🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to switch the Atom Socket(HLW8023) on/off?

    Scheduled Pinned Locked Moved Atom
    4 Posts 2 Posters 4.6k Views
    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.
    • T Offline
      tgprivate
      last edited by

      I can't get any description about the HLW8032 Socket's controll ways. Could anybody who has the python code to do this give me some tips? Thanks a lot.

      1 Reply Last reply Reply Quote 1
      • felmueF Online
        felmue
        last edited by

        Hello @tgprivate

        from the schematic the relay is switched on/off through GPIO23.

        Using UiFlow Pin blocks and looking at the Python code I get this:

        from m5stack import *
        from m5ui import *
        from uiflow import *
        import machine
        
        pin0 = machine.Pin(23, mode=machine.Pin.OUT, pull=machine.Pin.PULL_UP)
        pin0.on()
        pin0.off()
        

        Note: untested

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        T 1 Reply Last reply Reply Quote 1
        • T Offline
          tgprivate @felmue
          last edited by

          @felmue It works according to your method, thank you very much!

          1 Reply Last reply Reply Quote 0
          • felmueF Online
            felmue
            last edited by

            Hello @tgprivate

            glad to hear it worked. And thank you for reporting back.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

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