Home Wireless Control - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Home Wireless Control

Description:

Project A - 044167 Home Wireless Control Part A Final Presentation Students Ehud Ravitz Lee Blum Instructor Konstantin Sinyuk Project Goals General Block Design ... – PowerPoint PPT presentation

Number of Views:138
Avg rating:3.0/5.0
Slides: 33
Provided by: Eit99
Category:

less

Transcript and Presenter's Notes

Title: Home Wireless Control


1
Home Wireless Control
Project A - 044167
Part A Final Presentation
Students Ehud Ravitz Lee Blum Instructor Konstant
in Sinyuk
2
Project Goals
Create a data and control network over household
appliances.
Should be implemented on cheap software.
Should be friendly to both users and application
developers.
Check future interfacing of the System with
external Controllers (iPaq, CAN2USB)
3
General Block Design
4
Network Structure
  • Each household appliance will have an End Point
    embedded within it.
  • In Each room in the house, an Access Point will
    control over all the End Points in the room using
    a Bluetooth wireless connection.
  • All the Access Points will communicate with one
    another through a wired CAN network.

5
Design Tools
  • Microchip PIC18F452/8 on PICDEM2 boards.
  • MCC18 compiler using MPLab IDE.
  • Philips Bluetooth units.

6
End Point Design
  • A Microchip PIC18F452 controls a Philips
    Bluetooth unit using UART.
  • The application on the PIC controls the
    appliance, according to Bluetooth data transfers
    with the Access Point.

Household Appliance
PIC18F452
UART
Philips Bluetooth Unit
BT
7
End Points could also be
  • CAN2USB control over a PC connected to the web
    (Control Protocols over the Internet)
  • An iPaq unit, setting as a remote control (using
    BT)
  • And many more

8
Access Point Design
  • A Microchip PIC18F458 (with CAN support) controls
    a Philips Bluetooth Unit using UART.
  • Each Access Point, located in a different room of
    the house, can communicate with up to seven local
    End Points using Bluetooth.
  • Extra E2PROM memory stores the Access Points
    database of local and total End Points
    (controlled with I2C).
  • The PIC uses CAN 2.0B to communicates between
    different Access Points, enabling control of an
    Access Point on End Points in different rooms.

9
Access Point Design
CAN controller
PIC18F458
BT
10
Specifications
Microchip PIC18F452/8
DC 40 MHz Operating Frequency
32KBytes Internal Program Mem.
1536 Bytes Data Memory
256 Bytes Data EEPROM Memory
2 18 8 21 Interrupt Sources
A, B, C, D, E I/O Ports
4 Timers
Addressable USART, MSSP ( CAN on 8) MSSP, CAN, Serial Communications
Yes Parallel Communications (PSP)
8 input channels 10-bit Analog-to-Digital Converter
2 0 8 2 Analog Comparators
2 No 8 Yes Analog Comparators VREF Output
Yes Programmable Low Voltage Detect
Yes Programmable Brown-out Reset
2 No 8 Yes CAN Module
75 Instructions Instruction Set
Yes 40-pin PDIP
11
Specifications
Phillips Bluetooth Philips Components V1.1
2.4GHz to 2.4835GHz Operating Frequency
Class 2 (0 dBm nominal) Transmit Output Power
Up to 15m (with integral antenna) Operating range
Less than 80dBm _at_ 1E-3 BER Receiver Sensitivity
Embedded software stack supporting an HCI interface Embedded Software
Point to Multipoint (up to 7 slaves) Master/Slave switching supported Network Topology
USB v1.1, UART at up to 921 kbps (low voltage serial interface) Interface
3 to 3.4V (or direct power from USB connection) Power Supply
Idle lt 2mA File transfer 70mA Peak lt 100mA Current consumption
-10 to 55C Operating Temperature
-40 to 85C Storage Temperature
45 x 48 x 7mm Dimensions
12
Work Frequencies
  • CAN max. freq. is 1Mbps.
  • Bluetooth effective freq. is 750KB/sec.
  • PIC to BT UART connection is in 115,200 bps.
  • PICs effective throughput is 10MIPS.
  • Therefore, the CAN connection can support a
    system with four Access Points, each one
    transferring one End Points data, as expected.

13
Systems Advantages
  • The Bluetooth Protocol is a standard. Making
    generic as possible to produce. Should be
    embedded in all household appliances, of all
    manufacturers.
  • Strong enough to handle intended rate of
    communications (previous slide), mainly short
    data transfers for control functions.
  • Cheap Hardware.

