element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
On the Line
  • Challenges & Projects
  • Design Challenges
  • On the Line
  • More
  • Cancel
On the Line
Forum Forum#5: UNO Q & Grove Starter Kit V3 - Building the Safety Alert System (ILS)
  • News
  • Projects
  • Forum
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join On the Line to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 35 subscribers
  • Views 125 views
  • Users 0 members are here
Related

Forum#5: UNO Q & Grove Starter Kit V3 - Building the Safety Alert System (ILS)

skruglewicz
skruglewicz 1 month ago

Forum #5: UNO Q & Grove Starter Kit V3 

Hello fellow challengers

Building on my Forum #4 post—where I outlined using the Arduino UNO Q's AI vision capabilities to detect safety gear (glasses/vests) and Red Zone incursions—it’s time to bring that system into the physical world. Detection is only half the battle; we need to instantly alert operators when a safety breach occurs.

For this phase, I will be using the Grove Starter Kit V3 by connecting (piggybacking) its Base Shield onto our Arduino UNO Q. Here is my extensive, step-by-step novice-friendly guide to designing, coding, and implementing this alert system using the Arduino App Lab.

1. Hardware Integration: Piggybacking the Base Shield on the UNO Q

What does "piggybacking" mean? The Grove Base Shield V3 is an expansion board (a "shield"). The Arduino UNO Q maintains the classic UNO form factor and pin layout. "Piggybacking" simply means we align the male pins on the bottom of the Grove Base Shield with the female headers on the top of the UNO Q, and press them firmly together.

Why use the Base Shield?

Instead of dealing with messy wires, resistors, and breadboards, the Base Shield gives us neat, plug-and-play "Grove connectors." We just use the provided 4-pin cables to snap our sensors and output devices into the board.

2. Selecting the Ideal "Alert" Modules

While the Grove Kit is known for its "sensors" (which take data in), for an alert system, we need "actuators" (which put data out). To create a robust, multi-sensory alert system, I have selected the following components from the Grove Starter Kit V3:

  1. Grove - Red LED (Visual Beacon): A flashing red light is the universal sign of danger. This will catch the operator's eye immediately.

  2. Grove - Buzzer (Audio Siren): Factories and workspaces can be distracting. A loud, piercing auditory alarm ensures the alert is heard even if the operator isn't looking at the system.

  3. Grove - LCD RGB Backlight (Status Display): We need to tell the operator why the alarm is going off. Is it a missing vest? A Red Zone incursion? This screen will display the exact text and change its backlight color to red during an emergency.

  4. Grove - Button (Reset Sensor): A physical input sensor. Once the operator acknowledges the alarm and corrects the safety issue, they press this button to silence the system.

3. Data Flow & System Architecture

Before we code, it helps to visualize how information travels through our system. The UNO Q is special because it has a "Dual-Brain": a Qualcomm processor (for AI) and an STM32 microcontroller (for hardware).

Here is the flowchart of our logic:

========================================================================
                      SYSTEM DATA FLOW DIAGRAM
========================================================================

 [ USB Camera ] --> Captures video feed of the work zone
       |
       v
 +---------------------------------------------------+
 |                  ARDUINO UNO Q                    |
 |                                                   |
 |  1. QUALCOMM MPU (Python via App Lab)             |
 |     - Runs AI Object Detection (Glasses/Vest)     |
 |     - Detects "Red Zone" Incursion                |
 |            |                                      |
 |            v (Arduino Bridge API triggers alert)  |
 |            |                                      |
 |  2. STM32 MCU (C++ Sketch via App Lab)            |
 |     - Receives "ALERT" signal                     |
 |     - Controls the Grove hardware pins            |
 +---------------------------------------------------+
       | (Signals sent through Base Shield)
       v
 +---------------------------------------------------+
 |             GROVE BASE SHIELD V3                  |
 +---------------------------------------------------+
       |               |               |             |
   (Port D2)       (Port D3)       (Port I2C)    (Port D4)
       |               |               |             |
       v               v               v             v
   [Grove LED]   [Grove Buzzer]  [Grove RGB LCD] [Grove Button]
  (Visual Alert)  (Audio Siren)  (Text Warning)  (Reset Input)
========================================================================

4. Step-by-Step Implementation Instructions

Step 1: Connect the Hardware

  1. Unplug your UNO Q from power.

  2. Align and press the Grove Base Shield V3 onto the top of the UNO Q.

  3. Using the Grove cables, connect the Grove LED (with a Red bulb) to port D2.

  4. Connect the Grove Buzzer to port D3.

  5. Connect the Grove Button to port D4.

  6. Connect the Grove RGB LCD to any of the I2C ports.

Step 2: Open Arduino App Lab

  1. Connect the UNO Q to your computer via USB-C.

  2. Launch Arduino App Lab.

  3. Create a new "App". App Lab will open a dual-pane window. We will be working in the C++ Sketch pane, which controls the Base Shield hardware.

5. Coding Examples: Sketches for Each Sensor/Module

Below are the beginner-friendly C++ sketches for each individual module so you can understand how they work in isolation. Note: In App Lab, these are standard Arduino C++ commands.

A. The Visual Beacon (Grove LED)

// --- GROVE LED SKETCH ---
// This sketch flashes the LED to simulate an emergency beacon.

// 1. Define the pin where the LED is connected
const int ledPin = 2; // Port D2 on the Base Shield

void setup() {
  // setup() runs once when the board turns on.
  // We tell the UNO Q that the ledPin is an OUTPUT (sending electricity out)
  pinMode(ledPin, OUTPUT); 
}

