Hello, guys, and welcome back.
In this lecture, I'm going to demonstrate with a very simple example how we can use analog inputs with
Arduino.
So let us get started by going to Adreno and just get the breadboard with the horno, as we've done
in the previous demonstration.
Next, we're going to get a temperature sensor.
If you go to components and go to all, we can search for the temperature sensor.
Now, there is a lot of analog inputs that we can use.
You could use potentia meter, we could use multiple sensors.
But what I'm going to focus on for now is only the temperature sensor.
So let us place it on the breadboard.
Now, this temperature is supposed to send a signal to the original.
So let us wire it really quickly.
Now, as you can see, the temperature sensor contains three terminals, Power V Out and Genndy.
Now simply we need to connect the power and the GENNDY to the corresponding power here.
And remember, the plus is coming from the five volt, the red one, and we are redirecting it to the
park section.
And the mine is the black one is connected to the GENNDY so that when we connect the Andes here, let's
say to the Andes, we are connecting it as well to the original and powering it from the original.
Now let's take the power and connect it to the plus Katagiri and to the negative.
And we have power to the positive.
Now we have velt.
Now this temperature sensor is actually sending us voltage and this voltage need to be converted to
the real temperature.
So in order to do that, we're going to take this V out and connect it to the analog input.
Don't connect it to the digital because this is an analog value.
It's not a constant zero.
All five volts.
No, this could be any value between zero and five volts.
And then the ADC inside this pin, which is connected to this spin, is going to convert it to a digital
value that we can manipulate.
So this temperature is going to send a valuable voltage value all the way here.
Now, think that is great because you can easily simulate a temperature sensor.
Now, if you have a real Arduino hardware and you understand the temperature, you would need to get
this temperature sensor, get something like a lighter next to it and try to heat it up.
Or you could have some cooler or a fan directed at your temperature sensor in order to see a value of
change.
Now, if you go to start simulation here and you click on the temperature sensor, you could change
the value of the temperature.
Now, if we zoom in a bit by holding control and using our mouse, we'll.
We can change the value between minus 40 and 125 Celsius, and according to what value we change, the
voltage here is going to change.
Now, the next lecture, we're going to start writing code in order to simulate this TMB be 36.