Reef Discussion

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
No luck so far - I am just about to run some tests.

There is a USB to Serial convertor chip just after the USB connection - this is designed to be hooked up to a computer to provide power and transfer the program to the Arduino. I suspect that the phone charger provided more than the 5.5v normally provided by a USB port and it fried the chip. There looks to be some physical damage on the top of the chip but I can't be sure.
 

deediro

Member
Jan 19, 2013
85
40
Roxburgh Park
The power chips on mine seem to heat up more than any other part... I'm guessing that's the weak point of the non-genuine ones.

I've got a geniune arduino mega coming in so I'll compare.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
The power chips on mine seem to heat up more than any other part... I'm guessing that's the weak point of the non-genuine ones.

I've got a geniune arduino mega coming in so I'll compare.
What is your supply voltage to the Arduino? Keep in mind that they operate off 5v logic (and can thus be powered off a USB connection) - if you are using a 12v supply then 7v needs to be burnt off somewhere.
 

deediro

Member
Jan 19, 2013
85
40
Roxburgh Park
Yeah I'm using 12v as I need 10v to control the Meanwell drivers - so I should expect that much heat to be dissipated? Hope it's not reducing the life too heavily.
 

deediro

Member
Jan 19, 2013
85
40
Roxburgh Park
Hit me up if you need a hand. I'm happy to send you all my code and descriptions - noting that a lot of it was stolen from various places on the net.

Or happy to trawl around the internet to help find answers :)
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Hit me up if you need a hand. I'm happy to send you all my code and descriptions - noting that a lot of it was stolen from various places on the net.

Or happy to trawl around the internet to help find answers :)
Thanks @deediro - coding for the basic controller functions is not the problem. The difficult thing is coding for the touch screen/TFT display which you won't find anywhere.

I am currently struggling with the screen for setting/editing the start times, ramp times etc. Keep in mind that I am providing for 7 different settings (one for each day of the week) x 10 channels x 4 settings (start, ramp up, ramp down and finish) so there is a lot of data to try and keep track of. Working with 2 dimensional arrays is interesting !!

I spent about 4 hours last night working on a screen layout which I am not happy with - I think I can do it better so that is probably 4 hours I will put down to experience.
 

deediro

Member
Jan 19, 2013
85
40
Roxburgh Park
I stole all my code for my touchscreen and modded it to have what I wanted :) Using a 2.4" with SD Card reader.

Can't remember where from but it looks like this (I've got 2 strings of 14 LEDs):
ai298.photobucket.com_albums_mm249_deediro_20130222_173159_zpsceaa7c22.jpg


And modification page for the date/time:
ai298.photobucket.com_albums_mm249_deediro_20130222_173144_zps1d602a22.jpg

 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
@deediro, it looks like you are using a version of the Jarduino sketch :)

I am trying to have a different 'look and feel' to mine which is why I have started from scratch instead of modifying something like the Jarduino.

This is a screen shot of my page for setting the channel timings

Controller-1.jpg


I am still working on this screen, and I am yet to program all the touch areas, but you get the idea ;)
 

Synodontis

Member
Aug 1, 2011
1,979
968
Melton, Victoria
Guys,

This is going to be very sweet. :)

The GUI is looking very smart with a few more screens to go. The amount of work that has gone into the GUI alone is staggering, when we get the finished product I'm 99% sure everyone will be happy.

The wait will be well worth it I feel :)

Now try & tell me I was talking shit about the GUI.

Looks great @MagicJ,
Just wish we could help you more with the programming. I can make my name scroll down the screen if your using a Commodore64? Would this help any? o_0
 

deediro

Member
Jan 19, 2013
85
40
Roxburgh Park
Nice that's looks really good. As you said, getting the touch screen working is a huge amount of work. I was going to redesign the whole UI but when I realised how long it would take, I took the easy way out and changed the one already available a little bit and used as much of it as I could.

