{"title":"Buzzer Modules","description":"\u003cp\u003eActive and passive buzzer modules for Arduino, ESP32 and other boards that run at 3.3 to 5V. An active buzzer beeps at one fixed tone as soon as you drive its signal pin, so a single digitalWrite in your code is all it needs. A passive buzzer has no built-in tone generator, so you can play notes and short tunes with the Arduino tone() command.\u003c\/p\u003e","products":[{"product_id":"active-buzzer-module-high-low-level-trigger","title":"Active Buzzer Module for Arduino, High or Low Level Trigger, 3.3 to 5V","description":"\u003cdiv class=\"nznpd\"\u003e\n\u003cdiv class=\"nznpd__lead\"\u003e\n\u003cp class=\"nznpd__intro\"\u003eA small beeper board for Arduino, ESP32 and Raspberry Pi Pico projects. Set one pin and it beeps at a single fixed tone, so it suits alarms, timers, button clicks and error warnings with nothing more than digitalWrite. A transistor on the board does the switching, so your pin only supplies a few milliamps.\u003c\/p\u003e\n\u003cp class=\"nznpd__intro\"\u003ePick the trigger to suit your code. The High level board sounds when the pin is HIGH and stays quiet while your board starts up, so choose it if you're unsure. The Low level board sounds when the pin is LOW, and on a 3.3V board such as an ESP32 or Pico its VCC goes to 3.3V, not 5V. An active buzzer makes one tone only, so it won't play a tune. For music or voice, use our \u003ca href=\"\/products\/sc8002b-audio-module\"\u003eSC8002B amplifier module with speaker\u003c\/a\u003e.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eSpecifications\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__specs\"\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBuzzer\u003c\/span\u003e\u003cstrong\u003e12 mm active buzzer, one fixed tone of about 2 to 3 kHz\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eTrigger\u003c\/span\u003e\u003cstrong\u003eHigh level sounds when I\/O is HIGH; Low level sounds when I\/O is LOW\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSupply\u003c\/span\u003e\u003cstrong\u003e3.3 to 5V DC on VCC, loudest at 5V\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eCurrent\u003c\/span\u003e\u003cstrong\u003eAbout 30 mA from VCC while it sounds; the I\/O pin only supplies about 4 mA\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eLogic\u003c\/span\u003e\u003cstrong\u003e3.3V or 5V. Low level board on an ESP32 or Pico: run VCC from 3.3V\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eDriver\u003c\/span\u003e\u003cstrong\u003eTransistor with a 1k base resistor, so digitalWrite is all it needs\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePins\u003c\/span\u003e\u003cstrong\u003eVCC, I\/O, GND on a right-angle 3-pin header (2.54 mm)\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eWash seal\u003c\/span\u003e\u003cstrong\u003eSticker over the sound hole; peel it off for full volume\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBoard size\u003c\/span\u003e\u003cstrong\u003e32.2 x 13.1 mm, one 3 mm mounting hole\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eDatasheets\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__ds\"\u003e\n\u003ca class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-ACT-Datasheet-Rev1-1b.pdf?v=1794904617\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the active buzzer module datasheet (PDF)\"\u003e\n\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\n\u003cspan\u003eFull technical datasheet\u003c\/span\u003e\n\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\n\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003cdiv class=\"nznpd__qs\"\u003e\n\u003ch3\u003eWiring \u0026amp; getting started\u003c\/h3\u003e\n\u003cdetails class=\"nznpd__figbox\" open\u003e\u003csummary\u003eWiring diagram\u003cspan class=\"nznpd__codelang\"\u003eArduino Uno\u003c\/span\u003e\u003c\/summary\u003e\u003cfigure class=\"nznpd__fig\"\u003e\u003ca href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-ACT-wiring-uno.png?v=1794900661\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-ACT-wiring-uno.png?v=1794900661\" alt=\"Buzzer module wired to an Arduino Uno: VCC to 5V, I\/O to D8, GND to GND\" width=\"1453\" height=\"507\" loading=\"lazy\"\u003e\u003c\/a\u003e\u003cfigcaption\u003eTap the drawing to open it full size.\u003c\/figcaption\u003e\u003c\/figure\u003e\u003c\/details\u003e\n\u003col class=\"nznpd__steps\"\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eConnect three wires\u003c\/strong\u003e\u003cp\u003eThe pin names are printed beside the header. VCC goes to 5V, I\/O to D8 and GND to GND. On an ESP32 or Pico, use 3.3V for VCC with the Low level board. Three female jumper wires push straight onto the pins.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003ePeel off the seal\u003c\/strong\u003e\u003cp\u003eThe sticker on top covers the sound hole while boards are washed in the factory. Leave it on and the beep is muffled, so peel it off once the module is in place.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eLoad the test code\u003c\/strong\u003e\u003cp\u003eUpload this sketch to an Uno. For the Low level board, change ACTIVE_LEVEL to LOW first.\u003c\/p\u003e\n\u003cdetails class=\"nznpd__codebox\"\u003e\u003csummary\u003eExample Arduino code\u003cspan class=\"nznpd__codelang\"\u003eArduino C++\u003c\/span\u003e\u003c\/summary\u003e\u003cpre\u003e\u003ccode\u003e\u003cspan class=\"t-c\"\u003e\/\/ Active buzzer module test (MOD-BUZ-ACT-H \/ MOD-BUZ-ACT-L).\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Module VCC to 5V, I\/O to D8, GND to GND on the Uno.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ High level board: set ACTIVE_LEVEL to HIGH.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Low level board:  set ACTIVE_LEVEL to LOW.\u003c\/span\u003e\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e8\u003c\/span\u003e;\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eACTIVE_LEVEL\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e;\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eIDLE_LEVEL\u003c\/span\u003e = (\u003cspan class=\"t-v\"\u003eACTIVE_LEVEL\u003c\/span\u003e == \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e) ? \u003cspan class=\"t-v\"\u003eLOW\u003c\/span\u003e : \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e;\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003ebeep\u003c\/span\u003e(\u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ems\u003c\/span\u003e) {\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eACTIVE_LEVEL\u003c\/span\u003e);  \u003cspan class=\"t-c\"\u003e\/\/ buzzer on\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003ems\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eIDLE_LEVEL\u003c\/span\u003e);    \u003cspan class=\"t-c\"\u003e\/\/ buzzer off\u003c\/span\u003e\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003esetup\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eIDLE_LEVEL\u003c\/span\u003e);  \u003cspan class=\"t-c\"\u003e\/\/ set the off level first\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003epinMode\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eOUTPUT\u003c\/span\u003e);           \u003cspan class=\"t-c\"\u003e\/\/ so it stays quiet at start\u003c\/span\u003e\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003eloop\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003ebeep\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e100\u003c\/span\u003e);   \u003cspan class=\"t-c\"\u003e\/\/ two short beeps\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e150\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003ebeep\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e100\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e1000\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003ebeep\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e600\u003c\/span\u003e);   \u003cspan class=\"t-c\"\u003e\/\/ one long beep\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e2000\u003c\/span\u003e);\n}\u003c\/code\u003e\u003c\/pre\u003e\u003c\/details\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eCheck it works\u003c\/strong\u003e\u003cp\u003eYou should hear two short beeps, a pause and one long beep, repeating every few seconds. If a Low level board beeps as your board starts, set the pin HIGH before making it an output, as the sketch does. If it keeps buzzing on a 3.3V board, move VCC from 5V to 3.3V.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003c\/div\u003e\n","brand":"NZN Electronics","offers":[{"title":"High level","offer_id":67798082224224,"sku":"MOD-BUZ-ACT-H","price":1.99,"currency_code":"NZD","in_stock":true},{"title":"Low level","offer_id":67798082256992,"sku":"MOD-BUZ-ACT-L","price":1.99,"currency_code":"NZD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/BUZ-ACT_01_hero-high-transparent_e1c1f04f-9b8d-4d1f-9af6-2280a4fd7757.png?v=1795226125"},{"product_id":"passive-buzzer-module-low-level-trigger","title":"Passive Buzzer Module for Arduino, Low Level Trigger, 3.3 to 5V","description":"\u003cdiv class=\"nznpd\"\u003e\n\u003cdiv class=\"nznpd__lead\"\u003e\n\u003cp class=\"nznpd__intro\"\u003eA small buzzer board that plays notes. It has no oscillator of its own, so your code supplies the pitch: tone() on an Arduino, PWM on an ESP32 or Pico. That makes it the one to pick for start-up jingles, simple tunes, rising alarms and different beeps for different events. A transistor on the board does the switching, so your pin only supplies a few milliamps.\u003c\/p\u003e\n\u003cp class=\"nznpd__intro\"\u003ePassive and active buzzers look alike, and the difference matters. A passive buzzer stays silent on a plain HIGH or LOW and only clicks, because it needs a switching signal. An active buzzer beeps by itself when you switch it on, with one fixed tone. If you only want a fixed beep from digitalWrite, get our \u003ca href=\"\/products\/active-buzzer-module-high-low-level-trigger\"\u003eActive Buzzer Module\u003c\/a\u003e instead. This board is the Low level type: leave I\/O HIGH when idle, and on a 3.3V board such as an ESP32 or Pico, power VCC from 3.3V, not 5V.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eSpecifications\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__specs\"\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBuzzer\u003c\/span\u003e\u003cstrong\u003ePassive buzzer, about 12 mm across, no built-in oscillator\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eDrive signal\u003c\/span\u003e\u003cstrong\u003eA square wave from tone() or PWM; a steady HIGH or LOW only clicks\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eTrigger\u003c\/span\u003e\u003cstrong\u003eLow level: keep I\/O HIGH when idle, it sounds while the pin switches\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSupply\u003c\/span\u003e\u003cstrong\u003e3.3 to 5V DC on VCC\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eLogic\u003c\/span\u003e\u003cstrong\u003e3.3V or 5V. On an ESP32 or Pico, run VCC from 3.3V\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eDriver\u003c\/span\u003e\u003cstrong\u003eTransistor with a 1k base resistor, so one pin is all it needs\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePins\u003c\/span\u003e\u003cstrong\u003eVCC, I\/O, GND on a right-angle 3-pin header (2.54 mm)\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBoard size\u003c\/span\u003e\u003cstrong\u003e32.2 x 13.1 mm, one mounting hole that takes an M3 screw\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSound\u003c\/span\u003e\u003cstrong\u003eAny note you can generate, one at a time, at small-beeper volume\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eDatasheets\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__ds\"\u003e\n\u003ca class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-PAS-Datasheet-Rev1-2.pdf?v=1794911844\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the passive buzzer module datasheet (PDF)\"\u003e\n\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\n\u003cspan\u003eFull technical datasheet\u003c\/span\u003e\n\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\n\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\n\u003cdiv class=\"nznpd__qs\"\u003e\n\u003ch3\u003eWiring \u0026amp; getting started\u003c\/h3\u003e\n\u003cdetails class=\"nznpd__figbox\" open\u003e\u003csummary\u003eWiring diagram\u003cspan class=\"nznpd__codelang\"\u003eArduino Uno\u003c\/span\u003e\u003c\/summary\u003e\u003cfigure class=\"nznpd__fig\"\u003e\u003ca href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-ACT-wiring-uno.png?v=1794900661\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/MOD-BUZ-ACT-wiring-uno.png?v=1794900661\" alt=\"Passive buzzer module wired to an Arduino Uno: VCC to 5V, I\/O to D8, GND to GND\" width=\"1453\" height=\"507\" loading=\"lazy\"\u003e\u003c\/a\u003e\u003cfigcaption\u003eTap the drawing to open it full size.\u003c\/figcaption\u003e\u003c\/figure\u003e\u003c\/details\u003e\n\u003col class=\"nznpd__steps\"\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eConnect three wires\u003c\/strong\u003e\u003cp\u003eThe pin names are printed beside the header. VCC goes to 5V, I\/O to D8 and GND to GND. On an ESP32 or Pico, use 3.3V for VCC. Three female jumper wires push straight onto the pins.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eLoad the test code\u003c\/strong\u003e\u003cp\u003eUpload this sketch to an Uno. It plays eight notes, then sets the pin back to HIGH, which is the quiet level for this board.\u003c\/p\u003e\n\u003cdetails class=\"nznpd__codebox\"\u003e\u003csummary\u003eExample Arduino code\u003cspan class=\"nznpd__codelang\"\u003eArduino C++\u003c\/span\u003e\u003c\/summary\u003e\u003cpre\u003e\u003ccode\u003e\u003cspan class=\"t-c\"\u003e\/\/ Passive buzzer module test (MOD-BUZ-PAS-L, Low level trigger).\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Module VCC to 5V, I\/O to D8, GND to GND on the Uno.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ The board is silent while the pin is HIGH, so HIGH is the idle level.\u003c\/span\u003e\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e8\u003c\/span\u003e;\n\u003cspan class=\"t-k\"\u003econst\u003c\/span\u003e \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003eNOTES\u003c\/span\u003e[] = {\u003cspan class=\"t-n\"\u003e262\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e294\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e330\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e349\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e392\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e440\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e494\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e523\u003c\/span\u003e};  \u003cspan class=\"t-c\"\u003e\/\/ C4 up to C5\u003c\/span\u003e\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003eplayNote\u003c\/span\u003e(\u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ehz\u003c\/span\u003e, \u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ems\u003c\/span\u003e) {\n  \u003cspan class=\"t-f\"\u003etone\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003ehz\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003ems\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003ems\u003c\/span\u003e + \u003cspan class=\"t-n\"\u003e20\u003c\/span\u003e);\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e);  \u003cspan class=\"t-c\"\u003e\/\/ tone() leaves the pin LOW, so put it back to idle\u003c\/span\u003e\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003esetup\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003edigitalWrite\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eHIGH\u003c\/span\u003e);  \u003cspan class=\"t-c\"\u003e\/\/ set the idle level first\u003c\/span\u003e\n  \u003cspan class=\"t-f\"\u003epinMode\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eBUZ\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003eOUTPUT\u003c\/span\u003e);     \u003cspan class=\"t-c\"\u003e\/\/ so it stays quiet at start\u003c\/span\u003e\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003eloop\u003c\/span\u003e() {\n  \u003cspan class=\"t-k\"\u003efor\u003c\/span\u003e (\u003cspan class=\"t-t\"\u003eint\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ei\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e0\u003c\/span\u003e; \u003cspan class=\"t-v\"\u003ei\u003c\/span\u003e \u0026lt; \u003cspan class=\"t-n\"\u003e8\u003c\/span\u003e; \u003cspan class=\"t-v\"\u003ei\u003c\/span\u003e++) {\n    \u003cspan class=\"t-f\"\u003eplayNote\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003eNOTES\u003c\/span\u003e[\u003cspan class=\"t-v\"\u003ei\u003c\/span\u003e], \u003cspan class=\"t-n\"\u003e300\u003c\/span\u003e);\n  }\n  \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e2000\u003c\/span\u003e);\n}\u003c\/code\u003e\u003c\/pre\u003e\u003c\/details\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eCheck it works\u003c\/strong\u003e\u003cp\u003eYou should hear a rising scale from C to C, then two seconds of quiet, repeating. If you only hear clicks, the code is switching the pin on and off with digitalWrite instead of calling tone(). Change the numbers in NOTES to play your own tune.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003c\/div\u003e\n","brand":"NZN Electronics","offers":[{"title":"Default Title","offer_id":67798150447200,"sku":"MOD-BUZ-PAS-L","price":1.59,"currency_code":"NZD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/PAS-L_01_hero-transparent.png?v=1794971581"}],"url":"https:\/\/www.nznelectronics.co.nz\/collections\/buzzer-modules.oembed","provider":"NZN Electronics","version":"1.0","type":"link"}