Home  5  Books  5  GBEzine  5  News  5  HelpDesk  5  Register  5  GreenBuilding.co.uk
Not signed in (Sign In)

Categories



Green Building Bible, Fourth Edition
Green Building Bible, fourth edition (both books)
These two books are the perfect starting place to help you get to grips with one of the most vitally important aspects of our society - our homes and living environment.

PLEASE NOTE: A download link for Volume 1 will be sent to you by email and Volume 2 will be sent to you by post as a book.

Buy individually or both books together. Delivery is free!


powered by Surfing Waves




Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome to new Forum Visitors
Join the forum now and benefit from discussions with thousands of other green building fans and discounts on Green Building Press publications: Apply now.




  1.  
    Posted By: SteamyTeaSo as I write the data to a text file every 6 seconds, could I write a bit more Python Script to to buffer the data before I write it to the file stored on the SD card? Or maybe to two SD Card on a card reader? (just thought of that).

    Or if that complicates the program too much, do it outside the program.

    For my data collection where I'm writing a pair of RRDB files every minute and another 74 every five minutes, I wanted to avoid keeping on spinning up the hard disks which otherwise can sleep for a good chunk of the day.

    The monitoring scripts create a small RAM disk with

    APPDIR=/var/local/monitoring
    WORKDIR=$APPDIR/work
    case "$1" in
    start)
    if [ -f $WORKDIR/state.db ]
    then : OK
    else
    mount -t tmpfs -osize=10m /dev/ram1 $WORKDIR && $0 restore
    fi
    # start the monitoring ...
    ;;
    backup)
    cp -r $WORKDIR/* $APPDIR/backup/
    ;;
    restore)
    cp -r $APPDIR/backup/* $WORKDIR
    ;;
    ...
    esac


    Where $0 is the name of the script so it can re-run itself to do backups from RAM-disk to spinning and restore from spinning to RAM-disk.

    The stop section does a
    $0 backup
    before umount-ing the RAM-disk.

    Then I can choose how often I want a copy of the data/spin up the disk.
    # crontab -l
    # backup every 20 minutes
    */20 * * * * test -f /var/local/monitoring/work/state.db && /var/local/monitoring/xpl.init backup

    Hmmm looking at that now, it would be better to build the test into the init script ...
    • CommentAuthorMackers
    • CommentTimeDec 30th 2013 edited
     
    Ok, I`m going to order my RaspberryPi very soon, what do I need?

    1) RaspberryPi B model 512mb
    2) Power supply
    3) USB mouse and keyboard- already have this
    4) Case
    5) PiRack GPIO expansion card
    6) SD card- might have one lying around

    I want to as previously mentioned home automate ect, so what else do I need?
    I know ST has shown the 1-wire sensors ect.
    Is PiFace any good?

    There is so much to choose from its head spinning lol
    • CommentAuthorSean
    • CommentTimeDec 30th 2013
     
    this site will no doubt have been mentioned here before, but if your aim to to monitor and automate these plenty here to get your plans started

    http://openenergymonitor.org/emon/
    • CommentAuthorcbatjesmond
    • CommentTimeDec 30th 2013 edited
     
    Posted By: MackersOk, I`m going to order my RaspberryPi very soon, what do I need?

    2) Power supply
    And/Or a powered USB hub for if/when you need more current/USB-ports than the RaspberryPi can provide.

    6) SD card- might have one lying around
    Get a spare !

    There is so much to choose from its head spinning lol
    :-)

    7) HDMI->(whatever video input you have) cable, to make initial setup simpler.
    •  
      CommentAuthorSteamyTea
    • CommentTimeDec 31st 2013
     
    A 'breadboard' and some connecting wires are useful, as are a pile of resistors, LEDs and capacitors. A multimeter too.
    A Network cable.
    I have a cheap HDMI to VGA adapter.

    I have a PiFace, but never used it. I think there is an issue with it reading 1wire devices reliably. Would have to check on that.

    A Wireless adapter is useful, and the must have is an real time clock.

    Software needed is PuTTY, TightVNC and WinSCP to you can work it remotely.

    The biggest thing you will need is time, fags and coffee, oh and a pencil and paper.
    • CommentAuthorMackers
    • CommentTimeDec 31st 2013
     
    I'll get all that sorted tonight. I'll not bother with any break out boards just yet.

    I'll let you know when I'm up and running.

    I'll also do a few sketches of my ideas of what I want from it and we'll go from there

    Getting excited now!
    • CommentAuthorborpin
    • CommentTimeDec 31st 2013
     
    No need for a monitor. Just install PuTTY and connect through SSH. If you are new to the command line, get a book on Linux/Unix Command line if you don't have one. I have an old 'Unix in a Nutshell' book that I still use....

    Defo a powered hub. The Pi ones prevent feedback of voltage back to the Pi.
    • CommentAuthorgaree
    • CommentTimeJan 14th 2014
     
    Hi SteamyTea

    If your Pi is connected to the internet, you can use NTP (Network Time Protocol) to get an accurate date/time.

    http://www.ronnutter.com/raspberry-pi-ntp-client-setup/

    Gary.
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 14th 2014
     
    Unfortunately the ones I have to put out on site are not connected. I find the RTCs pretty good, though cheap, they seem expensive as the RPi is so cheap.
    I also need to make some run off batteries, that is proving harder than I thought.
    • CommentAuthorMackers
    • CommentTimeJan 14th 2014
     
    I'm still waiting on my Pi, the cases are out of stock! Not happy:cry:
    • CommentAuthorskyewright
    • CommentTimeJan 14th 2014
     
    Posted By: SteamyTeaI also need to make some run off batteries, that is proving harder than I thought.

    12v SLA (or LA) of a suitable size plus a regulated car power adaptor?
    There are a heap of options at
    http://www.maplin.co.uk/c/batteries-and-power/car-power/car-accessory-chargers

    Some of them have USB sockets.
  2.  
    Maybe a bit more ambitious than you're currently intending but there's a detailed write-up of this guy's 'PiPad' build on his blog, including the spec of a battery adapter that gives 6 hours.

    http://mkcastor.com/2014/01/02/pipad-build/

    Worth a quick read even to see what these things are capable of..!
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 14th 2014
     
    Posted By: Mackersthe cases are out of stock
    They fit in a packet of Marlboro


    Posted By: skyewright12v SLA (or LA) of a suitable size plus a regulated car power adaptor
    Yes, done that bit, but seems to drain my little 12V battery quite quickly (it is an old electric wheelchair one). Could be that the battery is knackered, not had the nerve to try it on the car one as that would involve buying a charger.
    Thing is I need them to run for about 6 weeks.
    • CommentAuthorEd Davies
    • CommentTimeJan 15th 2014
     
    http://www.bitwizard.nl/wiki/index.php?title=Reducing_power_consumption_of_a_raspberry_Pi

    Still, even feeding 5 and 3.3 V with separate switchers 6 weeks (roughly a 1000 hours) of 150 mA consumption will still take 150 Ah out of a 12 V battery. That's not insubstantial, particularly if you're not intent on pretty much destroying the battery with a couple of runs of this experiment so want to plan not to go below about 50% DOD.

    Might well work out cheaper to visit once a fortnight to change the battery or to use a PV panel to keep it topped up or something.
    • CommentAuthorskyewright
    • CommentTimeJan 15th 2014 edited
     
    Posted By: SteamyTea
    Thing is I need them to run for about 6 weeks.

    :shocked: Ah. I see the problem!
    I can't add anything to Ed's suggestions (very neat trick reducing the power requirements like that :smile:).
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 15th 2014
     
    I had thought of getting a small PV panel, but then thought I would be better off with more suitable sites to monitor.
    Really annoying that I am monitoring electrical energy but often there is not a 13A socket nearby (within 20m or so).
    Shame is is not a way to get the power from a clip-on current transformer. That would make life really simple.
    • CommentAuthorsnyggapa
    • CommentTimeJan 15th 2014
     
    I guess you are already nailed to the RPI but if you switch to something much simpler like an arduino then they apparently draw something like 15mA , less if you strip them down - so instant gain of 10x life. Of course, assuming it's capable of doing the same job..
    • CommentAuthorEd Davies
    • CommentTimeJan 15th 2014
     
    Sorry if I missed it before but can you say what you want to log? All I remember reading is that there would be cattle around.
    • CommentAuthorborpin
    • CommentTimeJan 15th 2014
     
    Posted By: MackersI'm still waiting on my Pi, the cases are out of stock!
    Loads of different suppliers for these. Can't believe they are all sold out.
    • CommentAuthorgaree
    • CommentTimeJan 15th 2014
     
    Hi SteamyTea

    How about alternating between two of these batteries from Maplins...
    http://www.maplin.co.uk/p/sealed-lead-acid-deep-cycle-solar-12v-7ah-battery-1-pack-n69hf

    Have one running the Pi, while the other is charging up at home to be swapped out on the next site visit.

    You'll probably need a plastic box big enough to hold it, and a little bit of soldering to make up an adaptor lead so you can plug it into the Pi.

    G.
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 15th 2014
     
    Posted By: Ed DaviesSorry if I missed it before but can you say what you want to log?
    Electrical use on dairy farms, Trouble is the meters are often a long way from the dairy/parlour. I try and put the logger near the storage tank as I can then get an idea of how much cooling is happening too.

    Yes too wedded to the RPi now. Though halve tempted to abandon the research as it seems futile, I am not learning anything I did not know and the industry does not seem interested (they have much more costly things to worry about than 15p/(day.cow).

    I think I shall just keep search for more suitable dairy farms.
    • CommentAuthorEd Davies
    • CommentTimeJan 15th 2014 edited
     
    Garee, he'd have to be visiting ever other day, at least. 150 mA is 3.6 Ah/day so 50% DOD in one day and flat the next and that's using the two-switcher trick I linked to above - if you use the Pi's own linear regulator to drop from 12 V it'd go out even quicker (as more current would be drawn).

    If you don't want to mess with the Pi board (removing the linear regulator) it'd be better to feed it 6 V or so - just above the linear regulator's drop out voltage to minimize the heat wasted in the regulator.

    I have some 20 Ah LiFePOâ‚„ cells. A pair of those would do nicely (7.2 volts fully charged, can run them down to about 6 volts). Pity I'm up the other end of Britain otherwise I'd be glad to help bodge something up. Bit logistically tricky from here - would freak the post office (or whatever it's called now) out completely to post batteries like that back and forth.

    Using a 12 V battery of some sort a PV panel like this only costs half as much again as one of those batteries and would extend its life considerably, at least outside the deepest part of the winter:

    http://www.navitron.org.uk/product_detail.php?proID=35&catID=133

    If you have a spare analog input on whatever you're attaching to the Pi you could have the Pi software doing charge control as well - divert current through a power FET and a resistor whenever the battery voltage gets to 13.8 volts.
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 15th 2014
     
    Friend of mine had some large NiCad (or similar) batteries, may ask him what they are.

    No analog inputs to play with, though I could make or buy a regulator. Just the costs. Spent next year electricity bill on it already :shamed:
    • CommentAuthorskyewright
    • CommentTimeJan 15th 2014
     
    Posted By: SteamyTeaElectrical use on dairy farms, Trouble is the meters are often a long way from the dairy/parlour. I try and put the logger near the storage tank as I can then get an idea of how much cooling is happening too.

    Are you still using the cc128 or have I lost the plot? If you're using the cc128 how are you powering that?
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 16th 2014
     
    I power the CC128 off the 3.3V pin on the RPi (Pin 1).
    I have a feeling that the CC can run on 5V quite happily, though not put it to the test.
    • CommentAuthorskyewright
    • CommentTimeJan 16th 2014 edited
     
    Posted By: SteamyTeaI power the CC128 off the 3.3V pin on the RPi (Pin 1).

    As you didn't have a 13A socket available I thought it must be something like that, but it does mean another thing to add to the battery capacity calcs.
    In the absence of an induction charger, are there any less obvious 240V sources? Light fittings (N.B. I Am Not An Electrician!)?
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 16th 2014
     
    Have you have ever seen wiring on a farm! It is either fully enclosed and unreachable or a total mess. I have to walk away from those sorts.
    So for health and safety/insurance reasons I am sticking to a 13A socket and an extension lead/RCD.
    • CommentAuthorskyewright
    • CommentTimeJan 16th 2014
     
    Posted By: SteamyTeaHave you have ever seen wiring on a farm! It is either fully enclosed and unreachable or a total mess.

    Quite a lot, but many years ago. It seems that the only thing that has changed is that some are now fully enclosed & unreachable...

    I have to walk away from those sorts. So for health and safety/insurance reasons I am sticking to a 13A socket and an extension lead/RCD.

    Fair enough.
    •  
      CommentAuthorSteamyTea
    • CommentTimeJan 16th 2014 edited
     
    Posted By: skyewrightIt seems that the only thing that has changed is that some are now fully enclosed & unreachable...
    Usually after a death/fire/loss of service, all pretty upsetting for the herd, especially the last one.:cry:
    • CommentAuthorMackers
    • CommentTimeJan 18th 2014
     
    Got my RaspberryPi today. Time to start formulating a plan of my ideas then discuss how to best achieve this.

    Back soon with plans.
   
The Ecobuilding Buzz
Site Map    |   Home    |   View Cart    |   Pressroom   |   Business   |   Links   
Logout    

© Green Building Press