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

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

  • 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".
    () or only if the power is down and battery is drained! (very bad luck here).

    the "script" now looks like.

  • This post is deleted!

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

Log in to reply

Pycom on Twitter