0

I'm new to the Raspberry Pi community and need to power a 1v motor however, I can not figure out how to output such power.

Here is all of ,my code if you need it:

from machine 
import Pin
import time

led=Pin(25,Pin.OUT)
Motor=Pin(15,Pin.OUT)
print("working!")
for i in range (3):
    Motor.value(1)
    led.value(1)
    time.sleep(0.5)
    Motor.value(0)
    led.value(0)
    time.sleep(1)
    
Motor.value(0)
led.value(0) 
3
  • I'm not sure what you are asking. Perhaps you could edit more detail into your question and describe what kit you are using and what you are trying to achieve. It seems more like an electronics question at the moment.
    – joan
    Aug 5, 2021 at 7:40
  • I have read that it is possible to increase the output using software, but I could never find out how. Aug 5, 2021 at 19:24
  • If you mean adjusting the voltage of a GPIO pin, that doesn't seem possible. You can only control on and off, though that implies you can program a PWM signal.
    – Josh Zhang
    Aug 5, 2021 at 19:32

1 Answer 1

1

You cannot control the output power of the Pi, however you can turn it on or off and even read its current state. What you want is a MOSFET to drive the motor. This is a sample circuit that you can use. The 12V can be whatever your motor needs. It is important that the grounds be connected and that motor is powered by a external power supply, not the Pi. This simple circuit will allow you to control the motor's speed by PWMing the output pin. Just a note, this inverts the signal so A high on the output turns on the MOSFET pulling the output low. You can skip the diode if you use a MOSFET with an appropriate UIS (valanch) rating. Hopefully this answers your question. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.