GIGA R1 Sonar Range Finder Library (NewPing)

Well...Dang it... I have a project that I build a while ago using a Mega, ethernet shield, and an Ultrasonic Sensor. It implements a WDT as well in case connectivity is lost for some reason. And it uses an LCD shield to display various bits of information.

Unfortunately, now that I'm getting around to actually using the set up I find that I can't get it connected to Ethernet as the shed the device will be put in is not currently wired for ethernet connectivity. So, simple, right, just get a Giga R1, which is a Mega with WiFi! Ordered one today, and it's already shipped. So I figured I'd recompile the sketch for the Gigi R1 board and change the Ethernet connections to WiFi.

Man am I disappointed... So far I've had to make the WiFi changes, and now changes to the Watch Dog Timers (as the Giga used a different core), and the EEPROM memory code (as the Giga doesn't use standard EE code), and now I find the NewPing library for the sensor may or may not support the ultrasonic sensor!

I don't have the board yet so can anyone let me know if the NewPing code works properly on a Giga R1? The compiler throws a warning. If NewPing doesn't work, can anyone recommend a library for ultrasonic sensor that will work on the Giga? At this point it may be simpler to trench a line so I can run ethernet...or slap an ESP8266 module onto the existing Mega based board.

Really wish I'd done more research, and/or it was made more clear that the Mega and Giga are completely different animals...

Hi @MadMacks.

Yes, it does work properly.

However, there is a very important thing you should be aware of: the common ultrasonic range finder modules like the HC-SR04 use 5 V logic levels, while the GIGA R1 WiFi's I/O pins use 3.3 V logic levels and are not rated to withstand 5 V. So if you connect one of these sensors directly to the pins of the GIGA R1 WiFi, you may do permanent physical damage to the board's microcontroller. The way to use such 5 V devices with 3.3 V boards like the GIGA R1 WiFi is to connect the device to the GIGA R1 WiFi via a level shifter, which converts the 5 V to 3.3 V and vice versa. You can get convenient level shifter modules from all the usual sources of electronics components.

You can safely ignore that warning.