Skip to content

Micro:bit micropython library to calibrate a sound sensor KY038

License

Notifications You must be signed in to change notification settings

fizban99/microbit_ky038

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micropython library to calibrate and use a sound sensor KY038

This library helps calibrating a sound sensor KY038 with the micro:bit. It also provides a clap counter functionality. It assumes the Digital output of the sound sensor is connected to pin0 of the micro:bit. It uses an analog input, since the digital input seems not to be very reliable powering the sensor with 3V. Power and ground of the sensor are also connected to the micro:bit.

  • Helps calibrate the sound sensor showing an arrow on the micro:bit indicating the direction to turn the potentiometer
  • Has a clap counter included

Inititalizes the calibration routine. The micro:bit will display an arrow indicating the direction that you should be turning the potentiometer with a screwdriver.

from ky038 import KY038

KY038.calibrate()

Count the number of claps or any consecutive sudden sound.

from ky038 import KY038

KY038.calibrate()
while True:
    print(KY038.count_claps())

About

Micro:bit micropython library to calibrate a sound sensor KY038

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages