Software apps and online services
Hand tools and fabrication machines
In this example I'll show you an application where I'll be able to control the amount of liquid to be injected in milliliters from the WEB, these values are modified from the internet via the UBIDOTS platform.
It explains how to receive information with our GOBLIN 2 from the UBIDOTS API via an HTTP protocol.
The methods to request information supported by UBIDOTS are:
- GET request a resource from the cloud, in this case the API (a variable)
The GOBLIN 2 receives a value from the UBIDOTS API and executes the expulsion of the selected value.
Necessary hardware and connection diagram:
You need to create a UBIDOTS account.
Under the tab labeled Devices, we'll choose Add Device, in this case we'll call it Milliliters pump.
In Milliliters pump, we'll add a variable in Add Variable and it'll be “Default”. We'll also call it Milliliters pump.
We create a Widget under the Dashboards tab. It'll be “Control” data >> type of widget “Slider” >> name of the control variable: Milliliters pump.
It'll show in the following way and the slider will range from 0 to 7000ml. These are the 7500ml in our water tank and these parameters may be modified according to your container. Done! Our control variable has been created.
We'll go to the Devices tab to access “Milliliters pump” and go to API Credentials in the profile.
We copy the “Tokens” and the “ID” and we replace them in the xxx of our program.
Replace the “ID” and the “Token” where the xxx is in the example code. You can obtain the code from here.
Select Tools in the Arduino IDE followed by Board: Arduino/Genuino Uno. Select the port COM of your GOBLIN 2 and compile the program -“Upload”. Done! Our GOBLIN 2 has been programmed.
You can use this example for an automatic irrigation control that irrigates every 15 minutes the number of liters of water that were chosen. You can make automation systems to turn on and off light bulbs and other devices.