2021-05-16 08:12 PM
Can we connect SENSEA/SENSEB pins to microcontroller ADC inputs to monitor the current in real time?
Solved! Go to Solution.
2021-05-17 12:52 AM
Hi @sandhan26,
yes you can connect an ADC on the SENSEA/SENSEB pins, so you can sample the voltage on the sense resistor and monitor current in real time.
Since you have small signals on it, my suggestion is to amplify the signal before the acquisition.
Have a nice day !
2021-05-17 12:52 AM
Hi @sandhan26,
yes you can connect an ADC on the SENSEA/SENSEB pins, so you can sample the voltage on the sense resistor and monitor current in real time.
Since you have small signals on it, my suggestion is to amplify the signal before the acquisition.
Have a nice day !
2021-05-17 05:40 AM
Hi Dario,
Than for the information. I have a x-nucleo-ihm013a1. This board doesn't have the sense pins connected to any headers.
So, I guess we need to make our own board for testing. Do you have any suggestions on this ?
2021-05-17 06:12 AM
@sandhan26 (Community Member) ,
the X-NUCLEO-IHM13A1 is designed to use the internal PWM current control of the STSPIN250; this is the reason why there is no header connected to the sense resistor.
I would do some test using the board that you have, modifying it in this way:
you can solder two small wires on the sense resistor (R6 or R8), twist and connect them the inputs of an OpAmp (it could be a simple handmade circuit mounted on a matrix board).
You can supply the opamp using the 3.3V connector CN6 and acquire its output using an ADC channel on one of the free contacts on CN8.
If you need some suggestion about OpAmp, check this part number: TSV911
Does this solution sounds good for you ?
2021-05-17 08:46 AM
Thanks a lot Dario for the wealth of information. I will try with an OpAmp.
2021-05-18 01:44 AM
Hi Dario, I do have a few additional queries, so I was checking the datasheets for the STSPIN250 and x-nucleo-ihm013a1. The x-nucleo-ihm013a1 has two 68 Ohms in parallel at the sense pin. Which gives us max load current of 100mA with 3.3V Vref.
Our target motor has stall current of 360mA. So I guess we need to have a 10ohm 1%, 2W resistor sense resistor?
2021-05-19 09:32 AM
Hi @sandhan26,
The two resistors are 0.68 ohm, so the actual resistance is 0.34 ohm.
In your case, I suggest to remove one of the two sense resistors so you get 0.68 ohm.
Setting VREF = 0.245V the internal PMW current control limits the current at 0.245V/0.68Ohm = 360 mA which is the stall current of your motor.
Power on shunt resistor is not a concern here (less than 100 mW).
Note that the REF pin has a recommended operating voltage up to 0.5V, so it is not possible to connect it at 3.3V (see on the datasheet in the recommended operating conditions table).
On the free pads of the removed shunt, you can solder the two wires of the OpAmp, to measure the current in real-time.
I think it will make the soldering easier :thumbs_up: