5V sensors and circuits
bambino69
Posts: 126
in Propeller 2
What is the Pin tolerance when using 5v sensors?
Is 10k ohm pull ups still acceptable?
Is 10k ohm pull ups still acceptable?
Comments
I imagine these would be for the old Arduino boards (?). But, (and I'm not an expert) it seems like a lot of the new Arduino boards are 3.3 V I/O...
Or, maybe this is a sensor for Basic Stamp?
What sensors exactly ?
Open collector digital output sensors can use internal P2 programmable pullups, if you want a very low parts count.
10k is ok for moderate speeds, but 1k would be used for faster uses.
CMOS drive 5V Logic outputs would need a series resistor to tolerate the 5V drive into P2's 3v3 clamping diodes.
Analog 0-5V sensors would need divider resistors to give 0~3v3 change at the P2 pins. A decoupling cap may be added for noise filtering.
As I go forward I am going to want to hook devices up to the P2. Like moths to a flame.
Ping, RFID, Pir, DHT11, DS1620, etc
Just curious about the pins tolerance so that I can confidently breadboard a circuit with any device I run across that require 5v.
For analog signals, it's more complicated. We now have ADC in every pin, so don't have to do delta-sigma using 2 pins and external resistors anymore, like P1.
But, how to interface depends on (at least) the output impedance of the device.
If it's a strong signal with low impedance, like the voltage of a battery, you can just use a voltage divider with two resistors (one from P2 pin to ground and one from P2 pin and signal).
If it's a weak signal, you may need to do something more complicated, like a buffer amp, between signal and P2 pin.
Update: Corrected lower resistor limit, thanks @Wuerfel_21
As recently mentioned in another thread, 3.3kΩ is the smallest spec-compliant resistor if the clamp diodes are to be subjected to no more than 500µA.
Anybody know how much a pin can sink in these situations?
Didn't see your post quick enough
In the other threads I read 50 mA to be the max on a pin?
.5 mA seems a little conservative.
The clamp diodes protect the pin from over or under voltage situations...
I think you could get away with 1kOhm, but I don't want to give bad advise, so I'll correct my earlier post...
I think I've always used 10kOhm when I've done this...
I just added a comment on this to the docs...
50 mA is kind of a lot. You probably can't do that on all the pins, but again, the total current limit should be in the docs too (but probably isn't yet).
The other risk element with clamp resistors, is they will try to elevate the 3v3 rail. Most 3v3 regulators do not sink current.
During P2 reset, the P2 current is quite low, so many 5V drivers being clamped, could elevate the 3v3 rails to damage levels.
Regulators for DDR use can source and sink, but they tend to all use an external reference, so are not a one-part solution.
I guess a 3v3 regulator could be used for some P2 (boot) pins and DDR-reg(s) used for those pins where many might encounter 5V sourcing drive.
I guess I'll just wait for something to get put in the Docs.