Holiday Projects – Create a Raspberry Pi Spinning Windmill in 3 Steps

One of the things that I love most about mini Raspberry Pi projects is that I can quite often set up the raw materials for a project and as long as the Pi is connected to the TV with a keyboard and mouse, I can sit back and watch the kids explore without much adult interference. In the tutorial below, I created a powered pinwheel windmill – perfect for the current weather!

What you’ll need:

1. Make the Pinwheel Windmill

pinwheel_instructionsUse the template to make and colour in a paper pinwheel windmill.

You can download a free printable of the Pinwheel and instructions in PDF from here. These are designed to be printed on A4 paper, so no specialist equipment is needed.

If you want to make a larger pinwheel, it’s recommended to photocopy up to A3, but use card as paper doesn’t hold very well at larger sizes.

2. Connect Up The Motor

The Pibrella is an add on to the Rasberry Pi which connects to the GPIO Pins and has built in LEDs, a speaker, and mini breadboards to help you get started with physical projects without the need for soldering.

If you want to create a direct link to your Raspberry Pi, then you can always make use of a ribbon cable which also allows connection to the GPIO pins, but you will need a breadboard and motor driver chip. In using the Pibrella, we have everything all in one which gives kids a fast win, encouraging them to investigate further into the more intricate electronics version later.

small motoeNext we need to connect the motor.

Many small motors need to be soldered, so be careful that you purchase ones with wires already attached. These motors come with wires that will mean that there’s no need for any soldering making it a much safer project for children.

Strip the ends of the wires connected to the motor so that the copper cables are exposed. Connect a crocodile clip cable to each on, making sure that they don’t touch. Take two of the male to male jumper cables and connect them to the other ends of the crocodile cables.

PiBrella_RowENext, insert the ends of the jumper cables into the two holes labelled E on the Out section of the Pibrella board (there are 4 rows and it doesn’t matter which you use as long as your code matches). If you’re having trouble finding the section labelled E, use the image to help you.

Now that everything is attached, we need to add some code to the Raspberry Pi to get your windmill to spin!

3. Add The Code

Make sure that you’ve got your Pi connected to a keyboard & screen (or keyboard & your TV) and have it booted up. Open up an LXTerminal and run the following commands to make sure that your Pi is running the latest version of your operating system:

sudo apt-get update 
sudo apt-get upgrade

Next, if this is the first time that you’ve used your pibrella then you’ll need to install the drivers by running the following code:

sudo apt-get install python3-pip
sudo pip-3.2 install pibrella

Finally, open up your Python 3 programming IDE called IDLE. Click File, then New File to create a new programming file. To make your windmill spin, you’ll need to type the following code:

#Add your library files for pibrella & pausing

import pibrella
import time 

#create a loop to repeat forever

while True:

    pibrella.output.e.on()
    time.sleep(20)
    pibrella.output.e.off()

    time.sleep(20)

Now that you’ve created your code, save it as Windmill.py and select Run, then Run Module to watch your windmill in action!

Look out for next week’s blog where I’ll be updating our windmills to react to the temperature of our room using a simple temperature sensor.

Did you get your windmill spinning? Share a photo or short video with me and I’ll share it below!

20180725_173432_HDR
Evie with her two windmills – Keeping her cool!

*This blog contains affiliate links. I do not recommend any product that I don’t genuinely think is worth it, but the proceeds of these links help me to cover the costs of the website & blog. If you have any questions about the recommendations here, please contact me.

Follow my blog with Bloglovin

 

One thought on “Holiday Projects – Create a Raspberry Pi Spinning Windmill in 3 Steps

Leave a Reply

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