12v into picaxe input pins.

andrewgodfrey

New Member
Greetings group.
I believe it is o.k. to connect 12v in to a 5v powered picaxe if a resistor is in series.
If I am right, there is an internal zener
for each pin.

Is this true?

What value resistor would be recommended?


Thanks,
Russell.
 

BeanieBots

Moderator
If the input is a reasonably well known voltage, it would be better to use a potential divider to reduce it down to the same voltage as the PICAXE power rail.
Most inputs do indeed have a "clamp" diode that is connected between input and power rail. (it is not a zener). However, NOT ALL inputs have them. It is good practice to fit one externally if it is expected by design to overvolt an input.
The current limit resistor value is not critical. 10k would be a common value to use. The download circuit uses 22k.
Current should be limited to a maximum of 2mA.
 

Michael 2727

Senior Member
You can't use just one resistor normally.
A single resistor does not limit voltage.
A single rtesistor limits current.
You need a voltage divider = 2 x resistor/s.
Google Voltage Divider to get a better
understanding of how they function.
There are also many previous posts on this subject.
 

MPep

Senior Member
Hi there,

What is your purpose of doing so?

I have been in a similar situation, that required checking of serial port DTR line, talking to a modem.
I used the same circuit as the download resistors as per manual.

A lot of ics use a diode from input to the Vcc line. This prevents spikes from damaging the chip (limits it to 5.6V or there abouts).

I believe RevEd use a simple download circuit such as they recommend because of this.

2 resistors are certainly smaller on a circuit board than a MAX232 ic.

Regards,
MP
 

evanh

Senior Member
I doubt there is any internal zenors. The input clamping diodes limit the input pin to the power pin level plus one diode. It does not limit what the power pin can go to though.

First thing to usually happen on over voltaging the chips power rail is programmed ROMs are erased, if the voltage is raised further then real damage can occur with zenoring like effects going on. Which also explains why there is no clamping zenor built in.

A safe design rule is to add an external zenor across the power pins that is a value just above the regulated voltage level. It's a good safety net before other protections like circuit breakers kick in. BTW: Semiconductors always fail sort-circuit so a cooked zenor will always short out the power supply immediately tripping the supply protection.

Same can be done with all input pins. Zenors rock. Caps or I/O filters are another good option for ruggedising a design.

If you don't want to add the extra components then the latchup protection will prolly save the chip from any harm if you do just use a resistor, just make sure it's a high value one and that the total current through all such resistors is not going to lift the power rail to the Picaxe.


Evan

Edited by - evanh on 28/08/2006 13:18:37
 

Dippy

Moderator
There aren't any internal zeners (or zenOrs).
As said, if the input voltage is well known and not varying then a pot div is fine - dig out your calculator.

If varying a good general purpose input would be a 5K6 + 4V7 (or a bit lower) zener.

For higher res vals you may have to change the zener and you will need to experiment for ideal. Depends on source impedance , loads and all sorts, but I digress..

Zeners Ruck!
 

hippy

Ex-Staff (retired)
<i>BTW: Semiconductors always fail sort-circuit </i>

The transistor I inserted as a child into a 3-pin mains socket ( a leg per hole ) and powered up definitely didn't fail 'short-circuit', in fact there wasn't anything left to short together after :)

I've also had LED's and diodes crack open under fault conditions and go open, so it might be a rule of thumb, but by means an absolute rule.
 

Michael 2727

Senior Member
~ ;o) @ Hippy,
I did the same at about 12 with a plain Neon
indicator Lamp, after removing that silly
resistor thingy -
Wow did that go off with a bang, I don't think there was a piece of glass left bigger
than a grain of sugar.
 

bgrabowski

Senior Member
Many years ago when I was training to be a teacher, a bored pupil sitting at the back of the classroom made a chain of about 10 paperclips then opened up the end one and connected it to the bench mains socket.

There was a huge bang and blue flash, the pupil fell off his stool and the paperclip chain was found with several links welded together. The pupil was unhurt, thank goodness.
 

Dippy

Moderator
Yes... thank goodness....

I remember an Uncle who was trying to force together two lumps of enriched uranium and holding them together during a rapid neutron chain reaction over an island in the Pacific.
 

Dippy

Moderator
Yes, he did.

In fact he was used as a street lamp for several years using the hat as a reflector.

Most people found him to be a very illuminating character.
 

inglewoodpete

Senior Member
While you were all irradiating the South Pacific (remember, 'useless' and Stan live there ~ maybe that's the reason.... ;o), Russell's possibly still wondering about voltage dividers.

It was never clarified if the input was for reading analogue voltages or logic levels.

For those interested, a relatively safe divider and its calculation. The 4.7v Zener is optional but limits the voltage that can reach the PICAXE input pin.

<code><pre><font size=2 face='Courier'>
|+5v
.----+----.
| PICAXE |
Vin .---------. Vout | |
------| R1 |---o------o----|In |
'---------' | | | |
.---. | | |
| | | '----+----'
|R2:| |_ | _ |
|4k7| /_\ | |
| | | 4.7v |
'---' | 400mW |
| | Zener |
| | |
| | |
Com-----------------o------o---------o-----Com

Calculating the potential divider values:
R1 + R2 Vin
(1) _________ = _____
R2 Vout

R1 + R2 = Vin x R2
(2) ________
Vout

[ Vin x R2 ]
(3) R1 = | ________ | - R2
[ Vout ]

Given the values above:

[ 12 x 4k7 ]
R1 = | ________ | - 4k7
[ 5 ]

R1 = (2.4 x 4k7) - 4k7 = 11k3 - 4k7 = 6k6


Closest value for R1 = 6k8
</font></pre></code>

If using the input to read voltages, then Vout will be about 40% of Vin.

Edited by - inglewoodpete on 29/08/2006 06:38:21

Edited by - inglewoodpete on 29/08/2006 06:39:02
 

evanh

Senior Member
Yeah, well, I guess I should have said except when the current is strong enough to vaporise the legs. :/


Evan
 
Top