Sensors & Actuators on Raspberry Pi




100 Points
Learning Objectives

These instructions will show you how a Raspberry Pi can interact with the physical world using sensors and actuators.
This software and hardware allows you to collect data from sensors and send signals to actuators by Python programs running on a Raspberry Pi.

More information on the GrovePi+ system used is available online.
This system allows you to collect data from devices connected to your Raspberry Pi-such as peripherals and connected sensors that measure light level, sound level, temperature level, humidity leve and more.

After completing this assignment you will be able to:

  1. Investigate sensors and actuators
  2. Run Python programs on a Raspberry Pi that communicate with sensors and actuators
  3. Discuss uses of Raspberry Pi/Grove Pi devices to solve problems and address opportunities

Assignment Overview
This assignment reviews basic computer concepts that you will need in this course and throughout your career.

You are expected to have a working knowledge of SBC hardware and software.
If you do not understand how to use an item, perform a Google Search, refer to the WSU Technology Knowledge Base,  ask a teaching assistant, or ask the instructor.


Exercise 1-Examine Sensors & Actuators
  1. These steps are performed on the Raspberry Pi.
  2. Each IoT workstation contains a Raspberry Pi, Grove Pi+ data acquistion board and 10 sensors and actuators.
    Python programs have been written that control these devices-physical connections, data gathering, data processing, data presentation and data storage, if required.
  3. Make sure that the Raspberry Pi is powered on.
    Then inspect the GrovePi board to make sure it is also powered on-the green LED in the bottom center of the board will be lit.
    Note-if the GrovePi board Red LED reset light is illuminated, you must shutdown the Raspberry Pi, turn off the power, wait five seconds and then turn the power on again.

    GrovePi reset lightGrovePi with Red Reset light on

  4. Familiarize yourself with the available sensors and actuators depicted below.

    sensors and actuators on GrovePiGrovePi with Sensors and Actuators-on top of Raspberry Pi

  5. Review the GrovePi Configuration that details how the sensors and actuators are physically connected.
  6. On the desktop, right-click the 'Grove LED Bar' icon.
    grove led icon
    Choose 'Text Editor'
  7. Mousepad opens and displays a configuration file containing the path to the xLED_bar.py file
  8. Open a Terminal Window, enter python and the path to the Python file:
    python /home/pi/Desktop/IoT_Files/xLED_bar.py
    Press Enter and the program will execute, and illuminate the LED bar segments.
  9. Alternatively, double-click the Grove LED Bar icon on the desktop and choose 'Execute in Terminal'.
  10. To view the python program, open 'File Manager' to the path indicated above, find the file xLED_bar.py, right click it and choose 'Text Editor' .
    Examine the program code.

    LED test barLED Bar test on desktop


Exercise 2-Examine System Test
  1. These steps are performed on your Raspberry Pi.
  2. Using the skills learned, examine the program behind the Grove IoT icon on the desktop.
    Hint: it is connected to the program 'xSystemTest.py'
    grove led icon
  3. The program xSystemTest.py is much more complex.
    It is designed to test the proper functioning of all the sensors, actuators and the Raspberry Pi sound system.
  4. Run the program xSystemTest.py
    Note-this program is interactive, follow the prompts on the screen.
    Note-the program will read the test results aloud, if not troubleshoot the Raspberry Pi sound system.
  5. When done, the program appends the results to SystemTest.txt on the desktop.
    Open the file, scroll to the end.

Exercise 3-ScreenShot

These steps are done on the Raspberry Pi, or on your laptop using VNC.

  1. Take a screenshot of the last part of the SystemTest.txt, displaying the light level and current date.
    Note: this can be done using the Snipping Tool if you are running VNC, or use the scrot command if you are connected to the Raspberry Pi with a keyboard and mouse.

    system test system test output

  2. On your laptop save the screenshot as "IOT10" in your ' ' folder.

ScreenShot IOT10


Upload Screenshot

Submit to the appropriate D2L Assignment folder a screenshot that documents your work.


(50) 1. Upload your screenshot to the 'IOT10' D2L Assignment Folder.


Exercise 4-Reflections

Based on your experience in this exercise, consider the value of IoT devices for organizations, especially those needing to collect information.
Think about what type of problems a Raspberry Pi equipped with sensors and actuators could solve, and whether it could be cost-effective.
Businesses are deploying IoT 'solutions'-how can sensor equipped Raspberry Pis support or automate these efforts?

References:
Grove Pi:  Grove Pi Wiki
Grove Hat:  Rasberry Pi Weekly

(20) 2. Reflections-value
List a specific problem that a GrovePi equipped Raspberry Pi could solve.

(20) 3. Reflections-content
Research the internet on any topic related to Internet of Things sensors and actuators.
Provide one example of how an organization's product development department could use the GrovePi system to their organization's benefit.

Submit Assignment

When all tasks are completed press the Submit button.


(10) 4. Assignment submission

Congratulations! You have used the GrovePi system, an interface to sensors and actuators, on a Raspberry Pi single board computer.


-- WHEN DONE --
SHUTDOWN THE RASPBERRY PI
TURN OFF THE POWER