cancel
Showing results for 
Search instead for 
Did you mean: 

measurement of currents using ACS172 on STM32f407VG

VTOL_Aviations
Associate II

Hai ,

my name is Dattu i am working on a project which involves measurement of current using ADC on STM32f407VG to achieve this i am using a 30A ACS712 sensor i have interfaced the sensor but when i am running the program i am getting a constant value like 1 or 0 so any can help with the interfacing issues i am not using a divider circuit even if i use i am getting same issue

Thankyou in advance

11 REPLIES 11
Ozone
Lead

>... measurement of current using ADC on STM32f407VG to achieve this i am using a 30A ACS712 sensor ...

I am not sure if this sensor is a good choice.

The datasheet states:

>... 66 to 185 mV/A output sensitivity ...

For a F407 drawing less then 200mA, the sensor range seems a bit (2 orders of magnitude) off.

On top of that, the datasheets states "not recommended for new designs".

TDK
Guru

What value are you expecting? How much current is going through the sensor? Maybe that's just what the reading actually is.

If you feel a post has answered your question, please click "Accept as Solution".

Did you measure the output of the ACS712, using a multimeter, or better, oscilloscope?

JW

I am using a digital multimeter to measure the output i am able to see output value as 0.59/0.65 constantly

do you mean that i cannot use ACS172 sensor on stm32f407vg board and in that case do i have any other alternative to measure current on stm32f407vg like any sensors or do i need to build my own circuit

thankyou

the output which i expect should vary according to the change in voltage (or) a constant voltage with variable load i have tried both the ways in case if this sensor is not appropriate for this task how can i proceed further my final aim is to measure current across load using adc on stm32f407 vg board

Do some rough estimations. A STM32F407 draws about 100mA, which is 0,3% of the sensor's range.

This gives you about 7..18mV sensor output signal, which uses at most 4 bits of the 12-bit ADC signal of 3.3V.

I would call this a bad choice.

do i have any alternatives if so please guide me

So the the ADC is not set up properly. In debugger, check in respective GPIO_MODER if the pin is set tp Analog. Read out and check the ADC registers.

JW