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.

12vdc inputs?

Status
Not open for further replies.

strokedmaro

New Member
Whats the best way to use 12vdc inputs for a 16f88 (example). I guess the question is what will require the least components...2n2222's and resistors or is there a leaner way. Thanks!
 
Just a single current limiting resistor in series - this limits the current, and clips to 5V on the internal protection diodes. Ensure the input pins you use have protection diodes (check the data sheet), as there are occasional pins that don't.
 
Nigel,
what is the maximum voltage you could put into a Pic pin? I have an application at the moment where I have 24v inputs, and I was toying between a zener, or opto-coupler. The reason being, that I can't guarantee the quality of the external inputs. What would you reccomend for reliability

Thanks
Jim
 
Last edited:
Nigel,
what is the maximum voltage you could put into a Pic pin? I have an application at the moment where I have 24v inputs, and I was toying between a zener, or opto-coupler. The reason being, that I can't guarantee the quality of the external inputs. What would you reccomend for reliability

A single resistor is all you need, the protection diode ensures that it clips at a safe level, 0.7V above and below Vdd and Vcc. Check the MicroChip application notes, where one even feeds mains directly through a limiting resistor to an I/O pin.
 
thats perfect! would 4.7k 1/8 watt do the trick? (got a ton of these on hand)

With 4.7K it would pass 1mA or so through the protection diode using a 10V input, or about 4mA with a 24V input - as this current is bypassed to the 5V rail it's probably a bit too much current, bearing in mind a PIC's low current consumption. I would suggest values in the 100K to 500K region, and reduce the current to ten's of uA.
 
To expand a little more, the regulator driving the PIC won't be able to sink current. This means that if the current through the input pin exceeds the current being drawn from the 5V rail, the 5V rail will rise.

To avoid this problem, we keep the input current as low as possible.

If you're doing this to many input pins and are worried about the 5V supply getting too high, you could ad a 5.6V zener across the 5V supply to protect it.
 
thats perfect! would 4.7k 1/8 watt do the trick? (got a ton of these on hand)

hi,
If you have lotsa 4K7's you could connect 3 in series between the +12V source and 0V, take the 4V signal from across the lower 4K7, this would be a high enough voltage to been seen as a logical high by the PIC input pin.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top