Close
0%
0%

Tracking without GPS

A different approach to tracking animals using Raspberry Pi 3, Texas Instruments Sensor Tag cc2650

Similar projects worth following
An inertial navigation system that uses the Raspberry Pi computer. motion sensors (accelerometers) and rotation sensors (gyroscopes) to continuously calculate the position, orientation, and of a moving object without the need for external references.
  • 1 × Raspberry Pi 3
  • 1 × Texas Sensor Tag CC2650
  • 1 × Raspberry Pi B
  • 1 × MEMS Sensor Board

  • When a Step has been Taken

    Brenda Armour11/10/2016 at 23:48 0 comments

    I know I have missed so many deadlines but this project still intrigues me so I will continue. Blue Mix gave me grief all last weekend up until today. I received errors that the route could not be found or the endpoint could not be reached. I had rebuilt my Node Red on Saturday but then received the same errors on Sunday. So I restaged the application after going through the logs that the app had run out of memory. Bluemix is not for the faint of heart. Rebuilding the app did have its advantages and did provide an opportunity to simplify the model. I included a High Pass Filter to compare to the Dynamic Threshold. I added an indicator to light up if the Filtered data is < Dynamic Threshold i.e. a step has been taken. But this short video does not include a time frame to exclude steps outside of the time frame.

    Red Node Model Revised:

  • Moving forward on Calculating Distance

    Brenda Armour10/21/2016 at 12:13 0 comments

    Measuring distance is a important component of this project. I am finding graphing the data in Freeboard is an excellent check to see if my calculations make sense. I have calculated the dynamic threshold and now will compare the second data to the first. I have used a node that delays the second flow by 1 second. Abit tricky but here is the initial graph. What I want is to determine if :

    A step is defined as happening if there is a negative slope

    of the acceleration plot (Flow2 < Flow1 ) when the

    acceleration curve crosses below the dynamic threshold. I split the flow threshold into two flows. On Flow 2 I added a delay function to compare the first data to the second data coming in.

    var delay=1000; //1 second
    setTimeout(function() {  //your code to be executed after 1 second}, delay);
    return msg;

    As you can see in the video there is vibration going on even when the sensor tag is on my desk. A time window will next be added to discard invalid steps. At one point I move the tag around. The interval between two valid steps will be between .2 seconds and 2.0 seconds. Anything outside that time window will be ignored.

  • Understanding Motion Data

    Brenda Armour10/16/2016 at 12:29 0 comments

    I am using Node Red and IBM BlueMix to send the sensor tag data to the cloud. I am using the accelerometer and magnetometer on the sensor tag to determine next position of a moving object. The Raspberry Pi 3 with built in Blue Tooth and WiFi is the gateway to the cloud. I have installed iot-sensor-tag to connect the Raspberry Pi 3 to Bluemix. More info can be found here.

    Lets look at the raw data from the sensor tag. I am shaking the sensor tag in this demo.

    I started experimenting with sensor data in 2014. The first board I used was the MEMS sensors evaluation board from Element 14. The board had a low-power 3D Magnetometer and a 3-Axis Digital Accelerometer. The video shows the board on a Raspberry Pi B. The kit also allows you with a website to move the board and visualize the accelerometer moving a car and a compass using the data from the magnetometer.

    So the evaluation board was a great starting point. IBM Bluemix cloud/ Node Red and the Sensor Tag provided a way to mathematically calculate distance, bearing and velocity using the accelerometer and magnetometer. The sensor tag uses a coin cell battery that can last up to a year. All 10 sensors are enclosed in a small case. It is Bluetooth enabled and you can also use Zigbee protocol to increase distance. At this point I will be using Bluetooth.

    Node Red already comes installed on the Raspberry Pi. I am using the cloud version because it was easier to program. I am also using Freeboard as a dashboard and Dweet.io to collect the data. I added some nodes to accomplish calculations for the algorithm. Smooth node info can be found here.

    So can you calculate distance using an accelerometer ? This is essential to calculate position of a moving object. I am going to be using a pedometer design based on the 3 axis of the accelerometer data. Here is my node red design ( work in progress ) . The goal is to recognize and count steps. This will allow me to measure distance and speed. It appears I have two different flows but I am using Global Variables in my equations. I highly recommend this article on writing functions in Node Red.

    A simplified view of the model :

    At every 10 samples the maximum and minimum of the accerometer axis is taken. The dynamic threshold is calculated with (Max + Min)/2 . A placeholder holds the first sample and then compares it to the next sample. A step has been taken if the new sample < previous sample. . More to come !

  • Using Accelerometer and Magnetometer Data to Calculate Position

    Brenda Armour10/13/2016 at 00:08 1 comment

    As you can see this is a Work In Progress. I will publish more detail as to how I reached this point. I have included Outside Weather Conditions in this model.

View all 4 project logs

  • 1
    Step 1

    Sending Sensor Data to IBM Bluemix

    I used this excellent video by Ryan Baxter exclusively to achieve the deployment of sensor motion data to Bluemix The video was made in Nov 12, 2014 and Bluemix has changed. His video can be found here: . He was using a Beaglebone Black as a gateway and I am using a Raspberry Pi B. I had to make some modification to his code to accommodate the changes to Bluemix which I have documented. The screenshots in the video have changed so if you do follow the video than you may have to improvise to get where you need to be. Basically all you are doing is connecting a device and than creating a service. Then you can create a APP. You also need to sign up for a free trial from IBM. If I missed a step please let me know

    At your terminal (I'm using Putty) use Git command to clone the repository . Found here - https://github.com/IBM-Bluemix/iot-sensor-tag.

    git clone https://github.com/IBM-Bluemix/iot-sensor-tag
    

    Move to the publish directory and execute the command npm install – You may see some warnings but as long as they are not errors it should be okay.

    Now lets set up our Raspberry Pi in Bluemix ;

    Console for IBM. Click on Catalog.

    Select Internet of Things on the left. Now select Internet of Things

    Under Connect you device – click on Launch dashboard

    Select Create Device Type

    Select Create device type:

    Name your Device. Add the MAC address for the Pi. The MAC address can be found using ifconfig. All other fields are not mandatory

    Generate you credentials . This is where I had to modify the code. During the setup you have to create a config.properties to store you credentials generated by Bluemix. This screen shot shows what I copied from Bluemix to Notepad. I changed the field names to match his code. My credentials have changed so I'm not concerned about showing them. The device.cfg shows one set of credentials modified to work in the program. If you view his video the syntax has changed to the example in Notepad. Use sudo nano within the publish directory to copy your credentials to that was generated by Bluemix.




    Now we can start the program from the publish directory.

    Node sensor-tag.js

    Make sure your sensor tag is connected and you should see this in Putty.

    Lets go back to Bluemix. Connected to fox tracker

    Sensor data coming in !


    I have created an app for the Fox Tracker .


    Click on view App. I also imported a node red flow from the git repository.

  • 2
    Step 2

    Setting up Node Red Palette

    I have the latest version now of Node Red (v 15.2) There are 225,000 modules available in their library which can be found here. For this project I am sending the accelerometer and magnometer data to Bluemix. I am using Dweetio to build data sources for the dashboard. Dweetio is simple to use and info can be found here. The dashboard is Freeboard. All these tools are free to use and very cool if you are building an application for the Internet of Things.

    Red Node Pallet:

    Dashboard:

View all instructions

Enjoy this project?

Share

Discussions

Brenda Armour wrote 10/16/2016 at 17:46 point

Sorry for being late to reply. My second log shows more detail to provide a step counter to calculate  if a step has been taken. More to come.

  Are you sure? yes | no

F0cks wrote 10/13/2016 at 17:14 point
Hey!
I suppose that you integrate acceleration to get speed and then, distance. I am  curious to know how you correct intrinsic errors due to accelerometer design, errors when you integrate constant speed at the beginning etc...Good luck for your project!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates