# lets design a inexpensive growable controller data acquiescence for our hobby



## mgj (Feb 8, 2017)

I started as one long post but I see that not what is needed so Lets break it down into several small post to allow addressing each issue
laying out the vision. 

First: Lets talk physical constraints

Any micro processor on which you can do data gathering would be sufficient.
The pi , Arduino, odriod, etc. are all reasonably priced so capability should be the deciding factor.
Of course cheap a/d d/a is a necessary design goal.
Within reason the cheaper the better.
Within reason the smaller the better.
Within reason the easier it is to interface the better.
Logging to a small sd card probably would not add any cost and so would be desirable.
Cheap wireless capability is a must.
A fair amount of memory would be nice.
Ease of replication is very desirable.
Open source hardware would be nice, this might leave out the odriod.
I suggest we are left with the pi and the arduino. Either would work.
The pi is larger but probably had more abilities.
The arduino is smaller and has a ton of cousins
next lets think about os, programming etc


----------



## mgj (Feb 8, 2017)

I would suggest staying away for windows as the operating system.
It is a closed system and can cost quite a bit.
It is not as robust as it should be.
Windows is also not open source and perhaps this is the biggest reason for avoiding it.
Certainly no planes will crash if it fails but I happen to think linux is our answer.
So we can use linux it is open source, stable , and cost nothing to use.
It drives the web, mission critical systems and most embedded system.

This perhaps is the time to think about programming also.
I would shy away from c however powerful it takes longer to program and is harder for the lay person to undrstand.
Quite honestly to me the is only one choice and that is python.
It is flexible , powerful, open source, has many libraries available and perhaps most important is easy to understand and even learn by the lay person.
So my first decision has been made. I think we need to use linux as the operating system and to use python as the programming language.

Having made the choice of python means that any linux os will be sufficient,
I would probably also suggest using python 2.x as it is still the python of choice for many however 3 is starting to be used more. The argument for the linux distro will probably need to be made on ease of setup, available of others who use it and ease of updating. It is true however we can make prepackage os isos for the less technical inclined. Again Ease of obtaining and support should also be factored in. It would be nice if the os could be installed on the sd card fom any other system i.e. windows, osx , linux and yes even from our device itself. This is a much harder choice for me and so I going to dalay picking for a bit. Using python portability will allow me to do this.

Please please think about this and comment, To me it is obvious but community thought and comments are vital.
The hardest part of design is to set goals and needs before implantion and not have to bend something to fit what you did not think of to begin with. You will not bother me by presenting ideas, probably not even by calling me names . If you touch my aquariums however I will find you.


----------



## mgj (Feb 8, 2017)

Starting out lets shoot just for one thing. Lets measure the temp for one tank and be able to wireless connect to our box. Perhaps logging data local here is a good idea to start also. No fancy graphs or displays just plain old temperature readings. A computer doesn't really care about any sensor it is just numbers to it. There are a lot of sensors out there and we need to find cheap preferable less than a few dollars , after all if we are going to build something we might as well make it cheap but workable. Less than a buck wouild be really nice , remember we can rely on our computation power to ease the cost. Ther are some considerations here however. The sensor doesn not have even to ber linear as we can correct in software. Unlike a fixed a/d to a display which is easier if the device is linear we don't care if the other are cheaper. There is a line of what is called one wire devices that might fit the bill. But can we do it cheaper? Another question do we want the sensor in the water column or attached to the glass outside. If it is in the water how do we seal it? I admit that to me if we can get reasonable results by attaching it to the outside of the tanks as the flat strip thermometers do thisa would be my choice. I think we often have enough junk in our tanks already. We also need to decide on update speed. And now that I think about it maybe two sensor one high and one low might be worth it if they are cheap. This would give us backup and a chance to monitor any strata layering within the tank.
So we need to primary first
1: decide on the sensor
2: decide on placement, I really do like the outside placement if it will work and I really think it will

Notice that I have not mentioned any certain computer in this as we can experiment with just obtaining and converting the data here. Of course afterward we need to move it to its own platform. Anyone who deal with the sensors could really help this by sharing their knowledge. Of course one we get this far it is only a short step to multi tank monitoring and heater control.


----------



## mgj (Feb 8, 2017)

I have orderd some temp sensors and flow meters from amazon to check out. The temp sens are waterproof. I still like the outside solution better however. Flow meters you say well I would sorta like to watch flow from my fluval filters and were not very expensive but of course they will take a long time to get here. I am looking for cheap co2 sensing which I did not see. Also ph probes reasonably priced would be nice. Again any thing which will give a varying output upon its input(co2, ph, light levels, etc.) probably can be made to work. It would not have to be calibrated as most have their test kits to refer back to. It does need to be somewhat accurate, long lives, reliable, stable and inexpensive. I mean we really don't care that much say for ph if we could only get tenths as long as it was stable i.e. gave the same reading even if off reading every time for the same input. Again if anyone has tried variuos sensors their input would be very useful.


----------



## s2man (Nov 8, 2016)

What signal do your temp sensors put out? Will a pi read them? Pi runs linux, doesn't it? 

Dang, I used to have catalogs of sensors, but that was in a past life...


----------



## mgj (Feb 8, 2017)

yes pi can be linux based. as far as the exact signal it probably present a varying resistor type. I will source a constant current supply and read the voltage present in the a to d section of pi. Right now I won't even worry about switching just read that one sensor. I would love to see a cheaper device than these I have on order. Theres no reason why with the right device we would not be talking a few cents especially with temp sensing. The pi has a ten bit a to d built in if I remember correctly. We should be able by careful use of external resistance to place both the range and the resolution squarely with the window. the ten bit will cover a a range of 1024 steps let say we decide to cover 60 to 90 degrees. This 30 degrees range would mean we could have .03 degree steps. 50 degree range would still a 05 degree step far more than we need. I would think measuring 50 f to 100 f would cover any setup one might have. We really don't need any more precision on any of the sensors. I saw where the water flow sensor shipped today, don.t know exactly when I will see it however. I suspect we will get just a pulse count from it. All of them I want to be fed with five volts which the pi can supply As I said earlier my vision is to get core working then expand the i/o by switching to cover mult sensors. with 4 bit driving a switch that would give us 15 ports so even sampling one a second would be fine.


----------



## mgj (Feb 8, 2017)

I am around st louis mo by the way.


----------



## mgj (Feb 8, 2017)

https://www.amazon.com/gp/product/B00CHEZ250/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
is the first set of sensors and is on its way so hopefully in a few days I can play.


----------



## mgj (Feb 8, 2017)

https://www.amazon.com/gp/product/B00ENA0M7E/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
is the flow meter I've got coming. As I said before I have got external filters and I would love to keep tabs on their flow. The range may be a little low for some filters but will give me a chance to play. It is a hall effect device so I certainly expect pulses from it. Probably will have three wires. plus 5 volts ground and a return pulse line.


----------



## mgj (Feb 8, 2017)

I have not found a cheap ph sensor or a co2 sensor yet. I have seen color type co2 which if I understand it stays in the aquarium and changes color with co2 levels. Again I am not trying to get out of all work so id I had to every months re fil re calibrate that okay. There bound to be some cheap co2 sensors somewhere I mean look at how cheap some of the ph pens are. The only other sensor might be a light and that should be easy to find. Once we can get a terminal window with good data then we can worry about pretty graphics.


----------

