50
Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Embed Size (px)

Citation preview

Page 1: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Jake BaldwinKrista Hasling

Maryam Moghaddam-ZadehJack Oakes

Scott Wisdom

Page 2: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Project OverviewProject OverviewS.C.A.D.A. system

Manna Energy Foundation , RwandaWater Purification

Project ObjectiveRemotely determine system healthPerform control operations based on use

(autonomous and supervisory)Report and record

Page 3: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

FeaturesFeaturesThis design goal:

32 External ADC’s 6 Relay/Valve controls4 Bus Power3 Bus DataGSM communicationMemory SD card

Demo will not include max number of sensors

Page 4: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Structural SetupStructural Setup

Page 5: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 6: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom
Page 7: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 8: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom
Page 9: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Schematic for 3.3V buck Schematic for 3.3V buck converterconverterUses LM3100 ChipSame as 5V and 10V buckSupplies max currents of 1.5 APredicted max current needed

is <1 A

Page 10: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Schematic for 12 V Buck-BoostSchematic for 12 V Buck-Boost Uses LM5118 Converter can supply a

max current of 3.5 amps

Predicted Max current < 1.5 Amps

Page 11: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Schematic for 24V BoostSchematic for 24V BoostUses LM3488Max current of 3.4 AmpsPredicted max value <1

Amp

Page 12: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

ProgressProgressConverters and PCB are designed and

orderedNo implemented circuit protection yet….Separating headers on current PCB will be

removed for finished project

Page 13: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 14: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Pressure Meter 1Pressure Meter 2

Flow MeterUV light

Valve12 Vdc

5 Vdc5 Vdc

24 Vdc240 Vac

ADCADS7828 MC

ATxmega64A1

I2C

0- 5 Vdc2- 40 mA

0- 12 Vdc

0- 5 Vdc

3.3 Vdc

0- 12 Vdc

Page 15: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Analog/Digital ConverterAnalog/Digital Converter

Page 16: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

SensorsSensorsFlow 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

Page 17: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

SensorsSensors

Terminal Block•PT 1935006•PCB attachment for ADC to sensors•16 connections

Brass Actuated Ball Valve•DynaMatic AP20DA•1 device for testing•Temperature: -15° to 300 ° C

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

Page 18: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom
Page 19: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom
Page 20: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Water Collection

Tank

Water Storage TankFilter 1

UV light 1

UV light 2

Pressure Pressure

Flow

Page 21: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

*No Flow Meter due to cost

Pressure

Pressure

UV lightValve

“Flow”

Pump

Page 22: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 23: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Microcontroller – Microcontroller – ATxmega64A1ATxmega64A1Calibration of internal 32 MHz RC DFLL oscillatorInitialize and use communication modules

SPII2CUART

Sample sensors with timer interruptLog data to SD CardParse and execute commands from cell module and

base-stationMonitor and control using programmed algorithm

Page 24: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Image source: http://www.atmel.com/dyn/resources/prod_documents/doc8067.pdf

SD Card

RS-232DebugPort

ADC

PDIPort

SPI

UART UART

DMA

I2C

I2C

Buses and ConnectionsBuses and Connections32kHzXTAL

Serial-to-USB IC

(to base-station)

CellModule

ATmega32

Page 25: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Code FlowCode FlowInitializemodules

Power on Idle

Samplesensors

Timer 1 interrupt

Writemeasurement

to SD Cardover DMA

Readmeasurementfrom SD Card

SendMeasurement

Over Cell

Measurementssatisfy algorithm

conditions?

Performalgorithmresults of

satisfied conditions

Yes

READ

Parse command

Return to Idle

No

Command from base-station or cell

Otherbase-station/cell commands...

WRITE

XXXX

Page 26: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Monitor and Control Monitor and Control AlgorithmAlgorithmStructure of one software algorithm block

…With additional blocks, control is a “sum of

products”

Condition 1

Condition 2

Condition n

&

& …

Result 1

Result 2

Result n

&

& …

Page 27: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Monitor and Control Monitor and Control AlgorithmAlgorithm

Condition types:Threshold(Value, Above/Below, SensorID)True/False(Condition)

Result types:ChangeValve(Closed/Open)ChangeRelay(On/Off)SendAlert(AlertType, Method, Value)

Page 28: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Memory – SD CardMemory – SD CardUse 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)

Page 29: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Memory: SchematicMemory: Schematic

Page 30: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Memory: Process Flows for Memory: Process Flows for SD CardSD Card

SD Card Initialization:

SD Card Read Cycle:

SD Card Write Cycle:

Page 31: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

GO_IDLE_STATE trace

SEND_OP_CONDtrace

Page 32: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 33: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

GSM CellularGSM CellularAVR-GSMCalling cardEmbedded antennaDirect interface for USB

terminal communicationOff board connectors for

power and buses

Page 34: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

FBD: GSM ModuleFBD: GSM Module

Serial Interface

Serial Interface

SIM300D

FTDISERIAL-

USB

ATMEGA32

I2C

XMegaLaptop 12Volt DC

Prototype Components

2 PIN Power EXT I/O

USB PORT

6 pin ISP

26 Pin IO

I2C

-DAQFactory-Real Term

-Prototype power-’Wall’ power

Page 35: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

GSM CellularGSM CellularATxmega64 /ATMega32 SIM300 Bus/ATMega32

I2C with defined commands ‘Get’ and ‘Set’

2 BuffersData Transmit (~160

byte)Data Receive (~160 byte)

