Fishing Rod Controller

by DoritoKattie in Circuits > Arduino

107 Views, 0 Favorites, 0 Comments

Fishing Rod Controller

WhatsApp Image 2023-10-30 at 01.20.21.jpeg

I wanted to make a fishing game inspired by the fishing mechanic from Stardew Valley. In this project you will also be making a controller for this fishing game.

Supplies

For this project you will need the following things:

  • An arduino + cable
  • A potentiometer
  • 4 jumper wires
  • 1 on off switch
  • 1 10k resistor
  • 1 prototype board
  • laser cutter
  • solder kit
  • Access to a laser cutter
  • glue gun
  • wood glue
  • cardboard
  • paper
  • wooden stick
  • A 120 mm x 1200 mm plate of MDF
  • 2 small hinges and 1 latch hook hasp (I took mine from a small jewelry box)
  • Metal thread
  • 1 twist cap
  • Some thread

Experimental Phase

WhatsApp Image 2023-10-29 at 20.58.29.jpeg

My first concept that I wanted to make was timer a sort of timer that would go down if you lay your phone on a pressure sensor. But if you take your phone after a few seconds the timer would go up again. So I wanted to try to make this.

When I wanted to use the seven segment display it didn't show some of the numbers correctly( I followed this instruct able: https://www.instructables.com/Using-a-4-digit-7-segment-display-with-arduino/)

I tried to fix this but it was confusing and I wanted to make something that used less ports in the Arduino.

After that I came up with the idea that I wanted to make a fishing game with a self made controller inspired by the fishing mechanic/fishing minigame in Stardew Valley.

Building a Prototype Controller

Schermafbeelding 2023-10-29 225131.png
WhatsApp Image 2023-10-29 at 20.58.29(1).jpeg

In the attached pictures you can see how I connected all the parts together. You can try to clone this. With the code below you can try to test it to see if you can get it to work properly. If you want you can also add or remove things to design your own controller.


Arduino Code

To make sure that the arduino can communicate with our game we need to write some code. This is the code I used:

const int buttonPin = 2; //Different names for things(for the readability of the code)
const int spinPin = A0;

//Geheugen van je programma
float potentiometerState = 0;
int buttonState = 0;

void setup(){ //Gets executed once at the start by the arduino
  //We tell the arduino how we want to use our pins(wires)
  pinMode(spinPin, INPUT);
  pinMode(buttonPin, INPUT);

  //We connect the arduino with the computer
  Serial.begin(19200);
}

void loop(){ //The arduino will repeatedly execute this function for us
 
  buttonState = digitalRead(buttonPin); //Looks at the value of the buttonPin (at the top of the script it says what the button pin is) and saves this in buttonState
  //The button is in a digital input, so we also read it digitally
 
  potentiometerState = analogRead(spinPin); //Looks at the value of spinPin (at the top of the script it says what the spin pin is) and saves this in the potentiometerState
  //The potentiometer is in an analog input, so we also read it analogously
 
  potentiometerState = potentiometerState / 1023.0f; //Change it to a number from 0 to 1 instead of 0 to 1023 (make it a percentage)
 
  Serial.print(buttonState); //Send the button state to the computer
  Serial.print("/"); //Send the '/' to the computer
  Serial.println(potentiometerState); //send the potentiometer value to the computer followed by an enter
}



Soldering

Schermafbeelding 2023-10-30 003718.png
WhatsApp Image 2023-10-29 at 20.58.15.jpeg
WhatsApp Image 2023-10-29 at 20.58.10.jpeg
WhatsApp Image 2023-10-29 at 20.58.07.jpeg

Now that we know that our circuit works we can solder the parts together permanently. Because we no longer use a breadboard we can simplify the circuit as seen in the pictures above.

It was very hard to solder the jumper wires. I recommend to trim the wires so you don't solder to the anti-oxidizing jumper ends.

You can see a case in the picture above. I forgot to take a picture of the things I soldered and I already put them in the case so I had to take those pictures afterwards.

Measuring

WhatsApp Image 2023-10-29 at 23.43.15(1).jpeg
WhatsApp Image 2023-10-29 at 23.56.17.jpeg
WhatsApp Image 2023-10-29 at 23.43.15.jpeg
WhatsApp Image 2023-10-29 at 23.43.47.jpeg
WhatsApp Image 2023-10-29 at 23.43.14.jpeg

To figure out how I want to make my case, I made a cardboard prototype. This made it a little easier for me to figure out what the correct measurements would be for my controller casing. I wrote the measurements down on paper and I numbered every element(also on the cardboard prototype so it would be easier to know which component is what and where I needed to make a few holes for the potentiometer, wooden stick, on off switch and the cable that connects the arduino to the computer). After that I could use the laser cutter to cut out the elements.

Assembling

WhatsApp Image 2023-10-29 at 20.57.54.jpeg
WhatsApp Image 2023-10-30 at 00.08.39.jpeg

After cutting out all the elements I can start gluing all the parts together. I used wood glue for this step. I put my soldered parts into the case during the gluing process, because I wouldn't be able to put it in afterwards I finished gluing my case. Lastly I made a door with the hinges and latch hook hasp so I can take the arduino out if I wanted to.

Making a Game(optional)

To use the controller, I made a game in Unity. It is based on the fishing mechanic/fishing mini game from Stardew Valley. You see a bar with a fish and the fish moves from top to bottom. As the player you can move a square from top to bottom. The fish needs to be in this square long enough to catch the fish(another bar will fill up. If this bar is full you can catch the fish). The square can move if you spin the potentiometer and you can catch the fish with the on off switch.

If you want to try out your new controller you can download my game from the google drive: https://drive.google.com/file/d/1KNwptDa_gFsqx69RNsKzhYxWZtPSg2bi/view?usp=sharing

If you want to know how it works or make your own you can find the source code at: https://github.com/Kaassliertje/SplashySuccess

Decorating the Controller

WhatsApp Image 2023-10-30 at 01.20.21.jpeg

As a final step we decorate the controller. I decorated mine with a wooden stick, some metal wire, some fabric thread and a twist cap. I sawed the wooden stick and I glued one end on the bottom of the case(on the bottom of the case there is a hole and I put the stick through the hole and I glued it with hot glue). With this stick you can hold the controller up like a fishing rod. I glued the other end of the stick on the case(there was also a hole on the top side of the case, so I put the stick through the hole and I used hot glue to let it stick)and I made a fishing line and hook with the metal wire and fabric thread and attached it with metal wire on the stick. Lastly I glued the twist cap on the spinning end of the potentiometer.

Enjoying Our Work

Now we are finished with the controller. We can try it out and enjoy what we made. Here you can see a video of me playing my fishing game.






Conclusion

This project was a success. This project was a success because I created a working controller and I also learned a lot. I learned how to solder and I now have a better understanding of how to program and what I am doing.

What I would like to add in the future are different types of fish that are easier and harder to catch and based on this you will get more or less points added to your score.