Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. 110v-230v AC to Mysensors PCB board

110v-230v AC to Mysensors PCB board

Scheduled Pinned Locked Moved Hardware
269 Posts 63 Posters 271.0k Views 68 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A aproxx

    @sundberg84 Thanks for the kind words!
    The new design (with relay) indeed has a few digital pins available. I've included the following in this design:

    • 4 digital in and output pins. Pin 3, 4, 5 and 6. Pin 3 is also used to switch the relay, so 3 other digital pins are available to connect other things like motion sensors and switches.
    • 1 Analog input pin. Pin A0.
    • 2 5v pins.
    • 2 Ground pins.
    • A few extra empty pins which aren't connected to anything, but can be used to add some custom things if needed.

    Bill of materials is available below, together with Gerber files, and DIP file (as I'm using Diptrace to design my PCBs).
    Please keep in mind that this is only my second time designing PCBs, so if you'd like to be 100% sure it works I would recommend to wait until I've tested the board and confirmed that everything is working fine.
    But feedback is always welcome!
    Mysensors v2.1 UNTESTED.rar

    J Offline
    J Offline
    Jan Gatzke
    wrote on last edited by Jan Gatzke
    #34

    @aproxx Looks great so far. I am missing a diode and snubber components around the relay. Or are those just not visible? Didn't have a look at the files, yet. In another thread someone posted a diy solid state relay with triacs. This would be a little bit smaller than the relay and would less likely fail. I would add a fuse in front of the power supply, too.

    I will definitly have a look at Diptrace. I like those 3D previews. :)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aproxx
      Hero Member
      wrote on last edited by
      #35

      @Jan Gatzke There is a diode in place, but it just isn't visible in that current 3D design. I've used following schematic (minus the LED) to connect the relay to pin 3 of the Arduino :
      D112-D114-D1181V1SCH.png

      What do you mean by "less likely to fail" about these relays? I've been using them for a while now, but never had any issues with these. Or do you think that they might show this problem when using them for a long time?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jan Gatzke
        wrote on last edited by
        #36

        Yes, relays are mechanical parts. Cheap ones are likely to fail over time. The missing snubber protection in your circuit will kill them, too when connecting inductive loads.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aproxx
          Hero Member
          wrote on last edited by aproxx
          #37

          Hi all,

          After all input you guys gave me, combined with the findings of this topic, I decided to go back to the drawing board.

          Before submitting my newly designed PCB I would like to make sure it doesn't contain any (obvious) mistakes.
          Two questions I still have are:

          • I assume it is correct that all ground pins are connected to each other? So both for the 5v parts of the circuit and the 3.3v circuit?
          • The HLK-PM01 seems to provide a quite stable voltage somewhere between 4.9 and 5.1 volts. If I understand correctly I should directly connect this to VCC input of the Arduino Pro Mini, and NOT to the RAW input voltage?

          Any other remarks on the current design are welcome as well of course! :)

          Schematic
          Schematic.png

          Components (from left to right)
          J1 2 Pin screw terminal (Power input)
          Fuse1 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
          Varistor1 Varistor 10D391K 10D-391K VDR 10K391 Metal voltage dependent resistor
          HLK-PM01 HLK-PM01 230v AC – 5v DC converter
          Fuse2 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
          Varistor2 SMD 1206 5.5V Varistor original Varistor resistor 100pcs/lot
          C1 100nF capacitor
          C2 100uF capacitor
          U3 LE33ACZ 5v to 3.3v converter
          C3 4.7uF capacitor
          NRF24L01 Normal NRF24L01(+) module
          Arduino Arduino Pro Mini 5v
          K1 G3MB-202P 240V AC 2A Solid State relay
          J2 2 Pin screw terminal

          J 2 Replies Last reply
          0
          • A aproxx

            Hi all,

            After all input you guys gave me, combined with the findings of this topic, I decided to go back to the drawing board.

            Before submitting my newly designed PCB I would like to make sure it doesn't contain any (obvious) mistakes.
            Two questions I still have are:

            • I assume it is correct that all ground pins are connected to each other? So both for the 5v parts of the circuit and the 3.3v circuit?
            • The HLK-PM01 seems to provide a quite stable voltage somewhere between 4.9 and 5.1 volts. If I understand correctly I should directly connect this to VCC input of the Arduino Pro Mini, and NOT to the RAW input voltage?

            Any other remarks on the current design are welcome as well of course! :)

            Schematic
            Schematic.png

            Components (from left to right)
            J1 2 Pin screw terminal (Power input)
            Fuse1 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
            Varistor1 Varistor 10D391K 10D-391K VDR 10K391 Metal voltage dependent resistor
            HLK-PM01 HLK-PM01 230v AC – 5v DC converter
            Fuse2 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
            Varistor2 SMD 1206 5.5V Varistor original Varistor resistor 100pcs/lot
            C1 100nF capacitor
            C2 100uF capacitor
            U3 LE33ACZ 5v to 3.3v converter
            C3 4.7uF capacitor
            NRF24L01 Normal NRF24L01(+) module
            Arduino Arduino Pro Mini 5v
            K1 G3MB-202P 240V AC 2A Solid State relay
            J2 2 Pin screw terminal

            J Offline
            J Offline
            jemish
            wrote on last edited by
            #38

            @aproxx here you use only Relay not a relay with button.
            my suggestion is that make design to use relay with button

            1439321581937-schematic.png

            Here I sketch 2-Relay and 2- switch

            1 Reply Last reply
            0
            • A aproxx

              Hi all,

              After all input you guys gave me, combined with the findings of this topic, I decided to go back to the drawing board.

              Before submitting my newly designed PCB I would like to make sure it doesn't contain any (obvious) mistakes.
              Two questions I still have are:

              • I assume it is correct that all ground pins are connected to each other? So both for the 5v parts of the circuit and the 3.3v circuit?
              • The HLK-PM01 seems to provide a quite stable voltage somewhere between 4.9 and 5.1 volts. If I understand correctly I should directly connect this to VCC input of the Arduino Pro Mini, and NOT to the RAW input voltage?

              Any other remarks on the current design are welcome as well of course! :)

              Schematic
              Schematic.png

              Components (from left to right)
              J1 2 Pin screw terminal (Power input)
              Fuse1 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
              Varistor1 Varistor 10D391K 10D-391K VDR 10K391 Metal voltage dependent resistor
              HLK-PM01 HLK-PM01 230v AC – 5v DC converter
              Fuse2 PTC Resettable Fuses 250V 1A TRF250-1000 PPTC Polymeric PTC PolySwitch
              Varistor2 SMD 1206 5.5V Varistor original Varistor resistor 100pcs/lot
              C1 100nF capacitor
              C2 100uF capacitor
              U3 LE33ACZ 5v to 3.3v converter
              C3 4.7uF capacitor
              NRF24L01 Normal NRF24L01(+) module
              Arduino Arduino Pro Mini 5v
              K1 G3MB-202P 240V AC 2A Solid State relay
              J2 2 Pin screw terminal

              J Offline
              J Offline
              jemish
              wrote on last edited by
              #39

              @aproxx please make this type of board, so that we can control two thing through one module

              1 Reply Last reply
              0
              • scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by scalz
                #40

                @aproxx I know my board is different of yours as I am using smd. But if you want to have a look, I have updated my first post here http://forum.mysensors.org/topic/1586/roller-shutter I am waiting for my pcb now..
                Maybe it can help you...

                For your schematics, what I would do is like @jemish said : buttons connector, maybe a resistor between arduino and relay. You are protecting input of HLK (with varistor..) it is ok. But you don't protect at output of relay.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  aproxx
                  Hero Member
                  wrote on last edited by
                  #41

                  @jemish Yeah it seems like I totally forgot to add the switch in the schematic, but I do have it in place in my PCB design :)
                  About adding a second relay.. I'm not sure about that yet. Maybe if I can still keep footprint of the board to a size less than 5 by 5 cm I'll add a second one. But it is certainly is a good idea though!

                  @scalz I'll definitely have a closer look at your PCB design! Seems really interesting, but unfortunately I don't have the proper tools to go for SMD. Soldering a single SMD component is doable, but I'm not going to start soldering SMD Atmel chips :)
                  About the resistor you mentioned: I assume the Solid State Relay which I mentioned doesn't need an external resistor between my arduino and the relay.. According to the datasheet the G3MB-202P-DC5 seems to have a build-in input resistor if I'm not mistaken.

                  J 1 Reply Last reply
                  0
                  • scalzS Offline
                    scalzS Offline
                    scalz
                    Hardware Contributor
                    wrote on last edited by scalz
                    #42

                    @approx: I agree with you. first time I soldered small chips I was afraid as I am not electronician. On youtube there is lots of tutorials for smd soldering. I think maybe one day you should try with solder paste. It is magical! I don't always use it for atmel chips but it is easier.
                    and of course flux, desoldering wick, and a magnifier is a must have too. and a 0.2mm tip for soldering iron..
                    But your design is cool, I like it too! It could interest people.:smiley:

                    S 1 Reply Last reply
                    0
                    • scalzS scalz

                      @approx: I agree with you. first time I soldered small chips I was afraid as I am not electronician. On youtube there is lots of tutorials for smd soldering. I think maybe one day you should try with solder paste. It is magical! I don't always use it for atmel chips but it is easier.
                      and of course flux, desoldering wick, and a magnifier is a must have too. and a 0.2mm tip for soldering iron..
                      But your design is cool, I like it too! It could interest people.:smiley:

                      S Offline
                      S Offline
                      shabba
                      wrote on last edited by
                      #43

                      @scalz (sorry OT) I am actually looking at getting a decent (aka not too expensive!) air gun and some paste - preferably with a syringe. Any recommendations on that?

                      1 Reply Last reply
                      0
                      • scalzS Offline
                        scalzS Offline
                        scalz
                        Hardware Contributor
                        wrote on last edited by scalz
                        #44

                        @shabba: I have not an air solder yet, I would like to test it! I have not compared yet existing products. But I think it is useful for desoldering, soldering some chips. Not the best for res, capa...I would prefer solder iron.
                        Like many people, I usually use flux and good soldering tin (0.3 with flux in it) with a 0.2 tip. And sometimes I use my solderpaste for fun and for some chips! Something i think I will try to make soon is a smd picker. and then a solder paste dispenser. another thing cool I would like to try is this http://operationalsmoke.blogspot.fr/2014/05/diy-usb-soldering-microscope.html but with a c920. Unfortunately not enough times...

                        Sorry for OT too. See you soon

                        1 Reply Last reply
                        0
                        • A aproxx

                          @jemish Yeah it seems like I totally forgot to add the switch in the schematic, but I do have it in place in my PCB design :)
                          About adding a second relay.. I'm not sure about that yet. Maybe if I can still keep footprint of the board to a size less than 5 by 5 cm I'll add a second one. But it is certainly is a good idea though!

                          @scalz I'll definitely have a closer look at your PCB design! Seems really interesting, but unfortunately I don't have the proper tools to go for SMD. Soldering a single SMD component is doable, but I'm not going to start soldering SMD Atmel chips :)
                          About the resistor you mentioned: I assume the Solid State Relay which I mentioned doesn't need an external resistor between my arduino and the relay.. According to the datasheet the G3MB-202P-DC5 seems to have a build-in input resistor if I'm not mistaken.

                          J Offline
                          J Offline
                          jemish
                          wrote on last edited by
                          #45

                          @aproxx when you completed the design of PCM board than please share with me as soon as possible.

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            aproxx
                            Hero Member
                            wrote on last edited by
                            #46

                            @jemish Of course I'll share the design and all related documents.. :) I hope to have it finished in a few days, and will sure give an update when completed!

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              aproxx
                              Hero Member
                              wrote on last edited by aproxx
                              #47

                              As promised: In the attachment of this post you can find all required information to build this board.
                              The zip file includes all required Gerber files, bill of materials, as well as the Schematic and PCB design (drawn using DipTrace).

                              One remark: I've slightly adjusted the design to optimize the reception for the NRF24L01. The antenna of this chip is now placed slightly next to the custom PCB. Hopefully this will result in a better RF reception.
                              Size is approximately 47 by 42mm.

                              Download (Please be aware that this board is still untested at this moment, so please doublecheck things yourself before ordering!):
                              Check latest post for updated version.

                              1 Reply Last reply
                              2
                              • scalzS Offline
                                scalzS Offline
                                scalz
                                Hardware Contributor
                                wrote on last edited by scalz
                                #48

                                @approxx: nice board!
                                could I give you one or two tips? as I have recently designed an ac board too...

                                there is one or two trace which are 90° corner. maybe I am a little old school on this but it is preferable to have 45°. but it should work I think no problem.
                                Your board will not draw too much AC current I think, and I don't know what are your trace widths for AC. but you can check here http://circuitcalculator.com/wordpress/2006/01/31/pcb-trace-width-calculator/ if you want to know width of trace regarding current flow. Then if you can't have the right width because of space... you can use soldermask layer stop and then you will be able to add soldering on all the AC trace and give it more strength for more current drawing. Because most of china fabhouse use 1oz copper. Some 2oz but more expensive.

                                Just my 2cent tip, maybe you already know it, and have already ordered you board.

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  aproxx
                                  Hero Member
                                  wrote on last edited by
                                  #49

                                  @scalz Yeah usually I'm going for 45 degree angles as well, but I guess I just forgot for those few. However I do have full confidence in Dirty PCBs, so I'm sure there wouldn't be any disruptions in the trace.

                                  Regarding trace thickness/width: I've been doing some calculations as well, but with 1oz copper traces I would need extremely wide traces to come up with a decent copper volume. So my plan is to solder a thin wire at the bottom side of the PCB between the AC connection points. That's why I've got the AC and 5v DC circuits separated as much as possible. :)

                                  But thanks for the feedback anyway! And congrats on taking the first step of ordering the board! I'll be doing the same tomorrow.

                                  J 1 Reply Last reply
                                  0
                                  • OitzuO Offline
                                    OitzuO Offline
                                    Oitzu
                                    wrote on last edited by
                                    #50

                                    Looking at your pcbs and looking the same time on my badly soldered dimmer.. i have the gut feeling i should maybe redo this with a proper pcb. :sweat_smile:

                                    2015-08-17 23.07.49.jpg

                                    DrJeffD 1 Reply Last reply
                                    0
                                    • OitzuO Oitzu

                                      Looking at your pcbs and looking the same time on my badly soldered dimmer.. i have the gut feeling i should maybe redo this with a proper pcb. :sweat_smile:

                                      2015-08-17 23.07.49.jpg

                                      DrJeffD Offline
                                      DrJeffD Offline
                                      DrJeff
                                      wrote on last edited by
                                      #51

                                      @Oitzu said:

                                      my badly soldered dimmer.

                                      No way that is just like mine! :) It's Perfect!

                                      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?

                                      1 Reply Last reply
                                      1
                                      • OitzuO Offline
                                        OitzuO Offline
                                        Oitzu
                                        wrote on last edited by Oitzu
                                        #52

                                        @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, VCC

                                        The 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() {                        
                                        }
                                        
                                        DrJeffD 1 Reply Last reply
                                        0
                                        • A aproxx

                                          @scalz Yeah usually I'm going for 45 degree angles as well, but I guess I just forgot for those few. However I do have full confidence in Dirty PCBs, so I'm sure there wouldn't be any disruptions in the trace.

                                          Regarding trace thickness/width: I've been doing some calculations as well, but with 1oz copper traces I would need extremely wide traces to come up with a decent copper volume. So my plan is to solder a thin wire at the bottom side of the PCB between the AC connection points. That's why I've got the AC and 5v DC circuits separated as much as possible. :)

                                          But thanks for the feedback anyway! And congrats on taking the first step of ordering the board! I'll be doing the same tomorrow.

                                          J Offline
                                          J Offline
                                          jemish
                                          wrote on last edited by
                                          #53

                                          @aproxx If I want to buy this module then.........
                                          If you sell this module then I am ready to buy ...

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular