Skip to main content

Meadow.Foundation.Motors.Stepper.Uln2003

Uln2003
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Motors.Stepper.Uln2003

ULN2003 is a high voltage, high current Darlington array containing seven open collector Darlington pairs. The ULN2003 is often packaged on board used to control stepper motors.

Code Example

Uln2003 stepperController;

public override Task Initialize()
{
stepperController = new Uln2003(
pin1: Device.Pins.D01,
pin2: Device.Pins.D02,
pin3: Device.Pins.D03,
pin4: Device.Pins.D04);

return base.Initialize();
}

public override Task Run()
{
stepperController.Step(1024);

for (int i = 0; i < 100; i++)
{
Resolver.Log.Info($"Step forward {i}");
stepperController.Step(50);
Thread.Sleep(10);
}

for (int i = 0; i < 100; i++)
{
Resolver.Log.Info($"Step backwards {i}");
stepperController.Step(-50);
Thread.Sleep(10);
}

return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a ULN2003 to your Meadow board, connect the following:

ULN2003Meadow Pin
GNDGND
VCC3V3
INT1D01
INT2D02
INT3D03
INT4D04

It should look like the following diagram: