bike buddy

51
Bike Buddy Group 15 Sponsored By: Ari Nacius Progress Energy Nowook Park Ethan Pemble Nick Quinlan

Upload: ulema

Post on 25-Feb-2016

49 views

Category:

Documents


0 download

DESCRIPTION

Bike Buddy. Group 15Sponsored By: Ari Nacius Progress Energy Nowook Park Ethan Pemble Nick Quinlan. Introduction. Speed: 18 MPH Dir: 28.53 ˚ N , -81.20 ˚ W T: 85 ˚F P= 4.2 W. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Bike Buddy

Bike BuddyGroup 15 Sponsored By:

Ari Nacius Progress EnergyNowook ParkEthan PembleNick Quinlan

Page 2: Bike Buddy

Introduction

Bike Buddy uses a portable AC generator to harness power from pedaling.

It attaches to the bicycle and displays riding information. Speed (mph) and direction Lat./Long. coordinates Ambient temperature Power generated by pedaling

(Watts) It also supplies power to USB

devices.

[picture]

Speed: 18 MPHDir:28.53˚N,-81.20 ˚W

T:85 ˚F P=4.2W

Page 3: Bike Buddy

Goals & Motivation

Current portable bicycle generators are primarily used to power headlights.

Our goal is to expand on possible applications of this alternative energy source by providing additional features to the bike rider.

Provide accurate data to the user while efficiently powering all systems with the AC generator.

Page 4: Bike Buddy

Power Flow Diagram

AC generator

DC converter

Battery charger

6v regulator 5v regulator 3.3v regulator

µC GPS

Battery switcher

USB

Pedal the bike

Power System

Display System

LCD

Page 5: Bike Buddy

Bike BuddyPower System

Page 6: Bike Buddy

Specifications & Requirements

PowerPeripheral Operating voltage

Expected maximum current draw Power requirement

Microcontroller 3.3v 19 mA 62.7 mW

LCD 6v 220 mA 1320 mW

GPS 3.3v 70 mA 231 mW

USB port 5v 500 mA 2500 mW

Total Power 4.12 W

Page 7: Bike Buddy

Building the Generator

Initially we wanted to design our own custom generator.

Instead of spending time on designing a generator we decided to concentrate on the capabilities of the LCD and sensing functions.

Because it was vital to provide constant power for the rest of the project to work, we thought it best to purchase one instead.

Example of a home-made electric generator

Page 8: Bike Buddy

Choosing a Generator

Voltage(volts)

Current(milliamps)

Power(watts)

Cost(USD)

Current Source

6V 400mA 2.4W $63.70 AC

Voltage(V)

Current(mA)

Power(W)

Cost(USD)

Current Source

12V 500mA 6W $16.99 AC

Pros:• Less energy loss to friction • Sleek designCons:• More expensive• Custom Wheel Needed• Low Power Output

Pros:• Higher Power Output• CheapCons:• Energy Loss in wet or muddy

conditions• Produces buzzing noise

Page 9: Bike Buddy

Power Supply

AC/DC conversion No need for a step-up or step-

down transformer. Full Bridge rectifier using 4

schottky diodes for low voltage drops.

A 50V 2200 uF electrolytic capacitor is used to minimize the ripple before regulation.

A voltage regulator (LM317) regulates the voltage to a constant 10V.

Formulas to find the average DCVoltage from the generator

When Vrms = 30V, Vdc = (30V x 1.414)/3.14 = 13.5V

,

Page 10: Bike Buddy

Battery Characteristics Lead Acid Nickel Cadmium Nickel Metal Hydride Lithium IonEnergy/Weight

(Wh/kg) 30-40 40-60 30-80 100-160

Energy/Size(Wh/L) 60-75 50-150 140-300 250-360

Power/Weight (W/kg) 180 150 250-1000 250-340

Charge/Discharge Efficiency 50-92% 70-90% 66% 80-90%

Energy/Price (Wh/USD) — 2.75 2.8 - 5

Self-dischargeRate (per mo.) 3-20% 10% 30% 8% (21°C)

Cycle Durability 500-800 2,000 500-1,000 1,200

Nominal CellVoltage 2.105V 1.24V 1.2V 3.6V

Nominal Capacity 7200 mAh 900 mAh 700 mAh 4800 mAh

Size 151x98x98mm 73x29x52mm 51x48x22mm 127x80x43mm

Weight 3940g 210g 135g 678g

Battery Characteristics

Page 11: Bike Buddy

Specifications & Requirements

Lithium-Ion BatteryPack (2 Cell) Capacity: 1400mAh Voltage: 7.4 V (8.4 V pk) Dimensions: 51mm x 38.1mm x 19mm Weight: 2.5 oz Maximum Charge Current: 1C or 1.4A Maximum Current Draw: 0.87 A

Page 12: Bike Buddy

Li-Ion Battery Charger

ADP3810 (Analog Devices)

MAX1758 (Maxim)

MCP73842 (Microchip)

Input Voltage -0.4V to 18V -0.3V to 30V -0.3V - 12VMax Charge Current 1.2A 1.5A 2A

Operational Temp 40C to +85C 40C to +85C 40C to +85C

Maximum Power Dissipation

500mW 762mW 120mW

Battery Temp monitoring No No Yes

Packaging SO-8 SSOP-28 MSOP-8

Charger Comparison Table

Page 13: Bike Buddy

Li-Ion Battery Charger

MCP73842 manufactured by Microchip to charge an 8.4V Li-Ion battery.

Programmable Charge Current. Programmable Safety Charge Timers. Preconditioning of Deeply Depleted Cells. Automatic End-of-Charge Control. Continuous Cell Temperature monitoring Automatic power-down when input power

is removed to prevent battery discharge.

Ctimer = 0.033uF

Tprecon = (Ctimer/0.1uF) X 1 hr = 19.8 mns

Tfast-charge = (Ctimer/0.1uF) X 1.5 hrs = 29.7 mns

Tterm = (Ctimer/0.1uF) X 3 hrs = 59.4 mns

Typical Charge Profile

Page 14: Bike Buddy

Charge Circuit Flow Diagram

Page 15: Bike Buddy

Li-Ion Battery Charger (cont’d)For a maximum charge current of 2A,

RSENSE is calculated using the formula in the datasheet.

RSENSE = 120mV / 2A = 60m

The charger turns off when the battery reaches a temperature limits of 10 F and 80 F.

Those temperature limits are set using two resistors Rt1 and Rt2

Rt1 = (2 x 10 x 100)/(100 - 10) = 22 Ohms

Rt2 = (2 x 10 x 100)/(100 - 3 x 10) = 28.57 Ohms

Practical values:Rt1 = 22.22 OhmsRt2 = 29.00 Ohms

*maufacturer-recommended design configurationation.

Page 16: Bike Buddy

Battery Switcher

2 comparators to monitor and compare the battery voltage levels with a reference voltage of 3.5V.

6 p-channel mosfets used to switch the batteries when the source battery reaches 3.5V.

A zener diode is used to keep the reference voltage at a constant 3.5V.

The 100uF capacitor is to ensure that the output doesn’t change during the switch.

Page 17: Bike Buddy

Battery Switcher

One battery powers the unit while the other is being charged.

Switch happens when the battery powering the unit reaches 3.5V.

3.5V is the minimum input voltage range of switching regulators that power the subsystems.

The power source switch does not affect the operation of the unit.

Switcher Profile

Page 18: Bike Buddy

Switching Regulators

Vref=1.5 V, 10kΩ ≤R1≤ 500kΩ

R2=R1*(Vout/Vref-1)

For Vout=6V: R1=10kΩ, R2=30kΩ

Page 19: Bike Buddy

The MAX608 low-voltage step-up controller operates from a 1.8V to 16.5V input voltage range.

Pulse-frequency-modulation (PFM) control provides high efficiency at heavy loads, while using only 85μA (typical) when operating with no load.

In addition, a logic-controlled shutdown mode reduces supply current to 2μA typical. The output voltage is factory-set at 5V or can be adjusted from 3V to 16.5V with an external voltage divider.

The MAX608 operates in “bootstrapped” mode only (with the chip supply, OUT, connected to the DC-DC output). The two bootstrap capacitors and are employed on both sides of inductor to provide gate voltage to high side input switch through high side driver in any mode of operation. This allows the regulator to work in all three modes of operation without different external components or configurations depending on the mode.

Switching Regulators

Page 20: Bike Buddy

Bike BuddyPower Sensor

Page 21: Bike Buddy

Current Sensor The ACS756 current sensor

