HackerBox 0064: Scope

by HackerBoxes in Circuits > Electronics

7467 Views, 23 Favorites, 0 Comments

HackerBox 0064: Scope

Whole Box HB0064.png

Greetings to HackerBox Hackers around the world.

With HackerBox 0064, we can assemble, explore, and modify an ARM-based Digital Storage Oscilloscope. We'll also assemble a function generator circuit for creating continuous square, triangular, and sinusoidal waveforms. These tools can be used to experiment with alternating current (AC) circuit components on a solderless breadboard.

HackerBoxes is the monthly subscription box for enthusiasts of electronics and computer technology - Hardware Hackers - The Dreamers of Dreams.

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 really appreciate your taking a few minutes to read the FAQ.

Supplies

This Instructable contains information for getting started with HackerBox 0064. The full box contents are listed on the product page for HackerBox 0064 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 with a $15 discount, you can subscribe at HackerBoxes.com and join the revolution!

A soldering iron, solder, and basic soldering 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 Deluxe Starter Workshop for a set of basic tools and a wide array of introductory activities and experiments.

Most importantly, you will need 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.

Oscilloscopes

Oscilloscope Tutorial (Basics 101)

This video from TheGeekPub is a nice introduction to what an oscilloscope is and how we use them.

An oscilloscope (aka scope or o-scope) is a type of electronic test instrument that graphically displays varying signal voltages, usually as a calibrated two-dimensional plot of one or more signals as a function of time. The displayed waveform can then be analyzed for properties such as amplitude, frequency, rise time, time interval, distortion, and others. Early oscilloscopes used cathode ray tubes (CRTs) as their display element and linear amplifiers for signal processing. These have been largely superseded by digital storage oscilloscopes (DSOs) with thin panel displays, fast analog-to-digital converters and digital signal processors. (Wikipedia)

The word "osculate" comes from the Latin noun osculum, meaning "kiss" or "little mouth." Osculate is used in geometry for the action of a pair of curves or surfaces that touch so that they have a common tangent at the point of contact. When osculate is used to mean "kiss," the context is typically humorous. In either case, this word has nothing to do with oscilloscopes, but it'd be fun if we all said it more often.

ARM-Based DIY Oscilloscope Kit

Scope Kit.png

The DSO138 was originally designed as a training oscilloscope kit. Simplicity in structure and ease of operation were primary design goals.

There have been may versions and variations created of the DSO138. The one featured in HackerBox 0064 is dark blue, while most versions in the wild are red. This run manufactured just for us has had all of the surface mount components pre-soldered to simplify assembly. While there is quite a bit of soldering left to be done in this kit, it is all trough-hole soldering. We hope it should be fairly easy to complete.

The heart of the DSO138 is an ARM Cortex-M3 ARM processor (STM32F103C8). The display is a 2.4-inch TFT LCD with 320x240 resolution featuring 262K colors. The DSO138 design is open-source. Source code is available allowing us to add new features.

DSO138 Schematic Diagram

Scope Schem Guide.png

DSO138 Resistors and Inductors

Scope Res.png

As usual, we'll start with the lowest profile, simplest to solder components...

Resistors

The blue axial resistors have color coded bands for value identification. However, it is always best to confirm the values using an ohmmeter. Resistors can be inserted in either direction.

  • R3: 200K (red black black orange)
  • R5: 20K (red black black red)
  • R6: 300R (orange black black black)
  • R10: 3K (orange black black brown)
  • R11: 150R (brown green black black)
  • R38: 1.5K (brown green black brown)
  • R2, R4: 2M (red black black yellow)
  • R7, R36: 180R (brown grey black black)
  • R28, R40: 470R (yellow violet black black)
  • R37, R39: 10K (brown black black red)
  • R1, R14, R16: 100K (brown black black orange)
  • R8, R12, R13: 120R (brown red black black)
  • R9, R15, R26: 1K (brown black black brown)

Inductors

The three axial inductors look like fat, greenish resistors. They can be inserted in either direction

  • L1, L3, L4: 100uH

DSO138 Ceramic Capacitors

Scope Cer Caps.png

Ceramic capacitor values are generally marked in exponential notation for units of picofarads. Recall that "pico" is the metric prefix for 10^-12. 1,000 pF is the same as 1nF. 1,000,000 pF is 1,000nF which is 1uF or 0.001mF.

Some ceramic capacitor marking examples:

  1. The marking "7" is 7 picofarad
  2. "77" is 77 picofarads
  3. "776" is 77[000000] picofarads (or 77uF)

Ceramic capacitors are not polarized. They can be inserted in either direction.

The DSO138 Kit Includes

TWELVE 0.1uF Capacitors Marked "104"

  • C1, C8, C9, C10, C11, C14, C15, C16, C17, C18, C20, C23

SIX OTHER VALUES

  • C2: 220pF "221"
  • C3: 5pF "5"
  • C5: 2pF "2"
  • C7: 100pF "101"
  • C12, C13: 30pF "30"

DSO138 Electrolytic Capacitors and More

Scope ECaps.png

Electrolytic Capacitors

The SIX Electrolytic Capacitors have a "+" side and a "-" side. The "+" side has a longer lead and goes into the PCB hole marked "+". The "-" side is marked on the capacitor housing, has a shorter lead, and goes into the PCB marked with a white half-circle.

  • C19, C21, C22, C24, C25, C26: 47uF

Variable Timmer Capacitors

  • C4, C6: 30pF

LED

LEDs have a required orientation. On the PCB, the "-" (cathode) side has a round solder pad (as opposed to the square solder pad) and it is double marked by the silkscreen. The "-" is the flat side of the landing circle on the PCB. The "-" is the "line side" (as opposed to the "triangle side") of the schematic symbol printed on PCB. On the LED itself, the "-" (cathode) has a flattened edge on the red lens (to match the flat side on the PCB). The "-" lead of the LED is also shorter that the other lead. The "+" (anode) terminal of the LED has a longer lead, which goes into the square hole on the PCB.

  • D3: Red 3mm

Diodes

The two diodes have a required orientation. The white line painted onto one side of the diode must align with the painted line marking on the PCB silkscreen.

  • D1, D2: 1N4007

DSO138 Magical Crystals and More

Scope XTAL.png

Crystal

In addition to being magic, the crystal can be inserted in either direction.

  • Y1: 8MHz

TO-92 Devices

There are three devices in three-terminal TO-92 packages. This package has a flat side and a rounded side. Before inserting each TO-92 device, be sure it is oriented such that the round and flat side match up with markings on the PCB silkscreen.

  • Q1: S8550 (PNP Transistor)
  • Q2: S9014 (NPN Transistor)
  • U4: 79L05 (Negative 5V Linear Voltage Regulator)

Momentary Tactile Switches

SW4, SW5, SW6, SW7, SW8: 6 x 6 x 5 mm

DSO138 Remaining Switches and Connectors

Scope Done No TFT.png

Remaining Components

The remaining components all go exactly where they fit:

  • J1: BNC Connector
  • J2: Small Wire Loop (can be a trimmed lead)
  • J3: 2x20 Female Header
  • J4: MiniUSB Socket
  • J5: 1x3 Male Header
  • J6: 1x4 Male Header
  • J9: White Two-Pin Power Socket (notch faces edge of board)
  • J7, J8: Black Two-Pin Female Headers
  • SW1, SW1, SW3: 2P3T Slide Switches

Display Headers

  • J1: Male 2x20 Header
  • J2, J3: Male 1x2 Headers

Do Not Mount Display Yet

Working With the DSO138

Scope Jumps Leads.png

DSO138 Power Requirements

In the next steps we will need to power up the DSO138. This requires approximately 9V and no more than 12V. The white JST power connector can be used or the 5.5mm Barrel Jack. The power source must be able to supply about 200mA, so a 9V battery may work for a while, but a proper supply is preferable. Note that the provided MT3608 DC-DC switch mode boost converter module can take an input of as little as 2V and output 5-28V depending upon the potentiometer setting.

Finalize and Test the DSO138

  1. Short Jumper JP3 with a small blob of solder
  2. Power up the DSO138
  3. Measure the voltage between DGND and TP22
    1. If TP22 is not 3.3V, follow the debug information below
    2. If TP22 is 3.3V, move ahead
  4. Unplug, or turn off, the power source
  5. Short Jumper JP4 with a small blob of solder
    1. Some suggest that also shorting JP5 helps stabilize power to this LCD type
    2. Either way, shorting JP5 does not appear to cause problems for this LCD
  6. Seat the Display onto the Main PCB
  7. Power up the DSO138 Again
  8. Using the alligator clip cable, place the red clip onto the J2 wire loop
    1. You can also use the 10X probe but switch it to 1X
  9. Set the sliders to AC, 0.1V, and X5
  10. Set the green time/div field on the screen to 0.5ms using SEL and +/-
  11. You should see a nice square wave on the screen

Additional Resources

Video: How to use the DSO138

Move usage and debug information: DSO138 User Manual

Mod to Run DSO138 off USB Power (The necessary 100uH Inductor, 2.2K Resistor, and 1nF Capacitor are included in the AC Components Baggie)

JYE Tech shares this page with various files, firmware images, libraries, diagrams, etc. for the DSO138

The ardyesp Arduino-based project is one of several different open source DSO138 firmware builds available online. Check google and github for others. The included CH340 USB-to-Serial module can be useful for interfacing to, and programming, the STM32 ARM chip. Be sure to set the CH340 module for 3.3V operation.

The project combines an electrocardiogram analog front end module (see HackerBox 0055) with the DSO138 to provide a portable ECG system.

Printable DSO138 Simple Case - search thingiverse for other options.

ICL8038 Function Generator Kit

Func Gen Kit.png

The ICL8038 is a precision oscillating integrated circuit with multiple waveform outputs. The frequency and duty cycle of the output waveform can be controlled by current or resistance.

The kit is designed to operate over the frequency range of 50KHz-250KHz, divided into five bands. Jumper switch J2 selects the frequency band. Jumper switch J3 selects between square, triangle, and sinusoidal output signals.

