X-NUCLEO-IKS01A3 problem connecting with dc motors

I am trying to use X-NUCLEO-IKS01A3 expansion board for a robot car because I need accelerometer. I connected H Bridge cables to the expansion board and the compile passed but the motors does not move. What should I do ?

(p.s I added required libraries and completed the decleration of the used pins : “*XNucleoIKS01A3 mems_expansion_board = XNucleoIKS01A3::instance(D0, D1, D3, D7, D8, D13, D14)”)

Do you think you’d be able to add a schematic or picture of your setup? This will allow us to see how you have everything connected.


I made a schematic to see clearly the connections

Hi,

It looks like your connection is ok but your software setup is wrong.

according to the informations from the expansion board’s page for a communication with the mems expansion board you need to use
these pins XNucleoIKS01A3::instance(D14, D15, D4, D5, A3, D6, A4);
Please check look Hello world for the expansion board.

For a H-bridge control you need another library, you can start read here. Also you need to use different pins then for the mems expansion board.

BR, Jan

1 Like

I have added motor control libraries and the motors work properly without the expansion board. For the control of DC motors I need pwm pins which are not included on expansion board according to the schematic (X-NUCLEO-IKS01A3 Motion MEMS and Environmental Sensor | Mbed) so can I only use PB_0 and PB_11 pins which belong to nucleo because they are not covered from expansion board, or they are not operational. Could I use also digital pins like D0,D1,D7,D8 for IN1,IN2 etc of h bridge and if yes how should they be declared according to instance function. The pins you mentioned above (XNucleoIKS01A3::instance(D14, D15, D4, D5, A3, D6, A4)) are for the sensors but I don’t need to declare them all I suppose because I need only accelerometer for my project.

Arispant, you not need (you can not because it is not possible ) declare pins which is not used by Moms ex. board in the constructor because these pins are only wired through the PCB. So the pins A0, A1, D0, D1, D7, D8 and D13 are free to use for another connection like you want.

When you want to use pins only for ACC I am not sure about the constructor let you pass NULL instead of the PIN NAME, probably not. And you will still need check the datasheet of the board about how set solder bridge and jumpers.

Attention pin PB_0 is used for LED1 so avoid to use LED1 when you want to use this pin for PWM output.

BR, Jan

OK it worked without changing instance function, I just declared pins according to the schematic. PB_0 worked as PWM, too as this link shows (NUCLEO-F207ZG | Mbed).