Arduino Beginner Series: Project 11: High Voltage Indicator using an Active Buzzer

Hello everyone!! Welcome to this post on Arduino LED Projects!!
Need a short introduction to what the Arduino is then click on LINK
Check out the breadboard intro right HERE

In this project we’ll build a high voltage indicating system, in which the buzzer goes off when the voltage is above 4V (Arduino supplies from 0-5V).

Demo:

Things Required:

  1. Arduino UNO
  2. Breadboard
  3. Jumper Wires
  4. Active Buzzer Module
  5. 10k Potentiometer
  6. Arduino IDE on computer

Functions used:

  1. digitalWrite()
  2. Serial.println()
  3. analogRead()
  4. pinMode()

Reference Material:

  1. So there are basically two Types of buzzers : Active Buzzers and Passive Buzzers. Here I’ve used an Active Buzzer. The basic difference is that an active buzzer as an internal oscillator which generates the tone and it requires a dc voltage. The passive buzzer however, requires an AC input.
  2. I’ve used this (LINK) video as a reference.
The one on the left is an Active Buzzer and the one on the right is a passive buzzer

Code:

View on/ Download from Github: (LINK)

int potpin=A2;
int potval;
float volt;
int buzzpin=12;

void setup() {
  // put your setup code here, to run once:
  pinMode(buzzpin, OUTPUT);
  pinMode(potpin, INPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:

  potval=analogRead(potpin);
  volt=(5.0/1023.0)*potval;
  Serial.println(volt);

  if(volt>4){
    digitalWrite(buzzpin, HIGH);
  } else {
    digitalWrite(buzzpin, LOW);
  }

}

Stay Tuned for upcoming posts on Arduino Projects! We’re on the basic newbie projects right now and slowly, gradually move on to those cool, ultra techy projects!! Want to be the first to know when a new and amazing post comes up?? Then feel free to subscribe!

Happy Learning!!

Leave a Reply

PHP JS HTML CSS BASH PYTHON CODE

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: