Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / rapid switching of analogInputs a la resistive touchscreen on: August 27, 2011, 12:20:32 pm
Hi board

(so many of my posts begin like this):
"I recently hacked a resistive touchscreen"....

The underlying method requires a loop which sets one axis to 5v (digitalWrite, HIGH) and gnd (digitalWrite, LOW), while the other axis is read. The axes are then inverted. this gives me continuous X-Y axis readings and works really well.

I am now attempting to implement a DIY solution, using a similar method: rows of copper fabric strips, a sheet of Velostat, and columns of copper fabric strips. My question is one of feasability: should I expect similar functionality using the same method? I'm hoping to set columns to 5v, rows to read, then invert and set columns to read and rows to 5v and then loop. Would this allow me access to continuous X-Y data? Someone suggested a 'new' method of: fixing rows to gnd/read and cycling through each of the 5v columns one by one (not too sure how to realise this in code), but would the above method work too?

This question was referred to in a different but related post; I'm sure this doesn't infringe double-posting rules.

thanks all

2  Community / Local Groups / Re: Northern Ireland anyone? on: August 19, 2011, 06:45:02 am

if we need an admin/organiser to set up meets etc, I can do that, unless the OP wants that job smiley

I'm trying to assemble an egalitarian forum of local talent (programmers/hackers/n00bs/experts) to skill-share and self-promote...

3  Community / Local Groups / Re: Northern Ireland anyone? on: August 19, 2011, 06:41:28 am
Hi Norn Iron Arduinoids,
County Down-based Arduino/MaxMSP geek here, would love to hear from/meet/share with other Arduinoids. You can see some of my work here (i'm completing a PhD in digital musical instrument design):

4  Using Arduino / General Electronics / Re: turn a DIY touch grid into a touch matrix on: August 19, 2011, 05:29:18 am
Thanks Grumpy_Mike

I'll set this up over the weekend and get back to you with the results,

very helpful forum

5  Using Arduino / General Electronics / Re: turn a DIY touch grid into a touch matrix on: August 18, 2011, 05:25:22 pm
thanks for replying. Maybe cos it's quite late at night, but i'm not sure I understand; I included the top diagram to demonstrate my intial thoughts. The proposed setup in that diagram might be powered thus:

set the bottom layer of columns to read (input);
set the top layer of rows to 5v;
(let voltage settle, c. 5ms);
set the top layer of rows to read;
set the bottom layer of columns to 5v;

and the second diagram is a simplified version of this (using only 2 columns and rows).

Do you mean that I might read continuously from the bottom layer of columns, if I alternate or cycle through the 5v rows?
Sorry, I appreciate you assuming I might not be a n00b, but, derpa derpa, I am. Could you clarify what you mean, perhaps in pseudo-code?

Thanks a million
6  Using Arduino / General Electronics / turn a DIY touch grid into a touch matrix on: August 18, 2011, 07:32:30 am
this question is a little long-winded, so please bear with me....

I recently hacked a cheap resistive touchpanel; the implementation was unsuccessful but I was intrigued by the practicalities of pulsing each axis to get continuous X-Y location data - each axis is rapidly switched between a read function and a 5v function. In the end the noisy data prevented further use.

I am currently working on a 5x3 grid of DIY force sensors, which works well, giving me 15 discrete touch locations and Z-axis force data:

Following an idea by Randy Jones, who successfully implemented a multitouch FSR matrix:

I am considering extending the grid into an 8x8 matrix, which will give me 64 discrete locations, Z-axis force and greater opportunity for interpolation across the entire matrix.

My question is: can I 'hijack' the rapid switching idea from the resistive touchpanel (power the X axis, read the Y, then power the Y axis and read the X?) in my DIY FSR matrix.

There are 2 simple diagrams explaining my concept, here:
(I'm having trouble attaching/uploading picture files here).

My initial concept was for 8 strips of copper fabric (all connected to 5v) laid out in rows, then a layer of velostat, then 8 columns of copper fabric connected to the read inputs via pulldown resistors. It occured to me that I could only get ONE axis reading for this circuit (as depicted in the first diagram above); but would it be possible to get discrete X-Y touch location by rapidly alternating reading and powering to the circuit? I could easily build and code for this, but what I don't know is, how would I interpolate between reading X axis and Y axis to give me one reading (for each of the 4 points in the second diagram above)?

Thanks for bearing with me
7  Using Arduino / General Electronics / Re: 15 sensors in series: 1x5v or 15x5v? on: August 17, 2011, 06:54:10 am
now I understand, my OP was a little misleading (suggesting only one 220R); correct, I am using 15x220R, but my readings changed and I assumed there was a error in my circuit. My other error was assuming that sensor1 would get 5v (being physically closest to the 5v pin) and sensor 15 would get something less than 5v, being furthest away.

8  Using Arduino / General Electronics / Re: 15 sensors in series: 1x5v or 15x5v? on: August 17, 2011, 06:43:29 am
I really need discrete input from each sensor (I'm building an accessible digital musical instrument). A single version of this circuit (ie, 1x220R pulldown) gives me a serial monitor reading of approx 0 - 620, when I start to duplicate and add sensors, the readings for each sensor become c. 300 - 900. My question really is, can I use 15 resistors, a single 5v pin and a common ground (to allow discrete readings from each sensor) and if so what resistor value? Forgive the n00bosity,

many thanks
ps perhaps you might suggest a more robust solution
9  Using Arduino / General Electronics / Re: 15 sensors in series: 1x5v or 15x5v? on: August 17, 2011, 06:26:43 am
Hi, and thanks for the very prompt response.

You suggest the 220R is too low when using multiple FSRs; what value can you suggest?
I only have one 5v output pin (Mega2560) - the reason I suggested 15x5v from the digPins was, if one circuit works, then duplicate it 15 times to ensure success?? Here's a sketch of my current circuit:
10  Using Arduino / General Electronics / 15 sensors in series: 1x5v or 15x5v? on: August 17, 2011, 04:49:19 am

I have built 15 DIY force sensors: copper fabric/velostat/copper fabric sandwich, one side to 5v, the other to pin via pulldown 220R. If I connect them all in series, ie 15 x 220R (common ground) running off a single 5v pin, should I expect the same response off each sensor? Or will the current vary (reduce) from sensor 1 to sensor 15. Should I use 15 digital pins (OUTPUT, HIGH) to power each sensor with its own 5v?

11  Using Arduino / Programming Questions / [sharing] my PhD blog (coding/hacking/patching) on: June 19, 2011, 01:22:23 pm
This may well be the wrong sub-forum; but I wish to maximize exposure and this appears to be the most popular venue, so......

My new blog covers all aspects of my journey through sensor-hacking, coding/patching and interaction design, focusing exclusively on Arduino and MaxMSP. Please feel free to visit and comment, ridicule, disagree etc.

Best wishes
12  Using Arduino / Programming Questions / Re: circular or dynamic array on: June 16, 2011, 03:19:01 am

thanks for this; my code with your solution is below. I just had my "Doh!!" moment.........the pot I'm using is logarithmic, hence the unexpected high delta values.


int newSample = 0;         //voltage reading
int oldSample = 0;
int sampleRate = 200;

void setup(){

void loop(){
  int delta = newSample-oldSample;

13  Using Arduino / Programming Questions / circular or dynamic array on: June 15, 2011, 02:45:27 pm
I am trying to determine the delta, or degree of change, from a simple changing analog voltage (I'm currently using a 500k pot for testing; 0-1023). Following some guidance I implemented this code:

int hist[10];
int inVal;
int delta;

//initialize the array, then

void loop(){

 for(int i=0; i<10; i++){

delta = hist[9]-hist[5];

I have a fair idea of what this is doing, but as it isn't functioning as expected, could someone review it to identify any flaws or improvements please?
what currently happens is that when the pot isn't moved I get zero, when the pot is moved slowly I get low delta; when moved quickly I get high values BUT the delta value is relative to the pot value itself, so in the low pot range, low delta is low - when the pot is in the high range, low delta is actually high!


14  Using Arduino / Programming Questions / Re: average or median for noisy data on: March 06, 2011, 08:27:34 am
thanks Paul, most helpful

15  Using Arduino / Programming Questions / average or median for noisy data on: March 06, 2011, 06:06:38 am
Hallo board
I have a simple coding question, but first here's my hardware set up -

I have hacked a 4-wire resistive touch panel, as follows:
panel pins 1-4 = X+, Y+, X-, Y-;
X+ =(5V or read) X- =(gnd or open);
Y+ =(5v or read) Y- =(gnd or open);
the read lines are pulled down to ground

The circuit has been optimized for clean voltages, and the data is also fairly clean when using a stylus or pen etc. When using a fingertip, however, the voltages ramp up to the XY location, representing fingertip flesh expansion and contraction during contact and release; such jitter is not present when using a stylus etc.

Here's my code:
connect as A0=X1, A1=Y1, A2=X2, A3=Y2;
A0 and A1 alternate readings, so 1kR pulldown to gnd on these;
'open circuit' floating values cured via digitalWrite to 0v on
A2 and A3
int xVal = 0;
int yVal = 0;

void setup()

void loop()
pinMode(A0, OUTPUT); //analog 0 = gnd;
pinMode(A2, OUTPUT); //analog 2 = +5v;
pinMode(A1, INPUT); //analog 1 = signalRead;
pinMode(A3, INPUT); //switch3

digitalWrite(A0, LOW); //gnd
digitalWrite(A2, HIGH); //+5v

delay(5); //let voltage settle
xVal = analogRead(A1); //read pin 1
xVal/=4;                //0-1024 = 0-128
digitalWrite(A2, LOW);  //back to gnd

//switch pinModes to read other axis
pinMode(A3, OUTPUT); //analog 3 = +5v
pinMode(A1, OUTPUT); //analog 1 = gnd
pinMode(A2, INPUT); //switch2
pinMode(A0, INPUT); //analog 0 = signalRead

digitalWrite(A1, LOW); //gnd
digitalWrite(A3, HIGH); //+5v
yVal = analogRead(A0);
digitalWrite(A3, LOW);  //back to gnd

//Serial.print("X= ");
//Serial.print("\t\tY= ");
Serial.print(255, BYTE);
delay (40);

Can someone suggest a simple array or forLoop to average several readings, inside each "axis-cycle", before sending them out?

Pages: [1] 2