1 of 49

Electronics

2 of 49

3 of 49

4 of 49

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 49

But where do we start?

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

6 of 49

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 49

Parallels amongst other fields

8 of 49

What you’re making this week

9 of 49

10 of 49

11 of 49

Micro USB connector

Provides 5V and ground connections

Data transfer for programming and debugging

12 of 49

3.3 Volt regulator

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

13 of 49

Capacitors store charge and reduce ripples

why?

14 of 49

variance

average

No Load

No Bypass

15 of 49

No Load

0.1uF Bypass

16 of 49

With Load

No Bypass

17 of 49

With Load

0.1uF Bypass

18 of 49

With Load

0.1 and 1uF Bypass

19 of 49

With Load

0.1, 1, and 10uF Bypass

20 of 49

Resistors* reduce the flow of current

Light Emitting Diodes produce light when current flows through them

21 of 49

Diodes:

22 of 49

Diodes:

Light emitting diode (LED)

23 of 49

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

24 of 49

25 of 49

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

26 of 49

Resistors also define states

Usually coded so you can see the value

51*10^2 = 5.1K Ohms

27 of 49

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

28 of 49

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

SW2

SW3

29 of 49

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

SW2

SW3

30 of 49

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

SW3

31 of 49

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

SW3

32 of 49

Scenario

Voltage at input when not pushed

Voltage at input when pushed

SW1

???

Gnd (0 Volts)

SW2

3.3V

3.3/Gnd/

SW3

33 of 49

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

34 of 49

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

35 of 49

10 pin header

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

36 of 49

ATSAMD21E microcontroller

It does almost anything

37 of 49

38 of 49

Buttons?

OLED screen

39 of 49

How is that a button?

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

40 of 49

Either measure rise time

Or wait a fixed time and measure voltage

41 of 49

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

42 of 49

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!

43 of 49

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

44 of 49

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

RP2040

ESP32C3

45 of 49

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

46 of 49

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

47 of 49

Digital Simulation in Wokwi/Falstad

48 of 49

49 of 49

Options to assemble this week

QPad Xiao

QPad w/Micro

Qpad

w/USBC

Easy

Harder

Super challenge

Helpful programmer