Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Tinkering; Like Guntering for the Connected Generation.

1568101115

Comments

  • Registered Users, Registered Users 2 Posts: 11,390 ✭✭✭✭patsy_mccabe


    On the subject of writing code, this is something I did to download all the information from www.ICBF.com for each animal I have here.

    Up to this, I was just manually doing it for all the figures. As these figures now change every 3 months, I set about trying to do it automatically.
    Now, normally with MS Excel you can extract table value from a website, but with some websites those tables are not accessible. This is the case with ICBF.com.

    I used a webscraping technique by using Selenium software and VBA code within MS Excel. Excel normally will only open a website using MS Explorer. With Selenium, MS Edge and Chrome webrowsers can be used.

    Anyway, it took some time to do, as I'm only a novice with coding. I even managed to download the percentile values locating within the HTML coding for the different Linear Values. These pop up when you hover over the bar graphs, under the Linear tab.

    So now, I open the Excel file, run the macro from a pushbutton and all the websites open and close automatically, transferring all the data to the Excel file. I do it for a list of bulls too.

    These Tutorials from WiseOwl were of great help to me;
    https://www.youtube.com/watch?v=FoxWcvZzYVk&t=290s


  • Registered Users, Registered Users 2 Posts: 1,679 ✭✭✭Zimmerframe


    I saw it mentioned in the thread earlier, but did anyone come across a cheap and cheerful, fence monitor.
    similar to this one:

    https://fenceguard.net/#technische-daten

    or

    https://store.jva-fence.com.au/products/pte0705


  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I saw it mentioned in the thread earlier, but did anyone come across a cheap and cheerful, fence monitor.
    similar to this one:

    https://fenceguard.net/#technische-daten

    or

    https://store.jva-fence.com.au/products/pte0705

    Working on it......
    Your second link is essentially what I'm looking to build myself.


  • Registered Users, Registered Users 2 Posts: 1,679 ✭✭✭Zimmerframe


    emaherx wrote: »
    Your second link is essentially what I'm looking to build myself.

    Good luck with it.

    That one looks good, especially the analog output.


  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Some interesting reading for anyone interested in building an electric fence tester. https://mro.massey.ac.nz/bitstream/handle/10179/1161/02whole.pdf


    I also came across this, which is probably the closest to what I want to build. https://github.com/kiu/lofence , Its LoRa WAN based using The Things Network. I've experimented in the past with The Things Network, its free to use but you need to either deploy a TTN Gateway or be near someone who already has, so I'll adapt this project to my existing MySensors network instead.

    They have provided detailed Schematics too, https://github.com/kiu/lofence/blob/master/rev_b/hardware/kicad_lofence_schema.pdf
    But I only need to look at a small portion of it.

    556382.png

    The top circuit is just a voltage divider using a series of Resistors, this is very similar to how the cheap Neon bulb type testers work.

    The other 2 circuits will take the output from the voltage divider circuit and process them into signals readable by a microcontroller. I can take their output and connect directly to one of my existing sensor nodes.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I've sourced a few parts to experiment with the electric fence monitoring, but finding the time is the issue at the moment.


    Most of what I do here is pure messing mostly for my own entertainment and education, but I'm really happy with 2 things that I built this year.

    1. Is the solar well pump, it is performing much better than expected and cost under €400 and has probably already saved more than that in fuel and water costs alone, but it has been a big time saver too.
    2. Is the monitoring setup for the same pump, especially in this very hot weather, it gives me piece of mind that the pump is providing enough water while I'm away at work and also saves me hiking up to the far end of the out farm to check it every evening. The walk wouldn't bother me normally but I'm glad to avoid it in this heat.

    Interesting too to see the difference between water use this week compared with beginning of June

    June 11th

    Untitled Image


    This Week.

    Untitled Image




  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Screenshot_20210721-192742.jpg

    Water has been getting very hot this week from my solar panels.



  • Registered Users, Registered Users 2 Posts: 1,536 ✭✭✭JustJoe7240


    Some fantastic posting here folks!



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Not sure there is a strict standard.

    I presume it's DIN-9680 plug you have?

    Usually small pin is either connected to ignition or left disconnected. I've looked at a few data sheets before and Amperage varies by manufacturer.

    Usually 25A/5A or 30A/10A and using the small pin may reduce the max amperage on the large +ve pin as they share a common earth.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Don't think it will really matter.

    But the way I like to do it is the small pin coming from the ignition with a switch between. This allows aux lights or beacons to switch on off with tractor with option to turn off aux lights for road use. Then large positive to always live 25/30A source for implements.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Latest Version of my Remote IOT Gateway https://farmer-eds-shed.com/remote-3g-4g-mysensors-lora-gateway-v2-with-iot-sim/

    I now have 2 IOT Gateways running from solar panels on 2 different out farms, still only monitoring water levels, but they have been very stable now for weeks. After experimenting with a number of different USB 3G modems I finally gave in and bought a couple of 4G modem Hats designed specifically for the Raspberry Pi Zero and long term use.

    One of them has a LoRa radio Module which is good for long range communications with the sensor nodes.

    The other has an NRF24 radio Module which is shorter range, but I had some sensor nodes built previously and a spare radio module.

    image.png image.png image.png




  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Although so far I've been mostly using this to monitor water levels, I'm also working on a few other sensors and actuators.


    Potential Out Farm sensors:

    Solar Battery Monitor.

    Electric Fence Monitor.

    Electric fence switch.

    Livestock GPS monitor.

    Livestock Health Monitor.


    I'd be interested to hear peoples thoughts on this and like to hear more suggestions.


    I also have a few others around the yard and garden like:

    Green house Irrigation control.

    soil moisture sensors.

    fuel levels.

    temperature liquid/air.

    humidity



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    The IOT sims from 1nce are working out really well too, data usage is low and they give you your own private address range with VPN access for your server which makes network access fairly straightforward. And the overheads of keeping the VPN going don't count against data usage.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I haven't any detailed plan yet but.....

    I now have an almost farm wide sensor network so just need to work on some sensors.

    The monitors will work in much the same way as commercially available devices, with Heart rate and temperature sensors.

    A microcontroller fitted with sensors and GPS module will periodically collect data and send to one of my IOT gateways then sleep for a defined amount of time.

    There will need to be a good bit of experimentation to see how low powered and how short sleep intervals can be achieved for practical battery usage. I currently have Arduino powered room temperature sensors in my heating system that run on 3 AAA batteries which last 18 months+ between battery changes, they send room temp every 3 min, obviously the GPS would require more power than a temperature sensor but with longer sleep times and a bigger battery hopefully a practical amount of time can be achieved.


    Another use could be for sheep worrying, microcontroller could alert you if sheep were very active with high heart rate, only a few sheep in flock would need collars.


    Livestock monitors might not be the very top of the list, but are an example of what can be achieved.

    I'm trying to build a completely open source affordable and scalable sensor network that can be used in every aspect of farming, that doesn't require subscriptions to several different cloud services.


    another few things I thought of.

    Bale counters for baler and wrappers, with total season count and crop type.

    yield monitors.

    Sprayer, slurry, FYM, fertilizer recording including fields and amounts spread.

    Gas Monitors, Hydrogen Sulphide, methane, carbon monoxide etc.



  • Posts: 0 [Deleted User]


    Lemming-like I've jumped back into the LoRaWAN YT videos. I figure I'll need a LoRaWAN gateway to monitor and control devices as I may not be at home to do so. I'd like to convert the batt-latch type gates I made into fence lifters with a LoRa node built in to each. I've already bought a 4g PT battery powered camera to monitor paddock moves so it's belt & braces time. Being able to monitor fencer battery, fence status, and water would be dead handy. I'll get to that automatic water pump yet...



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Are you looking for an off the shelf gateway or going the DIY route?

    I've been getting on well with the MySensors.org DIY Gateways, but I've also dabbled with TheThingsNetwork.

    There are also LoraWAN providers like Sigfox which don't require gateways but will have a small subscription per node.

    Also if Someone else has implemented TheThingsNetwork Gateway in your area then you can use it either.



  • Posts: 0 [Deleted User]


    I think I'd prefer DIY, though it'll be the hardest. I don't fancy spending a lot on off the shelf or subs. I'll check out mysensors 👍️ I doubt there'll be another gateway near to where I'll be putting sensors tbh



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Not necessarily the hardest option at all, with loads of information available online. You are more than welcome to copy any of my project.

    The hardware is simple enough. The software is not too bad either, bit of a learning curve but once you get going its mostly cut and paste from the examples. Just start off with one node and a gateway and work from there.



  • Posts: 0 [Deleted User]


    Thanks for that 👍️ That's kinda the plan alright, learn to crawl before doing any marathons. It's pretty cool what this gear can achieve, save a lot of walking.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Ye, with using the solar water pumps it has really given peace of mind and I can even see problems before they are really problems. About mid summer one of the pumps had stopped working due to water level dropping and submersible pump was just sucking air, but IBC kept the cattle with water and the app alerted me to the issue. Last week I had another issue that showed up with the IBC level dropping a little lower than normal and taking much longer to fill, I received no alert but looking at the graph there was definitely something not right, turned out battery needed a top-up. Could probably do with a slightly bigger panel for this time of year but one battery top up since March is not bad either.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    This one is perfect for a Serial or WiFi MySensors Gateway. I've also used it as a TheThingsNetwork gateway too, but it was less than ideal for that.


    These make great nodes for testing purposes or where there is reliable power source like solar. For purely battery powered nodes you'd be better off modifying an Arduino mini pro and attaching a radio module.

    You also need one of these to program the stemedu and other Arduino devices without USB ports.


    Other than that you only need a 3.7V battery and some simple sensors and dupont cables.


    Then for a controller, I use Home Assistant but there are many other options, it can be installed on an old laptop/PC raspberry pi or even just in a virtual machine.



  • Registered Users, Registered Users 2 Posts: 85 ✭✭tilting tim


    Hi all, great thread, some very interesting projects and ideas here.

    just done my first bit of monitoring on farm, installed 2 Shelly em’s to track the electricity usage on farm. Currently have both set up, one doing the mains and vacuum pump and the other doing the bulk tank and hot water heater. Hoping to invest in some energy saving devices in the next year or two but wanted to see where I would benefit the most.

    Also have a new parlour going in soon so should be interesting to see the difference between variable speed vacuum pump and normal one.



  • Registered Users, Registered Users 2 Posts: 11,396 ✭✭✭✭Timmaay


    I'm trying to put a pto shut off switch on the mudguard of the mf here for slurry etc, I thought it would be a simple job of wiring a break into the switch in the cab, however I need a switch that breaks the circuit, and this switch holds the break in the circuit until you want to turn on front the cab again. I thought there is a certain time of button switch that does that job, but can't remember the name. Anyone able to help me. Obviously what I absolutely do not want is the PTO randomly turning on after I've hit that outside switch tho hahah.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    How dose your current in cab switch work?

    Dose it latch on/off or is it a momentary push button?

    A momentary push button can be wired in parallel and latching by 2 way switching but that would give you full on/off capabilities from inside and outside the cab.


    If the PTO works by a normal on/off switch latching high then replace that one with one that latches high using a self powered relay (a relay that powers its own coil) with 2 reset buttons, one in cab and one on mudguard. You'd end up with 2 push buttons in cab for on/off and one on mudguard for off.



  • Registered Users, Registered Users 2 Posts: 11,396 ✭✭✭✭Timmaay


    Oh I didn't think about the switch in the seat, dammit I shouldn't of been sitting on it while testing which wires turned off the PTO lol, no wounder it kept turning back on and acting like a normal switch when I reconnected, I'll test it again tomorrow when I'm not sitting on the seat, and hopefully just a button on the mudguard will work then ha.



  • Registered Users, Registered Users 2 Posts: 11,396 ✭✭✭✭Timmaay


    Mf 5711, yep when filling the tanker I'm out of the seat so I've already had to override the seat (in that tractor you flick it twice). Basically it acts in a different manner sitting on the seat against when overwritten which is all I care about.



  • Registered Users, Registered Users 2 Posts: 11,396 ✭✭✭✭Timmaay


    Yeh in fairness all I want to do is to tap into part if the pto circuit that once broken the pto turns off, and doesn't restart the pto when unbroken, in which case its largely irrelevant if the button got wet or wires damaged or shorted because it can't tell the pto ever to turn back on.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    If your PTO is overriding a safety switch by flicking a switch twice then I assume it is controlled by an ECU. You need to be more careful here as it may not be a traditional make/break type circuit but more like a computer input. You should meter out the switches for continuity and voltage in the various modes to figure out what's going before considering splicing into anything.

    Does your PTO button stay on? Or just a push button.

    And whatever you do make sure it fails off.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I've come up with a simple electric fence monitor.

    1 simple signal light.

    image.png

    + a photo diode.

    image.png

    + a microcontroller with integrated LoRa radio

    image.png

    Some crude code stolen from a MySensors PIR Sensor, shows up in Home Assistant as a motion sensor, but it doesn't really matter its just a binary on off sensor which can report the electric fence pulses.

    #define MY_DEBUG
    #define MY_RADIO_RFM95
    #define MY_DEBUG_VERBOSE_RFM95
    #define MY_RFM95_RST_PIN 4
    #define MY_RFM95_CS_PIN 8
    #define MY_RFM95_IRQ_PIN 7
    #define MY_RFM95_IRQ_NUM digitalPinToInterrupt(7)
    #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128
    #define MY_RFM95_FREQUENCY (RFM95_868MHZ)
    
    
    #define MY_NODE_ID 83
    
    
    #include <MySensors.h>
    
    
    
    
    uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 1   // Id of the sensor child
    
    
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    
    void setup()
    {
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
    }
    
    
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Electric Fence Sensor", "1.0");
    
    
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOTION);
    }
    
    
    void loop()
    {
        // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
    
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
    
    
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I still plan on making a sensor to read the line voltage but this should be adequate for the moment.

    If fence voltage is above 3,000V pulses reported in Home Assistant.

    below 3,000V no pulses.


    The micro controller I used this time is an Adafruit LoRa32u4 II



Advertisement