Close

The TinyDataLogger code is born

A project log for Solder Fume Extraction Station Deluxe - from scrap

Inhaling the solder fumes is terrible for the health. Maybe some old parts from my old PCs could supply some details for this project.

debinixDebinix 11/02/2022 at 15:060 Comments

## Project notes 2022-11-02 (The TinyDataLogger code is born)

Finally, the code is slowly coming together for logging battery charge and discharge values. The code consists of the following main function blocks.

- The menu finite state machine (FSM).
- NTP-based date/time retrieval.
- ADC input and calibration.
- The code that handles the single switch works with short and long presses to control the menu.
- The I2C display code for either a small 0.96" OLED or a 2x16 LCD. Modify the code to adapt other I2C displays.
- The SD-writer implementation.

In the upper half of the FSM is the three choices in the menu, i.e., Start Logging (Go), Paus (Cnt), and Finished (Hlt). The OLED display shows the measured battery value and a time counter in the lower part of the image. 

I used four color LEDs during the development to get a complementary visual indication for the correct state changes and the usual serial output in the Arduino IDE.


Implementing and testing the finite state machine for the menu and achieving a robust short/long single switch without bounces consumed most of my time. I will create a separate GitHub repository for the 'TinyDataLogger' since it may have a broader audience interested in trying this out.

Discussions