Arduino/C4/Arduino-on-Cloud/English

From Script | Spoken-Tutorial
Revision as of 15:08, 9 January 2024 by Nirmala Venkat (Talk | contribs)

Jump to: navigation, search
Visual Cue Narration
Slide 1: Welcome to the Spoken Tutorial on Arduino on Cloud.
Slide 2:
Learning Objective
In this tutorial, we will learn about
  • Arduino on Cloud interface
  • How to create circuit connection and
  • Simulate to see the output
Slide 3:
Pre-Requisites
To follow this tutorial, you should have a basic knowledge of
  • Arduino and
  • Electronic components

If not, then go through the relevant Arduino spoken tutorials on this website.

Slide 4:
System Requirement
To record this tutorial, I am using:
  • Ubuntu Linux 18.04 OS
  • Chrome web browser
Open the browser and go to https://simulation.iitbx.in Let us go to Arduino on Cloud website
  • Open the web browser on your computer and go to this link.
  • Note that an internet connection is required for the entire process.
point to Arduino on cloud We can see the Arduino on Cloud on the left hand side of the screen.
Click on the launch button Click on the Launch button to launch the arduino main page
Point to the video

On the left hand side there is a video on how to use arduino on cloud.

Please watch it and understand the various features available on Arduino on cloud.

Point to the button

click and show the document about the experiment

Click on the Explore experiments button below the video.

It takes you to a home page of arduino on cloud.

Click on the three bars on the top left corner to see a list of experiments which are given for you to practice.

Go to the experiment and scroll down in the document Let us see a demo on the Servo Motor experiment.

This experiment shows how to control the rotation of a servo motor using potentiometer.

The details required for the experiment are given in this page.

Refer the circuit diagram and source code while practising.

Switch to the tab Let us go back to the Arduino on cloud webpage.
Click on the launch editor Click on the Launch Editor button to open the interface.
Point to the left panel

Expand and show the input and output

The components required to create the circuit are available on the left panel.
narration only Let's see how to create the circuit diagram for servo Motor experiment.
narration only First we will give a name to this experiment as Servo Motor Control.
Point to untitled On the top right, by default it shows the name as untitled.
Click on the untitled and edit to Servo Motor Control. Click on the untitled and edit the name of the experiment to Servo Motor Control.

We need a breadboard, arduino uno, servo motor and potentiometer for this experiment.

Now let us drag and drop the required components.

click on the General section

Drag and drop breadboard

First click on the General section.

Select the Breadboard. Drag and drop it in the working space as shown.

drag and drop the Arduino UNO from the Controllers tab. Next let us drag and drop the Arduino UNO from the Controllers section.
Arrange the breadboard and Arduino side by side as shown here.

Use the Plus or Minus icons in the toolbar to zoom in or zoom out as shown.

drag and drop the Servo Motor from output tab

click on the servo motor.

click on view info.

Scroll down to show the information

Click on ok

Then from the Output section, drag and drop the Servo Motor in the working space.

If you want to know more about any component, click on the component.

A pop-up window appears on the top right corner.

Now click on the View Info button.

The new window will give you some basic information about the particular component.

Click on OK to close this window.

drag and drop the potentiometer from input tab From the Input section, drag and drop the potentiometer on the breadboard as shown.

Make sure the legs of the potentiometer are attached to the points of the breadboard.

The breadboard point turning red indicates the connection is established.

We have selected all the components required for this experiment.

Next, let us do the circuit connection.
Point to red marked positive rail


drag and make the +ve connection

drag and make the GND connection

The top and bottom of the breadboard has a red-marked positive rail and a blue-marked negative rail.

All the holes in the same row are internally connected.

So you can use any of the holes in the same row for connection.

We will create a +5v source rail on the breadboard.

Select a box in the positive rail of the breadboard as shown.

Then connect it to the +5V pin on the Arduino Uno.

Likewise, select a box in the negative rail and connect it to the ground (GND) pin of the Arduino Uno.

point to the black wire


By default, the colour of the wire is black whenever created.

Let us change the colour of the wire connected between +5V and the breadboard to Red.

change the color to red

From the drop down box, select the red colour.

Click on the wire for which the colour has to be changed. A pop up window appears on the top right.

From the drop down box, select the red colour.

Now we will extend the +5V and Ground rails of both top and bottom of the breadboard as shown.

This will help us to make the other component connection simple.

connect the centre pin of potentiometer to A0 on arduino

change the color to green


Connect the left terminal of the potentiometer to the 5V

Now we will connect the potentiometer to the Arduino Uno.

Connect the center pin of the potentiometer to the Pin A0 of the Arduino Uno.

Let us change the colour of the wire connected to Pin A0 of Arduino to green.

Connect the left terminal of the potentiometer to the 5V rail on the breadboard. Change the wire to red.

Connect the right terminal to the GND rail. Connect the right terminal to the GND rail.

Let us keep the black colour of the GND pin to the breadboard as it is.

Connect the Signal pin of the Servo Motor to Pin 9 of the Arduino Uno.

Connect the power pin of the Servo Motor to +5v rail of the breadboard.

Connect the GND pin of the Servo Motor to the GND rail of the breadboard.

