Skip to content

6. Electronic Design.

Group Assignment: - Use the test equipment in your lab to observe the operation of a microcontroller circuit board (as a minimum, you should demonstrate the use of a multimeter and oscilloscope). - Document your work on the group work page and reflect what you learned on your individual page.

Individual Assignment: - Use an EDA tool to design a development board to interact and communicate with an embedded microcontroller

Assignment Checklist.

item Activity Status
task 1 Linked to the group assignment page IN PROGRESS
task 2 Documented what you have learned in electronics design IN PROGRESS
task 3 Checked your board can be fabricated IN PROGRESS
task 4 Explained problems and how you fixed them. IN PROGRESS
task 5 Included original design files (Eagle, KiCad, etc.) IN PROGRESS
task 6 Included a ‘hero shot’ IN PROGRESS

Group Assignment.

Reading PWM Signal from ESP32 module.

We wrote a short piece of code to generate a variable PWM signal using a potentiometer. We observed the change in pulse width on the oscilloscope and the average voltage on the multimeter.

//TEST PWM FOR ESP32 MODULE
const int potPin = 4;     
const int pwmPin = 23;    
const int freq = 5000;    
const int resolution = 8;  
const int pwmChannel = 1;  

void setup() {
  Serial.begin(115200);
  pinMode(potPin, INPUT); 
  pinMode(pwmPin,OUTPUT);

  ledcSetup(pwmChannel, freq, resolution);
  ledcAttachPin(pwmPin , pwmChannel);
}

void loop() {
  int potValue = analogRead(potPin);
  int speed = map(potValue, 0, 4095, 0, 255);

  Serial.println(potValue);

  ledcWrite(pwmChannel, speed);
}

Video Evidence

Ver video en YouTube

Individual Assignment.

Choosing Electronic Design Software.

I chose the EDA software KiCad because it is free and open source.

PCB board design

I created the project by going to File > New Project. This automatically created two files, one corresponding to the schematic editor and the other to the KiCad board editor.

We start with the schematic editor, where we add the components to be used on our board. Add Symbol > We select each component from the library.

We place all the components to be used in our workspace. For this demonstration case, we will make a module that uses the RP2040 Seed Studio XIAO microcontroller, which will read data from a TMP102 sensor and display it on an SSD1306 OLED display. It will also have two pull-up resistors for the I2C connection, two power pins, and a switch to turn the module on and off.

Once all the components are entered, we make all the connections using the Add Wire tool.

We return to our Project explorer and search our .pcb file. Inside of pcb editor we press “Update board from squematic”.Next we move and position the footprints, anticipating their final placement on our board. In this case, we distributed the components between the two sides, top and bottom. If we want to change the side of a component, we first select the component, right-click on it, and then click on “Flip”.

We create the board outline with the “Draw Rectangle” tool and add the circles corresponding to the mounting holes.

We configure the track and via dimensions as shown in the graphic.

We install the FreeRouting plugin to create the tracks for our circuit by following this tutorial: https://www.youtube.com/watch?v=AuBZ1W80c9s&t=58s&ab_channel=Mr.T%27sDesignGraveyard After that, we use our plugin in Tools > External Plugins > FreeRouting.

A new window will appear where the process will be automatic.

We will have our circuit with the tracks created. If adjustments are needed, we can edit the tracks by deleting and creating new ones with the “Add Route Via” tool.

By clicking on the “Add Fill Zone” tool, we will create our fill zone. In the pop-up window, we select the net or connection corresponding to GND, also naming it “GND” in “Zone Name”.

After that, it will ask us to enclose or frame the entire area to be covered by the fill zone.

This is how it should look once we have selected the entire outline of our electronic board.

Immediately after selecting, we activate the fill by pressing the “b” key on the keyboard, ensuring that our fill frame is pressed or selected.

To create our manufacturing files, we must click on “Files > Manufacturing Outputs > Gerbers / Drilling Files”.

In the “Route” pop-up window, we select the layers we want to machine, enable the drill file origin to set our manufacturing origin. Finally, we click on “Route” and then “Generate Drill Files” to generate our track routing and drilling files in the specified path, which in our case is “archivos de fabricación” (manufacturing files).

PCB Generation

I generated my machining files in FlatCAM, an open-source and free tool.

I used the CNC 6040 milling machine available at the Fablab to machine the electronic board.

Soldering of SMD components.

I proceeded to solder the components in the electronics area of the Fablab using the necessary tools and materials until I obtained the prototype of my electronic board.

Programming and Testing

Before programming our RP2040, we proceed to prepare our programming environment, having the environment ready for Arduino to program the RP2040 and the libraries for the display modules and the I2C connection. To install the libraries for the RP, we can follow the instructions at https://wiki.seeedstudio.com/XIAO-RP2040/.

Module powered on.

From Youtube

Ver video en YouTube

Files for download.

LEARNING, FINDING AND LESSONS

When using modules for Arduino or other components whose schematic symbols or PCB footprints are not found by default in the KiCad libraries, we should search the internet for libraries. These libraries can be provided by the manufacturers themselves or by developers who have created their own. If we cannot find the necessary libraries from these sources, the remaining option would be to create our own libraries in KiCad. There are many tutorials available online for this.


Last update: May 8, 2025