Go Down

### Topic: Is arduino equiped with AC protection? (Read 5581 times)previous topic - next topic

#### durkinnj

##### Dec 30, 2012, 07:40 pm
I have an input coming from a car. It goes from 0V to roughly 18V at max. I was hoping to build a simple voltage divider using about 500k and 2M (arduino seeing the voltage across the 500k which is about 3.7V at max which would be plenty for analog reading). But there is one problem. There is roughly 25V of AC riding on that DC and I don't know what frequency. All I have is a basic multimeter. What should I do? Should I block the AC or use a diode somehow or does the arduino have something built in that can help me with this?

Thanks! (:

I tried to find a schematic of the arduino UNO or MEGA (I HAVE BOTH) but it looks like this site is down?

#### winner10920

#1
##### Dec 30, 2012, 08:01 pm
If you have just a 1M resistor you could get away with using the internal protection diodes and directly hook it up to your source, now this is just technically and no one really like to do this, your best off with using external clipping diodes to protect from >5v and <0v
There will also be resistors involved and the values and wattage of the external diodes will vary depending on your needed frequency response

#### Magician

#2
##### Dec 30, 2012, 08:16 pm
You can't measure anything till you get rid of AC.  Simple RC is the easiest way. Resistor limiting current below 1 mA , and you o'k with internal diodes build in AVR chips.
Only 1M too much, analog reading requirement < 50 k. Even with 20 k in voltage divider it save to overvoltage input up to : V = R * I + 5V = 20k * 1 mA + 5V = 25V

#### durkinnj

#3
##### Dec 30, 2012, 09:05 pmLast Edit: Dec 30, 2012, 09:08 pm by durkinnj Reason: 1
Not sure if I completely understand either of you. 1M not 1M diodes not diodes. What should I do? Are you saying limiting the current bellow 1mA will be good enough to run the source straight into the arduino using a voltage divider? And you are saying that 1M is limiting it too much? So I should use like a 5k and a 20k for the volatge divider?

#### JimboZA

#4
##### Dec 30, 2012, 09:08 pmLast Edit: Dec 30, 2012, 09:30 pm by JimboZA Reason: 1
Forgive my ignorance, but what does it mean for 18VDC to have 25VAC riding on it?
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### dhenry

#5
##### Dec 30, 2012, 09:29 pm
Quote

Is arduino equiped with AC protection?

Yes: the pins get burned up, protecting the core.

#### durkinnj

#6
##### Dec 30, 2012, 09:35 pm
Okay. My original question is answered. The core will be protected. That is good in case I screw something up. an AC waveform can ride on a DC level. If you combine 5V DC and 20V AC you will have an AC waveform with the 0V point at 5V. It basically just shifts the waveform up. Although I can't see the waveform I can measure both DC and AC current using a multimeter.

#### JimboZA

#7
##### Dec 30, 2012, 09:42 pm
Quote
If you combine 5V DC and 20V AC you will have an AC waveform with the 0V point at 5V. It basically just shifts the waveform up.

OK, but why would we do this?

Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### durkinnj

#8
##### Dec 30, 2012, 09:54 pm
Honestly, I forget that part. I'm sure it has some applications but I am unaware of any right now. I didn't do that though. That's just what I have to work with.

#### winner10920

#9
##### Dec 30, 2012, 10:02 pm
Ah missed that analog read part, you want to read that full 18v spectrum? And don't trust your meter, dc and ac voltage reading aren't perfect especially if both are present at the same time, it could be just pulsating dc not ac or a more complex waveform, you really need to oscope it to know what you are dealing with, you could be trying to solve a nonexistent problem, either way a voltage dividerlike he suggested would be fine, and if you are unsure a 5.1zener used correctly will ensure the voltage after the divider is between 0 and +5v
Basically the zener cathode (+ or banded end) will go to the input, cathode to ground and you will be protected
This would be after your voltage divider

#### winner10920

#10
##### Dec 30, 2012, 10:04 pm
The offset is used often in single supply audio circuits, the signal is amplified around the offset to amplify the full range of the signal and then the dc component removed before the output

#### 3dprinter

#11
##### Dec 30, 2012, 10:23 pm
When you write "AC protection" most people think of mains voltage (110-240V depending where you live). No, the Arduino has no protection against mains AC. It will simply emit a little cloud of magic blue smoke, possibly accompanied by a loud "pop".

You meant to ask if an AC signal (where the peak voltage is below 5.5V) on an input pin will damage it. No, no damage at all. It does not matter if it is a mixture of DC and AC. The problem is, can you get a usefull measurement?

On a digital pin, you will se the pin input change between HIGH and LOW at the frequency of the AC signal. If the signal is irregular it will switch just as irregularly, but be more often HIGH than LOW (due to how the digital input threshold is done.). On an analog pin you might expect the "DC average" over the time the port samples, but the way it does that, if the AC signal is in the tens-hundred-Khz range, you get essentialy a random value.

As others have said, if you want the DC component of your mixed signal put a capacitor in series and a resistor to ground, after your voltage divider, and you get some reasonable value for the DC part. Look up RC filters for usefull values. (The multimeter basically does this when you switch to AC measurement)

If the frequency of the AC is low enough you can measure the length of the AC periode on  a digital port. If it is real slow, you can sample often and get the wave form.

#### dc42

#12
##### Dec 30, 2012, 11:11 pm

I have an input coming from a car. It goes from 0V to roughly 18V at max. I was hoping to build a simple voltage divider using about 500k and 2M (arduino seeing the voltage across the 500k which is about 3.7V at max which would be plenty for analog reading). But there is one problem. There is roughly 25V of AC riding on that DC and I don't know what frequency. All I have is a basic multimeter. What should I do? Should I block the AC or use a diode somehow or does the arduino have something built in that can help me with this?

You can do exactly as you have said, but also add a capacitor between the Arduino pin and ground to filter out the AC. The value of the capacitor you need depends on the lowest frequency of the AC.

You will lose some of the accuracy of the ADC if you use such high value resistors. On the other hand, if you reduce them too much then the current may be too large for the pin protection does if the voltage exceeds its normal range. I suggest 100K and 400K, or 50K and 200K.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### durkinnj

#13
##### Dec 30, 2012, 11:31 pmLast Edit: Dec 30, 2012, 11:34 pm by durkinnj Reason: 1
Is it possible for the meter to falsely read DC when it is really AC? I found a wiring diagram online and it says the wire I am measuring is AC. Perhaps they didn't note that it was an offset AC signal or perhaps my multimeter is giving me false DC readings because the frequency is so low/high?

Also, Should I just trial and error with the capacitor sizes since I don't know the frequency of the AC signal? If so, where should I start? I'm guessing a good starting place would be a standard 60Hz.

I've got a 200k and a 47k on a breadboard right now. Am I doing a low pass filter to block everything above say 40Hz?

#### dc42

#14
##### Dec 30, 2012, 11:45 pm
Try 1uF or 10uF.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up