DIY Printed Circuit Boards – Part 2: Isolation Milling

Isolation milling is not an option available to everyone! It requires that you have a small CNC mill that has the required accuracy to mill tracks of the thickness that your design requires, and alsothe  necessary software. I have a Sieg X1LP mini mill (ArcEurotrade) that I converted to CNC using my own parts. You can see a picture of it below. My mill does not have ball screws and the Z axis is driven directly via the bevel gear that used to be operated by a hand-wheel. Thus, I think it would be fair to describe the whole system as pretty crude. However, through the wonders of Mach3, the software that takes G code and converts it into the signals required to drive the stepping motors that operate the XY table and the Z axis, it is possible to tune the mill to be surprisingly accurate. The key to accuracy when using the ACME lead-screws that come with the Sieg mill is to regularly check the mill’s accuracy and set the backlash compensation so that its movements are both accurate and repeatable. The backlash compensation in Mach3 works extremely well – in essence, it does exactly what the operator would do were they operating the mill manually. When used manually, one works with the mill to take up the backlash before dialling in a further real movement of the table. So, for example when making an X axis movement to the left after the mill has made a movement to the right, on first turning the hand wheel one encounters no resistance as the lead-screw’s thread moves to take up the slack within the drive nut. It is only once that slack has been taken up that the hand wheel begins to drive the table. In Mach3 you can tell the programme to make the movement that removes the backlash and then drive the table the required distance. At the end of this blog entry, I provide a reference to a video that shows you how to do this. Suffice it to say, that with the backlash compensation correctly set, the X1LP mill is very accurate – without it, you will not be able to mill a PCB. Obviously, the head of the mill needs properly ‘trammed’ – set to be absolutely orthogonal to the surface of the table. My Sieg came very well trammed and no shimming of the column carrying the mill head was required. I suspect the advice given above will apply to almost any small mill regardless of make.



My CNC converted Sieg X1LP mill. The MPG handwheel is a very useful accessory enabling you to operate the mill while standing right in front of it!

The first step in the production of a PCB is to use design software to create the files you require to produce the G code to drive the mill. I use EasyEDA. This is a web-based system. It is very easy to use and has the option to either send the files off to have EasyEDA manufacture your boards or to download the files you need to make them yourself. Thus, you have a way of making both a prototype board for yourself, and a way of ordering as many copies as you like! There are tutorials showing you how to use EasyEDA so I will not explain here ( ). The design process consists of drawing your schematic by placing components or packages on a canvas. You can use SPICE to simulate the circuit if you wish. Following this, you can convert the schematic into a PCB. It is important to bear in mind the separation distance between tracks – this needs to be more than twice the tip-diameter of the cutter used in milling the board.


Simple schematic of an Arduino button pad created using EasyEDA


The PCB design from the schematic above

Pressing the ‘Fabrication Output’ button at the top of the EasyEDA PCB design screen will open a new browser window giving you the option to download the Gerber files to your computer. The files are download to a zipped directory which contains the following types of file all with the name Gerber_drill with the file extensions GTL, GBL, GTS, GBS, GTO,GBO, DRL, GKO, GTP.

These apparently bewildering file suffixes have the following meanings:

GTL = top copper

GBL = bottom copper

GTS = top solder mask

GBS = bottom solder mask

GTO = top silkscreen

GBO = bottom silkscreen

DRL = NC drill

GKO = board outline

GTP = top paste

Only two or three of these files are relevant to milling your board. The DRL file, which contains the points at which the board needs to be drilled for component leads etc., and the GBL and/or GTL files which contain the information concerning the track layouts on the top and bottom copper surfaces of the PCB. To make use of these files you will require a piece of software like CamBam which is an application to create CAM files (G-code) from CAD source files or its own internal geometry editor. It like other programs of its kind, can import Gerber files and turn them into the G-code that Mach3 requires to drive your mill in order to cut your PCB design. Let’s consider the procedure for utilising the Gerber files produced from a PCB design program such as EasyEDA for a single-sided design.

Since Gerber files record everything in Imperial units, in CamBam (or equivalent) set everything up for ‘inches’. Then, open the GBL file and you will see something like this:


The Gerber GTL file imported into CamBam


Gerber DRL file imported into CamBam and superimposed on the GTL file

