Un geiger collegato ad una scheda Arduino Uno con Ethernet shield (che rileva gli impulsi tramite interrupt e che implementa anche un web server) e una pagina php ospitata su un server commerciale consentono di monitorare da remoto via internet i livelli di radioattività, con una gradevole interfaccia grafica.
La pagina .php si occupa della visualizzazione grafica utilizzando le risorse rgraph.net (javascript).
<script src="RGraph.common.core.js"></script>
<script src="RGraph.meter.js"></script>
<script>
window.onload = function ()
{
var rh = new RGraph.Meter('rh', 0, 40, <?php echo $_POST["h"]; ?> );
rh.Set('chart.labels.position', 'inside');
rh.Set('chart.title', 'Radiation');
rh.Set('chart.title.vpos', 0.5);
rh.Set('chart.title.color', 'black');
rh.Set('chart.red.start', 32);
rh.Set('chart.red.end', 40);
rh.Set('chart.yellow.start', 20);
rh.Set('chart.yellow.end', 32);
rh.Set('chart.green.start', 0);
rh.Set('chart.green.end', 20);
rh.Set('chart.border', false);
rh.Set('chart.needle.linewidth', 5);
rh.Set('chart.needle.tail', true);
rh.Set('chart.tickmarks.big.num', 0);
rh.Set('chart.tickmarks.small.num', 0);
rh.Set('chart.segment.radius.start', 100);
rh.Set('chart.needle.radius', 80);
rh.Set('chart.needle.linewidth', 2);
rh.Set('chart.linewidth.segments', 15);
rh.Set('chart.strokestyle', 'white');
rh.Draw();
}
</script>
La visualizzazione nel <body> con l'istruzione
<div><canvas id="rh" width="400" height="250">[No canvas support]</canvas><br /><?php echo $_POST["h"]; ?> uR/h</div>
Nella sezione <head> una istruzione refresh consente in pratica l'aggiornamento ogni 30 secondi della visualizzazione:
echo '<meta http-equiv="refresh" content="30; url=http://...................">';
Lo sketch Arduino operante come web server ritorna come risposta una pagina html con una form che contiene il valore misurato inviato con metodo POST.
Scarica lo sketch