Version One: Bench Trial

A project log for Sea Temperature Sensor using GSM

A template for battery powered sensors using GSM

Mike CochraneMike Cochrane 06/14/2015 at 11:260 Comments

Before installing the first prototype in the sea I wanted to run it for a while to see what the battery life might be and ensure the code doesn't mysteriously die after a period of time.


A teensy 3.0 connected to the cheapest Sim800L breakout I could find. This breakout has the Tx/Rx, Power and Reset pins broken out. A simple resistor voltage divider on the Rx input of the Sim800L takes care of level shifting the Teensy's 3.3v to the needed 2.8v IO.


The way the breakout for the Sim800L is wired, the module turns on as soon as it gets power. The plan was to tell the module to power off when not being used then use the Reset pin to bring it back to life. I wrote some quick code, wired up the Reset pin to a digital IO pin on the Teensy and I could turn it off, then reset it to bring it back to life so moved on to the rest of the code thinking this was sorted - more on this later.

Next was making an HTTP request, there's plenty of code examples for making a TCP connection and sending HTTP requests with the Simcom GSM modules. Then I checked the datasheet and found it had HTTP request support build in (why doesn't everyone just use this?). So making an HTTP GET request is pretty trivial, I hacked that up and had it sending me temperatures ever minute shutting down the module in between, it worked okay (code was a mess but worked - optimised for implementation speed?).

Next was to leave it going longer with 10 minute updates. So I changed the delay at the end of the loop and tried it out, first a delay() that long was coming up short, 9 x 60 second delays worked so that's what I used. The first data came through, the Sim800L turned off. All looked good. Then the Sim800l turned back on! I checked the serial debugging, I didn't turn it on! Turns out the way the breakout board is wired it always turns back on about 30 seconds after being powered down. In my earlier tests I was resetting it before it had time to auto start so I didn't find this. Nothing I can do about this on this breakout, so I've got to live with it.

New plan, put it in flight mode when I don't need it - the lowest power mode in the datasheet that I could use - then put it back in normal mode when I need to send data. So that's what I did:

Test results

Everything worked fine! I set it at ~5 min updates and gave it a single half used battery and left it running for a couple of days outside in the rain and wind.

Extrapolating the battery voltage drop to two fully charged batteries and ~10min updates suggested 10 days battery life was possible. That was good enough for now, time for sea trials!