Trimmer RP1 adjusts the frequency within each of the five bands. RP2 adjusts the square wave duty cycle. RP3 adjusts the square wave linearity. RP4 adjusts sine wave distortion adjustment. RP5 adjusts output amplitude.

The circuit can be powered by 12-24V applied to the barrel jack J1.

The output waveform is available at header J4 output. The bottom pin of J4 is GND. The top pin is the output waveform including DC bias. The middle pin is the output signal capacitively coupled to remove the DC bias.

Function Generator - Begin Assembly

FuncAsm1of2.png

Phase A:

  • Bare PCB
  • That was easy!

Phase B (Resistors):

  • Resistors may be oriented in either direction
  • R1, R3, R5, R6, R7: 1K "Brown Black Black Brown"
  • R2: 20K "Red Black Black Red"
  • R4: 82K "Grey Red Black Red"

Function Generator - Complete Assembly

FuncAsm2of2.png

Phase C (Ceramic Capacitors):

  • These may be oriented in either direction
  • C2: 1uF "105"
  • C5: 10nF "103"
  • C6: 1nF "102"
  • C8: 330pF "331"
  • C3, C4, C7, C9: 100nF "104"

Phase D (pay attention to part orientation):

The two Electrolytic Capacitors (C1 and C10) have a "+" side and a "-" side. The "+" side has a longer lead and goes into the PCB hole marked "+". The "-" side is marked on the capacitor housing, has a shorter lead, and goes into the PCB marked with a white half-circle.

  • C1: 47uF
  • C10: 10uF

The LED also has a required orientation. On the PCB, the "-" (cathode) side is closest to the edge of the PCB and it is double marked on the silkscreen. The "-" is the flat side of the landing circle on the PCB. The "-" is the "line side" (as opposed to the "triangle side") of the schematic symbol printed on PCB. On the LED itself, the "-" (cathode) has a flattened edge on the red lens (to match the flat side on the PCB). The "-" lead of the LED is also shorter that the other lead.

  • D1: Red LED

The transistor has a flat side and a rounded side. Before inserting the transistor, be sure it is oriented such that the round and flat side match up with markings on the PCB silkscreen.

  • T1: NPN (9013 or 8050)

Phase E (Potentiometers):

The trim pots only fit into the PCB in one orientation.

  • RP1: 10K "103"
  • RP2: 1K "102"
  • RP4: 100K "104"
  • RP3, RP5: 20K "203"

Phase F (the end of laughter and soft lies):

The IC socket is oriented so that the small half-circle on one end matches the marking on the PCB. After the socket is soldered and cools, the IC can be inserted being sure to align the same marking to match the socket and the PCB silkscreen. The leads of the IC need to be VERY GENTLY bent inward (to about 90 degrees with the IC housing) so they can more easily fit into the socket. This can be done by laying the IC on a hard surface on its side and applying torque against it to gently bend the entire side row of pins at once. Then flip it over and do the other side.

  • IC1: DIP-14 Socket
  • IC1: ICL8038 Integrated Circuit (IC)

The four remaining connectors only fit how they fit.

  • J1: Power Jack (5.5mm barrel with 2.1mm positive center)
  • J2: Frequency Band Selector (2x5 pins)
  • J3: Square, Triangle, Sine Selector (2x3 pins)
  • J4: Output Header (3 pins)

AC Circuit Components

AC Components.png

Resistors, Inductors, and Capacitors (RLCs) can be used to manipulate the frequency contents of AC signals and diodes can be used to "chop" AC signals. You can generate a signal, view it on your oscilloscope and then see how inserting a diode or a frequency selective RLC circuit into the path modifies the view.

Try using the included AC circuit components:

  • 1N914 Diode
  • 10K Potentiometer
  • 100uH Inductor (matter wrap) **
  • 100mH Inductor (glossy wrap)
  • 1nF Ceramic Capacitor "102" **
  • 10nF Ceramic Capacitor "103"
  • TWO 2.2K Resistors **

Note that the components marked ** can be used in the DSO138 Power Supply Mod mentioned earlier.

We will share some example AC circuits once you get a change to try them out for yourself.

Information Coding in Outer Space

Space Coding.png

In February 2021, the NASA Mars 2020 Perseverance Rover landed on the surface of Mars. The landing involved a supersonic parachute inflation and the first ever autonomous guided landing on Mars. Hidden in the 320 red and white fabric panels of the parachute is the message "DARE MIGHTY THINGS" along with the Earthly coordinates of the NASA Jet Propulsion Laboratory (JPL).

Secret messages appear as Mars rover gets to work.

Of course, space is no stranger to human information encoding efforts. Golay Codes, LDPC (low-density parity-check) Codes, and Turbo Codes have been widely used for satellite, interplanetary, and deep space comms.

Dare Mighty Things

outro.png

We hope you are enjoying this month's HackerBox adventure into electronics and computer technology. 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 revolution. Live the HackLife. Get a cool box of hackable gear delivered right to your mailbox each month. Surf over to HackerBoxes.com and sign up for your monthly HackerBox subscription.