change the color of the wire.

Connect the Signal pin of the Servo Motor to Pin 9 of the Arduino Uno.


Connect the power pin of the Servo Motor to +5v rail of the breadboard.

Connect the GND pin of the Servo Motor to the GND rail of the breadboard.

Change the color of the wire as shown for easy identification.

click on the Save Temporary icon on the top toolbar.


Click on Dashboard


Click on Temporary circuits

It is recommended to save our progress of circuit creation in between.

For this, click on the Save Temporary icon on the top toolbar.

It will save in the browser cache.

Note that if you clear the browser cache, all the saved circuits will be lost.

To view the saved circuits, in the menu bar click on Dashboard.

Click on the save button and then on the save temporary button.

Then click on Temporary Circuits in the left pane.

We can see the saved circuit.

To open the saved circuit, click on it.

In the pop-up window, click on the Edit circuit button.

show the action Let us make the circuit connection look better.

On the toolbar, click on the Auto-Arrange Wires icon which re-arranges the wires .

It will take some time to see the re-arrangement of wires.

Next we will see how to write the code for this experiment.
Click on the Code icon, on the top left of the toolbar.


Click on the Code icon, on the top left of the toolbar.

Write the necessary code in the void setup() and void loop() as shown.

Let us copy and paste the required code from the document.

Click on the triangle icon
Now we will simulate the circuit design to see the output.

Click on the play icon Start Simulation on the toolbar.

Point to bottom of the window


A serial monitor will appear at the bottom of the screen which shows the simulation is started.

The compilation text message in green color shows that the code is correct without any errors.

narration only Let us change the Potentiometer value in the working space to see the output.
Point to various output according to narration

Show both rotation with potentiometer

Click on the brown stick of the potentiometer and rotate it clockwise to change its value.
When the value is at the minimum, note that the shaft of the servo motor is at the minimum angle.
When we increase the potentiometer value, the shaft of the servo motor starts to rotate.

Likewise, you can rotate the potentiometer in anticlockwise, and the servo motor reverses its rotation.

point to the output At the same time, we can see the corresponding values of potentiometer and servo motor in serial monitor.

Thus we can observe that the servo motor rotates as per the rotation of the potentiometer.

Press the simulation button again to stop the simulation.

narration only Let us see some common mistakes that happen when we write the code or in the circuit connection.
Change the code

Highlight while recording

For example, in the third line of the code we have created a variable as myServo.

Let us change the capital ‘Sto a small letter ‘s and see what happens.

Note that in the entire rest of the code, we have used capital 'S' in myServo .

Click on the Start Simulation icon Let us compile and check the output.

Click on the Start Simulation icon on the toolbar.

Point to the error

Correct the code and compile

Show the action -change the code, simulate, point to serial monitor

The serial monitor window at the bottom of the screen shows the text in RED colour.

It indicates that there is an error in the code. This is a case sensitive error.

Note that Arduino codes are case sensitive.

We have to correct the code and compile it again as shown.

narration only Let us see another common mistake that happens in the circuit connection.
delete the ground connection. Assume that we have forgotten to make the potentiometer ground connection while creating the circuit.

Select the ground wire connection and right click and select delete.

Otherwise, press the delete button to delete the ground connection.

Now let us check the output.

Click on the Start Simulation. Click on the Start Simulation. The code will compile properly and it will show there are no errors.

Let us check the rotation of the servo motor.

point to the output Note that the servo motor is not changing its shaft position as expected.

Hence you have to cross check all the required pins are connected correctly in the circuit.

Let us see other features available on the interface.
Point to Export & Import JSON There are icons to Export and Import JSON files.
Click on the Export JSON file icon

Type servo motor

Click on the Download Project button.

save the file in downloads folder

To download the JSON file of this project, click on the Export JSON file icon on the top toolbar.

Let us give Servo_motor as the filename to save.

Click on the Download Project button.

Select the path where you want to save the JSON file and click on the save button.

Let us try to import this code now.

Click on the new project icon on the toolbar.

Click on the Import JSON file icon.

Select the Servo_motor.json file which we saved earlier and click on the open button.

We can see the circuit has been imported. Click on the 'Code' icon.

Even the code has been imported successfully.

Click on the Start Simulation button and verify the rotation of Servo motor using the potentiometer.

We can see the imported JSON file is also working properly as expected.

Download Image The Download Image option allows you to download the circuit design in either SVG, PNG or JPEG format.
Show the document page Explore and practice the experiments that are given in this page.
This brings us to the end of this tutorial.

Let us summarize.

Slide:

summary

In this tutorial, we learnt about
  • Arduino on Cloud interface
  • How to create circuit connection and
  • Simulate to see the output
Slide 9:
About Spoken Tutorial project
The video at the following link summarizes the Spoken Tutorial project.
Please download and watch it.
Slide 10 :Spoken Tutorial workshops The Spoken Tutorial Project Team conducts workshops and gives certificates.
For more details, please write to us.
Slide 11: Forum for specific questions Please post your timed queries in this forum.
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.

Thanks for watching.

Contributors and Content Editors

Madhurig, Nirmala Venkat