In an IoT node I use an AM2315 sensor to measure temperature and humidity. This sensor can be connected via I2C bus to a NodeMCU module. The results of these periodic measurements are presented here.
On my location these days we had negative temperature on the Celsius scale for the first time in this autumn.
What happened? I had to see wrong temperatures in my graphs.
I looked for the root cause and found that in the used library AM2315.lua the range below 0°C was not handled. The MSB of the temperature value is set in the case of negative temperatures. Therefore I masked this bit and if set the value is multiplied by -1. If you use customized firmware the bit module must be included.
Here are the modified lines for AM2315.lua:
h = string.byte(b) * 256 + string.byte(b) --humidity
h = h / 10
-- MSB is set for negative temperature
t = bit.band(string.byte(b), 127) * 256 + string.byte(b) --temperature
t = t / 10
if bit.isset(string.byte(b), 7) then t = -1 * t end
You will find these modifications on https://github.com/tectiv3/am2315-lua, now.
Finally, here is a temperature graph from today. Winter is coming now 😉
… seen @ Mini Maker Faire Zurich 17./18. September 2016.
A very good example for a battery-powered wireless IoT-Node. Have a look to Lambda Nodes for further information.
Now, after two weeks of vacation, the sensors were in operation from 2016-05-17 until now and the battery condition is very well. This means an uninterrupted run time of 28 days until now.
You can follow the status of this IoT Node at www.ckuehnel.ch/AM2315@NodeMCU.html. Here is a screen shot of today’s results.
The following images show that already little sun as today helps to recharge the LiPo accu of the solar-powered AM2315 sensor.
As you can see, for mid of May it is a little bit cold. After noon, the clouds thinned slightly and the temperature grows up. The IP camera image shows the cloudy sky.
But, the prognosis for the afternoon is not so bad. Look at the evening what happened.
To build an autonome weather station I started a test with a solar-powered AM2315 Sensor. The data are uploaded to Thingspeak.com and are presented over an own website.
The AM2315 is a temperature & humidity sensor with an I2C-interface in a nice enclosed style. The sensor contains a DS18B20 temperature sensor and a capacitive humidity sensor. A microcontroller inside builds the sensor interface and works as an I2C-slave.
For outside measurements it is also advantageous that the AM2315 comes in a rugged case with mounting bracket. While it is not rated as ‘weatherproof’, it is more suitable than SHT PCB-breakout sensors for measuring outside.
After crimping a Grove-connector we can connect this sensor to a Grove Arduino sheld hooked on a Wemos D1 board, for example. Or you connect the wires to a Wemos D1 mini.
At Github you will find an AM2315 Lua module and it is easy to integrate the AM2315 into your own application. I have included the AM2315 sensor into my DHT11 network and it sends now outside data to the MQTT. Its ID is ESP8266-13972685.
The data coming from the AM2315 sensor are marked red in the screenshot while the data of another outside sensor ASH2200 are marked orange. The two sensors are outside but at different locations.
The software am2315.lua and am2316_mqtt.lua is on Sourceforge and Github.
To reduce the power consumption of my IoT button it must go into sleep mode after sending its message. I measured a current consumption of about 100 μA in sleep mode w/o any hardware changes. To get further reduction of current consumption you can remove the LED at pin D0 (GPIO16), for example.
Continue reading “IoT Button (2nd)”
Amazon introduces its Dash Button to order much needed goods. But there are alternatives. Two of them are bt.tn and flic.
bt.tn and flic are just what the name suggests: connected push buttons that can trigger actions. Together with IFTTT they can trigger a growing number of services. Relating to the connectivity bt.tn and flic differ.
The bt.tn has built-in internet connectivity and needs no smartphones or apps to pair with. Flic uses a Bluetooth low energy connection to an Android or iOS smart phone and the flic app for network connection.
These offers are interesting to experiment with. But, we can build such an IoT Button by yourself and save a lot of money.
D1 mini combined with an 1-Button shield is one solution. You can buy both for $ 4.99 from Aliexpress.
IFTTT offers channels for bt.tn and flic. IFTTT’s Maker Channel allows you to connect IFTTT to your personal projects like this IoT Button.
This time my IoT Button sends a Twitter Direct Message after pressing it. It’s a starting point to test the mechanism.
The configuration of IFTTT is well documented and should be no problem.
For a door contact application step-by-step instructions for IFTTT setup are in my book “IoT Node for les than 15 $”.
This time I work on reducing power consumption to get a battery-powered solution.
To measure the room conditions we can use a traditional Thermo-Hygrometer as shown in the image.
If you want to see these conditions from any location around your home then you can use a cheap DHTxx shield connected to a D1 mini and dweet its data to dweet.io. Use freeboard.io to make these data visible at any location. The program sample dht_dweet.lua can be downloaded from Sourceforge.
You can use your smartphone or a tablet to visualize the room conditions of the observed room (https://freeboard.io/board/BQK578).
Further information on NodeMCU and ESP8266 devices in “Building an IoT Node for less than 15 $” (http://amzn.com/3907857305; http://amzn.com/B018J1OVC4)
…build from DHT shield and D1 mini board
- Install last firmware version (for DHT commands)
- Use the floating point version nodemcu_float_0.9.6-dev_20150704.bin
- Download dht.lua and run it on DHT shield/D1 board package
- You will get the following output:
You can add a time stamp after calling a timeserver, for example.