Sixfab is launching their new HAT for Raspberry Pi named as Sixfab Raspberry Pi Cellular IoT Application HAT. The HAT uses Quectel BG96 module which gives this HAT combined feature of LTE technologies Cat.M1, Cat.NB1 and eGPRS for your Raspberry Pi.

Please visit product page for detailed feature

The HAT also contains built-in temperature, humidity, light sensors, 3-axis accelerometer and relay

Since this is our first tutorial on this HAT. Here we will be observing all built-in sensors and control relay.
What we need:

      Raspberry Pi,
      Sixfab Raspberry Pi Cellular IoT Application HAT.

1. Attach the HAT to your Raspberry Pi and turn ON your Raspberry Pi. Make sure your I2C and Serial interfaces are enabled from raspi-config.

2. Clone our github Repo to your Raspberry Pi.

 

rpi_ciot_code1

3. Once the repo is cloned get into the Sixfab_Rpi_CellularIoT_Library

 

rpi_ciot_code2

 

4. Now install the library by

rpi_ciot_code3

 

The library is written with python3 so we will be writing and running every script in python3.

*** Alternate method of installing the library is using pip3. Simply run the following command.

once after installation you will need the scripts from github repo.

5. Once it is installed you may get into sample directory where you will find examples for the shield.

rpi_ciot_code4

6. For this tutorial we will run sensor_test.py

rpi_ciot_code5

 

In this way you have got data from all available sensors on the HAT. Now we will examine the code.

 

  • LINE 1: imports the cellulariot class from cellulariot Library
  • LINE 2: imports time library
  • LINE 4: declares node as an object
  • LINE 6: Disables the module
  • LINE 7: Re-enables the module
  • LINE 9: idle for 0.5 seconds
  • LINE 10: readAccel() returns the accelerometer value
  • LINE 12:  readHum() returns the Humidty
  • LINE 14: readTemp() returns temperature
  • LINE 16: readLux() returns lux in percentage
  • LINE 17-23: returns ADC values
  • LINE 25/27: turns ON/OFF the Relay
  • LINE 29/31: Switch ON/OFF the USER led

 

In next tutorial we will show sending data over UDP.

2 thoughts on “Sensor Test Tutorial for Sixfab RPi Cellular IoT Application HAT”

  1. The github repository is not available.
    git clone https://github.com/sixfab/Sixfab_RPi_CellularIoT_Library.git

    What to do?
    I am not able to use this device without documentation on how to configure it.
    Please send instructions!

Leave a Reply

Your email address will not be published. Required fields are marked *