Arduino Mega 2560 Based Data Logging System with RTC, Dual LIDAR, OLED Display, and SD Card Storage
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates a real-time clock (RTC), two LIDAR sensors, a rotary encoder, an OLED display, a micro SD card module, and an Arduino Mega 2560 microcontroller. The Arduino Mega 2560 serves as the central processing unit, interfacing with the RTC for timekeeping, the LIDAR sensors for distance measurement, the rotary encoder for user input, the OLED display for data output, and the micro SD card module for data logging. The circuit is designed to operate on a 5V power supply, with common ground connections throughout the components.
Component List
RTC DS3231
- A real-time clock module for timekeeping.
- Pins: 32K, SQW, SCL, SDA, VCC, GND
Arduino Mega 2560
- A microcontroller board based on the ATmega2560.
- Pins: Numerous digital and analog pins, including IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
TF LUNA LIDAR (x2)
- Compact LIDAR sensors for distance measurement.
- Pins: power, RXD/SDA, TXD/SCL, GND, ICL, DATA SIG
Rotary Encoder
- An input device that provides rotational position feedback.
- Pins: GND, +, SW, DT, CLK
0.96" OLED
- A small display for visual data output.
- Pins: GND, VDD, SCK, SDA
Micro SD Card Module
- A module for reading and writing data to a micro SD card.
- Pins: cs, sck, mosi, miso, vcc, gnd
Wiring Details
RTC DS3231
- SCL -> Connected to Arduino Mega 2560 SCL
- SDA -> Connected to Arduino Mega 2560 SDA
- VCC -> Connected to 5V power supply
- GND -> Connected to common ground
Arduino Mega 2560
- SCL -> Connected to RTC DS3231 SCL, OLED SCK, and both TF LUNA LIDAR TXD/SCL
- SDA -> Connected to RTC DS3231 SDA, OLED SDA, and both TF LUNA LIDAR RXD/SDA
- D50 -> Connected to Micro SD Card Module miso
- D51 -> Connected to Micro SD Card Module mosi
- D52 -> Connected to Micro SD Card Module sck
- D53 -> Connected to Micro SD Card Module cs
- D2 PWM -> Connected to Rotary Encoder CLK
- D3 PWM -> Connected to Rotary Encoder DT
- D4 PWM -> Connected to Rotary Encoder SW
- 5V -> Connected to 5V power supply rail
- GND -> Connected to common ground
TF LUNA LIDAR
- power -> Connected to 5V power supply
- RXD/SDA -> Connected to Arduino Mega 2560 SDA
- TXD/SCL -> Connected to Arduino Mega 2560 SCL
- GND -> Connected to common ground
Rotary Encoder
-
- -> Connected to 5V power supply
- SW -> Connected to Arduino Mega 2560 D4 PWM
- DT -> Connected to Arduino Mega 2560 D3 PWM
- CLK -> Connected to Arduino Mega 2560 D2 PWM
- GND -> Connected to common ground
0.96" OLED
- VDD -> Connected to 5V power supply
- SCK -> Connected to Arduino Mega 2560 SCL
- SDA -> Connected to Arduino Mega 2560 SDA
- GND -> Connected to common ground
Micro SD Card Module
- cs -> Connected to Arduino Mega 2560 D53
- sck -> Connected to Arduino Mega 2560 D52
- mosi -> Connected to Arduino Mega 2560 D51
- miso -> Connected to Arduino Mega 2560 D50
- vcc -> Connected to 5V power supply
- gnd -> Connected to common ground
Documented Code
Arduino Mega 2560 Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code is a template and does not include specific functionality. It should be expanded to initialize the connected devices and implement the desired behavior of the circuit.