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 (http://www.gyes.eu/photo/x-macro.htm) 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.

Advertisements
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.

BP_circuit

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!

PM_photoampV3

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 , , , , , , , , , | 41 Comments

Improving the electromagnetic shutter, and using the Camera Axe to time it. The Winking Pig is born!

Edit (15/04/15) – added pictures of finished brass version of shutter at end of post along with a picture, and brief description, of the range-finder setup I will be using this year.

Well, after a couple of rather frustrating weeks, I think I have got as far as I can with the basic structure of the enclosed low-lag time electromagnetic shutter. Initial experiments with versions of the shutter in which the blade was hinged on a pin were promising with opening times for a 20mm aperture looking like they might reach the magic 5ms. Unfortunately, the open times were accompanied by long closing times that proved very hard to reduce to acceptable lengths. After, many rebuilds and modifications, several of which worked for a while before failing, I bit the bullet and decided to go back to a shutter in which the blade is hinged by tape to the electromagnet. This turned out to be a really good move (see below)! However, it was the experiments on the shutter with a hinge pin that led to the name of the current version…..the ‘Blinking Pig’….now the ‘Winking Pig’. That name arose from a moment in which my exasperation led to me describing the thing as a “blinking pig” (‘putain de merde’ in French, or ‘******* *****’ in English or  American) and my wife watching it open and close, declaring that it looked more like a “winking pig” to her. So there we are, the Winking Pig Shutter! Here are some diagrams of the structure of the Winking Pig.

This complicated diagram is the whole shutter seen in X-ray view. The front and rear plates are 90mm in diameter.

This complicated diagram is the whole shutter seen in X-ray view. The front and rear plates are 90mm in diameter.

This diagram shows the position of the electromagnet relative to the shutter housing. The blade is shown in the fully open position.

This diagram shows the position of the electromagnet relative to the shutter housing. The blade is shown in the fully open position.

This the front plate. The funny triangular shape is hole in which the magnet and its support can swing. The two slots are for the mounting bracket for the solenoid coil and the bump stop. When these slots are cut they have rounded ends. The central hole is the aperture and the other two small holes are for the lens mount.

This the front plate. The funny triangular shape is hole in which the magnet and its support can swing. The two slots are for the mounting brackets for the solenoid coil and the bump stop. When these slots are cut as inside profiles they have rounded ends. The central hole is the aperture and the other two small holes are for the lens mount.

This is the rear plate. The complex shape is a 0.7mm pocket in which the shutter blade swings. The other holes are as for the front plate.

This is the rear plate. The complex shape is a 0.7mm deep pocket in which the shutter blade swings. The other holes are as for the front plate.

This is the Delrin ring that   grips the lens of my OM-D EM10 camera - 60mm Zuiko macro lens.

This is the Delrin ring that grips the lens of my OM-D EM10 camera – a 60mm Zuiko macro lens.

These pictures may help to make things clearer….the aluminium needs cleaning up but as you will see, it’s not quite the definitive version!

Front view. Note that the mounting brackets for the solenoid and the bump stop are slotted at 90 degrees to the slots in the shutter housing Thus,  they can be moved up, down and back and forth, and also rotated to get the best position. The shutter is shown with the round solenoid in position. The square section solenoid lowers the profile of the shutter.

Front view. Note that the mounting brackets for the solenoid and the bump stop are slotted at 90 degrees to the slots in the shutter housing Thus, they can be moved up, down, and back and forth, and also rotated to get the best position. The shutter is shown with the round electromagnet in position.

This is a rear view of the shutter showing the mounting ring.

This is a rear view of the shutter showing the mounting ring.

This shutter has front and rear plates similar to those in the previous version (see previous blog entry). However, the shutter blade consists of a piece of polycarbonate to which a magnet retaining bar of Delrin is glued. The retaining bar is the same thickness as the 8 x 1.4mm N52 neodymium magnet. The front face of the the electromagnet, like the magnet and magnet retaining bar, is now completely flat. This structure allows the use of a ‘stamp-hinge’ flap of high-strength duct tape to enable to shutter blade to hinge on the face of the electromagnet. As a result of this arrangement, the magnet remains as close as is physically possible to the electromagnet as it swings away. This both makes the movement of the blade away from the coil as rapid as possible, and facilitates its rapid return once it hits the bump stop.  The coil shown here consists of ~500 turn of 0.34mm enameled copper wire wound on a 5mm soft iron core (resistance about 5 Ohms, and 2 mH). Here is a detail of the electromagnet and shutter blade with the shutter held open using a magnet on the back of the bump stop (the bump stop isn’t properly adjusted!):

Solenoid and shutter arm - the magnet bearing tab can be seen poking up through the cut-out.

Solenoid and shutter arm – the magnet bearing tab can be seen poking up through the cut-out.

The hinge made of tape is remarkably durable. By virtue of the aperture in the front and the back plate both being three millimeter smaller than the shutter blade, the shutter is light tight.

The work from here on in is to refine the design shown here. Currently, the shutter’s front and rear plates are made out of 2mm aluminium (I used this because I had lots of it!) and the retaining ring that fixes the shutter to the camera is made out of Delrin. The latter is very simple and I will be able to make other retaining rings to fit lenses of any diameter. The ring is a push fit, but for safety’s sake, three nylon grub screws are used to stop the shutter from falling off the lens. The position of the holes in the retaining rings will remain in the same place relative to the shutter plates meaning that the same shutter will fit all my lenses. The next steps are to fabricate the shutter from thinner material. Originally, I thought to use Delrin for the front and rear plates of the final version. However, I want to use material thin enough to prevent vignetting even when a smaller aperture (in the external shutter) is employed. The thinnest Delrin I can find is 6mm thick which would mean a great deal of milling, and I am not sure ~1mm Delrin would be rigid enough. For that reason, I have ordered up some thin brass sheet which I think will be stiff enough to work at a that thickness. It is possible to chemically blacken brass which may also be useful.

The diameter of the aperture in the front and rear plates is a key issue with respect to the opening and closing times – the force on the magnet falls rapidly as it moves away from the solenoid, and the further it moves from it the less this force becomes. This is most important with respect to its closing where the forces are provided by the sum of the rebound energy and the magnetic attraction of the magnet for the solenoid core. Another magnet can easily be added to the bump stop if one wants to accelerate the return of the shutter arm. In opening the momentum provided by the initial kick from the solenoid also rapidly declines with distance which is another reason to use a hinge that minimizes the separation of the solenoid core and the magnet. For reason that the magnet will need to move further away from the core to open it, a 20mm aperture will always be gated more slowly than a smaller one. The thinner the material the shutter is constructed from, the less the vignetting and it becomes possible to employ smaller apertures, or with a bigger aperture, place a filter behind it.

So what are the tweaks for the future? It would be fairly easy to incorporate a section of the top plate that can be removed, or a slot, so that the solenoid/shutter assembly can be withdrawn as one piece. The solenoid can be improved by flattening it’s profile. I have finally found a way of making a flat solenoid using the soft iron laminae salvaged from an old transformer. There is also room to tune things up by using different magnets, by changing the drive voltage, using a lower esr capacitor or speeding up the closing of the shutter with an additional magnet. It was while I was looking at the CamBam drawings shown above that I saw that it would be fairly easy to generate a two-blade shutter. One could have one shutter arm’s swing space pocket in the font plate, and the swing space for a second one in a pocket milled in the rear plate – the second solenoid would be at the bottom of the shutter and the second swing space rotated at 180 degrees to the other. A thin shim with the appropriate apertures cut in it would separate the front and rear shutter blades. I think that arrangement would work, and because the shutter blades could be about 60% of the current size, the shutter should be faster. Getting it light tight might be difficult but I think it’s worth a go and I am in the process of drawing it up in CamBam – I am a sucker for punishment! Someone asked me about using a Winking Pig as a conventional shutter with variable timing – it might be possible to do this by having a second electromagnet to ‘catch’ the arm for a period after opening?

In developing this shutter, I have had cause to look at different ways of timing them. The first method is very crude and simply consists of shining a light through the shutter and measuring when the light is cut off using a photodiode. However, this isn’t very accurate because the photodiode is wide enough to cause a significant error. I found I consistently got values that were too short. Shining a laser onto the diode through the the shutter at the extreme edge at which it opens is much more accurate. However, I have also found two other techniques very useful. The first is crude but is good way of roughly judging the speed of shutter – video it opening and closing. The iPhone 6 has a slow-mo mode which runs at 240fps or one frame every 4.2 milliseconds (ms). This is quick enough give you some idea of the time to open and close as long as one is working with something that operates on the timescale of 10 – 20 ms (1/100 – 1/50th of a second) to seconds. The other technique that I have found most useful is to use the Camera Axe. The software of this trigger allows one to use the Advanced Menu to  provide delays after triggering that can be increased by 0.1ms at a time. Thus, one can use a laser sensor to fire a strobe at varying time intervals after the light beam is broken. With a bit of white paper in front of the camera lens one can use the Camera Axe to obtain images of the camera’s own shutter in action. In the case of an external shutter, one can fix it to the front of the lens and have it triggered at zero time with the flash going at an interval after this to catch it opening and closing. The images below are of the Winking Pig captured using the Camera Axe and assembled as a time series – the shutter is fully open in about 5ms and fully closed about 8ms later. The vignetting seen here is due to the presence of a 4mm thick filter on the on the lens:

A time series taken using the Camera Axe and my home built laser triggering system. I used my hand to trip the the system and then varied the delay to the occurrence of the flash. The times are in milliseconds.

A time series taken using the Camera Axe and my home built laser triggering system. I used my hand to trip the the system and then varied the delay to the occurrence of the flash. The times are in milliseconds.

So, onward and upward (?) it’s been more than a year since I finished my first low-lag time shutter……..I have learnt a lot about cnc milling, CAD/CAM, electromagnets and a whole range of other stuff but sometimes its been a blinking pig of a project! However, I consider the basic structure of the shutter to be ‘finished’. I will update this post with pictures of the final version of the brass Winking Pig Shutter with a lower profile electromagnet as soon as its done….and then of course there is the double-bladed shutter that is to come!

The following photos were added to the post above on the 15th April 2015. The design of the shutter is essentially as described above but it has now been made from 1.2mm CZ120 brass (nice stuff). The shutter blade is an experimental one made out of black paper impregnated with plastic. I have reused the old coil – a more compact rectangular section one is shortly to be added. Other pictures will appear in due course.

Close up of the brass Winking Pig. No reason for it to be in brass other than it is such a lovely metal to machine. The shutter blade at the present time is 'super light' and made from 0.25mm thick black paper impregnated with liquid nylon nail repair lacquer! The blade weighs about 160mg and the whole shutter arm with the magnet about 1g. The 20mm shutter aperture is fully open in 5ms and a 'magnetic bumper' closes it in about 5ms - a significant improvement on a mechanical return. There is a dwell time of about 1.5ms (the shutter is out of view and reversing direction) during which the shutter is fully open and the flashes can be fired. Behind the shutter is an ND8 multi-coated filter that makes it possible to take photos in good light at between ~f8 and f16. The lens is an Olympus 60mm f2.8 Zuiko macro lens - this is really nice and very light.

Close up of the brass Winking Pig. No reason for it to be in brass other than it is such a lovely metal to machine. The shutter blade at the present time is ‘super light’ and made from 0.25mm thick black paper impregnated with liquid nylon nail repair lacquer! The blade weighs about 160mg and the whole shutter arm with the magnet about 1g. The 20mm shutter aperture is fully open in 5ms and a ‘magnetic bumper’ closes it in about 5ms – a significant improvement on a mechanical return. There is a dwell time of about 1.5ms (the shutter is out of view and reversing direction) during which the shutter is fully open and the flashes can be fired. Behind the shutter is an ND8 multi-coated filter that makes it possible to take photos in good light at between ~f8 and f16. The lens is an Olympus 60mm f2.8 Zuiko macro lens – this is really nice and very light.

"New" setup for 2015. A new optical range-finder (grey box to the left) which uses a 21mm achromatic doublet to focus the IR light scattered from the target. The range-finder has a plastic lens hood which isn't on it in this picture. Red targeting lasers are at the back (left and right) with red tape on them to hold the screw-operated focusing mechanisms in a fixed position. The IR laser is right of the camera and held in a Delrin tilt and swivel base. The camera is an Olympus OM-D EM1 - very light by comparison to my Nikon D7000 and 105mm macro lens. The Camera Axe computer takes signals from the range-finder IR diode amplifier located under the aluminium top plate. Under this are the electronics to pulse the IR laser and power the Winking Pig's shutter coil. The flashes are Yongnuo 560-IIIs one of which is triggered by the Camera-Axe with the 2nd flash wirelessly slaved to it. Power supply is to the left in front of the range-finder. This has a boost-converter providing 40V for the shutter, everything else runs on 9V. Diodes are used to drop the 5V provided by the Camera Axe to the red lasers to 3.5V. The IR laser has a special power supply that uses a regulator and a 555 timer to drive it with ~4V pulses at 3.5KHz. The aerial at the front helps the operator identify the focal point.

“New” setup for 2015. A new optical range-finder (grey box to the left) which uses a 21mm achromatic doublet to focus the IR light scattered from the target. The range-finder has a plastic lens hood which isn’t on it in this picture. Red targeting lasers are at the back (left and right) with red tape on them to hold the screw-operated focusing mechanisms in a fixed position. The IR laser is right of the camera and held in a Delrin tilt and swivel base. The camera is an Olympus OM-D EM1 – very light by comparison to my Nikon D7000 and 105mm macro lens. The Camera Axe computer takes signals from the range-finder IR diode amplifier located under the aluminium top plate. Under this are the electronics to pulse the IR laser and power the Winking Pig’s shutter coil. The flashes are Yongnuo 560-IIIs one of which is triggered by the Camera-Axe with the 2nd flash wirelessly slaved to it. Power supply is to the left in front of the range-finder. This has a boost-converter providing 40V for the shutter, everything else runs on 9V. Diodes are used to drop the 5V provided by the Camera Axe to the red lasers to 3.5V. The IR laser has a special power supply that uses a regulator and a 555 timer to drive it with ~4V pulses at 3.5KHz. The aerial at the front helps the operator identify the focal point.

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

Prototyping a new version of the high speed shutter

Last year I made several high speed shutters based on the excellent and innovative “Arnoshutter” built by Frans Eggermont (Arnoldus) (see: https://www.flickr.com/photos/arnoldus1942/8207885119/). With spring rapidly approaching, I am keen to have a fast shutter available to take high speed photos of insects in flight. One of the problems with my old shutters has been that they tend to leak some light around the edges even when aligned as perfectly as I can get them. The longer the external shutter can be held open without light reaching the camera sensor, the better the chances of catching a shot of a flying insect. Last week I started designing a light trapped electromagnetic shutter. The design has several weaknesses that stem from the light trapping of the shutter blade. As you can see, from the photos below, the shutter blade runs in a complicated 0.7mm deep pocket milled into the rear plate. It is hinged via 0.3mm hole drilled into the shutter arm and also through matching holes in the front and rear plates. The blade can contact both front and rear surfaces leading to an increase in frictional resistance compared to the open design where the blade runs across a single surface. Also, the shutter blade is being pushed via a magnet fixed to a tab bent up at 90 degrees from the shutter arm. The result is that the shutter experiences force from the electromagnet that pushes it to open but that also makes it want to twist into the rear shutter plate. To make the shutter even less likely to work well, I chose to make the prototype entirely out of aluminium, which is far from famed for its excellent ‘sliding’ properties! Indeed, at the outset, the blade made a noise that reflected the friction between it and the surfaces it contacted. The good thing about the design is that the light trapping achieved by having the shutter flag 3mm bigger than the 20mm apertures in the front and back plates, is remarkably effective even when using shiny aluminium in the construction. Here is a picture of the shutter’s constituent parts (front and back plates, shutter arm, and electromagnet):

Components of the fully enclosed shutter. The yellow dots are the polythene washers.

Components of the fully enclosed shutter. The yellow dots are the polythene washers.

Well, with so many obvious flaws, I wasn’t too hopeful about being able to make the design work. The first thing I did to improve things was to space the ~0.35mm thick shutter blade out from the rear plate by placing a thin washer under it at the hinge point, made by stamping out a circle from a polythene bag. I then added a second one on top of the blade to space it away from the top plate. These washers are about 0.05mm thick (!) and the ~0.3mm holes through the middle were made by pushing a pin through them. Currently, I am using a piece of 0.3mm enameled copper wire as the hinge-pin. When I assembled the shutter I was rewarded by a quick opening time but a rather slow closing time and sometimes the shutter failed to close at all presumably because the friction was too much for the weak attraction of the shutter magnet to the soft iron core of the solenoid. The measured time from beginning to open, to fully closed was, when the shutter worked, about 50ms. Too slow …. and not quite fast enough to encourage me to believe that this flawed design could be made to work sufficiently quickly to be of use. I figured that maybe adding a spring to assist closure would help, but I didn’t have a spring to hand that was light enough to be worth trying. Instead, I decided to try placing a magnet at the far end of the shutters swing with the pole of the same polarity as that on the outer surface of the blade magnet, facing the shutter arm. This transformed the performance – the time to fully open was now ~5ms and the time to close ~8ms with an open dwell time of ~1-2ms – that’s good enough to set me milling the whole thing out of Delrin which, with its much better sliding properties, should improve things. Also, it should be possible to improve on the blade by making the flag thinner, or making it out of a lighter material than aluminium – perhaps Delrin. We will see. Further speed gains may be had from using a smaller aperture. I plan to add the shutter to my 60mm Olympus macro lens. If I can get away with a 15mm aperture, this in itself should reduce the cycle time by more than 20%. I also need to make an adjustable stop to carry the 2nd magnet – the current one is held by carpet tape! A further improvement, that should reduce the twisting forces could be had by winding a lower profile solenoid and reducing the height of the tab bearing the magnet.

Here is a video of the shutter operating. The video has been speeded up at the outset and the end, but slowed down in the middle. The frame rate (120fps)  is such that the video sometimes only catches part of the opening/closing cycle but it gives an idea of how the shutter operates.

Here is the timing of the shutter – hard to be exact but the whole cycle currently takes about 15ms.

Shutter timing after adding the extra magnet to aid closure. Not fast enough but quick enough to be encouraging!

Shutter timing after adding the extra magnet to aid closure. Not fast enough but quick enough to be encouraging!

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

Brighter, faster, flashes from an LED-based flash gun – part 2

I have spent a little while now looking at the possibility of building a lower power version of the exciting Vela One very high-speed flash gun. Recently, I have managed to squeeze significantly better flashes out  of the 10W COB chips with which I have been experimenting. Also, I have written some code that will allow me to use the chips as a stroboscope, a flash driven by an external pulse, or as a “steady” modelling light. The steady modelling light has in fact been achieved by cheating, and just running the chip at a very high flash rate (500Hz), far above the normal human flicker-fusion frequency. I am happy enough now to parallel up 3 by 10W chips and drive two of these guns as neat fast flashes that I can use for some experiments with insects in flight. I don’t really have any need for flashes shorter than a few tens of microseconds but having started, it became an intellectual challenge to see what could be achieved. I have shortened up the leads to the chips, hacked the pcb around to shorten key traces, added a ground plane, and made a few other changes that speed up the voltage pulses used to drive the LEDs and that thus now produce brighter, faster, flashes. My feeling is that in the end, certainly using only 6 x 10W chips, I am not going to get enough light out of the LEDs to use in anger at sub-microsecond speeds, though this might be achievable with hugely higher drive voltages and bigger/more chips. Currently, I am using only 35V.

My next plan is to produce a two layer PCB and incorporate within it, or on a separate board, a boost converter to provide higher drive voltages, though for practical reasons, I do not intend to drive the chips much harder than at present (50A). I will make the details available here when I have finished the board and tested it.

Meantime, because someone asked me, I have pasted my software into this post. This sketch works, BIG *BUT*, I would not pretend the code is ‘good’. Indeed, I suspect it is truly horrible, I am still feeling my way around in the world of Arduino programming even if I have learnt quite a bit. If the sketch helps someone else do some experiments with COB LEDs then I will be happy.

Also, I offer the following observations on the 10W chips driven at 50A. I have used the pin photo-diode circuit described in an earlier post to measure the light output from the LEDs. I have not found a way of calibrating the diode, though one might be able to extrapolate from the numbers I give below using the datasheet for the BPX65 (see http://ezphysics.nchu.edu.tw/prophys/basicexp/electronote/photodiode.pdf). I don’t think the calibration matters much. What is clear from driving the LEDs with pulses of decreasing length is that the maximum output is available with pulses as short as 1us…though of course this might not be true if one used a higher drive voltage. Here are the numbers I got:

Pulse length   (us)         Relative light output (arbitrary units)

50                                         1.0

5                                            1.0

1                                            0.8

0.4                                       0.36

Here are a couple of traces of the photo-diode output:

5us 50A drive pulse

5us 50A drive pulse

You can see that the pulse peaks within 5us. The on-time is about 1us, the off-time a bit shorter.

400ns drive pulse, same voltage as above though current probably also never reaches peak.

400ns drive pulse, same voltage as above though current probably also never reaches peak.

The light pules is nearly twice as long as the drive pulse (marked by the two artifacts in the trace). Note the change of scales and my labeling error – it really was a 400ns pulse! What is surprising to me, and has been surprising from the outset, is how little the phosphors within the chip apparently contribute to the duration of the light output – the *warm* white LEDs we use to light our house glow visibly for tens of seconds after they are switched off. The absence of  measured after glow from the 10W daylight white chips correlates with my visual observation that I am unable to detect any afterglow beyond what I take to be the recovery of the opsins in the photoreceptors of my eyes.

Here is the code for the Arduino-based LED driver – all works on my UNO Rev 3:

</pre>
 // Programme to conrol a COB LED for use as a photographic flash/strobe.
// The "steady" and "rapid" modes are experimental but are working
// Beware that the huge currents involved in overdriving the LED
// *will* result in **serious damage/problems** if the pulse driving the LED should accidentally
// become prolonged! It is important to choose parameters that will work with the chosen MOSFET
// and LED. The MOSFET datasheet will provide details concerning the safe operating envelope for
// the device. Those for the LED can only be established by burning some out! I can take no
// responsibility for any loss/damage that occurs as a result of following any of the instructions
// here or that result from using the code below!

#include <LiquidCrystal.h>;
LiquidCrystal lcd(8,9,4,5,6,7); // pins used by lcd
//Global scope variables
int key = -1;
int flash_pin_1 = 2; 
int sensor_pin_1 = 3; 
//int steady_pin_1 = 11;// for a switch to a 2nd PSU...not in use ... yet
// Functions called:
void strobe();
void flash();
void steady();
void rapid();
int which_button(int a);
int get_key(unsigned int input);

//
//
//Setup - tells us stuff & prints up options on LCD
//
//
//

void setup()
{
 // sign on stuff
 pinMode(flash_pin_1, OUTPUT);
 pinMode(sensor_pin_1, INPUT_PULLUP);// currently set to fire flash when sensor pin goes low
 //pinMode(steady_pin_1, OUTPUT); // not in use - could switch in another PSU
 lcd.begin(16, 2);
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" MadBoffin Labs ");
 lcd.setCursor(0,1);
 lcd.print(" 21st Feb 2015 ");
 delay(1500);
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" <<BLIP V1.0>> ");
 lcd.setCursor(0,1);
 //1234567890123456
 lcd.print(" COB LED driver ");
 delay (2500);
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("Use buttons to ");
 lcd.setCursor(0,1);
 //1234567890123456
 lcd.print("choose options "); 
 delay (1500);
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" <LEFT> = rapid ");
 lcd.setCursor(0,1); 
 lcd.print(" <UP> = flash ");
 delay (1500);
 lcd.clear();
 lcd.print("<RIGHT> = steady"); // experimental!
 lcd.setCursor(0,1); 
 lcd.print(" <DOWN> = strobe"); // experimental!
 delay (1500);
 lcd.clear();
}/*--(end setup )---*/

