Input from sensors. How to log
Hi,
I'm playing with this idea. (logging input from IO sensors)
I've found diy-schematics to create a energy (electricity/gas) meter/sensor system which is kind-of stand-alone, and consists of a couple of sensors and a unit with an lcd to display current electricity and gas consumption.
Now I only want to take the input of the sensors and log them somehow to a file or a database so that this data can be used for further processing (whatever that maybe.)
I've searched a bit, but got confused, if someone could tell me how to log inputs of simple sensors which give a 'pulse' (IO on or off)
now, in short, how the system works.
Most powermeters in homes (digital ones, like mine, luckily) have a couple of leds to indicate operation. in my case 1 led is for type I (night) electricty, another led is for type II (day) electricty, and the 3rd led is an 'impulse' led. The meter states 800imp/kwH, so every blink of the led is 1,25 watts of enery consumed.
now, put some light dependant resistors together to tell the difference between type I en II electricity, and use an LDR and some op-amps to amplify the pulse. count it, and you know your electricity consumption.
Now for Gas, the meter measures in M3 to 1cc as it's smallest unit.
The meter (rotating numbers) have a 'dim' finish, other than the number '0' (in my case) or the '6' which are shinny. This difference can be detected by an so called 'opto-coupler' which allows you to measure every 10cc of gas consumed, as the opto-coupler notices this difference it sends a pulse., count it and you know your gas consumption.