Introduction: Arduino Charge Warning Night Light
Class and Name: 9A Vivian Ting
The charge warning lamp is a combination of two different devices, which joins a charge warning device and a nightlight together. Since many people I’ve known in my surrounding have been bothered by the problem of forgetting to charge their laptops or other electronic devices, the creation of the machine was to remind the user to charge their electronic devices every night to have a fully charged device in the next day. After charging your device, the lamp on the top of the machine could be turned on to reduce stress, relax, and enhance sleep quality.
The concept development of the project has been collected from my previous project on ProjectPlus, which was about the creation of an Arduino Brightness Warner (Search: Arduino光線警示燈, please be minded that the website is written in Chinese) for the protection of one’s vision. The idea of the project has been thought out from the website: http://www.tngs.tn.edu.tw/download/arduino/blinki... which was a source instructing the process of functioning a press-button and a LED on Arduino.
In this project, I’ve modified my previous project, a brightness warner by including an additional LED and a press-button to form a lamp on the device from an online source (source is mentioned in the Credit section). In the same time, I’ve changed the function, the role, and the purpose of the device.
Project's Code: https://create.arduino.cc/editor/Vivian_Ting/e97d...
- Arduino Leonardo x1
- Breadboard x1
- Long wire x16
- Short wire x6
- Photoresistance (5~10k/ohm, 5mm) x1
- LED light (Colors are optional, I’ve chosen red and yellow) x2
- Press-button x1
- Resistor (82/ohm, ¼ watt) x2
- Precise resistor (10k/ohm, ¼ watt) x2
- USB power cable x1
- Cardboards x6
- 20cm*15cm x2
- 20cm*7cm x1
- 20cm*6cm x1
- 15cm*7cm x2
- 5cm*3cm x1
- Cotton x suitable amount
- Charger x1 (Any charger with cables, I’ve used the charger of MacBook Air)
- Black tape
- Sizzor x1
- Utility knife x1
- Power bank x1
- Glue gun x1
Step 1: Set the Breadboard Up
By referring to the picture provided, set the breadboard up.
First of all, connect 5V to the positive section of the rows on the breadboard. In the same time, connect GND to the negative section of the rows on the breadboard.
Press-button: Connect one end of the press button to the positive section of the breadboard and another with a precise resistor (10k ohm) and a wire connecting to Pin13. Then, connect another end of the precise resistor to the negative section of the breadboard.
Charge warning LED: Connect the positive end (the longer one) of the LED to Pin5 and the negative end (the shorter one) to the resistor (82 ohms). After that, connect the other end of the resistor to the negative section of the breadboard.
Lamp LED: Connect the positive end (the longer one) of the LED to Pin3 and the negative end (the shorter one) to the resistor (82 ohms). After that, connect the other end of the resistor to the negative section of the breadboard.
Photoresistance: Connect one end of the photoresistance to the positive section of the breadboard and another with a precise resistor (10k ohm) and a wire connecting to analog pin2. Then, connect another end of the resistor to the negative section of the breadboard.
Step 2: Code Uploading (1)
Upload the code below to Arduino Leonardo. After uploading the code, open the Serial Monitor and put your hand fully on the photoresistance or turn the room’s light off to adjust the light border if the photoresistance.
Step 3: Code Editing
Once you’ve got the number, record it down and replace the original number in the photocell section of the code below to the one you’ve got.
Step 4: Code Uploading 2
Upload the final code to the Arduino Leonardo. Test if it has any problems.
Step 5: Case Making— Preparations
There will be six cardboards required for the process.
A: 20cm*15cm (Bottom)
B: 20cm*15cm (Top)
C: 20cm*6cm (Front)
D: 20cm*7cm (Back)
E: 15cm*7cm (Left)
F: 15cm*7cm (Right)
Carve a 3cm*3cm hole on the right corner of board B, once finished, carve a 1.5cm*1.5cm hole in the middle of board B. Afterward, carve a 4cm*2cm hole on the left corner of board E.
Step 6: Case Making— Paper Wrapping
To wrap the boards up, cut out several pieces of wrapping papers that are about 2~3 cm wider and longer than the corresponding cardboard. Once finished preparing all of the papers, stick the boards to the center of the paper accordingly. Cut off all corners of each paper with boards on it (check the picture to see example). For the holes on board B, use a utility knife to cut out the diagonals of the holes, then stick the four triangles inward with tapes. Stick each side of the paper to the board with tapes (check the picture to see example). In the same time, wrap the 5cm*3cm cardboard with a wrapping paper and write warning messages with markers on it for later use. Once finished, move on to the next step.
Step 7: Case Making— Forming a Box
Using a glue gun, stick all sides together except for the front one (board C) to form a box. Stick only the right side of board C to form a door for the case. After that, use strips of tapes to close the door up. If there’s any problem of the breadboard in the future, strip off the tape to check.
Step 8: Set Up the Machine
Put the breadboard into the case. Pass the lamp LED and the photoresistance together through the little hole in the middle of board B. Once finished, use a glue gun to fix the black part of the wire with the LED and photoresistance passed through the hole. Let the glue cool down before continuing the step. Push the press button through the hole on the right corner of board B to make it stuck on the hole. Cut out two strips of tapes, one will be about 7 cm and another will be about 4 cm. Stick the shorter tape in the middle of the longer tape to form a single strip of tape with two ends sticky. Stick one end tightly onto a side of the press-button while having another one not so sticky across the other side of the button (check the picture as a reference). The tape forms a switch of the button (check video demonstration：https://youtu.be/cVi2NH_fGUM ).
Step 9: Organizing the Wires
Let the warning light LED out of the case through the gap of the case’s door and extend the wire of the LED with four long wires. By using black tape, stick the black part of the LED’s wire onto the cable of the charger. Stick the cardboard with warning texts on it onto the black part of the LED’s wire. Organize the wires or the LED and the charger by sticking them together with black tapes to form a single line.
Step 10: Decorations
Surround all surfaces if the night light LED with cotton and fix them onto the box with glue guns. The purpose of the step is to worsen the glare of the LED light to form the best brightness for a nightlight while also decorating the device. Once finished, check if the device has any problems by testing the abilities, the warning LED should be lit up when the environment is dark. When the button is pressed, the night light LED should be lit up while the warning light was off. If there are no problems with the functions, your machine is completed!
Step 11: Finished Products
Check out the pictures and the video to see the final product made!
Video presentation of the final product: https://youtu.be/LogYjDKN14Q