Internet of Things Course (IoT) : Develop your Smart Scale Application - Part 1 | Nitin Sikka | Skillshare

Internet of Things Course (IoT) : Develop your Smart Scale Application - Part 1

Nitin Sikka, Internet of Things | Cognitive Computing

Internet of Things Course (IoT) : Develop your Smart Scale Application - Part 1

Nitin Sikka, Internet of Things | Cognitive Computing

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
13 Lessons (1h 7m)
    • 1. Introduction

    • 2. How to use platform effectively

    • 3. Working Principle of Weighing Scale

    • 4. Required Hardware Software Components

    • 5. Introduction to HX711 Module

    • 6. Solder HX711 & Scale

    • 7. Introduction to Arduino and Setup

    • 8. Understand Arduino Syntax

    • 9. Project Setup

    • 10. Scale caliberation Process and Code

    • 11. Upload Calibration Code and Final Demo

    • 12. Next Steps

    • 13. Follow me on skillshare

  • --
  • 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.





About This Class

The Internet of Things, or IOT, refers to the billions of physical devices around the world that are now connected to the internet, all collecting and sharing data. 

This class originated from a simple idea of converting a simple bathroom weighing scale into Smart weighing scale using Internet of Things(IoT) technologies.

Basically we will transform a bathroom weighing scale in such a way that it will transmit weight readings in real time to IBM Watson Internet of things platform and then save it to a database table.





Value additions that you will have from this course:

  • Understand Internet of things applications.
  • Complete a hands on IoT Project to make a Smart weighing scale application.
  • And learn about the path ahead.

Target Audience

  • Anyone who is interested in learning about new technologies
  • Students , developers and technical designers.

Link to my other Internet of things classes on Skillshare:

Internet of Things for Beginners (IoT)| Learn To Make Smart Light Bulb

Internet of things for Beginners (IOT) | Learn To Make Smart light Bulb

Meet Your Teacher

Teacher Profile Image

Nitin Sikka

Internet of Things | Cognitive Computing


Hey! Thank you for checking out my classes here on Skillshare. I am a IT professional and freelancing instructor living in New Delhi, India with my family.

Professional Experience

After completing my degree in computer science I started my career working in Bangalore for Indian Software MNC. 

I have been working as a senior application developer and have an experience of 10+ years in design and development of enterprise applications.


I am an avid learner of new & emerging technologies like Internet of Things(IoT) and these days I am focusing on building IoT applications for enterprise businesses. 

Content on SkillShare

I want to put up value content on technical topics like IoT and other open source web techno... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
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.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

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.



1. Introduction: I think you should pick this class. I mean, why won't you? It's gonna be about Internet of things on. Were will convert a normal being scaled into a smart being. Skill over, set off three classes on. It's gonna be fun. Hi, I'm a software application developer and a technology enthusiast. In our first off the three classes of designing a smart being still application, we will connect our being skilled with the computer using a microcontroller device so that we can get the real time get readings on our computer. I think this product is great for the people who have some knowledge off Internet of things and warned greater understanding off landscape and want to know how it works by doing a project from scratch in this first class, we're going to start from the real beginning. We shall understand in detail about the working principle off being skill and how we take the output off the scale and interface it with our computer actually doing the whole connections and the port for that to work. Then, in the falling class, we shall see how we can turn our weight readings or by five who IBM out a platform on cloud . And then in the third and the last part of this project, we shall right in order. Yes, application, which will connect to our cloud platform and capture the data to save it into a database at the end of this project. I hope you believe it. Skills that will get you more excited and encouraged to make your own projects in the area off. I O t. Are you ready to take this project journey with me as your guide? I think you are. Let's get started. 2. How to use platform effectively: before we proceed for their, it is important to know how to use this platform effectively scale. Scharffen imminently differentiates itself from other learning platforms by recommending comparatively smaller classes on the project based learning more than I have like my class with these pool stated principles, where I have divided the complete class into three parts and each of them will be associate ID. With the project, I will highly recommend toe, abide by project based learning and complete the given project. Believe me, it will help you to understand the things in a much better way, and further, you can extend this knowledge to create your own products. Now let us look at the platform and the various options that are available to maximize your learning experience. Want to land on the course page? You can see that we have few sections which will enable you to get maximum out of this class. You can click on the about to check the detailed description or this class. Here you may find the core content off the class target audience and various other value additions that you may take away after taking this class. Now, once you click on the project and resources. You'll find the details about the project associated with this class. This section should have complete details about the project and the resources which are required for this project. Also, once you complete the product, you can submit your project by clicking on the create Project button. Here, you can give a title a description for what you did, and you can even upload a working video or image off your project and then hit the publish button. In case you have any clarifications or cushions, you can just quit on the discussion. Stamp on can start a new trade, and I will get back to you as soon as possible. And now, last but not least, you can click on the review staff on. You can drop your feedback about the class things which you liked on any area that you think can be improved. I will definitely include the feedback in my future classes. That's it. See you and next really 3. Working Principle of Weighing Scale: In this video, we shall establish a clear understanding about the working principle of a weighing scale application. Most of us are using being scales, but what we don't know is that they're using a load cell to measure the weight. Now it becomes very important to understand what exactly is a load cell. Load cell is basically a gauge to measure the weight or the force applied on a surface. It is a transducer. And working off a transducer is to convert one form of energy into another one. So it is basically a transducer. And when a force is applied, it generates an electrical signal whose magnitude is equal to the force being applied. So load cell is basically converting a force into an electrical signal. And by force, I mean any kind of weight that we put on a load cell. Now, we have various type of load cells. The load cells, which use air pressure as an agent to measure the weight, are called as pneumatic load cells. Then there are load cells which use water pressure to measure the force being applied. And they are called as hydraulic load cells. There is a load cell is called as strain gauge load cell. It basically uses a very thin wafer like device to measure the weight or the force being applied on the surface. In this video, we will discuss in detail the working principle of a strain gauge load cell and what mechanism they basically used to convert the applied force into the readings which we see on a weighing scale application. Strain gauge load cell is the most popular type of load cell, which forms the basis of almost all kind of weighing scale applications. Here we need to understand what is a strain gauge. Strain gauge is a kind of a transducer that converts the mechanical displacement into the change of resistance. Here, mechanical displacement means whenever we place some kind of weight on a load cell, it will either contract or expand the strain gage, which is a kind of mechanical displacement due to which it will change the resistance of this gauge. Do you need to understand that the final output from a weighing scales are good, is always an electrical signal. First, we use the same gage to get the change in resistance. And then later in this video I'll explain how we use this genuine resistance and how we can work this resistance value into an electrical signal. And you can see an illustration of a strain gage. The via which you can see in the strain gauge is basically a dynamic resistor. And any kind of Shane is applied, then it changes its resistance. And that change is in a defined limit. Which we can measure the exact amount of load applied on the scale. The stream gauges generally bounded onto a beam which deforms when any kind of force is applied. This is a given example of a button type strain gauge load cell. Now, the change in resistance depends on a basic principle. You must have read this equation. R equal to rho L by a. R is the resistance, rho is the resistivity. L is the length of the wire, and a is the area of that wire. Resistivity is that property due to which the current flows in a wire. And you can see that the resistance is directly proportional to the resistivity with an increase in the resistivity, resistance of the material to conduct the electrical current will go up. Now, when any kind of lead is applied on a strain gauge, then it will either contract or expand. In other words, the length of that strain gauge will change. And that change of length is proportional to the resistance, which ultimately can be measured. So fundamentally there are two principles. Strain gauge under tension. Resistance will go up because when under tension it will be stretched, which will increase the length of the wire and it will increase the resistance. Strain gauge under compression, resistance goes down. Now. Next, we will see how this change in resistance is converted into an electrical signal. Now for any weighing scale, you will find that all the strain gauges are placed in the form of a Wheatstone bridge. This is an example of a Wheatstone bridge circuit. Wheatstone bridges in electrical circuit in which all the resistance across the legs are in a balanced state, which means all the resistance are CME. And when all the distance are same and we provide the input voltage of a defined value. The output voltage will always be calculated as 0. In our weighing scale application, you will find that in place of each resistor, one strain gauge will be pleased. Now when distinguish comes under any kind of tension or compression, then the resistance of that stream gage changes and which will result in a change across the output voltage also. Now let us see how the output voltage can be calculated using the simple equation. Consider the case one where all the resistance are in the balanced condition and our five ohms each. And we provide an input voltage of five volts. And when we replace the value in this equation, we will get the output voltage is 0, which means there is no load in this case. Now just consider that we have placed some weight on it. And due to which the resistance of each stream gauge changed, strain gauge RA, expanded. So it will result in an increase in restaurants and it became six ohms. Similarly, the strain gauge RB got compressed and proportionally it resistance decreased and became four ohms. And now, when we replace all the updated values in this equation, we found out that the output voltage gain to be 11 mold. So we came to know that when there is no load, then the output voltage is 0. And when we apply some load on that, the value of output voltage changes. This is the fundamental principle on which all the weighing scale applications are designed. I thought it very much important to understand this before we can start with our application. So in the end, just to summarize, in this video, we first discussed what is a load cell and what are various kinds of load cells existing. We also discussed in detail about the working principle of a strain gauge load cell. Then we have explained how it behaves as a dynamic resistor when we put any kind of load on it. And how they are used in as a Wheatstone bridge configuration to get an output voltage signal which can be converted into weight measurements. That's it for this video. Do let me know in case you need any further clarification and see you in next video. 4. Required Hardware Software Components: In this video, we will look at all the things which you need to complete this part of project. All the components which I am using in this project are quite easily available and inexpensive. Let us first look at the weighing scale. As we are trying to capture the readings from a domain scale in real time. The first thing that we need easy being scaled. The main scale which I am using for this project is quite easily available and you can get it for under $20. Next thing that we will use a microcontroller device, Arduino. Arduino is an open source hardware chip that we will use to get an output from our wing scale into our laptop. The one which we are using is Arduino Uno and is a great to start up with. Another thing that you would need is a USB cable that comes along with the device and is used to supply power to Arduino and you connect it with your laptop. It is also used to upload the programming logic into Adreno. No, we need something called Les ethics seven w1 module. This is required because we cannot connect our weighing scale to Arduino directly. The output from a weighing scale is an analog signal and it needs to be converted into a digital format before it can be used by our microcontroller device, Arduino. I take seven w1 is nothing but an analog-to-digital converter designed for weighing scale and other industrial control applications to interface with rich sensors. The digital output from the hi-tech seven w1 can now be passed on to Arduino, where it can be processed to get the actual weight measurements of this game. Let us talk about jumper wires. These are basically used for prototype applications where we need to connect different components without full ring. As we need to connect some wires with our weighing scale in order to get the output from it and then pass it on to eject Simon level one module, we need to do something called as soldiering. Soldiering is a process of joining together two or more components by melting something called as a shoulder around the connection. The shoulder is a metallic alloy and when it cools down, it creates a strong bond between those electronic components. Now, let us have a look at all the things which are required to complete this job of soldiering. Let us first look at soldiering iron. A soldering iron is a handheld tool that plugs into a standard 120 volts AC outlet and it heats up in order to meet the shoulder around the electrical connections. It is one of the most important tools that are used in soldiering. For beginners, it is recommended that you lose a pen style soldiering Iran in 15 to 30 watts range. Next, I am using another tool which is called as holding hands. It is a device that has two or more alligator clips and sometimes a magnifying glass attached to it. These clips will assist you by holding the items when you are trying to solar while using the soiling iron. Before we can start with our soul ring, we need something called as flux. Flux is an important component for soldiering. It is used to reduce the oxidation which tends to form whenever part maters come in touch with air or oxygen. In simple terms, it allows us to produce nice and glean joints. Next we have the solar or the soldier in wire. It is the material that is meditate to create a permanent bond between the electrical parts. It comes in the form of a wire and the most commonly used type is a lead free rosin calls older. With that, we have completed all the components that we will use in this predict. I would request you to please go ahead and check the project description section, further details to buy these equipments. Once you have all of them, you can start with your project. See you in next video. 5. Introduction to HX711 Module: The most important thing that we want to achieve in this project is that we need to interface the weighing scale with our microcontroller so that we can process the weird readings which are coming from the scale to connect our weighing scale with Arduino and transmit the data, we use a small electronic module called as ejects seven w1. In this video, we will look in detail about the working of an analog-to-digital converter module seven, w1. And how we will use this module in developing our project. I will explain you in detail the analog signals and how they are different from the digital signals. After that, we shall understand the output format of an analog-to-digital converter module. And in the end, we will look at various pins available on edX seven w1 and they are working. So let's get started. It's X7. W1 is a small module which is designed for high precision electronics is there in this project, we want to capture the readings from the weighing scale and then interface it to our microcontroller device, which in our case is RDD. Using microcontroller, we can process this data to sort of send it across to cloud platform. But the first step is to capture the weight readings when force is applied on the scale, and then transmit it to our microcontroller device. But the important thing to understand here is that a weighing scale is an analog device. As our microcontroller is a digital device, which means that output from weighing scale will be an analog signal, whereas micro-controller does not understand it directly. So it has to be converted and we need a analog to digital converter in place to convert this value into a digital signal. Before we understand the module, we will quickly touch on some important tones. In digital electronics. First thing to know is that a signal is used to carry the data from one device to another one. And analog signals are continuous wave signals that change with time period. Let us try to understand it with the help of an example. Here you can see that this graph is for temperature. We are measuring the temperature from 12:00 AM to 12:00 PM in the night. We can see that temperature started falling down after midday. And we can see this graph is analog in nature. This is an along as within the given range, each and every value is possible from 0 to t max. We can have any value of temperature like this one is 38.8 degrees Celsius. We can also have 10.4 degree Celsius. And in the same way, we can have all the intermediate values which are possible. If D max is 45 degree Celsius, we can have any value between 0 to 45 degrees Celsius. So this one is analog as it can take any value within the given limit. Let us now look at discrete time signals. Discrete-time signals are important to understand before we start with digital signals. And discrete time signals, we discretize only the time axes of analogs plot. My discretization, i mean that we have to divide the time axis into equal intervals. Air signal is not having continuous value, instead has values at specified time intervals. Here in the given example for discrete time signals, instead of recording the temperature values continuously, we are now regarding the temperature values every hour. For example, if a temperature measurement is taken at 09:00 AM, Then the next measurement will only be taken after one hour. And we are not sure what is the value of the temperature between 910 m. It is still an analogous plot and we see that discrete time signals are a subset of analog signals. Let us now look at digital signals. And digital signals, we discretize both the time and magnitude axis. For the given example of discrete-time signals. We have known discretize the magnitude axis. That means the temperature can have any value between 0 to 45 degrees Celsius, like at time t1, we have the temperature measurement of nine degrees Celsius. At time T2, we have the temperature value of 38 degrees Celsius, and similarly, we have other values. Now, in case of digital signals, we need to discretize both the time and magnitude excess. So I'm going to make the levels at say, 015 degrees Celsius, 3045 degree Celsius. So unlike the analog signals, which can have any value of temperature between 0 to 45 degrees. Digital signals can only have 0153045 degrees Celsius. And the signal can take values equal to these levels only. Now considering the same example which we used in discrete-time signals, we will see what values it will hold. In the case of digital signals. At time T1, we have a temperature measurement of nine degree Celsius. But nine is not possible. It falls between 0 to 15 degrees celsius. And to minimize the error, we always take a lower value. So in this case, the value will be 0 degree Celsius. Similarly, we will calculate all other values. So in the end, you can see the difference between analog and digital signals. And analog signals. We can have any value between the predefined limits. But in digital signals, we can have values equal to these predefined levels. Only. The output of an analog-to-digital converter is in bit format. In computing with is the smallest unit of data. A bit represents one of the two binary values. That is either 0 or 10 represents a low state, whereas one represents a high state. Now, to understand this in a better way, let us say we have a 2-bit analog-to-digital converter, which can measure an analog signal from 0 to ten volts only. It has two inputs, the reference voltage and other is the signal to be measured. The reference voltage is the maximum value that the converter can convert. The output value of this two bit converter will be a string of two numbers. This device will give you a digital value as shown on the screen. So in this example, the 2-bit digital value can represent four different numbers. And the value input range of 0 to ten volts is divided into four pieces, giving a voltage resolution of 2.4 volts. The resolution defines the smallest voltage change that can be measured by the converter. The resolution can be calculated by dividing the reference voltage by the number of possible conversion realms. Resolution can be improved by reducing the reference voltage. Changing that from five volts to 2.5 volts will give you a better resolution. However, the maximum voltage that can be measured is now 2.5 volts instead of five words. The only way to increase the resolution without reducing the range is to use a converter with more bits. Now let us see how a 8-bit analog-to-digital converter converts an analog signal into a digital output. An 8-bit digital value can represent two raised to the power eight different numbers, that is around 256 different numbers. Now say, we provide an input signal of 0.859 volts to this 8-bit analog to digital converter, which has a reference voltage of five volts. Then we can calculate. The size of the step by dividing the reference voltage, that is five volts, by the number of different convergence possible. That is 256. So we can calculate the step size or the resolution of this 8-bit converter as 0.0195. This is the smallest possible voltage change that can be measured by this particular analog-to-digital converter. Now, let us see how an analog signal is converted into a digital output. Say we provide an input signal of 0.859 moles. First of all, it is compared with most significant bit to check if it is equal to or greater than its value, which is not true in our case. And hence, with number seven is set as 0. Again, the input voltage value is compared with the subsequent bits. And when it reaches bit number five, the input voltage is greater than 0.6 to five, and therefore with number five is set as one. And now the residual value of 01234 is compared with subsequent widths. When it reaches the third bed, it finds that Europa 1234 greater than the bit value 0.156, and hence, the big number three is also set as one. Now the residual value of 0.078 is compared with the next bit, that is bit number two. And it finds that the both values are equal. And hence, week number two is also set as one. It is in this way that an input voltage of 0.859 is converted into a bit format. With this, I hope I am able to clear how does he converter converts an analog signal into a digital output. Please let me know if you have any further clarifications. With that, we come to the last part of this video that spins off each edge seven devil won. The circuit diagram shows how we can connect a load cell door microcontroller device using a jack seven w1 module. As shown in this diagram, the weight sensor or the load cell draws the power from its X7 W1 chip. So no other separate power source is needed. The load cell produces and analog signal at the output depending on the weight, like on its surface. This analog signal is given to GA, which is nothing but an amplifier through multiplexer. Vga amplifies the signal and provides the output to the digital interface. The digital interface convert the analog signal into a digital value and then provide the serial data at the output. I think this will give you a very good understanding about this particular module. And we'll help you in establishing a foundation for building our project. And see you in next video. 6. Solder HX711 & Scale: now that we have understood the basic components which are required for soldiery. In this video, we will perform this ordering tasks which are relevant to our project, basically really to perform to folding operations. First, we need to solar. The head opens with the object seven. Double one board as the mortal comes with separate head opinions which needs to be attached in the board. Also, we need to shoulder the viers with being skill in order to pay the analog output from the scale and transmit a to a tech seven double one module and then ultimately converted into a digital signal. Solving is quite a tricky job, especially when you're doing it for the first time. I have tried to include all the possible details which are important for you to complete this part of job before you heat up the sword in guardian, make sure that the tip is clean. Otherwise, use a sandpaper toe, clean the tip. Then we will plug in the soldering iron and make sure that it is properly heated. We shall now place the header pins on the bread board like this on. Then we'll put the board upside down, apply some flux on the beans. The basic principle is that Touch the heart island onto the pad near the pin on. Bring in the solar in touch with it. Now remove it as soon as it mates. Now repeat it for the other pains. In the similar fashion, there might be a case where you want to undo the soldering. So for that the process is still the same. We will apply some flux. Then we will catch the pain where we want to undo the soldering with the heart soldering iron on as soon as it makes the solar, we can easily remove it before it settled towns again. With this, we have successfully attached head opens without board. You can see that we have two versions off a check. Seven, double one. Both of them are same. Just that they belonged to different companies and we will use the one in green color for our project set up. And now they will look at the second part off our soldering job and that is to soldered wires without being skilled. We need four jumper wires that we will attach with our scale to get it in a long output and pass it on toe. Take seven Double one model. So we will cut and feel one end up female to female jumper wire so that we can sold one end off it with the scale on. Put the other land into the heather Pins off a check. Seven Double one model. Now, if you open the back panel off the being scale, you will find that under the green PCB board, four pins are marked. There's E plus the miners s plus on ass minus. These are the interface pains. From there we will take the analog output off the scale. So we have attached four wires with these pins. As this is the most critical part, I will demonstrate to you how you can do it for this. First off, all you need to apply the flux onto the circuit. Make sure to apply enough off it. Then we will bring our heart soldering Ireland and touch it to remove Div ire similarly again merit the solar toe, attach the wire before the solder cools down. We will do it one more time. Make sure there is enough flux. We're touch the iron toe, melt the solder and remove the wire before it solidifies. With that, we have completed both off our soldering tasks on. Now we will wire up the whole thing to complete the set up. See you in next video. 7. Introduction to Arduino and Setup : Till now, we have understood the functioning of a load cell and how we use a text seven w1 to convert an analog into a digital signal, we need to convert the analog format into a digital signal so that it can be understood or it can be processed by our digital device, like Arduino. Now you know that a digital signal is nothing but a representation of a voltage change that we have received from our load cell. But still it needs to be converted into a human understandable wait format. Now, when we receive that digital signal into our Reno, we need to write some logic to process this information into understandable weight readings. In this video, we will learn about the hardware JB Arduino, and we will see how we can set up this device to upload the programming logic enjoyed. Arduino is an open source prototyping platform that was made for the designers to make their projects interactive. It provides us with a hardware like Arduino Uno and a software platform so that we can program these devices to make our projects. The good thing about the Arduino is that it is quite simple to use and you need not to be an expert to use it effectively. We are going to use Arduino Uno for our project and we just kind of grid for newcomers. Now, let us look at some general overview about the adrenal. Here you can see there are two rows of pins opposing to each other. These are nothing but various input and output pins using which we can talk toward Reno. The fundamental is that the Arduino accepts the input from different kinds of devices, sensors into these spins hair. We can use temperature and humidity sensors, pressure sensors, vibration sensors, and all other sorts of inputs. You basically plugging the sensors into the input pins. And Arduino will process the signals based on the simple programming logic that we've uploaded into the device using our computer. And then it sends a signal to the output pins to perform certain actions. For example, if the temperature of a boiler goes beyond a certain point, then it should blow up and allow. So here we are using a sensor which will send the temperature readings toward real and Arduino will iteratively process this information and will blow up an alarm attached to one of the outward payments in case it goes beyond a certain point. Now, you can imagine all software projects which you can complete or make using Arduino Uno ball. Now, we want to download the software so that we can control the Arduino and can program it. The place to go is Arduino's official website, our Reno dot cc. Go to the download link in the menu and download the software according to your machine. It is called as Adreno IDE. And that is a development environment program. And you can see the installers for Windows, Mac, and Linux. Once you download, just launch the application. Now, we will make some configuration changes to upload the code into our Arduino device. First of all, we'll go to the Tools Boards and select Arduino Uno as our board. Secondly, after you connect the Arduino with your laptop using a USB cable, you go to the Device Manager of your operating system and check out the serial port on which the device is connected. It is COM port five. For me. I return back to the id. Again. Tools. Go to the port and make sure that same port is selected. That's it. We are ready to upload a program into our device, will go to the files, check out some examples. Basics. Blink. So this is a basic code, sample code provided by the ID and we'll try to upload it into our device. We'll validate it using this button. Once the code is completely compiled, will upload it into our device. As you can see, the code is now completely uploaded. With this, we come to the end of this video. See you in the next one. 8. Understand Arduino Syntax: in the previous video, we talked about the Reno I. D. Various many options and reloaded examples. Now, in this review, we will understand the port syntax that we use while writing there. Dana programs. No. We will select one of the pre loaded programs. Goto file examples. Basics. The Util read. Syria First action in this piece off court is some great outlines off next. These are called Les Good Comments. Court comments are not processed by the compiler. The comments are basically used for our own understanding to describe what that piece, of course, is doing in an understandable language. If you put too forward slashes in the start off any line, then it will turn great. That means they're commended and no syntactical error will be thrown for that piece off line while verifying the court. Similarly, we have multiple line comments. If you want to commend multiple lines, then we use a forward slash, followed by a star in the start of the line. Then you go to the end of the line where you want toe end the comment and put a star forward by forward slash. This will end the multi like almond. Let us. Look at this line off court. My looking at the court. You might not understand the intent behind writing this line, of course, but the comment about shows that we have a push button attached to pin number two off the board on. We're naming it, naming that bin has a push button to use it in our court. Now we have the side of court where it stays. Can't push button equal toe. This is we are doing a data declaration. Were were declaring a variable off indigent type which can hold numerical value. And then we store pin number, which is two in our case. So by end of the statement, we will have a numeric valuable push button which will have a value equal to two now generally all the court statements except the functions and with semi colons. It tells the compiler that this individually executable hold statements dominates. Here. Compiler will throw an error if you miss a semi colons. Now we look at two very important functions which are used in most of the arena programs and their car less set up on blue. Now function is basically a group of statements that are executed together to perform it. US function could be really find are a user defined functions Redefined functions are already provided with the integrated development environment where us we can define our own functions to here. We'll try to understand the statement Wide set up function Declaration primarily has three parts function name returned type and the perimeters which are required to call the function. So the word set up has three parts wide is the return type that means dysfunction will not return anything as an output then set up is the name of the function on within their own records will pass the required perimeters for executing this function core. Now, as we don't need any perimeters for this function call so perimeter section is empty The set of function is called only once in the start of the program and within the curly brackets, we will put in the line off court which we want to execute along with the second function here we are doing two tasks. First of all, we are setting up a serial communication serial communication is the process off sending the data one bit at a time sequentially over a communication Channel serial dot begin. This statement will tell our Reno to get ready to exchange the messages with the serial monitor at a data rate off 9600 bits per second. Then we will make the number toe as an input pain so that it can take the input from the push button. Now, the second most commonly used function in an arena program is aloof function. Blue function gets executed repeatedly in this section will perform the task, which we want our reno to do, based on the inputs from the various sensors or the actuators attached to the input pins. As you can see, we first read the state of the pin number to toe which the push button is attached. Then, using the serial Lord print line function will print the state of the pain in real time. As these statements are written inside a loop, they get executed repeatedly until you reset the board or switch it off. That's pretty much about the court structure of the skeleton that we will use in our programs. See you next week 9. Project Setup: way have discussed everything in bits. First, we discussed about the working principle of a being scale application and how it converts the forced into an output old age. Then we started in detail about a text seven double one and how it converts the analog to a digital signal. We have also talked about our microcontroller device are green. We have seen how to set up and program agree. No, no in this video will completely hardware connections required for our project. Let us now give a closer look into the connection details. We will divide this into two parts. First, we will connect the being skill with an object seven level on model and then we will connect HX seven, double one with a brain. In our sorting video, you have seen that we advertised four wires with the interface Spins off are being skill Now, As you can see, they will put e plus and e minors from the scale Toe e plus and E minors on edge export Similarly s pleasant s minus from scale toe a plus and a minus on edge export That way Ask Gayle is now connected without a text seven development board. Now we will connect R Reno without a text mood. First of all, we will power up our ethics board using our dino take a jumper while from 3.3 world pain off Arduino vcc in edge X seven, double one and ground in a text seven double, one toe ground in a dream. Now take a jumper while from day topping off at 67 Double 12 pin number 11 on our Gino and then connect the clock pin off at $67.1 toe. Pain them but hurting off. You know, now that we have understood the things, let us now do it in practical. Here is a slight which represents the been mapping off, being skill and magic seven. Double one. It will help you to follow when we will be demonstrating it in the next step with people a spinoff scale. We have attached the red wire and it will go to e plus slot on its export. Similarly, the negative we have attached the black wire and it will be attached toe e negative on edge export and the white wire is attached with s plus and we'll goto a plus on brown Jumper wire is attached. Toe s negative off interface spin. And this will goto a negative on a text board. So this is our set up. Most of all, we will attach a check seven double one without weighing scale. So no, the white wire will go into a plus. The brown wire will go into a negative. Black wire will be a dashed with you. Negative. And the red jumper wire from the interface spin will be attached to e positive on HX seven , double one. So that way we have connected our being skilled with a check. Seven double one. Now we will connect a tech seven Double 12 R Reno microcontroller device. For that, we will take a jumper wire a green color jumper wire and we'll put it in Mississippi, Nevada, Reno and another jumper wire which will go in tow ground pain off our tree. No, we will a dodge the blue color a jumper wire in our case. Toe pin number 11 off Arduino on another jumper wire off red color will be attached. Toe be number 13 off Audrina. No, We will take all these wires and attach it with our check. Seven. Level one board. The VCC from Argentina will be attached with VCC off at Jack's amendable. One ground will go to the ground off a check. Seven. Double one on the red jumper wire from the pin. Number 13 will go and sit into the clock pin off attacks. Seven. Double one. Similarly, the pin number 11 which is the date up and we'll go into the data up in off a check. Seven. Double one. In the next video, we'll understand the artery. No programming, which we need to do in orderto read this digital signal and converted into understandable weight readings. See you in next radio. 10. Scale caliberation Process and Code: In this video, we will discuss about what is scary collaboration and why it is required, as we know that being instruments, scales and balances are used widely in the industry for various measurements, some off the measuring instruments are used in laboratories to measure small objects, whereas some others are used to measure heavy objects like trucks and other heavy makers. We all see being instruments in our daily lives around us, beat like battle Ming scales or when we visit grocery stores to buy the veggie tables. Now it is very important that the scale should provide accurate readings. That means one poem should weigh as one bone on the skin. This process is called les calibration were a scale, a statistic and adjusted against standard weights. In other words, calibration is an adjustment, but farming on the instrument to make that instrument function as accurately as possible, we are going to use an important in our project that this car less calibration factor now say, for example, you have pleased and standard weight off 10 cages on your scale, but the Scalea showing reading off five kilograms. Now you need to multiply this value so as to get a correct output value, which is scoreless calibration factor. Now they will write a piece off Cool to find the calibration factor off our beings. Kid, we are on agree No, I d on here. We will write a piece off court to find out the calibration factor off are being skill. We will first ofall install a library which will have all the relevant functions to interact with our being skilled. For this Goto tools manage libraries then here just type out each x seven Double one on hit Enter here You can check for ejects seminal one Arduino library and click on install. Now for me in this step is already done, So I will skip it for now before we understand the court Let us once discussed the calibration process for this We will keep a known weight on the scale. For example, if we keep 10 gauges on the scale and are renewing showing, say, for example, seven kids years now, we will change the calibration factor in real time till we get the eco rate were trainings at this point the only thing off the Russians number one. How is or Dino going to display the output weight readings. And then how can we send commands toward Reno to change the calibration factor? This will happen using our laptop. We will use our laptop to connect it with a Reno, and all the communication between the arena and the laptop will happen through a tool. Corliss Cereal monitor. If you want to print something is an output from the Arduino. Then we can write some cereal functions inside the cold, due to which the output will get printed on the serial monitor. And similarly another way. Say you're not getting excoriate. We're treating from the Arduino on. We want to change the calibration factor. Then, on the serial monitor, we can provide some commands which needs to be handled in our court, say from cereal monitor. If we get a plus command than in our cold, we will increase the calibration factor by 10. And if we get a minus command than in, our court will decrease the value off the calibration factor by 10 and use it for our further calculations. We will look on how to use the serial monitor after we understand and upload our court. Now we will understand the piece off court which will upload into the arena in orderto calibrate are being skill. First of all, we'll include a text seven Double one library in order to excess, although underlining functions and methods. After that, we will likelier to constants one for the date up in another one for the clock pin the data pain off reject seven Double one is connected to open number 11 off Arduino and similarly, the clock pin off check $7 1 is connected to PIN number 13 off Arduino. After that, we have created an object, namely skill for a check seven Double one in order to excess all their defined methods in the next line will declare a variable for calibration factor on will initialize it with some random value. Next is our set up function. First of all, in order to start the communication, we need to use cereal lord, begin function dysfunction, establishes a communication channel between our computer and agree No. And now onwards, the data can be exchanged between these two on we passed a perimeter toe dysfunction, which is scoreless moderate, meaning that how many bits per second can be passed toward this communication channel now will print below. Lines off text on cereal monitor. If I want to print something on cereal monitor, I will use cereal Lord print line function. Using these functions, we can print anything on cereal monitor. After that, they will use scale Lord big and function in order to initialize the library with data output on clock pin here. Basically, we're specifying the pains on which we're getting the digital output on the clock signal from Magic seven, double one. After that, we'll call. Certainly score, scale, function, toe pass the perimeters like calibration factor toe the scale before we start taking the readings from the skill. Initially, we will call this function without any perimeter. After that, we will reset the scale to zero by calling scale are their function. Now we will look at the look function. This set off court will get executed repeatedly till the time our dino is switched on. Now, first off, all we will call certain underscore scale function with the initial calibration factor. Now we'll use get on the score unit, function toe, get the weird readings from it takes seven double one. After subtracting the deer were and adjusting the calibration factor that we have said using certain discourse scale function here we will multiply the output with the constant number in order to convert it and two kilograms. The second perimeter in this function designates the number of decimal places in the output . So we will print the output weight up to one decimal place. Now, this is the piece off cold there we will dynamically at just the value of calibration factor using cereal monitor here. First of all, we will check if we have any input on the serial monitor. If any kind of data is available on cereal monitor, then we will use cereal Lord Reid function to get that value. If the input values plus r A we will increase the calibration factor by 10 if the value is minus are said will decrease the calibration factor by 10 and we will use the new calibration factor value toe again perform the loop function. Now that we have understood the piece off court, we will upload it into the green Oh, and try to calculate the calibration factor for our being skill 11. Upload Calibration Code and Final Demo: here in this video, we will finally connect our complete set up with a laptop and upload the calibration code into it. After that, we will do a final round of demo. So bring in your whole set up, which we have built in the project Set up video. Now you have your being skill connected with the analog to digital converter HX seven, double one which in turn should be connected with your microcontroller device are green. Now connect your arena device into the U. S. Report off your laptop. Now open the arino I d to further open the calibration program that we have written now to upload the program into what we know, we have to make couple of settings in Reno I d. First off, I'll go to the device manager off your laptop, another ports to see on which communication port the Arduino is now connected for me. The Adriano is currently connected on comport five. Then come over to what we know I d go toe tools port and then select the port on which your devices connected. All this is to connect your i d and device so that we can push our program into the device . One more thing that we need to set up is the board. We will go to tools and then board and select Ari. No, no, no. One more thing that we need to check is our serial monitor. As we discussed in the last video, all the communication between the arena and the computer will only happen through the serial monitor. So once your program is uploaded and the device is running, click on this button to access your cereal monitor to view the messages from the Agree No or to send the commands to the device. With that, we are all done. We will just verify the cord and then hit upload. Now open the serial monitor. You can see the messages are being printed on the serial monitor. Now I will put some weight on my skill. My current it is around 74 kilograms on it is currently showing around 66 kilograms. No, I will try to change the calibration factor. With each miners we're sending. The calibration factor will be decreased by around 10. The current television factor value is around 10512 and now we're getting decorate values. With that, we have completely the demo off our project. I hope you find it exciting. Do let me know if you need any help while implementing your project, and I'll get back to you as soon as possible. Thank you. 12. Next Steps: Congratulations. You are made it to the end of the course. Seriously, it's a big achievement on you. Should be proud of it. We have covered in detail light from the hardware integration toe ring. No programming. You should now be able to fetch the weird readings from your scale to your laptop. Our next stop machine. It's quite an achievement. Now, where do we go from here? No, we will understand about IBM. I only platform and see how we can connect to the IBM cloud from no damns you. That is our WiFi neighborhood microcontroller. Otherwise, we will just replace the arino with our nor them's your device. Once we get connected to the IBM cloud platform, we shall push the data from the scale in real time toe IBM Watson, I d platform making it a true in the let off things application where we will transmit the data in real time through the cloud platform state you and I shall inform you once I posed the next class. Thank you. 13. Follow me on skillshare: the world of Internet of things is immense and constantly will be. If you are a big Nerine, I ot and want to learn more about it than you can go and check out my another course about making a smart light bulb using I O. T. If you have not, please go ahead and follow me on skill share. That way you will always be notified about my future courses.