Week 8

Electronics Design

Group Assignment

First

- 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)

Second

- Document your work on the group work page and reflect what you learned on your individual page

Individual Assignment

First

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

Second

- extra credit: try another design workflow

Third

- Extra credit: design a case for it,simulate its operation

Group Assignment

LINK TO THE GROUP ASSIGNMENT PAGE

Organization

In our Fab Lab Cientifica del Sur, we have all the implements to work in the Group Assignment, this time I made a group with my colleague Hans, we both organized as follows:

LINK TO THE ASSIGNMENT WEEK

Organization Of the Week - Electronics Design
Wednesday 13th First commit of organization of the week, tasks, progress, materials, etc.
Thursday 14th First approach to components, initial tests with measuring equipment, documentation. First board design progress, component organization, PCB design software exploration.
Friday 15th Board milling, circuit verification, start soldering, documentation of complications.
Monday 18th Multimeter continuity testing, blink, PC board programming, documentation
Tuesday 19th Final documentation, last commit, preparation of speech, final project progress

Description of the equipment

In our laboratory we have the following implements:

1. Mastek multimeter with test points

+ Info

2. A Miniware DS213 oscilloscope.

+ Info

3. A Logic Analyzer LA104

+ Info

4. GW-INSTEK adjustable DC voltage supply with power cable and test points.

+ Info

Descripción de la imagen

Test

Testing the Multimeter

LED'S

For testing with the multimeter, we use as test object two LEDs, the first 3mm DIODE type and the second SMD LED.

Descripción de la imagen

Here are some pictures and the procedure with the multimeter to test the operation of the LEDS.

It is necessary to indicate that the negative node goes with the BLACK cable, while in positive with the RED cable, the same ones must be connected to the multimeter, verifying that the black cable is to the RIGHT and the black one to the LEFT side.

The result is that the LED type DIODE lights up without any problem, that is to say that our test 1 with the multimeter is CORRECT.

We tested the other LED ignition test, this time with the SMD, here is the result:

Everything is working properly! Two successful tests.

SMD RESISTORS

We test resistors, 499ohm and 1000ohm, for this case we set the multimeter by positioning the dial upwards pointing to the Ω symbol.

Consider that not always the resistance or its value will be represented on the multimeter, often it is important that it is one or two decimal places less.

Ω = Ohms

kΩ = Kilohms

MΩ = Mega ohms

CONTINUITY

About continuity, from here we test with our Quentorres, fixing a point of the milled copper channel and another on the soldering of one of the pins of our board, the multimeter should make a sound when finding continuity, I leave evidence of the case

All correct with the tracks and their continuity, the plate does not short-circuit.

Testing the Logic Analyzer

A logic analyzer is an instrument to capture, display and measure multiple electronic signals simultaneously in a digital circuit, they are able to show the relationship and timing between many different signals in a digital system, it is the best tool for debugging digital circuits and digital communication systems.

Descripción de la imagen

We did not have much experience using a Logic Analyzer, we understood that it is an electronic signal measurement device, I share this tutorial to understand it quickly:

Tutorial!

With this information we have more clear what to measure, here are some parts of the Analyzer that is important to show to know the operation system:

Descripción de la imagen

Knowing this, we can start connecting the ports with a jumper cable, we connect the GND (ground) of the Analyzer to the output of the corresponding Quentorres and the cable for CH1 (channel 1) with the free port to touch parts of our board, the intention is to verify the voltage and P_PWSum values with reference to the performance of the Xiao and its connection on the board.

Descripción de la imagen

Testing the Oscilloscope

It is an electronic measuring instrument for displaying electrical signals in a given time. These signals are expressed in graphs in which an electron beam passes through a coordinate axis on a phosphor screen.

Descripción de la imagen

From here, we decide:

Place the diode to find the voltage of a channel, we set the voltage sending signal to 0.5V for channel 1, so that, using the swords, attached to the jumper applied on the XIAO and connected on channel 1 to the Osilloscope, we discover that there is conunication between these components.

