8. Electronics design

This week's practice consisted in making our own PCB design, testing the electronic design rules and making it following the same process from Week 4 . As we had to understand the elements around electronics, this was pretty intensive for newbies like me, but I got a lot of knowledge from it.

What did I learn from electronics design?

Mostly terms and concepts related to circuits, also considerations to build tracks, what to link, where and why. As the main concepts, here are some of the basics I got:

>
Concept Description Picture/ Symbol
Voltage Strenght with which electricity flows.
Current Electricity flow amount.
Power Rate at which energy is transferred or converted.
Ground It's a reference point in an electrical circuit that serves as a common return path for electric current.
Resistor Component to resist voltage and avoid short circuits. The ones you use depend on your other component's requirements.They don't have voltage, nor current limit, their limit is on power.
Capacitor It's useful to store energy in an electric field. These are polar and not always required for a circuit.
LED's They are polar, when soldering them guide with the green line they have to place them. This line is the cathode (negative ) side.
Microcontroller The brain of a circuit, It allows to design names to the pins and program them later. It's possible to connect them directly if they have ports of communication, if not they can use another one.
Footprint It's the physical layout or pattern of a component's pads, holes, and other features on the PCB.
Schematic design It's a graphical representation of an electronic circuit. It illustrates the connections between various electronic components using their symbols.

During the development of this practice I got to understand some rules that might be obvious for people with enough experience, but I will list them here as personal notes:

  1. When you make the traces, they must have one side linked to the ground and one to voltage, the circuit must close at some point.
  2. Try to have a resistor per component, some modules already include them.
  3. All of the traces with the same function must be connected to close the circuit. Eg: All of your grounds and Voltages, In case you have more than a single pin for it in your microcontroller.
  4. Consider to always include some important pins to program your board later: MISO, MOSI, SCK, GROUND, VOLTAGE and RESET.
  5. Export the files for cutting the PCB from different layers of the same version of a file. Don't add the outline frame from a different file because the measurements may change.

Adding libraries to KiCad

