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
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
If you are interested in project features and development watch above videos
Connections
Nokia 5110:
- RST to D9
- CS/CE to D10
- DC to D8
- MOSI/DIN to D11
- SCK/CLK to D13
- VCC to Arduino VCC
- LIGHT to D6
- GND to GND
DHT11:
- VCC to VCC
- DATA to D14
- NC
- 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)
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)