//
//
// Primary loop
// Gets user input from buttons
//
//

void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{

 int stop_flag = false;

 lcd.setCursor(0,0);
 lcd.print("Make your choice");
 lcd.setCursor(0,1);
 lcd.print("Press a button! ");

 do{
 which_button(key);
 switch(key){
 case 0:
 stop_flag = true;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" LED steady ON ");
 delay(1500);
 steady(); 
 break;
 case 1:
 stop_flag = true;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" LED will FLASH ");
 delay(1500);
 flash();
 break;
 case 2:
 stop_flag = true;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" LED will STROBE ");
 delay(1500);
 strobe();
 break;
 case 3:
 stop_flag = true;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("LED flash RAPID ");
 delay(1500);
 rapid();
 break;
 }
 }
 while (stop_flag != true);
}
// End "loop" ----------------------

//
//
// FUNCTION - strobe() - begin to strobe the LED
// First collecct values using "accumulate_value" function
//
//

void strobe()
{
 // Function variable declarations 
 int frequency;
 int duration_strobe;
 int stop_flag_strobe;
 long microseconds = 1000000;
 long on_time;
 long total_off_time;
 long interval;
 //

 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("Runs forever!!!!");
 lcd.setCursor(0,1);
 lcd.print("To escape RESET ");
 delay(1500);
 //
 // Get flash frequency
 //
 String title_string_1 = "FREQUENCY (Hz):";
 frequency = accumulate_value(1, -1, 10, -10, 200, 1, title_string_1);
 //
 // Now get flash duration
 //
 String title_string_2 = "DURATION (us):";
 duration_strobe = accumulate_value(1, -1, 10, -10, 50, 1, title_string_2);
 //
 // Calc ON and OFF times
 //
 on_time = frequency * duration_strobe; // answer in us
 total_off_time = microseconds - on_time;
 interval = (total_off_time/frequency)/1000;// answer in milliseconds
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("On-time us: ");
 lcd.setCursor(12,0);
 lcd.print(on_time);
 lcd.setCursor (0,1);
 lcd.print("Off-time ms: ");
 lcd.setCursor(12,1);
 lcd.print(interval);
 // now produce the flashes for ever-and-ever
 stop_flag_strobe = false;
 do{
 digitalWrite(flash_pin_1, HIGH);
 delayMicroseconds(duration_strobe);
 digitalWrite(flash_pin_1,LOW);
 delay(interval);
 }
 while (stop_flag_strobe != true); // i.e. never stop!
} 
// End "strobe" ----------------------

//
//
// Routine - flash
// Produce a single flash after specified delay when flash_pin goes LOW
//
//

void flash()
{
 // Function variable declarations 
 int stop_flag_flash;
 int duration_flash;
 int delay_flash;
 //
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("Runs forever!!!!");
 lcd.setCursor(0,1);
 lcd.print(" To stop <RESET ");
 delay(1500);
 //
 // Get flash duration
 //
 String title_string_1 = "DURATION (us):";
 stop_flag_flash = false;
 duration_flash = accumulate_value(1, -1, 10, -10, 250, 1, title_string_1);
 //
 // Get delay to flash
 //
 String title_string_2 = "DELAY (ms):";
 delay_flash = accumulate_value(1, -1, 10, -10, 250, 1, title_string_2);
 //
 // Warn that flash pin is armed - will fire on LOW
 //
 int val = HIGH;
 //1234567890123456 
 while (stop_flag_flash == false){ 
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" Flash is armed ");
 lcd.setCursor(0,1);
 lcd.print("<RESET> to exit "); 
 do{
 val = digitalRead(sensor_pin_1);
 } 
 while(val == HIGH);
 delay(delay_flash);
 digitalWrite(flash_pin_1,HIGH);
 delayMicroseconds(duration_flash);
 digitalWrite(flash_pin_1, LOW);
 val=HIGH;
 //
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" Flash fired!!! ");
 lcd.setCursor(0,1);
 lcd.print(" Waiting to arm "); 
 delay(2000); // sets time before flash is re-armed
 }
}
// End "flash" ----------------------

//
//
// Function - steady - experimental idea. Run really fast to imitate steady light!
//
//

void steady()
{
 int stop_steady_flag = true;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("Steady light ON ");
 lcd.print("<RESET> to exit "); 
 do{
 digitalWrite(flash_pin_1,HIGH);
 delayMicroseconds(20);
 digitalWrite(flash_pin_1, LOW);
 delayMicroseconds(200);
 }
 while (stop_steady_flag != false);
}
// End "steady" ----------------------

//
//
// FUNCTION - rapid - experimental! Really fast using PORT command and nops
//
//
void rapid()

{
 int stop_rapid_flag = false;
 int val_rapid = HIGH;
 int delay_rapid;
 unsigned char old_value;
 DDRD = DDRD | B00000100; // Fast way to set pin 2 as output 
 // - may not be necessary as already done using pinMode in setup
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("High speed! ");
 lcd.setCursor(0,1);
 lcd.print("<RESET> to exit ");
 delay(1500);
 String title_string_2 = "DELAY (ms):";
 delay_rapid = accumulate_value(1, -1, 10, -10, 250, 1, title_string_2);
 while(stop_rapid_flag == false){
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" Flash is armed ");
 lcd.setCursor(0,1);
 lcd.print("<RESET> to exit "); 
 do{
 val_rapid = digitalRead(sensor_pin_1);
 }
 while(val_rapid == HIGH);
 delay(delay_rapid);
 old_value = PORTD;
 PORTD = old_value | B00000100;
 PORTD |= B00000100; //set pin 2 high
 //__asm__("nop\n\t"); // chain nops to get longer flashes - zero nops (as here) gives 500ns flash
 //delayMicroseconds(1); // Produces a pulse that is close to 1us - use "nops" (60ns) to go faster
 PORTD &= B11111011; //Set pin 2 low again
 val_rapid = HIGH;
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" Flash fired ");
 lcd.setCursor(0,1);
 lcd.print("Wait to re-arm ");
 delay(2000); // This delay sets the re-arm time
 }
}
// End "rapid" ----------------------

