Manual for Arduino Kit v1.0

Slides:



Advertisements
Similar presentations
Wireless Cue Light Project
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Lecture 8: Serial Interfaces
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Parallax 4x20 LCD (part number 27979) with Arduino Duemilanove
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
DPNM Lab., POSTECH 1/25 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Project Futura.
Bluetooth Controller Setting up the BT controller and Arduino with Processing.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
HMC5883L TYWu.
Basic Circuits – Lab 5 Wireless Networking Xmedia Spring 2011.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Motor TYWu.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)
Pulse-Width Modulation: Simulating variable DC output
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Hacking on Arduino George Patterson
physical computing .2 – Day 3
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Using a SparkFun™ serial LCD with an Arduino
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
Getting Started: Building & Programming
Application of Programming: Scratch & Arduino
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
Val Manes Department of Math & Computer Science
Microcontroller basics
Wireless Cue Light Project
Raspberry Pi <--> Arduino
Arduino & its hardware interfacing
Arduino Programming Part II
Microcontroller basics
UTA010 : Engineering Design – II
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino - Introduction
3.1 Serial Communication Part 1
Roller Coaster Design Project
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
IoT Programming the Particle Photon.
Intro to the Arduino Topics: The Arduino Digital IO
Introducing the Arduino Uno
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Aeroponic Engineering and Vertical Farming
Setting up a basic program with Arduino
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Introduction to Arduino IDE and Software
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Manual for Arduino Kit v1.0

IoT Application Version 1.0 1st week of Oct : Purchased V1.0 Released!

Contents Components and Sensors Environment of computer Arduino Uno Magnetic sensor (HMC5883L) Bluetooth sensor (HC-06) Others DC Motor with SN754410(DC Motor Controller) Volts and nuts Etc. Ultrasonic sensor (HC-SR04) Photocell Servo Motor Sound Sensor Environment of computer Computer specification How to install Arduino Sketch Install BT Chat App Assemble RC Car Required tools How to assemble RC Car Test RC Car

Components and Sensors – Arduino Uno

Components and Sensors – Magnetic sensor (HMC5883L)

Components and Sensors – Bluetooth sensor (HC-06) Change 0 pin to 12 pin and 1 pin to 13 pin

Components and Sensors – DC Motor with Controller (SN754410) Black Red Battery Battery Arduino GND Arduino VIN Red Black Motor 1

Environment of computer – Computer specification PC OS Windows7 Smart phone Prepare devices with bluetooth to connect to Arduino

Environment of computer – How to install Arduino Sketch Get Arduino Sketch installer https://www.arduino.cc/en/Main/Software Connect Uno board to PC Driver for Uno will be installed automatically Run Arduino Sketch Select board and port from sub-entry of tools Board : Arduino/Genuino Uno Port : Select Arduino port

Environment of computer – Install BT Chat App Get installer https://play.google.com/store/apps/details?id=com.har dcopy.btchat

Assemble RC Car – Required tools Screwdriver Long Nose Plier (option) Wire Stripper (option)

Assemble RC Car – How to assemble RC Car Use 3mm X 6mm volts.

Assemble RC Car – How to assemble RC Car Use 3mm X 6mm volts.

Assemble RC Car – How to assemble RC Car Use 3mm X 8mm volts.

Assemble RC Car – How to assemble RC Car

Assemble RC Car – How to assemble RC Car Use 3mm X 6mm volts.

Assemble RC Car – How to assemble RC Car Use 3mm X 6mm volts.

Assemble RC Car – How to assemble RC Car

Assemble RC Car – How to assemble RC Car

Assemble RC Car – How to assemble RC Car Use SN754410 Motor Driver.

Assemble RC Car – How to assemble RC Car Complete view of RC Car

Test – Bluetooth Connect LED between 2 pin and GND on Arduino Connect Arduino and PC Run Arduino Uno Compile code from the next slide Run BT Chat Connect HC-06 Default password is 1234 Send the ‘h’ message. If you receive the same message and then turn on the LED, it implies that the test is completed successfully. Send the ‘j’ message and turn off the LED

Test – Bluetooth Code #include <SoftwareSerial.h> SoftwareSerial BTSerial(12,13); char val; // variable to receive data from the serial port int ledpin = 2; // LED connected to pin 48 (on-board LED) void setup() { pinMode(ledpin, OUTPUT); // pin 48 (on-board LED) as OUTPUT BTSerial.begin(9600); // start serial communication at 9600bps Serial.begin(9600); } void loop() { if( BTSerial.available() ) // if data is available to read { val = BTSerial.read(); // read it and store it in 'val' if( val == 'h' ) // if 'H' was received digitalWrite(ledpin, HIGH); // turn ON the LED BTSerial.write(val); Serial.write(val); Serial.print(val); else if(val == 'j') { digitalWrite(ledpin, LOW); // otherwise turn it OFF val = '\0'; delay(100); // wait 100ms for next reading

Test – Magnetic sensor (HMC5883L) Better to solder HMC5883L and pin headers. Because it isn’t fitted well. Connect Arduino and PC Compile the code Click the serial monitor You can see that values are changing when you move the sensor.

Test – Magnetic sensor (HMC5883L) code #include <Wire.h> //I2C Arduino Library #define address 0x1E //0011110b, I2C 7bit address of HMC5883 void setup(){ //Initialize Serial and I2C communications Serial.begin(9600); Wire.begin(); //Put the HMC5883 IC into the correct operating mode Wire.beginTransmission(address); //open communication with HMC5883 Wire.write(0x02); //select mode register Wire.write(0x00); //continuous measurement mode Wire.endTransmission(); } void loop(){ int x,y,z; //triple axis data //Tell the HMC5883 where to begin reading data Wire.beginTransmission(address); Wire.write(0x03); //select register 3, X MSB register //Read data from each axis, 2 registers per axis Wire.requestFrom(address, 6); if(6<=Wire.available()){ x = Wire.read()<<8; //X msb x |= Wire.read(); //X lsb z = Wire.read()<<8; //Z msb z |= Wire.read(); //Z lsb y = Wire.read()<<8; //Y msb y |= Wire.read(); //Y lsb float rad = atan2(y, x) ; float degree = rad * 180 / PI ; //Print out values of each axis Serial.print("x: "); Serial.print(x); Serial.print(" y: "); Serial.print(y); Serial.print(" z: "); Serial.print(z); Serial.print(" deg : ") ; Serial.println(degree) ; delay(250);

Test – RC Car Connect Arduino and PC Run Arduino Uno Compile the code from the next slide Run BT Chat Connect HC-06 Default password is 1234 Send message types ‘a’ : turn left ‘d’ : turn right ‘s’ : stop ‘w’ : forward ‘x’ : back

Test – RC Car code #include <SoftwareSerial.h> // 소프트웨어 시리얼 SoftwareSerial mySerial(12, 13); // RX, TX int speedPinA = 3; int speedPinB = 9; int dir1PinA = 6; int dir2PinA = 7; int dir1PinB = 10; int dir2PinB = 11; byte incomingByte; int speed_value_motorA; int speed_value_motorB; void setup() { mySerial.begin(9600); // set digital i/o pins as outputs: pinMode(speedPinA, OUTPUT); pinMode(speedPinB, OUTPUT); pinMode(dir1PinA, OUTPUT); pinMode(dir2PinA, OUTPUT); pinMode(dir1PinB, OUTPUT); pinMode(dir2PinB, OUTPUT); //Initial status digitalWrite(dir1PinA, LOW); digitalWrite(dir2PinA, LOW); digitalWrite(dir1PinB, LOW); digitalWrite(dir2PinB, LOW); } void loop() { // control the speed 0- 255 speed_value_motorA = 255; // half speed speed_value_motorB = 255; // half speed analogWrite(speedPinA, speed_value_motorA); analogWrite(speedPinB, speed_value_motorB); if (mySerial.available() > 0) { incomingByte = mySerial.read(); if (incomingByte == 'a') //left { digitalWrite(dir1PinB, HIGH); if (incomingByte == 'd') //right digitalWrite(dir1PinA, HIGH); if (incomingByte == 's') //Stop if (incomingByte == 'w') //Forward digitalWrite(dir2PinA, HIGH); digitalWrite(dir2PinB, HIGH); if (incomingByte == 'x') //Back

Reference http://mechasolutionwiki.com/index.php?title=%E C%95%84%EB%91%90%EC%9D%B4%EB%85%B8#. EC.95.84.EB.91.90.EC.9D.B4.EB.85.B8_.EB.B0.B0.EC .9A.B0.EA.B8.B0