Page 1 of 2
Some questions about making my own digital sensor
Posted: 14 Dec 2010, 13:40
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?
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 13:49
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
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 14:15
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?
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 14:41
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...
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 16:51
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
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 17:25
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...
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 20:15
by mightor
No, you are not misremembering, it is possible.
- Xander
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 20:40
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
)
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 20:44
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
. 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
.
Re: Some questions about making my own digital sensor
Posted: 14 Dec 2010, 21:01
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.