Saturday, 11 January 2025

Bluetooth Low Energy 12V Car Battery Voltage Logger

 If you are unsure about your car battery and charger capacity, you can use this diy battery logger in 12V plugin connector to measure it.

For this logger I used STM8S103 module and HM-10 Bluetooth Low Energy module and Android Smartphone as displaying device.

STM8S103 bluepill module:

HM-10 BLE module
Android application screenshot:





Hardware schematic diagram drawn with KiCad:



STM8S103 Firmware was developed with ST Visual Studio with COSMIC C compiler in Windows PC.  ST Link V2 as programming /debugging interface.

Kicad 3D images of project hardware:


And actual prototype images:




Android application screenshots of battery voltage logging:








Project files  for KiCad , ST Visual Studio and Android apk to download:




Thursday, 9 January 2025

STM8S Bluetooth Low Energy oscilloscope

Simple and cheap DIY oscilloscope can be done with STM8S103 module and HM-10 Bluetooth Low Energy module using Android smartphone as display.
   STM8S103 module:



JDY-08 BLE module need HM-10 version 709 firmware and set up to 9600 baud UART mode.
Firmware can be programmed to  with TI CC debugger.
More info ,how to do:


Oscilloscope schematic drawn with Kicad:









































STM8S  firmware was developed using ST Microelectronics Visual Studio (Windows) using free license COSMIC compiler and ST Link V2 for program and debug interface.

This 1 channel 200 kS / 5 us oscilloscope  is battery powered (usb charging).
Including following features:
  - 1 channel 5us ... 5ms period 240 samples
  - max , min voltage display
  - AUTO / SINGLE  trigger
  - AC/DC select
  - LV / HV (high voltage 400V probe needed) attenuator select
  - sine wave generator
  - rising/falling trigger
  - Automatic power off

Hardware prototype with 3D printed custom covers:





















Android application was developed with Android Studio.

Here are some screen captures about application:







High Voltage Sine measure:



Modified Sine Wave inverter output measure:



Project files for Kicad , ST Visual Studio and Android app can be downloaded from:

Wednesday, 8 January 2025

BluePill (STM32) BLE oscilloscope

 Bluetooth Low Energy wireless interface can be used to transfer measurement data to Android smartphone.  My simple digital oscilloscope is done with 

 STM32F103C8T6 Core Board Development Board Bluepill



and Bluetooth low energy module  HM-10 :




Kicad drawn schematic diagram for this bluetooth low energy oscilloscope :




Designed also PCB in Kicad and was able to show these 3D images:





Kicad project is included in GitHub repository:
https://github.com/joukohak/stm32_blescope

Repository also includes  STM32 CubeIDE project  and  Android  apk.

Implemented hardware and 3D printed cover like this:






STM32 firmware was developed in Linux Mint PC with STM32 CubeIDE developement application and interface was ST Link V2:


Android application was developed with Android Studio.

Some screen captures of Android application:











Features include:

- AUTO triggering
- Single trigger
- START trigger rising/falling trigger level setting on channel 1
- 2 channel 1000 samples with period setting from 0.5us to 15ms (2MSps to 16.7 Sps).
- AC/DC select
- sine/triangle wave generator
- Max/Min / trigger Voltage display



Tuesday, 26 December 2023

Bluetooth Low Energy motion sensor with nRF 51822 module

NRF 51822 is a very low power BLE System On Chip , that allows to use as Bluetooth Low Energy peripheral connected to Passive Infrared Receiver module.


PIR module used:


Schematic diagram of ble motion sensor:

HW build to 3D printed case:






Software for NRF51822 was developed with Arduino IDE:



NRF connect android application could be used  to check Bluetooth Low Energy  UART services and characteristics:



BleCameraNRF  android application is used to start motion detection  from Nrf51 module, check battery, temp and solar log.




Project files can be found from github:

https://github.com/joukohak/nrf51pir




Saturday, 2 July 2022

NRF 51822 BLE module sensor with Arduino IDE

Radioland  BLE beacon module datasheet:


can be reprogrammed with Arduino IDE and ST Link V2  to special remote button  application.

SWDIO     ->   SWDIO
SWCLK    ->   SWCLK
3.3V         ->   BAT+
GND        ->   BAT-














3D printed cover for BLE module:






 Arduino IDE libraries for NRF51822  and instructions can be found from:

https://github.com/sandeepmistry/arduino-nRF5


Nrf51822 Bluetooth low energy stack (Softdevice)  version S130 is required to download and flash to device before BLE application software can be programmed :

Selecting a SoftDevice

SoftDevices contain the BLE stack and housekeeping, and must be downloaded once before a sketch using BLE can be loaded. The SD consumes ~5k of Ram + some extra based on actual BLE configuration.

  • SoftDevice S130 v2.0.1 supports Revision 3 of nRF51 in peripheral and central role. It is 108k in size.

Flashing a SoftDevice

  1. cd <SKETCHBOOK>, where <SKETCHBOOK> is your Arduino Sketch folder:
  • OS X: ~/Documents/Arduino
  • Linux: ~/Arduino
  • Windows: ~/Documents/Arduino
  1. Create the following directories: tools/nRF5FlashSoftDevice/tool/
  2. Download nRF5FlashSoftDevice.jar to <SKETCHBOOK>/tools/nRF5FlashSoftDevice/tool/
  3. Restart the Arduino IDE
  4. Select your nRF board from the Tools -> Board menu
  5. Select a SoftDevice from the Tools -> "SoftDevice: " menu
  6. Select a Programmer (J-Link, ST-Link V2, or CMSIS-DAP) from the Tools -> "Programmer: " menu
  7. Select Tools -> nRF5 Flash SoftDevice
  8. Read license agreement
  9. Click "Accept" to accept license and continue, or "Decline" to decline and abort
  10. If accepted, SoftDevice binary will be flashed to the board

There are some examples in

Arduino BLEPeripheral library:





My own Arduino projects for NRF51822 can be downloaded from:



The project real time clock button is nrf51822_sensor_rtc   and it requires to modify delay.h and delay.c in Sandeep Mistry's nRF51 library, because it is using nRF51822 device RTC1  counter, that is also used in Sandeep's library ( millis() and delay() ).


With nRF Connect  Android application nrf51822_sensor_rtc  project features can verified:




Services and Characteristics defined in Arduino code:


BLEService mainBleService("c83e0fa6-f5b7-473a-a2a2-3957117a2f58");
BLEUnsignedIntCharacteristic sensorCharacteristic("8afc0cf0-19bf-4bd2-9413-6e7259765edf", BLERead | BLEWrite | BLENotify); BLEService batteryService("180F"); BLEUnsignedCharCharacteristic batteryLevelCharacteristic("2A19", BLERead);



Can be verified on nRF Connect application:     - battery level is actually 20x mV instead %     - sensorCharacteristic when button pressed shows 32 bit (4 bytes) data including:         - seconds,minutes,hours and button counter value(byte)