User Tools

Site Tools


rgb_dimmer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rgb_dimmer [2014/07/12 16:19] – external edit 127.0.0.1rgb_dimmer [2023/02/28 14:24] (current) – [Modification of PCB rev. <= 1.1] breaker27
Line 1: Line 1:
-====== Building up a Power Switch ======+====== Building up an RGB Dimmer ======
  
 ===== Needed Parts and PCB ===== ===== Needed Parts and PCB =====
  
-You need a **PCB**. You may use the layout from [[https://github.com/breaker27/smarthomatic/tree/develop/hardware/power_switch_1|Github]] and etch it yourself or [[https://www.smarthomatic.org/shop/|order]] the PCB or a complete kit.+You need a **PCB**. You may use the layout from [[https://github.com/breaker27/smarthomatic/tree/develop/hardware/rgb_dimmer_1|Github]] and etch it yourself or [[https://www.smarthomatic.org/shop/|order]] the PCB or a complete kit.
  
 ==== Partlist (in buildup order) ==== ==== Partlist (in buildup order) ====
  
 ^  Amount  ^               Part                      ^  Placing               Picture                    ^ ^  Amount  ^               Part                      ^  Placing               Picture                    ^
-|    1     | PCB Power Switch                      |            |  {{ parts:pcb_power_switch.jpg }}      +|    1     | PCB RGB Dimmer                        |            |  {{ parts:pcb_rgb_dimmer.jpg }}        
-|        | Diode 1N4148                            | D1, D2     |  {{ parts:diode_1n4148.jpg }}          | +|        | Diode 1N4148                            | D1         |  {{ parts:diode_1n4148.jpg }}          | 
-|        | Resistor 560R green-blue-brown          | R1, R2     |  {{ parts:resistor_560r.jpg }}         | +|        | Resistor 560R green-blue-brown          | R1-R4      |  {{ parts:resistor_560r.jpg }}         | 
-|    1     | Resistor 1M brown-black-green           R3         |  {{ parts:resistor_1m.jpg }}           |+|    1     | Resistor 1M brown-black-green           R5         |  {{ parts:resistor_1m.jpg }}           |
 |    1     | IC holder                               | IC1        |  {{ parts:ic_holder.jpg }}             | |    1     | IC holder                               | IC1        |  {{ parts:ic_holder.jpg }}             |
 |    1     | Voltage regulator LP2950Z               | IC3        |  {{ parts:ic_lp2950z.jpg }}            | |    1     | Voltage regulator LP2950Z               | IC3        |  {{ parts:ic_lp2950z.jpg }}            |
-|        | Transistor BC547C                       | T1         |  {{ parts:transistor_bc547c.jpg }}     |+|        | Transistor BC337                        | T1-T3      |  {{ parts:transistor_bc547c.jpg }}     |
 |    1     | LED 2mA                                 | LED1        {{ parts:led_yellow.jpg }}            | |    1     | LED 2mA                                 | LED1        {{ parts:led_yellow.jpg }}            |
-|    1     | Connector AVR ISP 6pin angled           | JP1        |  {{ parts:connector_isp_angled.jpg }}  | +|    1     | Connector AVR ISP 6pin                  | JP1        |  {{ parts:connector_isp.jpg }}         | 
-|    1     | Connector Switched Output 3pin          | X1         |  {{ parts:connector_clamp_3pin.jpg }}  +|    1     | Connector pin header (for serial TX debugging etc.)  | JPx   |  {{ parts:connector_pinheader.jpg }}   |
-|    1     | Connector pin header (for serial TX debugging) JP5        |  {{ parts:connector_pinheader.jpg }}   |+
 |    1     | Capacitor 10µF                          | C1          {{ parts:capacitor_10uf.jpg }}        | |    1     | Capacitor 10µF                          | C1          {{ parts:capacitor_10uf.jpg }}        |
 +|    1     | Capacitor 100µF                         | C2          {{ parts:capacitor_100uf.jpg }}       |
 |    1     | IC ATMega328                            | IC1        |  {{ parts:atmega.jpg }}                | |    1     | IC ATMega328                            | IC1        |  {{ parts:atmega.jpg }}                |
-|    1     | Relay FTR-K1C (230V, 16A)               | K1          {{ parts:relay_ftr_k1c.jpg }}         | 
 |    1     | Transceiver PCB RFM12B                  | IC2        |  {{ parts:ic_rfm12b.jpg }}             | |    1     | Transceiver PCB RFM12B                  | IC2        |  {{ parts:ic_rfm12b.jpg }}             |
 |    1     | Antenna (82,2mm wire)                              |  {{ parts:antenna.jpg }}               | |    1     | Antenna (82,2mm wire)                              |  {{ parts:antenna.jpg }}               |
  
-maybe extra pinsat your opinion.+You have to decide on the LEDs you want to use. Depending on the typeyou have to use different resistors R6, R7, R8 for the LEDs. See further down for a recommended one. 
 + 
 +The capacitor C2 is only to buffer the input voltage in case you connect LEDs that draw much power and you want to avoid problems with some programmers that may have problems flahing when the voltage changes much.
  
 ===== Buildup of PCB ===== ===== Buildup of PCB =====
Line 35: Line 36:
   * **IC holder:** Look at the notch and place it in the right direction.   * **IC holder:** Look at the notch and place it in the right direction.
   * **LED:** Solder it to a wire if you want to place the PCB in a housing later. Read the instructions on how to [[LED_soldering|solder the LED to a cable]]. The longer wire of the LED is +. It goes into the hole more in the middle of the PCB.   * **LED:** Solder it to a wire if you want to place the PCB in a housing later. Read the instructions on how to [[LED_soldering|solder the LED to a cable]]. The longer wire of the LED is +. It goes into the hole more in the middle of the PCB.
-  * **ISP Connector:** The notch points to the side of the PCB (towards the voltage regulator)+  * **ISP Connector:** The notch points to the side of the PCB. 
-  * **10 uF Capacitor:** The marked line is -, which points to the LED. On the PCB, + is labelled.+  * **10 uF Capacitor:** The marked line is -, which points to the mid of the PCB. On the PCB, + is labelled.
   * **ATMega:** Before inserting it, you may want to check the voltage levels when switching the power on. Pin7 should have VCC (3V) against pin8 (ground). If you have different voltages: don't panic, nothing is broken, nothing is fried. Search your error. To insert the ATMega, bend the pins at 90 degreed by placing the ATMega on the table and bending it carefully. Then insert it into the IC holder. Be sure that you are not charged with electricity (ESD!) when touching the IC pins.   * **ATMega:** Before inserting it, you may want to check the voltage levels when switching the power on. Pin7 should have VCC (3V) against pin8 (ground). If you have different voltages: don't panic, nothing is broken, nothing is fried. Search your error. To insert the ATMega, bend the pins at 90 degreed by placing the ATMega on the table and bending it carefully. Then insert it into the IC holder. Be sure that you are not charged with electricity (ESD!) when touching the IC pins.
   * **RFM12B:** You should also check the voltages first before soldering the module. At the place for the radio module the pad beside the antenna and at the opposite side the third pad should read about 3.3 V. For soldering, read [[rfm12b_soldering|the RFM12B mounting instructions]].   * **RFM12B:** You should also check the voltages first before soldering the module. At the place for the radio module the pad beside the antenna and at the opposite side the third pad should read about 3.3 V. For soldering, read [[rfm12b_soldering|the RFM12B mounting instructions]].
-  * **Relais:** If you want to switch high currents, especially at high voltages, it is recommended to solder the wires directly to the relais pins on the bottom of the PCB. 
  
-{{https://raw.github.com/breaker27/smarthomatic/develop/hardware/power_switch_1/placing.png?500}}+{{https://raw.github.com/breaker27/smarthomatic/develop/hardware/rgb_dimmer_1/placing.png?500}}
  
 //(Image directly loaded from external GitHub source. If it doesn't work, fix link in wiki!)// //(Image directly loaded from external GitHub source. If it doesn't work, fix link in wiki!)//
 +
 +
 +===== Modification of PCB rev. <= 1.1 and SW rev >= 0.13.0 =====
 +
 +The older PCBs have the speaker connected to PD3 (pin5). Since the 16 bit timer has to be used to generate accurate frequencies, you have to connect it instead to PB1 (pin 15). The pin to drive the transistor for the blue LED has to be moved from PB1 (pin 15) to PD3 (pin 5).
 +
 +In future PCB versions, this shall be changed in the schematic and layout.
 +
 +To perform the modification, cut the PCB tracks on the marked positions and connect them to the other pins with patch cables.
 +
 +{{ rgb_dimmer_speaker_mod.jpg }}
  
 ===== Flashing the firmware ===== ===== Flashing the firmware =====
Line 49: Line 60:
 If you have a new ATMega where nothing is flashed onto, [[http://www.smarthomatic.org/builds/builds.html|download a prebuilt binary package]] or [[build your own firmware|build your own firmware]]. If you bought a hardware kit, the ATMega should already be flashed. If you have a new ATMega where nothing is flashed onto, [[http://www.smarthomatic.org/builds/builds.html|download a prebuilt binary package]] or [[build your own firmware|build your own firmware]]. If you bought a hardware kit, the ATMega should already be flashed.
  
-After flashing and switching the power on, your power switch should blink three times slowly. If you haven'flashed working EEPROM settings, it flashed quickly endlessly.+===== Power the Device ===== 
 + 
 +The device has an internal voltage regulator with 3.3V output to power the ATMega and the RFM12B. It's recommended to power the whole device with a 5V power supply. You can use a cheap one that is meant as phone charger. They have typically 500mA output current. 
 + 
 +===== Connecting LEDs ===== 
 + 
 +You can power three single LEDs or a multi RGB LED with common anode (+)The maximum current is 0.6A, limited by the transistors. Calculate the resistor you need by the following formula: 
 + 
 +R = (U_in - 0.3 - U_LED) / I_LED 
 + 
 +with U_in the input voltage of the device (e.g. 5V), U_LED the voltage your LED needs (e.g. 2.8V) and I_LED the current you want to do through the LED (e.g. 250mA). 
 + 
 +==== Recommended LED module and resistors ==== 
 + 
 +One LED type that is very bright with a moderate current are the **Cree XP-E LEDs**. They are available as a module in the smarthomatic shop. The module makes assembling easier and ensures good cooling. 
 + 
 +If you use this module, the following sets of resistors are recommended: 
 + 
 +^  Placing  ^       Part                  ^  normal  ^  bright  ^    max   ^ 
 +|    R6     | Resistor for **red** LED    |   39 Ohm |   27 Ohm |  7,5 Ohm | 
 +|    R7     | Resistor for **green** LED  |   27 Ohm |   18 Ohm |  5,6 Ohm | 
 +|    R8     | Resistor for **blue** LED     22 Ohm |   15 Ohm |  3,9 Ohm | 
 + 
 +The "normal" resistors are enough if you use a thin glass housing (as shown on the homepage). You can use normal 1/4 W resistors and the LED module won'heat up much. No heat sink required. This is the safest and easiest choice. 
 + 
 +The "bright" resistors result in LED currents of ~120mA and a power dissipation at the LED module of ~1W. It should not need an additional heat sinkbut it gets hot already (you can touch it, maybe ~50°C)The resisors have a calculated power dissipation of ~0,3W. 1/4W resistors max be enough, but I recommend to use metal oxyde resistors (1W). The overall current of the RGB dimmer is 380mA, so a typical power supply for smartphones with 500mA max. current fits perfectly. 
 + 
 + 
 +With the "max" resistors, you definitely need an extra heat sink at the LED module and resistors which can cope with the higher current (1W). 
 + 
 +Use resistors which can tolerate the power they consume. The power is calculated as:
  
-In normal operation, the LED shows the status of the relay. If a timeout is counting down, it flashed very shortly once a second to indicate this.+P = U_Res * I_LED
  
-===== Integrate it into a housing =====+with U_Res the voltage at the resistor.
  
-describe it... 
rgb_dimmer.1405174761.txt.gz · Last modified: 2014/07/12 16:25 (external edit)