Vous êtes sur la page 1sur 8

Glove project

Contents
Description ....................................................................................................................................... 2
Components ..................................................................................................................................... 2
Communication ................................................................................................................................ 2
Data package now: ....................................................................................................................... 2
New data package: ....................................................................................................................... 2
Power supply: ................................................................................................................................... 3
DC-DC for AAA Battery powered application: .............................................................................. 3
Bill of Materials................................................................................................................................. 4
Part Datasheets/Ordering place ....................................................................................................... 5
Firmware .......................................................................................................................................... 6
XBEE install ....................................................................................................................................... 7
Used Tools ........................................................................................................................................ 8

Description
Wireless range: 25m
Consumption: 60mA
Powered by: 1 x AAA 1.5V
Battery Life: 8 - 4000h based on wireless activity

Components
4 x Flex sensor - 70 lei
1 x 18F1320 microcontroller - 15 lei
1 x DC-DC Step Up converter - 30 lei
1 x MCP6004 rail to rail single supply operational amplifier - 4 lei
1 x XBee - 80 lei
1 x AAA battery - 1 lei
1 x Glow - 30 lei
+ Some very cheap SMD passive elements (R,L,C). - 5 lei
1 x PCB??? 100 lei
1 x XBee transmitter, receiver 250lei
------------------------------------------Total approx.: 750 lei

Communication
9600 bit/s, 8 bit, Stop Bit 1, Parity none

Data package now:


2 byte - finger1
2 byte - finger2
2 byte - finger3
2 byte - finger4
1 byte - package end - 0x00
1 byte - package end - 0xFF

New data package:


1 byte - data , 2 bits/finger

Power supply:
-DC-DC Step Up from 1.5V AAA battery.
-Battery Low indicator.

DC-DC for AAA Battery powered application:


MCP1623/24
http://ww1.microchip.com/downloads/en/DeviceDoc/41420B.pdf
MAX856MAX859
http://datasheets.maximintegrated.com/en/ds/MAX856-MAX859.pdf
MAX1722/MAX1723/MAX1724
http://datasheets.maximintegrated.com/en/ds/MAX1722-MAX1724.pdf

Bill of Materials

Qty

Value

Device

Parts

Description

10-XX

ON/OFF

OMRON SWITCH

LED3MM

LB, LED1, LED2

LED

PINHD-1X2

SENSOR1,2,3,4

PIN HEADER

PINHD-1X5

ICD

PIN HEADER

4MHz

XTAL/S

Q1

CRYSTAL

0.1uF

C-EU050-024X044

C6

CAPACITOR, European symbol

100K

R-EU_R3216

R1, R8, R9, R11

RESISTOR, European symbol

10K

R-EU_R3216

R16

RESISTOR, European symbol

10k

R-EU_R3216

R4, R5, R6, R7

RESISTOR, European symbol

10nF

C-EU050-024X044

10uF/6.

CPOL-EUE5-5

C10

POLARIZED CAPACITOR, European


symbol

15k

R-EU_R3216

R12

RESISTOR, European symbol

1K2

R-EU_R3216

R2, R3, R10

RESISTOR, European symbol

1uF

C-EU050-025X075

C7

CAPACITOR, European symbol

33pF

C-EU025-025X050

C3, C4

CAPACITOR, European symbol

4.7uH

L-EUL1812

L1

INDUCTOR, European symbol

47uF

CPOL-EUE5-5

C11

POLARIZED CAPACITOR, European


symbol

8.2pF

C-EU050-024X044

C8

CAPACITOR, European symbol

BBY40

D-SOD-87

D1, D2

DIODE

MCP16

MCP16251

U$1

Step Up DC/DC

MCP60

MCP604SL

IC3

Quad Op Amp 2.7V to 6.0V Single Supply


CMOS
18/20/28-Pin High-Performance,
Enhanced Flash Microcontrollers

C1

CAPACITOR, European symbol

3V

1
6.3V

1
251
1
04SL
1

PIC18F1
220SO

PIC18F1220SO

IC2

SL160AA/PR

SL-160AA/PR

G1

XBEE

XBEE

XB1

LI BATTERY Sonnenschein

XBee (TM) /XBee-PRO(TM) OEM RF


Modules

Part Datasheets/Ordering place


http://www.tme.eu/en/
MCP6001/1R/1U/2/4
http://ww1.microchip.com/downloads/en/DeviceDoc/21733h.pdf
PIC18F1220/1320
http://ww1.microchip.com/downloads/en/DeviceDoc/39605F.pdf

Firmware

#include <p18f1320.h> /* for 'PORTB' and 'TRISB' */


#include <delays.h>
#define NUM_CHANELS 4
#define BUFFER_SIZE 2 * NUM_CHANELS + 2
#define MESSAGE_END 0xff
unsigned char buffer[BUFFER_SIZE];

void initPortAConfig(void)
{
ADCON1bits.PCFG0 = 0; // analog input A/D
ADCON1bits.PCFG1 = 0; // analog input A/D
ADCON1bits.PCFG2 = 0; // analog input A/D
ADCON1bits.PCFG3 = 0; // analog input A/D
ADCON1bits.PCFG4 = 1; // digital IO push button
ADCON1bits.PCFG5 = 1; // digital IO - USART TX
ADCON1bits.PCFG6 = 1; // digital IO - USART RX
}
void initUSART(void)
{
PIE1bits.TXIE = 0;
PIR1bits.TXIF = 0;
TRISBbits.RB4 = 1;
TRISBbits.RB1 = 0;
BAUDCTL = 0;
SPBRG = 25; // 9600 bps only this one is working without data loss
TXSTA = 0;
TXSTAbits.BRGH = 1;
TXSTAbits.TXEN = 1;
RCSTA = 0;
RCSTAbits.SPEN = 1;
}
void initAD(void)
{
// configure analog pins
ADCON2bits.ADFM = 0; // left justified
ADCON2bits.ACQT = 2; //
ADCON2bits.ADCS = 6;
ADCON0bits.VCFG = 0;
ADCON0bits.ADON = 1;
}
void main (void)
{
int chanel = 0;
int bufferIdx = 0;

char checksum = 0;
initPortAConfig();
initUSART();
initAD();
TRISBbits.RB2 = 0;
TRISBbits.RB3 = 0;

while (1)
{
PORTBbits.RB2 = 1;
PORTBbits.RB3 = 0;
ADCON0bits.CHS = chanel;
Delay100TCYx(10);
ADCON0bits.GO = 1;
while (ADCON0bits.NOT_DONE);
buffer[bufferIdx++] = ADRESH;
buffer[bufferIdx++] = ADRESL;
chanel = chanel+1;
if (chanel == NUM_CHANELS)
{
buffer[bufferIdx++] = checksum;
buffer[bufferIdx++] = MESSAGE_END;
for (bufferIdx = 0; bufferIdx < BUFFER_SIZE; bufferIdx++)
{
TXREG = buffer[bufferIdx];
while (0 == TXSTAbits.TRMT); // wait until TSR is empty
}
PORTBbits.RB2 = 0;
bufferIdx = 0;
chanel = 0;
}
}
}

XBEE install
http://www.science.smith.edu/~jcardell/Courses/EGR328/Readings/XbeeGettingStarted.pdf

Used Tools
Microchip MPLAB IDE v8.91 connected with serial cable to ICD2
Microchip C18 Toolsuite
EAGLE 6.5.0
Microsoft Visual Studio 2012

Vous aimerez peut-être aussi