РЕКЛАМА НА ФОРУМХАУС @InteractiveHome, для меня, как инсталлятора, интересны способы объединения этого элемента системы освещения с остальной системой освещения, и далее - с системой управления. Какие существуют возможности на этот счет?
Наверняка это можно использовать. Тут дело в том какие задачи стоят, в выдумке и фантазии исполнителя) Изначально имелось ввиду автономное использование системы автоматики для управления подсветкой и освещения лестницы. Она наиболее актуальна именно в темное время суток (когда остальное освещение выключено и уровень естественного света низок). Для определения факта "наступления темноты" в подобных системах служит датчик освещенности.
На адресуемой ленте может получится намного интереснее и гораздо дешевле Под спойлером скетч для ардуино, если есть желание сделать самому Спойлер / Edit by Serge Niko June 2015 #include <Adafruit_NeoPixel.h> #define PIN 6 / Parameter 1 = number of pixels in strip / Parameter 2 = Arduino pin number (most are valid) / Parameter 3 = pixel type flags, add together as needed: / NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) / NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) / NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) / NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel (560, PIN, NEO_GRB + NEO_KHZ800); / IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across / pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input / and minimize distance between Arduino and first pixel. Avoid connecting / on a live circuit...if you must, connect GND first. / Set up Variables unsigned long timeOut=60000; / timestamp to remember when the PIR was triggered. int downUp = 0; / variable to rememer the direction of travel up or down the stairs int alarmPinTop = 10; / PIR at the top of the stairs int alarmPinBottom =11; / PIR at the bottom of the stairs int alarmValueTop = LOW; / Variable to hold the PIR status int alarmValueBottom = LOW; / Variable to hold the PIR status int ledPin = 13; / LED on the arduino board flashes when PIR activated int LDRSensor = A0; / Light dependant resistor int LDRValue = 0; / Variable to hold the LDR value int colourArray[350]; / An array to hold RGB values int change = 1; / used in 'breathing' the LED's int breathe = 0; / used in 'breathing' the LED's void setup() { strip. begin(); strip. show(); / Initialize all pixels to 'off' Serial. begin (9600); / only requred for debugging pinMode (ledPin, OUTPUT); / initilise the onboard pin 13 LED as an indicator pinMode (alarmPinTop, INPUT_PULLUP); / for PIR at top of stairs initialise the input pin and use the internal restistor pinMode (alarmPinBottom, INPUT_PULLUP); / for PIR at bottom of stairs initialise the input pin and use the internal restistor delay (2000); / it takes the sensor 2 seconds to scan the area around it before it can /detect infrared presence. for (int i=0 ;i < 350; i+) { / initilise the colourArray to zero colourArray=0; } } void loop() { LDRValue = analogRead (LDRSensor); /Serial.println (LDRValue); if (timeOut+15700 < millis() { / idle state - 'breathe' the top and bottom LED to show program is looping breathe = breathe + change; strip. setPixelColor (0,0,0,breathe); strip. setPixelColor (34,0,0,breathe); strip. setPixelColor (35,0,0,breathe); strip. setPixelColor (69,0,0,breathe); strip. setPixelColor (70,0,0,breathe); strip. setPixelColor (104,0,0,breathe); strip. setPixelColor (105,0,0,breathe); strip. setPixelColor (139,0,0,breathe); strip. setPixelColor (140,0,0,breathe); strip. setPixelColor (174,0,0,breathe); strip. setPixelColor (175,0,0,breathe); strip. setPixelColor (209,0,0,breathe); strip. setPixelColor (210,0,0,breathe); strip. setPixelColor (244,0,0,breathe); strip. setPixelColor (245,0,0,breathe); strip. setPixelColor (279,0,0,breathe); strip. setPixelColor (280,0,0,breathe); strip. setPixelColor (314,0,0,breathe); strip. setPixelColor (315,0,0,breathe); strip. setPixelColor (349,0,0,breathe); strip. setPixelColor (350,0,0,breathe); strip. setPixelColor (384,0,0,breathe); strip. setPixelColor (385,0,0,breathe); strip. setPixelColor (419,0,0,breathe); strip. setPixelColor (420,0,0,breathe); strip. setPixelColor (454,0,0,breathe); strip. setPixelColor (455,0,0,breathe); strip. setPixelColor (489,0,0,breathe); strip. setPixelColor (490,0,0,breathe); strip. setPixelColor (524,0,0,breathe); strip. setPixelColor (525,0,0,breathe); strip. setPixelColor (559,0,0,breathe); strip. show(); if (breathe = 25 | breathe = 0) change = -change; / breathe the LED from 0 = off to 100 = fairly bright if (breathe = 25 | breathe = 0); delay (100); / Pause at beginning and end of each breath delay (10); } /if (LDRValue > 950) { / only switch on LED's at night when LDR senses low light conditions - you may have to change the number for your circumstances! alarmValueTop = digitalRead (alarmPinTop); / Constantly poll the PIR at the top of the stairs /Serial.println (alarmPinTop); alarmValueBottom = digitalRead (alarmPinBottom); / Constantly poll the PIR at the bottom of the stairs /Serial.println (alarmPinBottom); if (alarmValueTop = HIGH && downUp != 2) { / the 2nd term allows timeOut to be contantly reset if one lingers at the top of the stairs before decending but will not allow the bottom PIR to reset timeOut as you decend past it. timeOut=millis(); / Timestamp when the PIR is triggered. The LED cycle wil then start. downUp = 1; /clearStrip(); topdown(); / lights up the strip from top down } if (alarmValueBottom = HIGH && downUp != 1) { / the 2nd term allows timeOut to be contantly reset if one lingers at the bottom of the stairs before decending but will not allow the top PIR to reset timeOut as you decend past it. timeOut=millis(); / Timestamp when the PIR is triggered. The LED cycle wil then start. downUp = 2; /clearStrip(); bottomup(); / lights up the strip from bottom up } /} if (timeOut+10000 < millis() && timeOut+15000 < millis() { /switch off LED's in the direction of travel. if (downUp = 1) { colourWipeDown (strip.Color (0, 0, 0), 100); / Off } if (downUp = 2) { colourWipeUp (strip.Color (0, 0, 0), 100); / Off } downUp = 0; for (int i=0 ;i < 35; i+) { / Depending on your preference you may want to include this loop to clear out the colourArray colourArray=0; } } if (timeOut+15000 < millis() && timeOut+15999 > millis() fade(); / Fade/switch off LED's } void topdown() { Serial. println ("detected top"); / Helpful debug message colourWipeDown (strip.Color (255, 255, 200), 25); / Warm White /for (int i=0; i<3; i+) { / Helpful debug indication flashes led on Arduino board twice /digitalWrite (ledPin,HIGH); /delay (200); /digitalWrite (ledPin,LOW); /delay (200); /} } void idlePattern (uint32_t c, uint16_t wait){ for (uint16_t i=0; i<strip.numPixels(); i = i+35){ strip. setPixelColor (i,c); strip. show(); delay (wait); strip. setPixelColor (i,(0,0,0); } for (uint16_t j= strip. numPixels(); j>0; j = j-35){ strip. setPixelColor (j-1,c); strip. show(); delay (wait); strip. setPixelColor (j-1,(0,0,0); } } void bottomup() { Serial. println ("detected bottom"); / Helpful debug message colourWipeUp (strip.Color (255, 255, 200), 25); / Warm White /for (int i=0; i<3; i+) { / Helpful debug indication flashes led on Arduino board twice /digitalWrite (ledPin,HIGH); /delay (200); /digitalWrite (ledPin,LOW); /delay (200); /} } / Fade light each step strip void colourWipeDown (uint32_t c, uint16_t wait) { for (uint16_t j = 0; j < 16; j+){ int start = strip. numPixels()/16 *j; /for (float b=0; b<=1; b = b+0.5){ for (uint16_t i = start; i < start + 35; i+){ strip. setPixelColor (i, c); strip. show(); } /delay (5); /} delay (wait); } } void clearStrip(){ for (int l=0; l<strip.numPixels(); l+){ strip. setPixelColor (l, (0,0,0); } } / Fade light each step strip void colourWipeUp (uint32_t c, uint16_t wait) { for (uint16_t j = 16; j > 0; j-){ int start = strip. numPixels()/16 *j; /start = start-1; /for (float b=0; b<=1; b = b+0.5){ for (uint16_t i = start; i > start - 35; i-){ strip. setPixelColor (i-1, c); strip. show(); } /delay (5); /} /Serial.println (j); delay (wait); } } / Play the LED fade out void fade(){ for (int j = 0; j <70; j+) { for (int i=350; i>-1; i-) { colourArray=colourArray-1; / reduce intensity of light by 1 if (colourArray <= 0) colourArray = 0; } for (int k=0; k<351; k=k+3) { uint32_t c = strip. Color (colourArray[k],colourArray[k+1],colourArray[k+2]); strip. setPixelColor (k+3)/3)-1,c); } strip. show(); delay (60); } breathe = 0; change = 1; }
Подарок к НОВОМУ ГОДУ Рабочий импортный проект г - на Serge N Спойлер Serge N / Edit by Serge Niko June 2015 #include <Adafruit_NeoPixel.h> #define PIN 6 / Parameter 1 = number of pixels in strip / Parameter 2 = Arduino pin number (most are valid) / Parameter 3 = pixel type flags, add together as needed: / NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) / NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) / NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) / NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel (560, PIN, NEO_GRB + NEO_KHZ800); / IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across / pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input / and minimize distance between Arduino and first pixel. Avoid connecting / on a live circuit...if you must, connect GND first. / Set up Variables unsigned long timeOut=60000; / timestamp to remember when the PIR was triggered. int downUp = 0; / variable to rememer the direction of travel up or down the stairs int alarmPinTop = 10; / PIR at the top of the stairs int alarmPinBottom =11; / PIR at the bottom of the stairs int alarmValueTop = LOW; / Variable to hold the PIR status int alarmValueBottom = LOW; / Variable to hold the PIR status int ledPin = 13; / LED on the arduino board flashes when PIR activated int LDRSensor = A0; / Light dependant resistor int LDRValue = 0; / Variable to hold the LDR value int colourArray[350]; / An array to hold RGB values int change = 1; / used in 'breathing' the LED's int breathe = 0; / used in 'breathing' the LED's void setup() { strip. begin(); strip. show(); / Initialize all pixels to 'off' Serial. begin (9600); / only requred for debugging pinMode (ledPin, OUTPUT); / initilise the onboard pin 13 LED as an indicator pinMode (alarmPinTop, INPUT_PULLUP); / for PIR at top of stairs initialise the input pin and use the internal restistor pinMode (alarmPinBottom, INPUT_PULLUP); / for PIR at bottom of stairs initialise the input pin and use the internal restistor delay (2000); / it takes the sensor 2 seconds to scan the area around it before it can /detect infrared presence. for (int i=0 ;i < 350; i+) { / initilise the colourArray to zero colourArray=0; } } void loop() { LDRValue = analogRead (LDRSensor); /Serial.println (LDRValue); if (timeOut+15700 < millis() { / idle state - 'breathe' the top and bottom LED to show program is looping breathe = breathe + change; strip. setPixelColor (0,0,0,breathe); strip. setPixelColor (34,0,0,breathe); strip. setPixelColor (35,0,0,breathe); strip. setPixelColor (69,0,0,breathe); strip. setPixelColor (70,0,0,breathe); strip. setPixelColor (104,0,0,breathe); strip. setPixelColor (105,0,0,breathe); strip. setPixelColor (139,0,0,breathe); strip. setPixelColor (140,0,0,breathe); strip. setPixelColor (174,0,0,breathe); strip. setPixelColor (175,0,0,breathe); strip. setPixelColor (209,0,0,breathe); strip. setPixelColor (210,0,0,breathe); strip. setPixelColor (244,0,0,breathe); strip. setPixelColor (245,0,0,breathe); strip. setPixelColor (279,0,0,breathe); strip. setPixelColor (280,0,0,breathe); strip. setPixelColor (314,0,0,breathe); strip. setPixelColor (315,0,0,breathe); strip. setPixelColor (349,0,0,breathe); strip. setPixelColor (350,0,0,breathe); strip. setPixelColor (384,0,0,breathe); strip. setPixelColor (385,0,0,breathe); strip. setPixelColor (419,0,0,breathe); strip. setPixelColor (420,0,0,breathe); strip. setPixelColor (454,0,0,breathe); strip. setPixelColor (455,0,0,breathe); strip. setPixelColor (489,0,0,breathe); strip. setPixelColor (490,0,0,breathe); strip. setPixelColor (524,0,0,breathe); strip. setPixelColor (525,0,0,breathe); strip. setPixelColor (559,0,0,breathe); strip. show(); if (breathe = 25 | breathe = 0) change = -change; / breathe the LED from 0 = off to 100 = fairly bright if (breathe = 25 | breathe = 0); delay (100); / Pause at beginning and end of each breath delay (10); } /if (LDRValue > 950) { / only switch on LED's at night when LDR senses low light conditions - you may have to change the number for your circumstances! alarmValueTop = digitalRead (alarmPinTop); / Constantly poll the PIR at the top of the stairs /Serial.println (alarmPinTop); alarmValueBottom = digitalRead (alarmPinBottom); / Constantly poll the PIR at the bottom of the stairs /Serial.println (alarmPinBottom); if (alarmValueTop = HIGH && downUp != 2) { / the 2nd term allows timeOut to be contantly reset if one lingers at the top of the stairs before decending but will not allow the bottom PIR to reset timeOut as you decend past it. timeOut=millis(); / Timestamp when the PIR is triggered. The LED cycle wil then start. downUp = 1; /clearStrip(); topdown(); / lights up the strip from top down } if (alarmValueBottom = HIGH && downUp != 1) { / the 2nd term allows timeOut to be contantly reset if one lingers at the bottom of the stairs before decending but will not allow the top PIR to reset timeOut as you decend past it. timeOut=millis(); / Timestamp when the PIR is triggered. The LED cycle wil then start. downUp = 2; /clearStrip(); bottomup(); / lights up the strip from bottom up } /} if (timeOut+10000 < millis() && timeOut+15000 < millis() { /switch off LED's in the direction of travel. if (downUp = 1) { colourWipeDown (strip.Color (0, 0, 0), 100); / Off } if (downUp = 2) { colourWipeUp (strip.Color (0, 0, 0), 100); / Off } downUp = 0; for (int i=0 ;i < 35; i+) { / Depending on your preference you may want to include this loop to clear out the colourArray colourArray=0; } } if (timeOut+15000 < millis() && timeOut+15999 > millis() fade(); / Fade/switch off LED's } void topdown() { Serial. println ("detected top"); / Helpful debug message colourWipeDown (strip.Color (255, 255, 200), 25); / Warm White /for (int i=0; i<3; i+) { / Helpful debug indication flashes led on Arduino board twice /digitalWrite (ledPin,HIGH); /delay (200); /digitalWrite (ledPin,LOW); /delay (200); /} } void idlePattern (uint32_t c, uint16_t wait){ for (uint16_t i=0; i<strip.numPixels(); i = i+35){ strip. setPixelColor (i,c); strip. show(); delay (wait); strip. setPixelColor (i,(0,0,0); } for (uint16_t j= strip. numPixels(); j>0; j = j-35){ strip. setPixelColor (j-1,c); strip. show(); delay (wait); strip. setPixelColor (j-1,(0,0,0); } } void bottomup() { Serial. println ("detected bottom"); / Helpful debug message colourWipeUp (strip.Color (255, 255, 200), 25); / Warm White /for (int i=0; i<3; i+) { / Helpful debug indication flashes led on Arduino board twice /digitalWrite (ledPin,HIGH); /delay (200); /digitalWrite (ledPin,LOW); /delay (200); /} } / Fade light each step strip void colourWipeDown (uint32_t c, uint16_t wait) { for (uint16_t j = 0; j < 16; j+){ int start = strip. numPixels()/16 *j; /for (float b=0; b<=1; b = b+0.5){ for (uint16_t i = start; i < start + 35; i+){ strip. setPixelColor (i, c); strip. show(); } /delay (5); /} delay (wait); } } void clearStrip(){ for (int l=0; l<strip.numPixels(); l+){ strip. setPixelColor (l, (0,0,0); } } / Fade light each step strip void colourWipeUp (uint32_t c, uint16_t wait) { for (uint16_t j = 16; j > 0; j-){ int start = strip. numPixels()/16 *j; /start = start-1; /for (float b=0; b<=1; b = b+0.5){ for (uint16_t i = start; i > start - 35; i-){ strip. setPixelColor (i-1, c); strip. show(); } /delay (5); /} /Serial.println (j); delay (wait); } } / Play the LED fade out void fade(){ for (int j = 0; j <70; j+) { for (int i=350; i>-1; i-) { colourArray=colourArray-1; / reduce intensity of light by 1 if (colourArray <= 0) colourArray = 0; } for (int k=0; k<351; k=k+3) { uint32_t c = strip. Color (colourArray[k],colourArray[k+1],colourArray[k+2]); strip. setPixelColor (k+3)/3)-1,c); } strip. show(); delay (60); } breathe = 0; change = 1; }
Ну, тот страшный датчик стоит 32 евро, если я правильно подсчитал. И кроме подсветки ничего не умеет и работает только со своим контроллером. Меня бы из-за него жаба задавила.
Есть и по 8,5 евро аналоги, и то основная стоимость в арматуре датчика, нужно красивый дизайн, плати .
Никто не видел недорогие диммеры, основная задача которых - просто плавное повышение освещение СД-ленты? На али есть полно недорогих контроллеров регулирования с несколькими программами, но они управляются кнопкой - т. е. меняют режимы после запуска ленты. Нужен просто плавное увеличение света для комфорта (плавное затухание обеспечивается конденсатором БП ).
И то же самое, но наше посконное, Русское За 6 евро Пирон-5 - это извещатель охранный, оптико-электронного типа. Устройство включает в себя микропроцессорное управление и настройку чувствительности, а также сферическую линзу, которая обеспечивает качественное наблюдение за зонами, без помех и искажений. Основное предназначение - это охрана домаили любого технического помещения, где необходимо максимально исключить вероятность проникновения злоумышленника. Охранные системы, которые используют данную модель, получают тревожный сигнал на контрольную панель после того, как происходит размыкание шлейфов на датчике, посредством реле. Имеет высокую степень защиты от различных источников радиопомех и засветок внешнего типа с мощность до 6500 Люксов. Важная особенность - это регулировка чувствительности дискретного типа для животных. Пользователь может самостоятельно настроить уровень чувствительности устройства, выбирая режимы нераспознаваемых объектов от 10 до 40кг. Установку рекомендовано осуществлять в угловых зонах помещений. Поддерживает возможность выбора дальности срабатывания: Режим 10 кг - максимальная дальность 10 м (кошки, декоративные собаки); Режим 20 кг - максимальная дальность 9 м (кошки и небольшие собаки); Режим 40 кг - максимальная дальность 8 м (длинношерстные собаки); Режим 40 кг - максимальная дальность 7 м (любые собаки до 40 кг).