In this straightforward Arduino project for beginners, a push-button switch is connected to Arduino pin a pair of and a speaker system or piezo disc is connected to pin eight. once the Arduino is battery-powered up or reset, a tune vies. If the push-button switch is ironed, the tune is replayed.

A speaker system is going to be a lot of louder that a piezo disk. If you are doing use a piezo disk, ensure that it’s not the buzzer kind that has inherent physical science to form it buzz once power is applied. Plain piezo disks also are equipped in an exceedingly plastic housing that makes them look a lot of just like the buzzer kind.

 

Connection Formula :

No series electrical device or resistance is required once employing a piezo disc. The piezo disk is a lot of sort of an electrical device than a resistive component. it’s high resistance and will not draw an excessive amount of current from the Arduino pin.

Replay-Tune-Arduino-Project-Circuit

Fig: Replay Tune Arduino Project Circuit

It is not necessary to attach a pull-up resistance to the push-button switch as a result of the inner pull-up resistance is enabled by the Arduino sketch. each version of the circuit connect a push-button switch to digital pin a pair of the Arduino and therefore the sound device to pin eight of the Arduino. The Arduino sketch that follows is employed for either circuit.



Required Parts :

Replay-Tune-Arduino-Project-Circuit-Parts

  1. Arduino Uno Board    [Purchase Links     Ali-Express       Amazon
  2. Project Board                                               Ali-Express       Amazon
  3. Connecting Cable                                        Ali-Express      Amazon
  4. Resistor – 330ohm                                       Ali-Express       Amazon
  5. Push Button Switch                                     Ali-Express       Amazon
  6. Buzzer                                                         Ali-Express       Amazon

SOURCE CODE



Tutorial watch the video