Here is the full tutorial on how to make a 3D printed Raspberry Pi Ladybird with programmable LEDs that flash.
The model plugs directly in to your Raspberry Pi and can be programmed using either Scratch or Python.
You can either make your model using 3D printed as shown below or make the model using Salt Dough as I did with my prototype model.
Step 1. Create your Ladybird using Google Sketch-up.
Google sketch-up is a free program that lets you design and build pretty much anything you can think of – from tiny little models right through to skyscrapers and space shuttles.
There are plenty of the great tutorials on how to use Google Sketch-up, have a look on YouTube for some beginners lessons.
Important tip – in order to get you model 3D printed, it needs to be ‘water-tight’ so make sure when you look round it there are aren’t any holes. Otherwise the 3D printer wont be able to print it.
Step 2 – Convert your sketch-up file to an STL file.
3D printers wont accept Sketch-up files for printing so you have to convert the file to an STL file first before it can be printed. Sketch-up has an extension which does the conversion automatically for you. You will need to install the extension using the built in Extension Warehouse. If you can’t get the STL extension working then do what I did instead: Export your model as an OBJ file and convert it to a STL file using Meshlab, a free program.
Step 3 – Fix your model
Although your STL file should in theory be fine, the chances are it’s not – so you will need to fix it using a program call Netfabb.
Step 4 -Get it printed
If you have access to a 3D printer then you can print the file yourself, otherwise you will need to send it off to a 3D printing service to get it printed. I used magicmodel.co.uk to get mine printed. The model costs about £20 to get printed and their service is great.
Step 5 – Electriconics time
Once you have your model and your components you will need to design the layout for your breadboard/prototyping board. Your circuit needs to look like the following:
Here is my ladybird wired up using a prototyping board, with all the components soldered directly on to the board. You can use this solution ( a bit more time consuming but tidier and permanent) or you can just use a breadboard. I will post a picture of the breadboard option when I get the jumper wires through from Ebay.
Step 6 – Connecting to your Raspberry Pi
You will need to install Scratch GPIO in order to get your Ladybird working with the Raspberry Pi.
Follow the instructions here in order to get it working
Step 7 – Programming the ladybird in Scratch
Turning the GPIO pins on and off in Scratch is pretty simple, you just use broadcasts, which can be found in the ‘Control’ or blocks area of scratch. Here are the 4 main commands that Scratch GPIO uses:
Example – Turn off the 2 input port LEDs
By default some of the pins we have connected to are half on when you plug in the Ladybird. This is because only 6 of the GPIO ports are set up as output by default. Two of the pins (pin7 and pin22) are not set to output and won’t work right! We can override this by turning these 2 pins off manually, which tells the Pi that you want to use them as outputs. This code below does just that:
Click the green start button on scratch to see if it all works!