HackerBox 0086: LoFi

by HackerBoxes in Circuits > Arduino

3665 Views, 5 Favorites, 0 Comments

HackerBox 0086: LoFi

HB0086 Whole Box.png

Welcome to HackerBox 0086 and many things LoFi. Configure and program the Arduino Nano microcontroller module. Assemble and tune an AM/FM Radio Receiver Kit. Build an Arduino-based Chromatic Theremin - an electronic musical instrument that you can play without touching. Experiment with Arduino A.M. Radio Transmitters for both beaconing and audio signals.

HackerBox is the original monthly subscription box for electronics, computer technology, and hacker culture. Each HackerBox is a discovery box, which means all members await and enjoy a new surprise each month. Tech, toys, knowledge, and fun. It's like having a hacker convention, your birthday, and the first day of school - every month - right in your mailbox.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.

Supplies

This Instructable contains information for getting started with HackerBox 0086. The full box contents are listed on the product page for HackerBox 0086 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month, you can subscribe at HackerBoxes.com and join the party! Subscribers save at least $15 every month and get each new HackerBox shipped immediately off of the production line.

A soldering iron, solder, and basic assembly tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for basic tools and a wide array of introductory activities and experiments.

The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

WEAR SAFETY GLASSES WHEN SOLDERING, WHEN TRIMMING WIRE LEADS, OR WHEN CUTTING, DRILLING, ETC.

Set Up the Arduino Nano

Nano.png

The Arduino Nano is possibly the most common microcontroller (MCU) module currently in use. The Arduino Nano is a surface-mount, breadboard-friendly, miniaturized Arduino board with integrated USB. It is amazingly full-featured and easy to hack. The included variant is based on the ATmega328P MCU operating on 5V at 16Mhz. In includes an on-board USB-C port connected to a CH340 USB/Serial bridge chip.

First Connection

Connect the Arduino Nano into a USB port of your computer. The power LED will come on and shortly after that, a second LED will start to blink slowly. This happens because the Nano is pre-loaded with the BLINK program, which is running on the brand new Arduino Nano.

Software 

We will use the Arduino IDE to program and interface with the Arduino Nano.

  1. Download and install the Arduino IDE
  2. Connect the Arduino Nano to a USB port of your computer
  3. Run the Arduino IDE
  4. In the IDE, select Tools > Board > Arduino Nano
  5. Also select Tools > Processor > ATmega328P (Old Bootloader)
  6. Also select Tools > Port > (the USB port connected to the Nano)

USB Troubleshooting

If there are multiple USB ports to select from, you can do a little test. One of the ports will disappear from the list when you unplug the USB cable from the Nano and then navigate back into the Tools dropdown menu again. That one that disappears is the port connected to the Nano.

If there are no USB ports to select (or at least there is no port that disappears when unplugged), you may need to install a driver for the USB chip on the Nano module. This chip is the CH340 which have a driver included in most modern operating systems, but there is more information here if you need it.

Example Code

Load up a piece of example code:

File->Examples->Basics->Blink

Blink is actually the code that was preloaded onto the Nano and should be running right now to slowly blink the onboard LED. Accordingly, if we load this example code, nothing will change. Instead, let's modify the code a little bit.

Looking closely, you can see that the program 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.

Theremin Soldering Kit

Arduino Nano Theremin Solder Kit Tutorial - Cyber City Circuits

The Theremin Soldering Kit was designed by Cyber City Circuits.

It's a fun musical instrument featuring ultrasonic, wireless control simply by waving your hands.

Follow the video or the online assembly instructions.

Note that the video and instructions describe the 100 ohm resistor as having brown, black, brown bands ("4 Band" resistors have three value indicator bands and one tolerance indicator band). However, the HackerBox kit includes a "5 Band" 100 ohm resistor where the value indicator bands are brown, black, black, black. The resistor body also happens to be blue instead of beige, so that makes it easy to find.

If you do not grok how a first resistor marked brown, black, brown and a second resistor marked brown, black, black, black are both 100 ohms, the Digi-Key Resistor Color Code Calculator will help. Switch between the "4 band" and "5 band" tabs at the top and play with the values.

Note that the particular speaker included in the HackerBox kit does not have any polarity markings, but it will work in either orientation.

After assembly, program the Arduino Nano using either sketch from the GitHub repository.

Time to Make Music

Simply wave your hand in front of the Theremin to create different notes. Using the ultrasonic sensor, the Arduino Nano detects the distance of your hand from the instrument and then translates that distance into notes on a scale.

Cyber City Circuits

Cyber City Circuits - We ARE Your Small Business Manufacturing Department

HackerBox 0086 is a collaboration with Cyber City Circuits. They provide a range of engineering services including product design, prototyping, PCB assembly, reverse engineering, and training.

Cyber City Circuits is a disabled veteran owned small business. They are a great team to work with.

If you have a project that might benefit from their expertise, just reach out to Sales@CyberCityCircuits.com

AM/FM Receiver Kit

AMFM Blocks.png

This kit is a very simple AM/FM radio receiver. It is LoFi as heck. It provides a good learning experience, not a good listening experience. There are four main blocks to the receiver system. Let's consider the color-coded blocks while we examine the schematic diagram.

