# Search Results for: "squidwrench electronics workshop"

### Squidwrench Electronics Workshop: Session 6 Whiteboards

Coverage of capacitors as charge-storage devices, rather than filters:

Session 6 – Whiteboard 1 – overview

We avoided all the calculus and derivations, taking the exponential waveform as a given for RC circuits:

Session 6 – Whiteboard 1 – exponential detail

Discussions of dielectrics, plate spacing / area, and suchlike:

Session 6 – Whiteboard 1 – dielectric permittivity

Some handwaving discussion of construction, electrolytic capacitor innards, and The Plague:

Session 6 – Whiteboard 1 – cap construction

A 1 F cap charged through a 1.8 kΩ resistor during most of the session to show what an 1800 s time constant looked like. Nope, it never quite got to the 3.5 V from the power supply, even when we all decided it was time to shut down!

### Squidwrench Electronics Workshop Session 6: Capacitors

Capacitors as charge-storage devices with An introduction to Function Generators & Oscilloscopes

Capacitor show-and-tell

Capacitor show-n-tell

Things to remember

• The green one over on the left is the 1 farad cap my EE prof said I’d never see: “It would be as big as a house”
• The small disk in front of it is a 600 mF (milli, not micro) polyacene “battery” rated at 3.3 V
• Air-variable and wax-dielectric caps = ghosts from the past
• Reverse-biased diodes act as capacitors, due to charge separation
• Silver-mica caps are pretty things to behold
• Voltage rating vs size vs dielectric, a cap charged to 10 kV will get your attention

Warmup exercise: Measure the caps with a variety of meters, noting they do not reach 1 farad. General patter, Q&A, introducing equations as needed.

I will resolutely squash all discussion of capacitors as analog / small signal circuit elements.

Cap construction

• C = εA/d with ε = dielectric permittivity = ε0 × εR
• ε0 = vacuum permittivity = 8.84 × 10-12 F/m
• εR = relative permittivity, air = 1.0006
• dielectrics: wax vs paper vs plastics vs whatever
• ignoring dissipation factor for now
• caution on dielectric absorption
• electrolytic caps vs capacitor plague
• brave / daring / foolish: aluminum foil with chair mat dielectric (εR ≈ 3)

Useful equations

• C = Q/V and (nonlinearly) C = Δq/ΔV
• thus Q = C × V, Δq = C × Δv = Δc × V
• by definition, i = Δq/Δt, so i = C × Δv/Δt
• “displacement current” vs “actual current”
• stored energy = 1/2 × C × V²

Quick demo

• charge 1 F cap to 3.7 V at 20 mA from constant current power supply
• estimate charge time
• plot V vs T
• disconnect power supply, connect white LED, observe light output for the next few hours

Capacitor applications in charge-storage mode

• Constant current → voltage ramp (scope horizontal)
• Large cap = no-corrosion (kinda sorta) small-ish battery
• Change plate d → microphone (need V)
• Trapped charge in dielectric → Electret mic (no V, but need amp)
• Change C (varactor) → parametric low noise amplifier (narrowband)

Parallel caps

• C = C1 + C2
• expanded plate area “A”
• capacitor paradox vs reality: never switch paralleled caps!

Series caps

• 1/C = 1/C1 + 1/C2
• increased separation “d”, sorta kinda
• floating voltage on center plates = Bad Idea

Now for some hands-on lab action

Connect function generator to resistor voltage divider

Resistor voltage divider – oscilloscope connections

• calculate total resistance and series current
• calculate expected voltages from current
• show input & output waveforms on scope
• overview of oscilloscope controls / operations

Replace lower R with C, then measure V across cap

RC Circuit – integrator

• series circuit: fn gen → R → C (C to common)
• scope exponential waveform across C
• not constant current → not linear voltage ramp
• except near start, where it’s pretty close
• e^-t/τ and (1 – exp(-t/τ))
• time constant τ = RC (megohm × microfarad = ohm × farad = second)
• show 3τ = 5% and 5τ < 1%
• integration (for t << τ)

Tek 2215A oscilloscope – cap as integrator

Flip R and C, measure V across resistor

RC Circuit – differentiator

• series circuit: fn gen → C → R (R to common)
• scope exponential waveform across R  ∝ current through cap (!)
• same time constant as above
• differentiation (for t << τ)

Tek 2215A oscilloscope – cap as differentiator

If time permits, set up a transistor switch

NPN switch – Cap charge-discharge

• display voltage across cap
• measure time constants
• calculate actual capacitance

Other topics to explore

• measure 1 F cap time constant, being careful about resistor power
• different function generator waveforms vs RC circuits
• scope triggering
• analog vs digital scope vs frequency

All of which should keep us busy for the better part of a day …

### Squidwrench Electronics Workshop: Session 5 Whiteboards

Whiteboards from the SqWr Electronics Session 5, covering transistors as switches …

Reviewing I vs V plots, starting with a resistor and then a transistor as a current amplifier:

SqWr Electronics 5 – whiteboard 1

Reminder of why you can’t run a transistor at its maximum voltage and current at the same time:

SqWr Electronics 5 – whiteboard 2

