You can access the source code files via this link.
This project explores the precision power monitoring capabilities facilitated by the STM32 ADC in conjunction with the ACS712 Hall Effect-Based Current Sensor. Much like a skilled conductor guiding an orchestra, this combination harmoniously integrates to deliver precise and efficient power monitoring solutions in embedded systems.
The ACS712 sensor can be used by developers to make power monitoring easier with the STM32 ADC at its core. By combining the ADC's strong features with the ACS712's precise measurements, analyzing power usage in embedded systems can be made simpler and more reliable.
This integration enables real-time monitoring of power consumption across diverse applications. By optimizing the ADC's configuration and utilizing the ACS712's accurate measurements, developers can tailor power monitoring solutions to meet specific project requirements effectively.
From industrial automation to IoT deployments, the STM32 ADC and ACS712 Hall Effect-Based Current Sensor present a robust solution for mastering power monitoring in embedded systems.
To begin this project, we'll first activate Continuous Conversion mode. Next, we'll set up the ADC for regular mode conversion. Finally, we'll establish UART communication to send out both the ADC readings and system status
Step One:- Open CubeMX & Create New Project Choose The Target MCU STM32F103C6 & Double-Click Its Name
- Go To The Clock Configuration & Set The System Clock To 8MHz
Configuration for the
ADC
Mode:
- In the Categories tab, select the [ADC1, enable IN9]
- In the Parameter settings tab, ADC Settings : Enable Continuous Conversion Mode
- In the Parameter settings tab, ADC_Regular_Conversion Mode: [Enabler Regular Conversion Mode & Number of Conversio : 1 & External Trigger Conversion source : Regular Conversion launched by software & Rank1: channel : 9, sympling Time :1.5 Cycles]
Configuration for the
UART
Mode:
- Enable USART1 Module (Asynchronous Mode)
- Set the USART1 communication parameters (baud rate = 115200, parity=NON, stop bits =1, and word length =8bits)
- Generate The Initialization Code & Open The Project In CubeIDE
- Write The Application Layer Code
- Open Proteus & Create New Project and click next
- Click on Pick Device
- Search for STM32F103C6 & ACS712 & BATTERY & CAP
- Click on Virtual Instruments Mode then choose VIRTUAL TERMINAL & DC AMPERMETRE
- Click on Terminal Mode then choose (DEFAULT & POWER &GROUND)
- finally make the circuit below and start the simulation
If you have any questions or suggestions don't hesitate to leave a comment below
Comments