This shows you the differences between two versions of the page.
iothings:laboratoare:2022:lab2 [2022/10/13 16:19] dan.tudose [Exerciții] |
iothings:laboratoare:2022:lab2 [2022/10/13 17:00] (current) dan.tudose |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Sparrow ESP32 board bring-up & SPIFFS ===== | + | ===== Lab 2: Sensors & SPIFFS ===== |
In today's lab assignment we will bring up the sensors on the Sparrow ESP32 board and build a logger using the filesystem library and the board's internal Flash. | In today's lab assignment we will bring up the sensors on the Sparrow ESP32 board and build a logger using the filesystem library and the board's internal Flash. | ||
+ | |||
+ | === Bringing up the sensors === | ||
+ | |||
+ | We'll learn how to get data from all the sensors on the board. | ||
+ | |||
+ | == Light Sensor == | ||
+ | |||
+ | |||
+ | {{ :iothings:laboratoare:2022:f7e03b34cc8586c24828e06bdde40887.jpeg?150|}} | ||
+ | |||
+ | The board has an on-board [[https://eu.mouser.com/datasheet/2/239/lite-on_lite-s-a0002515146-1-1749840.pdf | LTR308]] light sensor. It's connected to the ESP32 processor via a I2C bus. You will need to install a [[https://www.arduinolibraries.info/libraries/ltr308-library | driver library]] to get light intensity readings. Go to Sketch > Include Library > Manage Libraries and search for LTR308 and then click on the Install button. | ||
+ | |||
+ | The library comes pre-loaded with an example, you can load it from File > Examples > LTR308 and it should print light intensity reading in the Serial Terminal. | ||
+ | |||
+ | Use the Serial Plotter to graph different illumination levels. | ||
+ | |||
+ | == BME680 Sensor == | ||
+ | |||
+ | {{ :iothings:laboratoare:2022:screenshot_2022-10-13_at_16.58.01.png?150|}} | ||
+ | |||
+ | Next, you'll be bringing up the [[https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme680/ | BME680]] sensor, which is a highly integrated temperature, pressure, humidity and gas sensor. | ||
+ | Again, you will need to install a [[https://www.arduinolibraries.info/libraries/bme680 | sensor library]] that enables you to interface the sensor on I2C and get readings. | ||
+ | |||
+ | Run the I2CDemo to get sensor readings and plot them in the Serial Plotter. | ||
=== ESP32 Flash Memory === | === ESP32 Flash Memory === | ||
Line 45: | Line 69: | ||
Using the same libraries and apps as the previous exercise, implement a sensor data logger. The data logger periodically reads all sensor values (e.g. once every 30 seconds) and writes them in a file, together with a timestamp. For the timestamp, you could use a library such as [[https://www.arduino.cc/reference/en/libraries/uptime-library/ | uptime]]. | Using the same libraries and apps as the previous exercise, implement a sensor data logger. The data logger periodically reads all sensor values (e.g. once every 30 seconds) and writes them in a file, together with a timestamp. For the timestamp, you could use a library such as [[https://www.arduino.cc/reference/en/libraries/uptime-library/ | uptime]]. | ||
+ | Use the bluetooth terminal to dump all sensor data. | ||
===== Resources ===== | ===== Resources ===== | ||