What kind of ESP controlled servo should I use to rotate a volume control safely?

I need to use three volume controls to automate volume adjustment for rear speakers, front speakers and subwoofers in my boat. The levels are impossible to automate with IR (which I have done with a lot of other stuff), because the Pioneer headunit starts different places in the menus depending on what was done the last time, and there is no way to go directly to a set point and have that as a starting point.

Adding any form of active volume control (there are several cheap IR versions) creates noise. I actually had to use optical out from a USB sound card for the Pi that serves the music, and then a headset amp with optical in connected to the headunit with RCA cable just to get rid of the noise from the Pi! So I’m going to use three of these passive controls:

image

To turn them I will use three independent servo motors. I think the best way to connect them will probably be with a thin rubber hose, then I won’t rip the volume control or servo apart if something has a hiccup and it tries to turn the knob too far. But does anybody know what type of servo motor I should use? I prefer Aliexpress for my electronic shopping. It would have to be a motor that turns to a set point for an input from the ESP32, like:

Press 50 in Homeassistant → the servo moves the knob to half volume
Press 10 in Homeassistant → the servo moves the knob to 1/10 from 0
Press 100 in Homeassistant → the servo moves the knob to full volume

I will probably use hot glue to fix the parts in a waterproof box, I do a lot of that in the boat.

Servo typically rotates only little over 180 degrees, is that enough?

Thanks for answering! There are lots of 360 servos as well on Aliexpress. I just don’t know if they can take instructions like the ones I need, and not only “rotate 20 degrees left” or “rotate 20 degrees right”, without “knowing” where they are. I will receive the volume controls tomorrow, but as far as I could see, it has a rotation of around 270 degrees from start to finish.

Edit: Like these, for instance. I just don’t know the first thing about servos and servo control.

Edit 2: And anyway, I would never need to turn the volume all the way down (the 0 example in the first post is really not an issue), so it wouldn’t be a problem even if I couldn’t go from 0 to 100, I could probably even do with 50 to 100, since the speakers in the front and the rear are the same type and I have an approximate balanse between them and the subwoofer.

Then standard servo is more practical. 360 servos have potentiometer removed so you don’t have position feedback.

Thanks! So that one would work, then? It is a 360, but it doesn’t go all the way around, it goes 180 degrees one way and 180 the other way. Specs:

360 °
Specificattion:
SG-90 Micro Servo
All Nylon Gear
Connector Wire Length: 150MM
Name: 9 grams of steering gear
Size: 23mmX12.2mmX29mm
Weight: 9 grams
Maximum angle: 360 °(Note: This refers to moving back and forth within a 180 ° range, with positive and negative 180 ° being 360 °)
Torsional moment: 1.5kg/cm
Working voltage: 4.2-6V
temperature range: 0 ℃ --55 ℃:
Operating speed: 0.3 seconds /60 degree
Dead band width: 10 microseconds

Can I adjust the speed on a servo like that, or will it swing 60 degrees in 0.3 seconds no matter what? It sounds fast for a volume control.

Edit: it seems like I can do that with an advanced option:

  • transition_length (Optional, Time): The time needed for a full movement (-1.0 to 1.0). This will effectively limit the speed of the servo, the larger the value, the slowest the servo will move. Defaults to 0s. This can slow down the servo to avoid loud noises or just make the movement not jerking.

I’m not sure a servo is what you should be looking at.
They won’t hold their position when power is lost, which also means they use a lot of power just to keep the same setting all the time.

Wouldn’t a motor work better? Like a stepper motor?

The volume control won’t move when it’s set. It’s a totally manual volume control that is basically a potmeter. But do you mean that a servo will go back to 0 setting when the power’s cut?

Yes… That is usually how servos work.
But perhaps some work differently.

Aha, I see! I didn’t know that, thanks! Then I have to research more. I see that ESPHome has a stepper component as well, so perhaps something like this instead? I see in the Stepper component that it supports the ULN2003 driver.

I’m not sure that is 100% correct though.
It was a long time ago since I used a servo, but I remember it as having a spring that pulled it back.
But there are perhaps other versions?

Can’t help you with stepper motor, have never used one.

OK, thanks! I’ll try to contact the seller of the servo and see if that can be used, if not I’ll try that stepper.

Just go with regular servo if 180 deg movement is ok. Stepper doesn’t have known position, so if you have power off you don’t know where it was.

Thanks! I’ll see how much movement I need when I get the first of the volume controls tomorrow. :+1:

They typically make little more than 180, about 200deg.

1 Like

100% you want steppers! Theyre super accurate and most importantly, theyre pretty much silent when they rotate. Have you ever used servos? Nails on a chalkboard is a bit exacerbated but servos are an easy second or third place. They’re very load and annoying. Please dont do that to a Pioneer!

Thanks, but I had already ordered servos when you answered. :slight_smile: And I will not be able to hear them anyway inside a box, inside a cabinet in the boat, with music over the speakers (they will only be used to adjust balanse between amps, so they will not be in use when there is anythinge near silence). :grin:

Sweet, im kind of interested in how this turns out either way. If you remember to, you should do an update here.

Will do that! :+1: It may take a few weeks, stuff from China can take a while, and I need to set aside time to do the job.

Few weeks!?! Thats unacceptable, I want to see it now!

Jk, i know how it is. Hell, half the time i get stuff in, ive already started something else or had forgot all together.

They can work surprisingly well. I made “temporary” setup to control my water heater power based on PV solar excess. I used $1 sg90 servo to rotate potentiometer of an old triac controller every 10 seconds, so it’s basically turning almost continuously 10 hours a day.
Later I built all “digital” controller and I’m waiting for the servo to fail to replace the whole setup. But it keeps on going, two years now.