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 >
Всем привет! Отличная и полезная новость для туристов в Китай! В частности и в особенности для тех, кто планирует посетить Китай более 30 дней. Из-за безвизового режима до 30 дней многие путаются в долгосрочном и краткосрочном посещение поднебесной, т.е. Китая. Если вам нужна долгосрочная поезда, то будет разумнее и лучше оформить визу в Китай, т.е. визу L на 90 или 60 дней. В общем, если вы ищите, оформление туристической визы в Китай, туристическая виза в Китай, туристическая виза L
Syao-Lun_friva, October 16th, 2026
Предсказуемость результатов https://mycosmi.ru/services/apparatnyy-massazh Принцип действия аппаратов хорошо изучен https://mycosmi.ru/services/lazernaya-epilyatsiya Их эффективность клинически подтверждена https://mycosmi.ru/prices локальные жировые отложения, устойчивые к диете и спорту; Наш аппаратный косметолог подбирает индивидуальную программу для каждого пациента, учитывая состояние мягких тканей, возраст и желаемый результат https://mycosmi.ru/prices Медицинская а
DallasErelo, October 16th, 2026
Дополнительные способы использования осветительной опоры: Из каких материалов могут быть изготовлены опоры? Силовые опоры предназначены для поддержки и передачи нагрузок https://www.profit-energo.ru/catalog/k-9778241-nesilovyye Они используются в конструкциях, где необходимо обеспечить устойчивость и прочность, например, в мостах, зданиях, сооружениях для хранения и переработки грузов https://www.profit-energo.ru/catalog/k-4310050-opory_osveshcheniya Внутренняя проводка https://www.pr
DavidGof, October 15th, 2026
Just last week I had a small hiccup. A bonus round froze mid-spin. Normally you'd worry about losing your payout, except this time I was playing on <a href="https://wearewunder.bar/">Vegazone casino</a>. I pinged the team at once, and an agent had my session back up pretty fast. The feature restarted without a hiccup, and the payout landed in my account.Stuff like this shows that quick help changes everything. I mostly log on just to unwind, and I went through the terms I needed on https://weare
VegazoneCasinoCA, October 15th, 2026

Leave a comment

= Thanks for your comment =