WiFi Analog/Digital Module reads analog or digital data, returns the values and responds according to programmable limits. MQTT protocol

Ready to use boards available at Tindie

WiFi Analog/Digital Module reads analog or digital data, returns the values and responds according to programmable limits. MQTT protocol

The analog/digital control module reads analog data and digital data through its 2 input terminals. Input analog data limits are zero VDC to 3.3VDC, and this maps into output values of 0 to 1024 Input digital data limits are zero, for a digital zero, and 3.3VDC for a digital 1 The module sends the value of the measured analog data periodically every Interval milliseconds, and it sends the value of the measured digital data when this chances from 0 to 1 or from 1 to 0. The user can also request the module to send the measured values of analog and/or digital data at any time by publishing a specific MQTT topic. The module provides a triggering signal whenever the digital data changes (Figure 1) The module provides a triggering signal when the analog signal is less than a preset value or larger than a preset value (Figure 2)

Figure 1: Digital data response
DigitalDataResponseGraph

Figure 2: Analog data response
AnalogDataResponseGraph
Once the module is connected to the WiFi router it will stablish communication with the MQTT server and port as specified above and will attempt to connect. Wait a few seconds and all 4 LEDs will blink in sequence indicating a successful connection. If this fails, reset the board and wait a few seconds for the LED sequence. The module uses MQTT protocol for communication. MQTT topics are composed of a four letter acronym followed by the ESP822 chipid (the chipid is listed with your documentation), XXXXchipid Once a connection with the MQTT sever is established, the module is ready for communication and therefore reading analog and digital data and sending commands.

A typical MQTT instruction is composed of a topic followed by a message.

MQTT Topics and Messages

RANLchipid : this topic instructs the module to read a sample of the analog data and send it back via an MQTT topic and message. The module in response sends a topic and value as follows:
DANLchipid value ; you can get the analog value by subscribing to the topic DANLchipid and getting the value from the message
RDIGchipid : this topic instructs the module to read a sample of the digital data and send it back via an MQTT topic with the value as a message. The module in response sends a topic and value as follows:
RANLchipid value ; you can get the digital value by subscribing to the topic RANLchipid and getting the value from the message
MANLchipid min_analog_trigger (min 0, max 1024, def 300): this topic allows the user to set the module’s minimum analog value used for triggering the LED and signal . The change takes immediate effect.
XANLchipid max_analog_trigger (min 0, max 1024, def 800):: this topic allows the user to set the module’s maximum analog value used for triggering the LED and signal. The change takes immediate effect.
INTEchipid Interval_in_milliseconds (min 500 ms, max 240000 ms, def 5000 ms): this topic allows the user to set a new interval in milliseconds for receiving analog data. The change takes immediate effect.
RESTchipid: this topic allows the user to reset the module remotely.

Note that the analog value is sent by the module at regular intervals (controlled by the value of Interval_in_milliseconds) as specified during configuration or changed during operation, while the digital value is sent only when it changes. You can always request the analog or digital value at any time by publishing the respective topic.

Advertisements

About hbouzas

Born in Buenos Aires, Argentina. Studied Physics at the University of Buenos Aires. Joined Schlumberger in February 1985 in Houston, Texas, and worked in several technical and managerial positions until 2000. From 2000 until 2008 held several management positions in Abingdon, UK; Calgary, Alberta and London, UK. Worked in the areas of Geophysical Exploration, Geological Modeling, Structural Modeling, Reservoir Modeling and Petroleum Economics and holds several patents. He is currently the Norway Technology Center Manager for Schlumberger Information Solutions and is based in Oslo and Stavanger. Main interest are software, technology, innovation, 3D visualization, design, human computer interaction, energy, environment.
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to WiFi Analog/Digital Module reads analog or digital data, returns the values and responds according to programmable limits. MQTT protocol

  1. tytower says:

    So what is this useful for ? What can it do . Do you have a demo MQTT account or something to show us .Obviously it seems like a lot of work to see if a switch is high or low

    • hbouzas says:

      You can figure out lots of applications I’m sure. I throw one, analog water sensor triggers when water level less than this and greater than that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s