110v-230v AC to Mysensors PCB board
-
@DrJeff said:
Just Kidding I need to get my dimmers working properly also. You got the zerocross working right? 220v 110v? share sketch? will yours work locally with gateway off?
Yes the zerocrossing is working right. Shouldn't working with gateway off only be a matter of programming? ^^
Built vor 220V, but should also run at 110V (with different resistors), need to check the specifications of the combonents again to verify that.I got no working MySensors sketch or a drawn pcb layout yet, but i can describe how it works.
Left connectors are (up to down): LOAD: Phase, Neutral; Source: Neutral, Phase
Right connectors are (up to down): GND, PWM Output, Zero-Crossing Input, VCCThe Zerocrossing detection is done by the bridge rectifier and the zerocrossing detection module 4N25.
The Signal goes to a INT-Pin of an arduino.In a test sketch i use a timer and the interrupt to do the correct pwm output.
The pwm output goes to the MOC3021 (Opto) that will fire the TRIAC seen left from it.Little test sketch:
#include <TimerOne.h> //Config int INTPin = 0; int outputPin = 11; int dimLevel = 64; // Dim level (0(on)-128(off)) int freqStep = 75; //50Hz, should be 65 for 60Hz //Global volatile int i=0; // Counter. Only fire if i >= dimLevel volatile boolean zeroCross=0; void setup() { pinMode(outputPin, OUTPUT); attachInterrupt(INTPin, zero_cross_detect, RISING); Timer1.initialize(freqStep); Timer1.attachInterrupt(dim_check, freqStep); } void zero_cross_detect() { zeroCross = true; i=0; digitalWrite(outputPin, LOW); } void dim_check() { if(zeroCross == true) { if(i>=dimLevel) { digitalWrite(outputPin, HIGH); i=0; zeroCross = false; } else { i++; } } } void loop() { } -
@jemish I've made some minor changes to the board (nothing functional has been changed, just some updated silk screen and modified the 90 degree angles to 45 degree angles.)
Please be aware that at this moment the board still isn't confirmed to be working. If you want to be 100% sure everything works properly, I strongly advise to wait for another 5-7 weeks. That way I can assemble the board myself and confirm everything is working as expected.
-
@jemish
All components are at my desk at the moment. The only thing missing is.. The PCB itself. :)
DirtyPCBs' website states that the board was shipped to me at August 24. My packets from China usually arrive about 2 or 3 weeks after they have been sent from China, so I expect it to arrive somewhere next week.
After the boards have arrived I'll make sure to have it assembled in less than a week. :) -
@jemish
All components are at my desk at the moment. The only thing missing is.. The PCB itself. :)
DirtyPCBs' website states that the board was shipped to me at August 24. My packets from China usually arrive about 2 or 3 weeks after they have been sent from China, so I expect it to arrive somewhere next week.
After the boards have arrived I'll make sure to have it assembled in less than a week. :) -
I received the newly designed PCB last weekend, and have been soldering/testing the board since it arrived. Just a few minor changes to the layout (not the schematic) and the board should be completely finished! So far the results look promising.
@jemish: I'm currently re-working the design a bit and working on documentation, but I'll make sure to post the new and completely finished design by the end of the week! -
As promised, I've got an update for this project. The board has been tested in the past week, and everything is working as expected. Compared to the previous board I've posted, I have updated the following:
• Solder pads of LE33CZ have been placed a little wider apart to avoid short circuit while soldering.
• Solder pads of the resettable fuse (Fuse2) has been placed closer together to better fit the fuses of the BOM.
• Moved the NRF24L01 connector a bit away from the solid state relay. Should make it easier to solder.
• Moved Fuse2 to another location on the board, away from the 230v circuit.Some 3D pictures (Top and bottom):


Anyone who is interested can order the PCB HERE
Some documentation, and all gerber / DipTrace files (in case you would like to make some modifications) can be found here: MySensors board v3.2.3.zip.
-
As promised, I've got an update for this project. The board has been tested in the past week, and everything is working as expected. Compared to the previous board I've posted, I have updated the following:
• Solder pads of LE33CZ have been placed a little wider apart to avoid short circuit while soldering.
• Solder pads of the resettable fuse (Fuse2) has been placed closer together to better fit the fuses of the BOM.
• Moved the NRF24L01 connector a bit away from the solid state relay. Should make it easier to solder.
• Moved Fuse2 to another location on the board, away from the 230v circuit.Some 3D pictures (Top and bottom):


Anyone who is interested can order the PCB HERE
Some documentation, and all gerber / DipTrace files (in case you would like to make some modifications) can be found here: MySensors board v3.2.3.zip.
-
@aproxx I guess you use a different Arduino Pro Mini as the one in the 3D view, because its row of pins pointing towards us seems to get awfully close to the mains coming from "Power in", right?
@Yveaux
I believe those are for the serial connection that usually are pointing up, or back for programing? It looks like they are just rendered as down in the 3D image? But I am curious how the clearance for the components on the other side (HLK) is when they are soldered, does it need some space off the board? -
As promised, I've got an update for this project. The board has been tested in the past week, and everything is working as expected. Compared to the previous board I've posted, I have updated the following:
• Solder pads of LE33CZ have been placed a little wider apart to avoid short circuit while soldering.
• Solder pads of the resettable fuse (Fuse2) has been placed closer together to better fit the fuses of the BOM.
• Moved the NRF24L01 connector a bit away from the solid state relay. Should make it easier to solder.
• Moved Fuse2 to another location on the board, away from the 230v circuit.Some 3D pictures (Top and bottom):


Anyone who is interested can order the PCB HERE
Some documentation, and all gerber / DipTrace files (in case you would like to make some modifications) can be found here: MySensors board v3.2.3.zip.
-
@aproxx I guess you use a different Arduino Pro Mini as the one in the 3D view, because its row of pins pointing towards us seems to get awfully close to the mains coming from "Power in", right?
@Yveaux: I'm using the standard Arduino Nano, but I agree that the 3D view looks a bit worrying. In real life it isn't needed to solder this row of pins to the Arduino, so it should be safe. So the assumption of @DrJeff is correct!
The only reason why these pins look connected to the board is because I couldn't find a 3D design of the Arduino nano without these 6 pins soldered. :)
But thanks for pointing this out, I'll add it to the documentation to make sure people aren't getting confused.@AWI: I'll try and see if I can take some decent pictures when I get home (in approximately 12 hours) and post them up here!
-
For those who wanted to see some pictures of the board:

Small notice: These pictures are of a slightly older design. The newer design has a few minor changes like better component placement and a permanent fuse instead of this resettable fuse. But these pictures should at least give you an idea on how everything looks like, and shows how really small it actually is.
Also, I reinforced the traces of the 230v lines, which I absolutely recommend to do! (Although I do recommend to do it slightly more professional than I did on this prototype :)) -
For those who wanted to see some pictures of the board:

Small notice: These pictures are of a slightly older design. The newer design has a few minor changes like better component placement and a permanent fuse instead of this resettable fuse. But these pictures should at least give you an idea on how everything looks like, and shows how really small it actually is.
Also, I reinforced the traces of the 230v lines, which I absolutely recommend to do! (Although I do recommend to do it slightly more professional than I did on this prototype :)) -
@AWI Thanks for the kind words! I did my best on the soldering part, but the reinforcement of the 230v circuit could have done a bit better in my opinion. :) Next time I would use an isolated wire to reinforce the 230v traces, but for a prototype build this was sufficient.