Mini IR Theremin Circuit

10,979

Mini IR Theremin
Mini IR Theremin

The IR Theremin hardware schematic is notably simple, as the primary input and output devices require minimal connections. This simplicity can be a double-edged sword, as fewer hardware components often lead to increased software complexity. The main components utilized in the circuit include the PIC18F452 microcontroller, the 2Y0A21/GP2D120 infrared sensor, and a headphone speaker. The power supply for the circuit consists solely of batteries. A voltage regulator is not necessary since the available batteries are all rated at +1.2V, resulting in a total of +4.8V from four AA batteries, which remains within the operational specifications for both the PIC and the infrared sensor. The infrared sensor features three connections: Power, Ground, and Output, with the Output connected to pin 2 (RA0) of the PIC, configured as an analog input for the analog-to-digital converter. The speaker connection consists of one terminal connected directly to ground and the other connected to pin 19 (RD0) of the PIC. The firmware controls this pin to alternate between on and off states at specific frequencies, generating the desired pitch output through the speaker.

The IR Theremin circuit is designed around the PIC18F452 microcontroller, which serves as the central processing unit for controlling the operation of the infrared sensor and generating audio output. The 2Y0A21/GP2D120 infrared sensor is employed for detecting the proximity of an object, which modulates the pitch of the sound produced by the speaker based on the distance of the object from the sensor. This interaction allows for an intuitive user experience, where moving closer or farther away from the sensor alters the pitch of the sound.

The power supply arrangement using four AA batteries is efficient for this application, providing sufficient voltage while maintaining portability. The absence of a voltage regulator simplifies the circuit design, as the battery voltage falls within the acceptable range for both the microcontroller and the IR sensor. It is essential to ensure that the batteries are fresh and capable of delivering the required voltage to maintain consistent performance.

The IR sensor's connections to the microcontroller are straightforward. The Power and Ground pins are connected to the appropriate voltage and ground references, while the Output pin is routed to pin RA0 of the PIC. The microcontroller's analog-to-digital converter (ADC) is configured to read the output voltage from the IR sensor, which varies with the distance of an object in proximity to the sensor. This ADC reading is then processed in the firmware to determine the corresponding pitch for the sound output.

The speaker connection is equally simple, with one side grounded and the other side connected to pin RD0 of the PIC. The microcontroller firmware is programmed to toggle this pin at varying frequencies, producing sound waves of different pitches based on the input received from the IR sensor. The resulting audio output is amplified by the speaker, creating an audible signal that corresponds to the distance measured by the infrared sensor.

Overall, the IR Theremin circuit exemplifies a minimalistic yet effective design that leverages the capabilities of the PIC18F452 microcontroller and the 2Y0A21/GP2D120 infrared sensor to create an interactive electronic instrument.The IR Theremin hardware schematic is deliciously simple in that the main input and output devices do not require many connections. This is usually a mixed blessing because less hardware, often means more software. The main devices used in the circuit are the 18F452, 2Y0A21/GP2D120 IR Sensor and the headphone speaker.

The power circuit here is just batteries. No voltage regulator was used because the batteries I have are all +1. 2v, so 4 AA Batteries x +1. 2v = +4. 8v which is within specification with the PIC and IR sensor. The IR Sensor only has three connections: Power, Ground and Output to the PIC`s pin 2 (RA0). This is set as an analog input for the A-to-D converter in the PIC. The connection to the speaker is one side going directly to ground and the other side of the speaker connecting to the PIC`s pin 19 (RD0). The firmware will tell this pin to alternate between on and off at certain frequencies to create the proper pitch output to the speaker.

🔗 External reference