good night does anyone know how to set up an acs712-30A as current sensor? another question, is necessary to remove the diode diode from the circuit? I am using the PB0 and PB1 ports for THE CURRENT SENSORS ANY PROBLEM IN THIS ?
Good morning @marcusbeche !
Where is this schematic from? Is it your design? Do you know what type of diode this is?
I don’t quite understand the idea of the diode, I must admit. From my point of view this will cause C13 to charge, but not discharge (except via the current sense pin)? Is this circuit known to work?
PB0 and PB1 of which MCU type?
Good morning @runger
diodes are 1n4148 and the CPU is ST32F103C8. You’re right. should have a discharge resistor I forgot to put it. I think I should remove the diode. What do you think of that? thanks for the remark.
That diode there is wrong. Also having a resistor, depending on size and where you put it, will turn the circuit to an RC filter at best and useless at worst.
Remove the diode, and leave the 100nF there as a decoupling capacitor and place it as close next to the analog pin of the MCU as possible. Also, depending on your motor speed, 100nF may be too large at high speeds, and worsen your timing, may want to go for 10nF — I see you already put a 1nF filter directly into the sensor anyways.
Third, I see you feed 5V and pull 3.3V, you must ensure the voltage divider is using 0.1% or 0.05% high precision, extra low temperature distortion resistors, which are quite expensive, and also you need a reference divider circuit with the exact same resistors, depending on your MCU for analog reference signal. Also, using a voltage divider, the decoupling capacitor, in combination with the resistors from the divider, depending on the length of the trace and its inductance, will still act as an RLC filter anyway, so be prepared for some signal delay. That’s not a bad thing, you will get a smoother signal, just be prepared about what to expect from this.
Not sure what you mean by this.
Thanks SO MUCH for your help, @Valentine. great observations. I will implement. Thank you very much