-
Notifications
You must be signed in to change notification settings - Fork 0
Hardware configuration
You will need:
- A Raspberry Pi (Any model will do, however the Zero W is recommended as it's the cheapest and offers WiFi connectivity).
- An Arduino.
- Any Arduino compatible Relay Board (octocoupler STRONGLY RECOMMENDED).
- A USB cable to connect the RasPi to the Arduino.
Setup:
-
Connect the arduino to the relay module as seen below:
In this schematic, I'm using a 2 channel relay module. You can use with as many channels as you want, but in the end only one of them will be used.
-
Upload this script to your arduino. Modify it accordingly. Note: When I was developing the script, I was using an active high relay. If yours is an active low relay, reverse the
digitalWrite(RELAY_PIN, X);lines (change High, to low and vice versa). -
When it's uploaded, give it a test by firing up the serial monitor and by writing
ENABLE. If the relay clicks, then you're set. -
Connect the arduino to your raspberry pi, by using the USB cable.
-
Connect the relay module to your door's unlock mechanism. You may wish to get a project box to set all the components inside.
-
Done! Continue with the rest of the setup guide.
Report any issues to the PiLock_UnlockScripts project.
In this schematic, I'm using a 2 channel relay module. You can use with as many channels as you want, but in the end only one of them will be used.