Project

A Raspberry Pi Pico Controlled Frequency Shift Audio Oscillator:  A Radio Shack Classics Circuit Remix

November 26, 2023 by Don Wilcher

A PIR sensor detects objects to allow a Raspberry Pi Pico running MicroPython code to adjust the frequency of a Science Fair electronic oscillator circuit with audio output.

In my previous remix projects—Building a One-Shot Multivibrator with an ESP32 Terminal Display and the Transistor Controlled Switching of an LED Display—I used solderless breadboards for the wiring. This Radio Shack Classics Circuit Remix will maintain the original approach of point-to-point wiring using spring terminals. The remix portion of the project involves the construction of a solderless breadboard controller device interacting with a frequency shift audio oscillator using a passive infrared (PIR) sensor and a microcontroller.

 

Point-To-Point Wiring of Vintage Electronic Circuits

Vintage electronic products like vacuum tube radios and televisions were constructed using bus bars and terminal strips. The bus bars provided the high side and ground voltage rails for the vacuum tube radio and television electronic circuits.

Figure 1 illustrates a vacuum tube audio amplifier electronic circuit constructed using point-to-point wiring. This wiring method was effective for building the electronic circuits.

 

A vacuum tube audio amplifier constructed using point-to-point wiring

Figure 1. A vacuum tube audio amplifier constructed using point-to-point wiring. Image used courtesy of PS Audio

 

In addition, the point-to-point wiring of vacuum tube circuits allowed easy changes and replacement of electronic components. The ability to easily build and repair these point-to-point circuits provided educational value and encouraged careers in the electronics industry.

 

Point-to-Point Wiring With Spring Terminals

Similarly, many educational electronics kits use point-to-point wiring to provide an introduction to solid-state electronic circuits (Figure 2).

 

Snap Circuits Pro education kit with point-to-point wiring.

Figure 2. Snap Circuits Pro education kit with point-to-point wiring. Image used courtesy of Elenco

 

As illustrated in Figure 3, the classic Radio Shack Science Fair electronic project kits used spring terminals for the electrical connections. Circuit modifications and experiments can be performed easily by removing connected components using these spring terminals. Novice hobbyists and students can learn about electronics technology by constructing circuits without specialized tools like the soldering iron.

 

Spring terminals used on Radio Shack Science Fair Electronic project kits for point-to-point wiring

Figure 3. Spring terminals used on Radio Shack Science Fair Electronic project kits for point-to-point wiring. Image used courtesy of Don Wilcher

 

The Science Fair Original Frequency Shift Oscillator

The original frequency shift oscillator circuit was experiment 80 in the Radio Shack Science Fair 200-in-1 electronic project kit. The lab manual pages for this project are shown in Figure 4.

 

The original frequency shift oscillator project from the Science Fair 200-in-1 electronic project kit lab

Figure 4. The original frequency shift oscillator project from the Science Fair 200-in-1 electronic project kit lab. Image used courtesy of Science Maison (click to enlarge)

 

In this original design, a manually operated key switch between nodes 167 and 168 was used to change the oscillator's frequency. When the switch was open, the resistance at the base of the NPN bipolar transistor was 47 kΩ.

When the switch was closed, the 220 kΩ resistor was connected in parallel with the 47 kΩ resistor. The effective resistance at the base of the NPN transistor is now 38.7 kΩ. This change in resistance shifts the frequency that drives the speaker.

 

The Raspberry Pi Pico Controlled Frequency Shift Oscillator System

The objective of this circuit is to generate two distinct tones or sounds from an 8 Ω speaker in response to the presence or absence of an object. The conceptual design of the Raspberry Pi Pico controlled frequency shift audio oscillator is illustrated in Figure 5.

 

The Raspberry Pi Pico controlled frequency shift audio oscillator block diagram

Figure 5. The Raspberry Pi Pico controlled frequency shift audio oscillator block diagram. Image used courtesy of Don Wilcher

 

A pyroelectric sensing element in the PIR sensor detects thermal energy emitted from the object. Typical PIR sensors are shown in Figure 6. The PIR sensor provides a detection signal to the Rasberry Pi Pico controller.

 

Typical passive infrared (PIR) sensors

Figure 6. Typical passive infrared (PIR) sensors. Image used courtesy of the Don Wilcher

 

The Raspberry Pi Pico, aided by an RP0240 microcontroller, will operate a small transistor-based electromechanical relay module (Figure 7).

 

A transistor-based electromechanical relay module

Figure 7. A transistor-based electromechanical relay module. Image used courtesy of the Don Wilcher

 

