Controlling a Garage door by using License Plate detection

Take a seat in your car. Are you searching for your remote controller at the moment? Is it hard to find? Has it slipped deep in your pocket? If your family usually gets sick and tired, please let Ozeki 10 do the job for you. Install Ozeki on a small Raspberry Pi 2 or 3. They both fit in your palm. Hopefully you have an USB street view camera, although most surviellance cameras are IP cameras.

In this guide you will see how to connect Ozeki software to your street view USB camera and detect the license plate of your car. The vehicle just have to stop in front of the garage and if the plate has a match, the garage opens. Basic technical skills are in your vains. An Arduino needs to be wired between a RF433 transmitter and your Ozek 10. After finishing this construction, you will no longer need your 315 or 433 MHz garage remote. It is suggested to get familiar with your garage control technology before starting this project. Read STEP 1 to figure out the radio frequency.

Life has no remote. Get up and change it yourself.

Section 1 - How to wire an RF transceiver

STEP 1: Check out how to open your garage door

Ozeki 10 provides a highly intelligent solution to create radio signals on 315 or 433 MHz frequencies depending on your hardware. Luckily for you, both work the same way, so your first task is to find out the frequency. Hopefully you still have the user's guide around. If not, no problem. Use a radio frequency counter device to find it out. The car key copier should have one. If he cannot find the signal, ask your neighbours or buy an RF counter.

check your garage doors frequency
Figure 1 - Check your garage door's frequency

STEP 2: Do you have a street view camera ?

Search for a street view camera around your garage door. If you have one, check if this camera can see your license plate, but there is no problem if you have no camera above the garage. Drill an USB camera on the wall to have a visual on your license plate, so when you arrive home to your family, it can detect your vehicle. Unfortunately it only supports USB cameras, but this can soon change in the future and IP cameras support will be added.

street view camera
Figure 2 - Street view camera

STEP 3: Acquire some extra parts to build it

The camera above your garage and the following parts can serve you:

  • Raspberry Pi 2/3 (or Asus Tinker Board)
  • Arduino Nano, Uno or Mega
  • RF 315 or 433 MHz receiver, transmitter
  • breadboard (to build your first RF circuit on)
  • Jumper wires and a single USB cable

the required parts
Figure 3 - The required parts

STEP 4: The circuit diagram helps you to wire it

Follow the diagram and plug the components as you see it below. A white breadboard is suggested for beginners or testers. You will easily finish it and power it up to see the Arduino LED glow. You can easily acquire the 315 or 433 MHz receiver and transmitter from electronic shops. Check which one you need. This is a great opportunity to learn a bit of electronics. The red wires support the power supply voltage, which is 5V. The black wires are for grounding. The electricity on each board travels between the red and black wires. The colorful wires carry the input or output RF signals.

circuit diagram
Figure 4 - Circuit diagram

STEP 5: Install Ozeki 10 debian package on Pi

On the circuit you saw in STEP 4, you can see where to plug your HDMI cable to use the Raspbian ( or Asus TinkerOS) GUI. You should open your integrated Chromium browser on the following page to download Ozeki 10:
http://www.ozeki.hu/index.php?owpn=231 If you have any problem with the installation, you can find a great tutorial for installing it on a Raspbian: http://www.ozeki.hu/index.php?owpn=5986 This is where to find how to reach the GUI, so you can create an intelligent garage door for your needs.

download ozeki to raspberry pi
Figure 5 - Download Ozeki to Raspberry Pi

STEP 6: Download C++ IDE for Arduino boards

The Arduino programmer can be downloaded for both Raspbian ( or Asus TinkerOS ), although it is easier to unplug the Arduino from your Pi and connect it to a Windows machine, so you can upload the codes. There is a fast link to download the IDE at https://www.arduino.cc. All drivers for the boards are included. Please make sure that the newest Ozeki version is downloaded to your Windows as well. It doesn't have to be a licensed version. The Ozeki Arduino libraries can be freely used even after the trial.

download the c++ ide for arduino
Figure 6 - Download the C++ IDE for Arduino

STEP 7: Format your EEPROM

Each Ozeki device has an individual ID that helps Ozeki 10 manage them separately. The EEPROM is used for storing each ID, which means that if you would like the code to perfectly work, please wipe the EEPROM as shown in this video tutorial: http://www.ozeki.hu/index.php?owpn=3110 Access the serial monitor as you can see it on the screenshot below.

eeprom cleared
Figure 7 - EEPROM cleared

STEP 8: Upload transceiver code to your Arduino

http://www.ozeki.hu/attachments/5952/RF_transceiver_code.txt (copy)
Paste the code and upload it with the usual technique. Later on you can modify the whole wiring and change it to an RF transmitter. Receiving signals are only necessary to save the remote controller data, since you will control your garage with transmissions. It is not advised to change the pins.

upload the rf433 code
Figure 8 -Upload the RF433 code

Section 2 - Add the required connections and camera filters

To follow on these steps, you should unplug the Arduino and replug it to your Raspberry Pi. The RF433 transceiver device should already be installed on the ATmega chip of the Arduino. Do not make a misinterpretation from the device name, the Oz433MhzTransceiver code can transmit and receive both 315 or 433 MHz RF signals depending on the radio module.

STEP 9: Start Control Panel

