MINECRAFT Arduino Nano Night Light

by Bullock STEAM MakerSpace in Circuits > Arduino

4205 Views, 22 Favorites, 0 Comments

MINECRAFT Arduino Nano Night Light

IMG_3476.jpg

We love MINECRAFT and we love Arduino, so we decided to combine the two! Along with a recycled tennis ball canister, a peanut butter jar, Arduino Nano, and a few everyday components and created a light sensitive night light with a MINECRAFT themed shade made of vellum paper.

There are a myriad of ways to achieve this, but this is simple, straight forward and easy to achieve for those new to electronics and a fun inspiration for those that use electronics everyday. Feel free to use a plug if you choose to connect to an outlet or a solar panel and rechargeable batteries outside.

What You'll Need...

IMG_3442.jpg

Tall, wide mouthed empty bottle or canister: we chose a tennis ball canister for it's height and a peanut butter jar for its width.

Drill and small bit

Soldering Iron and Solder

Scissors

Assorted pliers, wire strippers, etc.

Vellum Paper

Double Sided Tape or Glue Gun

9V Battery Snap Connector with loose leads for soldering : We chose 8 x AA for ours. You can use 9V, AAA, AA if you prefer. **You MUST have at least 5V going to Arduino Nano

Arduino Nano: You could use other microcontrollers as well as 'Arduino Compatible' knockoffs to keep costs down.

400 Point Breadboard - Self-Adhesive

Assorted male-male Jumper Wires

4.7KΩ Resistor

LDR(Light Dependent Resistor)

White Piranha LED (you can use any LED, we just like the brightness of this type) Here is a video of different types of LED's.

Small gauge Solid Hookup wire

Drill a Hole in the Bottom of Your Jar/cannister

IMG_3443.jpg

This is hole large enough for the LDR to poke through.

Print Design on Vellum Paper...

IMG_3444.jpg
IMG_3441.jpg
IMG_3440.jpg

We have a MINECRAFT theme going here, but feel free to be creative and print any picture you want to have as a "lamp shade".

The lid will be ON THE BOTTOM of your lamp. Adjust your print accordingly and cut to fit the length of your chosen canister/jar.

Cut Two Pieces of Solid Core Hookup Wire....

IMG_3446.jpg
IMG_3465.jpg
IMG_3466.jpg

These are going to be soldered to the LDR. The length should correspond to the height of the night light and be able to connect into the breadboard.

Any color is ok as there is no polarity in the LDR.

*NOTICE our wires are actually too short and we had to had male to female jumpers at the end to be able to connect while shutting the lid. CUT YOUR WIRES APPROXIMATELY 6 INCHES LONGER THAN IN THE FIRST PICTURE.

Solder the Wires to the LDR...

IMG_3447.jpg
IMG_3448.jpg

Solder one wire to each of the legs of the LDR to extend it through the hole we drilled in step 1.

Use heat shrink or electrical tape to guard against a short circuit as the legs will be close together.

PRO TIP: Use simple tape to hold small wires in place for easy soldering.

Solder the Battery Leads (optional)

IMG_3449.jpg
IMG_3450.jpg

Solder a header pin onto each wire and shrink wrap.

We like to do this for a secure connection into the breadboard. If you feel that the bare leads work fine for insertion, then skip this step.

Solder Piranha LED Legs...

IMG_3451.jpg
IMG_3452.jpg
FWFJQ9QICPP4Z3B.LARGE.jpg
piranha-76-25mm-size.jpg

Piranha LED's are made to sit close onto the breadboard and we need to extend their legs. We achieve this by simply soldering 4-6 inch pieces of small gauge Solid Core hook up wire to extend the legs.

We do recommend marking the legs of the Piranha LED so you know the orientation and polarity.

Build the Circuit...

Screen Shot 2015-08-09 at 10.53.49 PM.png
Untitled 2.jpeg
IMG_3454.jpg
IMG_3455.jpg
IMG_3456.jpg

Here is the Fritzing Diagram and the .fzz if you want to redesign the circuit.

Downloads

Load the Arduino Sketch...

Screen Shot 2015-08-09 at 11.30.59 PM.png

Make sure you choose Arduino Nano as your board. Here is the sketch we used. Simply copy and paste into the Arduino IDE.

int ldrPin = A0;
unsigned int ldrValue = 0;

void setup ()

{ pinMode(12, OUTPUT); Serial.begin(9600);

}

void loop()

{

ldrValue = analogRead(ldrPin);

if (ldrValue<200) digitalWrite(12, HIGH);

else digitalWrite(12,LOW);

}

Test Your Circuit...

IMG_3457.jpg
IMG_3458.jpg

When the LDR is covered (darkness) the LED should light nice and bright. If the LDR is partially covered (dusk) the LED will glow lighter and get brighter as the sun/light falls.

Attach Battery to Back of Breadboard...

IMG_3459.jpg
IMG_3460.jpg
IMG_3461.jpg

Draw a line and remove just enough to attach the battery but kep the remainder of the back of the breadboard covered.

Place Circuit Onto the Lid...

IMG_3462.jpg
IMG_3463.jpg
IMG_3467.jpg
IMG_3468.jpg

Use a piece of double sided tape or a drop of glue stick to secure the circuit inside of the inverted lid. This is the bottom of your lamp and the cannister/jar will attach to become the 'lamp shade'.

You can bend the legs of the LED you soldered to direct the light. We faced ours up.

Feed the LDR Through the Drilled Hole...

IMG_3464.jpg
IMG_3469.jpg

We added a piece of black electrical tape for neatness and a snug fit.

Make Any Adjustments and ENJOY!

IMG_3470.jpg
55c8c6c450e1b69dfe000cfb.jpeg
IMG_3473.jpg