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

    Actuate a 5V relay based on NFC Card Presence : how to prevent the PinOut to be rize-up during the boot sequence.

    Scheduled Pinned Locked Moved Expansion Board
    4 Posts 2 Posters 20 Views 2 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.
    • P Offline
      pevrard
      last edited by pevrard

      Dear All,
      First : Happy New Year 2021 to all.

      I'm using a Sipy + PyScan (RFID) to actuate a relay that will be used to open a door.
      => I'm using P19 as pinout to actuate the relay and generating impulsion for 0,5 sec on opening the garage door.
      From the wiring, and programming, all is working as a charm : approaching a whitelisted NFC card from the reader is generating the impulsion and as a result open / close the door.
      The problem i have is when the Sipy is rebooting : at the boot sequence, all Pxx seems to be activated, which is resulting onto generating an impulsion on the relay... opening the door ... unwanted.
      Is there a way to prevent the P19 (or any other accessible PIN accessible as Pin-Out on the Pyscan) to rize up during the boot sequence ?
      Thanks for your help
      Regards
      Patrick.
      PS @ Community Manager : Sorry i did not found any section regarding Pyscan on the forum, therefore i've attached it to Expansion Board section. Feel free to move it to more appropriate section if need be.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @pevrard
        last edited by

        @pevrard Have you checked pin.hold?

        Note that this works only for resets, deep sleep (the internal one, not the Pyscan-controlled one), etc. Won't work if the SiPy is actually disconnected from/reconnected to power.

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          pevrard
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • P Offline
            pevrard @jcaron
            last edited by

            Hello jcaron
            Thanks for your speedy answer.
            indeed, i added an hold(false) before and hold(true) after activating the relay and it works fine.
            Considering your point on disconnecting power : I'll backup the USB power with and LipoBattery, and add up a regular watchdog reset (in case of) so it never() falls into the "no power case", and forget the "hold".
            Regards
            Patrick
            () or only if the power is down and battery is drained! (very bad luck here).

            the "script" now looks like.
            Relay.hold(False)
            Relay.value(ON)
            time.sleep(0.5)
            Relay.value(OFF)
            Relay.hold(True)

            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