Select all the tracks and hit ‘Copy’. Now open the DRL file without saving the tracks and hit ‘Paste’. You now have the tracks and the holes superimposed. I now convert the units metric. I do this because all my tooling is metric. After selecting all the components of the design, you can drag the design to a convenient location relative the XY origin. Now, select all the tracks in the design and specify how you would like these to be milled. Select ‘Profile’  as the milling operation and set the parameters to mill outside the profile. I use a 0.2mm 30 degree V-cutter of the kind used for engraving and run the mill at maximum RPM. This means that the minimum tool diameter you should set is 0.2mm. However, this assumes that it is the tip of the cutter that will do all the cutting when in fact the diameter of the cutter at the chosen cutting depth will be greater than this so you will need to lie about the tool diameter! The depth of copper depends on the board you buy. For 0.5oz board the copper is 0.7mils thick or about 17.5 microns, for 1oz board it is double this and double again for 2oz board. So for 1oz board, using a piece of scrap, try something about 0.25mm for the tool size along with a cutting depth of about 50 microns. If you get the depth or diameter wrong, the tracks you cut will either not be isolated or be cut to be narrower than you wanted. During the milling process you can use any manual Z fine tuning adjustment your mill have to get the the depth of cut just right. Also, if the cuts are not deep enough, you can mill the same piece of board a second time setting the Z zero point a little deeper. However, before setting off to mill a board you will need to convert the design to G-code and save it. I save the ‘track G-code’ and the ‘hole G-code’ to separate files and mill them sequentially. So after selecting the tracks and specifying how they are to be milled, you can save the G-code file for them and then deselect (or delete) them. You can then select the holes and specify drilling operations for them and create a separate G-code file for them. If in the end you want lots of different sized holes then I suggest you may find it easier to first drill them all to the same size and then drill the larger holes out by hand using a Dremel or, even just use the V-cutter to ‘dink’ the centres of all the through-the-hole pads and drill them by hand. If you don’t do this, you will need to edit the G-code to stop the mill and make the necessary tool changes – too difficult for me! Don’t be tempted to drill on the copper without a guiding ‘dink’ or pilot hole – your drill will skid all over the place!


The mill all set up and ready to go

Holding down a piece of FR4 for milling can be problematic. The technique I employ is to use double-sided tape to stick the board to a piece of MDF and then clamp the MDF to the mill table. Not all boards are equal! The flatness of the board is critical so any variation in the thickness of it will cause problems. For this reason it is probably a good idea to steer clear of the cheaper board you see advertised on eBay. Because of the shallow depth of cut, it is crucial to accurately zero the Z axis. To do this you can use an electrical method, lowering the mill until you get the first electrical contact between the tool and the copper surface of the board, or you can employ a magnifying glass and watch for first contact (I do the latter with the mill running). During the cutting process I usually sray a little WD40 onto the surface – it seems to result in a slightly better cut. Using the technique described above I can easily achieve tracks of 0.2mm thickness.


Tungsten carbide V-cutter used for milling PCBs and a tungsten carbide micro-drill for drilling the holes for component leads etc.


The PCB held on double-sided tape


PCB after milling both the ‘tracks’ and ‘holes’ files


Setting up a mill to do backlash compensation in Mach3:



Posted in electronics, Photography and electronics | Tagged , , , , , , , , , , , , | Leave a comment

A new web site for macro and insect lovers!

Having spent a year getting the house here in the Tarn ready, and building a new workshop, I finally got round to  building a website with my own domain name – The subject of the web site is, “Musings on the French countryside, photography, science, and the meaning of life”. It has some of my ‘bad macro’ pictures of some of the beautiful things to be found here in the Tarn, France. By ‘bad macro’, I mean handheld photos taken without a flash of things that move about and that thus are never absolutely pin sharp! So, ‘bad macro’ is a phrase I use to describe the photography I do aimed at catching as many images as I can of the creatures and plants that fascinate me – a sort of nature notebook. I can put my wonderful micro 4/3rds camera in my pocket along with my 60mm macro lens and wander and wonder without the encumbrences of tripods, flashes etc. I save photography with a strobe and other gubbins for other occassions – I love both sorts of photos but a pocketable setup is hard to beat sometimes. Take a look!



Posted in Photography and electronics | Tagged , , , , , , , , , , | Leave a comment

DIY printed circuit boards – printing and milling. Part 1: photo-etching.

There are several ways that an amateur can go about making their own printed circuit boards. They include: the toner transfer method, photo-etching and isolation milling. Their is another alternative – sending your design off to a commercial supplier. For a long time, I have used very basic software (Circuit Wizard) for designing my own circuit boards. More recently, I have used KiCAD and EasyEDA. Of these two, I have found EasyEDA very easy to learn and use. It also has, should you need it, the facility to send a design off and have the boards made at a very reasonable cost. For that reason, and because it also incorporates a simulation package, I have now concentrated on using it rather than any other package. The only ‘down-side’ to EasyEDA is that it is web-based and your designs are created and remain on the EasyEDA server. However, you can download Gerber files and PDFs to enable photo-etching and isolation milling.

