Distance sensors with the Lopy (ultra sonic, IR etc) and input voltage
-
Hello,
I have various distance sensors lying around (ultrasonic and IR are my favourites), but I have always used them in conjunction with arduino boards. I've noticed that the maximum input voltage on the digital pins on the lopy seem to be 3.3v. Correct me if I'm wrong, please.
Is there any way to connect a 5v digital output to the lopy without having to deal with series resistors or other voltage rectifying methods? I sure hope so.
Thanks
Søren -
@soren
I'm afraid you'll need logical level adapters to connect 5V sensors, as you correctly found out the LoPy is not 5V tolerant, you must use 3.3V levels.But in most cases it's quite simple and there are many ready made options like the TI TXS0108E or MOSFET based adapters.
-
@soren
Many of the Arduino 5V devices will work on 3V3!If not, you could run them on 5V, BUT:
Use a voltage divider (NOT series resistor) on the 5V outputs that connect to a 3V3 level input.
3V3 is USUALLY enough to register as HIGH on a 5V device.Interfaces like I2C (IIC) and SPI are trickier, as they pull the pin LOW (against a pull-up): Use a level shifter!
-
@soren
simpy use BSS138 to level shifting or bigger model 2N7000
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login