This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2024:projects:wus1 [2024/11/12 13:29] – [description] mcorwin3 | notes:c4eng:fall2024:projects:wus1 [2024/11/14 04:37] (current) – [WUS1] dnayo | ||
---|---|---|---|
Line 2: | Line 2: | ||
Add a section with supporting information for each project | Add a section with supporting information for each project | ||
+ | **Theremin using ultrasonic sensor and passive buzzer.** | ||
+ | First create a function to play a specific frequency. The frequency determine the pitch of a note, which is measured in Hz. The inverse of Hz is period (Hz=1/T). The period is the number of cycles or oscillations per second. To get the buzzer to play a specific note, the buzzer must oscillate at the given frequency for a note. Since you can't directly control the frequency of the buzzer, you have to simply alternate between HIGH and LOW states every " | ||
+ | |||
+ | Foe the ultrasonic sensor, the TRIG pin receives an input form the gpio pin, which triggers an ultrasonic pulse to be sent, which is then bounced back and detected by the echo pin. The trick is to use the speed of sound in air (in cm/ | ||
+ | |||
+ | The final part is bringing everything together, which includes mapping specific frequencies to distances form the sensor. Since we already have the functions for the distance and frequency, the mapping is very straightforward. It just involves using basic algebra using the variable " | ||
+ | |||
+ | |||
+ | **Joystick and active buzzer.** | ||
+ | First create a function where the buzzer is sounded off when a button is hit. When the button is hit the active button works by generating sound through an internal oscillating circuit when power is supplied to it. Unlike a passive buzzer which requires an external signal to produce sound, an active buzzer only needs a simple on/off signal to make noise. The second step was to unhook the button and replace it with a joystick which is a component that computes the position of its handle relative to its base as values of x,y,z on a 3-dimensional plane. The x plane of the joystick was hooked up to the buzzer so when pushed down the buzzer would sound off until released | ||
+ | {{: | ||
+ | |||
+ | **Joystick, Servo and Button** | ||
+ | First, make sure you've downloaded the appropriate files needed. This includes the Joystick, the ADCDevice, the ButtonLED, and the Sweep (servo) file from Github' | ||
=====project idea===== | =====project idea===== | ||
Line 10: | Line 24: | ||
Passive Buzzer: | Passive Buzzer: | ||
Uses the frequency of an AC input to create an oscillating electric field. The oscillating electric field then causes a thin, inner diaphragm to vibrate, which creates sound waves. Higher frequencies cause a faster vibration and a higher pitch. A lower frequency corresponds to a lower pitch. | Uses the frequency of an AC input to create an oscillating electric field. The oscillating electric field then causes a thin, inner diaphragm to vibrate, which creates sound waves. Higher frequencies cause a faster vibration and a higher pitch. A lower frequency corresponds to a lower pitch. | ||
+ | |||
+ | Joystick: | ||
+ | The joystick is a component that computes the position of its handle relative to its base as values of x, y and z on a 3-dimensional plane. Like on a 3-dimensional graph, the y-axis correlates to forward and backwards and the x-axis correlates to right and left, while pressing the handle down like a button adjusts the calculations along the z-axis. The five pins positioned to the left of the joystick are, from top to bottom: ground, (+)5 voltage power, x-variable, y-variable, and GPIO Pin input. The x and y-variable pins are connected to an analog-to-digital converter (ADC) device used to help process the information regarding the position of the joystick controller to the computer. | ||
+ | |||
+ | Active Buzzer: | ||
+ | The active buzzer generates a sound when it receives a voltage signal. Inside the buzzer, there' | ||
====description==== | ====description==== | ||
Passive Buzzer: Using the diagram and code from GitHub' | Passive Buzzer: Using the diagram and code from GitHub' |