Arduino meets MATLAB: Interfacing, Programs and Simulink
eBook - ePub

Arduino meets MATLAB: Interfacing, Programs and Simulink

Anita Gehlot, Rajesh Singh, Bhupendra Singh

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Arduino meets MATLAB: Interfacing, Programs and Simulink

Anita Gehlot, Rajesh Singh, Bhupendra Singh

Book details
Book preview
Table of contents
Citations

About This Book

This book provides a single platform for beginners in systems engineering to start Arduino interface projects with MATLAB®. It covers the basics of the programming with Arduino and Arduino interfacing with MATLAB® with and without the use or I/O packages.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Arduino meets MATLAB: Interfacing, Programs and Simulink an online PDF/ePUB?
Yes, you can access Arduino meets MATLAB: Interfacing, Programs and Simulink by Anita Gehlot, Rajesh Singh, Bhupendra Singh in PDF and/or ePUB format, as well as other popular books in Informatik & Programmierung. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781681087276

Arduino Interfacing with Actuators



Rajesh Singh, Anita Gehlot, Bhupendra Singh, Sushabhan Choudhury

Abstract

An actuator is a component which is responsible for moving or controlling a mechanism. An actuator requires a control signal and a source of energy. This chapter explains the working of actuator with the help of different methods.
Keywords: AC motor, Arduino, DC motor, L293D, Stepper motor, Servo motor.



5.1. DC motor control with transistor ‘H’ bridge

A DC motor is a device that converts electrical energy into mechanical energy. It has vital importance for the industry. Fig. (5.1) shows the block diagram of the system, comprises of Arduino, power supply, DC motor, LED. It is designed to control the DC motor with ‘H’ bridge (2N2222), LEDs are connected to check the change in the status of inputs to motor in order to make it move in forward and reverse direction. To make H bridge four 2N2222 transistors are used- Q1, Q2, Q3, Q4.
Fig. (5.1))
Block diagram for the interfacing of DC motor.

5.1.1. Circuit Diagram

Connect all the components to Arduino as per the connections as described-
  1. Make collector of Q1 & Q2 common and connect to positive terminal of +12V DC.
  2. Make emitter of Q3 & Q4 common and connect to negative terminal of +12V DC and ‘GND’.
  1. Make base of Q1 & Q4 common and connect to pin9 of Arduino.
  2. Make base of Q2 & Q3 common and connect to pin10 of Arduino.
  3. LEDs are also connected parallel to inputs of H -bridge.
  4. +12V DC jack of power supply is connected to DC jack of Arduino Uno.
Fig. (5.2) shows circuit diagram for the interfacing of DC motor.
Fig. (5.2))
Circuit diagram for the interfacing of DC motor.

5.1.2. Program

int MPIN1 = 10;
int MPIN2 = 9;
void setup()
{
// initialize pin10 and 9 as output
pinMode(MPIN1, OUTPUT);
pinMode(MPIN2, OUTPUT);
}
void loop()
{
digitalWrite(MPIN1, HIGH); // make 10 and 9 pin HIGH and LOW respectively
digitalWrite(MPIN2, LOW);
delay(1000); // wait for a 1000 millisecond
digitalWrite(MPIN1, LOW); // make 9 and 10 pin HIGH and LOW respectively
digitalWrite(MPIN2, HIGH);
delay(1000); // wait for a 1000 millisecond
}

5.1.3. Proteus Simulation Model

Connect the components with Arduino as described in section 5.1.1 in the virtual environment of Proteus simulator. Power supply need not to be connected in the virtual environment of Proteus. Load the program as described in section 5.1.2 and check the feasibility and working of the circuit. Fig. (5.3) shows the Proteus model for the system.
Fig. (5.3))
Proteus simulation model for the Arduino interfacing with DC motor.

5.2. DC motor control with L293D

L293D is 14 pin motor driver IC. DC motor upto 12V/1A ca be controlled with this.Fig. (5.4) shows the block diagram of the system, comprises of Arduino, power supply, DC motor, L293D, LED. It is designed to control the DC motor with IC L293D. LEDs are connected to check the change in the status of inputs to motor in order to make it move in forward and reverse direction.
Fig. (5.4))
Block diagram to control DC motor with L293D.

5.2.1. Circuit Diagram

Connect all the components to Arduino as per the connections as described-
  1. Input pins 2 and 7 of L293D IC are connected to 10 and 9 pins of Arduino Uno.
  2. Output pins 3 and 8 of L293D IC are connected to +ve and –ve terminals of DC motor respectively.
  3. +12V DC jack of power supply is connected to DC jack of Arduino Uno.
  4. Pins 1,9 and 16 of L293D are connected to +5V.
  5. Pins 4,5 and 12, 13 of L293D are connected to GND.
  6. Pin 8 of L293D is connected to +12V power supply.
  7. LEDs are connected parallel to input pins 2 & 7 of L293D.
Fig. (5.5) shows circuit diagram to control DC motor with L293D.
Fig. (5.5))
Circuit diagram to control DC motor with L293D.

5.2.2. Program

int MPIN1 = 10;
int MPIN2 = 9;
void setup()
{
// initialize the digital pin as an output.
pinMode(MPIN1, OUTPUT);
pinMode(MPIN2, OUTPUT);
}
void loop()
{
clockwise();
delay(2000); // wait for a 1000 millisecond
anticlockwise();
delay(2000); // wait for a 1000 millisecond
}
clockwise()
{
digitalWrite(MPIN1, HIGH); // make pin 10 as HIGH and 9 as LOW
digitalWrite(MPIN2, LOW);
}
anticlockwise()
{
digitalWrite(MPIN...

Table of contents