background image

Obstacle Avoidance Smart Car Kit

Summary of Contents for Obstacle Avoidance Smart Car Kit

Page 1: ...Obstacle Avoidance Smart Car Kit...

Page 2: ......

Page 3: ...n 2 Add Libraries and Open Serial Monitor 20 Lesson 3 Blink 32 Lesson 4 Installation Method 43 Lesson 5 Servo 54 Lesson 6 Ultrasonic Sensor Module 57 Lesson 7 IR Receiver Module 62 Lesson 8 L298N Moto...

Page 4: ...We are cooperating with a lot of companies from diffirent countries Also help them to purchase electronic component products in china and became the biggest supplier of them We look forward to build c...

Page 5: ...utorial This tutorial include codes labraries and lessons It is designed for beginners It will teach every users how to assembly the smart robot car kit and use Arduino controller board sensors and mo...

Page 6: ...4 78 Packing list...

Page 7: ...The Arduino software that you will use to program your Arduino is available for Windows Mac and Linux The installation process is different for all three platforms and unfortunately there is a certai...

Page 8: ...6 78 STEP2 Download the development software that is compatible with the operating system of your computer Take Windows as an example here...

Page 9: ...7 78 Click Windows Installer Click JUST DOWNLOAD...

Page 10: ...sion 1 8 0 is available in the material we provided and the versions of our materials are the latest versions when this course was made Installing Arduino Windows Install Arduino with the exe Installa...

Page 11: ...9 78 Click I Agree to see the following interface...

Page 12: ...10 78 Click Next You can press Browse to choose an installation path or directly type in the directory you want...

Page 13: ...11 78 Click Install to initiate installation Finally the following interface appears click Install to finish the installation...

Page 14: ...12 78 Next the following icon appears on the desktop Double click to enter the desired development environment...

Page 15: ...d skip the contents below and jump to the next section But if you want to learn some methods other than the installation package please continue to read the section Unzip the zip file downloaded Doubl...

Page 16: ...14 78...

Page 17: ...he LED will light up and you may get a Found New Hardware message from Windows Ignore this message and cancel any attempts that Windows makes to try and install drivers automatically for you The most...

Page 18: ...16 78 Right click on the device and select the top menu option Update Driver Software...

Page 19: ...78 You will then be prompted to either Search Automatically for updated driver software or Browse my computer for driver software Select the option to browse and navigate to the X arduino1 8 0 driver...

Page 20: ...llow the software to be installed Once the software has been installed you will get a confirmation message Windows users may skip the installation directions for Mac and Linux systems and jump to Less...

Page 21: ...will ask you to install Java runtime library if you don t have it in your computer Once the installation is complete you can run the Arduino IDE Installing Arduino Linux You will have to use the make...

Page 22: ...For example the built in LiquidCrystal library makes it easy to talk to character LCD displays There are hundreds of additional libraries available on the Internet for download The built in libraries...

Page 23: ...we will install the Bridge library Scroll the list to find it then select the version of the library you want to install Sometimes only one version of the library is available If the version selection...

Page 24: ...vailable in the Include Library menu If you want to add your own library open a new issue on Github Importing a zip Library Libraries are often distributed as a ZIP file or folder The name of the fold...

Page 25: ...IDE navigate to Sketch Include Library At the top of the drop down list select the option to Add ZIP Library You will be prompted to select the library you would like to add Navigate to the zip file s...

Page 26: ...24 78...

Page 27: ...Manual installation To install the library first quit the Arduino application Then uncompress the ZIP file containing the library For example if you re installing a library called ArduinoParty uncomp...

Page 28: ...p and h files just make sure they re all there The library won t work if you put the cpp and h files directly into the libraries folder or if they re nested in an extra folder For example Documents Ar...

Page 29: ...ided to include a serial terminal with the software Within the Arduino environment this is called the Serial Monitor Making a Connection Serial monitor comes with any and all version of the Arduino ID...

Page 30: ...which port to open in the Serial Monitor is the same as selecting a port for uploading Arduino code Go to Tools Serial Port and select the correct port Tips Choose the same COM port that you have in...

Page 31: ...29 78 Once open you should see something like this...

Page 32: ...ndle most of your serial communication needs The first setting you can alter is the baud rate Click on the baud rate drop down menu to select the correct baud rate 9600 baud Last you can set the termi...

Page 33: ...connection with your Arduino If you re already working in the Arduino IDE there s really no need to open up a separate terminal to display data Cons The lack of settings leaves much to be desired in...

Page 34: ...Fistly you need to download and intall UNO CH340G driver The UNO R3 board has rows of connectors along both sides that are used to connect to several electronic devices and plug in shields that exten...

Page 35: ...which it blinks In Lesson 0 you set up your Arduino IDE and made sure that you could find the right serial port for it to connect to your UNO R3 board The time has now come to put that connection to...

Page 36: ...34 78 When the sketch window opens enlarge it so that you can see the entire sketch in the window...

