Opex - (Work in Progress) Aquarium Controller

Discussion in 'Do It Yourself (DIY)' started by money88, Nov 21, 2018.

  1. vetteguy53081

    vetteguy53081 Well known Member R2R Supporter Partner Member 2019 R2R Secret Santa Reef Tank 365 Article Contributor Build Thread Contributor Hospitality Award

    Joined:
    Aug 11, 2013
    Messages:
    11,790
    Likes Received:
    14,498
    Location:
    Sheboygan, WI
    Proof that knowledge is power !!
     
    Ranjib and money88 like this.

  2. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Pretty close to finishing up the Bluetooth settings section, as well as the node connection configuration to auto connect and read and write to the Bluetooth Low Energy Device. Right now I am only planning on making it able to write 00 or 01 (aka boolean) of on or off. Which for right now should work for most applications.

    opex-bluetooth.PNG

    Also still thinking as to what I want to rebrand it as.
     
    Ranjib and Diamond1 like this.
  3. theatrus

    theatrus Well-Known Member R2R Supporter Build Thread Contributor

    Joined:
    Mar 26, 2016
    Messages:
    988
    Likes Received:
    1,981
    Location:
    Sacramento, CA area
    BLe GATT can be pretty temperamental when running for long periods of time - for my old LEDBrick build I had to add a large number of failsafes to pull back dead devices, manage slots, etc.
     
    Ranjib and money88 like this.
  4. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Yea I've built some failsafes in so far and continuing to improve upon them. I think I also do plan to make it direct serial connection, just looking at figuring out how to have multiple boards connected via serial.
     
    Ranjib likes this.
  5. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    So I have rebranded this to ORCA.

    orca.PNG

    Thinking the acronym will stand for one of these let me know your thoughts:
    • Open source Reef Controller for Automation
    • Open source Reef Controller Assistant
    • Open source Reef Controller All-in-one
    Or let me know if you have other ideas.

    In terms of development I had a few hiccups with my freshwater planted tanks that took up a lot of my time the last week or so. Mouth rot is no fun...But I am back to development and currently working on getting the equipment and temperature panel all good to go. The power bar so far has been working flawless in my test tank and I have no problems staying connected.

    I also just ordered some dosing pumps and some other gear to get moving on some other areas.

    Now I just have to figure out how to change my thread name. I guess I will have to become a supporter :p
     
    Ranjib likes this.
  6. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Made some progress on creating outlets and tying them to bluetooth system. I have actually done some pretty rigorous testing and I haven't had connection issues. I will continue to watch it and see if I need to add an option wire interface as well.

    Temporary housing for doser as I develop it. Will never be hooked up unattended. 20181207_191205.jpeg
     
    Ranjib and ScottBrew like this.
  7. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,524
    Likes Received:
    11,170
    Location:
    Palo Alto, Bay Area
    Very nice :)
     
  8. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Thanks ya its slow work but it's slowly coming along :) my electronics knowledge is slowly growing and honestly a lot of it comes from your work and thread. Right now I am deciding if by modular I plan to make all items work standalone with mini arduinos like the trinket and have communication or do a mix of both. I think it would be a pretty cool idea to have standalone modules like a doser or ATO that function independently or can be controlled by the main pi. Only thing I would have to figure out is how to do all that communication. The PI only has 1 set of SPI pins so unless it was bluetooth like the power bar or wifi which I am even more skeptical about. I want this to be failsafe. Wifi can go down bluetooth seems to be more reliable than that.
     
    Ranjib likes this.
  9. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,524
    Likes Received:
    11,170
    Location:
    Palo Alto, Bay Area
    That is a very good though process. You are not only isolating the failure domain, you are also addressing another key part of your product development, which is iterative deliverable, where each iteration leads to a small yet functioning part that address one unique problem. It has its own value, and hence its a story :) . Stitching this story together to form a coherent journey is harder and more complex, but almost always a better approach.

    Coming back to the isolating failure domain side, you'll notice Sanjay Joshi, Jake Adams etc also talks about preferring multiple independent system for same reason. They also emphasize of higher quality expectation from each of those systems (do one thing, do it right) .. something that I really like,
     
    ScottBrew, MaccaPopEye and money88 like this.
  10. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    So finished up the addition and deletion of the outlets with GPIO and Bluetooth. Pretty simple UI but still have to clean up a few error scenarios so I don't just pop up an alert ;)

    Right now working on electronics for the dosing pump and the new light sensor ATO (unfortunately I burnt out one of my arduinos not realizing I had something hooked up incorrectly and my optical sensor that I got was a dud, stupid ebay).

    outlet-delete.PNG outlets-table.PNG outlet-add-bt.PNG outlet-add-gpio.PNG

    I wish I had more time to dedicate to this but this is usually the busy season at work. And when I realize I need to order more electronics it really slows me down. Well that and the lack of knowledge I have on electronics. My tinkering is outpacing my reading so lots of trial and error.

    Development will evolve as I start to learn more node and react and I know there will be a lot of refactoring for me to do. I am trying to note those spots in the code as I see them now but I also will have to refer back to this thread to see the order in which I completed things to then go back and refactor them. I am also looking to get some test cases up and running soon as at this point its been an after thought which makes it difficult if anyone else is planning on helping in the future. I also need to create my fritzing diagrams for myself because even having to rewire something becomes a problem if I didn't create something.

    Lets continue the grind, the biggest motivation is seeing everyone elses Reef-pi build threads. I say to myself well I need to get this running already before I go out and buy a dosing pump for example.
     
    Last edited: Dec 14, 2018
    MaccaPopEye, Ranjib and ScottBrew like this.
  11. Ranjib

    Ranjib Valuable Member R2R Supporter R2R Excellence Award Reef Squad Build Thread Contributor

    Joined:
    Apr 16, 2016
    Messages:
    6,524
    Likes Received:
    11,170
    Location:
    Palo Alto, Bay Area
    Nice progress :) . The UI looks sleek ,
     
    money88 likes this.
  12. madox

    madox Member

    Joined:
    Jul 2, 2015
    Messages:
    12
    Likes Received:
    12
    You can still program all gadgets through Pi, but they might work standalone. This way you can throw away one problem. However every gadget must have rtc.

    When BT conection is restored all data sync again.
     
    money88 and Ranjib like this.
  13. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Well not necessarily. If by rtc you mean a real time clock module. I mean certain things like an ATO wouldn't need to have a clock but other items like doser definitely would. I think it would be case by case. Temp controller would not have to either. I am leaning towards less needing it than not.
     
    Last edited: Dec 15, 2018
    Ranjib and madox like this.
  14. madox

    madox Member

    Joined:
    Jul 2, 2015
    Messages:
    12
    Likes Received:
    12
    Thats right, but if you want to keep history of ATO, Temp etc after power outage, you cant sync data in DB. Arduino reset internal clock to zero.
     
    money88 likes this.
  15. money88

    money88 Active Member R2R Secret Santa

    Joined:
    Mar 26, 2017
    Messages:
    197
    Likes Received:
    190
    Yea I think for any wireless modules that makes sense in the case a connection cannot be made it would be good to know history. The thing is though is in order to save log data I would need to either have an arduino with external storage like the adafruit feather logger or I would have to save it in EEPROM which is usually really small and usually only tested for up to about 100k writes. And many of the arduinos with external storage and bluetooth are larger than the typical board I plan to use for that module.
     
    Ranjib likes this.
Draft saved Draft deleted