stroboscope for classic combustion engines

Hi all,

As a proud owner of a Honda CB500F1 (1976) I was looking for a stroboscope to set the ignition timing right.
A simple stroboscope will cost about 60-70 euro's and will do the job fine but much more fun it will be to build my own, using a picaxe of course!

The stroboscope itself is built using common parts (still in development... will post the details later)

First difference is: I will not use the regular xenon flashlight but a sturdy LED.
Because most white LED's are using a fluorescent layer to emit light, they will show an afterglow. They are way to slow for a stroboscope. Instead, I chose a RGB LED.
The forward voltage of the 3 LED's inside will be about 8 Volts and the current will be about 350 mA. The LED emits a lot of light, so I must find a way for eye protection later on. Lots more light as the average standard stroboscope, it might even possible to use it out in the sun!

I also found a nice, small 8 character LCD starburst display. Very suitable for a portable device.

Th picaxe will mainly be used to do some measuring during the test. Besides the use of the RGB LED, the stroboscope itself is pretty discrete and straightforward. It will be connected to the breakerpoints directly to make measurements possible.

Where does the picaxe fit in?
Not directly in the strobe itself because we cannot allow any delay on the flash.
But since we have the ignitionpulse from the engine, we can do some measuring

The picaxe will show cycles per minute, dwell (the time the breakerpoints are opened and closed)
Settings can be made in the menu for number of cylinders, 2 or 4 stroke engine and number of ignition coils (My Honda has 2 of them)

In another modus the strobe will flash by the picaxe and show the frequency on the display. By looking at the reflection and change the frequency until it appears frozen you can determing the speed of the machine you are looking at (Fan or something)

The third modus is just a light to see into the dark areas of the engine you are working on

All can be managed with just 4 buttons (menu,up,down and OK)

In a bit earlier version of the software I made a short movie while testing the functionality

Look at it: http://www.youtube.com/watch?v=Y6vIzKHuNtg

The programme itself so far (maybe some adjustments are needed after the electronics are built):
View attachment lcd led strobe sgl task dn.bas
 
The code in code :)
Code:
'connections Picaxe 18M2:
'        ______  ______
'       |      ()      |
'  btn +|1  c.2  c.1 18|btn -
'     nc|2  c.3  c.0 17|btn menu
'  serin|3  c.4  c.7 16|LED1 bg wht
' serout|4  c.5  c.6 15|LED2 bg red
'    gnd|5  0v   +5v 14|Vcc
'       |6  b.0  b.7 13|ignition in
'I2C sda|7  b.1  b.6 12|stroboscoop out
' in pwm|8  b.2  b.5 11|btn OK
'     nc|9  b.3  b.4 10|I2C scl
'       |______________|
'
'The display used is: dsm-0822a LCD Starburst and connects to the scl/sda
'An electronic circuit will directly trigger a high power RGB LED (since
'white LED's are fluorescent and not fast enough for this application)
'the RGB LED will also be triggered by output b.6
'from the electronic circuit also an output is provided thet connects to 
'output b.6 is connected to the RGD LED and to input b.2

