ME 445 – Lab 3 part 1: Stepper motor and light sensor 1) Stepper Motor The ULN2803A chip contains eight Darlington transistors with base resistors and flyback diodes as shown below so that inputs can be driven directly by TTL. The outputs can sink up to 500 mA at 50V. Build a circuit to energize the coils of a unipolar stepper motor using four outputs from your Arduino as shown below. Write a program to energize individual coils in the proper sequence to achieve CW and CCW rotation of the stepper motor. Rotation speed should also be programmable. ULN2803A Arduino digital outputs Arduino GND motor coils 1 1B 1C 18 2 2B 2C 17 3 3B 3C 4 4B 16 6 4C 15 5 5B 5C 14 6 6B 6C 13 7 7B 7C 12 8 8B 8C 11 COM 10 9 GND external power GND A C B D external power +5VDC Report: Comment on holding torque when all coils are off versus when one is energized. How could you increase holding torque? List as many ways as you can think of. 2) Light sensor Attach a light sensor to the motor shaft so that it can be rotated horizontally to scan the room. You may use either a photo-transistor or a CdS sensor as your light sensor. Use the Arduino A/D converter to measure the light sensor output as the motor rotates. Continuously display the motor’s current angular position and current light sensor output to the PC or LCD display. page 1 of 3 ME 445 – Lab 3 part 1: Stepper motor and light sensor Report: Write a program to perform a rapid 360 degree scan of the area and record light intensity as a function of angle. Once the full scan is complete, point the sensor at the position of maximum intensity. Be creative to find the maximum as accurately and rapidly as possible. Also, use functions to make your code easier to read and debug. Include a well-formatted version of this code with your report. Report Include all of the items mentioned above and answer the following questions. 1) What is the angular resolution for rotation with your stepper? How could you improve resolution? 2) List what you consider to be the most important advantages and disadvantages of stepper motors. Troubleshooting question: Pick the biggest problem you ran into while working on this lab and describe the problem in your report. Also provide the steps you followed to solve the problem. Think about how you could have determined what the problem was as quickly as possible and write about a method you would use to diagnose similar problems in the future. If you didn’t run into any problems, you write about what you think could have been a major issue. Note: Now that the labs are getting more challenging, you could have two or three things wrong at one time. Try to develop a test that would allow you to eliminate as many potential problems at once. page 2 of 3 ME 445 – Lab 3 part 1: Stepper motor and light sensor FOUR PHASE STEPPER MOTOR DRIVE SEQUENCE Wave Drive Sequence (full steps) Step A B C D 1 ON 2 ON 3 ON 4 ON 5 ON Two-Phase Drive Sequence (full steps) Step A B C D 1 ON ON 2 ON ON 3 ON ON 4 ON ON 5 ON ON Half-Step Drive Sequence (half steps) Step A B C D 1 ON 2 ON ON 3 ON 4 ON ON 5 ON 6 ON ON 7 ON 8 ON ON 9 ON A B D C page 3 of 3