Académique Documents
Professionnel Documents
Culture Documents
Submitted by: Patrick Audet paudet@uvic.ca Tomas Martin tlcmo@uvic.ca August 07, 2011
II
TABLE OF CONTENTS
1. Executive Summary..............................................................................................................1 2. Introduction...........................................................................................................................2 3. Market analysis.....................................................................................................................3 3.1 Product Definition.......................................................................................................3 3.2 Analysis of the pet products market.............................................................................3 3.3 Competing products.....................................................................................................4 4. Mechanical Design................................................................................................................5 4.1 Thermoelectric cooling devices Seebeck effect........................................................5 4.2 Thermoelectric cooling system design........................................................................6 4.3 TEC Calculations.........................................................................................................8 4.4 TEC selection criteria..................................................................................................9 4.5 TEC cooling system design.......................................................................................11 4.6 Housing and feeding system......................................................................................12 5. Electrical Design.................................................................................................................16 5.1 Component selection.................................................................................................16 5.1.1 LCD Display.................................................................................................16 5.1.2 Microcontroller.............................................................................................17 5.1.3 Stepper Motor...............................................................................................19 5.1.4 Motor Selection- Bipolar stacked (1 W/coil)................................................21 5.2 Power requirements...................................................................................................22 5.3 Microcontroller selection...........................................................................................22 5.4 Electrical schematics.................................................................................................24 5.5 Software.....................................................................................................................26 5.5.1 Main module:................................................................................................26 5.5.2 Set module:...................................................................................................26 5.5.3 Motor movement:..........................................................................................27 6. Product costs.......................................................................................................................28 6.1 Bill of Materials.........................................................................................................28 6.2 Total costs and expected selling price........................................................................29 7. Conclusions.........................................................................................................................30 3. 4. 30 30 2005
III
2005
IV
LIST OF FIGURES
Figure 1:Household breakdown by pet type..............................................................................3 Figure 2:Automatic feeder types and prices (5).........................................................................4 Figure 3:Seebeck Voltage diagram (7).......................................................................................5 Figure 4:Thermocouples connected in series (10).....................................................................6 Figure 5:Schematic of a thermocouple (9).................................................................................6 Figure 6:Parameters used in mathematical equations (12)........................................................8 Figure 7:Performance of selected TEC (13) .............................................................................9 Figure 8:Tellurex TEC dimensions (13)..................................................................................10 Figure 9:Diagram of performance vs. Input power (8)............................................................10 Figure 10:TEC Cooling Overview...........................................................................................11 Figure 11:Picture of TEC Assembly........................................................................................11 Figure 12:Mechanical drawing................................................................................................13 Figure 13:Automatic fish feeder housing and heatsink assembly...........................................14 Figure 14:Automatic fish feeder - fully assembled..................................................................15 Figure 15:Structure of a transmissive LCD display (16).........................................................16 Figure 16:HD44780-based 2x16 character display .................................................................16 Figure 17:Unipolar motor structure (17)..................................................................................19 Figure 18:Bipolar motor structure (17)....................................................................................19 Figure 19:Bipolar motor structure (17)....................................................................................20 Patrick Audet / Tomas Martin 2005
Automatic Fish Feeder Final Report Figure 20:Stacked stepper specifications (Danaher Motion)...................................................21 Figure 21:BS2-SX Module schematic.....................................................................................23 Figure 22:Automatic fish feeder electrical block diagram...................................................24 Figure 23:Electrical Schematic................................................................................................25
LIST OF TABLES
Table 1:TEC Parameter Definitions...........................................................................................8 Table 2:Microcontroller characteristics (all prices in US$).....................................................18 Table 3:AFF Power requirements............................................................................................22 Table 4:TEC Input/Output requirements.................................................................................22 Table 5: AFF Prototype Material Costs................................................................................28
2005
1.
EXECUTIVE SUMMARY
Pet ownership has been increasing at a steady pace in the last 20 years. In the US, after dogs and cats, the most popular pet is now the freshwater fish. More than 60% of households in the U.S. own a pet, and with pet ownership considered by many as an affordable luxury, it is not surprising to see that the total value of the pet industry approaching 35 Billion U.S. dollars (U.S. figures) The Automatic fish feeder (AFF) is a product that focuses on this market. Its purpose is to dispense frozen fish food into an aquarium, automatically, and for up to 14 days. This document provides a brief outlook on possibilities of the AFF in the market: It explores the total customer base, looks at competing products and the preferred distribution channels or points of sale. The mechanical design for a prototype unit, design and selection criteria for thermoelectric cooling, electrical component descriptions and complete electrical diagrams are also included in this document. The manufacturing cost is reviewed and compared to competitive products already on the market. Recommendations are made to improve the thermal insulation of the design, select a less complex microcontroller and lower cost through mass production.
2005
2.
INTRODUCTION
Companion animals bring positive health effects to their owners; most commonly cited effects are reduced levels of stress, depression, and even heart risk. (1) Mammals, especially dogs and cats, and birds have dominated the pet scene for a very long time. Many of these are domesticated while others, often considered novelty pets, are not. The popularity of aquariums has been slowly migrating from Europe and Asia to North America. New advances in low cost water filtration offer easy maintenance for novice enthusiast. Aquarium keeping is a popular hobby around the world. The predecessor of the modern aquarium was introduced in 1850 as a novel curiosity; since then, aquarium ownership has expanded as more sophisticated systems including lighting and filtration systems were developed to keep aquarium fish healthy. (2)
2005
3.
3.1
MARKET ANALYSIS
Product Definition
This device will dispense frozen fish food into an aquarium. It will be capable of dispensing frozen blocks of food at a several times a day at any desired time (all times are programmable). The device will use an array of thermoelectric coolers mounted onto a stainless steel cold plate to keep the product frozen without making any noise. A heat sink is mounted onto the hot side of the thermoelectric device. A low speed fan keeps the heat sink temperature low. The insulating container will feature a 14-turn rotating screw inside. The screw will accommodate 14 frozen blocks of food. Design goals Compact design capable of being mounted on top of a fish tank. Easy cleaning, cube loading and maintenance Device should be able to handle commercially available cubes of frozen food. Easy to program with at least three pushbuttons to set the time of day and feed times.
3.2
2005
According to BusinessWeek, distribution of pet products is mainly done through small retailers. Big chain pet stores such as PetSmart (Petcetera in Canada) account for about 15% of total sales. Big department store chains like Zellers and Wal-Mart also offer fish feed and some accessories. (5)
3.3
Competing products
There is limited distribution of automatic feeders in Canada; automatic feeder selection is greater in the U.S. - mostly dominated by dry food feed feeders. Prices for automatic dry food fish feeders vary from US$14 up to $50 U.S. Note that all these products dispense dry food. Figure 2: Automatic feeder types and prices (5)
$25 U.S.
$50 U.S.
$14 U.S.
Other products include live shrimp hatcheries from dry cysts these hatcheries however are not automatic feeders.
2005
4.
MECHANICAL DESIGN
The most important component of the AFF is the thermoelectric cooling device (TEC). The arrangement and number of TECs will define the total power consumption and the overall cost of the Automatic fish feeder; Because of this, especial consideration is given to the design a operation of TECs in the following section. TEC devices are available in packages that can be directly soldered to a surface or in a ceramic sandwich style. TECs are semiconductor devices that provide cooling when current is passed though them. They make use of the Peltier effect, which states that if a current is passed through a material, a temperature differential will appear.
4.1
The Seebeck effect is what makes Thermoelectric cooling possible. The inverse of the Seebeck effect was discovered in 1834 by French watchmaker and physicist Jean Charles Athanase Peltier [3] Peltier discovered that by applying a voltage to the Seebeck circuit a temperature difference is created at the junctions. The result is a small heat pump that has become known as a thermoelectric cooler or Peltier cooler.
2005
4.2
Figure
5:
Figure 5:
2005
Todays conventional cooling systems are made up of 3 basic parts: A compressor, condenser and evaporator. A pressurized refrigerant is allowed to expand and changes state from a liquid to a gas. During this stage energy in the form of heat is absorbed and results in a temperature drop. The compressor will then recompress the refrigerant. The heat generated by the compressor and absorbed in the evaporator is now expelled in the condenser. When comparing conventional cooling systems to TECs several analogies can be made. Electrons at the cold junction absorb heat as they move from the P-type (lower energy level) element to an Ntype element (higher energy level). The electrons are moved through the system by the power supply where the energy is released into a heat sink as the electrons move from the N-type element back to the P-type element. (8) Thermoelectric devices have no moving parts, produce no noise, are rugged and very reliable. Standard TECs are 40x40x4mm (length X width X height) or smaller. The industry standard mean time between failures is about 200,000 hours, which is more than 20 years for modules left in the cooling mode. (11) In order to choose a TEC three important specifications need to be stated. These are: The temperatures on the cold side, the temperature on the hot side and the amount of heat that must be moved by the device. The temperature difference across the TEC device is not the same as the measurable temperature difference between the cold and hot sides of the system. The methods of exchanging heat on the cold or hot side of the system are an important consideration in order to achieve a desired result. The efficiency of the heat exchanger depends on its unique characteristics. These represent a typical value for the heat sink operating temperature for the method used: Finned forced air heat sink: 10 to 15C above ambient air temperature Free convection heat sink: 20 to 40C above ambient air temperature Liquid exchangers: 2 to 5C above liquid temperature
The amount of heat to be moved by the device is called the heat load (QC). The load is comprised of the amount of work needed complete the desired task; for example to cool an object or dehumidify air. The load must also take into account the parasitic load caused by losses to the surrounding environment. Environmental losses are made up of loss through insulation, condensation of water, formation of ice or conduction through wires. (8)
2005
4.3
TEC Calculations
Figure 6:
Table 1:
L = element height Tc = cold-side temperature Qc = heat load I = applied current A = cross-sectional area Th = hot-side temperature
(Equ: 1)
(Equ: 2)
2005
4.4
2005
10
The Basic dimensions of the Tellurex TEC are 44x40x3.3mm (LxWxH) and pictured below. Figure 8: Tellurex TEC dimensions (13)
When choosing a TEC it is important to consider the device performance vs. input power. The diagram below shows the relation ship between the two. Input power can be, Voltage (V), Current (I) or the product of the two, P=IV. The performance of the device can be stated as (Th-Tc), QC or a combination of these two parameters which is the case most of the time.
The terms TMAX , QMAX , IMAX or VMAX refer to the point where the curve peaks. Operating at or close to the peak of this curve is inefficient and devices should be designed to operate from 40% to 80% of maximum performance. (8)
Figure 9:
2005
11
4.5
2005
12
4.6
2005
13
FRONT VIEW
TOP VIEW
2005
14
Figure 13:
2005
15
Figure 14:
2005
16
5.
ELECTRICAL DESIGN
The AFF is controlled by a programmable microcontroller; this is a necessity for a design that features an alphanumeric LCD display that interacts with the user. The design requires a stepper motor to control screw forward/backward motion precisely
5.1
Component selection
5.1.1 LCD Display The user interacts with the unit through a display/keyboard combination. A backlit LCD character display will be used at it offers effective communication of words at a minimal cost. An LCD works like a light valve Liquid crystals change lights polarization angle when subject to a voltage differential. Figure 15 shows the structure of an LCD display. Figure 15: Structure of a transmissive LCD display (16)
1 Front glass substrate 2 Terminal 3 Segment electrode 4 Common electrode 5 Back glass substrate 6 Upper polarizer 7 Orientation layer 8 sealant 9 Liquid crystal 10 Conducting material 11 Sealant 12 Inlet
All LCD character displays are sold as modules. The most common LCD controllers used in these modules are the Hitachi HD44780 and the Samsung KS0066 controllers. Figure 16: HD44780-based 2x16 character display The HD44780 controller is extensively used in the industry and features a 4-bit or 8-bit parallel interface. Documentation and sample code is provided for all microcontroller families. KS0066-based controllers offer both parallel and serial communications, however, LCD displays based on this controller are not very common. Prices for HD44780-based displays are lower and offer similar performance to those based on the KS0066.
2005
Automatic Fish Feeder Final Report The chosen module is a 16-character by 2-line, transmissive backlit LCD display.
17
5.1.2 Microcontroller Four types of Microcontrollers will be analyzed here. These microcontroller types were chosen due to their low price, wide availability, and abundant support. All these microcontrollers are offered with multiple built-in devices, memory types and sizes. 8051-based Microcontrollers The 8051 is an 8 bit microcontroller originally developed by Intel in 1980. It is the world's most popular microcontroller core, made by many independent manufacturers. The 8051 is widely supported, with a a full range of free and commercial products available, its architecture matches control system problems (boolean logic). This microcontroller is also the one that is offered at the lowest cost, with multiple options integrated into the same chip. Due to its internal architecture, the 8051 is difficult to program in machine language. Most of the development products feature a C compiler. Development kits are priced from $50 to $100 U.S. (14) PIC Microcontroller The PIC microcontrollers were the first RISC microcontrollers. Although having few instructions (e.g. 33 instructions for the 16C5X line versus over 90 for the Intel 8048), the PIC line has a wealth of features included as part of the chip. The benefits of design simplicity are a very small chip, small pin count, and very low power consumption.(15) Unusually for microcontrollers, the Microchip PIC data books include complete documentation on how to program the chips -- information that other manufacturers do not disclose easily. Parallax offers PIC microcontrollers with a tokenized BASIC interpreter for fast development times 68xx series by Motorola The popular 68hc11 is a powerful 8-bit data, 16-bit address microcontroller from Motorola (the sole supplier) with an instruction set that is similar to the older 68xx parts (6801, 6805, 6809). The 68hc11 has a common memory architecture in which instructions, data, I/O, and timers all share the same memory space.(15) This microcontroller is widely used and extensively supported by Motorola. Machine programming is much easier than the 8051nad PIC, and it can also be programmed in C. The main characteristics of all microcontroller families can be seen in Table 2. From Table 2 we can conclude that the Basic stamp module is excellent for fast prototyping, but it is unsuitable for mass production due to its cost. Although Motorolas microcontroller is easy to program and use, the development costs are steep, it is single sourced and programming information is secret. The 8051base microcontrollers and the PIC microcontrollers are used widely and are fully documented with a great number of free development tools these two microcontrollers will be the most suitable for a commercial low-scale project.
2005
18
0.00 Medium
Programming device Easy Demo Board 132.00 Easy MCU (chip only - mass product) 2.47
Freescale MC68HCxx series Software programming tools Programming device Demo Board MCU (chip only - mass product)
Metrowerks Codewarrior "basic". Freescale proprietary undisclosed None available for DIP MCUs Lowest cost programmer/demo board includes SMT QFP MCU MC68HRC98JL3ECP (28-pin DIP) MCU,128RAM,4K FLASH,A/D
Microchip PIC RISC MCU Software programming tools Programming device Demo Board MCU (chip only - mass product)
Freeware assembler and C compiler Public programming info: Multiple programming circuits available Multiple sources, might not be needed SX28AC-DP+ (16 pin DIP) / other models available
Parallax PIC w/ BASIC Software programming tools Programming device Demo Board MCU (chip only - mass product) EEPROM for MCU (required)
Freeware basic tokenizer Included in demo board/ same as PIC BS2-SX OEM module SX28AC-DP+ (16 pin DIP); No internal memory for programs Required
2005
19
A stepper motor is required to perform precise screw movements (in degrees) as the screw must move 360 exactly in each feeding operation. A stepper motor will also allow for forward/backward motion to prevent the product from freezing into the screw and housing. Stepper motors can be of two types: Permanent Magnet and Variable reluctance. Variable reluctance motors run freely when no current is applied while permanent magnet motors have a tendency to show some resistance to movement. Permanent magnet steppers are heavier but easier to manufacture; this explains their widespread use.
Unipolar motors Figure 17: structure (17) Unipolar stepping motors can be controlled using 6 wires and are usually wired as shown in Figure 17, with a center tap on each of two windings. The center taps of the windings are typically wired to the positive supply, and the two ends of each winding are alternately grounded to reverse the direction of the field provided by that winding Unipolar motor
Bipolar Motors Figure 18: structure (17) Bipolar motors are constructed just like unipolar motors, but the two windings are replace with a single winding and the center tap is eliminated. The motor itself is simpler but the drive circuitry needed to reverse the polarity of each pair of motor poles is more complex (See Figure 18). Bipolar motor
The drive circuitry for such a motor requires an H-bridge control circuit for each winding. An Hbridge allows the polarity of the power applied to each end of each winding to be controlled in dependently
2005
20
Other types of stepper motors: Bifilar Motors Similar to the bipolar motor, but instead of winding each coil in the stator with a single wire, two wires are wound in parallel with each other. Motors with bifilar windings are always powered as either unipolar or bipolar motors. Multiphase Motors Multiphase motors are used in power/torque applications are very different from the unipolar/bipolar construction as seen in Figure 19. Figure 19: Bipolar motor structure (17)
Control of either one of these multiphase motors in either the Delta or Y configuration requires 1/2 of an H-bridge for each motor terminal. It is noteworthy that 5-phase motors have the potential of delivering more torque from a given package size because all or all but one of the motor windings are energized at every point in the drive cycle. Some 5-phase motors have high resolutions on the order of 0.72 degrees per step (500 steps per revolution).
2005
21
5.1.4 Motor Selection- Bipolar stacked (1 W/coil) The Bipolar motor was selected due to its easy construction, widespread use and low price. A stacked bipolar motor was selected to allow for more even operation and greater angle control. A stacked bipolar is just two bipolar stepper motors stacked together with a common rotation axis allowing for standardization of parts and lower manufacturing costs. The selected motor electrical schematic can be seen on Figure 20.
2005
22
5.2
Power requirements
Table 3 shows the electrical power requirements for the AFF. TECs and Heatsink fans are connected directly to the 12V power supply, as they have builtin control elements.
Table 3:
ELEMENT TEC STEPPER SOLENOID S.T. POWER LOGIC TOTAL I V 8.00 0.80 1.00 4.30 0.30 4.60 12.00 5.00 12.00 ** 5.00
5.3
Microcontroller selection
The Input/Output requirements for the microcontroller can be found in Table 4: Table 4:
Component Pin requirements Inputs Stepper 0 Push buttons 3 LCD display Total 1 4 Outputs 4 0 11 15 2-coil bipolar stacked stepper Momentary contact type Hitachi-based; 7 outputs for 4-bit operation 19 Total I/O pins
The Basic Stamp 2SX OEM model was selected among the microcontrollers listed in Table 2. This is due to the very limited amount of resources available to build a single prototype. The Basic Stamp Module integrates a fully functional microcontroller board with programming, debugging and development tools for $50 US. The Basic Stamp does not have the required number of pins to control all functions unless the LCD is operated in 4-bit parallel mode. Figure 21 shows the schematic diagram for the BS2-SX module.
2005
Automatic Fish Feeder Final Report Figure 21: BS2-SX Module schematic
23
2005
24
5.4
Electrical schematics
A block diagram of the electrical design is shown in Figure 22 and detailed electrical schematics on Figure 23. Figure 22: TEC unit TEC unit Automatic fish feeder electrical block diagram Stacked stepper Motor Feeding mechanism
Fan
TEC unit
TEC unit
Fan
12 V DC Power supply
V. Reg.
CONTROL
LCD Module
Input switches
I/O buffers
H Bridge
H Bridge
2005
25
2005
26
5.5
Software
The prototype system can deliver one frozen food blocks per day at a preprogrammed time. The system runs a counter to derive a 1minute pulse which is used to run the real time clock (the clock returns to zero at midnight). Feeding times are stored on a table (feed time table- FTT), which the main loop checks constantly. During normal operation (not during programming), the 2x24 LCD will display: Standby HH:MM Software modules:
5.5.1 Main module: The main loop runs when the unit is not being programmed or not dispensing food. The main functions of the main loop are: 5.5.2 Set module: The main module calls the programming module when the 'SET' button is pressed. This module is the only module that interacts with the user. User programmable functions are: Administers the FTT Sets the time of day Forced feed Maintains a counter that is used to estimate the time (loop counter) Polls the buttons and enters programming loop if any of the buttons is pressed. Displays the time on the LCD display Controls feeding events - enters the feed module when feeding time occurs
The user interface is designed to use a 2x24 alphanumeric display and three buttons. The interface is structured as hierarchical lists - the user navigates through the lists using the 'LEFT' and 'RIGHT' buttons, and selecting options using the 'SET' button. The values are changed using the 'LEFT' and 'RIGHT' buttons. New values take effect by pressing 'SET' (which also returns the user to 'Stand by' mode) The following options can be set in programming mode: TIME OF DAY: Used to set the time, (in 24-hour format) that the unit uses to control feed times. Internal clock mis estimated through a loop. During setup the LCD screen shows the following: TIME OF DAY <> (set) 00:00 +hrs +mins (set)
2005
Automatic Fish Feeder Final Report Where 00:00 is the current time that the user adjusts using the left button for hours and right button for minutes. The user sets the time by pressing set once the right time is displayed on the LCD screen. Once set, the unit will display the following message for 1 second: SETUP SUCCESSFUL
27
FEED TIME: Allows the user to set the time of day at which the unit will feed one block of frozen food. Further software improvements will permit multiple feed times per day. When setting feed time the LCD display shows: FEED TIME <> (set) 00:00 +hrs +mins (set) The 00:00 text changes with the desired feed time. The user adjusts the feed time using the left button for hours and right button for minutes just as with time of day. The user sets the time by pressing set once the right time is displayed on the LCD screen. Once set, the unit will the following message for 1 second: SETUP SUCCESSFUL SET TEMPERATURE: Will control the TEC current and therefore control the temperature. This option requires an analog input and thermistor. This function is not implemented in the current design. FEED NOW: Will activate the feeding mechanism immediately, dispensing one block of frozen food. The unit will display the following display while feeding: ** FEEDING ** EXIT SET MENU: Returns to Standby mode. And waits for the next programmed feeding event. 5.5.3 Motor movement: The motor movement modules move the motor for a single feed (360 rotation forward). The PLC generates the signals that control the two H-Bridges for the 2-unit-stacked stepper motor. The complete source code can be found in Appendix A
2005
28
6.
6.1
PRODUCT COSTS
Bill of Materials
The total cost of components required to assemble the prototype board can be found in Table 5:
Table 5:
Part ELECTRICAL 74LS05N 2N6124 2N6121 108-4100 --BS2SX 529PB-ND LED 1NS3xx -SMT-75
2
Description Hex Inverter PNP NPN 4x10 Breadboard Metal film resistor 10k Metal film resistor 1k Basic Stamp B2SX OEM Momentary SPDT 3mm LED Diode 5W T18 Wire. etc. Airpax stepper, 5V, 7.5deg 2x24 Parallel LCD w/EL 500mA, 5V Regulator 12V 3000RPM Fan
2
MECHANICAL ---Helical feeding screw Plexiglas Housing Heat sinks 2 4.38 $0.00 $50.00 $8.75 $278.79
2005
29
6.2
2005
30
7.
CONCLUSIONS
Fish and aquariums are the world's largest hobby. Aquarists spend much more money in accessories and maintenance products than any other type of pet owner. The profits from aquarium related equipment exceeds that of any other pet type. This is a novelty/luxury product that can be sold to enthusiasts for much a higher price than current dry food automatic fish feeders. Manufacturing costs will have to be reduced to meet suggested price target The Automatic frozen food feeder depends on the availability of frozen food for fish. Current availability is very limited.
8.
RECOMMENDATIONS
The total cost should be reduced to $55 with mass production. From Table 2, more than 50% of the total cost is due to the TECs and BS2SX microcontroller. Cost reductions should be possible by targeting these areas. Replace the BS2SX-OEM module ($75) with a single-chip microcontroller and integrate this chip into the circuit. There are simpler microcontrollers available for less than $10US More efficient heat insulation on the feeding chamber to allow for smaller more efficient TECs. Add a door to the food chamber to reduce cold air loss and reduce cooling requirements. Add an extra LED and a LED/photodiode detector pair to sound an alarm when the system has run out of product.
2005
31
9.
REFERENCES
(1) Hynes, Angela, Natural Health; Mar2005, Vol. 35 Issue 3, p72, 6p, 10c, 2bw (2) http://en.wikipedia.org/wiki/Pet (3) American pet product manufacturing Association (APPMA); Statistics page, http://www.appma.org/press_industrytrends.asp (4) Alderman, Lesley; Money Magazine; Sep94, Vol. 23 Issue 9, p154, 1/4p, 1c (5) Business Week; 9/23/2002 Issue 3800, p128, 1p, 1 graph, 3c (6) Petsmart; http://www.petsmart.com (fish fish feeder section) (7) Omega, Thermoelement Material-T30-Z, http://www.omegaeng.nl/temperature/z/pdf/z021-032.pdf (8) Steinbrecher, Tillmann; The Heat sink guide, http://www.heatsinkguide.com/content.php? content=peltierinfo.shtml (8) http://www.melcor.com/handbook.html (10) http://www.digit-life.com/articles/peltiercoolers/ (11) http://www.electracool.com/basics.htm (12) TE Technology, Inc.; http://www.tetech.com/techinfo/#1 (13) Tellurex Corporation; http://www.tellurex.com/cz1-1.4-127-1.14cm.html (14) Internet FAQ Archives; 8051 Microcontroller, www.faqs.org/faqs/microcontrollerfaq/8051/ (15) Internet FAQ Archives; Microcontroller FAQs, http://www.faqs.org/faqs/microcontrollerfaq/primer/ (16) http://www.displaytech-us.com/pdf/ol_lcd/LCDConstruction.PDF (17) Douglas, Jones (Ph.D.); Control of Stepping Motors (18) A Tutorial, http://www.cs.uiowa.edu/~jones/step/types.html
2005
APPENDIX A
AFF Software for BSX2-OEM
' {$STAMP BS2sx} ' {$PBASIC 2.5} #SELECT $STAMP #CASE BS2 #ERROR "BS2e or greater required." #CASE BS2E, BS2SX Slot CON 63 #CASE BS2P, BS2PE, BS2PX Slot CON 127 #ENDSELECT ' defines variables to use in the program lcdchar VAR Byte ' character to be output by the LCD routine lcd_low VAR lcdchar.LOWNIB ' break up byte for 4 bit lcd interface lcd_hi VAR lcdchar.HIGHNIB ' break up byte for 4 bit lcd interface idx VAR Byte ' counter for printout looping hours VAR Byte ' hours - time (main loop) mins VAR Byte ' counts minutes to keep time (main loop) fd_hours VAR Byte ' feed time hours fd_mins VAR Byte ' ' feed time minutes secs VAR Byte ' seconds - time (main loop) tmp VAR Byte ' temprary storage for calculations setstate VAR Byte ' current state that we are setting ' I/O definitions ' Three push buttons ( IN ) sw1 VAR IN0 sw2 VAR IN1 sw3 VAR IN2 ' Motor Control mtout VAR OUTB ' LCD control lines L_ENA VAR OUT13 L_RS VAR OUT14 L_NIBOUT VAR OUTC ' Nibble for out8-out11
lcdchar=0 ' prints welcome message GOSUB setpos idx=welcm_msg GOSUB prt_str PAUSE 1000 ' waits for 5 seconds and goes to standby
stdby: lcdchar=0 ' prints standby GOSUB setpos idx=standby GOSUB prt_str stdbyloop: GOSUB printtim ' prints time on second line ' detect buttons FOR secs = 0 TO 5 ' seconds PAUSE 980 ' 980ms delay IF (sw1 | sw2 | sw3) THEN GOTO uiset 'jumps to setup ui if pressed NEXT ' update clock mins=mins+1 IF mins>59 THEN hours=hours+1 mins=0 ENDIF IF hours>23 THEN hours=0 ' checks feed time
' sets option (= sets time) lcdchar=64 ' button operation txt on 2nd line GOSUB setpos idx= set_tim_msg GOSUB prt_str set_tim_opt: GOSUB printtim ' prints time to be set PAUSE debounce lup2:
DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA
1 2 123456789012345678901234 " ** GUPPY LUV **",0 "STANDBY - (Press to set)",0 "TIME OF DAY <> (set)",0 "FEED TIME <> (set)",0 "SET TEMPERATURE <> (set)",0 "FEED NOW ",0 "Exit set menu ",0 " +hrs +mins (set)",0 " SETUP SUCCESSFUL ",0 " ** FEEDING ** ",0