Home
TRC 2014 Training Manual
Contents
1. eTry turning the potentiometer knob what happens Vil DC Voltage Measurement e Turn the knob and point the arrow to the DC Voltage Measurement position e Use one value higher than your ex pected value e Ex If you are measuring 9V set the dial to 20V e Connect the test leads across in parallel the ter l minals you want to measure the voltage at NOTES VIII DC Current Measurement e Turn the knob and point the arrow to the DC Current Measurement position e Use one value higher than your ex pected value e Ex If you are measuring 9V set the dial to 20V TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 6 Day 1 3 Electrical Circuit nent such as a switch e TROUBLESHOOTING use continuity testing to check if there are open circuits or unconnected elements Faults and Troubleshooting l Short Circuit e A low resistance connection established by acci dent or intention between two points in an electric circuit e Current tends to flow through the path resistance is RS the lowest bypassing the rest of the circuit 10 kQ e Occurs as a result of improper wiring or broken insulation BAT1 e TROUBLESHOOTING 9V use continuity testing to check if there are accidental short circuits EE shorting circuit TRY THIS Bi a T 74
2. where in a sketch e Special Functions There are two special functions that are part of every Arduino sketch 1 setup e A function that is called once when the sketch starts e Setting pin modes or initializing libraries are placed here 2 loop e A function that is called over and over and is the heart of most sketches D Control Structures e lf Else Statement Most basic of all programming control structures It allows you to make something happen or not depending on whether a given condi tion is true or not Syntax if someCondition do stuff if the condition is true else do stuff if the condition is false optional Example int test 0 if test 1 printf Success else printf Fail While Loop Do while Loop For Loop Syntax for start condition operation do stuff until condition becomes false Example e How many times will Hello be displayed int count for count 0 count lt 15 countt printf Hello Page 12 A 0 and q Dissection of the Program e Logic 0 int ledPin 13 Store the value to a variable Logic LOW void setup Ground e g OV pinMode ledPin OUTPUT Sets pinMode z Fal e e Logic 1 void loop digitalWrite ledPin HIGH Turn on LED Logic HIGH delay 1000 Wait for 1000ms Positive e g 5V digit
3. and Workshop May 26 30 2014 Day1 1 Basic Electronics Day 1 2 Prototyping Day 1 3 Electrical Circuit Faults and Troubleshooting Day 1 1 Basic Electronics I BASIC CONCEPTS ELECTRICITY Day 1 4 Exercises Day2 Gizduino Fundamen A Charge tals lI Introduction J Basic unit from which electrical forces Il Getting Started come from B The Law of Conservation of Charge lll Sketch Fundamentals IV Digital Input Output V Analog Input Output POSITIVE NEGATIVE Day 3 amp 4 Advanced Inter J facing l Serial Communica J Charge can neither be created nor de stroyed tions it can only be transferred from one body to another Il TRC Pilot Board and Con troller C Static Electricity Ill Communications via Blue e When 2 electrically neutral objects are rubbed against each other electrons can jump from one material to another tooth IV TRC 2013 Vehicle Board l The amount of electrons that jump de pends highly on the nature of the mate rial V Mechatronics Servo and If the material loses electrons it is now positively charged If it gains electrons DC Motors it is now negatively charged TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent RUBBER D Voltage Training Topic Schedule Day1 Basic Elec
4. TRY THIS shorting circuit Ill Reverse Connection Polarity R5 10 KQ e Current flows only in one direction DC circuits e Polarity of a source can be reversed by swapping BAT1 SW5 the wires on the positive and negative terminal 9V KE connects to connects to e In DC circuits make sure the polarity is correct to to e TROUBLESHOOTING ll Open Circuit Make sure that your polarity is cor rect before plugging in the ower supply volt e An electric circuit in which the normal path of cur age ana gg ng p pp y rent has been interrupted LED turns OFF when switch is pushed e Accidental disconnection of one part of the con ducting pathway from another e Intentional by intervention of an electric compo TRAINING AND CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 7 TRY THIS ALWAYS REMEMBER e Check all connections in your circuit before con necting it with the power source e Check for accidental short and open circuits loose connections e Connect your voltage supply in the correct polarity Verify if the components placed in the circuit are correct and have correct values CO R R ECT e Check also if there are defective components a WRONG IV Over Current You do not want this
5. from 90 to 180 when moving the joystick DOWN EXTRA CHALLENGE Control TWO Servos by mapping the other Servo to the left right movement of the joystick NOTES Tagisang Robotics 2014 Training Kit Parts List A Umm TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 22
6. the circuit elements based on the circuit diagram Digital Multimeter A device used to measure test the following DC Current DC Voltage AC Voltage Resistance Continuity LED Tester ae i CATE 600v X C T unfusod JL Maxson J ha EE xi 8301 BACK LIGHT OFF 600 V gt Ja 200m 4 10A P Ec ECB EM PN Ae KE RED Meter Lead Voltage Resitance or Amperage VWmA port Positive Connection TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 4 e BLACK Meter Lead Common ground COM port Negative Connection en ime k 2M wy X J 200 Q 200k R 2200k N S SOK ee C A gt ce ECBE iit ta 2k 200 mR Awo CATI 600V er U untuseg JU MAX GOO y MAX 00 10ADC com OmA 3 F XL 8301 Ba eas V LED Test e Turn the knob and point the arrow to e PROBES the LED tester position Handles used to hold the tip on the connection LEDs will work one way only being tested e The longer wire goes to the positive e TIPS e The negative side is the shorter wire or the LED End of the probe provides the connection with the flat side point e Connect the RED meter lead to the positive side of the LED and the BLACK meter lead to the negative side of the LED IV Continuity Test e LED will light up if the LED is working e Turn the knob and po
7. 40964 BIND TO MASTER e AT BIND lt value gt Where lt value gt is equal to your slave address chang ing ALL COLONS to COMMAS ex 2013 3 40964 D Deploying Bluetooth e Close Serial Monitor unplug USB and remove MODE jumper e Plug again the USB pairs should connect after a few seconds RED LED LIGHTS UP e Open the Serial Monitor to communicate with your paired device the connection should be two way EXERCISE e Fix the Bluetooth Shield and Gizduino connection by mounting them like so e Move the Serial Comms switch to the left as seen i here e Upload the BT BasicControl sample sketch to your Gizduino e Unplug USB return the Serial Comms switch to the right e Mount one of the Gizduinos with the Bluetooth Shield back to the controller and power it with a 9V battery e On the other Gizduino connect an LED on Pin 13 then plug it on the USB connector to power it up E Character Translation e ASCII characters have their equivalent decimal e Concept used in translating is base counting e Set a terminating character to indicate when the program will stop processing e While terminating character is not encountered assume that the number being passed ends with ink LA CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 19 e RULE 3 Always te
8. Band Band Band Turning the Knob changes the re sistance of the component 4 R2 D Switch e Component that can open or close an electrical connection 10 10 10 Changing of state is activated manu ally button press p 5 Eion M i mir Violet tin amp S Di ree nde k S sw1 LED TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 3 nk LA CONSULTING Day 1 2 Prototyping 5 vertical contacts What we will be using e Components LEDs Tact Switch Resistors Potentiometers e 9V Battery and battery clip e Digital Multimeter e Breadboard Breadboard Construction base for prototyping electronics Also Known as prototyping board or protoboard Used to make temporary circuits for testing Easy to change or replace connected together contacts horizontally space for inserting ICs connected 5 oaassssseeee SKIC sue susse wut i AES TG AJ eg ee al oe en ig BA cs net anan E Se ee ae ns nhs x pS oat ee connections ll Breadboard Prototyping Disconnect the power supply from the breadboard before putting all the components Place the actual circuit component onto the bread board one by one Always check if you are placing the correct compo nent onto the breadboard Check connections between
9. FF e Gizduino has Setup a simple LED L 6 labelled PWM out analog output pins circuit and connect GND a switch as with the Pin7 8 labelled AO A7 analog input pins previous exercise TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 14 ANALOG IN ot 2 These pins are for input usage only You don t have to set the pinMode for these pins 0 Reading Analog Input e analogRead e Function to perform 10 bit ADC e Returns value from 0 1023 e Syntax analogRead channel Channel ADC channel used Example analogRead 0 E Analog Output OLGITAL 170 Clay 222 e You don t have to set the pinMode for these pins 3 5 6 9 10 11 if you are using them as analog output pins TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent analogRead Example Connect a potentiometer to the Arduino as shown below A 5V A B AO B C Gnd C int baud 9600 int channel 0 void setup Serial begin baud void loop float sensorValue analogRead channel Read value from pin Serial printin sensorValue DEC Display in decimal format Serial printin sensorValue 5 1024 0 Get the voltage delay 1000 e Open th
10. alWrite ledPin LOW Turn off LED delay 1000 Wait for 1000ms rue B Setting Pin Mode e pinMode e Configures the specified pin to behave either as an EXERCISE VARYING BLINKING SPEED l a input or an output e Change the value of the delay to 200 e Did the blinking speed of the LED s increased or Example decreased pinMode 13 OUTPUT Sets pin 13 as output e Experiment on the function delay e Syntax e Change them to any desired value Observe what happens pinMode pin mode pin the number of the pin whose mode you wish to set mode either INPUT or OUTPUT IV DIGITAL INPUT OUTPUT e Digital Discontinuous Discrete Example e Gizduino has 24 pins that can be configured as i i _ l int ledPin 13 LED connected to digital pin 13 either digital input or output digitalWrite ledPin HIGH sets the LED on delay digitalWrite ledPin LOW sets the LED off delay C Setting Pin Output digitalWrite Write a HIGH or LOW value to a digital pin syntax digitalWrite pin value pin pin number value HIGH or LOW PW thinkLAB TRAINING AND CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 13 EXERCISE BLINKING MULTIPLE LEDS e Using the switch connected to pin 7 of Arduino e Setup the circuit below on your breadbo
11. ard Modify make a program that turns ON OFF the LED your Blink code to turn ON and OFF three LEDs at Button pressed and released LED ON the same time e Modify your code to turn ON and OFF one LED at a time Button pressed and released again LED ON Button pressed and released again LED OFF x And so on VI ANALOG INPUT OUTPUT e We were able to make our microcontroller talk with our PC But the world doesn t talk digital only ana log A Analog to Digital Conversion e Converts analog voltage signals from the real world to digital 1s and O s that can be understood by the PC D Reading Pin State e It is like translating a language e digitalRead e Analog Signal e Reads the value from a specified digital pin Sound e Returns either HIGH or LOW Temperature e Syntax Light odigitalRead pin pin the number of the digital pin you want to Digital Signal read int e eano Example int inPin 7 pushbutton connected to digital pin 7 a digitalRead inPin read the input pin 1110 EXERCISE PUSHBUTTON SWITCHING eie e Setup a simple LED circuit Use pin 4 e Connect a switch as shown e Using the switch connected to pin 7 of Arduino make a program that turns ON OFF the LED e Button pressed LED ON 9 5V e Button not pressed LED OFF 10101010 11001111 B Analog Input Output CHALLENGE LIGHTS 10K Switch e Analog Continuous ON LIGHTS O
12. document cannot be reproduced or used for purposes other than TRC without prior consent Page 9 BAT1 DAY 2 GIZDUINO e Data Acquisition FUNDAMENTALS ae e Robotics C Arduino I Introduction e Arduino is an open source physical computing plat form based on a simple microcontroller board and a development environment for writing software for the board Computer o D Application Yr 4 e The Gizduino board available at E gizmo is based on Arduino Diecimila a microcontroller board based on ATMega164 324 644 A What is a micronctroller e Arduino comes with its own open source Integrated Development Environment IDE e Why Arduino oT WY G PELEV VU EV EYEE YY ETELE hie Inexpensive reeititititiiitt eTSESSELESESESSEES gt 35 ace GELE oot mae f Cross platform f gt a w pegus e we isa Wee ete gt gt gt o gt w gt gt gt Simple clear programming environment Open source and extensible software Open source and extensible hardware D Integrated Development Environment e One chip solution e Highly integrated chip that includes all or most of File Edit Sketch Tools Help the parts needed for a controller CPU _ RAM ROM O Ports Timer Interrupt Controller e t connects to the Arduino hardware to upload pro grams and communicate with them e Contai
13. e Serial Monitor e Turn the potentiometer knob e What happens to the voltage when the knob is turned fully clockwise e What happens to the voltage when the knob is turned fully clockwise e What happens to the voltage when the knob is turned halfway across its full range ink LA CONSULTING Page 15 Pulse Width Modulation Pulse Width Modulation 0 Duty Cycle analogWrite 0 Sv Ov 25 Duty Cycle analogWrite 64 Sv Ov 50 Duty Cycle analogWrite 127 Sv Ov 75 Duty Cycle analogWrite 191 Sv Ov 100 Duty Cycle analogWrite 255 Sv Ov F Writing Analog Output analogWrite Supported pins 3 5 6 9 10 11 Function to perform 8 bit DAC Value ranges from 0 255 0 5 volts counterpart syntax analogWrite pin value Pin the pin to write to EXERCISE PULSE WIDTH MODULATION CHALLENGE POTENTIOMETER CONTROL TO Create a sketch that changes the brightness of an LED by turning the knob on a potentiometer LED any PWM pin and GND Potentiometer wiper to AO Potentiometer outer pins to 5V and GND BLINKING LEDS Construct the LED setup shown below LED1 On if pot is set fully clockwise LED2 On if pot is set halfway LED3 On if pot is set fully counter clockwise Otherwise all LEDs are turned OFF analogWrite Example Setup an LED circuit in your breadboard Connect it to ANY PWM PIN ty Ik GND int ledPin 15 OR ANY PWM PIN void setup void loop fade in fr
14. eproduced or used for purposes other than TRC without prior consent TRAINING AND CONSULTING Page 11 ll Sketch Fundamentals We will now analyze the Blink code that we uploaded earlier In this section we will learn the following A Sketch B Comments C Variables D Functions E Control Structures A Sketch e Sketch is the unit of code that is uploaded to and run on an Arduino board e Example Blink The sketch uploaded earlier B Comments e Comments are ignored by the Arduino when it runs the sketch e It is there for people reading the code to explain what the program does how it works or why it s written the way it is e For multi line comment use and e For single line comment use e Example Multi line comment Blink Turns on an LED on for one second then off for one second repeatedly Single line comment LED connected to digital pin 13 C Variables e Place for storing a piece of data e Variable has a name a value and a type e Example int pin 13 In the statement pinmode pin OUTPUT It would be equivalent to the following statement pinmode 13 OUTPUT D Functions e Also known as procedure or subroutine e Anamed piece of code that can be used from else TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent
15. f the current coming from the motor s power supply Direction is binary logic e Numerous ways to implement this control scheme Collective term DC Motor Driver H Bridge configuration is the most com monly used and simplest to build TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 20 e Hybrid Driver Electro mechanical solution for controlling DC Motor speed and di rection Rugged design allows high cur rent use with additional safety fea tures such as fused inputs and iso lated microcontroller connections C Hybrid_RunTest sample sketch e Upload Hybrid RunTest sample sketch to your Gizduino e Completely wire the minimum set of connections to the Vehicle Board Dock your Gizduino and turn all switches ON D Servo Motor e Composed of an electric motor mechanically linked to a potentiometer interfaced with a control chip e Signals are translated into position commands e Servo motors usually has three wires for power ground and control Se Supported by Servo library for easy interfacing with Arduino system SERVO GIZDUINO Red 5V Brown GND Yellow Gizduino Pin Sketch gt ImportLibrary gt Servo E Servo Motor Control Create a Servo object Servo lt name gt Declare Servo presence to Gizduino Identified by the lt name g
16. int the arrow to the continuity tester position e Connect the tips of the black and red probes of the multitester you should hear a an audible alarm when they are connected AA PI D3 e Disconnect power source first before performing continuity testing e Connect the test leads across the wire leads you VI Resistance Measurement want to check for continuity e Turn the knob and point the arrow to e An audible alarm will be heard if they are connect Peolianee MEAS UEMEN Poe ed if not check the wire or the connection e Disconnect any power source before WARNING costae e Remove the component from the circuit before test ing e Set the dial to the lowest value Do not use the continuity testing for power sources like batteries or power supplies e lf OLor 1 appears move to the next level e Test the tact switch e Connect the test leads across terminals you want to measure resistance at DO NOT TEST POWER SOURCES Which leads are always connected Which leads are connected when you push the switch VW thinkLAB TRAINING AND CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 5 e Get your potentiometer e Measure resistance from the ff 1 Both ends of the pot 2 Left end and middle of the pot 3 Right end and middle of the pot TRY THIS
17. l difference across the two points I Power Equation P IxV e Equivalent to the work done per unit time e Produced by the flow of charges current passing through an electric potential difference voltage J Water Analogy TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Batteries Output does Work Power Wattage Pressure Voltage Valve creates resistance Low pressure reading lower voltage K Circuit Diagram Standard way of illus trating the components and connections in an electronics circuit e llustrated with the use of circuit element symbols Page 2 ll COMMON CIRCUIT ELEMENTS AND SYMBOLS ve al BAT1 _ 1 2 3 sm 4 R1 R2 C1 L1 D2 D1 NA 7 g 9 10 V4 part e Keeps passage of current to one 9v i A Voltage Source T direction only e Device that supplies a constant e Chemicals inside react differently to voltage an applied voltage producing color e By virtue of Ohm s Law this de vice also supplies a relative amount of current B Resistor e Current limiting component D1 RN e Colored bands determine the re sistor s value within a range C Potentiometer r E Resistors with variable sistance Standard EIA Color Code Taple 4 Band 2 5 and 10 values 1st 2nd 3rd 4th Band
18. mega644 Sanguino mode Serial Port gt Gizduino mini w ATmega324 Sanguino mode Gizduino mini w ATmegal64 Sanguino mode Programmer y Arduino Uno Burn Bootloader Arduino Duemilanove w ATmega328 Arduino Diecimila or Duemilanove w ATmega168 e Select the serial device of the Arduino board from the Tools gt Serial Port menu To find out you can disconnect your Arduino board and re open the menu the entry that disappears should be the Ar duino board Reconnect the board and select that serial port sketch_may24b Arduino 1 0 1 Eon xX File Edit Sketch Help Auto Format Archive Sketch Fix Encoding amp Reload Ctrl T sketch_may24 Serial Monitor Ctrl Shift M Board gt Serial Port gt COM3 Programmer gt Burn Bootloader E Uploading the Program e Save the sketch as Blink AUS O OO File Edit Sketch Tools Help Blink it Riaml e Click Verify button to check your code for syntax errors After compiling click Upload button in the environment If the upload is successful the mes sage Done Uploading will appear in the status bar e A few seconds after the upload finishes you should see pin13 L LED on the board start to blink in orange If it does congratulations You ve gotten Ar duino up and running thinkLAB TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be r
19. nalog Pin 1 e Wireless Medi Left stick X axis Analog Pin 2 um Right stick Y axis Analog Pin 3 i ante Right stick X axis Analog Pin 4 ll ZigBee RF LEFT button Digital Pin 10 Ae RURAS e Transmits wirelessly at low power 1 mW DOWN button Digital Pin 11 e Distance is limited to 10m radius RIGHT button Digital Pin 12 Uses spread spectrum frequency hopping Digital Pin 5 C Configuring Bluetooth U Il board set POWER to INT short MODE pins e While docked upload the _ pilot_board_ debug sketch to your Gizduino Biy N OO J E e s f Bluetooth Shield e Open the Serial Monitor to view the outputs TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 18 e Using jumper wires connect the following pins GIZDUINO BT SHIELD RX Pin TX Pin 5V e Upload BIconfig sketch for Bluetooth Shield con figuration e Open the Serial Monitor and set the baud rate to 38400 also make sure the return line is set to Both NL amp CR e Type AT on the reply box The Bluetooth device should reply and print OK ROLE e for MASTER type AT ROLE 1 e for SLAVE type AT ROLE 0 BAUD RATE e AT UART 38400 0 0 PAIRING KEY e AT PSWD xxxx Where xxxx represents a 4 digit number SLAVE ADDRESS e AT ADDR If successful device will reply with a colon separated digit string ex 2013 3
20. ns Toolbar Text Editor x Status Bar B Microcontroller Applications Console e Environmental Monitoring M enus e Automobiles TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 10 ll Getting Started Materials needed A Gizduino Board USB Cable Connect Arduino to PC e Connect the Gizduino board to you computer using the USB Cable The green power LED should turn on B Launching Arduino IDE e Double z Click the be Arduino gt application ARDUINO arduino 1 0 1 C Creating a sketch e Type the sketch below int ledPin 13 void setup pinMode ledPin OUTPUT void loop digitalWrite ledPin HIGH delay 1000 digitalWrite ledPin LOW delay 1000 D Setting up Arduino IDE e Go to Tools gt Board menu and select Gizduino w ATmega644 Gizduino X ATmega1281 Gizduino w ATmega644 Gizduino w ATmega324 Gizduino w ATmegal64 sketch_may2 Ae Gizduino mini w ATmega328 File Edit Sketch Help Gizduino mini w ATmegal68 Auto Format Ctrl T Gizduino mini w ATmega88 16 MHz Archive Sketch Gizduino mini w ATmega8 8 MHz sketch_may24 5 SA ase Fix Encoding amp Reload Gizduino miniUSB w ATmega328 Serial Monitor Ctrl Shift M Gizduino miniUSB w ATmegal68 Baal gt Gizduino mini w AT
21. om min to max in increments of 5 points for int fadeValue 0 fadeValue lt 255 fadeValue 5 analogWrite ledPin fadeValue sets value 0 to 255 delay 30 fade out from max to min in increments of 5 points for int fadeValue 255 fadeValue gt 0 fadeValue 5 analogWrite ledPin fadeValue sets value 0 to 255 delay 30 What is performed in this sketch NOTES TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 16 DAY 3 amp 4 ADVANCED Cae for STRING enclose in double INTERFACING Serial Communications void setup Serial begin 9600 e How it talks with your PC A USB ane velo B PL2303 chip Serial printIn Hello World C Serial pins delay 1000 D Poll the Serial line for incoming data e variable Serial available e Returns the number of bytes to be read int data type e IMPORTANT leave the inside of the parenthe sis BLANK E Read the first byte of incoming data e variable Serial read e Need to store the read data inside a variable int or e The Gizduino communicates serially Serial one after another char data type x Stream of 1 s and 0 s e IMPORTANT data is read byte by byte or ONE CHARACTER PER READ COMMAND needs A UART Universal Asynchronou
22. rminate all connections to the Vehicle Board in the proper polarity GND goes to GND supply goes to supply 2X 1 2 1x10 10 IV Mechatronics Servo and DC Motors 5 x 100 500 A DC Motor 512 B Tricky to connect to microcontrollers e Needs a lot of power to run e Produces lots of electrical noise that may interfere with microcontroller pin outputs N Z 50 48 2x T 49 48 1x10 10 5 53 48 5x100 500 512 When electric current passes through a coil in a magnetic field the magnetic force produces a torque which turns the the current digit lll TRC 2013 Vehicle Board e RULE 1 Never place the Vehicle Board on near any metallic or conductive surface material the current each half revolution to keep th e RULE 2 Make sure battery cable connectors are nec ae paietiant the connected to the battery in proper polarity externally through Y coil in the same a commutator direction ThinkLab TRC VEHICLE BOARD v 2 TRC2813 e Provide separate power source for the DC Motor NEVER POWER IT STRAIGHT FROM GIZDUINO PINS or 5V 7 e Ensure all ground points GND are connected common B DC Motor Control e SPEED ag fag Pulse Width Modulation PWM Se ides e Supported by Gizduino pins 3 5 6 9 10 EERE Recall analogWrite e DIRECTION Motor Direction follows Source Current Direction Needs external circuitry that will reverse the direction o
23. s Receiver extra processing if expected data are STRINGS Transmitter e Main communications device employed on the void setup board Serial begin 9600 Accompanies the RS232 communications stand ard made available to almost all electronic mod ules with a communications interface void loop if Serial available gt 0 eo l B har ReceivedByte Serial read B Initialize Serial communications char ReceivedByte Serial read f Serial print ReceivedByte e Serial begin lt baud gt delay 10 e Need to do this ONCE usually first command in setup e The value lt baud gt specifies the baud rate to be i used e g 9600 38400 115200 etc NOTES e IMPORTANT baud rates between communi cating devices MUST MATCH C Pass data to the Serial port Serial printIn lt value gt e Can also use Serial print e Able to display any value or data represented by lt value gt e IMPORTANT for CHAR enclose lt value gt in sin VW thinkLAB TRAINING AND CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 17 TRC Pilot Board and Controller e NOTE Make sure the Seri al Monitor baud rate is set at 38400 Il Communications via Bluetooth A Communications e Wired Medium Serial UART INPUT ACCESS SPI 2C Left stick Y axis A
24. t parameter give your Servo a name label Attach the servo to a Gizduino pin lt name gt attach pin Bind the Servo to a specific pin on the Gizduino pin will provide the rotation data for the attached Servo All DIO pins are supported able to control multiple Servo motors Set angle of rotation lt name gt write angle Rotates the shaft based on the specified value angle between 0 to 180 only Position is held until a new value angle is given or the power to the Servo is reset Use for loops to count from O to 180 and back Reconnect your potentiometer and use it to control your Servo make Sevo follow the rotation of the potentiometer knob 5V A AO B Gnd C TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent VW thinkLAB TRAINING AND CONSULTING Page 21 F Servo Motor Tips CHALLENGE SERVO CONTROL VIA BLUE Power consumption of the Servo is directly propor tional to its load that is the heavier the load the more current it draws All Servos are rated with a Stall Torque value or the maximum load it can carry at a given operating voltage Displacement of the load increases as it is placed farther away from the shaft on the Servo arm TOOTH Using the right controller joystick move the Servo from 90 to 0 when moving the joystick UP and move
25. to happen to you e A condition when the current in the circuit is larger than the intended current exists through a conduc tor e May be caused by a short circuit loose connection excessive load and incorrect design e TROUBLESHOOTING Check if there accidental short cir cuits defective components and incorrect components value blown fuse due to overcurrent eee DAY 1 4 EXERCISES EXERCISE 1 e Remove one leg of the resistor from the bread board what happens e Place a jumper wire across the LED what hap TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this document cannot be reproduced or used for purposes other than TRC without prior consent Page 8 DAY 1 4 EXERCISES R1 10 kO 2 BAT1 9V R1 10 kQ KE e Try turning the potentiometer knob to both sides what happens to 2 How about 3 e Why did the LED at 3 turned off when turning the pot to one side AA 4 Z SW8 R5 D2 510 Q S S Sw9 SW10 o o BAT1 R6 R7 510 Q 10 KQ D3 A D4 e Use jumper wires as your switches e What happens to the LED when you remove the wire at A at B at C e Observe the light intensity of the LED in 5 and 6 which one is brighter Why R7 10 KQ R8 10 KQ 10 KQ 10 KQ BAT2 T 9v l D V D5 thinkLAB TRAINING AND CONSULTING TRC 2014 TRAINING MANUAL Created by ThinkLab exclusively for TRC 2014 only this
26. tronics and Prototyping Day 2 Gizduino Fundamentals Day 3 4 Advanced Interfacing Day 5 Mini Project When this phenomenon happens in a controlled environment it produces the electricity we encounter and use every day GLASS lt V etemen Potential Difference The work required to move a charge from one point to another The unit for voltage is volts V joules colomb Vaement is the voltage ACROSS the element E Current The net flow or motion of charges DC single di rection AC both direction back and forth I element e Telement IS the current THROUGH the element fe TRAINING AND CONSULTING Page 1 e Unit for current is amperes A colomb sec R F Resistance element e The ability of any material to limit the amount of current v passing through when a poten tial difference is applied Unit for resistance is ohms Relement iS the quantified e resistance of the element Q volt ampere G Electrical Circuit e Any arrangement of elements representing the 3 concepts that permits current to flow e Current flows once the circuit connection is closed e Breaking the connection disrupts the current flow e Batteries provide voltage e Current flows charges turn on bulb e All elements present have various resistance val ues H Ohm s Law V IxR The current through an ideal conductor between two points is proportional to the potentia
Download Pdf Manuals
Related Search
Related Contents
Manual SBX-3 Severin AT2586 Tamron AF 28-80mm f3.5-5.6 Aspherical (Nikon AF) 番 NPW532 2 - Club d`Astronomie de Lyon Ampère FiBER FORCE® CST®: Technologie de câble à pillier Cooling - Cooling Troubleshooting Copyright © All rights reserved.
Failed to retrieve file