Init:
  setfreq m32
  'because every character takes 2 bytes the eeprom address is doubled in value
  '0-9
  eeprom 96,(217,155,0,11,89,156,9,151,160,13)'01234
  eeprom 106,(169,208,185,149,12,130,185,157,169,157)'56789
  'special characters
  eeprom 128,(0,0)'space
  'A-Z
  eeprom 130,(184,141,13,189,153,144,13,185,185,144)'abcde
  eeprom 140,(184,128,153,149,176,13,4,32,21,32)'fghij
  eeprom 150,(176,66,145,16,146,11,146,73,153,153)'klmno
  eeprom 160,(184,140,153,217,184,204,169,149,12,160)'pqrst
  eeprom 170,(145,25,208,2,208,73,66,66,6,2)'uvwxy
  eeprom 180,(73,146,255,255)'z and lamptest '[' 
  symbol btnmenu = b10
  symbol menu = b11
  symbol menub = b12
  symbol intflag =b13
  symbol strob = b15
  symbol cyl = b16
  symbol breakers = b17
  symbol takt = b18
  intflag = 0
  strob = 1
  cyl = 4
  breakers = 2
  takt = 4
  symbol waiter=8000
  symbol freq1  = b19
  symbol loop0 = b20
  symbol loop1 = b21
  symbol byte0 = b22
  symbol byte1 = b23
  symbol chr1  = w12
  symbol chr2  = w13
  symbol val0  = b26
  symbol val1  = b27
 input b.2,b.5,b.7,c.0,c.1,c.2
 
main:
for b0=0 to 5
low c.7
high c.6
pause 1000
'high c.7
low c.6
pause 1000
next
high c.7
gosub startupshow
menu = 1
goto menu1

menu1:
intflag = 0
pwmout b.3,off
pause 1500
if menu < 1 then
  menu = 4
end if
if menu > 4 then
  menu = 1
end if
if menu = 1 then
  poke 28,"s"
  poke 29,"t"
  poke 30,"r"
  poke 31,"o"
  poke 32,"b"
  poke 33,"e"
  poke 34," "
  poke 35,"["
  gosub display
end if
if menu = 2 then
  poke 28,"t"
  poke 29,"a"
  poke 30,"c"
  poke 31,"h"
  poke 32,"o"
  poke 33," "
  poke 34," "
  poke 35,"["
  gosub display
end if
if menu = 3 then
  poke 28,"l"
  poke 29,"i"
  poke 30,"g"
  poke 31,"h"
  poke 32,"t"
  poke 33," "
  poke 34," "
  poke 35,"["
  gosub display
end if
if menu = 4 then
  poke 28,"r"
  poke 29,"e"
  poke 30,"s"
  poke 31,"e"
  poke 32,"t"
  poke 33," "
  poke 34," "
  poke 35,"["
  gosub display
end if
if pinc.0 = 0 then'menu btn
end if
if pinc.1 = 0 then'min btn
menu = menu - 1
end if
if pinc.2 = 0 then'plus btn
menu = menu + 1
end if
if pinb.5 = 0 then'ok btn
  strob = menu
  if strob = 1 then 
    menu = 4
    goto menu2
  end if
  if strob = 2 then
    menu = 2
    freq1 = 255
    goto tacho
  end if
  if strob = 3 then 
    menu = 1
    goto light
  end if
  if strob = 4 then 
      reset
  end if
end if
goto menu1

menu2:
pause 1500
if menu < 1 then
  menu=6
end if
if menu > 6 then
  menu = 1
end if
bintoascii menub,b2,b3,b4
  poke 28,b4
  poke 29," "
  poke 30,"c"
  poke 31,"y"
  poke 32,"l"
  poke 33," "
  poke 34," "
  poke 35,"["
  gosub display

if menu = 1 then 
  menub = 1
end if
if menu = 3 then 
  menub = 2
end if
if menu = 4 then 
  menub = 4
end if 
if menu = 5 then 
  menub = 6
end if
if menu = 6 then 
  menub = 8
end if

if pinc.0 = 0 then'menu btn
  menu = 1
  goto menu1
end if
if pinc.1 = 0 then'min btn
menu = menu - 1
end if
if pinc.2 = 0 then'plus btn
menu = menu + 1
end if
if pinb.5 = 0 then'ok btn
  cyl = menub
  menu = 2
  goto menu3
end if

goto menu2

menu3:
pause 1500
if menu < 1 then
  menu = 2
end if
if menu > 2 then
  menu = 1
end if
bintoascii menub,b2,b3,b4
  poke 28,b4
  poke 29," "
  poke 30,"s"
  poke 31,"t"
  poke 32,"r"
  poke 33,"o"
  poke 34,"k"
  poke 35,"e"
  gosub display

if menu = 1 then 
  menub = 2
end if
if menu = 2 then 
  menub = 4
end if

if pinc.0 = 0 then'menu btn
  goto menu2
end if
if pinc.1 = 0 then'min btn
  menu = menu - 1
end if
if pinc.2 = 0 then'plus btn
  menu = menu + 1
end if

if pinb.5 = 0 then'ok btn
  takt = menub
  menu = 2
  goto menu4
end if
goto menu3

menu4:
pause 1500
if menu < 1 then
  menu = 3
end if
if menu > 3 then
  menu = 1
end if
bintoascii menub,b2,b3,b4
  poke 28,b4
  poke 29," "
  poke 30,"c"
  poke 31,"o"
  poke 32,"i"
  poke 33,"l"
  poke 34,"s"
  poke 35,"["
  gosub display

if menu = 1 then 
  menub = 1
end if
if menu = 2 then 
  menub = 2
end if
if menu = 3 then 
  menub = 4
end if

if pinc.0 = 0 then'menu btn
  pause 500
  goto menu3
end if
if pinc.1 = 0 then'min btn
  menu = menu - 1
end if
if pinc.2 = 0 then'plus btn
  menu = menu + 1
end if

if pinb.5 = 0 then'ok btn
  takt = menub
  menu = 1
  goto stroboscoop
end if
goto menu4

interrupt:
intflag = 1
return

display:
  setfreq m32
  hi2csetup i2cmaster, 112, i2cslow, i2cbyte' I2c address LCD
  hi2cout (224,%11001000) 'init for display (11001000)
    for loop0 = 0 to 7 'count digit 
      val1=28 + loop0 'RAM address in string area
      peek val1,chr1 'read character
      if chr1 = 32 then 'space
        chr1 = 64 'shift space to 64
      end if
      if chr1 < 48 then 'below numeric 
        chr1 = 91 'burst character
      end if
      if chr1 > 57 then
        if chr1 < 64 then
          chr1 = 91 'burst character
        end if
      end if
      if chr1 > 90 then
        if chr1 < 97 then
          chr1 = 91 'burst character
        end if
      end if
      if chr1 > 122 then 'above alpha 
        chr1 = 91 'burst character
      end if
      if chr1 > 91 then 'lower case to upper case
        chr1 = chr1 - 32
      end if
      if chr1 > 90 then 'not alphanumeric
        chr1 = 91 'burst character
      end if
      val1=chr1*2 'here ascii codes will be doubled
      read val1,byte0,byte1 'get character data from eeprom
      val0 = loop0 * 4
 '     setfreq m4
      pause 10
      hi2cout (val0,byte0,byte1) 'send data to LCD
  '    setfreq m32
    next
return

startupshow:
  poke 28," "
  poke 29,"e"
  poke 30,"v"
  poke 31,"g"
  poke 32," "
  poke 33," "
  poke 34," "
  poke 35," "
  gosub display
  pause waiter
  poke 28,"L"
  poke 29,"e"
  poke 30,"d"
  poke 31," "
  poke 32," "
  poke 33," "
  poke 34," "
  poke 35," "
  gosub display
  pause waiter
  poke 28,"s"
  poke 29,"t"
  poke 30,"r"
  poke 31,"o"
  poke 32,"b"
  poke 33,"e"
  poke 34," "
  poke 35," "
  gosub display
  pause waiter
  poke 28,"t"
  poke 29,"a"
  poke 30,"c"
  poke 31,"h"
  poke 32,"o"
  poke 33," "
  poke 34," "
  poke 35," "
  gosub display
  pause waiter
  poke 28,"v"
  poke 29," "
  poke 30,"1"
  poke 31," "
  poke 32,"0"
  poke 33," "
  poke 34,"b"
  poke 35," "
  gosub display
  pause waiter
  return
end


stroboscoop:
setint %00000000,%00000001
do while intflag = 0
setfreq m4
COUNT b.7,1000,w5
PULSIN b.7,0,w6
setfreq m32

w0=1000/w5
w6=w6/w0
w6=100/w6
w6=360/w6

bintoascii w6,b2,b3,b4,b5,b6
poke 28,b4
poke 29,b5
poke 30,b6
poke 31," "
poke 32," "
poke 33,"d"
poke 34,"e"
poke 35,"g"
gosub display
pause waiter

w5=w5*60
if w5 > 4000 then'LCD bg changes color if rpm is high
  low c.7
  high c.6
else
  high c.7
  low c.6
end if

bintoascii w5,b2,b3,b4,b5,b6
poke 28,b2
poke 29,b3
poke 30,b4
poke 31,b5 
poke 32,b6
poke 33,"r"
poke 34,"p"
poke 35,"m"
gosub display
loop
menu = 1
goto menu1

tacho:
'61-5167 Hz
setint %00000000,%00000001
do while intflag = 0
if freq1 >255 then
  freq1 = 255
end if
if freq1 <2 then
  freq1 = 2
end if
pwmout PWMDIV64,B.6, freq1, 10
setfreq m4
COUNT b.2,1000,w6
setfreq m32
if pinc.1 = 0 then'min btn
  freq1 = freq1 + 1
end if
if pinc.2 = 0 then'plus btn
  freq1 = freq1 - 1
end if
'w6=w6*60
  bintoascii w6,b2,b3,b4,b5,b6
  poke 28,b2
  poke 29,b3
  poke 30,b4
  poke 31,b5
  poke 32,b6
  poke 33," "
  poke 34,"h"
  poke 35,"z"
  gosub display
  loop
  menu=2
  pwmout b.6,off
goto menu1

light:
setint %00000000,%00000001
do while intflag = 0
if pinc.1 = 0 then'btn-
menu = 0
end if
if pinc.2 = 0 then'btn+ 
  menu =1
end if
  poke 28,"l"
  poke 29,"i"
  poke 30,"g"
  poke 31,"h"
  poke 32,"t"
  gosub display
  if menu = 1 then
  poke 33," "
  poke 34,"o"
  poke 35,"n"
  high b.6
else 
  low b.6
  poke 33,"o"
  poke 34,"f"
  poke 35,"f"
end if
loop
low b.6
menu=3
goto menu1
Some work can be done to clean up and make this program a bit more efficient but it works already fine as it is now.
 
Last edited:

fernando_g

Senior Member
"Because most white LED's are using a fluorescent layer to emit light, they will show an afterglow."

Some years ago, I attempted to build a white-LED flash for photographic use and replace a Xenon one.
I would notice motion blur when using the LED version, that was absent in the conventional flash.

Later I learned exactly -doing web searches- the latency inherent in white LEDs.
 
Top