I'm new to electronics and I have done a lot of research on how to protect my arduino input from electro static discharge, but I need to use a voltage divider to lower the voltage from max 12V to the switches I need to sense to voltage allowed by the ATmega, which would be max 5 volts on digital input.
I will be using shift register to multiply my input, I will have 16 switches to detect they should all should be protected circuit and the voltage I want to use is 12 volts because I'm going to have somewhat long runs of cable and I want to make sure I have enough voltage to sense.
Can someone help me with the schematic and values of components that I need to achieve this? I which I can do that by myself, but I'm in over my head a little bit...
Here is a little summary of what I need.
Voltage from the switches : 12V- Need ESC protection- Need voltage divider down to 5V- Will be using shift register- Will have 16 switches
I want to use is 12 volts because I'm going to have somewhat long runs of cable and I want to make sure I have enough voltage to sense.
How far? With normal "high impedance" signals you shouldn't get any voltage loss over a long run. You only get a voltage drop with (relatively) high current and (relatively high) wire resistance (Ohm's Law). That can be a problem when transmitting power but rarely when transmitting signals.
A bigger problem with long-runs is usually noise pick-up. You may be able to filter that out (with a capacitor) but a low-pass filter can mess-up your multiplexing (depending on the filter and multiplexing speed). in some situations higher voltage can help with noise too (higher signal-to-noise ratio) but I wouldn't worry about that before it happens.
Can someone help me with the schematic and values of components that I need to achieve this? I which I can do that by myself, but I'm in over my head a little bit...
If you are using a voltage divider, just add the diodes (at the Arduino input). If there is no voltage divider add a series resistor to limit the over-voltage current (see [u]this page[/u]). The diodes (with a resistor) will add some ESD protection but depending on the "size" of the static discharge it's hard to know how much protection you need.
How far? With normal "high impedance" signals you shouldn't get any voltage loss over a long run. You only get a voltage drop with (relatively) high current and (relatively high) wire resistance (Ohm's Law). That can be a problem when transmitting power but rarely when transmitting signals.
It can be more than 300 feets, but if I understand correctly, since I'm not sending power simply signal I could get away with 5V directly and not worry with a voltage divider...
A bigger problem with long-runs is usually noise pick-up. You may be able to filter that out (with a capacitor) but a low-pass filter can mess-up your multiplexing (depending on the filter and multiplexing speed). in some situations higher voltage can help with noise too (higher signal-to-noise ratio) but I wouldn't worry about that before it happens.
The multiplexing can be done very slowly, Arduino is going to simply monitor the state of the switch, no interrupt is necessary.
The diodes (with a resistor) will add some ESD protection but depending on the "size" of the static discharge it's hard to know how much protection you need.
I just need basic ESD protection since the cable are so long and the can pickup a static starge, I don't expect to be protected by direct lightning hit, but indirect lightning hit would be desirable, since all those cables will be outside.
No the switch does not need to be sourced at all... They are simple momentary switch.
Here is my crude schematic, without any filtering or protection...
You can see that the switches are very simple (oups forgot to connect them), you see the point. The whole system is going to be a little more complicated, but I'm trying to figure out this part... Protect Arduino from the harsh of the switch, which will most likely get ESD really often. Most of the time the switches are going to be closed circuit. I need to monitor when they open...
Edit: Took down the image since it had bad information...
I need to read the state of 16 switches that can be very far from the micro controller, 300 feets and more some times. The cables will be run outside.
I am worried about lightning (indirect hit) destroying my micro controller since all those long wires to the switches would act as giant antennas. I have seen network switches being destroyed by a close range lightning bolt, indirect hit but really close. Where the network cable were running outside underground.
I need to use shift registers (input and output) because I need to monitor 16 switches and control 16 LEDs based on the state of those switches. I don't need fast reaction between the moment the switch is released and the moment the LED is lit. So I can take my time reading the states of the switches and changing the state of the led...
I will be using a Dragino shield also so some of the pins are unavailable.
That's all I need to do really, monitor the switches give a feedback using LED and report to a webserver using the Dragino. Making sure that the circuit is protected enough so it will survive monitoring those switches.
FrAllard:
I just need basic ESD protection since the cable are so long and the can pickup a static starge, I don't expect to be protected by direct lightning hit, but indirect lightning hit would be desirable, since all those cables will be outside.
Then dont try to invent your own lightning protection, unless you are really sure what you are doing.
Use something like a telephone socket to connect the outside wire. Telephones have long cables outside and thus lightening protection is essential. Its normally built into the master socket at the point of entry into a building.
Use something like a telephone socket to connect the outside wire. Telephones have long cables outside and thus lightening protection is essential. Its normally built into the master socket at the point of entry into a building.
Thank for the suggestion, I'll look into it for sure. I'd rather have it build into the circuit though...
Lightning protection has only one goal: don't set fire to your house. If you get a close hit then no amount of protection will save the electronics.
ESD protection is still able to save your equipment from static electricity strikes caused by nylon carpet or whatever. There's a "human body model" that defines specific impulse voltage/time/energy caused by a person with a static charge touching your input pins. Most ESD protection devices are focussed on this type of event. That's what the protection diodes inside the 328P are there for.
With a voltage divider on the input, the top resistor in the divider acts as the primary protection. Any fault occurring outside the box has to push current through that resistor to damage things inside the box. Usually the protection diodes on the 328P can shunt enough current that the voltage drop on the resistor is equal to the fault voltage.
If it's possible that the input lines can accidentally touch 120-240V (like they are in the same conduits) then you have to treat that as your fault voltage. Then work out the current through the resistors which must be carried by the protection diodes.
TVS diodes are great for this too. I recently had a problem with a simple heater controller where hooking up the power wires caused severe transients that blew up my Arduino. Adding a TVS diode clips the top off the transient and stops the capacitors oscillating.
Since I'm not absolutely sure of what I'm doing I'll find somebody that do and draw me a working and safe schematics for my project... I can follow a recipe to make a cake, I cannot bake a cake from scratch tough. I can program the Arduino without a problem, the problem is the schematics, next step "Find a guy that do schematics".