Particle Photon Battery Test with 4-20 mA I2C sensor publishing to google sheets

Here is my battery test from last night. I wanted to see how long the 2000 MAH battery would last with all of my stuff connecting and publishing to google sheets once every min. I was able to get 15.5 hours of life out of the setup with 868 entries into google sheets.

Particle Photon with the following

Particle power shield: https://www.amazon.com/Particle-PWRSHLD-Contains-Charging-Portable/dp/B06XJ64G8G/ref=sr_1_3?ie=UTF8&qid=1525448889&sr=8-3&keywords=particle+photon

2000 mAH 3.7v battery

NCD I2C 1-Channel 4-20mA current loop receiver: https://store.ncd.io/product/1-channel-4-20-ma-current-loop-receiver-16-bit-ads1115-i2c-mini-module/

NCD I2C Shield for Particle Electron or Particle Photon: https://store.ncd.io/product/i2c-shield-for-particle-electron-or-particle-photon-with-outward-facing-5v-i2c-port/

Connected to a flow meter sending a 4-20 ma output to the I2C. Publishing the reading once every minute to google sheets via webhook.

I wanted to thank @ScruffR and @rickkas7 for the help and support with my newbie questions. Also @gusgonnet for writing such an informative tutorial on how to use webhooks with google sheets. I would never have gotten this far without the community and support. Thank you all again.

4 Likes

First of all great work! I would like to build something similar to monitor the fluid level of a storage tank; and it won’t be portable. I will use a sensor that also uses a 4-20 mA signal. Can you possibly provide more information on your build? Connections, code, and signal translation? This will be my second Photon project but I am still amateur… Thanks!

Howdy @badkyle,

Sorry for the delay I was traveling. I use the National Control Devices, 4-20ma board found here. https://store.ncd.io/product/1-channel-4-20-ma-current-loop-receiver-16-bit-ads1115-i2c-mini-module/
This lets me get the 4-20 ma signal over to the particle with the ADS1115 chip built into their board. If you want you can also get this photon I2C adapter board if you don’t want to wire the output of the 4-20 board directly to the pins on the electron. https://store.ncd.io/product/feather-battery-i2c-shield-for-particle-and-feather-modules/

I used both boards before I moved to the electron and started building my own boards. They are also both in that picture, along with the power shield but that’s another story.

Here is the link for the ADS1115 code on GitHub used on either the electron or the photon. https://github.com/ControlEverythingCommunity/ADS1115
I do not think its ported so just copy and paste the code into your project. Once your record your ADC value you can map it accordingly to your sensor. You need record at a zero level, write that ADC number down, then trick your sensor to measure max value, write that ADC number down, then map the range. I am sure there is a very technical way to do this but I just trick my sensor to read the min and maximum value then map from there.

Now here is one thing that sucks about those boards… if you need more than one you have to calibrate for each board. The ADC readings are different from board to board, even if you plug it into the same sensor. But they do work so we have that going for us. lol

Let me know if you get stuck.

Cheers,
Tom