Circuits designed for Arduino working on Raspberry Pi (and vice versa)


I’m new to electronics, so I’m sorry if this is a silly question, but I’m having some trouble making a circuit built for an Arduino work on the Raspberry Pi.

The circuit in question is designed to power a small DC motor using a MOSFET, and is almost exactly the same as project 9 in the Arduino starter kit:

… except mine doesn’t use the button, but instead has the pin switch to HIGH for 5 seconds, then switch to LOW for the next 5 repetitively.

Anyway, this works fine, so I figured I should be able to substitute pin 2 on the Arduino for pin 37 on the Pi (and ground for ground) and it should carry on working as it did before when sending a HIGH signal to pin 37 (which I’m doing via Node-red) - except it doesn’t work.

I can put an LED between 37 and ground, and that lights up when I expect it to, so I’m not sure why it isn’t powering the motor.

Can someone help me out? Thank you.


The main difference between an Arduino and the Pi is that one operates at 5v and the other at 3v3… so the most likely is that your MOSFET gate voltage is not suitable.

That said I am not clear on how your project is wired to the Pi in details so the culprit may be elsewhere.


TBH, this sounds like the issue.

I’m a total noob with all of this, so while I can just about spell MOSFET, I have no idea what it is, or how it’s different to any other transistor. I’ve found a video on powering a motor using a Pi:

and I think I have the required components (the diagrams at least look the same, with the arrows inside the transistor pointing in the correct directions), so I’ll have a go at that.


Further to my previous messages, I’ve since built the circuit shown in that video, and it worked (the motor is powering the dinosaur):

Or rather, it starts off working, then stops.

I swapped the dino motor with a regular one, and that works (and continues to work regardless), and also put an LED in place of the motor, which also worked, but upon plugging the dino one back in it still didn’t work.

At this point, I figured that I’d killed the motor somehow, but placing an AA battery across its contacts made it spring back into life - and in fact seems to temporarily repair it as part of the circuit, but only for two or three runs (of 5 seconds each) then it stops working again.

I’ve tried it connected to both the 3.3 and 5v pins, but get the same issue both ways - it works for 2 or 3 runs, then stops working again until it’s reset using a battery. This only happens with the dino motor, but not the other one.

Does anyone have any ideas?

Thank you.

(PS, silly project is silly)


What was the dino motor originally powered by? Battery/voltage wise? And what voltage are you feeding it now? It may be overheating. Or maybe your mosfet is overheating due to high current draw.


Just a regular AA battery, so 1.5v.


I would say that’s the issue, your trying to run a 1.5V motor from 9V (minus whatever the mosfet drops). Its likely not rated to take that much voltage. That’s 6 times its normal voltage. It’s likely overheating. Swap the 9V battery out for a 1.5V and see if it works.


I think there might have been some misunderstanding, I was never using a 9v battery - that was simply the image I borrowed from the Arduino starter guide.

In my later attempts, I think I removed the MOSFET entirely, and tried running it directly from the 3.3v and 5v pins - although it was a long time ago, so I don’t remember.