Using a Tablet to Control a BeagleBone Black With LabVIEW

by Austin Stanton in Circuits > Remote Control

3501 Views, 9 Favorites, 0 Comments

Using a Tablet to Control a BeagleBone Black With LabVIEW

IMG_7926.JPG

This Instructable will show you how to use your tablet to control a BeagleBone Black using LabVIEW its Data DashBoard application.

Materials

373615_html_1f0bfc20.jpg

Hardware

  • Tablet (Data Dashboard 2.2 is available for Apple iPad and Android tablets)
  • BeagleBone Black
  • Temperature sensor [TMP36] (250 mV output at 25°C)
  • LED

Software

  • LabVIEW
  • Data Dashboard Application

(LabVIEW Physical Computing Kit for BeagleBone Black includes a BeagleBone Black and LabVIEW)

Setting Up Beagle Bone

Screen Shot 2016-06-29 at 10.11.50 AM.png

Refer to this setup video for help if you have any issues with the steps below.

  1. Connect ethernet to the BBB (BeagleBone Black).
  2. Connect the BBB to the PC via USB.
  3. If this is the first time connecting the BBB to the PC, open the BBB mass storage device from My Computer and launch the START HTML page.
  4. Scroll down to Section 2 and install the correct driver for the PC operating system.
  5. Launch LabVIEW and open the Target Configuration Wizard from Tools»MakerHub»LINX»Target Configuration.
  6. Enter the BBB Hostname or IP and a username and password with root privileges and click connect.
    • Default IP Address for the BBB USB/Ethernet device is '192.168.7.2'.
    • Default Username is 'root'
    • Default Password is empty.
  7. Click the Install Software tab.
  8. Click Install.
  9. Review any warnings and complete the installation.

In the bottom left corner, you can see the USB and Ethernet IP addresses under the BeagleBone Black logo. You can see from the picture above that my ethernet IP address is 192.168.1.53, you will need to use this IP address later so write it down.

Circuit Set Up

IMG_7917.JPG

First, refer to the BeagleBone Black LINX pinout diagram. Place the TMP36 on the breadboard with the rounded part facing towards from the BeagleBone(the order of the pins is important!). Connect the right pin of the round facing side to power(VDD_3v3 or pin 49 on the diagram), and the left pin to ground(DGNG or pin 47 on the diagram). Connect the center pin to Analog pin 1(A0 or Pin 85 on the diagram).

Next, to place the LED on the breadboard and connect the cathodes (short leg) to ground by running a 220-ohm resistor to ground(DGNG or pin 1 on the diagram). Then connect the anode to digital pin 7(DIO_7 or pin 7 on the diagram).

Adding Global Variables

Screen Shot 2016-06-28 at 10.30.43 AM.png
Screen Shot 2016-06-28 at 10.25.38 AM.png

The first picture above shows my VI before I added any global variables and the second picture shows what it will look like after. Control global variables are added to the input of the LED's digital write channel and an indicator global variable to the output of the TMP36. Instructions for doing this are shown below.

  • Add an or to the input of the LED's digital write channel so the front panel control can be used as well.
  • Click Ctrl+Spacebar to open up the Quick drop search so you can search and add a "Global variable."
  • Next, hold shift and click on the global variable to highlight it. Then hold Ctrl and drag it to create a duplicate global variable.
  • Finally, wired the global variables.

Setting Up Global Variables

Screen Shot 2016-06-23 at 5.35.29 PM.png
Screen Shot 2016-06-23 at 5.43.07 PM.png
  • Click shift and double click on one of global variables to bring up its front panel.
  • From here add a boolean LED and a numeric indicator.
  • Change the names to something short and descriptive, I chose "LED" and "Temp".
  • Save the file, make sure you know where it is because you will need to open it in a later step.

Web Service Set Up - LED Web Service Part 1

Screen Shot 2016-06-28 at 11.31.20 AM.png
  • Right click BeagleBone Black and then select New»Web Service.
  • Rename the Web Service to something short, I chose ws.
  • Right click on Web Resources then select New VI.
  • Press Ctrl+E to switch to the Block diagram and then right click to open up the functions palette, select "Select a VI".
  • Select the Global VI you made in step 5.
  • Right click the LED VI and select Create»Control.

LED Web Service Part 2

Screen Shot 2016-06-28 at 11.39.59 AM.png
  • Switch back to the front panel, you will see a box like the one in the picture above in the top right corner, select the top left box.
  • Next, click on the LED, the box you selected in the last step should turn green.
  • You select this box because the LED is a control.
  • Save the file, give it a short descriptive name, I chose LED.

Thermistor Web Service Part 1

Screen Shot 2016-06-28 at 11.44.12 AM.png
  • Again, right click on Web Resources and then select New VI.
  • Press Ctrl+E to switch to the Block diagram and then right click to open up the functions palette, select "Select a VI".
  • Select the Global VI you made in step 5.
  • Click on the LED function and a drop down menu will appear, select Temp.
  • Right click on the Temp function and select "Change to Read".
  • Right click the LED VI and select Create»Indicator

Thermistor Web Service Part 2

Screen Shot 2016-06-28 at 11.46.29 AM.png
  • Switch back to the front panel, you will see a box like the one in the picture above in the top right corner, select the top right box.
  • Next, click on the Temp, the box you selected in the last step should turn orange.
  • You select this box because the Temp is an indicator.
  • Save the file, give it a short descriptive name, I chose Temp.
  • From the project menu, right click on "ws" and select start, after it is done compiling you will be given a port number(often it will be 8001), write this down it will be needed to connect it to the tablet.

Data Dashboard

IMG_0224.PNG
IMG_0225.PNG
  • From there select the palette in the top right and select LabVIEW Web Service>>Call Web Service and then click the empty dashboard to place it on the screen.
  • Click on the call button and then select the globe that pops up below it. Enter the IP address that you wrote down in step 2 and the port number you wrote down in step 30.
  • Select WS1 on the first screen and then LED on the next.
  • Click the plus sign next to the call button and then select "create new control".
  • Select the switch
  • Next, click on Poll and then select the globe that pops up below it.
  • Enter the IP address and port again and then Select WS>>/Temp
  • Select the plus sign next to the poll and then select Create new indicator
  • Select the gauge from the indicators palette.
  • Run the Tempblink VI and then select the play button in the top right corner of the app to test whether or not it is working. You should see a temperature between 20-35 degrees Celsius.
  • To turn on the LED flip the switch to the right and click the call button, the call button must be clicked every time you change the switch.

Setting Up a Start Up VI

Screen Shot 2016-06-28 at 1.10.18 PM.png
  • From the project menu, right-click the build specification and choose New>>Real-Time Application
  • Save the project, I chose to name mine "Tempblink".
  • Go to the "Source Files" category and select all of the project files and click the arrow to move them into the Startup VIs
  • Go to the "Web Services" category and click the box next to your Web Service name. You will see an HTTP port, write down this number, you will now use this port number to access the web service from your tablet.(previously I used 8001, now I would use 8002)

Run the VI As a Startup

Screen Shot 2016-06-28 at 1.12.35 PM.png
  • Right click the new build specification and choose Build and then click Done. Next right click the new build specification and choose Run as Startup. Click Yes to reboot the target.The VI will now run whenever the target is powered on.

Once you have completed these steps you will be able to control the VI from your tablet without having to use a computer. You can download the Tempblink.vi project below, thank you for reading my instructable and feel free to comment with any questions you may have.

Downloads