Uncategorized

pico motor

how to power motors correctly on raspberry pi pico

Ask Question

Asked today

Modified today

Viewed 12 times

1

This question was migrated from Super User because it can be answered on Raspberry Pi Stack Exchange. Migrated 7 hours ago.

I was using my raspberry pi pico and testing motors, and it worked just fine(pins was in GND + 3v3 pins). Then I wanted to use On/Off function in C, And i used the pin GP28_A2 to use it. But it wont turn on the motor. I used ampermeter and voltmeter, and everything was same(3.2volts 0.15-0.3amp) I dont know what to do, please help me.

gpio_init(28);
gpio_set_dir(28, GPIO_OUT);
gpio_put(28, 1);

c

Share

EditFollowCloseFlag

asked 7 hours ago

user avatar

StiglCZ

1122 bronze badges

Add a comment

1 Answer

Sorted by:

Reset to default                                              Highest score (default)                                                                   Date modified (newest first)                                                                   Date created (oldest first)                              

1

What I am understanding is you are using a GPIO pin connected to a motor to operate it, without any interface between the pin and the Pi. The results you are getting is exactly what I would expect, nothing. It is also highly possible you managed to destroy the GPIO pin as they are not designed to drive loads especially inductive ones.

The easiest solution would be to use preferably a non darlington NPN transistor rated at enough current and voltage to comfortably power the motor. Since I do not know the motor ratings etc I cannot recommend a transistor. I would suggest you use a NPN transistor something in the 1A or greater range, depending on motor rating. Connect the emitter to ground, the base to the GPIO using something in the 300 ohm range. The collector to the motor and the anode of your flyback diode. Connect the cathode of the diode and the other motor lead to the + supply. The + supply can be whatever is reasonable, it does not have to be 3v3, just be sure the grounds are connected.

Share

EditFollowFlag

answered 3 hours ago

user avatar

Gil

69733 silver badges44 bronze badges

Add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.