Editing PIC based Stepper Motor Dancing Analog Clock

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
 
*Name: PIC based Stepper Motor Analog Clock with Dancing Hands
 
*Name: PIC based Stepper Motor Analog Clock with Dancing Hands
 
*Purpose: An amusing analog clock, see below.
 
*Purpose: An amusing analog clock, see below.
*Status: This is a draft. Code works but still in refinement, code available, email russ_hensel Also still refining the project.
+
*Status: This is a very early draft. Code works but still in refinement, code available, email russ_hensel  
 
*Technology: Stepper Motors, PIC 16F877A and BoostC
 
*Technology: Stepper Motors, PIC 16F877A and BoostC
 
*Author: [[russ_hensel]] ( where you can find an email address to reach me )  
 
*Author: [[russ_hensel]] ( where you can find an email address to reach me )  
 
*License: Open source and object code.  
 
*License: Open source and object code.  
  
This is an analog clock, with real hands driven by stepper motors.  A clock for the confused dyslexics amoung us, for more informatinon on Dyslexia see DAM ( Mothers Against  Dyslexia ). Because stepper motors are quite powerful the clock could be made quite large, 3 feet in diameter is probably within reach still using inexpensive ( salvage ) stepper motors.  The project description includes eagle files for the circuits and a BoostC project with source code for the PIC.
+
This is an analog clock, with real hands driven by stepper motors.  Because stepper motors are quite powerful the clock could be made quite large, 3 feet in diameter is probably within reach still using inexpensive ( salvage ) stepper motors.  The project description includes eagle files for the circuits and a BoostC project with source code for the PIC.
 
 
 
 
News:
 
* May '09  C code was missing from archive, this has been fixed.
 
 
 
* Comming Soon:  I have a second physical version of the clock that looks much nicer, including real clock hands.  Code has been improved a lot as well.  ( code updated in new download below )
 
 
 
[[Image:ClockFace.png  | Clock Face ]]
 
  
 
=== Major Parts ===  
 
=== Major Parts ===  
Line 22: Line 14:
 
*2 Stepper Motors -- probably can be salvaged from printers or 5 1/4 disk drives ( where I got mine )
 
*2 Stepper Motors -- probably can be salvaged from printers or 5 1/4 disk drives ( where I got mine )
 
*PIC16F877 processor  -- Others can be used, but this guy has a lot of IO, quite a bit is used for the clock
 
*PIC16F877 processor  -- Others can be used, but this guy has a lot of IO, quite a bit is used for the clock
*Low side Driver Chip -- but any transistors with reasonable beta and enough current handling capacity could be substuited.
+
*Low sid Driver Chip -- but any transistors with reasonable beta and enough current handling capacity could be substuited.
 
*Case -- With a bit more work than I have done you could have a really nice case.  I am working on an oak one now
 
*Case -- With a bit more work than I have done you could have a really nice case.  I am working on an oak one now
 
*Clock Face --  Some good artwork here could make a really good looking clock, anyone willing to send me an high quality graphics file?
 
*Clock Face --  Some good artwork here could make a really good looking clock, anyone willing to send me an high quality graphics file?
 
*Circuit Board --  Right now mine is built mostly on a proto board, but I have designed but not tested printed circuit boards suitable for single sided, toner transfer, fabrication.
 
*Circuit Board --  Right now mine is built mostly on a proto board, but I have designed but not tested printed circuit boards suitable for single sided, toner transfer, fabrication.
  
=== What it Looks Like ===
 
 
The current case, face, and hands are pretty rough, I am working on better ones, but it may be a bit of a wait.
 
 
Still photo: see above.
 
 
Video of a couple of minutes, running at 10x but the motion of the hands in real time ( minute ticks by in 6 not 60 seconds )  [http://www.youtube.com/watch?v=Dajo2r___P8 Short Video of Clock]
 
  
Putting a better face on it, a draft coming soon:  [[Image:PossibleFace.png | Hour hand face  ]]
 
  
 
=== Features ===
 
=== Features ===
Line 51: Line 35:
 
|-valign="top"
 
|-valign="top"
 
|Special effects -- Dancing
 
|Special effects -- Dancing
|Hour and minute hands may "dance" at special times, see the video at: [http://www.youtube.com/watch?v=Dajo2r___P8 Short Video of Clock]
+
|Hour and minute hands may "dance" at special times, see the video at: xxx
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 61: Line 45:
 
|For debugging and demo of special effects
 
|For debugging and demo of special effects
  
<!-------------------------------->
+
<!--------------------------------
 
|-valign="top"
 
|-valign="top"
|Dual Stepper motors
+
|
|Salvage from printers and floppy drives.  Independent drive of each hand.
+
|
 
<!--------------------------------
 
<!--------------------------------
 
|-valign="top"
 
|-valign="top"
Line 113: Line 97:
  
 
|}
 
|}
 +
  
 
=== Circuit ===
 
=== Circuit ===
Line 121: Line 106:
  
 
For parts I used used my junk box, when it fails consider SparkFun and Futurlec.  Or.....  See: [[Supplier]].
 
For parts I used used my junk box, when it fails consider SparkFun and Futurlec.  Or.....  See: [[Supplier]].
 
To see the circuit and board in detail download the files and view in Eagle, the free version is fine.
 
  
 
==== Power Supply ====
 
==== Power Supply ====
  
This is a straight forward half wave rectifier with a linear regulator.  It is powered by a wall wart transformer rated at about 9 volts.  The unregulated voltage is over 9 volts ( 9 * ( 2 ^ 1/2 )) by simple theory.  This unregulated voltage is used directly by the steppers so choose you wall wart to match your stepper motors.  You should also size the filter caps based on the current that will be used by the motors.  A couple of volts of ripple is not a problem as long as you have enough overhead for the 5 volt regulator ( the PIC might run on less, let me know if you try it ).  An important part of the power supply is a 60 hz, roughly square wave.  It is clipped off from the AC input.  The 60 Hz power line tends to be very accurate over the long term, less so if you suffer power outages.  You could run the clock on batteries but the motors load down a battery pretty badly and you would need a different timing signal ( the original code has a subroutine for timing off the crystal ).
+
This is a straight forward half wave rectifier with a linear regulator.  It is powered by a wall wart transformer rated at about 9 volts.  The unregulated voltage is over 9 volts ( 9 * ( 2 ^ 1/2 )) by simple theory.  This unregulated voltage is used directly by the steppers so choose you wall wart to match your stepper motors.  You should also size the filter caps based on the current that will be used by the motors.  A couple of volts of ripple is not a problem as long as you have enough overhead for the 5 volt regulator ( the PIC might run on less, let me know if you try it ).  An important part of the power supply is a 60 hz, roughly square wave.  It is clipped off from the AC input.  The 60 Hz power line tends to be very accurate over the long term, less so if you suffer power outages.  You could run the clock on DC but the motors load down a battery pretty badly and you would need a timing signal ( the original code has a subroutine for timing off the crystal ).
  
 
===== Power Supply Schematic and Board =====
 
===== Power Supply Schematic and Board =====
Line 143: Line 126:
 
|Part
 
|Part
 
|Details
 
|Details
<!-------------------------------->
+
 
 
|-valign="top"
 
|-valign="top"
 
|Wall Wart
 
|Wall Wart
|You need one with AC output to get the 60 Hz timing signal from the power line.  Mine is a 9 v 800 ma unit.  I found it somewhere.  The unregulated rectified voltage should be good for your motor, so check your motor against the wall wart.  The 9 volt unit does a good job of driving a 12 volt motor.  Motors do not need very well regulated power.
+
|You need one with AC output to get the 60 Hz timing signal from the power line.  Mine is a 9 v 800 ma unit.  I found it somewhere.
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 156: Line 139:
 
|My junk box yeilded 4,700 mfd at 25 volts
 
|My junk box yeilded 4,700 mfd at 25 volts
 
<!-------------------------------->
 
<!-------------------------------->
 +
 
|-valign="top"
 
|-valign="top"
 
|C1A = High Frequency Bypass
 
|C1A = High Frequency Bypass
Line 170: Line 154:
 
|-valign="top"
 
|-valign="top"
 
|DC1, DC2 = Clipping Diodes
 
|DC1, DC2 = Clipping Diodes
|Clip the AC for the time keeping to +5 and 0 volts.  Protects the input of the PIC.  I just used standard small signal diodes.
+
|Clip the AC for the time keeping to +5 and 0 volts.  Protects the input of the PIC.
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 176: Line 160:
 
|10 k resistors, form voltage divider to the timing signal to PIC, limits current to DC1 and DC2.
 
|10 k resistors, form voltage divider to the timing signal to PIC, limits current to DC1 and DC2.
 
<!--------------------------------
 
<!--------------------------------
 +
|-valign="top"
 +
|D_REVERSE = reverse voltage protection diode
 +
|Use only if you worry about reverse voltage protection on the regulator.  Not real likely, I left it out.
 +
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|D_REVERSE = reverse voltage protection diode
 
|D_REVERSE = reverse voltage protection diode
Line 206: Line 194:
 
|-valign="top"
 
|-valign="top"
 
|MOUNT_1...4
 
|MOUNT_1...4
|Mounting holes.  No electrical connection.
+
|Mounting holes
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|Stepper
 
|Stepper
 
|Badly regulated power for the stepper motors, to the common connection on the motors.
 
|Badly regulated power for the stepper motors, to the common connection on the motors.
<!-------------------------------->
+
<!--------------------------------
 
|-valign="top"
 
|-valign="top"
 
|xx
 
|xx
Line 224: Line 212:
 
===== Processor Schematic and Board =====
 
===== Processor Schematic and Board =====
  
Single sided, for toner transfer, in Eagle ( semi-final, less ground plane, files may be more up to date ) To get a readable copy download the Eagle files and open in Eagle, see: [[Techniques#Software_design_tools | Techniques, Software Design Tools]]
+
Single sided, for toner transfer, in Eagle ( semi-final, less ground plane, files may be more up to date )
  
 
[[Image:ProcessorBoardSch.png  | Power Supply Schematic ]]
 
[[Image:ProcessorBoardSch.png  | Power Supply Schematic ]]
Line 240: Line 228:
 
|-valign="top"
 
|-valign="top"
 
|Wall Wart
 
|Wall Wart
|You need one with AC output to get the 60 Hz timing signal from the power line.  Mine is a 9 v 800 ma unit.  I found it somewhere.  The output voltage, when rectified, needs to be enough to drive the motor, the PIC runs off a regulator so it does not care much about the input voltage.
+
|You need one with AC output to get the 60 Hz timing signal from the power line.  Mine is a 9 v 800 ma unit.  I found it somewhere.
 
<!-------------------------------->
 
<!-------------------------------->
  
 
|-valign="top"
 
|-valign="top"
 
|PIC16F877A
 
|PIC16F877A
|My favorate 16 series part, relatively lots of memory and pins.  Bigger than you need, but only about 8 bucks.  Try with an 18 series part, should not be hard and will leave you more up to date.  Let me know.
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 253: Line 241:
 
|-valign="top"
 
|-valign="top"
 
|Single Pole double throw Momentry Switch
 
|Single Pole double throw Momentry Switch
|( or could be 2 momentary push buttons ) one moves the hands up, the other down, in the set and adjust modes.  From my junk box.
+
|( or could be 2 momentary push buttons ) one moves the hands up, the other down, in the set and adjust modes.
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|Pull Up/Down Resistors
 
|Pull Up/Down Resistors
|10k more or less
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|CQ1, CQ2 = capicators for the crystal
+
|CQ1, CQ2 = crystal resistors
|about 20 pf seems to work, see the PIC16F877A manual
+
|about 20 pf seems to work, see the 977a manual
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|xx
 
|xx
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|xx
 
|xx
Line 273: Line 261:
 
|-valign="top"
 
|-valign="top"
 
|Q = crystal
 
|Q = crystal
|4 meg Hz is what I used.  May be quite a bit faster than needed, I have not looked into this.  The 4 meg crystal seems to work ok on a proto board.  Note that some of the code is dependent on this frequency, but could be fairly easily changed.
+
|4 meg Hz is what I used.  May be quite a bit faster than needed, I have not looked into this.  The 4 meg crystal seems to work ok on a proto board.
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|RA4, RA5 = Pull up resistors
 
|RA4, RA5 = Pull up resistors
|10K more or less
+
|10K
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|RB1 ... RB6 = Pull up resistors
+
|RB1 ... RB6
|10K more or less
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|RRA2, RRA3 = Pull up resistors
+
|RRA2, RRA3 =  
|10K more or less
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
Line 292: Line 280:
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|RRA1 = Pull Up resistor
+
|RRA1 =
|10K more or less
+
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|
+
|CLOCK  =
 
|
 
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|DRIVER  = Driver
+
|DRIVER  =  
|Driver chip for stepper.  ULN2803. Good for up to .5 amp 35 volts I think.  Could use discrete transistors ( possibly darlingtons ) if you want higher current.  You should not need more current unless you make a really big clock.
+
|Driver chip for stepper.  ULN2803   
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|RMC  = Pull up resistor for master clear ( pull down with push button switch to reset ).
+
|RMC  = Pull up resistor for master clear
|10k more or less
+
|10k
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|PUSH_BUTTON_SWITCH  = Reset
 
|PUSH_BUTTON_SWITCH  = Reset
 
|Push to reset the processor.  Mine was from salvage.
 
|Push to reset the processor.  Mine was from salvage.
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 +
 
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 +
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
Line 336: Line 326:
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|VDD = Positive Power
+
|VDD =
|5 volts from power supply.
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|G1  = Ground Connection
+
|G1  =
|To the power supply.
+
|
 
<!-------------------------------->
 
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
|SW_UP, SW_DOWN = Setting switch
+
|SW_UP, SW_DOWN =
|I used a momentary double throw, single pole, you could use 2 momentary push buttons.
+
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
 
|
 
|
<!--------------------------------
+
<!-------------------------------->
 
|-valign="top"
 
|-valign="top"
 
|  =
 
|  =
Line 358: Line 348:
 
|  =
 
|  =
 
|
 
|
<!-------------------------------->
 
|-valign="top"
 
|MOUNT_1...4
 
|Mounting holes.
 
 
<!--------------------------------
 
<!--------------------------------
 
|-valign="top"
 
|-valign="top"
Line 371: Line 357:
  
 
=== Program ===
 
=== Program ===
 
==== Overview ====
 
  
 
Nothing very fancy here.  The 60 Hz input is fed to the port x interrupt.  This lets the PIC keep time.  The hands are not moved during the interrupt instead flags requesting hand movement are set and the main loop moves the hands.
 
Nothing very fancy here.  The 60 Hz input is fed to the port x interrupt.  This lets the PIC keep time.  The hands are not moved during the interrupt instead flags requesting hand movement are set and the main loop moves the hands.
Line 378: Line 362:
 
Invalid states for the mode can easily happen with a rotory switch when the wiper is not fully in position.  Because of this not all possible states on the mode input are used.
 
Invalid states for the mode can easily happen with a rotory switch when the wiper is not fully in position.  Because of this not all possible states on the mode input are used.
  
The stepper control is half step.  The activation of the coils is determined by an array which hold the 8 different activations of the coils.  My stepper motor has 200 full steps ( 400 half steps ) per revolution.  You should be able to adjust the code for different steppers.  Much of the steppeer code is very similiar to that in [[Stepper Motor Tester]] which may or may not have a better explanation of the code which drives the stepper motor.
+
The stepper control is half step.  The activation of the coils is determined by an array which hold the 8 different activations of the coils.
  
For the serial interface code see [[Serial Communications Library -- BoostC and 16F877A]]
 
  
I have tried to have pretty good comments in the code, any comments on the comments ( helpfull one please ) let me know.
 
  
==== Compiling ====
+
For the serial interface code see [[Serial Communications Library -- BoostC and 16F877A]]
The zip file contains the entire source bootst project.  Unzip into a directory and open in source boost.  There are some additional notes at the top of the main source file.  Follow the instructions there, they will tell you about any compiler and/or linker options, and report on memory usage from a recent compile of mine.  The compile should run without error. 
 
 
 
If you do not wish to compile you can use the precompiled hex version also included in the zip archive.
 
 
 
=== Building the Clock ===
 
 
 
My first case is just a 3/4 inch board with a thinner ( about 1/4 inch ) board mounted perpendicularly to it for the face of the clock.  Mounting the stepper motors can be problematic as the ones I encountered had no mounting tabs or holes.  What I finally came up with is to drill a fairly large hole ( about 1 inch ) that matches a slightly raised cylinder around the shaft.  Then bolt a plate across the back of the motor and sandwich the motor up against the hole.  It holds well, centers up nicely, and is easy to take apart. 
 
 
 
The face is just a piece of light cardboard with the face drawn on it.  Be as creative as you can.  You should be able to do better than my attempt.  My hands are bamboo skewers from the kitchen drawer.  They are pushed perpendicularly through a short piece of aquarium tubing which then slips over the motor shaft.  Seems to work pretty well.
 
 
 
You should be able to make a much better looking clock, I am working on one and will report back later.
 
  
 
[[Image:MotorMount1.png | Motor Mount]]
 
  
 
=== Running the Clock ===
 
=== Running the Clock ===
  
==== Without the Serial Interface ====
+
Before plugging it in set the hands to 12 oclock and and 0 minutes ( if the hands are accessable ).
  
*Before plugging it in set the hands to 12 oclock and and 0 minutes ( if the hands are accessable, else skip this ).
+
Plug in.  The hands should spin a bit and then stop.  The clock will be set to 12:00 and will immediately start running.  But the hands may not be initialized or adjusted to the correct zero positions.  To adjust them change the mode switch to Adj Hour Hand  and manipulate the up down switch untill the hour hand moves to 12:00 ( this does not change the internal time of the clock ), switch to Adj Minute Hand
  
*Plug in.  The hands should spin a bit and then stop. 
 
  
*The clock will be set to 12:00 and will immediately start running.  But the hands may not be initialized or adjusted to the correct zero positions.  To adjust them change the mode switch to Adj Hour Hand  and manipulate the up down switch untill the hour hand moves to 12:00 ( this does not change the internal time of the clock ), switch to Adj Minute Hand and adjust it to 0 minutes.
+
If you are using the serial interface:
  
*Switch the clock back to run, the hands may move a bit, the time is very near 12:00 ( unless it took you a long time to adjust the hands ).
+
Enter the serial mode by connecting a 9600 8n1 with a terminal emulator like .....
  
*Switch to set hour to set the correct hour.
+
The clock should send debugging information about onec a minute.  It will also inform you of the changing of modes with the mode switch.
  
*Switch to set minute to set the correct minute.
+
Then send an ! the clock should respond with....
 
 
*Switch to run and enjoy.
 
 
 
==== With the Serial Interface ====
 
 
 
This interface is not necessary but can be very useful for playing around with the clock, or debugging new version of the code.
 
To use the serial interface you will need a cable, and perhaps a level shifter ( the Stepper Tester [[Stepper Motor Tester]] has a max232 level shifter, this circuit does not, you can get a level shifter as a seperate component or even built into a cable ).  You will also need a serial terminal, generally a program for your PC.  For information on a good terminal program see [[PC-Microcontroller Communications#Serial_Communications_from_a_PC_to_Microcontrollers]]
 
 
 
Notes on terminal program set up.
 
 
 
*Baud rate should be 19.2K 8N1
 
*Most terminal programs can be set to treat a carriage return as a carriage return line feed. Do it.
 
Some terminal programs will not transmit in lower case ( all our commands are lower case ) unless specially set to do so. Set it to allow lower case.
 
 
 
The clock should send debugging information about once a minute ( maybe ).  It will also inform you of the changing of modes with the mode switch.
 
 
 
Then send an ! to the clock, the clock should respond with "Stopped; turn on serial mode" and you can then use the commands in the following table.
 
 
 
Command table:
 
 
 
{| class="wikitable"
 
|-valign="top"
 
|Command
 
|Action
 
<!-------------------------------->
 
|-valign="top"
 
|!
 
|Stop whatever is running, enter serial control mode.
 
<!-------------------------------->
 
|-valign="top"
 
|Hn<cr>
 
|set clock to hour n ( n is one or two digits ) and move the hands, but no dancing.
 
<!-------------------------------->
 
|-valign="top"
 
|Mn<cr>
 
|set clock to minute n ( n is one or two digits ) and move the hands, but no dancing.
 
<!-------------------------------->
 
|-valign="top"
 
|R<cr>
 
|Report on clock status
 
<!-------------------------------->
 
|-valign="top"
 
|Dn<cr>
 
|Dance the clock to hour n ( n is one or two digits ).  Only move thg hour hand.  Use to review debug the dance.
 
<!-------------------------------->
 
|-valign="top"
 
|A<cr>
 
|Adjust the hands to their 0 positions ( 12:00 ). If they are not correctly line up use the J and Y commands below
 
<!-------------------------------->
 
|-valign="top"
 
|Yn<cr>
 
|( Y is above the H ) adjust the hour hand by an amount n, where n is a signed number from about -100 to 100.
 
<!-------------------------------->
 
|-valign="top"
 
|Jn<cr>
 
|( J is above the M ) adjust the minute hand by an amount n, where n is a signed number from about -100 to 100.
 
<!--------------------------------
 
|-valign="top"
 
|<cr>
 
|
 
<!--------------------------------
 
|-valign="top"
 
|<cr>
 
|
 
<!--------------------------------
 
|-valign="top"
 
|<cr>
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|X<cr>
 
|Exit serial control, return to control by mode switch
 
<!--------------------------------
 
|-valign="top"
 
|xx
 
|
 
<!-------------------------------->
 
  
|}
+
Command table
  
 
=== Additional Ideas ===
 
=== Additional Ideas ===
Line 511: Line 402:
 
*For a related project see:  [[Stepper Motor Tester]]
 
*For a related project see:  [[Stepper Motor Tester]]
  
*Some clever gears might let you mount the hour and minute hands around the same axis, maybe start from some cheap clock or clock movement.
+
=== Download ===
 
 
*Clock faces and hands can be bought ( google it ).  Maybe they could be usefully incorporated.
 
  
 +
Comming, email me until then see [[russ_hensel]
  
=== Modifications You May Need to Make ===
 
 
Motors vary, you want to know what the voltage, current, and step size is for your motor.  The stepper tester project [[Stepper Motor Tester]] can be useful for this.  It should give you the number of steps and tell you if your voltage is suitable. The motor only runs from time to time so some overvoltage is probably ok.  If the number of half steps is different from 400 you can change the program and the layout of the minute hand to accomidate.  A 7.5 degree per step motor has 96 half steps per rotation, use 60 of thes for a minute hand which will now swing over 180 degrees, I think you can still fit this on the dial.  Not that the circuit for both the stepper tester and the clock are good for only 500ma so motors that use more than this will need a different driver.  Comments in the code should help you modify the code for different numbers of steps and/or different dial layouts.
 
 
=== Download ===
 
Note there may be a serious error in the schematic for the clock board.  You can jumper around it if you have already made the board, else wait for version X. ( may be fixed in version 2 below, but I need to check. )
 
Download includes the boostc project ( .c, .h, and ._c files ) some of the graphics, movie, and eagle files [http://home.comcast.net/~russ_hensel/OC/DDClock/DDClock_v2.zip Download Version 2] Questions? email me until then see [[russ_hensel]]
 
  
 
=== Comment, Questions, Contributions? ===
 
=== Comment, Questions, Contributions? ===
  
 
Email me [[russ_hensel]], or use the talk page for this topic.  All feedback is welcome.
 
Email me [[russ_hensel]], or use the talk page for this topic.  All feedback is welcome.
 
[[category:projects]][[category:Serial Communications]][[category:Microcontroller]][[category:PIC]]
 
[[category: clock]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)