Arduino Datalogger With RTC, Nokia LCD and Encoder

by cbm80amiga in Circuits > Arduino

10417 Views, 38 Favorites, 0 Comments

Arduino Datalogger With RTC, Nokia LCD and Encoder

lcd0.jpg
lcd1.jpg
lcd2.jpg
lcd3.jpg
lcd4.jpg
lcd6.jpg
lcd7.jpg
lcd8.jpg

Parts:

  • Arduino Nano or Arduino Pro Mini
  • Nokia 5110 84x48 LCD
  • DHT11 temperature/humidity sensor
  • DS1307 or DS3231 RTC module with built-in AT24C32 EEPROM
  • Cheap encoder with 3 debouncing capacitors

Features:

  • GUI based on Nokia LCD and encoder
  • temperature, humidity, date and time can be stored every 1 to 120 minutes
  • each record is compressed to 39 bitfield only so 32kbit flash (4KB) can fit 819 records
  • optional AT24C256 chip can store even 6553 records
  • deep sleep used to save battery, ATMEGA is woken up by interrupts mainly
  • DHT11 is powered only during measurements
  • powered by single 18650 or other lithium cell
  • a few display "faces"
  • 6 fonts
  • battery level meter
  • data review and graphs
  • min/max with date/time
  • all recorded data dump via serial port in CSV format
  • LCD back light
  • own fast and low resource N5110 library used
  • own low level DHT11 data reading
  • own DS1307, DS3231 and AT24C32 I2C EEPROM handling code
  • the code uses almost all 32KB Arduino flash
  • all internal registers can be stored in external EEPROM or DS1307 internal RAM

Data compression

Following values are recorded:

  • time (hr,min)
  • date (d,m,y)
  • temperature
  • humidity

Above data is compressed to 39-bit bitfield:

  • hr 0..23 -> 5b
  • min 0..59 -> 6b
  • d 1..31 -> 5b
  • m 1..12 -> 4b
  • y 2018..2021 -> 2b
  • temp -40.0..64.0 -> 1024values = 10b
  • hum 0..100 -> 7b
  • total 39 bits

Only 5 bytes are used for 1 record:

bits   76543210    
byte0 hhhhhmmm byte1 mmmddddd byte2 mmmmyytt byte3 tttttttt byte4 hhhhhhh0

Watch Videos

Arduino Datalogger with GUI
Arduino Datalogger with GUI update, DS3231 support

If you are interested in project features and development watch above videos

Connections

datalogger_scheme1.png
breadboard.jpg
encoder.jpg

Nokia 5110:

  1. RST to D9
  2. CS/CE to D10
  3. DC to D8
  4. MOSI/DIN to D11
  5. SCK/CLK to D13
  6. VCC to Arduino VCC
  7. LIGHT to D6
  8. GND to GND

DHT11:

  1. VCC to VCC
  2. DATA to D14
  3. NC
  4. GND to GND

RTC DS1307/DS3231 and AT24C32 EEPROM:

  • Arduino I2C (A4/A5)

Encoder:

  • PinA to D2
  • PinB to D4
  • Button to D3

RTC Modules "LowPower" Modifications (optional)

ds1307mod2.png
ds3231mod.png

In DS1307 cut 2 traces, remove R6 and make solder joint

In DS3231 cut 2 traces

Firmware

Arduino sketch:

https://github.com/cbm80amiga/N5110_DHT11_logger_G...

N5110 library:

https://github.com/cbm80amiga/N5110_SPI

Configuration options:

#define USE_DS3231 -> to use DS3231 instead of DS1307

#define REG_IN_RTCRAM -> registers are stored in RTC RAM (only for DS1307)