Introduction: HackerBox 0102: Flea-Scope

Welcome to HackerBox 0102 where we will configure and explore the Flea-Scope USB oscilloscope based on a PIC32MK microcontroller and leveraging a simple browser interface. Experiment with a P6100 1X/10X oscilloscope probe. Stimulate external circuits using the Flea-Scope's builtin waveform generator. Prototype and experiment with electronic circuits quickly and easily using a solderless breadboard. Understand resistive voltage dividers and extend the concept to frequency selective circuits using inductors and capacitors. Implement and verify high-pass and low-pass filter circuits. Turn the Flea-Scope into an embedded system running StickOS BASIC and dive deeper by implementing a simple Simon game.

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 0102. The full box contents are listed on the product page for HackerBox 0102 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. Subscription members save at least $15 every month and automatically receive each new HackerBox shipped immediately off 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 tools and supplies along with 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.

Step 1: Flea-Scope USB Oscilloscope

An oscilloscope is an electronic test instrument that graphically displays varying voltages of one or more signals as a function of time. Their main purpose is capturing information on electrical signals for debugging, analysis, or characterization. Oscilloscopes are used in the sciences, engineering, biomedical, automotive and the telecommunications industry for maintenance of electronic equipment and laboratory work. (Wikipedia)

The Flea-Scope is a USB oscilloscope supporting 18 million sample-per-second (Msps). In addition to oscilloscope functionality, the Flea-Scope is also a mixed-signal logic analyzer and a waveform generator. The Flea-Scope is based on the PIC32MK microcontroller and can be controlled by any Chromium-based web browser that supports WebUSB API or Web Serial API running on a computer, tablet, or smartphone. There is no additional software to install.

Rich Testardi is the mastermind inventor behind the Flea-Scope. Here at HackerBoxes, we were immediately excited when we saw early details of his project. We reached out to Rich and eventually partnered with him to manufacture thousands of units. We are very proud to share Rich's dream of bringing the Flea-Scope to as many people as possible.

Step 2: Flea-Scope Quick Start

Plug the Flea-Scope into your computer using the micoUSB cable.

Three LEDs (red, green, and blue) will illuminate on the Flea-Scope with the blue LED blinking.

Open the Flea-Scope GUI by directing a Chromium-based web browser to this URL.

Click the "Start Connect" button on the GUI.

In the pop-up window, select "Flea-Scope" and hit "Connect".

Connect the 10X probe to the BNC Coax connector of the Flea-Scope.

Switch the probe from 10X mode to 1X mode.

Clip the probe onto the outermost pin hole of the three pin wave header as shown in the image. This connects the output of the waveform generator to the scope input. A sine wave should appear on the oscilloscope display.

Test switching the "wave out" setting of the waveform generator to "square" and then "triangle" to see the results.

Also test changing the "hertz out" setting from the 1KHz default to 3KHz.

A full User's Guide for the Flea-Scope can be found here and includes a schematic diagram for the device.

Step 3: Header Pins and Breadboards

Header pins - two sections are provided. Each is about 18-22 pins long. Snap three pins from each one and then snap off 12 pins from each one. You will need two sections with 3 pins and two sections with 12 pins. Any additional pins are scrap.

As shown in the top portion of the diagram, insert both of the 3 pin sections into the rows of 3 pin header holes adjacent to the BNC coaxial connector. These should be inserted pointing "up" from the component side of the Flea-Scope PCB.

Next, insert the two 12 pin sections into the 12 pin rows at the outer edges of the Flea-Scope. These should be inserted pointing "down" from the solder side of the Flea-Scope PCB.

The PCB holes for the headers are stagger-offset allowing the PCB to grab onto the pins. The header pins can be used this way (without soldering) if you only intend to connect to the pins with jumper wires. However, if you intend to press the Flea-Scope into the solderless breadboard, or if you just want the pin headers to be more securely fixed to the Flea-Scope, it is worth taking a moment to solder the header pins into place.

Solderless breadboards are a fast and easy way to prototype and experiment with electronic circuits and systems. Purple bubbles on the drawing illustrate the two different types of connections on the solderless breadboard.

The four long horizontal bubbles 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 connected to the +3.3V power supply line.

The eight short vertical bubbles are "terminal strips" generally used to connect the pins of various circuit components. Each vertical column of five pins are connected together in the same way that the long horizontal rows of the power rails are connected together. Even though only 8 vertical bubbles are illustrated, all 60 of the vertical 5 pin columns are connected together. Note that the upper and lower terminal strips are separated by a gap of exactly the distance between the two rows of pins on a standard DIP Chip. Accordingly, the upper and lower terminal strips are not connected to one another.

Connect the Flea-Scope to the breadboard using two male-female Dupont jumper wires. Connect the female ends of the jumpers to the "Wave Out" pin and the "Scope in" pin of the Flea-Scope. Insert the male pins of the jumpers into the same five-pin terminal strip of the breadboard, thus connecting them together. The oscilloscope display should look the same as it did when the probe was clipped on the "wave out" pin.

Note that the voltage on the oscilloscope display peaks at about 3.3V.

Before moving on, appreciate that the "Wave Out" signal is output from the waveform generator and serves as the input to the circuit. The output of the circuit is fed into "Scope In" to be viewed on the oscilloscope screen. Don't let the goes-intas and the goes-outas confuse you.

Waveform Generator [WAVE OUT]  -->  External Circuit  -->  [SCOPE IN] Oscilloscope 

Step 4: Voltage Divider

Using three male-female dupont jumpers, connect two 1K resistors in series between the "wave out" pin and the "ground" pin and connect the midpoint point between the resistors to the "scope in" pin.

According to our experience with how sets of pins interconnect on the solderless breadboard, it should be apparent how this arrangement implements the circuit divider according to the provided circuit diagram.

When R1=R2 (in this case 1,000 Ohm or 1K), the "voltage divider" factor R2/(R1+R2) reduces to 1/2. Accordingly, Vout = 1/2 Vin, thus dividing the voltage in half. Note that the voltage on the oscilloscope display now peaks at about 1.65V (half of 3.3V).

Note that the resistors in the voltage divider don't really care about the frequency of the sine wave. If you use the "hertz out" field to change the frequency of the waveform generator, the dividing factor remains roughly 1/2.

The potentiometer is basically two resistors that are differently "divided" based on the rotation of the shaft. Replace the two 1K resistors with the potentiometer as shown in the lower left of the image. While observing the sine wave on the oscilloscope display, turn the potentiometer back and forth to see the amplitude of the wave increase and decrease from 0V to around 3.3V.


Step 5: Frequency Selective Circuits

Unlike resistors, there are other circuit components that operate differently upon sine waves having different frequencies. These include inductors (coils) and capacitors.

An inductor can be thought of as a resister whose resistance gets bigger as the applied frequency gets higher.

A capacitor can be thought of as a resistor whose resistance gets smaller as the applied frequency gets higher.

Placing these components that act like "frequency selective resistors" into our voltage divider will divide the voltage to different levels based on the frequency of the signal applied. In other words, the output will be bigger or smaller at different frequencies. Such behavior is that of a (frequency) filter.

Capacitive High-Pass Filter

Start with the resistive voltage divider from the previous step. Note that the waveform generator has a "wave out" pin in the center and a "wave out with series 4K" pin closer to the PCB edge. Use the the center pin for these experiments so that the extra 4K resistor does not invite itself into our calculations.

Replace R1 (closer to the orange wire) with the 100nF Capacitor (brownish disc).

Change the "signal" setting on the oscilloscope GUI to "ac".

Switch the "hertz out" field back and forth between 500 and 5K. Which has a higher amplitude?

The 5KHz signal should have a higher amplitude because this is a high-pass filter. The capacitor has a low resistance to the higher frequency (acts more like a wire). However, the capacitor has a higher resistance to the lower frequency and tends to block the signal from passing as easily.

Another was to consider this is with the voltage divider equation. We are basically making R1 big at low frequencies and R1 small at high frequencies.

We can verify these observations against theory using the DigiKey Low Pass/High Pass Filter Calculator. Select the "High Pass Filter" tab. Select the "RC" filter configuration. Enter (1000) 1K for the resistance and 100nF for the capacitance. The calculator tells us that the cutoff frequency is about 1592Hz, which explains why 5KHz (5000Hz) mostly passes the filter while 500Hz is mostly blocked by the filter.

