How to make an ADC out of components?
Microcontrolled
Posts: 2,461
Hi,
I recently received a precision hall effect joystick that I'm wanting to use for the second version of my Stingray robot remote. The problem is: I have no ADC chips and I want to get this working ASAP. Does someone know of a schematic or code to read the voltage from the joystick without using an ADC? It is a 5V joystick, so I'll be using a resistor on each line.
Thanks,
Microcontrolled
I recently received a precision hall effect joystick that I'm wanting to use for the second version of my Stingray robot remote. The problem is: I have no ADC chips and I want to get this working ASAP. Does someone know of a schematic or code to read the voltage from the joystick without using an ADC? It is a 5V joystick, so I'll be using a resistor on each line.
Thanks,
Microcontrolled
Comments
So, the joystick outputs are a variable/varying voltage?
If you're really game to mess around a little... you could try "voltage to frequency -- V-to-F".
If you have some 555's (or, even better, 7555's) then you can make VCOs (voltage controlled oscillator).
The VCO from/in a 4046 would be even better, but you probably don't have any of those.
http://ecelab.com/circuit-vco-555.htm
http://www.555-timer-circuits.com/555-vco.html
http://www.robthefiddler.com/electronics-audio-diy/circuit-experiments/555-as-vco/
http://www.rayslogic.com/propeller/Programming/ADC.htm
@Cluso99 & Rayman: This is what I was looking for! Thanks! I'll give this a shot tonight since I have all of the components on hand.
Placement of the feedback resistor and caps right next to the Propeller pins is critical for a sigma-delta converter to work well. Putting them on a solderless breadboard, for example, will not work. 'Just a heads up.
-Phil
best regards
Stefan
Here are a couple of pics with the circuit from http://www.rayslogic.com/propeller/Programming/ADC.htm
I used some random caps and resisters, just use the values you need...
Click to zoom
PINOUT
1 = Prop output pin
2 = Prop input pin
3 = Input signal
4 = VSS
5 = NC
6 = NC
7 = NC
8 = VDD
I didn't solder the connections since I want to use these components for other purposes...
OK, so I've done the simple setup and soldered it directly to the board that I am working with very close to the pins. However, for some reason, I cannot get it to work. I run the ADC program included with the AppNotes and the value only changes when the joystick goes up, not when it goes down (I have not yet tested the other axes). I connected my Propscope to it and got the following, the flat part being when it is pushed up.
This is strange, because when I connect the Joystick output directly to the Propscope I get a nice curve when I move it up and down.
Can someone tell me what I am missing here? I followed the schematic on Rayman's site exactly, and built 2 circuits with the same results.
Thanks,
Microcontrolled
Here is an alternative suggestion for joystick control. The wii nunchuck and the wii classic controller both have joysticks and other buttons. Both are I2C. Both have cheap clones on eBay. The nunchuck also includes an accelerometer. The wii motion plus has a gyro and can be daisy-chained to the nunchuck or classic controller. Food for thought!
To your alternate suggestion: I've eyed those both before! I'm thinking about getting a cheap clone of the motion plus or the Nunchuck off eBay just for the purpose of using the accelerometer/gyro. I've used them before (but had to return them!) and they are very easy to work with.
I've also had a bad experience with a generic PlayStation 2 controller. The Prop could communicate with it but it only had 5-bits of resolution instead of the normal 8-bits.
I now avoid generic controllers.
Duane