1 of 56

How To Make (Almost) Anything 2024

Recitation - Electronics

Anthony Pennes,Miana Smith, Fangzheng Liu

Slides adapted from prior HTMAA years

Slides available here: https://docs.google.com/presentation/d/1iu8pZZBEQhfTdsyvbonfDtuw-2OByA3X/edit?usp=sharing&ouid=111640701903637948112&rtpof=true&sd=true

2 of 56

3 of 56

4 of 56

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 it and solder on all the parts properly
  4. Program your board to do something

5 of 56

Ohm’s Law:

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

6 of 56

Voltage

Measures the difference in electrical potential between two points – often an input voltage (vcc) and ground (gnd)

7 of 56

Current

Measures the rate of flow of electrons in a circuit

8 of 56

Resistance

Measures how hard it is for electrons to move through a circuit

9 of 56

Triplets

  • Voltage: potential to do work (electron pressure)

  • Current: work (electron flow)

  • Resistance: … friction (electron resistance)

10 of 56

Ohm’s Law:

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

How much current goes through this resistor?

11 of 56

Ohm’s Law:

How much current goes through this resistor?

1A

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

12 of 56

Ohm’s Law:

How about these resistors?

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

13 of 56

Ohm’s Law:

How about these resistors?

1A

+3V

14 of 56

15 of 56

Ohm’s Law:

Voltage divider

Very useful for monitoring babttery voltage

16 of 56

17 of 56

Diodes:

Current flow in one direction only

Sort of… :p

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

18 of 56

Diodes:

19 of 56

Diodes:

Light emitting diode (LED)

20 of 56

Ohm’s Law:

What about this LED?

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

21 of 56

Ohm’s Law:

What about this LED?

0A … installed wrong way

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

22 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED?

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

23 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED?

∞A

Diodes have 0 resistance!

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

24 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED?

∞A

Diodes have 0 resistance!

Resistance (measured in ohms)

INFINITE CURRENT -> THE PART WILL MELT :(

25 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED with a current limiting resistor!

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

26 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED with a current limiting resistor!

(5-VFd)/5

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

27 of 56

28 of 56

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

I=(5-Vfd)/R

29 of 56

Ohm’s Law:

Ok so what about this (correct direction) LED with a current limiting resistor!

V = I ∗ R

Voltage (measure in volts)

I: Current (measure in amps)

Resistance (measured in ohms)

In practice, you will probably use in the range of 250-1000Ω resistors

(I basically always do either 499Ω or 1kΩ since they’re always in stock :p)

(5-VFd)/5

30 of 56

Switch

31 of 56

Switch - slide switch

A: OFF B: ON

SPDT:Single Pole, Double Throw

32 of 56

Switch- tactile switch

33 of 56

Mosfets

  • At a base level- digitally controlled switches
  • How low voltage/power microcontrollers activate high voltage/power devices
  • Oversize so they don’t burn
  • Pulldowns and current limits

tiny power

big

power

34 of 56

Our second equation - Capacitance

I = C ∗ dv/dt

Capacitance (measured in farads) (also a charge measurement, charge = CV)

I: Current (measure in amps)

dV/dt: Change in Voltage over time (measure in volts/second)

35 of 56

Capacitance

I = C ∗ dv/dt

Capacitance (measured in farads)

I: Current (measure in amps)

dV/dt: Change in Voltage over time

(measure in volts/second)

Energy is stored in an *electric* field

36 of 56

Capacitance

The science here can get a little complicated but/and I like to think of a capacitor as a filter for changes in voltage

37 of 56

Capacitance

The science here can get a little complicated but/and I like to think of a capacitor as a filter for changes in voltage

38 of 56

Capacitance

The science here can get a little complicated but/and I like to think of a capacitor as a filter for changes in voltage

39 of 56

Capacitance - switch debouncing

40 of 56

Capacitance - switch debouncing

41 of 56

Rules of Thumb

“Engineering is the art of knowing what to ignore”

Buffering caps: 1uF-10uF place at each digital component

Current limiting resistors on low power LEDs :1K

Pullup/down-resistors: 10K (unless present onboard)

button debounce: handle in software with slow reads

42 of 56

v(t) = L

Inductance

did𝑡

Inductance (measured in “henry”s)

v(t): voltage induced by inductor at this instant

di/dt: Change in Current over time (measure in volts/second)

43 of 56

Inductance

Energy is stored in a

magnetic field (!)

44 of 56

Triplets

  • Resistance / Resistors: resists voltage, “does work”

  • Capacitance / Capacitors: resists change in voltage

  • Inductance / Inductors: resists change in current

45 of 56

Triplets

  • *everything* has *some* resistance, inductance, and capacitance; resistors are inductors, capacitors are resistors, inductors are capacitors, etc…
  • we can largely ignore this inconvenience until we hit high powers, high frequencies, and high precision

46 of 56

But how will I know if my component needs a capacitor?

And how big of a capacitor will I need? (and what are all of those labels?)

Neil’s SAMD11 Hello World board: http://academy.cba.mit.edu/classes/embedded_programming/D11D/hello.D11D.echo.png

47 of 56

Sometimes: read the datasheet

Often: follow design patterns

48 of 56

USB HEADER

(prefix J in Neil’s boards often mean some type of connector)

49 of 56

This gets 5V

So this (voltage regulator)

Drops it to 3.3V for this microcontroller

Most of the microcontrollers you will encounter in this class will run at either 3.3V or 5V – Be careful about not cooking a 3.3V micro with 5V!

50 of 56

Bypass capacitor as we discussed!

Value: 1uF

51 of 56

Programming header— how you (initially) load code onto this microcontroller!

We see the J prefix again— this is a header — and SWD denotes the interface

52 of 56

Microcontroller

SAMD11D

This is a SAMD11 in the D package

We also stock SAMD11C, which has less pins but the same package.

53 of 56

Neil uploads photos of these boards to the components link— check this if you’re not sure what you’re looking for.

54 of 56

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

RP2040

ESP32C3

55 of 56

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

56 of 56

Digital Simulation in Wokwi/Falstad