Arduino Programming using Ardublockly: Block Based Arduino Learning | Amit Rana | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Arduino Programming using Ardublockly: Block Based Arduino Learning

teacher avatar Amit Rana, Engineer, Programmer and Trainer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

44 Lessons (3h 35m)
    • 1. Introduction

      1:15
    • 2. History Of Embedded Systems

      4:04
    • 3. Arduino Boards

      8:45
    • 4. Arduino Software installation

      10:02
    • 5. Ardublockly Blink Download

      10:51
    • 6. Arduino vs C Final

      15:08
    • 7. Bread Board

      8:27
    • 8. LED

      11:17
    • 9. Final Movie All Led On

      1:15
    • 10. Final Movie Alternate Blink

      0:58
    • 11. Final Movie 4 On 4 Off

      1:07
    • 12. Final Movie Chaser

      1:06
    • 13. Final Movie Blink 10 Times

      1:12
    • 14. Final Movie LED and Switch Program

      1:30
    • 15. Final Movie Leds and Switches

      1:39
    • 16. Buzzer Programming

      3:20
    • 17. Final Movie Buzzer

      1:09
    • 18. Final Movie Buzzer and Led Program

      0:45
    • 19. Digital Input

      10:43
    • 20. Serial Communication

      13:16
    • 21. Seven Segment Display

      7:17
    • 22. Tri Color Led

      5:27
    • 23. Ultrasonic

      14:06
    • 24. ADC Input

      17:18
    • 25. Analog Write

      11:42
    • 26. Final Movie Servo Motors

      14:31
    • 27. Final Movie Ultrasonic

      14:06
    • 28. Conclusion

      1:28
    • 29. Final Movie Tri color Generation RGB

      0:49
    • 30. Final Movie Tri Color YCM Color Generation

      1:05
    • 31. Final Movie Traffic Light Control

      0:45
    • 32. Final Movie Tri Color Led and Switch Generation

      1:53
    • 33. Final Movie Up Counter Using 7 Segment Display

      3:33
    • 34. Final Movie Serial Message Print

      0:40
    • 35. Final Movie Serial Message Read

      0:40
    • 36. Final Movie Serial Based Device Control

      2:44
    • 37. Final Movie Digital Thermometer

      1:43
    • 38. Final Movie Digital Voltmeter

      1:42
    • 39. Final Movie Digital Ligt Meter

      1:12
    • 40. Final Movie Temperature Control

      0:45
    • 41. Final Movie Led Fading

      1:20
    • 42. Final Movie Distance Meter

      1:29
    • 43. Final Water level Indicator

      0:40
    • 44. Final Movie Servo Motor

      0:45
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

304

Students

--

Projects

About This Class

Do you want to learn Arduino but don't know coding? Then this course is specially designed for you. This course makes use of the Ardublockly which generates Arduino Code directly by using simple blocks. Anyone who can read English can program Arduino's with this course. There are lots of interesting interfaces included with arduino which makes the course very much interesting. A detailed study of every interface including how to make connections on breadboard and how to use every sensor with arduino takes you from a complete beginners level to an intermediate level. With 25 different projects to finish, this is sure to keep you hooked for days

Meet Your Teacher

Teacher Profile Image

Amit Rana

Engineer, Programmer and Trainer

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction : Hello, everyone. I'm an engineer, a programmer and developer. In this course, we're going to study about this. Yes, it's an Arduino board. We're going to study the art dealer programming in a block best programming way. So it's completely fine if you don't have any programming experience before it is also okay . If you have not use our you know, born before this is a complete project based course What? We're going to do its first download the software required for programming the ARLENA board now Lord, our sample program andan study the projects in detail this Roger Cancer stop number of different interfaces. Interesting interfaces like Ellie leads sensors, switches on motors are you know, programming is a lot of fun and you're going to love this program. Incisions. It's completely fine. It's regardless of your education. Are any background you can still study already know All you need is Arduino board and some programming and interfacing interfaces. Some minor components. The list off All these companies will be given to you in this course. Happy learning. Have fun. Thank you 2. History Of Embedded Systems: Let's get started in the garden, a programming course that said before, we're going to study about Arlena bold in this course and how to write down programs for it . But before that, you need to understand why use these are, you know, boards at all. See, then and when you have to love any kind of an electronic system or dinner 20 project, you might have a heart after nothing. Some kind of project for your school or some happy assignment or some school crush for your college spreads it. Whenever we have to develop any kind of an electronic project, there are two ways to do that. Project one is directly make use off some basic electronic components on digital components and creative assistant. Second is to use a Michael Continental system. Generally, the microcontroller systems are easier to build because they're programmable. We also call them as an embedded system, and since in Carson Sofer microcontroller on some input and output devices, we need to abandon microcontrollers in order to use this embedded system. It embarrasses timber. Lambing is only limited to the electronic situated in students. What happens is a micro mountainous study involves the study off architecture in section saved on a lot off mean owls and many complications in the microcontroller did. Subjects are usually the microbes subjects in all Delia comics. What happens is starting these instruction saves on architecture. It's quite tedious. It's very difficult to remember those things. And that is the reason many off the electronic starting people itself are not much interested in, um, very insistent. As I said, because of this reasons, many electronics students find it difficult to start programming with microcontrollers. This is a very common difficulty on toe addresses. Difficulty. These are, you know, moves very developed. How next to conduct even background of this our universe. That was a very fine teacher in Italy. We all call him as Massimo Bansi. He had a student off his own for a PhD project. So his project was to create a board on my card until early sport andan I ve for the microcontroller so that anyone without having any programming or electronic knowledge should be able to program it. The project was completed. The name of the project was fighting. Its PhD student went to his home. He was a U. S based citizen, so he made form next massive Almanza toward that celebrity. Fighting was a great project. It just needed a simple, winding mechanism to understand the microcontroller programming. So Massimo Bansi, along with his few frames this project onwards and Hickel units are, you know already know consist off a microcontroller baseboard. Hang on accompanying software a soft Germans and integrated development and moment there we can I know the programs for my The most important thing of our, you know, is we don't need to study architecture of this icy or the microcontroller. We also don't need to study. The institution said we also don't need even remember being out off it. The cardinal is developed in sexually that anyone can immediately start using it basically are the norm or doesn't have anything except you. Israel Office, Michael until I see and simple input output port pins. But the programming has been made so simple that you just have to read the numbers on this board and Connecticut side programming. This board there are luminous. That's a heart was available. The first thing that we're going to do, it's to study about these are, you know, boards to see what out of the different are, you know, board seats available. Then you'll also see how easy it is to program. They are, you know, And then it will start with the block. Best programming happened. 3. Arduino Boards : as we're discussing in last session about our dinner boards. Now we'll discuss about the Ordina boards in detail, as discussed before. It's a microcontroller based boat, which is created on a complete open source hardware philosophy. It simply means that the schematic layout and everything related to making the PCV off the Ordina board is available free off cost, the harder schematics and the Libs on available three off coast. The board can be built by hand or it can be purchased reassembled online so you can. You can generally grab an Arduino board. I don't eBay or Amazon or wherever you're living. I hope so that getting in our dinner board is not a big challenge for you. Plus, our hero is also an open source software, so the programming softer that they have created for programming. Our dino is also free off course available. The software can be downloaded from the Garden, a website for free. It's a very flexible and easy to use hardware and software interface. To use see how it looks. The concept Band RD. No aides used the rd no board directly instead of microcontroller board, so the problem with microcontroller board AIDS it does have its we need to create a board out off it. We need to create a PC before then solder the microcontroller, then download a hex file into it by writing down problem in a very complex. The are, you know, eliminates all of this. So by using already know we eliminate all the issues required in a microcontroller based system development our denies targeted foreign Jersey asks engineers and artists as I dont you before there is no microcontroller knowledge required to study their. You know, you're not even required to be an engineer or a science student. Even you're not required to be a college student at all. Anyone from school to college or to alert and even can't discern ordeal, you don't need to have any softer knowledge or an imprint. Previous C or C plus plus programming knowledge required our Internet suitable for all the students who are willing to learn it. It's clearly built for everyone. So these are the different Arduino boards available that its most popular already know. You know that there is our Omega Nano Leonardo do and many more, they pointing down the microphone to note, which is used to making the already know board. There are different Arduino boards, but basically the software and the programming involvement remains the same. Now, these different boards are created with different microcontrollers with different features with different pin numbers and lots of different things. For example, this is the most popular you know. You know, board. It consists off at bigotry to it at the Gold Office because it's so hard my got to do it as the heart of the order. No board. And as you can see on this board, there is not much things present onto the board. We can see there is a USB connected over here. Then there is a Power Jack over here. This is the ultimate treat which microcontroller exit 28 when I see off a fierce cities and Wigan sports two major connector sections here. So this already don't you know it is by far the most popular and most widely available are gonna board is nothing but a just plain microcontroller board with all the pins open. What we can do is we're gonna connect anything we want to do, spin and prevent this microcontroller. If you look at it carefully, X a very small size board, and it has a peculiar sheep. Another see another board. This is our dino may go. This is built upon at Mega 2560 as compared to admit a tree to it over here to 50 is a bigger I see. It's a surface mounting type I see and has large soft bins. And because it has lots of pins, the keynote off this already know, is also bigger. There are more number off female headers over here as a less eerie as you can spot again. There is a USB connector and power check connector, so the basic structure of the board remains the same. But the additional pills do occupy additional space onto the microcontroller board. Going further, this is one of my favorite boards. Are you know, Nano. It uses the same microcontroller, assert off are you know you know which is that bigotry to it. But as you can see on this board, it's a very tiny bold. It just looks like a single for deep in icy. All the pins off the microcontroller are taken out onto the same sized headers like this, and you can just insert this either In a break board I didn't BCB by connecting a socket to it. Are ya Nano on already know you know are almost completely identical Except only one thing that Nano has two more and look prints a six and a seven. This is our you know do this is based on arm microcontroller and again a much high featured and highly processing power Keep people microcontroller board and so on. If he just look at the absurd off are you know, we can see there are more than 20 different Arduino boards which are presently available. More than 20 different boards are available years So are you know not Sissy is the website of our you know, on this website we can also see more than the previous boards. And what are the current boards which are being sold by their you know So there are many projects focus on the Ordina website at their homepage. Moreover, if you go into the product section, we can see the number hardin aboard seven level today, the day invention And with the advent off duty, there are specific coyote related are gonna boards Also you can see such as the range off entry later on our dinner boards. These are somebody in house creatures. One off. This is mega and do, which we just saw. Then there are some specific to the Internet off thinks application already knows which are , you know, you determine age title and so on. So there are numerous Arjuna boards to begin with. You can just grab on toe any Arduino board that you can get from your local markets. As I said, the knowledge and the programming involvement remains the same for all of them. Let's look at the are you know you know in detail This is how are you? No, no looks as we just discussed it has been a controller at bigotry twitch, and some things are open. What are the spins and how do we use this? Spence, if you look at the board carefully, the measure dissension with any microcontroller baseboard and our dino is that we do not require to study the architecture of this. I see the pin off this I see which are the microcontroller sport Pins are spaced out and renamed as been 01 toe. As you can see upto 13 so looking from this view on the right, sir, there are zero toe 13 general Purpose Spence looking at the left hand side. There are a zero, even eight to a three, a four and a five. So six pin over here and total 14 pins over here. So total 14 bills from 0 to 13 in six from a zero to a five. We have a total 20 points, which can be used this digital input output so all of them can be used as digital input output. Additionally, a zero to a five can be used. That's analog inputs, but is analog input will seem detail when we study about the on a lot traditional convertible. Plus, This is an additional character which is used for connecting a number of different power prints. So this power collector gives us access to the additional power pills for correcting external sensors, all realities or searches. We have decency, which is five world over here to ground planes. One million input veil input pin is the same input, which is a plague through the BC Jack connector. So, except for their little board, spin out. Thanks for watching this video 4. Arduino Software installation: Hello, everyone. In our last session, we discussed about the different Arduino boards with sorted for Darlene Awards, which are available out there. We can also check out all the available Arduino boards that are available on the or Billions official website, which is already know dot cc. Let's open our Dina Road Cincy. On this upside, we can not only see the available Arduino boards, but you can also download the ordeal of software, which is required for down, which is required for writing down programs. For our you know, its software is nothing but an integrated development environment. It's an open source software. It is available free off course. We don't have to pay anything for it. This is the home pitch off our dino. As can be seen. There is a product section. Let's open it in a new tab, and then there is a software section. We go into the softer section here. The good thing is, our Dino comes in a Web editor. That's the less you know offline, I d. We generally prefer an offline I D. Because we may or may not have the Internet access all the time, so we prefer using offline I d. If you're working on Windows, I would recommend to go on for this Windows installer, which is the first option. The Windows Zip file is actually a non administrative install file. So if you don't know the zip you can directly than they are, you know we don't installation. Plus, if you're done with that strain, you can also get the RD no app in the Windows store. For Mac OS. This is diversion to use, so we'll go for the Windows installer by clicking here it us or the contribution to the already know software as well as the entire involvement. If you are willing to, you can contribute some donations over here. If not for now, just download So this downloading starts. I haven't $100 managers, so it has captured the download, if not genetically starts within the chrome or Firefox. Whichever browser you're using, it's a 90 MB softer might take a vial for completely downloading. Meanwhile, let's take a look at Donald, you know, products in our last session. Also, we were discussing about various already know products available starting from entry level toe enhanced features and I o T. Related as Well, it's variable. So these are the different are you know, boards available lark so hard in a part of, circa mentally presage. Out of this, the products which are marked in green are the Arduino boards and products, which are marked in some other colors are some at on. Boards are shills for the are, you know. So the installation file is downloaded onto the computer. We'll see where it goes. As I said, it would take a fine for the installation toe. Get downloaded completely. That's it. So let's ah, let's see if the downloading it's finished on March. The downloaded file will usually come into the downloads folder over here, as I have on our dino. 1.6 point five version said the file downloaded here installed this hard. You know, all you need to do is just double click onto this file and the installation will begin. Just click on yes to this option, which is to run the Ordina set up as administrator and are, you know, will install during the Arden installation process. It will ask you to select the location where you want to install the RD know as well as it will also ask you to download a number of different drivers as the let's install number of different driver software's. I would recommend you to please download all of them because it consists off the drivers for most required and most popular you know boards. It consists of all the drivers. Let's see was Installation is finished. You can run the RD no. From here, it's also important to see where this Sardinha has been installed. So going to the computer onto the C drive in program files, usually in program files except six. Here you will find a folder called Are Do You Know? Here you will find a folder called Are Do You Know this folder is the installation folder off our Do you know this is the entire set up for our, you know, and we can also directly run the compiler from over here once our dino starts, It starts with such a screen, which shows words set up as well. It's Boyd Loop, but in this course we went to straight in the RD No in a block. Best method for that are Dina was needed to be installed onto the computer and hence Vince told it. Now let's see. What is the other software we're talking about, which will between stole. I'm talking about Ardo broccoli. All the broccoli is created using the Googles most popular broccoli platform. So what you need to do is just google the art of broccoli. I am. You will get the downloading link afar to block. I just search it over here in my chrome browser are. If you don't want to Google search it, I'll just let it will give you the wrinkles. So this is the link A for a job locally. For your reference, I will praise this link in another pair file so that you must find it easier for later understanding as well as follow. This is the link from where we have around lording over the block. So this is the homepage of heart of locally. As you can see, we have a very miles an initiative graphical interface for now, learning and creating programs for our dino This off Garance on all three platforms major platforms which are Lennox Mac as villas windows clicking this button You can go on to the download option soft when those were Jennifer job locally clicking on the windows down or for When does Britain will take you to the get hub repository off our Deb. Locally, There, we can download the release version of for a job locally for Windows. So, as you can see, there are numerous emergence listed out here out of which what we want is our job locally, the 0.1 point toe windows towards it. Make sure before downloading our job locally that you have installed or do you know in your system properly. So this is how you can install They are the blocky again, into the downloads folder. You will find the zip file off or the block. Lexi, Is it dead in downloads? I will have it in the compressed folder because I have idea. This is what we're talking about are the broccoli V 1.0 point to 0.1 point if needed. You can copy this toe a favorable location, see and compete into a folder called all data. All right. Once copied, all you have to do is right. Click on this zip folder and extract all the block. Lee C P. 0.1 point two slash windows It will create a new folder and with the intent or the block lifts off terrace being expected. If you open this folder, you can see new files. Being added into this folder was the stylishness completar. We can see all the files present in this folder and we can also start the order blacklists after directly from this folder using this fire named are the block lee under Scotland dot batch. Thank you for watching this video. Popular Injured decision. 5. Ardublockly Blink Download: indecision. We will be studying about how to create our first program Using are the block. Before that We have a very small and very important settings to be done in our lab locally . So please listen to decision very carefully. Also know down the instructions required as the minute so open this art of local folder when soup in stroll and once you're Randy's our job locally underscoring that batch, you will see that there is a server compiler setting start iron I file generator In this file, we have to give the part. There are already know is installed For your reference. I have return ity Now your pat file that Donald General Windows Computer This is where are the noise installed? And this is the full part. So they are, you know, installation. Now let's see what this president and this compiler settings right like that and click on it. You will see these are some settings which are required for the job locally to run the very first off it is or do know, executable. But which is by default return. It's none. If it is, it does none. We won't me will go down there program says In order to block Lee, and if you have toe be successful in downloading program is in order. Locally, we have to put here the entire address off the ordinance. Tradition, as I told you, are devices installed over here on with those machines. Let's also see that through this PC in si program files, usually except six I already know and I already know dot Exe. So this becomes the entire part C program files accepts. It's our dino and already know dot e x e, which I have written just for the reference over here. So we need to copy this pot into this section in that I and I file have also have this text here from that I and I file So it's not needed? No, What we need is this entire pot without any spaces Toby put here instead off none. I just remove none and do a control of he, which is based in over there. You can also, if needed, believe that none and I click use in your mouth and just stricken based when Serbia stripped. Go to file, I'm savage. No, I'll close minimize this close this fold this is my third of locally folder, which were previously We had extracted the contents. Now, as we have done the server compiler settings, let's run the art of locally underscored run Don't back file one second, just simply double click it. Once it's open, you can go into the file. So it the differences here you must be able to see this location off. Are you know dot exit? If it is not visible, go back to the text file. I and I file and do the required changes. Moreover, by default, ladies and white male at mega explain many boards selector, which we have to change to our you know who know as very using our you know, you know, for our experimentation. If you connect and already know, then a serial port will be shown over here, which is not saying right now, So let's close it for No, no, I haven't already know bored with me if you have followed all the instructions and if you have this already know Bullard with a USB cable, you would please plug it inside your computer. I'll just do it. Plugged it in. If you are on Windows Computer as I told you before, you can goto the device manager and see if this sardine aboard is visible there as a comport usually explicit there if the drivers are properly installed. If the drivers are not properly installed, you will see an error over here. So see, already know you know is available edge comfort in order blocking hands. If we go into the preferences now, we should be able to see the come five here. Okay, now we'll discuss about the RD No, and it's been out in detail once again. Before that, let's do a quick program. I had told you before that there is an led connected by the force to pay number 13 off. Are, you know will quickly write down a program using blocks toe blink this lady connector to pin number 13 and then we'll go on to see the details off, how well it is are connected and how you can connect multiple allegiance to the Arduino using Breitbart First thing to do, it's find out the loop. Always remember every embedded system program or every article program is needed to be executed in financially. If you take an example of temperature controller are the energy meter presenting home. They don't just execute once and stop Once a complete cycle is completed, they start again from the beginning. So if an energy meter is there, it shows Date time Our minutes second, the energy consumed on all the details. Once it come finishes showing all the details, it starts again from the first parameter. How this happens Because every program we do is executed in a in financial, in an infinite loop here in our live locally in the loops, you will get this. Rip it while do routine, Displace it here So it will repeat why some condition is attached to you to attach a condition here We just took this from loops. Repeat five attach a condition here we'll go into the logic section here. We'll find out a block we should see true when we are doing what repeat while true means we are giving nothing inside of I look and simply just true, which is a constant. So whatever I don't hear whatever blocks were put here will be executed in financially as told you, we will just do the input and output and blink the bait and led people also say there is a separate function called set built in led to high or low in the input output tab. You can also notice the other functions available, said Digital Pain. Really keen on a lot of pain will discuss them all in detail. For now, we'll see this set built in led to Hi. I'll just put this block here Then, from the time I think there could be little enough 500 milliseconds by default, it's 1000 milliseconds. I'll make it 500 again, going into input output, I will take, said build analogy set too high, and from time I will take this weight 1000 milliseconds instead of 1000. I'll keep it 500. But here we make the state built in led and sort of high, too blue if the ordeal is connected, if you have done the settings properly, then you can click here, which is the button present. Play Burton. This play button is important. The red one, which you see just click on this button and this court will be uploaded into the already know board. It shows you a message over here, plus are do not put messages also seeing here what it says right now, it's serial port is not available. We might have some issues with the serial port, so let's check it once more in the Device manager serial port is present. So this finishes our program. You can also see a respective Xcor degenerated for this program over here, which is there Are, you know, program now to download this. What we have to do is we have to go into once again check the preferences. Everything sounds correct. It also shows before any but not compiling upload skitch their school. And let's click on this upload sketch toward you know that's langoustine. Once the uploading is done, it shows successfully upload Skitch and onto the ordinary itself. Also, you can see they're really being linking here against I don't know if we can support it properly. And so what he is This led is linking with really off 500 milliseconds. And if you want, we can also change this. Deal it further faster. 200 milliseconds also remember one more thing. Whenever you click this button, the Wilton Rd no installation compiler is invoked and you might also see in our little window leg kiss when the installation process starts, it's perfectly normal. It is not starting. They are, you know, But it is just invoking the compiler off the rd No, to download the program into this microcontroller board. Also notice that if this is the first time you're downloading program into the Arduino board, then there is there are different elegies onto the board called P IX and Rx. You will see a lot of activity over there when the program is actually being downloaded. That is also perfectly normal, as you will see onto this board in the chart. And so that's the program downloading starts. 6. Arduino vs C Final: way missing about the Arduino programming on decision we're going to see what are the differences between the conventional C programming that you might have launch on the computers on what is the Arduino programming on? Where does it stand? So let's begin now. If you have done any amount off C programming are if you are even removed, Lee knowing about this equality, then you must be familiar with the structure There we just hash include a library, something like a studio, not Etch they don't The program in the body avoid me and whatever is the is a good table off our sequel. Write all that down here into this too curly brackets. Whereas as we have seen in our last session in our you know, we don't do like this, we don't We haven't included any hash and glory yet. We haven't written Avoid me instead, what we wrote waas avoid sitter and then void loop. So there was no print if actually in case off are you know, I'm just keeping it here for illustration. So what we do here is we do something like more or something on here. What we do is something like digital rights are anything ignorant now. What is the difference between these two things? First of all, remember the language is C programming itself. But the ordinary folks have just converted it into intra fighting a single Boardman function. They have complex. They have just sliced that part in their compiler to be accepted. That still functions. So one will before it set up and one would be word Lou. Now again, if I that concern, let me tell you, because before you know how people used to write down program in Embedded World was also exactly the same. So hash include anything that you need and then write down for men. And then whatever is the initialization core or what you might call it that's set up for what's supposed to be done here. And then when you want to start the men program, it has two wooden legs. So why one structure was very famously used because it's a constant search always remains true, and whatever is the executable core was being written at this particular point. So this is also the same format which is being followed by many microcontroller programming , even at this point, and will remain the same. But what happens is many a times beginners find it difficult to write down a ball over, even on voter. I don't below Valmon what needs to be executed once and what next to be executed infinitely , are repeatedly they did some doubt in Indy programmers head, especially the beginning ones, and that is why they are doing it split into this troop. Warren's words set up and for a look. Apart from that, there is no difference off course in our you know, you can have hash includes if you want to add any additional library or any building library on any custom made elaborate. So that's about the basic programming structure. Second thing is about the deejay types. If you have known about see good. If you have not known about see, just listen to this line on it will get more clear when we're doing the programming. So data David something which we use or declare while doing this, he programming in order to sell something soft data. We also call it as a variable. Say I want to measure temperature that I want to save the temperature into some value or some variable on that variable has to declare using some off the redefined or allowed data types basically data. That's just what let's say, if I declare carb temp, then it will know what it will locate a bit off memory inside their lamb off my computer for the variable time. Now that is negative. So if you declare something as inability, then it a locker. It's 6 10 with space for that particular variable called Led Inside My Exam. So that's the data type, and there are no more bitter. Let's and see. These are the data nights, which are provided by our dino. So the inch it's Simba cheer on computers here. In this discussion, our computers are below. When you're talking about, see, compile a regular C compiler, your computer is actually the pink in process. R. A. M. D professor of whichever you're using, which is much faster on much bigger picture than argument are too small a bit controller, so the variables are according to that aid. But only some bite isn't a bitch. Cat is in a bit and sent carries in a bit. Carrots change and center, of course, is consent. Similarly, word are inch of 16 which usually on computer programming, language, word and aptitude a bit ones. But here they're six in betweens. Then send Long is there, which is targeted with insane. Later. I long is there, which had signed it today, and flute is there. So these are the most popular and most commonly used data types can see as villas in our you know. But in our you know, the definitions are a bit different. Bite it. Same carrot. Same but inch on some other data types lend may be different. All you need a zil, most of dance. What we do is we either make use off camp. Our inch are long are flute. This is just to demonstrate the similarity. There is no big difference between embedded C on the regular C programming language that we use on 12 computers. The according structure is exactly like C. So there are far lobes. There is if condition there, Mr Lives, they sit straight. Man, there is fine Lew function president known and see pointers as you use and see added structures, unions, even the librarians hash includes mackerels, which you declare using has defined every single piece off the Kuban structure remains exactly the same. There is no change, including structure. So whatever. If you have learned about, see before good. Even if you don't have land about C better, we will be explaining anything and everything as leader. But whatever that is present in the C programming is exactly present into the RV nobles. So there is no change in the structures. The change lies there it lies in the librarians like STD io not edge in your dotage. Not these are the standard input output libraries that return in C for CompuTrace programming, which just has an input device which does has an operative ways. But since we don't have display, we don't have a city, our dotage or even print If put us or put care functions, we don't have a keyboard connected world, you know, So we don't have scan ever get this or get to see each kind of functions. We have a very small aid with brain. And that's why we don't have this. He me mad. Really. It's like a studio door. Rachel in your dotage President said they are, you know, But yes, we can do the bit ways I operation like making particular bits go high and low. Then we can perform serial communication and we can bridge detail exactly like we print on a computer screen by sending throw TV unspeakable to the computer personal communication. Then there is SP I and I two c communication. These are against some electronic serial communication for the cons will be discussing about divorce in detail We can do and are pretty still convention. We can convert any analog signal into digital version off it, using the bacon on the Lockridge to convert weapons off our you know, and we can also perform, It appears imagination means we can generate square Aviles from any pinot far below to the program. But at constants like a NATO displaying keyboard, inputs are not presented. So those are the things that are absent on what are the constraints while doing the programming. The variables always take the lance bass on the entire program that you write down. And as we have seen in love last video we uploaded onto the ball. It is stored into the flash space. So because of the ramen fast space constraints, the thing becomes very tricky. Semi. That is because are you? No, no Has got one little two took a pure flash and merely to keep you off them on favorite operation. Now imagine you doing programming on your computer, which has got maybe fgb 16 GBR maturity of ram are, you know has to keep me off now. So that's why any variable that you declare has to be justified. If your program is Lindy, if your program is a longer one, then you need to make sure you choose the variables carefully. For example, if there are religions that needs to be turned on and off and you want to send a number to them if possible, instrument using word are inch because off calf, because it will take only a bit of space inside the memory. And it can store 0 to 55 R Minnesota 2128 to 1 27 numbers. So these are the concepts that you need to take care off doing the programming in order. No, but arrest off the things almost remains the same between civil ramming and argue. Thanks for watching this video. Keep experimenting 7. Bread Board: Hello. Indecision. We're going to study about the bread port. Have you used it before? Okay, let me tell you, if you belong to electron ICS, then you must have seen this bread board somewhere before. If not, let me tell you what is the purpose off it we have been sending about our Dino. And you can also study about a number of different electronic companies. But whenever it comes to doing any kind of experimentation, we need toe place some components, for example. Rd no is just a plain bold. We have seen it. It has nothing but pins open to it. Okay, Now what if I have to connect and a little bit? You know what? If I have to connect, it led is returned. You know what? If I have to connect a temperature sensor, what if I have to connect an ultrasonic sensor? There are a number of different interfaces which we want to connect with our dino and perform some experiment on it. Of course, you can use some wires on hang on those connections, but it's OK when there is only one or two components connected with her, you know, But when you want to connect multiple components, such as it'll idiots with Are you know you are going to need this. As I said, this is a brain boat. Now let's see what is bread board bread board? It's a bread Good is also called Asgard board are very bored in some areas off. Be bold in India. Usually call it is bread board, and the board is a term which is also popularly available and called around, doubled everywhere. Some bread would consist off a number of different holes. As you can see, this is the bread board idea, and this is how it is divided. It does this black area, it's called as the main 80 appear, replace the components. And then it has this. Why would lay media? What, Here all of them are just blank holes. Let's see how the out. If you look at this column, we can see that there are total 12345 holes. All five holes are internally shorted, are connected to each other. So if I insert a component here, the same component has a connective upto this point also, and remember only this five holes are sorted with each other, which are in the vertical column. Similarly, this five balls this five holes. All the five all pairs are shorted with each other and only with each other. So this fight pins have no connection with EJ. Isn't pins as villas on the opposite serpents? No connection at all. Only this fiber shorted with each other. Same thing happens over here also, and so on. You can see there is a large area her pins are connected to. Why they're connected to each other is because if I can tell entity over here and if I want to connect anything to the pin, I can insert the other component in the same column. That's how this may be. Our particular column area is been arranged. This heart is under Lady is interesting to see as this fight pencil shorted to each other. These fight pins are also shorted with each other, but as you can see, there are 5555 total 25 points in one line during departments in the other land. Starting from this point, all 25 pence upto this are shorter with each other, so they are all connected from inside this first fight. Then there just in five. Then I just inferred than a Justin five. And then it just in front and all of them sipping number one from 25. All of them are connected to each other. Similarly, they're parallel line. It's all connected with each other upto 25 here again, they don't have a cross connection in between. So there is only a horizontal shorting, not a particle shorting over here. In the same way, we have 25 points started here. 25 year, 25 year 25 here. 25 years, 25 years, 25 years and 25 here. If you want, you can extend this connectivity from this point up to this point by putting a jumper over here. Same way you can extend connectivity off this point upto this point by simply connecting a jumper over here. Exactly. Same thing applies to the bottom line souls as a general practice. What we do is we use this area as may Nadiya for placing the components and use. This area is the common area which are most usually the power lines. Use this as a power line. So answered all this five points are shorted. A break at this point and again all five ports up short in the same mitt. This horizontal lines are connected internally in this way exactly following the red lines and they have a break at this point. So if I want to short this point upto this just one jumper is native from here to here. In the same way, you can also join this columns if needed by putting a jumper from here to here. But usually we don't need to do that. This is how we connect components onto a Breitbart. So it existed. Remember, two points off one component are never connected in to existent vertical lines. One point distended clear in one place, under point gets connected to somewhere else. Then this point of this resistor is accessible by this small vire in the same line and disconnection is extended again to some other location here again become a stolen picture which extends the connection to this led on the second point of led goes to this point. Now hear this led point will be accessible from this point to this point and revenge. This is how they perform Breitbart connection you can also broads for a number of different how to use Braidwood videos onto the YouTube, which will give you in depth details about this bread port. But most importantly, for better understanding, all the videos and tutorials are aside. What you have to do is grab a brain board yourself and try to see how it books human also end up burning some components and that's okay, that's part of the study. So this is how when I see is inserted. If we have a small eyes, you then four parts are one side of the diet secrets gonna get to one part of the breakable and other part to the other side so that they don't get shorted with each other. This is how we can use single sided connector. So here the number of one off I says this 234 and number five years here, this one number five is accessible on all pins. So I put just put the fire over here which existed Spin number five of this icy gives that connector to register as well as facility. Similarly, you have to perform this connection where you want to have it. Ladies eight resistors connected toward you know, As I said, this article points are sorted from this point upto this only. So you have to put the jumper over here so that you can have these lines and extend it up to all the lines over the Breitbart. Cater's off. The energy are connected to common pins. They're all very common by a single black wire which will stick around Anders off the in. Idiots come to register through this protection. This register goes back, back into the other section of the bread board and goes back to the are, you know, pin in the same way. Are all ideologies are connected. I hope you will enjoy making this connections happy learning. 8. LED: in last session. We see how to download a program onto their dinner board using the order blocking now in this session. What we're going to do is we're going to discuss about this beautiful electronics company. Skulled led IDs. Let's begin led stands for light emitting diode. This is by far the simplest and most widely used electronic component in experimentation. As the let's study off microcontrollers, the symbol off energy is like this. This is the symbol off led, which usually consists off two terminals called an or and cattle. These two adults indicate that this is a light emitting dire. If this two arrows are not present, it simply means that it is a normal diary. One important property off led its. It conducts only in one direction when it is connected to the supply. So and what has to be connected to Posit two point and Catherine has to be connected to negative point of the supply. Only then eligible, connects or conduct, and it will turn on in the aliens connected in the other direction. It is called us reverse biasing off the lady, and in this configuration that led won't turn on looking at the bottom off any energy we can also see. This is how the led an order and get her looks. But the simplest way to identify the independents. It's to look at the energy from outside of you. Generally, a bigger led or bigger laid off that led bigger leg of that energy is the energy and the shorter one. It's cattle. There is one more indication. If you look inside the lady, you may see there are two substrates out of which the smaller substrate is that off and or and the bigger substrate or the larger substrate is that off cattle ladies are used everywhere on there are not a single. It can always this fight. How many places are how many applications and led Is Houston excuse for indication, as the less it's used to give light throw the microcontroller experimentations views el. It is only for indication purpose, and that is why ladies are always used a long, bitter Siri's register. Now let's see how it's interface with our dino. This is the other day. No, no board, as we have seen and every ardent hope in has by default. One led connected to its number 13. This Ellery is always connector veto. Serious register. There is a story we see here is the tweet. 30 Home register athletes and 100 of register has to be present between cattle and note and supply voltage. Here the led is connected in a very simple configuration. There the cattle goes directly to the ground off are, you know, and an or Vitor register comes to the number 13 off are you know. So when you do digital right in number 13 High, Hyman's vote off five world level signal is generated onto the spin. And when five World Signal is generated here, a current limited current floats through this lady through this register and led and they lead. It turns on when video digital rights number 13 Khumalo It means zero hole degenerated and appears onto this spinoff rd no, thereby turning off ability in such a way. Whenever you do digital right high on any of the pins from 0 to 13 or a zero to If I What we get is plus five fold as their put wordage, it's very important to remember and video digital rights that pin number Khumalo. It means zero world appears onto that particular been any lord connected in this configuration will turn on fan logic highest given and will down, off when logic clue is given This is how we write down the instructions So one of them could be digital right? 13 comma high and everyone can religion tonight 13 comma Look, it has to be low over here. That was a single led on As I told you, there are delegates. There is a single led connected on toe every ordeal aboard and hence we have also seen the output off how we can blink. This led now If I want to have multiple, it is connected to the already know Look at the schematic. We have discussed bread board in depth. So this is how you can connect eight different elevates to the already know You can see the simplicity ads All the cater's off ladies are connected to the horizontal short lines one off the horizontal short lines. Since 1st 5 sections off, horizontal lines are connected to each other and later, five or not, we need a small jumper wire here to connect the entire cities from his dot Up to the last note over here. Ladies are connected in such a way that cattle off every lady goes to this common line and a pin. It's connected from this common land to the ground of our dinner. Then I noticed off every allergy goes to a minister. We have used the same 3 30 100 store over here and we can get the other point of the register to the Arduino pin here. There is no limitation at all. You can use anything from pain. Zero to pin 13 and been a zero toe. If I can get this eight diligence, we have used the number 1234567 And it now all we have to do is we have to create two different projects. One, It's simply make all the energies go on and off. And second project is to make for a lease on and for religious off one after another, I will demonstrate how to make all of them go on and off, and later on you can create your project off making four on and four off. Along with these two projects, I have multiple quizzes, assignments for this particular interface Did it not only clears our harder concepts. But you're also clear. Suffer softer concepts regarding how we give output any already know pins. So I would recommend you to place complete all the assignments after we see how to make this are all eight delegates go on and off through the program. Now let's start with a donor program for it. Here is the block record which we have created before. What I do is use the same repeat while true look and they go on reading said digital pin instructions. One after another we have our religious collected from the number 1234567 And it esporte this bag so will choose it. Lines elect once, so take coolants and then the click it in duplicate again duplicate. You can also duplicate this entire section not available here now. And another one is it So magnet spins three, four, five, six, seven And it we have made them All workers are put pins. Now I have repeated I have copied in the centre block implicated this entire block. But here I don't run this much, so I'll just drag it over here. So its military So they're all it elevates at once. They will be made high and neglect dealing off one second over here. And then I will have all these eight lines here. But instead of high, this thing will make them all go. No. And once again, when all the ladies hi Billy and Low is done will put a delay of one second. So this finishes our program toe, make all the eight allergies go high and go low. Richard Ely off one millisecond. First you try this program, then try toe reduce this billy routine so that you will get up higher flashing great awful idiots being on and off. Next. What you have to do is create your other project, which is make four religious on and make for religious off. So, respectively, what he will do is in the 1st 8 lines. What off this eight. The 1st 4 will demand high. The letter full will become true ability, the latter for William in Blue. Here. The 1st 4 will remain low and the latter for William in high that we make your all high end or low program converted into four heart on and four off program. Now just click on this button over here, which uploads this sketch into her. You know, as I showed you this kind of our dino invoking happens once when you click on this upload button, end up loading blesses starts depending upon the competitive spirit. This uploading process may take some time as it takes on my computer. But as soon as it's completed, we see this success message over here on this particular already know in walked picture disappears. So this program is downloaded over here. After downloading this complete program in the next session, we'll see the output off the same program onto the hardware. We have a set up connected with our dino and 80 ladies onto the bread board at shown in the presentation. So we'll see. The output will also see by decreasing this deal. It's how that output changes so you can convert the same program to the four realities on and four ladies off by simply changing the instructions as needed. There are multiple quizzes followed with this particular program, which you have to execute, and it would be good if you perform them all because it clarifies all the programming related concepts off digital output would stop here 9. Final Movie All Led On : 10. Final Movie Alternate Blink: 11. Final Movie 4 On 4 Off: 12. Final Movie Chaser: no. 13. Final Movie Blink 10 Times: 14. Final Movie LED and Switch Program: 15. Final Movie Leds and Switches: way, way. 16. Buzzer Programming: Hello there. In our last session, we saw how to interface a switch or a digital input to the Arduino microcontroller are you know, boots Decision is a very quick decision, which is about interfacing off a bus. A buzzer is a small pizzo element which comes either in this kind of format on this kind of format, this one, which you can see, is a PCB mounting type buzzer. And this one has two different wires. Both of them can operate from three World toe up to 30 voles, and they can easily operate at five old off our deal. Interesting with the buzzer. It's fairly easier when it comes toward, you know, board everybody. There is a pin so buzzer and it has an internal circuitry which can 100 the sounds for it. It has an an order as well as a cattle terminal clearly marked or to the body of a person. Plus, this kind of buzzer has red and black wires, which clearly signifies that it has one pin acting as ground underpin acting else. The this is your supply voltage. You can taste any buzzer but directly connecting its positive will teach to five World off our dino and negative pinned to the ground off already know so by directly connecting it to the Five World under ground, the buzzer can turn on immediately. When you want to control it from the garden opens, you can connect the unheard off, this buzzer or the positive off this buzzer to a microcontroller pin. Are you know, pin like this here, the red or positive off this buzzard is connected to pin number nine and black or the negative is connected to ground the beautiful bazaar ease. You just have to simply write high onto the spin and the bazaar will done on your right Lou onto the spin and the buzzer will turn off. Moreover, if we do this high, low, high, low at a very high rate or at the very faster it, then we may observe different sounds with the buses. So totally depends upon owners how we want to make a buzzer on off. If you want the simple beep, then we'll just make it higher small law and immediately make it Sorry if if we just want to be, then we'll make it higher. A very small dealing and immediately will make it. Look, if we want the continuous beep, then accordingly or programs will change about from just creating beeps by making it on and off are you know all supervisors with a tone library which facilitates the usage of buzzer ? This stone library can generate up any particular frequency any particular given square where frequency on any pain of the ordeal. Here we have you spend number nine and that's why we're showing the number nine in the block. So this can be used to relate very stools. All you have to do it. Select the desired pin and desire frequency with which you won't go down on the buses. So there is not much into the programming off this, but then interfacing. But what we'll be doing is will be looking at the buzzer programs on how their outputs sound like Thank you 17. Final Movie Buzzer: 18. Final Movie Buzzer and Led Program: 19. Digital Input : Hello. In last session, we saw how to connect multiple led. It's to already know and how to write on programs for it, using our blacklist softer, locally based software. In this session, we're going to see how toe except digital inputs onto an hour in open, as we have discussed before. Also, every been off are, you know, from PIN number 0 to 13 and the number is zero to if I can be used as digital output as villas. Digital input decision is about using the particular prints off RD knows as digital input. Let's begin. Usually whenever we are developing any kind of electronic project or any kind of electronic system, we may come across connecting a switch to our project, say, pressing a button to turn something on our pressing a button turned to son Turn something off and minister stings. Moreover, not only buttons, but we can also connect number of different sensors so they already know toe work as input . For example, a proximity sensor are, ah, line sense are there are many types of sensors. Usually these buttons or did sensors are to be connected to the input off are, you know, as logic. Input means they should not give voltage more than five old and they should not give all taste less than zero. Whatever is applied to depend off our dino, everything is within the range of five volt. Then it is treated us logic high. If it is in the range of ground or ground offal dishes a player did it restricted us. Logical. Here we're looking at the simplest tactile buttons which are very popularly available and can be used with RD knows this track 10 buttons are very easy to interface with our you know, they also come in a foreleg pattern as well as a to late pattern. So this can be interface to the are you know, along with any kind of digital input. But before interfacing that we need to see how digital input is red in our DNA programming . Look at this concept first. I never want to connect the switch. Say this is the configuration which we want to use. That switch here. This spin goes to the are you know and this is the VCC means five world. If this which is pressed, we're sure that will get five old from this pin on the Arduino pin. But when we do not press this switch, what is the state of seals? Absence of logic one or absence off high doesn't ensure presents off logic low or zero Here . This creates a prostate condition, which is also called as high imprudence, condition and distress. It condition is usually not good for the embedded systems are not good for the microcontrollers in that Christ, it's situation. The RD no can take any decision it can either treated as higher or it can treat it as Lou. So over this problem, what we have to do is we can connect up the register from the Arduino pin towards ground. This concept is called as a pull down that the stuff, see what it does when this which is pressed the garden open over here will get the decency straightforward. No issues at all. But when the switch is released, this resistor ensures that the pain which is connected here will get a ground potential. Through this register, it eliminates the problem off frustrating. So if the switches pressed, it gets logic one. If this which is released, it gets logic zero in a similar context there is a concept off. Pull up where we connect a switch against ground and we need to have ah, pull up resistor. This is the same resistant, but this time connected to the sissy. What happens here is when the button is pressed. Input at this point will rid logic zero, but when the button is released this point, it's full high. Or pull over a sec or pull five world through this pullup register in already know when, everywhere making connections. We have toe either connect the pullup resistor on harder, or we have to enable the internal pullup resistor. Initially, we'll see how to enable then will. Initially, we'll see how to use the pullup resistor by connecting it externally onto the bread. Board here will have multiple assignments and first and the simplest of the assignment. It's to connect a switch in exactly this configuration and create an led or make an led go on. If the switches pressed and Macon led go off. If the switch is not placed in our you know, we use this pain digital really, really any particular. Be enough are you know also the pin Particular pin has to remain to work as input pin, which happens automatically in the Are the block as far before digital really function in our dino raise, either High street are low state, depending upon what is the potential person. TORONTO They are, you know, been Let's see a sample circuit diagram. If you look at this sample schematic closely, we have a switch connected to pin number two. We disconnected toe plus five bolt or decency. This is this configuration verse, which is connected against basis. So here our pin number, so it's connected to the city to a switch and the number toe. It's also pulled down to ground to register. This resistor can be any general purpose resistor. You can use a 4.7 K or you can use a tin can register here. So if this which is pressed, been to Mildred plus five world or logic high. If this which is released into Mildred ground, our logic zero. So this is how we have to do. Okay, now let's try to write down a program for if a switch is connected in this configuration, and if we have to blink and led, or if the switches pressed. If we have to make an led go high. Then what program is needed? So the problem Assignment here. Eaves connect a search you already know been. Do connect other points off. Switch toe sissy, connect up, pull down resistor. Thanks, youth and a lady at been 13. It's which is pressed. Led will turn on if switches, not Wrist Lady will done off. Now here. Program doesn't know if this which is pressed or if it is not pressed with program notes, whether the hundreds high or the Penry's blue. Let's that I don't a program for it in our the block. So let's let's start with the program here. So that is going to be logic and see for if and do here. We want to really the logic input connected a pin number two and make analytical high or low. So in the input output tap milieus did digital pin here. We want to really pin number. You can see accidents. I take that block in set up. One liners added that it's been more two comma input. Now what we'll do is we'll create a comparison off this input switch against ground are basis E. So if this block, which can perform an equal to not equal toe greater than or less than kind of comparisons. If digital pain true, it's equal toe get into the logic will trick through as further socket that we're creating . If the switches pressed, the pin will read Plus Five World, which means logic I, which means true. So this loop will execute if the switch is true or if whatever we have pressed or whatever we have, whatever the switches pressed, whatever switch they have connected, it's pressed. So the switches for us, what we want to do is the already connected to pin number 30. You can also use the built in led here making time, and similarly, if you just duplicate this entire block, then there is only one change. If digital read up into is equal to equal toe falls, then we'll make this lady go. Look that simple as that Soc The Ordina program corresponding Ordina program has also injured greater here. What happens is if the number two receives a logic one or two signal, then the eligible made high, and if the number two this is a logic law or false signal, then the particular pin is made Lou the hardware off this particular experiment along with the schematic. We will see in the next video all you have to do after you have the created A program like this is downloaded. This to the Ordina Board is in this button and we can see the output. Thanks for watching. 20. Serial Communication: Hello, everyone. So far, we have discussed about the input and output of the already know how to make the digital input how to make the digital output. But you might have noticed that with the Ordina, we can definitely make depends go high and low that it's five world and zero world, but so far we don't have any output device with art. You know that's a big limitation for us, because if we want to print any messages or if you want to do anything with our dino, which includes messaging or showing some data, it's not possible. Decision is about the serial communication there. You can use your computer directly as an output device off already Know you can send data from already know too PC as a less trumping sit through the ordeal and decision. We're going to study how the serial communication works and how do they don't a program for it. So let's begin. As you can see, serial communication is transferring and reception off data or any kind of digital communication between two machines. It is always cereal, so that's why it's called that cereal. We have two different pins dedicated for serial communication. We have two different pins dedicated for serial communication. Been number zero is the attic Spin off our dino and pin number of honesty he explain afford , you know, zeros addicts. It means that it can receive digital later through the spin and one is P excitements. It can transmit data through the spin, beginning with the dystopian serving hardware serial port Pence off are you know, which goes directly to the microcontrollers p accent at expense. They used the cable with which we have connected are already know all really toe with up with her computer access our communication channel. And we can directly send data from our dino toe, the PC and from PC to the order. You know, this communication happens over com port in windows which shone in device manager like this . I have told you before also, this is a screenshot off the device manager where we can see the already notes comport, It's presage. We need to know this comport number Come 11 in case off my computer right now. So you have to check this come number. You have to check this gun number if you have to do any communication with the are, you know, board. If you have a return, some program in our dino, which sense later toe the PC or which receives something from PC, then you can use this kindof terminal software's onto the Windows computer. This is Terminal by Bree You can just search it for terminal bribery. It's a very good utility created by a person called Break, which can be used. It's 1/3 party software, but definitely safe to use here. We have a choice to select the comfort which we want to connect, connect button and some bits per second or Baldridge settings. Whatever said by Arjuna will be seen here, and whatever we will be sending will appear over here. Apart from a terrible This after our dinner itself, provides us with a very simple utility called It's Our, you Know, serial terminal. On our, you know, serial monitor, it looks like this very simple. Hey, this is the window where the messages to be transmitted or the details of the transmitter is visible, and this is the window where the messages sent by our Dino Arkan civil onto the computer. So this is the serial monitor, which is by the 4% in the already no i d. In today's experiments are any experiment with Serial Terminal. We're going to use the serial monitor presenting already know itself, since our A block away don't have its own cereal monitor, we will open our dino and we will access to the serial monitor given by their dignity. This is our in our text were escorting the initial Izabal serial port. It is initialized with serial dot begin function in the bracket. What we give it something called us Baldridge. This body does nothing but bits per second. It's a standardized value, which is used by both. Departed is presenting communication, so the transmitters vowed rating for it is 9600 Then the receivers about rate should also is it true? 960 And the small button in our Dino i D gives us access to the serial monitor. In order broccoli. We just have to put a single block like this. Set up cereal with speed 296006 per second, and using this function, we can send any detail toe serial port which will be available or which we've seen on the computer screen. So this is how we do it. This is text with Cyril wrote begin function and this is the block off serial begin. Our are the block Cliff core to begin the communication. The standard about Brits Italians are 240040096001 incredible zero upto 115 to 00 Make sure make sure if these are the voters are one of the Bader did selected here. We have to choose the same boat it Then we opened the detail in PC based software. This is how we write down how toe right deter to the serial port in Texas Escorting. We will write serial dot print or serial dot print Ellen and we can directly put a text string over here or a variable over here in gets off ordered locally. What we will do is we will simply is this serial dot print function and we can put any kindof arbitrate next year. But we can also put any kind off variable here. What you see in this colored boxes a variable. If there is a variable, it is converted into asking for much and sent to PC So these are the blocks used for transmitting data from Martino to the computer. When the seven data from comforted to the RD no, we have the first check. If cereal not available is greater than zero. It simply means that if some data is available on cereal porch, then dysfunction Britain's 12 or the number that many bites which are available for reading so if surrendered available is greater than zero means even a single bite is present. We can really this using a variable like this interagency call to cereal or to read will read that bite into a variable called Extreme as always, retarded broccoli. This thing, it's pretty much simplified. All you have to do is just use this single block, take a variable and said that variable just like endurance. Equal Toe said that variable too. This block prompt for number with message enter. This centre is nothing but something that will appear on to the serial port, and it will ask you to enter some numbers after this evil inter number from cereal porch and that number will be saved in tow. This variable called I Am video. Furthermore, you can do anything with this number, you can compare it. You can perform some develops on off with it, or you can do anything you want. Looks like to see a sample court with it. Okay. Before that, let's see, how do we experience or how absurd this data onto the serial port? So this is how the serial monitor off our dinner looks like. The most important here is the bordered selection. We have to take the exact same voted, which we have taken another program, like 300 here. Our 1900 over here. Whatever you put another program should be selected over here. Okay, Let's see a program how to transmit data to a PC and how to receive some data from, please. This is our order. Brooklyn office. We will start with, Comes over here. We'll see. There is a conception in which we have set up cereal speed toe, 300 bps. I'll make it 96 years. It'll you will see in the text, scored and set up cereal or bigger. 900 line heads appeared. Next. We just have to try to send data to the PC, so I'll just use this serial print and from text will take a blank section on Let's late Hello World Next What we do it's We'll try to read a number from Serial port, So let's take a variable over here. You can change the name off the serial from item to anything like here. Well, the name is that LTD's out of ST So said Al Exito again comes ran for a number with Message No one will do its well are some deal. It's in between so that we can easily identify our functions. So after sending something on PC will put the one second of daily then this block and now what we'll do is we'll again wait for one second and we'll resend. This are extra variable toe the PC. So this is equal program again. Use the serial dot print Very function here and our Delia. This time I won't put any text over here. But instead of text, I'll simply put this variable over here. What is the name of variable? We have given 60 so just call. It is R 60. By the end of this program, what output we expect I already know. Sending hello Welsh toe the PC rate for the second, then our dino sending enter toe The PC here are durable, which we put some number onto the terminal as soon as we put some number into the terminal . That number it's stored in a variable culture at extreme again our Dino Velvet for one second. And it will send the same number which we had sent, which to the serial port. So that we get to know that whatever we have sent has been received to its We just have to upload the score. Using this button has told you before. It involves are you know, and it starts uploading into the board. You can also see they are You know, I d output over here after the program is being downloaded here, I lose this already know I d to fuel the output on a serial terminal. I get up in the City of criminal using this button over here. Uh huh. But I can also go to tools and serial monitor in order to do that, make sure the comported selected here, which is exactly same that appears in your diverse vanishing. As soon as I opened the serial terminal, I get a Hello, world. Remember wanting in our dino whenever you opened the serial monitor? From this point, your rd no incidence it and it starts executing from the beginning. So what? We're service Hello Words And the terminal is asking me to enter the number l enters a tree and click on cinch. After a second, I got three after another second I got hello world as villas Interest. It means the program is now repeating itself. I'll put here now five and take on Sent. It's sudden I decertify Hello worlds and enter. It simply means that serial communication off our our dino is walking with this art of locally program. There are very interesting project assignments which we have to do with serial communication. Moreover, for the different interfaces like analog, Moreover, for the different interfaces, like an agreed number of different sensors or ultrasonic sensor, we're going to use the serial terminal as our output device. The parameters of the values recorded by dot sensors will be central serial port and we'll see them in the serial terminal. Oh, silly monitor Off are, you know, hope you like decision. Please complete the assignment. So you get completely clear with the Are you not serial port? It's involving some militants on some different interferences. Thank you 21. Seven Segment Display: so in decision, we're going to study about another very into say interface and that it's a seven segment display. You must have definitely seen a seven segment visibly, somewhere in your life, whenever you go in public places like banks or religious stations are theaters or malls. You must have seen some form off led splits. Those little splits appear something like this. They're available in digital watchers, Elektronik, middles, calculators, radio systems, microwave over inveighing machines. And, most important, application is displayed. A number of different displace at a public address system. Public location systems. What is there in this kind of this place? There is a very specific type of display called It's seven segment. Why do you call it that? Seven segment display is because it consists off seven different segments, which can be lipped on any number. Can we display with this display? It's There is one entity behind every segment, as you see in this picture that segments are labeled as a B C, the F. All in all, there are such total seven segments, and there is an eight segment also, which is called us. The simple point there is one led behind every segment and then that led is connected to a supply with proper register, then that particular segment. But I turns up what we can say. Let's up depending upon the sides. The voltage applied to the seven segment displays make happy. This is the most common and most popular smaller, half inch certain segment display, so the overall village overall, the height of character of this displays half inch. This kind of this place can be operated with five world supply, and there are different led. It's for different segments, so we have to carefully connect those spins and make them on and off. For example, in disgracefully, if I have to print five, then I have to turn on the segments if g see de and so on. So this kind of numbers are generated with seven segment display. It's on. We need to properly tablet. How presented a particle a number off it in division sound, said one. Displays is very simple. Most of the seven segment displays are one of the two types, one it's called it's Common cattle. Another one school debts common and no in common. Entered in common cattle. The cater's off all the seven segments are all that seven delegates are shorted and given toe one point of the display, which, which is also let's see. See that is common cattle. This one is the ground been or negative off the idiots, and hence it can be directly connected to the negative off the power supply. Then this led. It's with a proper register kinetically goto, microcontrollers, spin on our little spill for interfacing in common and are displayed a north off. All that, seven said, validates our shorted together and made common. This is also called Let's See That is common and Cater's off. All the Myriads are available on to the spirits the display, which we have right now. It's a common Anno type display. So in this conflagration all the owners are connected to sissy and what we need to do its connect dispense with a citizen sister toe. They are, you know, remember, in common cattle display. Logic high has to be given to the segment been to live that led and in common scattered so in common and on display here. We have to give logic zero in order to let this segment we also want to formal it a table leg this which can be used to let a particular lady with her particle up number. For example, if it is a common I know display and you won't took printer zero, then we need to make all the segments go low, because when we give, known to the ardent up in that segments will turn on and only one segment escaped higher and that its G this will print number zero. Let's see how consider this. That's common cattle display common and display, so we only want this segment to be off. So wherever genes connected, I will keep that in high and will make arrest all the pence low so that the turn on and creator can I throw based upon what display you have. You have to change your interface in style or in professing soak in Dagenham at Sensei's way have a common energy display, and that's why this is the interface in diagram. Following the common energy configuration, we have connected this common a north wind to a great board. We have counter this, and mention display on a bread board on the common field is given to the five you know for their by the common Interrogate surplus Final supply and further with each segment, there are individual registers. Desert little home registers, Unusual registers are connected to its segment, and they go toe respect to our open open number. 234567 Eat way have used this much for interfacing. Now this is purely based on trial, and experimentation are you can in advance creative people like this for your common and display to print the number to print any desired all minute fluids. They have to specify here, which means they're connected to A B, C D E F G, and this is the sequence needed for printing those numbers. If you want, I'll just wander over this side for sometime, or I will just wait on this site for some time. You can also referenced later the constant review at this point. So this is negativism diagram. A simple project you have to do with seven segment display. It's creating up counter, which counts number from zero one toe up to nine and then the pitch again from 90123 and sore. I hope you will enjoy this project because it involves a seven segment display, which is very interesting to see once it gets up on. I hope you like this assignment. Thank you. 22. Tri Color Led : in the last session we have seen about ladies as well as different switches. Toby interface with the Are you know in this session will see a very interesting kind off led, which is a tricolor reality. As an in suggests, the led itself can generally three different colors. Those are red, green as a less blue. Usually this led comes in either a common cat for more or in a common and normal. This is just like a normal led, but instead off single entity. In the same package. There are three different delegates which share Idella common cattle or ground connection, or would share a common and normal five old connection. So the default led, which we have usually is the one which is having a common ground connection are common cattle connection. So here what we have to do is we have to connect this ground or the largest you know, the lady, which is the common ground to the ground correction or the drunk enough. They are, you know, and this red, green and blue pins with their respective register can go toe any enough if I have to prevent this with our dino de schematic should look like this. Ah, common pin, which is the middle one. Second plane from the Liar left side goes to the ground terminal onto the first other remaining three pins. We connect one register each and then the spends goto the number seven, six and five off. What we have to do here is make a particular pin go high. For example, if you write a program to create or to make the number five high, then respecting to this particular spin are ready collectible be generated by the ladies. If we keep retire, then the red will stay on. If we make the number five low, then the red will turn off. For the immediate simple turn off. If we create the numbers is if we make the number six go high, then the green color will be generated. And if we make the number six law, the eligible turn off. Interestingly, if we keep both red and green powered on or both of them made higher than the energy will genders, rail and green color at the same time, thereby generating a new color. Interestingly, if we keep both the number five and number six high when the literal generate weird and green at the same time. So what color degenerates when we combine the red and green, the energy will generate and yellow color. Similarly, you can combine red with blue green, which blue. You can also make all three off them go high at the same time, generating a little bit off whitish color. Not a purified. But yes, it can miss it. Toe fight Killer There are many interesting projects which can be done with this tricolor lady, which will do one by one. One of the project is to create a traffics and Melo doctor, so you have to create red, yellow and green colors after specified. Really, the program should run automatically. Second program. I want you to create AIDS makings off three switches and if one switches pressed, one particular call originated in the adults, which is pressed. The other color should vision record and definitely we keep Buddhist, which is pressed at the same time. Then true colors at the same time should be generated onto this led hope so that this interesting projects will keep you hooked onto the are, you know, for some time and next session we'll see the practical Zoff, This particular experiment. These are the project assignments. As an stated, you may know them down. Interestingly, if we make the number five and number six boat off them kept high, then the led will generate rail as well as green at the same time, thereby generating a new color, which is yellow. Yes, you can mix the colors the way you want and the relative in response. So what you're combination is given I want to do create first. I want to experiment with this silly so that you can generate all three colors as well is the combination of them. And then I want to do create two different presents. Sort off it. First, it's creation. Often automatic traffic signal with tricolor led, which will generate red, green and yellow side by side with a little bit off dealing. Second project is I want to connect three searches on this three ladies creativeness is tricolor Lady consented three different colors if one switches pressed and initially mitigated other footage. Green cards which blue? If any of the switches our friends at the same time, then both the output Should women higher elevation, generate color mixing type of back hope you will enjoy this practices, and it will keep you hooked onto the Gardena and dislike of the religious for some time, enjoy the station and back together. 23. Ultrasonic : Hello, Devon. In decision, we're going to study another very interesting sensor that is called its ultrasonic sensor. It looks like this exactly the one which is there in the presentation. The beauty of the sensor aids. It's a fairly low cost sensor, which works on the ultrasonic principle and the sensor. It's primarily used to detect distances. It can detect accurate distances from four centimeters up to 200 centimeters. Interfacing off the sensor with microcontroller is very easy. This is just a single four pin sensor, and we just have to understand how this address on extensive works, and we can easily able to write down a program for it by interfacing it with the ordeal. So let's begin. Ultrasonic sensor works on the principle of equal off sound from a surface. As we see, the sensor consists off to different transducers. Both of them are actually identical transducers, but one off them act as a transmitter and another one access er receiver On some sensors. Translators indicated that street and as are the Sievert like this, what happens is the transmitter transfers are very short or you bust through its sensor, and whenever there it's so face or whenever there is a collecting surface in front ofit from which the audio can transmit back or reflect back. Then order is reflected back from that surface and is being captured by the receiving transducer. What we get is the except time duration between the transmission and reception off this audio signal on based upon the time duration, we have to calculate the overall distance traveled by the sound. Applications are many, most important and most primary obligation off doesn't sense that is definitely the distance measurement, usually in the construction areas. Also, he was indeed contact list Distance meter, which are based on ultrasonic sensors, are very common know instead of just following the day. Best matter to find out distances between two balls and two places plus ultrasonic sensor can also act as a mortar level indicator since it does not need toe be in touch with devoted itself. So it's a non contact best what the sensor. It can be assisted on contact best water sensor and robotics. We can use it as obstacle avoiding robots in almost every car parking sensor, which you might have seen till now. Ultrasonic sensors are used to accurately detect the presence often obstacle behind the car , and our not selling sensor can also be used to measure the dimensions of the project in a complicated set up. Let's see how to in professor does sonic sensor and how it actually works. That said, it's a very Zimbabwe's. This is the operating voltage of the sensor. It works on plus five DC so it can be powered on their it live it or do you know operating current of the sensor is 15 million Pierre majoring angle. It's 15 degrees Celsius and the range. It's too sentimental to four meters minutes, 400 centimeters. It's been a very isn't helping out. It's very simple. It has a sissy trigger PICO and ground basis. He has to go to the plus five Power supply ground has to go to the ground. Pin or negative will take off our power supply. Shiver and equal distributions can be connected toe anything off? Are you know any general purpose spins off already know the working principle, as I said, is very simple. A transmitter off the sensor transfers an Oreo boast from reflecting surface. The sound is reflected back to the receiver, and we have to find out the distance based upon it. Here is the working principle and very distant to understand. Let's see, the first thing we have to do with this sensor is we have to give a 10 microsecond falls to the trigger signal to the trigger input. After every giver 10 microsecond pulls to the trigger pin, a small audio bust is generated and transmitted from the transmitter. Remember, first thing is to give up 10 microsecond pulse know how to give 10 microsecond pills. Just make up enough are, you know, high just connected to a trigger pin. Wait for them microsecond and then make that been Go No, that's it At soon as this trigger pulses, given this equal been, we become higher. Here we have two people in the echo. Pulse duration for high period equals remains high as long as there is no reflection. And as soon as the sound reflects back from some surface or some reflecting surface and received by the sensor or deserted by the receiver, the ICO pin becomes thereby. What we have is the pulse village off this equal equivalent to the distance traveled by the sun, hence many times This ultrasonic sensor is also called as a POW output sensor. It simply means that it gives up pulse Werth modulated or put off the distance that is being made. Sure. Now let's say some calculations off this ultrasonic sensor and how we can deliver distance out off it. Now we assume that we really major this duration, using our denotes balls in function. We can measure this duration in microseconds. Now let's see how they can help to make the calculations spirit of the sound. It's 3 44 metre per second, which we can also say it's 3 44 00 centimeters per second. Now out off this speed, this is a distance traveled by sound in one second. If I have to find out time required for traveling one centimeter, then what would I do is I will take in verse off this spirit I debate 3 44 00 centimeters per second. Is the spirit off sound. I want to know how much is the time required to travel once intimate er so definitely time required for one centimeter will be one divided by 34 before 00 I can do this calculation also one de breaded about 34400 What we get. It's 2.9 into 10 to the power minus five, which is a Quito 29 into 10 to the power minus six, which is nothing but 29 microseconds. Now what we have is time required for traveling one centimeters. Then what we have is the total time that has been traveled by our sound. So the calculation of distance becomes very simple. It becomes distances, it will do This duration divided way 29 duration. Will the suit from the pulse Werth and 29 over here. But here one thing is to be industry. That the sound traveled is a double sound double distance traveled so it emits from transmitter, reflects back from the transit reflecting surface and comes back to the sensor. It simply means that the overall distance traveled is doubled. This formula off duration divided about 29 will be applicable if we had been measuring the distance at this point. But no, we are not measuring distance at this point. But we're measuring distance at the same point that the transfer that is located so the sound has traveled double distance. And that's why what we do is with the white this distance reading by who? So the distance becomes duration diverted back. 50 it to summarize. Let me repeat it again. First, we give attend microsecond pulse to the trigger input. Then a small audio busters transmitted and equipping becomes high. We need to measure the pulse worked off this week. Open as long as they coins high, we need to keep measuring the pulse with it. It could become slow whenever there is a reflection and the sound comes back to the receiver. So we get a duration off this couples in microseconds spirit of the sound is 3 44 00 centimeters per second, and that's why I'm required for one centimeters equals to one divided about 3 44 00 which is nothing but 29 microseconds. Now we have this pulse Worden microsecond and we have time required for distance. Traveling one centimeter in microsecond. All we have to raise distances toe duration divided by 29 because Brendan and microsecond is the time required for one centimeter, and this is the total time period that it's traveled. But since their distances double. But beware this quantity by two and we get distress is going to do a racially divided by 50 it It gives us a precise distance in centimeters. So this is the formula. It can also misstated in this way. But since the time required our time up change in our our dino is in microseconds. This calculation is not possible. This is how we interface it with the already know. So this is supposed to plus five alert ground goes to ground trigger and cope in can go toe any GPL open. So far, it's not needed to be connected only over here. So here it reads. Connected to trigger and a four, it's connected. It's connected toe equal but its own manager and you can correct it anywhere as Jewish, depending upon what we discussed. This is the algorithm off our program. First we initialize the serial port. Then we do the trigger pin high. Then Michael, Second Billy, to get up in low. They agree with the pulse. Will it perform the calculation? And Lexi hope to write down this program using our job. Lockley using our blocks. The project is very simple. That is distance Mitt. This is our order blocking posting, as answered. It's initially it serial port. What about bread off? 96 Level zero, then next. Certainly still Input pin or the still pin to hire here our IQ open. Did your opinions connected to it too? So we'll make it to pin. Firstly will make eight open loop, so that establishes for some time. They believe it for one second, and then I'll make Saudi. Firstly, I make this trigger pin Lou bit for one second and then we'll make this to underpin. We only need to keep this trigger pin high for a short duration so that short tradition isn't it. But then microsecond will have this beach microseconds block over here. So far, the values in one lady wait milliseconds block. No, we have used with microsecond spoke, So we'll wait for 10 microseconds immediately after it. We will make this pin the trigger pin cool. Look, it's true that and now we make it look. No, they're scared of variable, said item. Let's call this item ads duration and let's set this duration toe, but it's really high piles on bin it. This is our equipment read hypothesis this is our equipment. So we have a report. We have taken this variable duration, and we have a signed the hype figure or we're reading the high pulls off a tree that is ik open the equal demand higher as long as the sound does not come back at certain sound comes back week, open will become low, and dysfunction will stop it executed. Next, let's create another variable and looks well. This video bullets mistress so distance is equal to a small matter. Motives. This do addition, divided by 58 and lastly we print is the sense onto the serial port with new life. As always, after the entire program it's completed. We'll take a small dealing before repeating it again. As you have seen, the entire program appears inward loop, and that's why it executes infinitely forever uploaded this program to their dinner board and city output Off it. The output off this ultrasonic sensor will be seen onto the serial port of the ordeal, so make sure toe open the RD no serial monitor after this program has been applauded 24. ADC Input : hello. So far we have seen how we can have digital inputs in digital outputs with are, you know, we can connect any kind of imports. And Celeste outputs, like led its to the garden opens in decision. What we're going to study its how toe, except analog inputs with are, you know, if you belong to a technical background. Good. If you do not believe in tow, a technical background much good, because anyone, because anyone with a little bit of technical background will Tinkoff analog input mince our sandwich, which is actually true, but not true in the case off on drug inputs with our deal. Remember, in order to major any kind of analog input signal, we have to have a circuit called on a lot to digital converter. The Advanced Micro controllers, like at Mega say's Do have an on ship A D converter are analog traditional converter, the microcontroller president on our Dino. You know it's at military to it, and it does have an built in a truly converter, which we're going to study about. No, So that's it. What is that? A lot signal The Sanders cellular phone is an analog signal, but in terms of microcontrollers in terms Off RD knows in terms of digital world any signal whose value is to be major. It's called lesson analog signal. Whenever we want to measure the voltage off, a signal we can apply and we can use in a Tory converter circuit over there, even if it may be about to voltage, which is from 3.7 to 4.2 fools. If I want to measure the voltage, I will need any to reconvert, because if I give that value to a digital input, it will either be treated as logic one or as logic zero, and we don't get the voltage off their signal. And that's where for reading hold ages. We need it. It's a socket. Let's see, How does a decent circuits work whenever we say and a lot to digital converter. It simply means that there is at least one input signal, which is our applied input. Voltage. I'm digital output means a particle of number off digital signals which are generated as a part off output. This digital output must have some bait. This weight is also called its resolution off output. So there is an eight or a converter, which accepts the signal and can split that into anade without put. It can be said to have an eight bit resolution or it isn't a pit idiocy. What happens is whenever we apply a signal their signal gets can return from eight or ports . Men's eight zeros. True eight ones. Let's understand this concept in a little bit. Details. These are the basic concepts. First thing is resolution. It is the number of for put bits off ABC. Generally, there are a bit as well. It's stand between this is available. It really Siemens. Its resolution starts from eight zeros. Let's let's do this calculation somewhere so it's minimal. Put this eight zeros and the maximum output. It's hate once this isn't buying it. If you convert that into a digital format, this is zero, and it once is nothing but 2 55 A total off 0 to 2 55 minutes. A total to 56. Results are generated in an eight between ISI. Similarly, if we have a tell 10 literacy, then we have 10 zeros, which is naturally zero and decimal of to then once, which is 10 to 3 Mr Total off 10 do foot it. Is this up generated? The cardinal heads a 10 bit ABC. Let's minimize this for for the difference. So second concept is very if very if is the maximum voltage that can be converted or that has to be converted by the intraday converter circuit by default. RD knows ABC It's tried to FIFA world, so we can work 0 to 5 world entire range into 10 to 4 different number off steps. The Steps sides depends upon Villa and resolution. Therefore, if let's take an example, if we have attended, really is just like an Arduino, then with five world reference other Steps says is 4.8 million falls. To understand this concept better, let's take this example for assumption only we don't have attributed. This is in market today just for assumption as, um that we have a tree. But it is so for the three bitch agency. What results We have our 000 It means zero and up to 111 admits in decimal seven, So we have a total of eight results, so my step size becomes five year did but eight, which is a quarto, 0.62 fine. Worse, I meditate five to read it, but it yes. So one step is 0.625 holes long whenever signal hearts between zero toe 6 to 5 wolves, which is this level. Whatever natives say it with 0.1 volt point to 4.35 or whatever it is, as long as it is less than 0.625 holds the digital output assigned to it. It's 000 as soon as this mm goods from 0.6252 12 12.1250 millet balls. So there are lots of stuff I work, so it makes 1.25 words. Now, whenever the signal is between greater than 0.625 and lets them 1.250 vote, it turns in this level, and it has been given with the value 00 So whenever the signal hands between 0.625 volt toe 1.250 bulls, it harms something between here and the value of goods since 001 Similarly, the signal whenever in portable abilities the number of that level is given to it as the digital output. Definitely having attributed the seals off no use because we won't be ableto distinguish anything from 0 to 0.625 Holt and we can only distinguish between the signals, which are in the multiples off 0.625 word. So that is the basic concept off analog traditional conversion. What we have. It's 10 to 4 as other resolution. So our step says it's quite fine. 4.8 million voters, even if the signal rises by 4.8 million balls will get to know about it because our digital output may be changing, they should allow put it something that we get from the Arduino functions. But still, we can find it out for mathematical operation that digital output will be equal toe on a log in naturally directed by step sets. So if I have in this case 6 to 5.625 volts as my step sets and if my input signal applied is one hold, then Naturally, it lies between one world class between points of so five world in 1.250 moles, so its value assigned will be 001 Cardinal. We have tended agency 0 to 5 World as our input signal range and 0 to 10 to three as our or put. Also mention and remember wanting, argue knows, can only convert positive validation to a digital format and not the negative teaches. Only the signals between 0 to 5 old can be converted toe 10 minute a truly converted output . Based upon this, let's study our first project that is digital volt meter in this project. What we do, it's we use a potential meter, which is a variable resistor which are first off its resistance between two endpoints and the variable point over here. Use this potential meter connected against decency and ground. And this variable point goes to go on a long input as this variable point is rotated towards Mississippi will get five hold onto the antelope in, and as it goes down, we can gradually go down at 4.54 point 33.2 to hold one world upto zero volt till the port is rotated towards it. At the end of the serpent, we get potential with a number of different sizes and ships. This is one off one such potential meter. These are the two endpoints. One goes to a sissy. This goes to ground and this will go to the analog input pin off our deal. This commanding. It's very simple. Henceforth one been going to five village under been going to the ground and the middle one goes to the is zero input. Let's see how to create a program for it. Using are the block Lee. To create this project, we will have to follow this algorithm. There we declare a variable read an integrative hello into this converted to my levels by making this analog really multiplied with 4.8 it and print dismay levels onto the serial port. Let's see how to create this program. First will initialize the serial port after tax like our or put device, the nets are initial is variable. No school. This variable ads value No, let's connect our lives apply really and a lot been a zero to the spin you conducted Reprint this value Want to the serial port? It will just be a number without much significant street. I am. We can then create another variable. No scholar deaths M V In this empty. What we'll do is we'll convert this recorded analog greater signal into its respecto medieval swell. To do that, we need a little bit off mathematics where we multiply this variable called Val by a number four point it it which is all subsets. And then we can print this Milly bolt onto the computer screen. That's it for our program. Make sure whenever you do such programs properly introduced delis so that your program doesn't look hanged or stop that point. So are dealing. After that execution is done, a delay after sending the and a lot of value onto the serial port. To do lives are sufficient bullets except for the program donor that into the ardent aboard , make your connections at shown here and see the output. What do you observe is the first value appearing as the A truly converted output and the second value appearing as they digital many of our values. Next project, based on an a lot traditional converter, is a digital thermometer. In this pleasure, we're going to study a very interesting sensor, which can measure atmospheric temperature off room temperatures. Let's begin. This is 11 35 very popular temperature sensor, which is a factory calibrated sensor. It means we don't need to do any kind of collaboration once the sensor is purchased. The 1st 1 from the left hand side is the voltage or visit Zip in the middle. One is D analog output signal and the last thing is the ground signal. We can connect any signal from 4 to 20 volts. Toe this 11 certify sensor. Let's see how it books L M identifier Gilson Analog output Voltage analog means it just gives a d. C voltage corresponding to the temperature. It senses 11. 35 can give, then malevolent four degrees Celsius. It means if they don't, temperature is one degree Celsius. Exactly. Its output would be 10 million forage and if the room temperature right now where I'm sitting, if it it's 24 degrees Celsius, the output of 11 30 fades to 50 million folds. It is a complete linearly changing output voltage which changes as 10 minute Valls particle senses. If we have to interface this with our you know, we have to leave this. We have to connect this output to the analog and put enough are, you know, read that value, then convert that value into the respect of my levels and then divide that medieval spy. Then let's see how that algorithm will look like so first thing with doing so variable and we'll do on a loader and integrate into it. Then we'll convert that variable in tow levels by multiplying by 4.8 it. And then we'll convert that medieval Sintra temperature by dividing this medieval spy. Then, for example, if right now the room temperature is 25 it means what will read here is 2 50 mill evils based on 2 15 levels. What recording gate or whatever Variable big. It will be 2 50 divided by our steps sets. So that is four point it didn't so we'll get either 51 or 52 invariable. Then my multiplying it by 48 will get the exact to 50 hello again and then by diverting it . Barton, What we get is the temperatures, have you The connections are again that simple as the previous potential interconnection one ping or the first plane, which is this is he goes to five vote last been goes to the ground, and Torben, which is the analog output pin, goes to the even enough microcontroller. Let's see how that I don't a program for it. There will be a very small change in the previous problem that we had created. This is the program for our world meter. The only change here, baby, Let's do the modification in the same program. So what we do here, it's We converted this Val into mill evils. No, I won't print any extraordinaire, which I don't need. So Valence and a low grade valleys and Allegri said to even then medieval deals on a long, great value. Converted into 4.8, it converted into my levels by multiplying into 4.8 it. And then we'll have another third variable, their squalid it's them. And let's make this time me. This May levels do you ready to buy? Because after dueting, Martin will get the exact temperature reading here. I'll change the sign too Division and here I'll put this number, then was this entire thing is done. You can print this pain variable or to the serial port, the city temperature that much is the program for digital thermometer. Don't know that into the garden aboard and see the output. Hope you enjoyed decision. Thank you 25. Analog Write : Hello, everyone in decision, we're going to see pulse width modulation. That is, speed a blue them with already know, bit of Liam is very useful. A number of different scenarios. Let it be up simply controlling and led or let it be controlling off speed off a motor. Let's see, we don't live in detail. We have learned, basically stands for pulse word. Correlation. Having this feature on the microcontroller is a very essential utility that we have. What happens, actually, with ulcers, more relation is anything off. The microcontroller can generate US Square with, which means it can continuously generated a wave. Having some high region and some law region. This high region is usually the logic holders that is, the fivefold and lower region or low level is gender leader zero hold. We can definitely create such a problem reform by writing down programs for it by writing down instructions for it. But if I have to create a PW and signal order single square their form to my programming, then that should be the only court I'm writing down. For example, if I have to create a square wave with 50% on duration and 50% off duration. Then what? Then my main program would be digital, right? That been high. Some daily digital, right, Lou and some daily, even if I had a single instruction into this program, my frequency and my pulsar it everything will vary, which an auntie probably memorial. What exactly happens, sees a square will start generating onto the microcontroller pin, regardless off the other programs. So even if you write down the instruction for creating the square where once the square will starts running and it never stops unlisted, it stopped manually by writing an instruction. Moreover, generation of this PW also doesn't require continuous execution off some particular piece off course into the court. So let's see how to use the problem to explain the Dublin with 10 lady. It's very simple to understand considerable generating a square were like this, and we have given this to an led toe, turn it on and turn it off. What happens is if for the 75% off our pulse duration, if we keep the signal high, and only for the 25%. If we keep the signal law and then I can repeat then are led, will let our Lady will turn on with 75% brightness it rebuild sufficiently good brightness . If the on and off mirrored off this polls are exactly same. Then our lady will blink, are illegible, don't on with 50% brightness and if 1% or one period is only 25% whereas the off period it 75% of eligible be just slightly lived. What is The benefit is once generated. This signal goes on continuously generating and thereby whatever we have connected, whether being led or be a motor for spirit controlling delegate a continuous signal without writing any further been. So what we're going to do in this experiment is we're going to collect and led Vitorino and see the fading effect with it. Applications off of Liam are many. For example, dimensionality generating an audio signal providing variable spirit for mortars as well s rotating this room motors. Let's see how degenerate credibly um, it already know with our you know, you know there are a total six speed of limb channels available. Does problem channels are rich in number three, 569 10 and 11. It means that all the sixpence can generate a square ville continuously. Even if we write a single instruction like this, this is how we're done in serial program. This is how we're down an hour or two broccoli program. What we do is we just write down such unlock pin or indexed where I don't analog, right. We specify a pin number over here, and then we specify a value off course. It's been number would be anyone off 3569 10 and 11. Remember this discretion, this description, it's specific toe, you know, and Formiga that would be more number of credible champions. And so discount may change. This is respect. This isn't respect today, you know, board and then the second value, which were I don't do this function over here also is nothing but our expected duty cycle. That said, this rally will go, but from between 0 to 2 55 Just look here. So if you want a 50% of the cycle, it means 50% of the time signal is high and 50% of the times signal is low. In that case, we should write down 1 27 over here. Anything less than 1 27 will generate really blame signal with less than 50% duration. And anything greater than 1 27 will generate a pretty blooms signal off greater than 1 27 or 50% for continuous high off the number three, we will make it to 55 so the off period is almost zero. And for continuously keeping it low will make this another great to be zero that we've been keep the pain continuously atop low level. Another beautiful tolerate is it generates approximately 400 to 600 hertz off signal, which depends upon the channel being used. And the same is also documented into the our dinner editorship. Or they are, you know, upset if you see the guardian or documentation online. And if you look out for the analog arrayed function description over there, you will see what kind off frequencies are generated on what kindof pins. What we are more interested is into the pulse fit order duty cycle off the particular signal. By giving 1 27 we're creating the duty cycle off 50%. So this is how it goes. If you read analog great 64 a gender survival signal off 25% due to second it mr 84% of the time. The signal is high. Remaining times The signal is low on a longer 1 27 gender itself of people, so do the cycle. Another great 1 91 generates 75% of the cycle and on a low grade, zero in and already 2 55 usually gender. It's continuous high signal or continuous low signal that's shown here our simplest project with this analog write our prenup lives in l generation. It's a lead. It's fading effect. What we want to do its we want to connect one a lady with a registered to a particular period Blimp, enough already know. Here we have connected to pin number six underpin off the lady goes to the ground. What we want to do is we want to gradually go on increasing the duty cycle connected to the analogue right signal off. This led so that we'll see a slowly fading effect of the lady so it will go on. It will start from being off and then slowly the brightness off led vin done on. It will go on increasing till the signal becomes completely on or continuously on, which is 55 value, and then we'll gradually decreases it down. So that's what we're going to do in this project. Let's see, How did I Don't a program for it? This is our order. Locally. Here from the loops. I want this count with a variable name from this to this bias. This kind of function. So what this does is actually it will implement a variable I starting from zero Do 200 are 2 55 Whatever valley we have given here and each time, it will increment by one and renovated increments by one. Whatever we write down over here will be executed once. If you look at here, the led is connected to pay number six. So what we'll do? It's from our input output tab will take such this Anil a pin function We connected over here instead of three. We'll make it six and then what we want to do here is we want to connect this I so this I'll starts from zero and goes upto 2 55 I'll find design my variables because we have created a variable now, which is called I just take this table over here, drop down the list and select. This will create a for loop starting from 0 to 2 55 every time. The increments from 0 to 55 that I've had little Billy Toronto, the on a lock up in which has been number six and I look great. Moreover, to experience some Billy or to experience some differences will also give a small delay over here, usually not more than 10 milliseconds. So we can observe the feeling effect or the frightening effect of the lady. By the end of this program, what will have bunnies? The led connected to pin number six will get a signal with zero duty cycle mints completely off signal. And with every 10 milliseconds off daily, that off signal will inclement by gradually increasing the on period so slowly the UNP irritable increase up to 55 when 2 55 100 is given, it will be completely on an ineligible. Before Bright was the evidence Fulbright, What we'll do is we'll stop there for two seconds strobes and then I will repeat this entire look again. But this time what we will do it. We will increment discount from 2 55 Do zero by minus one means what now? Here The I will start from 2 55 I'm It will go on. Decreasing itself tell it is until it becomes zero. Yes, everything remains the same. So what we did here, Boss, we implemented this I from 0 to 2 55 by one value. Every time it increments by one. We execute this to instructions which it said and Allah pin another great win 6 to 0 or one or two or diverted increments and then waiting for 10 milliseconds. Then one service completed. We're gonna to second daily and we have the reverse forces. So this block will show us the led Bink slowly faded in from completely off to fully on on this block will show us the led been completely faded out means completely brightly lit toe completely off. So there's the program for a fading effect off the lady. You can join this two blocks or even if you don't, it doesn't matter much. Donor this program onto the microcontroller onto the are you know and see the output. Our next session, our next video. We'll show the output of this fading effect. As for this program, Thank you 26. Final Movie Servo Motors : in decision. We're going to study about servo motors and interfacing of that sorrow. Moto Smith already know servos are very different type of motors. Basically, silver actually doesn't mean a motor settlements a mechanism. This mechanism is used to hold a particular object at the particular position. Several motors providers the same facility with an electric motor inside edge. Usually, they have used BC motors. If, if you know about DC Motors than their principal, it's simple. They are used for continuous rotation. For example, ville are anything like that which leads to removed. Server is a specific type of motor. It's an actuator with inbuilt feedback mechanism that response to a control signal by moving toe and holding a position or by moving at the continuous spirit. So, most important, jump off servo is holding a particular position you will not find. Mostly that's that was are being used for continuous irritation, but they're mostly used for holding a particular position on That's My servo motors are ideally suited for robotics application when robotics arm or robot gripper has created, there are two types of sorrow motors one this fall as a continuous rotating servo. This eggs this works exactly like a DC Motor, which can rotate continuously but has an additional talk associated with tipped. Second type of motor is the standards which we're going to refer to in discourse, and we're also going to see a practical onto it. We're also going to do a pleasure. Standards are promoters can wrote it only vanity degrees so they can wrote it from one position to the other position and from the other position back to the first position or home position. They don't give any other motion than rotating within this one or two degrees, and we have to give it a signal to hold somewhere between 0 to 1. It really the whole Dement's hold. Then the servers locked. It's a 90 degree position that it stays there. It doesn't move from that position here and there. Lexi House that was are used, so controlling a centavo is done by a single control signal. Unlike other motors, servo motor don't need a driver circuit. Instead, they have abated driver circuit inside the server assembly they're controlling is done by upholstery impulse, treeless, nothing but single pulse input. This has to be continuous pulls off duration 20 milliseconds, Mr Frequencies 50 hertz. The pulse given to the servo motor has to be off 50 hertz frequency and the on and off period of this bulls besides the locking or the position of this room. So for a standard servo, the pulse vert is exactly like this. So it has to be minimum one millisecond on arrest, 19 milliseconds off and maximum to milliseconds on and rest 18 milliseconds off. If we're giving a pulse, who's on periods on live on milliseconds, and such a pulse is given to it continuously. Then the server water Lock said that zero degree position, which is also which can also be called. That's the home position of the servo motor. If we give a pulse Werth off 1.5 million seconds, then that's Romo. Don't lock set, 90 degree position and unforgivable sweat off to millisecond. Then the servo motor locks at one interdict decencies. Glitzy rotating. This are one clock. Was election aids increasing this pulse width gradually, starting from one milliseconds upto two milliseconds, one millisecond its zero degree and to milliseconds 1 80 degree. If I have devoted the server in the counterclockwise direction or in the other direction. Then I would start with two millisecond pulse. Trine and I will go on Dick, lamenting that on period up to one Melissa one millisecond where one millisecond will be active position and servo motor will come back to zero. No, this has to be a continuous signal given to the servo motor. And whenever this country a signal is given to this horrible motor. Whatever is the pulse for that we have specified in that country. A signal salvo stays locked at that position. It doesn't move from that position unless the force it's so strong that it breaks the several years. Let's see how this control signal is given. This is generally the inside off a servo motor. There are numerous strips off zero Moto's available. Some of them are blasted years afterwards. Some of them are metal gears, servos plastic years. Our worlds are related, Lee cheaper than the battle of your service, and they have a relatively less strong the primary part in Saturday's survives DC Motor as well as there is a potential meter. More apples is this Water, along with this Elektronik socket is rotated, and this motor with this gear mechanism also noted support or potential meter, which in turn gives for back to the electronic circuit over here, telling it about what is the exact position off server in terms of degrees. So it was usually have only three wires. One of them It's five, which another man is ground and violets signal input at certain before the drive circuit. Its present inside. We don't need to give an external day circuitry, so there is a small DC motor gearbox and some special electronic circuit. Which job performs the job of driving as well as controlling the motor? These are the several firings. The differences are taken from two off the most popular several manufacturers have taken for Taba. Several connected is usually a tripping collector. Only on dividing is same for almost every server that is being manufactured. One aimed off the three wire is ground, usually colored as black. Sometimes you will also find brown color. That's why it is ground signal or negative. The power supply, the middle signal always in every sorrow motor connection. It's plus five volts R plus six foot every several supports up to six world off signal given to it. Millions signal is usually the final supply. When we're connecting the servo to the are, you know, we will be connecting this medal pinned to the Five World and the black been to the ground signal. Last end off this room or disconnection is the signal. So in high tech servers that signal is yellow color info. Thomas A. Rolls That signal is might colored in many syllables in our pro nine grams servos or any other brand syllables. This signal is also sometimes color. That's orange on the ground. It's color does brown, but that's the universal said. That's the middle. Where is always the voltage or plus five whole signal? This is called on to serve a home. Usually there are different ships off some horns, which are given with every servo motor. We can connect any home, depending upon our requirements. So there is this cross or plus size town. Others there is a dis con, or there is a single shaft off this shape, that kind off onset, available astral before this is how the whiting it's supposed to be in the project off this servo motor, or whenever you will be interfacing that my grand serval, which were using in this project, you will do the connection exactly like this. Where my help in should go to five old black men should go to the ground and fight our audience. Been should go to the control signal. Please check in your side was data shit. What is the maximum current that is consumed by your servo motor? Because most of the times there was consumed more than 500 million people, 600 million peer, even one ampere and to NPR currents. So if the servo you're using consumes a very high current, then I won't advise you to connect this middle pin to the already know. Instead, you should use an external power supply. We are using a very simple and small micro suitable. Microsoft consumes much less current in the order of 100 million Pierre. And so it's perfectly fine if we connected to the r denotes five pin. But if you have any other server than the one shown in the project, I would suggest you to definitely check that leadership once. So this is how well do the connection of this server? We are referring to this kind of service here, which is a micro servo. These are the different types of Hans available with this servo. This are broken directly with a professed with hard. You know, even when our deal is connected. USB port and no external power is given. But first there was like this which are a bigger size servers. You must use external power supply. This is a micro server among the group. Let's see, How do you know a program for it? RD knows, built in sort of a library handles all the needles. Leader. What we need to do is really to connect someone any of the pain of the ordeal. Oh, remember, one more thing, which is specifically important. Analog right function will not work on pin number nine and 10. If we're Jozy, serve a library. That is because off some technical reasons, that serve elaborately mixes off Timerman an elaborate use this time urban off the microcontroller. So then values. Instead of all it can be assumption number man intend, but on a low great will not work After 12 servo motors can be controlled with more sorry notes and with a bigger already know like Arden Omega. After 40 years, servo motors can be controlled at the same time, The argument serval everyday handles all the Beatles off this servo motion and movement Will, Cissy how they are. So look at this light. What we do in our according express courting is with initialize a particular object off the serval library by writing servo space myself object. This myself object could be myself of one myself photo, my gripper or whatever you call it. It's just a name. Then what we do is tow this object. We attach a servo and here with specify the pin fair, we have connected the servo motor, so my serve object, not attach, and here pin number will attach our initial. Is this all over Toronto that pin Lastly, what we do, it will send a control signal by writing myself object dot light And here there to specify a position disposition is nothing but an angle from 0 to 1 into degree, so they border in tow. Instructions or functions are starboard attach instead of or not right in right with, simply write down the angle in our look. Luckily, we don't have to do any of those things. We just help you single block sex suitable from a specified a pin number to a particular Diggory. It's which is 0 to 1 it. So we'll take this block and here will have toe arrange. Or we'll have to put a variable or a number block where we could specify just a number on which you want to log the server. The program that we're going to do. It's a sweep program. They're What we'll do is we'll rotate the Savoy in clock weights as well as, well rotate this or will contact request direction. What I'm going to write down is, or what I'm sure going to show you a program for it will gradually go on increasing the servo angle from 0 to 1 80 degree that will rotate it in a clockwise direction and then gradually go on, decreasing the servo motors direction. Our sorrow. Moto's angle from monetary degree 20 which will be was a counter clockwise direction actually exit the program in Are the block you Hello. So this is our program. What we have done here is we have taken a variable loop called counterfeit. This is present in loop, which is exactly like a for loop. So in this count of it, what we have done is they're taking a variable ire which will increment from 0 to 1. It this blue colored blocks you must have got now are present here in this maths. So there's the blue color block. That's it. So we can't I from 0 to 100 degree and we implemented by fun every time that I increments from 0 to 11 tau this excludes will execute this do look will execute once. What we're doing here is we're sitting sort of front 11. Do I? I is the variable So this variable will start from zero first time said servo happen Number 11 will be set to zero decorates Then we'll take a 50 milliseconds of dealing. Then it will increment by one. Then it becomes one. So said serve a pin connector that been 11 toe I I'm inspired. So said, Sir, we have been 11 to 1 degree again 50 millisecond delay toe the political four degree, five degree a degree 1050 upto one it Then I becomes 1 90 This four Look for this count with look will stop. I'm program will go here. What we have done here is we have taken a daily off three seconds. You can see this year in void Loop and my incentive. What we have done is my server. Wonder to touch 11 school is automatically, isn't it? So first there is a for loop which increments starts from zero goes up to 1 80 What we do is we just right down to this servo, that particular position angle. Then once it's done, we're taking a daily off two seconds and we're repeating the entire thing once again. But he and would start from unity we in that zero and with the Clement by one. So this upper section off court will shores the sort of well being rotated from 0 to 1 80 degree with a daily off stimulus second. So it rotates clockwise. It's upto wanted after, you know after you. So it works for three seconds and it comes back and a global selection. I hope the scored waas easily understandable to you. I hope you will enjoy this practice. Do the connections safely and uploaded this scored on to the Arduino and see the output. Thank you 27. Final Movie Ultrasonic : Hello, Devon. In decision, we're going to study another very interesting sensor that is called its ultrasonic sensor. It looks like this exactly the one which is there in the presentation. The beauty of the sensor aids. It's a fairly low cost sensor, which works on the ultrasonic principle and the sensor. It's primarily used to detect distances. It can detect accurate distances from four centimeters up to 200 centimeters. Interfacing off the sensor with microcontroller is very easy. This is just a single four pin sensor, and we just have to understand how this address on extensive works, and we can easily able to write down a program for it by interfacing it with the ordeal. So let's begin. Ultrasonic sensor works on the principle of equal off sound from a surface. As we see, the sensor consists off to different transducers. Both of them are actually identical transducers, but one off them act as a transmitter and another one access er receiver On some sensors. Translators indicated that street and as are the Sievert like this, what happens is the transmitter transfers are very short or you bust through its sensor, and whenever there it's so face or whenever there is a collecting surface in front ofit from which the audio can transmit back or reflect back. Then order is reflected back from that surface and is being captured by the receiving transducer. What we get is the except time duration between the transmission and reception off this audio signal on based upon the time duration, we have to calculate the overall distance traveled by the sound. Applications are many, most important and most primary obligation off doesn't sense that is definitely the distance measurement, usually in the construction areas. Also, he was indeed contact list Distance meter, which are based on ultrasonic sensors, are very common know instead of just following the day. Best matter to find out distances between two balls and two places plus ultrasonic sensor can also act as a mortar level indicator since it does not need toe be in touch with devoted itself. So it's a non contact best what the sensor. It can be assisted on contact best water sensor and robotics. We can use it as obstacle avoiding robots in almost every car parking sensor, which you might have seen till now. Ultrasonic sensors are used to accurately detect the presence often obstacle behind the car , and our not selling sensor can also be used to measure the dimensions of the project in a complicated set up. Let's see how to in professor does sonic sensor and how it actually works. That said, it's a very Zimbabwe's. This is the operating voltage of the sensor. It works on plus five DC so it can be powered on their it live it or do you know operating current of the sensor is 15 million Pierre majoring angle. It's 15 degrees Celsius and the range. It's too sentimental to four meters minutes, 400 centimeters. It's been a very isn't helping out. It's very simple. It has a sissy trigger PICO and ground basis. He has to go to the plus five Power supply ground has to go to the ground. Pin or negative will take off our power supply. Shiver and equal distributions can be connected toe anything off? Are you know any general purpose spins off already know the working principle, as I said, is very simple. A transmitter off the sensor transfers an Oreo boast from reflecting surface. The sound is reflected back to the receiver, and we have to find out the distance based upon it. Here is the working principle and very distant to understand. Let's see, the first thing we have to do with this sensor is we have to give a 10 microsecond falls to the trigger signal to the trigger input. After every giver 10 microsecond pulls to the trigger pin, a small audio bust is generated and transmitted from the transmitter. Remember, first thing is to give up 10 microsecond pulse know how to give 10 microsecond pills. Just make up enough are, you know, high just connected to a trigger pin. Wait for them microsecond and then make that been Go No, that's it At soon as this trigger pulses, given this equal been, we become higher. Here we have two people in the echo. Pulse duration for high period equals remains high as long as there is no reflection. And as soon as the sound reflects back from some surface or some reflecting surface and received by the sensor or deserted by the receiver, the ICO pin becomes thereby. What we have is the pulse village off this equal equivalent to the distance traveled by the sun, hence many times This ultrasonic sensor is also called as a POW output sensor. It simply means that it gives up pulse Werth modulated or put off the distance that is being made. Sure. Now let's say some calculations off this ultrasonic sensor and how we can deliver distance out off it. Now we assume that we really major this duration, using our denotes balls in function. We can measure this duration in microseconds. Now let's see how they can help to make the calculations spirit of the sound. It's 3 44 metre per second, which we can also say it's 3 44 00 centimeters per second. Now out off this speed, this is a distance traveled by sound in one second. If I have to find out time required for traveling one centimeter, then what would I do is I will take in verse off this spirit I debate 3 44 00 centimeters per second. Is the spirit off sound. I want to know how much is the time required to travel once intimate er so definitely time required for one centimeter will be one divided by 34 before 00 I can do this calculation also one de breaded about 34400 What we get. It's 2.9 into 10 to the power minus five, which is a Quito 29 into 10 to the power minus six, which is nothing but 29 microseconds. Now what we have is time required for traveling one centimeters. Then what we have is the total time that has been traveled by our sound. So the calculation of distance becomes very simple. It becomes distances, it will do This duration divided way 29 duration. Will the suit from the pulse Werth and 29 over here. But here one thing is to be industry. That the sound traveled is a double sound double distance traveled so it emits from transmitter, reflects back from the transit reflecting surface and comes back to the sensor. It simply means that the overall distance traveled is doubled. This formula off duration divided about 29 will be applicable if we had been measuring the distance at this point. But no, we are not measuring distance at this point. But we're measuring distance at the same point that the transfer that is located so the sound has traveled double distance. And that's why what we do is with the white this distance reading by who? So the distance becomes duration diverted back. 50 it to summarize. Let me repeat it again. First, we give attend microsecond pulse to the trigger input. Then a small audio busters transmitted and equipping becomes high. We need to measure the pulse worked off this week. Open as long as they coins high, we need to keep measuring the pulse with it. It could become slow whenever there is a reflection and the sound comes back to the receiver. So we get a duration off this couples in microseconds spirit of the sound is 3 44 00 centimeters per second, and that's why I'm required for one centimeters equals to one divided about 3 44 00 which is nothing but 29 microseconds. Now we have this pulse Worden microsecond and we have time required for distance. Traveling one centimeter in microsecond. All we have to raise distances toe duration divided by 29 because Brendan and microsecond is the time required for one centimeter, and this is the total time period that it's traveled. But since their distances double. But beware this quantity by two and we get distress is going to do a racially divided by 50 it It gives us a precise distance in centimeters. So this is the formula. It can also misstated in this way. But since the time required our time up change in our our dino is in microseconds. This calculation is not possible. This is how we interface it with the already know. So this is supposed to plus five alert ground goes to ground trigger and cope in can go toe any GPL open. So far, it's not needed to be connected only over here. So here it reads. Connected to trigger and a four, it's connected. It's connected toe equal but its own manager and you can correct it anywhere as Jewish, depending upon what we discussed. This is the algorithm off our program. First we initialize the serial port. Then we do the trigger pin high. Then Michael, Second Billy, to get up in low. They agree with the pulse. Will it perform the calculation? And Lexi hope to write down this program using our job. Lockley using our blocks. The project is very simple. That is distance Mitt. This is our order blocking posting, as answered. It's initially it serial port. What about bread off? 96 Level zero, then next. Certainly still Input pin or the still pin to hire here our IQ open. Did your opinions connected to it too? So we'll make it to pin. Firstly will make eight open loop, so that establishes for some time. They believe it for one second, and then I'll make Saudi. Firstly, I make this trigger pin Lou bit for one second and then we'll make this to underpin. We only need to keep this trigger pin high for a short duration so that short tradition isn't it. But then microsecond will have this beach microseconds block over here. So far, the values in one lady wait milliseconds block. No, we have used with microsecond spoke, So we'll wait for 10 microseconds immediately after it. We will make this pin the trigger pin cool. Look, it's true that and now we make it look. No, they're scared of variable, said item. Let's call this item ads duration and let's set this duration toe, but it's really high piles on bin it. This is our equipment read hypothesis this is our equipment. So we have a report. We have taken this variable duration, and we have a signed the hype figure or we're reading the high pulls off a tree that is ik open the equal demand higher as long as the sound does not come back at certain sound comes back week, open will become low, and dysfunction will stop it executed. Next, let's create another variable and looks well. This video bullets mistress so distance is equal to a small matter. Motives. This do addition, divided by 58 and lastly we print is the sense onto the serial port with new life. As always, after the entire program it's completed. We'll take a small dealing before repeating it again. As you have seen, the entire program appears inward loop, and that's why it executes infinitely forever uploaded this program to their dinner board and city output Off it. The output off this ultrasonic sensor will be seen onto the serial port of the ordeal, so make sure toe open the RD no serial monitor after this program has been applauded 28. Conclusion : Hello, everyone. Congratulations on completing the scores. So far, you have created and completed lots of interesting projects with block best programming. I hope your knowledge must have gained too much higher level than the course started are from the momentary Sergeant the course. And from the moment you finished it, I hope you also have enjoyed the assignments and programs that were part of the schools. I hope it was all very easy and simple roses for you. So many congratulations for completing this course. You are now completely entered into the embedded systems world and really toe dive on with the new interfaces on a lot more new projects as a going step or as a controlling remark, I would like to redirect you to some very important and very interesting things. So in this video, I'm assigning and including some links which contain Lord offing for me to tutorials on informative videos with are you know, there are many interfaces and many more things to do with our hero than we can possibly even imagine. So please go onto this links visit. This links religious tutorials that specifically the tutorials from Ada fruit and spot fun are very easy to use. And there are presenting a very large quantities. All you need to know is how to use our, you know, and how to use this tutorials. So I hope you would have enjoyed decision thinking for buying this schools. And once again, congratulations for completing your journey into the Arduino programming. Thank you. 29. Final Movie Tri color Generation RGB: 30. Final Movie Tri Color YCM Color Generation: 31. Final Movie Traffic Light Control: 32. Final Movie Tri Color Led and Switch Generation: 33. Final Movie Up Counter Using 7 Segment Display: Oh! 34. Final Movie Serial Message Print: 35. Final Movie Serial Message Read: 36. Final Movie Serial Based Device Control: 37. Final Movie Digital Thermometer: 38. Final Movie Digital Voltmeter : 39. Final Movie Digital Ligt Meter: 40. Final Movie Temperature Control: 41. Final Movie Led Fading: 42. Final Movie Distance Meter : - okay ? 43. Final Water level Indicator: 44. Final Movie Servo Motor :