Lab#3 : Arduino To Proteus Simulation For Simulate Arduino Program That .

1y ago
48 Views
2 Downloads
608.77 KB
12 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Brenna Zink
Transcription

Eng.mohammed AlbhaisiLab#3 : arduino to proteus simulationfor simulate Arduino program that you wrote you have to have these programs :1-Arduino C2-proteus3- Virtual Serial Port Driver4-Arduino library to proteusYou must do following Steps if you want to simulate your program:1-We must make virtual port using Virtual Serial Port DriverHere we make virtual port between COM1 and COM22- choose port and Arduino type from toolsHints : Here we connected arduino to COM 1

Eng.mohammed Albhaisi3-write your code , then write code to initialize serial communication (you may need itsometimes )void setup(){//initialize serial communications at a 9600 baud rateSerial.begin(9600);}4-after you finish your code , then choose from Sketch Export compiled Binary to get hex file .5- choose Arduino uno from protues ,then connect COMPIM(serial port) to arduino Rx fromArduino to Rx in COMPIM and vice versa ,then choose port COM2 in COMPIM ,and change baudrate to 9600 (or try 115200 )

Eng.mohammed AlbhaisiHints : here we choose COM 2 because we connect arduino to COM 16-upload hex file to arduino that you export it in step number four .

Eng.mohammed AlbhaisiExample # 1 : lm 35 sensorFirst code Arduino C :const int sensorPin A0;int reading;float voltage;float temperatureC;void setup() {// put your setup code here, to run once:Serial.begin(9600);}void loop() {// put your main code here, to run repeatedly:reading analogRead(sensorPin);voltage tln("volts");temperatureC (voltage -0.5)*100;Serial.println("Temperature degrees C");delay(1000);}Second connect your circuit at proteus program as following :

Eng.mohammed AlbhaisiExample # 2 : PWMArduino C :Second proteus :

Eng.mohammed AlbhaisiExample # 3 : Servo motorArduino C :Second proteus :

Eng.mohammed AlbhaisiExample # 4 : Ultra sonicHC-SR04 ultrasonic ranging module.HC-SR04 is the ultrasonic ranging module used here. HC-SR04 consists of an ultrasonictransmitter, receiver and necessary electronics for making it a stand alone system. Theoperating principle is very simple. It sends 8 pulses of 40KHz sound waves, and picks up thereflected wave. The time lag between the transmission and reception is measured and thedistance is calculated from the equation D TS/2. Where D is the distance, T is the time lagand S is the speed of sound. The output of the HC-SR04 will be a pulse whose width isproportional to the distance. From the datasheet, width of the output signal will be 58uS for adistance of 1cm. What we need to do is to just send a 10uS wide trigger signal to the triggerpin of the module and wait for the output pulse at the echo pin of the module. Timing diagramand pin out of the ultrasonic module is given below.

Eng.mohammed AlbhaisiArduino C :const int pingPin 7; // Trigger Pin of Ultrasonic Sensorconst int echoPin 6; // Echo Pin of Ultrasonic Sensorvoid setup(){Serial.begin(9600); // Starting Serial Terminal}void loop(){long duration, inches, cm;pinMode(pingPin, OUTPUT);digitalWrite(pingPin, LOW);delayMicroseconds(2);digitalWrite(pingPin, HIGH);delayMicroseconds(10);digitalWrite(pingPin, LOW);pinMode(echoPin, INPUT);duration pulseIn(echoPin, HIGH);inches microsecondsToInches(duration);cm nches);Serial.print("in, tln();delay(100);}long microsecondsToInches(long microseconds){return microseconds / 74 / 2;}long microsecondsToCentimeters(long microseconds){return microseconds / 29 / 2;}

Eng.mohammed AlbhaisiSecond proteus :

Eng.mohammed AlbhaisiExample # 5 :LCD to arduinoTo get more information go to example as shown :Arduino C :// include the library code:#include LiquidCrystal.h // initialize the library with the numbers of the interface pinsLiquidCrystal lcd(12, 11, 5, 4, 3, 2);void setup() {// set up the LCD's number of columns and rows:lcd.begin(16, 2);// Print a message to the LCD.lcd.print("hello, world!");lcd.setCursor(0,1) ;lcd.print("DSP lab ! ");}void loop() {// Turn off the display:lcd.noDisplay();delay(500);// Turn on the display:lcd.display();delay(500);}

Eng.mohammed AlbhaisiSecond proteus :

Eng.mohammed AlbhaisiExercise :1- Do all example in your report (arduino C and proteus )2- Simulate code that make TrafficLight (red , yellow, green)

1-Arduino C 2-proteus 3- Virtual Serial Port Driver 4-Arduino library to proteus You must do following Steps if you want to simulate your program: 1-We must make virtual port using Virtual Serial Port Driver Here we make virtual port between COM1 and COM2 2- choose port and Arduino type from tools Hints : Here we connected arduino to COM 1

Related Documents:

Arduino compatible components. Personal computer running Arduino software Arduino software is free to download and use from: www.arduino.cc Arduino board Such as: Arduino Uno Freetronics Eleven Genuino Uno or any Arduino compatible board that has a standard Arduino UNO header l

arduino-00 -win.zip Recommended Path c:\Program Files\ ( - version #) Step 3: Shortcut Icon Open c:\program files\arduino-00 Right Click Arduino.exe (send to Desktop (create shortcut)) \ ( - version #) Step 4: Plug In Your Arduino Plug your Arduino in: Using the included USB cable, plug your Arduino board into a free USB port. Wait for a box to .

Hence we given interesting top five easy to make Arduino projects with code and library link. Happy learning Arduino 1. Heart Rate Monitor AD8232 Interface Arduino 2. Fingerprint sensor-scanner with Arduino 3. Giving Voice Recognition Ability to Arduino 4. Soil Moisture Sensor and Arduino 5. How to Interface RFID with Arduino?

3. Then, use the Arduino IDE to write code to send to Arduino. Once a code is sent to the Arduino, it lives on the Arduino Uno. Any future edits to that code on the computer will not be sent to the Arduino unless it is manually uploaded to the Arduino Uno. When using the Arduino

arduino’s analog pin 4 (SDA). And the pin labelled as SCL on the MPU 6050 to the arduino’s analog pin 5 (SCL). And that’s it, you have finished wiring up the Arduino MPU 6050. Step 2: Uploading the code and testing the Arduino MPU 6050 To test the Arduino MPU 6050, first download the arduino library for MPU 6050, developed by Jeff Rowberg.

117. Password access with arduino 118. Arduino Voltmeter Code 119. Easily control your iPod using Arduino 120. Candy Tossin Coffin using an Arduino 121. Arduino 7 segment Displays Digital Clock With Charlieplexing LEDs 122. Arduino controlled webcam panner 123. Binary/ Analog Clock 124. Universal Gripper

Upload your custom Arduino code with the corresponding library file 3. Add the used libraries 4. Select the used in-outputs in the Arduino IO Simulator 5. Connect the Arduino IO Simulator to the Arduino board with the right se-rial port 1. Connect the Arduino Board The Arduino IO Simulator works with a lot of

3/15/2021 6105636 lopez richard 3/15/2021 5944787 padilla elizabeth 3/15/2021 6122354 rodriguez alfredo 3/16/2021 6074310 aldan francisco 3/16/2021 6060380 bradley vincent 3/16/2021 6133841 camacho victor 3/16/2021 6100845 cardenas cesar 3/16/2021 6133891 castaneda jesse .