Introduction: RGB-light-driven Movement of the Palms Contactless

About: Developer and teacher.

RGB-night light, with the ability to control the color of the night light using hand movements. Using three distance sensors, we will change the brightness of each of the three components of the RGB color when approaching or removing the hand. An Arduino Board was used as a microcontroller.

Step 1: List of Components

The project required the following details

  • Arduino controller-1 pc;
  • 8x8 RGB matrix-1 pc;
  • Ultrasonic distance sensor HC-SR04-3 pcs;
  • Shift register-chip 74hc595 - 4 pcs;
  • 220 Ohm resistor-24 pcs;
  • Power supply unit 5V 2A - 1 pc.
  • Ceiling light with stand - pc;
  • Wires, solder, etc

Step 2: Electrical Circuit

Step 3: The Assembly of the Lamp

Step 4: Creating a Sketch

Development of the sketch. When developing the sketch, I set the following parameters:

- the distance of 1-20 cm, 1 - maximum brightness, 20 - zero - distance sensors in the loop read the data and apply the resulting distance to set the brightness - if the distance changes from 1-20 cm to more than 20 cm in a cycle (the hand goes to the side) - this brightness is fixed for this color

The brightness is set by applying a PWM signal to the output of the matrix for groups R, G, B. the frequency of the PWM signal is approximately 60 Hz. The PWM signal is generated as follows:

For example, a distance of 5 cm

PWM signal-15-(5-1)=10 interrupt cycles the LEDs of this color are lit 4-1-LEDs of this color are not lit