No-touch Light Dimmer

by JustV4 in Living > Life Hacks

1741 Views, 30 Favorites, 0 Comments

No-touch Light Dimmer

5885356d8080cf0cfe005d0f.jpeg

Hello Community,

In this tutorial, i'll show you how to easily control the brightness of your lamp without having to touch anything!
This is a very simple project, and can easily be adjusted to will.

Gathering the Parts

step1.jpg

The parts needed are:

- Arduino Uno
- Breadboard
- Dinstance sensor
- Servomotor
- Jumper wires
- Socket dimmer

Connecting the Parts

Capture2.PNG

The next thing that we'll have to do, is connect everything.
I made a quick schematic, as seen above.

NOTE: Some distance sensors (like mine) have 2 signal ports (TRIG and ECHO)
Connect TRIG to digital 7 and ECHO to digital 6

Attach the Servomotor to the Dimmer

step3.jpg

As you can see, I attached it with tape.
This is not super stable, so you can best use hot glue or other methods.

Transfer the Code to Your Arduino

I uploaded the code to this pastebin: http://pastebin.com/DkJkWc53
As you can see, i attached the TRIG of the distance sensor to digital 7, and ECHO to 6.

You can play around with the distances, and the values in which your lamp will increase and decrease in brightness.

Upload the code, and the device should work!

Make a Nice Casing

stepidk.jpg

Don't judge my woodcrafting skills, but this will keep everything nicely in place.
If you make a nice looking case, it will look pretty on your nightstand!