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

    Is there a difference on Powering Expansion Board & Sipy via USB or via JST ?

    Scheduled Pinned Locked Moved Expansion Board
    2 Posts 1 Posters 67 Views 1 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

      Good evening Everyone,

      I've recently bought a Sipy + Expansion Board (actually a pack of 5), in a view to create a very simple alarm for door check with Sigfox messsage sending
      I'm reading the status of GND connected to G28 in order to check if the circuit is closed (door closed) or opened (door opened) with a simple ILS + magnet.
      All is working like a charm when the board is powered through the USB socket, but does not work while only powered via the JST + Battery. The battery is self sufficiant, but everythings looks like the expansion board is no more capable to send the message to the Sipy.. even the Sipy is working fine...

      Here below my very simple code :

      from machine import Pin,idle
      import _thread

      Door1 = Pin('G28', mode=Pin.IN, pull=Pin.PULL_UP)

      def LoopDoor1(delay, id):
      while True:
      if Door1.value() == 0:
      print("Door1 Closed")
      import('Board_Library').LEDColor(import('Parameters').LED_Green, import('Parameters').Time_50ms)
      while Door1.value() == 0:
      idle()
      if Door1.value() == 1:
      print("Door1 Opened")
      import('Board_Library').LEDColor(import('Parameters').LED_Red, import('Parameters').Time_50ms)
      while Door1.value() == 1:
      idle()

      def FiveSecondLoop(delay, id):
      while True:
      #import('sys').stdout.write('.')
      import('time').sleep(5)
      import('Board_Library').LEDColor(import('Parameters').LED_Orange, import('Parameters').Time_5ms)

      _thread.start_new_thread(LoopDoor1, (1, 1))
      _thread.start_new_thread(FiveSecondLoop, (1, 2))

      print("Board Ready")

      <<<<<<<<<<

      When powered by USB: disconnecting the wire cause the LED to be RED for few seconds, reconnection cause it to be GREEN, while every 5 seconds, the Orange is blinking.
      When powered from JST + Battery : the Orange is blinking every 5 Seconds, but no RED/GREEN while disconnecting/reconnecting the wire...

      Did i missed something ? Did i do something wrong ??
      the intention of using the JST is to prevent somebody from disconnecting the mains...
      I can obviously find a way to have a permanent USB power.. but this is not the use of JST connector..

      Thanks all for your help
      Regards
      Patrick.
      PS : the code with Sigfox has been removed.. this is not the problem topic.

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

        Hello All,
        Replying to myself :-).
        I've tested with Pin G22, (instead of G28 in my initial post).. and all works as a charm..
        ... let's turn it into an advantage.. i now know when the USB is powered (from the mains) or not... and can trigger another alarm with "Power has disappeared"..

        @Pycom : if you could release/share more details on each PIN Status/Usage (it may exist already, but did not find it myself). Thanks in advance for your help.

        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