Wednesday 13 January 2016

How does a zener protect my microcontroller?


I'm connecting a 12V inductive limit switch for my 3d printer to a RAMPS controller (Arduino-based printer controller).


The RAMPS board operates at 5V, and connecting the 12V signal from the limit probe will surely fry the RAMPS board. A friend suggested the following circuit:



schematic and DC sweep of zener and resistor in series


As I understand it, the controlled reverse breakdown of the Zener will drop 5V from the 12V signal (and the R1 will see the other 7), and the resistor will keep the current nice and safe for the Zener (and the microcontroller?).


I don't doubt my friend, but I don't understand exactly why this is safe. Couldn't the signal short through the microcontroller and ruin my day?


Not an EE, I'm much more of a software guy. Thanks for taking a look.



Answer



Assuming that you use a 5V (or 4.7V) Zener, it should work as you described. The Zener will start to conduct at its Zener voltage, and the resistor will take up the difference (to 12V).


The only danger to the microcontroller would be if the Zener became disconnected. In that case, the full 12V would appear at the microcontroller pin. But there's a resistor in series, and digital chips have ESD diodes built-in that will stop the pin voltage exceeding Vcc (plus 0.7V or so; no problem).


I think the circuit is a good 'un.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...