[Music] foreign introduction to Smart machines this course is designed for all students of age 8 and above and are enthusiastic about learning microcontrollers and how do they work let's look at the learning objectives for this session on completing this course you will be able to know microcontrollers and their applications to identify output devices perform multi-command processing now let's look at some of the concepts involved in this session let me ask you a question first what are smart machines machines that can control a process for example a series of actions or steps on its own are called smart machines let's look at an example each LED of a fairy string light that we use in festivals glow in a different sequences automatically or a fan which starts automatically when temperature goes up these are some of these smart machines why do we need smart machines smart machines do not need human intervention to complete their process like your microwave stops when the timer ends and we are not needed to switch it off or another example can be the street lamps light up themselves automatically when it starts becoming dark and does not require any Manpower to switch it on this reduces our time involvement and the amount of effort in doing or completing a process but how can a machine become smart smart Machines are made smart by using a device called microcontroller that enables the machine to perform processes and take its own decisions but what is a microcontroller microcontroller is basically an electronic device which can control processes take decisions and perform actions for example the LED light string can be made smart when we add a microcontroller with it which can allow each led to Glow in a certain sequence or at certain intervals let me introduce you to PC which is a smart microcontroller the kit that has been provided to you comes with a PC microcontroller inside it using this device will be able to see and understand how a microcontroller can take decisions and perform actions however we need to remember that microcontrol is just a machine it cannot process information on its own it cannot understand on its own therefore we need to guide it to process the information but the next question that arises is how does a microcontroller like PC even knows what to control or what action to perform and when to perform for example think of an action such as let's say picking up an object first you need to see the object next your brain processes the visual information that you have just seen and then commands your hand to move in a specific way to pick up the object in a single attempt a microcontroller is similar to our brain it also can process inputs for example seeing the object and outputs like picking up the object but only when it is programmed to do so because microcontrollers cannot understand or think on their own the next question is what is input and output we need to provide the information to PC to get a desired result or output the information that is given to a microcontroller is called input and the subsequent result that we get against the input is called output the PC or any microcontroller processes the input and provides an appropriate output the output is generally converted into a form that we can interpret that we call as human interpretable form using an output device for example a LED we have just now learned that microcontrollers like PC can provide outputs in human interpretable form such as by lighting up an LED or by producing sound from Beaver I have a question can PC light up an LED yes PC comes with four inbuilt LED lights that we refer as smile LED all these four smile LEDs are programmable which means our PC can control them can PC produce sounds yes it can produce the sound through beeper beeper is inbuilt in the PC a beeper is an electronic device that produces sound to alert the person about some process alarm clocks mobile phones car horns or doorbells all of them uses a beeper to produce different types of sounds from a single device we are able to hear different types of sum now this gives us another question how does a single beeper produces different types of sum it happens by varying the pitch of the sound which is basically the sharpness of a sound for example sound of flute has higher pitch when compared to sound of a drum the bit is measured in terms of frequency higher the frequency more the pitch of the sound our PC comes with a programmable inbuilt beeper just like our smile LEDs we know about smart machines microcontrollers and applications of microcontrollers we also know about input output and process the output device the need for programming microcontrollers our task for the day is to control output devices using PC we have to complete two tasks today the first task is to control smile LED and our second task is to control the frequency of the Beeper to produce different types of sounds to accomplish any task using microcontrollers we need two main things first is a hardware and second is a software what is Hardware the physical parts required to complete any task are called Hardware or in simpler words Hardware are the parts that we can touch for example the PC microcontroller itself or the LED lights the Beeper the switches let's understand what is software software is basically set of instructions information or programs used to execute a specific task software are those parts which we cannot physically touch for example weapload application or the codes let's look at the hardware supplies required for this session to complete the task for the day you require one PC microcontroller One USB type-c cable four smile LEDs and a beeper let's look at the software required for this session for this session will require upload app it can be upload mobile application also or upload web application also and will require an algorithm before beginning any task or before getting to the task we must have a plan so let's understand what that plan is before we begin to make the plan first begin by identifying places where you think LED is located on PC by marking it on the PC circuit sheet that has been provided to you once you have finished this let's understand why and what is plan if I ask my PC to smile or say light up all four LEDs will it do the same no because we know microcontrollers do not understand English they cannot perform things on their own they need guidance just like humans speak in different languages even machines have their own language we need to provide them with information in the form of a code that they can actually process before we start coding a microcontroller we need to have a plan ready let's understand why and how to create this plan why do we need a plan it is very difficult to construct a good Building without having a plan or plan for it right similarly to create a good code planning is essential this plan should include a set of steps when followed correctly will help us achieve the desired goal the plan is basically certain steps that we need to follow to accomplish our task now we know the importance of algorithm so we'll create our algorithm now keep your pen and pencils ready and make the algorithm along with me let's create algorithm for our first task of the day our PC has four inbuilt smile LEDs in this session we have to light up all four smile LEDs let's look at the algorithm the algorithm begins with start then we need to enable all four smile LEDs so we will enable smile led1 smile LED 2. then smile LED 3 and smile LED 4. once all LEDs are enabled we can control all four LEDs and light them up to do so we will turn on Smile led1 Smile LED 2 then smile LED 3 and then smile LED 4. finally our algorithm ends with stop now that we have created algorithm for our first task of the day let's create algorithm for our second task of the day which is to control the frequency of the Beeper to produce different types of sounds let's look at the algorithm the algorithm begins with start then we need to enable the Beeper so we'll enable the Beeper once the Beeper is enabled we can control the Beeper and set its frequency finally our algorithm ends with stop this is how the algorithm looks like for accomplishing our task for the day we'll be following this algorithm to create code for our PC let's see what we have learned till now we now know about Hardware software the requirement and the plan for a code the algorithm and the need of an algorithm now let's move to the make section where we'll assemble the hardware and we'll program our microcontroller we make part of every session involves Hardware assembly and programming the PC based on the algorithm that we have created we already know the hardware and software requirements for this session and we have also planned this step-by-step instructions required to complete the task so let's start making the project first we'll select the hardware parts that are essential for this activity from your kit and we'll look at this small instructional video to complete our assembly here in this project we'll use a play computer a power bank and a USBC type cable now that our Hardware assembly is ready we can move on to programming to begin with programming first we'll open the upload app you can open it on your computer or you can also open it in your mobile phone but let's first understand what is Cloud app float app will allow us to code the PC and help us complete the task remember where we understood that microcontroller cannot understand or do things on its own it requires guidance so upload app allows us to provide that guidance to our microcontroller within the Cloud app we need to write the code which is basically an input based on our plan which we created that is algorithm and upload it to the PC now we'll look at the instructional video to successfully create our first code now let us understand how to make the hardware and software work together now that our hardware setup is ready we'll connect this Hardware to this software to connect this Hardware with the software I need load app Cloud app connects with the hardware wirelessly using Bluetooth so let's click on load app here you will see a image of PC so tap on this image of PC click on this icon over here you can see the play computer here so just tap on this and you play computer is connected similar to Cloud mobile application we can also use upload web application in order to do so first connect your PC with your laptop like this upload app with PC in your browser type www dot upload.org you will be taken to the initial screen of load app click on open load web and you will be asked to sign in so click on sign in click on the account once you are signed in you will see this icon once you tap on PC icon you will be taken to scan device section click on scan device and the com port to which your PC is connected will be shown click on that com Port click on connect you will arrive to the PC main section and from here we can start coding our PC in this session what we are going to do is we are going to light up the first smile LED over here all these are programmable smile LEDs so we are going to light up the very first smile LED on this position to start coding your PC click on code click on Project paste click on new project and you will arrive to a section where you can see your PC the inputs and the outputs in the output section you will find these four smile LEDs that you can see on your PC they are listed on your output device panel where first denotes the first smile LED second third and this is fourth smile LED if I click on the first smile LED option will be written smile 1 enabled and you can see the first my LED turns orange once you have enabled your first smile LED move to the next section by clicking on this next button we'll skip this section because this section is specifically built for any external hardware click on next again to move to the next section here you can see the first smile LED has turned orange which denotes that now it is activated and it can be controlled now click on next to move to the code part this is the section where we'll code if you remember the algorithm it always starts with this start after that click on this select choose action double tap on action now you will find the controlling feature of the first smile LED click on smile LED one and you can see the intensity is currently 0 which means the LED is off which you can set to 1 which means LED is now on close this click on select again and put this in a loop by clicking on Loop and you can upload this to your PC now that we have programmed our play computer okay now let's connect and see the output so the first smile LED should light up over here so as you can see the first smile LED has lighted up now we know how to control one smile LED our task for today is to control and light up all four smile LEDs so let's see what the code for it will look like so we'll click on this code then we'll go to Project based new project and now we have reached to this section for enabling first smile LED in the output section we enabled we clicked on this first smile LED button this time we have to light up all four smile LEDs so we will enable all four of them so click on this smile one enabled smile to enabled smile 3 enabled and smile 4 enabled last time if you remember we saw only the first smile LED turn orange which showed which showed that it is now activated this time you can see all four LEDs are now turned orange which means all four are now activated click on next to move to the next section we'll skip this section because this section is specifically made for any external hardware we'll click on next again you can see these four smile LEDs are turned orange rest everything you can see in either yellow or gray color which means the smile LEDs are now enabled or activated click on next and now we have reached to the code part if you remember the algorithm the code starts with start then click on the select option choose action to give command double tap on action since last time we enabled only first smile LED therefore we could control only first smile LED in this section this time we have enabled all four smile LEDs therefore we can see control for all four smile LEDs to turn on all smile LEDs click on this smile LED one and set the intensity to 1 1 means turn on similarly for Led 2 set intensity to 2 smile LED 3 set intensity to 3 and smile LED 4 set intensity to 4. then close this section click on select again and loop the program once you have created this code you can upload now we have uploaded our code to play computer now let's see if all four smile LEDs light up which is led1 led2 led3 and led4 so here I'll connect the power bank through USB C type cable to the play computer and let's see if all four LEDs light up as you can see all four LEDs have lighted up over here what we are going to do there is a inbuilt beeper inside our play computer so what we'll do is we'll turn on that beeper and we will understand about different tones that outlay computer can make and we can also set the frequency of the Beeper over here so let's start coding our play computer so let's first connect our play computer by going to this point and you'll find new play computer when you plug it in so tap on it and you will come to this console in this console we'll start coding so click on code and go to Project based in Project we'll create a very new project in this project we are going to enable the Beeper so that beeper makes sound so let's this is the Beeper option as you can see let's enable this first so PCB per enabled go to the next console next again and next again now clicking on Tab will go to actions inside action will find our beeper so we'll first enable the people in people you will find two tabs one is the frequency tab second is the tone tab so first explore the tone tab so clicking on tone we can set it to 0 1 2 3 and 4. so let's hear what tone one sounds like so let's tap it again to stop the code and we'll set this into a loop so and this is how our code looks like let's upload it [Music] now we have uploaded tone one if you remember in the coding we have said tone one and let's see how tone one sounds from the Beeper so we'll connect the power bank with our play computer and let's hear to the song now in the same code let's click on action and explore what Intensity 2 Tone sounds like so we'll set this from 1 to 2 and let's upload the code [Music] this time we have uploaded tone 2 so let's see what tone 2 sounds like so again connecting power bank and let's see it to the sound this was about the tone tab now let's go to the frequency Tab and explore the frequency type now in frequency we can save the frequency from 0 all the way to 9000. this is basically the straightness of the sound or what we call it as Earth so let's set it to 9000 and let's upload [Music] this time instead of setting tone we have set up frequency so we have set it to 9000 frequency which is very very still so let's hear how a sound of frequency 9000 Hertz sounds like this time we'll reduce the frequency from 9000 to let's say 4500 what you can also do is you can tap on this and then backspace and then you can type 4500 over here and then exit so your frequency is set to four thousand five hundred let's upload this and hear how it sounds foreign [Music] to 4500 so let's see how the Beeper makes the sound it's connecting power bank and let's hear to the sound [Music] now we have finished our task for the day in case you were not able to finish the task for the day or you face some difficulties you can always refer to the troubleshooting guide given along with let's look what we have learned till now we now know about the need of load up the procedure of connecting PC to the load app of the basics of project-based programming on ploda creating new project on ploda how to enable output devices such as smile LEDs and beepers programming through hexagonal coding now that we have created our project let's move to the Evolve section we have completed the task of the day and in doing so we have learned about PC basically the hardware part the algorithm and deployed application which was the software part now we'll use this knowledge to complete two challenge tasks ahead our challenge task for today is to turn on the two smile LEDs in the center and the Beeper together first create an algorithm then create a code for the same ly upload your code onto PC to accomplish this challenge you can refer to this small hint to accomplish your challenge for the day wish to learn more you can always learn more by visiting the links given here until next time make crazy play Crazy