Skip to content

A servo controller that uses a Nano, and has 8 channels of servos controlled by 8 inputs. In addition, servo endpoints can be set with 4 additional inputs.

License

Notifications You must be signed in to change notification settings

dpharris/NanoServoController

Repository files navigation

NanoServoController

This Servo Controller was originally designed for use with the Nano, but should work unchanged on the Uno, etc. It has also been adapted to the Pico.

AVR_ServoController_Native.ino

This sketch is written for the Nano and AVR series. It has up to 8 input lines that controlup to 8 servos. These inputs can be absolute (Active Low) or alternating, allowing use of toggles or push-buttons, or being connected to a accessory board.

The inputs can be connected to SPDT slide or toggle switched with the centre to the board pins D0-D7 and the other two terminals connected to groaund and 5V. Or, 8 pushbuttons connected to ground and to D0-D7. In this case one has to uncomment one line in tne sketch: "#define ALTERNATE" to allow the pushbuttons to choose the two servo psotitions alternately.

The outputs D8-D13, A4 and A5 are connected to eight servos.

In addition there are four control lines, operated by push-buttons, used to program the endpoints of the servos:

  • Next servo - choose the next servo
  • Next position - choose the next servo position
  • Up -- move the chosen servo one way
  • Down -- move the chosen servo the other way Changes to the servo positions will be stored in EEPROM after 20 seconds of inaction.

Extensions

The sketch has been modified to:

  • AVR using use an external PCA9685, see AVR_ServoController_PCA9685.ino. This allows up to 16 servos.
  • Pico using native (PIO) servo-driver to allow 8 servos. (This uses all PIO, so be aware.). Pico_ServoCOntroller_Native.ino.
  • Pico using a PCA9685. This allows 16 servos. Pico_ServoController_PCA9685.ino.

Compiling / Using

Copy one of the sketches into a new sketch in the Arduino IDE. CHoose the correct oprocessor. You will need to use Library Manager to download the ServoEasing library.

Using SPDT switches

image

Using Nano Mother board and SPDT switches

Inexpensive motherboards can be used to make life easier, since they have a power supply and servo connectors, for example: https://www.aliexpress.com/item/1005002054420577.html

image

Using buttons

This will require the "#define ALTERNATE" line to be uncommented in the sketch.

image

Using Nano Motherboard and PCA9685 PWM daughter board

image

Using Pico with Native PWM

image

Using Pico Motherboard and PCA9685 PWM daughter board

image

Using with LCC Tower

image

Real World Setup

image

Setting Servo Positions

https://youtu.be/eLYbbh9UrcI

Operating the Servos from LCC

This set up has an LCC-Loconet-USB, and two LCC Towers. I have programmed a pushbutton to send alternating eventids. The same Tower consumes these, and moves a servo to one endpoint and then to the other endpoint.

https://youtu.be/-KqmzUoACQ0

About

A servo controller that uses a Nano, and has 8 channels of servos controlled by 8 inputs. In addition, servo endpoints can be set with 4 additional inputs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages