Accéder au contenu principal

Garage door sensor with Arduino nano

I needed to have a way to know the state of my garage door. 

Several solutions where at my disposal so as to do that;
  • hack the existing control central to be able to know the position of the door and send the status wireless to my 433Mhz to MQTT gateway
  • add an external sensor and send the status wireless to my 433Mhz to MQTT gateway
  • One of these two options with a cable
After some investigations on the control central of my garage door I have deducted that there is no "closed" "open" contact, indeed the stop of the motor seems to be detected by the fact that it is "forcing" maybe by detecting some over current.
The sensor that I have at the bottom of this garage door is in case there is an obstacle in the course of the door. Sending a stop to the motor. Unfortunately I can't use this due to the fact it is not actionned at the end of the course.


Safety sensor of the garage door (cannot be hacked for state recognition)


I had to choose solution 2 and build an external sensor, as I had in stock a sonar and an arduino nano I took these two components to build the core of the sensor, added to that I used a 433mhz cheap emitter to send the open or close signal (which in fact are two different numerical values) due to the fact that it is easier for me than putting a long cable between my gateway and the garage door.

At final the bill of material is:
  • Arduino nano
  • Sonar HC SR04
  • 433Mhz emitter
  • 433Mhz wire antenna
  • Electrical box
As I have power supply at disposal close to the door I'm going to power the sensor with this.

I will place the sensor normal to the door, when the door is closed it will be at a distance of approximately 5cm, when it is open we will reach the maximum of the sensor. A condition statement checking this distance is making the job of saying I'm open or I'm close.

Here is the simple schematic:



Here is the program:

Here is the circuit:



And how it looks like at final:



Working perfectly with the 433Mhz gateway and OpenHAB.







Commentaires

  1. Ce commentaire a été supprimé par un administrateur du blog.

    RépondreSupprimer
  2. It's indeed important to take into account the security of the systems we are diying, thanks for the link. Regarding this garage door there is no hack of the initial system it is working off the shelf. The sensor is an add to know the state of the door not to act on it.

    RépondreSupprimer
  3. Ce commentaire a été supprimé par un administrateur du blog.

    RépondreSupprimer

Enregistrer un commentaire

Posts les plus consultés de ce blog

OpenMQTTGateway now reads Xiaomi Mijia Temperature and Humidity sensor

In the path of integrating BLE devices to OpenMQTTGateway I have found the Xiaomi Mi Jia Humidity and temperature sensor to be a good candidate. This little indoor sensor is able to measure temperature and humidity and to transmit these data by bluetooth low energy to your smartphone. As we already integrated another BLE device ( Mi Flora)  why not extending the integration scope of OpenMQTTGateway to this one. I ordered one to see if I was able to extract data from it. After a few weeks, I received it, a first test with nRF connect application showed me that this device diffuses data in a quite similar way compared to Mi Flora (using BLE service data exposition). From this point I had to determine the differences between the data sent from mi flora and the data sent from mi jia hum & temp sensor. The reverse engineering was similar to the one done with Mi Flora and with some offset implementation in the program I was able to read easily the humidity and temper...

433toMQTTto433 - Bidirectional ESP8266 NodeMCU gateway between RF 433Mhz signal and MQTT

The goal  is to act as a gateway between 433Mhz sensors and a MQTT broker or between the MQTT broker and 433Mhz actuators, It enables to: receive MQTT data from a topic and send RF 433Mhz signal corresponding to the received MQTT data  publish MQTT data to a different topic related to received 433Mhz signal  It can be an interesting part in an home automation system so as to interface sensors and actuators (wall sockets) with software like openhab . List of compatible sensors here The interest of putting this gateway to an ESP8266 and not on a raspberry pi is to be able to manage security actions at gateway level (power on a siren, cut power to certain devices) following RF data received by sensors without being dependent to the PI for security related actions. [EDIT] all infos are now centralized into  the github repository  take a look at it you will find up to date info about OpenMQTTGateway You need: Software: Mosquitto Arduino IDE latest versio...

Get your BLE sensors data into Home Assistant in 5 minutes

You can now upload your board directly from the web browser!  So let's imagine you want to read data from a sensor like a Mi Flora, an LYWSD03MMC, a weight scale, or any other BLE sensor from this list  Plug an ESP32 dev board to your computer USB port Go to this website: https://docs.openmqttgateway.com/upload/web-install.html Select esp32dev-ble Click the install button Depending on your board you may have to press the BOOT button Choose the port that the ESP is connected to. Wait until the process is complete. Release the BOOT button That's it, OMG is now loaded into your ESP32 board without Arduino IDE, platformIO or a binary flasher. Here are the steps in images: Now comes the Home Assistant part: Add the MQTT integration and activate auto discovery Create a user and a password (Configuration->Users) without administrator right for the gateway Well, this is enough for Home Assistant. So let's now connect both: Check the Wifi Access points available with your smartph...