dIMU sensor defect?

Hello, my Son asked me to build a cool robot, so I tried to use a dIMU-Sensor for a self-balancing Segway-Bot. I used the RobotC- Code from Laurens Valk, but I couldn’t get the robot to work: Most times i got the error-message “dIMU connected?” although the Sensor-LED was on. In only one trial the robot did the job to find its balance. With my own NXT-program i could read the sensor-values from the gyro for short time after connecting it to the NXT-Brick, but then the sensor-signal freezes immediately. Can you give me a hint whats wrong with the sensor, please? Thank you

Hi @nxt_pa,

Can you share with us the code that you are using and also the screenshot of the output that you are getting.Can you also try this code and tell us if it works to find if something is wrong with the sensor.


Hello Shoban,

sorry, but I can only use code in RobotC or NXT-G for the Lego Mindstorms NXT-Brick. My simple approach to this NXT-Segway was using the RobotC- code by Laurens Valk from his tutorial http://robotsquare.com/2012/02/13/tutorial-segway-with-robotc/ .
I did some further testing with simple NXT-G- programs using the gyro and fast-gyro blocks. The main issue is the freezing of the sensor signal after starting the program on the NXT-Brick. Sometimes reconnecting the sensor to the NXT-Brick resets the signal and it reads gyro-values.
Can some damaged components or the gyro-chip itself on the sensor-pcb cause this behavior? If possible, can you show me the circuit diagram, please?

Hey @nxt_pa, hopping in here. Are you using the EV3 or the older NXT brick? This should work fine on the NXT brick; it may not be as reliable on the EV3. One thing you might want to try in testing is putting pauses in between reads; the I2C line can get locked up if it’s read too quickly.

Because the sensor is able to read sometimes, it indicates the sensor is working, and the problem might be in the software.

Also, just to check: are there any other sensors on the same line? Are you using an I2C hub or anything like that?