Posts Tagged ‘WiFi’

As a follow-up to my 2018 Smart Temperature and Humidity Gauge here is a new and improved wireless version. A smartphone screen replaces the previous LCD display, allowing the data to be read remotely from the device location. The four displayed parameters are the same, but the previous Absolute Humidity formula with its -30°C to +35°C range has been replaced with a new formula (Mander 2020) with an extended temperature range.

The WiFi-enabled microcontroller can be programmed to operate in Station mode, Access Point mode or both modes simultaneously so you can use the device at home, at work, on the beach, wherever you want to know the values of the parameters which determine your comfort.

The original Smart Gauge prototype with attached LCD display

The wireless function also enables you to read temperatures inside a closed compartment such as a fridge. By following the readings on your smartphone (I set mine to refresh every 20 secs) you can see what the upper and lower thermostat settings are. For example the air in the 4°C compartment of our fridge cycles between 2.9°C and 7.5°C. I was surprised by this to begin with, but then realized that things stored in fridges generally have significantly larger heat capacities than air so their temperatures will fluctuate over narrower ranges.

A sensor mounted on jumper leads is ideal for testing condenser coil ventilation on a fridge, with the sensor placed directly in the airflow of the lower inlet and upper outlet.

– – – –

Hardware

The CarnotCycleAIR Smart Gauge is built around an Arduino IDE compatible Sparkfun ESP8266 Thing Dev microcontroller featuring an integrated FTDI USB-to-Serial chip for easy programming. A 2-pin JST connector has been soldered to the footprint alongside the micro-USB port and the board is powered by a rechargeable 3.7V lithium polymer flat pouch battery which fits neatly underneath the standard 400 tie-point breadboard. The system is designed to work with DHT sensors such as the DHT22 with a temperature range of -40°C to +80°C and relative humidity range of 0-100%, or the DHT11 with a temperature range of 0°C to +50°C and relative humidity range of 20-90%. These are available mounted on 3-pin breakout boards which feature built-in pull-up resistors. Both sensors are designed to function on the 3.3V supplied by the board, enabling the signal output to be connected directly to one of the board’s I/O pins without the need for a logic level converter [the ESP8266’s I/O pins do not easily tolerate voltages higher than 3.3V. Using 5V will blow it up].

Note: Comparing temperature readings in ambient conditions with an accurate glass thermometer has shown that when the sensors are plugged directly into the breadboard they record a temperature approx. 1°C higher than the true temperature, which in turn affects the accuracy of the computed absolute humidity and dewpoint. The cause appears to be Joule heating in the breadboard circuitry. Using jumper leads to distance the sensor from the board solves the problem.

The DHT22 sensor works happily down to –40°C, as does the new absolute humidity formula.

When used in Station mode the range is determined largely by the router. In Access Point mode where the device and smartphone communicate directly with each other, the default PCB trace antenna was found to work really well with an obstacle-free range of at least 35 meters (115 feet).

A Sparkfun LiPo Charger Basic, an incredibly tiny device just 3 cm long with a JST connector at one end and a micro-USB connector at the other, was used to recharge the battery. Charging time was about 4 hours.

The Sparkfun LiPo Charger Basic

– – – –

Circuitry

The circuitry for CarnotCycleAIR Smart Gauge couldn’t be simpler.

The ESP8266 (with header pins) is placed along the center of the breadboard and 3.3V is supplied to the power bus from the left header (3V3, GND). The DHT sensor is powered from this bus and the signal is routed to a suitable pin. I used pin 12 on the right header. That’s all there is to it.

– – – –

Coding

CarnotCycleAIR Smart Gauge is a further development of an ESP8266 project – “ESP8266 NodeMCU Access Point (AP) for Web Server” – published online by Random Nerd Tutorials which displays temperature and relative humidity on a smartphone with the ESP8266 set up as an Access Point. Code for both the Station-only version and Station and Access Point version using Arduino IDE can be copied from these mouse-over links:

Station-mode Temperature Humidity App for Smartphones

Dual-mode Temperature Humidity App for Smartphones

– – – –

© P Mander December 2021