We had the result of a square wave, which means that it is a regular interval voltage, such as signals from TV, radio and other devices that use timing signals, this is due to the use of the LED blink programmed on the board.

Descripción de la imagen

Testing the DC Voltage Supply

The tests with the DC Voltage Supply, we did them connecting the source with the two hook pins, in the photo is identified which are, so, using a DC motor with the soldering of their sources to two jumper, we connect the hook pins with the corresponding (black wire is ground, red wire is voltage) we started first with the ignition and were manipulating the voltage rise knob little by little.

Descripción de la imagen

After identifying the basic operating buttons of the power supply, we proceed to the soldering of the DC motor with the male jumper wires.

Descripción de la imagen

After the soldering is done, we connect the male side with the source clamp wires.

Descripción de la imagen

From here we are ready to see the result.

Individual Assignment

What am I going to do?

First of all, the idea of this work is to create a board with an output for display, a screen that sends me messages every so often.

So, I defined the shape, in this case I want it to be a fruit, for summer season in my country is usually consumed "mango", it is a very sweet fruit and quite rich in flavor, for this reason, the shape I wanted to be based on it.

Also as a curious feature, it is important to consume fruits to improve our health, because of the high percentage of water that our body needs to be hydrated, I particularly like the mango as a seasonal fruit, it is here where I will be able to find the best fruits for our health.

Descripción de la imagen

This is where the idea of taking advantage of this Assignment arises! I want to make a didactic timer that helps children remember when to eat fruit, so that it will emit warning messages and make a funny face or two, I haven't thought about including sound yet, but it's a possibility, here is my diagram.

Descripción de la imagen

Start of activities

To begin the activities, I propose the following:

1. The design of the board should contain references of the Quentorres + Fab Xiao, with the intention of basing the brain on the Xiao RP2040 and the components to use a display of the Fab Xiao, in this way I get the result I want.

2. Component search and active training conducted by our local instructors, beginning modeling in KiCAD and simulation.

3. Milling the plate and starting the weld.

4. First Tests of Board Communication + Xiao Add the display output and start of the cover design of the board.

1. PCB design, ready!

We had a first approach to the KidCAD program to begin taking the first steps, I will detail how I started.

These are the steps to follow to be able to download the FAB lib and obtain the components, I leave the FILES here

I describe here the steps to download the Fab Academy library.

  1. Clone or download the repository. Rename the directory to fab.
  2. Store it in a safe place such as ~/kicad/libraries.
  3. Run KiCad or open a KiCad .pro file.
  4. Go to "Preferences / Manage Symbol Libraries" and add fab.kicad_sym as symbol library.
  5. Go to "Preferences / Manage Footprint Libraries" and add fab.pretty as footprint library.
  6. Go to "Preferences / Configure Paths" and add a variable named FAB that points to the installation directory of the fab library, such as ~/kicad/libraries/fab or C:/kicad/libraries/fab. This will enable the custom 3D shapes to be found. The 3D shapes project has just started and most of them still have to be populated.

BOM and Schematic for Man-go!

Imagen 1 Imagen 2

Man-go!

Where to buy? Amount
Seeed Studio XIAO RP2040 Seeed Studio 1
1kΩ resistor Digikey 4
LED Digikey 4
Male 4 row vertical header Digikey 1

Prior to the design of the board, we had a Zoom training with one of our local instructors, who was able to teach us step by step how to make the electronic board with components from our stock, so it was going to be much easier to develop it, and also learning more about electronics is a lot of fun for me.

Descripción de la imagen

I leave you with some considerations and recommendations when starting work in KiCAD

Component loading: Take into account the download and installation of libraries, I leave you the link here

Descripción de la imagen

Here in this graphic you can glimpse the detail of the composition of the parts, so that for the use of the pins for the LCD, a 1x04 SMD Header Connector is added, which connects the SDA and SCL pins of the Xiao RP2040, plus GND + 3V3 according to the behavior of the Output, it should be added that for the operation of LCD a 1k ohm resistor is added.

