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.

2n2222 transistor logic shifter not working

Status
Not open for further replies.
Hi

I have followed the following link to build myself a logic shifter to shift 3.3v to 5v and 5v to 3.3.

My 3.3v device is a raspberry pi 2b and arduino uno.
I have been told by engineers on another site that the pi may not be able to guarantee a minimum voltage of 3v for the arduino to register a logic high.

Hence why I need a logic shifter.

Is the way i have wired it correct?

It doesn't seem to work at all.
 

Attachments

  • shifter.gif
    shifter.gif
    7.9 KB · Views: 644
Are you sure you've got them connected the right way?, I'm somewhat confused by your labelling rx and tx.

But for 5V down to 3.3V you just need two resistors as a simple resistive attenuator, no need for a transistor - so you don't need the lower circuit.

For the top circuit, the emitter of the transistor connects to TX out from the 3.3V UART, and the collector connects to RX in on the 5V UART.

You might have a look here:

 
ok I appear to have it working in one direction. The pi can send data to uno.
However for some reason the pi appears to not see the reply back from uno.

I am using the two resistors method to step down the logic level.
but for some reason it appears to not see the signal.
When I probe the middle of the voltage divder, the voltage switches betwen logic high and logic low as expected.
But the pi doesn't see it.

I have checked for continuity between the rx pin on the raspberry pi to the voltage divider. Its fine.

confused!
 

Attachments

  • attenuator.gif
    attenuator.gif
    4.2 KB · Views: 229
But the pi doesn't see it.
Hi amateur. It's been ~1 month since your last post. Have you got things working yet?
If not, have you double-checked that the Pi pin is configured as an input and that the Pi and Uno have a common ground connection?
 
This is all over the net as a bi-directional converter, but I am suspicious when
you add up all the tolerances (especially 2N7000 worst case Vt) its logic level
noise margin pitiful, and possibly non functional :

1696155504262.png


I think this better choice :

1696155807247.png




Regards, Dana.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top