Week08. Electronic Design

Group assignment:

   1. See the test equipment in your lab to observe the operation of a microcontroller circuit board    2. Send a PCB out to a board house

  Individual assignment:

  Use an EDA tool to design a development board to interact and communicate with
  an embedded microcontroller, produce it, and test it

Research

PCB Design Softwares

1. Altium Designer:

   Altium Designer is a comprehensive PCB design software widely used in the electronics industry.
   It offers features like multi-board design, 3D PCB visualization, advanced routing capabilities, and integration with ECAD-MCAD collaboration.
   Altium Designer is known for its powerful features and is often used for complex and high-density PCB designs.

2. KiCad:

  KiCad is an open-source and cross-platform PCB design software.
   It includes tools for schematic capture, PCB layout, 3D visualization, and design rule checking.
   KiCad is a popular choice for hobbyists, small businesses, and educational institutions due to its free availability and growing community support.

3. Eagle (Autodesk Eagle):

   Eagle (Autodesk Eagle) is a PCB design software known for its user-friendly interface and versatility.
   It offers features like schematic capture, PCB layout, and integrated component libraries.
   Autodesk Eagle has both free and paid versions, making it accessible to a wide range of users, from hobbyists to professional designers.

4. CircuitMaker:

   CircuitMaker is a free, cloud-based PCB design software developed by Altium.
   It provides a modern and intuitive user interface, allowing designers to create schematics, design PCBs, and collaborate with others in real-time.
   CircuitMaker is a good choice for hobbyists, students, and small teams who want an accessible and feature-rich PCB design tool.

Group Assignment My Part

1. Objective:

The objective of this exercise was to observe the operation of a microcontroller circuit board using standard test equipment like a multimeter and oscilloscope.

2. Equipment Used:

Digital Multimeter Digital Oscilloscope

Multimeter Measurements:

Description of image A multimeter is a highly versatile instrument employed to measure diverse electrical properties. Here are the common modes of a multimeter and their respective functions: Voltage Measurement (V) DC Voltage (V— or VDC): It is used for measuring the direct current (DC) voltage. This mode is applied to check batteries, power supplies, and any circuits of DC type. AC Voltage (V~ or VAC): It is used for measuring the alternating current (AC) voltage. This mode is applied to check household outlets, AC power supplies, and other circuits of AC type. Current Measurement (A) DC Current (A— or ADC): It is used for measuring the direct current (DC) flowing through a circuit. It is employed for checking the current in DC circuits. AC Current (A~ or AAC): It is used for measuring the alternating current (AC) flowing through a circuit. It is employed for checking the current in AC circuits. Resistance Measurement (Ω) Resistance (Ω): It is used for measuring the resistance of a component or circuit in ohms. It is useful for checking resistors, the continuity of wires, and the condition of switches. Measured the power supply voltage to the microcontroller board, which was found to be 5.1V, within the acceptable range. Description of image Measured the resistance of various components on the board to ensure there were no shorts or open circuits. Description of image

Oscilloscope Observations:

Function generator and Oscilloscope in our lab Description of image

1. The oscilloscope we use is OWON EDS102CV

Description of image

2. I read the instruction manual of this OWON EDS102CV

2.1 Font Panel is as below:


Description of image 1. Oscilloscope switch 2. Display area 3. Keys and knob control area 4. Probe compensation: 5V/1KHz signal output 5. External trigger input 6. Signal input port 7. Menu close key

2.2 Key Control Area:


Description of image 1. Horizontal menu option setting area, including 5 keys: H1 - H5 2. Vertical menu option setting area, including 5 keys: F1 - F5 3. Menu close key: Close the menu displayed on the current screen 4. Universal knob: When the ○M mark appears in the on-screen menu, it indicates that the universal knob can be rotated to select the current menu or set the value; Pressing the knob can close the menu on the left side of the screen. 5. Function key area: A total of 12 keys. 6. Vertical control area: Includes three keys and four knobs. In the oscilloscope state, the "CH1 Menu" and "CH2 Menu" keys correspond to the setting menus of Channel 1 and Channel 2 respectively. The "Waveform Calculation" key corresponds to the waveform calculation menu. The operation menu includes operations such as addition, subtraction, multiplication, division, and FFT. The two "Vertical Position" knobs control the vertical displacement of Channel 1 and Channel 2 respectively. The two "Volts/Div" knobs control the voltage range of Channel 1 and Channel 2 respectively. 7. Horizontal control area: Includes one key and two knobs. In the oscilloscope state, the "Horizontal Menu" key corresponds to the horizontal system setting menu. The "Horizontal Position" knob controls the horizontal position of the trigger, and the "Seconds/Div" knob controls the time base range.

