Posts with «buzzer» label

Active and passive buzzer modules: KY-006 and KY-012 with Arduino

A buzzer module emits a sound to signal a danger or the end of a set time. It also serves to confirm a command. There are two types: passive, such as the KY-006 and Ks0019, and active, such as the KY-012 and Ks0018. AdriRobot tested them with an Arduino UNO, with a Multi Test Shield and with the micro:bit board.

Active and passive buzzer module: the difference

Loose buzzers and buzzer modules used in the tests (photo: AdriRobot)

The buzzer is an audio signalling device. It can be mechanical, electromechanical or piezoelectric. In the active module there is an internal oscillator: you just power it and the sound starts. The passive module has none, so the control circuit must supply it with a square wave between 2 and 5 kHz.

The piezoelectric buzzer is based on a ceramic disc with a metallic layer. It is robust and cheap. That is why it is used for narrow-band alarm signals, for example in household appliances and in medical technology. Electromagnetic buzzers, on the other hand, have a metal diaphragm set vibrating by an electromagnetic circuit, with the electronics already integrated.

The four modules compared

The KY-006 and KY-012 have the same circuit, made up of a connector and the buzzer. Only the type of buzzer changes, passive in the first and active in the second. Of the connector only GND and signal are used, so the current comes from the Arduino pin. Each module also measures 15 × 19 × 9 mm and weighs 2.4 g.

The Keyestudio Ks0018 (active) and Ks0019 (passive) modules are more elaborate. An NPN S8050 transistor acts as a switch between the control pin and the buzzer. There are two resistors: one on the base and one in series with the power supply. This way the control pin only supplies the current for the transistor. The connector therefore has three connections: GND, signal and 3.3 or 5 V power. Finally, these modules measure 30 × 20 × 10 mm and weigh 3 g.

The NPN S8050 transistor acts as a switch on the Keyestudio module (schematic: AdriRobot)

Testing with Arduino: square wave and tone()

The KY-006 module connected to an Arduino UNO for the basic test (schematic: AdriRobot)

To test a passive module you need an Arduino UNO, some Dupont jumpers and the KY-006 or the Ks0019. In the first sketch digital pin 3 goes from high to low with short pauses. This way the square wave is built by hand. Alternatively you use tone(pin, frequency, duration), which generates a square wave with a 50% duty cycle.

The command also produces only one tone at a time. If another pin is already playing, the call has no effect, while on the same pin it changes the frequency. To stop the sound you use noTone(pin). In AdriRobot’s example the buzzer sounds at 500 Hz and at 1000 Hz for one second each. Then it stays silent for five seconds.

The active module is simpler. With the KY-012 or Ks0018 a signal pin at high level makes the buzzer sound. At low level it stops it.

Multi Test Shield and micro:bit

The Multi Test Shield is a shield built by AdriRobot, compatible with the Arduino UNO R3. It is used to test the sensors of the 37-in-1 kit. The KY-012 is inserted on the JP2 connector. This way the sketch alternates sound and silence and shows the various phases on a small OLED display.

The Ks0018 and Ks0019 modules can also be connected to a micro:bit board. You need the Keyestudio Micro:bit Sensor V2 shield and three female-female Dupont cables. The program is also written with the MakeCode block editor and saved directly onto the board.

Where to find the modules

The individual modules are in the catalogue: the passive buzzer module KY-006 and the active buzzer module KY-012. Both are also part of the box of 37 sensors for Arduino, Raspberry Pi and robotics.

Source: the original article by AdriRobot includes the complete sketches, the MakeCode programs and other examples of buzzer use in projects.

Related products

The post Active and passive buzzer modules: KY-006 and KY-012 with Arduino appeared first on Open Electronics.

World’s Cutest Pomodoro Timer Is Also a Clock

Student and hacker [prusteen] recently fell in love with the Pomodoro method of time management. That’s where you concentrate on your task for 25 minutes, then take a five-minute break, and repeat this four times with a longer break at the end. Initially, [prusteen] was keeping track on their phone, but hated having to change the timer value between Pomodoros and break times. In order to keep the flow mode engaged, [prusteen] came up with this darling little study buddy that does it all with the push of a button.

By default, this tomato shows the current time, which we think is a handy and often-overlooked feature of Pomodoro timer builds. Press that momentary switch on the front, and it starts counting upward to 25 minutes. Then it beeps in stereo through a pair of buzzers when the time is up, and automatically starts a five-minute break timer. Press it again and the display goes back to clock mode, although judging by the code, doing this will cancel the timer.

Inside the juicy enclosure is an Arduino Nano, an RTC, and a 7-segment display. We love the attention to detail here, from the little green leaves on top to the anatomically-correct dimple on the underside. And we always like to see lids that snap on with magnets. So satisfying. Check out the brief demo after the break, which unfortunately does not include any lid-snapping action.

