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

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 version (tested ok with 1.6.10

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

SONOFF RF BRIDGE + Pilight or How to extend the supported protocols by our little bridge

With version V0.9 of OpenMQTTGateway  @steadramon  &  @puuu  (the ESP library creator) enabled by their work to integrate Pilight library on OMG. Permiting to increase significantly the list of RF protocols of OMG . But now that we have this interesting possibility and with the goal of OMG of beiing multi boards compatible, why not trying to put Pilight on a Sonoff RF Bridge . So as to do this test I ordered a new one so as to be on the same hardware as most of the users (my other RF Bridge is a demonstration old one) So as to decode RF signals the Sonoff RF Bridge has a special dedicated chip (EFM8BB1)  that communicate with the esp8285 with a serial connection. If we want to increase the number of RF protocols compatibles on the device without modifying the hardware, the only software based solution is to hack the  EFM8BB1. This hack is available and made by @ Portisch . The list of protocol is interesting but at the moment not as big as Pilight one. Maybe I will t