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.
- 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)
- 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:
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 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
To upload the assets:
- Visit Runtime assets
- Click the red + button
- Locate the runtime folder
- Click Open
- Repeat for all files in this folder
- Click Upload
Note: Don't mark any files as private as these will be publically accessible from the Internet.
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.