Do you need more interaction with your Pomodoro timer? Build yourself a pomo-dachi instead.

Arduband Gives Your Eyes a Hand

Let’s face it, we probably all sit at our computers for way too long without getting up. Yes, there’s work to be done, games to be played, and the internet abounds with people who are wrong and must be down-voted and/or corrected. We totally get and respect all that. However, if you want to maintain your middle- and long-range vision, you should really get up regularly and gaze out the window for a bit.

In fact, the Arduband does you one better. Its Arduino Nano and accelerometer check your position every ten minutes. If you haven’t changed your Z by the third check, then it’s time for a break. The combination of an RGB LED, buzzer, and vibrating disc motor working together should be enough to pull you out of any computerized stupor, and they won’t give up and go back to sleep until you have stood up and remained upright for one minute.

We like that [ardutronics123] spun up a board and made it small enough to be wrist-mounted using a watch strap. It would work just as well worn around your neck, and would probably even fit in your pocket. Blink a few times before you check out the build video after the break.

Arduband would be great on the go, but who does that anymore? If you spend every day at the same desk, you could point a time-of-flight sensor at your chair and start a timer.

Otto - build you own robot in two hours!

Primary image

What does it do?

Otto walks, dances, makes sounds and avoids obstacles, is completely open source, Arduino compatible, 3D printable, and with a social impact mission to create an inclusive environment for all kids.

Otto was inspired by another robot instructable BoB the BiPed and programmed using code from another open source biped robot called Zowi.

CC-BY-SA

Otto's differences are in the assembled size (11cm x 7cm x12cm), cleaner integration of components and expressions.

Cost to build

$49, 00

Embedded video

Finished project

Complete

Number

Time to build

2 hours

Type

URL to more information

Weight

250 grams

read more

Grove Water Sensor


Connecting a water sensor to an Arduino is a great way to detect a leak, spill, flood, rain etc. It can be used to detect the presence, level, volume and/or the absence of water. While this could be used to remind you to water your plants, there is a better Grove sensor for that. The sensor has an array of exposed traces which will read LOW when water is detected. In this tutorial, we will connect the Water Sensor to Digital Pin 8 on the Arduino, and will enlist the very handy Grove Piezo buzzer and an LED to help identify when the Water sensor comes into contact with a source of water.


 

Parts Required:

Putting it together


If you have a Grove Base Shield, you just have to connect the Grove Water Sensor to D8 on the shield, and the Buzzer to D12 on the Shield. My Grove base shield obstructs the onboard LED, so I will attach an LED to Digital pin 13. If you do not have a Grove base shield, then you should connect the Sensors as described in the tables below:
 


 

Arduino Sketch


 
  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33


/* 
  Grove Water Sensor sketch 
     Written by ScottC 5th August 2014
     Arduino IDE version 1.0.5
     Website: http://arduinobasics.blogspot.com
     Description: Use Grove Water Sensor to detect leaks, floods, spills, rain etc.
     Credits: This sketch was inspired by this website:
              http://www.seeedstudio.com/wiki/Grove_-_Water_Sensor     
 ------------------------------------------------------------- */
#define Grove_Water_Sensor 8     //Attach Water sensor to Arduino Digital Pin 8
#define Grove_Piezo_Buzzer 12    //Attach Piezo Buzzer to Arduino Digital Pin 12
#define LED 13                   //Attach an LED to Digital Pin 13 (or use onboard LED)
void setup(){
pinMode(Grove_Water_Sensor, INPUT); //The Water Sensor is an Input
pinMode(Grove_Piezo_Buzzer, OUTPUT); //The Piezo Buzzer is an Output
        pinMode(LED, OUTPUT); //The LED is an Output
}

void loop(){
        /* The water sensor will switch LOW when water is detected.
           Get the Arduino to illuminate the LED and activate the buzzer
           when water is detected, and switch both off when no water is present */
if(digitalRead(Grove_Water_Sensor) == LOW){
                digitalWrite(LED,HIGH);
digitalWrite(Grove_Piezo_Buzzer, HIGH);
                delay(2);
                digitalWrite(Grove_Piezo_Buzzer, LOW);
                delay(40);
        }else{
                digitalWrite(Grove_Piezo_Buzzer, LOW);
                digitalWrite(LED,LOW);
        }
}


 

The Video


 


If you liked this tutorial - please show your support :

ScottC 05 Aug 16:38

How to use a Tricolor LED and a Mini Buzzer


So I’ve made a little not-so-challenging game that uses a tricolor LED, mini buzzer, arduino and of course our Android device. The mechanics of the game is that you need to choose a color, red, green or blue from the Android app and then the accessory (arduino) will randomly pick a color after [...]