Anders Häggman

MAS.863 Portfolio

WEEK 10 // Output Devices

In line with many other things I have done in this class, controlling a stepper motor was something I had not done before. By this time, I had now made a handful of PC-boards (created the schematics and placed the components), so this was not in itself a huge task, but did take surprisingly long, as I find most electronics do for me.

Also, what's most annoying, in the debugging stage I spent way too long wondering what the problem was, when I had mapped the Arduino to ATTiny pin numbers wrong. The sad part is, that I already checked them once, but failed to see my mistake. I blame the lack of sleep.

  • Level of previous experience:              
  • Time taken:               
  • Tools used:
    Eagle PCB Software  //  Roland Modela MDX-20  //  Soldering Equipment  //  Arduino IDE
  • Got help from:
    Will Langford  //  Jessica Artiles
  • Main learnings:
      Be sure to check and double check the Arduino - ATTiny pin number mapping.
      If possible, don't work tired. You'll make a lot more mistakes (or at least I make a lot more mistakes when I'm tired).

[Image_Missing]
Arranging the wires in the correct order for the power cord that I am making.
[Image_Missing]
The power and ground both have two wires each, so I'm twisting them together at the other end.
[Image_Missing]
Added some heat shrink, and soldered short bits of solid core wires to the other end. It has no functional value, but from a usability perspective I thought it would be nicer (I didn't want to have frayed wires when using the cord). I also color coded the ends of the wires with black and red heat shrink, and marked the end of the connector, so that I could easily see which wires were connected to which connector holes, and wouldn't have to wonder which one is ground and which one is power.
[Image_Missing]
I also used heat shrink on the connector end, to hide the ends of the wires, for both the power cord that I made, as well as the stepper motor wires.
[Image_Missing]
This is a tester piece that I made, that I could then use a multimeter on to verify which cable goes to which connector hole.
[Image_Missing]
Since I ran the stepper motor as bipolar, two of the wires were not needed. I color coded the end of the connector to make sure that I would connect it right.
[Image_Missing]
There was some conflicting information about which voltage regulator to use. I had first used the 100mA one, but was told that I should use the larger 1A one. So I began redesigning my board, but then realized the 100mA regulator is fine, and used the old board design, shown above.
[Image_Missing]
This is the schematic for the board I made.
[Image_Missing]
The board I designed, along with my schematics for how to connect the different connectors. I found this to be helpful in trying to avoid mistakes, when tired. Despite all the efforts I made to try and be careful and avoid mistakes, the stepper was not stepping. The problem, annoyingly, was that I had the wrong pin numbers in the arduino code (even though I had supposedly already checked them once).
[Image_Missing]
Although things weren't working, there was time for a late night treat.

After figuring out that the pin number mapping was incorrect, and changing the pin numbers in the arduino code, the stepper motor began working. After the code worked, it was easy to adjust the turning speed, direction, delays between steps and number of steps. I didn't think to take video of all the different variations, but below is a video of the motor simply turning.