Open OBD datalogger

This is a fully open-source car datalogger that reads engine data using the OBD2 interface in real time and stores it on an SD card. It also stores GPS data. All communication is done directly by the MCU without a translator chip like ELM327 or STN1110. The datalogger supports all CAN and K-Line OBD2 protocols. All hardware fits into an off-the-shelf OBD2 connector enclosure.

This project is available on Github.

Continue reading “Open OBD datalogger”

Making graphics and fonts for embedded systems

Microcontroller systems with graphical displays require a way to display text. In case of alphanumeric displays (like HD44780) it is easy – just send your ASCII bytes to the display. Graphical displays operate on individual pixels, so firmware must generate the graphics and texts on the fly.

In this post I show the complete multi-step process from a TrueType (.ttf) font file to autogenerated C code that can be used by a graphics library to display texts on a microcontroller. All code (including the embedded graphics library) is available on Github.
Continue reading “Making graphics and fonts for embedded systems”

Reading OBD2 data without ELM327, part 2 – K-Line

K-Line is another popular OBD2 interfacing standard, that has been used in European cars before CAN bus became common. There are a couple of physical variations (K-line, K+L, KKL) and slightly different protocols (KWP2000 or Keyword Protocol, and ISO 9141) running on those lines. Basically all you need to talk to an older car is an MCU with a UART and a single transistor. 🙂
Continue reading “Reading OBD2 data without ELM327, part 2 – K-Line”

Reading OBD2 data without ELM327, part 1 – CAN

All modern cars have an OBD2 diagnostic connector that allows reading many engine and drivetrain parameters like RPM, vehicle speed, temperatures etc.

Most of car interfaces use a special protocol translating chip like ELM327 or STN1110 to convert different vehicle protocols (that depend on the age and brand of the car) into an easier to use serial protocol with AT-commands.

I wanted to build a datalogger that would fit into a OBD2 connector. There was no space to fit my microcontroller and another chip to do protocol conversion, so I investigated and reverse-engineered the most common OBD2 protocols to be able to implement them directly on my MCU.
Continue reading “Reading OBD2 data without ELM327, part 1 – CAN”

B6AC battery charger teardown


I recently got some discarded NiCd batteries from emergency lighting fixtures (5 cells, 7 Ah) and I started looking for a way to check if they might still work. While searching for chargers I found model B6AC that: charges automatically almost any battery chemistry (various lithium, NiCd, NiMH, lead-acid), can discharge batteries in a controlled way, balance li-ion battery cells, can cycle the battery through several charges and discharges, indicates the charge and discharge capacity (and probably some more features I still do not realize).
Continue reading “B6AC battery charger teardown”