When I get the tank up and running I might re-visit my arduinos. I was planning on getting some wireless integration with a couple of Unos and an ethernet board so I could set up a real time web server for monitoring. Gave up when I realised the wireless modules I bought had a range of about 5m :(
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Crap day today in Hobart - hot and windy - so I had a chance to stay inside and work on the sketch. I have almost finished the touch controls for the screen pictured above - keep in mind that there are in excess of 50 different touch areas on this screen :rolleyes

For anyone interested, here is the code that goes behind this screen (not finished yet, but close)

Code:
case 9:      // Edit Channel Timing Settings Page
        {
         
         
          if ((y>=55) && (y<=103))                                              // Range for change icons (+ and - signs)
          {
         
              for (counter=0; counter<4; counter++)
              {
                if (x>= (18 + (counter*95)) && (x<= (98 + (counter*95))))        // Testing which time cell has been touched
                {                                                                // 0 - Start; 1 - Ramp up; 2 - Ramp Down; 3 - Finish
             
                  _timeCell = counter;
             
                }
         
              }
             
            if ((y>=55) && (y<=71))                                            // + Row
            {
              if (x>= (18 + (_timeCell * 95)) && (x<= (34 + (_timeCell * 95))))                                          // Ten's digit of hours
              {
                timeVariable[_timeCell][0]++;
               
                if (timeVariable[_timeCell][0] == 3)
                {
                  timeVariable[_timeCell][0] = 0;
                }
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (34 + (_timeCell * 95)) && (x<= (50 + (_timeCell * 95))))                                          // One's digit of hours
              {
                timeVariable[_timeCell][1]++;
               
                if (timeVariable[_timeCell][1] == 4)
                {
                  timeVariable[_timeCell][1] = 0;
                }
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (66 + (_timeCell * 95)) && (x<= (81 + (_timeCell * 95))))                                          // Ten's digit of minutes
              {
                timeVariable[_timeCell][2]++;
               
                if (timeVariable[_timeCell][2] == 6)
                {
                  timeVariable[_timeCell][2] = 0;
                }
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (82 + (_timeCell * 95)) && (x<= (97 + (_timeCell * 95))))                                          // One's digit of minutes
              {
                timeVariable[_timeCell][3]++;
               
                if (timeVariable[_timeCell][3] == 10)
                {
                  timeVariable[_timeCell][3] = 0;
                }
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
            } 
           
           
            if ((y>=87) && (y<=103))                                            // - Row
            {
              if (x>= (18 + (_timeCell * 95)) && (x<= (34 + (_timeCell * 95))))                                          // Ten's digit of hours
              {
                if  (timeVariable[_timeCell][0] == 0)
                      {timeVariable[_timeCell][0] = 2;}
                else {timeVariable[_timeCell][0]--;}
               
                                 
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (34 + (_timeCell * 95)) && (x<= (50 + (_timeCell * 95))))                                          // One's digit of hours
              {
                if  (timeVariable[_timeCell][1] == 0)
                      {timeVariable[_timeCell][1] = 3;}
                else {timeVariable[_timeCell][1]--;}
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (66 + (_timeCell * 95)) && (x<= (81 + (_timeCell * 95))))                                          // Ten's digit of minutes
              {
                if  (timeVariable[_timeCell][2] == 0)
                      {timeVariable[_timeCell][2] = 5;}
                else {timeVariable[_timeCell][2]--;}
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
              if (x>= (82 + (_timeCell * 95)) && (x<= (97 + (_timeCell * 95))))                                          // One's digit of minutes
              {
                if  (timeVariable[_timeCell][3] == 0)
                      {timeVariable[_timeCell][3] = 9;}
                else {timeVariable[_timeCell][3]--;}
               
                updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
                channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
              }
             
            } 
             
             
             
          }
         
         
          if ((y>=118) && (y<=148))                                              // Range for channel number buttons
         
          {
            for (counter=0; counter<10; counter++)
            {
              if (x>= (15 + (counter*35)) && (x<= (45 + (counter*35))))        // Testing the position of each existing button to determine
              {                                                                // which one, or channel, has been touched 
                _channel = counter;
                newButton9[0] = (15 + (counter*35));
                drawframe(oldButton9[0], 118, 2);
                drawframe(newButton9[0], 118, 1);
                oldButton9[0] = newButton9[0];
               
               
               
              }
            }
            calculateDigits(_channel, _day);
            updateTimeFields(18, 55, 0);
            updateTimeFields(113, 55, 1);
            updateTimeFields(208, 55, 2);
            updateTimeFields(303, 55, 3);
          }
         
          if ((y>=155) && (y<=185))                                              // Range for day of week buttons
          {
            for (counter=0; counter<7; counter++)
            {
              if (x>= (15 + (counter*35)) && (x<= (45 + (counter*35))))        // Testing the position of each existing button to determine
              {                                                                // which one, or day, has been touched 
                _day = counter;
                newButton9[1] = (15 + (counter*35));
                drawframe(oldButton9[1], 155, 2);
                drawframe(newButton9[1], 155, 1);
                oldButton9[1] = newButton9[1];
               
               
              }
            }
            calculateDigits(_channel, _day);
            updateTimeFields(18, 55, 0);
            updateTimeFields(113, 55, 1);
            updateTimeFields(208, 55, 2);
            updateTimeFields(303, 55, 3);
     
           
          }
         
         
          if ((y>=199) && (y<= 231))    //  Buttons
              {
                if ((x>=350) && (x<=382))  // Back Button
                {
                 
                    controlmodeScr();
                                 
                }
              } 
         
         
          break;
        }
This has taken me about 6 hours - my coding is crap but it gets the job done :)