Skip to main content
VTOL_Aviations
Associate III
October 21, 2019
Question

measurement of currents using ACS172 on STM32f407VG

  • October 21, 2019
  • 4 replies
  • 2943 views

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

This topic has been closed for replies.

4 replies

Ozone
Principal
October 21, 2019

>... 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".

VTOL_Aviations
Associate III
October 22, 2019

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

Ozone
Principal
October 22, 2019

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.

TDK
October 21, 2019

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""."
VTOL_Aviations
Associate III
October 22, 2019

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

waclawek.jan
Super User
October 21, 2019

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

JW

VTOL_Aviations
Associate III
October 22, 2019

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

waclawek.jan
Super User
October 22, 2019

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