Laser Cutter Model Solar System

by devincej in Circuits > Raspberry Pi

363 Views, 1 Favorites, 0 Comments

Laser Cutter Model Solar System

IMG_0733.jpeg
solar system demo

This is a method of making a model solar system using a laser cutter and a raspberry pi. It is obviously not to scale, but is a cool way of getting to know how gears work. I used a Raspberry Pi and a Crickit MotorHat

Supplies

IMG_0736.jpeg
IMG_0737.jpeg
IMG_0738.jpeg
  • Raspberry Pi (optionally running circuitpython)
  • A motor hat for the Raspberry Pi to control a continuous servo (I used the one in link)
  • A 5V DC power source for both the pi and the hat
  • A laser cutter (or some other method of precisely cutting wood)
  • A high torque continuous rotation servo (or any other high torque motor capable of continuous rotation)
  • Wood/Acrylic sheets to cut
  • A wooden dowel
  • Small orbs to represent planets (I painted styrofoam balls for the smaller planets and 3D printed the Sun)
  • A neopixel LED strand
  • 2 buttons
  • A potentiometer (optional for speed control)
  • Jumper wires
  • Washers and a cardboard disc (optional)
  • A hot glue gun
  • Wood Glue
  • A soldering iron (optional)

Design Gears

IMG_0722.jpeg
IMG_0723.jpeg
IMG_0721.jpeg

First, you will need to create the dimensions for your gears. This will require some prototyping/research unless you've had experience with designing gears before. I used this site to generate an .dxf file for the laser cutter at my school and spent a while testing different dimensions on cardboard before I found the right size. If you are looking to use the same design as I did with 4 smaller gears inside a larger interior gear then you should try to change the values around so the interior pitch radius of the smaller circle is about a third of the interior pitch radius of the larger circle. I also chose to cut holes in the gears the width of my wooden dowel so I could easily insert arms for the planets. Once you think you have the correct dimensions, cut and try testing on a flat surface. Secure the interior gear to a surface somehow, then insert the smaller gears and spin the middle one. The smaller gears should fit and be able to rotate continuously without popping out or getting stuck.

Design Box

IMG_0726.jpeg

Next, use the laser cutter to cut your box. I designed mine using MakerCase. This will be much easier than the gears, all you have to do is make sure that there is a face of the box which is a square that has sides equal to the diameter of the interior gear. Make sure the gear fits on top of the box after cutting the parts, then glue the box together. I chose to cut the top face of my box that the gears rest on out of clear acrylic and not glue it to the other sides so I could see/access the inside of the box. Make sure to add a hole in the center of the top of the box big enough to fit the wooden dowel through. A hole through a side of the box to run wires into may also be useful depending on how you intend to design it.

Glue Gear to Top Face

IMG_0727.jpeg

Next, carefully glue the interior gear (largest gear with teeth on inside) to the top surface of the box. Mine was made out of acrylic, so I used superglue to secure it to the wood. You need to make sure that the gear is perfectly centered within the surface, or else the project may not work. To check this, you can line up the gears by placing the dowel through the face and inserting all the gears one by one. Once the gears fit, trace around the larger gear to see where you should glue.

Add Cardboard Disc (optional)

IMG_0728.jpeg

This is an extra step you can take to help secure the planets a bit better. Once you've glued the interior gear on, place the smaller gears inside then use the laser cutter to cut a disc with an exterior diameter equal to the diameter of the interior gear and an interior diameter just small enough that the disc will hang over the smaller gears a little bit, holding them down on the surface. Test this a couple times to make sure it is big enough to actually hold the gears in place, but not too big that you won't be able to slip them under, then carefully glue on top of the interior gear.

Assemble Planet Gears

IMG_0729.jpeg

Next you'll assemble the planets. Cut 4 pieces off the dowel, the lengths are up to you just make sure they won't be high enough to hit the Sun. Using wood glue, secure the length of dowel to the hole in the middle of the gear. Once dry enough to handle, hot glue the styrofoam ball to the other end of the dowel. I chose to paint my styrofoam balls, you could too or alternatively 3D printing colored balls or just buying small planets would work. It is important to note that any weight added by these balls will make more work for the motor.

Secure Motor

IMG_0742.jpeg

Next, it's time to secure the motor into the box. I did this by gluing two small blocks of wood onto the bottom of the box where the motor would sit. It will help to try and figure out where this location is by lining the dowel up through the hole to see exactly where the center is. Find this center, line the servo up on it, then mark where the sides of the servo are. Glue the two wooden supports around the servo so when it turns it won't just rotate itself. If it has nothing supporting it, the friction of the gears will be too strong and the servo will just coil its wires around itself causing problems.

