Hello everybody. In this instructable I'll show you how to make easily a contactless switch with a distance sensor. It might be very useful for your house or other machines.
Because I'm a student and I'm making a project about 'Passive house' and I want to have a special switch.
Step 1: What You Need
What you need to make this switch, are:
-a distance sensor. I prefer the HC-SR04 or a HC-SR05.
-an arduino board
-an LED to test the program
Step 2: Wiring
The distance sensor have 4 pins:
-VCC to 5V pin on your arduino board
-TRIG to a digital pin (in my case pin 3)
-ECHO to another digital pin (in my case pin 4)
-GND to GND
Connect the LED to a digital pin, it has to be different from the other pins.
Step 3: Program
This is the code for the switch. Use my code if you wish.
Step 4: Result...
Sorry for my English. I'm not a native speaker. If you have any improvement, they are welcome!