Pickup Winder V2

by tinyboatproductions in Living > Music

6575 Views, 21 Favorites, 0 Comments

Pickup Winder V2

3202E6C8-56F9-4E16-9DA2-444BF64D16D1.jpeg
Pickup Winder V2

Hello again, if you are here I assume its because you saw the first video or instructable I made on building a DIY pickup winder for about 37 dollars. Today, I am taking a look at version 2. (If you haven’t seen or read about version one check it out first, I assume a lot of knowledge in this one)

There are 2 main things I am changing. First, the Arduino Uno for an Arduino Nano. Second change is the mosfet stuff. I’ll get into why in a bit.

The goal was to reduce cost, add functionality, and improve the easy of assembly. And I hit all the targets.

So lets get into it.

Supplies

Here is the part list for V2. I have tried to break down the tools list into “Need” as in I think you can’t do this project with out them and “Nice to have” or you can make it work without them but its better with.

If you have some of these parts already go ahead and use them. I did choose to buy several kits of parts, this means that you’ll have parts left over, which you can use to build more, or to use for other projects. If that's not your jam, take a look around, I was able to find singles of several parts that cost only a bit more. Or check out your local electronics store as they likely sell smaller quantities.

The total cost each comes to just about $31, cutting off $6 from V1.

Disclaimer on the prices, because of *gestures vaguely at the supply chain*. The costs are from July 2022. I can’t say the prices will stay the same.

None of the links are affiliate.

Parts

Tools

Need:

  • 3D printer (I used an Ender 3 V2) or access to one
  • Wire strippers/Cutters
  • Allen keys
  • Screw driver
  • Soldering Iron
  • Multi-Meter

Nice to have:

  • Wire crimper
  • Helping hands
  • Bread board
  • Sand paper

What Gives About V1?

You might why I want to change make changes when V1 works. Well, there are two main reasons to make changes, cost, and functionality. I wanted to target both of those. There are a few components that can be eliminated from V1 as well as some cost saving that comes with that. Also, adding some different components means that I can add more functionality.

So lets take a look at the changes, first the Arduino Uno. It’s out, it is a powerhouse for prototyping but the full board is uncessicary for this project. I had initially planned to use the barrel jack on the arduino until I ran into power issues; the on board pins can only provide about half the current the motor wanted, so I didn’t end up using it. I am replacing it with an arduino Nano, which has most of the functionality of the Uno while being significantly cheaper and smaller.

The second change is the mosfet stuff. I don’t like it... Also, it requires a bunch of random components, like a diode and mosfet, which really impacted the cost. I decided to use an H-Bridge. It’s a pre-build driver board for dc motors. It allows control of 2 motors at the same time, and enables forward and reverse of each. And they cost like 3 dollars each. This enables me to add a 3 state switch so that I can run the motor forward and backward (that functionality part comin’ around too). I don't know how useful this is practically for pickup winding but who am I? Some guy on the internet who decided they know how to wind pickups.

Case

I designed/modified the case from V1 to suit V2. Mainly this consisted of adding mounting bases for the H-Bridge and protoboard I am using. It’s here.

If you have V1 you only need to replace the base. You’ll also need to increase the side of the hole for the switch in the front as the new one is a tad bigger. I just used my drill.

I printed this out of PETG but there is no reason PLA would not work.

Build the Circuit

dual resistor.png
C1F04D02-38A4-4743-A566-3C78C5776929.jpeg
B94CE040-6182-4C51-81EC-C4552B32053E.jpeg
86A85B0F-54D5-4241-A308-6A33311FAE2A.jpeg
8E88EF8D-7BD9-4633-B53A-79B49A561802.jpeg
C6342BA2-7B3C-4B00-9DB3-656320802DCF.png

This step really feels like “Draw the rest of the owl” but I think the circuit this time around is a bit easier to follow.

I have attached a diagram of the circuit to look at and I hope it makes sense.

But a lot of it is the same, with a few changes. The major change is that I am building all of this into a protoboard rather than a bread board. This just makes the circuit more solid, I don’t have to worry about wires coming loose.

I did learn a few tricks while doing this so I figured I would leave them here for you.

  • I would recommend cutting the protoboard before soldering as I found it kind of a pain after but either way is fine.
  • To cut the wires
  • strip one end
  • bend that end, and place it where it goes
  • Cut off the wire, one hole past where it needs to go
  • Mark the insulation just before the hole it will go in
  • Strip the wire there and bend the lead
  • Solder it in place
  • The board I have has long traces running the length of it. To separate sections of the board use an knife and a ruler to cut the copper. Then verify they are separated using a multimeter.

To connect the components I soldered in male headers to the board. I could then add female headers to the components to make it easy to trouble shoot or make changes. This was super useful, but if you don’t have it or don’t care to, skip it, solder ‘em straight in.

For the switch, I only connected one set of the poles, so one side. The top I connected to D4, the middle to Ground, and the bottom one to D5. D4 and D5 can be swapped as they will just change the direction the motor turns.

One other note before moving on. The H-bridge can intake 12v and make a 5v line available to other components. This is what I am using to power the Nano. Just make sure to also connect the ground from the Nano back to the ground on the H-bridge

Code

Here is the full code for this version. There are a few changes that allow this version to work.

First off, the H-Bridge takes 3 wires from the Nano to run. It needs IN3, IN4, and ENB (if you use motor A you will use the other three, IN1, IN2, and ENA). To make the motor run in one direction IN3 needs to be HIGH, IN4 needs to be LOW and you need to send a PWM signal to the ENB pin. To run in the opposite direction IN3 needs to be LOW, and IN4 needs to be HIGH. This code takes care of that.

Because of that, the extra pins, I can no longer control the motor by simply cutting power to it. So, I also added code to check the state of the switch and that tells the motor what direction to go (pulling IN3 and IN4 HIGH and LOW accordingly).

As the motor can now run in revers the code also handles subtracting counts as well.

Once the cirucit is built, upload the code and you should be ready to go.

/*
 * Written by Tiny Boat Productions, 2022
 * DIY Pick up winder version 2
 * 
 * Referance Documents
 * Potentiometer: https://docs.arduino.cc/learn/electronics/potentiometer-basics
 * DC Motor: https://www.tutorialspoint.com/arduino/arduino_dc_motor.htm
 * Reed Switch: https://create.arduino.cc/projecthub/muchika/reed-switch-with-arduino-81f6d2
 * I2C LCD: https://create.arduino.cc/projecthub/Arnov_Sharma_makes/lcd-i2c-tutorial-664e5a
 * Debounce: https://www.arduino.cc/en/Tutorial/BuiltInExamples/Debounce
 * H-Bridge: https://hackerstore.nl/PDFs/Tutorial298.pdf
 * 
 */


#include "Wire.h"
#include "LiquidCrystal_I2C.h" // v1.1.2


const int DEBUG_PORT = 9600;
const unsigned long DEBOUNCE_DELAY = 20;
const int LCD_COLUMNS = 16;

//Pin declarations
const int MOTOR_PIN = 9; //motor pin
const int POT_PIN = A0;  //pot switch pin
const int REED_PIN = 3;  //reed switch pin
const int CW_PIN = 5;    //clockwise pin
const int CCW_PIN = 4;
const int IN3_PIN = 12;  
const int IN4_PIN = 11;

LiquidCrystal_I2C lcd(0x27,20,4); //LCD setup

//Inital Values
int potVal;     //reading from the potentiometer
int lastPotVal = 0;
int motorSpeed;
int turnCount = 0;      //revoultion count
bool runState = false;           //run state
bool lastRunState = false;
unsigned long lastDebounceTime = 0;
int turnsSinceUpdate = 0;
int lastUpdateTime = 0;
int currentRPM = 0;
int lastPercent = 0;
int motorPercent = 0;


void handleReedUpdate() {
  int currentTime = millis();

  if (currentTime - lastDebounceTime > DEBOUNCE_DELAY) {
    turnsSinceUpdate++;
    currentRPM = 60 / (currentTime - lastUpdateTime);
    lastUpdateTime = currentTime;
  }
  lastDebounceTime = currentTime;
}


void setup() {
  //set up motor and reed switch pins
  pinMode(MOTOR_PIN, OUTPUT);
  pinMode(REED_PIN, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(REED_PIN), handleReedUpdate, FALLING);
  pinMode(CW_PIN, INPUT_PULLUP);
  pinMode(CCW_PIN, INPUT_PULLUP);
  pinMode(IN3_PIN, OUTPUT);
  pinMode(IN4_PIN, OUTPUT);

  Serial.begin(DEBUG_PORT);

  //set up the lcd
  lcd.init();
  lcd.backlight();    //turn on the backlight
  lcd.setCursor(0,0); //set the cursor in the uper left corner
  lcd.print("Pickup winder");
  lcd.setCursor(0,1); //set the cursor at the start of the second line
  lcd.print("By: Tiny Boat");
  delay(1500);
  
  while (analogRead(POT_PIN) > 5){ //Make sure the motor is at low speed before starting it
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Turn pot CCW");
    delay(500);
  }
  
  while(digitalRead(REED_PIN) == 0){ //Ensure you dont start on the magnet so the count is accurate
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Turn winding wheel 1/4 turn");
    delay(500);
    turnCount = 0;
  }


  while(digitalRead(CW_PIN) == 0 || digitalRead(CCW_PIN) == 0){ //Ensure the switch is in the off position
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Flip switch to");
    lcd.setCursor(0,1);
    lcd.print("off position");
    delay(500);
  }


    lcd.clear();
    lcd.print("Speed:  Count:");
    lcd.setCursor(0, 1);
    lcd.print("0");
}


void loop() {
  // put your main code here, to run repeatedly:
  potVal = analogRead(POT_PIN);
  if(digitalRead(CW_PIN) == 0){
    lastRunState = runState;
    runState = true;
    digitalWrite(IN3_PIN, HIGH);
    digitalWrite(IN4_PIN, LOW);
  } else if (digitalRead(CCW_PIN) == 0){
    lastRunState = runState;
    runState = true;
    digitalWrite(IN3_PIN, LOW);
    digitalWrite(IN4_PIN, HIGH);
  } else {
    lastRunState = runState;
    runState = false;
  }


  //set the motor speed var
  if (!runState){
    motorSpeed = 0;
  } else if ((potVal != lastPotVal || runState != lastRunState) && runState) { //if the motor speed or the run state has ch/anged, and the motor is not off
    motorSpeed = potVal / 4;
    lastPotVal = potVal;    
  }


  //set the motor speed pwm
  analogWrite(MOTOR_PIN, motorSpeed);


  //update the screen
  motorPercent = (motorSpeed*100)/255;
  if (motorPercent != lastPercent){
    //if( motorSpeed >= lastSpeed*0.01)||(motorSpeed <= lastSpeed*0.01){
      lcd.setCursor(0, 1);
      lcd.print("        ");
      lcd.setCursor(0, 1);
      lcd.print( motorPercent);
      lastPercent = motorPercent;
    //}
  }
  
  if (turnsSinceUpdate > 0) {
    if(digitalRead(CCW_PIN) == 0){
      turnCount += turnsSinceUpdate;
    } else {
      turnCount -= turnsSinceUpdate;
    }
    
    turnsSinceUpdate = 0;


    lcd.setCursor(LCD_COLUMNS / 2, 1);
    lcd.print(turnCount);
  }


  Serial.print("Motor speed: ");
  Serial.print(motorSpeed);
  Serial.print(",Count: ");
  Serial.print(turnCount);
  Serial.print(",run state: ");
  Serial.println(runState);
}

Assembly

1CC7E710-7FC0-4321-AA03-5638AC3A3F94.jpeg

With everything programmed and wired, its time to put it all together.

To hold the screen in place use some M2 screws. I also used M2 screws to hold the barrel jack in place. For the motor mount put the M2 screws thought the top piece and then through the mount, and add 2 nuts tighten against each other on the bottom. I then used some more M2 screws to hold the mount in place.

The final M2 screws goes into the shaft of the pickup holder to hold it onto the motor.

To hold the magnet and reed switch in place I used E6000, but I would recommend using hot glue.

To hold the potentiometer and switch in place I used their provided hardware. For the potentiometer I had to remove the locating tab with pliers. For the switch I just left of the ring with the tab.

I used 2 of the 4 available holes to mount the H-bridge using M3 screws.

Finally, I used 2 M3 screws with washers to hold the cirucit board in place. I placed the board on the bosses and then used the washer to clamp on top of the board.

Then we can make any final wiring connections and attach the base using 4 M3 screws.

Note here that pretty much anything from about 5mm to 15mm will work for length on almost all of these. I didn’t keep track of what length I used where.

Test It Out

Now, with everything together, give it a test. If you want to build a pickup and know what you are doing go ahead. If you want to read about how I make one check out step 7 from the V1 Instructable. Otherwise once you know it works, use it.

Final Thoughts

I am pretty happy with how this turned out. I think it has several improvements over version one, not limited to cost but also it is easier to build.

If you made this post a make, if you think its cool like it, if you have a question ask away.

If you post your build on instagram tag me @TinyBoatProductions, I love seeing people build these projects.

That’s all for now, thanks for reading!