labview linx, arduino and thingspeak
TRANSCRIPT
![Page 1: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/1.jpg)
LabVIEW LINX, Arduino and ThingSpeak
Hans-Petter Halvorsen
https://www.halvorsen.blog
![Page 2: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/2.jpg)
• Arduino• ThingSpeak• LabVIEW• LabVIEW LINX• Example–Write Data to ThingSpeak using a TMP36
Temperature Sensor
Table of Contents
![Page 3: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/3.jpg)
System Overview
Sensors
Arduino UNOPC
USB cable Type A-B
LabVIEW+
LabVIEW LINX Toolkit
TMP36 Temperature Sensor
ThingSpeakCloud Service
Temperature
![Page 4: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/4.jpg)
Hardware• Arduino• Breadboard• Wires (Jumper Wires) • TMP36 Temperature Sensor
![Page 5: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/5.jpg)
Arduino
Hans-Petter Halvorsen
https://www.halvorsen.blog
Table of Contents
![Page 6: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/6.jpg)
• Arduino is an open-source electronics platform based on easy-to-use hardware and software.
• It's intended for anyone making interactive projects, from kids to grown-ups.
• You can connect different Sensors, like Temperature, etc.
• It is used a lots in Internet of Things projects• Homepage:
https://www.arduino.cc
Arduino
![Page 7: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/7.jpg)
Arduino• Arduino is a Microcontroller• Arduino is an open-source platform
with Input/Output Pins (Digital In/Out, Analog In and PWM)• Price about $20• Arduino Starter Kit ~$40-80
with Cables, Wires, Resistors, Sensors, etc.
![Page 8: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/8.jpg)
Connect Arduino to your PC
USB cable Type A-B
PC
Arduino
![Page 9: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/9.jpg)
Arduino Software
In this window you create your
Program
Compile and Check if Code is OK
Creates a New Code Window
Open existing Code
Upload Code to Arduino Board Save
Open Serial Monitor
Error Messages can be seen herewww.arduino.cc
The software can be downloaded for free:
![Page 10: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/10.jpg)
Arduino Programs// Initialization, define variables, etc.
void setup(){
// Initialization...
}
void loop(){
//Main Program...
}
All Arduino programs must follow the following main structure:
![Page 11: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/11.jpg)
ThingSpeak
Hans-Petter Halvorsen
https://www.halvorsen.blog
Table of Contents
![Page 12: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/12.jpg)
• ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet of Things (IoT) applications.
• ThingSpeak has a free Web Service (REST API) that lets you collect and store sensor data in the cloud and develop Internet of Things applications.
• It works with Arduino, Raspberry Pi, MATLAB and LabVIEW, Python, etc.
https://thingspeak.com
ThingSpeak
![Page 14: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/14.jpg)
LabVIEW
Hans-Petter Halvorsen
https://www.halvorsen.blog
Table of Contents
![Page 15: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/15.jpg)
• LabVIEW is Graphical Software• LabVIEW has powerful features for
Simulation, Control and DAQ Applications
LabVIEW
Basic LabVIEW Example:
![Page 16: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/16.jpg)
LabVIEW HTTP ClientWe can use the built-in LabVIEW HTTP Client Functions in order to communicate with the ThingSpeak REST API
![Page 17: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/17.jpg)
LabVIEW LINX
Hans-Petter Halvorsen
https://www.halvorsen.blog
Table of Contents
![Page 18: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/18.jpg)
• The LabVIEW LINX Toolkit adds support for Arduino, Raspberry Pi, and BeagleBone embedded platforms• We will use an Arduino Uno in this
Tutorial
LabVIEW LINX Toolkit
![Page 19: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/19.jpg)
Installing LabVIEW LINX ToolkitUse VI Package Manager
Note: Do not install this package if you are running LabVIEW 2020 Community Edition or later, as the Community Edition already includes the LabVIEW LINX Toolkit
![Page 20: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/20.jpg)
LabVIEW LINXNote! In order to use Arduino with LabVIEW LINX you need to update the Firmware on
the Arduino device
![Page 21: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/21.jpg)
LINX Firmware WizardNote! In order to use Arduino with LabVIEW LINX you need to update the Firmware on
the Arduino device
![Page 22: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/22.jpg)
LabVIEW LINX Palette
![Page 23: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/23.jpg)
TMP36 Example
Hans-Petter Halvorsen
https://www.halvorsen.blog
Table of Contents
![Page 24: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/24.jpg)
System Overview
Sensors
Arduino UNOPC
USB cable Type A-B
LabVIEW+
LabVIEW LINX Toolkit
TMP36 Temperature Sensor
ThingSpeakCloud Service
Temperature
![Page 25: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/25.jpg)
TMP36
TMP is a small, low-cost temperature sensor and cost about $1 (you can buy it “everywhere”)
![Page 26: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/26.jpg)
Linear ScalingConvert form Voltage (V) to degrees CelsiusFrom the Datasheet we have:
(𝑥!, 𝑦!) = (0.75𝑉, 25°𝐶)(𝑥", 𝑦") = (1𝑉, 50°𝐶)
There is a linear relationship between Voltage and degrees Celsius:
𝑦 = 𝑎𝑥 + 𝑏
We can find a and b using the following known formula:
𝑦 − 𝑦! =𝑦" − 𝑦!𝑥" − 𝑥!
(𝑥 − 𝑥!)
This gives:
𝑦 − 25 =50 − 251 − 0.75
(𝑥 − 0.75)
Then we get the following formula:𝑦 = 100𝑥 − 50
![Page 27: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/27.jpg)
Wiring
![Page 28: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/28.jpg)
LabVIEW
![Page 29: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/29.jpg)
LabVIEW
![Page 30: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/30.jpg)
LabVIEW
![Page 31: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/31.jpg)
LabVIEW
![Page 32: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/32.jpg)
ThingSpeakWe see that the Temperature Data has been successfully written to ThingSpeak
![Page 33: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/33.jpg)
Summary• We have successfully logged Temperature Data
to the ThingSpeak Cloud Service using an Arduino UNO device.
• The Programming Environment has been LabVIEW and the LabVIEW LINX Toolkit
• The Temperature Sensor was a TMP36Temperature Sensor
![Page 34: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/34.jpg)
Final System
Sensors
Arduino UNOPC
USB cable Type A-B
LabVIEW+
LabVIEW LINX Toolkit
TMP36 Temperature Sensor
ThingSpeakCloud Service
Temperature
![Page 35: LabVIEW LINX, Arduino and ThingSpeak](https://reader033.vdocuments.us/reader033/viewer/2022042403/625d82a05cbe7e49e5384801/html5/thumbnails/35.jpg)
Hans-Petter Halvorsen
University of South-Eastern Norwaywww.usn.no
E-mail: [email protected]: https://www.halvorsen.blog