Advertisement

IR Harp

Not rated 9,730

#IR sensor #microcontroller #Direct Digital Synthesis #TSOP sensor #audio output #infrared #harp #music #sensor array #digital output
IR Harp
IR Harp

Description: A harp without strings, where infrared (IR) sensor-receiver pairs function as strings in the device. The device detects when a string is plucked, causing blockage of the IR signal, and produces corresponding sounds using Direct Digital Synthesis. Six TSOP sensors are employed to identify the blockage of infrared LEDs, providing digital output to a microcontroller. The microcontroller processes this data and generates a 6-bit digital output to a Digital to Analog Converter (DAC) using an R-2R ladder. The DAC converts the digital input into analog data, which is subsequently filtered and amplified to drive the speakers. The microcontroller interprets the sensor data and outputs stored waveforms at the frequency assigned to the plucked strings via interrupts.

Familiarity with sensors from previous projects indicated that photodiode sensors would present challenges due to alignment issues and low sensitivity. Consequently, TSOP sensors were selected for their excellent voltage variation from 0.0 to 4.81 V. Testing was conducted with two sensors placed 5 cm apart to ensure no interference between IR LEDs, utilizing pipes to mitigate this issue. TSOP sensors require an IR LED to operate on a square wave of approximately 38 kHz, which was generated using a 555 timer circuit.

The DAC0808 was initially used to convert the digital output from the TSOP sensors into an analog signal; however, it did not meet expectations, leading to the design of a custom DAC using an R-2R ladder, achieving a range of 0 to 4.5 V. To amplify this signal without affecting the previous circuit, a buffer and amplifier were incorporated, resulting in an output range of 0 to 8.6 V. This output was directed to a speaker, but insufficient current led to the inclusion of a Darlington transistor (TIP122) with a 5A current rating to drive the speaker.

Oscilloscope analysis revealed a grainy waveform, prompting the implementation of a Sallen-Key low-pass filter to eliminate high-frequency noise. During sensitivity testing, the sensors failed to respond to rapid finger flicks. To address this, a D flip-flop IC (7474N) was used as memory to capture even brief flicks. An audio jack was integrated after the low-pass filter to facilitate sound output through earphones, with a buffer and appropriate resistors ensuring a 0 to 5V output for the jack.

The circuit is powered by a 12V, 1A adapter, with an LM7805 voltage regulator providing a stable 5V supply. Power switches were included for the supply and for toggling between the audio jack and speaker. Capacitors were incorporated to protect the LM7805 from sudden voltage changes during power cycling.

To generate a sine wave signal from the microcontroller, digital values must be written with a specific delay between them. Sampled values of the signal are stored in an array. Two methods for introducing delay were considered: the delay() function of Arduino, which is inefficient, and the use of interrupts, which was selected for this application. An interrupt with a prescaler of 8 increments a 32-bit accumulator whenever triggered, allowing the processor to remain active and perform other tasks, such as processing input. The frequency of the output can be varied by adjusting the increment value, with larger increments resulting in higher frequencies.A harp without strings i. e. IR sensor-receiver pairs function as strings in our device. The device senses when a string is being plucked (causes blockage of IR). Correspondingly, the particular sound is produced by Direct Digital Synthesis. We used 6 TSOP sensors to identify the blockage of infrared led`s. They then give digital output to microcontroller which processes data and gives 6-bit digital output to Digital to Analog converter(r-2r ladder). DAC converts the digital input to analog data which is then filtered and amplified to drive the speakers. The microcontroller is used to interpret the sensor data and output the stored waveforms at the frequency assigned to the plucked strings using an interrupt.

Since we were somewhat familiar of sensors because of line follower competition, we knew that working with the photodiode sensors would be difficult as their alignment and low sensitivity were some of the major problems. So we found out TSOP sensors which gave excellent variation from 0. 0 to 4. 81 V. Then we worked with two sensors kept at a distance of 5 cm to test that one led is not interfering with another sensor.

We used pipes to remove this problem. TSOP sensors require the IR LED to operate on a square wave of a particular frequency, which in this case was ~38kHz. We provided the required square wave form by a circuit using the 555 timer. We then used DAC0808 to convert the digital output of TSOP sensors into analog signal but it was not working as per our expectations so we designed our own DAC chip using r-2r ladder.

We were then getting range from 0 to 4. 5 V. Now we wanted to amplify this signal without affecting previous circuit. For this purpose we used a buffer and an amplifier which then gave range between 0 to 8. 6 V. We then gave this output to speaker which we took out from synth. But we realised that the current was insufficient to drive the speaker, so we put a Darlington transistor(Tip122) whose current rating was 5A to drive the speaker. When we analysed the output on an oscilloscope, we found that the waveform was grainy. To smoothen the waveform, we used sallen-key low pass filter to remove high frequency noises. While testing the sensitivity of the sensors, we realised that it was not responding to very quick flicks of fingers.

To resolve this problem, we used D flip-flop IC 7474N as a memory to store even a single flick. To get sound from earphones, we placed a 3. 5 mm audio jack after the low pass filter. But to get 0 to 5V for the jack we placed a sort of buffer after the low pass filter with appropriate resistances to get the required output. To power the circuit, we used a 12V, 1A adapter. Since we needed both 12 V and 5V supply we used LM7805 to get 5V supply. We also provided switches for the power supply and for switching between audio jack and speaker. Capacitors ensure security to LM7805 when a large sudden change in voltage occurs during Power OFF-ON toggle.

To generate a sine wave signal from a microcontroller, we must write the values in digital form, with particular delay time between, onto any set of pins. To do this, we stored the sampled values of the signal in an array. There are two ways to provide the above mentioned delay: One is to use the delay() function of Arduino, with argument corresponding to the required frequency, between the values.

This is a highly inefficient method which does not utilise the full processing power. The other method is the use of Interrupts and this is what we have used. We have used an interrupt of prescalar 8 to increment a 32-bit accumulator, whenever it is called. Thus we are not putting the processor in a state of sleep between writing of the values and hence it is free to do other processing ex. processing of input. We can vary the frequency of the output by changing the increment value. A larger increment will produce a higher increment. The increment is calculat

Related Circuits