Difference between revisions of "PulseCounter"

From Let's Control It
Jump to navigation Jump to search
m
m
Line 3: Line 3:
  
 
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.
 
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.
+
 
 +
= Hardware =
 +
You need an ESP8266 module like the ESP-01 or use the *future* board. We will use a commonly available sensor TCR5000. Connect pin 3 (DO) to ESP pin GPIO2 and power both the ESP and sensor module.
 +
 
 
= Software =
 
= Software =
 
== Domoticz ==
 
== Domoticz ==
Line 20: Line 23:
 
  // ****************************** End User defined settings ***************************
 
  // ****************************** End User defined settings ***************************
  
 +
Download: Todo
 
== Nodo ==
 
== Nodo ==
todo
+
Todo
 
== ?? ==
 
== ?? ==

Revision as of 18:31, 15 April 2015

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.

Hardware

You need an ESP8266 module like the ESP-01 or use the *future* board. We will use a commonly available sensor TCR5000. Connect pin 3 (DO) to ESP pin GPIO2 and power both the ESP and sensor module.

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 ***************************

Download: Todo

Nodo

Todo

??