Stepper control generic: Difference between revisions
(13 intermediate revisions by the same user not shown) | |||
Line 32: | Line 32: | ||
===Slide Switch=== | ===Slide Switch=== | ||
The slide switch can be used as control - generally used for direction control. It is connected to digital input 3 on the arduino chip. Direction pin to | The slide switch can be used as control - generally used for direction control. It is connected to digital input 3 on the arduino chip. Direction pin to the driver is connected to digital output 1. | ||
#define Switch 3 | #define Switch 3 | ||
Line 54: | Line 54: | ||
===i2c port=== | ===i2c port=== | ||
The board has provision for an i2c port. This can be used to connect to some external device (lcd screen, slave device). Or it can be connected to another arduino board to serve as slave device. | The board has provision for an i2c port. This can be used to connect to some external device (lcd screen, slave device). Or it can be connected to another arduino board to serve as slave device. | ||
The recommended library for use of the i2c is TinyWireM from this link here | The recommended library for use of the i2c is TinyWireM from this link here modified for the attiny84 chips. <br> | ||
[[Use a LCD i2c with attiny84]] | [[Use a LCD i2c with attiny84]] <br> | ||
[[Stepper Control Board with LCD]]<br> | |||
===Serial Port=== | ===Serial Port=== | ||
The serial connector as a FTDI layout to allow connecting directly a FTDI adaptor. This | The serial connector as a FTDI layout to allow connecting directly a FTDI adaptor. This allows communications from the board to a computer. e.g. sending commands to the board or displaying debug information. | ||
=Sketch Examples= | =Sketch Examples= | ||
Line 66: | Line 67: | ||
==Default Sketch== | ==Default Sketch== | ||
The default sketch loaded in the | The default sketch loaded in the Attiny84 is a basic sketch to control the motor manually. The potentiometer will be use as speed control.<br /> | ||
[http://lechacal.com/ | [http://lechacal.com/stepper_pilot/stepperBoardv3_default_v1_1.ino Download Sketch Version 1.1.] | ||
A demonstration can be seen on [http://lechacal.com/stepper_control/video_stepper_board_v2_default.webm this video] | A demonstration can be seen on [http://lechacal.com/stepper_control/video_stepper_board_v2_default.webm this video] | ||
Line 86: | Line 87: | ||
[http://lechacal.com/stepper_control/steppercontrol_i2c.ino Download Slave i2c Sketch.]<br> | [http://lechacal.com/stepper_control/steppercontrol_i2c.ino Download Slave i2c Sketch.]<br> | ||
[http://lechacal.com/stepper_control/stepper_i2c_master_example.ino Download Master i2c Sketch.] | [http://lechacal.com/stepper_control/stepper_i2c_master_example.ino Download Master i2c Sketch.] | ||
==Serial Sketch== | |||
This sketch allows controlling the stepper from serial communication. | |||
[http://lechacal.com/stepper_pilot/stepperBoardv3_serial_v1_0.ino Serial sketch v1.0]<br> | |||
[[Control a Stepper Motor with Serial over USB]] | |||
=Related Articles= | =Related Articles= | ||
[[How_to_program_an_Attiny85_or_Attiny84 | How_to_program_an_Attiny85_or_Attiny84]] | [[How_to_program_an_Attiny85_or_Attiny84 | How_to_program_an_Attiny85_or_Attiny84]] |
Latest revision as of 18:33, 2 May 2015
Arduino Stepper Control Board - Any Driver
The tiny stepper controller is a controller board for stepper motor. It can be controlled manually (potentiometer and switches) and programmed with Arduiono IDE.
Technical Specifications
Stepper Motor driver board: A4988
Microcontroller: Attiny84.
Input Power: 12Volts. (30V max)
Power Socket: 2.1mm Jack. Center positive.
Motor connector: 4 way molex.
Manual Control ready with:
- Potentiometer for speed.
- Push button for single step increment.
- Slider switch for direction selection.
- i2c port
- Serial port in FTDI configuration
Hardware Controls
Slide Switch
The slide switch can be used as control - generally used for direction control. It is connected to digital input 3 on the arduino chip. Direction pin to the driver is connected to digital output 1.
#define Switch 3 #define Direction 1
Push Buttons
Two push buttons are available. These can be used for any desired manual function such as speed up, move left, start, stop etc...
They are configured with digital input 0 and 2.
#define Button1 2 #define Button2 0
Potentiometer
The board host a potentiometer for variable control such as speed. It is connected to analogue input 3.
#define Pot 3
i2c port
The board has provision for an i2c port. This can be used to connect to some external device (lcd screen, slave device). Or it can be connected to another arduino board to serve as slave device.
The recommended library for use of the i2c is TinyWireM from this link here modified for the attiny84 chips.
Use a LCD i2c with attiny84
Stepper Control Board with LCD
Serial Port
The serial connector as a FTDI layout to allow connecting directly a FTDI adaptor. This allows communications from the board to a computer. e.g. sending commands to the board or displaying debug information.
Sketch Examples
Default Sketch
The default sketch loaded in the Attiny84 is a basic sketch to control the motor manually. The potentiometer will be use as speed control.
A demonstration can be seen on this video
i2c Control
The two i2c pins of the Attiny84 are available on the board to be controlled from an i2c master.
This is a sketch for the Attiny85 for speed and direction control. Commands are as follow
"a" for direction 1 - e.g. Master will issue Wire.write("a")
"b" for direction 2 - e.g. Master will issue Wire.write("b")
"delay:" for speed control - e.g. Master will issue Wire.write("1500:")
":" for stopping the motor - e.g. Master will issue Wire.write(":")
Delay must be a number followed by a ":" which is the stop character. This number is the delay in microseconds between each steps.
Download Slave i2c Sketch.
Download Master i2c Sketch.
Serial Sketch
This sketch allows controlling the stepper from serial communication.
Control a Stepper Motor with Serial over USB