The Crop Duster Buster! A Launchpad-Controlled Clapper

The Crop Duster Buster is sure to keep your pet's toot smell away!

Don't you hate when you're sitting with your loved one and they toot without warning? While you can't train your dog, Buster, to hold it in—you can create a device that will help supply fresh air to your personal space with the clap of a hand! (Okay, so two claps but you get the idea!)

the-crop-duster-buster-a-launchpad-controlled-clapper

BOM:

launchpad_crop_duster_diagram_4

Why?

While I was sitting there peacefully watching my Sunday cartoons, I heard a strange noise emitted from beside me. Moments later I smelled what it was. My first instinct was to nudge my cat, Olive, away from me and after doing so I realized that it didn't do the trick. I had to leave the room! That's where I drew the line. Nobody interrupts my television, and I certainly don't watch TV without my cat by my side.

With some basic components that were lying around the house, I was able to create the “Crop Duster Buster.” Never again would I have to worry about the smell of my cat's toots.

How?

Thanks to the original article, I was able to pull this project together rather quickly. The first step was to create the microphone preamplifier. A very basic preamp is all we need for this project, and we can get adequate results with the BJT-based circuit shown in the schematic. But if you're looking to do any serious audio work, you'll want to use a solid op-amp based circuit (the MAX4465 is an op-amp that is optimized for microphone preamp applications).

The preamp circuit, combined with the analog-to-digital converter within the Launchpad, allows us to convert sound into digital data ready for some simple signal processing. We will need to program the Launchpad to detect voltage peaks corresponding to the claps. We can use the following code to collect ADC data for analysis; looking at some data will help us come up with an effective detection scheme.

                    void setup()
{
Serial.begin(9600);
}

void loop()
{
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
}

Within our program, we tell the Launchpad to look for two claps within 500ms of each other and above an adjustable threshold. A pushbutton allows us to set the threshold to one of three predefined values. The yellow LED gets brighter as sensitivity increases. When the Launchpad detects the two-clap pattern, it can perform whatever task we choose; in this project, it actuates a relay, which in turn powers a fan.

 

Read More:  The Crop Duster Buster! A Launchpad-Controlled Clapper


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top