Question on Digital Input Values

My first project with the Arduino is to flag an LED on when the input from a Sharp IR sensor goes low (GP2Y0D810Z0F). I've written the most basic of programs to get the input and using an if statement, but it doesn't seem to be working. The LED is either always on or off leding me to believe that the translation of the input is not working.

My question is - what value does the input have to be for the Arduino to assign a HIGH or LOW value? the input from my sensors are either 5.6V or 1.05V. Will this translate to HIGH and LOW or do I have to regulate the input somehow?

Thanks.

First off, never apply more than 5v to any arduino pin. Secondly, the atmega datasheet for your chip will specify the minimum and maximum voltages.

As I'm on my iPod right now, I can't look it up for you, but a simple google search should suffice.

Normally an input will be seen as LOW if smaller than 3 volts (approximately) and HIGH if above 3 volts. Your sensor should produce clean HIGHs and LOWs. Best is to post your code so we can have a look over it.

According to the data sheet the 168 the minimum you can have a logic 1 is 0.8 of Vcc. So if the arduino is running at 5V then this is 4V. The highest a logic zero can be is 0.2 of Vcc so that puts it at 1V for a 5V arduino.

So 1.05V might be just too high to be seen as a zero.

According to the data sheet the 168 the minimum you can have a logic 1 is 0.8 of Vcc.

Mike, which datasheet are you using?
I'm looking here:http://www.atmel.com/dyn/resources/prod_documents/doc8271.pdf, at page 316/562, and it says for Vcc of 2.5 to 5.5V, a low has a maximum of 0.3Vcc, and a high is 0.6Vcc minimum.

Yes sorry I was reading the 1.8 - 2.4 Vcc line. :-[

The point is his sensor output does not go low enough to register as a logic zero.

The fact that you are getting 5.6V for a HIGH implies that you are using a separate power supply for your IR sensor.

If that's true, be sure to tie your grounds together - after you find a way (diode in series?) to drop the 5.6V to ~5V.

That darn ground wire will get you every time! Yes, I'm using a separate power source. Otakon2K - you're right it's 3V. I found that on the reference section today.

I made a wiring harness from an R/C receiver switch assembly, and six male servo leads which will hold my six sensors. I connected all of the power lines together to power the sensors from a 6V input through the switch. I separated the signal output lines and will use them with the Arduino to help control the robot's motion.

The platform....My old E-MAXX. Can't wait to get this together.

Thanks for all the great input here. will post pics soon.

BMag

By the way, a 2K resistor takes the signal input of 5.63V down to 5.11V High / 0.97V Low. Should I take it lower than that?

BMag

Where are you putting this resistor?

Ohhhhh! I accidentally put 24 V in a Digital input (I know is a big mistake). jejeje.... My Arduino Diecmila does not start and the light power will light a point and stops. Can I do something? Or I sould buy another Arduino?

Thank you!

Buy another.
I don't use mini/nano when developing, so that if I do fry the MCU's tiny little mind, I can remove it from the socket and replace it. Much better than having to buy a new board, or trying to replace a surface mounted part.

Ok!!!

thank you very much!!!