Intro to Electronics Sep 22
The water analogy
Voltage is the amount of water in the tank, more voltage, more water, more pressure current is the amount of water that moves,
more resistance is a thinner pipe, less resistance is a wider pipe, more water can go through faster
Voltage is measured in potential between two volts
current is a measure of amount of charge moving per time, measured in amps (A)
"amount of electricity moving"
ground is reference point, so when saying votage is 5v, its 5v compared to ground. (negative terminal on battery)
if battery is 12v, if it gives 5v its 5v relative to the ground of the battery.
Electrical components
- Ideal Voltage Source (Think Battery) Maintains constant voltage
- Passive Components (Inductors, Resistors, Diodes)
- Resistors: Resists the flow of charge (ohms) Dissipates energy as heat, V = IR
- Equivalent Resistance (sum in series, sum of inverses in parallel)
- Capacitors: Store voltage in an electrical field (farads)
- Equivalent Capacitance (sum in parallel, sum of inverses in parallel)
- as current goes in, they charge up, resist change in voltage across them.
- Diode: Allows current to flow in only one direction. Prevents damage to components
- We use schottkys because they "switch" faster
- Inductors: Current through them is equal to inductance (V = L(dv/dt)) Constant voltage and constant inductance, so the rate of change of current over time is linear.
- The graph of current going through it is a line
- Use that to create sawtooth waveform, and its used for regulators.
- Resistors: Resists the flow of charge (ohms) Dissipates energy as heat, V = IR
Microcontrollers
- Arduino, rpi, arm-stm, are mini computers and you can put code ot them.
- read, manipulate, and respond to data. Each connection is a pin, each pin has a specific function
- every pin has a function they can do.
- many ground pins, all of them are GPIO (general purpose input output)
- digital vs analog, so strings of 1-0 binary its easy for computers to understand.
- our sensors are analog, so they can be anywhere between 0-5 volts
- ADC and DAC (analog-digital converter and digital-analog converter)
- GPIOs
- can either output a high or low signal
- work on 3.3 volts
- some signal, 3.3V is high, 0 is low
- the main purpose of these is either the input or the output.
- can either output a high or low signal
- MOSFETs
- NMOS: connects drain and source when gate is HIGH
- PMOS: connects drain and source when gate is LOW
- a type of transistor
- basically a switch that is controlled with voltage
- Simple voltage Divider
- We know V = IR for resistors
- and we can add resistors in series
- so we can take the voltage between two identitcal resistors so we get half the voltage.
- If i Have a voltage source that is 12v and need a 5v signal, what resistor values would work well?
- Pulled High/Pulled Low
- Digital Systems 1 is high 0 is low
- connecting it to the high or low, usually through a resistor
- ensures that when the switch is open, input is high (for pull up) or low (for pull low)
- Smoothing Capacitors
- Decoupling Capacitor (it uncouples the bad waveform)
- Communication Protocols
- lets say your adc wants to send
10110and esp wants to read it - what if they dont agree at the speed?
- need to synchronize in some way
- What if they need to send in both directions at the same time?
- some protocols will let you send data both ways
- ESP uses SPI and I2C, its sometimes called 2 wires
- I2C uses SDA (Data) and SCL (Clock) wires (2 wires)
- Devices are selected by first sending an address
- You can have multiple devices on the same bus
- can use the exact same wires to go to a different adc
- how do i Identify them?
- first data sent is the address, and then the data
- the other chips ignore data if not for their address
- SPI protocol
- no longer has addresses, has way more wires
- the sclk line is just clock
- data goes both ways
- MOSI (Master Out Slave In) and MISO (Master In Slave Out)
- Each sensor has its own select wire, the same mosi miso connect to all sensors
- sensors read data when select pull low. (Hardware chip selection)
- the idea that only one is low at a time, and that is the only device.
- Most of the boards will implement SPI in some way.
- I have one MOSI line and one MISO line.
- I2C uses SDA (Data) and SCL (Clock) wires (2 wires)
- lets say your adc wants to send
Introduction to Altium
- A net is a node, a bunch of wires all connected together with the same name. Altium will classify all your wires with the same net
- resistor kinda looks like a block with solder pads
- all you need are two solder pads that you use to connect them to the board.
- common components
- esp32 (bt and wireless!)
- voltage regulator (AZ1117)
- USB C port
- connects to all the pins on the esp32