This is a support page for day 5 of an 8-session class is a basic introduction to both electronics and programming the Arduino microprocessor. The intent is to prepare the student for what is currently popular in the maker world, rather than an electronics or engineering degree, and includes some things of interest to amateur radio enthusiasts.
Day 1, Day 2, Day 3, Day 4, Day 5, Day 6, Day 7, Day 8
Day 5: Transistors, potentiometers, phototransistor, rotary encoder
Goals:
-
- Draw the circuit symbol for a transistor
- Explain what a transistor does
- Explain what a potentiometer does
- Explain what a phototransistor does
- Explain how a rotary encoder works
Vocabulary:
-
- Transistor
- Potentiometer
- Rotary encoder
- PNP transistor
- NPN transistor
Transistor circuit w/ 9v battery and Arduino – schematic diagram, wiring and code
Schematic:

Build:

Code:
Blink-forever.ino (from Day 2)
Copied!
void setup() { pinMode(12, OUTPUT); } void loop() { digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(12, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
Transistor with phototransistor – Schematic, wiring
Schematic:

Build:

No Code needed: put a infrared remote’s LED near the phototransistor and your LED should blink.
Transistor with phototransistor + switch & LED – Schematic, wiring
Schematic:

Build:

No Code needed: bend the infrared LED and the phototransistor toward each other. Then pressing the switch should make your regular LED blink.
Homework:
-
-
- Watch Transistors Explained: https://www.youtube.com/watch?v=J4oO7PT_nzQ
- Watch NPN / PNP Transistors Explained: https://www.youtube.com/watch?v=zpyK5Hy8d0c
-
![]()