From the current step until the end of the tutorial, you can see screenshots that show the Ozeki 10 client GUI from a remote location. If you are familiar with Ozeki, you probably know that you can reach the server from it's IP and port number: 9505. No matter where you are, with a username and password you can log in to the Ozeki desktop by using the internet. You can see below how to start the 'Control Panel' with the red Napoleon icon.

start the control panel
Figure 9 - Start the control panel

STEP 10: Open RF transceiver connection

The 'Control Panel' is the centralised application that can manage all Ozeki 10 connections. As an example you can see that the RF433 transceiver is already connected. Just in case if it wasn't automatically detected, please click on the 'Serial ports' tabpage, so you can manually add the COM port that uses the Arduino. The LED should turn green left to it, meaning it has been successfully connected. Back to the connection list, click on 'Details'.

rf connection in list
Figure 10 - RF connection in list

STEP 11: Save the garage opener signal

This is the GUI for the RF433 transceiver. The first tabpage shows the chat panel where you receive chat messages from the connection. All incoming messages are basicly radio frequency signals received by the antenna and forwarded through the chat interface. Now it is time to grab your garage remote and press the button on the top. Try it in a few meter range of the receiver module. If the garage door opens, you can probably see the signal on the chat GUI as shown below. Save the signal, because you will use it later. If the button that closes the garage is different, press it and save it too.

receive the signals
Figure 11 - Receive the signals

STEP 12: Imitate signals by sending them

The chat interface can be used for two way communication between the user and connection, which is an RF433 transceiver in this case. Now comes the magic from Ozeki 10. You will open your garage door by pasting the door opener signal into the chat box and hitting the blue 'Send' button. Look at your garage, if the antenna was close enough, it will open. For 433 MHz 17.3 cm and for 315 MHz 23.8 cm antenna length is required. Try to control any RF device in your home by catching and saving their remote controller signals. Use the chat message box and hit enter to transmit them.

send imitated signals
Figure 12 - Send imitated signals

STEP 13: Add license plate detection filter

After testing the RF transceiver, please go back to the home page of the Ozeki Control Panel. Make sure you have plugged in your USB camera to your Ozeki 10 server machine, which can be the Raspberry Pi. In the following two pictures you will see how to add a license plate detector to your camera. Click the blue 'Create new Connection' button on the top. Many icons will appear to the right. Pick the camera icon called 'Video' and from the new group of icons, please select 'Vision' as you can see below.

add the license plate filter
Figure 13 - Add the license plate filter

Finally you just have to click the 'License plate' icon. Pair the filter to the same USB cameras detected by your operating system. Please select your license plate format region. Currently you can choose from Australia, Europe or United States. You should know that IP cameras are currently not supported for filtering license plates, although I have talked with the group and it will be supported in the near future. Click 'Ok' to see the filter appear in the connection list with the actual camera stream. From now it will automatically send plate numbers if you subscribe to it with Ozeki 10. Try it on a license plate. Then look at the 'Event' tabpage of the plate filter.

pair the filter to the camera
Figure 14 - Pair the filter to the camera

Section 3 - Import and run example codes

The code block diagram can be easily understood. This section shows how to download the XML file example and import it to Ozeki 10. Finally change the licence plate and door opening signal to your own. The click the green flag to run the code.

STEP 14: Start block diagram creator

At the current place you are on the GUI, find the block diagram creator at
Ozeki's Start menu/Programs/Education/Snap
The screen shot below shows how to reach it through the Start menu.

run the ozeki 10 code editor
Figure 15 - Run the Ozeki 10 code editor

STEP 15: Download the example XML

Please download the example created for you by opening the following page: http://www.ozeki.hu/attachments/6007/license_plate_detector.xml Save it to your machine. Click 'Save as...' by using the right mouse button, but please memorize the folder, so later on you will be able to find the XML file and import it. Ozeki 10 can create a block diagram from the XML.

download the example xml file
Figure 16 - Download the example XML file

STEP 16: Import the code to Ozeki 10

Back to Ozeki 10's block diagram creator, you can either create your own codes or import the example from STEP 15. Click the a grey folder icon on the top. Select 'Import...' and navigate to the folder you have saved the XML to. Click 'Ok' to automatically load the blocks. Look below to see how to do it. With either method, the code needs to subscribe to the license plate filter.

import licensplate xml
Figure 17 - Import license plate XML

STEP 17: Modify some attributes

Take a closer look on the code. It starts by pressing the green flag and subscribes to the license plate filter connections, which sends messages towards the blocks. If a message is received, it is compared to your plate number and if it is a match, the code sends the garage door opener RF signal. Please change both the license plate and opener signal to your own.

modify the attributes
Figure 18 - Modify the attributes

STEP 18: Click green flag to start the code

Start the code by easily clicking on the green flag. It is on the top right corner of the application. The screenshot below shows where to find it. The code will run until the red dot is pressed, which is right to the flag. This is the only way to stop it, because the blocks are placed in a 'forever' infinite loop, which continously listens to messages coming from the plate detector.

click the green flag
Figure 19 - Click the green flag

No more remotes. Enjoy your life

Change everything! Think more, work more. Create happiness and joy in your life. Ozeki RF433, RF24 and IR are capable to control the same electronic devices around you that you have already bought. If they made your life more complex, Ozeki 10 should make everything easier. Make it simple! It can get simple by centralising device control with Ozeki 10.

change life with no remote

More information