top of page

KYLEE'S DESIGN BLOG

  • Writer's picturekydo5322

Lab 2 - Arduino Prototyping

The purpose of this lab was to expose me (& my peers) to the Arduino prototyping environment and to try my hand at laser cutting. The end result was Arduino powered LEDs that fluctuated based off data from the switch to illuminate the sun and moon inside a cute wood shadow box.


Materials

Here's everything you need to create this project:

-1/8" thick plywood (x2)

-Acrylic paint & brushes

-2 LEDs (Any color is fine - I used red and blue)

-Arduino Uno

-Breadboard

-Switch

-Blah blah blah


Part 1: Building & Understanding the Circuit

The hardest part about building the circuit was figuring out the pulldown resistor, but after discovering that its purpose is to give a clean read (it's on, so it has to be 1 or it's off, so it has to be 0), the rest of the circuit was simple. The images of the circuit, however, are far from simple. The jumper wires are mess, but hey! That's prototyping.


Part 2: Program the Microcontroller

To get the circuit to listen to you, you need the right code. Here's mine:

 

int momBut = 2;

int led1 = 3;

int led2 = 4;

int buttonVal;

void setup() {

pinMode(momBut, INPUT);

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

}

void loop() {

buttonVal = digitalRead(momBut);

if(buttonVal == 1){

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

}

else if(buttonVal == 0){

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

}

}

 

This code was a slight variation of the demo code my instructor showed the class (thanks Melissa). Its job is to read the switch's state. If it is pushed, it tells led1 (whatever is plugged into pin 3 on the Arduino) to turn on. If the button is untouched, then it tells led2 (pin 4) to turn on.


Part 3: Laser Cutting !!

This was my first encounter with laser cutting and boy, did I learn. Overall though, laser cutting is incredibly cool and a valuable tool.

 

Step 1: Brainstorming. The hardest part of making an enclosure is thinking of a design that displays what the circuit is doing. Since I had 2 LEDs alternating states based off a button being pushed, I decided it would be interesting to have a blue LED illuminate the moon and a red (originally yellow, but it burnt out) LED illuminate the sun. From there, the forest shadow box was conceived.


Step 2: Creating the blue print. After carefully measuring all necessary components, I went to makercase.com to create a box. I imported that into Adobe Illustrator, added some features (holes for buttons and cords), and created the tree layers by tracing an image of forest . Here's the layout:

You may notice that the final product has a mountain range, but there is no mountains included in the blue prints. Well, after cutting the forest pieces, I realized it wasn't going to cover the entire circuit and I didn't have time to cut new pieces. So, being the problem solver that I am, I took a silhouetted mountain range my roommate made, and cut it down to size (shout out to Jacob for the mountains and being my laser cutting mentor).


Step 3: Laser cutting. Make sure you have the pdf version of your file saved on your flash drive to give to the Laser Master.

Step 4: Painting. You really only need to paint a sun, a moon, and the trees. You could even etch the sun and moon onto the box and achieve the same effect. But I love painting, so I went overboard.



Step 5: Putting the enclosure together. Assuming everything went right with step 4, just snap the box together, glue the trees to the front of the box, put your circuits in, and voila! A beautiful sun and moon shadow box.

This was not the case for my enclosure. There were problems with my laser cut, so the box did not fit together and I had to sand down the finger joints and glue the box together. This was a huge pain in the ass and a lesson learned: don't move the material until you know you are done cutting! Also, always do test cuts!



Taking it Further

I would highly recommend soldering everything, so your circuit is nice and tidy and you can place the LEDs in any position. I did not do this in my enclosure because I did not have time to solder and because I need to reuse a lot of the components (especially the button). In my next iteration, you can expects more forest layers, cleaner circuit, soldering, finger joints that actually work, and more LEDs - just for fun.

 

Comments


bottom of page