For the case of the Leds, 4 are used, two on each side, the intention is to create a spiral ignition, while the time is programmed for the LCD on, each LED has its 1k ohm resistor.

Descripción de la imagen

Track width: Consider 0.4mm for single conductor tracks and 0.8mm for GND, 3VC, 5V.

Descripción de la imagen

Layer order: Verify that the active layers are "F.Cu." and "Edge Cut", that is to say "F. Cu." corresponds to the tracks and Edge to the cut lines, this is important when exporting the layout for cutting.

Descripción de la imagen

About the contour: Always use a .DXF file, make sure that the units are in millimeters and with the scale 1.000.

Descripción de la imagen

ALL THE FILES HERE

MAN-GO! KICAD

MAN-GO! ILLUSTRATOR

MAN-GO! PNG

MAN-GO! SML CUT

2. Soldering and programming tests with Output

Plate milling

Having the traces and the cut for milling, the process was carried out through MODS, and it lasted approximately 40 minutes in the MonoFab SRM-20 in the two processes.

Descripción de la imagen

MAN-GO! SML CUT

This's the result:

Descripción de la imagen

Component soldering

To make the soldering of the board, I used the soldering iron and tin, little by little I was accommodating the components, I recommend the following:

- Start with the smallest, as the resistors, in this case I used the 1K ohm, attached to these are the SMD LED's, the channel C negative side (green color) of the LED's goes directly or pointing towards the channel of the resistors.

Descripción de la imagen

- I used the soldering iron at 310°C and Flux on the board and the component.

Descripción de la imagen

Blink

I connected the Xiao to my board, previously I had already loaded the configuration and preferences through the URL's, so in this step, I just asked Chat GPT for the code to turn on the LED's through this prompt:

"Hi can you give me the code for ARDUINO IDE to do the blink of pin 26,29,1,2 of the XIAO RP2040".

            
                // Definir los pines a utilizar
                #define LED_PIN_1 26
                #define LED_PIN_2 29
                #define LED_PIN_3 1
                #define LED_PIN_4 2
                
                void setup() {
                  // Inicializar los pines como salidas
                  pinMode(LED_PIN_1, OUTPUT);
                  pinMode(LED_PIN_2, OUTPUT);
                  pinMode(LED_PIN_3, OUTPUT);
                  pinMode(LED_PIN_4, OUTPUT);
                }
                
                void loop() {
                  // Encender el LED en el pin 1
                  digitalWrite(LED_PIN_1, HIGH);
                  // Esperar 500 milisegundos
                  delay(500);
                  // Apagar el LED en el pin 1
                  digitalWrite(LED_PIN_1, LOW);
                  
                  // Encender el LED en el pin 2
                  digitalWrite(LED_PIN_2, HIGH);
                  // Esperar 500 milisegundos
                  delay(500);
                  // Apagar el LED en el pin 2
                  digitalWrite(LED_PIN_2, LOW);
                  
                  // Encender el LED en el pin 3
                  digitalWrite(LED_PIN_3, HIGH);
                  // Esperar 500 milisegundos
                  delay(500);
                  // Apagar el LED en el pin 3
                  digitalWrite(LED_PIN_3, LOW);
                  
                  // Encender el LED en el pin 4
                  digitalWrite(LED_PIN_4, HIGH);
                  // Esperar 500 milisegundos
                  delay(500);
                  // Apagar el LED en el pin 4
                  digitalWrite(LED_PIN_4, LOW);
                }
                
            
          

BLINK MANGO.INO

It worked, here are the results, it should be noted that the process of opening a new Sketch in ARDUINO IDE is quite easy.

Descripción de la imagen

All is working!

Display

Here, I have done a lot of testing, first starting by asking Chat GPT which pins I should consider to design my board taking into account the location of this display:

"Hi, can you tell me which pins of the XIAO RP2040 I should connect to run a Display that has the pins GND, VCC, SCL, SDA, do you indicate me if I should use resistors?"

