6. Electronics design

I used to think this week would be tough, but it turns out not that difficult to draw a simple dev-board with some inputs and outputs after picking up my high school physics memories and learning EAGLE.

1.1 Assignments of the Week

  1. 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
  2. Individual assignments:
    • Design a development board to interact and communicate with an embedded microcontroller

1.2 Multimeter and Oscilloscope

Our test equipment is a multimeter and oscilloscope in one device.

1. CH1, CH2 measured signal input connector.
2. Signal generator output connector (S type only).
3. Display area.
4. Press F1~F4 keys, multi-function keys, in each menu mode, press the corresponding key to select the corresponding menu item.
5. Press the HOR key, you can change the horizontal time base setting by pressing the key, and observe the resulting state information changes, and you can also find that the horizontal time base display corresponding to the status bar has changed accordingly; by pressing the key, you can adjust the signal in the waveform The horizontal displacement of the window.
6. Press the return key to return to the previous menu. When the menu is at the first level, press the return key again to close the menu.
7. Measurement menu key (oscilloscope) or range key (multimeter).
8. Zoom or move keys
9. Autoset button (oscilloscope) or autorange button (multimeter).
10. Stop/run button (oscilloscope) or hold button (multimeter) or output/close signal button (signal generator - S type only).
11. Multimeter input.
12. Trigger the menu key (oscilloscope) or the relative value key (multimeter).
13. Power switch button.
14. Enter the Save Settings button.
15. Enter the system setting button.
16. Button to switch the working status of oscilloscope and multimeter.
17. CH1/CH2 channel switching button.

The Test :

We connected a potentiometer to the A0 pin of Arduino, a Micro Servo to the D9 pin, and the D5 pin is used to output the mapped analog signal. When we turn the potentiometer, we can observe the rotation of the servo, and detect the corresponding waveform, voltage, current and resistance through the D5 pin.

Here is the code. I made some modifications on dfrobot's source code.

          #include 
          Servo myservo;

          int potpin = 0;
          int val_in;
          int val_servo;
          int val_out;
          int pin=5;

          void setup() {
                myservo.attach(9);
                pinMode(pin,OUTPUT);
          }

          void loop() {
                 val_in = analogRead(potpin);
                 val_servo = map(val_in, 0, 1023, 0, 179);
                 val_out=map(val_in,0,1023,0,255);
                 analogWrite(pin,val_out);
                 myservo.write(val_servo);
                 delay(15);
          }
        

1) Oscilloscope

Press the "Mode" to switch to the oscilloscope function. Connect positive to D5 pin, negative to GND. Then turn the potentiometer, you'll see the square wave on the screen.

A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency between fixed minimum and maximum values, with the same duration at minimum and maximum. In an ideal square wave, the transitions between minimum and maximum are instantaneous.
The square wave is a special case of a pulse wave which allows arbitrary durations at minimum and maximum amplitudes. The ratio of the high period to the total period of a pulse wave is called the duty cycle.
Square waves are often encountered in electronics and signal processing, particularly digital electronics and digital signal processing. Its stochastic counterpart is a two-state trajectory.

---- from Wikipedia

2) Multimeter

Press the "Mode" to switch to the multimeter function. Connect positive to D5 pin, negative to GND. Press F1~F4 to select the corresponding function.

1.3 Electronic Components

1.4 PCB Design

1) What is PCB?

A printed circuit board (PCB; also printed wiring board or PWB) is a medium used in electrical and electronic engineering to connect electronic components to one another in a controlled manner. PCBs require additional design effort to lay out the circuit, but manufacturing and assembly can be automated. Electronic design automation software is available to do much of the work of layout.

A basic PCB consists of a flat sheet of insulating material and a layer of copper foil, laminated to the substrate. Chemical etching divides the copper into separate conducting lines called tracks or circuit traces, pads for connections, vias to pass connections between layers of copper, and features such as solid conductive areas for electromagnetic shielding or other purposes. The tracks function as wires fixed in place, and are insulated from each other by air and the board substrate material. The surface of a PCB may have a coating that protects the copper from corrosion and reduces the chances of solder shorts between traces or undesired electrical contact with stray bare wires. For its function in helping to prevent solder shorts, the coating is called solder resist or solder mask.

---- from Wikipedia

2) Software: EAGLE

EAGLE is electronic design automation (EDA) software that lets printed circuit board (PCB) designers seamlessly connect schematic diagrams, component placement, PCB routing, and comprehensive library content.

DOWNLOAD EAGLE

3) Schematic and Board Layout

4) Design Steps

5) Pads and SMD

6) Final Work

BOM

PartValueDevicePackageDescription
PINS1PINHD-1X7/901X07/90PIN HEADER
PINS2PINHD-1X4/901X04/90PIN HEADER
R1499 ohmRES-US1206FABR1206FABResistor (US Symbol)
R21k ohmRES-US1206FABR1206FABResistor (US Symbol)
S16MM_SWITCH6MM_SWITCH6MM_SWITCHOMRON SWITCH
SUPPLYPINHD-2X3-SMD2X03SMDPIN HEADER
U$1LEDFAB1206LEDFAB1206LED1206FABLED
XIAO10201038814PIN_600MIL-SMD10201038814PIN_600MIL-SMD14PIN_SMD-600MILCheck availability

Fab_Xiao PCB Download Here