Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino 2, 28BYJ-48, and ULN2003


  • Please log in to reply
3 replies to this topic

#1 CodeHeadTheo

CodeHeadTheo

    New Member

  • Members
  • Pip
  • 4 posts

Posted 16 April 2015 - 08:36 PM

This may be out there but my search kung-fu is failing me. I am looking for some basic simple code to "getting started" with a NetDuino and 28BYJ-48 stepper motor with a ULN 2003 board.

 

There is all kinds of examples out there for a Arduino Uno but not the Netduino.

 

I have written some simple code that I thought should work from my understanding of the unit, the board lights up and sequences through the coil (at least the leds are lighting up in sequence) but the motor just barely vibrates as each sequence fires and not rotating at all.

 

I am using an external 5v power supply, I tested with a 9v power supply as well thinking it was a power issue but that did not solve the issue. I have several of these boards and motors and I tested a couple of them as well with the same result.

 

I am wired using D0-D3 and in code I just new up a port and write to it using .Write() like so:

 

OutputPort _p0 = new OutputPort(Cpu.Pin.GPIO_Pin0, false);

// repeated for the other 3 ports

 

//in a while loop I simply

 

_p0.Write(true);

_p0.write(false);

Thread.Sleep(100);

_p1.Write(true);

_p1.Write(false);

 

//and continue through the other 2 ports.

 

 

Any pointer as to what simpleton issue I am hitting here will be greatly appreciated.

 

Thanks!

 

 

 

 

 



#2 peterfjorgensen

peterfjorgensen

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationDenmark

Posted 20 April 2015 - 07:56 PM

Hi,

To me it sounds like the order of engaging the coils in the motor is incorrect. Just because that you may think it is the most natural that the outputs are engaged in the numeric order (1,2,3,4, 1,2,3,4, etc.) it also depends on if you have the wiring correct. Maybe the order should be (1,4,3,2,1,4,3,2, etc), or something else.

Basically you will need to check if the motor coils are activated in the right order.

Sometimes trial-and-error is the best method here

 

/Peter  



#3 CodeHeadTheo

CodeHeadTheo

    New Member

  • Members
  • Pip
  • 4 posts

Posted 20 April 2015 - 08:54 PM

No, the order is absolutely correct and the wiring is right as well. I have this working just fine running on a Arduino Uno and a Arduino Nano, the same approach to the code and working with it on the NetDuino is failing to produce results. I even thought at one point that it may be my NetDuino but I have several so I changed it out as well and the result was the same.

 

I will keep testing it and if I come up with a solution, I will update this thread. If someone that has a stepper running on a NetDuino comes across this thread, some sample code or insight would be appreciated.

 

Thanks

Theo



#4 peterfjorgensen

peterfjorgensen

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationDenmark

Posted 21 April 2015 - 08:18 AM

http://microframewor...-MicroFramework

 

Please have a look at my (very old, but newly updated  :) website), where you can see a video and my code running a stepper motor using the old GHI USBizi board using the ULN2003 driver. The same code will easily run on other .NETMF boards.
 

If you are completely sure that the wiring is correct and the order of engaging the coils is also correct, then you need to check the power supply.

 

I noticed a rather long delay in your code between engaging two coils - 100ms! As you know, the motor you are using has 2048 steps per revolution, so it will take ages for you to see it moving. I'd lower the delay and see what happens...

 

Peter






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.