dummy


6. ELECTRONICS DESIGN


On Week 4, "Embedded programming", we learned how to use simple codes with the XIAO RP2040 Microcontroller, but to do so we used a "Bread Board to make the cabling connections between the components and the Microcontroller Pins.
This week we got to design our "personalized Board" it is hands on software and hardware to design it. Instead of having the breadboard to do the connections, we designed the board making the connections directly into a board as it would be in a final product design, the Breadboard is a semi-permanent prototype of electronics circuits.

HERO IMAGE

size

ASSIGNMENTS

Group Assignment

Individual Assignment


GROUP ASSIGNMENT

For this assignment we met with my fellow students and Steven our instructor, he guided us through the different equipment we have in the Fab Lab to test boards and Microcontrollers. size

I found particullarly interesting the Oscilloscope, it is an equipment that can give so much information not only from the hardware but from the coding itself. We did a comparison between the Arduino Uno and the XIAO RP4020 with the same coding of Blinking a Led Light, then we measure their waives and we could see the difference on the waives height as the Arduino Uno microcontroller was connected to a 5v ant the XIAO to 3v. We could see too the accuracy of the time in both waives, given the delay of 500 ms between ON-OFF in the loop.
Then we took out the delay from the coding and could see the speed of the internal clock, in both cases both were a bit behind trying to complete the loop the waive. Steven tought us that we can do "Bare Metal Programming", in the Data sheet of the microcontroller and its components, we can learn how to code to go directly to the internal clock to make the loop faster, changing the time difference from miliseconds to nanoseconds.

You can see HERE more about the group assigment, where we see more in detail the different 3D printing properties.


INDIVIDUAL ASSIGNMENT

-Design a development board

This board should interact and comunicate with an embedded microcontroler.

I have decided to use the integrated software AUTODESK EAGLE for designing my board.

The main objective of this board is to expose all the pins of the Microcontroller for external use, making them readily available for connecting with external components. Additionally, I want to include two built-in components, a switch and a LED light, that can communicate with each other.

To start I had to go to the FAB ACADEMY LIBRARY to download the Eagle Library, where are a lot of the components used in electronics design.

To add the necessary components for the board to the schematic document within the program, we can use from the library and upload it:

When I have all the parts in the Schematic Document I started to trace the paths or connectios between the components, assigning each of the Microcontroller pins to the extension pin. Each of the Pin Buttons has, one ground, one 3V, and one 5V the other are left for the data points. In this way I have all the pins available to connect different components to the Board.

The Led and the pin Button are built in the board, and are connected to the Pin Buttons. each of them requires a resistor to calibrate the voltage.

size

Before moving on to the PCB format, I ran the ERC (electrical rule check) controller to check for any discrepancies in my schematic design. This is a good practice as it can help avoid potential issues later on. During the check, I found some errors which I fixed, but I also noticed some "errors" that were actually intentional, such as the value of some pins that were not needed, like the Power Pin connected to VCC. This was done intentionally to provide flexibility in the set of pins, allowing them to be connected to either 3V or 5V depending on the specific requirements.

size

After completing the schematic diagram check, I switched to the PCB document in the program. Here, all the components and paths between them were automatically "sent" to a board setting, but they were initially disorganized. I had to manually move each of the components to their final placement, making sure to leave enough space for the paths that I would later print with the CNC.
Before starting to move the components around, I adjusted the grid size to help guide me with the movements and traced a working area starting from the 0,0,0 origin point

size

Once I had positioned the components approximately where I wanted them, I started tracing the paths that would connect the different pins. I went to the Route tools and selected manual mode, which allowed me to have better control over the paths.

size

When I was working on the PCB design, I made sure to go to the DRC (Design Rule Check) settings and adjust the sizes to ensure a good space between the paths and the size of the paths. I set the spacing between 12ml and 16ml, which worked well for both. This step is very important, as it prevents the paths from getting too close to each other and generating errors when trying to get the template for the CNC in Mods.

size
size

After I finished preparing the pads, I proceeded to draw the outer line of the board by going to the Manufacturing tools and selecting "Outline polyline". This allowed me to create the final shape of the board, which I could then use to generate the necessary files for the CNC machine.

size

At this point, I was able to go back to the schematic and add more components or change connections between them if needed. I made some additions and changes in the schematic diagram and then ran the ERC to rule out any errors. Next, I traced the new paths in the PCB document and ran the DRC to check for errors. I discovered that most of my errors were due to bad connections to the center of the pins, pads being too close to each other, and broken paths. Fortunately, the DRC showed me where the problems were and what needed to be fixed.

size

I was able to move the paths around once they were already traced, and I spent some time organizing them and giving them more space between each other. It was important to carefully check the board for errors and fix them to ensure that the routing and drilling would be accurate. Once I had checked everything again and all the DRC errors were cleared, I exported the image to PNG. Before doing so, I made sure to go to Preferences > Electronics and untick the "Display signal names on pads and traces" option, and then clicked OK.

size

I exported the image by typing in the command prompt, and a window appeared where I selected the location to save the PNG. I chose to make it monochrome and set the resolution between 1000 and 2000. I selected the area as file, not window. I exported two images, one for engraving the paths and another for cutting through the board. In the layers section,
I only kept layer 1 Top where I drew the paths and added text. I also kept the layer of the Microcontroller pads, as these areas would be left without engraving by the CNC.

size

Once I finished exporting the image for the engraving of the paths, I proceeded to export the second image for the cut through. The process was the same, but this time I left ON the layer of the pads where the holes for the microcontroller are and the border outerline.

size

I opened the generated images in GIMP to touchup some minor details, for the engravig image I had to fill the holes of the pins.

size size

For the cut through image I had to leave only the holes for the pins and the outerline

size size

Having these two images I proceed to open the PNG images in Mods, and calculate them. This will generate the G-code I sent to the CNC machine to mill.

size

The steps to open mods are the following:

  1. Open MODS PAGE
  2. Right click on the screen and choose Programs from the menu
  3. Then choose Server Program from the list
  4. Scroll down to G-code, chose mill 2D PCB png
  5. Once Mods windows are opened we select open PNG file
  6. At the third window we select Calculate
  7. If we wish we can open to view the G-code path
size