Streaming sensor data from sensor on MKR1000

I have an MKR1000 and a few sensors I picked up (e.g. $3.99 - Light Sensor Module - Tinkersphere).

From what I understand most sensors stream sequenced integer data. I want to basically set up my Arduino with several sensors and have them stream their data into databases over wifi.

Being mildly technical and new to Arduinos, my thought was to set up an AWS instance and write a sketch that streams data from the device to a Postgres instance on AWS.

  1. Does this set up make sense?
  2. Are there existing sketches I could start from / modify to handle Arduino-AWS interactions?

If you got to Tools -> Manage Libraries in the Arduino IDE you can type AWS and find a library called aws-sdk-arduino-esp8266. This might be a starting point if you want to go cloud.

Another option is to setup a system on a Raspberry Pi and do everything local. Your MKR will collect the data but the collection, storage and analysis is done on the Raspberry Pi.

I use a Adafruit Feather M0 WiFi and the Adafruit MQTT library. In the example code of this library there are comments for the MKR1000. So this should be easy to adapt.

On my Raspberry Pi I installed Mosquitto as MQTT broker. This handles all the messages between devices.

Then I use Node-Red to receive the messages from the broker and display them on a local webpage. You can also control other stuff in your house, send emails ...

Additionally I save the data in a influxdb database from Node-Red and can retrieve long time data again when I want.

Each step is fairly simple to set up and understand and you can learn a lot.