October 14th, 2015
  • Stepper motor
  • 28BYJ-48
  • ULN2003

Stepper motor library

I've made it my quest to create OOP classes for Arduino. Read about that in this blogpost if you need some more context.

This library is created using the 28BYJ-48 stepper motor in combination with the ULN2003 driver board, but it will work with every 4 pin driver board for stepper motors.

  Scheme stepper motor  

This library lets you choose between three different step modes:

  • Half step mode
  • Full step single phase mode
  • Full step dual phase mode

If you want to know the differences between these modes, please look at this YouTube video explaining all three modes.

The 28BYJ-48 motor needs 512 full (inner) engine rotations to rotate the drive shaft once. In half-step mode these are 8 x 512 = 4096 steps for a full rotation, and in full-step mode these are 4 x 512 = 2048 steps for a full rotation.

Between every step the engine needs some time to move. You can specify this time as the step delay in milliseconds, which is 1ms by default. So when you increase the step delay, the motor turns slower.

When you've initialized the engine with a mode you can choose to let the motor run clockwise or counter clockwise continuously or only for a certain amount of steps. The library can call a method in the event the motor turned the requested amount of steps. See the example code which is in a subdirectory of the library.

Please note that full step mode may need an external power source in order to work. I use a PC power supply for this. You can use a red (5V) and a black wire from the power supply to power the driver board. To turn on a PC power supply you have to connect the green wire to one of the black wires. See my library to control a power supply here.

The stepper motor library can be found here on GitHub.
It uses the BaseTimedElement base class which can be found here on GitHub.

< Previous post Overview posts Next post >
Договориться о дате приезда специалиста https://krd.1mcentr.ru/ооо-первый-метрологический-центр/
ArthurMuh, October 7th, 2026
Оформление акта о неисправности оборудования по инструкции происходит в тех случаях когда выявлена поломка оборудования и требуется установить ее причины а также принять решение о выполнении восстановительных работ или о списании из-за дефектов https://zapchasti-remont.ru/shop/karteryi_i_kolenvalyi/ Дефектный акт может быть составлен как в отношении бытовой офисной техники так и применительно к сложным техническим устройствам https://zapchasti-remont.ru/shop/detali_dvigatelya/
Marcuswaw, October 7th, 2026
Каждый букет будь то розы или другие цветы можно оплатить банковской картой при оформлении заказа https://tsvetochnyybiznes.ru/sbornye-bukety В некоторых случаях доступна бесплатная доставка цветов в Москве но иногда требуется заплатить за доставку https://tsvetochnyybiznes.ru/oferta Стоимость доставки по Москве вы также увидите при оформлении заказа https://tsvetochnyybiznes.ru/kustovye-rozy оформление банкетных залов для свадеб юбилеев; Какой букет можно заказать с доставкой Мы предлагаем бы
CharlesChike, October 7th, 2026
Врач посоветует уходовые средства которые подойдут для вашей кожи в период восстановления https://www.cellulait.ru/blog/page/4/?post-paged01db32=20 Ими необходимо пользоваться каждый день до полного восстановления https://www.cellulait.ru/blog/page/14/?post-paged01db32=2 Диодный лазер MeDioStar NeXT https://www.cellulait.ru/blog/page/11/?post-paged01db32=2 Это единственное устройство в котором применяется сразу две волны разной длины 940 и 810 Нм что позволяет его использовать для пациентов с
DavidgoK, October 7th, 2026

Leave a comment

= Thanks for your comment =