needs a single +3 to+5V supply.

Ultra-low power loss: 130uOhm internal resistance.

13kVRMS isolation voltage between terminals 4/5 and pins 1/2/3.

Output voltage proportional to AC and DC current.

20mV/A output sensitivity. Nearly Zero magnetic

hysteresis

Page 22: Bike Buddy

Analog-to-Digital Converter The ADC pins have a voltage range of

0V to 5V. But since the internal reference voltage is 2.56V, our input voltage must not reach that level.

We use a voltage divider to prevent the attempted maximum voltage from the generator from reaching 2.56V on the ADC pins.

Voltage interval = 2.56V / 1023 = 0.0025V

At every 2.5mV increment, a binary data is recorded and stored in a data register.

Since we want the recorded voltage to be accurate to 1/10 of a volt, we select resistor values that will increment the stored binary data at every 1/10 of a volt.

0.0025 = (1/10)(R2/(R2+R1)) 1/40 = R2/(R1+R2) R1 = 39K, R2 = 1K

Page 23: Bike Buddy

Analog-to-Digital Converter (cont’d)

The ADC is used to measure the power generated by the generator by monitoring the voltage and current.

The current sensor output is connected to a similar voltage divider as the one on the right for the battery.

Since we don’t want to drain the batteries, we use a to isolate the batteries from the voltage divider.

Page 24: Bike Buddy

Bike BuddyDisplay System

Page 25: Bike Buddy

Small and power efficient

Peripheral sensors to provide information to the rider: Speed and direction Power generated Global position Ambient temperature Time of day

Display System Goals

µC

GPS

12:37 PM67 °F

Lat: 28.60265

NE6.73 MPH

Lon: -81.23185

Generating 3.7 Watts

Power sensor

Page 26: Bike Buddy

Liquid Crystal Display

Serial Graphic LCD from sparkfun Provides simple 1-wire

serial interface with built-in commands and character display.

128x64 pixel space Software-scalable

backlighting for indoor/outdoor use

Operates at 6v, average current draw ~125 mA (with full backlighting)

Page 27: Bike Buddy

GPS Receiver: LS20031

The LS20031 GPS unit has an embedded antenna and simple TTL serial interface.

Built-in battery stores satellite positions for rapid startup.

3.3v @ 41 mA

Page 28: Bike Buddy

Microcontroller

Atmel ATmega128 LInput/Output 53 pins

Memory128KB FLASH4KB EEPROM4KB internal SRAM

Analog-to-Digital 10 bit, 8 channel

Peripheral Interface 2 USART, TWI, SPI

Clock Speed Up to 8 MHz

Operating Voltage 2.7 – 5.5 vExpected Active Current ~20 mA

Page 29: Bike Buddy

Development Board: STK-300

RS-232 port for USART communication.

Simple USB programmer for quick prototyping.

Provides 8 buttons and LEDs for testing.

External 8 MHz crystal provided for source clock.

Includes C compiler (WinAVR) and AVR Studio 4 development environment.

Page 30: Bike Buddy

Software Overview

Initialize Serial Devices

Retrieve Power Sensor Data (ATD)

Retrieve GPS Data (USART1)

Update Display(USART0)

Power Switch ON

Retrieve Temperature Data

(TWI)

Retrieve Sensor Data

Stand-by Timer overflow?

Format numbers for display

Page 31: Bike Buddy

ATmega128 Timer

Timer1: 16-bit timer System clock rate: 7.3728 MHz Prescaler: divide-by-1024 Tic: 7.2 kHz Overflow: 9.1 ms Desired period: 300ms or 2730 overflows

The sensor update loop is driven by a timer, and executed every 300ms. The screen will update roughly 3 times per second.

Page 32: Bike Buddy

C1 = C2 = 15 nF

USART on the ATmega128L

Liquid Crystal Display

Serial Device USART0

Transmit pin PE1 (#3)

Receive pin PE0 (unused)

Baud rate 9600 bpsFrame Structure 8N1

GPS ReceiverSerial Device USART1

Transmit pin PD3 (#28)

Receive pin PD2 (#27)

Baud rate 9600 bpsFrame Structure 8N1

USART is dependent on the internal system clock and is highly sensitive. To reduce data error rates, an external system clock rated at 7.3728 MHz is chosen.Both devices (the LCD and the GPS receiver) are configured to transmit at 9600 bps with 8 data bits, 1 stop bit, no parity bit.

Page 33: Bike Buddy

Drawing

Native Commands

LCD Commands

Command Byte Argument Description

Clear Screen 0x00 — Clears all written pixels.

Reverse Mode 0x12 — Green-on-black pixel display.

Splash Screen 0x13 — Toggles sparkfun logo at boot.

Set Backlight 0x02 0:100d The number is decimal.

Set Baud Rate 0x07 “1:6” Retained during power cycling.

Command Byte Argument Description

Set X Coordinate 0x18 0:127d Moves cursor for text generator.

Set Y Coordinate 0x19 0:63d Moves cursor for text generator.

Set/Reset Pixel 0x10 x, y, 0:1d 0: set (x,y) pixel, 1: reset (x,y) pixel

Draw Line 0x02 x1, y1, x2, y2, 0:1d (x1,y1) to (x2,y2), 0: draw, 1: erase

Draw Circle 0x07 x, y, r, 0:1d (x,y) center, r: radius, 0: draw, 1: erase

Draw Box 0x0F x1, y1, x2, y2, 0:1d (x1,y1) to (x2,y2), 0: draw, 1: erase

Erase Block 0x05 x1, y1, x2, y2 Entire box is erased.

Wrapper functionsint lcd_clearScreen()int lcd_setBacklight(int)

int lcd_setPixel(int,int)int lcd_setX(int)int lcd_setY(int)int lcd_drawLine(int,int,int,int)int lcd_drawCircle(int,int,int)int lcd_drawBox(int,int,int,int)int lcd_erase(int,int,int,int)

Page 34: Bike Buddy

Parsing GPS Information

The only NMEA record used in the design is the Recommended Minimum Specific GNSS Data (RMC), which provides UTC time, date, latitude, longitude, speed over ground, and course over ground.

Name Example Units DescriptionMessage ID $GPRMC RMC protocol headerUTC Time 053740.000 hhmmss.sssStatus A A = data valid or V=data not validLatitude 2503.6319 ddmm.mmmmN/S Indicator N N=north or S=southLongitude 12136.0099 dddmm.mmmmE/W Indicator E E=east or W=westSpeed over ground 2.69 Knots TrueCourse over ground 79.65 DegreesDate 100106 ddmmyyMagnetic variation DegreesVariation sense E=east or W=west (not shown)Mode A A=autonomous, D=DGPS, E=DRChecksum *53

<CR><LF> End of message termination

$GPRMC,053740.000,A,2503.6319,N,12136.0099,E,2.69,79.65,100106,,,A*53

Page 35: Bike Buddy

Bike BuddyTemperature Sensor

Page 36: Bike Buddy

Parameter Symbol Condition Min Typ Max Units

Supply Voltage VDD Local Power 3.0 - 5.5 V

Pull-up Supply Voltage VPU

Parasite Power 3.0

-

5.5

V

Local Power 3.0 VDD

Sink Current IL VI/O =0.4V 4.0 - - mA

Standby Current IDDS - - 750 1000 nA

Active Current IDD VDD=5V - 1 1.5 mA

DQ Input Current IDQ - - 5 - µA

Page 37: Bike Buddy

DS1625• Data is read from / written via a 2-wire

serial interface(open drain I / O lines)

• Temperature measurements require no external components

• Measures Temperatures from -55°C to +125°C (-67°F to +257°F)

• Converts temperature to digital word in 500 ms

• Temperature is read as a 9-bit value (two byte transfer)

Parameter Supply Voltage

Symbol VDD

Min 4.5

Typ 5.0

Max 5.5

Units V

Page 38: Bike Buddy

Pin 1

SDA Data input/output pin for 2-wire serial communication port

Pin 2

SCL Clock input/output pin for 2-wire serial communication port

Pin 3 Tout

Thermostat output. Active when temperature exceeds TH; will reset when temperature falls below TL

Pin 4

GND Ground pin

Pin 5 A2 Address input pin

Pin 6 A1 Address input pin

Pin 7 A0 Address input pin

Pin 8 VDD Supply voltage 5V input power pin

DS1625

Page 39: Bike Buddy

DS1625

Temperature Digital Output (Binary) Digital output (Hex)

+125°C 01111101 00000000 7B00h

+25°C 00011001 00000000 1900h

+1/2°C 00000000 10000000 0080h

+0°C 00000000 00000000 007Fh

-1/2°C 11111111 10000000 FF80h

-25°C 11100111 00000000 E700h

-55°C 11001001 00000000 C900h

MSB LSB1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 = -25°C

Temperature is represented in the DS1625 in terms of a 0.5°C LSB.

Not Using, Remains 0

Page 40: Bike Buddy

Two Wire Interface (TWI) A popular serial peripheral interface bus TWI stands for Two Wire Interface and for most parts this bus is

identical to I²C. The name TWI was introduced by Atmel and other companies to

avoid conflicts with trademark issues related to I²C. -More flexible than SPI (Serial Peripheral Interface ) -Master and slave modes supported -7-bit slave address -Bidirectional, open-drain bus (device pulls down, resistors pull up) -Two wires, SCL, (clock) and SDA (data)

Typical TWI bus configuration

Page 41: Bike Buddy

Two Wire Interface A TWI transmission consists of

Start condition An address packet consisting of

-Read/Write indication and -Slave acknowledge, (SLA+RW)

One or more data packets Stop condition

A Start condition initiates a transmission by a master. Between Start and Stop conditions, the bus is busy and no

other masters should try to initiate a transfer. A Start condition is signaled by a falling edge of SDA while

SCL is high.

Page 42: Bike Buddy

Two Wire InterfaceAddress packet -Address packet is 9 bits long -MSB first -Address “000 0000” is reserved for broadcast mode -7 address bits (driven by master) -1 read/write control bit (driven by master) -1 acknowledge bit (driven by addressed slave)

Page 43: Bike Buddy

Two Wire Interface Data packet

-All data packets are 9 bits long -MSB first -One data byte plus an acknowledge -During a transfer, Master generates SCL, Receiver acknowledges -Acknowledge (ACK): Slave pulls down SDA in the 9th SCL cycle -Not Acknowledge (NACK): Slave does not pull down SDA in 9th

cycle

Page 44: Bike Buddy

USB

Page 45: Bike Buddy

WHY USB?• USB, became really popular nowadays to connect computer peripherals.• Not only for Data Source, but Power Source• A USB controller require to power one unit load, which is around 100mA. • such as fan, light, charging the batteries of mp3 players and cell phones.

Page 46: Bike Buddy

USB Types

Parameter Requirement

DC voltage, high-power port 4.75V to 5.25V

DC voltage, low-power port 4.75V to 5.25V

Maximum quiescent current (low power, suspend mode) 500µA

Maximum quiescent current (high power, suspend mode) 2500µA

Maximum allowable Input capacitance (load side) 10µF

Minimum required output capacitance (host side) 120µF ±20%

Maximum allowable inrush charge Into load 50µC

Page 47: Bike Buddy

USB Powering

Page 48: Bike Buddy

Pin No. Signal Cable Color

1 + VCC Red

2 Data - White

3 Data + Green

4 GND Black

USB Specs

Page 49: Bike Buddy

BudgetProduct/Part Vendor/Service Actual Cost

ATmega128L dev board (STK300) Kanda.com $104.00

Serial graphic LCD 128x64 Sparkfun.com $100.00

Bike generator 12V 6W Bike World USA $16.99

LS20031 GPS receiver Sparkfun.com $60.00

2x 2-cell Li-Ion Battery packs Powerizer.com $40.00

Temperature sensor circuit Digikey/Mouser $20.00

USB port (female) Sparkfun.com $4.00

Power supply circuit Digikey/Mouser $300.00

Battery charger circuit Digikey/Mouser $100

Battery switching circuit Digikey/Mouser $100

Packaging/Misc. Hardware Skycraft, … $200

Extra cost $300

Total ~$1300

Page 50: Bike Buddy

Milestones

Feb Mar

Feb. 19Complete part acquisition

Feb. 26Assemble prototypes of hardware systems

Feb. 27-28Successfully implement USART devices

Mar. 13-14Battery circuit built and tested

Mar. 10Complete basic software control flow

Mar. 20-21Finish programming

Mar. 27-28Build and test power supply

Apr. 3-4Assemble unit and attach to bicycle for final testing

Apr

April 24reBuild and retest power supply

Page 51: Bike Buddy

Bike BuddyGroup 15