I just built my first robot following the "First Robot" tutorial. The only problem I am having is with the Sharp GP2D120 IR sensor. When I run the code as per the tutorial (i.e. "readadc 1, b1" and "debug"), the values for b1 are displayed as:
123, $7B, %01111011, '{'
The readings do not change even if I put something in front of the sensor. Do those readings provide a clue as to what is wrong with my robot?
The columns are all saying The columns are all saying the same thing: 122 in decimal is 7A in hexidecimal which is 01111010 in binary which is ‘z’ in ASCII. To make your life easier you can just ignore all but the first column.
I reprogrammed it and I reprogrammed it and verified that it’s looping. The readings just don’t change. I did notice, however, that the reading is now down to 121 (first 123, then 122, now 121). Maybe this steady decrease is an indication that I received a defective sensor? Could I just be unlucky?
it’s possible that the it’s possible that the sensor is bad. have you tried another component, like an LDR? thats a super simple device that should give you a good idea if things are working at least with your code.
Unfortunately, I don’t have Unfortunately, I don’t have any other components to test with as I only bought the components that were required to complete the tutorial, nothing more. What’s an LDR? I guess I’ll test it out with that.
The housing of the Sharp IR The housing of the Sharp IR Sensors is conductive. If you put it on a metal chassis of your robot, it may cause this behaviour. Try to isolate the sensor from the chassis.
Try powering the sensor and reading the signal pin with a meter. If you have a variable voltage up to 2 volts or so with moving your hand in front of it, then the sensor is good.
Then check your connections to micro, common ground, correct input pin, etc.
The white wire is the signal wire from the sensor. The power and ground wires are elsewhere on the board (In a V and a G).
The blue lines are where I’ve soldered short wires between the points, to short them out. Only I’m nto sure they’re the right points. After reading the circuit board manual and the instructions on this site, I made a guess at that, but could well be wrong.
**I dont understand what all**<br><p>I dont understand what all those connections over on the analog pins are and I can`t make any sense of the manual. It has a schematic for a stamp like module but no diagram showing your boards pins and google is absolutely no help. Yay for blackbox hardware. I did find Frits walkthrough about that picaxe starter kit though. From the look of it you have connected the sensor cable to ground and the analog in to +ve which is why you have a constant 255.
Remove all the short blue wires and connect the white wire from the sharp IR to the centre pin instead of the hole.
Hey, thanks for the response. Although it turned out it was just my dodgy soldering skills on the signal wire. It works fine now! He’s been trundling around and exploring the house.