​Hacking BLE & RF into an EEVBLOG uCurrent Gold

A project log for - A full stack IoT platform

A full stack project dedicated to easily collecting, analyzing and sharing IoT sensor data.

Luke BenoLuke Beno 08/20/2015 at 06:560 Comments

Well just because we all know Dave Jones' opinion of "The Internet of Things", it is time to bring his uCurrent to the dark side! Just kidding, Dave if you are reading this, I just thought that it would be a fun project :)

I love my uCurrent and use it all of the time for measuring power consumption of small low power devices. I've been working on some solar stuff where I want to measure current over a long period & a wireless interface/data logging would be handy. There are some other instances where I just can't be bothered to get out (or find) my DMM, untangle the leads and get it all together. Not to mention my desk ALWAYS looks like this!

Anyway from my other updates You'll find that I've been working on a new low cost sensor node that supports BLE as well as the standard Nordic Enhanced Shockburst protocol. The size of this node is small so I figured it would be a perfect marriage to put them together. There are just 4 connections:

Here's the code, apologies in advance for the egregious use of floats, it is a hack after all...

#include <analog_io.h>
#include <SPI.h>

uint8_t x = 0;
analog_io radio(P3_5, P3_6, P2_5);

float ref, I;
float Current;
uint16_t batt,lp_ref;

const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 };

void setup()
  radio.begin();  // Defaults 1Mbps, channel 0, max TX power

void loop()
  lp_ref = analogRead(A0);
  batt = analogRead(11)>>1;
  if (lp_ref-batt>100) {
    for (int k=1;k<=100;k++) {
      ref -= ref/k;
      ref += analogRead(A0)/k;
      I -= I/k;
      I += analogRead(A3)/k;
    Current = (I-ref)*0.00244140625;
  else {
By the way, you can find the analog_io library here. The Rx code is straight from the "proprietaryRfRx" example.

All that is left is to put it back together:

Add some tape for good measure

There is one more thing to consider, I'm using the 2.5V reference in the MSP430. That means that I can't measure voltages greater than 2.5V from GND. The way that the uCurrent works is that in order to do bi-directional current measurements, it sets the virtual reference at VCC/2, about 1.5 V. So the measurement range is degraded to, -1.5mA to +1.0mA. Nothing quite works close to the rails either so be advised.

Since I don't really use the bi-directional aspect of my uCurrent, I'm tempted to lower the virtual ground to something like 200mV and get more range. I digress...

Feel free to comment, send a skull my way or follow the project! Sensor nodes are for sale too, send me a message it you would like to purchase. $15 for the node, an extra $5 if you want a Si7020 Temp & Humidity sensor soldered on. $5 Shipping world wide (except for a few countries).