element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#16 - Proximity Theremin
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 19 replies
  • Subscribers 30 subscribers
  • Views 4481 views
  • Users 0 members are here
  • theremin
  • 100projects
  • proximity
  • capsense
  • 4
  • psoc
Related

PSoC 4 Pioneer Kit Community Project#16 - Proximity Theremin

cy.gul
cy.gul over 12 years ago

Hello folks!

 

Today's project is a personal favorite of mine because it got the amateur/wannabe musician inside me very excited. Building on yesterday's example of how to do proximity sensing with the CapSense Component, today we're going to use that concept in an application. This example project implements a Theremin, a 1920s electronic musical instrument played without physical contact.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

The project uses two proximity sensors - one for Pitch and another for Volume. The proximity sensing itself is done using wires that act as antennas, input to the PSoC 4 using the CapSense block.

The theremin has 2 modes - discrete and continuous notes, toggled by using the pushbutton (SW2) on the board. Pitch information is indicated by the color of the LED, while Volume information is indicated by the brightness of the same LED.

The Cortex-M0 CPU takes the analog input from the CapSense proximity sensors and send a parameter indicating distance to the hardware PWMs, that in-turn modulate the LED. The CPU also sends data to the 2 other PWMs that are used to drive the a Buzzer that creates the musical notes.

The project also includes a UART Component so you can read the CapSense proximity sensor data over hyperterminal.

 

image

 

What's cool about this project?

- It uses 5 (five!) hardware 16-bit PWMs - 3 of which are implemented on the TCPWM block (modulating the RGB LEDs), wheres 2 more implemented using UDBs (to drive the buzzer).

- It implements distance sensing using CapSense proximity

- It lets you make music in the air! Check out the demo video above.

 


Hardware Connections:

 

image

 

The RGB LED and the pushbutton switch are on the board. In addition to the PSoC 4 Pioneer Kit, you're going to need -

- an 18 ohm Speaker/Buzzer (P2[0])

- 2 resistors, 2 capacitors

- hanful of jumper wires

 

image

 

 

The project is attached below, its all ready to go. Just build and program on to your PSoC 4 Pioneer Kit, and wire up a small buzzer.

Have fun making music!

 

 

 

 





 



Attachments:
KIT042_Theremin.Bundle01.zip
  • Sign in to reply
  • Cancel

Top Replies

  • jesusantoniocar
    jesusantoniocar over 12 years ago +1
    Hello Gagan. Thanks for give us this amazing project, great design with few elements to build. i will buy some elements that need to make a full test. best regards, jesus antonio.
  • Former Member
    Former Member over 12 years ago in reply to greatunclebulgaria +1
    Hey David, Great question. Actually, you need just one 100ohm resistor and one 8ohm/0.1W speaker (see image below). You could use a speaker with a different rating as well - for this application, it doesn…
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar +1
    Hello. It is a new video with the last file project.. best regards, Jesus Antonio. players.brightcove.net/.../index.html
Parents
  • Former Member
    Former Member over 12 years ago

    Note 1:

    Some of you may be wondering - why are 2 PWMs needed to drive the speaker?

     

    Well, the 2 PWMs can be used to create dual-tone music, and as a result, some fun sound effects. By default, the second PWM an octave higher (double the frequency) than the first PWM.

     

    To change the relative pitch of the 2nd PWM to the first, in main.c, line 215, change NOTES_TO_OCTAVE to NOTES_TO_JARRING (2nd MIDI note above the base note) or NOTES_TO_THIRD (3rd midi note above the base note).

    Do experiment with other combinations as well, to make your own special sounds!

     

    Note 2:

    If your speaker is sounding soft, reduce the volume scale-down performed in lines 205 and 206 (the volume is reduced by a factor of 16 (4 shifts right) ). I scaled down the volume for peace of mind (especially for my colleagues image )

     

    I hope you have as much fun with the Theremin as I had developing it. Maybe one of you could improve the design and post a video of you playing your own custom version of the Theremin. That would be cool!

     

    Should you have any questions, do let me know.

     

    Antonio

     

    PS: The video above has a caption for the speaker that reads 'PWM Based Speaker', but means 'PWM Driven Speaker'... Don't get confused!.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago

    Note 1:

    Some of you may be wondering - why are 2 PWMs needed to drive the speaker?

     

    Well, the 2 PWMs can be used to create dual-tone music, and as a result, some fun sound effects. By default, the second PWM an octave higher (double the frequency) than the first PWM.

     

    To change the relative pitch of the 2nd PWM to the first, in main.c, line 215, change NOTES_TO_OCTAVE to NOTES_TO_JARRING (2nd MIDI note above the base note) or NOTES_TO_THIRD (3rd midi note above the base note).

    Do experiment with other combinations as well, to make your own special sounds!

     

    Note 2:

    If your speaker is sounding soft, reduce the volume scale-down performed in lines 205 and 206 (the volume is reduced by a factor of 16 (4 shifts right) ). I scaled down the volume for peace of mind (especially for my colleagues image )

     

    I hope you have as much fun with the Theremin as I had developing it. Maybe one of you could improve the design and post a video of you playing your own custom version of the Theremin. That would be cool!

     

    Should you have any questions, do let me know.

     

    Antonio

     

    PS: The video above has a caption for the speaker that reads 'PWM Based Speaker', but means 'PWM Driven Speaker'... Don't get confused!.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube