Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Distance sensors with the Lopy (ultra sonic, IR etc) and input voltage

    Scheduled Pinned Locked Moved LoPy
    distance sensormax voltagepin
    4 Posts 4 Posters 1.5k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sorenS Offline
      soren
      last edited by

      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

      J B L 3 Replies Last reply Reply Quote 0
      • J Offline
        jmarcelino @soren
        last edited by jmarcelino

        @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.

        1 Reply Last reply Reply Quote 1
        • B Offline
          barsznica @soren
          last edited by

          @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!

          1 Reply Last reply Reply Quote 1
          • L Offline
            livius @soren
            last edited by

            @soren
            simpy use BSS138 to level shifting or bigger model 2N7000

            think about people first, then computers

            1 Reply Last reply Reply Quote 0

            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
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom