Author Topic: GarageMote working - 1.6v on pins D4 and D5  (Read 1842 times)

sulterry

  • Newbie
  • *
  • Posts: 17
GarageMote working - 1.6v on pins D4 and D5
« on: February 16, 2015, 06:10:32 PM »
I've built the garage shield by hand and it seems to be working.  I get LED off when magnet is on open sensor, LED on when on closed sensor.  It blinks and pulses. I'm powering it with a 5v phone charger through gnd and VIN. The charger actually delivers 9v.  When I measure volts at pins of 8 pin connector I get 1.6v to VDD pins on sensors and 1.6v on OUT pins.  Volts on OUT pins go to 0v with magnets in place. The sensors are supposed to have 3v min VDD.  Is this going to continue to work?  I haven't tested relay.  Is there a reason I'm not getting 3.3v on D4 and D5?  10k pullup resistors are in proper positions.  Wires are routed correctly on board.  No solder bridges.  (I think, after checking numerous times. :P)

I've read many posts in the forum and looked at Arduino tutorial on digital pins.  I haven't a clue.

Thanks,

Terry S

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6326
  • Country: us
    • LowPowerLab
Re: GarageMote working - 1.6v on pins D4 and D5
« Reply #1 on: February 16, 2015, 10:24:37 PM »
You will notice the sketch loop will rapidly turn those sensors ON/OFF. So my guess is you are measuring the voltage with a multimeter that just sees a constant voltage, perhaps a RMS value which is not going to be 3.3V since the pins are ON only a fraction of the time. Does this make sense?
If you want to truly see what's going on, fire up your scope and look at D4/5.

Code: [Select]
#define HALLSENSOR1_EN        4
#define HALLSENSOR2_EN        5

...

//returns TRUE if magnet is next to sensor, FALSE if magnet is away
boolean hallSensorRead(byte which)
{
  //while(millis()-lastStatusTimestamp<STATUS_CHANGE_MIN);
  digitalWrite(which ? HALLSENSOR2_EN : HALLSENSOR1_EN, HIGH); //turn sensor ON
  delay(1); //wait a little
  byte reading = digitalRead(which ? HALLSENSOR2 : HALLSENSOR1);
  digitalWrite(which ? HALLSENSOR2_EN : HALLSENSOR1_EN, LOW); //turn sensor OFF
  return reading==0;
}

sulterry

  • Newbie
  • *
  • Posts: 17
Re: GarageMote working - 1.6v on pins D4 and D5
« Reply #2 on: February 17, 2015, 06:21:43 PM »
Thanks for the explanation Felix.  Very interesting.  I'm obviously not a programmer and only barely a hardware guy, but I like it. 

Scope? Somewhere in my future, hopefully, before the grave. :)  ( 73yo on 2/8)

Thanks Again

Terry S

TomWS

  • Hero Member
  • *****
  • Posts: 1925
Re: GarageMote working - 1.6v on pins D4 and D5
« Reply #3 on: February 17, 2015, 06:58:13 PM »