Power (Shown in BLUE)

The receiver is powered by a two AA battery cells. The power switch just to the left of the battery is actually part of the volume potentiometer. When you turn the volume all the way down it will click at the end and cut off the power supply.

A.M. Receiver (Shown in Yellow)

The Amplitude Modulation (A.M.) receiver block is based on the CD7642/TA7642 (datasheet) chip. This simple integrated circuit contains only ten transistors. The chip is carried in a compact three-pin TO-92 package that is usually used for individual transistors.

The AM block also comprises an inductor coil with a long ferrite core. In the schematic, notice that the AM inductor symbol has a line above it. That line symbolizes the ferrite core.

The AM block is tuned with variable capacitor CB. The tuning capacitor for the FM block (CA) is in the same package as CB. CA/CB is a dual variable capacitor with two tuning capacitors (AM and FM) in a single package.

The two elements (coil and capacitor) make up a tank circuit or tuned resonator. This circuit is the electronic version of a tuning fork and is often used in radio tuning.

Another example project using this same little A.M. chip can be seen here.

F.M. Receiver (Shown in Green)

The Frequency Modulation (F.M.) receiver block is based on the CD9088/TDA7088T (datasheet) chip.

The chip implements a superheterodyne receiver where a voltage controlled oscillator (VCO) output is mixed with the received radio frequency (RF) signal from the antenna. This mixing (heterodyning) shifts (down-converts) the received signal from its original radio frequency (generally 88-108MHz) to an intermediate frequency (IF) of about 70KHz. The message (voice, audio, etc.) can then be more easily detected from this lower frequency signal.

Audio Amplified (Shown in Orange)

The audio amplifier is based on the TDA2822 (datasheet) chip. The amplifier can drive the speaker or headphones.

Only one of the output signals from either the AM receiver (yellow block) or the FM receiver (green block) is selected by switch S1. The selected signal is then capacitively coupled into the audio amplifier circuit. Coupling a signal through a series capacitor (also known as A.C. coupling) can block any D.C. bias in the signal from passing through.

The audio amplifier circuit includes a variable resistor (VOL) for adjusting the amplification level (audio volume). The amplified output signal is fed into the speaker or headphones.

AM/FM Receiver Kit Parts

AMFM Parts.png

The AM/FM Receiver Kit has quite a few parts starting with a PCB and four semiconductor devices

AM/FM Receiver PCB
IC1 CD9088 (SO-16 F.M. Receiver Chip)
IC2 CD7642 (TO-92 A.M. Receiver Chip)
IC3 TDA2822 (DIP-8 Audio Amplifier Chip)
LED Red 3mm Light Emitting Diode

12 Resistors

R1  1K	  brown, black, red
R2 33K orange, orange, orange
R3 22K red, red, orange
R4 680R blue, gray, brown
R5 1.5K brown,green, red
R6 10K brown, black, orange
R7 22R red, red, black
R8 3.3K orange, orange, red
R9 330R orange, orange, brown
R10 100K brown, black, yellow
R11 4.7R yellow, violet, gold
R12 4.7R yellow, violet, gold

26 Ceramic Capacitors

C1   471
C2 104
C3 202
C4 683
C5 104
C6 104
C7 221
C8 25p
C9 104
C10 82p
C11 5p
C12 331
C13 332
C14 181
C16 104
C17 332
C18 104
C19 202
C20 104
C22 103
C24 104
C26 104
C27 104
C28 104
C29 104
C30 104

4 Electrolytic Capacitors

C15   220uF
C21 10uF
C23 100uF
C25 100uF

Additional Components

L1    7T5 Inductor Coil
L2 8T5 Inductor Coil
CA/B Variable Tuning Capacitor
J1 Headphone Jack
S1 AM/FM Switch
VOL Potentiometer with Switch
Speaker
Battery Holder (2 x AA)
Telescoping FM Antenna
Solder Lug
Three Screws
Two Plastic Dials
AM Radio Coil
Ferrite Rod for AM Coil
Plastic Mount for Ferrite Rod
Three Insulated Jumper Wires

AM/FM Receiver Kit Assembly

AM FM Asm1.png
  • Start by placing the CD9088 (F.M. Receiver Chip) on the back of the PCB. Match the pin one dot on the chip to the pin one indicator notch on the PCB silkscreen.
  • Place the 12 resistors. Be sure to know the value of each resistor before soldering it into place. Measure with a multimeter if necessary. Resistors are not polarized and can be inserted in either direction. Note the PCB silk screen markings that show how some of the resistors are to be flat against the board and some are standing up vertically.
  • Use the trimmed lead from one of the resistors to form the jumper wire J1.
  • Place the 26 Ceramic Capacitors. Carefully confirm the value marking of each capacitor before soldering it into place. Ceramic capacitors are not polarized and can be inserted in either direction.
  • The two small inductors L1 and L2 are very similar but one had 8 turns and one has 7 turns. Hold them against each other to see which is slightly wider by one turn. That is the 8T5 coil and the other is the 7T5 coil. The 5 indicates that they are both about 5mm in diameter. The inductors are not polarized.
  • The four electrolytic capacitors are polarized. They must be inserted in the correct orientation. There is white hatching on the PCB silkscreen to designate the negative side of each electrolytic capacitor. Match this to the white bar showing a "-" marking on the corresponding capacitor. That negative terminal of the capacitor will also have a shorter lead than the positive terminal. Positive terminals of devices are generally indicated by having a longer wire.
  • The positive terminal (anode) of the red LED has a longer lead (surprise, surprise) and should be oriented adjacent to the "+" marking on the PCB silkscreen.
  • The DIP-8 chip and the 3 pin TO-92 chip must both be oriented to match the markings on the PCB silkscreen.
  • The variable capacitor has a wider tab and smaller tab. The smaller tab goes over the edge of PCB, which is the only direction it should easily fit without forcing it in.
  • The volume potentiometer, AM/FM switch, and the headphone jack positioning should be obvious according to the PCB holes and markings.

