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 various 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
- Interfacing Smartphones and Tablets to your Arduino Projects
- Soldering Tools and Techniques
- Assembling a Printed Circuit Board to implement an LED Game
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 item we will need is a real sense of adventure, DIY spirit, and hacker curiosity. Starting any adventure as a maker and creator can be an exciting challenge. In particular, this type of hobby electronics isn't always easy, but when you persist and enjoy the adventure, a great deal of satisfaction may be derived from persevering and figuring everything out!
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 YwRobot Power Supply Module can plug onto one end of the solderless breadboard to provide 3.3V or 5V to your circuits. The YwRobot Power Supply Module can be powered by a 9V battery using the supplied 9V battery clip with barrel connector. Be sure that the power button is switched on. Here is a lot more info on the YwRobot.
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 Circuit on the Breadboard
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 resistor (a 300 ohm resistor from the kit will work fine), 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 power terminal.
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 its own test probes and the workshop also includes a pair of clip leads for when you need to work handsfree.
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: Arduino Experimentation Platform
Let's get ready to use the Arduino UNO R3 board by attaching it to the Laser-cut Acrylic Plate. Use the small bag of hardware. The rubber feet in the same bag can go on the underside of the plate (opposite side from the Arduino) to protect your work surface from being scratched by the hardware. The solderless breadboard may also by affixed to the Platform, as shown, using the adhesive foam on the reverse of the breadboard.
Step 12: Arduino UNO Microcontroller Board
Arduino is an open-source hardware and software concept. 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.
New Arduino hardware is always coming onto the scene - often with new or refined features. A very common class of Arduino hardware is the UNO. In 2016, RobotDyn released an UNO R3 design that we have used quite a bit here at HackerBoxes. It features an SMD-version of the ATmega328P, a CH340G serial-to-USB interface chip, and of course the Arduino bootloader for use with the Arduino IDE. We especially love the microUSB cable interface. This is the same cable that is used for almost all Android phones and tablets. There is one included in the Starter Workshop, you probably have some around the house, and they are quite readily available in stores.
When using the Arduino board with a computer (for example, to load and test code), it is best to just power the Arduino UNO over the USB cable. This happens automatically when the USB cable is plugged in. While using USB power, make sure that your YwRobot (or any other) power supply is turned off or preferably completely disconnected. You generally want to void having power supplies fight against one another to supply power. You can provide power to circuits on the solderless breadboard from the UNO while it is powered by USB. Use two jumpers from the UNO pins labeled 5V and GND to connect power to the long buses on the solderless breadboard.
For future reference, both the UNO and the YwRobot can be powered at their "barrel connector" power inputs using a 9V battery and the supplied connector. You can also use any Arduino compatible AC adapter instead of the 9V battery connector. Those inputs can generally handle anything in the range of 7 Volts DC to 12 Volts DC, which is why a 9V battery works great.
USB Device Driver
The Arduino board has a built in USB/Serial bridge chip. For the RobotDyn UNO, that chip is a CH340, but there are various other types of USB/Serial bridge chips used on the various types of Arduino boards. These chips allow the computers USB port to talk to the serial interface on the processor ship of the UNO.
Your computer's operating system requires a Device Driver to communicate with the 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 13: Our First Arduino Circuit and Program
There is a very well-written book entitled Introduction to Arduino by Alan Smith. From that 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.
Getting the software (IDE) set up on your computer, wiring up your first circuit, and loading you first program can be quite a rush. We can follow the first six sections of the book as listed here. The components are included in your HackerBoxes Starter Workshop.
- 1.1 What is a Microcontroller?
- 1.2 Install the Software
- 1.3 The Integrated Development Environment (IDE)
- 1.4 Our First Circuit
- 1.5 Updated Circuit
- 1.6 Our First Program
Installing the software (section 1.2) is a nice overview, but every computer and operating system is a little different, so the steps in the book might not exactly reflect experience. Basically there are two separate things to keep in mind with regard to getting the software installed:
- The USB Driver as discussed in the last step
- The latest Arduino IDE - always available here: Arduino.cc
Once you get into the IDE, you have to select the PORT (as discussed in the book) which will look different depending upon your USB driver. 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.
Step 14: Further Arduino FUNdamentals
There are a total of at least 30 sections in the Introduction to Arduino book that we recommend exploring. All of the components needed for these are included in your HackerBoxes Starter Workshop. The remainder of these sections are listed below, 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
- 4.2 Simple Musical Note
- 4.3 Music
- 4.4 Music with functions
- 5.1 Serial Monitor
- 5.2 Measuring Temperature
- 5.3 Hooking up an LCD Display
- 5.4 Talking to the LCD
- 6.1 Binary and Hex
- 6.2 Using Graphics
- 6.3 Making a Chart
- 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.
Step 15: 32x8 LED Matrix and Using Arduino Libraries
The FC-16 module is a small PCB (about 33x33mm) supporting an 8x8 LED matrix wired to a serial interface MAX7219 LED driver chip (datasheet). The FC-16 module has pin pads on each side so that multiple modules can be easily wired in a chain. The photo shows a block of four FC-16 modules that were manufactured as a single unit.
The Parola project provides a library and example code for scrolling a text display using MAX7219 or MAX7221 LED matrix controllers and an Arduino microcontroller board. The display may be made up of any number of identical modules that are plugged together to create a wider/longer display.
Click "downloads" on the Parola site to get the library. Unzip the library into your Arduino Libraries folder.
The Parola library uses the MD_MAX72XX library which can be found here and unzipped into your Arduino Libraries folder.
Next, we need to edit the file named "MD_MAX72xx.h" in the src folder.
The line reading:
#define USE_FC16_HW 0
must be changed to read:
#define USE_FC16_HW 1
Now we are ready to use the Parola example sketches. The simplest one to start with is HelloWorld.
Note the following lines:
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
There are four FC-16 modules (MAX_DEVICES) and pins 10, 11, and 13 (along with 5V and GND) are the ones to wire up from the FC-16 pins to the Arduino using some DuPont wires.
There are some additional low-level details in this Tutorial on using the Arduino and the MAX7219 LED Display Driver IC.
Step 16: HC-05 Bluetooth Module
As a preliminary step to using the Bluetooth Module (HC-05) with an Arduino board, get a sketch running on the Arduino that is controlled using serial communications. For instance, the Parola_Scrolling sketch in the Parola Examples folder. Do not wire up the HC-05 Bluetooth module yet. From the start, set the data rate to 9600bps. That is the default for the HC-05 so this just makes it easier to transition later.
Get the program running on the Arduino and working with the serial monitor on your computer (make sure to set the computer serial rate to 9600 as well or it will not work). Now you can disconnect the computer (or just turn the IDE and serial monitor off if you still need it for power) and wire up the HC-05. Now Bluetooth is taking the place of the serial monitor. Sync your mobile device's Bluetooth radio to the HC-05 and run an app like BlueTerm on the mobile device. This will let you type to the serial port from the mobile device just as you did from the Arduino software, but this time, you are wireless.
As an advanced option, if you want to be able to leave pins 0 and 1 connected to the PC (via the USB chip), you can modify whatever sketch you are working with to use the SoftwareSerial functions and wire the HC-05 rx and tx lines onto two other pins.
Step 17: Introduction to Soldering
The Starter Workship 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: LED Dice - Soldering Kit
This LED Dice kit is a great chance to practice some through-hole soldering techniques. Hopefully, in the end, you will have a cool random dice thrown toy to play with, but don't put too much pressure on yourself if you are new to soldering.
You can take a look at the schematic and the silkscreen legends on the PCB to guide you in placing the correct components into the correct vias.
- Start with the resistors. There are different values of resistors, so make sure the correct values go into the appropriate positions. You can read the color bands and use the included color code card. We also recommend double checking the values with a meter. Resistors are not polarized and may be inserted in either direction.
- Next, there are two capacitors. C1 is an electrolytic can-style capacitor. It is polarized so makes sure the plus and minus leads end up in the correct holes. C2 is a little brownish ceramic capacitor. The leads of C2 are not polarized and may be inserted in either orientation.
- The LEDs are polarized and will not light up if connected in reverse. Check the flat portion of the circle on the silkscreen against the base of the plastic LED diffuser lens. Also, the longer lead of the LED is positive.
- With the transistors, note that there are two different kinds. They are not interchangeable even though they looks almost identical. Their pins are also polarized. Again, check the flat portion of the circle on the silkscreen against the flat face of the transistor body.
- DIP (dual in-line package) chips and chip sockets are oriented by a small half-circle on end. Make sure these line up with the similar marking on the PCB silkscreen. If your kit includes chip sockets, solder those to the board and then let them cool for a 20 seconds before inserting the chips in the correct orientation. If you are not using sockets, be VERY careful to not overhead the chip leads. Heat then very quickly and just enough to melt solder.
- The push button should old fit in one way. It operates the same if rotated 180 degrees, so that is no worry.
- Note that the power jack and power lead have a positive wire and minus wire. The power supply requirement is 4.5-6 volts DC, so the 5V output from the UNO, the YwRobot supply, or any other 5V DC supply may be used.
Step 20: 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!