Note: some libraries seems to interference the WiFi function of the board after update.
While playing Metro Exodus (2019) earlier in the summer, I can't help to notice that the glove (with the Nixie tube watch) Artyom wears has a pretty realistic blue LED on it. It serves as ambient light indicator so that you can sneak past enemies in the "dark".
So the thing is a DIY/Maker product...and that made me want to make one.
Of course, there's no nuclear radiation in our real world (unless US and China did declare war to each other in the near future). What the next most dreadful thing? The unbearable heat.
It was so hot in the year 2020 that Arctic ice melt faster then ever, and more people get killed by heat than COVID-19 in Tokyo. When Artyom and friends explore the dried-out desert of Caspian Sea, it's amazing that they can even survive there more than a few days.
Anyway, I decided to change the spec a bit. My version would measure the apparent temperature (the temperature you actually felt) and UVI (Ultraviolet Index). They can be harmful if the levels get too high.
All stuff (including the small power bank) are installed on a cheap sports bracer. I also wore a sports sleeve underneath it.
This is what this glove does:
- The TM1637 displays time read from the DS3231 RTC (real time clock) module, just like a real watch.
- If you hold the button (it would wait 2 sec on start) when the device "boot up", the ESP8266 would connect to WiFi, query NTP server and update DS3231's internal time. (Then it would disconnect itself.)
- The 0.96" SSD1306 OLED displays apparent temperature, which is calculated from temperature, humidity and atmospheric pressure read from BME280. (The formula is listed below.)
- The 12-bit NeoPixel ring indicates UVI (2-13) measured from ML8511 with different colors.
- When pressing the button, the NeoPixel ring would light up in max brightness level as flashlight.
- The Illuminance reading (lux) from BH1750 light sensor would be used to control the blue LED as well as brightness level of TM1637 and NeoPixels. (for the OLED, I simply turn off some of the lines.)
- The buzzer beeps three times if the apparent temperature reaches 38*C or UVI reaches 8. This means you'll have to find shade as soon as possible (or try not to stay outside too long).
A power bank (with a single rechargeable 18650 battery inside) provide 5V power to the D1 mini (ESP8266).
The TM1637 and NeoPixels are connected to 5V and the rest are connected to 3.3V.
This is from Robert G. Steadman's A universal scale of apparent temperature in 1984:
AT = 1.07T + 0.2e - 0.65V - 2.7
e = (RH / 100) * 6.105 * exp(17.27T / (237.7 + T))
AT is apparent temperature (*C), T is temperature (*C), e is vapor pressure (hPa), V is wind speed (m/sec), RH is relative humidity (%).
Since I cannot measure wind speed, I simply ignore it in the code. Wind can be blocked by buildings anyway.
Calculate UVI from ML8511The ML8511 datasheet indicates that its analog output between 1V and 3V can be translate to 0-15 mW/cm2:
And according to this:
1 UVI corresponds to an irradiance of 1/40 Watt/m2.
1 mW/cm2 = 10 Watt/m2, so 1 mW/cm2 = 1/4 UVI.
This means you can simply multiply 0-15 mW/cm2 with 4 and get 0-60 UVI. Or you can directly map 1-3V to 0-60 UVI.
Also be noted that the reference voltage is 3.0V (not 3.3V).
One fun fact I also discovered is that phone LED flashlight emit some UV. So you can use it to to quick UV test indoors.
Other issuesIt seems that the u8g2 library used by the OLED occasionally cause the board to reset itself. However, since it would not connect WiFi by default, these interruptions are not serious.
Comments
Please log in or sign up to comment.