Skip to content

particle-iot/blueprint-tracker-energy-monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blueprint-tracker-energy-monitoring

This tutorial shows how to measure AC current using the Tracker One and a few external components.

Hardware

This Solutions Accelerator uses:

The current sensor boards converts the output of the sensor probe into an analog output. That output is connected to pin 3 of the M8 connector, which is analog input A3 for the Tracker One.

The other two pins are power and ground, which are connected to the DC/DC converter. The DC/DC is necessary since the output power of the Tracker One is 5V, and the input pins for sensing are 3.3V.

Software

The code to translate the analog input into current is found in main.cpp.

First, a callback is defined that is called when the Tracker One will publish a location point. This callback reads the value and uses the formula from the manufacturer (https://wiki.dfrobot.com/Gravity_Analog_AC_Current_Sensor__SKU_SEN0211_#target_3) to arrive at the current. It then inserts it into the location point JSON.

void loc_gen_cb(JSONWriter &writer, LocationPoint &point, const void *context)
{
    writer.name("current").value(readACCurrentValue());
}

The callback is registered with the Tracker Edge software in setup():

 Tracker::instance().location.regLocGenCallback(loc_gen_cb);

Once running, the Tracker One will publish the current measured and it will be associated with the location of the device. The current will be displayed on the Particle console map for each Tracker device running this firmware.

Getting the Tracker Edge firmware

A complete project based on Tracker Edge v19 is available in the firmware directory in this repository.

About

Measuring energy consumption using the Tracker One

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •