Light with ultrasonic sensor

Light with ultrasonic sensor

Description

Sensor using the HCSR04 ultrasonic module. The signal will to turn on a light in a specified area. The light source could be a LED strip (12V) or a 230V normal bulb. The Arduino stores the average of 1000 distance samples. If the measured distance falls below 30% of the average, meaning somebody crosses the active area, it reacts and turns on the light. For instance, in a kitchen the sensor's distance is 3m from the reflecting wall, so the reference distance is 3m, the distance to trigger the light is approx. 0.9 meter, 30% of the 3 m. If a person comes to the table, which is near the sensor, this will activate the light above the table. If the light source is a LED strip, the output is PWM controlled and turns the light on and off gradually in a soft manner. Depending on the load, consider an external 12V supply. The 230V bulb uses a relay. Take good care of isolating the modules, the thing uses mains voltage.

Statistics

Likes

0

Downloads

0

Category

Electronics