As the libraries you add while working with arduino, it is also necessary to add them when you use KiCad, so the first thing we did this week was to install the one that had all the component my FAB has.

  1. First we received a link to download the component library for all we have in the FAB
  2. I downloaded the floder in a ZIP folder, as if I were cloning the repository to my computer.Then I decompressed it to check the files in a location I could easily find.
    Engraving PCB
    Engraving PCB
  3. Next, I opened KiCad and uploaded the first folder from the preferences tool.This was to get the schematic.
  4. This already has default libraries, so I had to import mine from the + buton.
  5. Then I looked for the file fab.KiCad.sym to add the symbols, I saved it with the name "fab" in lower case.
  6. Now I did the same to add the footprint>.
  7. There I added the folder named fab pretty. To name this library, i called it Fab with the first being capital, to avoid confusions later.
  8. Finally, I imported another folder called KiCad to the configure pathsThen, it was all ready to start designing.
  9. Making my own design: The first schematic

    1. First I didn't have much idea on what to do, the only thing I was sure about was that I really wanted to make my own game controller. I looked around for some references of other DIY pcb controllers.
      Click here for the main references.

    2. I also checked some references on the site recommended last sesion called flux ai. It allowed me to review a board, it's components and layers, from the schematic to the PCB itself. For my practice the biggest reference here is this. The site is available if you click, here .
    3. After checking both reference I realized they made their boards with two layers, so my challenge would be to make my own at one without mixing traces.
    4. I started to design by creating a new project on KiCad. Immediately when you create one, you must select the folder where you want the files to be.
    5. Then I selected the Schematic editor, that would allow me to arrange the components and make the connections between them.
    6. When it opens it looks like this. It has the options to add and modify symbols.
    7. Then I used the Add Symbols option to look for the component I needed, I started looking for buttons.
    8. As I didn't know if that was the one I wanted, I clicked on the datasheet link , so it could open a PDF on my browser and offer me a picture. These were the ones, so I added 4 of them.
    9. Then I looked for the pins here, because I needed two of them. As these are analog components, I Checked the amount the joystick module has, so I added two with 5 of them.
    10. Then I assigned them a name using the Draw netlabels tool. I gave them the same names as the ones on the module.
    11. Then I added a resistor to each button, and placed them on the upper right corner
    12. Later, I added the voltage symbols to the edge of the buttons . So I would know the right side.
    13. As I already had a side of the circuits "connected", I added the symbol of ground next to the resistors, so that it would be connected on the other side.
    14. At first I added a Xiao ESP32C3 as a microcontroller, hoping to take advantage of the pins and usb already attached, so this is how the schematic looked like before starting to edit it on the PCB option.
    15. Making my own design: The KiCad PCB edit

      1. To edit the pcb I opened from the menu that appears with the folder of the project, you have one default, so I only had to click it to open.
      2. This is how it looks when you open it, it doesn't show any preview of what you do on the schematic.
      3. To update the current design, I clicked on the tools option, and then on the update from schematic option. There appears a message showing which pieces will modify. Everytime you make a change on the schematic, you must update it again to verify everything works.
      4. After updating, It showed me the pieces all together, The blue lines are the preserved links between components I had from the schematic. Note: If something is not linked visually by a blue line here, it won't allow you to join the components with trcks.
      5. The next step here was to separate them and try to accomodate them to the right place. This way I had a preview of the size and distribution before making connections.
      6. Making my own design: Going back and forth between the schematic and the PCB editor.

      7. To guide me during the wiring and connecting, I drew these lines to help me know what to conect and where.There I realized maybe the pins from the Xiao ESP32C3 were not enough, so I wired on the schematic and also tried the same with another microcontroller.
      8. As I wasn't convinced about the microcontroller, I changed itagain and started connecting from the pcb editor. This time it was another version of the Atmega328 on a square format. This ended up becoming the final microcontroller choice.
      9. Once I started to connect, I realized I would depend on an external module to program this microcontroller, so I added the pins to program/ connect it later. Also, I remembered that I can use tags instead og directly connecting it from the schematic editor.
      10. I started to wire following the design rules, so as my Atmega328 had small pins, the traces were also very small and I had to be careful and patient.
      11. To know where to connect what, I based on the datasheet from the microcontroller, it was much easier also to add tags on the schematic. This type of image it's available for every microcontroller and you find it as "pinout"
      12. Also, I realized the joystick pins had the same names. To aviod confusion or mistakes, i renamed them based on the side they would belong to, using a letter standing for it.
      13. As I asked for some advice, what I wanted was too much for a beginner and I would put much pressure if I wanted it to work as a finished market joystick. So, I just added two leds to indicate the status depending on the buttons pressed or movements as the output for this week.
      14. I also included the respective ressistances and finished making the base traces.When It seemed ready, I drew the frame for it.
      15. I used the tool inspect design rules to check if the electric connections were correct. Fortunately, the mistakes I had were related to unconnected pins I didn't use.
      16. Also, When my footprint was ready, I drew some rectangles the size of my joystick module, so it wouldn't hit anything, I also drew the frame.
      17. When I thought I was done, I added another pin to program, so i had 6 in total. I accomodated them based on the easier way to wire.
      18. Before exporting, I asked for some assesment again, so I noticed my connections were not working becayse my buttons were not connected to voltage , neither the grounds were connected, so I had to wire everything and check again.
      19. Finally, I could export the layer with the traces and the one with the cutting frame.The main file is on a SVG format.
      20. This is how it looked like when I exported the files.
      21. Processing and cut

        1. Once I had the SVG files, I used MODS To set it all for the cut.
          Engraving PCB
          Engraving PCB
          Engraving PCB
        2. I used the parameters of 1/64 for the traces and 1/32 for the cut. Also, as my microcontroller was very small I gave the tool a very thin diameter.
        3. For my fisrt cut, I used a new V blade and tried to cut over the surface, I also used the remaining parts of my first PCB copper sheet, so I really tried to fit this one. I had the trouble that when the cut started, the spindle worked perfectly, but after some passes it wouldn't contact the surface. I tried more than how I should, because it ended up eating some traces, so I couldn't continue on the same layer.
          Engraving PCB
          Engraving PCB
          Engraving PCB
          Engraving PCB
          Engraving PCB
          Engraving PCB
        4. During my second and third cut, I had the opposite problem. I couldn't calibrate the z axis correctly, because this time the spindle passed just fine and then it would lower itself deeper than the origin. I'm still not sure if this is because of the MODS settings or the calibration only, but I will figure out. (At some point I ran out of space). I tried also making a single offset, but I believe the problem relates more with the depth of the cut.
          Engraving PCB
          Engraving PCB
          Engraving PCB
        5. Take a look at the cut here, and the sound, it was way too deep.

          Anti-hero shots (To be continued)

          Anti-Hero shots