michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Anti-mosquito laser turret - requesting circuit design help

Sat Nov 19, 2016 2:08 pm

Greetings robotics forum,

I'm making a turret that shoots mosquitos with a laser using computer vision. I'm very comfortable with the software involved, but am new to the hardware and circuit design (voltage, current, etc.). Particularly, I'm not sure how to design a circuit that provides everything with sufficient power without blowing anything out.

Hardware list
  • Raspberry Pi 3 (and/or Arduino UNO, both available)
  • Raspberry Pi camera module (computer vision to track mosquitos)
  • USB webcam (to triangulate distance to target from 2nd vantage point)
  • Two stepper motors (28BYJ-48) with driver boards (ULN2003) for horizontal & vertical aiming
  • 5mW red laser (starting weak & safe)
Power consumption specs
  • Raspberry Pi 3: Recommended PSU current capacity 2.5A, Maximum total USB peripheral current draw 1.2A, bare-board consumption: ~400mA
  • Raspberry Pi camera: 250mA
  • USB webcam: 5V, 500mA
  • Laser 3-5V, 5mW (do I understand correctly that providing 5V will make this consumption 1mA? Amps = Watts / Volts)
  • Stepper Motors (each): DC 5V 4-phase, Insulation Resistance: >10MΩ (500V), Dielectric Strength: 600V AC / 1mA / 1s, DC Resistance: 200Ω±7% (25C)
Trying to figure out:
1) Can power everything directly off the Raspberry Pi 3, or do I need an external power source?
2) Do I need any resistors? If so, what might the circuit design look like? (or what's your thought process designing one?)

Appreciate any guidance,
-Michael

mattmiller
Posts: 2099
Joined: Thu Feb 05, 2015 11:25 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 2:48 pm

Come back when you've got the mosquitto tracking bit done and reliable before we start giving you ANY information on basically designing a automatic laser weapon :)

michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 3:27 pm

The software is already designed. Not that it's relevant to circuit board design, but I'll share the approach for those interested:

Using OpenCV as the computer vision library and a large whiteboard to specify the "hot zone".
- Software initializes and takes a still image. The initial image should be calibrated with no moving objects in it since we will treat any change in the image as motion detected.
- Any motion detected that exceeds 2cm square will indicate something larger than a mosquito in vision and will disable the turret until it leaves sight completely. (could be a squirrel, cat, dog, etc.) Always aires on the side of caution.
- As a secondary precaution, the initial still image is sent to Google's Vision API to look for humans, cats, dogs, etc.; that may be standing still in the initial shot. If any large living thing is detected the software will exit with an explanation.
- The coordinates of the whiteboard are detected and set as the maximum bounds the laser will be allowed to aim. If anything is already in front of the whiteboard's hot zone in the still image, the software exits with an explanation.
- Before hunting, the turret cycles through aiming at the 4 corners of the whiteboard to confirm it is calibrated correctly. When correct calibration and all other safety checks pass, the software provides the option to activate hunting mode.
- For mosquito tracking, without the hardware setup as well I'm not able to determine whether Raspberry Pi has enough processing power to track and aim in real time. If not, I plan to use an Extended Kalman Filter to assist with state prediction.

Additionally, my neighbor with a PhD in physics works with high powered lasers and offered to advise on safety. We're using a class IIIa laser which she advises is sufficiently safe.

boyoh
Posts: 1316
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 4:02 pm

michaela wrote:The software is already designed. Not that it's relevant to circuit board design, but I'll share the approach for those interested:

Using OpenCV as the computer vision library and a large whiteboard to specify the "hot zone".
- Software initializes and takes a still image. The initial image should be calibrated with no moving objects in it since we will treat any change in the image as motion detected.
- Any motion detected that exceeds 2cm square will indicate something larger than a mosquito in vision and will disable the turret until it leaves sight completely. (could be a squirrel, cat, dog, etc.) Always aires on the side of caution.
- As a secondary precaution, the initial still image is sent to Google's Vision API to look for humans, cats, dogs, etc.; that may be standing still in the initial shot. If any large living thing is detected the software will exit with an explanation.
- The coordinates of the whiteboard are detected and set as the maximum bounds the laser will be allowed to aim. If anything is already in front of the whiteboard's hot zone in the still image, the software exits with an explanation.
- Before hunting, the turret cycles through aiming at the 4 corners of the whiteboard to confirm it is calibrated correctly. When correct calibration and all other safety checks pass, the software provides the option to activate hunting mode.
- For mosquito tracking, without the hardware setup as well I'm not able to determine whether Raspberry Pi has enough processing power to track and aim in real time. If not, I plan to use an Extended Kalman Filter to assist with state prediction.

Additionally, my neighbor with a PhD in physics works with high powered lasers and offered to advise on safety. We're using a class IIIa laser which she advises is sufficiently safe.
Advice put all the bits in a box , You have a lot to learn yet
The forum will give you good advice, but not do it all for you.

First you need to understand basic electronics, this will need some
Practical work on a breadboard, and understanding Ohms Law.
A book on starter circuits , will be very handy , a multi meter
And a 0/12v 3/4a power supply .
There are no Magic books or formulas , for learning electronics
Just reading and building , Then if there is something you don't
Understand , you can ask the forum,

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 4:40 pm

Appreciate the advice on putting things in a box. I have the Raspberry Pi 3 and Camera module in a SPi-BOX, and will make a larger box for the rest.

I already have the stepper motors hooked up via a breadboard and finished programming an API to control aiming. The ULN2003 driver boards made the stepper circuits easy. I also successfully hooked the laser up to the breadboard and had it powered via the Raspberry Pi 5V & GND pins. Reading up that the GPIO pins are 3.3V, it appears the laser can be connected to one to control its activation.

Learned the basics of Ohm's law, but being new to hardware I have a sense there's a lot I don't know I don't know, so wanted to ask more experienced folks before hooking up everything simultaneously and blowing something out. I'm excited to learn more, but was hoping I might receive advice a little more targeted than reading a textbook on circuits. Not against doing that, but appreciate any more suggestions or warnings that might be available.

User avatar
bensimmo
Posts: 4152
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 5:53 pm

For the laser, power it externally and use a relay or other such electronic switch to trigger it.
That way when you need change the laser to something more powerful you'll not need to worry about the Pi side of things and current draw. (Possible just a better 'switch').
You are then just pushing the button.
For the moment a couple of AA cells will do and get that going.

Do you need servo help? What are you programming in?

michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 10:16 pm

Thanks, @bensimmo, external power with a relay for the laser sounds like a great way to go since everything else seems to be powered fine off the Raspberry Pi as is.

I think I'm all set -- confirming servos are already working property with precise aiming within 0.088 of a degree.

Thanks everyone for the help!

PiGraham
Posts: 3576
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 10:30 pm

You aren't serious I hope.
A laser powerful enough to kill flies is highly dangerous to eyes and also capable of damage and possible fire.

boyoh
Posts: 1316
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Anti-mosquito laser turret - requesting circuit design h

Sat Nov 19, 2016 10:36 pm

I suggest using solid state switching in your project, mechanical relays are
To slow and bouncy for the Laser firing circuit, you want high speed
switching. One possibility is using a capacitor discharge unit , switching
A thyristor( SCR) this would give you very fast switching pulse for the
Laser
This is only a suggestion Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 1:30 am

@boyoh thanks again, I'll use a thyristor per your suggestion.

@PiGraham the laser isn't nearly strong enough to kill a fly, and the motivation isn't to kill anything. As mentioned above the laser is 5mW (class IIIa) and the software uses an extremely cautious & multi-pronged safety routine outlined above. My primary motivations are more to practice my math & 3D object tracking. I tend to only be attracted to projects with potential practical value, so targeting mosquitos presents an interesting twist.

Related: organizations are experimenting with similar projects to control Malaria around clinics in Africa. [ref: a, b, c] Commercial solutions are expensive. If a safe & affordable open source solution can be made available it may help more areas.

User avatar
bensimmo
Posts: 4152
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 7:21 am

Relay was suggested as it was the first thing that came to mind for proof of concept, given all the data analysis I didn't think a fraction of a second really mattered here.
Once out of concept and using a pulsed laser, you can build in interlocks and other external safety devices, but of course look at more suitable switching then, but have a go at both :-D it was more the external powering.

In the literature I had read before, they are only after wing damage that are thin and fragile. DNA damage was also mentioned but not sure how that was expected to work, I did only skim.
The lasers in the lower wavelength UV would probably do that, I certainly had a good tan from one once :oops:

boyoh
Posts: 1316
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 2:55 pm

bensimmo wrote:Relay was suggested as it was the first thing that came to mind for proof of concept, given all the data analysis I didn't think a fraction of a second really mattered here.
Once out of concept and using a pulsed laser, you can build in interlocks and other external safety devices, but of course look at more suitable switching then, but have a go at both :-D it was more the external powering.

In the literature I had read before, they are only after wing damage that are thin and fragile. DNA damage was also mentioned but not sure how that was expected to work, I did only skim.
The lasers in the lower wavelength UV would probably do that, I certainly had a good tan from one once :oops:
In no way was I undermining your suggestion of using a relay.
I to studied the data analysis, and com to the conclusion that
That a mechanical relay was not suitable for fast signal switching.
I was very surprised at your remark on the relay slow operation,
Beining a fraction of a second did not matter.,From you this
Surprised me very much,
No hard feelings, regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 4:56 pm

michaela wrote:- Any motion detected that exceeds 2cm square will indicate something larger than a mosquito
Can you really see a mosquito with a web cam? Usually there are leaves moving and changes in lighting that occur that affect just trying to match on any changes in pixels. If you use data from more than one camera and have sufficient resolution, you could potentially figure out where in 3d space the object is. But mosquitoes are tiny.

michaela
Posts: 9
Joined: Sat Nov 19, 2016 2:03 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 6:38 pm

@stderr, yeah, figuring out how well I can calibrate the vision for small insects. It successfully tracks a small piece of candy tossed in front of the camera. Seeing how precise I can make it. One of the reasons for using the whiteboard to specify the zone where the camera will focus is to increase contrast of things flying in front of it.

User avatar
bensimmo
Posts: 4152
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Nov 20, 2016 8:08 pm

boyoh wrote:
bensimmo wrote:Relay was suggested as it was the first thing that came to mind for proof of concept, given all the data analysis I didn't think a fraction of a second really mattered here.
Once out of concept and using a pulsed laser, you can build in interlocks and other external safety devices, but of course look at more suitable switching then, but have a go at both :-D it was more the external powering.

In the literature I had read before, they are only after wing damage that are thin and fragile. DNA damage was also mentioned but not sure how that was expected to work, I did only skim.
The lasers in the lower wavelength UV would probably do that, I certainly had a good tan from one once :oops:
In no way was I undermining your suggestion of using a relay.
I to studied the data analysis, and com to the conclusion that
That a mechanical relay was not suitable for fast signal switching.
I was very surprised at your remark on the relay slow operation,
Beining a fraction of a second did not matter.,From you this
Surprised me very much,
No hard feelings, regards BoyOh
You get me wrong. I was just mentioning why I suggested relay, only a testing method and to explain to power away from the Pi. Any method that's faster and can deliver the current and voltage for higher power lasers should be used if possible.
I don't know the absorption rate of mossies or their wings to know what sort of fluence at what wavelength for what period of time would be needed. Or the animal cruelty you need to abide by for these things.

I just figured that determining it was a mossies in a picture via the internet was the slowest part of the setup.
Hope we find out and the methods used. It's an interesting use and problem.

The more commercial methods use wing beat analysis to determine mossies to species and even if male or female iirc.

User avatar
karrika
Posts: 1063
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Nov 21, 2016 7:52 am

Killing mosquitoes one by one is surely more ecological than the Swedish invention to put a small layer of oil on top of your grill and leave it on a low temperature for the night. It kills mosquitoes by the thousands every night. They get attracted to heat and carbon dioxide.

Image

PiGraham
Posts: 3576
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Nov 21, 2016 9:05 am

michaela wrote:@boyoh thanks again, I'll use a thyristor per your suggestion.

@PiGraham the laser isn't nearly strong enough to kill a fly, and the motivation isn't to kill anything. As mentioned above the laser is 5mW (class IIIa) and the software uses an extremely cautious & multi-pronged safety routine outlined above. My primary motivations are more to practice my math & 3D object tracking. I tend to only be attracted to projects with potential practical value, so targeting mosquitos presents an interesting twist.

Related: organizations are experimenting with similar projects to control Malaria around clinics in Africa. [ref: a, b, c] Commercial solutions are expensive. If a safe & affordable open source solution can be made available it may help more areas.
Sorry if I misunderstood. What effect does a low power laser have on mosquitos? Is the idea simply to chase them out of the room patrolled by the laser?
Isn't malaria best controlled by limiting the numbers of mosquitos, by killing some or introducing sterile competitors?

PiGraham
Posts: 3576
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Nov 21, 2016 9:16 am

michaela wrote:Related: organizations are experimenting with similar projects to control Malaria around clinics in Africa. [ref: a, b, c] Commercial solutions are expensive. If a safe & affordable open source solution can be made available it may help more areas.
Ah, the links make more sense
When an insect is illuminated by a galvanometer-steered 532 nm pulsed laser, its characteristic wing-beat frequency produces an oscillation in light intensity that can be used for identification. “For identification, five sequential wing beats are needed,”
So, not a camera system. An insect is illuminated by a scanning laser and the pattern of light reflected from it is detected to ID the target. The beam guidance gives the location. The insect is killed by momentarily increasing the laser power, incinerating the insect (or parts of) that is already in the beam.

(c) mentions retroreflector, s presumably the photonic fence is a laser bounced back from a fixed retro-reflector and insects in the mean reduce the intensity of the detected light. That might imply a tough retrorefelector and some protection mechanism, filter or shutter on the detector to avoid damage from the kill pulse.

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Thu Nov 24, 2016 9:04 pm

I'd love to see this if it works! I have built a vaguely similar setup that uses IR sensors to shoot humans with a 200mW laser, but it is very imprecise and only moves in azimuth. And it's quite dangerous. Sounds like you've already solved the difficult bit (the computer vision and software) so the hardware should be really easy. I reckon you can do it without doing any 'electronics' at all.

For the supply, just add up the currents. Allow 320mA each for the steppers. Everything is 5V which makes it really simple - I reckon a 4A supply would do it. All PSUs have a bit of overload capacity and internal capacitors that should keep the Pi running for brief periods when the motor are straining. If it was me I'd get a 5A supply for peace of mind and future expansion, though it will be a little bit more expensive than your average phone charger.

Split out the supply to the laser relay and motor drivers with chocolate blocks or something, don't try to power everything off the Pi. Some wiring might be required here.

As bensimmo says use a sold state relay for the laser. It will be plenty fast enough, and the control pin should plug straight into the Pi's GPIO. Loads of people will be a long in a minute to tell you you need loads of protection circuitry, but it'll work and I haven't blown anything up yet.

Similarly, the ULN2003 will plug straight into to GPIO. The only hardware problem I foresee is these motors are pretty slow compared to servos - 15rpm - so you might need to trade-off range and precision.
Submarine communication systems engineer and amateur robot enthusiast.

kbernardet
Posts: 4
Joined: Sun Dec 25, 2016 5:15 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Sun Dec 25, 2016 5:22 pm

Hi

I made a similar thing with :
- raspberry pi 3
- raspi cam
- 2 galvanometers to control the direction of the laser
- a fast relay to switch on/off the laser
- some electronics to control the galvanometers with the raspi (mcp4922)
- opencv to track the moving object
and a laser ...
I stopped this project because of the safety of the laser (too dangerous).

Karim

RadOD
Posts: 1
Joined: Fri Jun 09, 2017 7:28 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Fri Jun 09, 2017 7:34 pm

1. Where are we on this project? Any success? I'm late to this thread, but I'd be happy to help - is the software published?

2. Where did you find that mosquito-grill thing? I'd like to try that.

3. Laser power needed to kill a mosquito is lower than you might think: https://www.nature.com/articles/srep20936. I think the hard problem is how to detect the mosquito. Identification, tracking and destruction seem doable.

IanS
Posts: 232
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Jun 12, 2017 8:40 am

Class IIIa lasers are NOT safe! I have several years experience with lasers of varying powers at visible and beyond visible spectrum wavelengths, a PhD in laser physics, and attendance through enough laser safety courses that I could recite them. If your neighbour really knows about lasers, rather than just uses them, the response should have been along the line of "That's a stupid thing to do."

Your blink reflex is fast enough to save your sight with a Class I laser, but not with anything higher. If they are lucky, whoever gets in the way will escape with a small amount of retinal scarring, and only lose their sight in part of the total field of vision, but given the nearly instinctive response for somebody to look at a light that flashes in their eyes, that damage will be to the centre of the retina. Retina damage is not repairable.

There have been a number of projects on these boards, normally involving a mix of water and mains voltage, where considerable care is required, but very few that can be considered dangerous to somebody who just happens to be nearby. And no, the stated safety precautions are not sufficient. Can you guarantee that whatever image classification API you use is 100% effective? No. What happens if a person, sitting still, blinks? That is a small movement against a stationary background, which targets their eyes.

User avatar
bensimmo
Posts: 4152
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Jun 12, 2017 12:26 pm

IanS, what was the PhD research in? (Interested)

YCN-
Posts: 246
Joined: Fri Jun 10, 2016 3:18 pm

Re: Anti-mosquito laser turret - requesting circuit design h

Mon Jun 12, 2017 2:03 pm

I just get to read that post also, does any one has the software?
Can it be found online? I really love the idea. I was thinking about pigeon hunting with a watter gun, that software would be really cool to get me fast enough !

YCN-

IanS
Posts: 232
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Anti-mosquito laser turret - requesting circuit design h

Wed Jun 14, 2017 2:08 pm

bensimmo wrote:IanS, what was the PhD research in? (Interested)
Put simply: controlling light with light. Use a polarised high energy pulse to slightly rotate the polarisation of a following weaker linearly polarised beam. Purely optical equivalents of the opto-magnetic Faraday and Kerr effects. Further work after I left looked at embedding the control within a length of fibre, to make purely optical switching devices.
I can find abstracts for most of my old papers online (https://scholar.google.co.uk/scholar?st ... 8&as_vis=1), but the contents all seem to be behind pay-walls.
It requires really high power densities, which were achieved by building a laser that had an average power of about 1W, but which concentrated that power into 100fs (100E-15s) pulses at a 80MHz pulse rate, and then focused down to a point about 15um in diameter. That is a peak power density of about 1 peta-Watt per square meter (in a very small space for a very short time). At the time that was a world-class leading laser. Pulses that brief are not easy to obtain, and the only way to obtain 100fs was to build the laser yourself. These days you can buy sub-10fs lasers. e.g. https://www.thorlabs.com/navigation.cfm?guide_id=2024. That laser was powered by a Class IV commercial Nd:YAG laser with about 8W output power. Enough power that it would quickly burn through clothing and if it hit skin it hurt. No blood though - small laser wounds are self-cauterising. Still not the kind of thing you do twice. Both lasers were in the infra-red, which makes avoiding the beam just that little bit harder.

Return to “Automation, sensing and robotics”