Intention
The goal of this project was to expand my familiarity with sensors on the Particle platform and to understand how to integrate inputs into a circuit. I aimed to use a force-sensitive resistor (FSR) as an input to control an LED, with the LED turning on when pressure is applied to the FSR. This project helped me explore how sensor data can drive outputs and practice using conditional logic in my code.
The goal of this project was to expand my familiarity with sensors on the Particle platform and to understand how to integrate inputs into a circuit. I aimed to use a force-sensitive resistor (FSR) as an input to control an LED, with the LED turning on when pressure is applied to the FSR. This project helped me explore how sensor data can drive outputs and practice using conditional logic in my code.
Process
I began by connecting the Particle Argon device to Wi-Fi and ensuring it was linked to the Particle Cloud, following the standard setup instructions. For the circuit, I connected an LED to the Argon, including a 220Ω resistor to limit the current. The longer leg (anode) of the LED was connected to D0. The shorter leg (cathode) was connected to GND through the 220Ω resistor.
Next, I added the FSR to the circuit as an input: One leg of the FSR was connected to 3.3V on the Argon. The other leg of the FSR was connected to A0 (an analog input) and to GND through a 10kΩ resistor, creating a voltage divider. This setup allowed me to measure the voltage change on A0 as pressure varied on the FSR.
In the Particle Web IDE, I wrote code to read the FSR’s analog value and set a threshold to control the LED based on the amount of pressure applied. The
analogRead()
function gathered the FSR readings, and a conditional statement checked if the reading exceeded the threshold. If it did, the LED turned on, indicating enough pressure was applied. I opened the particle serial monitor and the pressure reads about 1754. So I set up the threshold of 1500. Product
The final circuit successfully turned the LED on when I applied pressure to the FSR and turned it off when I released the pressure. By adjusting the threshold, I could control the sensitivity of the LED response, enabling me to refine the interaction between the input (FSR) and the output (LED). The setup demonstrated a basic example of using sensor inputs to drive outputs in an IoT application.
Reflection
This project taught me how to work with analog sensor data on the Particle platform and how to implement a voltage divider to read values accurately. I learned that setting the correct threshold for the FSR was crucial to achieving reliable results. Testing the circuit highlighted the importance of secure connections, especially for the ground and analog input pins. I now feel more confident integrating analog sensors and look forward to applying more complex logic to sensor-driven interactions.
Challenges Encountered
Throughout this project, I faced a few notable challenges, especially with establishing a reliable connection with the FSR. Initially, I struggled to detect pressure consistently, as the FSR often produced unexpected readings or no response at all. After troubleshooting various factors—like adjusting resistor values, rechecking connections, and experimenting with threshold settings—I was finally able to achieve reliable readings, though it required several attempts.
At one point, the FSR suddenly stopped responding entirely, which led me to consider potential issues with loose connections, inconsistent pressure sensitivity, or even possible damage to the FSR itself. This experience underscored how sensitive analog sensors can be to physical setup and wiring accuracy.
Additionally, I found it challenging to connect multiple sensors in the circuit simultaneously. Managing different inputs while trying to maintain consistent performance highlighted the importance of carefully organizing wiring and understanding how each sensor interacts within the circuit.
Next Steps
For the next steps, I plan to experiment with connecting two sensors together, such as pairing the FSR with another input, like a button or potentiometer, to create a more complex interaction. My goal is to improve my confidence in working with multiple sensor inputs and refine my understanding of how they can influence each other in the circuit.