ROBOTC.net forums
http://www.robotc.net/forums/

Sensor Multiplexer (SMUX)
http://www.robotc.net/forums/viewtopic.php?f=41&t=5524
Page 1 of 1

Author:  theboss4545 [ Wed Feb 20, 2013 11:36 am ]
Post subject:  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.

Author:  mightor [ Wed Feb 20, 2013 11:56 am ]
Post subject:  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

Author:  theboss4545 [ Wed Feb 20, 2013 2:35 pm ]
Post subject:  Re: Sensor Multiplexer (SMUX)

So in the code , is it reading the raw value from the sensor?Thank you.

Author:  mightor [ Wed Feb 20, 2013 3:20 pm ]
Post subject:  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

Author:  theboss4545 [ Wed Feb 20, 2013 3:37 pm ]
Post subject:  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!

Author:  mightor [ Wed Feb 20, 2013 4:31 pm ]
Post subject:  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

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/