# Implementation of a simple number counter for a mosquito zapper

#### dennipeter

Joined Oct 13, 2020
9
Hello folks,

I am a designer from India trying to make a mosquito zapper that keeps count of the number of mosquitos killed.

I am trying to implement a number counter to the circuit of a readily available mosquito zapper bat (Image below).

I want to do this using an arduino nano or an ESP 32 chip. Essentially, each time the zapper zaps a mosquito, I want it to send an input into one of the digital pins of the arduino.

The capacitor at the end of the circuit reads 2000v. I assume this is going to be the output voltage between the steel meshes. I do not have a high voltage multimeter to verify this. I am unsure about how to convert this into a safe voltage spike that can be read by the arduino's pins.

Apologies if this is a noob question.

#### AnalogKid

Joined Aug 1, 2013
11,201
Photo of the underside of the board. This will tell us if the magnetic component is a transformer or an inductor, and if either side of the 2 kV output is referenced to the input ground.

You probably can form a differentiator / edge detector / attenuator with a small, high-voltage rated capacitor and a resistor, plus a diode to keep the signal within the Arduino input voltage range. This should make a narrow spike pulse with each zap.

ak

#### dennipeter

Joined Oct 13, 2020
9
Photo of the underside of the board. This will tell us if the magnetic component is a transformer or an inductor, and if either side of the 2 kV output is referenced to the input ground.

You probably can form a differentiator / edge detector / attenuator with a small, high-voltage rated capacitor and a resistor, plus a diode to keep the signal within the Arduino input voltage range. This should make a narrow spike pulse with each zap.

ak

Thanks @AnalogKid for the quick response.

Here are some more pictures of the mentioned part.

Could you point me in the direction of a similar example/ link / video explaining how to wire the mentioned differentiator circuit. The concept is new to me. I am not an electrical engineer by training.

#### Attachments

• 1.4 MB Views: 6
• 1.2 MB Views: 7

#### jpanhalt

Joined Jan 18, 2008
11,087
Hello folks,
I am a designer from India trying to make a mosquito zapper that keeps count of the number of mosquitos killed.
Obviously, you have never been to Minnesota. There, they keep score of the number of mosquitoes killed in a single zap. Your device might be useful in the antarctic.

#### sghioto

Joined Dec 31, 2017
5,430
What is the red LED for? What does it indicate?

#### Dodgydave

Joined Jun 22, 2012
11,358
Looks like the HV comes out of the transformer into a bridge rectifier using 4 diodes and a smoothing capacitor,into the Green and Red wires.

Is this fed from AC and DC voltage, as there are two bridge rectifiers ?

#### dennipeter

Joined Oct 13, 2020
9
What is the red LED for? What does it indicate?
Red LED indicates that there the mesh is charged with a high voltage.

#### sghioto

Joined Dec 31, 2017
5,430
When a bug gets zapped does the red LED go off or blink?

#### dennipeter

Joined Oct 13, 2020
9
Looks like the HV comes out of the transformer into a bridge rectifier using 4 diodes and a smoothing capacitor,into the Green and Red wires.

Is this fed from AC and DC voltage, as there are two bridge rectifiers ?
Yes, you are right.
From what i have learnt. There is a cheap rechargable 3.3V battery inside. The transformer increases the voltage to about 300V, and then the capacitor increases that further to about 2000V.

I am not if the transformer, in the process converts to AC.

You mentioned that there are two bridge rectifiers with 4 diodes each? But I only see 3 diodes after the transformer.

#### dennipeter

Joined Oct 13, 2020
9
When a bug gets zapped does the red LED go off or blink?
No, It does not.
As long as the red light is on, you can Zap a bug with the bat. If the red light is not on, the bat will not Zap.

#### sghioto

Joined Dec 31, 2017
5,430
I have never used one of these devices ,when a bug gets zapped does it make a loud pop?
If so wondering if a sound sensor might work.

#### dennipeter

Joined Oct 13, 2020
9
I have never used one of these devices ,when a bug gets zapped does it make a loud pop?
If so wondering if a sound sensor might work.
Yes,I did think of putting a sound sensor. But that did seem a bit rudimentary. Also, external sounds may be able to trigger the counter.

This thing works like a regular electric fly zapper, only change is in the form factor, and you can wave the bat around to hit the mosquitos.

#### sghioto

Joined Dec 31, 2017
5,430
I see three diodes and three capacitors. Might be a voltage tripler circuit but that would mean 800 volts off the transformer.
Yes,I did think of putting a sound sensor. But that did seem a bit rudimentary.
That might be your best option as far as isolating the bat from the arduino. Another idea is a sensor that will detect a "vibration" of sorts when the bug gets fried. Maybe a piezo sensor.

Last edited:

#### dennipeter

Joined Oct 13, 2020
9
I see three diodes and three capacitors. Might be a voltage tripler circuit but that would mean 800 volts off the transformer.

That might be your best option as far as isolating the bat from the arduino. Another idea is a sensor that will detect a "vibration" of sorts when the bug gets fried.
Thanks you. Appreciate the input.
Is there not any other way to make a parallel circuit that can detect a large voltage spike in a nearby circuit?

I'm still waiting on a reply from @AnalogKid. But what do you think about his suggestion in post #2?

#### sghioto

Joined Dec 31, 2017
5,430
But what do you think about his suggestion in post #2?
I would like to see that circuit as well.
Without a bat on hand it's difficult to know how the high voltage output changes when a bug is hit. I would think there would be a measurable drop and that would be useful. Either way using sensors or voltage differentials you are going to have to do some experimenting on the device to get the needed data.
Personally I think the piezo sensor idea is worth a look.

#### jpanhalt

Joined Jan 18, 2008
11,087
What if two bugs at about the same time hit the mesh?

#### dennipeter

Joined Oct 13, 2020
9
What if two bugs at about the same time hit the mesh?
I'm willing to live with that comprimise. That would be a rarer occurrence.

#### dennipeter

Joined Oct 13, 2020
9
I would like to see that circuit as well.
Without a bat on hand it's difficult to know how the high voltage output changes when a bug is hit. I would think there would be a measurable drop and that would be useful. Either way using sensors or voltage differentials you are going to have to do some experimenting on the device to get the needed data.
Personally I think the piezo sensor idea is worth a look.
Thanks, Didnt think of a piezo electric sensor. Can try experimenting with that.

#### djsfantasi

Joined Apr 11, 2010
9,188
I'm willing to live with that comprimise. That would be a rarer occurrence.
Where do you live again? Up here, that wouldn’t be a rare occurrence at all. What would be rare is less than 4-6 mosquitoes at a time.

#### jpanhalt

Joined Jan 18, 2008
11,087
Where do you live again? Up here, that wouldn’t be a rare occurrence at all. What would be rare is less than 4-6 mosquitoes at a time.
I was referring, perhaps too obliquely, to a legend from the days of Lewis and Clark's that, "It takes a brave man on a fast horse to cross Minnesota in the Summer."