Jump to content

jnam

Members
  • Content count

    346
  • Joined

  • Last visited

About jnam

  • Rank
    Community Member

Contact Methods

  • Website
    http://

Profile Information

  • Location
    Nampa, ID
  1. 1'^3 cube reef 7.5 gallon

    I don't know about the power wheel set up I guess some people love them. As far as powering the LEDs go be careful with that set up. LEDs like constant current and the right voltages to run them. Just because they turn on doesnt mean they will last long running on a printer power brick... I love those mr aquacubes though. Good luck my friend!!
  2. Jnam's BC14

    CODE!!! :lol: :lol: I would LOVE to have this cleaned up and any suggestions you can make would be awesome!! /*Controller V1.1Pin assigmentsDigital pinspin 0 serial usepin 1 serial usepin 2 Pin 7 LCDpin 3 Pin 6 LCDpin 4 Pin 5 LCDpin 5 Pin 4 LCD pin 6 PiN E LCDpin 7 Pin RS LCDpin 8 1 Wire Buspin 9 Float Switch ATOpin 10 PWM LED Whole or Whitepin 11 PWM for Bluespin 12 Relay plug 3pin 13 Relay plug 4 Analog pinsA0 Analog KeypadA1 Relay 1 plug 1A2 Relay 2 plug 2A3 REALY EXPANSIONA4 i2c SDAA5 i2c SCLA6 DEADA7 DEAD*/#include <LiquidCrystal.h>#include <serial.h>#include "Wire.h"#include <OneWire.h>#include <DallasTemperature.h>#define DS1307_I2C_ADDRESS 0x68#define ONE_WIRE_BUS 8// initialize the LCD with the numbers of the interface pinsLiquidCrystal lcd(7, 6, 5, 4, 3, 2);OneWire oneWire(ONE_WIRE_BUS);DallasTemperature sensors(&oneWire);// Convert normal decimal numbers to binary coded decimalbyte decToBcd(byte val){ return ( (val/10*16) + (val%10) );}// Convert binary coded decimal to normal decimal numbersbyte bcdToDec(byte val){ return ( (val/16*10) + (val%16) );}// 1) Sets the date and time on the ds1307// 2) Starts the clock// 3) Sets hour mode to 24 hour clock// Assumes you're passing in valid numbersvoid setDateDs1307(byte second, // 0-59byte minute, // 0-59byte hour, // 1-23byte dayOfWeek, // 1-7byte dayOfMonth, // 1-28/29/30/31byte month, // 1-12byte year) // 0-99{ Wire.beginTransmission(DS1307_I2C_ADDRESS); Wire.write(0); Wire.write(decToBcd(second)); // 0 to bit 7 starts the clock Wire.write(decToBcd(minute)); Wire.write(decToBcd(hour)); Wire.write(decToBcd(dayOfWeek)); Wire.write(decToBcd(dayOfMonth)); Wire.write(decToBcd(month)); Wire.write(decToBcd(year)); Wire.write(0x10); // sends 0x10 (hex) 00010000 (binary) to control register - turns on square wave Wire.endTransmission();}// Gets the date and time from the ds1307void getDateDs1307(byte *second,byte *minute,byte *hour,byte *dayOfWeek,byte *dayOfMonth,byte *month,byte *year){ // Reset the register pointer Wire.beginTransmission(DS1307_I2C_ADDRESS); Wire.write(0); Wire.endTransmission(); Wire.requestFrom(DS1307_I2C_ADDRESS, 7); // A few of these need masks because certain bits are control bits *second = bcdToDec(Wire.read() & 0x7f); *minute = bcdToDec(Wire.read()); *hour = bcdToDec(Wire.read() & 0x3f); // Need to change this if 12 hour am/pm *dayOfWeek = bcdToDec(Wire.read()); *dayOfMonth = bcdToDec(Wire.read()); *month = bcdToDec(Wire.read()); *year = bcdToDec(Wire.read());}// pin assignmentsint relay1 = A1; //ATOint relay2 = A2; //Actinicsint relay3 = 12; //Day lightsint relay4 = 13; //Pumpsint buttons = A0; //Front buttons up = 43, down = 128, enter = 163int atoSwitch = 9;int temp1 = 0;int lcdRow = 0;int lcdColumn = 0;int feedStart = 0;int feedEnd = 0;int feedTime = 3; //in minutesint wlightState = 0; //0 is of and 1 is onint wHourOn = 11; int wHourOff = 20;int blightState = 0; int bHourOn = 10;int bHourOff = 21;void setup() { //start 1wire instance byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; Wire.begin(); sensors.begin(); Serial.begin(9600); // Change these values to what you want to set your clock to. // You probably only want to set your clock once and then remove // the setDateDs1307 call. second = 0; minute = 53; hour = 23; dayOfWeek = 4; dayOfMonth = 13; month = 11; year = 12; //setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("Controller V1.1"); delay(500); lcd.clear(); pinMode(relay1, OUTPUT); pinMode(relay2, OUTPUT); pinMode(relay3, OUTPUT); pinMode(relay4, OUTPUT); pinMode(buttons, INPUT); pinMode(atoSwitch, INPUT); digitalWrite(relay4, HIGH);}void loop() { //lcd.clear(); //lcd.setCursor(1,0); //lcd.print(readButtons()); mainDisplay(); ATO(); lightTimer(); //Serial.print(readButtons()); }int readButtons()//reads the buttons on the front need to replace the values from notes{int b = 0;int c = 0;c = analogRead(buttons);delay(100);// wait for humanif(c==0) { b=1;//enter }else if(c>600 && c<720) { b=2;//down }else if(c>480 && c<580) { b=3;//up }return b;}int moveCursor(){do { if(readButtons() == 2) { if(lcdRow > 0 && lcdColumn < 1 && lcdColumn != 7) { lcdColumn = 7; lcdRow = 0; } lcdRow = 1; } if(readButtons() == 3) { if(lcdRow > 0 && lcdColumn ==7) { lcdColumn = 7; lcdRow = 0; } else if(lcdRow == 0 && lcdColumn != 0) { lcdRow=1; lcdColumn=0; } else { lcdRow = 0; } } DrawCursor(lcdColumn, lcdRow); } while (readButtons() != 1);return(lcdColumn, lcdRow);}void DrawCursor(int lcdColoumn, int lcdRow) { //clear off old cursor lcd.setCursor(0, 0);//THESE PRINT A BLANK IN THE SPOTS THAT WOULD HAVE STARS lcd.print(" "); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(7, 0); lcd.print(" "); lcd.setCursor(7, 1); lcd.print(" "); //draw new cursor lcd.setCursor(lcdColumn, lcdRow); lcd.print("*");}void ATO(){ int atoTimeOn = 0; int atoStartTime = 0; if (digitalRead(atoSwitch) == HIGH) //check the state of the float first { atoStartTime = millis(); digitalWrite(relay1, HIGH); lcd.clear(); lcd.setCursor(0,0); lcd.print("ATO ON"); int at = 0; while(digitalRead(atoSwitch) == HIGH) // print something on the screen till the float turns off { atoTimeOn = millis(); lcd.setCursor(0,1); lcd.print(at); delay(1000); at++; } delay(100); digitalWrite(relay1, LOW); lcd.setCursor(0,0); lcd.print("ATO OFF"); delay(500);//may need to be longer }return;}void mainDisplay() {//makes the main displaybyte second, minute, hour, dayOfWeek, dayOfMonth, month, year; getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);sensors.requestTemperatures();lcd.setCursor(0,0);lcd.print("Reef Controller");lcd.setCursor(0,1); if (hour<10 && hour!=0) { lcd.print("0"); } if (hour>12) { lcd.print(hour-12, DEC); } else if (hour==0) { lcd.print("12"); } else { lcd.print(hour, DEC); } lcd.print(":");if (minute<10) { lcd.print("0"); }lcd.print(minute, DEC);if(hour<12) { lcd.print("A"); } else { lcd.print("P"); }lcd.setCursor(7,1);temp1 = sensors.getTempFByIndex(0);//lcd.print(temp1); //here goes the templcd.setCursor(12,1);lcd.print("Menu");if(readButtons() == 1) { mainMenu(); }return;}void mainMenu(){//draw the menulcd.clear();lcd.setCursor(1,0);lcd.print("Exit");lcd.setCursor(1,1);lcd.print("Feed");lcd.setCursor(8,0);lcd.print("Lights");lcd.setCursor(8,1);lcd.print("Settings");delay(50); //wait for humanmoveCursor();if(lcdColumn == 0 && lcdRow == 0) { return; }if(lcdColumn == 0 && lcdRow == 1) { feedMode(); return; }if(lcdColumn == 7 && lcdRow == 0) { lighting(); return; }if(lcdColumn == 7 && lcdRow == 1) { settings(); return; } }void feedMode(){byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); lcd.clear();lcd.setCursor(0,0);lcd.print("Feed Mode ");lcd.setCursor(0,1);lcd.print("You have ");//lcd.print(feedTime);lcd.setCursor(13,1);lcd.print("sec");digitalWrite(relay4, LOW);feedStart = minute;feedEnd = feedStart + feedTime;////lcd.print(feedStart);// take out after debugif (feedEnd > 60) { feedEnd = feedEnd-60; }//lcd.print(" ");//lcd.print(feedEnd);//take out after debug int ft = feedTime * 60;do { getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); ft = ft--; lcd.setCursor(9,1); lcd.print(ft); delay(1000);// wait a second, try to take this out and see what happens if(readButtons() == 1) {break;} }while (minute < feedEnd);digitalWrite(relay4, HIGH);lcd.clear();return; }void lighting(){lcd.clear();lcd.setCursor(0,0);lcd.print("W:");if(wlightState == 1) { lcd.print("On"); } else { lcd.print("Off"); }lcd.print(" ");lcd.print("B:");if(blightState == 1) { lcd.print("On"); } else { lcd.print("Off"); } lcd.setCursor(0,1);lcd.print("Wo");lcd.print(wHourOn);lcd.print("f");lcd.print(wHourOff);lcd.print("Bo");lcd.print(bHourOn);lcd.print("f");lcd.print(bHourOff);delay(10000);lcd.clear();return;}void settings(){lcd.clear();lcd.setCursor(0,0);lcd.print("under construction");delay(5000);lcd.clear();return;}void lightTimer()//turn off and on the lights at a certain time{byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);if(wlightState == 0 && wHourOn <= hour && hour < wHourOff) { digitalWrite(relay3, HIGH); wlightState = 1; }if(wlightState == 1 && wHourOn < hour && hour >= wHourOff) { digitalWrite(relay3, LOW); wlightState = 0; }if(blightState == 0 && bHourOn <= hour && hour < bHourOff) { digitalWrite(relay2, HIGH); blightState = 1; }if(blightState == 1 && bHourOn < hour && hour >= bHourOff) { digitalWrite(relay2, LOW); blightState = 0; }return;}
  3. Jnam's BC14

    At a standstill until the holidays are over... What I have gotten done is a little more coding cleaned up and it should be ready to post tonight. The stand is all done minus paint
  4. Jnam's BC14

    The Controller I am using a Arduino Nano 328. The plan is for the controller to take care of the ATO the Lighting and the circulation pumps. Right now it does accomplish all of those tasks albeit not at the level I want them to. The case comes from an iPod nano and is the PERFECT size for the LCD and the Nano. Parts ListArduino ATMega328 nano 16x2 LCD using the standard LCD library DS1307 RTC 4 X Solid State Relays DS18S20 onewire Temp from Dallas Various resistors and other electronic mumbo jumbo… What is working =)LCD works wonderfully. RTC is programmed and ticking along. All the functions to run the SSRs without the accidental “flicker” problem I had at first The ATO works… The function for feed mode and water change time Lighting turns off and on at designated times Front panel buttons but the code is laggy The Relay box works and looks wonderful What is not working or partially working or not coded yet. Dimming functions for the LEDs (right now I am just using the PC lights so its not a big deal. The submenus for changing the settings within the software, things like when the lights come on and off and duration of feed times or any other variable the user might want to change. The temperatures only read 185 degrees as far as I can tell this HAS to be a wiring issue because the coding looks fine. External power from a 12V adapter doesn’t seem to turn the arduino on it only wants to run off of USB power which is fine for testing but I need to figure the wiring out on it. Some of the countdowns don’t countdown correctly… still working on this The button functions are laggy and sometimes have a mind of their own need to work this one out. Some of my code seems VERY long winded and I want to clean it all up and make it more efficient. What I really want is help with my coding Like I said I am happy to post it up in an effort to help others and to see if anyone can help me out =) I will get the code off of my laptop tonight and post it for digestion. I will also put up the schematics for my wiring. Eventually I will add an "expansion" to get the controller online.
  5. Jnam's BC14

    Here is the plan. I bought a 14 gallon BioCube on clearance, my 20L is on autopilot and I wanted something to do. Plus my girlfriend is interested in all this reef stuff now too so this will be "her" tank I DIY I love it. So with this build I will do my best to document all of it's goings ons and compile my research into one place. I want feedback and I love to answer questions. The plan: Lighting LED lighting conversion 20 to 24 mix of RB and NW I have a hard time buying into all the other colors... someone convince me differently and this may change otherwise it will be a 60:40 combo RB:NW. I will use two 700mA dimmable drivers to control the seperate channels. The lighting will be on a ramp up and down schedule. The Cheato lighting will be done with a standard CFL more than likely I will just run that opposite schedule to the lighting. Equiptment A heater obviously of what size and style and brand I have no idea whatever I have in the fishbox will probably suffice. DIY arduino controller: more on this later. DIY ATO controlled by the arduino. Possible a K1 for more flow but this depends on what the girlfriend would like to stock in it. The Controller: Arduino Nano ATmega328, I went with the nano formfactor for ease of boxing the project up when I was done. I have gone through hell and back with the arduino teaching my self the language (granted not that hard and I have a lot to learn) to dealing with the convenient to prototype yet impossible to put in a project box Arduino Duemilvore (sp). The controller will get its very own slew of posts soon enough. I have it running mostly but I would LOVE LOVE LOVE for someone to help me clean the code (which I will post for all to see shortly). The woodworking part of the project will also get its very own post here shortly. My girlfriend and I both created this "masterpiece" Teasers. The guts of the controller The case for the controller, can you guess what I canabalized to make it? My 20l next to the new stand. Yeah its blury and the blue is blown out dang iPhone Better now? Oh and it is completely UNCOOL to correctly rotate pictures FYI.
  6. Pmd on refractometer and GFO
  7. Tulip's Topic of Answeerss :)

    Many LFS will sell water at pennies for the gallon of RODI water or MixedSW just check around. To Iballs point we do water changes in our tanks to remove Nitrates that cant be broken down by the bacteria in our little systems. If you are removing nitrate laden water and replacing it with nitrate laden water well you will eventually get a build up and experience an algea bloom... algae is alway present in your tank and needs really just two things to live light and food, well in a reef we give it PLENTY of light so it waits for food and that comes in the form of Nitrates. Buy a nice RODI unit you wont need to spend much more than a couple hundred dollars but it will pay for it self in frustration and certainly keep you in and enjoying this hobby. Have fun and good luck.
  8. FES The controller still in need of its case FTS ATO ran out of water lol
  9. On the arduino: I want to sell what I have as a package. The list 20x4 display 3 button keypad I2C port expander wired to the LCD to keep the ardiuno pins free. Dallas 1wire temp sensor ATMega328 Duemilanove 6 SSR Float switch Piezo speaker for alarms and such I2C DS1307 RTC Expansion Shield Leak sensor DIY Its a ready to run controller ie the programming is dont except for the LEDs functions for sunrise/sunset. It is set up with a flood alarm, ATO, temp sensing, feed modes, etc... BUT it was the first full fledged packaged project I had dont for a controller. I have since gone smaller and thats the reason why I am selling this set up. With all that said I am sure I am into the components more so than I would have been just buying something off the shelf but it was a fun project. I would really like to get at the very least 100$ for the package.
  10. Official 3 and Under Pico Contest!

    Im still in No issues overhere...
  11. RAOK - Random Act of Kindness

    I have some random LEDs all 3w some mounted on stars some not. 3 x RBs unmounted Cree 2 x Whites mounted cree 2 x blues unmounted cree 3 x CW unmounted Cree I am not sure on bin numbers and such. I can ship. PM is key. Id love the GSP from patback
×