1. Welcome to AquaScaping World!

    Become a register member to get FULL SITE ACCESS AND BENEFITS.

    Join the ASW community now!

    Dismiss Notice

Fish tank Controller and Monitor DIY

Discussion in 'Do-It-Yourself (DIY) Section' started by Zeus, Jul 21, 2017.

  1. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Hi All

    I wanted a tank controller that could in theory control everything in a high tech tank from CO2 levels light intensity, fert dosing temp control etc, but had no idea what is was and couldn’t find anything on the market. Nearly gave up on the idea until I came across How to use a PLC to control your fish tank. By ‘ian-m’ at UKAPS. One read though the thread and it was excaulty what I was after. After months having pm’s with Ian and private thread with over 300 posts I have it fully working.

    Programable Logic Controler 'PLC'

    It times everything from dosing of macros,micros,LCO2, light intensity of kessils via DALI analogue 0-10volts output. Moonlight Passover period where one of four kessil 160 tuna suns is on at lowest setting for 10-15mins and its like the moon passing over. Turns T5 tubes on and off. Turns the heaters on and off via thermistor temp reading so a heat can never over heat a tank. An independent pH probe signal via timer informs the PLC the pH is low and an independent pumps starts with an inline CO2 atomiser on a very high BBS rate to rise the [CO2], at the same time a separate inline CO2 atomiser on a low BBS pre canister Fluval FX6 filter starts which is on constantly during CO2 period. Once target pH reach high CO2 injection is turn off, pumps stays on 10-15mins then stops until pH controller signals the PLC again. Then it restarts. Results in a bubble free tank when the Booster injection is off. Night time air pump.

    At the press of a button on the PLC or my mobile phone can change settings, initial the WC setting or even change it over to Holiday mode with reduced light duration and intensity and a corresponding reduction in EI fert dosing levels. Press another button to check pH level, have lights on for short while whilst friends turn up with auto off OFC. The list goes on.

    Did plan to add a PAR meter, but cant justify the cost

    Have the PLC on an Ethernet connection so adjusting timings is straight forward via PC.

    Is it cheap – NO
    But its reliable and once you get use to the Seimans logosoft software its not Hard IMO. Needs some planning OFC bit of wire few crimps, Few boxes, glands etc and done.

    Heres the Display from my PC
    upload_2017-7-21_18-1-28.png

    Pic of the PLC in cabinat with 20 controlled socket outlets.
    upload_2017-7-21_18-7-25.png
    and auto Doser
    upload_2017-7-21_18-8-39.png

    I'm not going into details ATM but if you have any questions feel free to ask or pm me.

    Was it worth it? well just got another tank '10 gal' and planing on doing another PLC not as much control OFC but the thought of messing with timers and power cuts just isnt worth it. For the just over £100 I should be able to control the lights CO2 and macros and micros from one base PLC module - Auto dosing pumps extra, with Holiday mode built in OFC

    Zeus

     
    kabriolet, Tim Harrison and ShadowMac like this.

    Sponsored link:


  2. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    It looks like you have taken the common old fish tank well into the next level and at a rough guess way beyond the average home Aquarium keeper. It will be very interesting to see how it works over the years.

    I have one question for you what happens in a power outage or do you have a back up UPS like what some have for the home computer?

    Keith:cat::cat:
     
  3. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    I like to think any one could do what I have done, it wasnt hard. 'What one man can do so can another' The alternatives controlers wasnt up to the job IMO. Adjusting settings is so easy can even do a printout of the timer settings.


    Its good for over 80hrs if theres a power loss so it keeps time good. Auto checks time with time server also, auto change for summer/winter time. Could extend the battery life for power outage on unit easy as base unit is 24Vdc, so could add extra battery but a bit OTT imo. If the power is out for more than 72hrs in my location, the last thing on our minds will be fish tank.
     
    kabriolet likes this.
  4. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    I consider myself a very good when working with wood as it was my trade but what you have done out of the question.
    Are they power outlets in the second photo ?
    Is it possible for you to post an estimated materials only costing only please.
    The power outage was referring to would you have to reset the controls up again?

    Keith:cat::cat:
     
  5. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Will do materials listing but very tank specific.
    No reset require after power out. The seimans logo8 is an industrialial PLC so has most stuff covered

    Sent from Mountolympus via neural interface
     
  6. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    That is great news no resetting after a power outage. I just looked the Seimans Industrial
    Logo8 PLC up, it looks like a very high quality unit.

    Keith:cat::cat:
     
    kabriolet and Zeus like this.
  7. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Yes which makes it idea for a tank controler as we what something reliable. I did look at many different options before the PLC but they had limitations and wasnt reliable. the energiene power management system came close, esp the ethernet version but that went out of production. I got the USB version for my son which is good, but only has a short duration on a power off and the internal clock needs resyncing. Also limited by USB cable length so I needed to use laptop to resync the unit in its location. The WIFI controllers like Mi|Home you can get for controlling lights and sockets outlets looked good at first but again limitations in timer frequency and also the Wifi doesnt always connect to the power socket, not an issue for lights in house but for our tanks its not acceptable.

    The turning point was the cost of a Quality auto doser which arent cheap and the ones available also have there limitations. So I will start there.

    Again for auto doser I copied someone elses work DIY dual peristaltic dosing pump with alternate switching. By 'ian_m' at UKAPS

    I ended up with three quality four roller pumps from Williamson Pumps Ltd which cost just over £50 each. Again not cheap but a quality pump.

    101.008.230.030/4 100 series with AC powered motors - Motor:8rpm 230v AC (008.230), No off Rollers:4, Tubing Diameter:3.0 mm (030), Tubing Material:Tygon A-60-F Norprene (101) x1

    101.015.230.030/4 100 series with AC powered motors - Motor:15rpm 230v AC (015.230), No off Rollers:4, Tubing Diameter:3.0 mm (030), Tubing Material:Tygon A-60-F Norprene (101) x2

    4x6 Clear PVC Tubing - Coil Length:30m

    Total cost £153.91

    and from RS
    upload_2017-7-23_11-40-44.png


    Case was a bit tight for space but big enough - thought I might have had to trim the mounting plates going off the PDF :nailbiting:, But on the kitchen table they just fit :cigar:
    upload_2017-7-23_11-41-40.png

    couple off sticky labels dismantled pumps a bit to get at mounting plates, marked them up. Drilled them out

    upload_2017-7-23_11-42-12.png

    Wired them up

    upload_2017-7-23_11-42-47.png

    Fitted to cabinet

    Tank entry was tight
    upload_2017-7-23_11-43-32.png


    so thought off
    upload_2017-7-23_11-44-3.png

    Just dont put Macro and Micros together !
    Nothing off the shelf was going to work/fit, which lead to using a 2cc syringe cut off

    upload_2017-7-23_11-44-27.png
    upload_2017-7-23_11-44-53.png

    The Tubing fits snuggly onto the syringe so to check the LCO2 dose I Just used a 10cc syringe upside down and ran the estimated time measure the amount I had then adjusted the time.
    The EI dose 100% for my tank was 100ml so just just a glass beaker and as Ian had predicted form experiance one took 31mins and the other took 37Mins

    The pumps just plug into a chosen socket at 240v and the PLC does the rest via your own designed program.

    Then little program for PLC - dont be put off if you dont follow the program below, as its just like a new game or piece of software. There is a free Logosoft demo and free online training going though the basics
    upload_2017-7-23_11-45-34.png


    The little program above basically does the Full EI dose in normal mode and half EI dose in Holiday mode.

    The LCO2 is a little different as it is increasing the Dose 6 secs every day whilst the plants acclimatise to the TOXIN

    many weeks later the LCO2 dose is at 500 secs ( nice round number) which is just over the advised dose for my tank size.

    The real benefit from a PLC is that one PLC can control many tanks if close together and only one set pumps are needed.
     
    Last edited: Jul 23, 2017
  8. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    Thank you very much for all that informative information. Only one big concern a few images missing how did you post them?

    Keith:cat::cat:
     
    Zeus likes this.
  9. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    My error :whistle: copied and pasted a big section - should be good know
     
    keithgh likes this.
  10. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    So the base unit Siemens Logo8 can seem a bit daunting at first but its not, after playing with the Siemens Logosoft comfort demo , which if you design you program on wont upload with the base unit you have to get the Logosoft comfort Program which if why its best to get a stater kit which comes with the software. If you plan to more than one you already have the software so you can just get the base unit.

    Siemens Logo8 brochure

    First you need to decide what you wont to control/measure that will determine which base unit will suit you best, how many sockets outlets you need will determine how many extension mods you need also.

    Mine was a ambitious project with lots of control and measure so for know I will keep it to just sockets outlets and control of them.

    so if you wish to control just four sockets any voltage the LOGO! 230 RCE is a good starting place and going for the
    LOGO! 8 Starter Kit 230RCE makes sense around £160 (remember you getting the software)

    need 4 extra sockets then also get LOGO! DM8 230 R £65
    need 8 extra sockets then get LOGO! DM16 230 R £105

    Going for the base/extension with a relay makes sense as its just basically a switch live wire to one end want every voltage you want and the software open and closes the switch

    upload_2017-7-23_13-50-54.png

    The LOGO! 230 RCE uses 115-230VAC/VDC as an operating voltage which runs the units. Plus the eight inputs on the top of the unit also use the same 115-230VAC/VDC which is where you can connect your momentary push switches. Which when programed allow you to turn stuff on or change the programed modes. Eg friends turn up and you which to show off your tank. press button and lights come on for say 1hr then unit goes back to normal. The limit to what you can do is very impressive IMO

    upload_2017-7-23_13-52-18.png

    For 12 sockets

    upload_2017-7-23_13-54-45.png

    Wiring diagram
    upload_2017-7-23_13-55-57.png

    Finished unit
    upload_2017-7-23_13-57-48.png

    The above is a summary of what 'ian_m' did with his at UKAPS

    Full details
    How to use a PLC to control your fish tank .

    Ian also did a very impressive software design so he can edit the settings of the timers from the from display panel. I did not take this route as I just use the software direct and change it over the ethernet connection as you can edit settings on the fly with ethernet connection , if you change the design to need to upload the design via mem card or ethernet. The reason for Ians choice of changing settings was because he didnt have an ethernet connection close by at the time. So used a long ethernet cable every so often to update more major changes. I did ethernet over mains from the start so no need for a long cable. Plus can really see my display so would be tricky to use.

    Thanks again to ian_m for the kind permission to use his images and mentoring me though my choices/options - (next post my setup)
     

    Attached Files:

    Last edited: Jul 23, 2017
    kabriolet likes this.
  11. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Not all the base units are the same and to gain some functions you need to go for a different model. So you need to be absolute in your requirements before you start to save on cost and future disappointment. If space is tight as in Ians case the LOGO! 230 RCE base unit is a clear winner. If however you have the space you can take things a little further.

    Two things I wanted to control/measure was the temp and the output of my kessils. To do this I had to go down the LOGO! 12/24 RCE route

    upload_2017-7-23_14-34-5.png the LOGO! 12/24 RCE starter kit can be picked up for about £180

    The LOGO! 12/24 RCE does everything the LOGO! 230 RCE does plus allows to to use four of the eight inputs to read analog voltages in the 0-10V range. Which might not seem useful ATM but they can be. With using the 12-24Volt base unit different extension modules can be used also, for me it was the
    LOGO! 8 AM 2 AQ £95 Which gives two analog outputs (voltage 0-10V) which you can adjust/set/control via the Logo software, this voltage range is know as the DALI standard - IEC 62386 , which in turn will allow me to control the intensity and spectrum of my kessils lights or any other lighting which has a suitable driver using the DALI standard

    Although I do have a kessil controller which has four DALI outputs that couldn't do what I was after the 'Moonlight Passover Period' where one of four kessil 160 tuna suns is on at lowest setting for 10-15mins and its like the moon passing over. Its very cool IMO and Looks fantastic.

    Temp Control was also a requirement, not just to control the temp 'per sa' but to turn the heaters off to prevent them getting stuck on as can happen. The best way to do this was with a LOGO! AM2 RTD £100 which would give a temp range of -50 to 200 degrees celsius in a very linear way and a direct temp reading very accurate and sensitive plus I would of needed a PT100 sensor
    say
    Correge PT100 Sensor -20°C min +100°C £30. Not cheap but I was running out of space to fit it all in as well as cost running away. So I chose the thermistor route which is also accurate not as sensitive but non linear so getting a direct reading was going to be an issue! or was it, just needed a bit of soldering of wires with a resistor and wire it straight into the analog input of the LOGO! 12/24 RCE base unit well that was the plan.

    Next was how many socket to have

    The Moonlight Passover Phase. Where one kessil would be on its lowest setting at a time for 10-20mins each. The issue with this is that the Kessil 160 pass on their analog 0-10V input only when the power is on the Kessil light. I could leave the power on and just use eight different 0-10V inputs but that would of needed four Siemens LOGO! 8 AM 2 AQ at £100 each. So I decided to wire the analog inputs in parallel to the Kessils and then have the PSU for each kessil on a timmer. So Four Outputs need for kessils.

    The T5 Ballast I have has two plugs on it one for tubes 3&4 and another for tubes 1,2,5 &6. So two outputs needed there.

    One for pH controller power, Plus two for the Twin solenoids I have for duel CO2 injections, one for booster period other for maintaining pH drop so three for CO2 control.

    One for Filter with an inverted output via relay - so if PLC fails filter stays on - Ians idea

    One for heater - inverted again same reason as above
    One for heater two - non inverted

    One for Ehiem 3000+ which is on an independent loop to maintain good flow and for CO2 booster injection.

    One for Air pump

    Three for auto dosser - Macros. Micros and LCO2

    One for fish feeder

    So 18 outputs needed. The base unit has Four outputs and expansion modules come in four or eights.

    So went for 20. Auto top up was an option at the time, but with hooded Rimmed tank water loss Hasnt been an issue

    So two LOGO! 8 DM16 24R £110

    The total width off the PLC was 305mm. after much looking around went for TK PS Plastic Enclosure, IP66, 360 x 254 x 111mm From RS
    upload_2017-7-23_17-33-20.png
    with 220 x 331 x 2.5mm Mounting Plate for use with TK Enclosure
    upload_2017-7-23_17-34-12.png
    But it was still going to be tight. Wire management wasn’t going to be easy I bigger Enclosure would off been better for wiring but too big. So leap of faith required.

    The Modules fit on a 35mm DIN rail, so raised the 35mm Din rails and ran wire under Din rail
    upload_2017-7-23_17-37-14.png

    upload_2017-7-23_17-38-5.png

    Did an earth strap on back
    upload_2017-7-23_17-38-42.png

    Just fitted

    upload_2017-7-23_17-39-39.png

    Little tight for switches

    upload_2017-7-23_17-40-27.png

    20 socket MDF
    upload_2017-7-23_17-45-36.png

    upload_2017-7-23_17-42-17.png

    to cut down on the number of wire I ran the earth and neutral in series and 20 separate live feeds. For tubing I use the tubing from my Fluval FX6 I had spare. Just picked up a suitable gland from RS
    upload_2017-7-23_17-46-30.png

    Then found out the entry point for the wire to the PLC enclosure wasnt going to work

    wired up my monmentory push switches off ebay and some very nice locking swicthes of Ian he had left over :thumbup:

    upload_2017-7-23_17-48-13.png


    Raised the Lower DIN rail on right hand side so wires to outlets could be passed in

    upload_2017-7-23_17-49-35.png

    The enclosure had to be fitted in the cabinet before the DIN rails

    upload_2017-7-23_17-50-43.png


    Was a little tight for space but got it wired up. Uploaded my software (skipped the testing stage) and was working.

    To date the legend for the inputs and outputs was

    upload_2017-7-23_17-54-18.png

    Did some changes and not updated legend :whistle:

    (Next I'll post the extra bits on the lower DIN rail etc)
     
    kabriolet likes this.
  12. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Lower 35mm Din rail components

    WAGO 2000-1201 x20 £14
    upload_2017-7-23_19-7-14.png

    WAGO 2000-1292 x20 £10
    upload_2017-7-23_19-8-45.png

    Basically a nice easy screwless connectors for the wires for the sockets. Could of saved money and wired them direct. But easy push fit once ferrules attached and crimped to wires.

    WAGO 2000-1401 £1 each

    upload_2017-7-23_19-17-13.png
    WAGO 2000-1492 £50 each
    upload_2017-7-23_19-20-52.png
    For multiple feeds

    WAGO 2000-1407 £2.50
    upload_2017-7-23_19-24-53.png
    For earth conections


    PVS HALTER 1P :: Photovoltaic fuse holder 1-pin, 900V £5
    upload_2017-7-23_19-28-10.png

    FIN 49.31.8 230V :: Coupling relay, 1 changer, 10 A, 230 VAC £10

    upload_2017-7-23_19-30-5.png

    For Fluval filter and one heater, which was used NC ie closed relay without power. Applying 240v opens the switch
    Another was used for the power feed from my pH controller (which was intended to power the PSU for the solenoid valve) But now closes the relay which signals to the PLC which the software acts upon. What it does is up to you. Mine switches the CO2 booster injection and the independent line on sometimes. Other times it does nothing as I may be just checking the pH. This is one area a good software program just gives that little edge, just requires a little thought and imagination.



    CRIMPZANGE AEH :: Crimping pliers for wire end ferrules, 0.25 - 6 mm²
    upload_2017-7-23_19-33-52.png to crimp the ferrules

    Wire
    2491X brown equipment wire,.75sq.mm 100m £15

    2491X blue equipment wire,.75sq.mm 100m £15
    other 0.75mm wire 4Amp already had
    then got some smaller wire of ebay for switches.
    Selection of ferrules.

    One 35mm Din housing of eBay
    upload_2017-7-23_19-51-36.png
    this was for mounting a resistor which in turn would work in series with the thermister with a 24Vdc applied across them, then the volt drop taken at the mid point goes to the analog input of the PLC base unit reads the value which corresponds to a non linear temp, little maths trail and error and temp moniting/control via software

    upload_2017-7-23_19-55-55.png

    Checked it with UKAPS electronics Guru' Ian' who advise a couple of capacitors to smooth the voltage out :thumbup: and reduce interference

    upload_2017-7-23_19-57-7.png

    Got the bits
    upload_2017-7-23_19-57-41.png upload_2017-7-23_19-58-18.png
    bit of soldering
    upload_2017-7-23_19-59-9.png

    Got the thermistor

    upload_2017-7-23_20-0-0.png

    Did bench test with 12Volt battery, Digital probe and multimeter - allowing for actual battery output of 12.73Volts
    upload_2017-7-23_20-0-42.png

    upload_2017-7-23_20-1-30.png
    wired the thermister into PLC.

    The values are far from linear upload_2017-7-23_20-3-2.png But cheap compared to RTD and thermocouples, they also dont have the same degree of accuracy :bored: but we dont need that degree of accuracy for a fish tank, after all who has their tank at 26.347 degrees? tenth of a degree is plenty IMO

    and as the temp goes up the volt drop across the thermister drops

    so a little creative maths for a given temp measured by digital probe

    tank was 26.1 degrees so via siemens maths instruction block, which has an input 'X' to give a temp

    upload_2017-7-23_20-4-7.png
    ((10,000/X)*10,000) /498 gives the temp 26.1 degress which I linked to my display mobile phone etc



    ( sorry had to remove links as at link limit)
     

    Attached Files:

    keithgh and kabriolet like this.
  13. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    (Continuing as was at photo limit)

    upload_2017-7-23_20-9-25.png

    at that temp is spot on when it says 27 degrees its more mice 27.5 and when its says 25.5 degrees its more like 24.8. But that doesnt matter as long as the target temp is correct when the heaters switch off and when they switch on.

    The Logo software for temp control looks like this
    upload_2017-7-23_20-10-22.png

    Which basically has a night temp day temp and turns heaters off during WC and off for Initial pH boost whilst target [CO2] is reached.

    It may look complicated, and the Logo software looks a bit :eek: but dont let it put you off. It wasnt that hard

    Thermistor in tank
    upload_2017-7-23_20-14-4.png

    Set Hydro heaters to 28 Degrees in the very unlikely event that something fails. If the PLC fails the Filter and one heater are still on as long as there is power.
     
  14. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Software design is up to you, Get the demo from link and have a play do the tutorials on siemens site if you get stuck ask. I even posted on an electrical forum about some stuff, got some good replys too

    Also there is a configurator on Siemens site to enable you to select modules. It will only allow compatible modules to be plugged together, so no 230V I/O into 24V Logo etc. Here get your part numbers right for the modules as like some idiot you may have to return some :whistle: :ROFLMAO: wasnt laughing at the time :mad:
     
    keithgh and kabriolet like this.
  15. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    It certainly helps with the photo.

    I have made it a Sticky now you are certainly the DIY Master now.

    Keith:cat::cat:
     
    Zeus likes this.
  16. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    How is all the DIY bits and pieces going, did you have to do any minor adjustments?
    Photos might help if necessary.

    Keith:cat::cat:
     
  17. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    Just had a BIG software design update. Ian over at UKAPS did this.

    Quote - Ian at UkAPS
    One of thing I wanted my controller to do (though didn't do on initial design, as I wanted to get something that worked), was to be able to just set one timer for the time I wanted my tank lights on eg 3pm to 11pm and have all other device on/off times be calculated based on these times. For instance turn CO2 on 2 hours earlier than light on 1pm, and off one hour before lights eg 10pm. Same for brighter lights, wave maker, air pump etc. Then if I see algae starting to appear just simply reduce light on time by an hour or two, edit one timer )on front panel or via web front end) and have all other times change as well.

    Below is the link to the Logo!SoftComfort source file, for those of you following along at home.;)

    https://1drv.ms/u/s!AgIGUdnorxMQtOVYVFg_yKAQNkwz9g

    Basically the functional block diagram is largely the same, so same output relays and inputs from switches to turn on/turn off/disable/enable lights and devices.

    However there is now a new bit that reads the time values from the timer block from the PLC memory. This makes use of a facility to map functional blocks "internal parameters" eg timer on time, to memory. Use the Tools->Parameter VM Mapping to set this up. Below shows the parameters for two timers (normal and holiday times) being mapped to memory locations 0 to 6.

    [​IMG]

    This value can then be accessed using a network analogue input as shown below. The value read is 5888 for timer on time.
    [​IMG]

    Unfortunately the read value is in binary coded decimal format :( so is not immediately useful for calculations.
    https://en.wikipedia.org/wiki/Binary-coded_decimal

    The value read above, 5888 is in 1700 in BCD (use windows calculator to convert decimal to hex), and 17:00 is the actual timer value. To convert BCD to decimal value (no of minutes since midnight) the following calculation blocks are used. As can be seen this converts the read value of 5888 to 1020 (decimal), thus 1020 minutes since midnight ie 17:00 hours.

    [​IMG]

    This is then fed to analogue threshold trigger to determine if the lights (or other device) should be on or off. Below shows the diagram for two tubes on/off based on the time (more on that later) being between the values 1020 (17:00 hours) and 1380 (23:00 hours).

    [​IMG]

    Unfortunately one cannot get access to the Logo real time clock values, so a couple of blocks are devoted to counting minutes since midnight. A timer resets the counter minutes at 00:00 hours every day. This does have the issue that when the unit is first powered up the time is 00:00, so a menu setup is provided to set the initial time.

    One other change (as we can now calculate things) is the macro, micro and liquid carbon dosing values are now set in millilitres based on rated pump rate. Below shows dosing 40ml macro on Monday, Wednesday and Saturday and only 20ml if in holiday mode. The 40 & 20 can be modified to change the dose depending on your tank size.

    The rest of the "new stuff" is devoted to on screen menus to allow parameters to be edited either from LCD screen or remotely over the web. One can edit the no of minutes early CO2 starts, CO2 ends, wave maker starts/end etc. Below 4 T5 tubes turn on 60 minutes after the initial start time and go off 60 minutes before the end time. Similar for CO2, wavemaker & air pump.
    [​IMG]

    One variation I wanted, was to leave wave maker on longer when on holiday, so if in holiday mode it is on for all the time CO2 is on. Non holiday mode turns off 240 minutes before lights off, so that when I am in the lounge, where the tanks is, in the evening there is no faint hum of wave maker.
    [​IMG]

    Another issues is I like to run my air pump from 15 minutes before lights of (to degas CO2, provide extra tank agitation and pass air through my fish feeder) say 2am. Unfortunately with this design times cannot cross the midnight boundary, as the minutes counter gets reset at midnight, thus in my case air will come on 10:45 till 00:00 (rather than 2:00). Oh well, something for the next version to fix.:meh:

    Unquote- Ian at UKAPS

    After Ian's great work on the version 4.4 with his self adjusting timer settings -One ON/Off time sets them all :thumbup:.

    Got me thinking :bookworm: after I worked out how he had done. The idea of having a self adjusting CO2 on time based on the input from my pH controller. So copied his programing and got to work

    Most is the same as Ian's except the settings OFC except the all new CO2 self adjusting on time control :cigar:

    upload_2017-8-15_20-7-51.png

    It basically records the on time from the CO2 injection starting say 120mins before lights on time, then records the time it reaches the target pH, one minus the other and presto 43 minutes. Then the next day it starts 43 minutes before light on time, thats 827 Minutes in the above pic. First day it failed as the signal from the pH controller comes on then instantly goes of as the control starts up, so just added a 60second off delay and presto. have a counter so it only uses the first signal of the day with resets at midnight.

    Yes it was a fast rise in pH but with new reactor fitted and lower pH than normal due the acclimatising some pH sensitive Theo snails.

    Could also do it so it takes the average of several days - next version maybe, will see how it goes

    Been using it nearly a couple of weeks and its great so far.

    Been Working on twin CO2 inline reactors post filter ATM. Got massive CO2 injection rate with aid of PLC controlling Via pH Controller and tank bubble free
    upload_2017-8-15_20-15-45.png

    Plumbing to finalise fitting at weekend on its way, supper quiet too.
     
    keithgh likes this.
  18. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    This is why you are the King of the DIY .

    Keith:cat::cat:
     
    Zeus likes this.
  19. Zeus

    Zeus Aspiring Aquascaper

    Joined:
    Sep 9, 2016
    Likes Received:
    463
    Location:
    Yorkshire, UK
    PLC 'Thor'

    Been using sons Power Management System whilst he was home from uni, which is Okish but lacks ethernet so you need USB to access it and it doesnt like power offs, plus fine control seems a little clumsy. Son uses it close to his PC so it works great for his High Tech tank but he also manually doses ferts. I wanted to do auto ferts as well.

    I wasn't limited with space as it was going above kitchen unit, so to keep both PLC systems compatible with future possible project I decided on the
    Siemens LOGO! 8 Logic Control Without Display, Ethernet RJ45 Communication, 8 x Input, 4 x Output so needed a PSU so saved a bit of cash and got
    Switch Mode DIN Rail Panel Mount Power Supply, 36W, 24V dc/ 1.5A twice the size of the Logo PSU but third the price
    enclosure TEMPO ABS Enclosure, IP65, 240 x 191 x 107.4mm
    A Few Wago 2000 series terminal blocks for 35mm Din rail and a few Glands.
    other bits I already had.

    upload_2017-9-16_15-23-58.png
    upload_2017-9-16_15-24-27.png

    Couple of vents for passive cooling upload_2017-9-16_15-25-21.png

    stuck it above kitchen unit and done.

    Software design was very straight forward using Ian's 'one time to set them all' design.

    No display on the siemens unit but accessing it via ethernet was straight forward, just connected direct to PC via ethernet cable (removing cable from LAN) open Logosoft software, network project, go online and it poped up, right click properties then set the IP address and the default gateway, saved then connected back up to the LAN, all worked great. did the other properties settings for time servers, web admin etc, uploaded software working great. Turn lights on with phone when folks turn up ;)
    upload_2017-9-16_15-26-9.png
     
  20. keithgh

    keithgh Moderator Staff Member

    Joined:
    Jun 16, 2011
    Likes Received:
    4,648
    Location:
    Melbourne Australia
    Zeus

    When you are asleep you must dream DIY. With all these extras it must effect your power bill. When I pulled my three standard Low Tech tanks it was very noticeable.

    Keith:cat::cat:
     
    Zeus likes this.

Share This Page

Sponsored link: