Remote Aquarium Monitor and Control System Christopher Bunk Joshua Hoiland.
-
date post
20-Dec-2015 -
Category
Documents
-
view
218 -
download
4
Transcript of Remote Aquarium Monitor and Control System Christopher Bunk Joshua Hoiland.
Remote Aquarium Monitor and Control
System
Christopher BunkJoshua Hoiland
What if I have to leave it?
Common ConcernsCommon Concerns
Aquarium accessoriesAquarium accessories LightLight Water heaterWater heater Filter/pumpFilter/pump
FeedingFeeding How can I be How can I be suresure my fish are OK? my fish are OK?
We have the solution.We have the solution.
System ArchitectureSystem Architecture
Remote SystemSystem PC
RS232
InternetTCP/IPTCP/IP
Control &Monitoring
System
USB
WEBCAM HC12
NIC
NIC
USB
Serial
User InterfaceUser Interface
MeasuredTemperatu
re
DesiredTemperatu
re
SetTemperature
Feed Fish
Temperature History
Help
LogOut 22
Food Remainin
g
ON
OFF
PUMPS LIGHTS
GUI FeaturesGUI Features
Control Monitoring
Feed Fish Fish food remaining doses
Adjust Desired Water Temperature
Water Temperature
Light On/Off Lights On/Off
Filtration System On/Off Filtration System On/Off
Set/Reset Food Count Web Cam Streamed Image
Temperature trended graph
System System DesignDesign
System Control DiagramSystem Control DiagramAquariumLightHeaterTemperature
sensorFilterFeederInternetRemote ClientPC ServerHC-12Web CamRelayVoltage dividerRelayRelay
ThermistorThermistor
R25 3.3K ±5% Temperature range:
-40 to +125 °C Maximum dissipation
500 mW Cost: $0.68
BCcomponents 2322 640 3338
RelayRelay
Compact 1-amp SPST Reed Relay
Coil Voltage 5 VDC Contact Rating 125
VAC Operation time: 1.5 ms Cost: $2.49
Radio Shack275 0232
Stepper MotorStepper Motor
7.5˚ per step Power Source: 5 VDC
Feeding MechanismFeeding Mechanism Allows 31 feedings
SIDE VIEWstepper motorFood compartmentsfeeder opening
Feeding MechanismFeeding Mechanism
stepper motorFood compartmentsTOP VIEW
MotorolMotorola HC-12a HC-12
(provided by (provided by RIT)RIT)
Highlighted Highlighted ports are ports are usedused
HC-12 Port UsageHC-12 Port Usage AA
Pin 0 – Pump RelayPin 0 – Pump Relay Pin 1 – Light RelayPin 1 – Light Relay Pin 2 – Heater RelayPin 2 – Heater Relay
BB Pins 0-3 – Stepper Motor ControlPins 0-3 – Stepper Motor Control
ADAD Pin 4 – Analog Thermistor InputPin 4 – Analog Thermistor Input
HC-12 Port UsageHC-12 Port Usage Port S used for serial communicationPort S used for serial communication
Serial Communication Serial Communication CodeCode
serial_init: ; To use the serial port, one must set the baud rate. ; The 68HC12 is capable of speeds up to 38400. Here, we ; set it to 9600 baud. The value here is a 16 bit divisor. ; ldd #52 ; Value from Baud Rate Generation Table std $C0 ; SCI 0 Baud Rate ldaa #$0C ; Enable transceiver staa $C3 ; SCI 0 Control 2 rts
putchar: ; putchar outputs a character to serial port 0 ; Call with character in register A ; brclr $C4, #$80 putchar ; check SCI 0 Status 1 staa $C7 ; SCI 0 Data Low Byte rts
Control AlgorithmsControl Algorithms
Temperature Control
if( heater_on ){ if( current_temperature > desired_temperature ){ turn_off_heat(); }} else{ if( current_temperature < ( desired_temperature - tolerance ) ){ turn_on_heat(); }}
Control AlgorithmsControl Algorithms
Feeder Control
if( num_feedings_left > 0 ){ move_stepper( CCW 1 slot ); num_feedings_left -= 1;} else { return error( no food left );}
Software ArchitectureSoftware Architecture
PC Server ArchitecturePC Server Architecture
USBPORT
SerialPort
VideoControl And
MoitoringSystem
RS-232USB
Windows 2000System
Apache Web ServerPort 80
PropriataryStreamingSoftware
fromWeb Cam
Manufacturer
8420
Java ServletPort 8420 - Com Relay
Program
Port 8421 - Servlet Interface
Communicationsrelay programbetween serial
port and TCP/IPPort 8420
MySQLDatabase
TBDPORT
RemoteComputer
Web Page request, AppletCode and XML temerature
file request
Servlet/Applet Protocol
Web Cam Streamed Video
With a little help from With a little help from Open SourceOpen Source
Apache web serverApache web server PHP Module InstalledPHP Module Installed MySQL Database Running in MySQL Database Running in
BackgroundBackground Com Relay ProgramCom Relay Program
The ServletThe Servlet
Communicates in between 2 ports; Communicates in between 2 ports; 8420,8421.8420,8421.
Ensures simultaneous commands to Ensures simultaneous commands to the serial port are not made.the serial port are not made.
Trend temperature data to MySQL Trend temperature data to MySQL database every five minutesdatabase every five minutes
Web Cam ServerWeb Cam Server Will rely on Web Cam’s proprietary streaming Will rely on Web Cam’s proprietary streaming
technology.technology. Applet will be built around it’s viewing Applet will be built around it’s viewing
dimensionsdimensions
Com RelayCom Relay Simply Relays serial communication and Simply Relays serial communication and
TCP/IP communication by seamlessly TCP/IP communication by seamlessly stripping the header from the packetsstripping the header from the packets
Makes dealing with serial port simpleMakes dealing with serial port simple
Remote PC ArchitectureRemote PC Architecture
Web Page is loaded that streams fish Web Page is loaded that streams fish tank video, and loads control and tank video, and loads control and monitoring appletmonitoring applet
Applet connects to servlet and Applet connects to servlet and continually polls for status unless a continually polls for status unless a command is requestedcommand is requested
Help and Logout Options availableHelp and Logout Options available
SecuritySecurity
Port 80 requests password protected Port 80 requests password protected through apache htaccess filesthrough apache htaccess files
Port 8420 only accepts local Port 8420 only accepts local connectionsconnections
Port 8421 Requires password and day Port 8421 Requires password and day of the year hash to begin of the year hash to begin communicationcommunication
All other ports configured to be All other ports configured to be blocked blocked
Temperature MonitoringTemperature Monitoring Thermistor look up table in GUI and Servlet so Thermistor look up table in GUI and Servlet so
only un scaled values are sent to HC-12.only un scaled values are sent to HC-12. Applet retrieves a dynamically created XML file Applet retrieves a dynamically created XML file
for last 24 hours of temperature data and for last 24 hours of temperature data and displays on XY graphdisplays on XY graph
Desired temperature can be selected and the set Desired temperature can be selected and the set temperature button will confirm the changetemperature button will confirm the change
XML FormatXML Format
<TEMP> – Represents one temperature readingAttributes:Id - Unique identifier for every readingTime - Date and Time Stamp of readingContentValue - Recorded Scaled Value for temperature in FahrenheitExample Entry<TEMP Id=”24” Time= “2002-09-17 01:06:51”>24.5</TEMP>
Expandability / Other Expandability / Other UsesUses
Architecture fits a wide variety of Architecture fits a wide variety of remote monitoring solutionsremote monitoring solutions
Expand to other types of pets, Expand to other types of pets, children, housechildren, house
Allow monitoring only connections Allow monitoring only connections and control connectionsand control connections
Cost EstimatesCost Estimates
Item Quantity CostHC-12 1 N/APC Server 1 N/AAquarium 1 N/AFish/misc. aquarium supplies — $25 Web cam 1 $80 Aquarium light 1 $25 Aquarium Heater 1 $17.50 Filter/pump 1 $15 stepper motor (for feeder control) 1 N/ASubmersible thermistor temperature sensor 1 $1 120V -> 5V relays 3 3 @ $2.50 = 7.50Totals $171
Project MilestonesProject Milestones
Project Milestone Scheduled Completion Modified Completion Current StatusPreliminary research and proposal 09/15/02 Complete (9/15/02)Design presentation 09/17/02 Complete (9/15/02)
Control the relays with HC-12 09/24/02 09/30/02 Complete (9/30/02)
Calibrate temperature sensor 09/24/02 10/03/02 Complete (10/4/02)Streaming web cam media 09/24/02 Complete (9/22/02)Feeder control device 10/01/02 10/15/02 Complete (10/20/02)Local control software functional 10/08/02 10/17/02 Complete (10/20/02)
PC and HC-12 communication 10/15/02 10/15/02 Complete (10/16/02)Interface control software with web interface 10/15/02 Complete (10/15/02)Hardware testing 10/22/02 10/26/02 PartialSoftware testing 10/22/02 10/26/02 Partial
Project Presentation and Paper 10/29/02 Partial
?’s?’s