Offline Weather Station Arduino

by paclevkov in Circuits > Arduino

4488 Views, 36 Favorites, 0 Comments

Offline Weather Station Arduino

IMG_20181225_172822.jpg
battery_page.jpg
IMG_20181225_150657.jpg
temp_page.jpg

Summary

Last several times when i buy thermometer, i saw that there is almost always difference in the values. My task was to follow the temperature and the humidity inside my baby's room. Also there was issue reading the values from 2-3 meters range on the most thermometers and i needed to stand up to see the temp value, problem that i have with the most thermometers was the light. Other problem was I cannot see the temperature value because it is without backlight in order to save energy. I don't want to save energy i just need a couple of hours energy storage in order this device to work if the main energy line shuts down.

So i came with an idea:

- To create thermometer with allowance to change the temperature value.

- Which can be with backlight and Colors.
- To combine all the stuffs that regular thermometers have: (RTC, Battery, Min Max t, etc)
- And to have additional features like Seasons and Holidays

So i started the project before 1 year. The software part took me several months to complete. I have created several versions of the software, and the past 2 weeks i complete the project.

Device software information

Arduino code, and libraries:

Code is also uploaded on Code step.

https://github.com/stlevkov/KT2_144

https://github.com/stlevkov/Arduino-Libraries

Device Features

  • Boot Page - showing the Date and Time of the last firmware upload.
  • Home Page - showing Time, Date, Battery Icon, Temperature Icon, Temperature Value, Humidity Value, Tmax, Tmin, Seasons, Holidays, USB Indicator when plugged in.
  • Menu Page - with Temp, Clock, Battery, About, Back menus
  • Temp Page - allows to calibrate the DHT Sensor
  • Clock Page - allows to edit the Time and Date
  • Battery Page - showing Battery info, % percentage, mV voltage, Charging status
  • About Page - showing info for the author
  • Back function for exiting the menu
  • Transparent panels
  • RTC long life
  • Lithium battery - up to ~9 hours (450mAh)
  • Low Battery indicator - showing the icon in red ~ remaining 5 min.
  • Different colors for the - Low, Medium, High temperature
  • Holidays and Seasons messages
  • Programmable socket - at the back side
  • User Interface - using Rotary Encoder

The back side with the board will not be covered, because i want by baby to see and touch the board, while the device is not powered on. You can create some kind of cover for the back side of the board.

Sketch the Device, Draw the Init Idea

IMG_20181225_145812.jpg
IMG_20181225_145803.jpg
IMG_20181225_145715.jpg
IMG_20181225_145723.jpg
IMG_20181225_145742.jpg
IMG_20181225_145754.jpg

Decide what to have - how many pages, menus, how to change the menus and the pages.

If you have another ideas, you can change it with the arduino code.

Decide what form you want and what can be done easy. I first choose 3D printing, but after that decide to use simple material.

The idea is to have transparent walls on the top and on the bottom, also you can create more fine box.

So the main parts of the box are:

  1. Front - with the Display and Rotary Encoder
  2. Right - with the RTC module
  3. Left - with the DHT Module
  4. Back - with the oposite side of the board
  5. Top - Transparent with the 3.7V Battery and the ON/OFF Slide switch
  6. Bottom - Transparent

Choose the Right Components

  1. TP4056 Micro USB Charger 5V 1A 18650 Lithium Battery Charging Board - Ebay
  2. 1.44" 128x128 SPI Full Color 65K TFT LCD Display Module ST7735 - Ebay

  3. KY-040 Rotary Encoder Module for Arduino - Ebay

  4. DHT22 AM2302 Digital Temperature And Humidity Sensor - Ebay

  5. Tiny RTC I2C Modules 24C32 Memory DS1307 Real Time Clock RTC Module Board - Ebay

  6. Pro Micro Controller Board ATmega328P 16MHz Arduino Pro Mini Module - Ebay

  7. 3.7V 450mAh Lipo Rechargeable Battery - Ebay

  8. 6 Pins 2 Positions DPDT On/On Mini Slide Switch - Ebay

  9. CR2032 CR 2032 3V Button Cell Coin Battery - Ebay

  10. 10x22cm Soldering Prototype Copper PCB Board Single Side Universal - Ebay

  11. Male&Female 40pin 2.54mm Header Socket Single Row Strip - Ebay

Prepare Wiring Diagram

fritzing_katrin_therm_2_bb.png

The diagram shows connectivity of the similar sensors, while the Display is almost the same.

For proper pin usage, see the Arduino code in the Code step.

Download the fritzing file for more detail about the pinout. Hover the points from the diagram to see the exact pins of the modules.

Additional Info Before Start - Power Consumption

power_usage.png

The project use 450mAh battery, but you can use greater. Just have a look at the power consumption in order to choose and calculate the right battery for specific hours usage. When using 450mAh, the device can run approx. 9 hours.

In idle the device is running with around 0.102A - No energy saving optimization are done here

