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.
  • scalzS Offline
    scalzS Offline
    scalz
    Hardware Contributor
    wrote on last edited by scalz
    #65

    @samuel235: cool. happy for you.

    first you need to burn the bootlader in your atmel 328p. When it comes as ic-only, factory setting is 1mhz internal rc. and there is no bootloader yet. So you can't use ftdi at this moment, nor ota. So you need to burn the bootloader with avrspi. Like @sundberg84 said you can use the "arduino uno as isp programmer" method if you have an uno..On my side, I don't use this method, I prefer to use an usbasp. But both method works well.
    When burning bootloader, you will need to set fuses too, corrsponding to the bootloader.

    Sorry, I have not much time to make an howto, just point you in some direction..i hope it helps a little bit.

    Edit: you can find some howto here http://www.gammon.com.au/breadboard

    S 1 Reply Last reply
    1
    • scalzS scalz

      @samuel235: cool. happy for you.

      first you need to burn the bootlader in your atmel 328p. When it comes as ic-only, factory setting is 1mhz internal rc. and there is no bootloader yet. So you can't use ftdi at this moment, nor ota. So you need to burn the bootloader with avrspi. Like @sundberg84 said you can use the "arduino uno as isp programmer" method if you have an uno..On my side, I don't use this method, I prefer to use an usbasp. But both method works well.
      When burning bootloader, you will need to set fuses too, corrsponding to the bootloader.

      Sorry, I have not much time to make an howto, just point you in some direction..i hope it helps a little bit.

      Edit: you can find some howto here http://www.gammon.com.au/breadboard

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

      @scalz I'm using a USBasp programmer, however i think i may have an issue with my reset pin. I have continuity on every other ISP header pin and the associated pin on the ATMega but not the reset pin. Is this normal, should i be seeing continuity between ISP RESET and pin 29 on the ATMega?

      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
        #67

        I think you should have continuity between avrspi connector RST pin and your atmega RST pin...don't see why not. Have you checked your routing? I think so...Maybe a bad solder on this pin???

        S 1 Reply Last reply
        0
        • scalzS scalz

          I think you should have continuity between avrspi connector RST pin and your atmega RST pin...don't see why not. Have you checked your routing? I think so...Maybe a bad solder on this pin???

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

          @scalz I may have found the problem, i have just completed a x25 magnification inspection on the boards and every board has atleast one filled VIA. I'm going to get a makeshift jumper in place on this board and test for continuity again.

          I get continuity from the pin to the one side of the capacitor but nothing from the MEGA to the pin, it feels like the capacitor is stopping it coming through...

          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
            #69

            oki, so if continuity between rst atmega and one side of capacitor (dtr ftdi capacitor, right?) it should be ok. The capa is for dtr of ftdi (it is a trick for resetting atmega from ide when you want to upload).
            Is your schematic updated on your first post? I don't see a 10k resistor pullup for rst...you need it to keep rst line to 1 and then when you push a rst button, or want to reprogram it by ftdi or avrspi, it will go to low/0 briefly to tell the mcu to reset.
            if not done, try to connect a 10k res between your rst pin and vcc

            S 1 Reply Last reply
            0
            • scalzS scalz

              oki, so if continuity between rst atmega and one side of capacitor (dtr ftdi capacitor, right?) it should be ok. The capa is for dtr of ftdi (it is a trick for resetting atmega from ide when you want to upload).
              Is your schematic updated on your first post? I don't see a 10k resistor pullup for rst...you need it to keep rst line to 1 and then when you push a rst button, or want to reprogram it by ftdi or avrspi, it will go to low/0 briefly to tell the mcu to reset.
              if not done, try to connect a 10k res between your rst pin and vcc

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

              @scalz I have just uploaded a zip file with my .brd and .sch files. Sorry, forgot to update those

              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
                #71

                oki seems good. so I imagine you have continuity between rst atmega/one side of the 10k res. so what is your problem to program it?
                when programming with avrspi, be careful with the fuses, especially for clock freq. For instance, if you set the clock fuse for external crystal and you have no onboard, then you could have some problem to re-set the fuse to internal clock as at this moment, the mcu will wait for an external clock. I am not sure as I have never tested this, and I am careful when I set the fuses, but in eventuality I am tired and make a mistake, I like to put a crystal footprint. but sometimes, you have not enough room unfortunately.

                S 1 Reply Last reply
                0
                • scalzS scalz

                  oki seems good. so I imagine you have continuity between rst atmega/one side of the 10k res. so what is your problem to program it?
                  when programming with avrspi, be careful with the fuses, especially for clock freq. For instance, if you set the clock fuse for external crystal and you have no onboard, then you could have some problem to re-set the fuse to internal clock as at this moment, the mcu will wait for an external clock. I am not sure as I have never tested this, and I am careful when I set the fuses, but in eventuality I am tired and make a mistake, I like to put a crystal footprint. but sometimes, you have not enough room unfortunately.

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

                  @scalz I get continuity from the ATMega to the resistor and one side of the cap. But its not flowing through the cap. So you think i should be good to program from there? I try to test a connection to the board with AVRDude, by running "C:>avrdude -c usbasp -p m328p" and then i get

                  avrdude: error: programm enable: target doesn't answer. 1
                  avrdude: initialization failed, rc=1
                           Double check connections and try again, or use -P to override this check.
                  
                  avrdude done. Thank you.
                  

                  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
                    #73

                    yep, for capa it is not a problem. so it should work, but your log seems indicating a connection problem...but I don't see it :flushed: and I don't have much time for the moment...sorry.
                    for avrdude cli, I can't help you as I use avrdudess. no need of cli, a little bit easier.

                    S 1 Reply Last reply
                    0
                    • scalzS scalz

                      yep, for capa it is not a problem. so it should work, but your log seems indicating a connection problem...but I don't see it :flushed: and I don't have much time for the moment...sorry.
                      for avrdude cli, I can't help you as I use avrdudess. no need of cli, a little bit easier.

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

                      @scalz While feeding the board 3v, every part of the VCC line from the battery to the chip is perfect, however if i test a VCC pin and a GND pin on the chip, it reads 0.06. Would this be an issue?

                      Maybe i should have connected all of the vcc's together or even pulled another to the battery directly, the only vcc connection going to the mega is from the DTR/RESET pin on the SPI header, that flows through the resistor to the mega. Is this an incorrect wiring issue?

                      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
                        #75

                        Okay, so for some reason i seem to have not connected all the VCC's together unfortunately, i personally believe this is where my issue lies. If anyone feels differently, please shout out and let me know.

                        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
                          #76

                          @samuel235: i have just looked briefly to your .brd this time ;) .So, for your next rev:

                          • you have airwire. You have to have no airwire at all or you must know what you do. Here you have an airwire on your batt which is not connected to mcu. So of course it can't work. You can fix this by soldering a wire between Batt_vcc and radio_vcc. it should work. Sometimes, when board is complex, you can't see everything, and sometimes airwire are micro..in eagle you can see these : File menu/run ulp/ and launch zoom_unrooted.ulp. It will highlight these.
                          • decoupling capa, which are not always mandatory, but for a mcu I would say yes, needs to be placed near the concerned chip. Your board is small so it should work. but it's something to know.
                          • for vcc, power line/rails, you are using 12mil (trace width I usually use mils unit as I am not familiar to inch! I'm french lol). I think it is rather small...For signals, it's ok. But for power, hum..I prefer not to go under 16mil and it's my limit. I like 20/24 or 32mils, all depends of the current.

                          As you can see, pcb design is a whole science! I would advise you to persevere, you will find very good starter howto for pcb designing at sparkfun. they rocks! adafruit too. It's like kung-fu, I like to say : the path/road is long ;) but finally it's very rewarding, yeah :smile:

                          S 1 Reply Last reply
                          0
                          • scalzS scalz

                            @samuel235: i have just looked briefly to your .brd this time ;) .So, for your next rev:

                            • you have airwire. You have to have no airwire at all or you must know what you do. Here you have an airwire on your batt which is not connected to mcu. So of course it can't work. You can fix this by soldering a wire between Batt_vcc and radio_vcc. it should work. Sometimes, when board is complex, you can't see everything, and sometimes airwire are micro..in eagle you can see these : File menu/run ulp/ and launch zoom_unrooted.ulp. It will highlight these.
                            • decoupling capa, which are not always mandatory, but for a mcu I would say yes, needs to be placed near the concerned chip. Your board is small so it should work. but it's something to know.
                            • for vcc, power line/rails, you are using 12mil (trace width I usually use mils unit as I am not familiar to inch! I'm french lol). I think it is rather small...For signals, it's ok. But for power, hum..I prefer not to go under 16mil and it's my limit. I like 20/24 or 32mils, all depends of the current.

                            As you can see, pcb design is a whole science! I would advise you to persevere, you will find very good starter howto for pcb designing at sparkfun. they rocks! adafruit too. It's like kung-fu, I like to say : the path/road is long ;) but finally it's very rewarding, yeah :smile:

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

                            @scalz - While you were away i noticed about the VCC line not getting to the Mega, so i soldered a wire from batt + to the nRF vcc, like you just confirmed.

                            I would too prefer the traces to be bigger, however I routed them with a bigger size but i couldn't route the board completely. So i chose to bring the size down hoping to get away with it.

                            So, i have made the connection with the additional wire and I'm still unable to get a test communication connection to the board through USBasp. I thought maybe its going a little too quickly for the board and so i decided to use a slower SCK speed, dropped it really low, still nothing.

                            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
                              #78

                              arf..and now what's your vcc voltage?
                              if I have an idea, I'll tell you

                              S 1 Reply Last reply
                              0
                              • scalzS scalz

                                arf..and now what's your vcc voltage?
                                if I have an idea, I'll tell you

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

                                @scalz I'm sorry, you have confused me with arf, what does arf mean? Is it some 'slang' word? xD - My vcc voltage is 3v from a battery, if i let the USBasp power it, i set it to 3v which comes out at 3v3.

                                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
                                  #80

                                  ahah. it was an onomatopia? a sort of "argh" or "gloups". I don't know how to translate it lol!
                                  for your vcc problem (seems now you have a true one), there is of course an answer but I have no idea for the moment...like I said if I have one I will tell you. I will try to re-look at your eagle files maybe tonight...

                                  S 1 Reply Last reply
                                  0
                                  • scalzS scalz

                                    ahah. it was an onomatopia? a sort of "argh" or "gloups". I don't know how to translate it lol!
                                    for your vcc problem (seems now you have a true one), there is of course an answer but I have no idea for the moment...like I said if I have one I will tell you. I will try to re-look at your eagle files maybe tonight...

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

                                    @scalz Ahh okay, i assumed it was to be honest but just in case it was some sort of technical term that i didn't understand i thought it was best i questioned it.

                                    Yeah, i have some power in the chip now it seems, thank you for shining some sort of light on one issue, whether it is the issue that is stopping it from working or not, its help at least. When i get home i will be spending some more time on troubleshooting the issue again. Hope to speak to you later :)

                                    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
                                      #82

                                      @scalz I've woken this morning quite ashamed at the fact last night/yesterday i must have been that sleep deprived when asking about continuity over a connected capacitor. They will only show continuity if they are blown/faulty, i now remember.

                                      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
                                        #83

                                        I'm seeking external help from a electronic forum. Someone has suggested that my 0.1uF caps could be too far away from the micro-controller itself. We're talking around 13-15mm away from the chip. What're you thoughts, would you say that is too far away from the chip?

                                        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
                                          #84

                                          With a little open-heart surgery, the board becomes alive! While I'm yet to actually burn any bootloader to the uC itself, I have no got the circuitry working.

                                          The known issues:

                                          • Capacitor on the SPI Header was incorrectly connected. I had wired it like a resistor/diode.
                                          • The VCC line from the SPI was connected to the uC through the resistor of the RESET circuit.
                                          • Battery holder is connected in reverse.

                                          I have attached images for anyone interested in following this project with actual pictures of the progression through the revisions of this node. I have now made some alterations in my documentations regarding Rev1, listed the known issues and made some possible improvements:

                                          • Remove one 47uF capacitor.
                                          • Move the 47uF capacitor closer to battery terminal, and have all power traces coming through that capacitor, reducing the chance of the battery being drained through large spikes in draw.
                                          • Add capacitor to FTDI VCC to stop spikes when connecting programming board.
                                          • Increase silkscreen labels for document data such as pinouts and node info.
                                          • Remove the 100uF capacitor on the nRF24l01+, add a 4.7uF footprint and 0.1uF footprint. Only populate if needed.
                                          • Turn around the switch terminals, room should allow this.
                                          • Bring the 0.1uF capacitors closer to the VCC inputs on the uC.

                                          This week I will be aiming to get the designs and re-routes for Rev2 sorted out, and then get them ordered, with express shipping this time hopefully. The 3 weeks of waiting killed me!

                                          Please give your feedback, if you have any.

                                          IMG_7132.jpg IMG_7133.jpg IMG_7139.jpg IMG_7134.jpg

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

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


                                          9

                                          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