Using picaxe/xbee at 3.3V and PIR at 5v

kennethm

New Member
Hi,

I have a picaxe and an XBee both running off a regulated 3.3 v and I need to interface a PIR module to the picaxe.

Unfortunatly the PIR module requires 4.5 volts or more to operate, so I have a regulated 5v feeding the PIR. The question is, will i damage the picaxe if i connect the PIR output straight to one of its inputs without using a voltage divider?

Thanks in advance for any help offered

Kenneth
 

westaust55

Moderator
The absolute max voltage on an IO pin is defined in the datsheets as:
Voltage on all other pins with respect to Vss ............ -0.3V to (VDD + 0.3V)
So the answer is NO.
You will need a potential divider to drop down from 5V to 3.3V.

To get very close to 3.3 Volts, a couple of resistor combinations are:
1. 10 kOhm / 18 kOhm
2. 3.3 kOhm / 6.8 kOhm
 
Last edited:

Andrew Cowan

Senior Member
Code:
PIR output---------+
                   |
               10K resistor
                   |
                   +------------------------PICAXE input pin
                   |
               18K resistor
                   |
0V-----------------+
Andrew
 

hippy

Ex-Staff (retired)
You can probably get away with just the 10K, no need for the bottom 18K, same principle as current limiting the +/-12V serial through the 22K of a download circuit - note it's not a divider there, the 10K pulldown is at the +/-12V side, only there to stop the line floating when the cable is disconnected.
 

westaust55

Moderator
5V to 3.3V interface

NO you WILL need the bottom resistor.

Been there done that as an experiment. :rolleyes:


With just a single resistor you will "force" the entire IC sensing the signal (in this case the PICAXE) to the higher voltage.
 

hippy

Ex-Staff (retired)
That depends on the value of the R doesn't it ? It's works with the +/-12V serial and I've used it with non-PICAXE micros and 74HCxx logic. Microchip even has an App Note on how to connect to AC Mains using nothing but suitable current limiting resistors.
 

westaust55

Moderator
5V to 3.3V interface

The occasion where I tried to use a single resistor to an input was with a 74HC series chip operating at 3V.

As soon as any of the inputs when to 5V, the entire chip went to 5V even at the supply (VCC) pin).

That is why there are some 74LVC series logic IC’s with 5V tolerant inputs so they can run at the lower voltages properly with 5V input signals.

As stated earlier, Microchip give the absolute maximum input voltage for a pin as 0.3V greater than Vdd. This suggests they are not 5V tolerant when the PICAXE is operating at reduced voltage (3.0 or 3.3V).

Looking further into the Microchip datasheets (for 28X1 and 40X1 at least), they do show clamping diode on inputs but I would still go by the absolute max voltage rating.


EDIT:
A search of datasheets for PIC chips used for PICAXE does not find any reference top “5V tolerant” inputs.
But a search of the Microchip website with “5V tolerant” does find a range of microcontrollers such as PIC24HJ32 series , PIC24HJ64 series and dsPIC33FJ series and others microcontrollers where the datasheets do specifically state “All digital input pins are 5V tolerant”.
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en530271
 
Last edited:

leftyretro

New Member
That depends on the value of the R doesn't it ? It's works with the +/-12V serial and I've used it with non-PICAXE micros and 74HCxx logic. Microchip even has an App Note on how to connect to AC Mains using nothing but suitable current limiting resistors.


http://ww1.microchip.com/downloads/en/AppNotes/00521c.pdf

Not shown in the application circuit is that the neutral side of the AC voltage would have to be connected to your PIC DC common for this to work correctly.
If your circuit uses an AC transformer to develop it's DC voltages to would probably be better (safer?) to work off the AC secondary voltage.

Lefty
 
Last edited:

westaust55

Moderator
5V to 3.3V input interfacing

And here is the link to another Microchip Application Note that I found about the time I needed to do some 5V to 3.3V interfacing some months back.

http://www.microchip.com/stellent/groups/techpub_sg/documents/devicedoc/en026368.pdf

As mentioned, most 74HC series devices are not 5V tolerant when operated at 3 or 3.3V but while there is no mention in the PIC chip datasheets of 5V tolerant inputs, as they do have internal clamping diodes, then Hippy is correct and provided a sufficiently large series diode is used to limit the current (don;t want to blow the internal diodes) a single resistor should be adequate


I note that the referenced document is in fact chanter 8. Would be of interest for identify and look at the other chapters as well.
 
Top