Skip to content

GetUsernameFromDatabase/wlan-gate-open

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WLAN Gate Opener

This is a personal project with the goal of opening a gate from the phone.

Components

  • MOSFET -- IRLI540NPbF
  • Relay -- LMR2-3D

    Most likely not needed -- MOSFET can be used instead but I like the audio feedback it gives.

    Only one side is used so LMR1 is totally fine, this was just locally available.

  • Microcontroller -- Pico W
  • Resistors:
    • 220 Ω
    • 10 kΩ
  • Remote that opens the gate (mine operates on a 12V battery)

Setup

Setup IDE

I decided to use Visual Studio Code to develop this project but Thonny is a good alternative.

More information can be found in paragraph 4.2 of Raspberry Pi Pico-series Python SDK

Setup MicroPython

Setup MicroPython on raspberry pi Pico

  • download MicroPython (version used is v1.25.0)
  • program the Pico
    1. Push and hold the BOOTSEL button while connecting your Pico with a USB cable to a computer. Release the BOOTSEL button once your Pico appears as a Mass Storage Device called RPI-RP2.
    2. Drag and drop the MicroPython UF2 file onto the RPI-RP2 volume. Your Pico will reboot. You are now running MicroPython.
    3. Access the REPL via USB Serial.

More information can be found on Drag-and-Drop MicroPython -- Raspberry Pi Documentation

Setup Project on Pico

Get the project running on pico

  • copy env.py.example to src\env.py
    • on windows use cp .\env.py.example .\src\env.py
  • populate required fields with information
    • SSID with the name of the Wi-Fi you want to connect to
    • WLAN_PASS with the password for that connection
    • SIGNAL_DURATION with how long you want the remote to be on in milliseconds
  • upload project to Pico
    • open command palette (F1 or Ctrl+Shift+P) in vscode
    • then MicroPico: Upload project to Pico
    • alternative is to use rshell

MicroPython automatically starts main.py on device start.

see more -- MicroPython - Reset and Boot Sequence

Circuit

Circuit Diagram

circuit diagram Picture of the circuit that is used in this project

Pico W pinouts

Pinouts used in this project:

  • 3V3(OUT) (36) -- powering the relay MOSFET circuit
  • GND (38) -- final point of the relay MOSFET circuit
  • GP15 (20) -- driving the MOSFET's gate
  • GND (3) -- final point of the circuit that controls the MOSFET

Pico W pinout Pico W pinouts, source -- https://www.raspberrypi.com/documentation/microcontrollers/images/picow-pinout.svg

How the final result looks like in real life

IRL picture of setup

About

Opens a gate using a pico w microcontroller connected to a gate remote

Topics

Resources

License

Stars

Watchers

Forks