Results 1 to 10 of 10

Thread: Input from sensors. How to log

  1. #1

    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.

  2. #2
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    uhm...
    I guess your looking for is some kind of usb device?
    you need an usb chip, program it (most likely)
    and then set up a little deamon on the router that understands the usb device.

    sounds good?

  3. #3
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    AFAIK, wl500gPv1 has no free gpio pins... Some earlier versions (deluxe?) do had some... Also, some earlier devices had lpt port, which is generally speaking is also an array of gpio pins...

    So, for wl500gP you have to connect something to either usb, or rs232, or ethernet. I guess, definitely you need to use microcontroller (mc). From the point of view of mc handling, I'd put these three options in such order: rs232 (simplest) - usb - ethernet (the most complicated).

    Example of usage of rs232 you can find in the mc datasheets; I'd suggest to consider lcd2usb project as possible example for usb connection; and ISA-Ctrl AVR-Webserver an example of embedded web server.

  4. #4
    Quote Originally Posted by al37919 View Post
    AFAIK, wl500gPv1 has no free gpio pins... Some earlier versions (deluxe?) do had some... Also, some earlier devices had lpt port, which is generally speaking is also an array of gpio pins...

    So, for wl500gP you have to connect something to either usb, or rs232, or ethernet. I guess, definitely you need to use microcontroller (mc). From the point of view of mc handling, I'd put these three options in such order: rs232 (simplest) - usb - ethernet (the most complicated).

    Example of usage of rs232 you can find in the mc datasheets; I'd suggest to consider lcd2usb project as possible example for usb connection; and ISA-Ctrl AVR-Webserver an example of embedded web server.
    The complete schematic(s) are build around 2 PIC16F84's and behind the PIC's is a RS232 port which could be used.
    But my preferred supplier (conrad) doesn't have these PIC's. (so I was thinking of a way of directly feeding the input from the sensors to the asus.)
    anyone know of a supplier which ships to the netherlands which actually has these. ? TIA.

  5. #5
    I agree with other posters that the RS232 interface would be the simplest.
    You would need a PIC or Amtel AVR microcontroller to read the sensor and send the values through the serial port.

    My WL500W is connected to a AT Mega 32 via the internal serial port of the router. It was easy to do. The downside is that you need to open the router and solder 3 wires to the PCB. I use it to switch my printer and backup harddisk on and off with a web page.

    Pim.

  6. #6
    Quote Originally Posted by Pim Borst View Post
    I agree with other posters that the RS232 interface would be the simplest.
    You would need a PIC or Amtel AVR microcontroller to read the sensor and send the values through the serial port.

    My WL500W is connected to a AT Mega 32 via the internal serial port of the router. It was easy to do. The downside is that you need to open the router and solder 3 wires to the PCB. I use it to switch my printer and backup harddisk on and off with a web page.

    Pim.
    Nice,

    Yeah, after some reading and investigating I decided to built-up the complete schematics and get my data from the RS232 port.
    btw... I have found suppliers who have the PIC16F84 looking at 40-50 euro's for total components (including HF sender and receiver), so that's fine.

  7. #7
    Quote Originally Posted by raas View Post
    Yeah, after some reading and investigating I decided to built-up the complete schematics and get my data from the RS232 port.
    Can you post a link to the DIY project?

    And I was thinking, wouldn't it be possible to just use an USB2LPT adapter to read the signals?? (i found one for only €12)
    Or don't those things work on linux?

  8. #8
    Quote Originally Posted by DrChair View Post
    Can you post a link to the DIY project?

    And I was thinking, wouldn't it be possible to just use an USB2LPT adapter to read the signals?? (i found one for only €12)
    Or don't those things work on linux?
    Hi DrChair, the only online link I can find is this one: http://www.elektor.nl/artikelen-als-...r.227842.lynkx

    it has been published in Elektor in september 2007 and I found it when I was going through the paper magazine (i'm a member) a while ago. I don't think I can publish the schematic here (copyrighted ), but if you go to a library they'll probably have it, or purchase it online for something more than 1 euro.

    I haven't ordered any components yet, 'cause I'm still a bit in a planning phase. Still investigating if it would be possible to add 2 temperature sensors and a sensor for the home thermostat.

    If you log this data also, you can see trends like how much gas it has cost to warm the house in the mornig from like 15c to 20.5c with for example an outside temperature of 8c.

    Also, if you would log the thermostat setting (to detect if the central heating is on or not) then you would know how much gas is consumed for heating water (shower, clean) (I cook on electricity, so no gas consumer there), substract from total and you know consumption for heating the house, again with inside and outside temperatures.

    So I'm still a bit in a planning phase, but definatly going to make it.

  9. #9
    I'm in the process of building a media player and had a similar requirement for reading external control sensors. The product below might be interesting if only for extreme ease (nothing to build). It's essentially a USB interface to a PIC 18F2410 that has "14 I/O channels (8 can be used for analog inputs measuring 0-5 volts)". The PIC I/O pins can be read and set by issuing single character commands. I've just ordered one so can't report on how well it works in practice yet.

    http://www.saelig.com/miva/merchant....tegory_Code=UB

  10. #10
    Hi Martin,

    pretty interesting considering most temperature sensors are giving an analog signal. that was the problem what I'm having with the original schematic.

    This is a new hobby, so I'm still learning, reading, and gathering projects (from really simple, to more difficult ) so I can order a lot of stuff at the same time.

    Thanks.

Similar Threads

  1. How to test audio functions?
    By Reflex in forum WL-500g Q&A
    Replies: 6
    Last Post: 15-03-2011, 11:07
  2. Log File WL500G (system log)
    By henk_wl500g in forum Dutch Discussion - Nederlands
    Replies: 3
    Last Post: 18-07-2008, 09:13
  3. Problems compiling custom based firmware (using Kfurge howto)
    By Hytekk in forum WL-700g Firmware Discussion
    Replies: 17
    Last Post: 24-09-2007, 02:38
  4. icmp bloking ...
    By Kronos in forum WL-500g Q&A
    Replies: 0
    Last Post: 03-05-2004, 02:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •