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://dolgoletmed.ru/uslugi/kompleksnye-programmy/ Защемления нервных корешков, радикулиты
Dennispaisa, October 5th, 2026
Вы также можете заказать цветы с доставкой по Москве за 90 минут – за срочность в этом временном диапазоне мы не берем денег https://tsvetochnyybiznes.ru/sbornye-bukety/tproduct/765141311242-buket-v-fioletovih-tonah Если потребуется, доставим и за час по городу при отсутствии заторов на дорогах столицы, оцененных в 8 баллов и выше https://tsvetochnyybiznes.ru/korporativnye-zakazy Чем удобна доставка по Москве? При заказе в нашем интернет-магазине мы предоставляем широкий ассортимент ц
CharlesChike, October 5th, 2026
Обращаем Ваше внимание на то, что содержимое данного интернет-сайта носит исключительно информационный характер и ни при каких условиях информационные материалы и цены, размещенные на сайте, не является публичной офертой, определяемой положениями Статьи 437 Гражданского кодекса РФ https://zapchasti-remont.ru/shop/starteryi4/
Marcuswaw, October 5th, 2026
Двуспальные матрасы с разными половинами жесткости шьются как два односпальных матраса объединенные общим наматрасником такая конструкция удобная надежная и долговечная https://matras-centr.ru/melodija-sna Прежде кровати в основном были пружинные тонкие и мягкие и бытовало мнение что спать необходимо обязательно на жестком матрасе https://matras-centr.ru/stol-obedennij-citrus-bts Сегодня все кровати снабжены жестким основанием а матрасы изготавливают высотой не менее 10 см https://matras-centr.
DennisSkype, October 5th, 2026

Leave a comment

= Thanks for your comment =