Coder Social home page Coder Social logo

data-collection-workshop-code's Introduction

data-collection-workshop-code

Example code for collecting data with the Arduino BLE

Data collection workshop

Introduction to the Arduino BLE Sense:

Download Arduino IDE & example code

  1. Install Arduino BLE Sense examples

a. Upload blink sketch to test everything works ok!

b. Set up real-time serial connection to computer

c. Send real-time humidity & temperature data from sensors through the serial port:

  • Install the HTS221 library from the library manager
  • Open the HTS221 example from the example sketches menu
  • Upload the example sketch
  • Open the serial monitor and check you are getting data

d. Send the audio analysis through the serial port:

  • Open the PDM Serial Plotter example
  • Upload the PDM example sketch
  • Open the Serial Plotter
  • Make some noise!
  • Review the documentation: https://docs.arduino.cc/learn/built-in-libraries/pdm
  • What happens if you change the number of channels? How about the frequency?

e. Run a program on the computer to use the data in something

  • Change the channel number back to 1 in the PDM example sketch
  • Open the GraphProcessingCode Processing 3 sketch (Install Processing, if you don't have it: https://processing.org/download)
  • Change the number of the serial array index (line 29) to match your serial port (you can run the sketch and it will print the array)
  • Run the sketch and watch the results
  • What happens if you change the input and output of the map() function (on line 63)?

f. Let's try getting some data in really fast, using the built in accelerometer

Extra challenge: How would you add the sound from point 2, the PDM Serial Plotter example to point 4, the accelerometer example? (An answer is here and here)

2. Data logging

Now we are familiar in having the Arduino give us data, let's try and do something with it. Let's start by saving the data:

a. Upload the ENV sensing Arduino sketch

b. Run a bridge program to save your data

3. Going online

Now let's look at ways to use the data with MQTT:

a. Upload the ENV sensing Arduino sketch

b. Run a bridge program to send data to MQTT on cci server

c. Show incoming MQTT data with http://mqtt-explorer.com/

data-collection-workshop-code's People

Contributors

mattjarvis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.