Mayank JonejaVKSingh
Published © GPL3+

Poor Man's Theremin using Bolt IoT

Wave your hand in the air and make annoying buzzer tones!

BeginnerProtip19 minutes1,344
Poor Man's Theremin using Bolt IoT

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Photo resistor
Photo resistor
×1
Buzzer
Buzzer
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Theremin Breadboard view Fritzing

LDR and Piezo speaker connected to Bolt IoT Wi-Fi module

Code

theremin.py

Python
Measure light intensity from an LDR and set the PWM waveform to be written to a piezo electric buzzer.
import time
from boltiot import Bolt
import json

api_key = "your_api_key"
d_id = "your_device_id"

client= Bolt(api_key, d_id)


def get_light_intensity(pin):
    """
    Get light intensity.
    """
    response = client.analogRead(pin)
    print response
    data = json.loads(response)
    return int(data['value'])

def play_buzzer(pin, value):
    """
    Control the buzzer
    """
    response = client.analogWrite(pin, value)
    print response

while True:
    light_intensity = get_light_intensity("A0")
    print "light intensity is", light_intensity
    play_buzzer('0',light_intensity)

Credits

Mayank Joneja

Mayank Joneja

6 projects • 42 followers
Embedded Hardware Development and Robotics. Networked Embedded Systems | IoT | Wireless Sensor Networks | Design Thinking
VKSingh

VKSingh

7 projects • 93 followers
Senior Software Developer

Comments