When the button is pressed, the high current is applied and it is around 0.177A.

Connect the Display

IMG_20180210_170557.jpg
IMG_20180210_170622.jpg

The display is using SPI for connection.

There is adafruit library for this driver ST7735.

Connect RTC Module

IMG_20180304_133849.jpg

Create PCB Modification In order to use CR2032 Battery.

  • Remove D1
  • Remove R4
  • Remove R5
  • Remove R6
  • Short R6

More information about this modification is found here.

Attach Front Wall With the Display, RTC, Battery, Rotary Encoder

IMG_20180225_110845.jpg
IMG_20180225_131916.jpg
IMG_20180225_160350.jpg

If you want to boot up the device, just upload the code from the Code step and follow the other steps while changing and attaching the new parts.

Prepare Transparent Walls

IMG_20180421_163041.jpg

I use 3mm plexi. You can use similar transparent material. I use only one for the bottom side.

Create Right Wall

IMG_20180421_174425.jpg
IMG_20180421_174432.jpg

Create the Right side wall. Use the CR2032 size for the hole.

Create Left Side Wall

IMG_20180603_130806.jpg
IMG_20180603_132117.jpg
IMG_20180603_132222.jpg
IMG_20180603_132216.jpg
IMG_20180603_142332.jpg

Create the left side wall. Use the size of the DHT Module for the hole.

Create the Socket With the Universal Board and the Rails, Connect RTC, Encoder, Display and Display

IMG_20180606_000251.jpg
IMG_20180621_182638.jpg
IMG_20180621_183905.jpg
IMG_20180621_183915.jpg
IMG_20180627_204145.jpg
IMG_20180627_203610.jpg
IMG_20180813_195552.jpg
IMG_20180707_182656.jpg
IMG_20180707_192055.jpg
IMG_20180627_203642.jpg
IMG_20180708_115141.jpg
IMG_20180627_203806.jpg
IMG_20180627_205344.jpg
IMG_20180709_150845.jpg

Connect and solder all the pins following the wire diagram. You can use Arduino UNO with empty sketch installed in order to program the Arduino Mini.
Needed pins:

  • VCC 5V
  • GND
  • RX
  • TX
  • RESET

Dont forget to unplug the battery 3.7V at this steps if you upload the sketch before finish with the parts.

Power It on Before Continue

Arduino 1.44" color display - Idea for interface. DHT, RTC, Rotary encoder

At this point, you will be able to power on the device and use the all functions.

Use the Video preview to see what was the software on version 1.1. Also there is github link in the summary step for see the latest update.

Power on the device before the continue with the other steps before closing the top cover, make sure it works normally.

Add TP4056 and the Battery, Solder the Slide Switch, Add Charging Wire to Pin 5, Solder the Back Programmable Socket

IMG_20180813_193726.jpg
IMG_20180813_195128.jpg
IMG_20180813_223200.jpg
IMG_20181116_164927.jpg
IMG_20181116_170040.jpg
IMG_20181225_114727.jpg
IMG_20181118_162228.jpg
IMG_20180813_223300.jpg
IMG_20180813_223330.jpg
IMG_20180813_223346.jpg

After every soldering, test the system, make sure the parts are working fine before continue.

Create the Top Cover

IMG_20181225_125457.jpg
IMG_20181225_125541.jpg
IMG_20181225_125939.jpg

I use 0.5mm plexi sheet from power bank box.

Code

Use the parameters in the init section to define your preferences.

For the holidays, i use Bulgarian. You can edit the array using the holidays in your country.

The device is showing 4 seasons, edit them in the code prefer for your location.

If your sensors are different, follow the pins definitions and edit them in the code. I have left almost all the lines comments for better understanding of the code.

Tested platforms:

  • Arduino UNO
  • Arduino Pro Mini

Take the libraries you need from the repository, use those, defined in the sketch.

Downloads

Test the Device Before Final Touches

IMG_20181225_131321.jpg
IMG_20181225_131311.jpg
IMG_20181225_131328.jpg
IMG_20181225_131410.jpg
IMG_20181225_131347.jpg

The device is perfect, mine is calibrated -4*C, i used my Toshiba air conditioner, 2 simple walled thermometers, and two digital thermometers for calibrate it. If your sensor measure different values, you can now modify it.

Interface Preview

IMG_20181225_150919.jpg
IMG_20181225_150657.jpg
IMG_20181225_150515.jpg
IMG_20181224_181730.jpg
home_page_warm.jpg
menu_page.jpg
temp_page.jpg
home_page_cold.jpg
about_page.jpg
battery_page.jpg
home_page_normal.jpg
IMG_20181224_231649.jpg
IMG_20181225_150501.jpg
IMG_20181225_150824.jpg

Dont forget to edit the Firmware info in the init section of the code to show your credentials or left it as it is.

Finish Project

Home Thermometer using Arduino Mini and TFT Display