Skip to content

Arduino board

jolo edited this page Nov 12, 2013 · 3 revisions

Board can be supplied from USB port (max current limited to 500mA) or from external source - it mainly depends on the stepper motor type you want to use. There is a known issue when powering Arduino Nano board from external source - if the board is connected to external voltage source in the first place, and then connected to USB port, the USB UART converter may not be recognized. You need to connect pins 25 and 26 of FT232RL converter to eliminate this issue.

External elements connected to the board are:

Two push buttons are used for manual control. When button is pressed stepper accelerates in the chosen direction to reach maximum speed (MANUAL_STEPPER_ACC parameter). When button is released stepper stops quickly.

Temperature sensor talks with the board using OneWire protocol. Temperature value is read with 10 bit resolution and this process takes 188ms. Temperature is read every 3 seconds and its value is cached in arduino memory, so actual temperature read is always available for the driver.

Four pins are used to control stepper motor. Additional stepper motor driver must be used (unipolar or bipolar motor can be used). Low power 5V steppers can be powered from 5V Arduino board pin so it will be effectively powered from USB bus. Max 450mA can be drained there for stepper motor (assuming USB 2.0 port is used). There is also PWM output available for controlling stepper duty cycle when not moving. It should be connected to 'enable' input of stepper motor driver. Default duty cycle is set to 0, however if focuser moves under load this value can be set to higher (usually 10-30% is enough to prevent focuser move). http://www.open.com.au/mikem/arduino/AccelStepper library is used for stepper control. Library is highly configurable and can control many stepper motor types. As a bonus we get smooth start and stop, that can prevent focuser slip when loaded with heavy equipment.

Buzzer is used for confirming user actions, serial port connections or runtime errors and focuser move end. You can connect LED with resistor instead of buzzer, so you need to use your eyes, not ears to be aware of focuser actions.

Arduino board pin connections

  • 3 push button A input
  • 5 push button B input
  • 7 temperature sensor input
  • A5 stepper A output
  • A3 stepper B output
  • 6 stepper C output
  • 2 stepper D output
  • 9 PWM control of stepper duty cycle
  • 11 buzzer control

At the table above there is default pin configuration that was most convenient for my application - you can of course change the pin assignments in the arduino sketch to whatever you want. One important thing for Arduino Nano is that pins A6 and A7 cannot be used as digital outputs - this is the way they are implemented in the Atmega chip. No can do, amigo.

Other parameters (except of the pin assignment) you can change in the sketch are:

  • BUZZ_LONG long buzz time in ms
  • BUZZ_SHORT short buzz time in ms
  • BUZZER_ON flag that turnes on buzzer. Default is off.
  • TEMP_CYCLE internal temperature read cycle in ms (probably does not make sense to make it shorter)
  • STEPPER_ACC stepper acceleration/deceleration parameter [pps/s]
  • MANUAL_STEPPER_ACC stepper acceleration parameter for manual focusing [pps/s]
  • MANUAL_FOCUS_MODE mode of manual focusing. Default is 1 (control with push buttons), can be set to 0 (encoder mode - available but no longer supported)
  • STEPPER_PWM_FREQ stepper duty cycle PWM frequency in Hz. One may want to change it to prevent vibration or resonances of the focuser or other equipment parts. Only if you use duty cycle more than 0%

Other values are hardcoded in the sketch - you can still modify it if you wish :)

Communication between computer and arduino board is performed with USB UART chip FT232 (http://www.ftdichip.com/Products/ICs/FT232BM.htm) built in Arduino Nano board. When other arduino board is used (ie Mini) that does not have built in UART converter, an external converter must be used to ensure communication between USB port and arduino UART interface.

Clone this wiki locally