Using a Magnetic Switch (called a Door or Reed Switch) with a Raspberry Pi Pico & Circuit Python

Поділитися
Вставка
  • Опубліковано 19 жов 2024
  • Want to tell if a door is open? Use a Magnetic Switch. Sometimes called a Reed or Door switch, these come with two components, a wired piece and a magnet. When the door is open, the switch reports like a button that isn't depressed. When closed, the magnet completes a circuit inside the wired switch and current flows through the switch, reporting like a depressed button. We'll learn about Magnetic Switches, we'll wire one to a Raspberry Pi Pico and read it's state through a CircuitPython program, then we'll issue a challenge to create a door alarm that lights up an LED and plays an alarm sound if a door is open, and stop playing and lighting when the door is closed. We'll show the solution to the challenge at the end of the lesson.
    Part of Prof. John Gallaugher's Physical Computing course. For more info, see: gallaugher.com...

КОМЕНТАРІ • 4

  • @rickybeats1919
    @rickybeats1919 4 місяці тому

    Whats an ideal way to keep it powered for a diy home security system making sure all doors are closed?

  • @elalemanpaisa
    @elalemanpaisa Місяць тому

    possible to start the pi pico when a gpio is triggered run a task and shutdown again?

    • @profgallaugher
      @profgallaugher  Місяць тому

      If starting is no power before this then no because pico needs power to read GPIO. You can cut off power with a relay switch. But you might rather mean sleep mode? If so, check out this learn.adafruit.com/deep-sleep-with-circuitpython/overview

    • @elalemanpaisa
      @elalemanpaisa Місяць тому +1

      @@profgallaugher no sleep mode does consume too much energy, however, I think maybe having a relay switch which powers the pi on might solve my issue as this would power on the pi run the task and I could trigger the switch again to cut power afterwards