• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1708
  • Last Modified:

Block AC voltage on DC signal line

Im not even sure this is the proper place for this...
I have a sensor that outputs a DC voltage I can measure.  It also has a little bit .750ACV on the signal wire.  My microcontroller's ADC does not like this AC noise.
How do I go about cleaning the signal.  choke/inductor?  How do I know what size to use?
the sensor has a 0-5VDC range.
0
livegirllove
Asked:
livegirllove
  • 14
  • 11
1 Solution
 
wire_workerCommented:
Inserting a capacitor between the supply line and ground is usually the easiest way to remove AC noise.
If the AC is at power line frequency e.g. 50Hz or 60Hz then you should use a large value electrolytic capacitor. E.g.  47uF or 100uF rated at say 20 volts. That will be physically small due to its low voltage.
If the AC is at much higher frequencies let me know and I'll explain more.
0
 
livegirlloveAuthor Commented:
how do I measure the frequency?  Does it require an osilliscope?

I have a 12v supply powering the sensor.  The sensor is a TDS meter which measures salt in water.  It uses AC to keep them leads from getting buildup from electrolysis.  This is then converted to a DC range of 0-5v.

My microcontroller ADC (Arduino) is conected to signal wire and the arduino ground is connected back to the 12v supply ground to complete the loop.
0
 
livegirlloveAuthor Commented:
another thought.  Im powering the 12v from a computer PSU I converted to a standalone power supply.  I just had the thought that the PSU is only putting out DC voltage right?  So it is already being converted to AC and then back to DC.
Not sure thats relevant but thought i'd mention it.
0
What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

 
livegirlloveAuthor Commented:
I dug out a few 100uf 16V 20% Xicon Aluminum Electrolytic Capacitor from another project I didnt ever start ;)
So it goes parrallel with the signal and ground wires?
 livegirllove-456662.flv
0
 
wire_workerCommented:
Hi, I'll answer your last question first, then come back to the others later.
Yes parallel with the signal and ground wires. the negative of the capacitor goes to the ground, the positive to the signal wire.
0
 
wire_workerCommented:
OK, so it would seem the AC frequency on TDS meters is going to be >1kHz.  A CRO would certanly tell you or the frequency measurement mode of a Digital Multimeter (as long as the frequency was < say 500kHz which it sshould be)
The main reason I needed to know the approx frequency is that Electrolytic capacitors only have low impedances at lower frequencies because they also posess parasitic inductance.
If you measured the frequency it would assist me, but first up try the electrolytic.  If it doesn't work we either change its size, or get a different style cap. such as a polycarbonate or tantalum.
0
 
livegirlloveAuthor Commented:
Ok ill follow up on your last post in a bit.
For now I did a quick test.
No Cap:
DC = .547VDC
AC = .748VAC

With 100uf cap:
DC = .176VDC
AC = .048VAC


So I took a big drop on my DC side - Bad
but the AC went way down - good
my microcontroller isnt bouncing nearly as badly form noise - good
getting closer. :)
0
 
livegirlloveAuthor Commented:
ok I googled and figured out what a CRO is.. i think
Cathode Ray Oscilloscope/Oscillograph
I dont have one yet.  I just havent had a good enough excuse to buy one for my newish hobby.

My multimeter doesnt do frequency it looks like.
http://www.ryobitools.com/product_manual/file_url/469/RP4020_664_trilingual.pdf
0
 
wire_workerCommented:
Your TDS meter isn't able to cope with outputting all that alternating current through the capacitor.  try a smaller cap between 0.5uF and 10uF to reduce the current, and preferably a tantalum if you have one.  This unfortunately will not reduce the AC amplitude as much, but it should greatly reduce the loading effect and keep the DC signal up to where it should be.  BTW, with that much AC on your output I wouldn't be trusting your DMM for accurate DC readings.  A CRO would be the definitive way to see what is actually happening to the DC and AC components of that signal.

Now I look at your two signal amplitudes, unfiltered the peak AC amplitude is actually larger than the DC signal by a factor of (0.748 x 1.414)/0.547 = 1.9 !!   That is a HUGE difference (not the "little bit" you first wrote about).

Can you give me the model number and brand of your TDS meter ?
0
 
