Touch Sensor "Raw" value

Discussion specific to the intelligent brick, sensors, motors, and more.
jojoguy14
Posts: 155
Joined: 29 Sep 2010, 12:49
Contact:

Touch Sensor "Raw" value

Post by jojoguy14 »

Hello everyone!

So...the touch sensor has a data plug for the raw value of the touch sensor. I tried using it to create a variable touch sensor (pressure switch), but it only read two numbers. Is there a way to use the raw value to create a "pressure switch"? If not, why is the raw value there???

jojoguy10
Creator of LEGO-X TechN'XT! (http://lego-x.com http://techn-xt.blogspot.com)
Known as jojoguy10
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Touch Sensor "Raw" value

Post by mightor »

All analogue sensors have a raw value, as does the touch switch. It's just that when the touch switch closes, you'll create a short circuit, so the analogue value will be "0". When it is open, it will read "1023". There's no in between though, so it's not like a pressure gauge.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
philoo
Posts: 76
Joined: 29 Sep 2010, 09:04
Location: Paris, France
Contact:

Re: Touch Sensor "Raw" value

Post by philoo »

mightor wrote:All analogue sensors have a raw value, as does the touch switch. It's just that when the touch switch closes, you'll create a short circuit, so the analogue value will be "0"
Well... actually it is not a dead short, there is a 2.2k ohm resistor in series with the switch to protect it. So, since the input has a 10k ohm pull-up resistor, the raw value with closed switch is around 1023*22/122=184
Philo
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Touch Sensor "Raw" value

Post by HaWe »

no "internal resistance" between the contacts, depending on how tight you press it?
Maybe the values are faked by the firmware, and if you want to read the "real raw values" - : what about configuring it as a "general analog sensor"?

edit... philoo was faster :(
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Touch Sensor "Raw" value

Post by mightor »

I stand corrected :)
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: Touch Sensor "Raw" value

Post by h-g-t »

Since it is just a switch with a resistor in line (to limit the current drawn from the port) you are only ever going to get on or off, even if 'on' is not quite a dead short.

I did see a website once where someone had connected a set of switches in parallel into one port, each switch with a different value of resistor. By defining it as one of the analogue sensors he was able to read the various resistances so he knew which switch was pressed.

Saved having to use a separate microchip for multiplexing.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Touch Sensor "Raw" value

Post by mightor »

This is also how the HiTechnic Touch MUX and the Mindsensors Touch MUX work. It's a resistor network in both cases.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Touch Sensor "Raw" value

Post by HaWe »

that blows me away!
Could that mean, if I'm using RCX Touch sensors instead of the NXT ones (having different internal resistors), that the returned values could be distorted? :shock:
(actually i intended to use RCX or 3rd company hardware switches for my robot project) :?
Last edited by HaWe on 25 Feb 2011, 21:33, edited 2 times in total.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Touch Sensor "Raw" value

Post by mightor »

I don't have those but I'd say so :)

A whole new world has just opened up for you, has it?

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Touch Sensor "Raw" value

Post by HaWe »

no: no new world has opend - a world threatens to sink :cry:
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests