Hello, I'm trying to make a lock for my sand blasting cabinet, and already have an old linear gear rack with a DC motor attached, and would prefer that cool old mech vs using a servo.
The needs are modest.
press a button, motor runs one direction for X amount of time, press it again, it runs the other direction for X amount of time.
The diagram below is 90% what I need, My hang-up is adding the on time code to get the desired effect. Don't have much, but I can offer a few dollars for anyone that wants to help.
Oh, I did not realize there was a coder for hire section.
Correct, I can kludge around a bit, But im better with vacuum tubes.
Since you were kind enough to reply swiftly, Id like to hire you (if you are willing) I have a few other projects I will likely need some work on.
Thanks Larry, Not my pic, but my test circuit will share grounds.
Are you sure that the ancient L298 motor driver will safely power your motor. The L298 output drops 2V to over 4V of the motor power supply and dissipates that power as heat. So the more current the less voltage gets to the motor. The L298 can supply up to 2A (they say), is the motor stall current less tban 2A?
// If button is pressed - change rotation direction
if (pressed == true && rotDirection == 0)
{
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
rotDirection = 1;
// Run motor for 2 seconds
delay(2000);
// Turn off
digitalWrite(in1, LOW;
}
Do the same for both directions and that should do the trick!
Not OP, but that code took me approximately 1 minute to write. It would take a lot more than that to find an NE555, calculate the required resistor/capacitor values, see if I have them and order if not and finally solder everything together.
Then we have to figure out the direction changing logic. Probably need an NE556 or another 555.
Or use a $2 arduino nano clone and do all that in less than 5 minutes. We're building qty 1, not 10,000.