Pages: [1] 2   Go Down
Author Topic: Is arduino equiped with AC protection?  (Read 1752 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2602
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: December 30, 2012, 03:08:15 pm by durkinnj » Logged

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 105
Posts: 4658
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Forgive my ignorance, but what does it mean for 18VDC to have 25VAC riding on it?
« Last Edit: December 30, 2012, 03:30:21 pm by JimboZA » Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
   
Is arduino equiped with AC protection?

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

Offline Offline
Full Member
***
Karma: 0
Posts: 125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Johannesburg. UTC+2
Online Online
Faraday Member
**
Karma: 105
Posts: 4658
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Full Member
***
Karma: 0
Posts: 125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 33
Posts: 1225
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Full Member
***
Karma: 0
Posts: 125
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: December 30, 2012, 05:34:46 pm by durkinnj » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try 1uF or 10uF.
Logged

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.

Pages: [1] 2   Go Up
Jump to: