Awesome
STM32 Energy Monitoring
The STM32 platform is a family of microcontrollers based on the Arm Cortex M processor, offering among many powerful features, plenty of 12-bit analog inputs and high speed sampling, making them particularly suitable for energy monitoring applications.
The following resources are a work in progress guide to using the STM32 platform for energy monitoring, being written as part of development work into the next generation of OpenEnergyMonitor hardware. To be included as a section in http://learn.openenergymonitor.org
OpenEnergyMonitor Forum threads:
Getting started: STM32 (Arduino integration)
If you are familiar with the Arduino platform getting the basics working using the familiarity of the Arduino IDE and the STM32Dunio Arduino integration is a good place to start.
- 1. Blinking an LED using the NUCLEO-F303RE Development board & STM32Duino
- 2. Basic NUCLEO-F303RE energy monitor using an EmonTxShield & EmonLib discreet sampling STM32Duino library
Introducing STM32CubeMX
ADC access using the Arduino analogRead command gives limited performance, its possible to sample much faster across many channels by using the lower level STM32 HAL (Hardware Access Layer) provided by ST. The development pathway to access these features is different and quite daunting if your primarily familiar with the Arduino platform. There is a tool called STM32CubeMX which is a kind of project builder that you can use to generate the initial outline of your project, from there you can enter your own 'user code' into the relevant placeholders in the generated project. The following set of guides give an introduction to this process:
Hardware
Notes on hardware development and initial designs:
STM32-pi_basic
- Eagle design 01
- Prototype 1, breadboard, voltage follower & anti-alias
- STM32-pi_basic eagle design 02
- STM32-pi_basic eagle design 03
- STM32-pi_basic eagle design 04
- Design Notes v4
- STM32-pi_basic eagle design 05
STM32-pi_full
Misc
Firmware Examples
Firmware examples included in this repository:
- 1. Blink
- 2. ADC
- 3. DMA
- 4. Emon: EmonTxShield Voltage and CT1 current measurement, single ADC example.
- 5. Emon1CT: EmonTxShield Voltage (ADC1) and CT3 current measurement (ADC2) example.
- 6. Emon1CT_ds18b20: EmonTxShield Voltage (ADC1) and CT3 current measurement (ADC2) example with DS18B20 temperature measurement.
- 7. Emon3CT: EmonTxShield Voltage (ADC1) and 3x CT inputs on ADC2.
- 8. Emon3CT_CB: Firmware for Hardware/stm32-pi_basic/5
- 9. Emon3CT_CB_v2: Firmware for Hardware/stm32-pi_basic/5 v2.
- 10. Emon3CT_RFM69: EmonTxShield Voltage (ADC1), 3x CT inputs on ADC2 and RFM69 support.
- 11. Emon3CT_VET: Basic firmware for Hardware/stm32-pi_full v2 by Trystan Lea.
- 12. emonTxshield_dBC (v13): Mutli-channel energy monitor example firmware thanks to @dBC see https://community.openenergymonitor.org/t/stm32-development/6815/232
- 13. RFM69: RFM69 library and examples.
- 14. MBUS: Example of reading data from an MBUS meter using Serial and DMA's.
STM32 Pi Full
- STM32 pi v0.7 firmware basics
- Sombrero_VB_Blink
- Sombrero_VE_ADC-test
- Sombrero_VE_Blink
- Sombrero_VE_Working5