Software Everywhere!

A project log for Firefighter Pump Training System

andyknittandyknitt 06/26/2014 at 15:481 Comment

Software Overview

There's a lot of software that goes into this project.  On the Raspberry Pi there are several Python scripts running, a MySQL database, and a PHP web interface.  There is also C code running on the Wixels.  Here is a basic block diagram that shows what's going on:

The heart of the system is a MySQL database that stores valve status (on/off) and pressure and flow information for each valve that's connected to the sytsem.  This system is an extension of the technique explained here that allows web control of Raspberry Pi GPIO.  In addition to web (LAN) control of the valves, we also want the simulated nozzle to be able to control them.  To accomplish this, there is a script that constantly checks the desired status of the valves in the MySQL database and turns the valves on or off whenever a status change is detected (remember we are using latching solenoids so we supply a pulse when we want to turn a valve on or off).  We can then have multiple programs or scripts reading and writing to the MySQL database as needed.  There is the possibility that multiple programs could be writing conflicting values to the database.  For instance, if an instructor uses his smartphone to turn a valve off while the simulated nozzle is trying to turn it on.  

Eventually I'll get source code posted for everything, hopefully soon!

System Configuration

In a basic, standalone application, the Raspberry Pi can be configured as a WiFi access point to allow smartphones or tablets to connect to it.  This configuration is shown here:

Another option is to have the Raspberry Pi connect to an existing wireless network created by an external wireless router.  This could potentially allow greater range between the Pi and the smartphone devices, and also allows the connected smartphones to access the internet via the existing wireless network while still controlling the valves.  Here is an illustration of this configuration:

This configuration still requires that the valve control system be within wireless range of the simulated nozzle.  The Wixel devices are very low power and don't have nearly the range of WiFi.  This can cause problems, especially if firefighters are taking the nozzle into a metal building with the valve control system outside.  Because we're using a MySQL database to track desired valve status, however, it's possible to have a remote computer on the same LAN edit that database.  If a Wixel is connected to this remote computer, we can set up a remote receiver for the Wixel away from the valve control system, thus extending the range using WiFi.  This is shown here:

Eventually I'd like to replace the Wixel boards with a WiFi based board like this.  Doing this would put everything in the system on the same WiFi network to allow the most flexibility.  It also eliminates the need to make sure that the Wixel and WiFi systems are running on different channels to reduce interference.  Multiple WiFi access points or WiFi repeaters could be added to the system as needed to improve range.  Here's what that might look like:


Avocadodude wrote 10/14/2014 at 05:55 point
Would you be willing to post how your sending a momentary pulse for the hbridge.
I understand setting the logic for polarity, but I am struggling with best
practice for sending a pulse for the latch.


  Are you sure? yes | no