This guide was written for the Trinket Mini and Gemma v2 boards. It has been updated to also support the Trinket M0 and Gemma M0 using CircuitPython. We recommend the Trinket M0 or Gemma M0 as they are easier to use and are more compatible with modern computers!

The Adafruit Trinket's small size makes it ideal for lightweight or small projects including robotics. This project demonstrates the use of a standard hobby servo with the Trinket.

The standard Arduino IDE servo library will not work with 8 bit AVR microcontrollers like the ATtiny85 on the Trinket and Gemma due to differences in available timer hardware. Fortunately the Adafruit_SoftServo library works well on any available pin (a hardware PWM (pulse width modulated) pin is not required). The library is not ideal, in that servos must be refreshed periodically. A true hardware library would be best if one could be coded, although it would be limited to pins capable of hardware PWM (GPIO #1 and #4).

If you turn the potentiometer, the servo will rotate from zero to 180 degrees. The circuit can be expanded into a number of useful projects.

Parts used:

  • Standard 5 volt hobby servo (several are available in the Adafruit shop)
  • Potentiometer (variable resistor), anything from 1K Ω to 10 KΩ, value not critical
  • Breadboard, jumper wires/hookup wire
  • Power supply and connector - if you want to have it connected to a battery pack or computer-independant
Last updated on 2018-04-28 at 04.31.14 PM Published on 2013-09-12 at 05.02.44 PM