Difference between revisions of "S17: Wake up Barista"
Proj user4 (talk | contribs) (→Parts List & Cost) |
(→Grading Criteria) |
||
(61 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | == '''Wake up Barista''' == |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | '''Wake up Barista''' | ||
== Abstract == | == Abstract == | ||
− | When you have studied all night and need to attend a meeting in 9:00am next morning, you are running out of time to get anything done but have to get your caffeine fixed. Is there anything better than wake up with coffee aroma fills the air surrounding you? We want to introduce our product, your personal Wake Up Barista. A smart coffee maker embedded with alarm clock. Brewing the coffee for you right away when you | + | When you have studied all night and need to attend a meeting in 9:00am next morning, you are running out of time to get anything done but have to get your caffeine fixed. Is there anything better than wake up with coffee aroma fills the air surrounding you? We want to introduce our product, your personal Wake Up Barista. A smart coffee maker embedded with alarm clock. Brewing the coffee or other hot drink for you right away when you jump out from your bed! This device will heating and brewing the coffee or other hot drink automatically when the alarm clock begins to buzz. Enjoy the hot and fresh drink when you just open your eyes, also take a deep breath with the tempting smell, you will love it for sure! |
== Objectives & Introduction == | == Objectives & Introduction == | ||
− | + | ||
+ | :Our product has two major parts. First part is a modern alarm clock; secondly, it is able to make delicious coffee or other hot drink such as tea. | ||
+ | :For the alarm clock part, basically, you need to set the alarm clock time through our system by using the push button switches. The real time clock inside the SJ One board will record the data you have set and start the system. When the time reaches the setting time, SJ One board is using a PWM pin to control a singing speaker device to help you wake up under a warm and sweet environment. There is another GPIO pin is set as a reset key. Moreover, we are using an small but great LCD screen to show the needed data. These are all primary functions and theory of alarm clock part. | ||
+ | :For the barista side, it is relates inseparably with the alarm clock part we have, and it will start to produce hot drink 4 minutes before alarm set time, so that the drink will be ready when the setting time is up. Inside the barista, we are using many high level functions and sensors to control the whole system, includes high efficiency heater, water pump, buzzer, etc. | ||
=== Team Members & Responsibilities === | === Team Members & Responsibilities === | ||
* Chien Wei Lan | * Chien Wei Lan | ||
+ | ** Project concept | ||
+ | ** Software prototyping | ||
+ | ** Part of hardware design | ||
+ | ** Wiki | ||
* Mingyang Wang | * Mingyang Wang | ||
− | + | ** Implement and integrate the software part of project on SJ one board | |
+ | ** Including Alarm clock, RTC module, SPI LCD module, and GPIO to Relay Module | ||
+ | ** Wiki | ||
+ | |||
* Lin Zheng | * Lin Zheng | ||
+ | ** Implement part of PWM part to control buzzer | ||
+ | ** Part of hardware design | ||
+ | ** Wiki | ||
* Zhixuan Zhou | * Zhixuan Zhou | ||
+ | ** Part of hardware design | ||
+ | ** Whole system integration | ||
+ | ** Wiki page managing & develop | ||
== Schedule == | == Schedule == | ||
Line 35: | Line 38: | ||
|- | |- | ||
! scope="col"| Week# | ! scope="col"| Week# | ||
− | ! scope="col"| Date | + | ! scope="col"| Start Date |
+ | ! scope="col"| End Date | ||
! scope="col"| Task | ! scope="col"| Task | ||
− | ! scope="col"| Actual | + | ! scope="col"| Status |
+ | ! scope="col"| Actual Completion Date | ||
|- | |- | ||
! scope="row"| 1 | ! scope="row"| 1 | ||
| 3/19 | | 3/19 | ||
+ | | 3/21 | ||
| Finalized Schedule and materials | | Finalized Schedule and materials | ||
| Completed | | Completed | ||
+ | | 3/21 | ||
|- | |- | ||
! scope="row"| 2 | ! scope="row"| 2 | ||
− | | 3/ | + | | 3/22 |
+ | | 3/28 | ||
| Test water pump, timer, and heater | | Test water pump, timer, and heater | ||
− | | | + | | Completed |
+ | | 3/28 | ||
|- | |- | ||
! scope="row"| 3 | ! scope="row"| 3 | ||
− | | 4/ | + | | 3/29 |
+ | | 4/10 | ||
| Design Schematics & build up prototype | | Design Schematics & build up prototype | ||
− | | | + | | Completed |
+ | | 4/10 | ||
|- | |- | ||
! scope="row"| 4 | ! scope="row"| 4 | ||
− | | 4/ | + | | 4/5 |
− | | Refine prototype | + | | 4/20 |
− | | | + | | Refine prototype & Start to order required components |
+ | | Completed | ||
+ | |4/20 | ||
|- | |- | ||
! scope="row"| 5 | ! scope="row"| 5 | ||
− | | 4/ | + | | 4/20 |
+ | | 5/18 | ||
| Testing and Debug | | Testing and Debug | ||
− | | | + | | Completed |
+ | |5/18 | ||
|- | |- | ||
! scope="row"| 6 | ! scope="row"| 6 | ||
− | | 4/23 | + | | 4/19 |
− | | | + | | 5/23 |
− | | | + | | Writing project report |
+ | | Completed | ||
+ | |5/23 | ||
|- | |- | ||
! scope="row"| 7 | ! scope="row"| 7 | ||
− | | | + | | 5/15 |
− | | Find project | + | | 5/20 |
− | | | + | | Find project preparation |
+ | | Completed | ||
+ | |5/20 | ||
|- | |- | ||
! scope="row"| 8 | ! scope="row"| 8 | ||
− | | 5/ | + | | 5/20 |
+ | | 5/24 | ||
| Ready for Demo | | Ready for Demo | ||
− | | | + | | Completed |
+ | |5/23 | ||
|} | |} | ||
Line 85: | Line 106: | ||
! scope="col"| Number | ! scope="col"| Number | ||
! scope="col"| Part Name | ! scope="col"| Part Name | ||
− | ! scope="col"| Cost | + | ! scope="col"| Quantity |
+ | ! scope="col"| Parts Cost | ||
|- | |- | ||
! scope="row"| 1 | ! scope="row"| 1 | ||
− | | Heater | + | | Heater & Water Pump |
− | | | + | | 1 |
+ | | $29.99 | ||
|- | |- | ||
! scope="row"| 2 | ! scope="row"| 2 | ||
− | | | + | | Push Button Switch |
− | | | + | | 4 |
+ | | $3.99 | ||
|- | |- | ||
! scope="row"| 3 | ! scope="row"| 3 | ||
| LCD Module | | LCD Module | ||
− | | | + | | 1 |
+ | | $19.95 | ||
|- | |- | ||
! scope="row"| 4 | ! scope="row"| 4 | ||
− | | | + | | Buzzer |
− | | | + | | 1 |
+ | | $9.95 | ||
|- | |- | ||
! scope="row"| 5 | ! scope="row"| 5 | ||
− | | | + | | Relay Module |
− | | | + | | 1 |
+ | | $6.68 | ||
+ | |- | ||
+ | ! scope="row"| 6 | ||
+ | | PVC Board | ||
+ | | 1 | ||
+ | | $9.88 | ||
+ | |- | ||
+ | ! scope="row"| 7 | ||
+ | | Matel Stands | ||
+ | | 50 | ||
+ | | $7.69 | ||
+ | |- | ||
+ | ! scope="row"| 8 | ||
+ | | Jumper Wires | ||
+ | | 18 | ||
+ | | $2.69 | ||
+ | |- | ||
+ | ! scope="row"| 9 | ||
+ | | Power Strip | ||
+ | | 1 | ||
+ | | $2.88 | ||
+ | |||
|} | |} | ||
Line 112: | Line 160: | ||
=== Hardware Design === | === Hardware Design === | ||
− | + | ||
+ | We use SJ one board as LPC1658 arm cortext-M microcontroller as the project platform, with built-in RTC module and external LCD module, we can show the time on the LCD and set up the alarm clock on it. By manipulating two GPIO pins, one is used to control the relay to turn the heater on, the other one is used to control the water pump for dripping hot water. The overall system block diagram and schematic as below. | ||
+ | |||
+ | [[File:block_diagram.png|500px]] | ||
+ | |||
+ | Fig.1 Block Diagram of Wake Up Barista | ||
+ | |||
+ | [[File:Schem.png|500px]] | ||
+ | |||
+ | Fig.2 Schematic of Wake Up Barista | ||
+ | |||
+ | |||
+ | In this project, we use a SPI interface LCD module. To connect the LCD with SJ one board. You have to select specific SPI ports as MOSI, SCK, SSEL(CS), RST, RS(DS), and of course VCC and GND. This LCD module can be operated from 3.3V to 5V(brighter). Choose two GPIO to control the Relay module and PWM port for activate the buzzer. | ||
+ | |||
+ | TABLE.I Pin assignment | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! SJ one board | ||
+ | ! Port | ||
+ | ! LCD | ||
+ | ! Port | ||
+ | ! Relay | ||
+ | ! Water Pump | ||
+ | ! Heater | ||
+ | ! Buzzer | ||
+ | |- | ||
+ | | MOSI1 | ||
+ | | MOSI1 | ||
+ | | MISO | ||
+ | | 6 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | SCK1 | ||
+ | | SCK1 | ||
+ | | SCK | ||
+ | | 7 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | CS | ||
+ | | P1.19 | ||
+ | | CS | ||
+ | | 3 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | RST | ||
+ | | P1.20 | ||
+ | | RST | ||
+ | | 4 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | RS | ||
+ | | P1.22 | ||
+ | | D/C | ||
+ | | 5 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | 3V3 | ||
+ | | | ||
+ | | VCC | ||
+ | | 1 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | VCC | ||
+ | |- | ||
+ | | GND | ||
+ | | | ||
+ | | GND | ||
+ | | 2 | ||
+ | | RELAY GND | ||
+ | | | ||
+ | | | ||
+ | | GND | ||
+ | |- | ||
+ | | PWM0 | ||
+ | | PWM0 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | Buzzer PWM | ||
+ | |- | ||
+ | | 5V | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | RELAY 5V | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | RELAYCTL1 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | WP_CTL | ||
+ | | WP_CTL | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | | RELAYCTL2 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | HTR_CTL | ||
+ | | | ||
+ | | HTR_CTL | ||
+ | | | ||
+ | |} | ||
=== Hardware Interface === | === Hardware Interface === | ||
− | + | ||
+ | '''SPI Interface:''' | ||
+ | |||
+ | We use SPI interface LCD module to implement the alarm clock. SPI is a simple bus, exchange a byte via MOSI and MISO. | ||
+ | CS pin is used for control slave device. The SPI pin assignment as below. | ||
+ | {| class="wikitable" | ||
+ | ! SJ one board | ||
+ | ! Port | ||
+ | ! LCD | ||
+ | ! Port | ||
+ | |- | ||
+ | | MOSI1 | ||
+ | | MOSI1 | ||
+ | | MISO | ||
+ | | 6 | ||
+ | |- | ||
+ | | SCK1 | ||
+ | | SCK1 | ||
+ | | SCK | ||
+ | | 7 | ||
+ | |- | ||
+ | | CS | ||
+ | | P1.19 | ||
+ | | CS | ||
+ | | 3 | ||
+ | |- | ||
+ | | RST | ||
+ | | P1.20 | ||
+ | | RST | ||
+ | | 4 | ||
+ | |- | ||
+ | | RS | ||
+ | | P1.22 | ||
+ | | D/C | ||
+ | | 5 | ||
+ | |- | ||
+ | | 3V3 | ||
+ | | | ||
+ | | VCC | ||
+ | | 1 | ||
+ | |- | ||
+ | | GND | ||
+ | | | ||
+ | | GND | ||
+ | | 2 | ||
+ | |} | ||
+ | |||
+ | '''PWM Interface:''' | ||
+ | |||
+ | PWM is a digit output to emulate analog output with duty cycle. We can control the buzzer with PWM. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! SJ one board | ||
+ | ! Port | ||
+ | ! Buzzer | ||
+ | ! Port | ||
+ | |- | ||
+ | | PWM2 | ||
+ | | PWM2 | ||
+ | | PWM | ||
+ | | 1 | ||
+ | |} | ||
+ | |||
+ | |||
+ | '''GPIO interface:''' | ||
+ | |||
+ | Used GPIO to perform Button Switches and relay to control the heater and water pump. | ||
+ | |||
+ | |||
+ | {| class="wikitable" | ||
+ | ! SJ one board | ||
+ | ! Port | ||
+ | ! Button | ||
+ | ! Port | ||
+ | ! Relay | ||
+ | |- | ||
+ | | GPIO_B1 | ||
+ | | 0.0 | ||
+ | | B1 | ||
+ | | 1 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO_B2 | ||
+ | | 0.1 | ||
+ | | B2 | ||
+ | | 2 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO_B3 | ||
+ | | 2.6 | ||
+ | | B3 | ||
+ | | 3 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO_B4 | ||
+ | | 2.7 | ||
+ | | B4 | ||
+ | | 4 | ||
+ | | | ||
+ | |- | ||
+ | | GPIO_H | ||
+ | | 1.28 | ||
+ | | | ||
+ | | | ||
+ | | Heater | ||
+ | Relay | ||
+ | |- | ||
+ | | GPIO_W | ||
+ | | 1.29 | ||
+ | | | ||
+ | | | ||
+ | | WaterPump | ||
+ | Relay | ||
+ | |} | ||
=== Software Design === | === Software Design === | ||
− | + | ||
+ | [[File:244 project zhou.png|350px]] | ||
+ | |||
+ | Fig.3 Wake Up Bar!sta | ||
+ | |||
+ | |||
+ | The SJOne board utilizes four tasks to display, read key input, control heating and control buzzer. | ||
+ | |||
+ | The display task controls LCD using SPI bus. We initialize LCD when the display task begins. The display task receives data through queues from heat task and key button task; it also checks whether the RTC register changed. If the time or heating state is changed, it updates the LCD by writing new display data. | ||
+ | |||
+ | The key button task initial four GPIOs as input with pull-up. It reads the GPIO connected to keys when a key has pressed the value of the pin changes from 1 to 0. four keys is used, config RTC time, config alarm time, config whether to heat when at the alarm, manual start or cancel heating and stop the buzzer. Key task config RTC time, alarm time, and send state data through queues and give semaphore to other tasks to update display or take the control action. | ||
+ | |||
+ | Heat task utilizes task delay and takes semaphore blocks loop to control the heater and pump on for a constant time. It is blocked by a heating semaphore when heating finished it gives alarm semaphore. | ||
+ | |||
+ | Alarm task utilizes task delay, and take semaphore blocks loop to control the buzzer. It is blocked by an alarm semaphore. If an alarm semaphore is taken, it enables PWM to control the buzzer. If an alarm stop semaphore is taken, it disables PWM to stop the buzzer. | ||
=== Implementation === | === Implementation === | ||
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation. | This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | This product combines the clock and the coffee machine together. Using SJ one board to control the heater and the water pump to heat the water. Using SPI control the LCD screen to display time, date and alarm clock. | ||
+ | |||
+ | (1)There are four push button switches on the top of the Wake up Barista. From left to right are button one, button two, button three and button four. | ||
+ | |||
+ | [[File:IMG_button.JPG|400px]] | ||
+ | |||
+ | Fig. 4 The entire product | ||
+ | |||
+ | (2)Press button one and hold until the clock time flicker to start adjusting clock time. Press button one to adjust the hour, minute or date. Button three use for decrease the time, and button four use for increase the time. | ||
+ | |||
+ | [[File:IMG_time.JPG|400px]] | ||
+ | |||
+ | Fig. 5 LPC screen display | ||
+ | |||
+ | [[File:IMG_2868.JPG|400px]] | ||
+ | |||
+ | Fig.6 Setting time | ||
+ | |||
+ | |||
+ | (3)Press button two once to start setting the clock alarm, twice to adjust alarm time, third to finish adjusting and fourth to set the alarm on. | ||
+ | |||
+ | [[File:IMG_2863.JPG|400px]] | ||
+ | |||
+ | Fig.7 Setting alarm clock | ||
+ | |||
+ | (4)When clock alarm on, there is a coffee cup pattern on the bottom right corner. | ||
+ | |||
+ | [[File:IMG_2864.JPG|400px]] | ||
+ | |||
+ | Fig.8 The pattern show alarm clock is on | ||
+ | |||
+ | (5)When the clock alarm off, the pattern will disappear. | ||
+ | |||
+ | (6)If user only wants to make coffee without set the alarm clock, press button three and hold, and press button four. If user wants to stop the product directly, press button four and hold, and press button three. When the Wake up Barista start heating water, the pattern will change from green to red. After it done, press button one to stop the alarm clock, and the pattern will change from red to green. | ||
+ | |||
+ | [[File:IMG_2865.JPG|400px]] | ||
+ | |||
+ | Fig.9 The pattern show heating | ||
== Testing & Technical Challenges == | == Testing & Technical Challenges == | ||
Line 132: | Line 472: | ||
=== My Issue #1 === | === My Issue #1 === | ||
− | + | Timing issue to porting C code to FreeRTOS C++ code sytle. We Must use built-in FreeRTOS delay function or system crash may happen. | |
+ | |||
+ | === My Issue #2 === | ||
+ | High CPU utlization, unable to keep display update realtime. In order to reduce CPU utilization, we use queue, semaphore and check rtc change only send data to lcd when time or state changes. | ||
== Conclusion == | == Conclusion == | ||
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge? | Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge? | ||
+ | |||
+ | The Wake up Barista is a very useful product, which can help people save more time during a busy day. During design and build this product, there are several issues. Timing issue for avoid conflict or system crash. CPU utilization issue to realize display update real-time. After several test and adjust, finally solve those problems. This project is very helpful to apply theory to practice. Through the whole project, help us better understand the application of the SJ one board, and the communication between the SJ one board to other components. | ||
=== Project Video === | === Project Video === | ||
− | + | Click Here [https://youtu.be/bq1x2Md6ZfE] to watch the video! | |
=== Project Source Code === | === Project Source Code === |
Latest revision as of 15:23, 31 May 2017
Contents
Wake up Barista
Abstract
When you have studied all night and need to attend a meeting in 9:00am next morning, you are running out of time to get anything done but have to get your caffeine fixed. Is there anything better than wake up with coffee aroma fills the air surrounding you? We want to introduce our product, your personal Wake Up Barista. A smart coffee maker embedded with alarm clock. Brewing the coffee or other hot drink for you right away when you jump out from your bed! This device will heating and brewing the coffee or other hot drink automatically when the alarm clock begins to buzz. Enjoy the hot and fresh drink when you just open your eyes, also take a deep breath with the tempting smell, you will love it for sure!
Objectives & Introduction
- Our product has two major parts. First part is a modern alarm clock; secondly, it is able to make delicious coffee or other hot drink such as tea.
- For the alarm clock part, basically, you need to set the alarm clock time through our system by using the push button switches. The real time clock inside the SJ One board will record the data you have set and start the system. When the time reaches the setting time, SJ One board is using a PWM pin to control a singing speaker device to help you wake up under a warm and sweet environment. There is another GPIO pin is set as a reset key. Moreover, we are using an small but great LCD screen to show the needed data. These are all primary functions and theory of alarm clock part.
- For the barista side, it is relates inseparably with the alarm clock part we have, and it will start to produce hot drink 4 minutes before alarm set time, so that the drink will be ready when the setting time is up. Inside the barista, we are using many high level functions and sensors to control the whole system, includes high efficiency heater, water pump, buzzer, etc.
Team Members & Responsibilities
- Chien Wei Lan
- Project concept
- Software prototyping
- Part of hardware design
- Wiki
- Mingyang Wang
- Implement and integrate the software part of project on SJ one board
- Including Alarm clock, RTC module, SPI LCD module, and GPIO to Relay Module
- Wiki
- Lin Zheng
- Implement part of PWM part to control buzzer
- Part of hardware design
- Wiki
- Zhixuan Zhou
- Part of hardware design
- Whole system integration
- Wiki page managing & develop
Schedule
Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.
Week# | Start Date | End Date | Task | Status | Actual Completion Date |
---|---|---|---|---|---|
1 | 3/19 | 3/21 | Finalized Schedule and materials | Completed | 3/21 |
2 | 3/22 | 3/28 | Test water pump, timer, and heater | Completed | 3/28 |
3 | 3/29 | 4/10 | Design Schematics & build up prototype | Completed | 4/10 |
4 | 4/5 | 4/20 | Refine prototype & Start to order required components | Completed | 4/20 |
5 | 4/20 | 5/18 | Testing and Debug | Completed | 5/18 |
6 | 4/19 | 5/23 | Writing project report | Completed | 5/23 |
7 | 5/15 | 5/20 | Find project preparation | Completed | 5/20 |
8 | 5/20 | 5/24 | Ready for Demo | Completed | 5/23 |
Parts List & Cost
Number | Part Name | Quantity | Parts Cost |
---|---|---|---|
1 | Heater & Water Pump | 1 | $29.99 |
2 | Push Button Switch | 4 | $3.99 |
3 | LCD Module | 1 | $19.95 |
4 | Buzzer | 1 | $9.95 |
5 | Relay Module | 1 | $6.68 |
6 | PVC Board | 1 | $9.88 |
7 | Matel Stands | 50 | $7.69 |
8 | Jumper Wires | 18 | $2.69 |
9 | Power Strip | 1 | $2.88 |
Design & Implementation
The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.
Hardware Design
We use SJ one board as LPC1658 arm cortext-M microcontroller as the project platform, with built-in RTC module and external LCD module, we can show the time on the LCD and set up the alarm clock on it. By manipulating two GPIO pins, one is used to control the relay to turn the heater on, the other one is used to control the water pump for dripping hot water. The overall system block diagram and schematic as below.
Fig.1 Block Diagram of Wake Up Barista
Fig.2 Schematic of Wake Up Barista
In this project, we use a SPI interface LCD module. To connect the LCD with SJ one board. You have to select specific SPI ports as MOSI, SCK, SSEL(CS), RST, RS(DS), and of course VCC and GND. This LCD module can be operated from 3.3V to 5V(brighter). Choose two GPIO to control the Relay module and PWM port for activate the buzzer.
TABLE.I Pin assignment
SJ one board | Port | LCD | Port | Relay | Water Pump | Heater | Buzzer |
---|---|---|---|---|---|---|---|
MOSI1 | MOSI1 | MISO | 6 | ||||
SCK1 | SCK1 | SCK | 7 | ||||
CS | P1.19 | CS | 3 | ||||
RST | P1.20 | RST | 4 | ||||
RS | P1.22 | D/C | 5 | ||||
3V3 | VCC | 1 | VCC | ||||
GND | GND | 2 | RELAY GND | GND | |||
PWM0 | PWM0 | Buzzer PWM | |||||
5V | RELAY 5V | ||||||
RELAYCTL1 | WP_CTL | WP_CTL | |||||
RELAYCTL2 | HTR_CTL | HTR_CTL |
Hardware Interface
SPI Interface:
We use SPI interface LCD module to implement the alarm clock. SPI is a simple bus, exchange a byte via MOSI and MISO. CS pin is used for control slave device. The SPI pin assignment as below.
SJ one board | Port | LCD | Port |
---|---|---|---|
MOSI1 | MOSI1 | MISO | 6 |
SCK1 | SCK1 | SCK | 7 |
CS | P1.19 | CS | 3 |
RST | P1.20 | RST | 4 |
RS | P1.22 | D/C | 5 |
3V3 | VCC | 1 | |
GND | GND | 2 |
PWM Interface:
PWM is a digit output to emulate analog output with duty cycle. We can control the buzzer with PWM.
SJ one board | Port | Buzzer | Port |
---|---|---|---|
PWM2 | PWM2 | PWM | 1 |
GPIO interface:
Used GPIO to perform Button Switches and relay to control the heater and water pump.
SJ one board | Port | Button | Port | Relay |
---|---|---|---|---|
GPIO_B1 | 0.0 | B1 | 1 | |
GPIO_B2 | 0.1 | B2 | 2 | |
GPIO_B3 | 2.6 | B3 | 3 | |
GPIO_B4 | 2.7 | B4 | 4 | |
GPIO_H | 1.28 | Heater
Relay | ||
GPIO_W | 1.29 | WaterPump
Relay |
Software Design
Fig.3 Wake Up Bar!sta
The SJOne board utilizes four tasks to display, read key input, control heating and control buzzer.
The display task controls LCD using SPI bus. We initialize LCD when the display task begins. The display task receives data through queues from heat task and key button task; it also checks whether the RTC register changed. If the time or heating state is changed, it updates the LCD by writing new display data.
The key button task initial four GPIOs as input with pull-up. It reads the GPIO connected to keys when a key has pressed the value of the pin changes from 1 to 0. four keys is used, config RTC time, config alarm time, config whether to heat when at the alarm, manual start or cancel heating and stop the buzzer. Key task config RTC time, alarm time, and send state data through queues and give semaphore to other tasks to update display or take the control action.
Heat task utilizes task delay and takes semaphore blocks loop to control the heater and pump on for a constant time. It is blocked by a heating semaphore when heating finished it gives alarm semaphore.
Alarm task utilizes task delay, and take semaphore blocks loop to control the buzzer. It is blocked by an alarm semaphore. If an alarm semaphore is taken, it enables PWM to control the buzzer. If an alarm stop semaphore is taken, it disables PWM to stop the buzzer.
Implementation
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
This product combines the clock and the coffee machine together. Using SJ one board to control the heater and the water pump to heat the water. Using SPI control the LCD screen to display time, date and alarm clock.
(1)There are four push button switches on the top of the Wake up Barista. From left to right are button one, button two, button three and button four.
Fig. 4 The entire product
(2)Press button one and hold until the clock time flicker to start adjusting clock time. Press button one to adjust the hour, minute or date. Button three use for decrease the time, and button four use for increase the time.
Fig. 5 LPC screen display
Fig.6 Setting time
(3)Press button two once to start setting the clock alarm, twice to adjust alarm time, third to finish adjusting and fourth to set the alarm on.
Fig.7 Setting alarm clock
(4)When clock alarm on, there is a coffee cup pattern on the bottom right corner.
Fig.8 The pattern show alarm clock is on
(5)When the clock alarm off, the pattern will disappear.
(6)If user only wants to make coffee without set the alarm clock, press button three and hold, and press button four. If user wants to stop the product directly, press button four and hold, and press button three. When the Wake up Barista start heating water, the pattern will change from green to red. After it done, press button one to stop the alarm clock, and the pattern will change from red to green.
Fig.9 The pattern show heating
Testing & Technical Challenges
- 1. Control the heater and water pump.
- 2. Work on RTC timer on SJ one Board.
- 3. Control the speaker and vibrator as alarm clock.
- 4. Display the clock time with LCD module
My Issue #1
Timing issue to porting C code to FreeRTOS C++ code sytle. We Must use built-in FreeRTOS delay function or system crash may happen.
My Issue #2
High CPU utlization, unable to keep display update realtime. In order to reduce CPU utilization, we use queue, semaphore and check rtc change only send data to lcd when time or state changes.
Conclusion
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
The Wake up Barista is a very useful product, which can help people save more time during a busy day. During design and build this product, there are several issues. Timing issue for avoid conflict or system crash. CPU utilization issue to realize display update real-time. After several test and adjust, finally solve those problems. This project is very helpful to apply theory to practice. Through the whole project, help us better understand the application of the SJ one board, and the communication between the SJ one board to other components.
Project Video
Click Here [1] to watch the video!
Project Source Code
References
Acknowledgement
Any acknowledgement that you may wish to provide can be included here.
References Used
List any references used in project.
Appendix
You can list the references you used.