Welcome To the Hoffman Amplifiers Forum

September 07, 2025, 09:42:47 am
guest image
Welcome, Guest. Please login or register.
-User Name
-Password



Hoffman Amps Forum image Author Topic: Arduino test: Turning amp pots with a servo  (Read 9326 times)

0 Members and 1 Guest are viewing this topic.

Offline EL34

  • Administrator
  • Level 5
  • **********
  • Posts: 10407
  • wooot!
    • Hoffman Amplifiers
Hoffman Amps Forum image
Arduino test: Turning amp pots with a servo
« on: July 20, 2022, 03:03:45 pm »
I did a simple two button test just to see how much power it took to turn an amp pot

This tiny 180 degree servo had no problem turning a 1ma amp pot

Here's the Arduino code I wrote for this bench test

Code: [Select]

// Test: Servo turning an amp pot

#include <Servo.h> // include the Servo library
// Twelve servo objects can be created on most boards
Servo myServo;  // create servo object to control a servo

int position = 0; // variable to store the servo position

// constants won't change. They're used here to set pin numbers:
const int Button0 = 2;  // the number of the pushbutton pin
const int Button1 = 3;  // the number of the pushbutton pin
const int ledPin =  13; // The number of the Arduino LED pin

// variables for the push buttons
int ButtonState0 = 0;
int ButtonState1 = 0;

void setup()
{
  //Serial.begin(115200); // open a serial connection to your computer
  myServo.attach(9); // attaches the servo on Arduino pin 9 to the servo object
 
  pinMode(ledPin, OUTPUT); // initialize the Arduino LED pin as an output

  // initialize the push button pins as inputs
  pinMode(Button0, INPUT);
  pinMode(Button1, INPUT);

  myServo.write(position); // go to zero on start up
}

void loop()
{
  // read the state of the push buttons
  ButtonState0 = digitalRead(Button0);
  ButtonState1 = digitalRead(Button1);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (ButtonState0 == HIGH)
  {
    digitalWrite(ledPin, HIGH); // turn Arduino LED on
    myServo.write(10); // go to 10 degree
  }


  else if (ButtonState1 == HIGH)
  {
    digitalWrite(ledPin, HIGH); // turn Arduino LED on
    myServo.write(170); // go to 170 degree
  }


  else
  {
    digitalWrite(ledPin, LOW); // turn Arduino LED off
  }

}

And here 's the video with more info
It is 1440p


« Last Edit: July 20, 2022, 06:37:45 pm by EL34 »

Offline EL34

  • Administrator
  • Level 5
  • **********
  • Posts: 10407
  • wooot!
    • Hoffman Amplifiers
Hoffman Amps Forum image
Re: Arduino test: Turning amp pots with a servo
« Reply #1 on: July 31, 2022, 02:52:18 pm »
Arduino Servo Experiment #2

Setting up preset buttons to turn multiple servos to different positions.

I attached the Arduino code as a .txt text file -  Servo5.txt
Rename the file to .ino to load into the Arduino IDE - Servo5.ino

Filmed at 1440p HD

« Last Edit: July 31, 2022, 02:57:14 pm by EL34 »

Offline EL34

  • Administrator
  • Level 5
  • **********
  • Posts: 10407
  • wooot!
    • Hoffman Amplifiers
Hoffman Amps Forum image
Re: Arduino test: Turning amp pots with a servo
« Reply #2 on: July 31, 2022, 03:05:01 pm »
Here's how to do the multiple buttons and one data wire using a voltage divider circuit
Just add more buttons and more resistors
The resistors are all the same value
I am using 220 ohm 1/4 watt metal films in my test setup

The voltage drop reading will be different at each junction depending on how many switches you have
Those values are set in the Arduino code that I attached to the post above
« Last Edit: August 01, 2022, 08:27:04 am by EL34 »

Offline shooter

  • Level 5
  • *******
  • Posts: 11015
  • Karma Loves haters
Hoffman Amps Forum image
Re: Arduino test: Turning amp pots with a servo
« Reply #3 on: August 01, 2022, 03:09:33 am »
i use a 4 position DIP switch, feeding the Pic controller I use. 
If I can't get it with 16 combinations i'm over thinking it  :icon_biggrin:
Went Class C for efficiency

 


Choose a link from the
Hoffman Amplifiers parts catalog
Mobile Device
Catalog Link
Yard Sale
Discontinued
Misc. Hardware
What's New Board Building
 Parts
Amp trim
Handles
Lamps
Diodes
Hoffman Turret
 Boards
Channel
Switching
Resistors Fender Eyelet
 Boards
Screws/Nuts
Washers
Jacks/Plugs
Connectors
Misc Eyelet
Boards
Tools
Capacitors Custom Boards
Tubes
Valves
Pots
Knobs
Fuses/Cords Chassis
Tube
Sockets
Switches Wire
Cable


Handy Links
Tube Amp Library
Tube Amp
Schematics library
Design a custom Eyelet or
Turret Board
DIY Layout Creator
File analyzer program
DIY Layout Creator
File library
Transformer Wiring
Diagrams
Hoffmanamps
Facebook page
Hoffman Amplifiers
Discount Program


password