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 😉
D-duino is a low cost Arduino-compatible ESP8266 development board. A 0.96O LED was integrated.
You can use Arduino IDE or NodeMCU (Lua) to program it. Further info at tindie.com.
… 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.
I flashed the SONOFF Smart Switch with a special Lua application program and can control it by MQTT.
Further information in my German blog.
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.
This ESP8266 IoT board combines built-in USB and battery charging. The ESP8266 is clocked at 80 MHz and supports 3.3 V logic.
To make it easy to use for portable projects, a connector for 3.7 V Lithium polymer batteries and built in battery charging was added.
You don’t need a battery, it will run just fine straight from the micro USB connector. But, if you do have a battery, you can take it on the go, then plug in the USB to recharge. The board will automatically switch over to USB power when its available. The board comes pre-programmed with NodeMCU Lua.
You can order this ESP8266 IOT Board [DPO82666E] from ELECROW for $12.90. Further info you will find in the ESP8266 IoT Board Wiki.
Wio Link now has got a little brother – the Wio Node. Two samples arrived from SeeedStudio today. Have a look to SeeedStudio’s images and compare:
Wio Node has the most of features as Wio Link. But it is cheaper, smaller and also lighter in weight.
- An ESP8266 based open-source Wi-Fi development board (here Espressif’s WROOM-02 is used)
- Supports Grove Sensors/Actors
- Visual Configuration via Mobile App (Android & iOS)
- OTA (Over-The-Air) Firmware Updates
- RESTful APIs
- IFTTT Application
- Powering by Micro USB
- Battery Holder for re-chargeble LiPo accu
Easy starting at iot.seeed.cc/start.
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 set the right colors for an RGB LED we have to set the appropriate values for R(ed), G(reen) and B(lue).
On this website I found this image explaining the composition of colored light from R, G and B.
You can step over the ratio axis and can generate all colors building a rainbow beginning from Red over Yellow, Green and Blue to Magenta and back to Red again.
If you start with three data points then you will get Red (0), Green (1/3) and Blue (2/3) only. The more equidistant data points are used, the finer the color gradation.
The required data points can be calculated with the Cosinus function to get a table of RGB values for controlling a RGB LED or Neopixels etc.
Continue reading “Rainbow Colors on WS2812”