LED Infinity Illusion Mirror

by AntonioLJ in Circuits > Arduino

399 Views, 1 Favorites, 0 Comments

LED Infinity Illusion Mirror

Imagen_1.jpg

This project was created by Antonio López and Fracisco López, students of 'Creative Electronics', a Beng Electronics Engineering module at the University of Málaga, School of Telecommunications

Our final project consists of a mirror with led lighting, this lighting is controlled by 3 types of sensors (microphone sensor detection, infrared motion sensor and ultrasonic sensor distance).

Supplies

  • 1 SAV-MAKER-I (alternative to Arduino Leonardo).
  • 1 Channel 5V Relay Module Low Level Trigger Relay Expansion Board Module.
  • High Sensitivity Sound Microphone Sensor Detection Module.
  • Strip led BTF-LIGHTING 3.2FT 1m WS2812B 100 Pixeles.
  • HC-SR501 Adjust IR Pyroelectric Infrared PIR Motion Sensor Detector Module.
  • Ultrasonic Sensor Distance Meter Ultrasonic Measurement HCSR04.
  • DIY Design Flexible Tape for Building Christmas Tree Mounting Tape for 12mm LED Light Module WS2812B.
  • Transparent methacrylate sheet 5mm.
  • Round metallic mirror.

Configuring NeoPixels

61wF7bGaFLL._AC_SL1000_.jpg

The first thing to do is to check and configure the LED strip. For the configuration of the LED strip we use the NeoPixels library. You can find the library here::

https://github.com/adafruit/Adafruit_NeoPixel

In our case, we have configured the LED strip for 100 LEDs.

Testing

20221206_175615.jpg
8.jpg


When we have acquired the materials, the first thing we have to do is to make sure that everything works correctly, for this we use a protoboard, once everything works we can solder the connections on a PCB board.

Connection

13.jpg
14.jpg

Mention that we have powered the circuit using a powerbank, which had two usb ports, with the first port, we have powered the sensors and the Arduino, and with the second port we have powered the led strip.

As it says in the list, the Arduino sensors that we have acquired are sensor modules, that is, they come with ports which are usually Vcc, Gnd and Signal, but as we will see some of them have more ports than those mentioned.

The pin assignment can be whatever you want, so, to know to which pins we have assigned each signal just look at the code below.

Once we have clarified the above, we will start by connecting all the Vcc and Gnd sensor ports to the same power supply line that we have left for this purpose.

  • The Ultrasonic Sensor has 4 ports, the power, Trigger and Echo, the first two we already know where they go, but for the Trigger and Echo, we will have to configure the port as follows, the Trigger as output pin, since it sends a signal, and the Echo as input pin, since it receives the signal.
  • The Sensor Detector, we will connect its two power ports to the same place as the others, and its Signal port, we will assign it as an input pin.
  • The Microphone has 4 ports, but we will only have to use three since we already know where the power ports go, only two ports would remain unconnected, the ports are D0 and A0, which we will use only the D0, since it sends a digital signal, which will only be activated if it detects noise above a threshold which we can regulate from the module itself.
  • The Relay Module also has 3 inputs, power and Signal, but in this case we will assign an output pin to the Signal port.
  • The LED strip has 5 wires to connect, the three that are together which are red, black and green, which represent Vcc, Gnd and Signal, plus two reinforcement wires of Vcc and Gnd. So at first we only have to connect the Gnd and Signal which will go to the board, to the Signal we will assign an output pin. To feed the strip we will use those of reinforcement, but these instead of going to the board will go to the input of the relay, as if it were a circuit aparate, so that when the relay is activated it works and when not, it turns off independent mind of the values of the other sensors or of the signal that it sends to the strip led.

Once we have everything connected we just have to combine everything.

Arduino Program

You can find the entire arduino code on this Github repository.

As shown in the code, when the detection sensor detects motion, it generates a signal that activates the relay, which in turn turns on the LED strip, the motion sensor is set so that if we move too far away or too close it turns off, sending a signal to the relay or that when we produce a noise the LEDs change color.

Since we use a powerbank we don't have to worry about connecting it to a power outlet, with the configuration we have in the code we can turn it off and on without touching anything.

Operation

LED Infinity Illusion Mirror