power on/off motor

Hello..

I am a newie in this area and I really need your help if possible ...

I have an arduino nano connected to a stepper uln2003, with a motor 28BYJ-48 of 5volts .

The wiring:

Arduino Nano:

(30) and (29) powers the board

(D4) to (D7) goes to the stepper motor signal

(04) GND and the (27) +5V powers the stepper driver uln2003 and the motor

(D9) and GND is for the microswitch

I use this to rotate a gyro watch winder that i download from thingiverse, by the user Gene Fusco

The program makes 10 turns clockwise and stops through a microswitch, then for 40 minutes stop, then turns 10 times anti-clockwise and stops again 40 minutes...

Send file too...

Always this ..

Works really well...

But.....
There is a problem...

The motor heats up and the part that I use to rotate is made of PLA, the heat that comes out of the motor causes the PLA to start to be deformed and spoils the part ....

Is there a way through code to turn on/off the current that goes to the uln2003 board in that 40 minute period?

I appreciate any help you can give me on this.

Gyro_Watch_Winder.ino (5.45 KB)

We would also appreciate a schematic if you could please.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

These functions could save and restore motor state while powering them down and up again

byte state ;
void powerDownStepper ()
{
  for (byte i = 4 ; i <= 7 ; i++) 
  {
    state = (state << 1) + digitalRead(i) ;
    pinMode (i, INPUT) ;
  }
}

void powerUpStepper ()
{
  for (byte i = 4 ; i <= 7 ; i++) 
  {
    pinMode (i, OUTPUT) ;
    digitalWrite (i, (state & 0x8) == 0x8) ;
    state <<= 1 ;
  } 
}
1 Like

Hello.
And thanks for help me on this... :slight_smile:

Just need to copy and paste in the end of the file?
Or has to be in a specific place?

Sorry to ask but this is all new to me...

And sorry to bother...
But can you please explain what pins is in use?
I like to understand.. Not just have things without trying to know...

The motor still is very hot...
Turn on..

Make 10 turns and stops...
Even after 30minutes in pause.. Still very hot... round 49/53ºC..

This temperature starts to soften PLA....

:confused:

You could use a relay, or a transistor, to make/break the 5V connection to the motor card.

Or you could try this - when you are done winding, make D4 to D7 low, that will turn off the coil drivers, so no motor current flows and the motor doesn't heat up.

I really appreciate your help ..

But I don't know how to program for Arduino ..

I have a little knowledge of electricity and little more than that ..

Programming I never did and I don't know how to do...

lc1975:
Hello.
And thanks for help me on this... :slight_smile:

Just need to copy and paste in the end of the file?
Or has to be in a specific place?

Sorry to ask but this is all new to me...

Definitions can go where you like with Arduino, but you put the calls to the functions in the correct places.
The functions are named logically so you can understand how to use them.

But can you please explain what pins is in use?

The ones you told us in your initial post...