Trouble with NXT Ultrasonic sensor


#1

Hi-
Am having trouble getting the NXT ultrasonic sensor to hook up properly to the Bricktronics shield+Arduino.

My setup:

Standard bricktronics Arduino shield
Arduino Uno
Off-the-shelf NXT ultrasonic sensor hooked up to port 4 with pins 1+2 and 4+5 connected.

My symptoms:

I’ve had plenty of good performance with the motors hooked into the platform as above.
once I hook up the NXT ultrasonic sensor, the Arduino dies. Power light goes off and it’s totally non-responsive.
Once I unplug the sensor, the whole system comes back online.

Could really use some help. This is a project for my sons birthday and am pushing to get the prototype wrapped up soon.

Has anyone had any luck with the ultrasonic sensors?

Best wishes,

Kevin


#2

I now see that using just USB-grade power won’t work and so I made sure to try both the wall-adapter (9V) and alternately the battery pack.

In all these cases (as in the USB-supplied power) the system is fine and up and running until I plug in the NXT Ultrasonic sensor. At that point, the whole system appears to lose power and the Arduino power lights go dark. As soon as I unplug the NXT Ultrasonic sensor, the Arduinio+Bricktronics-shield comes back up online.

I made sure to recheck the jumpers (which connect pins 1&2 plus pins 4&5).

I will try a different sensor (same type and model) but I’m doubtful that’ll have any effect.

Does anyone have any ideas for me?

Could really use some advice from someone who has successfully gotten the Bricktronics shield to work with two motors and the Ultrasonic sensor.

best wishes,

Kevin


#3

Hi Kevin,

Adam from Wayne and Layne here. At a recent summer camp, we made a rover with two motors and an ultrasonic to follow a person walking.

Have you tried just getting the ultrasonic sensor to work on its own, without the motors? That’d be a good differential test to try.


#4

Wayne-
Thanks for chiming in! :smile:

Yes, I’ve unplugged the motors and just tried to get the Ultrasonic sensor working. The same symptoms: when I plug it into sensor-port #4, the whole board goes down…as if it has been powered down.

I am tempted to experiment with either the jumper settings (1&2 + 4&5) or change the I2C select setting. I am running Arduino Uno, so it should be Rev3…but that’s not working.

Will also try a Mega (with the Bricktronics Megashield) and see if I get the same symptoms there.

Summarizing: so far, everytime i’ve tried to plug in the Ultrasonic sensor, the board goes dark.

Appreciative of your support,

Kevin


#5

Hi Kevin,

Not all Uno boards are Rev3, so double check that. You can always set the switch to “Analog” for an UNO and it will work. The switch was mostly added to try and support non-Uno boards like the Leonardo, which don’t have I2C pins on A4 and A5. When testing just the ultrasonic sensor, this switch’s setting shouldn’t matter at all, however (explained below).

Having the whole board go down when you plug in the sensor is rather worrying, sounds like a short between power supply pins or something like that. Have you tried sensor port 3?

The jumpers (1&2 + 4&5) setting are working for me, and I wouldn’t change them to any other setting for the Ultrasonic sensor.

I just tried the example Ultrasonic sketch included in the Bricktronics library, and it worked fine with my Duemilanove on both port 3 and 4. This board is not rev3-compatible, and when I switched to “rev3” the ultrasonic sensor still worked fine. This is because the I2C pins and selector switch are only used for the I2C I/O expander chip (the largest chip on the shield) which is only used for sensor ports 1 and 2 and the the motors).

What version of the bricktronics shield do you have? It should be written in white letters above the largest chip. Did you purchase it pre-assembled or as a DIY soldering kit?

Thanks,
Matthew


#6

Matt-
I have the v1.05 version of the board. I asked you guys to ship me a bunch of these assembled boards and they all look fine.

I’ve tried ports 3 and 4 on both Uno and Duemilanove and its the same symptoms: without the Ultrasonic sensor plugged in, the board and shield work fine, but as soon as I plug in the sensor into port 3 or 4; the whole thing goes lights out. When I unplug it, it all comes back online fine.

I tried two different Ultrasonic sensors as well. No luck.

I had limited success using the Arduino mega 2560 plus the Bricktronics mega-shield. On that combination, plugging it all in does not bring the board down. The code compiles and loads onto the system fine, but the readings on range are zero over and over. The Ultrasonic sensor does flash red around its little “eyes” though and the board is clearly up and running in this case.

With Uno and Duemilanove, it all just goes dark.

Shoot. Just can’t figure out what I am doing wrong…

Thanks,
Kevin


#7

Ah, I think I know what’s going on. Are you using the EV3 ultrasonic sensor? LEGO apparently changed the sensor protocol again when it released the EV3 kit, and we haven’t gotten it working yet on the Bricktronics Shield. The EV3 motors will work just fine, but we don’t officially support any of the EV3 sensors (the pushbutton sensors should still work, but we aren’t sure about the rest). The NXT 2.0 Ultrasonic sensor works great (which is what I have been testing with) so if you have access to those, you should be good to go. Sorry about the confusion!


#8

That is very helpful. I am definitely using the v3 sensors.

Will try to acquire some v2 sensors, see how that works; and report back to the forum.

Thank you very much for your help.

Kevin


#9

Sorry its taken me so long to get back to this group, but the v3 sensor WAS the problem and the v2 sensors worked just fine.

Very much appreciate the help from you all! The robot project turned out FANTASTIC and each of my boy’s friends that came to the party walked home with a fully functional autonomous lego robot. It’s was based on the Castor bot, but I made room for a BrickTronics shield, Uno, and a v2 sensor on top. Kinda looked like the famous Wall-E robot once it was done.

Thanks again! Many happy kids left the party that day. :slight_smile:

Kevin


#10

Excellent, thanks for the update Kevin. I’m glad the V2 sensors worked well, that sounds like a most excellent robot party!

We’re actually adding support for more NXT sensors soon, and I think I’m going to make a visual compatibility grid showing which motors and sensors are usable with which Bricktronics hardware, and how to connect them.