doorbot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doorbot [2020/02/10 22:29] – [Raspberry Pi Breakout Board] tmurray | doorbot [2024/04/05 18:53] (current) – Add link to doorbot connection page tmurray | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Doorbot ====== | ====== Doorbot ====== | ||
- | The doorbot is responsible for scanning key fobs and unlocking the door for members. The software is written in Typescript | + | The doorbot is responsible for scanning key fobs and unlocking the door for members. The software is written in C++ and runs on an ESP32. It expects to use the Wiegand protocol for reading fobs. It communicates with a server written in Python. |
Implementation of the system is split up into a few repositories: | Implementation of the system is split up into a few repositories: | ||
- | | + | * https:// |
- | * https:// | + | * https:// |
- | | + | |
- | * https:// | + | |
- | + | ||
- | There are currently two doorbots. " | + | |
===== Building a Doorbot ===== | ===== Building a Doorbot ===== | ||
- | A new doorbot can be built with the following components: | + | To deploy |
- | + | ||
- | * 12V power supply: https:// | + | |
- | * 4x power supply holders: https:// | + | |
- | * 120V power socket w/switch: https:// | + | |
- | * 5V voltage converter: https:// | + | |
- | * Micro-USB cable (can be short) | + | |
- | * 3/8" plywood sheet, 2' | + | |
- | * Raspberry Pi (a multicore model is strongly recommended) | + | |
- | * Raspberry Pi mounting bracket: https:// | + | |
- | * Raspberry Pi prototype breakout board: https:// | + | |
- | * MOSFET, IRL540: https:// | + | |
- | * Schottky diode: https:// | + | |
- | * SD card (8GB or more, recommend A1 rated or better) | + | |
- | * DB9 port breakout board pair: https:// | + | |
- | * Mounting bracket for DB9 (you' | + | |
- | * 120mm computer fan: https:// | + | |
- | * Red and Black hookup wire | + | |
- | * Breadboard breakoff pin headers | + | |
- | * Wood screws that won't poke through the plywood when you screw in the mounts | + | |
- | * 4-pin molex computer connector | + | |
- | * C13 power cable (standard computer power cable): https:// | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | First, make the box by cutting the plywood on a laser cutter using this pattern: https:// | + | |
- | + | ||
- | Using the brackets, screw down the power supply and Raspberry Pi, as well as the 5V power converter and the fan. The Pi should be placed near the open slot in the back, so you can plug in an Ethernet cable later. | + | |
- | + | ||
- | Cut the end off the micro-USB cable, with enough length to run between the Pi and the 5V power converter. Connect the power wire (usually red) to the 5V output, and the ground (black) line to ground. Use hookup wire to connect the 12V output from the power supply to the input of the 5V converter, as well as the ground line. | + | |
- | + | ||
- | Connect the 12V line of the molex connector (yellow wire) to the 12V power supply output, as well as the two central ground pins on the connector. Connect this to the fan. | + | |
- | + | ||
- | Connect the hot/ | + | |
- | + | ||
- | At this point, you should be able to plugin everything and have the Pi bootup. | + | |
- | + | ||
- | ==== DB9 Port ==== | + | |
- | + | ||
- | The DB9 port connects the box to the components being controlled. Although it should work as long as you connect up both sides the same, it's best if we keep all the doorbots in the shop the same. Here's the recommended pinout: | + | |
- | + | ||
- | - +12V | + | |
- | - +5V | + | |
- | - Wiegand Data 0 | + | |
- | - Wiegand Data 1 | + | |
- | - GND | + | |
- | - GND | + | |
- | - Door Latch | + | |
- | - +5V | + | |
- | - GND | + | |
- | + | ||
- | Wiegand Data 0 should go to the Rasbperry Pi's GPIO 12, and Data 1 should go to GPIO 13. Door Latch should go to the breakout board' | + | |
- | + | ||
- | + | ||
- | ==== Raspberry Pi Breakout Board ==== | + | |
- | + | ||
- | Here's a wiring diagram for connecting the Pi: | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | Connect header pins on GPIO12 and 13, plus two for the door latch. You'll also want pins for an incoming 12V input and its ground. Add a few more pins for the 5V, 3.3V, and the Pi's ground. | + | |
- | + | ||
- | Here's an example of a completed board: | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | This board has a few extras, like a jumper pin that could go to a switch, allowing power to be entirely cut to the latch (which might be useful for a magnetic hold system). There' | + | |
- | + | ||
- | ===== Installing the Doorbot ===== | + | |
- | + | ||
- | The Raspberry Pi will need git and Node.js installed. The wiegand reader also needs the pigio library. Install typescript globally | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Then, clone the deployment repository, branch " | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Install all the dependencies | + | |
- | '' | + | * RFID reader for 125KHz fobs that outputs the Wiegand protocol (https:// |
+ | * Electronic strike running at 12V or 24V (https:// | ||
+ | * A power supply matching your 12V or 24V strike | ||
+ | * An ESP32 [TODO: exact model of dev board] | ||
+ | * The doorbot hat (see below) | ||
+ | * An enclosure (3d printed) | ||
- | Copy the systemd startup file, and set it to start at boot: | + | [[Howto connect |
- | '' | + | Building the hat is covered elsewhere (TODO make that page) |
- | To get the tight timings required, using a C program to read the Wiegand data tends to be more reliable than doing it in Typescript. So we'll install that: | + | * TODO: RFID reader connections |
+ | * TODO: Power connection | ||
+ | * TODO: Strike connection | ||
+ | * TODO: Configure firmware | ||
+ | * TODO: Uploading firmware | ||
- | '' | + | ===== Serial Port Debugging ===== |
- | '' | + | The ESP32 has a USB port, and much useful information is given about the cache status, key reading, etc. There are also a few commands you can send: |
- | '' | + | * check <ID> - Check if a keyfob is valid |
+ | * newcache - Rebuild the cache | ||
+ | * open - Open the door | ||
+ | * stats - Dump info about this doorbot |
doorbot.1581373796.txt.gz · Last modified: 2022/05/29 16:01 (external edit)