messed up analog/digital converter, reads pot, but not sensor
Matthew
Posts: 200
Hello.
I'm using an ADC0831 as my analog/digital converter. If I hook pin2 to my 10k pot, it reads it like a dream (from the debug menu, I can see all 256 values as I turn the pot). If I hook it up to my ultrasonic sensor, it reads eratic values even if I'm not moving the sensor. When I attach the ultasonic sensor to my voltmeter, it works perfectly and gives off an output voltage of 0.03-6.xx.
Could my problem be because the voltage goes over 5 volts? But shouldn't it still be able to read something like 3.xx or 2.xx volts?
I'm using an ADC0831 as my analog/digital converter. If I hook pin2 to my 10k pot, it reads it like a dream (from the debug menu, I can see all 256 values as I turn the pot). If I hook it up to my ultrasonic sensor, it reads eratic values even if I'm not moving the sensor. When I attach the ultasonic sensor to my voltmeter, it works perfectly and gives off an output voltage of 0.03-6.xx.
Could my problem be because the voltage goes over 5 volts? But shouldn't it still be able to read something like 3.xx or 2.xx volts?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
www.mrrobot.com/usonic.html
Pin1 is connected to the positive terminal of a 9v battery
Pin2 is connected to the negative terminal of a 9v battery
Pin6 is connected to Pin2 of my ADC0831
Thanks,
Matthew
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Also, I don't know that particular ADC, but I was using an ADC recently that had a pretty low input impedance, and its internal clocking was yanking my signal all over the place until I used an op-amp buffer on my sensor to lower its output impedance. Maybe your circuit would be helped by a buffer of some kind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
Mr. Robot didn't have any 5v sensors left, and they said they wouldn't be coming in for a few months.
·· You don't want to run the Stamp (And ADC) from 9V, you want them at 5 Volts!· What you want is a common-ground between the two power circuits.· All you need to do is connect the ground pin from the sensor to the ground·on the BASIC Stamp.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--
Thanks,
Matthew
Make sure your connections, especially the common ground are solid.· I can't count how many times I got erratic readings from and ADC or other device just because a wire in the breadboard was making intermittent contact.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--