//
//
// FUNCTION - accumulate_value returns sum of button presses to calling routine
// six values in call provide values for buttons and upper and lower limits
//
//

int accumulate_value(int inc_r, int inc_l, int inc_up, int inc_down, int upper_limit, int lower_limit, String title_string)
{
 // Function variable declarations
 int accumulator = 0;
 int returned_value;
 int stop_flag = false;
 //

 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print("<R> <L> <U> <D> ");
 lcd.setCursor(0,1);
 lcd.print(" Set the values ");
 delay(1500);
 lcd.clear();
 lcd.setCursor(0,0);
 //1234567890123456
 lcd.print(" <Select> ");
 lcd.setCursor(0,1);
 lcd.print(" Confirms ");
 delay(1500);

 do{
 which_button(key);
 switch(key){
 case 0:
 accumulator = accumulator + inc_r;
 break;
 case 1:
 accumulator = accumulator + inc_up;
 break;
 case 2:
 accumulator = accumulator + inc_down;
 break;
 case 3:
 accumulator = accumulator + inc_l;
 break;
 case 4:
 stop_flag = true;
 break;
 }
 if (accumulator <= lower_limit)
 {
 accumulator = lower_limit;
 }
 if (accumulator >= upper_limit)
 {
 accumulator = upper_limit;
 }
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print(title_string);
 lcd.setCursor(0,1);
 lcd.print(accumulator);
 delay(75);
 }
 while (stop_flag!= true);
 returned_value = accumulator;
 return returned_value;
}
// End "accumulate_value" ----------------------