I am not going to explain how to use it here, you can find everything you need at: Here, I am just going to explain how I used to make and how I now make PCBs at home. I have no experience of the toner transfer method so it won’t be discussed. Suffice it to say that it involves transferring the plastic toner used by laser printers from glazed paper to the surface of a copper-clad board where it protects the copper from the etchant during the etching process. This, the first of two posts, explains how I photo-etch PCBs. A later post will explain how to use a milling machine to do the same.


What you need

To make your own photo-etched PCBs you will need an inkjet photoprinter – I have used both an Epson R300 and a Canon Pixmar 4950 – both worked very well. In addition, you will need a hairdryer, some pre-sensitized photoboard  (Maplin can supply this), a UV light box – I made my own (see below), some OHP film designed for use with an ink jet printer (I use the stuff you can buy from WH Smiths), some developing trays, a pair of broad plastic forceps, a measuring cylinder or jug, something to weigh out the chemicals, and some software in which to create PCB designs (see above). To drill the boards, you will need a Dremel or other small hobby drill.

Printing your design

I have found that ink jet printers can do a first rate job.  However, the settings are crucial. Print your design onto inkjet OHP film. You can buy this in WH Smiths or get it on the web. Results may vary between manufacturers. With WH Smith’s film I print using the ‘Glossy photopaper’, ‘high quality’, and ‘photo printing’ options. Print your design to the film using these settings and remember to use the rough side of the plastic sheets. The rough side carries a coating designed to absorb the ink. Once you have printed your design, dry the film with a hairdryer holding the dryer about 45 cms away. Don’t let the film get too hot – it will curl and distort. Drying takes about 2 minutes. Return the film to the printer and overprint your design and then dry it again with the hairdryer. Remarkably, with my Canon printer, the two prints line up perfectly. If you hold up the film to bright light after the first printing it will appear slightly transparent, but after the second printing, it should be jet black. Tiny details can be reproduced and I have produced boards with tracks only a fraction of a millimeter wide.

A caution, the OHP prints may appear totally dry but actually they are slightly hygroscopic and will forever by slightly sticky to the touch. They can be stored for a few months but eventually blur as the ink diffuses through the paper’s coating. I haven’t found this to be a problem – you can always print another mask.

Mask printed on a photo-printer.

Exposing the printed circuit board

This step requires some experimentation. However, it will not take long to establish for exactly how long the board needs to be exposed. I have a homemade UV light box. It consists of two Sylvania blacklight 350 tubes mounted in a wooden storage box bought from Homebase. It has a 5mm glass platen and a switch. I used some aluminiumized radiator reflector material to make a reflector for the tubes. The whole thing cost about £20 to make. When in use, it is covered with sheet of card and a black cloth. NEVER let any UV light enter your eye! If I were making the box today, I would probably use half a dozen 3W UV LEDs.

To expose the board I attach the mask to the copper surface using a tab of sellotape and place it on the platen. I put a heavy book on the board to make sure there is a good contact between the mask and the board. I cover the whole thing with a black cloth and then switch the tubes on. For me, the exposure times are about one minute and fifteen seconds. To establish the best exposure times you need to make a test strip – i.e. expose a piece of board through a photo-mask while using a piece of card to block the light from a portion of the board. Move the card along and expose it again etc. I used intervals of 15 seconds for this and then, when I had checked out how well this had worked by developing the board, I made a second strip using 5 second intervals. Exposure time is crucial and I have found that you need to be within 10% of the correct time to get a perfect board. My lights may be a little bright or too close to the board because ideally one might like exposures to be around five minutes. However, it works perfectly for me so I’ll stick with it.

My DIY UV light-box – you really don’t need anything more complicated!

Once the board has been exposed, you will be able to see your design on the photoboard’s surface.

Developing the PCB

Probably the wise thing to do is to buy some purpose made PCB developer from a supplier like Maplin. I made my own. It consists of 2.5 grams of sodium metasilicate (anhydrous) and 5 grams of sodium hydroxide in 375 ml of water (see below for a link to the origins of this formulation). Both these chemicals are dangerous and need to be handled with care. Add the sodium metasilicate slowly to the water and protect yourself appropriately from splashes. Then add the sodium hydroxide again taking great care. Shake until everything has dissolved. The developer keeps for a few weeks. If in doubt, make it up fresh every time.

To develop the board, immerse it in the developer with the design side uppermost. I use a discarded plastic tray from supermarket food packaging for this. Gently rock the dish. After about a minute you will see the tracks remain green and the exposed areas floating away in swirls of black. When the design is fully developed, remove the board from the developer using plastic tongs and place it a tray full of water. Rinse it off and then rinse it some more under a tap. A light stroke with some wet tissue will remove any remaining etch resist from the parts of the design exposed to light.

