**Controlling LED Lights with an RF Remote: A Step-by-Step Guide**
The following is the content of a file:
WEBVTTKind: captionsLanguage: enA few weeks ago, I showed you how I built a cuboid cloud LED lamp, which created mixed feedback from viewers. However, that's not the point right now because the lamp is not completely finished yet.
As you can see when I flip on the lamp's power switch, it activates both the GU10 LED spots and the RGBW LED strips on top. The reason for this is that both components are wired up in parallel, which isn't ideal as it prevents us from experiencing mood lighting without having the whole room flooded with lights.
The easiest solution would be to use two switches, each individually turning on and off one component group. However, that's not possible because we only have two wires available at the power switch. A simple two-switch system is not feasible in this case.
Fortunately, since we got an RF remote for the RGBW LED strips, I will show you in this video how it communicates with its receiver and how we can use it to talk to my controller and thus control all sorts of things. But first, let's start by understanding how this system works.
**Understanding the RF Remote System**
The RF remote transmitter uses an IC that has a specific data encryption method, which might be different from what your particular IC uses. The data sheet should provide more information on this. My secret codes for turning off/on the GU10 LED spots will be pressing yellow and pink one after the other.
To get the decimal codes of those buttons, I used the simple receive demo sketch and created a simple piece of code around them that reverses the current state of digital pin 5 whenever this button combination is pushed. After uploading the new code, I hooked up an LED to pin 5 for testing and checked whether everything works as intended.
**Implementing a Solid-State Relay (SSR)**
In order to control mains voltage, we would need something like a relay about which you can learn the basics in one of my previous videos. After building up a small demonstration circuit with this generic relay board, it worked just as I thought it would. However, I don't put a lot of trust in those relays because they often experienced sparking, leading to the changeover contacts getting locked in one position.
A better solution is to use a solid-state relay (SSR), like the G3MBA-202P SSR, which probably consists of a Triac with a sprinkle of complementary components for safety reasons. This type of relay does not use mechanical components for switching but instead does it electrically. If you want more information about solid-state relays, I would recommend checking out one of my previous videos.
**Finalizing the Circuit**
After hooking up the Arduino as well as the GU10 LED spot replacements to the SSR, it was time for testing, which turned out successful. At this point, I expected to build a small additional circuit for the solid-state relay since I wanted to turn on when the Arduino outputs a low voltage signal.
However, apparently the board the relay came with already featured such a circuit and thus when the Arduino fails, the lights will still be turned on. Next, I soldered out all of the required components onto an additional piece of perf. board and connected them to one another using solder bridges and bridge wire according to my small finalized schematic.
**Testing and Finalizing**
As soon as the circuit was complete, I grabbed myself a 5-volt power supply with more than enough output current capabilities and wired it up to power the circuit. After turning on the power, everything seemed to work fine, and I could turn off/on the lights with the RF remotes.
Later, I realized that the receive range of the circuit was quite horrible, so as an afterthought, I was forced to remove its data signal to the Arduino and replace it with the data outputs of the previous receiver circuit. This way, the range of the transmitter and receiver system was drastically improved.
**Final Assembly**
It was finally time to run unscrew and lift up the lamp's top MDF piece, hook up the circuit's power supply to mains voltage along with the LED power supply, and insert the solid-state relay in series to the GU10 LED spots. After closing everything up, we cut a rectangle hole into the MDF boards for easier possible troubleshooting later on.
And got the lamp back in position. And as you can see, it still works perfectly fine, but now I can turn off the GU10 LED spots whenever I want.