This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
playground:mission-log-template2 [2014-11-05 18:35] – [Spark-Core Hacking: Read MQ2 sensor data] chrono | playground:mission-log-template2 [2015-12-14 23:15] (current) – created chrono | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Spark-Core Hacking: Read MQ2 sensor data ====== | + | ~~DRAFT~~ |
- | The [[mission: | + | ====== Questionable ideas for the record ====== |
- | Since gases can be a tricky and risky energy carriers and their combustion also creates potentially harmful by-products like Carbon-Monoxide (CO), it seemed prudent to have an autonomous environmental monitoring | + | Today was one of those rare, lucky days, when you get a chance to render someone awestruck with a perfect, bare-eye ISS fly-by observation for his first time. Afterwards, he was curious if that really was the ISS and how I was able to tell and predict it. Good. People who question things are good company. So I told him a bit about TLE's and how they can be used to calculate/ |
- | To cover everything, | + | Then it was my turn to render myself awestruck with a first-time observation |
- | ^ Sensor ^ Target ^ Description ^ Mount ^ | + | https://analytics.usa.gov/ |
- | | MQ7 | CO | Carbon-monoxide (Combustion product) | Top/Ceiling | | + | |
- | | MQ4 | CH4 | Methane (Natural Gas) | Top/Ceiling | | + | |
- | | MQ2 | C3H8 | Propane (Camping Gas Mix) | Bottom/Floor | | + | |
- | | MQ2 | C4H10 | Butane (Camping Gas Mix) | Bottom/ | + | |
- | | DS18S20 | Temperature | Room/Air Temperature Monitoring | Top | | + | |
- | The ideal platform for this project seemed to be a [[https:// | ||
- | I'll try to release the local spark cloud howto soon, to get an easy start with spark-cores without having to use the official spark-cloud and thereby rendering control of the IoT to basically any government " | + | https:// |
- | + | ||
- | ===== Hardware ===== | + | |
- | + | ||
- | * Spark-Core + SC Breadboard | + | |
- | * Sainsmart MQ2 el cheapo sensor board | + | |
- | * Two Resistors (Voltage Divider R1/R2: 10k/33k | + | |
- | + | ||
- | ===== Software ===== | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | <sxh bash> | + | |
- | # | + | |
- | + | ||
- | while : | + | |
- | do | + | |
- | VAL=$(spark call 1234567890abcdef analogread " | + | |
- | TS=$(date +%s) | + | |
- | echo "${TS} ${VAL}" | + | |
- | echo "${TS} ${VAL}" | + | |
- | sleep 1 | + | |
- | done; | + | |
- | + | ||
- | </ | + | |
< | < | ||
- | $ vi mq2-gnuplot.parm | + | https:// |
</ | </ | ||
+ | |||
+ | amsix-ams8.netarch.akamai.com | ||
+ | a23-34-186-52.deploy.static.akamaitechnologies.com | ||
< | < | ||
- | set terminal pngcairo background "# | + | % DOTGOV WHOIS Server ready |
- | set output " | + | Domain Name: DIGITALGOV.GOV |
+ | | ||
- | set title " | + | >>> |
- | set grid | + | Please be advised that this whois server only contains information pertaining |
- | set lmargin 9 | + | to the .GOV domain. For information for other domains please use the whois |
- | + | server at RS.INTERNIC.NET. | |
- | set style line 1 lc rgb '# | + | |
- | set style line 2 lt 2 lc rgb "# | + | |
- | + | ||
- | set ylabel "ADC Read Value" tc ls 2 offset 1,0 | + | |
- | + | ||
- | set xtics textcolor linestyle 2 rotate | + | |
- | set ytics textcolor linestyle 1 | + | |
- | set tics nomirror | + | |
- | + | ||
- | set xdata time | + | |
- | set timefmt " | + | |
- | set format x " | + | |
- | + | ||
- | set border linewidth 1 linestyle 2 | + | |
- | + | ||
- | unset key | + | |
- | + | ||
- | plot " | + | |
- | + | ||
- | quit | + | |
</ | </ | ||
- | |||
- | < | ||
- | $ watch --interval=1 gnuplot mq2-gnuplot.parm | ||
- | </ | ||
- | |||
- | You can use Ristretto or any other image viewer to look at the resulting png. Ristretto automatcally redraws the image, as soon as gnuplot put's out another one. | ||
- | |||
- | {{tag> | ||
- | |||
- | {{keywords> | ||
- | |||
- | ~~DISCUSSION~~ |