Robo-Tank DIY Aquarium Controller Forum
Nixu's Aquarium setup (Work in progres) - Printable Version

+- Robo-Tank DIY Aquarium Controller Forum (https://www.robo-tank.ca/forum)
+-- Forum: Robo-Tank Arduino Based - NO LONGER AVAILABLE (https://www.robo-tank.ca/forum/forum-16.html)
+--- Forum: Robo-Tank Gallery (https://www.robo-tank.ca/forum/forum-20.html)
+--- Thread: Nixu's Aquarium setup (Work in progres) (/thread-174.html)

Pages: 1 2 3 4 5 6 7 8


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-18-2017

(01-18-2017, 07:51 PM)Steve S Wrote: Wow! Nice work! I can hardly wait to see the final results.  Sure beats using a Kill a Watt meter.

Will you be able to monitor anything that's directly plugged into the Robo Tank outlets? What about the additional 8 outlets? I'm almost afraid to know how much power my tank consumes ;-)

Keep us posted!

Yeah thats it how i planned it to working, it meter anything which is connected to powerbar outlets, so i have to make little modifications to the powerbar. But it meter all equipment, i don't even try to meter each outlet individual, because that is too "complex" (yeah it can be done, but i have to "build" meter circuit every outlet, and code will be much bigger, so i don't even want to do that )  

basically i add that kind of current transformer (but only 10 amp, because aquarium don't use 100 amps )  to wire (which is going from wall socket to powerbar) and it measure current (of course it needs a little bit electronic parts also, but nothing much) 


[Image: YHDC-CT-Sensor-02.jpg]

And also i need to meter ac voltage, and when i have current and voltage, rest is math  :)

There is page, where i found idea of it. And there is also library that i use, and electric diagram. (it is pretty simple)
https://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor


RE: Nixu's Aquarium setup (Work in progres) - Rob F - 01-18-2017

Looks great Nisku, I like how you blended it in. :) Nice to see the updates you're adding. For those wondering yes one day I will get to adding it. :)


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-19-2017

(01-18-2017, 11:39 PM)Rob F Wrote: Looks great Nisku, I like how you blended it in. :) Nice to see the updates you're adding. For those wondering yes one day I will get to adding it. :)

Thanks :D Nisku  K05163

Now code is almost complete, and current values are real, but i don't have any electronics yet, so they show zero :D I also added daily consumption

When i get my parts i test it up, and make final adjustment / calibrations. And also add code to store "total consumption" value to sd card, so it wont reset when power lost / reboot, but it can be reset by pressing long to "total consumption value" and because total cost is just calculated to total consumption * kWh price, it reset too automatically. And when Rob gets graphs back, i can try to implement some data in there. Like daily consumption and total consumption, so these can be looked in graphs too :) 

[Image: 14320981.t.jpg]


RE: Nixu's Aquarium setup (Work in progres) - Rob F - 01-19-2017

lol oops, typo Niksu. :) I'm almost done the custom rules, then I'm going to quickly add flow meters and then do the graphs. It shouldn't be to difficult to add more.


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-24-2017

Code is almost ready. Circuit is done and running. There is video of current status. I have to adjust and calibrated it properly, but it is pretty accurate without fine calibration. End of video i put 300w heater on.

Also i have to make "settings" page "complete" 

https://www.youtube.com/watch?v=764FJZ4Vj74


RE: Nixu's Aquarium setup (Work in progres) - ChrisC - 01-24-2017

Nice.... clean implementation niksunen. I like the idea of monitoring total power consumption as well as individual plugs. The problem with monitoring each plug (as has been mentioned above) is the size of the coils available to to the job. Has anyone found something smaller we could use? I know there are direct wire solutions that are smaller and Rob could probably put together a board that would work bout I think some discussion would help him do the research on possible solutions,
The other issue is all the wires required to run back to the processor. I'm thinking a I2C solution would solve that. There are a few references (that I could fined) to that kind of solution but they are either discontinued or vaporware. Just my misc thoughts, I think the direction is really cool.


RE: Nixu's Aquarium setup (Work in progres) - Steve S - 01-24-2017

Great addition to Robo-Tank Nixu!

I tracked down the hardware on ebay and it looks to be very affordable for the probe. Is there any other hardware required?

and NOW the big question, as I don't recall which R-T hardware you are running...
Will this mod work on both ver 1 and ver 2 of R-T? Is the code supported on both ver? 
Also, can you run two power bars through the same probe if you are using more than the initial 8 outlets?

Tying this in with the graphs can really provide some nice data. 
I could even see using this with alarms to alert you to a component failure

Good work


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-24-2017

(01-24-2017, 11:52 AM)ChrisC Wrote: Nice.... clean implementation niksunen. I like the idea of monitoring total power consumption as well as individual plugs. The problem with monitoring each plug (as has been mentioned above) is the size of the coils available to to the job. Has anyone found something smaller we could use?  I know there are direct wire solutions that are smaller and Rob could probably put together a board that would work bout I think some discussion would help him do the research on possible solutions,
The other issue is all the wires required to run back to the processor. I'm thinking a I2C solution would solve that. There are a few references (that I could fined) to that kind of solution but they are either discontinued or vaporware.  Just my misc thoughts, I think the direction is really cool.

Actualy i ended up using this ct. http://www.tme.eu/en/details/ppac1010/current-transformers/talema/ac1010/  And it is enough small, that i can fit 8 those in power bar. So it possible to meter each outlet separate, but then you need somekind of i2c - analog input circuit, because you need 8 input for current, and 1 for voltage (each outlets has same voltage). I found those i2c boards on ebay, it has 12 input and cost only 15€. So i can buy it, and 7 more ct coils and modified my powerbar, so i can track any outlet individually

I think, i can left current screen like it was. And add another screen, where all outlets are listed individually and show each data separately. But adding all 8 outlet to graph is big question. Maybe Rob can tell that :) 

(01-24-2017, 11:55 AM)Steve S Wrote: Great addition to Robo-Tank Nixu!

I tracked down the hardware on ebay and it looks to be very affordable for the probe. Is there any other hardware required?

and NOW the big question, as I don't recall which R-T hardware you are running...
Will this mod work on both ver 1 and ver 2 of R-T? Is the code supported on both ver? 
Also, can you run two power bars through the same probe if you are using more than the initial 8 outlets?

Tying this in with the graphs can really provide some nice data. 
I could even see using this with alarms to alert you to a component failure

Good work

I use gen 2. There is no big issues to get it working also gen 1. (it only needs arduino, and couple components, ct etc..) And gen 1 has arduinos so :D 
Code though don't work gen 1. But it is easy to modified working gen 1. But i dont have any gen 1 sketch and boards etc, so i cannot test it.

"Is there any other hardware required" There is couple parts, but they are very cheap :D i can make list of parts later, but there is circuits.

"Also, can you run two power bars through the same probe if you are using more than the initial 8 outlets?" 
Yeah you can, but then power to wallsocket to power bars must go same wire. And also you must put only one wire trough ct, not both, or you get current results zero :D 

There is picture how install correct: 
[Image: CT-on-cable.jpg]

Ac circuit to measure voltage:

[attachment=199]

Current circuit to measure current: 

[attachment=200]


RE: Nixu's Aquarium setup (Work in progres) - ChrisC - 01-24-2017

niksunen, do you have the link on the I2C board on eBay? I'd like to see what you are using.


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-24-2017

(01-24-2017, 12:40 PM)ChrisC Wrote: niksunen, do you have the link on the I2C board on eBay? I'd like to see what you are using.

Sorry but i don't find it anymore :D (it may be somewhere else than ebay also) And i don't have i2c circuit yet, but i have to buy it.

I might be use this chip or similar, this is only 8 chanel, but it will enough for me :)  

http://www.ti.com/lit/ds/symlink/ads7828-q1.pdf

and i order it there. It cost about 8 euros. 
http://www.mouser.fi/ProductDetail/Texas-Instruments/ADS7828EIPWRQ1/?qs=JxdSYA%2fPj%252bGxjoBBVPoX2A==


RE: Nixu's Aquarium setup (Work in progres) - Rob F - 01-24-2017

Wow you went all out Niksu, good job. I have one recommendation, maybe put the "power now" on the home page under the date/time then you can always see what is currently being drawn.

This took 2 analog pins, the Gen2 controller board only has one analog pin left (A11) so Niksu tried the DAC1 and DAC2 pins, thankfully they worked. So it's not possible to do much more as is, but I've seen some boards that connect to I2C and give analog pins. I'll find it and link later, same thing as Niksu linked but on a board already. The Gen1 controller has more pins remaining so its only a matter of adding the code, adding the data to the graphs on the Gen1 would be a challenge though, when I'm done graphs on Gen2 it should be much easier to add new ones.

If anyone can figure out the best way for all 8 outlets in a power bar I can easily make a board that could mount in the power bar, just not so easy for me to figure out the hardware...


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-24-2017

