Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:iot-open:hardware2:actuators_sound [2023/08/18 08:08] – created ktokarzen:iot-open:hardware2:actuators_sound [2023/11/23 10:39] (current) pczekalski
Line 1: Line 1:
-==== Sound Output Devices ====+====== Sound Output Devices ====== 
 +{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ 
 +== Speaker == 
 +Speakers are electroacoustic devices that convert electrical signals into sound waves. A speaker uses a permanent magnet and a coil attached to the membrane. Sound signal flowing through the coil creates an electromagnetic field with variable strength; the coil attracts a magnet according to the strength of the field, thus making a membrane vibrate and creating a sound wave.\\ 
 +Another widely used speaker technology, called piezo speaker, uses piezoelectric materials instead of magnets.\\ 
 +Speakers are used to create an audible sound for human perception and ultrasonic sound for sensors and measurement equipment. Some speakers are designed to generate a single, fixed-frequency acoustic tone. Such elements are called buzzers and have a built-in generator to emit sound if the voltage is on. Elements without built-in generators should be controlled with the frequency signal coming from the microcontroller. Sound-generating devices require more power than LED, so there is a need to check if the operating current is lower than the maximum current of the microcontroller's pin as specified in technical documentation. In the case of the overcurrent, an additional amplifying element is required, e.g., a transistor. Sample speaker is present in the figure {{ref>speaker1}} while connection of the piezoelectric one is present in the figure {{ref>speaker2}}.
  
-=== Speaker === +<figure speaker1
-Speakers are electroacoustic devices that convert the electrical signal into sound waves. A speaker uses a permanent magnet and a coil attached to the membrane. Sound signal, flowing through the coil, creates the electromagnetic field with variable strength, coil attracts to magnet according to the strength of the field, thus making a membrane to vibrate and creating a sound wave. Other widely used speaker technology, called Piezo speaker, uses piezoelectric materials instead of magnets. Speakers are used to creating an audible sound for human perception and ultrasonic sound for sensors and measurement equipment. +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:speaker_c.jpg?100 | Electromagnetic speaker}} 
- +<caption>Electromagnetic speaker, 8 Ω 0.5 W</caption>
-<figure label+
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:speaker_c.jpg?100  title}} +
-<caption>Speaker 8 Ω 0.5 W.</caption>+
 </figure> </figure>
  
-<figure label+<figure speaker2
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_piezo_buzzer.png?200 | title}} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_piezo_buzzer.png?200 | Arduino Uno and piezo speaker schematics}} 
-<caption>Arduino Uno and piezzo buzzer schematics.</caption>+<caption>Arduino Uno and piezo speaker schematics</caption>
 </figure> </figure>
  
 <code c> <code c>
-const int speakerPin = 9; //Define the buzzer pin+const int speakerPin = 9;      //Define the piezo speaker pin
  
 void setup() void setup()
 { {
-  pinMode(speakerPin, OUTPUT); //Set buzzer as an output+  pinMode(speakerPin, OUTPUT); //Set spekaer pin as an output
 } }
  
 void loop() void loop()
  
-  tone(speakerrPin, 1000); //Send 1 kHz sound signal +  tone(speakerrPin, 1000);     //Send 1 kHz sound signal 
-  delay(1000);        //For 1 s +  delay(1000);                 //For 1 s 
-  noTone(speakerPin);     //Stop sound +  noTone(speakerPin);          //Stop sound 
-  delay(1000);        //For 1 s+  delay(1000);                 //For 1 s
 } }
 </code> </code>
  
en/iot-open/hardware2/actuators_sound.1692346081.txt.gz · Last modified: 2023/08/18 05:08 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0