STEPD StepDuino Quickstart Guide

Similar documents
keyestudio Keyestudio MEGA 2560 R3 Board

ARDUINO MINI 05 Code: A000087

Alessandra de Vitis. Arduino

IDUINO for maker s life. User Manual. For IDUINO Mega2560 Board(ST1026)

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

IDUINO for maker s life. User Manual. For IDUINO development Board.

ARDUINO LEONARDO WITH HEADERS Code: A000057

ARDUINO LEONARDO ETH Code: A000022

Beetle SKU:DFR0282. Contents. Introduction

Sanguino TSB. Introduction: Features:

ARDUINO INDUSTRIAL 1 01 Code: A000126

Arduino Smart Robot Car Kit User Guide

ARDUINO YÚN MINI Code: A000108

ARDUINO M0 PRO Code: A000111

Introduction to Arduino. Wilson Wingston Sharon

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

ARDUINO MEGA 2560 REV3 Code: A000067

Propeller Activity Board (#32910)

ESPino - Specifications

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

ARDUINO MICRO WITHOUT HEADERS Code: A000093

ARDUINO YÚN Code: A000008

ARDUINO UNO REV3 SMD Code: A The board everybody gets started with, based on the ATmega328 (SMD).

ARDUINO UNO REV3 Code: A000066

XNUCLEO-F030R8, Improved STM32 NUCLEO Board

Goal: We want to build an autonomous vehicle (robot)

MegaPi Born to Motion Control

ARDUINO MEGA ADK REV3 Code: A000069

Introducting Itsy Bitsy 32u4

L298N Dual H-Bridge Motor Driver

1. Introduction Packing list Parts Introduction Uno R3 Board for Arduino Specifications... 6

How to Use an Arduino

LAMPIRAN I (LISTING PROGRAM)

Farklı Arduino Boardlar

MEGATRONICS v3.0 DATASHEET

Eng.mohammed Albhaisi. Lab#3 : arduino to proteus simulation. for simulate Arduino program that you wrote you have to have these programs :

Arduino ADK Rev.3 Board A000069

Physics 120/220. Microcontrollers Extras. Prof. Anyes Taffard

The Arduino Briefing. The Arduino Briefing

Make your own secret locking mechanism to keep unwanted guests out of your space!

MEGATRONICS V3.0 QUICK START GUIDE

Name: Serial MP3 Player A manual

2.2" TFT Display. Created by lady ada. Last updated on :19:15 PM UTC

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

ARDUINO PRIMO. Code: A000135

An Arduino Controlled 1 Hz to 60 MHz Signal Generator

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

Stepper 6 click. PID: MIKROE 3214 Weight: 26 g

MEGATRONICS v3.0 DATASHEET

Module 003: Introduction to the Arduino/RedBoard

Adafruit Metro Mini. Created by lady ada. Last updated on :12:28 PM UTC

ARDUINO UNO R3 BASED 20A ROBOT CONTROL BOARD [RKI-1580] Page 1

Stand-alone programming AVRs using CircuitPython

Programmable Device Interface PDI-1 A Versatile Hardware Controller with USB interface

ARDUINO BOARD LINE UP

USER GUIDE RADDS. December 2014 Version Max3dshop

Thank you for purchasing the RGB Multi-MCU base and driver board from SuperTech-IT and TheLEDCube.com

Power Supply, Arduino MEGA 2560, and Stepper Motors Connections

Arduino Dock 2. The Hardware

Ultratronics v1.0 DATASHEET

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Getting to know the Arduino IDE

Bluno M0 Mainboard SKU: DFR0416

SECOND EDITION. Arduino Cookbook. Michael Margolis O'REILLY- Tokyo. Farnham Koln Sebastopol. Cambridge. Beijing

ARDUINO MEGA INTRODUCTION

TETRIX PRIZM Robotics Controller Quick-Start Guide and Specifications

Lesson 6 Intel Galileo and Edison Prototype Development Platforms. Chapter-8 L06: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

GUIDE TO SP STARTER SHIELD (V3.0)

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

USER GUIDE ARDBOX ANALOG

TETRIX PRIZM Robotics Controller Quick-Start Guide and Specifications

Digital Circuits 7: MCUs... how do they work?

Exen Mini. Setup Guide - V1. nerdonic.com

Arduino Programming and Interfacing

Arduino Smart Bluetooth Robot Car Kit User Guide

Introduction To Arduino

Omega MP. Multi-Programming Shield for Atmel Microcontrollers. User Manual

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

M-DUINO R FAMILY. M-Duino 19R/38R/57R User Guide: 1 Index

Romeo BLE Quad Robot Controller SKU: DFR0398

Intel Galileo gen 2 Board

ARDUINO. By Kiran Tiwari BCT 2072 CoTS.

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

Introduction to Arduino

CORTESIA ELECTRONICCA

USER GUIDE ARDBOX RELAY

CNC Controller Quick Start Guide

INTERFACING HARDWARE WITH MICROCONTROLLER

Adafruit TB A DC/Stepper Motor Driver Breakout Board

Adafruit Mini TFT " 160x80

M-DUINO FAMILY. M-Duino 21 User Guide: 1 Index

Contents. List of Figures. TermDriver Datasheet 1. 1 Overview 2. 2 Features 2. 3 Installation with Arduino 3

Arduino Uno R3 INTRODUCTION

USER GUIDE ARDBOX ANALOG

Ks0096 keyestudio CNC Kit / CNC Shield V4.0 + Nano 3.0+3pcs a4988 Driver / GRBL Compatible

Bolt 18F2550 System Hardware Manual

Digispark DIY: the Smallest USB Arduino

Transcription:

STEPD StepDuino Quickstart Guide The Freetronics StepDuino is Arduino Uno compatible, uses the ATmega328P Microcontroller and works with most Arduino software. The StepDuino can be powered automatically by the USB connection or powered separately by your project via the DC jack, which also provides power to any connected stepper motors. Software installation 1. Download the latest Arduino IDE for your operating system from www.arduino.cc/en/main/software and install it to suit. You'll also find more step-by-step guides for installation here: www.arduino.cc/en/guide/homepage Windows users please note: The USB driver for the StepDuino must be downloaded and used for first-time installation of the StepDuino's USB port 2. Once the Arduino IDE is installed, we're ready to do the initial board and port setup. You won't need to do this again unless the serial port number changes such as when using a different USB port on your computer. 3. In the Arduino IDE, select Tools > Board > Arduino Uno. 4. Before connecting your StepDuino to the USB port, have a look at the list of ports in Tools > Serial Port. That's where your StepDuino serial port is going to appear when you plug it in.

5. Connect your StepDuino to the computer USB port. We supply an appropriate USB cable with the StepDuino. After a short while if you look at Tools > Serial Port again you'll see a new port appear: that's the StepDuino ready to be used. Select that port now with Tools > Serial Port so there is a tick mark next to it 6. You're ready to go. The Arduino IDE now knows about your board and has a connection to it. Compiling and uploading a sketch to the StepDuino "Sketch" is the Arduino term for a program. To test uploading a simple sketch to your StepDuino: 1. Choose File > Examples > 01.Basics > AnalogReadSerial. You'll see the code open in the IDE. 2. Select Sketch > Verify/Compile, you've now built (compiled) the program ready to be loaded. 3. Lastly, to load the program into the StepDuino, select File > Upload to I/O Board. You'll see the red D13 LED flicker as the board is reset, then the green and yellow RX and TX LEDs will flash while the upload is in being done. 4. A few seconds later the RX and TX LEDs will go off, the board will reset, and the TX LED will appear to be on constantly. 5. In the IDE, select Tools > Serial Monitor. A new window will open. Check that the speed drop-down in the bottom right of the window is set to "9600 baud". You will then see a stream of numbers down the window showing readings from the analog inputs on the StepDuino. Congratulations! You've now compiled and uploaded your first sketch to the StepDuino. Using the microsd card slot The microsd card slot is supported by a variety of libraries that implement different versions of the FAT filesystem commonly used on microsd cards. The Arduino IDE comes bundled with the "SD" library pre-installed including some example sketches, so look infile > Examples > SD to see how to communicate with a microsd card. Note: the "select" line for the microsd slot on the StepDuino is D9, which is

different to the examples bundled with the IDE. Ensure you change the select line setting in the sketch to pin 9. Using the stepper motor outputs Stepper motors do not simply spin like most motors you may be familiar with. They move in a series of steps (hence the name) with a defined angle of rotation per step. Stepper motors can be specified as having a certain number of steps per rotation, or as a number of degrees of rotation per step. Both numbers are just different ways of stating the same thing. For example, a typical hobby stepper motor may be said to have "200 steps/rev" (steps per revolution), or "1.8º/step" (degrees per step) which are really the same thing. So if you drive a 200 steps/rev (or 1.8º/step) motor through 200 steps, it will rotate a complete 360º back to where it started. Microstepping Settings Stepper motors are specified in terms of how many steps they take per revolution, but a technique called "microstepping" allows controllers to drive motors in smaller increments. The StepDuino supports four levels or increments of microstepping: full-step, 1/2-step, 1/4-step, and 1/8-step. The default configuration is 1/8-step, which is set by leaving the pairs of solder bridges on the back of the PCB unconnected. That means you need to send 8 times as many step pulses as you may expect based on the specs of your motor, but it also gives you much finer control of the rotation of the motor. You can adjust the microstep settings for both outputs independently by applying solder bridges across the positions labelled "MS0" and "MS1" for the relevant output. MS0 MS1 Setting Ope n Clos ed Ope n Ope n Ope n Clos ed 1/8 step (default) 1/4 step 1/2 step Clos Clos Full step

ed ed Motor Connections The StepDuino has two independent 4-wire bipolar stepper motor outputs. Each output (labelled "STEPPER 1" and "STEPPER 2" on the PCB) uses two control lines: one line to determine the direction of rotation of the stepper motor, and one to trigger a step of the motor. Stepper 1 direction: Arduino digital pin 2. Stepper 1 step: Arduino digital pin 5. Stepper 2 direction: Arduino digital pin 3. Stepper 2 step: Arduino digital pin 6. These assignments are also printed on the bottom of the StepDuino in case you need to look them up. To connect your 4-wire bipolar stepper motor, you first need to determine the coil connections using the datasheet of your particular motor. The very common NEMA-17 stepper motors used in many hobby projects such as 3D printers can generally be connected using the colour codes as shown below, using (left to right) red, green, yellow, blue: Otherwise, the general coil wiring for your stepper should match this (there should be a similar diagram in the datasheet for your stepper):

Stepper motors cannot be powered from the USB port because they generally require a higher voltage and more current than USB can provide. Connect an external power source suitable for your stepper motors (often 12Vdc) to the DC IN jack in the top left of your StepDuino as shown above.

Example Sketch The example sketch below sets up the output pins for both Stepper 1 and Stepper 2, and then drives the Stepper 1 channel through a total of 1600 steps (ie: one complete rotation for a 200 steps/rev motor using 1/8th microstepping: 200 x 8 = 1600) then pauses for one second, then does the same thing in reverse, then repeats. You'll see in the sketch there are also unused example functions for running Stepper 2 forward and for "braking" both motors so the controller holds them in place and resists rotation. * StepDuino example const int Stepper1Step = 5; const int Stepper1Direction = 2; const int StepsPerRev1 = 1600; const int Stepper2Step = 6; const int Stepper2Direction = 3; const int StepsPerRev2 = 1600; * Set pin assignments void setup() pinmode(stepper1step, OUTPUT); pinmode(stepper1direction, OUTPUT); pinmode(stepper2step, OUTPUT); pinmode(stepper2direction, OUTPUT); * Main loop void loop() for(int i = 0; i < StepsPerRev1; i++) stepper1forward(); delay( 1000 ); for(int i = 0; i < StepsPerRev1; i++) stepper1reverse();

delay( 1000 ); * Rotate stepper 1 forward by 1 step void stepper1forward() digitalwrite(stepper1direction, HIGH); digitalwrite(stepper1step, HIGH); delaymicroseconds(2); // 1uS minimum pulse duration for DRV8811 digitalwrite(stepper1step, LOW); delaymicroseconds(100); * Rotate stepper 1 backwards by 1 step void stepper1reverse() digitalwrite(stepper1direction, LOW); digitalwrite(stepper1step, HIGH); delaymicroseconds(2); digitalwrite(stepper1step, LOW); delaymicroseconds(100); * Rotate stepper 1 forward by 1 step void stepper2forward() digitalwrite(stepper2direction, HIGH); digitalwrite(stepper2step, HIGH); delaymicroseconds(2); // 1uS minimum pulse duration for DRV8811 digitalwrite(stepper2step, LOW); delaymicroseconds(100); * Lock both steppers in place void applybrakes() digitalwrite(stepper1direction, LOW); digitalwrite(stepper1step, LOW);

digitalwrite(stepper2direction, LOW); digitalwrite(stepper2step, LOW); delaymicroseconds(50);

Using the servo outputs A servo is a device that contains a small electric motor that can be commanded to rotate to a specific angular position. For example you might use a servo to move the part of a robotic arm, or lift a stylus from a two-axis plotter. Your StepDuino easily allows for the connection of two servos at the same time. To connect your servos, observe the colour of the wires between the servo and end plug. The darkest wire will match the GND pin on the SERVO port of your StepDuino, as shown in the example image below: However if you are unsure, check with the supplier of the servo to ascertain which wire is GND, 5V and signal. Controlling your servos is equally simple, and the Servo library included by default with the Arduino IDE will suffice. Consider the following sketch:

#include <Servo.h> Servo left; // assign objects to the Servo library Servo right; int pos = 0; // variable to store the servo position void setup() left.attach(10); // one servo connected to D10 right.attach(11); // the other to D11 void loop() for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees in steps of 1 degree // tell servos to go to position in variable 'pos' left.write(pos); right.write(pos); // wait 15ms for the servos to reach the position delay(15); for(pos = 180; pos>=1; pos-=1) // and reverse left.write(pos); right.write(pos); delay(15); This will sweep both servos across a 180 degree range and back again. Once the two servos have been activated in lines two and three, and assigned to the StepDuino's digital output pins for servos - you can simply use the required.write function to control each servo.

Using the LCD The 20x4 LCD is controlled using a shift register, which saves some I/O pins on the microcontroller and allows them to be used for other purposes. This means the regular LiquidCrystal library included with the Arduino IDE can't drive it directly, so you need to use Marc Merlin's version of the "NewLiquidCrystal" library. To do so, visit github.com/marcmerlin/newliquidcrystal and click the "Download ZIP" button on the right-hand side of the page. Once the.zip file has completed downloading, open the.zip file and copy the folder labelled "NewLiquidCrystalmaster" into your Arduino IDE libraries folder. Finally, rename the folder to "NewLiquidCrystal". For detailed instructions on library installation please see our tutorial "How To Install Arduino Libraries". Once you have the library installed and your IDE has been restarted, create a new sketch and paste the following code into it: * Demo of writing to the StepDuino LCD #include <Wire.h> #include <LiquidCrystal_SR_LCD3.h> const int PIN_LCD_STROBE strobe const int PIN_LCD_DATA data const int PIN_LCD_CLOCK clock = 4; // Out: LCD IC4094 shift-register = 7; // Out: LCD IC4094 shift-register = 8; // Out: LCD IC4094 shift-register LiquidCrystal_SR_LCD3 lcd(pin_lcd_data, PIN_LCD_CLOCK, PIN_LCD_STROBE ); * Setup routine. Run once void setup() lcd.begin( 20, 4 ); lcd.home (); lcd.setcursor (0, 0); lcd.print(f("** Stepduino v1.1 **")); lcd.setcursor (0, 1); lcd.print(f("dual channel stepper")); lcd.setcursor (0, 2); // Initialize the LCD // Go to the home location

lcd.print(f("motor +servo outputs")); lcd.setcursor (0, 3); lcd.print(f(" freetronics.com/sd")); delay( 2000 ); lcd.setcursor( 0, 3 ); lcd.print(f(" ")); * Main loop. Run indefinitely void loop() // Set the cursor to column 0, line 1 // (Note: line 1 is the second row, since counting begins with 0): lcd.setcursor(0, 3); // Display the number of seconds since reset: lcd.print(millis()/1000);

Specifications Microcontroller MCU Type Operating Voltage MCU Clock Speed Atmel ATmega328P 5V 16 MHz StepDuino Input Voltage Digital I/O pins Analog Input Pins Analog Resolution Current Per I/O Pin Total Current For All I/O Pins Current For 3.3V Output 7-28V DC recommended 5-40V DC maximum 14 (6 provide PWM output) 8 (analog input pins also support digital I/O, giving 22 digital I/O total if required) 10 bits, 0-1023 at 5V AREF is approx 0.00488V; 4.88mV per step 40 ma maximum 200mA maximum 50mA maximum Memory Flash Memory SRAM, EEPROM microsd 32 KB Flash Memory, of which less than 1 KB is used by bootloader 2 KB SRAM, 1 KB EEPROM microsd card slot with SPI interface. Uses pins D4 (select), D11, D12, D13 Communications Serial Stepper Outputs 1 x hardware USART, SPI (Serial Peripheral Interface), I2C 2 x Texas Instruments DRV8811 4-wire stepper motor controllers

Servo Outputs Display Other 2 x digital I/O pins broken out with GND and 5V connections to suit hobby servos HD44780-compatible 20x4 backlit LCD with 3-wire shift register interface Integrated USB programming and communication port. Many other one-wire, multi-wire, LCD and expansion devices supported by free code and libraries