6. Why Agrino
● Commercial product is too expensive
● Sensor components for maker is too short life cycle
● We can do it by ourselves!
7. Project Positioning
Arduino Agrino Commercial
Function Yes Yes Yes
Durability L M H
Development resource H H L
Accuracy L M H
Manitain and calibration No DIY Yes
Cost L M H
Open source Yes Yes No
8. Agrino
An open source project designed for agricultural sensing,Based on the
Arduino source code。
Hardware
customize hardware
Software
Arduino core
Sensor library
18. Weather Board
● Sunshine duration
○ BH1603 upto 100000lux
● Solar radiation
○ BPW21
● Temperature and Humidity
○ SHT31
● APRS
○ Wind and ranin
19. Target: Field Sensor Station
● Sensor module
○ Micro weather station
○ Soil sensor
● LPWAN
● Power system
○ Solar Power Supply
○ Powergate
● Local storage
● RTC
20. Fieldsensor : MTDuino(sigfox) and Sensor Library.
https://thingspeak.com/channels/550467 https://thingspeak.com/channels/548078
21. MTDuino
The MTDuino-SigFox is powered by Atmel’s
SAMD21 MCU, featuring a 32-bit ARM
Cortex® M0 core.
With the addition of the M0 board, the
Arduino family becomes larger with a new
member providing increased performance.
22. LPWAN - Sigfox
● 12Byte data
● 140 message/day
Sigfox
backend
OHF Server
FieldSensor
24. Soil Sensor and Sensor Library
1. Define sensor
2. Define data package (12byte)
3. Get sensor data to data package
4. Packet data to hex string
5. Send data by sigfox module
25. Example
typedef struct _mec10_data
{
int temp:13; //value range maxiumu: 8000
unsigned int vwc:14; //value range maximum: 10000
unsigned int ec:15; //value range maximum: 20000
unsigned int salinity:15; //value range maximum:20000
unsigned int tds:15; //value range maximum: 20000
unsigned int epsilon:13; //value range maximum: 8200
unsigned int batvol:10;//value range maximum: 1024
bool avaliable:1;
}MEC10Data ;
const int sigfoxPayloadSize = 12; //in byte.
typedef union _sigfox_data_pack
{
MEC10Data mecData;
byte dataArray[sigfoxPayloadSize];
} SigfoxDataPacket;
void encodeMEC10Data(SigfoxDataPacket &data,char* payload)
{
array_to_string(data.dataArray,sigfoxPayloadSize,payload);
}
void array_to_string(byte array[], unsigned int len, char buffer[])
{
for (unsigned int i = 0; i < len; i++)
{
byte nib1 = (array[i] >> 4) & 0x0F;
byte nib2 = (array[i] >> 0) & 0x0F;
buffer[i*2+0] = nib1 < 0xA ? '0' + nib1 : 'A' + nib1 - 0xA;
buffer[i*2+1] = nib2 < 0xA ? '0' + nib2 : 'A' + nib2 - 0xA;
}
buffer[len*2] = '0';
}
void loop()
{
SigfoxDataPacket data;
if(readMEC10Data(data) == 0x00/*ModbusMaster.ku8MBSuccess*/)
{
char sigfoxpayload[sigfoxPayloadSize*2];
encodeMEC10Data(data,sigfoxpayload);
sigfox_atcommand_tx("AT$SF=" + String(sigfoxpayload)+"r");
}
}
26. Sigfox Data Field
● How to parse raw data on server like…
○ 1cadcee80040001c0075c3bc
● What if difference device type
○ Field sensor
○ Micro weather station
○ ...more
● Solutions:
○ Parser rule by configuration with device id, but should be setting before device online.
○ message type in data filed like Unabiz Message class
■ but payload only 12byte!
source:https://unabiz.github.io/unashield/