cancel
Showing results for 
Search instead for 
Did you mean: 

[STSPIN250] Monitor the current in real time?

sandhan26
Associate II

Can we connect SENSEA/SENSEB pins to microcontroller ADC inputs to monitor the current in real time?

1 ACCEPTED SOLUTION

Accepted Solutions
Dario CUCCHI
Senior II

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 !

View solution in original post

6 REPLIES 6
Dario CUCCHI
Senior II

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 !

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 ?​

@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 ?

Thanks a lot Dario for the wealth of information. I will try with an OpAmp.

sandhan26
Associate II

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?

Dario CUCCHI
Senior II

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 👍