Introduction: Arduino Colorful Night Light (Revised Version)

Hello Internet!

This instructable teaches you how to make an easy, color-changing night light with Arduino Leonardo. This code also works with Arduino Uno, so if you're using that it's fine too.

This build was inspired by @Mikyyyyang. Here's the original link to the build: https://www.instructables.com/Arduino-Colorful-Ni...

There were four buttons in the original build, but I thought it would be nicer if I used a potentiometer instead so I could change four buttons into one.

Supplies

1. Arduino Leonardo (or Uno)

2. Breadboard

3. 4 LED lights (I used 1 of green, red, blue, and yellow for this build.)

4. Wires

5. Potentiometer (also called variable resistor, 可變電阻)

6. Paper (for making a lampshade. I used plain A4 white paper for this build.)

Step 1: The Circuit

You can connect the circuit to your breadboard exactly like the picture above. ;)

Note: I like to squeeze all of my LED wires into a tight place so it looks neater, but this might be hard to make.  Feel free to increase the width between the LEDs.

Second note: be careful when you connect wires to the potentiometer. Always make sure you connect the right ports to the right electrodes, or else you might get a broken potentiometer!

Step 2: Code for the Build

Code can be downloaded as an imo file below or found here:

https://create.arduino.cc/projecthub/terryblueberry/night-light-revised-version-10ae57

Step 3: Create a Case for the Build

1. Use some cardboard (I recycled a cereal box) to cover up the circuit (ugly!).

2. Use some paper to create a lampshade for the LEDs. I just surrounded them by rolling it up.

3. Remember to cut a hole on your cover for inserting the power cord.

P.S. I used tape to keep wires in place, but if you can get hands-on some clay, definitely use that since it has so much more customization. Do NOT use hot glue to glue the potentiometer onto your cover since that will break it. Believe me, I've tried it. :(

Step 4: Done!

Enjoy your night light!

(hey kcis people, i see u there 👀)