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

    Correct UART pins and problems

    Scheduled Pinned Locked Moved LoPy
    lopy4uarthoneywellserialexpansion board
    3 Posts 3 Posters 1.0k Views 3 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.
    • H Offline
      hopkapi
      last edited by

      I've been trying to get a Honeywell HPMA115S0 particulate sensor working with my LoPy4 and expansion board, but even with a modified Python library and lots of trial and error, it still can't read anything (the sensor works fine with a Pi). I want to check which pins I should be using for UART, and if there are any known issues that'd explain the problems I'm having.

      LoPy4 with the latest firmware, expansion board 2.0, USB connected, sensor connected to VIN (it uses 5V power and 3V logic), have tried a variety of pins but it seems like G24 and G11 should be the right ones.

      robert-hhR 1 Reply Last reply Reply Quote 0
      • J Offline
        jhonrob92 Banned
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @hopkapi
          last edited by

          @hopkapi If you connect
          G24 aka P3 -> 7
          G11 aka P4 -> 6
          GND -> 8 GND
          Vin -> 2 (5V)
          and run the LoPy from USB. then the electrical conditions shoul be OK, and the device shoudl be accessible via UART 1. SOmetimes the definition of Tx and Rx are reversed, so you may swap P3 and P4. That should not cause any harm to the devices. The UART setting according to the data sheet is baud rate: 9600, databits: 8, stopbits: 1, parity: no
          Some test code would be like:

          from machine import UART
          
          uart = UART(1, 9600)                         # init with given baudrate
          uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
          while True:
              data = uart.readall()
              if data is not None:
                  print(data)
          
          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