Waldo Cervantes
Published

Arduino Fishing Rod Project

Senor controlled DC motor with relay power switch for clutch actuator, via Photon control.

IntermediateProtip20 hours3,459
Arduino Fishing Rod Project

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
4-Channel 5V Relay Module With Optocoupler For Arduino
×1
Adafruit IR reflectance sensor
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Photon
Particle Photon
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1
Jumper wires (generic)
Jumper wires (generic)
×1
12V AC to DC power supply
×1

Story

Read more

Custom parts and enclosures

Self casting fishing rod

This is the device with the components before they are all attached and wired.

bread board setup

This is the wiring for the sensor, motor, particle photon, dc motor, resistor and AC to DC wall power supply (12V 4amp)

Schematics

bread board

this is the wiring for the dc motor, ir sensor, particle photon, resistor, relay and AC to DC power supply

Code

IRsenor

Arduino
The code is for a reflectance sensor that is used to calculate the rotations of the the flywheel on our design once the wanted rotations have have been meet the relay switched is actuated to redirect power to a different component, which is the magnetic clutch. All this is used to run a self casting fishing rod.
// This #include statement was automatically added by the Particle IDE.
#include "lib1.h"

// This #include statement was automatically added by the Particle IDE.
#include "Arduino/Arduino.h"

/*
  DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor

 */

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;
unsigned long int duration=0;
int relayPin= 5;
int relayPin2=4;
int buttonState = 64000000;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 115200 bits per second:
  Serial.begin(115200);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT_PULLUP);
pinMode(relayPin,OUTPUT);
pinMode(relayPin2,OUTPUT);
  digitalWrite(relayPin,LOW);
  digitalWrite(relayPin2,HIGH);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
   //buttonState =(duration) ;

    
  // print out the state of the button:
    duration = pulseIn(pushButton, HIGH);
    Serial.println("    RPM ");
  //Serial.println(buttonState);
    Serial.print(duration);
    
  //i want the pin5 to turn off once my vaule on the serial monitor reads >2000 which pin 2 is the ir-reflectance sensor that is counting:
  if ((duration < 25000) && (duration > 0)){ 
    digitalWrite(relayPin2,LOW);
    digitalWrite(relayPin,HIGH);
    delay(5000);
    while(1);
    }
    

 //while(1);        // delay in between reads for stability
  


}

Credits

Waldo Cervantes

Waldo Cervantes

1 project • 0 followers

Comments