2.3 Preliminary understanding of the oscilloscope user interface


Description of image 1. Waveform display area. 2. Trigger status indication, with the following information types:     Auto: The oscilloscope is in automatic mode and is collecting waveforms in the non-triggered state.     Trig: The oscilloscope has detected a trigger and is collecting post-trigger information.     Ready: All pre-trigger data has been acquired and the oscilloscope is ready to accept triggers.     Scan: The oscilloscope continuously collects and displays waveform data in scan mode.     Stop: The oscilloscope has stopped collecting waveform data. 3. The purple pointer indicates the trigger level position, and the horizontal position control knob can adjust its position.
4. The pointer indicates the trigger position in the memory. 5. Two yellow dotted lines indicate the size of the window expansion window. 6. Indicates the value of the current trigger level position. Displays the position of the current waveform window in the memory.
7. Displays the time set by the system (please refer to Configuration on P 59). 8. Indicates that a USB drive is currently inserted into the oscilloscope. 9. Waveform of Channel 1. 10. The purple pointer indicates the trigger level position of Channel 1. 11. Two purple dotted lines indicate the position of cursor measurement. 12. Waveform of Channel 2. 13. Trigger frequency shows the frequency of the Channel 1 signal. 14. Indicates the operation options of the current function menu. Different function menus have different displays. 15. ① The icon indicates the trigger type selected for the corresponding channel:.        Rising edge trigger.        Falling edge trigger.        Video line sync trigger.        pVideo field sync trigger. ② The reading indicates the value of the trigger level of the corresponding channel 16. The reading indicates the set value of the time base for window expansion when the window is set. 17. The reading indicates the set value of the main time base. 18. Current sampling rate and memory depth. 19. Displays the measurement items and measurement values of the corresponding channels. Among them, F indicates frequency, T indicates period, V indicates average value, Vp indicates peak-to-peak value, Vk indicates root mean square value, Ma indicates maximum value, Mi indicates minimum value, Vt indicates top value, Vb indicates bottom value, Va indicates amplitude, Os indicates overshoot, Ps indicates undershoot, RT indicates rise time, FT indicates fall time, PW indicates positive pulse width, NW indicates negative pulse width, +D indicates positive duty cycle, -D indicates negative duty cycle, PD indicates delay A->B, ND indicates delay A->B, TR indicates period root mean square, CR indicates cursor root mean square, WP indicates working cycle, RP indicates phase. 20. ① The readings respectively indicate the voltage range and zero point position of the corresponding channel.. ② The icon indicates the coupling mode of the channel:. "--" indicates DC coupling. "~" indicates AC coupling. "" indicates ground coupling. The reading indicates 21. Cursor measurement window, showing the absolute values of the two cursors and the readings of the two cursors. 22. The yellow pointer indicates the ground reference point (zero point position) of the waveform displayed by the CH2 channel. If there is no pointer indicating the channel, it means that the channel is not turned on. 23. The red pointer indicates the ground reference point (zero point position) of the waveform displayed by the CH1 channel. If there is no pointer indicating the channel, it means that the channel is not turned on.

3. Conduct a functional check

1. Switch on the power of the instrument and press the oscilloscope power key on the top of the main unit. A slight clicking sound will be heard from the relay inside. The instrument performs all self-check items and the startup screen appears. Press the Utility (function key), then press the H1 menu selection key to display the function menu. Rotate the universal knob to select "Calibration" and press the H3 key to select the manufacturer settings. The default attenuation coefficient setting value of the probe menu is 10X.
2. Set the switch on the oscilloscope probe to 10X and connect the oscilloscope probe to the CH1 channel. Align the slot on the probe with the plug on the coaxial cable connector (BNC) of the CH1 connector and insert it. Then rotate it to the right and tighten the probe. Connect the end of the probe and the grounding clip to the connector of the probe compensator.
3. Press the "Auto Setup" key. Within a few seconds, a square wave display (1KHz frequency, 5V) can be seen. Description of image It seems to be overcompensated, but we haven't found the small pin for adjusting the compensation. 4. We generated some wave function from the generator and observed it on Oscilloscope Description of image Description of image Description of image

2.4 Observe the operation of a microcontroller circuit board

I used another Oscilloscope of the same brand to test the votage of the microcontroller

Step1. Conduct a functional check

Following the same steps above and this one does not have any overcompensate problem. Description of image

Step1. Press the trigger level button on the panel, and then press CH1 to adjust the trigger level.

Description of image

Step2. Adjust all the settings below:

  - Adjust the coupling mode to direct current Description of image   - Reverse the adjustment to off Description of image   - Adjust the probe magnification to X1 Description of image

Step3. Clamp the ground wire to the ground wire of the nRF52840. Hook the signal wire to the pinheader port which is connected to nRF52840's VCC port.

Description of image

Step4. The votage signal is okay!Because one grid is 2V and the voltage line is at two and half grids position above the level line, the voltage is a constant 5V.

Description of image

IndividualAssignment_My PCB

My PCB is going to use the nRF52840 chip with an IMU embedded in it, so the extra components I will use are a LED strip and a sound module in potential. It is also always helpful to add a switch and LED on your PCB for basic testing.

It is better to decide the pin connections before design of PCB schematic.

Description of image Description of image

PCB Design Procedures

The basic steps of producing a PCB are: 1. Create Schematic 2. Create Board Design 3. Generate Gerber 4. Convert Gerber to PNG 5. Convert PNG to GCode 6. CNC Mill the board

Step1 Read the datasheet of the components And make a circuit Design

  For my PCB, I will include the nRF52840 chip, a LED strip, and a Grove - MP3 Module V4.0 as peripherals, as well as a switch and an LED for basic testing.

Description of image

Step2 Use KiCad to Create Schematic

First, create a project by clicking File->CreateNewProject

Description of image

Second, click on the "***.sch" file to start editing your schematic

Description of image

Before adding electronic components to your schematic, the libraries of the components from fabacademy needs to be installed first. You can use following link to download the libaries and follow the steps to add the libaries into your KiCad.

Link to the fabacademy libraries!

Description of image Description of image Description of image Description of image Description of image Description of image Description of image

Now we can begin the design the schematic: First click "Add Symbol" button on the right side panel.

Description of image

When selecting the compontent, you can search for the required components in the library, and once you click on the component's name, you can see both the schematic and PCB view of the componentsent needed in the libary and you can see both the schematic and PCB view of your components once click on the component's name.

Description of image Description of image

After the main component is placed on the schematic, we can continue to add more electronic components based on your design. Since my design will have the LED strip and a grove mp3 module potentially, so I need a group of three pin_header and a group of four pin_header. There are three different types of 1*3 pin_header, and you can tell the differences in the PCB view of the component: Take Conn_PinHeader_1x04_P2.54mm_Vertical_THT_D1mm as an example: - "Conn_PinHeader" indicates that this is a connector with a pin header. - "1x04" indicates that the pin header has 1 row with 4 pins. - "P2.54mm" means the pin pitch (spacing) is 2.54mm. - "Vertical" means the pin header is oriented vertically. - "THT" stands for Through-Hole Technology, meaning the pins are meant to be inserted through holes in a printed circuit board. - "D1mm" specifies that the diameter of the pins is 1mm.

Description of image Description of image Description of image

For my case, my choice is the Conn_PinHeader_1x03_P2.54mm_Horizontal_SMD

Description of image

For the rest part, I just followed the pre-designed circuit design and drew lines connecting the components to the corresponding pins of the nRF52840.

Description of image

Step 3 Update PCB from Schematic and Finish PCB Layout: First, click on component panel and choose the compontent you will use

Description of image

When selecting the compontent, you can search for the required components in the library, and once you click on the component's name, you can see both the schematic and PCB view of the componentsent needed in the libary and you can see both the schematic and PCB view of your components once click on the component's name.

Description of image Description of image

After the main component is placed on the schematic, we can continue to add more electronic components based on your design.
Since my design will have the LED strip and a grove mp3 module potentially, so I need a group of three pin_header and a group of four pin_header.
There are three different types of 1*3 pin_header, and you can tell the differences in the PCB view of the component:
Take Conn_PinHeader_1x04_P2.54mm_Vertical_THT_D1mm as an example:
 - "Conn_PinHeader" indicates that this is a connector with a pin header.
 - "1x04" indicates that the pin header has 1 row with 4 pins.
 - "P2.54mm" means the pin pitch (spacing) is 2.54mm.
 - "Vertical" means the pin header is oriented vertically.
 - "THT" stands for Through-Hole Technology, meaning the pins are meant to be inserted through holes in a printed circuit board.
 - "D1mm" specifies that the diameter of the pins is 1mm.

Description of image Description of image Description of image

For my case, my choice is the Conn_PinHeader_1x03_P2.54mm_Horizontal_SMD

Description of image

For the rest part, I just followed the pre-designed circuit design and drew lines connecting the components to the corresponding pins of the nRF52840.

Description of image

Step 4 Update Schematic to PCB

