Difference between revisions of "ECE497 Project Coffee Pot Control"

From eLinux.org
Jump to: navigation, search
(test)
m
 
(38 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:ECE497 |Px]]
+
[[Category:ECE497Fall2016|Px]]
 
{{YoderHead}}
 
{{YoderHead}}
  
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.)
+
Team members: [[user: Dituccjv| James DiTucci]] [[user:Hangdu| Hang Du]],  
 +
 
 +
== Grading Template ==
 +
 
 +
Add your names to this wiki!
 +
 
  
== Grading Template ==
 
 
I'm using the following template to grade.  Each slot is 10 points.
 
I'm using the following template to grade.  Each slot is 10 points.
 
0 = Missing, 5=OK, 10=Wow!
 
0 = Missing, 5=OK, 10=Wow!
  
 
<pre style="color:red">
 
<pre style="color:red">
00 Executive Summary
+
08 Executive Summary
00 Installation Instructions  
+
04 Installation Instructions - Details are missing
00 User Instructions
+
09 User Instructions
00 Highlights
+
10 Highlights - Nice videos
00 Theory of Operation
+
10 Theory of Operation - Nice "Theory of Operation" and Instillation sections.
00 Work Breakdown
+
10 Work Breakdown
00 Future Work
+
09 Future Work
00 Conclusions
+
10 Conclusions
00 Demo
+
08 Demo - Seems a bit hacked together.  Didn't see the video capture. 
00 Late
+
10 Not Late
 
Comments: I'm looking forward to seeing this.
 
Comments: I'm looking forward to seeing this.
  
Score:  10/100
+
Score:  88/100
 
</pre>
 
</pre>
  
Line 28: Line 32:
 
== Executive Summary ==
 
== Executive Summary ==
  
Give two sentence intro to the project.
+
Our project is to use the BBB to create a web interface for a common home coffee pot. Our web interface should allow <span style="color:red">(should allow? What does it do?)</span> users to schedule brew times, see a photo of the current coffee pot, see the temperature of the liquid; additionally the BBB should turn off the coffee pot when it is running dangerously low to avoid sludge at the bottom of the pot and notify the user via email when the pot should be refilled .
 +
 
 +
Currently, our project accomplishes the goal of allowing users to schedule brew times, see a photo of the coffee pot, and plot the temperature all from a web interface.
 +
 
 +
Currently, our project does not accomplish the goal of notifying the user when the pot is running low and turning off the pot. We cannot accomplish this because the Sparkfun pressure sensor that we used to determine how much liquid is in the pot cannot withstand the heat of the burner.
 +
 
 +
In fine <span style="color:red">(fine?)</span>
 +
, this project demonstrates the ease at which a maker can automate their environment. The BBB's ability to simplify GPIO and I2C interfaces along with node js's extensive repository modules makes interacting with the outside world simple
  
Give two sentences telling what works.
+
== Packaging ==
  
Give two sentences telling what isn't working.
+
We have not put any work into final packaging. This project simply represents the rapid prototyping capacity of the BBB.
 +
[[File:Pressuredivider.png|thumb|150px|Voltage Divider for BBB]]
 +
The Hardware used in this design includes the following
  
