View Full Version : Analog Voltage to digital signal conversion
04-30-2007, 03:16 AM
I am very new to the wide world of microcontrollers, I bought the whole board of education kit and am doing quite well with all of the projects in the accompaning book, I am up to measuring rotation labs. I got into this for two reasons: one is just a personal interest (pehaps leading to a really neat hobby), the other is a school project. Although I would love to figure this out on my own in the learning process, but I bought this kit·too late and just don't have the time to figure this out on my own. I need to convert an analog voltage signal·(0 V to·about 2 V)·to a digital signal (actually three of them) to use in the microcontroller to perform a function. I know there are several ways to do this but am looking for a method that is simple.·A one purchased·part solution would be nice, but using radioshack or other components to build should not be a problem. Any suggestions or help would be greatly appreciated. Remember I am very new to this so be pateint with me. I am sure that this is a common application for these controllers so hopefully there should be a large knowege base about this
Thanks so much for any help you could provide.
04-30-2007, 03:28 AM
An analog to digital converter chip will do it or RCTIME for a software solution. You are not clear on what you want to get for an output so I can't tell you what to use.
04-30-2007, 03:50 AM
I have an accelerometer, which gives an output of a voltage (from 0 V to about 2.5V)·in time in three axises, I would like the microcontroller to monitor the voltage·output of the accelerometer. When a certain conditions are met it basically flips a switch. I hope this is more clear, of what I am trying to do.
04-30-2007, 05:11 AM
Depending on the timing you need RCTIME could do that on three pins in sucession.
04-30-2007, 05:39 AM
Am I correct here, the·RCTIME is the command used with charging and discharging a capacitor. This time to discharge leads to the voltage, resistance or whatever through formulas. There is a·"lab" on this in my book, for measuring resistance of a potentiometer that is done similar to this.·How would this be hooked up with a constant voltage. I am guessing you would use a transistor to charge and stop charging the capacitor then use a resistor instead of a potentiometer. I would have to buy a few more transistors.
You also mentioned a digital converter chip, I have been reading online about digital signals. Parallax sells one with four channels (http://www.parallax.com/detail.asp?product_id=604-00027) for about $9.00 this seams like it would work. What are the advantages to using this method? (probably more speed) I would have to familarize myself with the SHIFTIN and SHIFTOUT commands, but they don't look too bad to learn. I am leaning toward this route what do you think?
04-30-2007, 12:42 PM
I have an accelerometer, which gives an output of a voltage (from 0 V to about 2.5V) in time in three axises, I would like the microcontroller to monitor the voltage output of the accelerometer.
check the datasheet on your acellerometer again.
Most also have a PWM output that can be measured with the COUNT or PULSIN. All the Analog Devices units I have used, do, the Memsic units do, and whatever you are using might. If your analog setup schematic includes caps, it most likely does.
If not, there are ways to use RCtime to measure voltages. Rather than repeating other work, I'll just point you to: