View unanswered posts | View active topics It is currently Tue Sep 16, 2014 5:53 pm






Reply to topic  [ 6 posts ] 
Sensor Multiplexer (SMUX) 
Author Message
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post Sensor Multiplexer (SMUX)
Hello,
I am trying to use a HiTechnic SMUX to collect data from 4 sensors ( Vernier and other kinds). I would read the value from each sensor , and then save it in the datalog. I am having difficulties understanding how the multiplexer works. I have read the programming guide PDF by Xander Soldaat. Your help is appreciated! Thank you.


Wed Feb 20, 2013 11:36 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: Sensor Multiplexer (SMUX)
You should check out some of the examples for the light sensor (lego-light-SMUX-test1.c and 2). I don't support the Vernier sensors. The reasons being that they seemed to be unwilling to help me with some hardware when I approached them about it. This is what their CEO had to say to me:
Quote:
So here is where I stand on this. I think it might be nice if we had
support for our sensors in ROBOTC, but I am way too busy to do any
work on this.
<snip snip>
In short, if you want to add support for our sensors to ROBOTC , feel
free to. I might mention it on our web site, or maybe in a newsletter,
but I cannot put much work or expense into it. As I said in my last
email, I am not sure it is worth the effort. There is already pretty
good support in LabVIEW, MINDSTORMS, and RoboLAB.

The Vernier is analogue, so your best bet would be to see how the lego-light driver does its thing :)

= 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]


Wed Feb 20, 2013 11:56 am
Profile WWW
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post Re: Sensor Multiplexer (SMUX)
So in the code , is it reading the raw value from the sensor?Thank you.


Wed Feb 20, 2013 2:35 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: Sensor Multiplexer (SMUX)
Well, sort of. The SMUX polls the sensor and then makes that data available to the NXT. You may find that you have to do a bit of calibration as the analogue value read by the SMUX is based on 3V3 and not the 4V3 that the NXT uses. In most cases this not an issue, but with the Vernier it might be.

= 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]


Wed Feb 20, 2013 3:20 pm
Profile WWW
Rookie

Joined: Sun Sep 25, 2011 1:52 pm
Posts: 16
Post Re: Sensor Multiplexer (SMUX)
Is it going to be a simple linear calibration? If I have two solutions of known values,and I take two measurements with the sensor , then I do the calibration , is that going to be enough?
Also, if I am trying to read the values from 2 sensors, would it be as simple as :
const tMUXSensor LEGOLS= msensor_S1_1;
const tMUXSensor LEGOLS1= msensor_S1_2;
raw=LSvalRaw(LEGOLS);
nxtDisplayTextLine(0,"Sensor 1: %4d",raw);
wait1Msec(1000);
raw=LSvalRaw(LEGOLS1);
nxtDisplayTextLine(0,"Sensor 1: %4d",raw);
Thank you!


Wed Feb 20, 2013 3:37 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: Sensor Multiplexer (SMUX)
That looks about right :) As for linear or not, that's something you'll have to find out experimentally. As I said before, I have no experience with Vernier, so I have no idea how they perform with 3V3.

= 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]


Wed Feb 20, 2013 4:31 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.