Skip to main content

HOW TO CONNECT BUZZERS WITH RASPBERRY PI

BUZZERS

There are two main types of buzzer: active and passive.
passive buzzer emits a tone when a voltage is applied across it. It also requires a specific signal to generate a variety of tones. The active buzzers are a lot simpler to use, so these are covered here.

    CONNECTING A BUZZER

An active buzzer can be connected just like an LED, but as they are a little more robust, you won't be needing a resistor to protect them.
Set up the circuit as shown below:
buzzer
  1. Add Buzzer to the from gpiozero import... line:
    from gpiozero import Buzzer
    from time import sleep
  2. Add a line below your creation of button and lights to add a Buzzer object:
    buzzer = Buzzer(17)
  3. In GPIO Zero, a Buzzer works exactly like an LED, so try adding a buzzer.on() andbuzzer.off() into your loop:
    while True:
        buzzer.on()
        sleep(1)
        buzzer.off()
        sleep(1)
    
  4. Buzzer has a beep() method which works like an LED's blink. Try it out:
    while True:
        buzzer.beep()

Comments

Popular posts from this blog

Jio

Reliance Jio planning its own  cryptocurrency called JioCoin  elder son Akash Ambani leading the JioCoin project, Reliance Jio plans to build a 50-member team of young professionals to work on blockchain technology, which can also be used to develop applications such as smart contracts and supply chain management logistics

PUNCHING MACHINE

ACCIDENT AVOIDING SYSTEM FOR PUNCHING MACHINE SYNOPSIS The aim of our project is to take a system-wide approach to preventing the machine accident. The system includes not just the machine and the operator; but rather, it includes everything from the initial design of the machine to the training of everyone that is responsible for any aspect of it, to the documentation of all changes, to regular safety audits and a finally a corporate culture of safety-first. Design is the part of a machine's life where the greatest impact can be made in relation to avoiding accidents. The designer should ensure that the machine is safe to set up and operate, safe to install, safe to maintain, safe to repair, and safe to decommission. Although safe operation is usually at the forefront of a designer's mind, safe maintenance and repair should also be a high priority. Around 50% of fatal accidents involving industrial equipment are associated with maintenance activities, and design...