Stufin
Home Quick Cart Profile

4.5in Flex Sensor

Buy Now on Stufin

Sensor Type

Variable Resistance Flex Sensor

Flexing Length

4.5 inches (114 mm)

Resistance Range

10 k to 30 k

Operating Temperature

-20C to 80C

Power Consumption

<5mA

Output Signal

Analog

Connection Type

2-pin JST connector

Applications

The 4.5in Flex Sensor is suitable for a wide range of IoT applications, including

Robotics

Detecting joint movement and flexibility in robotic arms and legs.

Wearable Technology

Measuring body movement and flexibility in wearable devices such as smart clothing and fitness trackers.

Healthcare

Monitoring patient movement and flexibility in medical devices such as rehabilitation equipment and prosthetic limbs.

Industrial Automation

Detecting movement and flexibility in industrial equipment such as robotic arms and grippers.

Overall, the 4.5in Flex Sensor is a versatile and reliable component for detecting bending and flexing movements in IoT applications.

Pin Configuration

  • 4.5in Flex Sensor Documentation
  • Overview
  • The 4.5in Flex Sensor is a flexible, bendable sensor that measures the amount of bend or flexure. It is a popular component in various IoT applications, including robotics, wearable devices, and interactive installations.
  • Pinouts
  • The 4.5in Flex Sensor has two pins, which are explained below:
  • Pin 1: VCC (Power Supply Pin)
  • Function: Provides power to the sensor
  • Voltage: Typically 5V, but can operate from 3.3V to 6V
  • Current: Typically 1-2mA
  • Connection: Connect to a power source, such as a microcontroller or a battery
  • Note: Ensure the power supply is stable and within the recommended voltage range to avoid damaging the sensor
  • Pin 2: OUT (Output Signal Pin)
  • Function: Outputs an analog signal proportional to the bend or flexure of the sensor
  • Signal Type: Analog voltage (0-5V)
  • Connection: Connect to an analog-to-digital converter (ADC) or an analog input pin of a microcontroller
  • Note: The output signal will vary depending on the degree of bend, with a higher voltage indicating a greater bend
  • Connecting the Pins: Structure and Recommendations
  • To connect the 4.5in Flex Sensor, follow these steps:
  • 1. Power Connection
  • Connect Pin 1 (VCC) to a power source, such as a microcontroller or a battery.
  • Ensure the power source is stable and within the recommended voltage range (3.3V to 6V).
  • 2. Output Signal Connection
  • Connect Pin 2 (OUT) to an analog-to-digital converter (ADC) or an analog input pin of a microcontroller.
  • Use a breadboard or a PCB to connect the sensor to your microcontroller or other components.
  • Ensure the connection is secure and not prone to mechanical stress or interference.
  • Additional Recommendations
  • Use a voltage regulator to ensure a stable power supply to the sensor.
  • Add a decoupling capacitor (e.g., 10uF) between the power supply and the sensor to reduce noise and improve stability.
  • Use a pull-down resistor (e.g., 10k) on the output signal pin to prevent floating outputs when the sensor is not connected.
  • Consider using a voltage divider or an amplifier circuit to condition the output signal, depending on your application's requirements.
  • By following these guidelines and connecting the pins correctly, you can use the 4.5in Flex Sensor to measure bend and flexure in your IoT projects.

Code Examples

4.5in Flex Sensor Documentation
Overview
The 4.5in Flex Sensor is a flexible potentiometer that measures bending and flexing movements. It is a resistive sensor that changes its resistance value in response to flexing, making it an ideal component for applications such as gesture recognition, robotic arms, and wearable devices.
Specifications
Length: 4.5 inches (114mm)
 Width: 0.5 inches (13mm)
 Thickness: 0.02 inches (0.5mm)
 Resistance range: 10k to 30k
 Operating temperature: -20C to 80C
 Power supply: 3.3V to 5V
Pinout
The 4.5in Flex Sensor has three pins:
VCC (Red wire): Power supply (3.3V to 5V)
 GND (Black wire): Ground
 OUT (White wire): Analog output signal
Code Examples
### Example 1: Reading Flex Sensor Data with Arduino
This example demonstrates how to read the flex sensor data using an Arduino board.
```c
const int flexPin = A0;  // Connect the OUT pin of the flex sensor to analog pin A0
void setup() {
  Serial.begin(9600);
}
void loop() {
  int flexValue = analogRead(flexPin);
  int resistance = map(flexValue, 0, 1023, 10000, 30000); // Convert ADC value to resistance value
  Serial.print("Flex sensor resistance: ");
  Serial.print(resistance);
  Serial.println(" ohms");
  delay(50);
}
```
In this example, we connect the OUT pin of the flex sensor to analog pin A0 of the Arduino board. We then read the analog value using `analogRead()` and convert it to a resistance value using the `map()` function. Finally, we print the resistance value to the serial console.
### Example 2: Using the Flex Sensor with Raspberry Pi and Python
This example demonstrates how to read the flex sensor data using a Raspberry Pi and Python.
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define the flex sensor pin
flex_pin = 18
# Set up the pin as an analog input
GPIO.setup(flex_pin, GPIO.IN)
while True:
    # Read the analog value
    flex_value = GPIO.input(flex_pin)
    # Convert the analog value to a resistance value
    resistance = (flex_value  30000) / 1023
    print("Flex sensor resistance: {:.2f} ohms".format(resistance))
    time.sleep(0.05)
```
In this example, we use the RPi.GPIO library to set up the flex sensor pin as an analog input. We then read the analog value using `GPIO.input()` and convert it to a resistance value. Finally, we print the resistance value to the console.
Note: These examples assume that the flex sensor is connected to a microcontroller or single-board computer with an analog-to-digital converter (ADC). The exact connection and code may vary depending on the specific hardware and software used.