Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano-Based Tractor Brake and Clutch Control System with BTS7960 Motor Drivers

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Tractor Brake and Clutch Control System with BTS7960 Motor Drivers

Circuit Documentation

Summary

This circuit is designed to control the brake and clutch of a tractor using linear actuators. The system reads values from force-sensing resistors (FSRs) and rotary potentiometers to control the actuators via BTS7960 motor drivers. When the FSR values exceed a predefined threshold, the actuators are activated to reduce the force needed to push the pedals.

Component List

  1. LMA

    • Pins: +, -
    • Description: Linear Motor Actuator
    • Purpose: Actuates the brake and clutch pedals.
  2. POWER SUPPLY 12V 5AMP

    • Pins: 220V Positive Pole (AC), 220V Negative Pole (AC), GND, GND (DC), 12V-24V Output (DC)
    • Description: Power supply unit
    • Purpose: Provides power to the circuit.
  3. BTS7960 Motor Driver

    • Pins: Pin 1, Pin 2, Pin 3, Pin 4, Pin 5, Pin 6, Pin 7, Pin 8, Pin 9, Pin 10, Pin 11, Pin 12
    • Description: Motor driver
    • Purpose: Controls the linear actuators.
  4. Rotary Potentiometer

    • Pins: leg1, wiper, leg2
    • Description: Variable resistor
    • Purpose: Reads the position of the brake and clutch pedals.
    • Properties: Resistance: 10000 Ohms
  5. XL4015 5A DC Buck Step-down

    • Pins: Output +, Output -, Input +, Input -
    • Description: DC-DC converter
    • Purpose: Steps down the voltage from the power supply.
  6. LM358 Op-Amp

    • Pins: 8, 1, 2, 3, 4, 5, 6, 7
    • Description: Operational amplifier
    • Purpose: Amplifies the signals from the FSRs.
  7. Arduino Nano

    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
    • Description: Microcontroller
    • Purpose: Reads sensor values and controls the motor drivers.
  8. Force Sensing Resistor

    • Pins: pin 0, pin 1
    • Description: Force sensor
    • Purpose: Measures the force applied to the brake and clutch pedals.
  9. Resistor

    • Pins: pin1, pin2
    • Description: Fixed resistor
    • Purpose: Used in voltage divider circuits.
    • Properties: Resistance: 10000 Ohms

Wiring Details

LMA

POWER SUPPLY 12V 5AMP

BTS7960 Motor Driver

Rotary Potentiometer

XL4015 5A DC Buck Step-down

LM358 Op-Amp

Arduino Nano

Force Sensing Resistor

Resistor

Code Documentation

/*
 * Tractor Brake and Clutch Control
 * This code reads values from FSRs and potentiometers to control linear actuators
 * via BTS7960 motor drivers. When FSR values exceed a threshold, the actuators
 * are activated to reduce the force needed to push the pedals.
 */

// Pin definitions
const int fsrBrake1Pin = A6;
const int fsrBrake2Pin = A7;
const int fsrClutchPin = A5;
const int potBrake1Pin = A0;
const int potBrake2Pin = A1;
const int potClutchPin = A2;

const int brake1ControlPin1 = 3;
const int brake1ControlPin2 = 5;
const int brake2ControlPin1 = 6;
const int brake2ControlPin2 = 9;
const int clutchControlPin1 = 10;
const int clutchControlPin2 = 11;

const int threshold = 500; // FSR threshold

void setup() {
  // Initialize serial communication
  Serial.begin(9600);

  // Set control pins as outputs
  pinMode(brake1ControlPin1, OUTPUT);
  pinMode(brake1ControlPin2, OUTPUT);
  pinMode(brake2ControlPin1, OUTPUT);
  pinMode(brake2ControlPin2, OUTPUT);
  pinMode(clutchControlPin1, OUTPUT);
  pinMode(clutchControlPin2, OUTPUT);
}

void loop() {
  // Read FSR values
  int fsrBrake1Value = analogRead(fsrBrake1Pin);
  int fsrBrake2Value = analogRead(fsrBrake2Pin);
  int fsrClutchValue = analogRead(fsrClutchPin);

  // Read potentiometer values
  int potBrake1Value = analogRead(potBrake1Pin);
  int potBrake