Skills Dev II: Working with Inputs and Sensors

Made by Junke Zhao

Using input and sensors to create interactive device

Created: December 4th, 2023

0

Intention

In the context of modern electronics and IoT (Internet of Things) projects, the ability to combine various inputs and outputs to create interactive and responsive systems is crucial. There are numerous sensors that come with the Sparkfun suite, and after experimenting and comparing a variety of sensors, I chose to use FSR as the sensor data

0

Context

In the real-world context, Force Sensitive Resistors (FSRs) find diverse applications, reflecting their versatility and utility. For instance, in healthcare, FSRs are used in pressure-sensitive beds and pads to monitor patients' movement or weight distribution, aiding in the prevention of pressure ulcers. In the realm of gaming and entertainment, these sensors enhance user experience in touch-sensitive controllers. Additionally, in robotics, FSRs serve as tactile sensors to enable robots to interact more delicately with their environment.

0

Process

The process involves both hardware assembly and software programming. On the hardware side, it includes setting up the Particle Argon board, correctly wiring the LED, button, and FSR onto a breadboard, and ensuring proper connections with appropriate resistors for circuit protection and functionality. On the software side, it involves writing a Particle program that continuously monitors the state of the button and the FSR, activating the LED only when both inputs meet predefined conditions. This process also includes testing and calibrating the FSR to determine the threshold value for "sufficient force".

0
int ledPin = D2;
int buttonPin = D3;
int fsrPin = A0;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
  pinMode(fsrPin, INPUT);
}

void loop() {
  int buttonState = digitalRead(buttonPin);
  int fsrValue = analogRead(fsrPin);

   bool isButtonPressed = (buttonState == LOW);
  bool isFsrPressed = (fsrValue > 5);

  if (isButtonPressed && isFsrPressed) {
    digitalWrite(ledPin, HIGH); 
  } else {
    digitalWrite(ledPin, LOW); 
  }

  delay(100);
}
Click to Expand
0
0

Product

The final product is a compact, interactive module that visually demonstrates the principles of conditional logic in electronics. When the button is pressed and the FSR is sufficiently pressed, the LED illuminates, providing immediate visual feedback. This project, while simple in its components, showcases the potential of combining basic electronic elements to create more complex and interactive systems. It serves as an educational tool for understanding electronics and programming basics, and as a prototype for more advanced applications.

x
Share this Project

Courses

48-675 Designing for the Internet of Things 24

· 11 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


About

Using input and sensors to create interactive device