Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

5V Input from a 12V Source

Status
Not open for further replies.
I need to add a pushbutton to remote alarm box. The box currently has all outputs, but with luck there is one that is not used thus one conductor in the cable is available. With some clever use of wire cutters and a soldering iron I think I can use this conductor to connect to an available input. The catch is the box is powered by 12V and the controller inputs are 5V. I came up with solution which looks like it would work. I could attach the resistors right to the back of the switch. But being so simple, it seems too easy and therefore I must be overlooking something.

12V Input.jpg


Would this work?
 
Close, but nope. The voltage across the resistor is 12 - 5.1 = 6.9 V. Decreasing R1 to 6.8K gives an on-state current of 1.01 mA.

ak
 
You forgot to mention debounce which can be done using a cap across switch and scale up R values so a suitable RC value is 5x max bounce time. The caps wets non gold contacts from oxidation. Both of these are critical and can be solved in many ways.

Such as 10ms pushbutton with 50ms =RC requires 1 uF and 50K or 100k down and 140k up with 7V discharge across the cap to cause a local arc that cleans the oxidation from the contacts.

I found this to be my favourite failure fix for power relays with TTL remote sensing aux 100mA contacts. 10% failure rate without cap. on P&B contacts zero failures with cap. With 100 relays in a box. Wetting current must exceed 10% rating for DC 1A contacts.
 
Last edited:
With just a zener to limit the input voltage to the micro the input will be floating when the switch is open. I think the input should be pulled down to ground with a resistor (10K to 100K) even if a zener is used.

Les.
 
With just a zener to limit the input voltage to the micro the input will be floating when the switch is open. I think the input should be pulled down to ground with a resistor (10K to 100K) even if a zener is used.

Les.
That was the kind of gotcha I was expecting from my circuit. I thought the zener idea was good. I suppose you could parallel the zener with a 100k resistor. But why add to the part count.
 
If the uC has a high input impedance, it might take a while to mosey back down to the 0 logic level after an input event. Best to discharge its input capacitance by intention than by hoping those electrons wander off on their own. If the body count is a problem, drop the zener diode and go back to your original 2-resistor input circuit. There is nothing wrong with it if you trust the 12 V source (noise, transients, etc.).

ak
 
Get the proper divider and put the switch across the resistor to ground. I am assuming infinite impedance on the output.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top