How can I program arduino to detect fluctuations in output voltage of a sensor

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
yaantey
 
Posts: 4
Joined: Mon Dec 19, 2011 2:26 pm

How can I program arduino to detect fluctuations in output voltage of a sensor

Post by yaantey »

Hey people.

Im using an FSR to detect the voltage changes when a different force are applied on it. Now I have been able to program the FSR to detect the voltages and print on the serial monitor. So, next I want to count the number of voltage fluctuations per sample of 8 and to 'ON' an led when there are more than 5 different voltges in a sample.

sample = s
8 samples detected
s0 = 1,
s1 = 1,
s2 = 1.5,
s3 = 2,
s4 = 2.5,
s5 = 3,
s6 = 3.5,
s7 = 4,
if sample has 6 various voltag {LED = ON}
else {LED = OFF}

Can anyone help me with a syntax for the above logic please.

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: How can I program arduino to detect fluctuations in output voltage of a sensor

Post by jasonwebb »

An FSR is simply a kind of resistor (force-sensitive resistor to be exact), so one does not program it.

I do not want to write code for you (and I hope no one else does either). Instead, I'd rather help you learn enough to write the code yourself.

If you don't have any programming experience, you will have a bit of work to do. However, if you have programmed before but aren't familiar enough with Arduino yet, I recommend checking out the official Arduino website and going to their tutorials section. Then, ready everything! And then keep reading. There are literally dozens of fantastic sites all of the internet to learn how to program using an Arduino.

In particular, here are some good tutorials from Arduino that will help you out on this project. Using these examples, you should be able to construct the complete program yourself:

http://arduino.cc/en/Tutorial/AnalogReadSerial
http://arduino.cc/en/Tutorial/ForLoop
http://arduino.cc/en/Tutorial/Blink

I'd be happy to look at code and help you debug problems if you sincerely get stuck, but don't expect anyone to do work for you.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”