End with a two sentence conclusion.
+
* [https://www.sparkfun.com/products/9375 Sparkfun Pressure Sensitive Resistor]
 +
Place the pressure resistor under the coffee pot. It is important to maintain consistency in the placement of the coffee pot relative to the resistor as well as the resistor relative to the burner. Currently, this piece of hardware is a weakness in the design. It cannot withstand the heat of the burner. If a replacement piece of hardware can be found this wiki will be updated. Additionally, it is necessary to calibrate the code to fit with your particular coffee pot.
  
The sentence count is approximate and only to give an idea of the expected length.
+
* [https://www.sparkfun.com/products/11050 Dallas One Wire Waterproof Temp Sensor]
 +
The Temp Sensor that we used is from Dallas one wire. It communicates over serial one wire communication. It simply needs to be somewhere in the middle of the liquid.
  
== Packaging ==
+
* [http://us.playstation.com/ps2/accessories/eyetoy-usb-camera-ps2.html Playstation EyeToy] <span style="color:red">(Looks like a different camera)</span>
 +
The PS Eyetoy is hooked into the USB input on the BBB.
  
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final packaging.
+
* [https://www.sparkfun.com/products/10747 PowerSwitch Tail II]
 +
The PowerSwitch Tail II is essentially a relay that can be used to switch a load that is connected to a wall outlet using a small signal from one of the BBB's GPIOs. Connect the GND and IN- to GND and attach IN+ to P9_13 for the current code configuration.
  
 
== Installation Instructions ==
 
== Installation Instructions ==
 +
<span style="color:red">How do I wire the hardware?</span>
  
 
The first time:
 
The first time:
  
set environment variable
+
1.set environment variable
 +
 
 
'''vim ~/.bash_profile'''
 
'''vim ~/.bash_profile'''
add this two line to the end of the file
+
 
 +
add the following lines to the end of the file:
 +
 
 
export SLOTS=/sys/devices/platform/bone_capemgr/slots
 
export SLOTS=/sys/devices/platform/bone_capemgr/slots
 +
 
export DTS=/opt/source/bb.org-overlays/src/arm
 
export DTS=/opt/source/bb.org-overlays/src/arm
 +
 
exit beaglebone and login again  
 
exit beaglebone and login again  
export
+
'''export'''
 
The result should include SLOTS and DTS.
 
The result should include SLOTS and DTS.
  
git clone https://github.com/hangdu/ECE497_finalproject.git
+
 
npm install ds18b20
+
2.install something <span style="color:red">(install.sh and setup.sh files are missing.)</span>
npm install http
+
 
npm install fs
+
'''git clone https://github.com/hangdu/ECE497_finalproject.git'''
npm install child_process
+
 
npm install crontab
+
'''npm install ds18b20'''
npm install nodemailer
+
 
npm install socket.io
+
'''npm install http'''
 +
 
 +
'''npm install fs'''
 +
 
 +
'''npm install child_process'''
 +
 
 +
'''npm install crontab'''
 +
 
 +
'''npm install nodemailer'''
 +
 
 +
'''npm install socket.io'''
  
 
install v4l2grab:
 
install v4l2grab:
git clone https://github.com/twam/v4l2grab.git
 
make
 
  
 +
'''git clone https://github.com/twam/v4l2grab.git'''
 +
 +
'''make''' <span style="color:red">(This doesn't work for me.)</span>
 +
 +
 +
3.1 for the camera to work
 +
 +
connect the camera to the beaglebone with USB
 +
 +
check /dev/vedio0 is showed
 +
 +
test camera using the command
 +
 +
'''v4l2grab -W 160 -H 120 -o test.JPEG'''
 +
 +
 +
3.2 for temperature sensor to work
 +
 +
check the hardware connection
 +
 +
'''vim /boot/uEnv.txt'''
 +
 +
make sure HDMI is disabled and eMMC is enabled
 +
 +
'''cd $DTS'''
 +
 +
'''vim univ-emmc-00A0.dts'''
  
 +
uncomment all things related to P9_12
 +
 +
'''cd ../../'''
 +
 +
'''make'''
 +
 +
'''cp ./src/arm/univ-emmc-00A0.dtbo /lib/firmware'''
 +
 +
'''cd /lib/firmware'''
 +
 +
'''echo BB-W1-P9.12 > $SLOTS'''
 +
 +
'''cat $SLOTS'''
 +
 +
to check BB-W1-P9.12 is loaded. <span style="color:red">(How do I know it's loaded?)</span>
 +
 +
'''cd /sys/bus/w1/devices'''
 +
 +
'''ls'''
 +
 +
'''cd 28-000008291724'''
 +
 +
28-000008291724 is the id of the temperature sensor. Every temperature sensor has a its own id. So be sure to check that and go to that directory.
 +
 +
'''cat w1_slave'''
 +
 +
then the temperature will be showed.
 +
 +
 +
3.3 for scheduling time to turn on coffee pot to work
 +
 +
on host computer(run specific shell):
 +
 +
'''cd BeagleBoard-exercise/setup'''
 +
 +
'''./firstssh.sh'''
 +
 +
on beaglebone(check the time is OK):
 +
 +
'''date'''
 +
 +
 +
4.export gpio31
 +
 +
'''cd /sys/class/gpio'''
 +
 +
'''ls'''
 +
 +
to check if gpio31 appears(GPIO31 pin is used to connect the coffee pot)
 +
 +
otherwise
 +
 +
'''echo gpio31 > export'''
 +
 +
 +
5.run Server
 +
 +
'''cd ECE497_finalproject/project/http'''
 +
 +
'''./setup.sh'''
 +
 +
'''./boneServer.js''' <span style="color:red">(I get an error.)</span>
 +
 +
 +
6.open client
 +
 +
Go to the browser and go to 192.168.7.2:9090
 +
 +
 +
Later:
 +
 +
You only need to start from step5 and step6.
  
 
== User Instructions ==
 
== User Instructions ==
  
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
+
The following graphic should assist a new user in navigating our webpage.
 +
 
 +
[[file:Camera Demo20.png | 800px]]
  
 
== Highlights ==
 
== Highlights ==
  
Here is where you brag about what your project can do.
+
[https://www.youtube.com/watch?v=bLEeOL1smGM  BBB Connected Coffee Pot Demo pt1 (Set Brew Alarm)]
  
Include a [http://www.youtube.com/ YouTube] demo.
+
[https://www.youtube.com/watch?v=PCy-TkzgIBE  BBB Connected Coffee Pot Demo pt2 (Reap Rewards of Brew Alarm)]
 +
 
 +
[https://www.youtube.com/watch?v=mMTOMqh2-NI  BBB Connected Coffee Pot Demo pt3 (Low Pot Alert and Auto Shutoff)]
 +
 
 +
[https://www.youtube.com/watch?v=L3bU4Kg_SDQ  BBB Connected Coffee Pot Demo pt4 (Snapshot and Temperature sensor)]
  
 
== Theory of Operation ==
 
== Theory of Operation ==
  
Give a high level overview of the structure of your software. Are you using GStreamer?  Show a diagram of the pipeline. Are you running multiple tasks?  Show what they do and how they interact.
+
[[File: General.png]]
 +
[[File: Brewtime.png]]
 +
[[File: Alertmail.png]]
 +
[[File: TempGraph.png]]
 +
[[File: Snapshot.png]]
 +
[[File: Autoshutoff.png]]
  
 
== Work Breakdown ==
 
== Work Breakdown ==
Line 89: Line 230:
  
 
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
 
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
 +
* Setup web interface [[user: Hangdu| Hang Du]]
 +
* Set Brew Alarm [[user: Hangdu| Hang du]]
 +
* Send Email upon empty pot condition [[user: dituccjv| James DiTucci]]
 +
* Turn Off Pot upon empty pot condition [[user: dituccjv| James DiTucci]]
 +
* Take Picture of Pot [[user: Hangdu| Hang Du]]
 +
* Take Temp Data [[user:hangdu| Hang Du]]
  
 
== Future Work ==
 
== Future Work ==
 +
Future work on the BBB Coffee Pot would include, choosing a suitable pressure sensor that can withstand the heat of the coffee pot. Unfortunately, the pressure sensitive resistor that was available to us cannot stand up to the heat of the coffee pot burner. The pressure sensor enables two neat features which are already implemented in the code: first the Bone will shut off the coffee pot when it senses the pot is critically low as to avoid evaporating all the liquid leaving gross coffee sludge in the bottom of the pot, second when the Bone senses the pot is running low it will notify the user of the event over email. currently, neither of those functions are actually implemented because we don't have the proper hardware. Future work on the software side would be to make the web page more user-friendly and aesthetically pleasing, create a system for user accounts, and increase the security of the BBBCoffeePot@Gmail.com email address. Currently, the password is plain text in the boneserver.js file.
  
Suggest addition things that could be done with this project.
+
== Conclusions ==
  
== Conclusions ==
+
At the end of this project, the biggest takeaway for me is how painless it is to develop a very useful device. Most of the struggle was finding the appropriate hardware. Using Node JS modules makes fairly complex tasks such as reading an analog input and sending simple. An area we should improve on is our web dev skills. The website is easy to use but looks sloppy.
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
One really interesting idea I had towards the end of the project that could take this in a completely different direction is using PWM the relay and the temperature sensor that we have to control the temperature of the liquid using a PID control scheme.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 06:20, 27 October 2017

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: James DiTucci Hang Du,

Grading Template

Add your names to this wiki!


I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

08 Executive Summary
04 Installation Instructions - Details are missing
09 User Instructions
10 Highlights - Nice videos
10 Theory of Operation - Nice "Theory of Operation" and Instillation sections.
10 Work Breakdown
09 Future Work
10 Conclusions
08 Demo - Seems a bit hacked together.  Didn't see the video capture.  
10 Not Late
Comments: I'm looking forward to seeing this.

Score:  88/100

(Inline Comment)

Executive Summary

Our project is to use the BBB to create a web interface for a common home coffee pot. Our web interface should allow (should allow? What does it do?) users to schedule brew times, see a photo of the current coffee pot, see the temperature of the liquid; additionally the BBB should turn off the coffee pot when it is running dangerously low to avoid sludge at the bottom of the pot and notify the user via email when the pot should be refilled .

Currently, our project accomplishes the goal of allowing users to schedule brew times, see a photo of the coffee pot, and plot the temperature all from a web interface.

Currently, our project does not accomplish the goal of notifying the user when the pot is running low and turning off the pot. We cannot accomplish this because the Sparkfun pressure sensor that we used to determine how much liquid is in the pot cannot withstand the heat of the burner.

In fine (fine?) , this project demonstrates the ease at which a maker can automate their environment. The BBB's ability to simplify GPIO and I2C interfaces along with node js's extensive repository modules makes interacting with the outside world simple

Packaging

We have not put any work into final packaging. This project simply represents the rapid prototyping capacity of the BBB.

Voltage Divider for BBB

The Hardware used in this design includes the following

Place the pressure resistor under the coffee pot. It is important to maintain consistency in the placement of the coffee pot relative to the resistor as well as the resistor relative to the burner. Currently, this piece of hardware is a weakness in the design. It cannot withstand the heat of the burner. If a replacement piece of hardware can be found this wiki will be updated. Additionally, it is necessary to calibrate the code to fit with your particular coffee pot.

The Temp Sensor that we used is from Dallas one wire. It communicates over serial one wire communication. It simply needs to be somewhere in the middle of the liquid.

The PS Eyetoy is hooked into the USB input on the BBB.

The PowerSwitch Tail II is essentially a relay that can be used to switch a load that is connected to a wall outlet using a small signal from one of the BBB's GPIOs. Connect the GND and IN- to GND and attach IN+ to P9_13 for the current code configuration.

Installation Instructions

How do I wire the hardware?

The first time:

1.set environment variable

vim ~/.bash_profile

add the following lines to the end of the file:

export SLOTS=/sys/devices/platform/bone_capemgr/slots

export DTS=/opt/source/bb.org-overlays/src/arm

exit beaglebone and login again export The result should include SLOTS and DTS.


2.install something (install.sh and setup.sh files are missing.)

git clone https://github.com/hangdu/ECE497_finalproject.git

npm install ds18b20

npm install http

npm install fs

npm install child_process

npm install crontab

npm install nodemailer

npm install socket.io

install v4l2grab:

git clone https://github.com/twam/v4l2grab.git

make (This doesn't work for me.)


3.1 for the camera to work

connect the camera to the beaglebone with USB

check /dev/vedio0 is showed

test camera using the command

v4l2grab -W 160 -H 120 -o test.JPEG


3.2 for temperature sensor to work

check the hardware connection

vim /boot/uEnv.txt

make sure HDMI is disabled and eMMC is enabled

cd $DTS

vim univ-emmc-00A0.dts

uncomment all things related to P9_12

cd ../../

make

cp ./src/arm/univ-emmc-00A0.dtbo /lib/firmware

cd /lib/firmware

echo BB-W1-P9.12 > $SLOTS

cat $SLOTS

to check BB-W1-P9.12 is loaded. (How do I know it's loaded?)

cd /sys/bus/w1/devices

ls

cd 28-000008291724

28-000008291724 is the id of the temperature sensor. Every temperature sensor has a its own id. So be sure to check that and go to that directory.

cat w1_slave

then the temperature will be showed.


3.3 for scheduling time to turn on coffee pot to work

on host computer(run specific shell):

cd BeagleBoard-exercise/setup

./firstssh.sh

on beaglebone(check the time is OK):

date


4.export gpio31

cd /sys/class/gpio

ls

to check if gpio31 appears(GPIO31 pin is used to connect the coffee pot)

otherwise

echo gpio31 > export


5.run Server

cd ECE497_finalproject/project/http

./setup.sh

./boneServer.js (I get an error.)


6.open client

Go to the browser and go to 192.168.7.2:9090


Later:

You only need to start from step5 and step6.

User Instructions

The following graphic should assist a new user in navigating our webpage.

Camera Demo20.png

Highlights

BBB Connected Coffee Pot Demo pt1 (Set Brew Alarm)

BBB Connected Coffee Pot Demo pt2 (Reap Rewards of Brew Alarm)

BBB Connected Coffee Pot Demo pt3 (Low Pot Alert and Auto Shutoff)

BBB Connected Coffee Pot Demo pt4 (Snapshot and Temperature sensor)

Theory of Operation

General.png Brewtime.png Alertmail.png TempGraph.png Snapshot.png Autoshutoff.png

Work Breakdown

List the major tasks in your project and who did what.

Also list here what doesn't work yet and when you think it will be finished and who is finishing it.

Future Work

Future work on the BBB Coffee Pot would include, choosing a suitable pressure sensor that can withstand the heat of the coffee pot. Unfortunately, the pressure sensitive resistor that was available to us cannot stand up to the heat of the coffee pot burner. The pressure sensor enables two neat features which are already implemented in the code: first the Bone will shut off the coffee pot when it senses the pot is critically low as to avoid evaporating all the liquid leaving gross coffee sludge in the bottom of the pot, second when the Bone senses the pot is running low it will notify the user of the event over email. currently, neither of those functions are actually implemented because we don't have the proper hardware. Future work on the software side would be to make the web page more user-friendly and aesthetically pleasing, create a system for user accounts, and increase the security of the BBBCoffeePot@Gmail.com email address. Currently, the password is plain text in the boneserver.js file.

Conclusions

At the end of this project, the biggest takeaway for me is how painless it is to develop a very useful device. Most of the struggle was finding the appropriate hardware. Using Node JS modules makes fairly complex tasks such as reading an analog input and sending simple. An area we should improve on is our web dev skills. The website is easy to use but looks sloppy.

One really interesting idea I had towards the end of the project that could take this in a completely different direction is using PWM the relay and the temperature sensor that we have to control the temperature of the liquid using a PID control scheme.




thumb‎ Embedded Linux Class by Mark A. Yoder