(01-24-2017, 05:59 PM)Rob F Wrote: Wow you went all out Niksu, good job. I have one recommendation, maybe put the "power now" on the home page under the date/time then you can always see what is currently being drawn.

This took 2 analog pins, the Gen2 controller board only has one analog pin left (A11) so Niksu tried the DAC1 and DAC2 pins, thankfully they worked. So it's not possible to do much more as is,  but I've seen some boards that connect to I2C and give analog pins. I'll find it and link later, same thing as Niksu linked but on a board already. The Gen1 controller has more pins remaining so its only a matter of adding the code, adding the data to the graphs on the Gen1 would be a challenge though, when I'm done graphs on Gen2 it should be much easier to add new ones.

If anyone can figure out the best way for all 8 outlets in a power bar I can easily make a board that could mount in the power bar, just not so easy for me to figure out the hardware...

Oh crap :D i know that i forgot something, i forgot to inform you Rob after i test those inputs. DAC not work. I tested it with that current code i have, only changing port numbers to dac. And get nothing :/ It may work, but it needs a code changing. Example i don,t know is they 12 or 10 bits input? (it effects how many steps i can read 1024 vs 4096 and therefore middle point etc 512 or 2048) Also i don't know which voltage they are specs. Example analog input reads 3.3 volts, and half that to middle point is 1.65. What i use for dac ? 

So i use analog pins. A0 (same that analog ph circuit uses, but i plan to buy atlas ezo i2c ph circuit so it don't mind of me) And A11 . And i ended up to soldering wires directly to arduinos back (i dont mind that also :D ) because i noticed that there is some resistors etc on the way to Sensor 1 port (A0) to the arduino pin itselff. So it effects readings. (i calculate those circuit values assuming that there is "direct" line to arduino pins (0 ohms, like when i connect them directly it arduino) And i have also bend or cut (i cut, because i don't ever use those anything else)  those A0 and A11 "leg" to board, so it dont't affect readings. Also i take 3.3v to those "spare" headers,

Display side are diffrent story, there are lot of unused analog pins right to way available and they are without any resistors or anything else that affects. So it possible to use those also, but then your display goes 4 more wire (vcc (3.3v), ground, and 2 analog wire to measuring). I am mounted my display to cabinet door, so that don't mind me at all :D But i all ready attached 4 pin DIN connector to controller box so, i use that arduino to take readings.

And one solution is those i2c analog input circuits, but i don't have any, so i cannot test them. And because this only need two (if you don't want to measure each outlet separate. So you can use this cheap chip or similars.
http://www.ebay.com/itm/For-Arduino-ADS1115-Module-4-Channel-16-Bit-I2C-ADC-With-Pro-Gain-Amplifier-/221980694555?hash=item33af14981b:g:uV8AAOSwdqRXiKCu it is only US $2.51.

"it can run from 2V to 5V power/logic,
can measure a large range of signals and its super easy to use.

The address can be changed to one of four options (see the datasheet table 5)
so you can have up to 4 ADS1115's connected on a single 2-wire I2C bus for 16 single ended inputs."

So you can put 4 them in chain or something, and it gives you the 16 inputs total :D And you need 9 to measure each 8 outlet separate (17 to 16 outlets)

I am planning to buy couple of those so i can test it out and test that measure each outlet separate.

So without using display arduinos analog inputs, or using controller arduino inputs (but then you loose example analog ph circuit ) there is no way to get it working, with current boards. Not without buying those i2c analog input chips, which may be the smartest move :)

"when I'm done graphs on Gen2 it should be much easier to add new ones."
Yep, because of that i wait when you get it done, so it easy to add new ones without messing up anything you are going to add. If i try to do it now, it is not good, because i know we do things diffrently :D and then my addon is quite unusable :D So it is best to wait and see how you are going to do everything, and then look and add those new values just the way you planned to do, so there are no differences  about that :)


Edit. I ordered right now couple of those i2c analog input chips there. http://www.banggood.com/ADS1015-12-Bit-Precision-Analog-To-Digital-Converter-ADC-Module-Development-Board-p-1110605.html

These ADS1015 are really easy to wiring, connect and setup. I i have to add only couple of lines more code and thats it (and define right input off course, but it takes only minutes :D)

https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/assembly-and-wiring


They will be there about 7 days (i took faster delivery) so after that i can test it out, also i have to go buy more those ct,s and parts so i can test measuring each outlet separate.

"I have one recommendation, maybe put the "power now" on the home page under the date/time then you can always see what is currently being drawn." 
Yeah never thought of that, it is very simple to add, i do it now :D 

Edit2. 