Capacitive Low-Pass Filter

Start again with the resistive voltage divider.

Replace R2 (closer to the brown wire) with the 100nF Capacitor (brownish disc).

Switch the "hertz out" field back and forth between 500 and 5K. Which has a higher amplitude?

The 500Hz signal should have a higher amplitude because this is a low-pass filter.

Again, consider the voltage divider equation. We are basically making R2 big at low frequencies and R2 small at high frequencies.

In the DigiKey Low Pass/High Pass Filter Calculator, select the "Low Pass Filter" tab, select the "RC" filter configuration, enter (1000) 1K for the resistance, and enter 100nF for the capacitance.

Inductive High-Pass Filter

Start again with the resistive voltage divider.

Replace R2 (closer to the brown wire) with the 100mH Inductor (black shrink-wrapped cylinder).

Switch the "hertz out" field back and forth between 500 and 5K. Which has a higher amplitude?

The 5KHz signal should have a higher amplitude because this is a high-pass filter.

Again, consider the voltage divider equation. We are basically making R2 big at high frequencies and R2 small at low frequencies.

In the DigiKey Low Pass/High Pass Filter Calculator, select the "High Pass Filter" tab, select the "RL" filter configuration, enter (1000) 1K for the resistance, and enter 100mH for the inductance.

Inductive Low-Pass Filter

Start again with the resistive voltage divider.

Replace R1 (closer to the orange wire) with the 100mH Inductor (black shrink-wrapped cylinder).

Switch the "hertz out" field back and forth between 500 and 5K. Which has a higher amplitude?

The 500Hz signal should have a higher amplitude because this is a low-pass filter.

Again, consider the voltage divider equation. We are basically making R1 big at high frequencies and R1 small at low frequencies.

In the DigiKey Low Pass/High Pass Filter Calculator, select the "Low Pass Filter" tab, select the "RL" filter configuration, enter (1000) 1K for the resistance, and enter 100mH for the inductance.

Step 6: StickOS BASIC

The Flea-Scope includes a special "deep-dive interactive mode" where you can interactively configure pins, write, debug, and run BASIC programs - turning the Flea-Scope an embedded system with a slick web interface.

Access the StickOS BASIC deep-dive UI at this URL

Additional Information:

Step 7: Simple-Simon Game

You remember the game - four buttons, four lights, and a sound buzzer. To play, you just repeat the “challenge” pattern as it gets longer and longer until you fail.

Using Flea-Scope StickOS BASIC, it is easy to build a simple-simon game

The details in the PDF file show a couple different ways to assemble the circuit. We used yet a third way as shown in the image above. To follow our example, start with 11 male-female Dupont jumpers between the Flea-Scope and the solderless breadboard like so:

Brown  B1  Left Side of 1st Button
Red    A1  Long Pin of 1st LED
Orange B3  Left Side of 2nd Button
Yellow A3  Long Pin of 2nd LED
Green  B6  Left Side of 3rd Button
Blue   A5  Long Pin of 3rd LED
Violet B8  Left Side of 4th Button
Grey   A7  Long Pin of 4th LED

White  A4  Buzzer
Black  3V3 Buzzer
Brown  GND Top Ground Rail

Of course, the wire colors do not matter at all, but it is easier to follow a visual example.

Additional connections:

  • all four short LED pins go to top ground rail
  • the grey diagonal preformed jumper connects the top and bottom ground rails
  • the four orange preformed jumpers connect the right side of each button to the bottom ground rail

Once the circuit is set up, copy and paste the code as described in the PDF file.

Step 8: Interesting and Effective

"I think that hackers - dedicated, innovative, irreverent computer programmers - are the most interesting and effective body of intellectuals since the framers of the U.S. Constitution."

- Steven Levy, Hackers: Heroes of the Computer Revolution

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 on other social media. Email support@hackerboxes.com anytime with questions or whenever you need some help.

Want more? Surf over to HackerBoxes.com and join us as a monthly HackerBox subscription member. You'll get a cool box of hackable gear delivered right to your mailbox every month and you'll enjoy a generous member discount.

Please consider sharing this free Instructable with others who may be interested in learning about these subjects. We really appreciate your support and "word of mouth advertising" is the greatest compliment that we can receive.