PulseCounter

From Let's Control It
Revision as of 18:27, 15 April 2015 by Admin (talk | contribs)
Jump to navigation Jump to search

Introduction

An ESP8266 module can be used as a simple digital pulscounter to retrieve data from all sensors with a digital output. Use it for purposes like gasmeter, watermeter, door open/close counters etc.

In this example we wil connect an optical sensor. Connect the digital output pin to GPIO2 on de ESP module board. Then load the appropiate software and follow those specific instructions.

Software

Domoticz

Within Domoticz, we have to add a special type of hardware called a "dummy". Second, we need to create a virtual device. Note the device IDX, we need to change this in de code. For more information about Domoticz hardware and devices, check domoticz website.

The following section in the Arduino sketch needs to be adjusted to your own situation:

// ****************************** User defined settings *******************************
#define WIFI_SSID           "........"        // Your local Wifi SSID
#define WIFI_KEY            "........"           // Your local Wifi WPA key
#define DOMOTICZ_IP         "192.168.0.8"        // Domoticz server address
#define DOMOTICZ_PORT       8080                 // Domoticz server portnumber
#define DOMOTICZ_IDX        72                   // IDX of Domoticz virtual device
#define DOMOTICZ_SENDDELAY  5                    // seconds between updates
#define ESP_COUNTER_IO_PIN  2                    // IO Pin used, default is GPIO2
// ****************************** End User defined settings ***************************

Nodo

todo

??