Thermometer control - javascript?

Status
Not open for further replies.

Wildbill

Ars Praefectus
3,327
Subscriptor++
I use a bundle of hardware (xbee, arduino, DS18B20) to deliver temperature data to a LAMP server which serves up a perl/CGI page mostly rendering google charts. All this so my Dad knows when freezing temperatures are over in his greenhouse so he can start planting. Yes, a $30 weather station would do the job - thank you for asking ;)

Given that I'm showing temperature, I thought I'd add a current temp widget just because. I did it with the google gauge from their charts, but I'd really like something that looks like a mercury thermometer. I've found a couple of javascript examples, but they look rather pedestrian next to the google stuff. I was starting to contemplate writing something from scratch but that just seems wrong. Any suggestions on a pretty free way of doing this before I start coding?
 

Hattori HANZo

Ars Scholae Palatinae
1,205
[url=http:/civis/viewtopic.php?p=25754855#p25754855:105tl913 said:
Wildbill[/url]":105tl913]Yes, a $30 weather station would do the job - thank you for asking ;)
Pff. Don't solve with consumer gear what you can solve for twice the costs in parts and lots of your spare time :D
My recent experience with cheap DS18B20s off ebay is btw that they don't keep within the +-0.5C range. The ten pack that went into the wire harness for my heating system varies by almost +-1.5C. Probably not a big deal for your green house use case, but I thought mentioning might not hurt.

I mainly posted to say thanks for the hint about those gauges. They look like I might use them, too.
 

topham

Ars Legatus Legionis
13,756
Subscriptor
I stumbled on an old ibutton programmable thermometer device (ive owned it for years and done nothing with it). When I went looking for specs I found out it was deprecated because of the variance in readings.

It's still cool though, I could program it to sample the temperature ever 5 minutes until the internal battery is exauhsted. (Unfortunately I've owned it for more than 10 years, so it's probably most of the way there as I think it still ran the clock).
 

Wildbill

Ars Praefectus
3,327
Subscriptor++
I got the Dojo gauges working - bit of a struggle, although of course now that it's working I can't see why really. However, I have a styling issue that predates the use of Dojo. Here's a reduced version of the page:
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="REFRESH" content="600">
<title>Arduino data</title>
<style>
.newspaper
{
-moz-column-count:2; /* Firefox */
-webkit-column-count:2; /* Safari and Chrome */
column-count:2;
}
</style>
<link rel="stylesheet" href="dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src='dojo/dojo.js'></script>
<script src='ArduinoGauge.js'></script>
</head>
<body class="claro">
<div><h1>Arduino Temperature & Humidity Data</h1></div>
<div class="newspaper">
  <div><h2>Temperature</h2></div>
  <div><h2>Humidity</h2></div>
</div>
<div class="newspaper">
  <div id="CircularTempGauge" ></div>

  <div id="CircularHumidityGauge" ></div>
  <div id="resultDiv"></div>
</div>
</body>
</html>

I want the data in two columns, which I get. I'd also like to get them to line up, which they don't. The browser (latest firefox, Safari) insists on adding a blank line before the Temperature heading so that it's lower in the page than the Humidity one. Clearly I can solve this with a table, but I was rather hoping I could persuade CSS to do it instead.
 
Status
Not open for further replies.