ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
IotCeption
Energy	Measurement	of	Android	Things
on	Raspberry	PI	3	with	Arduino	Uno
[Olivier	Philippot	-	@simplygreenit]
Who	I	am?
CTO	Greenspector
@simplygreenit
Why	you	need	to	measure	energy	?
IotCeption - Energy Measurement of Android Things on Raspberry PI 3 with Arduino Uno
In	Classical	Android
import android.os.BatteryManager;
import android.content.Context;
BatteryManager mBatteryManager =
(BatteryManager)Context.getSystemService(Context.BATTERY_SERVICE);
Long energy =
mBatteryManager.getLongProperty(BatteryManager.BATTERY_PROPERTY_ENERGY_COUNTER);
Slog.i(TAG, "Remaining energy = " + energy + "nWh");
Energy	...
The	project	schema	...
Shunt	:	INA219
I2C	Interface
In	real	life
Android	Things
The	project	under	test
1	Raspberry	Pi	3
1	Screen	+	1	HDMI	(Optional)
1	Ethernet
1	USB	Cable	for	power	(With	some	modifications)
1	micro	SDCard
1	Rainbow	Hat	project
Why	so	much	hate?
I2C	can	be	read	on	Android	Things	?
Arduino	to	measure
Arduino	IDE	+	INA219	Library	(C)
shuntvoltage = ina219.getShuntVoltage_mV();
busvoltage = ina219.getBusVoltage_V();
current_uA = ina219.getCurrent_mA()*1000;
loadvoltage = busvoltage + (shuntvoltage / 1000);
poweruWh = loadvoltage * current_uA;
Serial.println(poweruWh);
delay(100);
Serial	reading	on	PC
Serial	reading	in	golang
In	Arduino	program	:
Serial.begin(115200);
Serial	library	in	Go:	github.com/goburrow/serial
flag.StringVar(&address, "a", "/dev/ttyACM0", "address")
flag.IntVar(&baudrate, "b", 115200, "baud rate")
flag.IntVar(&databits, "d", 8, "data bits")
flag.IntVar(&stopbits, "s", 2, "stop bits")
flag.StringVar(&parity, "p", "N", "parity (N/E/O)")
Making	an	computer	oscillo
Highchart	which	read	the	data	:	http://localhost:8000/
Now	we	can	play...
Results
Autonomy	?
1,4w	in	continuous	/	5v	=	280mAh
3000mAh	battery	~	11h	of	autonomy
2w	in	continuous	/	5v	=	400mAh
3000mAh	battery	~	7,5h	of	autonomy
Conclusion	:	Measure,	Measure	and
Measure
For	Energy	questions	:	@simplygreenit

More Related Content

IotCeption - Energy Measurement of Android Things on Raspberry PI 3 with Arduino Uno