View Full Version : Analog to Digital to Computer
StellenboschStudent
01-12-2009, 03:13 PM
I have a device that generates voltage as it bends (only about 5mV) and I want to measure the voltage and then send it to a PC to log it and do some other stuff with the measurements.
Can anyone help me with some piece of equipment that I can buy/built to help me with this task.
I have sampled a couple of A/D converters from Texas Instruments with serial outputs, but where from there?
Obelix
01-12-2009, 03:14 PM
pic processor to measure the voltage and then serial through to pc
StellenboschStudent
01-12-2009, 03:20 PM
pic processor to measure the voltage and then serial through to pc
I figure that would be the easiest method, luckily I already have a PIC and a small PC board that has all the ports I will need, now I just have to write the code...
Messugga
01-12-2009, 03:35 PM
Not so easy, actually. 5mV is rather little and your PIC's built in A2D won't have the resolution required to get a meaningful reading. You'll have to amplify that voltage difference I'm afraid!
StellenboschStudent
01-12-2009, 03:38 PM
Not so easy, actually. 5mV is rather little and your PIC's built in A2D won't have the resolution required to get a meaningful reading. You'll have to amplify that voltage difference I'm afraid!
That is fine yes, i already have a non-inverting amplifier stage beforehand, so that is no problem. But I will have to check the what the PIC's A/D converter can handle.
syntax
01-12-2009, 04:50 PM
I figure that would be the easiest method, luckily I already have a PIC and a small PC board that has all the ports I will need, now I just have to write the code...
:) this sounds like a digital systems project....ur not an elec eng student are you????
The code is fairly simple, if you are not limited to a pic, i would recommend a micro instead. C is far easier than machine...
StellenboschStudent
01-12-2009, 04:53 PM
:) this sounds like a digital systems project....ur not an elec eng student are you????
The code is fairly simple, if you are not limited to a pic, i would recommend a micro instead. C is far easier than machine...
I actually am an elec eng student... Busy with my Masters, but haven't worked with PICs or code for more than two years... so just forgot most of the stuff.
Microprocessor has a bit to much functions, so I think a PIC will be enough.
greg_SA
01-12-2009, 04:58 PM
That is fine yes, i already have a non-inverting amplifier stage beforehand, so that is no problem. But I will have to check the what the PIC's A/D converter can handle.
I haven't worked with PIC specifically, but in general, the reference voltage for the A/D will probably be around 2.5V, so you'll need quite a lot of gain to get from 5mV to around 2.5V. The idea it that your full scale voltage on the sensor x gain = reference voltage.
I would look at an instrumentation amplifier - they are designed for high accuracy with large gains (for example an AD620 can go up to 1000x gain).
Regards,
Greg
Messugga
01-12-2009, 05:31 PM
I've worked with PIC a fair amount, though Atmel are my forte. Generally, the Atmel have a VREF pin for reference voltage for A2D, so that helps a bit. I just looked up the PIC16F88, which is a very nice little unit, although it may be somewhat overkill for what you need, but I see it also has a VREF (http://www.mcu.hk/GIF/PIC16F88.gif) so would work in a similar fashion, returning an A2D value as a fraction of 1024, which you can multiply with the known VREF in order to get the actual Voltage.
The A2D itself is normally 10 bit, so a resolution of VREF/1024.
The code should be a walk in the park and you get applications like Mikrobasic with complete libraries, that you can code in Basic, for instance.
In such a package, your ADC function would be thus: read_adc(x) where x is the A2D pin on the PIC.
Feel free to contact me if you want some help or sample files, I'm more than willing to share some source code if you need.