Some questions about making my own digital sensor

Discussion specific to the intelligent brick, sensors, motors, and more.
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Some questions about making my own digital sensor

Post by aswin0 »

Hi,

I found this digital sensor at Sparkfun that combines a three axis gyro and a three axis accelerometer. I would like to use this sensor with my NXT but do lack any experience with sensor building. I got some beginner questions.

- The sensor needs 3.3V (3.6Max), the NXT sensor port supplies 4.3V. This is too much so I need to get the voltage down. I read about voltage regulators, but they need about 1.5V overhead, giving 4.8V as minimum for input. This is more than the NXT supplies. So how do I provide the sensor with some clean voltage?
- The sensor implements high speed I2C, 400 kb/s. Will it run on the NXT that only has 9600 b/s?
- Provided I have some suitable power for the NXT, can I just connect the digital pins of the NXT with those of the sensor, or do I need some extra components between the two?
My blog: nxttime.wordpress.com
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Some questions about making my own digital sensor

Post by mightor »

aswin0 wrote:- The sensor needs 3.3V (3.6Max), the NXT sensor port supplies 4.3V. This is too much so I need to get the voltage down. I read about voltage regulators, but they need about 1.5V overhead, giving 4.8V as minimum for input. This is more than the NXT supplies. So how do I provide the sensor with some clean voltage?
You can use an LDO (Low Drop Out) regulator that will only require around 0.6V overhead. I used the LM3940 in a previous project.
- The sensor implements high speed I2C, 400 kb/s. Will it run on the NXT that only has 9600 b/s?
That should be fine :) If you are using ROBOTC, your I2C clock speed will be about 30KHz instead of 9600.
- Provided I have some suitable power for the NXT, can I just connect the digital pins of the NXT with those of the sensor, or do I need some extra components between the two?
Get one of these: http://www.sparkfun.com/products/8745 :) They're logic level shifters and work very nicely.

- 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)
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: Some questions about making my own digital sensor

Post by aswin0 »

Xander,

Tanks.
mightor wrote:
- Provided I have some suitable power for the NXT, can I just connect the digital pins of the NXT with those of the sensor, or do I need some extra components between the two?
Get one of these: http://www.sparkfun.com/products/8745 :) They're logic level shifters and work very nicely.
Do you mean to say that the NXT uses 5V for I2C and the sensor 3.3V?
My blog: nxttime.wordpress.com
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Re: Some questions about making my own digital sensor

Post by gloomyandy »

Will the level shifter also "hide" the pull ups on that board? If not they may give some problems as they have a much lower resistance then the values recommended by Lego...
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Some questions about making my own digital sensor

Post by mightor »

You put normal pull-ups (10k) on the 3V3 side and 82K on the NXT side. At least I think that's how I did it. Otherwise leave the ones on the 3V3 side and see how that works. I've used those logic level shifters before but it's been a long time and I didn't make drawings or photos.

- 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)
nxtreme
Posts: 246
Joined: 29 Sep 2010, 03:53
Location: 192.168.1.2

Re: Some questions about making my own digital sensor

Post by nxtreme »

Don't the data lines run at 3.3V logic? Or am I mistaken? I do remember that somebody on the NXTasy forums said that when interfacing with 3.3V sensors you could just substitute a 47K pullup for the 82K and connect the data lines directly. Maybe I'm mis-remembering something...
One King to rule them all, One King to find them,
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Some questions about making my own digital sensor

Post by mightor »

No, you are not misremembering, it is possible.

- 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)
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: Some questions about making my own digital sensor

Post by aswin0 »

nxtreme wrote:Don't the data lines run at 3.3V logic? Or am I mistaken? I do remember that somebody on the NXTasy forums said that when interfacing with 3.3V sensors you could just substitute a 47K pullup for the 82K and connect the data lines directly. Maybe I'm mis-remembering something...
I looked in the hardware schematic and found the part that deals with the data lines. See the image below, don't forget to scroll down. Does this mean they run at 3.3V? (The fact that I can read a schematic does not mean I can understand it :( )

digipin.jpg
(35.43 KiB) Downloaded 143 times
My blog: nxttime.wordpress.com
nxtreme
Posts: 246
Joined: 29 Sep 2010, 03:53
Location: 192.168.1.2

Re: Some questions about making my own digital sensor

Post by nxtreme »

So really, aswin wouldn't really need the logic level shifters, right? I like to keep designs as simple as possible, maybe its showing now :P. Sparkfun also just released a new 9DOF "sensor stick". It's quite expensive but I'm thinking it'd be rather fun to plop it on a NXT and take to an amusement park.

-EDIT- You can also click on the picture to make it expand to it's full dimensions... and thanks for the picture, aswin! I have looked at the HDK before but it always seems to vanish when I do hard drive spring cleaning. Note to self: download HDK again :).
One King to rule them all, One King to find them,
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: Some questions about making my own digital sensor

Post by aswin0 »

OK. Lets go back to the overall design.
I need the sensor, and some circuit that provides 3.3V. That's all, right?
To get 3.3V I need a LDO voltage regulator and 2 capacitors (i.e. LD-1117 + 100nF + 10muF). That's all, right?
What about pull ups, do I need those?
nxtreme wrote:Sparkfun also just released a new 9DOF "sensor stick". It's quite expensive but I'm thinking it'd be rather fun to plop it on a NXT and take to an amusement park.
I've been looking at that one as well. It has a 3D compass, 3D gyro and 3D accelerometer. But it is rather big. That is why I choose the IMU, this lacks the compass but has the same gyro and accelerometer. I hope to fit it in an sound sensor housing.
My blog: nxttime.wordpress.com
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests