inp DDRA TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE DDRB FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE WHILE TRUE inp PINA EQ inp 0 status move forward PORTB FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE EQ inp 1 status turn left PORTB FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE EQ inp 2 status turn right PORTB FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE status Signal lost PORTB FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 0.02 PORTB FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 0.05 PORTB FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE Automatically Scan and allow the user to select a sensor


In this experiment we shall use a user input block which scans the I2C port for supported sensors, and shows the user a list of detected sensors to select from.


The parameters supported by the selected Sensor are automatically fed into the adjacent drop-down menu for the user to select.







connections for I2C sensors


Sensors which use the I2C communication interface require 4 connections to be made.






*If the sensor chip itself operates at 5V(INA219, some boards of QMC5883L etc), the pull up should be to 5V , or else communication errors will occur. To do this, connect a 2K resistor each from SCL to 5V, and from SDA to 5V (this can be done on the SCL,SDA,5V pins located at the top right side of the 40*2 connector of SEELab)







Recording data







  1. Click the scan I2C button
  2. Select from the list of detected sensors*
  3. Select the parameter you wish to record
  4. Click on RUN!


* The device is able to obtain the list of I2C addresses which have responded during the scan. The names of the sensors are then guessed based on a predefined map of sensors and their commonly known addresses.

If 2 sensors are known to be sold with the same address, both will be shown to the user in the list (e.g., TCS34725 and VL53L0X are sold with address=41) . Choose accordingly.







Configuration options


Some sensors have additional configurations, and multiple parameters to choose from.


E.g., the MPU6050 allows choosing the input ranges of the accelerometer and gyroscope. Click on the configure option, and select the required range before starting acquisition.

It also has 6 parameters to choose from : acceleration along 3 axes, and angular velocity along 3 axes


For the TSL2561 LUMINOSITY sensor, 2 options, IR, full spectrum are available. One is chosen and logged in the first picture.







Recording a thermocouple's voltage with ADS1115 16-bit ADC



]]>