void loop() {
  // loop() runs over and over forever.
  digitalWrite(ledPin, HIGH); // Turn the LED ON (HIGH = electricity flowing)
  delay(500);                 // Wait for 500 milliseconds (half a second)
  digitalWrite(ledPin, LOW);  // Turn the LED OFF (LOW = no electricity)
  delay(500);                 // Wait for 500 milliseconds
}

B. The Audio Siren (Grove Buzzer)

// --- GROVE BUZZER SKETCH ---
// This sketch sounds a repeating alarm tone.

const int buzzerPin = 3; // Port D3 on the Base Shield

void setup() {
  pinMode(buzzerPin, OUTPUT); // The buzzer receives signals, so it's an OUTPUT
}

void loop() {
  digitalWrite(buzzerPin, HIGH); // Turn buzzer ON (makes a loud beep)
  delay(200);                    // Wait 0.2 seconds
  digitalWrite(buzzerPin, LOW);  // Turn buzzer OFF
  delay(200);                    // Wait 0.2 seconds
}

C. The Status Display (Grove RGB LCD)

// --- GROVE RGB LCD SKETCH ---
// This sketch changes the screen color to Red and prints a warning.

// We need to include special libraries (instruction manuals) for the screen and I2C communication.
#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd; // Create an LCD object to control the screen

void setup() {
  // Initialize the screen: 16 columns and 2 rows of characters
  lcd.begin(16, 2);
  
  // Set the backlight color to RED (Red, Green, Blue values from 0-255)
  lcd.setRGB(255, 0, 0); 
  
  // Print our warning message on the top row
  lcd.print("! ALARM ACTIVE !");
  
  // Move the invisible cursor to the start of the bottom row (column 0, row 1)
  lcd.setCursor(0, 1);
  lcd.print("RED ZONE BREACH");
}

void loop() {
  // Nothing needs to loop here, the text stays on the screen!
}

D. The Alarm Reset (Grove Button)

// --- GROVE BUTTON SKETCH ---
// This sketch reads the physical world (sensor input) to check if a button is pressed.

const int buttonPin = 4; // Port D4 on the Base Shield

void setup() {
  pinMode(buttonPin, INPUT); // The button sends data IN to the board
  Serial.begin(9600);        // Open a communication line to our computer screen
}

void loop() {
  // Read the state of the button (HIGH = pressed, LOW = unpressed)
  int buttonState = digitalRead(buttonPin);
  
  if (buttonState == HIGH) {
    Serial.println("Reset Button Pressed!"); // Send a message to the computer
  }
  delay(100); // Small delay to prevent reading the button too fast
}

6. The Final Implementation: Bringing it All Together

In a real-world scenario on the UNO Q, the AI camera detects the missing safety glasses and flips an internal variable to true. Here is the combined App Lab C++ sketch that pulls all our modules together into one cohesive safety system!

// ====================================================================
// FULL SAFETY ALERT SYSTEM SKETCH (Arduino App Lab C++)
// ====================================================================

#include <Wire.h>
#include "rgb_lcd.h"

// Define Hardware Pins
const int ledPin = 2;
const int buzzerPin = 3;
const int buttonPin = 4;

// Initialize LCD
rgb_lcd lcd;

// This variable acts as our system state. 
// In a full App Lab project, the Python AI script would change this variable 
// via the Arduino Bridge when it detects a missing hardhat or Red Zone breach.
bool alarmTriggered = true; 

void setup() {
  // Configure Pins
  pinMode(ledPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(buttonPin, INPUT);
  
  // Start LCD and default to a Green "Safe" state
  lcd.begin(16, 2);
  setSafeState();
}

void loop() {
  // Check if the operator pressed the reset button
  int buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH && alarmTriggered == true) {
    // If button pressed during an alarm, clear the alarm
    alarmTriggered = false;
    setSafeState();
  }

  // If the alarm is active, flash the lights and sound the buzzer
  if (alarmTriggered == true) {
    triggerAlarmCycle();
  }
}

// Custom function to handle the "All Clear" state
void setSafeState() {
  digitalWrite(ledPin, LOW);    // Turn off LED
  digitalWrite(buzzerPin, LOW); // Turn off Buzzer
  
  lcd.setRGB(0, 255, 0);        // Set LCD to Green
  lcd.clear();                  // Clear old text
  lcd.print("SYSTEM SECURE");   // Print safe message
  lcd.setCursor(0, 1);
  lcd.print("Monitoring...");
}

// Custom function to handle the flashing/beeping of the alarm
void triggerAlarmCycle() {
  // Set LCD to Red and display warning
  lcd.setRGB(255, 0, 0);
  lcd.setCursor(0, 0);
  lcd.print("! SAFETY ALERT !");
  lcd.setCursor(0, 1);
  lcd.print("ZONE BREACH     ");

  // Flash ON
  digitalWrite(ledPin, HIGH);
  digitalWrite(buzzerPin, HIGH);
  delay(300);
  
  // Flash OFF
  digitalWrite(ledPin, LOW);
  digitalWrite(buzzerPin, LOW);
  delay(300);
}

Conclusion

By utilizing the Grove Base Shield V3, we bypass complex wiring and focus strictly on logic and implementation. The dual architecture of the UNO Q allows the heavy lifting of AI detection to occur behind the scenes, seamlessly triggering our STM32 microcontroller to fire off real-world visual, auditory, and textual alerts using our Grove actuators.

I'd love to hear feedback from other challengers! Have any of you experimented with adding the Grove Smart Relay to actually shut down machinery during a Red Zone incursion?

Looking forward to your comments!

  • Sign in to reply
  • Cancel
  • DAB
    DAB 1 month ago

    Very good update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • colporteur
    colporteur 1 month ago

    Your approach to using the Grove Starter Kit to prototype is a simple yet elegant way to eliminate annoy connection issues. Nice touch!  

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube