alternate to AFmotor shield

Shop Forum Makelangelo Polargraph Art Robot alternate to AFmotor shield

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #5920

    I’ve got these:
    5V Stepper Motor + ULN2003 Driver Board Set from (

    and want to make a makelangelo variant — the GUI/pc side of your setup looks to be the easiest to work with of the various drawbots I’ve looked at.

    the problem is that the ULN2003 is just a Darlington array. basically just allows me to directly control the stepper.
    the stepper library from arduino won’t work, it’s a blocking process, but I found this library :
    I am trying to figure out what changes I need to make to the makelangelo code so I can use that with the driver boards I have.
    I’m not a great coder, but I think I can make this even without a helping hand, but it will be tedious.

    I would love to get a shortcut 🙂
    Any suggestions?


    Uh… I’m not familiar with the ULN2003. If you send the Arduino code when you get it working I can make it available to other people. You should only have to change the setup() and line() methods, if I remember correctly.


    I’ll be hacking at it this weekend — if I get something working out then I’ll send it along


    looks like I need to do 2 main things to substitute the accelstepper commands for the AFmotor ones, other than changing pin definitions.
    define forward and backward to be 1 and -1
    and make a function to handle onestep() — accelstepper equivalent would be move (1|-1); run();

    If time permits this week, I’ll be testing this out.


    I could put the m1.onestep() in a function on it’s own and that would make it easier to add #defines for different boards.

    Will you be sharing your changes back with the github project so other people can use your solution?


    I will be uploading — soon as I figure out what’s wrong with my changes 🙂 currently it takes a couple of really slow steps no matter how fast or far I tell it to go… for the first time I found myself wishing the arduino IDE had a debug mode so I could step through and see what it’s trying to do looks like print statements will have to do..
    Should have time to finish up this weekend, it being labor day and all. :crosses fingers:


    All right, I’ve got it mostly working, speed controls aren’t quite there(it just ignores all speed settings and uses the hard coded values, but it moves correctly.
    I forked it, uploaded my changes then made a pull request.
    here’s my Fork.

    First time working with GitHub, so if I did it all wrong, let me know what I need to do to fix it.

    Summery of what I had to change:
    AccelStepper.h instead of AFMotorDrawbot.h — both should work,since the AF is a superset of the AccelStepper library — I just needed it to throw errors so I could alter all the AF-specific code

    stepper initialization AF has a direction and a step pin, AccelStepper just has pins for the motorcoils.

    Couldn’t figure out the FORWARD and BACKWARD functions in AccelStepper — so I defined them as 1 and -1 which works great.

    replaced all the onestep() and step() instructions with Move();run();

    and last, I hit the autoformat button in Arduino 1.05, and it bleeped up all the whitespace 🙁

    All told quite a bit of fun, and thanks for the encouragement! I hope others find it useful.

    –never really did anything other than a hello world before, other than t-SQL queries which are an entirely difference beast


    Nice work! Looking forward to getting that patch in.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.