Skip to content

User guide ADC 09

Florian edited this page Jan 27, 2019 · 1 revision

Hardware

Any type of sensor with an analogue output can be used. Note that the Esp8266 only has one analogue input, A0. On NodeMCU this is D3 GPIO0. Example usage: Connect an IR-transistor between 3V3 and A0, then a resistor (470k) between A0 and Gnd. The gateway will then send a value that depends on the light level in the room.

If you want to use this sensor uncomment in user_config

#define ZsensorADC

#include "config_ADC.h"

To change the Mqtt-topic change home/ADCtoMQTT in config_ADC.h:

#define ADC "home/ADCtoMQTT"

The value is between 0 and 1024 and is tranmitted via Mqtt when it changes.

Clone this wiki locally
You can’t perform that action at this time.