The transistor-based electromechanical relay module’s Normally Open (N.O) contacts will control the frequency shift operation by switching a parallel resistor component in the oscillator circuit. The transistor-based electromechanical relay module’s N.O contacts will replace the key switch of the original frequency shift oscillator circuit.

 

The New Frequency Shift Audio Oscillator Design

In Figure 8, I have replicated the original circuit schematic from the Radio Shack design. However, in the lower left corner, you can see that I have removed the manually operated key switch and created two connection nodes for the relay.

 

The new frequency shift audio oscillator electronic circuit schematic

Figure 8. The new frequency shift audio oscillator electronic circuit schematic. Image used courtesy of Don Wilcher (click to enlarge)

 

The new parts of the circuit are illustrated in Figure 9. The Raspberry PI Pico monitors the output of the PIR sensor and uses that signal to switch the transistor relay module. Although the PIR sensor can be wired to the transistor relay directly, the Raspberry Pi Pico provides flexibility in object detection time for the switching response of the frequency shift oscillator.

 

The PIR sensor and Raspberry Pi Pico controller electronic circuit schematic

Figure 9. The PIR sensor and Raspberry Pi Pico controller electronic circuit schematic. Image used courtesy of Don Wilcher (click to enlarge)

 

Although not required, an external LED circuit consisting of R1 and D1 has been wired to the Raspberry Pi Pico to provide an external visual object detection indicator. The transistor relay module also has an onboard LED to provide visual operational feedback.

 

Building the New Frequency Shift Oscillator

As illustrated in Figure 10, the PIR sensor and Raspberry Pi Pico controller design is quite easy to assemble. A solderless breadboard allows the wiring of the PIR Sensor, the Raspberry Pi Pico, and the Transistor Relay module to be achieved easily. A standard-size solderless breadboard accommodates the electronic components' placement and wiring satisfactorily.

 

he PIR sensor and Raspberry Pi Pico controlled frequency shift audio oscillator solderless breadboard wiring diagram

Figure 10. The PIR sensor and Raspberry Pi Pico controlled frequency shift audio oscillator solderless breadboard wiring diagram. Image used courtesy of Don Wilcher

 

To aid in wiring the PIR sensor and the transistor relay module to the Raspberry Pi Pico, a pinout of the programmable board is provided in Figure 11.

 

Raspberry Pi Pico pinout

Figure 11. Raspberry Pi Pico pinout. Image used courtesy of the Raspberry Pi

 

Final Assembly of the Raspberry Pi Controlled Audio Oscillator

The frequency shift audio oscillator circuit is constructed using the Radio Shack Science Fair 150-in-1 Electronic Project kit. Using the kit’s pre-cut jumper wires and the point-to-point wiring method allows ease in building the frequency shift oscillator circuit. Figure 12 illustrates the PIR sensor and Raspberry Pi Pico controller. Figure 13 shows the complete build of the project.

 

PIR sensor and Raspberry Pi Pico controller solderless breadboard

Figure 12. PIR sensor and Raspberry Pi Pico controller solderless breadboard. Image used courtesy of Don Wilcher

 

The final Raspberry Pi Pico controlled frequency shift audio oscillator

Figure 13. The final Raspberry Pi Pico controlled frequency shift audio oscillator. Image used courtesy of Don Wilcher

 

Programming the Raspberry Pi Pico

The Raspberry Pi Pico was programmed for object detection using MicroPython. An integrated development environment (IDE) that supports MicroPython, like Thonny or the Arduino IDE, can be used to program the Raspberry Pi Pico.

Attach the Raspberry Pi Pico to a USB port on a desktop personal computer (PC) or laptop computer. Select the correct COM port to download the PIR Sensor MicroPython code to the Raspberry Pi Pico. Type the MicroPython code into the IDE, as shown here:

 

 

Operation of the Raspberry Pi Controlled Frequency Shift Oscillator

After successfully programming the Raspberry Pi Pico, place an object or your hand in front of the PIR sensor. Upon detection, the external and onboard transistor relay module LEDs will turn on for 1 second and then switch off.

Now, turn on the Science Fair frequency shift oscillator circuit with the power switch (SW1). A tone should be heard through the 8 Ω speaker. Place an object or hand before the PIR sensor; the sound’s frequency and pitch should change, as demonstrated in the video of Figure 14.

 

Figure 14. Operation of the Raspberry Pi controlled frequency shift audio oscillator. Video used courtesy of Don Wilcher

 

Optional Modifications

The frequency for the oscillator can be modified by changing values for resistors R1 and R2 or capacitors C1 and C2. Further, a binary communication messaging scheme can be developed based on the two tones, thus creating a frequency shift keying approach for the project using the MicroPython programming language.