Summary
A small but useful higro and thermo - meter with OLED 0,66" 64x48 display and DHT11/DHT22 humidity and temperature sensor.
There was a bug in the wemos.ino.txt so please download again :) or just initialize the sensor in setup by insertint line: dht.begin();
He whole set is based on Wemos 1D mini controller with 0,66" OLED shield and DHT11/DHT22 sensor shield all for less than $9 from links at the bottom :)
It can be used as a stand alone version just to display data or as a wireless sensor logging to server via WiFi.
Screen display legend by line:
- Humidity in percentage
- Temperature in Celsius degrees (can be changed to Fahrenheit)
- Current time - while connected
- WiFi signal strength in dBi and two last segments of assigned IP address - while connected
- Humidity bar - 0 - 100 %
- Temperature bar - 0 - 40 degrees (it will not look nice with sub zero reading due to lack of space :) )
In the below example is the code for Wemos 1D Mini and PHP receiving script along with RPImonitor who gathers and displays the data.
Installation instruction:
Hardware:
print, sand, use some hot glue to attach the screen to the shell and to glue them together :)
Software:
Requirements:
none for stand alone version
www + php server - in my case Lighttpd + PHP on Raspberry Pi 3+
software for analyzing data - in my case RPIMonitor does the job
wemos.ino.txt - a complete Arduino code to be uploaded to your Wemos 1D - note that some changes like server ip have to be made to make it work
receive.php.txt - a file that receives the data on the server, it creates two files which stores last received value from the sensor. Do not forget to set the right permissions:
sudo chown www-data:www-data receive.php
sudo chmod 755 receive.php
sudo usermod -a -G www-data pi // to add pi user to www-data
RPIMonitor configuration for the Raspberry Pi 3+ setup:
/etc/rpimonitor/templates/temperature.conf
reads the most recent value for temperature
dynamic.17.name=remote_temp
dynamic.17.source=/var/www/html/temperature.dat
dynamic.17.regexp=(\d+.\d+)
dynamic.17.postprocess=sprintf("%.3f", $1)
dynamic.17.rrd=GAUGE
and humidity
dynamic.18.name=remote_hum
dynamic.18.source=/var/www/html/humidity.dat
dynamic.18.regexp=(\d+.\d+)
dynamic.18.postprocess=sprintf("%.3f", $1)
dynamic.18.rrd=GAUGE
and shows them as text
web.status.1.content.4.line.2=data.remote_temp+" | "+data.remote_hum
and displays them on the graph
web.statistics.1.content.8.graph.3=remote_temp
web.statistics.1.content.9.graph.4=remote_hum
under the given names
web.statistics.1.content.8.ds_graph_options.remote1.label=Remote temp *C
web.statistics.1.content.9.ds_graph_options.remote1.label=Remote hum %
be sure to update line and content numbers accordingly
If you like it you can order the needed parts here:
Wemos 1D Mini -> http://s.click.aliexpress.com/e/bIteLhb2
Oled Shield -> http://s.click.aliexpress.com/e/dTXoboy
Sensor Shield -> http://s.click.aliexpress.com/e/bWIrdX5Q
Print Settings
Printer:
3dTalk Mini
Supports:
Yes
Notes:
Transparent filaments are cool because you see the diode blinking inside :)
태그
모델 소스
