Let's Make Robots!

arduino IR sharp 2Y0A21 (SOLVED)

hi guys,

 

i.ve been googling and searching around for ages now but cant find why my sharp ir sensor gives a standerd return of 300 in the display of serial monitor..

when i put my hand in front it wil display a number based on the distance of my hand between an int of 200 to 600 and sometimes a little more..

 

do u guys know how this can be happening. because my arduino now thinks he's seeing an object and returns 300 while in real life my arduino is facing notin but air..

 

thnx nick

Comment viewing options

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

thnxx all, i fixed it by addin a 10k resistor. my default return of the mesurement of air is now rated at ~90 now i am able to use distances between 300 and 100 agian =D got my robot workin and will place him as soon as possible at this website, only problem is that batterys are empty of the motor, soo it just worked well and then my battery is empty. anyway thnx alot u wil be able to see my first sucsesful avoidin robot sooon :D

thnx alot all!