0% found this document useful (0 votes)
8 views

Device Operation using PC by Arduino (2)

The project aims to operate devices using a PC via Arduino, specifically utilizing the Arduino UNO microcontroller for various electronic applications. It covers the history, technical specifications, and communication methods of Arduino, including serial communication standards and coding examples. Additionally, it discusses the software environment (Arduino IDE) and hardware connections necessary for implementing the project.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Device Operation using PC by Arduino (2)

The project aims to operate devices using a PC via Arduino, specifically utilizing the Arduino UNO microcontroller for various electronic applications. It covers the history, technical specifications, and communication methods of Arduino, including serial communication standards and coding examples. Additionally, it discusses the software environment (Arduino IDE) and hardware connections necessary for implementing the project.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Project 3

DEVICE OPERATION
USING PC BY ARDUINO
Block Diagram
PC

Device1

Device2
ABSTRACT

The main aim of this project is to


operate the devices using PC.
What is Arduino?
What is an Arduino Uno used for?
• Arduino UNO is a low-cost, flexible, and easy-to-use programmable
open-source microcontroller board that can be integrated into a
variety of electronic projects . This board can be interfaced with other
Arduino boards, Arduino shields, Raspberry Pi boards and can control
relays, LEDs and motors as an output.
History

• The Arduino project started at the Interaction Design Institute Ivrea


(IDII) in Ivrea, Italy.
• At that time, the students used a BASIC Stamp microcontroller, at a
cost that was a considerable expense for many students.
• In the year 2005 it came in market.
• It consists of both a microcontroller and a part of the software or
Integrated Development Environment(IDE) that runs on your PC.
Arduino Boards
Arduino UNO
PWR IN USB
(to Computer)

RESET

SCL\SDA
(I2C Bus)

POWER
5V / 3.3V / GND
Digital I\O
PWM(3, 5, 6, 9, 10, 11)

Analog
INPUTS
Technical specifications
• Microcontroller: Microchip ATmega328P [7]
• Operating Voltage: 5 Volts
• Input Voltage: 7 to 20 Volts
• Digital I/O Pins: 14 (of which 6 can provide PWM output)
• UART: 1
• I2C: 1
• SPPI: 1
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB used by optiboot bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
Serial Communication
• Serial communication is a communication method that uses one
or two transmission lines to send and receive data, and that data
is continuously sent and received one bit at a time.
Basics of serial communication
Difference between serial and parallel
communication
Serial communication standards

• RS-232C/RS-422A/RS-485 are EIA (Electronic Industries


Association) communication standards. Of these communication
standards, RS-232C has been widely adopted in a variety of
applications, and it is even standard equipment on computers
and is often used to connect modems and mice. Sensors and
actuators also contain these interfaces, many of which can be
controlled via serial communication.
Half-duplex communication and full-duplex
communication
Full-duplex communication
A method where send and receive both have their own transmission line so data can be
simultaneously sent and received.
Half-duplex communication
A method where communication is performed using one transmission line while switching
between send and receive. For this reason, simultaneous communication cannot be
performed.
Asynchronous communication and
synchronous communication
Asynchronous communication and
synchronous communication
• Transmission rate:
Specifies the number of bits to send each second.The unit is bps
(bits per second) and is selected from 300, 600, 1200, 2400,
4800, 9600, 19200, and so on. By matching the settings and
timing, the data delimiters correspond, and data can be normally
sent and received. For this reason, a start bit is added to each item
of data (1 byte) to acquire the correct timing.
BAUD RATE
• Baud = symbols per second.
• Common baud rates today: 4800, 9600, 19200, 38400
• Baud = number of bytes x total bits per frame x output rate of
message (in Hz), where total bits per frame = data bits, + start
bit + stop bit + parity bit if used.
• If we want to output this 41 bytes message at an output rate of
50Hz at 8N1, then we'll have: 41 bytes x 10 bits per frame x 50
Hz = 20500 bits per second or 20500 bauds.
SERIAL Communication
• Serial.begin(speed) : Sets the data rate in bits per second (baudrate) for
serial data transmission
Ex : Serial.begin(9600);
• Serial.end() : Disables serial communication, allowing the RX and TX pins
to be used for general input and output.
• Serial.print() : Prints data to the serial port as humanreadable ASCII text. It
returns the number of bytes written.
Ex: Serial.print(78) → “78”

Serial.print(1.23456) → “1.23”

Serial.print('N') → “N”

Serial.print("Hello”) → “Hello”
SERIAL Communication
• Serial.println() : Prints data to the serial port as humanreadable
ASCII text followed by a newline character (‘\r’ or '\n’).
• Serial.write() : Writes binary data to the serial port. It will return the
number of bytes written. To send the characters representing the
digits of a number use the print() function instead.
Ex : int bytesSent = Serial.write(“hello”);
• Serial.read() : Reads incoming serial data. It returns the first byte of
incoming serial data available (or -1 if no data is available).
Ex : var = Serial.read();
• Serial.available() : Get the number of bytes (characters) available for
reading from the serial port. It returns the number of bytes available
to read.
Ex : if(Serial.available()>0)
Software: Arduino IDE
Soft Code
int fan=2;
if(a=='@')
int light=3;
{
void setup()
Serial.println("LIGHT ON");
{
digitalWrite(light,HIGH);
pinMode(fan,OUTPUT);
}
pinMode(light,OUTPUT);
if(a=='+')
Serial.begin(9600);
{
Serial.println("PRESS");
Serial.println("fan OFF");
Serial.println("# to ON fan");
digitalWrite(fan,LOW);
Serial.println("@ to ON light");
}
Serial.println("+ to OFF fan");
if(a=='-')
Serial.println("- to OFF light");
{
}
Serial.println("light OFF");
void loop()
digitalWrite(light,LOW);
{
}
char a;
}
if(Serial.available()>0)
{
a=Serial.read();
Serial.print(a);
}
if(a=='#')
{
Serial.println("fan ON");
digitalWrite(fan,HIGH);
}
Hardware Connection using Proteus

You might also like