connect a velostat pressure sensor

Hi
I've made a simple pressure sensor using a small sheet of velostat sandwiched together between two bits of copper foil which is all held together by electrical tape. The sensor seems to be working fine as I'm getting variations in resistance readings on my multimeter when i apply pressure to it. However, I'm now wondering how i caninput them readings into my computer via arduino. I have tried hooking the sensor up to 5v and A0 and then ran this code: -

int reading = 0;

void setup() {
  Serial.begin(9600);
  
}
void loop() {
  reading = analogRead(A0);
  Serial.println(reading / 8);
delay(50);
}

but it's just giving me a straight readings of 1023 regardless of the amount of pressure i'm applying.
Am I connecting it up right?
Thanks

hi, I’m trying to connect a velostat pressure sensor that i’ve built to my arduino Uno r3.

The pressure sensor seems to be working correctly when it is attached to my multimeter (ie. it’s giving resistance readings which vary when i apply pressure to the sensor). However, When i try to hook it up to the arduino and run analogRead on the pin i just get a straight reading of 1023 regardless of the amount of pressure i apply. Does this mean i need to add a series resistor? Or am i hooking it up incorrectly? I’ve simply connected the two cables to 5v. and A0. and then uploaded this code: -

int reading = 0;

void setup() {
  Serial.begin(9600);
  
}
void loop() {
  reading = analogRead(A0);
  Serial.println(reading / 8);
delay(50);
}

Thanks very much

okay so i've attempted to add a few different series resistors and they are all making the readings go really erratic. is this normal?

What is the (average) resistance that you measure with your DMM.
You will need a pullup resistor that is about the same value.
Leo…

do you mean the average of the difference between 'the most' amount of pressure i could apply and then no pressure at all?
thanks for your help

Yes. If you know the sensor resistance extremes, you can pick a pullup resistor to suit.
The right value gives the most variation from the A/D.
Leo..

liamorourke:
Am I connecting it up right?

My eyesight isn't very good these days - I can't see your connections from here.

Perhaps you could show us a schematic diagram and, if possible, a photo of your setup.

i just told you how i connected it. there are two cables coming out of the sensor. one is going to A0 and one is going to 5volts. Now can you think of any way at all that this could be anything but what it is? Wawa seemed to understand it pretty easily and thus was able to help me quite a lot. Thank you very much Wawa. I'm going to take the readings average and pick up the correct resistor whilst im out in town. I'll let you know how i get along.

liamorourke:
i just told you how i connected it. there are two cables coming out of the sensor. one is going to A0 and one is going to 5volts. Now can you think of any way at all that this could be anything but what it is? Wawa seemed to understand it pretty easily and thus was able to help me quite a lot. Thank you very much Wawa. I'm going to take the readings average and pick up the correct resistor whilst im out in town. I'll let you know how i get along.

I didn't reply to the merged thread - I replied to the one that only said "I have tried hooking the sensor up to 5v and A0"
You made no mention of pullup, pulldown or series resistors at the time that I replied. (That all happened in the first copy of the thread, that I hadn't seen.) The communication problem is yours, for double posting, so don't take on an attitude with me.
In future don't double-post. Simple.

It's customary to show a schematic diagram or photo when asking for help on topics like this.

you started with the attitude by commenting on your poor eyesight not being able to see my connections. You say that you only saw my first post which said I had the two cables going to 5v and A0... which still is exactly what it is. my continuation was asking about whether or not I should add a resistor. But I haven't done that yet.

liamorourke:
you started with the attitude by commenting on your poor eyesight not being able to see my connections.

Lighten up. Never heard of humour?

You say that you only saw my first post which said I had the two cables going to 5v and A0... which still is exactly what it is. my continuation was asking about whether or not I should add a resistor. But I haven't done that yet.

Well I just automatically assumed that you must have had an additional pulldown resistor that you hadn't mentioned, since there was no way your setup could possibly work just connected between 5V and an analogue input. (That's just a pullup resistor, regardless of the actual resistance value, of course.)

Asking for a schematic diagram or photo, which you should have provided from the beginning, was a good way to see exactly what was going on. It's extremely common for people to not describe things well in their initial post, which is all I had to go on. I didn't have the benefit of the extra discussion in your other thread when I replied. Mine was the first reply where I was.

It is generally 'safer' to connect the sensor to input and ground, and the resistor between input pin and 5volt.

No 5volt supply on the sensor is no potential accidents/shorts.
A/D values, like the parts, are now also inverted.
Leo..

Sorry. stressful morning :frowning:
I'll post images in future. I'll probably use fritzing as my phone camera is crap. Thanks for trying to help

liamorourke:
Sorry. stressful morning :frowning:
I'll post images in future. I'll probably use fritzing as my phone camera is crap. Thanks for trying to help

No worries.
Generally, you'll find that most of us would much prefer a simple hand-drawn schematic to Fritzing. It can convey much more information. But that's another story. :slight_smile:

Wawa's already pretty well covered things here, for now at least.
I'll be interested to see how this goes. I made a pressure sensor for the gripper of a robot arm using velostat years ago.