Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom Project Overview S.C.A.D.A. system Manna Energy Foundation , Rwanda Water Purification Project Objective Remotely.
Download ReportTranscript Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom Project Overview S.C.A.D.A. system Manna Energy Foundation , Rwanda Water Purification Project Objective Remotely.
Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom Project Overview S.C.A.D.A. system Manna Energy Foundation , Rwanda Water Purification Project Objective Remotely determine system health Perform control operations based on use (autonomous and supervisory) Report and record Features This design goal: 32 External ADC’s 6 Relay/Valve controls 4 Bus Power 3 Bus Data GSM communication Memory SD card Demo will not include max number of sensors Structural Setup System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory Layout System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory PCB Layout – Power Converters Schematic for 3.3V buck converter Uses LM3100 Chip Same as 5V and 10V buck Supplies max currents of 1.5 A Predicted max current needed is <1 A Schematic for 12 V Buck-Boost Uses LM5118 Converter can supply a max current of 3.5 amps Predicted Max current < 1.5 Amps Schematic for 24V Boost Uses LM3488 Max current of 3.4 Amps Predicted max value <1 Amp Progress Converters and PCB are designed and ordered No implemented circuit protection yet…. Separating headers on current PCB will be removed for finished project System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory Sensors Progress 5 Vdc 5 Vdc 24 Vdc 240 Vac 12 Vdc Pressure Meter 1 Pressure Meter 2 Flow Meter UV light Valve 0- 5 Vdc 0- 5 Vdc ADC 2- 40 mA ADS7828 0- 12 Vdc 0- 12 Vdc 3.3 Vdc I2C MC ATxmega 64A1 Analog/Digital Converter Sensors Flow Meter •Signet 2551 •No device due to cost ($1500 each) •Using a direct current output to act as device in testing •2 devices per system •Output: 4 to 20 mA •Temperature: -20° to 70° C Pressure Meter •Omega 209 •2 devices for testing •6 devices per system •Output: 0 to 5 V at .0125 V/division •Temperature: -20° to 80° C Sensors UV lights •Sterilight with ICE controller •1 device for testing •Water temperature: 2° to 40° C •UV wavelength: 254 nm •SP100-HO: 11 gpm •9000 hours of use Brass Actuated Ball Valve •DynaMatic AP20DA •1 device for testing •Temperature: -15° to 300 ° C Terminal Block •PT 1935006 •PCB attachment for ADC to sensors •16 connections Current System Our System Pressure Water Collection Tank Pressure Water Storage Tank Filter 1 UV light 1 UV light 2 Flow Expo Demo Setup Valve UV light “Flow” Pressure Pressure Pump *No Flow Meter due to cost System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory Microcontroller – ATxmega64A1 Calibration of internal 32 MHz RC DFLL oscillator Initialize and use communication modules SPI I2C UART Sample sensors with timer interrupt Log data to SD Card Parse and execute commands from cell module and base-station Monitor and control using programmed algorithm Buses and Connections 32kHz XTAL PDI Port Serial-toUSB IC (to basestation) RS-232 Debug Port Cell Module ATmega32 DMA UART UART I2C ADC SD Card SPI I2C Image source: http://www.atmel.com/dyn/resources/prod_documents/doc8067.p df Code Flow Power on Initialize modules Idle Timer 1 interrupt Sample sensors Write measurement to SD Card over DMA Command from base-station or cell WRITE Parse command READ Measurements No satisfy algorithm conditions? Read measurement from SD Card Yes Perform algorithm results of satisfied conditions Send Measurement Over Cell Return to Idle XXXX Other basestation/cell commands... Monitor and Control Algorithm Structure of one software algorithm block Condition 1 & Condition 2 & … Condition n Result 1 & Result 2 & … Result n … With additional blocks, control is a “sum of products” Monitor and Control Algorithm Condition types: Threshold(Value, Above/Below, SensorID) True/False(Condition) Result types: ChangeValve(Closed/Open) ChangeRelay(On/Off) SendAlert(AlertType, Method, Value) Memory – SD Card Use 512-byte block size Microcontroller allocates 512-byte buffer that can be read or written to SPI at 4MHz Hash table between time stamps and block addresses (grouped by day and hour) Memory: Schematic Memory: Process Flows for SD Card SD Card Initialization: SD Card Read Cycle: SD Card Write Cycle: GO_IDLE_STATE trace SEND_OP_COND trace System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory GSM Cellular AVR-GSM Calling card Embedded antenna Direct interface for USB terminal communication Off board connectors for power and buses FBD: GSM Module SIM300D Serial Interface FTDI SERIAL-USB USB PORT Serial Interface ATMEGA32 2 PIN Power EXT I/O I2C Laptop -DAQFactory -Real Term 12Volt DC -Prototype power -’Wall’ power I2C 6 pin ISP XMega 26 Pin IO Prototype Components GSM Cellular ATxmega64 /ATMega32 SIM300 Bus/ATMega32 I2C with defined commands ‘Get’ and ‘Set’ 2 Buffers Data Transmit (~160 byte) Data Receive (~160 byte) 100Khz ~ 400Khz UART commands ‘AT’ ASCII commands 2 Buffers UART RX 256 bytes UART TX 256 bytes 3x30 SIM300 Buffers External connections 12V, GND, SCL, SDA ISP programmer Status buffer/byte 115K2 desired Code Flow Peripheral Init (UART, I2C) GSM Data Received Cellular Init Monitor Traffic Status Byte MCU Command Back to Monitor Traffic No No Data Yes MCU Send Data Update Status MCU Data Request Data Available Update Status Forward GSM Cellular - Progress + Text messaging works (AT&T) + Uart for ATmega32 works (interrupt) + I2C master configured for ATMega32 (interrupt) - Needs to be slave + Fully defined status byte, bus protocol - Perform simple Uart/I2C test via terminal System Block Diagram Supply PV Batteries Power Pumps, UVs Analog MC Base Station Antenna GSM Memory Base Station Base Station Two ways of communication: Serial to Microcontroller (and ADC) Serial to GSM module Two drivers on DAQFactory Two sets of Sequences GSM cell needs AT parsing GSM Communication DAQFactory now communicates with GSM cell MCU Communication Will Communicate with ADC through STK 500 Dummy microcontroller Atmega 32 Transmit commands and receive status Interface Commands Cmd Type GET_Status Commands Sensor (ADC) Cmd 0x01 Tx Parameters Tx Cmd, \x01 Sensor ID (1\x02 32) (0x01-0x20) Rx Parameters Cmd, Sensor ID, Data length (12 bits), Data Measured Relay State 0x02 Cmd, \x02 Relay ID (0x01-0x04) \x04 Cmd, Relay ID, Data length (8 bits), State \x02 \x04 \x01 \x00 - Not Flipped Valve State 0x03 Cmd, Valve ID (0x1-0x2) \x03 \x01 Cmd, Valve ID, Data length (8 bits), State \x03 \x01 \x01 \x01 - Open Power Sensor 0x04 Cmd, Sensor ID (0x1-0x4) \x04 \x03 Cmd, Sensor ID, Data length (12 bits), Data Measured \x04 \x03 \x0F – Power Value \x01 Memory (Block) 0x05 Cmd, Day (0x0-0x1F), Beginning Hour, Ending Hour (00-23)(0x00-17) \x05 \x10 \x11 – 11am \x14 Cmd, Day, Beginning Hour, Ending Hour, Data length (512 Bytes), Measurements \x05 \x10 \x11 – 11am \x14 \x200 \23…. Cmd, \x06 Cmd, Data length (64 Bytes), Measurements \x06 \x40 \x23…. Cmd, MOD ID (0x1-0x3) \x07 \x01 Cmd, MOD ID, Data length (8 bits), Status \x07 \x01 \x01 \x00 0x06 Memory (Recent Measurement) 0x07 MOD Status Rx \x01 \x02 \x02 \x0F – Pressure \x65 Interface Commands Cmd Type Commands Cmd Tx Rx Parameters Rx Cmd, Log Mode ID (0x01-0x02) \x11 \x01 Cmd, Log Mode ID, Data length (8 bits), Confirmed State \x11 \x01 \x01 \x01 – Was set! And begins logging Data.. Relay State 0x12 Cmd, Relay ID (0x01-0x06) Relay State (00 or 01) \x12 \x04 \x01 Cmd, Relay ID, Data length (8 bits), Confirmed State \x12 \x04 \x01 \x01 - Was Flipped! Valve State 0x13 Cmd, Valve ID (0x1-0x2) \x13 \x01 Cmd, Valve ID, Data length (8 bits), Confirmed State \x13 \x01 \x01 \x01 – Was Opened! SET_Status Data Logging Mode 0x11 Tx Parameters ID Sensor Relay Valve Power Sensor MOD Log Mod 0x01 0x02 Pressure 1 Pressure 2 Relay 1 Relay 2 Valve 1 Valve 2 PS 1 PS 2 Microcontroller GSM Cell (Signal Strength, etc.) Keep logging Stop logging until requested! 0x03 0x04 0x05 0x06 0x07 AC Current 1 AC Current 2 Temperature Relay 3 Relay 4 PS 3 PS 4 DAQFactory ….. DAQFactory User Interface Division of Labor Sensors/ Power Relays Primary MCU Memory Cellular Jack Oakes X X X Scott Wisdom X X X Krista Hasling X X X Maryam Moghaddamzadeh X Jake Baldwin X Board Layout X X X X X Base station X X X X Budget Sub-Section Component Quantity Unit Cost Power Power Components IC's 1 10 $ $ Sensors ADS7828 MAX3377EEUD TPIC2603 RELAY Omegadyne Phidgets DynaMatic 5 2 2 2 2 2 1 $ $ $ $ 2.50 $ 100.00 $ 30.00 expensive Sample Sample Sample $ 5.00 $ 200.00 $ 60.00 memory card pin out board USB max3232 Serial db9 Header pins atxmega stk600 1 2 1 2 $ $ $ $ 18.00 - $ 18.00 Sample Capstone sample Sample 1 $ 102.00 $ 102.00 Cellular PIC-GSM AVR-GSM SIM CARD PIC-DEV board D-26 pin Header 6-pin Header 6-pin 1 1 2 1 2 2 2 $ $ $ $ $ $ $ 275.00 250.00 15.00 107.00 - $ $ $ $ $ $ $ 275.00 250.00 30.00 107.00 - BaseStation PCB Orders DAQ-FACTORY (Starter) Proto PCB Shipping 1 2 1 $ $ $ 45.00 33.00 14.88 $ $ $ 45.00 66.00 14.88 Memory Main Processor Running Total Cost 65.00 4.50 $ $ Date Purchased 65.00 45.00 9/21/2009 9/16/2009 9/19/2009 8/24/2009 9/15/2009 8/31/2009 8/24/2009 Packaging Integration Capstone DEMO UROP Funding EEF Manna Energy Running Totals Total Available $800.00 ?? $2,000.00 $2,800.00 Currently Spent $ 292.88 Remaining $507.12 $ $ $1,010.00 $1,517.12 990.00 1,282.88 Milestone 1 Power Converters-efficiency numbers at different load conditions Physical Demo Constructed ADC and uC working together (with dummy test voltages) Physical connections for out-of-box items design completed GSM receiving text messages through serial port I2C slave functional – GSM module GSM module commands working Read/Write to SD card I2C functional Define Communications Protocol Retrieve sensor data Retrieve requested data in base module from remote module – on-site One-way communication between base station and uC – through text Milestone 2 Power circuit protection implemented Physical connection to battery and PCB designed All sensors connected to ADC AC power safely working Sensors and ADC working together ADC data written to SD card using timer interrupts Implementing Basic Set commands Hard-coded antonymous control algorithm GSM two-way functionality with uC Parse received commands and update status in DAQFactory Questions?