A resistor load line, with power calculation at the switch on and off coordinates:

SqWr Electronics 5 – whiteboard 3

Detail of the power calculations, along with a diagram of the current and voltage when you actually switch the poor thing:

SqWr Electronics 5 – whiteboard 3 detail

Oversimplification: most of the power happens in the middle, but as long as the switching frequency isn’t too high, it’s all good.

Schematic of the simplest possible switched LED circuit, along with a familiar mechanical switch equivalent:

SqWr Electronics 5 – whiteboard 4

We started with the “mechanical switch” to verify the connections:

SqWr Session 5 – Switched LED breadboard

Building the circuitry wasn’t too difficult, but covering the function generator and oscilloscope hookup took far more time than I expected.

My old analog Tek 2215 scope was a crowd-pleaser; there’s something visceral about watching a live CRT display you just don’t get from the annotated display on an LCD panel.

I’d planned to introduce capacitors, but just the cap show-n-tell went well into overtime. We’ll get into those in Session 6, plus exploring RC circuitry with function generators and oscilloscopes.

### Squidwrench Electronics Workshop: Session 5

Topics for today’s Squidwrench Electronics Workshop: Session 5 in a continuing series.

Having discussed transistors as current-controlled current sources, we can now select one as a victim use one as a switch, then add capacitors to learn about exponential charging, and introduce the oscilloscope as a vital tool.

NPN Switch – protoboard

So, we proceed:

## Transistors as switches

Review graphical parameters

• saturation voltage for high Ic
• cutoff voltage for near-zero Ic
• resistive load line: VR = Vcc – Vc
• power dissipation hyperbola (at all Vc)
• secondary breakdown limit (at higher Vc)

Something like this, only drawn much larger and with actual numbers:

Transistor characteristics – saturation and cutoff – load line

Reminder of linear vs. log scales converting hyperbolas into straight lines.

NPN transistor as “to ground” switch

• where to measure device voltages?
• passing mention of flyback diodes
• IB needed for saturation?
• Darlington transistors: beta multiplier, VBE adder

For example:

NPN switch – LED

Without the LED, you get nice square waves:

NPN – 100 Hz – 2.2k – no cap – Vc

An ancient green LED reduces Vc by a little over a volt:

NPN – 100 Hz – 2.2k green LED – no cap – Vc

Discuss PNP transistor as “from supply” switch

• why VCC must not exceed controller VDD
• kill microcontroller and logic gates

Wire up pulse gen to transistor

• function generator for base drive voltage
• collector resistor (then LED) as output
• how do you know what it’s doing?
• add oscilloscope to show voltages
• explanation of scope functions!

## Capacitor as charge-storage devices

Useful ideas and equations

• C = Q/V
• so C = ΔQ/ΔV
• therefore i = C * Δv/Δt
• energy = 1/2 * C * V²

Charging capacitor from a voltage source through a resistor

• Exponential waveform: e^t/τ
• time constant τ=RC
• show 3τ = 5%
• and 5τ < 1%

Add cap to transistor switch with R to soften discharge path

• charge vs discharge paths
• calculate time constants
• wire it up
• verify with oscilloscope

The circuit will look like this:

NPN switch – Cap charge-discharge

Discussion of parts tolerance: 100 nF caps are really 78 nF

With one cap:

NPN – 100 Hz – 2.2k 2.2k 78nF – Vc Vcap

Add another cap for twice the time constant:

NPN – 100 Hz – 2.2k 2.2k 2x78nF – Vc Vcap

Let the scope calculate 10-90% rise time:

NPN – 100 Hz – 2.2k 2.2k 2x78nF – Vc Vcap – rise fall times

Useful relations:

• rise time = 2.2 τ (compare with calculations!)
• rise time = 0.34/BW

Do it on hard mode with the old Tek scope for pedagogic purposes.

That should soak up the better part of four hours!

### Squidwrench Electronics Workshop: Session 4

Ex post facto notes from the fourth Squidwrench Electronics Workshop.

We finally talk about (bipolar, NPN) transistors as current-controlled current sources / sinks, ruthlessly restricted to DC operating conditions.

Scribbled notes of things to cover, contrast-stretched to be slightly more readable:

Session 4 – plan reminder

A bag o’ samples:

Session 4 – transistor samples

Nomenclature, regret expressed as to conventional vs electron current flow, schematic pictures vs. reality, why different packages. All six possible pinouts loose in the wild: always check datasheet and confirm device pin polarity.

Not all TO-92 packages contain transistors: voltage regulators, references, AM receivers, dual diodes, you name it, you’ll find it. When you order a million of something, you can get whatever you want.

The Squidwrench junk box parts drawers contain some genuine Mil-Spec 2N2222 transistors in genuine TO-18 metal cans, packed in individual containers labeled with their warranty expiration date. They still make ’em like that, just not for the likes of mere mortals such as I.

Reading data sheets and tamping down optimism: (large print) max voltage and max current ratings always limited by (small print) max power dissipation. Safe Operating Area bounded by datasheet limits, power becomes graceful curve on linear scales = straight line on log-log scales. Handwaving description of secondary breakdown issues, story about killing those ET227 bricks.

