We'll interface Garmin LIDAR Lite with esp32-pico-kit. esp32-pico-kit interfaces the LIDAR using I2C. We'll make use of the wireless connectivity. First we'll transmit the data through Bluetooth. And we'll the esp32-pico a webserver that'll display the data through WiFi.
The LIDAR runs on 5V, but itself I2C signal is 3.3V, which matches esp32.
We'll use Garmin's LIDARLite_Arduino_Library . First, we'll try out the library example GetDistanceI2C. It compiles and is uploaded without a problem. After hooking up the I2C and 5V, the serial monitor spits out numbers. For this, the Arduino serial plotter is a great tool to view the output.
Next we'll try to run esp32-pico-kit as a Bluetooth serial device. We run the SerialToSerialBT example without a problem. We have two way communications with a Bluetooth serial app on a smart phone.
Then we'll try an example of setting up a WiFi access point. That also goes without a problem.
Now we have tested the major pieces and are ready to put them together. We'll start with the LIDAR and BT serial. That uses 72% of Flash and 12% RAM. It works nicely .
We'll create a webserver to display the range data next. We set the web page to auto refresh every second. It uses 51% of Flash and 11% RAM. It works just fine. A lot of features can be added, such as displaying a live graph and changing registers etc.
The ease of create a working IoT system with arduino is quite amazing.
No comments:
Post a Comment