Summary of microSD ATmega32 Data-Logger
This project logs data from ATmega32’s 8-channel ADC (one channel for an LM35 temperature sensor, others for voltages or sensors) to a microSD card formatted FAT32, storing data as CSV files readable by Excel. It includes RTC for timestamping, RS232 for initial RTC setup and debugging, and a push-button plus LEDs for control and status. The microSD module provides 3.3V regulation and level shifting so it works with 5V microcontroller signals.
Parts used in the ATmega32 microSD Data-Logger:
- ATmega32 microcontroller
- microSD module (with microSD socket, on-board 3.3V regulator, 5V-3.3V level converter)
- microSD card
- RTC module (real-time clock)
- LM35 temperature sensor
- RS232 interface/cable
- Two LEDs (power and recording indicators)
- Push-button (start-stop recording)
- Power supply/cable (5V)
- Circuit connections/wiring and supporting passive components
Aim of this project is to present a way to store a large quantity of data into microSD card in files with FAT32 format. Here, ATmega32 is used for data collection and microSD interface. The data is received from in-build 8-channel ADC of ATmega32. One channel is used for reading temperature from LM35 sensor and remaining channels are used for simply reading voltages and storing them.
This project can be used to interface 8 different sensors with ADC of ATmega32, similar to the LM35 used here. The data is stored in CSV (comma separated values) format, which can be read using a PC/Laptop with Microsoft Excel or other compatible software. A snapshot of the excel file is given later in this post.
This project is an example of how to use the microSD FAT32 library presented in my earlier post. In that post, the files were created using hyper-terminal and entering data with the PC keyboard, since that demonstrates the file creation and it’s easy to debug. But many users have requested to make the file creation independent of the terminal, done inside the microcontroller, so I’m showing here how to use those functions independent of terminal. If you have directly landed on this page, it would be more helpful if you visit the original post first as it would be a better starting place for learning SD or FAT32 functions.
Here is the schematic (click on the images for larger view or download PDF):
The project contains RTC interface (for date and time storage), RS232 (for connection with PC) and a microSD module. Here, the hyper-terminal connection is required only for setting RTC date and time. Once the date/time are set, the RS232 connection is not required anymore for normal data-logging operation (It can be used for debugging purpose if there is a problem).
The microSD module used here is from eXtreme Electronics.
The module is shown in the figure here. Other than the microSD socket, this low-cost module also contains on-board 3.3v regulator for the microSD card, a 5v-3.3v level converter and other safety features required for the card. This module is used here as it provides a stable interface and makes the the card compatible with 5v supply and 5v signals of microcontroller.
The module is available at: http://store.extremeelectronics.co.in/MicroSD-TF-Module.html
The schematic also shows two LEDs and a push-button. The LEDs are used for indications of power and recording and the push-button is used to start-stop recording.
Operation of the circuit:
———————————————–
For setting RTC date/time (or for debugging mode):
- Connect the microSD module, insert the microSD card
- Connect the RS232 cable with the circuit. Set-up hyper terminal with 19200 baud, no parity, 8-bit data, 1 stop-bit and flow-control as ‘None’
- Connect the power cable and power on the circuit while keeping the push-button pressed
- Green LED will glow in the circuit board
- A menu will be displayed on the Hyper terminal as shown in the figure below. Select desired option and follow the displayed instructions
- When date/time is set or debugging done, select option ‘0’ to come out of the menu and start functioning a s data-logger
- At this point, the RS232 cable can be removed.
For more details click: microSD ATmega32 Data-Logger
- How is data stored on the microSD card?
Data is stored in CSV (comma separated values) files on a FAT32-formatted microSD card. - Can the project timestamp logged data?
Yes, the project includes an RTC interface for date and time storage. - How many ADC channels are used and what for?
The ATmega32 in-build 8-channel ADC is used; one channel reads temperature from LM35 and the remaining channels read voltages or other sensors. - Is RS232 required during normal logging operation?
No, RS232 is required only for setting RTC date/time or debugging; it can be removed for normal data-logging. - What is the microSD module advantage?
The microSD module includes a 3.3V regulator and a 5V-3.3V level converter, making the card compatible with 5V supply and microcontroller signals. - How do you set RTC date and time?
Connect the microSD module and RS232, hold the push-button while powering on, use HyperTerminal at 19200 baud to access the menu, then select the date/time option. - What are the LED and push-button functions?
LEDs indicate power and recording status; the push-button is used to start and stop recording and to enter RTC setup when held during power on. - What software can read the logged files?
CSV files can be read using Microsoft Excel or other compatible software.

