BS2SX to measure current unique problem almost solved please help.
hello everyone,
here is my problem. I am trying to use the following product and interface it to the basic stamp BS2-SX
http://www.allegromicro.com/en/Products/Part_Numbers/0713/index.asp
so far I have been able to hook up a computer through the ACS713 and measure the current with a multi meter and it compares to my clamp on ampmeter at about .7 amps which is great. my problem is i want to output the AC voltage from the ACS713 (in millivolts) to the BS2SX somehow so that the stamp can understand what is going on.
I tried the ADC0831 and hooked it up it works but only measures DC volts, my problem is how do i get all of this to work with AC?
The ACS713 measures the current of whatever is hooked up to it and has output voltage on a VOUT pin at 185mv/amp. for example i was measuring how much current a desktop computer was drawing and the ACS713 had about 120mv on its VOUT pin - so 120/185 = about .7 amp load the computer was drawing.
in this example i want to feed that 120mv AC voltage to the ADC0831 (or something similar) to have the stamp be able to read the voltage.
thanks a lot
steve
here is my problem. I am trying to use the following product and interface it to the basic stamp BS2-SX
http://www.allegromicro.com/en/Products/Part_Numbers/0713/index.asp
so far I have been able to hook up a computer through the ACS713 and measure the current with a multi meter and it compares to my clamp on ampmeter at about .7 amps which is great. my problem is i want to output the AC voltage from the ACS713 (in millivolts) to the BS2SX somehow so that the stamp can understand what is going on.
I tried the ADC0831 and hooked it up it works but only measures DC volts, my problem is how do i get all of this to work with AC?
The ACS713 measures the current of whatever is hooked up to it and has output voltage on a VOUT pin at 185mv/amp. for example i was measuring how much current a desktop computer was drawing and the ACS713 had about 120mv on its VOUT pin - so 120/185 = about .7 amp load the computer was drawing.
in this example i want to feed that 120mv AC voltage to the ADC0831 (or something similar) to have the stamp be able to read the voltage.
thanks a lot
steve
Comments
Google "precision rectifier". You'll be looking for a design with an op-amp which will compensate for the normal voltage drop across diodes.
In your case, a half-wave version will be fine as your loading into the ADC will be very light, requiring only a small amount of filtering. You can also go one step further and add a stage of amplification so the output will be 0 - 5 VDC, which the ADC will really like.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Peak detector circuits are available in abundance on the internet. Google op-amp peak-detector. National Semiconductor's op-amp datasheets are another good source for inspiration.
-Phil
i tried this and i'm getting the same result. am i doing something wrong? the debug screen is showing the voltage and its bounding all over the place.
http://www.discovercircuits.com/DJ-Circuits/peakdet1.htm
here is the code:
'{$STAMP BS2SX}
ADdata CON 2
ADclock CON 1
ADcs CON 0
result VAR Byte
mvolts VAR Word
Initialize:
HIGH ADcs
Main:
GOSUB Read0831
mvolts = result */ $139C
DEBUG HOME
DEBUG "adc... ", DEC result," ", CR
DEBUG "volts... ",DEC mvolts DIG 3, ".", DEC3 mvolts
PAUSE 100
GOTO Main
END
Read0831:
LOW ADcs
SHIFTIN ADdata,ADclock, MSBPOST, [noparse][[/noparse]result\9]
HIGH ADcs
RETURN
If you really are reading 9 bits of data, you probably want "result" to be defined as a WORD, and not a BYTE. A BYTE can only contain 8 bits of data.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What does your voltmeter measure at the output of your peak detector? This will help to isolate the problem as to whether it's hardware or software. If you get a steady voltage reading, then it may be your code. If not, it's more likely to be the peak detector circuit. If you have an oscilloscope, use it instead of the voltmeter, since some voltmeters have rather long sample times and may not reflect any jitteriness in the signal.
-Phil
i am getting the same results with my multimeter with and without the peak detector. the Vout with NO LOAD is 0v AC and about .5vDC which is expected, the data sheet says you will see .5vDC on the output pin with no load. i add a load and i switch the multi meter to AC and i start to see exactly what i'm supposed to which is about .130vAC and the DC goes to about .540 but that means nothing to me.
i'm using this peak detector http://www.discovercircuits.com/DJ-Circuits/peakdet1.htm
and this IC from allegro micro http://www.allegromicro.com/en/Products/Part_Numbers/0713/index.asp
basically i want the stamp to see the .130vAC just like the meter tells me in AC mode. does the .540 vDC help me at all?
when hooked up to the stamp with the peak detector and the ADC (using my code above) i see about .510 vDC (which is right) but as soon as i put a load on it the numbers start bouncing all over the place. im hoping for the numbers to change to about .130.
thanks
steve
In the case of short spikes, or even out-of-phase voltage and current, and if what you're really interested in is power consumption — not just current draw — a DC current sensor will be inadequate. If that's the case, I may be at a loss to help, since my experience with power factor considerations is nil.
-Phil
thanks again.
steve