Skip to content

Hardware configuration

Kyriakos Giannakis edited this page Aug 20, 2017 · 3 revisions

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:

  1. Connect the arduino to the relay module as seen below: "Schematic" 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.

  2. 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).

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

  4. Connect the arduino to your raspberry pi, by using the USB cable.

  5. Connect the relay module to your door's unlock mechanism. You may wish to get a project box to set all the components inside.

  6. Done! Continue with the rest of the setup guide.

Report any issues to the PiLock_UnlockScripts project.

Clone this wiki locally