Sten BOT Robot Kit 1 Stensat Group LLC, Copyright 2016

Similar documents
Sten-Bot Robot Kit Stensat Group LLC, Copyright 2013

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

Parts List. Robotic Arm segments ¼ inch screws Cable XBEE module or Wifi module

Arduino and Servo Motor

Two Hour Robot. Lets build a Robot.

Coding with Arduino to operate the prosthetic arm

Lab 06: Ohm s Law and Servo Motor Control

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Lesson4 Obstacle avoidance car

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

Sensor and. Motor Control Lab. Abhishek Bhatia. Individual Lab Report #1

Lecture 6. Interfacing Digital and Analog Devices to Arduino. Intro to Arduino

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Module: Arduino as Signal Generator

Arduino as a tool for physics experiments

Measuring Distance Using Sound

C++ PROGRAM FOR DRIVING OF AN AGRICOL ROBOT

4WD Mobile Platform SKU:ROB0022

Introduction: Components used:

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Name & SID 1 : Name & SID 2:

Robot Programming Manual

Today s Menu. Near Infrared Sensors

Embedded Controls Final Project. Tom Hall EE /07/2011

Robotic Arm Assembly Instructions

FABO ACADEMY X ELECTRONIC DESIGN

SCHOOL OF TECHNOLOGY AND PUBLIC MANAGEMENT ENGINEERING TECHNOLOGY DEPARTMENT

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

Robotics using Lego Mindstorms EV3 (Intermediate)

Marine Debris Cleaner Phase 1 Navigation

INA169 Breakout Board Hookup Guide

CONSTRUCTION GUIDE Light Robot. Robobox. Level VI

Programming 2 Servos. Learn to connect and write code to control two servos.

Arduino: Sensors for Fun and Non Profit

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

A - Debris on the Track

A - Debris on the Track

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters

A - Debris on the Track

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Blind Spot Monitor Vehicle Blind Spot Monitor

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

Lesson 3: Arduino. Goals

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Quantizer step: volts Input Voltage [V]

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

Pulse Width Modulation and

USB Multifunction Arbitrary Waveform Generator AWG2300. User Guide

.:Twisting:..:Potentiometers:.

Rodni What will yours be?

Bohunt School (Wokingham) Internet of Things (IoT) and Node-RED

About Arduino: About keyestudio:

Understanding the Arduino to LabVIEW Interface

Distance Measurement of an Object by using Ultrasonic Sensors with Arduino and GSM Module

Some prior experience with building programs in Scratch is assumed. You can find some introductory materials here:

PHYSICS 124 PROJECT REPORT Kayleigh Brook and Zulfar Ghulam-Jelani

100UF CAPACITOR POTENTIOMETER SERVO MOTOR MOTOR ARM. MALE HEADER PIN (3 pins) INGREDIENTS

Blue Point Engineering

Robots are similar to humans if you consider that both use inputs and outputs to sense and react to the world.

An Introduction to Programming using the NXT Robot:

CamJam EduKit Robotics Worksheet Six Distance Sensor camjam.me/edukit

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

Arduino Sensor Beginners Guide

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Lets start learning how Wink s bottom sensors work. He can use these sensors to see lines and measure when the surface he is driving on has changed.

Arduino Setup & Flexing the ExBow

SRF05-HY - Ultra-Sonic Ranger Technical Specification

1. Controlling the DC Motors

Safe Landing of Autonomous Amphibious Unmanned Aerial Vehicle on Water

Name EET 1131 Lab #2 Oscilloscope and Multisim

1. Introduction to Analog I/O

LVTX-10 Series Ultrasonic Sensor Installation and Operation Guide

The µbotino Microcontroller Board

Peek-a-BOO Kit JAMECO PART NO / / Experience Level: Beginner Time Required: 1+ hour

URM37 V3.2 Ultrasonic Sensor (SKU:SEN0001)

Content Components... 1 i. Acrylic Plates... 1 ii. Mechanical Fasteners... 3 iii. Electrical Components... 4 Introduction... 5 Getting Started... 6 Ar

Over Speed Vehicle Marking System Using Arduino UNO Controlled Air Cannon

Grove - Infrared Receiver

keyestudio keyestudio Mini Tank Robot

UIO Digital I/Os & DAQ Board User Manual

Momentum and Impulse

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

M-300 & M-320 Low Cost Ultrasonic Sensors

Sistemi Mobili. Differential wheeled robots. Angelo Trotta

