Project showcase
LIDAR Anywhere

LIDAR Anywhere © CC BY

How can scientists model and predict the formation of sink holes using IoT?

  • 7,127 views
  • 2 comments
  • 9 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)
Dremel 3000

Apps and online services

About this project

Scientific Problem:

How can we model and predict the forming of thermokarst in the Arctic?

A Thermokarst is a kind of sinkhole that results from the melting of ground ice in a region underlain by permafrost. In areas that have a lot of ice, a thermokarst can form when the ice melts, causing the ground settles unevenly. The size and form of the hole depends on the nature and extent of the ice. In general, regional thermokarst activity indicates an overall warming of the climate.

Why should anyone care? Thermokarst indicate climate change, but also are of concern for roads and construction. If a building, road (or oil pipeline) is built on ground with permafrost layers, the melting of the permafrost can cause sink holes and damage infrastructure.

Scientists would like to better understand how the thermokarst has developed, and predict its future state. One way to do this would require data that can be turned into 3D visualizations of the hole. LIDAR is a laser-based measurement technology for creating elevation models from the air; but aerial LIDAR lacks the resolution for an area of ground this small. 

Thanks to Kickstarter and a company called pulsedlight3d.com, we can build an inexpensive hand-held measurement tool to take distance measurements over multiple areas of the thermokarst. The first phase of this project was to evaluate the accuracy of data collection using servo motors in a sweep pattern. It turned out the servos were not accurate enough to allow for the LIDAR data points to be rendered into a good 3D model. However, the next phase is to mount an array of the LidarLite sensors on a drone capable of autopilot navigation. The drone wouldn't even need to fly more than a few feet above the thermokarst, but would just need enough height to scan the hole in a grid pattern. As a side note, a stronger laser diode is needed for scoping purposes. I've already been playing around with a basic laser scope commonly used for firearms and the results in bright daylight are promising.

The LIDAR Anywhere Device

The first version of the handheld LIDAR device was built in small dry box. I used a Dremel to carve out holes for the LIDAR sensor and laser sight to go through. I also installed a toggle button for turning the laser on/off. To make the mountings waterproof, I used Sugru compound. Data is transmitted over wifi to the Blynk mobile app.

Features:

  • LIDAR distance measurement (accuracy about 1 cm) up to 30 m.
  • Laser for targeting
  • Reasonably weatherproof
  • Uses consumer-grade power pack, USB interface (for now)
  • Real-time readings through Blynk UI

For phase II: Drone mounted array and both real-time and stored data options.

For more details on the thermokarst research itself, please visit: polarfield.com

Code

LIDARAnywhere Arduino codeC/C++
This application uses an Arduino and CC3000 shield to measure distance using the LidarLite scanner. The readings are delivered real-time to the mobile prototyping app: Blynk.

Libraries Required: Adafruit_CC3000, BlynkSimpleCC3000, IC2, SPI

* Requires wifi connection for Blynk service
// This application uses an Arduino and CC3000 shield to measure
// distance using the LidarLite scanner. The readings are delivered real-time
// to the mobile prototyping application: Blynk.

// Libraries: Adafruit_CC3000, BlinkSimpleCC3000, IC2, SPI
// ** Requires connection to Blynk service over WiFi **
// Author: Traci Ruthkoski
// Last Modified: 6/6/15

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space

// These are the interrupt and control pins for СС3000
#define ADAFRUIT_CC3000_IRQ   3
#define ADAFRUIT_CC3000_VBAT  5
#define ADAFRUIT_CC3000_CS    10

#include <SPI.h>
#include <Adafruit_CC3000.h>
#include <BlynkSimpleCC3000.h>
#include <I2C.h>

// Global Variables
char LIDARLite_ADDRESS = 0x62; // LIDAR-Lite I2C Address

// state variables
float get_distance = 0;
int smoothing = 10;

// You should get Auth Token in the Blynk App. 
// Go to the Project Settings (nut icon).
char auth[] = "Your Blynk Auth Token goes here";

void setup()
{
 
  Serial.begin(9600); 
  I2c.begin(); // Opens & joins the irc bus as master
  delay(100); // Waits to make sure everything is powered up before sending or receiving data  
  I2c.timeOut(50); // Sets a timeout to ensure no locking up of sketch if I2C communicat
  Blynk.begin(auth, "Your network SSID goes here", "", WLAN_SEC_UNSEC);
   llWriteAndWait(0x00,0x00);
}

// get slider position to determine smoothing
//BLYNK_WRITE(7)
//{
// smoothing = 2;
//}

// button press in app to get distance measurement
BLYNK_WRITE(5)
{
  get_distance = llGetDistance();
// get_distance = llGetDistanceAverage(5);
  // convert from mm to meters
 get_distance = get_distance;
 
 Serial.println("Distance");
 Serial.println(get_distance); 
 
 // show distance value on Blynk app
 Blynk.virtualWrite(6, get_distance);
 //Blynk.virtualWrite(8, gps);
}
 
void loop()
{
    Blynk.run();
 //   if(cc3000) {
  // turn on the wifi LED in app
 // Blynk.virtualWrite(30, millis()/1000); 
//}

}


/* ==========================================================================================================================================
Basic read and write functions for LIDAR-Lite, waits for success message (0 or ACK) before proceeding
=============================================================================================================================================*/

// Write a register and wait until it responds with success
void llWriteAndWait(char myAddress, char myValue){
  uint8_t nackack = 100; // Setup variable to hold ACK/NACK resopnses     
  while (nackack != 0){ // While NACK keep going (i.e. continue polling until sucess message (ACK) is received )
    nackack = I2c.write(LIDARLite_ADDRESS,myAddress, myValue); // Write to LIDAR-Lite Address with Value
    delay(2); // Wait 2 ms to prevent overpolling
  }
}

// Read 1-2 bytes from a register and wait until it responds with sucess
byte llReadAndWait(char myAddress, int numOfBytes, byte arrayToSave[2]){
  uint8_t nackack = 100; // Setup variable to hold ACK/NACK resopnses     
  while (nackack != 0){ // While NACK keep going (i.e. continue polling until sucess message (ACK) is received )
    nackack = I2c.read(LIDARLite_ADDRESS,myAddress, numOfBytes, arrayToSave); // Read 1-2 Bytes from LIDAR-Lite Address and store in array
    delay(2); // Wait 2 ms to prevent overpolling
  }
  return arrayToSave[2]; // Return array for use in other functions
}

/* ==========================================================================================================================================
Get 2-byte distance from sensor and combine into single 16-bit int
=============================================================================================================================================*/

int llGetDistance(){
  llWriteAndWait(0x00,0x04); // Write 0x04 to register 0x00 to start getting distance readings
  byte myArray[2]; // array to store bytes from read function
  llReadAndWait(0x8f,2,myArray); // Read 2 bytes from 0x8f
  int distance = (myArray[0] << 8) + myArray[1];  // Shift high byte [0] 8 to the left and add low byte [1] to create 16-bit int
  return(distance);
}

/* ==========================================================================================================================================
Average readings from velocity and distance
int numberOfReadings - the number of readings you want to average (0-9 are possible, 2-9 are reccomended)
=============================================================================================================================================*/

int llGetDistanceAverage(int numberOfReadings){ 
  if(numberOfReadings < 2){
    numberOfReadings = 2; // If the number of readings to be taken is less than 2, default to 2 readings
  }
  int sum = 0; // Variable to store sum
  for(int i = 0; i < numberOfReadings; i++){ 
      sum = sum + llGetDistance(); // Add up all of the readings
  }
  sum = sum/numberOfReadings; // Divide the total by the number of readings to get the average
  return(sum);
}

Schematics

LIDARAnywhere_v2 Schematic
Uses LidarLite sensor to read distances real-time. Accurate to the cm, up to about 30m. Distance measurements are displayed on the Blynk prototyping application.
Lidaranywhere v2 schem
LidarAnywhere Breadboard Layout
Uses LidarLite sensor to read distances real-time. Accurate to the cm, up to about 30m. Distance measurements are displayed on the Blynk prototyping application.
Lidaranywhere v2 bb

Comments

Similar projects you might like

Arduino Environmental Monitoring

Project showcase by Prajay Basu

  • 14,510 views
  • 1 comment
  • 28 respects

College Faculty DashBoard

Project showcase by Kaustubh Agarwal

  • 4,200 views
  • 4 comments
  • 27 respects

Arduino LIDAR

Project tutorial by abhinav

  • 35,066 views
  • 8 comments
  • 44 respects

Smart Parking

Project showcase by Kaustubh Agarwal

  • 31,612 views
  • 15 comments
  • 46 respects

Make an Autonomous "Follow Me" Cooler

Project tutorial by Hacker Shack

  • 94,557 views
  • 189 comments
  • 362 respects

RF BASED SMART HOME AUTOMATION SYSTEM

by Dennis Mwanza

  • 28,742 views
  • 4 comments
  • 45 respects
Add projectSign up / Login