← Back to list

Electronics_Design

March 19, 2024

Electronics_Design

Challenge


Group Assignment:

This week Was about using the debugging tools of Electronics (Multimeter and oscilloscope) components we have in the lab to observe the signals coming from the microcontroller and what is going to it from the sensor and its values.

This process is so helpful in understanding the working signals of MCU (How it looks) and how to understand the error from the value or the shape of the signal.

More about the process please refer to this LINK.


Individual Assignment

This week assignment is to design and fabricate a board (Any board)

For me I will be designing a board containing (ESP) for IOT purposes, 1 Input component and 1 output component, In addition to adding headers to be linked with the MCU.

The decision based on what I have in mind is to use the (XIAO ESP32C3) , DHT temperature and humidity sensor, button, and LED’s.

HS

As for the designing tool I’ll be using (KICAD).

Designing

It’s important before designing we need to make sure that we know all the component we want to use.

Tiny MCU board with Wi-Fi and Bluetooth5.0

XIAO Dimension

Knowing the dimension of an object is necessary before start designing to understand the PCB dimension.

Then its important to know the pin-out of your component so you can understand the orientation you want to have on your PCB in addition to what kind of other component can be linked together.

XIAO Pin-Out

For more details about the Board check this documentation –> Link

The DHT22 is a basic, low-cost digital temperature and humidity sensor.

DHT 22 Dimension

DHT 22 Pin-OUT

For more details check this datasheet –> Link

Surface mount switch

Switch Dimension and PIN-OUT

For more details check this datasheet –> Link

Those are the main big component to use the others are quite simple to use.

Now let Us go ahead to KICAD to start the schematic and then the design.

KICAD

When opening KICAD the window will show us the current or previous project you worked on

Kicad First Window

Kicad New Project

You can simply press (ctrl+N).

New Project Created

Now you will see the new project you have created.

Now I’m Ready to build my schematic

Open SChematic

SChematic Layout

Its Important to check all the available options and settings before starting the design process.

add component

add Xiao

Now Just press (OK) and then place the block diagram wherever on the sheet

place  Xiao

Now we can see that the pins are not like what the real MCU looks like so we just need simply to understand where each pin is cross-ponds to.

Xiao pins

6 pin header through hole

Global Label

Check Datasheet –> Link

Ftdi Pin Socket

LED

LED MCU

Resistor

Resistor with LED

Just Press (P) and choose the power option you want.

GND PWR

GND connected to resistor

RX and TX Connected

FTDI Socket Ready

XIAO ESP32 has 3 pins for power (5V , 3.3V , and GND)

Power to MCU Ready

DHT 22

DHT 22 connected

I have connected a pull up resistor between the Data bin and the input pin of the MCU as per data sheet (Section 5) the value can be from 1K to 10K.

Switch Omron component

Switch Connected

LED Connected

Now My Circuit Schematic is Ready

Schematic Done

Now I have to Run the Electrical Rules checker (ERC) to check for Errors

ERC

ERC Done

All the errors are because of the floating pins (Not connected pins).

Annotate

Annotate Complete

Move to PCB Page

PCB Design

After we move to the PCB design Page this screen will appear

PCB Design page

As seen the page is empty and there is no component to route.

Adding component

Place Component

Now we are ready to start routing the component together.

Rectangle Added

Rectangle Settings

While Sorting you will recognize that the components are moving with big step so you can change this by changing the grid step. Grid

Sorting Component big

Sorting Component Done

Board Setup

Board constrains

Track Width

Track Width Done

Track first Done

All route Done

DRC

DRC Done

This will create a common zone on the top board layer (For me its gonna be Ground).

Fill Zone

Fill Zone Done

Fabrication Outputs

Plot settings

Drill Files

Now we are ready to generate the toolpath and fabricate the board on the CNC.

For the Generation of the Toolpath and the machine process I will go through it fast but you can refer to this LINK for more Details.

Board Fabrication

Toolpath generation

Toolpath Generated

Machine Process

Board before Cleaning

Board After Cleaning

Soldering The Board

All component before soldering

All component before soldering

LED

Resister and button

All Done

Testing the Board

I will blink the LED’s on the board.

Code

#define LED1 21
#define LED2 20
#define LED3 10

void setup() {
  // put your setup code here, to run once:
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(LED1,HIGH);
digitalWrite(LED2,LOW);
digitalWrite(LED3,LOW);
delay(1000);
digitalWrite(LED1,LOW);
digitalWrite(LED2,HIGH);
digitalWrite(LED3,LOW);
delay(1000);
digitalWrite(LED1,LOW);
digitalWrite(LED2,LOW);
digitalWrite(LED3,HIGH);
delay(1000);
}

Raw Files

KICAD files


Issues faced

After milling the board

Board After Cleaning