LED stroboscope

Introduction

Stroboscope instruments are used for inspection and observation of moving parts by freezing or slowing down the action of an object. If a fast rotating or oscillating object is illuminated with periodic light flashes so they always hit it in the same position, the object will appear stationery in the eyes of the observer. The Mini-Project LED stroboscope is also a PIC Microcontroller project. A light signal which blinks with a certain frequency is produced by the Microcontroller. PWM mode of the PIC microcontroller is used to obtain this function. The frequency of the signal is changing with the external switches and the potentiometers. Jumbo LEDs are used to produce the flashing light. The frequency of the light is displayed by 4 digit seven segment display.
Design

A schematic of the device

The device is designed in three states; first part is the main circuit, second is the ssd circuit and third is the LED circuit.
The main circuit is pic microcontroller circuit and it contains all main operations of the device. Port A of the microcontroller is used for the analog to digital conversion. The analog input is changed with two potentiometers; course and fine which are connected serialy. That input is given through the pin 0 of the portA and the reference voltage is given from the pin3 of the portA(RA3). PWM output is taken through the CCP1 (RC2) pin . data for SSD is given through portD and the select lines are from port B. frequency changing switches are set to portE and portB. one switch is included to half the existing frequency value, one is for the conversion of Hz into rpm, two orange and green leds are used to indicate the units Hz or rpm. a white led indicates MHz value.
SSD circuit is the next circuit. Four single seven segments displays are used. It is found that the forty pins of those four SSDs are exactly in the same distance of the pic ic and the ic base of the pic ic is taken for place SSDs. This part is separated from the main circuit because of the complexness and the final product should be small and hand held.

The other part is the LED part. At first the LED circuit is designed with 36 normal LEDs but it is found in the initial test with using the signal generator that with a single output signal lighting up all 36 LEDs with the same brightness and same frequency is somewhat difficult and 3, 1W jumbo LEDs are used. An reflective surface of a normal lamp is taken to obtain a parallel beam of light.

Used method

In the project two main modes of the pic is used. ADC and PWM. ADC is used to read the input signal and PM is used to generate the signal.

ADC

Analog to Digital converter is used in this device to change the existing frequency value. Two serially connected variable resistors change the input voltage of the ADC and that value is read with respect to the reference voltage that is applied to another pin of the portA. By setting the register, (ADCON0=0b01000001; )the clock conversion is set to Fosc/8 (Fosc=5MHz) and the analog to digital conversion is enabled. The voltage of 5V is divided into 255, that much of change in externally input voltage increases the value of the ADC by one bit. This value is set into 8bit value and send to PR2 register for the PWM operation.

PWM

The output signal of the Stroboscope is generated by the PWM mode of the PIC microcontroller. The duty circle is set to 10%. That is calculated with using the equation

PWM duty circle=(CCPR1l:CCP1CON<5:4>)*Tosc*(TMR2 prescale value)

Tosc = 1 / Fosc

The frequency of the output signal is given by

Freq out = Fosc /[4 x (PR2+1)] , where PR2 = 0,1,2,3,4,5,…,254,255

Freq out (min) = 5 x 10^6 /[4 x (255+1)] = 4.88 kHz

Freq out (max) = 5 x 10^6 /[4 x (1)] = 1.25 MHz

Construction

component list

These are the components that i used in this project

 Conponent  description or purpose  number of components needed
 PIC16F877A   Microcontroller  1
 4 MHz crystal oscillator   generate clock  1
 LM7805  voltage regulator  1
 LM317  current driver for LED  3
 BC108  send the select signal  7
 10 k variable resistor  change the input voltage  1
 5 K variable resistor  change the input voltage  1
 resistor  330  control the current  7
 resistor  10 k  control the current  5
 resistor  1k  control the current  4
 LED   jumbo  for the display  3
 LED red  indicate power  1
 LED  white  indicate MHz  1
 LED orange  indicate rpm  1
 LED  green  indicate Hz  1
 push button switch  memory clear  1
 two way switch  power on & Hz to rpm  2
 push on switch  half the freq  1
 common cathode ssd  display freq  4

The first step is drawing the schematic diagrams including all the functionalities mentioned above .

Softwares used

Capture CIS of the Orcad software is used to draw the schematic diagrams.The PCB layouts of those circuits are also drawn with layout plus of the same software package.
pictures of the circuits that I constructed are shown below

Main circuit

ssd circuit

led lamp cover

Driving current

Driving current is an essential for lighting up those LEDs and LM317 is used as current driver for driving current. The input voltage for current drivers is the same input voltage that is used for the voltage regulator because the brightness of the LEDs are increased with the current.

Results

A picture of the operation of the Stroboscope

Improvements

A LCD display can use instead of the SSD.lot of information can be able to display through the LCD display units of the frequency (Hz or rpm), range (kHz or MHz) error of the reading, also other data as clock frequency, input voltage of the ADC.

The device can be improved with using pushbutton switches for both functions and also increasing the range of the frequency.