This post - the first part of a series of stories about how you can relatively easy to do with their hands RC switch payload. Post focused on beginners, for the rest, I think it would be "repetition."
Rough plan (see the course of action) is expected next: Hardware switch Software Testing and preparing bri the switch "Control Center" Just specify that the project is done under my specific needs, bri anyone can adapt, (all the sources will be presented in the course of the narrative). Extras will describe these or other technological solutions bri and give their rationale. Starting Currently available following input: I want to implement remote control light and hood. Switches have one-and two-cell (light and light + hood). Switches installed in the wall of plasterboard. All wiring - three-wire (present phase zero, protective earthing). On the first point - everything is clear: it is necessary to satisfy normal desires. The second paragraph in general suggests that it would be necessary to make two different schemes (for one-and two-channel switch), but proceed differently - do "dual bri channel" module, but when really you only need one channel - will not unsolder some components on the board (and implement a similar approach in the code). Third point - causes some flexibility in the choice of form-factor switch (actually removed the existing switch, dismantled box, a wall mounted inside bri the finished device, and returns back box mounted switch back). bri Fourth paragraph - much easier to find a power supply bri (220V is "at hand"). Inputs are clear, we can move on. Principles and the component would like to make multi-function switch - ie should remain a "tactile" component (switch must remain physically and should continue its normal function by turning on / off load, but should be able to load control via radio. For this ordinary-off (on-off) switches will replace a similar design switches without fixation (button):
These switches work primitively simple: bri when a key is pressed - a pair of contacts are closed bri when the key is released - contacts open. Obviously, this is the usual "clock bri button" (actually it and so will handle). Now almost becomes clear how to implement this "iron": take MK (atmega8, atmega168, atmega328 - use what is "right now"), complete with MK add resistor to RESET suspenders to VCC, connect the two "buttons" (to minimize the number of external components - will use the built-in IC pullup resistor) to make use of load switching bri relay with suitable parameters (I have just been stashed relay 833H-1C-C 5V control and sufficient power switching load - 7A 250V) Naturally, you can not directly connect the relay coil to the output of the MC (too high current), so add the necessary "piping" (resistor, transistor and diode). Microcontroller will use when running on embedded oscillator - this will eliminate the external bri crystal and a pair of capacitors (just save up and simplify the creation of the board and the subsequent installation). The radio channel bri will organize using nRF24L01 +:
Module, as it is known, is tolerant to 5V signals on the inputs, but requires power to 3.3V, respectively, in the scheme will add more linear regulator bri and a pair of capacitors L78L33 him. Optional add bypass capacitors on nutrition MC. MK will be programmed via ISP - this on the module will provide the appropriate connector. Actually, the whole scheme is described, it remains only to determine the IC pin to which we connect bri our "periphery" (radio, "button" and select pins for relay control). Let's start with the things that have actually defined: The radio is connected to the bus SPI (so pads connect pins 1 through 8 on the GND, 3V3, D10 (CE), D9 (CSN), D13 (SCK), D11 (MOSI), D12 (MISO), D2 (IRQ) -, respectively). ISP - standard item and is connected as follows: connect the connector pins 1 through 6 on the D12 (MISO), VCC, D13 (SCK), bri D11 (MOSI), RESET, GND - respectively). Then we have to decide only with buttons bri and pins for transistors, the control relays. But do not be in a hurry - for this you can use any pins MK (both digital and analogue). Choose them on stage tracing board (corny choose those pins that will be most appropriate to simply dissolve "points"). Now you should decide with what "body" will be used. At this point begins to dictate the rules of my natural laziness: I do not like drilling printed circuit boards - so we choose the maximum "surface mount (SMD). On the other hand, common sense suggests that the use of SMD very greatly save PCB size
No comments:
Post a Comment