loading
You have probably been to a party where there is a strobe and it delays everything. Today we are going to use this principle to "slow" stuff (fans) down. Maybe you have seen one using 555 timers, the Arduino and maybe even the Propeller chip. However, have you ever seen one with a PIC?

We are going to build this today. I am using the PIC12f675 from Microchip. THer is a video below to show the inner workings.  

Step 1: Get the Parts

You will need:
  Perf Board
  6 volt battery pack (AA) (If you want, it can have a power switch and cover.)
 7805 regulator (I use it in case I use a power supply.)
 220uF capacitor
 2 0.1 ceramic disc capacitors (it should say 104 on it.)
 2n2222 NPN bi-polar junction transistor (use this transistor or a power transistor...I say this because 2n2222 can drive up to 1 amp but really, a transistor with 500mA will work.)
 7 680ohm Resistors (I say seven because it has 1 "power led" See Notes at the bottom to hear why. This other LED also strobes like the others.)
 potentiometer (I like 100K...gives me good range)
 7 LEDs ( I prefer blue but any bright LED will work.)
 PIC Programmer (I used the old fashioned QuickWriter.)
 ...and most importantly the PIC12f675 Microprocessor!

Optional:
 IC socket (this can double the height of your chip which may affect your LEDs positively or negatively.)
 Three pin terminal block (female headers work too.)

 

