Reef Central Online Community

Go Back   Reef Central Online Community > General Interest Forums > Do It Yourself
Blogs FAQ Calendar

Notices

User Tag List

Reply
Thread Tools
Unread 11/28/2013, 02:00 PM   #151
wgraham
Registered Member
 
Join Date: Aug 2004
Posts: 292
looking good


wgraham is offline   Reply With Quote
Unread 11/28/2013, 10:51 PM   #152
sdtimer
Registered Member
 
Join Date: Jul 2013
Posts: 12
It's Very Good!


sdtimer is offline   Reply With Quote
Unread 11/30/2013, 05:06 PM   #153
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
I'm still working to get the first version to compile. I get: 'sdfile' has not been declared.
I can get by that by uncommenting class sdfile. Next issue is: 'time_t' does not name a type.
Any ideas where to start with that? I'm pretty sure my libraries are good and in the right place.


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/02/2013, 01:46 PM   #154
wgraham
Registered Member
 
Join Date: Aug 2004
Posts: 292
Do you have the library for the sd card as per instructions and also the right time library


wgraham is offline   Reply With Quote
Unread 12/02/2013, 06:53 PM   #155
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
If the library is SdFat then yes and I grabbed the two time libraries from the second page of this thread. First error is here in tinywebserver.h "void send_file(SdFile& file);"


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/03/2013, 11:45 AM   #156
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
if you have TinyWebServer library in your libraries folder, remove it. I use a modified TinyWebServer that is already included in the project.

The other possibility is you placed the library files in the wrong location. It should be in a folder named libraries in your sketch folder. Select File/Preferences menu on arduino, the first item tells you exactly where your sketch folder is.


d0ughb0y is offline   Reply With Quote
Unread 12/03/2013, 06:20 PM   #157
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
doughboy, thanks for the advice. I cant wait to get this thing running and I must have jumped too quick. I did sketch/show sketch folder which is the incorrect location.

I still have an issue with SdFat. Should that file be pulled out of the sdfatlib20130629 file or was there some modification to it necessary?


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/03/2013, 09:13 PM   #158
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
Looks like I got it to compile. Didn't like libraries too deep eg time/time/file.h


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/04/2013, 12:28 AM   #159
byee
Registered Member
 
Join Date: Apr 2006
Location: Coquitlam, BC
Posts: 115
Quote:
Originally Posted by d0ughb0y View Post
I'm starting this thread to document and share the progress of my controller build. I have been working on this for 1.5 years now and is still a work in progress. I have been using this on my tank since April 2013. I initially planned on getting an Apex controller, but it does not contain some features I need. Apex feed mode cannot be run on a schedule, it only has input lines (no output), no water level sensor, and no built it support for auto feeder (I think they are coming out with one for $99).

Objective:
To build a reliable, compact, simple, low cost, web based interface aquarium controller.

Description/Features:
Base Features:
8 outlet aquarium controller using Chauvet SR-08 relay packs.
Web based user interface optimized for mobile browser (Neptune Apex compatible).
Water level sensor using SR04 ultrasonic sensor (for top off water).
http://reefcentral.com/forums/showthread.php?t=2328819
Auto Feeder using hacked Aqua Chef feeder.
http://reefcentral.com/forums/showthread.php?t=2327962
Can run a Feed cycle on schedule.
Time is synchronized with NTP server and DS1307 RTC module.
Automatic daylight savings time adjustment of time.
ph sensor.
Temp sensor.
Two ATO switches.
Sound and Email alert.
Outlets, Sensors and Web access logging.

Mobile Client app features:
View and control outlets.
View chart of sensor data for last 24 hours.
View logs for any day since logging started.
Modify controller program schedule.
Calibrate ph probe.
Manage SD card files (currently supports file delete only).

Optional Features:
Can be expanded with another unmodified Chauvet SR-08 to add another 8 outlets.
Two channel PWM 0-10v variable output. (hardware implemented, no software yet).
LCD display. (implemented)

The original design includes an X10 interface so I can use my old AC jr DC-8, but had since dropped that feature. The PWM I originally intended for controlling LED lights, but I have since bought a Maxspect Razor so PWM is currently unused. I may use it someday when I get a controllable pump.


Main Parts Needed:
Chauvet SR-08 Relay pack.
8 channel 5v relay module.
Arduino Mega2560.
Ethernet Shield.
Atlas ph stamp.
DS1307 RTC module.
DS18B20 Temp sensor.
ph probe.
BNC connector.
Aqua Chef feeder.
BC327 PNP transistor and 4.7k, and 47K resistors and 1N914 diode.
12v 1A power adapter.
5v 1A power adapter (USB charger).
5mm LED and 220ohm resistor.
Piezo buzzer.
micro SD card. (4GB will store your logs forever).
assorted jumper wires, pin connectors male and female , stereo and 4 pole plugs and jacks, prototype board, soldering equipment, switches, etc.

Optional Additional Parts:
For 8 outlet expansion
Another Chauvet SR-08.
DB-9 breakout module (Sparkfun 8552)
ULN2803 Transistor Array.
DB9 cable (male to female).

For PWM output
LM358 and 4 10k resistors. For 0-10v variable DC output.

For LCD Display
1602 LCD with I2C backpack. You can display a lot of stuff on 16x2 if you get creative.

Depending on where you source your parts, the base unit will cost around $150 and definitely under $250 with the optional parts. I got all my parts from Ebay, Tayda Eletronics, and Sparkfun.


Software Features:
The software consists of the arduino code, and an html5/javascript code that runs on mobile web browser. The outlet schedule processing is done via timer interrupts. Each outlet is updated once per second, guaranteed. I use a very simple, efficient and compact algorithm to define the outlet schedule programming.

The main loop executes less time critical tasks at 60 hz (60x per second or once every 16ms) like logging outlet switch events to SD file, updates LCD, update ph, temp and sonar readings. The ph, temp and sonar readings use an 8 reading rolling average to smooth out the values.

Input lines use pin change interrupts. Ultrasonic sensor echo pulse, Feeder home position indicator (to stop feeder rotation), generic IO open and close all use pin change interrupt. ATO uses timer interrupt to poll once per second.

I also have a timer interrupt based audio beep code for the controller to provide an audio confirmation when commands are received by the controller from the mobile app.

The web server code is based on TinyWebserver. I modified it to use SdFat library and to read and write faster (using buffered reads and writes). I also added basic web authentication code to prompt web connections for a username and password. TinyWebserver is nice that it has code for uploading your files to the SD card.

The mobile web interface is compatible with Neptune's Apex controller. This means, my htm file will work with Neptune Apex controllers. See http://reefcentral.com/forums/showthread.php?t=2306409. Someday when I get an Apex, I will have a nice mobile html app to use. The web page also displays live video stream from a Foscam compatible camera. It is a single htm file written in html5 and javascript using jquery mobile library.

Files for this project are available on github at
https://github.com/d0ughb0y/Chauvet16
d0ughb0y,

Great job on this.

I started on 2 other Aurduino controllers and just gave up. This one has everything I need.

Just need to confirm some parts with you before proceeding

Ethernet Shield -any ethernet shield?

Where would I find the SD shield or is it part of the ethernet shield?

LCD shield - any 1602 LCD with I2C backpack will suffice?

Is there a BOM located at - https://github.com/d0ughb0y/Chauvet16?

Thank you!!



Last edited by byee; 12/04/2013 at 12:29 AM. Reason: added LCD question
byee is offline   Reply With Quote
Unread 12/04/2013, 01:57 AM   #160
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
I did not create a complete BOM other than what I listed, since the idea is to provide the plan (diagram) on how the parts connect, then its up to you what parts you want to use (like what connectors, relay board or solid state, etc). The circuit diagram on the first page is up to date, but a little low on resolution. I will update github with the latest program and pdf of the circuit diagram soon.

You need to use the arduino ethernet shield or compatible one. It comes with the sd card reader.

You can use any 1602 I2C LCD, however, I think there are two maybe three versions of the I2C backpack out there, any you will need to tweak the values (I2C address, pin assignments, etc) to find out what will work with the LCD you got.

I suggest you get all the parts first, then run individual test programs for each part (temp, rtc, ph ,etc) then once you verify each is working, then try to put them all together then try the controller program.


d0ughb0y is offline   Reply With Quote
Unread 12/04/2013, 10:15 PM   #161
byee
Registered Member
 
Join Date: Apr 2006
Location: Coquitlam, BC
Posts: 115
dOughBoy,

I have the Arduino ATMEGA 2560, DS1307 RTC module and DS18B20 temperature sensor.

I've got the following on order - ethernet shield (5100 chipset), I2C 1602 LCD and pH probe on order.

I'll need to order the Atlas ph stamp on my next trip to the USA. Atlas Scientific wants to charge me $29USD to ship the Atlas pH stamp into Canada! Looking at the pictures on the site, it can't be more than 1-1/2" x 1-1/2". Shipping is simply just too EXCESSIVE!!

From my understanding, I can just rem out the pH section of the code. Is there anything else I need to begin the testing?

Thanks!


byee is offline   Reply With Quote
Unread 12/05/2013, 10:10 AM   #162
hopaddict
Registered Member
 
Join Date: Nov 2013
Posts: 8
Very cool project! I am going to give it a go once I get a few items I am missing.

I was going to make my own waterproof ds18b20 sensors using stainless but the pre-assembled probes on Ebay will work out cheaper. The only ones I see on Ebay are inside stainless probes. Is anybody having any corrosion issues with these in salt water? I worry about the quality of the steel used in these.

I followed the instructions in the readme but I am getting some errors when I try to compile that I can't figure out. Any ideas?

Chauvet16.cpp:92:26: error: ‘EthernetUDP’ was not declared in this scope
Chauvet16.cpp:92:53: error: expected primary-expression before ‘timeServer’
Chauvet16.cpp:92:63: error: initializer expression list treated as compound expression
Chauvet16.cpp:1612:1: error: ‘EthernetUDP’ does not name a type
Chauvet16.cpp: In function ‘void initClock()’:
Chauvet16.cpp:1616:3: error: ‘Udp’ was not declared in this scope
Chauvet16.cpp:1617:53: error: ‘getNtpTime’ cannot be used as a function
Chauvet16.cpp: At global scope:
Chauvet16.cpp:1702:26: error: redefinition of ‘long unsigned int getNtpTime’
Chauvet16.cpp:92:26: error: ‘long unsigned int getNtpTime’ previously defined here
Chauvet16.cpp:1702:26: error: ‘EthernetUDP’ was not declared in this scope
Chauvet16.cpp:1702:53: error: expected primary-expression before ‘timeServer’


hopaddict is offline   Reply With Quote
Unread 12/05/2013, 10:13 AM   #163
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
Yes you can comment out the ph initialization and perhaps the code that sounds the buzzer. I highly recommend you get a buzzer. I got it from Tayda electronics. I think you can get it from their eBay store. Did you try atlas store on eBay? Shipping might be less. I don't know why shipping across the border is so expensive, I have not ordered an impeller for my skimmer because the shipping SWC charges to ship to US is quite high.

You also need a microSD card.
If you want to do the feeder or control jebao pumps, you need to get some transistors and resistors. And also relay board if you want to control outlets.


d0ughb0y is offline   Reply With Quote
Unread 12/05/2013, 01:37 PM   #164
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
Quote:
Originally Posted by hopaddict View Post
Very cool project! I am going to give it a go once I get a few items I am missing.

I was going to make my own waterproof ds18b20 sensors using stainless but the pre-assembled probes on Ebay will work out cheaper. The only ones I see on Ebay are inside stainless probes. Is anybody having any corrosion issues with these in salt water? I worry about the quality of the steel used in these.

I followed the instructions in the readme but I am getting some errors when I try to compile that I can't figure out. Any ideas?

Chauvet16.cpp:92:26: error: ‘EthernetUDP’ was not declared in this scope
Chauvet16.cpp:92:53: error: expected primary-expression before ‘timeServer’
Chauvet16.cpp:92:63: error: initializer expression list treated as compound expression
Chauvet16.cpp:1612:1: error: ‘EthernetUDP’ does not name a type
Chauvet16.cpp: In function ‘void initClock()’:
Chauvet16.cpp:1616:3: error: ‘Udp’ was not declared in this scope
Chauvet16.cpp:1617:53: error: ‘getNtpTime’ cannot be used as a function
Chauvet16.cpp: At global scope:
Chauvet16.cpp:1702:26: error: redefinition of ‘long unsigned int getNtpTime’
Chauvet16.cpp:92:26: error: ‘long unsigned int getNtpTime’ previously defined here
Chauvet16.cpp:1702:26: error: ‘EthernetUDP’ was not declared in this scope
Chauvet16.cpp:1702:53: error: expected primary-expression before ‘timeServer’
Double check your EthernetClient.cpp and EthernetClient.h files again. You may have a typo when you edited the files.

No problem with the ebay temp probe. Make sure you get the one with the longer cable. I think 90% are selling the one with short cable. Sparkfun sells one ($10+shipping) that has a long 6ft cable and does not use metal enclosure.


d0ughb0y is offline   Reply With Quote
Unread 12/05/2013, 03:37 PM   #165
hopaddict
Registered Member
 
Join Date: Nov 2013
Posts: 8
Something funky is going on with my libraries. I double-checked the changes I made to those two files and they were correct.

I imported the Ethernet library from the menu (Sketch>Import Library) and it added a bunch of libraries:

Dns.h
EthernetServer.h
Ethernet.h
EthernetUdp.h
EthernetClient.h
Dhcp.h
util.h

And now it compiles! The why has me confused though. By commenting out these added lines I discovered that the critical library was 'Dns.h'. I just realized I am using Arduino 1.0 as this is what was installed through the Ubuntu software center. Maybe a difference in the included Ethernet library?


hopaddict is offline   Reply With Quote
Unread 12/07/2013, 11:52 PM   #166
shafttlc
Registered Member
 
Join Date: Sep 2012
Location: So. Cal.
Posts: 26
Doughboy where did you get your protoboard from and do you know the part #?
Also do you have a pic of the bottom side of the main board with the components mounted?


shafttlc is offline   Reply With Quote
Unread 12/08/2013, 12:46 PM   #167
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
Quote:
Originally Posted by shafttlc View Post
Doughboy where did you get your protoboard from and do you know the part #?
Also do you have a pic of the bottom side of the main board with the components mounted?
Protoboard is from eBay, just search for prototype board and look for the green one that is double sided with plated through holes. Using plated through holes makes soldering easier. Just get the size that matches what you need. I think I got the 20pcs one that comes with assorted sizes. You then just cut it to size.

As to cutting, I used a dremel for cutting the Protoboard as well as the holes on the chauvet.

I don't have a picture of the underside. It's just a mess of wires soldered from one point to another. If you are not doing to feeder or doser pumps and just 8 channels, then all you need on the Protoboard really is just to hold the connectors, rtc and the ph stamp. If you use chassis mounted connectors, you can actually do away with the Protoboard and cut the other end of the jumper wire from the arduino and solder it to the connector, rtc and ph stamp. You don't need to follow exactly how I did it.


d0ughb0y is offline   Reply With Quote
Unread 12/08/2013, 12:59 PM   #168
shafttlc
Registered Member
 
Join Date: Sep 2012
Location: So. Cal.
Posts: 26
Thanks for the info. I was wondering about that. I have a couple boards but don't like them. Im liking the board you used that's why I asked. I thought about doing chassis mount parts but think board mount would be easier for future changes etc.


shafttlc is offline   Reply With Quote
Unread 12/09/2013, 09:18 PM   #169
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
Jerry do you recall where you got that LCD backpack? I'm never going to figure out how to port mine over.


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/10/2013, 11:18 AM   #170
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
Quote:
Originally Posted by camblonie View Post
Jerry do you recall where you got that LCD backpack? I'm never going to figure out how to port mine over.
I got it from seller accecity2006 on ebay, although I don't see the exact same i2c backpack on the current listing. I think there are only 2 or 3 different variations. The one I got is the original version, I think most you will get the later design. It works the same, just different pin assignments that can be configured in the config.h file.

What you need to do is run a test program on the LiquidCrystal I2C library until you get the right pin settings. You can also just trace the connection from the LCD to the I2C chip on the board. I think that is what I did to get the right pin assignments.


d0ughb0y is offline   Reply With Quote
Unread 12/10/2013, 03:59 PM   #171
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
my temp sensor got corroded and stopped working. It seems to have happened overnight. My filter sock is rust colored and the spot where the stainless steel part is laying on my sump is surrounded with rust. Its like I got GFO. I don't see any major corrosion on the stainless steel tip, though it looks like it has a lot of small nicks and chips, perhaps one of them corroded through. I think the stainless steel surface was all nice and smooth when the temp sensor was new.

I just ordered the temp sensor from sparkfun (no metal part). I went and got a 2m sensor from ebay again as backup. I think the stainless steel probe lasted about 8 months.

If you do have the stainless steel sensor, you may want to coat it with some reef safe paint.


d0ughb0y is offline   Reply With Quote
Unread 12/11/2013, 01:20 PM   #172
wgraham
Registered Member
 
Join Date: Aug 2004
Posts: 292
Thanks for the info will check the one I have


wgraham is offline   Reply With Quote
Unread 12/11/2013, 09:06 PM   #173
camblonie
Registered Member
 
Join Date: Jun 2013
Location: Michigan
Posts: 148
I'm sure this is easier than I am making it but I am failing. My LCD backpack is an MCP23008 and i traced the pinouts D7-6, D6-5, D5-4, D4-3, E-2, RS-1. Is this the only part of the code i need to modify?
#define LCD_ADDR 0x20
#define LCD_ROWS 2
#define LCD_COLS 16
#define LCD_NUM_MSGS 4
#define LCD_MSG_CYCLE_SECS 2
#define LCD_EN 2
#define LCD_RW 255
#define LCD_RS 1
#define LCD_D4 6
#define LCD_D5 5
#define LCD_D6 4
#define LCD_D7 3
#define LCD_BACKLIGHT 7


__________________
75g - 20g sump. LED's, Skimmer, RODI.
camblonie is offline   Reply With Quote
Unread 12/11/2013, 10:20 PM   #174
PufferGhoti
Registered Member
 
Join Date: Mar 2013
Posts: 43
Quote:
Originally Posted by d0ughb0y View Post
my temp sensor got corroded and stopped working. It seems to have happened overnight. My filter sock is rust colored and the spot where the stainless steel part is laying on my sump is surrounded with rust. Its like I got GFO. I don't see any major corrosion on the stainless steel tip, though it looks like it has a lot of small nicks and chips, perhaps one of them corroded through. I think the stainless steel surface was all nice and smooth when the temp sensor was new.

I just ordered the temp sensor from sparkfun (no metal part). I went and got a 2m sensor from ebay again as backup. I think the stainless steel probe lasted about 8 months.

If you do have the stainless steel sensor, you may want to coat it with some reef safe paint.
I have seen reports of using "Plasti-dip" with good results (liquid rubber solution) on other forums for Ebay temp sensors that are reportedly stainless steel. I have not tried it yet but with my partial "Jarduino" implementation (Screen v.1.2, temp monitoring and relay board only so far), I found the ebay "SS" probes installed in sump and main tank developed rust spots after a couple of months. Silicone is another option.

By the way d0ughb0y, excellent work, I have a chauvet ready to go, I just need to find the time (as usual) to implement, I think I have all the components around in the basement now and it should be my Christmas project....



Last edited by PufferGhoti; 12/11/2013 at 10:37 PM.
PufferGhoti is offline   Reply With Quote
Unread 12/14/2013, 02:25 PM   #175
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 5,165
Quote:
Originally Posted by camblonie View Post
I'm sure this is easier than I am making it but I am failing. My LCD backpack is an MCP23008 and i traced the pinouts D7-6, D6-5, D5-4, D4-3, E-2, RS-1. Is this the only part of the code i need to modify?
#define LCD_ADDR 0x20
#define LCD_ROWS 2
#define LCD_COLS 16
#define LCD_NUM_MSGS 4
#define LCD_MSG_CYCLE_SECS 2
#define LCD_EN 2
#define LCD_RW 255
#define LCD_RS 1
#define LCD_D4 6
#define LCD_D5 5
#define LCD_D6 4
#define LCD_D7 3
#define LCD_BACKLIGHT 7
The LiquidCrystal library works with PCF8574 chip. I don't think it supports the MCP23xxx chip, I think this is from adafruit. The adafruit one comes with its own lcd library, and the function calls are not 100% the same as the LiquidCrystal library. If you still want to continue using the MCP23xxx one, you can change all the lcd.xxx calls to match the one from adafruit. I actually used the mcp23xxx based one at the start in order to use the additional button inputs but scrapped that and went for the simplier display only. So I know you can modify the program to work with the adafruit compatible lcd library. To simplify things, my suggestion is for you to just get a PCF8574 based i2c board, its less than $2 on ebay.

I just did a quick search on ebay, the exact one I am using is available again for $1.43 shipped from seller princessdress08. Search ebay for
New 5V IIC/I2C Serial Interface Board Module For Arduino 1602 LCD Display
accecity2008 is another seller selling the same board ($1.53). Its the one with the small trimmer resistor for adjusting lcd contrast. The other board is the one with the large blue trimmer resistor for contrast adjustment.


check out the test programs from this page
http://arduino-info.wikispaces.com/LCD-Blue-I2C

it covers 3 versions of the lcd i2c board.


d0ughb0y is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 02:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2024 Axivo Inc.
Use of this web site is subject to the terms and conditions described in the user agreement.
Reef CentralTM Reef Central, LLC. Copyright ©1999-2022
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.