100Khz ~ 400KhzExternal connections

12V, GND, SCL, SDA ISP programmer

UART commands ‘AT’ ASCII commands

2 BuffersUART RX 256 bytesUART TX 256 bytes

3x30 SIM300 BuffersStatus buffer/byte115K2 desired

Page 36: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Code FlowCode FlowPeripheral

Init (UART,

I2C)

Status Byte

Cellular Init

Monitor Traffic

Update Status

GSM Data

Received

Update Status

No DataYes

MCU Data

Request

Forward

No

Data Available

MCU Command

Back to Monitor Traffic

MCU Send Data

Page 37: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

GSM Cellular - ProgressGSM 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

Page 38: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

System Block DiagramSystem Block Diagram

Page 39: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

BaseBase StationStation

Page 40: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Base StationBase StationTwo ways of communication:

Serial to Microcontroller (and ADC)Serial to GSM module

Two drivers on DAQFactoryTwo sets of Sequences

GSM cell needs AT parsing

Page 41: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

GSM CommunicationGSM CommunicationDAQFactory now communicates with GSM

cell

Page 42: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

MCU CommunicationMCU CommunicationWill Communicate with ADC through STK

500Dummy microcontroller Atmega 32Transmit commands and receive status

Page 43: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Interface CommandsInterface CommandsCmd Type Commands Cmd Tx Parameters Tx Rx Parameters Rx

GET_Status Sensor (ADC) 0x01 Cmd,Sensor ID (1-32)(0x01-0x20)

\x01\x02

Cmd,Sensor ID, Data length (12 bits), Data Measured

\x01\x02\x02\x0F – Pressure \x65

Relay State 0x02 Cmd, Relay ID (0x01-0x04)

\x02\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….

Memory (Recent Measurement)

0x06 Cmd, \x06 Cmd,Data length (64 Bytes),Measurements

\x06\x40\x23….

MOD Status 0x07 Cmd,MOD ID (0x1-0x3)

\x07\x01

Cmd,MOD ID,Data length (8 bits),Status

\x07\x01\x01\x00

Page 44: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Interface CommandsInterface CommandsCmd Type Commands Cmd Tx Parameters Tx Rx Parameters Rx

SET_Status Data Logging Mode

0x11 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!

ID Sensor Relay Valve Power Sensor MOD Log Mod

0x01 Pressure 1 Relay 1 Valve 1 PS 1 Microcontroller Keep logging0x02 Pressure 2 Relay 2 Valve 2 PS 2 GSM Cell (Signal

Strength, etc.)Stop logging until requested!

0x03 AC Current 1 Relay 3 PS 3 DAQFactory0x04 AC Current 2 Relay 4 PS 40x05 Temperature 0x060x07 …..

Page 45: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

DAQFactory User InterfaceDAQFactory User Interface

Page 46: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Division of LaborDivision of Labor 

  PowerSensors/ Relays Primary MCU Memory Cellular

Base station

Board Layout

Jack Oakes X X   X X    

Scott Wisdom   X X X   X

Krista Hasling   X X X X  

Maryam Moghaddam-zadeh X       X X X

Jake Baldwin X   X     X X

Page 47: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Sub-Section Component Quantity Unit Cost Running Total Cost Date Purchased

Power Power Components 1 $ 65.00 $ 65.00 IC's 10 $ 4.50 $ 45.00

Sensors ADS7828 5 $ - SampleMAX3377EEUD 2 $ - SampleTPIC2603 2 $ - SampleRELAY 2 $ 2.50 $ 5.00 9/21/2009Omegadyne 2 $ 100.00 $ 200.00 Phidgets 2 $ 30.00 $ 60.00 9/16/2009DynaMatic 1 expensive 9/19/2009

Memory memory card pin out board 1 $ 18.00 $ 18.00 Main Processor USB 2 $ - Sample

max3232 1 $ - Capstone sampleSerial db9 2 $ - SampleHeader pinsatxmegastk600 1 $ 102.00 $ 102.00

Cellular PIC-GSM 1 $ 275.00 $ 275.00 8/24/2009AVR-GSM 1 $ 250.00 $ 250.00 9/15/2009SIM CARD 2 $ 15.00 $ 30.00 8/31/2009PIC-DEV board 1 $ 107.00 $ 107.00 8/24/2009D-26 pin 2 $ - $ - Header 6-pin 2 $ - $ - Header 6-pin 2 $ - $ -

BaseStation DAQ-FACTORY (Starter) 1 $ 45.00 $ 45.00 PCB Orders Proto PCB 2 $ 33.00 $ 66.00

Shipping 1 $ 14.88 $ 14.88 PackagingIntegrationCapstone DEMO

Total Available Currently Spent RemainingUROP Funding $800.00 $ 292.88 $507.12EEF ??Manna Energy $2,000.00 $ 990.00 $1,010.00Running Totals $2,800.00 $ 1,282.88 $1,517.12

Page 48: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Milestone 1Milestone 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

Page 49: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Milestone 2Milestone 2Power circuit protection implementedPhysical connection to battery and PCB designedAll sensors connected to ADCAC power safely workingSensors and ADC working togetherADC data written to SD card using timer interruptsImplementing Basic Set commandsHard-coded antonymous control algorithmGSM two-way functionality with uCParse received commands and update status in

DAQFactory

Page 50: Jake Baldwin Krista Hasling Maryam Moghaddam-Zadeh Jack Oakes Scott Wisdom

Questions?Questions?