SRVODRV REV7 INSTALLATION NOTES

Learn about the RoboMind programming environment

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Experiment 1: Robot Moves in 3ft squared makes sound and

Scratch for Beginners Workbook

TECHNICAL DATASHEET #TDAX Universal Input, Single Output Valve Controller CAN (SAE J1939)

8 Channel, DMX to 0 10 volt, Decoder board

TETRIX PULSE Workshop Guide

PLAN DE FORMACIÓN EN LENGUAS EXTRANJERAS IN-57 Technology for ESO: Contents and Strategies

Community College of Allegheny County Unit 7 Page #1. Analog to Digital

Transcription:

StenBOT Robot Kit Stensat Group LLC, Copyright 2016 1

Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the Quad-Bot kit against component defects. Damage caused by the user or owner is not covered. Warranty does not cover such things as over tightening nuts on standoffs to the point of breaking off the standoff threads, breaking wires off the motors, causing shorts to damage components, powering the motor driver backwards, plugging the power input into an AC outlet, applying more than 9 volts to the power input, dropping the kit, kicking the kit, throwing the kit in fits of rage, unforeseen damage caused by the user/owner or any other method of destruction. If you do cause damage, we can sell you replacement parts or you can get most replacement parts from online hardware distributors. This document can be copied and printed and used by individuals who bought the kit, classroom use, summer camp use, and anywhere the kit is used. Stealing and using this document for profit is not allowed. If you need to contact us, go to www.stensat.org and click on contact us. 2

References www.arduino.cc esp8266.githun.io/arduino/versions/2.3.0 3

Robot Sensing This section, you learn about using sensors to control the robots movements. 4

Photo Cell The photo cell is a light sensitive device that changes its resistance based on light intensity. The photocell can be used in a simple voltage divider circuit with another resistor. The resistor is 100Kohms. The photo resistor will have a resistance ranging from 1 Mohm in darkness to 100 ohms in bright light. Install the photo cell and 100 K resistor on the solderless bread board away from the motor driver. Make sure the photo cell and resistor are connected. Connect the free end of the resistor to V3 at the analog connector. Connect the free end of the photo cell to GND. Connect the resistor and photo cell connection to pin ADC of the analog connector. 5

Photo Cell Program The program to the right will get an ADC value from analog port A0. Create a new program and enter the code. To measure the voltage, the function analogread(port) is used. One analog port is available and it is called A0. The voltage range on the analog port is 0 to 1 volt. Once the ADC value is read, it can be converted to a voltage value. The code to the right shows the equation which can be used for all the analog ports. The Serial.println() function that displays the volts, includes a numeric argument which specifies the number of decimal places. void setup() { Serial.begin(9600); void loop() { int a; float volts; a = analogread(a0); Serial.println(a); volts = (float)a/1023.0; Serial.println(volts,2); delay(200); Save the program to a new file. 6

Quiz Time Now that you know how the photo cell works and how to control LEDs, write a program to turn on an LED when the room becomes dark. Write a program to detect three levels of light and turn on the appropriate LED. If the room is completely dark, no LEDs are lit. If the room light is dim, turn on the red LED. If the room is a bit brighter, turn on the yellow LED. If the room is bright, turn on the green LED. It is up to you to select the thresholds. 7

Light Seeking Program The photo cell can be used to have the robot chase after a light source. Write a program to have the robot look for a bright light source. If one is not detected, have the robot turn in place. When it detects a light source, have the robot move forward toward the light source. 8

Sensing the Environment To detect things in the environment for purpose of collision avoidance, an ultrasonic range sensor will be added to the robot. This sensor sends out a burst of audio signal at 40 KHz and detects the echo. The processor needs to measure the time it takes for the echo to return. This sensor has four pins Ground 5 Volt power input Trigger Echo 9

Ultrasonic Range Sensor Operation The ultrasonic range sensor operates in a specific sequence. It waits for a trigger signal. The trigger is a 10us pulse. Once the trigger is detected, the sensor generates a short signal at 40 KHz. It then waits for an echo and measures the time from sending the short burst to receiving the echo. The sensor then generates a pulse on the echo with a length proportional to the delay measured. 10us pulse on Trig pin Trig 40 Khz burst signal Transducer Receiver Delay Echo from target Pulse on Echo pin Echo distance = pulse width (us) / 58 10

Ultrasonic Range Sensor Remove the light sensor circuit and install the ultrasonic range sensor in the same area as shown to the right. Connect the VCC pin from the sensor to the 5V pin on digital pin 16. Connect the GND pin from the sensor to the GND pin on digital pin 16. Connect the TRIG pin from the sensor to digital pin 4. Connect a 1K resistor (brown-blackred) from the ECHO pin to a spot on the bread board. Then connect the other end of the resistor to digital pin 5. 11

Ultrasonic Sensor The ultrasonic sensor has two signals, trigger and echo. A pulse is sent to the trigger and then the processor is to time when the echo returns. This requires two digital pins, one configured as an output and the other as an input. A new command that will be used is called pulsein(). This measures the time it takes a pulse to occur in microseconds. Try the program to the right. The results are in centimeters. Create a new program and enter the code to the right. Save the program and upload it. void setup() { Serial.begin(9600); pinmode(5,input); pinmode(4,output); void loop() { unsigned long range; unsigned long distance; digitalwrite(4,low); delaymicroseconds(2); digitalwrite(4,high); delaymicroseconds(10); digitalwrite(4,low); range = pulsein(5,high); distance = range/58; Serial.println(distance); delay(500); 12

Click on the down arrow to the right where circled in red. A menu will open. Select New Tab Below, it will ask for a name. Enter 'motion' Click 'OK' A new tab is created called 'ultrasound' Creating a Separate Function File 13

Creating a Function Go back to the first tab where the program is located. Copy the highlighted section by highlighting it with the mouse and press the keys Ctrl and X. Go to the new tab called ultrasound and past the code. void setup() { Serial.begin(9600); pinmode(5,input); pinmode(4,output); void loop() { unsigned long range; unsigned long distance; digitalwrite(4,low); delaymicroseconds(2); digitalwrite(4,high); delaymicroseconds(10); digitalwrite(4,low); range = pulsein(5,high); distance = range/58; Serial.println(distance); delay(500); 14

Making a Function Add the highlighted text to turn the code into a function. The first line identifies the code as a function. The unsigned long in front indicates the function will return a value. The curly brackets indicate the start and end of the function. unsigned long ultrasonic() { unsigned long range; digitalwrite(4,low); delaymicroseconds(2); digitalwrite(4,high); delaymicroseconds(10); digitalwrite(4,low); range = pulsein(5,high); return(range); The return statement specifies what value is returned to the calling function. 15

16

Conditional Programming Now it is time to use the ultrasonic sensor to do collision avoidance. The 'if' command will be used to test if the robot will collide with an object. The format for the if statement is shown to the right. Multiple statements can be inserted between the brackets and will be executed if the condition is true. To test for equals, use '==' if(a < c) { execute code here if(a == c) { execute this code if(a > c) { execute this code else { otherwise execute this code else allows two sets of codes to be executed depending on the condition. 17

Collision Avoidance Program The program on the next page will use the code used to control the motors, the ultrasonic function, and the conditional command. Put together, the program will keep the robot from bumping into anything. Enter the code on the next page. The code should be written in a single file. The code is split on the next page since it wouldn't fit in a single column. You will notice a delay() at the end of the loop() function. This is needed because the ultrasonic range sensor cannot be operated too fast. Incorrect results will occur if the loop runs too fast. Test it and see if you need to tweak the timing for going reverse and turning. Don't forget to include the motion file by adding the file. Save the program and then upload it. Change the code to turn a different direction. 18

Collision Avoidance Program long ultrasonic() { digitalwrite(4,low); delaymicroseconds(2); digitalwrite(4,high); delaymicroseconds(10); digitalwrite(4,low); long distance = pulsein(5,high); if(distance == 0) return(1000); distance = distance/58; return(distance); void setup() { pinmode(5,input); pinmode(15,output); pinmode(16,output); pinmode(14,output); pinmode(13,output); pinmode(4,output); void loop() { long distance; forward(); distance = ultrasonic(); if(distance < 10) { reverse(); delay(1000); left(); delay(700); halt(); delay(50); 19

Obstacle Course Time Now for the fun part. Modify and expand the program to go through the obstacle course shown below. The large square represent 2 foot grids. The red rectangles represent a barrier that can be detected with the ultrasonic range sensor. Set up some barriers out of any solid material. Card board boxes, poster paper, or other large materials will work. Use the ultrasonic range sensor to avoid crashing into the barriers and turns the right direction every time a barrier is detected. Hint, use the collision avoidance program and expand it so that it will complete the maze. This requires the robot to back up and turn in specific directions at specific points of the maze. Start Finish 20