Control 12V DC motor with simulink

I would like to control a 12V DC motor using Simulink. The Simulink support package for Arduino works fine but limits the output to the 5V of the Arduino board. If I upgrade the Arduino with a shield then I'm not able anymore to use the Simulink support package. I had an idea of using a transistor and an external power supply. If I use a battery of 12 volts works fine but I would like to use outlet socket to avoid changing batteries. If I use a transformer with a transistor its not working, I think should be something related to the common ground that I can't figure out (any suggestions?).
I was also thinking of using a power boost from 5V to 12V. Is this a good idea?
If someone has a better and easier solution please let me know.
Thank you!

If you use a good 12V power supply (not jut a transformer) it should work just as well as a 12V battery.

If you say exactly what 12V “transformer” you tried and also what transistor you are using and provide a diagram showing how they are all connected then it will be easier to help.


This is a simple configuration that explains the problem(see attachments). Cable from the power supply-- motor-- the ground of Arduino.
(using both cables of the power supply makes the motor run, but not using Arduino)

What are those pictures supposed to show? There is no transistor in the pictures and you’ve given no details of the motor or transistor or the actual circuit you’re intending to use.

A battery has 2 connections + and - and you say you had it working with that. The power supply has 2 connections + and -. Connect them exactly as you connected the battery. If it doesn’t work then my guess is that your power supply is not powerful enough to run the motor. 600mA is not a lot but with no details of the motor it’s just a guess.