And now it is there :) off course it need tweaking, and choose colors etc, but i do it later. Now i have to go to work :D 

I have on only internal filter (8w) so rest is what arduinos and display uses.

[Image: 14324140.t.jpg]


RE: Nixu's Aquarium setup (Work in progres) - Rob F - 01-25-2017

I was wrong on the DAC pins, mixed it up with ADC like you linked. :) Too bad only 4 can be used, that would mean no more analog for down the road. The A0 is used for the analog ph circuit or any digital/analog sensor so I can't give it up. If you want to use your analog PH circuit you can use A1 - A4 as they're sensor ports you're probably not using. You're right, lots of pins on the display but I'm against any cables coming out of it. I love only one cable going into it. But yeah if someone doesn't care it can be used.

Looking at the power data maybe it would be better under the AC outlets in the small space? The text is a little large for those icons. Just have something like 14.5w and people will know its how many watts are being drawn. Sorry I'm always looking for fault lol... do your thing. :)


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-25-2017

(01-25-2017, 02:05 AM)Rob F Wrote: I was wrong on the DAC pins, mixed it up with ADC like you linked. :) Too bad only 4 can be used, that would mean no more analog for down the road. The A0 is used for the analog ph circuit or any digital/analog sensor so I can't give it up. If you want to use your analog PH circuit you can use A1 - A4 as they're sensor ports you're probably not using. You're right, lots of pins on the display but I'm against any cables coming out of it. I love only one cable going into it. But yeah if someone doesn't care it can be used.

Looking at the power data maybe it would be better under the AC outlets in the small space? The text is a little large for those icons. Just have something like 14.5w and people will know its how many watts are being drawn. Sorry I'm always looking for fault lol... do your thing. :)

"Too bad only 4 can be used"
Yeah, but this makes 16 more analog ports (4x4) and it is better than nothing (and i dont need any more than 8)

Yeah under those icons is good place, but there is not gonna fit any text etc, only value and maybe watt sign. Because you know that there must be free space front of values. If want those values don't leave ugly remains / "garbage"


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-25-2017

I made some testings and calibration.

There is result. It show quite accurate readings. And because that meter don't show decimals in ac voltage, i don't know how much there is error, but less than 0.9v :D

And with current there is error 0.3w. And it most likely can fix using fine adjustment and calibrate using four decimals :D (now i use three) 

[attachment=201]


RE: Nixu's Aquarium setup (Work in progres) - rott - 01-25-2017

this is a very cool function I would love this added to mine even if I had to add some extra wires from the basement up to the controller screen :)


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-25-2017

(01-25-2017, 01:21 PM)rott Wrote: this is a very cool function I would love this added to mine even if I had to add some extra wires from the basement up to the controller screen :)

If you add one of these to controller, you have 4 analog input more, and you don't have to wire display pcb / arduino anything :) 

http://www.banggood.com/ADS1015-12-Bit-Precision-Analog-To-Digital-Converter-ADC-Module-Development-Board-p-1110605.html

When my order of these arrives (about 7 days) i add code and  support for these to the code :)

This is how connect those to controller / arduino. And if im not remember wrong, Rob has all ready direct port / connector to scl / sda so no need of soldering anything to controller :) But off course when arduino is due we want to put that power line to 3.3v not 5v

[Image: sensors_ADC_i2c_bb-1024.jpg?1396785691]


RE: Nixu's Aquarium setup (Work in progres) - rott - 01-25-2017

I will wait to see how it turns out in 9 days but I believe a lot of people might be doing this mod


RE: Nixu's Aquarium setup (Work in progres) - niksunen - 01-25-2017

I added feature that check if there is circuit connected to controller, And if it not, it show message when try to open energy meter screen. Also when there is no circuit attached, no daily, total or hourly consumption are writen / stored to sd card (because it is just stupid to write daily or hourly data of zeros or something else which is "trash"

Also no power usage not showing in homescreen if there is no circuit.

There is video of it. After i show that message, i put plug (wire between controller and powerbar) back to connector.

https://www.youtube.com/watch?v=oCfD6A4u5ps


RE: Nixu's Aquarium setup (Work in progres) - Rob F - 01-25-2017

Nice, you're like me, all about the details. There is an external port for I2C and some onboard headers.

You probably know but just to clarify and for others, any I2C being connected has to be 3.3v like you mentioned. If 5v is mandatory an I2C level shifter inline will work. All the other ports however are 5v, that's why you saw those resistors on A0 pin. They drop the voltage to 3.3 before going into arduino. I did it like that because most sensors available are 5v for the mega.