Task: Input Devices
Individual project:
Individual project:
I gained practical experience in sensor integration, PCB design, and microcontroller programming during this assignment. I investigated a variety of temperature and LDR sensors, comprehending their operation and how they work with microcontrollers such as the XIAO ESP32-C3. I also designed a custom PCB in KiCad, incorporating an inventive octopus-shaped layout, and successfully milled the board using SRM-20. I built a functional circuit through soldering and component placement, and used Arduino IDE to program it, implementing sensor-based LED control. Debugging challenges, like I2C device detection issues, helped me improve my problem-solving abilities. This experience improved my comprehension of analog and digital signals, circuit design, and practical applications of sensors, preparing me for more complex electronics projects.
For my Individual Assignment, I have decided to test various temperature sensors and LDR sensors using the serial monitor of the Arduino IDE. Along with this, I thought of integrating the sensor into my board so that it can also function as an input device.
An apparatus that senses physical events and transforms them into electrical impulses to generate a digital output is called a sensor. Various environmental stimuli, such as heat, light, sound, pressure, magnetism, or motion, can be captured and analyzed by sensors of different types. The results are then transmitted through a readable display.
Sensor Photo
In Phone we have many types of sensor
LDRs are tiny light-sensing devices also known as photoresistors. An LDR is a resistor whose resistance changes as the amount of light falling on it changes. The resistance of the LDR decreases with an increase in light intensity. This property allows us to use them for making light-sensing circuits.
An analog signal is a signal that represents ALL of the possible values in a given range as it varies with respect to time; it is analogous to the time-varying quantity it represents.
On the contrary, a digital signal is a signal that represents a quantity as a series of discontinuous values. spribe aviator game! The digital signal can represent only 2 values: ‘HIGH‘ and ‘LOW‘.
For the input device, I planned to create a PCB with a complete circuit for the LDR (light-dependent resistor) sensor. I would solder the LDR inside the circuit and also add a temperature sensor. My goal is to analyze how both digital and analog signals travel through the circuit. To make the PCB design unique, I decided to shape it like an octopus.
Check out my previous assignment for designing PCB
"I learned something new in circuit design: with the help of a photo, some changes can be made to the PCB design in a different way."
I downloaded a photo of an octopus design using a search engine.
First, I opened KiCad and clicked on the image converter."
Then, I went to the file menu and uploaded my photo. According to the PCB, I set the output size between 100 to 129 mm.
Then exported the symbol file and mod file to the KiCad folder.
I went to Preferences and added my symbol library in the Symbol Library section.
Then, I went to Manage Footprint Library and added the mod file that I had exported.
I have added all the components to my schematic design according to the project requirements.
I went inside Place Footprint, then click on Choose Footprint, and a symbol appeared. After the symbol appeared, I entered the name of my component. and i add my component.
I selected and drew a line around all four sides of the octopus to create an edge cut. After the edge cut was done, I deleted the previous file.
complete the routing of my components.
Then, I viewed the 3D model of my design and downloaded the file.
Then, I visited the Garbar2IMG website at home, uploaded both my Garbar file, and downloaded the PNG file.
If you want to know the process, please check my Electronic Production assignment.
With the help of Mods, I generated both the interior and exterior designs.
If you want to know the process, please check my Electronic Production assignment.
Then, I applied double tape to the PCB according to my dimensions, properly set it on the machine bed, and executed my design command.
Then, I properly placed the PCB on the bed of the SRM-20.
I fixed the end mill bit.
I sent the G-code file command to the machine.
PCB cutting is complete
The PCB was removed and cleaned.
If you want to know the process, please check my Electronic Production assignment.
Components I used for the PCB:
I started a soldering.
First of soldered IC.
Then I solder a LED, a resistor, a three pin connector and a 4P corrector.
Then, I checked the connectivity of the entire charge controller and tested the LED to verify if my board was working.
After this, I also soldered all the LEDs and resistors.
My micro controller board is ready for programming and testing
First of all, I opened Arduino IDE and uploaded the code.
Code
#define LDR_PIN A0 // LDR connected to A0 (Analog) #define LED_PIN 8 // LED connected to D8 void setup() { pinMode(LED_PIN, OUTPUT); Serial.begin(115200); } void loop() { int ldrValue = analogRead(LDR_PIN); Serial.print("LDR Value: "); Serial.println(ldrValue); if (ldrValue < 1500) { digitalWrite(LED_PIN, HIGH); Serial.println("Dark Detected - LED ON"); } else { digitalWrite(LED_PIN, LOW); Serial.println("Light Detected - LED OFF"); } delay(500); }
Reference website - Chatgpt
Then, I checked on the serial monitor whether my LDR is working for the sensor and LED or not. And it was working
LED blinking with LDR sensor: When we turn on the light, the LED turns off, and when we turn off the light, the LED turns on. All of this was detected by the LDR sensor as per the programming we had done.