Summary of SMA Solar readout – part 1
This article introduces the first part of a three-part series detailing a Bluetooth-enabled SMA solar inverter readout gadget. Designed as a birthday gift, the project uses an STM32F103 microcontroller and an HC05 Bluetooth module to fetch data from an SMA 5000TL inverter. The system displays readings on a 2x16 LCD via Mecrisp Forth code, featuring a 3D-printed enclosure and hardware watchdog capabilities.
Parts used in the SMA Solar Inverter Readout:
- STM32F103C8 board (or Blue Pill)
- 2x16 character LCD
- HC05 Bluetooth unit
- Micro-USB socket for power
- USB-to-serial adapter for development
- 3D-printed enclosure
- Mecrisp Forth software environment
This is the first post of a 3-part series about reading out an SMA solar inverter over Bluetooth and displaying some readings every few seconds. Long-time readers may remember the Solar at last weblog post from several years ago and the SMA Relay, based on a JeeNode v6. The Bluetooth readout code was derived from Stuart Pittaway’s Nanode SMA PV Monitor code.
This project is for a friend who’s birthday is coming up shortly, and who has the same SMA 5000TL inverter as I do – although it can probably be used with other models.
Here is the gadget, powered off 5V USB:

There’s no RF relay in this unit, although I may build a second one for use at JeeLabs, with an RFM69 instead of the LCD.
There are many sides to this project, i.e.
- µC choice: I’ll be using a low-cost STM32F103 board from AliExpress
- 2×16 character LCD, which is a bit old-school, but hey, it works…
- Bluetooth: I’ve selected a simple “HC05” unit, from eBay
- actual hardware connections
- talking to BT via the 2nd UART
- packet protocol encoding/decoding
- setting up permanent BT pairing
- formatted number display
- enabling the hardware watchdog
- automatic start on power-up
- a 3D-printed enclosure
The STM32F103C8 board in this unit is this one, but a Blue Pill would work just as well:

There’s a micro-USB socket on the bottom, but it can only be used for power (doh!) – the USB pins do not seem to be connected. So a USB-to-serial adapter will have to be used during development – no big deal.
The communication over Bluetooth uses the Serial Port Profile (SPP), but there’s a fairly obnoxious packet format on top, which needs to be generated before sending and decoded upon reception.
Here’s the basic packet structure:

The trick is to send out just the packets needed to obtain the desired readings, without getting into what those packet details mean. Luckily, all the hard work has been done years ago, for the SMA Relay.
Since I’ll be using an STM32 with Mecrisp, the main task on the software side will be to port the code over to Forth and to add some basic stuff, e.g. output to the LCD display.
Speaking of which: the LCD driver is very simple, just three dozen lines of Forth code.
Source: SMA Solar readout – part 1
- What is the purpose of this project?
The project reads out an SMA solar inverter over Bluetooth and displays some readings every few seconds. - Can this project be used with other inverter models?
While designed for an SMA 5000TL, it can probably be used with other models. - How is the device powered?
The gadget is powered off 5V USB via a micro-USB socket that supports power only. - Which microcontroller is used in this unit?
A low-cost STM32F103 board from AliExpress is used, though a Blue Pill would work just as well. - What communication protocol does the Bluetooth use?
Communication over Bluetooth uses the Serial Port Profile (SPP). - What software environment is used for the STM32?
The main task on the software side involves porting code to Mecrisp, which is a Forth environment. - How many lines of code are in the LCD driver?
The LCD driver is very simple, consisting of just three dozen lines of Forth code. - Is there an RF relay in this specific unit?
No, there is no RF relay in this unit, although one may be built later with an RFM69 instead of the LCD.