//
//
// ROUTINE - which_button () returns debounced key
//
//

int which_button (int a)// took out declarations ******
{
 // Function variable declarations
 int adc_key_in; 
 //int key;
 int oldkey = -1;
 adc_key_in = analogRead(0);
 key = get_key(adc_key_in);
 if (key != oldkey){
 delay(30);
 adc_key_in = analogRead(0); 
 key = get_key(adc_key_in);
 oldkey=key; // position?
 return (key);
 }
} 
// End "which_button" ----------------------

//
//
// ROUTINE - Convert ADC value to key number/button press
//
//

int get_key(unsigned int input)
{
 // Function variable declarations 
 int k;
 int adc_key_val[5]={
 50,195,380,555,790 };
 int NUM_KEYS = 5;

 for (k = 0; k < NUM_KEYS; k++)
 {
 if (input < adc_key_val[k])
 {
 return k;
 }
 } 
 if (k >= NUM_KEYS)k = -1; // No valid key pressed
 return k;
}

// End "get_key" ----------------------


 

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

Brighter, faster, flashes from an LED-based flash gun – part 1

This is a quick post to show that it is relatively easy to get very fast, bright, flashes from larger LEDs than those I reported upon in an earlier post. I used the same circuitry as before but this time used it to drive a 10W 9-element COB LED at ~50A. This resulted in flashes bright enough to take pictures. The picture below  of my Dremel running at maximum RPM was taken with my iPhone (!). Dremel claim the drill I have will run at 32,000RPM. The flash duration was 5us and the LED was used in “stroboscopic mode” in the dark. I was quite impressed with the picture given that the edge of the disc is moving at about 83 metres per second (~300kph).

