source code for the AIS receiver/repeater (Teensy 3.1):
credit to Stuart Robinson for the base LoRa code
source code for the Raspberry Pi LoRa gateway:
credit to Dave Ackerman for the base LoRa code
Thursday, 19 May 2016
Thursday, 12 May 2016
I have moved the dAISy to being powered via the 5v pad direct from Vbat (3.7-4.2V) since the power consumption is (perversely) much lower at 5V than 3V
I have changed the threshold for the microcontroller to send everything to sleep up to 3.6V.
Total system current now idles at 38mA @ 4V which is a great improvement.
The Teensy is drawing around 19mA at 4V. This will be the next target for power optimisation.
There may be a way of putting the teensy into micro sleeps - if we can profile the AIS traffic in an area and perhaps predict from the protocol timing if we can sleep at a given moment by sacrificing position update frequency for high-data-rate vessels for example, that would be an OK tradeoff
There is an odd anomaly with the dAISy when powering via 3.3V pad vs 5V pad - configuring the dAISy to output at 9600 baud is ignored when powering at 3.3V - serial data rate is 38400. However, move to powering via the 5V pad and the baud rate setting is reduced to 9600 as per the setting. The manufacturer is looking into it.
powering the dAISy from the 3.3v pad and current consumption for the dAISy runs at about 71mA (234mW)
powering the dAISy from the 5v pad at 4.1V takes about 17mA (70mW)
However, if I power the dAISY from the 3.3v, the battery can get down to about 3.2V before the dAISy stops receiving, but from the 5v pad, it gets flaky at 3.6V
I guess strictly I shouldn't be dragging the 18650 cells down this low, but it is all extra capacity useable down from 3.6 to 3.3Vbat, but what a power difference.
Threshold for system sleep is 3.3Vbat at present. I think I will up this to 3.6V, power the dAISy on the 5V pad and hope for the best.
I could do some calculations comparing the lost capacity vs overall consumption...
Friday, 6 May 2016
Overall power consumption measurements
dAISy current measured at 3.3V (via output of onboard 3.3v Regulator on Teensy) Active = receiving/parsing. AIS sentence. Standby = listening
Teensy current @ battery voltage with no peripherals powered up, taken from internet (not yet measured)
HopeRF not measured
Our challenge is to tame the dAISy which is someway off the published spec (<20mA @ 5V i.e. 100mW; we are seeing 74mA @ 3.3v i.e. 250mW)
Tuesday, 3 May 2016
I am powering the dAISy via 3.3v header on the PCB rather than USB, and receiving AIS sentences via the hardware TX pin. The dAISy utility seems to ignore me setting the onboard serial data rate to 9600baud, and continues to spit out at 38400, but the Teensy can handle this fine.
The remote unit periodically spits out its voltage over the LoRa link, whereby the Raspberry Pi logs this to the cloud to see battery performance over time
I am logging the voltage of the battery to thingspeak, which are plotted below. Values below are raw ADC values (12 bit input. 4.2V battery voltage scaled to 1.2V to match the Teensy 3.1 internal Vref ), and averaged over the last 10 readings
Readings are currently send from the remote device every 20 seconds, but at present the Raspberry Pi receiver crashes about once a day when a corrupt packet is received.
I am uploading to marinetraffic.com which gives some (delayed) statistics on AIS message rate to give me some idea of the number of AIS sentences I am likely to transmit
Current draw from the battery is 90mA @ 4.1v (0.37Watts) idle, rising to about 120mA (0.5W) on LoRa transmit, but not measured very precisely. Most of this is the dAISy
When the battery voltage drops below about 3.6V, I have the Teensy turn off the dAISy receiver and put the HopeRF into sleep, before itself sleeping for 20 seconds.
Every 20 seconds it wakes to measure the battery voltage, then sleeps again if needed.
Sleeping current is around 200uA, which can be improved with some effort
, but should not be significant