Top – Board in process of development. Bottom – Board after development and washing.



Etching the board

There are two etchants in common use – ferric chloride and ammonium persulphate. Both are nasty chemicals but ferric chloride is the nastiest! Be very careful using it. You can buy ferric chloride already made up and I suggest that you do. You can also buy it as granules; cheaper but nastier. Most people use a solution at about 40% concentration. The solution takes about 30 minutes to etch a board at room temperature. It will corrode everything in sight, burn you, and splashes will stain and rot your clothing and also anything else they touch! You have been warned.  Ammonium persulphate is cleaner to use and less nasty. A 20 – 25% weight to volume solution works best at about 40 oC. You can keep the solution at this temperature by placing the tray you use for etching in a water-bath.  Etching time will be about 15 minutes at this temperature. With both ferric chloride and ammonium persulphate you should rock the bath to keep the etchant moving over the surface of the board.

When all the copper has been removed from the spaces between the traces you can remove the board and wash it with copious amounts of water. When dry, you can remove the etch resist from the tracks either by exposing the whole board to UV, developing it again, washing and drying it, or by rubbing it with propyl alcohol. Actually, on the boards I have used the resist can stay there and you can solder through it.

Finished boards ready for drilling and cutting out

Drilling the board

I use small diameter tungsten carbide drills and my Dremel for drilling the pads.  You can do it without a drill press but it is a bit fiddly. The most important thing is that your board has nice holes etched in each and every pad. If it doesn’t, it is hell’s own job to get the drill to go through the pad without skidding all over the place!


Useful links

A rapid etching method using ferric chloride – looks amazing, haven’t tried it:

A different etchant; copper chloride and hydrochloric acid:!–A-better-etc/

Using ammonium persulphate:

A survey of methods using an inkjet printer to print directly(!) to a pcb – haven’t tried it but looks fantastic:

Someone using the same technique described here with excellent results:

Some further info for those wishing to make their own developer solutions:



Posted in electronics, Photography and electronics | Tagged , , , , , , , , , | Leave a comment

End to the silence – building a new workshop

It is nearly a year since I made the last entry on this blog. The reason for this is that my wife and I bought a new house in France close to the village of Penne. It is an old farmhouse and as is inevitable with old buildings, it needed some work. Mostly, it has been painting the walls and installing new furniture, and other such minor works. However, having spent the last several years working out of a small shed in the garden, I wanted to have a decent workshop. To this end, I decided to convert the old ‘cistern’ here into a workshop. Cisterns are a feature of isolated farmhouses in this part of France – they store water captured from the roof. In this case, a barn at one end of the farmhouse houses a second building within it. This interior structure has a ‘barrel roof’ and waterproof render on the floors and walls up to a height of about 2 metres. This ‘tank’ is about 4 x 5 metres and offered plenty of room for benching. Since the floor and the walls were designed to contain water without leaking, my instincts were that they should also keep out the damp. There is a pantile roof over the brick barrel roof and I my hope was, and it seems to have proven to be so, that if one roof didn’t stop the rain then the next one would. So far the whole thing seems entirely dry. The walls are nearly a metre thick – I presume this is because the walls of the tanks inside the barn were built up against the original barn walls. A great side effect of the massive nature of the structure is that it stays cool 22oC inside when it’s 38oC outside, perfect for when making something involves a little exertion! The way in to the cistern was via a set of large stone steps that led down into a pit. The pit was there so that the farmer or his wife could stand below the water level in the cistern and draw water from it via a brass stop cock. The previous owner had cut a hole in the wall just above the pit. Even with a pneumatic drill, it must have taken quite a bit of work to penetrate so much stone and cement.


The way in over the drawbridge

So, as I came to it, the cistern was bare concrete and a hole about a metre above the level of the floor of the pit. I bought a low-pressure high-volume paint sprayer in the UK (Screwfix) and used this to paint the walls with white masonry paint. I bought 10 litres of grey floor paint and roller-painted the floor with it. With these things done, the place began to look habitable! I built a door to close across the opening and closed up what I think may have been an inspection window through which to check to the water level. Then, I built benches along two sides and put clip-together shelving along another. I ran electricity into the cistern from a panel in the barn, and installed 6 13A sockets and fluorescent lights. The final step was to install a drawbridge (!) that folds down from the wall of the cistern below the door and that folds down to meet the steps on the other side of the pit. The door can be locked and the drawbridge also raised and locked in front of the door giving two levels of security.


