Pages: [1]   Go Down
Author Topic: Pin 11 HIGH/LOW Seem Reversed?  (Read 685 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is my first ever Arduino project.  Trying to do the "Interactive Traffic Light" demo from the "Beginning Arduino" book, if anyone is familiar.  I've gone over the wiring a million times and am pretty confident I have it right.  I'm a programmer, but very novice with electronics, and brand new to Arduino.

Everything is working except the yellow LED on pin 11 seems reversed.  I tested it, by just sending HIGH/LOW to that pin only, and HIGH turns it off and LOW turns it on...  Is this an Arduino defect or could it be something else wrong that I'm just not finding after tracing my wiring repeatedly (which would be annoying, but I find it hard to believe this one pin is different...)?

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
and HIGH turns it off and LOW turns it on
If the LED is wired up so that the arduino sinks the LED current then this is how it will behave.
I have not seen the schematic so I don't know if it has been but it is not uncommon to do this.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply.  Odds are this is what's happening, as it's much more likely there's a flaw in my wiring than in the Arduino.  Can you explain what "sink the current" means?  I'm not sure what I'm looking for.  The link below is a picture of the same thing, with what seem to me as minor, nonfunctional, differences.  I'm going to go back over my wiring again though and see if I see anything different.

http://lh6.ggpht.com/-flG9Rh34ra4/TjO5TmLMk6I/AAAAAAAAC3c/JBwJ1O_Sr4k/IMG_20110730_142344_thumb.jpg
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thank you for your reply.  Odds are this is what's happening, as it's much more likely there's a flaw in my wiring than in the Arduino.  Can you explain what "sink the current" means?

There are two ways to power and light up a resistor/led string to a Arduino output pin.

#1   output pin > anode of diode > resistor > ground

#2   output pin > cathode of diode > resistor > +5vdc.

In number one if the output pin is high the LED draws current and lights up. The output pin is said to be sourcing current.

In number two if the output pin is low the LED draws current and lights up. The output pin is said to be sinking current.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks again for everybody's help!  I fixed it.  All the breadboard wiring was "mostly" right - the main problem was I had misaligned the ground and 5V pins, and had the ground plugged into 5V and the 5V plugged into 3.3V.  By reversing the LEDs, it mostly worked, but that yellow light's on/off states were reversed.  Finally saw that, fixed it, and reversed all the LED's and it works!

Just to be sure, it doesn't matter what side of the LED the resistor is on, right?  In my schematic it goes:

output pin > resistor > anode of diode > ground

It works, so I'm assuming the resistor works on either side, which makes sense, I just want to make sure I'm not missing anything.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It works, so I'm assuming the resistor works on either side, which makes sense, I just want to make sure I'm not missing anything.

Yes, it's a series circuit, so order of the two components doesn't matter. Just like a three cell D size flashlight, it doesn't matter which battery goes first.  smiley-wink

Lefty
Logged

Pages: [1]   Go Up
Jump to: