I have a raspberry pi. I want to control a 12 volt motor (low torque). I believe the motor only has two connectors, and when it is powered it goes. The motor goes off of 12 volts where as the Raspberry Pi is only 5 volts.

I also want to be able to power the motor and the raspberry pi in one unit. I don't know what this yellow box is. For example, do I split the 12 volts DC coming in, and send 12 volts to the motor and then do some resisters to lower the 12 volts to 5 volts to power the raspberry pi? What about the ground for the motor? Can it be connected back to the yellow box too? (what ever the yellow box is)

For more clarification:

[![enter image description here](https://i.stack.imgur.com/lIovC.png)](https://i.stack.imgur.com/lIovC.png)