Notifications
Clear all

Hi my name is GerryK

5 Posts
3 Users
1 Likes
1,153 Views
(@gpdkeogh)
Member
Joined: 2 years ago
Posts: 3
Topic starter  

Hi my name is Gerry and I am have an electronics hardware background mostly in power electronics and and now working on an interesting new project but am new to software development.  I have some basic understanding of computer programming that is very dated so need to get myself up to speed.  I am joining the Forum to share my project and get ideas on code for same.

I would like to hear from those who have experience using 28BYJ-48 stepper motor control and "homing" on power up using a Hall Effect device and external digital input to turn the motor certain number of steps.

So far I have the motor turning and changing directions using a Hall effect.

Thanks for any feedback.

Gerry

 


   
YurkshireLad reacted
Quote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 

Welcome Gerry! I claim to be a developer by day, and there are also numerous people here who can also help you out with your code.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@gpdkeogh

Welcome to the forum.

I've used BYJ motors with the basic ULN drivers, but never had  need to home them.

What questions do you have ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@gpdkeogh)
Member
Joined: 2 years ago
Posts: 3
Topic starter  

question: Yes I am using the ULN2003 driver chip with the Arduino Uno R3 board.  I am trying to find a way to use magnetic hall effect switch to zero the position on start-up of the stepper motor. Once find zero immediately stop. A toggle switch moves the stepper forward 1/4 motor revolution (2048 steps / 4).  What is the best software approach to use?  While loop??


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@gpdkeogh 

I would just rotate the BYJ stepper (fairly slowly) until the Hall sensor goes HIGH and then set your location to zero.

I don't know your layout so I can't comment on how to position the sensor. I presume that your stepper shaft drives a magnet through some kind of path and that, on startup, you need the position to be set to a known location. If you position the magnet at a point where it just triggers the sensor when it's properly situated, then you're finished.

Using a toggle switch will be frustrating and inaccurate.

So, if your Hall sensor is on pin hallPin ...

while (!digitalRead(hallPin)) {

    ... // advance one or more steps depending on the accuracy required

}

position = 0;    // At starting location

This will rotate the shaft until the Hall sensor goes high which is, I think, what you wanted.

 

Note that this can also be used at any time during operation if you need to reset the device.

hope this helps.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote