# Scaling Up a Timing Light Circuit to Support 100 LEDs

#### Jon Schmidt

Joined Feb 17, 2018
6
I want to make an LED timing light like those that are used to set the ignition timing on an engine with a spark plug.

I need to be able to delay the flash of the light from 0 degrees to 720 degrees of crankshaft revolution so that I can video what is happening to mechanisms on an engine while it is running without using a high speed camera.

The engine will be running up to 8,000 RPM. I have found an example of a circuit that can do what I need but it only provides enough current for 1 LED. https://www.edn.com/design/other/4313346/LED-strobe-has-independent-delay-and-duration

This is great but I need to be able to run many LEDs, 100 would be ideal.

My best guess about how to do this is to make the entire circuit in parallel 100 times but I guess there must be a better way to do it.

If anyone has a better idea, please suggest it.

Thank You.

#### WBahn

Joined Mar 31, 2012
25,918
You don't want to make parallel copies of that circuit -- getting all of them to have the same delay and duration would be a nightmare.

How are you going to tie that to the engine's ignition timing? How are you going to maintain a constant delay in terms of degrees of rotation as the engine speed varies?

I think those are going to be bigger issues (particularly the latter) for you than driving multiple LEDs.

As for that aspect, that is pretty straight forward. There are a number of ways to slave an arbitrary number of LEDs to one command signal. If it is simply on-off control, then probably the simplest is to use a buffered voltage output from a comparator from the timing circuit and then make groups of LEDs that have FET transistors acting as switches.

#### philba

Joined Aug 17, 2017
960
I agree, the hard part will be the actual timing. The circuit you linked to has no way to select a specific delay. It's free running with no way to know the actual frequency or select a delay off of TDC. Do you have a way of getting a signal indicating the position of the crankshaft?

I can't help but think this calls for some sort of microcontroller.

#### DickCappels

Joined Aug 21, 2008
6,459
If you have a specific LED in mind it should be easy to come up with a design for the buffers. What LEDs do you have in mind?

#### GopherT

Joined Nov 23, 2012
8,012
I want to make an LED timing light like those that are used to set the ignition timing on an engine with a spark plug.

I need to be able to delay the flash of the light from 0 degrees to 720 degrees of crankshaft revolution so that I can video what is happening to mechanisms on an engine while it is running without using a high speed camera.

The engine will be running up to 8,000 RPM. I have found an example of a circuit that can do what I need but it only provides enough current for 1 LED. https://www.edn.com/design/other/4313346/LED-strobe-has-independent-delay-and-duration

This is great but I need to be able to run many LEDs, 100 would be ideal.

My best guess about how to do this is to make the entire circuit in parallel 100 times but I guess there must be a better way to do it.

If anyone has a better idea, please suggest it.

Thank You.
You can use 100 LEDs that are 30mA each or you can use one that is 3A. Cree makes a 10 W LED (3A) and you can find them on eBay where they are alreay mounted on an aluminum star which makes it much easier to solder and mount the star to a bigger heat sink.

Also, if you really want to freeze the motion of the engine, you want the lamp flash to be less than 1% duty cycle (about 3.6-degrees of engine rotation for each percent of duty cycle). The good news is, an LED can easily flash over 100 kHz (way more than you need). The bad news, these very low duty cycles, the less "bright" your eye perceives the LED so you may need to dim the lights. Back to good news, at very low duty cycles, you can significantly overdrive the LED (check the datasheet but I think that 10W Cree will take 10A or more when under 1% duty cycle and over 1 kHz. (On time less than 1% of 0.001 seconds).

Those strobes are fun but DO NOT look directly at the high power LED - bad temp issues and some chronic issues from UV emitted from white LEDs (early cataracts).

#### Jon Schmidt

Joined Feb 17, 2018
6
Wow, so much thoughtful help, I really appreciate it.

Since you guys have engineering ability, I think I should explain what I am trying to do.

I have a single cylinder engine that I am setting up with an intake duct with a glass window on one side. The duct will be up to about 20 inches long. I hope to video the entire length at once.

My aim is to video the movement of the air going into the engine.
Computer simulations of the air motion show that it is very elastic, I want to confirm the accuracy of the simulations.
I am working on some small wind vanes that hopefully will be able to be a useful indicator in video.
I also have high-speed pressure measurement equipment that I will be setting up to use at the same time.

The engine has 2 crank triggers, one (single pulse) that sends a signal to the ignition, and another (36 tooth - 1) that triggers a data acquisition system. If something else is needed, I can ad it.

It would be nice if the delay were proportional to the engine speed but It will be OK if it is not. I have a degree wheel on the crank that I can use to correlate the air motion in the duct to the crank angle. Maybe use a mirror/parascope like setup and get a view of the degree wheel along side the intake duct.

I have very little experience with circuits compared to you guys. Mostly just kits and Arduino type projects.

I don't have a particular LED in mind, the searching I have done so for showed some that seemed to concentrate the light in a directional cone, I suppose that would be more efficient than one that shines in all direction. (just wildly guessing).

If this information gives you any ideas for how I should proceed, I am all ears.

Thanks

Jon Schmidt

#### philba

Joined Aug 17, 2017
960
If you know arduino then this should be a walk in the park. Use the arduino to drive a MOSFET. You can use the Data Acquisition trigger as a signal to the arduino. Timing off of that, you would trigger the MOSFET (or MOSFETS) to fire the LED arrary. Also use the rate of the DAQ trigger to determine speed and thus be able trigger the LEDs at the desired degree of rotation.

#### LesJones

Joined Jan 8, 2017
2,667
I think a stroboscope using a xenon flash tube would give better results than LEDs. As the engine speed is likey to vary to some extent I think a phase locked loop oscillator would give a more stable picture. If you had the oscillator running at 360 times the the frequency of the crankshaft sensor then you could count pulses from the index pulse from the crankshaft to the point where you want the flash. Using a microcontroller would be the simplest way to do this. A much lower tech solution would be to add your own position sensor to the crankshaft. You would arrange the sensor part (Optical, Hall effect, variable reluctance etc.) so it could be moved round through a full 360 degrees. As you require 720 degrees I suspect the engine is a 4 stroke so mounting you sensor on the end of the camshaft would be better than mounting it on the crankshaft.

Les.

#### Jon Schmidt

Joined Feb 17, 2018
6
Great suggestions.

I didn't know that an Arduino was capable of doing something that high speed. I will look into Data Acquisition trigger and see what I find.

Are there any micro controllers that would be better than an Arduino for this?

The xenon flash tube looks like a better plan than LEDs.

#### philba

Joined Aug 17, 2017
960
8000 RPM = 133.33 revs per second. That means 7.5 mS per revolution or 20 microseconds per degree. A 16 Mhz Arduino will probably handle it though you might need to program the timer hardware directly. There are faster boards out there that use the Arduino IDE. Look at the 32 bit Teensy Line. Quite fast and very inexpensive (\$12-30). I'd use the Teensy 3.6, at 180 MHz, I don't think it would break a sweat. Just be aware that's a 3.3V device so you might need a driver for the MOSFET.

#### LesJones

Joined Jan 8, 2017
2,667
I am assuming the engine is a single cylinder 4 stroke. So for one full cycle (2 revolutions or 720 degrees) there 8000/(2 x 60) pulses per second = 66.67 hz If we want to be able to move the viewing position by 1 degree at a time we need to muliply this frequency by 720 which gives 48 Khz This has a period of 20.83 uS If you used the timing pulse from the sensor on the engine to reset timer 1 (A16 bit counter) in the ATmega328 on the Arduino and you used the 48 Khz signal to clock this counter you could then use the compare match to trigger the strobe. You would preset the compare register with a value between zero and 720 to decide when the strobe fired. I have no idea how you would do this programing the Arduino in "C" (Which is the normal way they are programmed) It would be reasonably easy in assembler but I think there would be some jitter onthe strobe firing position. I think the mechanical method I suggested would be better. Another problem has just occured to me, The normal duration of a flash from a xenon flash tube is about 1 mS (1000 uS.) So the flash would illuminate the engine for 48 degrees of rotation which would not show you what you want. I suggest that you check my calculations.

Les.

#### Jon Schmidt

Joined Feb 17, 2018
6
Thanks for all the thinking on this!!

I am looking into the teensy and mofsets now, I have made projects that had mofsets but did not know what they did.

I will look into the flash duration issue for both xenon and LED

#### philba

Joined Aug 17, 2017
960
You can program the ATMega 328 timer on the Arduino in C (C++ actually, though not a problem). I don't think jitter will be a big problem if the input signal timing is consistent and nothing else is running. There might be an issue with triggering for a small number of degrees at the top RPM due to the time it takes handle the start signal, start the timer and handle the timer interrupt. You may see a small amount of jitter (up to 125 nS is theoretical) though think it can be made deterministic.

However, running with the higher speed Teensys, I don't anticipate any problems with jitter.

#### WBahn

Joined Mar 31, 2012
25,918
You can program the ATMega 328 timer on the Arduino in C (C++ actually, though not a problem). I don't think jitter will be a big problem if the input signal timing is consistent and nothing else is running. There might be an issue with triggering for a small number of degrees at the top RPM due to the time it takes handle the start signal, start the timer and handle the timer interrupt. You may see a small amount of jitter (up to 125 nS is theoretical) though think it can be made deterministic.

However, running with the higher speed Teensys, I don't anticipate any problems with jitter.
You can deal with small number of degrees by just moving your window. Say, for instance, that it takes 10° of revolution to process everything. So you might double that and have your operating window be from 20° to 740° of revolution.

#### philba

Joined Aug 17, 2017
960
Yes, that certainly works.

#### Jon Schmidt

Joined Feb 17, 2018
6
I have been reading about Mofsets, but don't have enough knowledge about circuits like this to understand if speed will be an issue.

I am also working to find out more about the speed of Xenon tubes, some commercial automotive timing lights say they are Xenon, perhaps the size of the tube matters.

#### Jon Schmidt

Joined Feb 17, 2018
6
Here is a try at the logic of the code, how does this look?

Crank Trigger sends signal 1
Signal time (Time_1) is recorded

Crank Trigger sends signal 2
Signal time (Time_2) is recorded

Interval is computed
Interval=Time_2 - Time_1

Delay_Degrees = digital input

Output_SIgnal_Time = Time_2+(Interval*0.00277*Delay_Degrees) (1/360=0.0027777,,, maybe the multiplication will be faster)

Output a signal at Output_SIgnal_Time.

Assuming this is reasonable, I am wondering if the Arduino can supply the current required by the mofset or if some kind of step-up is required.

#### philba

Joined Aug 17, 2017
960
That's the general idea. The Teensy 3.6 has a multiply instruction but the ATMegas don't (so mul is very slow).

I would take a close look at the timers in what ever micro you use. You can use a 16 bit timer to measure the time between crank triggers. I think you might be able to use PWM hardware with the 16 bit timer to also fire the MOSFET. Doing that with interrupts means your main loop has no realtime constraints and it can do logging, computing the delay to fire the MOSFET, printing out data (like RPM) and so on.

The ATMega Arduinos have 40 mA drive current at 5V. The teensys vary but I think at least 20 mA, 3.3V though. I'm not an expert but you might be able to find a MOSFET with a low gate threshold - <3V. I'm not sure whether you will need a driver for the MOSFET. perhaps others smarter than I in this area can help.