Categories
TUTORIALS

Walking or Sleeping: Using force sensor to respond to steady pressure

Building on SparkFun’s Force Sensitive Resistor code, this tutorial demonstrates one method for enabling a pressure sensor response after a set threshold has been consistently sensed over a period of time. There are many applications for setting pressure response after a set duration has past. One application is distinguishing the difference between a person (who maybe me homeless) sleeping on a steam vent in the street and normal foot traffic in an urban environment for the purpose of delivering emergency response in extreme cold weather situations more efficiently.

 

Components:

Arduino Uno

Adafruit Square Force-Sensitive Resistor (FSR)

3.3KOhm -10KOhm Resistor

 

Circuit:

The circuit is very simple. One side of my FSR connects to 5v and other connects my analog pin o (A0), my resistor ( 10K Ohm) and then to ground.

How it works:

using the code for FSR it will use voltage and static resistor value to
calculate FSR resistance as grams of force pressure (weight): see figure below

In order to distinguish between someone who is sleeping on a steam vent and someone simply walking on it you will need to set a threshold value which will be calculated in grams in my case is set my threshold to 40823.3 (roughly 90lbs) assuming that is a fair weight for someone exposed to living on the street. Next I defined a value for how many times the sensor reading is equal to or greater than the threshold value ( int countAboveThreshold).  finally I defined a constant value for when threshold has been match or passed enough to trigger the action from Office of homeless services or similar homeless advocacy group to intervene by setting (const int iterationsToHold) to 600 which is a value found by dividing 20mins by my 2second delay. When the countAboveThreshold and iterationsToHold . You can get creative in how you define your duration but for my particular focus 20mins is a good enough guess since average pedestrians are not likely to stand on grates for late long.

 

In the following Serial monitor read-out

I set my const int iterationsToHold  to 6 for demonstration purposes

 

Code:

Leave a Reply

Your email address will not be published. Required fields are marked *