As the out of the ordinary plinus to make an led light corridor motion sensor

Bothered me one problem – the dark corridor on the way from the bedroom to the kitchen. You know, like in the kitchen at night to walk, but uncomfortable in the dark, and because the relative width of the corridor is long enough, then the probability of deviation from the route when navigating via built-in gyros's head.

Error accumulates, and even legs of different lengths, went with outstretched arms and fell in a doorway is not the first time.

Yes, of course there are all sorts of lamps, motion sensors, smart home, but I have better, I have a plastic plinth with cable channel.

So the idea arose to put a led strip in there and see how it will feel and get, you know, pretty cool, this podsvetka, as in space ships.





Well, then of course the ARDUINO! And what for? And so Smart! Ordered on Ali 2 motion sensor and went to work.



Not work of course, but fun. The motion sensor was selected without trying and just my luck, it fit perfectly in the plinth. Two sensors were needed to put them on both ends of the floor, because the dishes need to get back.





The Pinout of the sensor is the Chinese somehow made under the lens. The range of supply voltages of 4.5 to 20V, output: 3.3 V – there is motion 0V there is no motion. There is another jumper and two podstroechnye, did not understand, because by default, everything worked fine. Still, when all put together and separarely 2 output sensors, voltage, when the movement was around 1.5 V. I Think that you can't do that and had to put the diodes, but to disassemble again was reluctant, especially since the solution was opened to the ADC.



The conveyor can be operated in fieldwork IRFZ34N, because such a lie. Of course it doesn't open fully five volts, but with my band, which consumes about 1A at 12V it handles without heating.



The photoresistor was taken cheap Chinese.
The program is simple, with this logic: if the light intensity drops below a certain threshold, illuminated, smoothly switched on and after a specified time turn off smoothly. If during the illumination of again picking up movement, we consider the delay again. The lighting does not measure the light, because the light sensor is lighted by the baseboard.
 

int ledPin = 5; //Led stripint lightSensorPin = A7; //Photoresistorint motionSensorPin = A0; //motion Sensorint val = 0; //Brightness ribbonint light = 0; //Lightint motion = 0; //Motionint timerCounter = 0; //Rhyme timeint timerEnable = false; //Start of loop enableint timeOn = 8; //Time in secondsint faderEnable = false; //Allows to go outint lightEnable = false; //Allows the backlightvoidsetup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } voidloop() { analogWrite(ledPin, val); light = analogRead(lightSensorPin); motion = analogRead(motionSensorPin); if (light < 50 && !lightEnable){ delay(1000); if (light < 50) lightEnable = true; } if (light > 50 && val == 0) lightEnable = false; if (motion > 150 && lightEnable){ timerEnable = true; faderEnable = false; } if (timerEnable){ timerCounter ++; val = val + 1; if (val > 254) val = 254; if (timerCounter > timeOn * 50){ if (motion < 150){ //val = 0; timerCounter = 0; timerEnable = false; faderEnable = true; } else { timerCounter = 0; } } } if (faderEnable){ val = val — 2; if (val < 0){ faderEnable = false; val = 0; } } // Serial.println(light); delay(20); } All touch the farm was installed in the plinth, and for Arduino with power supply was printed on a 3D printer case, all Packed, closed and hidden.









SUBSCRIBE to OUR youtube channel that allows you to watch online, download from YouTube free video about the recovery, the rejuvenation of man. Love for others and ourselves, as the feeling of high vibrations — an important factor for improvement .

http://cdn00.vidyomani.com/c/1/6/1/li39dps2z55g/index.html

Put LIKES and share with your FRIENDS!

www.youtube.com/channel/UCXd71u0w04qcwk32c8kY2BA/videos

Subscribe -https://www.facebook.com//

After the work was done, I thought that it would be cool to make a narrow charge controller that would fit in the plinth, and it would need to bring only food, but all the wiring inside the plinth. But I wanted quickly and the fact that there is, therefore, from the floor going 6 lived in a fairly bulky body. Use the Smart skirting Board, evaluated all homemade. Smooth on and dim, even light, that's all you need for night walks.

So tempted, in accordance with the latest trends, write: "In the future I plan to tie Wi-Fi and equipped with sensors so that when you walk past he measured the heart rate and calculate calories burned, and struck the attackers discharge in the absence of a footprint in the database, led the statistics of on/off cycles and connected to the cloud" and how it shines and nothing more. published

 

P. S. And remember, only by changing their consumption — together we change the world! ©

Join us in Facebook , Vkontakte, Odnoklassniki

Source: geektimes.ru/post/276198/

Tags

See also

New and interesting