Answer:

GND (Ground): connect it to the GND (ground) pin of the XIAO RP2040 board.

VCC (Power): Connect it to the 3.3V power pin of the XIAO RP2040 board. This pin will provide the power needed to operate the display.

SCL (Serial Clock Line): This is the clock pin for I2C communication. Connect it to the SCL pin (pin 5) on the XIAO RP2040 board.

SDA (Serial Data Line): This is the data pin for I2C communication. Connect it to the SDA pin (pin 4) on the XIAO RP2040 board.

In the library you use to control the display via I2C, there will likely be a function to enable the RP2040's internal pull-up resistors. For example, in the Arduino Wire library, you can call Wire.begin() to initialize the I2C communication, and this will automatically enable the RP2040's internal pull-up resistors.

Descripción de la imagen

Despite the successful connections from the design of my board, the correct soldering and connection (attached evidence) the display did not turn on (attached code).

Descripción de la imagen

Thanks to this answer I was able to start checking the position of my paths again but I still did not identify the problem, according to several sources they indicate that these screens need 5V, but it is not strictly necessary, very strange!

I leave the code here

            
                #include Wire.h
                #include Adafruit_GFX.h.
                #include Adafruit_SSD1306.h
                    
                #define SCREEN_WIDTH 128 // Ancho del display OLED en píxeles
                #define SCREEN_HEIGHT 64 // Alto del display OLED en píxeles
                    
                // Dirección I2C del display OLED
                #define OLED_ADDR   0x3C
                    
                // Declaramos el objeto de la clase Adafruit_SSD1306
                Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
                    
                void setup() {
                    // Inicializamos la comunicación I2C
                     Wire.begin();
                    
                    // Inicializamos el display OLED con la dirección I2C y el tamaño del display
                      if(!display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) {
                        Serial.println(F("No se pudo inicializar el display OLED con la dirección I2C"));
                        while (true);
                      }
                    
                      // Limpiamos el buffer del display
                      display.clearDisplay();
                    
                      // Escribimos un texto en el display
                      display.setTextSize(1);      // Tamaño del texto
                      display.setTextColor(SSD1306_WHITE); // Color del texto
                      display.setCursor(0,0);      // Posición del cursor
                      display.println("¡Hola, Mundo!"); // Texto a mostrar
                      display.display(); // Mostramos el texto en el display
                    }
                    
                    void loop() {
                      // Nada más se ejecutará en el loop
                    }
                    
                
            
          

LCD MANGO.INO

Does not turn on!

What is the problem? I'll keep finding out...

3. Cover my board + design

To start with the modeling, the shape of the Man-go! and modeled from Sketchup, it is proposed to create a container with an opening to connect the Xiao + the hole to receive the Display.

Descripción de la imagen

SKETCHUP FILE

Passing it to the Prusa Slicer, to laminate and determine the printing time, 1.75mm copper-colored PLA with a temperature of 195 °C is used.

STL FILE

Descripción de la imagen

4. Operation!

The 3D printing went without problems, I attached evidence, the issue is that I cannot program the display, because even after 5 tests, it does not turn on.

I will continue the search!

Update!

After doing the tests and verifying that my LCD device is working correctly, I leave you the ASSIGNMENT 9 where I make another board to turn on a LCD, from here I can see my mistake, I explain:

Assigment Week 09

My GND connections: From here we can see that the GND branch extends to feed the resistor that uses the LED, but what I did not contemplate is that the GND connection for my LCD should go directly to GND, as if it happens with the other board designed, for this reason, when I make the branch and join this, is that I experience the non-functioning of my OUTPUT.

Burnt route: The LCD output connection (GND) is burnt, probably when using the soldering iron it has lifted the copper, so it has no continuity.

Right Angles: The design of my routes perceive right angles, it is not recommended for the circuits of a board.

All these errors I improve them in my board of the following week, so that I solve to detail these errors with the purpose of not to return to commit them in another opportunity.

Descripción de la imagen