Using Arduino to control cordless screwdriver

Hi. I want to use a Arduino to control a cordless screwdriver, and hence drive a fishing reel. This is to assist a disabled person who wants to try fishing but is unable to turn a reel for prolonged periods. What is needed is a controllable motor which will retrieve a lure/small fish bait in a manner that resembles a dying fish - like an able bodied person would use soft plastics. I have coded some realistic (I think, though the fish might think otherwise), infinitely variable retrieval algorithms relying heavily on the C language function rand(). Now I need to find a robust, inexpensive and easy to use source of power. A local hardware store has simple rechargeable cordless screwdrivers which could be used with no modification, and less then $20 each. I want to use one and have the Arduino feed it power according to my algorithm, so it drives the reel, varying pauses and fast and slow movements etc. maybe some controls to change the algorithm or speed up/slow down might come later, as everyone will have their own idea of what will work.

I know it would be better if I could describe the switch mechanism in the screwdriver but I don’t own one at present. I’m hoping they are all pretty simple and well understood.

I should also point out that I’m not focused on or involved in the fishing side - just the provision of a source of power.

Cheers and thanks
I will try to attach a photo of a typical el cheapo cordless screwdriver in the post below.

My knowledge of C coding is good but my knowledge of electronics is very basic. Can anyone suggest how I would go about connecting these 2 devices. I imagine an Arduino nano in a small box, cable tied to the screwdriver, sending out highly variable pulses to the screwdriver and the screwdriver doing it’s own thing under its own power.

Electrically it's not difficult. I recommend a basic arduino like the nano you suggested and a DC motor driver. You'll need the H-Bridge type of driver to run the motor in both directions. Don't try to build your own driver out of FETs. It's not worth the time and just leads to frustration. You'll need to figure out the motor current at full load (need an ammeter) to decide how to size the motor driver, but in any case they are usually just a few bucks and are relatively small (a 40A H-bridge driver is under 2" square and most are smaller than that).

The nano, motor driver, battery and perhaps a few pushbuttons or switches for control can easily fit into a small case that can be attached to the screwdriver.

1 Like

If it's just an off/on switch and the voltage is less than 30V and the current is less than 4A, then the circuit below will work

Thanks for the responses guys. I have a couple of questions.
Cedarlake- why bidirectional ? I imagined it would only need to retrieve.
And Jim, I take it Dn means any digital pin, is that right?

Be sure to take this person fishing and give the setup a very good test, best to do it on several trips to be sure it is ok. If you are lucky you will wind up with a free meal.

An Idea, if the screw driver has a variable speed trigger you might be able to use it without modification but Direction could be controlled with a simple DPDT switch. Reversing the motor polarity reverses the motor.

Yes

OK, then unidirectional is fine and the circuit that @jim-p posted will work. I assumed that you'd want to retrieve as well as reel out, but guess doing that under power would lead to tangles.

Ok, I researched the TLP3553a and learnt that it’s a solid state relay. I assume Jim chose this component over, for example, the simple mechanical relays that come with typical Arduino starter packs because of greater reliability, service life and switching speed?

That’s all good, we don’t want the device failing in the field. I’ve ordered a couple. Until they arrive, can I use the HW-482 relay that came with my starter pack?

I managed to overcome my newbie resistance to plugging things in when I don’t know what’s going to happen and gave the mechanical relay a try and it worked very well. I used a 9 volt battery and an LED (and resister and power supply) to demonstrate it was working. The only concern I was left with was whether the screwdriver would be responsive enough to turn some of the staccato pulses (dying fish doing it’s final twitches) into movement. So thanks all for your help.

One final point. I’m using the C language rand() function with module division to get me random variations within a small range. Ie
Movements = (rand() % 10) + 1
For 0 to 10 movements
But the result seems to be biased towards the lower numbers of the range. Is this a known thing?

Ok. I built this in prototype form and it works well, or we’ll enough. I just drilled holes in the electric screwdrivers casing and soldered two leads from the relay to the switch.

The major limitation is that the cordless screwdriver I purchased doesn’t have very crisp response. Shut off the power and it continues to rotate for a bit which kind of ruins the dying fish twitching effect. I guess I shouldn’t have expected a cheap tool which cost the equivalent of $14US to be precise. At least I know from experience they are robust and long lasting.

Anyway, thinking about power. Obviously I’m using the screwdriver’s internal 3.7 volt li-ion battery to power the retrieve, but can I use the same battery to power the Arduino Uno at the same time? It would obviously help to reduce bulk. Perhaps just take another couple of leads off the battery or the switch and fix them to vin and ground on the Arduino?

The battery has written on it 3.7 volts 1500mah, 5.85wh.

Also, any reason why I can’t swap it out for a 3200ah battery of the same type?

Cheers

The hardest part of the battery switch is getting the new battery, other then all should be fine.

No but you need to check if it is a protected or un-protected battery.
If it has more than two wires comming out, then I recommend not to try to replace it

Makes me wonder if you have ever used an electric tool that started and stopped rotating immediately then operating the trigger switch.

Better ones do.
My Makita drill/driver stops immediately. There is an audible clunk which I assume is a brake snapping into place. It’s quite a bit more expensive though.
Nowadays most tools like circular saws are designed to stop immediately for obvious safety reasons.

Thanks. That is interesting. Have not bought a new power tool in ages. Guess the lawyers won the contest.
New thought: Wonder if new soldering irons get cold immediately after use?

So what are your plans for moving forward?

I was surprised by the comment myself. All of my power screwdrivers/drills/impact wrenches stop the instant I release the trigger.

What are you talking about?

The OP said of the same type, except a different capacity.

So it's we hope a 3.7 volt cell, out of which come two wires whether it is "protected" or not.

@thebackwardpointinggodwit just to be sure, post a link or photo of the 3.7 volts 1500mah, 5.85wh unit and a link to the larger capacity one you want to use in its stead.

What is the means of charging either?

Please post your code here for we take a look. The random number function shoukd not be biased, but you can bias it. Although it is doubtful, you may have done inadvertently.

a7

Put the components in a jiffy box, fix a socket to a fishing reel, test it a bit, then give it back to the people who requested it.

I doubt it will ever get used, but I just wanted to do my bit as asked.

For the reel, it’s just a matter of epoxying a hex key socket to the flat-headed nut that holds the handle on. The screwdriver is connected to that via Flexi drive so it can lie neatly along the rod and the Flexi does a 90 degree turn to drive the reel. All connecting via 6mm hex shaft/socket so easy plug and play.

Testing it will be interesting. It’s actually illegal here (NSW, Australia) to use an electric fishing reel without a permit which requires a medical certificate. I don’t mind testing it a bit but not something I would make a habit out of as the fisheries enforcement staff won’t like it.

I do drone fishing so I can drop a bait up to 400 meters offshore, put the rod in a beach spike, and then let this device wind back in.

Once I’ve used it I will know whether the 1500mah battery is sufficient or not. I’ll upgrade if need be.

I may modify the code to allow the user to do the retrieve faster or slower if they want - let the user mix it up a bit. Also do a straight level wind. Control via buttons on the jiffy box.

Here’s the code. I may modify this to allow the user to slow things down or speed them up, and perhaps do a straight level wind. Or I may prefer to make no changes and keep it simple. We’ll see what the fish think.

Also, I did cases 4 and 5 as separate cases as a way of removing the rand() function’s possible bias towards low numbers - there was too much of the lower number cases and thus too much pausing and long steady pulls and not enough twitching.


// fishing retrieve
// random dying fish pattern
// ADavies 14/01/2024

const int relayPin = 2;
const int debugOn = 0;       // set to 1 for serial printouts
const int separation = 300;  // short delay to separate actions
const int twitch = 300;      // length of each twitch in dying fish movement

void setup() {
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);
  if (debugOn) Serial.begin(9600);
}

void loop() {
  int moveType = 0;
  long elapsedMillisecs = 0;
  int iterations = 0;

  // work out what type of movement it is, pause, long pull etc
  moveType = rand() % 6;

  if (debugOn) Serial.println(moveType);

  // according to the type of movement, work out how long the movement
  // lasts and how many iterations of the movement there will be
  switch (moveType) {
    case 0:  // long pause
      {
        elapsedMillisecs = ((rand() % 14) + 4) * 1000;
        retrieve(elapsedMillisecs, 1, 0);
        break;
      }
    case 1:  // short pause
      {
        elapsedMillisecs = ((rand() % 7) + 1) * 1000;
        retrieve(elapsedMillisecs, 1, 0);
        break;
      }
    case 2:  // long pull
      {
        elapsedMillisecs = ((rand() % 7) + 2) * 1000;
        retrieve(elapsedMillisecs, 1, 1);
        break;
      }
    case 3:  // short pull
      {
        elapsedMillisecs = ((rand() % 2) + 1) * 1000;
        iterations = (rand() % 3) + 1;
        retrieve(elapsedMillisecs, iterations, 1);
        break;
      }
    case 4:  // short staccato twitching
      {
        iterations = (rand() % 4) + 1;
        retrieve(twitch, iterations, 1);
      }
    case 5:  // long staccato twitching
      {
        iterations = (rand() % 11) + 4;
        retrieve(twitch, iterations, 1);
      }
  }
}  // ****  end of loop() ****


void retrieve(int elapMilliSecs, int iterations, int doMovement) {
  // this function does the retrieve
  if (debugOn) Serial.println(String(elapMilliSecs) + " " + String(iterations) + " " + String(doMovement));

  for (int i = 0; i < iterations; i++) {
    // doMovement of 0 is a pause so doesnt set the pin high
    // any other value is a movement of elapMilliSecs long
    if (doMovement) digitalWrite(relayPin, HIGH);
    delay(elapMilliSecs);
    digitalWrite(relayPin, LOW);
    delay(separation);
  }
}