Arduino Mosquito Repeller

57,699

395

47

Introduction: Arduino Mosquito Repeller

In this instructable I'm going to show you how to build a mosquito repeller using an Arduino. The repeller is in the form of a shield that plugs into the Arduino board and the frequency of the repeller can be changed easily.

This project is ideal if you are going camping or hiking outdoors, this device produces a sound of 31KHz Frequency which acts as a mosquito repellent. The frequency of this device can be adjusted and at 23kHZ to 54 kHz it also acts as a dog whistle. Human ears are not sensitive to these frequency ranges.

You can also view the video below on how to build this project.


Step 1: Tools and Components

Here is a list of the components and tools required, the list is simple and all you need is

  • Arduino Uno
  • PCB
  • Piezoelectric Disk
  • Header Pins
  • A breadboard (optional)
  • Wires
  • Soldering Iron
  • Soldering Lead

Step 2: Measuring

For this project we will be using digital pins 9 and 11, you could use any other pin with PWM support. So we will need to cut the header pins to our requirement. Then plug the headers into the PCB and mark the layout of the shield. Solder the header pins on to the Arduino, to solder the pins move the black connectors up a little bit and then solder it.

After soldering place the PCB on the Arduino to see if everything fits fine.

Step 3: Cutting

After soldering the headers lets cut the excess PCB out, to do this I used a rotary tool, you can also use a PCB cutter. After cutting the PCB you should have a shield, like the one in the picture. You can sand out uneven edges to get a cleaner look.

Plug the board on the Arduino to make sure it fits right.

Step 4: Circuit

The circuit is very simple, one of the piezoelectric disk is connected to digital pin 9 and the other to digital pin 11. The left over terminal of both the disks is connected together and soldered to the ground terminal of the Arduino. I am using two digital pins because I want to generate two different frequencies. You could connect both the disks in parallel if you like to use only one frequency.

Setting both the disks to the same frequency will cause the board to resonate and will give you more range.

Step 5: Code

The code for this circuit can be found below the code is really simple and is self explanatory, you can change the frequency by altering the frequency range in the code. 31KHz is the frequency that repels mosquito's and 23kHZ to 54 kHz to act as a dog whistle.

int speaker = 9;
int frequency = 31000;
int speaker2 = 11;
int frequency2 = 31000;

void setup(){
pinMode(speaker, OUTPUT);
pinMode(speaker2, OUTPUT); }

void loop(){ tone(speaker, frequency, 1000); tone(speaker2, frequency2, 1000); }

Makerspace Contest

Participated in the
Makerspace Contest

Be the First to Share

    Recommendations

    • Make It Bridge

      Make It Bridge
    • For the Home Contest

      For the Home Contest
    • Big and Small Contest

      Big and Small Contest

    47 Comments

    1
    piyushraj0001
    piyushraj0001

    3 years ago

    Can we use this for variable frequency for different pests , you have the code for variable frequency..?

    0
    JJL
    JJL

    Reply 1 year ago

    /*note that I used unsigned int for frequencies over 32000 */
    int speaker = 9;
    unsigned int sfrequency = 22000;
    unsigned int efrequency =42000;
    void setup(){
    pinMode(speaker, OUTPUT);
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);
    }
    void loop(){
    for (unsigned int i = sfrequency; i <= efrequency; i=i+500) {
    tone(speaker, i);
    delay(2000);
    /*noTone(speaker);*/
    }
    }

    0
    terencesaron
    terencesaron

    3 years ago on Introduction

    hai brother, the piezo buzzer produce how much sound in decibels ?

    0
    JJL
    JJL

    Reply 1 year ago

    I purchased some of these ultrasonic speakers they are much louder than the little pickup piezo's. They draw about 10ma so you can wire 2 directly to Arduino. They are on Amazon for about $7

    piezo speaker.jpg
    0
    JJL
    JJL

    Reply 1 year ago

    Not much sound comes out of these little discs. I set it to 4000hz and could barely hear it.

    0
    JJL
    JJL

    Answer 1 year ago

    These Piezo discs user very little power, so you could hook 3 or 4 to the same pin. The tone command only works on one pin at a time.

    0
    JJL
    JJL

    Tip 1 year ago

    I could only get one pin to work at a time for the Tone output. I looked up the Arduino tone syntax and you can only have one tone active at a time. Send a notone() command to disable one pin and to use another/

    0
    GeroE1
    GeroE1

    Question 4 years ago on Step 5

    Does this need a chemical like electronic mosquito repellent?

    0
    Apu07
    Apu07

    4 years ago

    Thanks for your post; just for the sake of clarity; the code says

    int speaker2 = 11;

    But, in the wiring there is no connection speaker2 (one of the piezoelectric) with Arduino´s pin 11.

    could you check please. Thanks you for your time and replay.

    0
    rggames96
    rggames96

    5 years ago

    can i change piezo to buzzer?

    0
    JunezRiyaz
    JunezRiyaz

    6 years ago

    Great Work dude.

    0
    ronj56
    ronj56

    6 years ago

    I enjoyed tinkering with the piezoelectric disk and the tone function in Arduino. However as a repellent, seem the science is not there. Might give it a try on my front porch though. Thanks.

    http://www.bbc.com/news/magazine-20669080

    0
    Cyberchipz
    Cyberchipz

    Reply 6 years ago

    By the mouth of two or three. Here is another link to establish the word!

    http://www.mosquito.org/faq#ultrasonic

    2
    jonTW
    jonTW

    6 years ago

    What frequency would I need to scare squirrels? I'm fighting a losing battle in my backyard..

    0
    Cyberchipz
    Cyberchipz

    Reply 6 years ago

    I was thinking about this and came up with two thoughts. 1:) You could come up with a frequency, and if irritating enough possibly it would push the squirrel away and do what you want. On the other hand, it could simply act as an alarm telling squirrels, "Hey, food here!" much like a dog whistle calls a dog.

    On a third note, I was thinking that two dissonant frequencies, as there are two emitters, just might be discouraging enough to repel them, if would me if I could hear them; I think it's worth a try; but, I don't have a squirrel problem; so, good luck.

    0
    JAK101
    JAK101

    Reply 6 years ago

    I recommend you look up essential oils that squirrels don't like. Then simply dilute this essential oil into water or a natural cheap oil (perhaps vegetable oil) or sorts and spray on your yard and areas where squirrels are bothersome. If you look at the ingredients on products sold at your local store for squirrel deterrents majority of the time you'll find they are using essential oils.

    0
    JAK101
    JAK101

    Reply 6 years ago

    Make sure you reapply after any rain fall as the essential oils are washed away.

    0
    LanceM25
    LanceM25

    Reply 6 years ago

    when you get that answer i too would like to know.

    0
    gobocop
    gobocop

    6 years ago

    Great project!!!

    Let me ask you two questions.

    Can I send data using this desing (kind of a ultrasound modem)?

    And if so....would the same desing able to listen? (changing speaker for micro)

    Thanks!