Skip to content

A React-based web application that simulates an analog airspeed indicator for the Piper PA-28 aircraft. The app uses GPS data to display real-time ground speed in an authentic-looking gauge interface.

License

Notifications You must be signed in to change notification settings

twn-wi11i4m/PA-28-Airspeed-Indicator-Web-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PA-28 Airspeed Indicator Web App

A React-based web application that simulates an analog airspeed indicator for the Piper PA-28 aircraft. The app uses GPS data to display real-time ground speed in an authentic-looking gauge interface.

Live Demo

Try the app live at: https://pa-28-airspeed-indicator-web-app.williamntw.com

Notes:

  • The demo is served over HTTPS — required for browser Geolocation.
  • For best GPS accuracy, open the URL on a mobile device and grant Location permission when prompted.
  • If GPS permission is denied or unavailable, use the built-in Test Mode (🧪 Enable Test Mode) to simulate speeds.
  • Report issues or feedback via the project repository (see repository links in this README).

Features

  • Authentic Full-Circle Design: 270° sweep gauge matching real aircraft instruments
  • Extended Speed Range: 0-200 knots with professional aviation layout
  • Live GPS Integration: Real-time speed tracking using the Geolocation API
  • Aviation-Standard Color Arcs:
    • Green (60-120kt) - Normal operating range
    • Yellow (120-160kt) - Caution range
    • Red (160-200kt) - Danger zone
  • PA-28 V-Speeds: Labeled critical speeds with colored triangle markers
  • Professional Needle: Tapered white needle with shadow effects
  • Precision Tick Marks: Major ticks every 20 knots, minor ticks every 10 knots
  • Digital Display: Large numeric readout positioned below the gauge
  • Status Monitoring: GPS connection status and comprehensive error handling
  • Test Mode: Built-in simulator for demonstration without GPS
  • Mobile Responsive: Optimized layout that fits any screen without scrolling
  • iOS Compatible: Enhanced iPhone/iPad GPS permission handling

PA-28 V-Speeds

The gauge displays critical speeds for Piper PA-28 aircraft with colored triangle markers. The values used by the app are defined in the code and can be edited if you need to tweak them for a different aircraft or variant. Current values (as used by the webapp) are:

Speed Value Description Color
Vso 47 kt Stall Speed (landing configuration) Red
Vs 50 kt Stall Speed (clean) Red
Vx 64 kt Best Angle of Climb Green
Vy 76 kt Best Rate of Climb Green
Va 112 kt Maneuvering Speed Green
Vno 121 kt Maximum Structural Cruising Speed Yellow
Vne 148 kt Never Exceed Speed Red

Speed Range Arcs

  • Green Arc (56-121 kt): Normal operating range (as drawn on the gauge)
  • Yellow Arc (121-148 kt): Caution range
  • Red Arc (148-150 kt): Danger / never-exceed line

Gauge Layout

  • 270° Sweep: Three-quarter circle from bottom-left to bottom-right
  • 0-200 Knot Range: Extended range covering all GA aircraft speeds
  • Precision Markings: Major ticks every 20kt, minor ticks every 10kt
  • Authentic Styling: Black face, white markings, metallic bezel

Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Local Development

  1. Clone or download the project files

  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start
  4. Open your browser to http://localhost:3000

Production Build

  1. Create optimized build:

    npm run build
  2. Deploy the build folder to your hosting service

Usage

GPS Requirements

  • HTTPS Required: GPS functionality only works on HTTPS or localhost
  • Location Permission: Browser will request location access
  • Mobile Recommended: Best GPS accuracy on mobile devices
  • Motion Required: GPS speed is only available when moving

iPhone/iPad Setup

If you get "GPS Permission Denied" on iPhone:

  1. Open iPhone Settings
  2. Go to: Settings → Privacy & Security → Location Services
  3. Find Safari: Scroll down and tap "Safari"
  4. Enable Location: Select "While Using App" or "Ask Next Time"
  5. Return to webapp: Refresh the page
  6. Grant Permission: Tap "Allow" when Safari asks for location

Alternative: Use the built-in "Test Mode" to simulate different speeds without GPS.

Testing Without GPS

For development/testing without actual GPS movement:

  1. Use the "🧪 Enable Test Mode" button when GPS fails
  2. Use the speed slider to simulate different airspeeds
  3. Click V-speed buttons for quick testing (Vso, Vx, Vy, Vno)
  4. Or use browser developer tools to simulate location

Deployment Options

Cloudflare Pages (Recommended)

  1. Connect your GitHub repository
  2. Set build command: npm run build
  3. Set build output directory: build
  4. Deploy automatically on push

Netlify

  1. Drag and drop the build folder
  2. Or connect via Git with same build settings

Vercel

  1. Import project from GitHub
  2. Vercel will auto-detect React settings

Technical Details

Architecture

  • React 18: Component-based UI
  • HTML5 Canvas: High-performance gauge rendering
  • Geolocation API: Native browser GPS access
  • CSS3: Responsive design with animations

Browser Compatibility

  • Chrome 60+
  • Firefox 55+
  • Safari 11+
  • Edge 79+

Performance

  • Optimized canvas rendering
  • Efficient GPS polling (1Hz update rate)
  • Responsive design for all screen sizes

Safety Notice

⚠️ This application is for educational and reference purposes only

  • Not certified for actual flight navigation
  • Ground speed ≠ airspeed (no wind correction)
  • Always use official aviation instruments for flight

Customization

Modifying V-Speeds and gauge ranges

Constants and configuration used by the gauge have been extracted to a small module for easier editing:

  • V‑speeds, arc ranges, gauge numeric limits, and color ranges live in src/components/gaugeConstants.js.
  • The V‑speeds are exported as V_SPEEDS in that module. Edit that file to change labels, values or colors.

Example (in src/components/gaugeConstants.js):

export const V_SPEEDS = [
  { speed: 47, label: "Vso", color: "#E12C2C" },
  // ...
];

export const GAUGE_CONFIG = {
  minSpeed: 20,
  maxSpeed: 150,
  // ... other gauge settings
};

The legend UI has also been moved into its own component at src/components/VSpeedsLegend.js for clarity.

License

MIT License - Feel free to use and modify for your projects.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Support

For issues or questions:

  • Check browser console for error messages
  • Ensure HTTPS and location permissions
  • Test GPS functionality while in motion

License

This project is licensed under the MIT License. See the LICENSE file for details


Crafted with ❤️ by William NG

About

A React-based web application that simulates an analog airspeed indicator for the Piper PA-28 aircraft. The app uses GPS data to display real-time ground speed in an authentic-looking gauge interface.

Topics

Resources

License

Stars

Watchers

Forks