ZipLight
My project is called ZipLight, a sound-sensitive smart desk lamp. When the surrounding noise exceeds a set threshold, the lamp automatically turns off, humorously signaling, “You don’t deserve to study.” It’s designed for libraries or quiet study spaces, reminding people to keep noise levels down.
I’m now using the Arduino Uno as the main controller, which connects to a sound sensor, a transistor, and an LED strip. The Arduino Uno provides standard 5V power and a familiar pin layout, making wiring straightforward. The PAUTIX COB LED strip provides soft, energy-efficient lighting, while the sound sensor detects noise levels. The transistor acts as a switch to control the lamp’s brightness based on the noise threshold.
The lamp is powered via USB, making it simple and practical. With its clean design and functional features, ZipLight is both a fun and effective companion for focused studying!
Supplies
Electronics:
- Arduino Uno (microcontroller board)
- PAUTIX COB LED Strip Light (5V, USB-powered, cut to desired length)
- GY-MAX4466 Electret Microphone Amplifier (sound sensor module with adjustable gain)
- NPN Transistor (DGS configuration, e.g., 2N2222 or similar)
- 1kΩ Resistor (for the base of the transistor)
- Jumper Wires (for connections)
Power and Connections:
- USB Cable (to power the Arduino Uno from your computer)
- Breadboard (for prototyping connections)
Tools:
- Wire Cutters and Strippers
- Soldering Iron (if needed for secure connections)
Materials for Assembly:
- Lamp Structure: 3D-printed
- Adhesive or Screws (to secure components inside the lamp structure)
Miscellaneous:
- Heat Shrink Tubing or Electrical Tape (for insulating connections)
- USB Power Source
3D Modeling the Lamp
In this step, we will design the lamp in three separate parts: the lampshade, the stand, and the stand connector. Each part is modeled independently to ensure modularity and ease of assembly. Here's how:
- Lampshade:
- Design a dome or cone-shaped structure to house the LED strip light.
- Add cutouts or grooves for the light to shine through or to fit ventilation if necessary.
- Ensure there’s a mechanism (like screw threads or clips) for attaching the lampshade to the stand connector.
- Stand:
- Create a sturdy vertical pole or support to hold the lampshade at an appropriate height.
- Design the base to provide stability. This could be a flat circular or rectangular shape.
- Add channels or hooks for cable management if desired.
- Stand Connector:
- Model a connector piece to join the stand and lampshade securely.
- Include slots or screw holes for fixing the lampshade and stand together.
- Ensure it allows for easy disassembly if required.
Once the models are complete, export the files in STL format for 3D printing. Ensure the dimensions align properly so the parts fit together seamlessly during assembly.
Wiring the Circuit
- Prepare the Components:
- Arduino Uno, GY-MAX4466 sound sensor, LED strip, NPN transistor, 1K resistor, wires.
- Connect the LED Strip:
- Negative wire → Transistor collector (C).
- Positive wire → Arduino Uno 5V pin.
- Set Up the Transistor:
- Transistor base (B) → Arduino pin 9 via 1K resistor.
- Transistor emitter (E) → Arduino GND.
- Wire the Sound Sensor:
- VCC → Arduino 5V pin.
- GND → Arduino GND.
- OUT → Arduino A0 pin.
- Power the Arduino:
- Connect the Uno to a computer using a USB cable.
Ready for programming and testing!
Coding
// Define pins
#define SOUND_SENSOR_PIN 2 // The sound sensor digital output is connected to digital pin 2
#define LED_STRIP_PIN 9 // The LED strip positive terminal is connected to digital pin 9
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(SOUND_SENSOR_PIN, INPUT); // Set the sound sensor as an input
pinMode(LED_STRIP_PIN, OUTPUT); // Set the LED strip control pin as an output
digitalWrite(LED_STRIP_PIN, HIGH); // Ensure the LED strip is off by default
}
void loop() {
// Check the sound sensor for high or low signals
int soundDetected = digitalRead(SOUND_SENSOR_PIN);
// If sound is detected (high signal)
if (soundDetected == HIGH) {
Serial.println("Sound detected! LED strip blinking...");
// Blink the LED strip for 2 seconds
for (int i = 0; i < 10; i++) { // Blink 10 times, 200ms per blink
digitalWrite(LED_STRIP_PIN, LOW); // Turn on the LED strip
delay(100); // Wait for 100ms
digitalWrite(LED_STRIP_PIN, HIGH); // Turn off the LED strip
delay(100); // Wait for 100ms
}
} else {
Prepare the Parts for Painting
Ensure all parts (lamp shade, stand, and connection part) are clean and free from dust
lightly sand the surfaces to create a smoother texture for painting.
Spray Paint the Parts
Choose a spray paint that is suitable for the material you're using (e.g., plastic or metal).
Apply light coats of paint, allowing each coat to dry before applying the next one.
Let the painted parts fully dry before handling them further.
Assemble the Lamp Components
Once the paint has dried, begin assembling the parts:
Attach the lamp shade to the stand using the connector part.
Secure all parts firmly using screws or glue, depending on the design.
Check for Stability
Make sure all parts are securely attached and that the lamp is stable. Adjust or tighten as needed.
Final Touches
Once assembled, check the overall appearance and make any final adjustments. You can add additional details or decorations if desired.