Page 37: ...upload them to an UNO R3 board but if you change them you cannot save them as the same file Since we are going to change this sketch the first thing you need to do is save your own copy From the File...

Page 38: ...36 78 You have saved your copy of Blink in your sketchbook This means that if you ever want to find it again you can just open it using the File Sketchbook menu option...

Page 39: ...37 78 Attach your Arduino board to your computer with the USB cable and check that the Board Type and Serial Port are set correctly...

Page 40: ...it could be COM3 or COM4 on your computer A right COM port is supposed to be COMX arduino XXX which is by the certification criteria The Arduino IDE will show you the current settings for board at th...

Page 41: ...n the Arduino should start to flicker as the sketch is transferred Finally the staus will change to Done The other message tells us that the sketch is using 928 bytes of the 32 256 bytes available Aft...

Page 42: ...check your installation Once the upload has completed the board should restart and start blinking Open the code Note that a huge part of this sketch is composed of comments These are not actual progr...

Page 43: ...PUT Every Arduino sketch must have a setup function and the place where you might want to add instructions of your own is between the and the In this case there is just one command there which as the...

Page 44: ...the parameter in for the delay command This delay period is in milliseconds so if you want the LED to blink twice as fast change the value from 1000 to 500 This would then pause for half a second each...

Page 45: ...43 78 Lesson 4 Installation Method...

Page 46: ...44 78...

Page 47: ...45 78...

Page 48: ...46 78...

Page 49: ...47 78...

Page 50: ...48 78...

Page 51: ...49 78...

Page 52: ...50 78...

Page 53: ...51 78...

Page 54: ...52 78...

Page 55: ...53 78...

Page 56: ...re As simple as that Servo motors were first used in the Remote Control RC world usually to control the steering of RC cars or the flaps on a RC plane With time they found their uses in robotics autom...

Page 57: ...55 78 Connection diagram...

Page 58: ...onto your Arduino board See Lesson 3 for details about program uploading if there are any errors Before you can run this make sure that you have installed the Servo library or re install it if necess...

Page 59: ...itters receiver and control circuit The basic principle of work 1 Using IO trigger for at least 10us high level signal 2 The Module automatically sends eight 40 kHz and detect whether there is a pulse...

Page 60: ...the time interval between sending trigger signal and receiving echo signal Formula us 58 centimeters or us 148 inch or the range high level time velocity 340M S 2 we suggest to use over 60ms measureme...

Page 61: ...59 78 Wiring diagram...

Page 62: ...the sensor After wiring please open the program in the code folder Lesson 6 Ultrasonic Sensor Module and click UPLOAD to upload the program See Lesson 3 for details about program uploading if there ar...

Page 63: ...61 78 Open the monitor then you can see the data as blow Click the Serial Monitor button to turn on the serial monitor The basics about the serial monitor are introduced in details in Lesson 1...

Page 64: ...ibrary that was designed for this particular sensor Introduction IR is widely used in remote control With this IR receiver Arduino project is able to receive command from any IR remoter controller if...

Page 65: ...63 78 Wiring diagram...

Page 66: ...erwise your code won t work For details about loading the library file see Lesson 3 In this lessson we need to use a IR remote control which has 17 functional key and its launching distance is 8 meter...

Page 67: ...65 78 Remote control code...

Page 68: ...contains two complete H Bridge circuits so it is capable of driving a pair of DC motors This makes it ideal for robotic projects as most robots have either two or four powered wheels The L298N can als...

Page 69: ...nterference ability This module can use built in 78M05 for electric work via a driving power supply part But to avoid the damage of the voltage stabilizing chip please use an external 5V logic supply...

Page 70: ...68 78 Wiring diagram...

Page 71: ...See Lesson 3 for details about program uploading if there are any errors After connection and power on two motors rotate clockwise for 2 second at a speed of 200 PWM value is 200 and then stop for 2 s...

Page 72: ...controller as main control uses IR module to receive IR remote signal and send the signal to Arduino Arduino will analyses the signal and then control the driver motor and the motion of the car with I...

Page 73: ...71 78 Connection Schematic...

Page 74: ...72 78 Wiring diagram...

Page 75: ...lick UPLOAD to upload the program See Lesson 3 for details about program uploading if there are any errors Before you can run this make sure that you have installed the IRremote library or re install...

Page 76: ...motor and send the feedback to Arduino Arduino will analyses the feedback signal and then control the driver motor to adjust the car diversion Finally the car is able to avoid obstacle automatically...

Page 77: ...e between the car and obstacle is less than 35 cm the car goes backward if the distance is no less than 10 cm the car goes forwards if the distance is less than 60 cm the motor turns to detect the dis...

Page 78: ...76 78 Connection Schematic...

Page 79: ...77 78 Wiring diagram...

Page 80: ...ick UPLOAD to upload the program See Lesson 2 for details about program uploading if there are any errors Before you can run this make sure that you have installed the Servo HC SR04 library or re inst...

Reviews: