Final Project Report

Final Project Report Bluetooth Enabled Coffee Machine with Smartphone Application ECE 4902 - Senior Design II Spring 2014 ECE Project Members: Jesse ...
27 downloads 0 Views 1MB Size
Final Project Report Bluetooth Enabled Coffee Machine with Smartphone Application ECE 4902 - Senior Design II Spring 2014

ECE Project Members: Jesse Garrard Thanh-Lam Dinh Shayan Rizvi Mevludin Guster Faculty Advisor: Marten Van Dijk Sponsor: iDevices iDevices Contact: Michael Tetreault

Introduction: Traditional coffee machine designs are outdated and inefficient. As a result, the purpose of our project is to Bluetooth enable a coffee machine. This will allow users to operate their coffee machine from the convenience of the next room, or another area in the vicinity. A recent survey taken by UConn students has shown that out of 402 students 52% of them prefer to use a Keurig while only 23% prefer a drip coffee maker and the remaining 25% use other forms of coffee makers. As a result, a Keurig Single Cup Coffee Machine will be used the purpose of this project. Summary: This coffee machine will have many features that a regular coffee maker does not. Through Bluetooth enabled, the user will be able to control various features from their smartphone or other handheld device. Some of these features include: turning on/off the coffee maker, commanding it brew on command, choosing a specific time for the coffee maker to brew, selecting a flavor of coffee to dispense, and selecting a volume of coffee to dispense. Background: Our project is sponsored by iDevices LLC. iDevices is a company that is located in Avon, Connecticut, and was founded in 2010. iDevices is an App-enablement and consulting company creating products that incorporate wireless connectivity to popular smartphone and tablets. Using Bluetooth and Wi-Fi technology, iDevices can work with other companies to appenable their products or offer electrical engineering consulting services. Below images which show the Keurig’s components.

Figure 1: Keurig Coffee Maker (B40)

Figure 2: Front view

Figure 3: Side view

Figure 4: Power conditioning and fuse board

Figure 5: Main board

Figure 6: Button interface board

Theory: The AVR Microcontroller will be communicating with the phone via Bluetooth (USART protocol). Using the function from the app, the signal (consist of specific bytes) are sent to the Microcontroller. It then interprets the signal and outputs the corresponding command, i.e. it chooses the flavor (through the use of the solenoid valves), turns on and off brew button (through relays), dispenses the coffee if a coffee cup is there (using the IR sensor to tell if the cup is present).

Figure 7: Design Flow Chart

Solution: To improve the functionality of the coffee machine the following aspects of the coffee machine will be controlled via a Smartphone application (table 1). Function

Description

On/Off

The coffee machine will be turned on and off by Bluetooth

Brew

Send control to brew coffee

Cup Present

Informs the user if there is a cup present

Water Level

Will indicate when the water level is low

K-cup

Choosing between 3 K-cups

Volume

Select volume to dispense (6oz, 8oz, 10oz)

Time

Set a time to brew coffee

Stop/Cancel

Stops current brewing

Connect

Connecting to supported devices Table 1: Coffee machine functions.

The Keurig coffee machine already has all of these features, with the exception of being able to select more than one K-cup, being able to sense the presence of a coffee cup, and selecting a time to brew. Therefore a circuit will be developed to interface with the pre-existing components to monitor and/or control the features mentioned in table 1. The relay circuit is used to interface with the pre-existing functions.

Figure 8: Relay circuit schematic to control the pre-existing function of the Keurig Coffee Maker (left), small handetched circuit board fitting inside the button interface board (right)

The circuit design can be separated into two categories - one section of the design will be dedicated towards the sensor aspect and the other will focus on more of the physical controls portion.

Figure 9: Overall schematic of the microcontroller circuit (Atmega644, Bluesmirf RN-42 Bluetooth Module, NMOS transistor, IR Sharp sensor, Solenoids, Solid-state relays)

Controlling Components: Components of the coffee machine that will be controlled by the circuit in figure 1 are: On/Off, Brew, volume to dispense, time, stop/cancel and K-cup selection. The Keurig will be able to be turned on and off via the smartphone application. This is achieved by controlling a Solid State Relay. A signal is sent from the phone to the microcontroller via Bluetooth, the microcontroller then outputs 5V from a GPIO pin which drives a transistor and controls the relay.

The Keurig will accept a command to brew via the smartphone application. To do this a signal will be sent to the Microcontroller which activates the GPIO that connected to the corresponding relay enable the punching on the K-cup. Along with the ability to simply brew coffee, there will be a feature on the smartphone application which allows the user to choose between 3 different K-cups. This will be capable by utilizing solenoid valves. The solenoid valves are normally closed and are enabled with 12 V DC. The 12 V is supplied via an external AC to DC converter. Timer peripheral is also utilized to create a calendar thus allowing user to set the time to brew coffee. Sensing Components: Components of the coffee machine that will be sensed by the circuit in figure 1 are: water level, brew head open and whether a coffee cup is present. The pin out of the Keurig’s Display/Interface Board can be seen in table 2 (below). Pin:

Function:

1

Voltage supply for

2

Heating LED

3

Descaling LED

4

10 Oz. Brew LED

5

Pressure Sensor Voltage Output

6

Analog Muxed Switches

7

Add Water LED

8

(5V)

9

GND

10

GND

11

Not Connected

12

Auto-Off LED

13

Power LED

14

Not Connected

15

8 Oz. Brew LED

16

GND

of Op-Amp

Table 2: Display/Interface Board Connector Pin out

In order to monitor the water level of the Keurig’s water reservoir pin 7 from table 2 will be polled by the Microcontroller. Analog to Digital Conversion technique will be used to map the water level to voltage signal and fed into the Microcontroller. If a high signal is intercepted an interrupt will be triggered and in the interrupt a message will be sent to the app via the Bluetooth module. Prior to brewing it will need to be determined whether the brew head of the Keurig coffee machine is open. Therefore, before accepting the command to brew pin J10 (brew head open switch) of Keurig's main controller board will be checked to determine whether the brew head is open. If the brew head is closed, then the Keurig will brew the coffee, otherwise an error message will be displayed in the application. Prior to brewing it will also need to be determined whether there is a coffee cup present under the spout. To do this a long range sensor will be applied at the base of the Keurig. The sensor that will be utilized is a SHARP GP2Y0A41SK0F. It can sense up to 30cm. It functions by detecting an object at a specific distance and outputting a voltage corresponding to the detection distance. That specific voltage will be read by the microcontroller and in turn signal will be sent to the application notifying the user if the cup is present or not. If the cup is not present the buttons on the application corresponding to brew and brew later will be disabled and a message will show up on the application saying a cup is not present. Android Application:

Figure 9: Data collected during a 7-day period ending on December 2, 2013.

The application will be built on the Android platform using Java. It will have a simple layout with buttons, and will be easy to use. The current version on Android is 4.4, codename KitKat. In order to support 99% of Android users, the application will need to support back to Froyo, Android OS version 2.2. The Android Bluetooth API will be used to communicate with Bluetooth module. The Bluetooth API was introduced in API 5 which will work with Froyo, API

8. In order to use features inside of Android there are permission which need to be requested by the application. When the user is about to install the application, the application will notify the user to accept and give permission to use Bluetooth. The application allows the user to connect to a device by simply pressing the menu button. When the menu button is pressed, an overlay pops up which lets you select a device. It will automatically look for devices which have already been paired. So if you’ve already connected to your coffee maker before hand, it will be easily connected. If the coffee maker has not been connected, then a scan button can be pressed and it will search for nearby Bluetooth devices. When the device shows up, pressing on it will pair it and connect it. This feature will allow the user to be able to control multiple devices by simply switching between them in the application. Originally, the device only supported portrait orientation but it was extended to handle landscape view. Mechanical Components: A holder needs to be designed in order to switch between different K-Cups. Figure 10 was the original design for the K Cup holder.

Figure 10: Preliminary K-Cup holder design

This holder was to be used in conjunction with the stepper motor and a mechanical solenoid. Ultimately this design was abandoned for a design that was more feasible. Figure 11 shows the final K Cup holder design.

Figure 11: K Cup holder final design

The new K Cup holder design was accompanied by an additional part to hold two new brew heads (the part that punctures the top of the K Cups).

Figure 12: Brew head beam

Finally these parts were both reinforced with additional aluminum to keep them ridged will puncturing the K Cups (figure 13).

Figure 13: Brew head beam and K Cup holder reinforced by aluminum

Each of the brew heads was connected to the to one of the three solenoids using food grade silicon tubing.

Figure 14: Solenoids with silicon tubing

Experimental Result: When the application is opened, all the buttons will be enabled but will do nothing since it is not connected. The device will let the user know they are not connected at the top right, seen in Figure 15. When a button is pressed, it will notify the user they are not connected. In order to connect, the menu button needs to be pressed and an overlay shows up with a list of pre-paired devices and an option to scan for more devices, this is seen in Figure 16.

Figure 15: Initial application start-up view

Figure 16: In-app connectivity menu

After connecting, it will notify the user it has connected and will show up on the top-right of the application and automatically requests information from the microcontroller about the state of the device. Figure 17 shows the connection of the device and the status of the coffee maker. Also seen in Figure 17 is the basic button layout with the brew buttons disabled when the cup is not present. When the cup is placed in front of the coffee maker the microcontroller sends a signal to the phone and lets the user know the cup is present, this can be seen in Figure 18. Also seen in Figure 18 is the detection of when the water level is low. From both Figures 17 and 18, we see that the buttons for brewing are disabled if there is not enough water or there is no cup present. But it allows the user to stop and clear any pending commands for brewing. When both are satisfied, the buttons will be enabled and the user will be able to select a KCup, Volume and whether they want to brew now or later. This can be seen in Figure 19.

Figure 17: Connected and showing status of device. In this instance, the cup is not present.

Figure 18: State of device showing water level is low.

Figure 19: Status of water and cup being satisfied and the user pressed the Brew Later option.

Some Android phones like the Nexus 7, are usually used in landscape. When the application was used in landscape view, it was not pleasant. So the application was extended by moving buttons and choices around when in landscape view. The landscape view can be seen in Figure 20. Some modifications were made to the applications in regards to working from previous test Figures to the landscape Figure.

Figure 20: Landscape view of the application

Budget: Our team was given a prototyping budget of $700 dollars and $300 for final production costs. The expenses and their costs are outlined below in table 3. The table shows that we did not utilize all the money allocated for the project. Part of the reason for that was the solenoids from Parker were donated. Expenses Keurig (B40) Coffee Maker (2) Stepper Motor Bluetooth Module (RN42) Miscellaneous Electrical Components Lexan Additional Keurig Components Parts Fabrication Tools Tubing & Connectors Parker Solenoids Total Cost: Remaining Prototyping Budget:

Cost of Expenses ($) 2 x 75.49 22.04 30 108 15.29 60 70 10 64.47 0 530.78 169.22

Table 3: Expenses along with total cost and remaining budget

Timeline:

Software design was a yearlong process, as we had to continually adjust the software according to our hardware needs and fix bugs along the way. Circuit design was accomplished in the first semester and the implementation was done throughout the second semester. The mechanical aspect of the project was one of the hardest parts as we are not mechanical engineers and it took a lot of research and planning from the first semester into the second semester. Throughout the second semester various design concepts were tested and reworked to create our final product. All of this is shown in figure 21 below.

Figure 21: Timeline

References: http://developer.android.com/about/dashboards/index.html