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. In wall light switch node - Custom PCB

In wall light switch node - Custom PCB

Scheduled Pinned Locked Moved Hardware
custompcbinwallnodelight switchswitch
245 Posts 15 Posters 132.6k Views 23 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.
  • sundberg84S Offline
    sundberg84S Offline
    sundberg84
    Hardware Contributor
    wrote on last edited by
    #3

    Great to see all this projects come to life! I hope we all can gather around this and create a great, small and SAFE in wall product.

    Controller: Proxmox VM - Home Assistant
    MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
    MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
    RFLink GW - Arduino Mega + RFLink Shield, 433mhz

    1 Reply Last reply
    0
    • scalzS scalz

      Hi.

      wow, it's great, lot of inwall projects...I agree with you for smd, I think it's best suited for slimmer as we have not much place inwall..the biggest problem is the ac stepdown, it takes lots of place. if we want something as small as "fibaro" it needs a custom ac stepdown. it's a little more tricky to make well but doable, then it is not galvanically isolated, not the the biggest problem if it is well integrated I think.

      Then there is multiple connections existing inwall to connect the switch. 3wire or like at my home for instance, I have only 2 wire connected on my switch one from mains, the other one go to the lamp. And this case is much more tricky to do...it needs a very smart power (lot of work on this) to power the device. the easy way for this one is coincell or battery.

      If it can help, and you do it before me ;) because I have some projects in work but it shoud not take too much time to design..
      In my case, for the moment, I plan to have:

      • Powering : AC stepdown (hilink or homemade) / coincell / rs485 powered (I need rs485 at my job)
      • I will integrate MyTinyCamel circuit (my ultra low power board) for battery. it can be powered with coincell or one/two aaa. And there will be authentication, ota, and mysxconnector eeprom.
      • a connector for one daughterboard (for sensors....)
      • all based on this post for footprint http://forum.mysensors.org/topic/1261/motion-detector-with-measurement-of-light-intensity-temperature-and-humidity-in-the-flush-box
      • and an insulating box

      for powering options, I am not very sure to be able to have all these options on one board but I will try to see ;)
      I wan to keep the "motherboard" on bottom, and of course, the sensors shield on top, so when opening the switch, we can't touch ac parts...lot of others ideas but I let you make your own. I don't want to interfere in your ideas :)

      S Offline
      S Offline
      Samuel235
      Hardware Contributor
      wrote on last edited by
      #4

      @scalz - FIrstly i would love to have some sort of development input or even help you on your project once my idea has got going. Just one question, the only rs485 i know is that of the serial connection for computers, could you explain what your mean by powering via rs485 please? For Version one of my product I will be keeping it nice and simple and keep it to just the one board with screw terminals for the switch buttons. Hopefully Version 2 will bring upgrades such as a secondary (sensor) board where we will then be able to connect different sensors onto the daughter board without touching the AC/DC like you have in mind. I would like to keep everything in this thread very simple and one at a time to enable us all to have a clear working space to develop the product that is in mind. Then once we have achieved that, then we can then agree what upgrades would be worthwhile and then develop Version 2. I will be documenting everything that goes on with this product just to make everything flow as smooth as possible with reference points at every stage of the build. I'm hoping that this will help prevent any issues that would require us to rollback to a previous state/build. I came across your 'MyTinyCamel' build the other day, i love what you have done!

      @sundberg84 - That is exactly what I would love to happen, and I'm pretty sure the likes of @hek will be loving that fact he has developed such a tight and strong community that is coming together to develop what the admins would call their 'baby'. I look forward to every upgrade we make! Bring on the issues and lets develop as a community!

      MySensors 2.1.1
      Controller - OpenHAB (Virtual Machine)
      Gateway - Arduino Mega MQTT Gateway W5100

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

        @samuel235: thx :) sorry, like I said I don't want to interfere in your projects. I was just saying some ideas if it can help.
        for rs485, it is just I will use one pair for power and one pair for data. I know it's possible to power and data on same line but this is not the way I will use I think.

        so, good luck with your project ;)

        S 1 Reply Last reply
        0
        • scalzS scalz

          @samuel235: thx :) sorry, like I said I don't want to interfere in your projects. I was just saying some ideas if it can help.
          for rs485, it is just I will use one pair for power and one pair for data. I know it's possible to power and data on same line but this is not the way I will use I think.

          so, good luck with your project ;)

          S Offline
          S Offline
          Samuel235
          Hardware Contributor
          wrote on last edited by
          #6

          @scalz Ahh so it is the serial cable you speak of! I would honestly really appreciate your input on this topic. I don't want you to leave from the topic at all. Please, share your inputs and suggestions whenever you feel the need, just want to keep everything organised here, so it doesn't end up with a caotic mess. I luck forward to your suggestions on various issues and upgrades along the path!

          MySensors 2.1.1
          Controller - OpenHAB (Virtual Machine)
          Gateway - Arduino Mega MQTT Gateway W5100

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Samuel235
            Hardware Contributor
            wrote on last edited by Samuel235
            #7

            I have attached the Board and Schematic mock-ups. Would it be possible to hear your opinions on what needs to be changed, if anything that is. All being well the RF Module fits where i intend it too, sitting just above the chip itself.

            Does that capacitor look okay being grounded to the ground line rather than directly onto the ground pin of the RF module (To stabilize the vcc and ground of the RF module).

            A quick little list to show what is what on the board:
            AVR CONNECT - Connection for AVR Programmer to bootload.
            SW1 - Screw terminals for Switch 1.
            SW2 - Screw terminals for Switch 2.
            SW3 - Screw terminals for Switch 3.
            ATMEGA328P-AU - The obvious, ATMEGA328P-AU.
            NRF24L1 - NRF24l01+, will use header pins and solder so its sitting just abover the ATMEGA.
            C2 - 4.7uF Capacitor to bridge the VCC and GND on the radio.
            BAT1 - Cell coin holder (CR2450)

            I don't need any mounting holes at the moment so that isn't an issue. I plan on elevating it off of the metal back box to stop any chance of shorting too.

            Would you say that i need to be wiring the terminals for the switch using VCC and a resistor or would a input pin to ground be okay? I've seen so many people people do it both ways in the forums and on the general internet, what is the preferred method?

            I'm more than happy with receiving any sort of criticism on this board, as this is my first attempt of a custom PCB and my first attempt of using Eagle software.

            Sch1.jpg Brd1.jpg

            MySensors 2.1.1
            Controller - OpenHAB (Virtual Machine)
            Gateway - Arduino Mega MQTT Gateway W5100

            1 Reply Last reply
            1
            • M Offline
              M Offline
              mardah
              Hardware Contributor
              wrote on last edited by
              #8

              Why not use a 4-pol screw terminal instead? One common and then one input for each switch. Also, consider if the corners could be 45 degrees instead of 90. That would make it fit more easly in a round back box. Aren't you missing a pull-up for reset and a few decoupling caps for the ATMega?

              S 2 Replies Last reply
              0
              • GertSandersG Offline
                GertSandersG Offline
                GertSanders
                Hardware Contributor
                wrote on last edited by
                #9

                Indeed, decoupling cap (100nF) is needed or the powerline (VCC-GND) would be unstable when transmissions occur. This effect could block or reset the atmega.
                With this setup, you will not be able to program sketches when the NRF is connected. If you add an FTDI header, you can program via serial port and monitor the processor while the NRF is connected. Will help in debugging code.

                1 Reply Last reply
                0
                • M mardah

                  Why not use a 4-pol screw terminal instead? One common and then one input for each switch. Also, consider if the corners could be 45 degrees instead of 90. That would make it fit more easly in a round back box. Aren't you missing a pull-up for reset and a few decoupling caps for the ATMega?

                  S Offline
                  S Offline
                  Samuel235
                  Hardware Contributor
                  wrote on last edited by Samuel235
                  #10

                  @mardah @GertSanders - Sorry guys, for some reason i just assumed that the decoupling caps were only needed for if i was using an external crystal, for increased power needed for 16MHz. I'll get that on.

                  I'm going to have a look at that header you speak about when i get home tonight, i was planning on programming the board then soldering the RF module on. Now you point this out that would be a very silly amature mistake to do. Thank you for making that obvious.

                  I'm also planning on refining the layout of the board and the shape. So i will take the corners off to adapt it to a round box.

                  MySensors 2.1.1
                  Controller - OpenHAB (Virtual Machine)
                  Gateway - Arduino Mega MQTT Gateway W5100

                  1 Reply Last reply
                  0
                  • m26872M Offline
                    m26872M Offline
                    m26872
                    Hardware Contributor
                    wrote on last edited by
                    #11

                    You might want to have both the 1x6 pin FTDI-serial-"arduino" port and the 2x3 pin AVR ISP port. Note that pin# are standardized.

                    S 1 Reply Last reply
                    0
                    • m26872M m26872

                      You might want to have both the 1x6 pin FTDI-serial-"arduino" port and the 2x3 pin AVR ISP port. Note that pin# are standardized.

                      S Offline
                      S Offline
                      Samuel235
                      Hardware Contributor
                      wrote on last edited by Samuel235
                      #12

                      @m26872 Could i ask why i would need both? They essentially do the same thing, right? Except FTDI uses the DFU bootloader and then the SPI connection overrides the DFU bootloader, am i correct in thinking this or do i have my lines mixed up? If so then i was planning on using the 6 pins i have on the edge of the board, connect them via jumper cables to the 6pin SPI connecter that would come with the USBasp programmer i plan to purchase. The reason i plan to go down this route is simply to save room in the socket, limited height room.

                      @GertSanders - Is the 6 pins that i have added to the board not a FTDI header? What makes it not, the pin layout or the pins used on the mega chip? I thought that if i added 6 pins, wired them to the chip using the pins i have (gnd, vcc, ce, csn, irq, miso, mosi and sck) that made it a FTDI, I'm guessing I'm incorrect?

                      @mardah - Free space depending, i'm looking into doing this now, so do you feel that my switching method is sufficient enough without using vcc and a resistor to each switch and then to the input pin? You're happy with the Input pin -> switch -> GND method? EDIT: The only 4 Pol i can find that would be big enough to accept 3 cables into the common is working out at a stupid price in comparison to the rest of the board. At the moment, i will be using the 3 terminal setup i have currently sketched.

                      I planned on using this as the USBasp programmer, however if i can use just an FTDI connection to do both (program the MYSBootloader and to upload sketches) that would be better for saving space on the board.

                      The FTDI programmer: Link
                      Can you use this to program the MYSBootloader as well as upload a sketch or is this simply to upload a sketch to the mega?

                      The decoupling caps, as a rule of thumb, its 100nF cap per supply pin, correct? I will supply all 3 VCC pins with the power, so i should connect a 100nF cap to each of the pins. Does this sound over kill or okay?

                      MySensors 2.1.1
                      Controller - OpenHAB (Virtual Machine)
                      Gateway - Arduino Mega MQTT Gateway W5100

                      m26872M 1 Reply Last reply
                      0
                      • M mardah

                        Why not use a 4-pol screw terminal instead? One common and then one input for each switch. Also, consider if the corners could be 45 degrees instead of 90. That would make it fit more easly in a round back box. Aren't you missing a pull-up for reset and a few decoupling caps for the ATMega?

                        S Offline
                        S Offline
                        Samuel235
                        Hardware Contributor
                        wrote on last edited by
                        #13

                        @mardah If i wire a 4-Pol screw terminal as follows:

                        1 - GND
                        2 - INPUT1
                        3 - INPUT2
                        4 - INPUT3

                        Then i wire GND into Switch1's COM connector, then L1 goes to screw terminal pin 2 (INPUT1). Then i take the com from the back of Switch1 into the COM connector of Switch2, then wire Switch2's L1 connector to screw terminal pin 3 (INPUT2) and the same for switch 3. Do you feel this would work as intended?

                        MySensors 2.1.1
                        Controller - OpenHAB (Virtual Machine)
                        Gateway - Arduino Mega MQTT Gateway W5100

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

                          hi.

                          just a little thing, it is "better" to have nothing under radio antenna (no gnd plane..) for range and operation. it could help as it will be inwall ;)

                          S 1 Reply Last reply
                          1
                          • scalzS scalz

                            hi.

                            just a little thing, it is "better" to have nothing under radio antenna (no gnd plane..) for range and operation. it could help as it will be inwall ;)

                            S Offline
                            S Offline
                            Samuel235
                            Hardware Contributor
                            wrote on last edited by
                            #15

                            @scalz Thank you for that heads up, i will get that down onto my board documents to change too. Thank you!

                            MySensors 2.1.1
                            Controller - OpenHAB (Virtual Machine)
                            Gateway - Arduino Mega MQTT Gateway W5100

                            1 Reply Last reply
                            0
                            • S Samuel235

                              @m26872 Could i ask why i would need both? They essentially do the same thing, right? Except FTDI uses the DFU bootloader and then the SPI connection overrides the DFU bootloader, am i correct in thinking this or do i have my lines mixed up? If so then i was planning on using the 6 pins i have on the edge of the board, connect them via jumper cables to the 6pin SPI connecter that would come with the USBasp programmer i plan to purchase. The reason i plan to go down this route is simply to save room in the socket, limited height room.

                              @GertSanders - Is the 6 pins that i have added to the board not a FTDI header? What makes it not, the pin layout or the pins used on the mega chip? I thought that if i added 6 pins, wired them to the chip using the pins i have (gnd, vcc, ce, csn, irq, miso, mosi and sck) that made it a FTDI, I'm guessing I'm incorrect?

                              @mardah - Free space depending, i'm looking into doing this now, so do you feel that my switching method is sufficient enough without using vcc and a resistor to each switch and then to the input pin? You're happy with the Input pin -> switch -> GND method? EDIT: The only 4 Pol i can find that would be big enough to accept 3 cables into the common is working out at a stupid price in comparison to the rest of the board. At the moment, i will be using the 3 terminal setup i have currently sketched.

                              I planned on using this as the USBasp programmer, however if i can use just an FTDI connection to do both (program the MYSBootloader and to upload sketches) that would be better for saving space on the board.

                              The FTDI programmer: Link
                              Can you use this to program the MYSBootloader as well as upload a sketch or is this simply to upload a sketch to the mega?

                              The decoupling caps, as a rule of thumb, its 100nF cap per supply pin, correct? I will supply all 3 VCC pins with the power, so i should connect a 100nF cap to each of the pins. Does this sound over kill or okay?

                              m26872M Offline
                              m26872M Offline
                              m26872
                              Hardware Contributor
                              wrote on last edited by
                              #16

                              @samuel235 I can't tell you what you need, I'm just saying that if you provide an AVR-ISP port looking like FTDI-port, everyone except yourself will be confused or even risk to destroy the AVR by mistake.
                              Let's look at the Sensbender diagram as a reference. The FTDI-port is JP2 and the AVR-ISP is JP3. Most people would prefer to program bootloader once and then use the FTDI to upload and debug new programs.
                              If I couldn't fit an AVR ISP port, I would try to make to make the nRF SPI-pin + Reset, accessible. Maybe even better is to make (if you don't already have?) a special board for 328p-AU (TQFP-package) bootloader programming, then solder it in place with bootloader already on it.
                              Please also note that the JP2 FTDI-port needs R3 and C5 to work.

                              S 1 Reply Last reply
                              0
                              • m26872M m26872

                                @samuel235 I can't tell you what you need, I'm just saying that if you provide an AVR-ISP port looking like FTDI-port, everyone except yourself will be confused or even risk to destroy the AVR by mistake.
                                Let's look at the Sensbender diagram as a reference. The FTDI-port is JP2 and the AVR-ISP is JP3. Most people would prefer to program bootloader once and then use the FTDI to upload and debug new programs.
                                If I couldn't fit an AVR ISP port, I would try to make to make the nRF SPI-pin + Reset, accessible. Maybe even better is to make (if you don't already have?) a special board for 328p-AU (TQFP-package) bootloader programming, then solder it in place with bootloader already on it.
                                Please also note that the JP2 FTDI-port needs R3 and C5 to work.

                                S Offline
                                S Offline
                                Samuel235
                                Hardware Contributor
                                wrote on last edited by
                                #17

                                @m26872 Firstly, thank you for referencing the sensebender and its pinout. I can now have a look at this and use it to better improve the pinout and layout of my board. So, i will try to get both headers onto my board to allow better programming capabilities. If i use the same pinout as the sensebender does for the AVR ISP and the FTDI-port, would i then be able to burn the bootloader and upload sketches while the RF module is soldered. If not, do you think i could use some jumper headers to effectively remove the RF module from the board while I upload the sketch and then put the jumpers back on to close the circuit back up?

                                MySensors 2.1.1
                                Controller - OpenHAB (Virtual Machine)
                                Gateway - Arduino Mega MQTT Gateway W5100

                                m26872M 1 Reply Last reply
                                0
                                • S Samuel235

                                  @m26872 Firstly, thank you for referencing the sensebender and its pinout. I can now have a look at this and use it to better improve the pinout and layout of my board. So, i will try to get both headers onto my board to allow better programming capabilities. If i use the same pinout as the sensebender does for the AVR ISP and the FTDI-port, would i then be able to burn the bootloader and upload sketches while the RF module is soldered. If not, do you think i could use some jumper headers to effectively remove the RF module from the board while I upload the sketch and then put the jumpers back on to close the circuit back up?

                                  m26872M Offline
                                  m26872M Offline
                                  m26872
                                  Hardware Contributor
                                  wrote on last edited by
                                  #18

                                  @samuel235 I can't recall that I've actually used the ISP with the nRF, but the whole point of ISP is that it should work.

                                  S 1 Reply Last reply
                                  0
                                  • m26872M m26872

                                    @samuel235 I can't recall that I've actually used the ISP with the nRF, but the whole point of ISP is that it should work.

                                    S Offline
                                    S Offline
                                    Samuel235
                                    Hardware Contributor
                                    wrote on last edited by Samuel235
                                    #19

                                    @m26872 Okay, so its probably best to just burn the bootloader, then solder the nRF inplace and then upload the sketches using the FTDI port just in case i solder on the nRF then turns out i can't burn the bootloader?

                                    I believe i can leave the AREF pin unconnected. Is this true?

                                    Do you have any other input other than the following changes i'm scheduling to make on the board tomorrow:

                                    • Remove GND plane around the area of nRF module to reduce chance of interference.
                                    • Remove current screw terminals and replace with 1 4-Position with GND as common and other 3 going to input pins.
                                    • Connect all GND pins.
                                    • Connect all VCC pins.
                                    • Add decoupling Caps in the layout that Sensebender uses, 1 on each VCC, so 3 in total.
                                    • Add Pullup to reset pin.
                                    • Remove current 'FTDI' connector and add correct FTDI layout connector along with a SPI header connection for bootloading, use Sensebender for reference of the pinout for these two connectors.

                                    While looking through the Sensebender schematic and images, i have noticed there is Q1 (What i think is a transistor, correct me if i'm incorrect), may i ask if you know what this is for, as it is not actually on the final board images.

                                    Sorry if i have made any more school boy errors.
                                    Sam.

                                    MySensors 2.1.1
                                    Controller - OpenHAB (Virtual Machine)
                                    Gateway - Arduino Mega MQTT Gateway W5100

                                    m26872M 1 Reply Last reply
                                    0
                                    • S Samuel235

                                      @m26872 Okay, so its probably best to just burn the bootloader, then solder the nRF inplace and then upload the sketches using the FTDI port just in case i solder on the nRF then turns out i can't burn the bootloader?

                                      I believe i can leave the AREF pin unconnected. Is this true?

                                      Do you have any other input other than the following changes i'm scheduling to make on the board tomorrow:

                                      • Remove GND plane around the area of nRF module to reduce chance of interference.
                                      • Remove current screw terminals and replace with 1 4-Position with GND as common and other 3 going to input pins.
                                      • Connect all GND pins.
                                      • Connect all VCC pins.
                                      • Add decoupling Caps in the layout that Sensebender uses, 1 on each VCC, so 3 in total.
                                      • Add Pullup to reset pin.
                                      • Remove current 'FTDI' connector and add correct FTDI layout connector along with a SPI header connection for bootloading, use Sensebender for reference of the pinout for these two connectors.

                                      While looking through the Sensebender schematic and images, i have noticed there is Q1 (What i think is a transistor, correct me if i'm incorrect), may i ask if you know what this is for, as it is not actually on the final board images.

                                      Sorry if i have made any more school boy errors.
                                      Sam.

                                      m26872M Offline
                                      m26872M Offline
                                      m26872
                                      Hardware Contributor
                                      wrote on last edited by
                                      #20

                                      @samuel235
                                      Arduino Pro Mini should be your no1 reference. Schematics and Eagle files povided. There your can see the normal layout of Q1 e.g. It's the crystal/oscillator (with 22pF caps if you choose xtal) I don't know why Sensebender looks like it does.

                                      I haven't studied your design closely or know your intentions, but I don't know of any proven coin cell nRF designs, but I suppose you'll have it sleeping a lot.

                                      Sometimes it's good to breadboard prototypes if there're any hesistance.

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

                                        for coincell, maybe you could add a capacitor near the coincell to absorb spike of power consumption..so the coincell would not discharge too fast with sudden spike ;)
                                        maybe 47u or 100u if you add few sensors in future...100u not very cheap..maybe through hole, there are some not too big.

                                        1 Reply Last reply
                                        0
                                        • m26872M m26872

                                          @samuel235
                                          Arduino Pro Mini should be your no1 reference. Schematics and Eagle files povided. There your can see the normal layout of Q1 e.g. It's the crystal/oscillator (with 22pF caps if you choose xtal) I don't know why Sensebender looks like it does.

                                          I haven't studied your design closely or know your intentions, but I don't know of any proven coin cell nRF designs, but I suppose you'll have it sleeping a lot.

                                          Sometimes it's good to breadboard prototypes if there're any hesistance.

                                          S Offline
                                          S Offline
                                          Samuel235
                                          Hardware Contributor
                                          wrote on last edited by
                                          #22

                                          @m26872 I have been looking at a nano i have on my desk while building these designs, and i didn't notice anything with Q1 hense why i asked about it on sensebender. However it is not of any interest to this project (to my knowledge), i just wanted to learn the use of a tran in this case.

                                          I will be sleeping the module quite a bit yeah, literally asleep all the time until someone presses the switch.

                                          @scalz I'll throw a 47u in there, this node shouldn't be used for any other sensor at any time to be honest, hence why i'm designing it from scratch to go into the socket.

                                          MySensors 2.1.1
                                          Controller - OpenHAB (Virtual Machine)
                                          Gateway - Arduino Mega MQTT Gateway W5100

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


                                          12

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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