When we are reading, we are often too enthralled by the books to notice the lights in your surroundings. You may be reading in a dark room, affecting your eye vision. Sometimes, you may turn on your lamp when the room is already bright enough for reading, hurting your eyes because of the bright light. To prevent these problems, to adjust your lamp depending on your surroundings, and to save energy by turning off a lamp, I devise an automatic reading lamp. It does not have a switch to turn on and off the light. Instead, I use a light sensor (photoreceptor) to detect the brightness surrounding the lamp. Another sensor detects whether a reader is present before the lamp. LEDs will be turned on when it is too dark around, and they will turn off when there is enough light. The ultrasonic sensor will turn off the lamp when the person leaves.
*Please refer to the picture number in each step. Count the picture from left to right.*
Step 1: Materials Needed
- Arduino Leonardo (or any other similar boards)
- Jumper Wires (Male to male wires for connecting the components on the breadboard, and male to female wires to let the LEDs reach the top of the lamp)
- Ultrasonic Sensor
- 1 10k ohm resistor
- 6 220 ohm resistors
- 6 LEDs (any color you prefer)
- Cardboard box (or other boxes that can be cut through)
- Utility knife
- A piece of brown paper
Step 2: Assembling the Parts (onto the Breadboard)
Please refer to the illustration above. Note that the 10k ohm resistor for the photoresistor (on the very left of the illustration) should be a blue one, as shown in the first material page. But the app I use to create this illustration (Tinkercad) cannot show a blue, 10k resistor. Please refer to the pictures in the material page to find the blue resistor for that place. If you have trouble connecting the wires for the ultrasonic sensor, please refer to the last illustration. Connect Trig to D6 and Echo to D7.
Step 3: Programming and Codes
Refer to the link below for the full code:
The programming part is simple, including only the codes for 6 LED, the light sensor, and the ultrasonic sensor. Refer to the descriptions in the code for more details. You can change the number, including brightness and distance, to what you prefer. To make the lamp less sensitive to your movement, for example, you can increase the number (distance) for the ultrasonic sensor. Also, if you want a brighter lamp, you can add more LEDs (using the same circuit before and adding to the codes).
Step 4: Making the Lamp's Exterior Part 1: Extending the Wires
First, use the male to female wires to connect the photoreceptor, LED, and ultrasonic sensor. This can allow the components to reach out of the box later on. (I use an alligator clip for the photoreceptor because I do not have enough male to female wires. Feel free to use them too.) (Refer to the first picture.)
Tape the LEDs together, two by two (Picture 2). Then tape all of them together to form a lamp of six LEDs (Picture 3). When the programming and assembling the breadboard works, the LEDs should be able to light up (Picture 4).
Step 5: Making the Lamp's Exterior Part 2: Cutting the Lamp's Main Structure
The main structure includes the vertical part of the lamp, where the extended wires with LEDs are hidden in for the LED to reach the very top of the lamp. I divide this section into three sections: the vertical section, the horizontal section, and the cube which connects the two sections.
You will need to cut out 4 pieces of 14cm*3cm cardboard. Do not cut all the way through (Picture 1), so you only need to stick the rectangular prism together on one side. When you successfully make this vertical section, repeat the process but change the dimensions to 8cm*3cm. The two rectangular prisms should look like (Picture 2).
Cut out 4 more 3cm*3cm squares on the cardboard. Tape them on the 14cm*3cm vertical section as shown in Picture 3. Tape them on three sides of the vertical section, leaving a hole on the side, and cover the top with the remaining cardboard. Place the entire vertical structure through the extended wires.
Then, tape the horizontal 8cm*3cm section to the opening of the 3cm*3cm section. The wire should pass through these parts as in Picture 4.
Use more tape to make the structure sturdier.
For the opening of the lamp, I use a piece of brown paper to cut out the cone shape to imitate a lamp. (Draw the shape of a Pac-man with 5cm as the radius. Then, tape the two radii together.) (Picture 5) Later, cut the top of the cone and ensure the wires can pass through. (Picture 6) Use more tape to connect the wires and the lamp structure to this cone and ensure the lightbulbs won't fall. (Picture 7 & 8)
Finally, tape the opening on the 8cm*3cm section, where the wires go through the cone. The tape again ensure the wires and cone won't fall off. (Picture 9)
Step 6: Making the Lamp's Exterior Part 3: the Exterior Box
Find any cardboard box with a cover which you can lift up. Cut three holes: a small one in the very left for the photoreceptor, a large rectangular one in the center for the entire lamp structure (the rectangle should be slightly larger than the horizontal section, so it should be about 10cm), and a square (3cm*3cm) in the right for the ultrasonic sensor.
Cut a small hole on the top left of the box for the power line. Place the breadboard in and connect the power line through the small hole.
Get the wires of the photoreceptor through the small hole on the left. It should just get to the surface.
Force the lamp structure through the rectangle. Be careful not to unplug the wires from the breadboard. The lamp structure will slant forward. Therefore, place some remaining cardboards (or any rectangular cardboards) behind the lamp for temporary support. (Picture 1)
Finally, cut 4 more pieces of cardboard with the dimensions of 6cm*3cm. It should be able to fit through the small square in the right. Place the wire through the opening.
The temporary finished product is in Picture 2. I fit some pieces of cardboard through to ensure the lamp will stand in the right position, instead of collapsing in the hole.
Pictures 3~5 are the finished product, from different camera angles.
CHECK THE VIDEO BELOW TO SEE THE ACTUAL SUCCESSFUL LAMP
Step 7: Making the Lamp's Exterior Part 4: a Sturdier Structure
To replace the cardboard pieces from the previous steps, and to remove the "holes" on the box, cut out rectangular pieces of cardboard which are slightly less than 3cm wide. The lengths can vary, as long as it can stay vertical after putting them into the holes. Cut about 8 pieces for the main structure opening hole, 6 more pieces for the other two sides, and 6 more pieces for the ultrasonic sensor opening. Tape these pieces together as shown in PIcture 1.
Fit the pieces through the opening behind the lamp structure. Then, tape 3 more pieces of cardboard together and place them in front of the structure. Put another 3 pieces to the right of the structure. (Picture 2~3) Make sure, again, that the lamp structure can remain vertical.
Notice that there is still an opening in the ultrasonic sensor (Picture 4). Tape the 6 pieces of cardboards together as before, and fit it through the little square opening of the ultrasonic sensor.
Again, tape the main structure to ensure it won't be bent.
The final, much sturdier lamp is shown in Picture 5, with cardboard pieces fitting through both openings.
Step 8: Finished Product
The finished product from different angles. Picture 4 shows the brightness after turning off all lights in the room when the LED lamp lights up. The LED light is bright enough to use as long as the user sits in front of the lamp, within the ultrasonic sensor's detecting area.
When the room is not bright enough (according to the photoreceptor values settings), and when a person sits in front of the lamp, within the detecting range of the ultrasonic sensor, the light will turn on. However, when only one of these sensors detects the factors, the light will not shine. For example, if the room is dark enough to trigger the light, but no one is sitting in front of the lamp, the device will not be turned on. If a person sits in front of the device, but the room is bright enough for reading, the lamp will not be turned on. Your surroundings must meet both factors for the device to work.
MORE VIDEOS BELOW
If you reach this point, congrats!