This project was made for small startup company, looking for a way to better distribute traffic in large cities. I was asked to prototype proof of concept able to open an automatic entry gate. It should allow to accept API request as an input. The requirements were simple: cheap, easy to implement and as simple as possible.
Implementation
It’s not that easy to emit the valid signal for a gate opener from a generic remote controller. Most parking barriers’ producers keep information about the signal shape and code in secret. Obviously, “security by obscurity” approach is fully understandable in this case. What was acceptable though, was to grab the yet another gate remote control and… bypass the button pins with cables and relays. Next thing to do was to find a device with digital outputs and accessible from the Internet.
I decided to use Raspberry Pi Zero computing platform, because unlike typical embedded platforms, it has a support for networking by default. I wrote and API server with Python/Flask, because it offers very feasible web development solutions. Taking into account situation when consumer may try to open a gate two times in the same time, I introduced support endpoint telling whether the system is in “opening the gate” state or not.
The last step was to connect high level Raspberry Pi computer with the low level relay. I used Raspberry’s GPIO pins as a digital output. In order to fit in current limits, I used NPN transistor and connected Raspberry to the base through a resistor.
Results
The project has been completed. My client’s software was able to connect to my prototype and control the gate through the click on the smartphone app. Below we can see the photo of completed project.
Of course, the cap comes from a beer opened after quality assurance 😉
Used hardware: Raspberry Pi Zero, relay with optocoupling, active USB hub with power supply, remote gate opener.