livegirlloveAuthor Commented:
Its not mass produced.  I had a guy adapt one for me.
heres the basics on it.
I am the guy that provided that sensor to jointtech. I can tell you little about the design. Basically circuit generates 2vac (adjustable) through graphite sensor tips 1cm apart .AC voltage is used primerally in order to avoid scaling arround the sensor tips(otherwise it will act as a shorted battery) in the water. AC signal gets amplified and converted to dc output through 4 operational amplifiers . The original design was ment to provide 0 to 200mv full scale 0 - 200umhos. Per jointtech's request i ampified the signal to 0 to 5v 0 - 5000umhos full scale by changing resistor values or the gain. Initially i tried 0 -5vdc for 0-3000umhos full scale , however did not perform well since linearity was tampered. I ran some tap water through it , checked with an HM ppm meter and calibrated unit to read the same. Then i added salt and recorded readings .Both units read the same value and voltage matched (for every 1000umhos  1volt).Based on what i read and problems that i see jointtech having are as follows. True i did my measurments with just a voltmeter, but i wonder and im sure this is caused by noise. One way to check is instead of DC turn the dial on votmeter to AC . If you see ac voltage ,thats the noise youre reading. Now i am not sure how ardunio responds to ac/dc analog signals and noise. If it does not have the noise elimination or ac isolation then further design changes are needed, because jointtech is not being able to read or register the values that voltmeter shows. As far as dc voltage being lower then expected, i think its due to pwer supply differences, i use 12v 500 ma, but my true output was 13.1 volts. op amps require +12 and -12 volts . In this circuitry a chip converts +12 to -11 by losing 1 volt from supply voltage which effects on calibration and span if different values used but it should work never the less. I will see how i can make some changes.

heres a link to my discussion on the Arduino forums.  I havent updated it since testing.  (they are harsh, grumpy electronics geniouses over there)
http://arduino.cc/forum/index.php/topic,59884.0.html
0
 
wire_workerCommented:
OK, I see the history now.  If the sensor guy/mfg can give you their cct diagram it would be helpful, otherwise I'm just poking in the dark somewhat.
Instead of just putting in a cap in parallel, put in an RC single pole filter. which lookks like thie

                                        R1
<TDS Meter out> 0------/\/\/\/\---------o <Arduino_in>
                                                  |
                                                  |
                                                 == C1
                                                  |
                                                  |
                                                GND

On the assumption that the Arduino input impedance is >500kOhm, choose R1 between 500ohms and 10kOhm so as to not reduce the TDS output by too much (from the resistive voltage divider)
Also assuming the output impedance of the TDS meter is low-ish (e.g. <100Ohms), choose C1 to satisfy a corner frequency of F where F<(Fac/10) where Fac= the AC frequency from the TDS meter.

F=1/(2xPIxR1xC1)

Now you can see why Fac is important to know, along with the schematic of the TPG meter
0
 
livegirlloveAuthor Commented:
Excellent.  I need to make a run to Radio Crap now and pickup some parts.  I only have these 100uf caps here.  
Ill see if I can get the schematic from him.  I suppose if I have the circuit I could build it myself and cut him out...  Not that I would but.. I probably wouldnt give it up ;)
If they have a scope i may just buy one.  
0
 
wire_workerCommented:
Scopes are expensive !!  Just ask the designer what frequency they use.  BTW one big problem I just noticed is that your DMM only reads AC up to 400Hz !  So if the freq. is baove that you will get attenuated and inaccurate readings from your DMM.
0
 
livegirlloveAuthor Commented:
whats expensive is all the time I dont work on my real business because im tinkering with my toys that I think are going to make me a million dollars ;)
So if a $400 scope saves me 8 hours of googling and tinkering and running to radio shack then I just profited $400 haha.  My wife doesnt approve of that reasoning but it gets me my toys.
I see a few arduino scopes as well.  My next project maybe...
http://accrochages.drone.ws/en/node/90
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285785582
0
 
livegirlloveAuthor Commented:
I get 4.629 - 4.699 Khz on my new DMM.
http://www.kleintools.com/instructions/pdf/MM2000_Digital-Multimeter-TrueRms-LowImpedance-Instructions.pdf

Scopes are way to much and theres so many options I got lost.  A task for another day.
0
 
wire_workerCommented:
OK, thanks.  I told you scopes were expensive!!!

