View unanswered posts | View active topics It is currently Tue Jul 22, 2014 3:33 pm






Reply to topic  [ 9 posts ] 
Wired OR for touch sensors 
Author Message
Rookie

Joined: Tue Oct 06, 2009 4:42 pm
Posts: 17
Post Wired OR for touch sensors
In my opinion, LEGO took a step backwards with the NXT-style cables, in that it is no longer easy to do a 'wired OR' for two or more touch sensors, simply by stacking the bricks that make up the old-style cable ends.

In my current project, I had need to stack 3 touch sensors together in a wired-OR style and have them all talk to the same sensor port on the NXT. I know this can be done using the RXC sensors and an adaptor cable, but I was having trouble getting that to work.

My current solution is to make a wired-OR block out of 4 Mindsensors NXT cable sockets, as shown in the image. I just filed off the projections at the sides of the sockets, glued 4 of them together using fast-set epoxy, and then wired corresponding pins together using a wire wrap tool. Now I can connect 3 sensors together so that if any of them show true, a true value is sent to the NXT brick. The construction of my project, together with software, prevent more than one sensor from being true at any given time, so there is no confusion.

A bit kludgy perhaps, but it works for me.
-Bill


Attachments:
NXT_wired_OR.jpg
NXT_wired_OR.jpg [ 108.81 KiB | Viewed 2800 times ]
Fri Oct 16, 2009 11:09 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Wired OR for touch sensors
hi,
to avoid soldering it's maybe more simple to use the rcx-nxt adaptor cables.
you can use the "rcx-side" as usual and plug together as many nxt- (or rcx-) sensors as you like to.

Image

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Fri Oct 16, 2009 12:35 pm
Profile
Rookie

Joined: Tue Oct 06, 2009 4:42 pm
Posts: 17
Post Re: Wired OR for touch sensors
For some reason, the adaptor cables are not working for me. Simple test: I connected an RCX touch sensor to an adaptor cable, plugged the cable into the NXT, and used the built-in 'View' module to test the touch sensor. There was no response to the sensor being touched.

Tried several sensors, several adaptor cables -- same result.

I wonder if it is possible that I got a bunch of bad cables from LEGO?

In any event, there is no soldering -- just wire wrap.

-Bill


Fri Oct 16, 2009 2:20 pm
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Wired OR for touch sensors
I got 12 of those cables, and I never got trouble using them.
neither using nxt nor fischertechnik touch sensors nor electronic shop switches.

rcx sensors I didn't try (maybe they have a different resistor) but if I understood you correctly you also wanted to use nxt sensors..?
did you try reading raw vaues?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Fri Oct 16, 2009 3:18 pm
Profile
Rookie

Joined: Tue Oct 06, 2009 4:42 pm
Posts: 17
Post Re: Wired OR for touch sensors
No, I originally wanted to use RCX touch sensors. And yes, I did look at the raw values. That is where I nailed down the problem -- the raw values barely move with the RCX sensors, as opposed to the NXT sensors, where the 'on' value is much, much smaller than the 'off' value.

I even made up some of my own cables using Mindsensors connectors and wire, but got exactly the same result. I do know that with the LEGO adaptor cables, the RCX touch sensors get connected to wires 1 and 2 in the cable -- these are the black and white ones.

So that is finally why I gave up on the RCX sensors and am using NXT touch sensors. It is definitely a second-best solution but at least it gets me a bit more along the way.

-Bill


Fri Oct 16, 2009 4:12 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Wired OR for touch sensors
Why not use the HiTechnic Touch MUX sensor? I have one and it would be trivial to make it into an OR configuration.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Oct 16, 2009 4:33 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Wired OR for touch sensors
sry for my bad English.
in the first line I actually wanted to propose to use the rcx adaptor cables for nxt sensors:

Code:
nxt touch sensors at adaptor cables              2x2 connector
                                                plates
                                                  __
nxt touch sensor1 <------------------------------|::|
                                                  __
nxt touch sensor2 <------------------------------|::|
                                                  __
nxt touch sensor3 <------------------------------|::|
                                                  __
nxt touch sensor4 <------------------------------|::|
                                                  __
nxt touch sensor5 <------------------------------|::|
                                                  __
                                                 |::|-----------------------------> NXT BRICK


using rcx sensors instead was just an alternative to this.

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Fri Oct 16, 2009 5:13 pm
Profile
Rookie

Joined: Tue Oct 06, 2009 4:42 pm
Posts: 17
Post Re: Wired OR for touch sensors
Xander, I just found the HiTech mux and ordered one! By coincidence, I had just stumbled across the new product and came back to this forum to mention it -- but I see you are ahead of me as usual :)

-Bill


Sun Oct 18, 2009 8:44 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Wired OR for touch sensors
Bill,

The Touch MUX is also supported by my driver suite, more info here: [LINK]. You could do something like this:
Code:
if (HTTMUXgetActive(S1) > 0) {
  // one of the buttons has been pressed
  // do something
}


Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Oct 18, 2009 9:48 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.