Let's Make Robots!

Low and High are reversed?

Hi guys, something pretty weird happened to me...

I'm using a 18X project board. When i got it, no problem, i hooked up a led with a 330Ohm resistor, a "high 0" turned the LED on, "low 0" turned it off.

As i wanted to use servos, i put the darlington off the board, and replaces it by 330Ohm resistors. Servos work, no problem, but i hooked up a LED (without additional resistor since there are now at the darlington place), and as soon as i power the board, the LED is on. If i want to turn it off, if have to send a "low" command, and to turn it off a "high" command...

But when i'm using servos, "servo 1, 225" makes the servo work, and as it's a continuous rotation servo i send a"low 1" to stop it... and it works Ô_ö

I'm sure there's a rational explanation, but right now i can't figure it out...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I don't know what you've done but you ALWAYS!!!! need a resistor in series with a LED. I don't have any of the starter boards as I make my own boards. All I know is that blue smoke lies in wait around the corner.

Read Rik's blog on "Smoke Emitting Diodes" while waiting for the smoke to errupt.

Yes I do know i need a resistor, when i said that i didn't add another resistor, it's because there's already one in series where the darlington was... exactly like that :

 how_20to_20start_20a_20robot_html_2060dd0.jpg

from the start here tutorial...

Sorry, I misunderstood.

The only other possibility is if you have connected the LED to the +5V instead of ground so that low turns it on and high turns it off.

Use a multimeter to test the voltage both sides of the LED and the resistor.

My circuit is like that :

Output pin ---- resistor ---- LED ---- V+

before it was the same, but with the darlington before the resistor...

 

[Edit] : i still don't have a multimeter, but i know i must get one...

If you previously used the darlington then it would invert your logic.

A Darlington inverts the signal output from the PIC.

The LED has one side connected to V+, the other must be heading towards ground in order for current to flow, to light the LED

A High from the PIC turns on the darlington transistor, which pulls-down/conducts/provide a path to ground for the current to flow through the LED from V+ on it's other side. When just running connected to the PIC pin, it has to go low to provide a path to ground. As Oddbot said, there should be a resistor in there somewhere whether the LED is connected to the darlington or the PIC pin. I think you have one in both cases (darlington or not) but it isn't entirely clear.

Thanks guys, it's a pretty useful information!

Sorry if i'm not really clear, i try to do my best in english, i think i speak better thant i write, especially about all those technical things... anyway, i indeed do use a resistor in both cases.

 So my problem isn't really a problem, it's normal... i just have to take that in consideration for my next programs (i actually already do, as i my first two lines are now "low 3" and "low 4"...)