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
The next few weeks have a simple task!
Ohm’s Law:
V = I ∗ R
Voltage (measure in volts)
I: Current (measure in amps)
Resistance (measured in ohms)
Voltage
Measures the difference in electrical potential between two points – often an input voltage (vcc) and ground (gnd)
Current
Measures the rate of flow of electrons in a circuit
Resistance
Measures how hard it is for electrons to move through a circuit
Triplets
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?
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)
Ohm’s Law:
How about these resistors?
V = I ∗ R
Voltage (measure in volts)
I: Current (measure in amps)
Resistance (measured in ohms)
Ohm’s Law:
How about these resistors?
1A
+3V
Ohm’s Law:
Voltage divider
Very useful for monitoring babttery voltage
Diodes:
Current flow in one direction only
Sort of… :p
Img: https://cdn.sparkfun.com/assets/4/4/a/5/b/5175b518ce395f2d49000000.png
Diodes:
Diodes:
Light emitting diode (LED)
Ohm’s Law:
What about this LED?
V = I ∗ R
Voltage (measure in volts)
I: Current (measure in amps)
Resistance (measured in ohms)
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)
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)
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)
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 :(
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)
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)
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
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
Switch
Switch - slide switch
A: OFF B: ON
SPDT:Single Pole, Double Throw
Switch- tactile switch
Mosfets
tiny power
big
power
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)
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
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
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
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
Capacitance - switch debouncing
Capacitance - switch debouncing
https://www.allaboutcircuits.com/technical-articles/switch-bounce-how-to- deal-with-it/
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
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)
Inductance
Energy is stored in a
magnetic field (!)
Triplets
Triplets
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
Sometimes: read the datasheet
Often: follow design patterns
USB HEADER
(prefix J in Neil’s boards often mean some type of connector)
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!
Bypass capacitor as we discussed!
Value: 1uF
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
Microcontroller
SAMD11D
This is a SAMD11 in the D package
We also stock SAMD11C, which has less pins but the same package.
Neil uploads photos of these boards to the components link— check this if you’re not sure what you’re looking for.
Seeed XIAO ("小": means "small")
RP2040
ESP32C3
Seeed XIAO ("小": means "small")
Digital Simulation in Wokwi/Falstad