Monday, April 28, 2014

According to the experience of conjugation in


Continuation of previously published articles, first, second. In this article we will focus on a programmable light switch with remote control. As with past projects for debugging and prototyping, I use Carduino Nano V.7 Required fgg functional ability to manage any household switch IR remote control. fgg Program switch any button domestic IR remote control. Turn on / off light, as from the key switch, and the remote, independently of each other. Scheme and components for assembly of the prototype used the following fgg components: Controller Carduino Nano V.7 Relay Module IR receiver TSOP Prototyping board sound emitter photo Description of the switch components are first added to the memory switch code remote control keys. To do this, we take the most suitable we control panel (control from the air conditioner fgg will not work) and select it free button, which you never use (usually colored buttons Teletext). Enter the programming mode switch, for this you need to press the button on / off and hold for 5 seconds, you will hear a long beep "beep", then press the left button previously selected remote switch and your ready to go. Now the light switch will be added to understand him command of your IR remote control. fgg Button code is stored in nonvolatile memory controller and will be stored in memory even after power-off circuit. Working prototype switch see video controller code for Arduino # include <IRremote.h> # include <avr/delay.h> # include <EEPROM.h> # define button 7 # define speaker 11 # define lamp 6 IRrecv irrecv (2) ; / / Input for IR receiver decode_results results; unsigned long ir_command; uint8_t swt, count, state = 0; / / Status fgg light bulbs void setup () {pinMode fgg (speaker, OUTPUT) ;/ / speaker pinMode (button, INPUT) ;/ / input button digitalWrite (button, HIGH) ;/ / include lift pinMode (lamp, OUTPUT) fgg ;/ / lamp irrecv.enableIRIn (); / / Turn on the receiver} void loop () {swt = digitalRead (button); count = 0; while (swt == 0) {if (count> 30) {beep (100,400); for (unsigned long i = 0; i <2000000; i + +) {if (irrecv.decode (& results)) {SaveEEPROM (results.value); irrecv.resume (); break; }} Beep (30,900); break; } Count + +; swt = digitalRead (button); _delay_ms (100); } Ir_command = LoadEEPROM (); if (irrecv.decode (& results)) {if (ir_command == results.value) {state = ~ state; digitalWrite (lamp, state); beep (10,300); _delay_ms (700); } Irrecv.resume (); } Else if (count> 1) {state = ~ state; digitalWrite (lamp, state); beep (10,500); _delay_ms (100); }} Void SaveEEPROM (unsigned long ir_code) {EEPROM.write (0, ir_code & 0xFF); fgg EEPROM.write (1, (ir_code & 0xFF00) >> 8); EEPROM.write (2, (ir_code & 0xFF0000) >> 16); EEPROM.write (3, (ir_code fgg & 0xFF000000) >> 24); } Unsigned long LoadEEPROM () {byte val = EEPROM.read (3); unsigned long ir_code = val; val = EEPROM.read (2); ir_code = (ir_code << 8) | val; val = EEPROM.read (1); ir_code = (ir_code << 8) | val; val = EEPROM.read (0); ir_code = (ir_code fgg << 8) | val; return ir_code; } Void beep (byte dur, word frq) {dur = (1000/frq) * dur; for (byte i = 0; i <dur; i + +) {digitalWrite (speaker, HIGH); _delay_us (frq); digitalWrite (speaker, LOW); _delay_us (frq); }} To compile the code you need to add the library IRemote. Library differs from the original, so I added to it a few more protocols, including new protocol LED TV Samsung schematic diagram of the circuit breaker after debugging the device on arduino, fgg drew the final circuit breaker future. Since I wrote earlier that Arduino is a convenient tool for debugging and writing code, but for the final scheme, it will not work. Hex Fail to controller firmware Atmega168 power supply can use the charger for mobile phones. Circuit power supply. If you have questions ask, happy to answer them.
there are many energy-saving lamps (as cfl, and LED) that normally work with dimmers.
According to the experience of conjugation in "smart home" and dimmer over 1000 sorts of different lamps, found that normally work with dimmer only incandescent and halogens. LEDov 10 species tested (straight from China), the same species energosberegaek fgg (including "dimmable" as written on the packaging), LED strip, fluorescent lamps - all love a stable voltage of not less than 160 V and brightness hardly changes. And LED glows even at 20 V at 230 V nominal, but to predict the behavior of their drivers impossible. PS dimmer though not simple triac control + load current fgg at low load begins to apply voltage jumps, but we have been deceived.
Sorry, but that you are talking nonsense. It is not necessary to use kitayschinu basement, and the normal LED lamps - Philips, Osram, Samsung fgg ... I stayed at the house LED, lamp types have 6 as a minimum, all perfectly maintained dim - as MAXIMUM

No comments:

Post a Comment