First go tools then click "update Schematic to PCB"

Description of image

Then you will have the first view of your PCB

Description of image

Secondly, set up the PCB rules for your PCB traces

Description of image Description of image

Now we can start to rearrange the compontents, the most important thing is to try to replace all the thin blue lines with PCB traces, and make sure there are no crossed points. If you see blue lines crossed as shown below, one option is to rotate the component positions to remove the crossing points.

Description of image Description of image Description of image

If you see blue lines crossed as shown in the 'crossed lines type2' example, the rotation method won't work. Instead, you can route one line inside and the other outside to avoid the crossing.

Description of image Description of image

So basically, you will keep rotating the components and try all the angles to ensure there are no crossed lines. It is also recommended that you draw the circuit layout on paper first to get a better view. So after several rotations and changes to the positions of the components, the PCB is finally done without crossed lines. I even changed the connection pin of my switch from D2 to D8 to make the PCB layout easier.

Description of image

After this part is finished, the next step is the edge part of the PCB for the final outer layout of the whole PCB. For this step, switch to the edge layer first by selecting edge on the right side of the panel

Description of image Description of image

If the white line is too thin, double-click on the line and set the parameters about the thickness and position of the line. Additionally, the positions of the lines are a very important parameter, which can ensure the lines are properly connected to each other and save you trouble later.

Description of image

Finally, I finished my PCB as below:

Description of image

It is also fun to add some cute text on the board by using the text tool, but make sure it is placed on the F.Cu (Front Copper) layer.

Description of image Description of image

For the last step, run the inspection tool to fix all the errors until 0 errors are achieved.

Description of image

Step4 Generate Gerber files

Description of image Description of image

Step 5 Transfer Gerber file to PNG

Description of image Description of image

Select the topTrace and TopCut to generate corresponding png files.

Description of image Description of image

Step 6 Generate the G-code Files using ModsCE

First, open the link as below:

  • Link to ModsCE
  • It is needed to generate diffrent G-code files for trace cutting, outline cutting and drill.

    For the trace file, the parameter needed to be set are as below
    Always remember to set the dpi to 1000
    For the v-bit, you can also change the parameter based on the real v-bit you have choosen instead of
    using the default parameter to get a better PCB. The V-bit I have choosen 20 20

    Description of image

    You can also preview the trace of cutting

    Description of image

    For the outline file, the parameter needed to be set are as below:
    Always remember to set the dpi to 1000
    use the default parameter is fine.

    Description of image

    You can also preview the trace of cutting

    Description of image

    Step 7 Machine Milling

    For this part, all needed is follow the same steps as week04 and use the machine to mill the PCB

    Description of image Description of image

    Step 8 Solder the Board

    This time I soldered the board at the firewood welding place. The soldering tips there were much better, so my soldering was much better than before. Still, I checked with a multimeter for any short circuits or open circuits after soldering each component. Description of image Listed all the components and soldered on the board Description of image After all the soldering was completed, I used the multimeter again to recheck whether all the components were conducting normally and whether there were any short circuits or circuit breakers. Description of image Description of image

    Step 9 Arduino Programming to blink the LED

    Step1. Prepare nRF52840 sense board for Arduino Programming

    1. Intall the nRF52840 sense libary For Mac, navigate to Arduino IDE > Settings, and fill "Additional Boards Manager URLs" with the url below: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json Description of image Description of image 2. Intall the nRF52840 sense board manager Navigate to Tools > Board > Boards Manager..., type the keyword "nrf52" in the search box, select the latest version of the board you want, and install it. You can install both. Description of image Description of image 3. Select your board and port After installing the board package, navigate to Tools > Board and choose the board you want, continue to select "Seeed XIAO nRF52840 Sense". Now we have finished setting up the Seeed Studio XIAO nRF52840 (Sense) for Arduino IDE. Description of image Description of image Description of image

    Step2. Arduino Programming

    Based on my PCB design, the LED on the board was connected to D1 of the nRF52840, so I changed the port number in blink code to D1 Description of image The blink code is as below:
    
        #define LED_BUILTIN D1
        // the setup function runs once when you press reset or power the board
        void setup() {
          // initialize digital pin LED_BUILTIN as an output.
          pinMode(LED_BUILTIN, OUTPUT);
         }
    
        // the loop function runs over and over again forever
        void loop() {
          digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
          delay(1000);                      // wait for a second
          digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
          delay(1000);                      // wait for a second
        }   
    
      
    
    Upload the code to the nRF52840 and it blinks! Description of image

    Source Files

    Download All Source Files

      KK Rocks!