Dremel cutting disc running at 32,000 rpm.

Dremel cutting disc running at 32,000 rpm.

Here is a movie of the LED running in strobe mode:

Next steps are to increase the speed of the flash to 1us or better, write code so that the Arduino controller can respond to signals from my Camera Axe trigger, and upgrade the circuit used to drive the LED to use higher currents (100A). The heat-sink I used is there so that the LED can also be run in continuous mode with normal currents. The chip I used is incredibly bright…..warning to anyone who uses these…don’t look at them directly!

Note added 14/02/15: The 10-90% rise-time for the 10W LED is about 2us, four times longer than that for the single 3W star LED. As the traces below show, the 10W LED is able to produce light pulses of 1us duration but, though not obvious from the image, this is at the expense of  about 40% of its light output per unit time. The rise and the fall times are such that the light pulse far outlasts the 500ns voltage pulse used to create it. This may be due to the greater intrinsic series resistance and capacitance of the larger chip. It doesn’t bode well for driving bigger COB LEDs for very short durations. Fortunately, it looks like the 10W chips will go fast enough and bright enough for some of the applications I have in mind most of which require pulses in the 5 – 500us range.

To get the Arduino to produce sub 5us pulses, I used the PORT commands to toggle the digital pins and I used and the ‘no operation’ assembler command, nop, to give me the duration I wanted. Each ‘nop’ takes about 60ns.

Light output in yellow, command pulse in blue.

Light output in yellow, command pulse in blue.

 

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