Before I do the calculations it would be really helpful if you can get the cct diagram of at least the output stage of the TDS meter so I can determine the max output current and the output impedance.  Also what is the Arduino IC you are using as I need to lookup the input impedance of the ADC.

Finally, double check the AC and DC amplitudes you measured above with your new DMM which can measure AC up to 10kHz.
0
 
livegirlloveAuthor Commented:
Hes not wanting to give up the circuit...  He did send me an email today saying that he seems to have fixed it using just a 25uf cap.  He hasnt replied back on my question of where he put it.  He has another unit hes modding for a final test.  Hopefully i'll have an update today.  

As far as this question goes I dont want to keep you hanging around for nothing as it seems without having the cicuit its a crap shoot on fixing it.  And it looks like hes going to be able to fix it for me anyway.
On the other hand I would like to know how to do this in the future.  
Since you gave me the general info on what I would need to do I think for now I'll close this and award points.  
I will update on the status in case you (or posterity reading this) cares.  
0
 
wire_workerCommented:
Thanks.  Even though you awarded the question, I'd still like to assist with a more completed solution too. (I know it won't give me any more points, but it shouldn't take me too much longer)

I'm not after the entire schematic.  In fact just ask him "what is the output impedance of the output signal (e.g. 10ohms, 100ohms ?).  and what is the max current able to be drawn from its output.  e.g. 10mA, 30mA ?"  The former will help me tune the cut off frequency corner, the latter to ensure you can use a passive LPF without loading the TDS' output down, rather than use an active one which requries an op-amp but will load the TDS' output VERY little. hopefully the passive LPV I showed above will be all that is required.

The goal is to reduce the AC amplitude to below a level that interferes with the Arduino's operation and ideally one which reduces the amount of processing in the arduino.  The AC will never be reduced to zero amplitude.  If for example we reduce it to 50mV peak to peak using a single pole LPF I described above, but you still wanted to reduce it further, it should be a simple thing to average out many samples of the ADC in the arduino code and remove the remaining ripple that way.  Averaging in maths and using a LPF in H/W are similar operations.
0
 
livegirlloveAuthor Commented:
OK let me see if I can get that info from him.  He is sending me the working unit with AC filtered and also a kit with the PCB and parts and Im sending this one back to him to fix.  I opened it up to add on the cap where he said and its just to small for my fingers and iron to work with.
0
 
wire_workerCommented:
OK, if his fix works then my proposal is redundant and at least you have learned some things !
0
 
livegirlloveAuthor Commented:
Well ...output impedance is 20kohm, current 40ma.Provided you have the load resistance ,in this case  the ardunio.
I determent the impedance by connecting 10k resistor as a load and did my calculations
0
 
wire_workerCommented:
OK, so now what is the input impedance to the analog input pin0 of the arduinio board (spec sheet for arduino would tell you that).  I wasn't able to see the part number on the other forum you are cross posting this to.
0
 
livegirlloveAuthor Commented:
its megaohms from what I remember.  
from the arduino site:
Pins Configured as Inputs
Arduino (Atmega) pins configured as INPUT with pinMode() are said to be in a high-impedance state. One way of explaining this is that pins configured as INPUT make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This makes them useful for reading a sensor, but not powering an LED.

0
 
wire_workerCommented:
I'm placing F_3dB at 1Hz  This assumes you don't want to see salt concentration changes faster than say once every few seconds. (if that's not right then you can up the cutoff frequency yourself with the formula I gve above).

Anyway, you will find by doing the maths that a value of R=20kOhm and C=3.97uF will give you 1Hz.  Now we need to select C from a standard table. closest is either 3.3uF or 4.7uF.  If you don't have either of those present, just grab one between 1uF and 10uF. Note with the formula above you must use R=20K+20K =40K, because I assumed the output impedance is 20K.

I am assuming the input impedance of the arduino's Ain is no less than 10MOhm which will cause a loading of (10e6/(10e6+40e3))=0.5% i.e. it will cause the reading to be 0.5% lower than what it actually is.

Please double check my maths so you don't purchase the wrong parts.
0
 
livegirlloveAuthor Commented:
haha. I bought 4.7 while I was at frys.  I will give this a shot and post back with the results.  thanks for taking the time to explain it.
0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

  • 14
  • 11
Tackle projects and never again get stuck behind a technical roadblock.
Join Now