AM/FM Kit Final Assembly and Tuning

AM FM Asm2.png

Identify the Hardware

  • There are three screws and solder lug.
  • The thicker screw and the solder lug go with the telescoping FM antenna.
  • The shorter screw attaches the larger plastic dial onto the variable tuning capacitor.
  • The longer, skinny screw attaches the smaller plastic dial onto the volume potentiometer.

A.M. Radio Coil

  • Slip the coil over the ferrite rod.
  • Position the plastic mount over one end of the ferrite rod.
  • Press the plastic mount into the notch along the top of the PCB.
  • Feed the leads from the coil through the hole in the PCB just to the left of the switch.
  • Solder the leads onto the two pads marked "AM" on the rear of the PCB.

Speaker

  • Use two jumper wires to connect the speaker to the two pads marked "SP" on the rear of the PCB.

Telescoping F.M. Antenna

  • Use one jumper wire to connect the soldering lug on the antenna to the pad marked "ANT" on the rear of the PCB.

Battery Housing

  • Solder the black lead of the battery housing to the pad marked "-" on the rear of the PCB.
  • Solder the red lead of the battery housing to the pad marked "+" on the rear of the PCB.

Power On

  • Put two AA cells into the battery holder.
  • Turn the volume potentiometer to click the circuit on. The red LED should light up.
  • Turning the capacitor dial to see if you hear any transmission on FM or AM. You probably will not.

FM Tune Up

  • Switch the selector to FM and turn the volume up.
  • Extend the telescoping antenna.
  • Spread out the turns of the 8T5 coil a little bit. This is the little coil next to the big tuning dial.
  • Use a small screwdriver to adjust the FM fine tuning screw on the back of the variable capacitor.

AM Tune Up

  • Use a small screwdriver to adjust the AM fine tuning screw on the back of the variable capacitor.

Arduino AM Beacon Transmitter

AM Beacon.png

This example is quick and easy. Simply connect an antenna wire to pin 11 of the Arduino Nano and run the attached AM_Beacon.ino sketch.

The generated signal can be received using an AM radio tuned near 900KHz. If you encounter interference on that frequency, move to a different frequency by modifying this code in setup():

 //Carrier Frequency generation
 uint32_t fTransmit = 900; //KHz

This transmission technique is pretty sloppy (LoFi A.F.) and splatters RF signals where they probably do not belong. It is very low power, but in the spirit of being a good steward of the electromagnetic environment, don't leave circuits like this operating any longer than needed to perform some quick experiments or demos.

Downloads

Arduino AM Audio Transmitter

AM Audio TX.png

The beacon example can be expanded to transmit an audio signal instead of just dots and dashes.

This video shows how to assemble the components according to the schematic.

The following tips may be helpful as well:

  • Solder the pins for the TRRS breakout module.
  • Plug the 3.5mm audio patch between the TRRS breakout and an audio source.
  • The TIP pin of the TRRS is the Audio Signal.
  • The RING2 pin of the TRRS is the Ground.
  • The ceramic capacitor is not polarized. It can be oriented either way.
  • The two resistors are also not polarized. They can be oriented either way.
  • Connect a wire to D11 as an antenna.

Once the hardware is set up, download and run the attached AM_Audio_TX.ino sketch.

As noted in the sketches, these Arduino AM transmitter examples are based on this project.

Downloads

Online Audio Fun With Google

Introducing Chrome Music Lab

Hack Audio

Hack Audio.png

hackaudio.com is a fantastic introduction to Audio Digital Signal Processing (DSP). It is intended for a range of backgrounds including those with years of programming experience as well as those ready to write their first line of code. Computer programming is used to create audio effects using digital signal processing.

Trust Your Technolust

outro.png

We hope you are enjoying this month's HackerBox adventure into electronics, computer technology, and hacker culture. Reach out and share your success in the comments below or other social media. Also, remember that you can email support@hackerboxes.com anytime if you have a question or need some help.

What's Next? Join the party and live the HackLife. Get a cool box of hackable gear delivered right to your mailbox each month and enjoy a generous member discount. Surf over to HackerBoxes.com right now to sign up for your monthly HackerBox subscription.

Please consider sharing this free Instructable with others who may be interested in learning about these subjects. We really appreciate your support!