Shelving – note the cistern’s barell roof




The inner door

I brought my machines from the UK; a tiny CNC mill and a small CNC mill, a bench drill and a small lathe. These are now installed along with draws etc to store all the bits and pieces one needs when making things.


Small mill – Seig X1-LP diy conversion to CNC


Tiny mill – diy conversion of Proxxon MF70 to CNC


Cheap bench drill – it works


Small Amadeal lathe

The cistern is my mechanical workshop. My electronic workshop is in one of the spare bedrooms in the main house and has all the stuff I need for building and testing circuits; oscilloscopes, signal generators, meters etc. So it is that after nearly a year, I am back in a position to start making things again. I have plans for a general purpose 5 axis camera positioning device that will allow stacking, structure-from-motion and the like, though the first step has been simply to rebuild my focus rail controller using a rotary encoder to drive the menus and the setting of values. That venture has been my first encounter with interupts…..took me a while but I think I have the measure of them. I’ll post the new design as soon as I have it working to my satisfaction. I have also been getting my mill to so isolation milling for prototyping PCBs and I will post some stuff on how I managed that very soon!


Posted in Photography and electronics | Tagged , , , , | Leave a comment

The “Photomacroscope”

(This post is a work in progress – pictures to be added etc.!)

“Photomacroscope” is a rather fancy name that I have given to taking some bits and pieces that I had lying around and turning them into a variable tube length microscope. The reason for making the photomacroscope was that I found an article on the web ( that describes how telescope eyepieces can be combined with camera lenses to give a slightly different way of doing extreme macro. Looking at the article, I realised that in addition to providing an interesting test bed for various combinations of camera lenses and microscope/telescope eyepieces, it would also allow me to in effect create a horizontal microscope that could make use of the collection of old tube length objectives that I have that includes a wonderful old Lietz X1.0 with a variable NA of 0.04 to 0.01. The principle employed here is one of eyepiece projection, nothing new but something that in the incarnation presented here allows for great flexibility in terms of both magnification and working distance.

At the heart of my photomacroscope system is an old BPM bellows that I picked up on eBay for £20. It is this that provides the ability to move an eyepiece relative to the objective. In order to house the objective inside the bellows, all that was necessary was to turn a giant Delrin washer the outside diameter of which matches the inside diameter of the camera coupling ring on the end of the bellows. The washer is a push fit to  this. The inside diameter of the washer enables a microscope eyepiece to push fit within it. The pictures below will hopefully make clear how this works:

A close-up of the adapter that fits to the BPM bellows and that carries the eyepiece. The eyepiece is a push fit to the Delrin washer and that in turn is a push fit to the adapter ring.

A close-up of the adapter that fits to the BPM bellows and that carries the eyepiece. The eyepiece is a push fit to the Delrin washer and that in turn is a push fit to the adapter ring.

The component parts of the photomacroscope. At the camera end, 12 and 20mm Kenko extension tubes for a Nikon camera, the Nikon adaptor for the bellows holding the eyepiece in the Delrin "washer", the BPM bellows itself, the BPM to M42 adaptor, the 50mm long M42 extension rings, the M42 to RMS adapter, and finally, the Leitz objective.

The component parts of the photomacroscope. At the camera end, 12 and 20mm Kenko extension tubes for a Nikon camera, the Nikon adaptor for the bellows holding the eyepiece in the Delrin “washer”, the BPM bellows itself, the BPM to M42 adaptor, the 50mm long M42 extension rings, the M42 to RMS adapter, and finally, the Leitz objective.

The assembled "photomacroscope".

The assembled “photomacroscope”.

As you can see, the bellows now has an eyepiece projecting into the space that would ordinarily be occupied by the camera. To provide room for the camera and set the distance to the camera sensor for the image projected by the eyepiece, I simply locked two extension tubes onto the camera end of the bellows. It turns out that the internal diameter of the extension tubes is such that the microscope eyepiece fits easily within them. At the other end of the bellows I fitted a T2 adapter where I could screw in some old M42 extension tubes and an M42 to Royal Microscopical Society adapter for the microscope objective. The combined length of the tubes and bellows provides for any reasonable tube length and easily achieves the 160/170mm required by my collection of old objectives. In addition, my collection of coupling rings makes it easy to add any of my Nikon lenses in either normal or reversed orientation. What I like about this setup is its versatility – so many combinations are possible!

With the Leitz X1.0 objective in place the working distance is such that I can use my little Nikon flashes to illuminate the subject or get LED illuminators in close enough to do the job. The whole setup mounts on my focus slide though it must surely be easier to move the subject than this rig? The rather ungainly setup is remarkably robust and doesn’t sag in the way that I had expected though I plan to add a strut made of 6mm aluminium plate to stiffen things up.

Here are some initial photos. With the X1.0 objective and an eyepiece, photos in the range 5:1 and 10:1 are easily obtainable and appear sharp with little chromatic aberration.

Posted in Photography and electronics | Tagged , , , , , , , , , , , , , , | 4 Comments

An Infrared Detector with Enhanced Immunity to Daylight Interference

High speed photography in daylight is difficult (and usually not that fast!). In darkness strobe pictures of bullets are made possible by utilizing a fast photo-diode or other photo-sensitive device as a switch – as the bullet passes the detector, it breaks a light beam and the strobes fire. Prior to the strobe firing, the camera shutter is held open, and after the picture is taken, it shuts again.  The strobe on low power has a very short flash duration, and in a darkroom, it is perfectly possible to get a crisp picture of a projectile moving at more than the speed of sound. That said, it ought to be easy to take a picture of bee in flight or a butterfly taking off from a flower, but it isn’t. The reason for this is that you can’t turn off the sun! To take macro pictures of moving objects in daylight, a high speed low-lag-time shutter like the one described in previous posts is necessary to limit the daylight entering the camera lens before, and after, the strobes fire. Further, whether one uses a crossed-beam detector or a more sophisticated optical ranging device (see posts below for details of how these work, and can be built by an amateur), the photo-diode or photo-transistor used as a detector has to be able to distinguish an object entering the light beam of the detector, from a background change in daylight intensity. This turns out to be quite a difficult problem.

In a previous post I described how one can use LEDs as light sensors that are fairly immune to interference by sunlight. However, not only aren’t they completely immune, they also aren’t very sensitive and only really work well as a beam break detector i.e. they can detect when the light from a laser is interrupted by an object that gets in the way but, as far as I am aware, they just can’t be made sensitive enough to detect laser light scattered from a target. Scattering of laser light into the detector of an optical rangefinder requires the use of a sensitive photo-detector like a photo-diode or photo-transistor. However, most of the circuits for employing these devices in a rangefinder are not completely immune to interference by sunlight. At the very least, adjustments will need to be made to allow for the decrease in sensitivity that occurs when the sun is shining brightly on an object that you want to trigger your camera.

Searching the web for photo-diode-based circuits that are immune to sunlight turns up a multitude of suggestions for improving a photo-detector’s immunity to sunlight. Some of the ideas are good, and some bad! Mostly, they involve using an infrared diode with a built in filter (usually this just consists of the special black plastic used to encapsulate the diode junction). The IR photo-diode-based receiver is paired with an infra-red LED transmitter or one based on an IR laser. The use of infrared cuts out a lot of the sun’s energy and helps to keep the circuit functioning in daylight. If a laser is employed, a line interference (optical) filter in front of the photo-diode matched to the wavelength of the laser, is significantly better than relying on the IR filtering built into the photo-diode’s encapsulation. Unfortunately, interference filters are expensive and hard to come by.

A further improvement can be had by switching the laser on and off at a high frequency – TTL enabled lasers can be switched at 10’s of KHz. Placing a high-pass filter in the photo-diode receiver circuit to cut out any light intensity changes at frequencies lower than several KHz, also improves things a great deal. Indeed, TV remotes use a system like this to prevent your TV hopping channels when you turn on the room lights or something else happens to change the the light intensity falling on the TV’s remote receiver. However, if you take your TV outside on a sunny day, you will find the range of the remote is severely compromised, or, it doesn’t work at all.

While some of the highly integrated devices used in TV remotes look as though they might be useful in rangefinders to be used for photographic purposes, they now mostly contain circuitry that means they can only be used to control TVs.  It was while searching for a way to eliminate the daylight sensitivity of the rangefinder I use for macro photography of insects in flight (or siting still for that matter), that I came upon this gem of a circuit. It was designed for use on a Mars Rover and is sunlight immune. The transmitter uses 10KHz IR pulses.


The circuit designed by Bob Pease for a Mars Rover. I wish I was as clever as he was!

It was designed by “the analogue guru”, the late, great, Bob Pease. A description of it can be found here:

Bob Pease – IR receiver for modulated light

In short – the two reactance circuits act as load resistances for a photodiode, BPW34. The voltage drop at each reactance circuit is amplified by a differential amplifier, built with two 2N4416 FETs. This symmetrical design makes the circuit insensitive to common mode interference and the output is nearly independent of ambient light conditions.  The circuit operates using a single 5V power supply. The diode has about a 2V bias voltage

In practice, I have found that the circuit also works well with a BPW41 IR diode and that it can then be run from a 9V supply along with this AC-coupled amplifier with its peak detect circuit, to produce an output that is more-or-less the same in the dark as it is in direct sunlight. The output which peaks within less than a millisecond using a laser modulated by switching it on and off at 3KHz or, within 100uS using a TTL-controlled laser modulated at 10KHz. The AC coupling and the other filtering within the amplifier circuit removes interference from any slower IR signals that should find their way through to its input. The fact that the plastic used to encapsulate the BPW41 diode is a good match to the 980nm lasers that I employ, makes for a circuit that is sensitive only to the laser light reflected from my quarry!


The ac-coupled amplifier I use to feed the input on my Camera Axe.

Posted in Photography and electronics | Tagged , , , , , , , , , , , , , , , , , | 3 Comments

A better moth trap using LEDs?

Warning: the LEDs used in this project are extremely bright. If you look at them directly you could damage your sight. Definitely don’t look at the UV LED, it may not even appear to be on, but it emits lots of UV and this is particularly damaging to our eyes. You can buy safety spectacles that block UV light – even with these on avoid doing more than glancing at the light.

This isn’t strictly an article on macro photography or indeed any aspect of photography. However, I thought I would put this piece on my blog because I found it very hard to find much on the web about building your own moth trap and, since my intention is to use the trap to attract moths for the purpose of photography, I thought it might be worth sharing.

Most moth traps are bulky affairs run from the mains or a petrol-driven generator. Often they use mercury vapour bulbs, black light (UV) fluorescent tubes, or other light sources, rich in ultraviolet light. Apart from bulk of the trap, the glass bulbs are delicate, and the requirement for mains power restricts where they can be used. Also, having mains power outside means that one has to be careful to avoid electric shock or having rain shatter the hot glass envelope of the light source. I wanted something light and robust that I could easily carry to remote locations. A quick survey of the traps available from UK suppliers revealed only one that utilizes LEDs and this device was about £150, far more than I wanted to pay.

The theory as to why moths are attracted to light goes something like this. As moths fly along a transverse path, part of their navigation system depends on keeping light from a distant light source at the same angle relative to them as they attempt to fly a straight line. However, if the light source is close enough, when the moth tries to keep the light at a constant angle, this results in it constantly turning around the light in a spiral that ultimately leads to it meeting up with the light source. Thus, the moon is not a problem to the moth, but a bright outside light bulb is, and the moth meets the bulb where upon, finding itself bathed in light, it behaves a bit like it does in daytime, and comes to rest. In a moth trap, the operator often places a container beneath the light with some old egg boxes in it. The moths crawl in amongst these to find the sort of niches they normally hide in during daytime. In the morning, the operator of the trap can empty out the container, and is rewarded by the capture of many different species of moth. These can then be identified, photographed and hopefully, then released without harm.

While moths are attracted by even dim lights with very little UV content, such as for example a candle, which attract moths that often then tragically burn to death, bright light sources rich in UV light are much more effective. Clearly, exactly how attractive a particular light source is, depends on how well its spectral properties match those of the moth’s eye. It is for reason that moths’ eyes contain UV receptors that a UV-rich light source is more effective than an equally bright yellow one. It occurred to me, and also I am sure to the manufacturer of the only commercially available LED-based moth trap, that LEDs offer a unique opportunity to match the spectral output of a light source to the spectral sensitivity of the moth eye. Having long ago worked on insect vision, I was aware that there are quite a few publications in which electrical recordings have been made from insect eyes. I turned to these to determine what the best LEDs would be to use in a home-made moth-trap. The tobacco hornworm moth (Manduca sexta) has long been a favourite experimental animal in insect research labs and it turns out that its eye contains three different kinds of photoreceptor with peak spectral sensivities in the UV, blue, and green region of the spectrum  (at 370 to 390 nm, 450 to 470 nm, and 530 to 550 nm). Looking through the data sheets for 3W LEDs I found devices that were a pretty good match to these spectral maxima – a 3W UV LED from Semileds with a peak output at 385nm,  a royal blue LED (Bridglelux/Epileds) with a peak output at 440-450nm, and an emerald green LED ((Bridglelux/Epileds)) with a peak output at 520-530nm. All of these devices are available on eBay. The peak oututs from the LEDs do not need to precisely coincide with the peak sensivities of the moth eye. Moth photoreceptors are fairly broadly tuned, but the nearer the outputs of the LEDs are to the peak sensitivities of the moth eye the better, and the more efficient the LEDs will be in attracting moths. The LEDs I used are pretty cheap – roughly £1 each for the green and blue ones and £3.50 for the UV device. My thought was to combine one of each of these LEDs in a light that would be ~9W in total, and that could be powered from a variety of low voltage sources such as rechargeable or lead-acid batteries, or a ‘wall-wart’ type mains power supply. To accommodate all the different possibilities, I decide to use a 5A adjustable step-down charge module (you can find these on Ebay for a few £s and they will accept a 5-30V input and provide a 0.8 – 29V output – fantastically versatile). They can be run as a constant current source, and incorporate a voltmeter and an ammeter. Since you can import them from China for about £3.50, it clearly is not worth designing one’s own power supply!

In order to make the light, I took a waterproof die-cast aluminium box about 125 x 80 x 55mm, and drilled it to accept three star-mount 3W LEDs, one of each colour. The LEDs are mounted on the top of the box and the adjustable step-down module is mounted in the back (see pictures). The step-down module means that one can choose to run the LEDs from almost any source that can provide sufficient current as long as the voltage it presents is greater than 5V. I drilled a hole in the side of the die-cast box and ran the power lead in through a neoprene sleeve. This was then sealed with silicone bath sealant. The bolts holding the LEDs and the leads leading to them, are sealed using the same sealant. While it isn’t my inntention to run the trap in the rain, the silicone gives sufficient water-proofing to run the light on a damp evening. In order to make things waterproof, it would be relatively easy to make a Perspex cover. However, it is important to know that ordinary Perspex does not transmit UV light. Thus, you would need to find a source of acrylic such as OP-4 that is transparent to UV. The die-cast box acts as a heat-sink for the LEDs so I milled the paint off the surface and put heat-sink compound between the aluminium backing pads of the LEDs and the surface of the box. The die-cast box I used has plenty of room for additional circuitry – it could for example, incorporate a timer or other device to switch it on at dusk, and off again when it gets light.

The total cost of the components for the moth trap light source, not including batteries, is about £15. A good portable power supply might be a battery box containing multiple rechargeable D cells, or a lead-acid battery.

The pictures below show the main components of the moth-trap light source. In use, I envisage it would sited above a large plastic pail of the sort you often get when you buy certain DIY materials. Putting some egg boxes or crumpled paper in the pail would probably be a good idea. Many moth traps have ‘vanes’ around the light designed to knock the moths on the head, causing them to fall into a container. However, there are a several papers that I have read that suggest they don’t make much difference to the catch, the moths will find their way in amongst the egg boxes without the vanes.

The components of the moth-trap light sources. The UV LED is in the middle of the lid (left). The die-cast box is the weather-sealed type.

The components of the moth-trap light source. The UV LED is in the middle of the lid (left). The die-cast box is of the weather-sealed type.

The step-down module was fixed in the box using NO-More-Nails permanent fixing tape to avoid drilling holes. Note the strain relief on the power lead.

The step-down module was fixed in the box using NO-More-Nails permanent fixing tape to avoid drilling holes. Note the strain relief on the power lead.

File 10-05-2015 16 48 15

The finished light source. Note the LEDs are bolted to the surface using stainless bolts with nylon washers to ensure the pads on the LEDs are not shorted to earth. There is a generous coating of heat-sink compound between the surface of the box and the back of the LEDs, and the paint surface of the box has been milled off to ensure a good thermal connection between the LEDs and the die-cast box.

The picture below shows the light source with the LEDs switched on – the UV LED doesn’t look bright because, unlike moths, we can’t see UV light and my iPhone camera isn’t too good at this either! A white piece of paper can be used to show up the UV output. I have to warn you that even when run at significantly below the 9Wmaxium, the LEDs are *extremely* bright.I am currently running the system at ~5W. The LEDs are connected in parallel and run at 3.25V and 1.5A – the maximum voltage for the UV LED is 3.5V and should not be exceeded. Run at ~5W the LEDs can use the die-cast box as their heatsink. At an ambient temperature of 21 degrees centigrade, the box reaches about 45 oC after about an hour – this OK, but if you wanted to push the LEDs to their maximum output, you might need to improve the cooling by adding some fins to the top of the box. In this picture the current was limited to only 0.8A but the devices were still saturating the camera on my iPhone and very uncomfortable to even glance at. A quick peek at the blue LED will have you seeing yellow spots in front of your eyes for many minutes so take care! IN PARTICULAR, DO NOT LOOK AT THE UV LED!

The trap with LEDs powered up at a low total current.

The trap with LEDs powered up at a low total current. The readings on the meter appear to make no sense because the refresh rate for them is too low for the exposure time for the photo……in fact they work perfectly and are great for setting the voltage and the current flowing through the LEDs.

I will update this post when I have used the trap in anger.

Posted in Photography and electronics | Tagged , , , , , , , , , | 52 Comments