Les capteurs – PIN State Monitor
Sensor’s Secret
Among the various options in evive’s control menu is a Pin State Monitor. This monitor, as the name suggests, displays the states, or the values of all the pins – both digital and analog – that are there under the magic lid. Let’s see what it shows.
Switch your evive ON if you’ve switched it OFF. From the control menu select Pin State Monitor. Once you select it, you’ll another menu which has the following three options:
- Digital Pin States: This option displays only the states of the digital pins, i.e. it shows whether a pin is at 0 or at 1.
- Analog Pin States: This option shows what value does each analog pin have between 0 and 1023. 0 – 1023 is a different way of representing the voltage values that the analog pins can have, i.e. 0 – 5V. Here 0V means 0, and 5V means 1023.
- Digital & Analog States: This option is a combination of the previous two; it shows the states of both the digital and the analog pins.
But what is the point of understanding what the monitor does? We’re going to use it to see the different sensors that are there in the starter kit, in action.
Let’s begin with the tiniest of them all that looks like this:
LDR
An LDR, short for light dependent resistor, is a resistor whose resistance changes as the light falling on it changes. This property allows us to use them for making light sensing circuits. Let’s get our hands dirty to see how it works.
Activity
- From the starter kit take out 3 male-to-male jumper wires, an LDR, and a 10kΩ
- Take one male-to-male jumper wire and connect one of its end to the top right corner of the breadboard, i.e. the first hole from the right in the first row. At the top left corner there is a group of 6 pins: 3 in each line. The 3 pins in the top line are the 5V supply pins, and the pins below are the GND pins. Take the free end of the male-to-male wire and connect to any of 5V pins.
- Next, take the LDR and insert one of its legs in the same column as that of the first jumper wire, i.e. the first hole from the left, but in the fifth row(Can be anywhere but should be in the column). Insert its second leg in any other hole in the same row, say, the 9th hole from the right.
- Now, take the 10kΩ resistor and insert one of its legs in the 9th hole from the right of the 2nd or 3rd row. Insert its second leg in the same row as the first leg but in a different hole, say, the last hole.
- Then, take another male-to-male jumper wire and insert it right above the resistor’s second led, i.e. in the last column. Connect its free end to any of the GND pins on the top left corner under the magic lid.
- Next, take the last male-to-male jumper wire and insert one of its end between the LDR and the resistor, i.e. in the 9th hole from the right of the 4th Take its free end and connect it to the A0 pin right above the breadboard.
- Finally, go to the controls menu and select Pin State Monitor. From the menu that appears, select either the Analog Pin States. On the screen, you will see numbers from 0 to 15. Besides 0, you will a value that nearly 800. Now, slowly take your hand close to the LDR; when you do so, you will observe that the value increases.
Thus, you can observe that the sensor senses the intensity of light that falls on it, and changes the resistance depending on it. Using this simple circuit, you can make the system that can be used to turn ON and OFF the lights of the room; but to create this system you require programming, i.e. writing a code, or a set of instructions to control the system. Guess what! We’ll be taking up programming in the next course! Make sure you to meet us there as well to learn cool things about programming.
