How to Build an Industrial Sensor

One of the most effective ways for many businesses to safeguard their profits is by closely monitoring inventory. This is particularly important for businesses with perishable goods requiring specific storage conditions and inventory levels. If these are not monitored, the company runs the risk of inventory shortages or spoilage. Luckily, inventory monitoring solutions make it easy to predict production demands and inventory spoilage remotely in order to increase efficiency and profits.

In this tutorial, we will create an industrial sensor that logs relative humidity level, temperature, and the weight of a 10kg or less object.

Let's break this down into four parts: preparation, configuring the server, assembling the hardware, and testing.

Preparation

Materials needed:

Electronic Components

  • 1x Programmable Wireless Starter Pack (available in the Twilio console)
  • 1x Jumper Wires Standard 7" M/M - 30 AWG (30 Pack)
  • 1x Breadboard - Self-Adhesive (White)
  • 1x Load Cell - 10kg, Straight Bar (TAL220)
  • 1x SparkFun Humidity and Temperature Sensor Breakout - Si7021
  • 1x SparkFun Load Cell Amplifier - HX711
  • 1x Particle Electron 3G Kit (Americas/Aus)

Tools

  • Electrical tape
  • Wire strippers

All materials required can be found in the Programmable Wireless Industrial Sensor shopping list.

Note: The additional steps required to activate a Twilio Programmable Wireless SIM card can be found in the Programmable Wireless Starter Pack.

Also, throughout this tutorial, you will see an reference to the "red + button." This is a standard user interface element that is shown throughout the user experience in Twilio's developer portal. When this tutorial refers to that button, you should be looking for something that looks like this:
 

''red + button'' sample image

Configure Server Software

Deploy scripts to Functions

The Industrial Sensor uses Twilio Functions to host the front and back end code. Functions is a serverless architecture that hosts the server-side code and website required to communicate with the Particle Electron.

Create new sync service
Create new sync service: Industrial Sensor
Create new sync service: Industrial Sensor Configuration

Create a Twilio Sync service instance. The Industrial Sensor will use Twilio Sync for synchronization and data storage. Go to Sync Services to create a new instance - click the red + button; name your new service Industrial Sensor; click the Create button and then make note of the Service Sid (starts with IS) for later.

Deploy Runtime assets

The front-end is written using the AngularJS framework and compiled as a single page application. To deploy, you need to download and extract the latest version the Industrial Sensor repository.

To upload the assets:

  1. Visit Runtime assets
  2. Click the red + button
  3. Locate the runtime folder
  4. Click Open
  5. Repeat for all files in this folder
  6. Click Upload

Note: Don't mark any files as private as these will be publically accessible from the Internet.

Deploy runtime assets

Make note of the URL created when index.html is uploaded. This will be your public URL of your Industrial Sensor. It looks like https://word-word-####.twil.io

Now you will create a new API key, which is a revocable credential used to access Twilio services.

Evan Cummack Evan Cummack is the product owner for Twilio’s Programmable Wireless. Evan joined Twilio in 2011. He previously worked on the Programmable Video product, and before that built and lead Twilio’s global Sales Engineering and Solution Architecture team. Evan believes in a future where wide-area IoT is prolific, built on scalable platforms that can support millions of developers and connected devices.
 

Comments (0)