14
Communication Algorithm
  • Access Point (AP) is always Master.
  • End Points (EP) are always Slaves.
  • AP Scans for updated EPs in area every X sec.
  • AP Calls EP when found.
  • EP stores APs BD Address to know who is his
    Master.
  • EP refuses other APs trying to connect him when
    is with a Master.
  • Packets sent from APs to EPs
  • Command
  • Inquiry for Data
  • Packets sent from EPs to APs
  • Data in response to inquiry / command

15
Debugging Methods
  • The MPLab Debugger, supplied with the PIC
    Development Kit.
  • The LCD, supplied on the PICDem 2 board, for
    faster, easier and specific tests.
  • The BT C project on PC.
  • LEDs

16
Final System Block Design
  • Opaque Background implemented modules

17
Part A status
  • Modules to control the PIC UART, LCD.
  • A Bluetooth module (BT stack on PIC
    implementation).
  • A Server (Access Point) Application.
  • A Client (End Point) Application.

18
1. UART module
  • An initialization function.
  • Read / Write functions.
  • Close UART function (closes UART after waiting
    for all data to be sent / received).
  • An interrupt service routine to control the UART
    module.
  • This module was compiled to be a standard EUART
    library.

19
2. LCD module
  • An initialization function.
  • Functions to write Strings and Constants to the
    LCD screen.
  • This module was compiled to be a standard LCD
    library.

20
3.1. Bluetooth module HCI Layer
  • An Initialization function.
  • Bluetooth stack commands functions
  • Reset
  • Write Scan Enable
  • Accept Connection Request
  • Disconnect
  • Inquiry
  • Create Connection.

21
3.1. Bluetooth module HCI Layer Cont.
  • A Get Event Routine to handle incoming events
  • Reset complete
  • Read buffer size complete
  • Write scan enable complete
  • Accept connection request status
  • Disconnect status
  • Disconnect complete
  • Create connection status
  • Connection complete
  • Connection request
  • Inquiry status
  • Inquiry result
  • Inquiry complete
  • Number of complete packets

22
3.1. Bluetooth module HCI Layer Cont.
  • Error Handling
  • Recognizing errors and sending appropriate return
    values
  • TRANSMIT FREE SPACE ERROR
  • RECEIVE FREE SPACE ERROR
  • CMD BUFFER ERROR
  • DATA PACKET BUFFER ERROR
  • VOICE PACKET BUFFER ERROR
  • DATA PACKET SIZE ERROR
  • VOICE PACKET SIZE ERROR
  • UNKNOWN COMMAND STATUS EVENT ERROR
  • SUCCESS

23
3.2. Bluetooth module Functional API Sublayer
  • Init
  • Search (Inquiry)
  • Connect / Accept Connection
  • Send / Receive Data
  • Disconnect
  • This module will be implemented in Part B

24
4. The Applications
  • EP and AP demo apps to show BT stack layer
    functionalities
  • AP functionality
  • Inquiry
  • Create connection
  • Select Desired Data using LCD and Buttons
  • Send data
  • Terminate Connection
  • EP functionality
  • Write Scan Enable
  • Accepts Connection
  • Receives Data
  • Shows Data on LCD

25
Module dependency diagram (Current State)
End Points also handle input from the
appliance. In part B, the main module in Access
Points will handle input/output from CAN module
routines as well.
26
DEMONSTRATION
27
Difficulties we have encountered
  • The PIC has many limitations
  • One process only.
  • Very small RAM (1.5K).
  • Using ROM as RAM not possible (mcc18).
  • 10Mhz effective CPU freq.
  • Only 32K ROM to store program.
  • Still, need to handle high frequency data
    transfers.
  • For all of the above reasons, conversion from PC
    and iPaq projects was not in question. All had to
    be written from scratch.
  • Moreover, no PIC modules were available for UART
    and LCD, and had to be developed.

28
Solutions we came up with
  • The emphasis when writing the code was on smart
    and efficient code (space and time).
  • Thus, the current apps take only 12.5K of the 32K
    program memory.
  • Thus enough space left for the CAN module (15K).
  • All the UART code, and thus the BT events, is
    interrupt driven.
  • Façade of C routines for LCD Assembly code.

29
Final System Block Design
  • Opaque Background implemented modules

30
CAN issues
  • There are two alternatives
  • DeviceNet module available from Microchip
  • CANopen module by Konstantin Sinyuk
  • We will probably develop with the DeviceNet
    module since it doesnt have the extra features
    of the CANopen, that we do not need for HWC.

31
Time Table
  • 01/12/03 - BT Functional API Sublayer
  • 15/12/03 - I²C module
  • 01/02/04 CAN-LOW CANopen or DeviceNet module
  • 01/03/04 HWC Scheduler module
  • 15/03/04 - AP / EP apps
  • April 2004 - Presentation Book
  • Army Service July 2004

32
To be continued
Write a Comment
User Comments (0)
About PowerShow.com