Nice work.<br>I would replace the pot with an UP and DOWN buttons.<br> <br>A
Can you vote for me in the Make it Move Challenge?
your on
You're absolutely right. I could have and, it kind of is hard to adjust the pot. However, I would need a whole lot more of parts and a longer program.
Sorry I had to include the dots in my comment of the code...it tried to put things as close together as possible so thr dots are really spacers...ignore them in the code.
Here is the other document in the other file......................................................................................................................................... <br><br>The Source Code for it is:............................................................................................ <br><br> ; STROBOSCOPE 2011 07 04<br>; To compile cvasm16.exe strobosc.src<br> include '12f675.inc'<br>_BODEN_OFF EQU 3FBFh <br>_MCLRE_OFF EQU 3FDFh <br>_INTRC_OSC_NOCLKOUT EQU 3FFCh <br>_WDT_ON EQU 3FFFh <br><br> FUSES _BODEN_OFF<br> FUSES _MCLRE_OFF<br> FUSES _INTRC_OSC_NOCLKOUT<br> FUSES _WDT_ON<br><br>; Define some variables in the general purpose FILE<br>; register area.<br><br>STATUS EQU 0003H<br>GPIO EQU 0005H <br>ADCON0 EQU 001FH <br>CMCON EQU 0019H <br>OPTION_REG EQU 0081H <br>TRISIO EQU 0085H <br>WPU EQU 0095H <br>ANSEL EQU 009FH<br><br>CLOCK1 EQU 0021H; -- CLOCK ----<br>POTMSB EQU 0022H; AD CH 3<br><br>; ------ MAIN PROGRAM -------------<br> CALL INIT ; INITIALIZATION<br><br>STROBE<br> BSF GPIO,0 ; TURN ON LED<br> CALL DELAY100US ; <br> BCF GPIO,0 ; TURN OFF LED<br> CALL DELAY100US;<br> CALL DELAY100US;<br> CALL DELAY100US;<br> CALL GETPOTAD2 <br><br>OFFLOOP<br> CALL DELAY100US;<br> CLRWDT ; REFRESH WATCHDOG TIMER<br> MOVF POTMSB,1 ; TEST IF POTMSB IS ZERO<br> BTFSC STATUS,2; TEST STATUS FOR ZERO<br> GOTO STROBE ; =ZERO, NOT TO DECREMENT<br> DECF POTMSB,1;<br> GOTO OFFLOOP ; 3 CLOCK CYCLES<br> GOTO STROBE<br> <br><br><br>;------------------------------------------------------------------------<br>GETPOTAD2<br> MOV ADCON0,#00001001B ; LEFT JUSTIFIED, CH 2<br> BSF ADCON0,1 ; START AD CONVERSION<br><br>WAITPOTAD2<br> BTFSC ADCON0,1 ; DATA READY?<br> GOTO WAITPOTAD2 ;<br> MOV POTMSB,ADRESH ;<br> RET ;<br>;------------------------------------------------------------------------<br><br>;-------------------- INIT --------------------------<br>INIT<br><br> BCF STATUS,5<br> CLRF GPIO<br> MOVLW 00000111B ;<br> MOVWF CMCON ; DISABLED COMPARATOR<br> BSF STATUS,5 ; PAGE 2<br> CLRF ANSEL ; DIGITAL IO<br> MOVLW 00100010B ; weak pull up gp1, GP5<br> MOVWF WPU ;<br> MOVLW 00111100B ;<br> MOVWF ANSEL ; SET AN3, AN2 AS A/D + INTERNAL RC<br> MOVLW 00001000B ;<br> MOVWF OPTION_REG ;<br> MOV ADCON0,#00000000B ;LEFT JUSTIFIED, AD REF=VDD, START AD3 FIRST<br> MOVLW 00111110B ; GP0 AS OUTPUT, GP1,2,3,4,5 as input<br> MOVWF TRISIO ;<br> MOVLW 10000000B ; CENTER FREQUENCY<br> MOVWF OSCCAL ;<br> BCF STATUS,5<br> CLRF INTCON ;<br> CLRWDT ;<br> RET<br>;------------------- END INIT --------------------------<br><br>;-------------------DELAY100US-------------------------------------<br>DELAY100US<br> MOV CLOCK1, #36 ; <br>D100LOOP<br> DECFSZ CLOCK1,1 ;<br> GOTO D100LOOP ;<br> RET<br>;-------------- END DELAY100US ---------------------<br>
I had trouble opening the code on my Instructable so, if you want to try, here is the direct link...www.instructables.com/files/orig/F6R/48WZ/GPBD59LS/F6R48WZGPBD59LS.doc...copy and paste it to try. But, I will upload the code here...<br><br>STROBOSCOPEOBJECT.doc is:<br><br>:10000000182005142E2005102E202E202E20102022<br>:100010002E206400A20803190128A2030828012841<br>:1000200009309F009F149F1813281E08A200080083<br>:10003000831285010730990083169F0122309500B5<br>:100040003C309F000830810000309F003E3085002A<br>:100050008030900083128B01640008002430A100DE<br>:06006000A10B302808008E<br>:1042000000000000000000000000000000000000AE<br>:10421000000000000000000000000000000000009E<br>:10422000000000000000000000000000000000008E<br>:10423000000000000000000000000000000000007E<br>:10424000000000000000000000000000000000006E<br>:10425000000000000000000000000000000000005E<br>:10426000000000000000000000000000000000004E<br>:10427000000000000000000000000000000000003E<br>:10428000000000000000000000000000000000002E<br>:10429000000000000000000000000000000000001E<br>:1042A000000000000000000000000000000000000E<br>:1042B00000000000000000000000000000000000FE<br>:1042C00000000000000000000000000000000000EE<br>:1042D00000000000000000000000000000000000DE<br>:1042E00000000000000000000000000000000000CE<br>:1042F00000000000000000000000000000000000BE<br>:084000007F007F007F007F00BC<br>:02400E009C3FD5<br>:02FFFE00750686<br>:00000001FF<br><br>

About This Instructable

8,122views

16favorites

License:

Bio: I love building things and taking pictures. If you want me to build something...I'm open to ideas. My motto? "If you want something ... More »
More by blinkyblinky:Keeping Up Appearances with Chindogu A Complete Beginner's Guide to Raw Files And Raw Processing Hypercard - An Impossible Paper Object 
Add instructable to: