- INTRODUCTION: -
In this sensor integration project, we will learn how to use a LDR (Light Dependent Resistor) on the Pluto 1.2 drone to its advantage. As the sensor name suggests that it is a light dependent sensor which is why the use case of this device in this project will be to safely land the drone in a dark place where the visibility is very low.
- OBJECTIVES: -
To learn how to use a LDR sensor and its use cases
- PROBLEM STATEMENT: -
To use the LDR sensor to land Pluto safely in darker places (you can change the sensitivity on the sensor accordingly)
- APPROACHING THE PROBLEM: -
Initially, like any other sensor, we need to understand what and how does the sensor provide us with the values. Then how can we use these values to make the drone land.
So firstly, you need to know the hardware connections for which you need to know about the GPIO 10 pin.
- GPIO PINS: -
GPIO (General Purpose Input/Output) pins are a fundamental feature of many microcontrollers; these pins serve as flexible interfaces that can be configured to either input or output mode, allowing the microcontroller to interact with external devices and circuits.
Similarly, the pin 10 is used as an interface between the LDR sensor and Pluto 1.2 flight controller, where the sensor values are transferred through.
- MOUNTING AND CONNECTIONS: -
PRIMUS (BOTTOM) AND LDR SENSOR (TOP)
- SOLUTION: -
- EXPLANATION OF THE SOLUTION: -
Like we discussed above, first we need to check values are being provided by the Light Dependent Resistor sensor and we do that by print its values in both in the dark and in a bright surrounding as well.
Further when we understand, that the sensor gives ‘1’ in the dark and ‘0’ when in light, we feed the signal read from pin 10 (where the LDR sensor is attached) directly to the ‘if’ condition. As the ‘if’ condition directly takes in a true value, it proceeds towards the tasks assigned in the ‘do’ command.
As shown above, would land when darkness is sent
ALTERNATIVE IDEA: We can also use this sensor in keep the drone in the dark initially and then make it take off once someone switches on the light inside a room.
Comments
Please log in or sign up to comment.