Introduction: HackerBoxes Starter Workshop
The HackerBoxes Starter Workshop was designed to provide an entry point for those wishing to get started in the hobby of DIY electronics. This includes those interested in joining the HackerBoxes monthly subscription box. The Starter Workshop is available here.
Projects in the monthly subscription HackerBoxes are not exactly for beginners. They generally require some prior DIY electronics exposure, basic soldering skills, and comfort working with microcontrollers, computer platforms, operating system features, function libraries, and simple program coding. We also use all the typical hobbyists tools for building, debugging, and testing DIY electronics projects.
The Starter Workshop provides a nice set of basic tools and supplies while also leading the participant through these important Topics and Learning Objectives:
- Identifying Common Electronic Components, Tools, and Supplies
- Working with Solderless Breadboards and Power Supplies
- Understanding Voltage, Current, Resistance, and Ohm’s Law
- Using Digital Multimeters
- Working with Voltage Dividers
- Interfacing to Microcontroller Boards from your Computer
- Wiring and Coding Arduino Projects (30+ Exercises)
- Installing and Using Arduino Libraries
- Integrating Hardware Modules into Arduino Projects
- Using Soldering Tools and Best Soldering Practices
HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are makers, hobbyists, and experimenters. If you would like to get this HackerBoxes Starter Workshop or receive the HackerBoxes surprise subscription box of great electronics projects in the mail each month, please visit us at HackerBoxes.com and join the revolution.
HACK THE PLANET!
Step 1: Workshop Contents
Using the images above, take a few minutes to familiarize yourself with the name and appearance of each item that is included in the HackerBoxes Starter Workshop. Even if you are following along with your own materials, this is a nice array of parts and supplies for you to make sure you have on hand. Either way, reviewing these items and their names will help us know which of the various parts to use in a particular experiment.
A very important additional thing you will need is a real sense of adventure, DIY spirit, and hacker curiosity. Starting in DIY electronics as a maker, experimenter, and creator can be an exciting challenge. While this type of hobby electronics isn't always easy, a great deal of satisfaction may be derived from sticking with it and figuring things out!
V1-V3: September 2016 - November 2018: Download the PDF "HB Starter Workshop Guide v1"
V4: November 2018 - May 2020: Download the PDF "HB Starter Workshop Guide v4"
V5: May 2020 - Present: Follow this Instructable
Step 2: Solderless Breadboard
Solderless breadboards are great for prototyping or experimenting with electronic circuits and systems.
This drawing illustrates the four areas of the typical solderless breadboard.
Areas A and D are "power rails" generally used to conduct the plus and minus voltages for your power supply across the entire length of the board. For example, the blue lines might be grounded (ZERO VOLTS) and the red lines might be tied to the 5V supply line (often used as LOGICAL HIGH or POSITIVE SUPPLY).
Areas B and C are "terminal strips" generally used to connect the terminal pins of various circuit components. Note that Area B is separated from Area C by a gap of exactly the distance between the two pin sides of a Dual In-Line Pin (DIP) Chip. That is why the terminal strips in Area B and Area C are not connected with each other.
Jumper Wires having pins or stripped wires on each end may be used to connect between the terminal strips as needed. The jumpers may also be used to connect the power rails into the terminal strip areas where needed.
Have a look at this great tutorial from our friends at Sparkfun introducing how to use a solderless breadboard. Note that the end of that tutorial shows some examples for building your first circuits on the breadboard using some LEDs. We will be getting to that in the next few steps, so you might want to stop when you get to that part of the breadboard tutorial.
Step 3: Powering Breadboard Projects
The Breadboard Power Supply Module plugs onto one end of the solderless breadboard to provide 3.3V or 5V to your circuits. The Power Supply Module can be powered using a micro USB cable connected any typical 5V source such as a wall outlet adapter, a USB power band, or even a computer.
Be sure to line the positive and negative pins up to the correct power rails. If they seem backwards, rotate the power supply to the other end of the breadboard.
Each of the two power rails can be independently switched to either 5V or 3.3V. Note that 3.3V is sometimes shown in shorthand as 3V3. Similarly, a 4.7 ohm resistor may sometimes be labeled as 4R7.
For now, set both of the 3.3V/5V jumpers to 5V since we will be working with 5V Direct Current (DC). Wikipedia can tell us more about Direct Current.
Step 4: A Simple Breadboard Circuit
So let's build our first simple circuit on the solderless breadboard. The circuit in the schematic allows current to flow from a 5VDC source through an LED (light emitting diode), through a 1,000 Ohm resistor, through a switch, and finally to ground.
Of course the current only flows when the switch is closed or pressed. The LED will only work in one direction. If it doesn't light up when you close the switch, try flipping it around. Once the LED is in the correct position, you will note that the long pin goes towards the positive (+5V) power terminal.
The 1,000 Ohm Resistor is also called a 1K resistor and features colored stripes in the order brown, black, and red.
Step 5: Resistance and Resistors
So what's up with the resistor that we used in our first circuit?
A resistor is a two-terminal component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among many other things. Fixed resistors have resistances that only change slightly with temperature, time or operating voltage. Variable resistors can be used to adjust circuit elements (such as a volume control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical activity. (see Wikipedia)
Resistors are measured in the unit OHMS, which we will learn more about shortly.
The resistor we used inline with the LED was to limit the current flowing the LED so that it did not overheat and burnout. Think of it like a safety valve.
Step 6: Digital Multimeter
The digital multimeter (DMM) is an electronic measuring instrument that combines several measurement functions in one unit. A typical multimeter can measure voltage, current, and resistance. DMMs have a numeric display for representing the measured value. The DMM in the HackerBoxes Starter Workshop comes with red and black test probes as well as the required 23A battery.
Here is a great video about how to use your multimeter.
Step 7: Measuring Resistance
Using a digital multimeter, and a pair of clip leads, put a resistor between the clips and plug the leads into the COM (common) and Ohms terminals. Set the range dial on the value of ohms just greater than your resistor, or start that the highest resistance and work your way down until something measures. The illustrated example shows a 1K resistor that actually measures at 0.950 K, which is not unusual at all. Work through some examples on a resistor color code chart to compare the marked (nominal value) with the measured (experimental) value. Note the tolerance band. A lot of resistors are +/- 5% or even +/-10%, so a 100 ohm resister may actually measure as 90 ohms or 110 ohms.
Step 8: Voltage and Current
Voltage is the difference in electric potential energy between two points. To make an analogy, when talking about mass, gravitational potential can be thought of as how high something has been raised off the ground and thus how much energy it has to release when it falls to the ground. Similarly, a charge at 5V potential has more energy to expend getting to 0V (ground) than does a charge at only 2V. Voltage is sometimes called "electrical pressure" because it is a bit like water pressure. To give the tap water in your house pressure as it flows out of the faucet, water is often pumped uphill to a water tower. The higher the tower (gravitational potential above the ground), the more pressure or the harder water can push through the pipe. Similarly, the more voltage (electrical potential raised above ground), the harder the electrons can push through the wires.
Electrical current is very similar to the notion of water current in a river or a pipe. Current is how much stuff (electrons in this case) flow through per unit time. Gallons-per-minute of water or charges-per-second of electricity.
Resistance can be thought of as the “tightness” of the pipe. The narrower the pipe is (higher resistance), the less current flows through for a given potential (voltage). You can make more current flow through a pipe by pushing it harder (higher voltage) or opening the pipe up (less resistance). This relationship is given by Ohm's Law: V = I x R where voltage (in volts) equals current (in amperes) times resistance (in ohms).
There are a lot of great tutorials online about voltage, current, and Ohm's Law. Here is a nice example.
Step 9: Measure Voltage and Current
Construct a simple circuit that just has a resistor between 5V and GND. This circuit isn't doing much but converting electricity into a tiny amount of heat. 5V of potential is being "dropped" across the resistor. To measure this voltage drop, we can put a clip on each side of the resistor. This will show 5V, which makes sense because one side the resistor is connected to 5V and the other to GND (0V) for a potential difference of 5V-0V or 5V. Note that voltage is always measured across some load (a resistor in this case) that is dropping the voltage being measured.
In order to measure current, the circuit must be opened up and the meter inserted within the circuit. This allows the meter to sense the current flowing through the circuit. Note that current is always measured inline requiring the circuit to be opened up first.
Step 10: Potentiometers and Voltage Dividers
A voltage divider produces an output voltage that is a fraction of its input voltage. Here is a great video about voltage dividers.
A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, the potentiometer acts as a variable resistor or rheostat.
Step 11: Microprocessors and Microcontrollers
Step 12: Arduino Open-Source Ecosystem
Arduino is an open-source hardware and software concept that makes it easy to get started working with microcontrollers. The Arduino user community designs and manufactures open-source hardware and open-source software to enable microcontroller-based solutions for building digital devices and interactive objects that can sense and control physical devices. Due to the open-source nature of the Arduino ecosystem, there are many, many variations on Arduino programs, libraries, and hardware. Arduinos are readily available, and of course they have countless tools, libraries, and tutorials available online.
Arduino is the perfect sandbox for hardware hackers to play in, but it also means that we have to be flexible and ready to explore, find solutions, figure out what works, how it works, and what we can do with it.
Start by installing the Arduino Integrated Development Environment (IDE). You can download it at Arduino.cc
You might want to check out this introductory video about the Arduino IDE. It jumps ahead to some of the topics we will address in later steps, but seeing the same ideas covered from different perspectives can be very helpful.
Step 13: Arduino Nano Microcontroller Plaform
The Arduino Nano is a great choice for learning about microcontrollers platforms. The included Arduino Nano module comes with header pins suitable for plugging into a solderless breadboard. For this step, all that is needed is the Arduino Nano module and a microUSB cable. Power is supplied to the Nano through the microUSB cable, which is also how programs are loaded from your computer into the Nano.
The Arduino Nano is a surface-mount, breadboard-friendly, miniaturized Arduino board with integrated USB. It is amazingly full-featured and easy to hack.
- Microcontroller: Atmel ATmega328P
- Voltage: 5V
- Digital I/O Pins: 14 (6 PWM)
- Analog Input Pins: 8
- DC Current per I/O Pin: 40 mA
- Flash Memory: 32 KB (2KB for bootloader)
- SRAM: 2 KB
- EEPROM: 1 KB
- Clock Speed: 16 MHz
- Dimensions: 17mm x 43mm
This particular variant of the Arduino Nano is the black Robotdyn design. Arduino Nanos feature a built-in USB/Serial bridge chip. On this particular variant, the bridge chip is the CH340G.
USB Device Driver
Your computer's operating system requires a Device Driver to communicate with the CH340G USB/Serial chip. The driver allows the IDE to communicate with the Arduino board. The specific device driver that is needed depends upon both the OS version and also the type of USB/Serial chip. For the CH340 USB/Serial chips, there are drivers available for many operating systems (UNIX, Mac OS X, or Windows). The maker of the CH340 supplies those drivers here. The Google translated version might be helpful.
Step 14: Your First Arduino Program in a Blink
Plug the Nano into the MicroUSB cable and the other end of the cable into a USB port on the computer. An LED on the board should start to blink. This is actually running a tiny program that is preloaded onto the Nano.
Now, launch the Arduino IDE software.
Once you get into the IDE, navigate to tools>board. Select "Arduino Nano" in the under the listed board types.
Next, you need to select the PORT for the board. This will look different depending upon your USB driver. It may have a name with "wchusb" in it. If the appropriate USB/Serial device is not showing up in the IDE under PORTS, it helps to unplug the USB cable, wait thirty seconds or so, and then plug it back in. Maybe even try a different USB port. This can force the operating system to notice that something has changed and initiate the associated USB driver.
Finally, load up a piece of example code:
This is actually the code that was preloaded onto the Nano and should be running right now to slowly blink the blue LED. Accordingly, if we load this example code, nothing will change. Instead, let's modify the code a little bit.
Looking closely at the program, you can see that it turns the LED on, waits 1000 milliseconds (one second), turns the LED off, waits another second, and then does it all again - forever.
Modify the code by changing both of the "delay(1000)" statements to "delay(100)". This modification will cause the LED to blink ten times faster, right?
Let's load the modified code into the Nano by clicking the UPLOAD button (the arrow icon) just above your modified code. Watch below the code for the status info: "compiling" and then "uploading". Eventually, the IDE should indicate "Uploading Complete" and your LED should be blinking faster.
If so, congratulations! You have just hacked your first piece of embedded code.
Once your fast-blink version is loaded and running, why not see if you can you change the code again to cause the LED to blink fast twice and then wait a couple of seconds before repeating? Give it a try! How about some other patterns? Once you succeed at visualizing a desired outcome, coding it, and observing it to work as planned, you have taken an enormous step toward becoming a competent hardware hacker.
Step 15: Your First Arduino Circuit
Disconnect the USB power from the Arduino Nano.
Remove the Power Supply Module form the Solderless Breadboard.
Plug the Nano onto the Breadboard and wire up an LED and 1K resistor as shown.
The same blink program can be used by changing the output pin from the one defined as "Builtin LED" to "Pin 2".
Can you make the flashing operate both the onboard and external LED at the same time?
Can you make the two LEDs alternate?
Step 16: Online Book - Introduction to Arduino
We suggest using the very well-written book entitled Introduction to Arduino by Alan Smith. At the link you can access a PDF version that Alan shares online. If you would like to have your own hard copy of the book, please consider supporting Alan by purchasing one here for only $8.99.
There are a number of sections in the Introduction to Arduino book that we recommend exploring using the components included in your HackerBoxes Starter Workshop. Some of of these sections are listed here, but certainly feel free to explore this material to any extent that you wish and at your own pace.
- 2.1 “Blinky” Light Patterns
- 2.2 IF Statements
- 2.3 ELSE Statements
- 2.4 WHILE statements
- 2.5 What is True?
- 2.6 Combinations
- 2.7 FOR statements
- 2.8 Our New Circuit
- 2.9 Introducing Arrays
- 3.1 Pushbuttons
- 3.2 Potentiometers
- 3.3 RGB LEDs
- 4.1 A Sound Circuit (using Piezo Buzzer)
- 4.2 Simple Musical Note
- 4.3 Music
- 4.4 Music with functions
- 5.1 Serial Monitor
- 5.2 Measuring Temperature
- 7.1 Sensors Galore
- 7.2 Light Sensor
If you'd like more ideas for experiments and projects, try Google searches for topics along with the word "Arduino" such as: "Arduino Mario Brothers Theme," "Arduino Door Bell," "Arduino Cat Toy," and so forth. Also, reach out to the HackerBoxes community on social media or in the comments below.
The Arduino UNO vs. NANO
This book, along with many other online Arduino resources, shows examples using the Arduino UNO board. The NANO is simply a more compact and breadboard-friendly version of the UNO. They are both based on the ATmega328 microcontroller making them more or less functionally equivalent.
Step 17: Introduction to Soldering
The Starter Workshop includes a nice set of the basic tools needed for soldering:
- Soldering Iron
- Soldering Iron Stand
- Soldering Iron Tip Cleaner
- Desoldering Wick
If you are new to soldering, there are a lot of great guides and videos online about soldering. Here is one example. If you feel that you need additional assistance, try to find a local makers group or hacker space in your area. Also, amateur radio clubs are always excellent sources of electronics experience.
Wear safety glasses while soldering.
You will also want to have some Isopropyl alcohol and swabs for cleaning the brownish flux residue left behind on your solder joints. If left in place, this residue will eventually corrode the metal within the connection.
Additional useful soldering tools that you may want to look into as you progress include a flux pen, a lighted magnifier (or stereo microscope), and possibly a heat gun for reflow and SMT work. When you get to the point where you need these tools, you will know when and why.
Step 18: Micro Flush-Cut Wire Cutters
These type of wire cutters are useful for a lot of things, but especially when soldering through hole leaded components. Once such components are soldered to the PCB, you will want to ship the leads off of the back very close the board. These are perfect tool.
Wear safety glasses while cutting. Even the manufacturer of these cutters included this very wise warning for their use: "WARNING: FLYING LEADS CAN RESULT IN EYE INJURY. PROPER EYE PROTECTION MUST BE WORN."
Step 19: Introduction to Soldering Kit - BadgeBuddy
The BadgeBuddy is simple and fun "introduction to soldering" kit. The BadgeBuddy is a blinky mini-badge PCB that can be hung from a conference lanyard, backpack, purse, belt, etc using the included ball chain. The BadgeBuddy uses an improved style of self-cycling rainbow LEDs for a reduced BOM with no external control circuitry required. This makes for an interesting result that is still simple enough for a first time soldering project.
- Tin the center pad under the coin cell clip with solder to create a slight raised spot
- Solder the coin cell clip onto the PCB according to outline
- Attach power switch onto the back of the PCB
- Insert flashing LEDs into front of the PCB with the short pin closest to the flat side of circle on the PCB
- Solder LEDs from rear of PCB
- While wearing safety glasses, trim LED pins
- Insert coin cell
- Celebrate success!
- Use bead chain to attach BadgeBuddy to conference badge, backpack, belt, etc.
Step 20: USB Digispark
The Digispark is an Attiny85 based microcontroller development board similar to the Arduino line, only cheaper, smaller, and a bit less powerful. The Digispark is a great way to jump into electronics, or perfect for when an Arduino is too big or too much.
- Support for the Arduino IDE 1.0+ (OSX/Win/Linux)
- Power via USB or External Source - 5v or 7-35v
- On-board 500ma 5V Regulator
- Built-in USB6 I/O Pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 6 even if you are programming via USB)
- 8k Flash Memory (about 6k after bootloader)
- I2C and SPI (vis USI)
- PWM on 3 pins (more possible with Software PWM)
- ADC on 4 pins
- Power LED
- Test/Status LED
Step 21: Dual Core ESP32 With Wi-Fi and Bluetooth
The ESP32 is a dual core 32-bit System-On-Chip. It has Wi-Fi, Bluetooth, and 512KB of RAM built-in. The clock frequency can go up to 240MHz. The ESP32 incorporates a wide variety of peripherals including: capacitive touch, ADCs, DACs, UART, SPI, and I2C.
Test out the ESP32 module before soldering the pins to the module. Random Nerds have an excellent tutorial for setting up the Arduino IDE to program ESP32 modules. Note that once the IDE is set up for it, the ESP32 board can be used a lot like an Arduino UNO or NANO. One important difference is that the ESP32 is 3.3V instead of 5V, so always keep that it mind.
Once you get the hang of programming the ESP32 module, the Random Nerds page linked above lists a variety of demo projects for the ESP32 including IoT, Web Servers, Bluetooth, Alexa Integration, MicroPython, and may others. There are a ton of great ESP32 projects out there, just search around.
Step 22: Hack the Planet
We hope you are enjoying the HackerBoxes Starter Workshop. This Workshop was designed to be a fun and thorough introduction to hobbyist electronics. Now that you've been exposed to these foundational skills, we hope that you will consider subscribing to HackerBoxes to have great projects delivered right to your mailbox each month. Please join us by SUBSCRIBING HERE.
Please share your success in the comments below and/or on the HackerBoxes Facebook Group. Certainly let us know if you have any questions or need some help with anything. Thank you for being part of the HackerBoxes adventure. Let's make something great!