DC current gain β = hFE, font flourish catastrophes, uppercase subscripts = DC vs. lowercase = AC, temperature dependence, process dependence, expected spread = don’t count on any particular values.

Just to show what the results should look like, I measured an MPS3704 by hand before class:

MPS3704 transistor I vs V plots

Which required two power supplies and three meters:

Session 4 – transistor measurement meters

Which, in turn, prompted me to festoon the class meters with conspicuous masking tape labels!

Seen a bit closer to the origin, with a fixed 100 μA base current and the scope’s arbitrary function generator producing a voltage ramp:

MPS3704 – 100uA base 2mA-div IC 50mV-div VC

Obviously, you’ll want automation when you do this more than once.

The whiteboard of introductory scribbles, with a plot of expected results:

Whiteboard – Session 4 – transistor I vs V plot

Small values of collector voltage to remain within allowable power dissipation! Discussion of switching behavior: high current at low voltage, low current at high voltage, avoid crossing the non-SOA (pulse vs DC) expanse, another mention of secondary breakdown.

After painstakingly measuring another MPS3704, compute actual current gain(s) and power dissipation:

Whiteboard – Session 4 – transistor measurements

With data in hand, we carefully increased the collector voltage with constant base current, ventured slowly into the non-SOA, and eventually measured the same base current producing no collector current at all. No smoke, much to the disappointment of all parties.

The benefit of actually measuring a (sacrificial) transistor cannot be overstated. Lots of baling-wire setup, plenty of mistakes and fumbles, hard lessons in how difficult it is to get useful numbers.

A good time was had by all, despite the absence of non-SOA smoke …

### Squidwrench Electronics Workshop: Session 3

Ex post facto notes from the third Squidwrench Electronics Workshop.

Exhibit various 50 Ω resistors, including my all-time favorite, a 600 W 3 GHz dummy load:

… down to a 1/8 Ω metal film resistor.

The dummy load’s N connector triggered a regrettable digression into RF, belatedly squelched because I wasn’t prepared to extemporize on AC concepts like reactance which we haven’t covered yet.

Discussion of resistor applications, power handling, power derating with temperature, etc:

Whiteboard – Session 3 – Resistor power derating

Why you generally won’t find 50 Ω load resistors in Raspberry Pi circuits. Cartridge heaters for 3D printers, not aluminum power resistors, although everyone agrees they look great:

Discussion of voltage vs. current sources, why voltage sources want low internal resistances and current sources want high resistances. Bungled discussion of current sources by putting diodes in parallel; they should go in series to show how added voltage doesn’t change current (much!) in sources driven from higher voltages through higher resistances:

Whiteboard – Session 3 – Voltage vs Current Sources

Use Siglent SDM3045X DMM in diode test mode to measure forward drop of power / signal / colored LEDs, discuss voltage variation with color / photon energy. Measure 1.000 mA test current for all forward voltages.

Compute series resistor (500 Ω) to convert adjustable power supply (the digital tattoo box, a lesson in itself) into reasonable current source; roughly 10 V → 20 mA. Find suitable resistor (560 Ω) in SqWr junk box parts assortment, digression into color band reading.

Wire circuit with meters to measure diode current (series!) and voltage (parallel!), measure same hulking power diode (after discovering insulating washers now in full effect) as before in 1 mA steps to 10 mA, then 15 and 20 mA, tabulate & plot results:

Whiteboard – Session 3 – Diode current vs forward drop

Discover warm resistor, compute power at 20 mA, introduce cautionary tales.

Lesson learned about never returning parts to inventory, with 560 Ω resistor appearing in diode drawer. Cautionary tales about having benchtop can of used parts as front-end cache for inventory backing store.

Another intense day of bench work!

### Squidwrench Electronics Workshop: Session 2

Some ex post facto notes from the second SquidWrench Electronics Workshop. This turned out much more intense than the first session, with plenty of hands-on measurement and extemporized explanations.

Measure voltage across and current through 4.7 kΩ 5 W resistor from 0.5 V to 30 V. Note importance of writing down what you intend to measure, voltage values, units. Plot data, find slope, calculate 1/slope.

Introduce parallel resistors: 1/R = 1/R1 + 1/R2. Derive by adding branch currents, compute overall resistance, factor & reciprocal.

Review metric prefixes and units!

Introduce power equation (P = E I) and variations (P = I² R, P = E²/R)

Measure voltage across  and current through incandescent bulb (6 V flashlight) at 0.1 through 6 V, note difference between voltage at power supply and voltage across bulb. Plot data, find slopes at 1 V and 5 V, calculate 1/slopes.

Measure voltage across ammeter with bulb at 6 V, compute meter internal resistance, measure meter resistance. Note on ammeter resistance trimming.

Measure voltage across and current through hulking power diode from 50 mV – 850 mV. Note large difference between power supply voltage and diode voltage above 750-ish mV. Note power supply current limit at 3 A. Plot, find slopes at 100 mV and 800 mV, calculate 1/slopes. Compare diode resistance with ammeter resistance.

Review prefixes and units!

The final whiteboard:

Whiteboard – Session 2

Hand-measured data & crude plots FTW!