Introduction: Arduino Controlled Lego Lighthouse
Lighthouses have been guiding boats to safety for thousands of years. One of the earliest and most notable of these was the Pharos of Alexandria. This huge structure stood for nearly two thousand years. When deciding on a lego project, I wanted to build something practical, yet at the same time fun. Although I won’t be showing you how to build one of the seven wonders of the ancient world, I will show you how to construct a lego lighthouse, which is a wonder in its own right.
My lighthouse is a fully automated, fully functional structure. Although it won’t be warning boats, it will be able to guide your steps during the darkest of nights. The light and motor inside the lantern room automatically turn on during low light levels. Also, the tri-colored LED can be adjusted between solid white light and alternating colors.
The purpose of this instructable is to instruct you on how to wire the electronics and think about the structure of the lighthouse. Although my instructions are detailed, I left room for customization. Making it according to the instructions makes this build functional, but building a custom lighthouse with your own colors, shapes, and designes makes it your own. I leave wiggle room for the building portion of the project, because I want you all to build your own lighthouses.
Step 1: Gather Your Materials
Before starting this project you are going to need the following components and materials:
1x small mirror (found these at Michael’s for real cheap)
1x NPN transistor
1x arduino (I used an arduino uno)
1x DC motor
1x tri-colored LED
1x breadboard (for prototyping the electronics)
2x 10K Ω resistors
3x 100 Ω resistors
1x 180 Ω resistor
1x 270 Ω resistor
You will also need quite a bit of the following:
Step 2: Sort Your Legos and Get Ready to Build!
When building a large lego structure, I always recommend gathering large quantities of the colors you’ll be using the most. For my lighthouse, I used red and white as my primary colors. I find the fastest way to separate what you want from what you don’t want is to dump the legos on a large mat or piece of fabric. After you picked out all the necessary bricks, you can pick up the fabric and dump the additional bricks back into their proper containers.
Step 3: Build Your Foundation
A sturdy tower is started by first building a good foundation. Make sure that your arduino can fit in the base of your lighthouse. Also, remember to leave an opening for easy access to the power sockets. Inspect the shape of your lighthouse. Be certain it is in the shape you would like. At this point, think of what pattern and color scheme you would like. It helps to have these in mind while building. As you can see, I chose a spiraling pattern with white and red bricks.
Step 4: Time to Get Prototyping Those Electronics
Next you are going to want to prototype the electronics and test them to make sure they are working. I attached two diagrams of the wiring I used when creating mine (you will find them above). When working with the tri-color LED, make sure that the proper resistors are connected to the proper pins. Make sure you study the data sheet and understand it completely before applying electricity (I fried two LEDs before doing it correctly). On most of these LEDs the red needs more resistance than the blue and green. Generally speaking the longest electrode coming from the tri-color LED is the ground. In case you need additional help with the electronic portion of this build, I added additional information in a chart above.
After your wiring is complete, upload the code I attached and try it out. I attached two files. One of which is a word document with the code. The other is the file directly from the arduino application. Both of these files are located directly under this paragraph. You may have to tweak the low light threshold value and PWM on the motor to your liking.
Step 5: If It Doesn't Fit, Make It!
Next, we’re going to have to mutilate some legos (Have to break some eggs to make an omlet). You will need to attach the mirror to the motor. To do this I applied J.B. Weld the mirror and mounted the motor onto it at an angle. Depending on the type of epoxy you use, you may need to let this sit over night. After the mirror has been successfully pasted to the motor shaft, attach the motor to the upper inside portion of the lantern room. Make sure you leave room to access the cathode and anode of the motor.
Proceeding the completion of the lantern room, you are going to need to drill a hole in the center of a thin lego. You will mount the lantern room onto this lego, so make sure that it is the proper size. The hole should be large enough to allow the LED to fit into the lantern room.
Step 6: The Lantern Room
Here is how I built my lantern room. Although this can be done several different ways, I wanted to give you some inspiration.
Step 7: Build the Lighthouse Up Around Your Electronics
Alright you’re almost finished! Place the arduino and all of the wiring into the foundation of the tower and build up around the wires. When you are almost finished with your lighthouse leave a small gap in the back of the tower to allow the wires to pass from the inside to the outside of the structure. Pull the wires connecting the switch, motor, and photocell out of the hole, but you should leave the wires connecting the LED on the inside of the structure. Once you have built as high as you want, place the lantern room on top. When you do this, it should conceal the hollow interior. Mount the photocell on the top of the lighthouse.
Step 8: Add Some Final Touches
Lastly, decorate your model. Add water, fish, shipwrecks, sharp jagged rocks, water, foam, a fisherman, a palm tree, a turtle, or anything you might think of to improve the general feel of the model. Get creative and have fun on this last step. Adding those little things like a starfish or shell really polish off this project and make it look amazing. Below I attached a video of my finished project in action.
If you enjoyed this project please vote for me in the lego contest. I would greatly appreciate it.
Participated in the
Community Contest: Toy Building Blocks