Create Project Need help?
Show more (2)

Electronic Mole Repellent [140078-I]

Status: Finished
May 3, 2013
in Elektor magazine | July 2014 | Find it here

Published in Elektor 2014 Summer Edition (July/August)

Electronic Mole Repellent

A few months ago, a friend asked me if I could design an electronic mole repellent she had heard about from another gardener. Not knowing much about repelling moles, I searched the internet for some guidelines on how these units work. I found a few commercial units claiming to repel moles with ‘Ultrasonic’ sound. After reading the specs, the ‘ultrasonic’ sound was in fact a 400Hz signal that is generated for a second or so, every 30 – 40 seconds.

I was quite skeptical whether this would actually have any effect on moles and after reading some of the comments on various gardening forums, about 50% of people said it did not work at all, whilst the rest claimed that it did work for them, I was even more skeptical.

However, I decided to give it a go, after all, if it did not work, the worst that could happen was that the moles would simply continue digging up my friend’s lawn. So after completing the project, I did inform her about my reservations.

To my surprise, my friend phoned me 3 months later and reported that the moles had stopped making mole-hills on the lawn, and had moved about 25 meters away to the bottom of the garden. She asked if I could make her three more, so that she can place them such, that it covers the entire garden area.

I could only find a few circuits on the Internet, all based around NE555 timers or some other ‘old school’ electronics, some of which were quite complicated and rather power hungry. I wanted a circuit that would allow me to put the device into the ground and forget about it for at least 3 months.

So, power requirements had to be at a minimum. I figured that 3 months would be enough to test the circuit’s effectiveness. I decided to use a PIC12F675 which I had at hand, but the circuit can also be made with PIC10F2xx. However, the PIC 10F2xx, only comes with an internal 4MHz oscillator which will consume slightly more power than an external crystal which is turned off during the sleep cycle.

Also the 12F675 can operate at 20MHz which also helps saving power as the duration that it requires to increment the counter between sleep/wake stages will be shorter. A piezo buzzer which has a frequency of 400Hz, with an operational voltage range between 8Volt – 16 Volt and producing a minimum sound output of 70 DB was selected to produce the ‘sonic’ output. The buzzer has its own built-in switch control circuitry, so it can be driven directly from one of the PIC’s output pins which is rated at 25mA. With a 9Volt supply, the power consumed is 12mA when the buzzer is activated.

A note about programming the PIC 10F and PIC12F chips: Using my trusty PICKIT3 programmer, I kept getting ‘write failed’ errors when trying to program these chips, yet I never had a problem programming PIC 16F and PIC18F chips. After a few frustrating days, I finally found the problem: If the power supply driving the Chip is less than 5 Volt (I used 3.3Volt) the PICKIT3 cannot program the chip. So initially, you must use a 7805 regulator in the circuit to program the chip. Then replace the 7805 with the PJ2950CT 3.3 Volt regulator. Please be aware that the pin-outs of the 7805 is different to the 3.3V regulator! See diagram. You could run the circuit using the 7805, but this will greatly reduce the battery life as the 7805 has a quiescent current of 5mA where the 3.3V regulator has a quiescent current of 75μA. I have also drawn a second circuit diagram, should you want to build a separate circuit for programming the PIC processor, rather than swapping a 7805 in the actual circuit. Having a permanent programming station also has its advantages.

Battery life:

The way I calculated the battery life is as follows: (Please correct me if I am wrong) I used two 9Volt Alkaline batteries in parallel to provide power. These batteries are rated at 530mAH, thus I have a total of 1060mAH at my disposal.

When the PIC is in sleep mode, it consumes about 150uA. Every 2.3 seconds it wakes up to check if a counter equals a preset value. If not, the counter is incremented by one, and the PIC goes back to sleep again. This operation consumes about 500uA for a period of about 100us. (at 4MHz clock rate) Once, every 30 Seconds, the buzzer is switched on for a duration of 800 ms consuming 12mA. So, on average it would be safe to say that the circuit consumes 12 mA every 30 seconds, for the duration of one second. The batteries can deliver 1060mA for one hour. Let’s make it 1000mA for ease of calculations.

Thus it can provide 1mA for: 1h*60m*60s * 1000 = 3600000 seconds, or, we can draw 1mA for the duration of 1 second, 3600000 times before the battery is depleted.

At 9 Volt, the circuit consumes 12mA every 30 seconds, thus 24mA per minute.

3600000/24 mA = 150000 minutes.

150000/60 minutes = 2500 Hours

2500/24 hours = 104 days or +- 3.5 Months.

Construction and placement:

I have provided 3 hex files: Molerep4MHz.hex, Molerep8MHz.hex and Molerep20MHz.hex, you can therefore select whether you want to design the circuit without an external crystal (4MHz internal oscillator),  with a 8MHz external crystal or a 20MHz external crystal.

After building the circuit, I placed it in a Plastic Jar (250ml) and sealed it with some tape to make it waterproof. I then asked my friend to find an entrance to a tunnel under a moles-heap and to place the jar inside the tunnel before covering it with sand. Of course, she had to remember where she buried it, so that she could retrieve it after three months, in order to replace the batteries. The hand-full of components cost me about 50.00 ZAR, which is equivalent to about 4 Euros or $6.00.

How does the device work?

I am not a rodentologist or entomologist, but after gleaning the Internet about mole behaviour, the following interesting facts came to light:

• Moles eat worms and insects, not plant roots and bulbs.

• They are very sensitive to vibrations and can detect the vibrations of worms moving around from quite a long distance. This is how they find their food.

• They do not hibernate during winter, the reason they seem less active, is due to the fact that worms tend to stay deeper below the surface due to the cold. Worms are more active at the surface when it is warm and moist, which normally occurs during the summer months. This is when mole-heaps appear on your manicured lawns and when flower beds get destroyed

• Moles are very territorial. The reasons cited why vibration works as a deterrent are as follows:

• It interferes with them finding their food in the area of the 400 Hz signals.

• It makes them think another mole is burrowing nearby.

• It irritates them. Are there any gardeners out there that would like to prove the effectiveness of this circuit by building and testing it?

Maybe we can prove once and for all, whether and electronic repellent is effective or not. The circuit can be built in a few hours and is a fun project for a rainy afternoon.


1) If the device is placed in a tube, which has adequate length to house 6X D-cell batteries, the unit would be able to run for two years or longer without changing the batteries, as these batteries can provide from 8500mAh to 18000mAh depending on make and chemistry used.

2) If changing the batteries seems too much trouble, solar cells and rechargeable batteries could be used to make the device maintenance free. In the long run, this may be more cost effective. This would mean though, that you would have to mount the device in a tubular container that can be driven into the ground upon which you would mount the solar cell on top. Many commercial units seem to use this approach.

3) Use a magnetic reed switch (Normally Closed) and a magnet to keep the device switched off whilst it is not installed in the ground. When you place the device into the ground, remove the magnet which is taped to the outside of the container covering the reed switch, to switch it on.

Read the full post
Show less

Loading comments...