1 of 50

Electronics

2 of 50

3 of 50

4 of 50

The next few weeks have a simple task!

  1. Learn (or recall) basic electrical engineering
  2. Use it to design a custom circuit board in a new software program (EDA)
  3. Mill/lase it and solder on all the parts properly
  4. Program your board to do something

5 of 50

But where do we start?

  • Theory?
  • Practice?
  • Components?
  • Ideal models?
  • Hardware or software?
  • Can we even separate them?

6 of 50

In the spirit of this course let’s try looking at this through a lens that I’m going to dub “everything everywhere all at once.” We’ll focus on hardware and dip into theory as the components require it.

​

“the limits of my language mean the limits of my world” - Ludwig Wittgenstein

7 of 50

Parallels amongst other fields

​

8 of 50

What you’re making this week

9 of 50

10 of 50

11 of 50

Micro USB connector

Provides 5V and ground connections

Data transfer for programming and debugging

​

12 of 50

3.3 Volt regulator

Takes 5V in and turns it to 3.3V which our microcontroller needs

​

13 of 50

Capacitors store charge and reduce ripples

​

why?

14 of 50

variance

average

No Load

No Bypass

15 of 50

No Load

0.1uF Bypass

16 of 50

With Load

No Bypass

17 of 50

With Load

0.1uF Bypass

18 of 50

With Load

0.1 and 1uF Bypass

19 of 50

With Load

0.1, 1, and 10uF Bypass

20 of 50

Tl;dr bypass capacitors are important. Use them.

21 of 50

Resistors* reduce the flow of current

Light Emitting Diodes produce light when current flows through them

​

22 of 50

Diodes:

23 of 50

Diodes:

Light emitting diode (LED)

24 of 50

Diodes:

Current flows in one direction only*

Require a resistor to limit the current

No current - nothing happens

A little current - nice happy lights

Lots of current - fire, burnt parts, sadness

​

​

​

Img: https://cdn.sparkfun.com/assets/4/4/a/5/b/5175b518ce395f2d49000000.png

Very sensitive here

25 of 50

26 of 50

Current won’t flow* until voltage exceeds the forward voltage drop (Vfd) of the LED

Knowing max current of the LED lets us set an appropriate current limiting resistor

​

0.025A=(3.3-2)V/R

R=1.3/0.025=52 Ohms

​

​

I=(3.3-Vfd)/R

27 of 50

Resistors also define states

Usually coded so you can see the value

51*10^2 = 5.1K Ohms

​

​

28 of 50

What is the voltage of a wire that is just hanging out in space?

29 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

​

​

SW2

​

​

SW3

​

​

30 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

​

SW2

​

​

SW3

​

​

31 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

​

​

SW3

​

​

32 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

​

SW3

​

​

33 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

3.3/Gnd/

SW3

​

​

34 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

3.3/Gnd/

SW3

3.3V

​

35 of 50

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

3.3/Gnd/

SW3

3.3V

Gnd (0 Volts)

With a power dissipation of only 1mW

36 of 50

10 pin header

Just some convenient pieces of metal to plug wires into so our board can connect to the outside world

​

​

37 of 50

ATSAMD21E microcontroller

It does almost anything

​

​

38 of 50

39 of 50

Buttons?

OLED screen

40 of 50

How is that a button?

Capacitive sensing/step response is a bit of magic that can be employed in many different scenarios

​

41 of 50

Either measure rise time

Or wait a fixed time and measure voltage

42 of 50

More components not used in this design

  • Mosfets
    • Control large power devices with small power signals
    • Incredibly useful
  • Inductors
  • Opamps
    • Do math on signals
    • Multiplication, division, integration, addition, subtraction, etc
  • Relays

43 of 50

Mosfets

  • Come in 2 flavors, N and P channel
    • N channel conduct current when the Gate is high and go below the load
    • P channel conducts current when the Gate is low and go above the load (less useful)
  • Allow microcontrollers to enable/disable very large loads - normally can only handle ~20mA ie 1 or 2 bright LEDs per pin.
  • Remember to include the pull-up/down resistor, current limiting resistor, and maybe a flyback diode!

44 of 50

Keeps it off!

Limits inrush

Signal

here

Flyback diode

Careful!

pull-up/down resistors keep the device off at rest.

Input resistors reduce inrush current.�Voltage spikes arise from inductive loads

V=L*dI/dT

45 of 50

Seeed XIAO ("小": means "small")

RP2040

ESP32C3

46 of 50

Seeed XIAO ("小": means "small")

47 of 50

Simulation in Wokwi vs Falstad

Pros

  • Easy
  • Intuitive
  • Pretty
  • Large libraries
  • Has Wifi implemented*

Cons

  • No notion of voltage, current, power, etc. can lead to blown components
  • Bigger/private projects want the paid tier

Pros

  • Actually powerful
  • Graphs of voltage current power etc

​

​

Cons

  • Has that opensource look (like my slides)
  • Less widely used
  • No Wifi

Wokwi Falstad

48 of 50

Digital Simulation in Wokwi/Falstad

49 of 50

Link1-Why is this a lie?

Link2

Link3

Link4

​

50 of 50

Options to assemble this week

QPad Xiao

​

​

QPad w/Micro

​

​

​

Qpad

w/USBC

Easy

Harder

Super challenge

Helpful programmer