A Theremin is a really cool music instrument with two antennas which can be played without physical contact. In this project, we decided to recreate a similar effect by using the components usually included in the box with a Bolt IoT Wi-Fi module, i.e. a buzzer and a photo-resistor.
The hardware connections are really easy and involve connecting a Buzzer to pin 0, a digital I/O pin on the Bolt module and a Light Dependent Resistor (LDR) on pin A0 (Analog Input). The light intensity incident on the LDR changes its resistance. A potential divider circuit with a 10k Ohm resistor allows the MCU to read the voltage across the LDR. You can read more about how that works in these blogs:
https://diyhacking.com/arduino-ldr-sensor/
http://physicsnet.co.uk/a-level-physics-as-a2/current-electricity/potential-divider/
By waving your hand above the LDR, you change the incident light intensity. Based on this value, we set a PWM signal to be generated onto the piezo-electric buzzer. The Bolt Wi-Fi module supports software PWM on all 5 digital I/O pins (0 to 4).
To read more about PWM and tones, check out:
http://www.egr.msu.edu/classes/ece480/capstone/fall14/group07/PDFs/PWM_Application_Note.pdf
https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/
The Fritzing Breadboard view clarifies the connections to be made:
The python script attached below has two functions. One to read the analog sensor value and the other to write the same value directly to the buzzer. This results in an interesting albeit slightly annoying tone which you could exploit for the growth of your musicianship skills.
That's it! :D It shouldn't take you more than 20 minutes to put this project together and start annoying all your dear ones this holiday season! :) Check us out on Indiegogo, back us, and spread the word! We have exclusive discounts for developers and the first batch of Bolts ships out in Februrary 2018 :)
Comments