I decided to go do some research about how to properly interface with AC Power. What I ended up doing was disassembling two wall plug-ins and testing a RAC03-05SK. The testing of the RAC03-05SK will be discussed in my pump house monitor project.
Disassembling the wall plugs (a phone charger an some other charger) three common things stood out and that is:
Compared to the traces I made the traces in those chargers are very large. I think this might be just for safety purposes (they don't have to be that big but they had room so they made them that way anyways), but I am not sure.
Both had more through hole components than I expected them to have.
Both had a large component with yellow tape around it that I did not immediately recognize. It turned out that it was the very important component that is the transformer.
Something that was not common between the two was how they connected to the wall plug. The phone charged just had two metal contacts that pushed against the wall plug creating the contact. That one is shown below:
The other one had a wire connecting the plug to the PCB, and each side was soldered on. That is also pictured below.
Another difference between the two is that one was obviously cheaper than the other and I found that interesting.
Below is a video of me disassembling these chargers:
While setting up my two demonstrations I have had a few ideas and observations.
First the observations:
There are a lot of wires involved in laying out lights, and they can be annoying.
A lot of decorations operate with battery power, so they could not be integrated into this project.
Video files take up a lot of room and it is not as easy as I thought to make a good YouTube video.
Now the ideas:
Putting an AC to DC converter right on the board might be a good idea to cut at least one wire out.
Making a version that would work with MKR boards may be cool since you could turn them on and off remotely which would be cool.
Making a version that turned on and off DC voltages might be a good idea so that a wider variety of decorations could be controlled.
Below is the link to the second demonstration, and later tonight there may be a PCB assembly video but I am not sure if I will figure out my editing software before the 11 pm deadline (Halloween hackfest). Either way that video will eventually be up and I'd give it a 90% shot of it being up sometime this weeked.
I have created an assembly video and a video showing the control board in action. The video showing the control board in action is currently on YouTube and listed in the links. My assembly video is not up yet because it is very rough and large so I want to edit it some before I upload it.
I have also submitted this project to the Halloween Hackfest, so that should be fun!
I got my first look at the PCBs that I had ordered from Osh Park. I recorded myself assembling the circuit for the first time ever, but I had an embarrassing mixup when I used the wrong resistor as my current limiter. Instead of a 220 Ohm resistor, I used a 220K Ohm resistor and the relay needed at least 15mA to turn on so the given the 5V outputted by the Arduino 5V/220000 Ohm = 0.0227mA is not enough current to turn on the relay.
Once I realized my mistake I used side cutters to cut out the 220K ohm resistor and then I soldered on 220 Ohm resistors. It was not pretty but this was only my first time doing it and I do have another 2 boards still to build.
The board did work as expected once the 220 Ohm resistors were installed so that was good.
I did record almost all of this ordeal, but my head was in the way when I was soldering sometimes. Given the poor placement of my head in the video I plan to assemble another one tomorrow without my head in the picture and after that, I will add instructions, photos, and other fun things to this project.
I have tested a very simple circuit where I wired up a set of Christmas lights to one relay and a 10 K ohm resistor to a second relay.
I then used a multimeter to measure the AC volts across the 10 kohm resistor while I was running an Arduino program which turned off one relay and then turned on the other relay. After 5s the Arduino switched which relay was on and which was off.
This will be my first Arduino shield so I am excited. I am, however, confused if I could eventually sell this as a DIY kit since it is designed to plug into main power. If anyone has any advice on that it would be much appreciated.