Glue Servo to Dowel

Find the width of your servo's shaft then using a drill bit of that width (or a bit wider) drill a small groove into the bottom of the dowel. Put a dab of glue in this groove (only a little too much can run onto the servo and prevent the shaft from spinning), then insert the servo's shaft. Hold it for a bit so it solidifies in an upright position. Now you can place in the box and mark where you want to cut the dowel down to (I did so my sun would be a few inches above the planets).

First Test

Now that the mechanical aspects of the project are assembled, it's time to run the first test. Using thick tape, cover one face of the center gear (poke through so hole isn't covered). Place the servo in the box in between its supports and run its wires to the outside of the box. Place the lid onto the box with the dowel poking through the hole. Place the center gear over the shaft, then run tape around the shaft so that no wood is exposed to the gear. The tape is to protect the wood from coming in contact with hot glue. If something goes wrong you will still be able to remove the glue by pulling the tape off instead of needing to cut new parts. Once you've taped it well enough glue the gear to the dowel, once again making sure no glue comes into contact with exposed wood. Hold the gear down so it dries level. Once the glue is solidified enough, carefully insert the planet gears. Now you just need to hook the servo up to 5V of power and make sure everything spins as it should. If it does you can remove the tape and glue the shaft to the gear for real, if it doesn't you'll need to do some troubleshooting.

NOTE: If gears keep popping off at first it could be because the center gear is bouncing. Try placing some washers on top of it before resorting to recutting objects, this in combination with the cardboard disc fixed the problem for me.

Wire Up Raspbery Pi and Hat

Now we can move onto the circuitry part of the project. Instead of just having the planets always on when connected to power, I chose to use a Raspberry Pi to add some functionality. Assemble your motor hat if necessary, then attach to the pi (You should probably put some electrical tape on the bottom of the motor hat so no metal comes into contact with the pi. This could cause short circuiting.). You should probably test to make sure the motor works first. To do this connect the 2 servo wires into the ends of the motor terminals on the hat. It might help to read the documentation on your hat first and familiarize yourself with its libraries, especially if you're using a different hat than I did. My hat had pins for other outputs, which is what I hooked the buttons and potentiometer into. It's a pretty intuitive setup if you've worked with a microcontroller before, mine even came with labels on it saying which row was signal, power, and ground. My hat also had a dedicated terminal for neopixels like the one for the motor. You can see in the example code how to use these pins.

CircuitPython Code

from adafruit_crickit import crickit
from adafruit_debouncer import Debouncer
from adafruit_seesaw.neopixel import NeoPixel
import random


ss = crickit.seesaw #Create crickit object


b1 = crickit.SIGNAL1 #Create button objects
b2 = crickit.SIGNAL2
ss.pin_mode(b1, ss.INPUT_PULLUP) #Set the buttons as input
ss.pin_mode(b2, ss.INPUT_PULLUP)
pot = crickit.SIGNAL6 #Create potentiometer object


num_pix = 20
pixels = NeoPixel(crickit.seesaw, 20, num_pix, brightness = .5)


def spinny_func():
pval = ss.analog_read(pot)
crickit.dc_motor_1.throttle = pval/1023 #1023 is unique to my board, you may need to find the correct
#threshold for yours


def light_func():
index = random.randint(0,19)
r = random.randint(0,255)
g = random.randint(0,255)
b = random.randint(0,255)
color = (r,b,g)
pixels[index] = color


dummy = False


while True:
if not ss.digital_read(b1): #Press button1 and the gears/lights turn on
dummy = True
if not ss.digital_read(b2): #Press button2 and the gears/lights turn off
dummy = False
if dummy:
spinny_func()
light_func()
elif not dummy:
crickit.dc_motor_1.throttle = 0
pixels.fill((0,0,0))

Create Box for Buttons (optional)

IMG_0740.jpeg
IMG_0741.jpeg

I threw together a small box last minute to hold the buttons and potentiometer. I haven't finished a proper one yet as I haven't been able to get to the laser cutter but all you have to do is cut a box big enough to fit your buttons and potentiometer on it and the pi underneath. I glued my potentiometer down and ran it's wires through the front, but you could alternatively cut a third hole in the top and mount the potentiometer beneath.

Power and Go

By this point you should be able to finish assembly and start it up. One of your buttons will turn the servo and neopixels on, the other will turn it off. The potentiometer will change the speed of the gears while on. You may need to change the code for your potentiometer, mine had a maximum value of 1023 but other boards are different. Once this is all set up all you need to do is connect the pi and hat to power and run the code. You can do this by using ssh to connect to your pi and typing "python [FILENAME].py" in the terminal line, or if you're familiar with the pi there are ways to make this code run upon connection to power.