Hello guys,
In order to give you some idea of my problem, my learning process and what I tried, let me explain. Hopefully its not too long...
For the last 2 months i've been busy building my aquarium computer. Since many others have made this, I've tried to copy as much from other projects. Maybe some know the Iaqua project. Mine however, will be simpler. The idea is to have a simple interface in which I can control my temperature and pH/CO2 through a 3.2'' TFT.
Since i'm new to Arduino i've started easy with some led tutorials and 16x2 LCD tutorials with an Arduino Uno. Next step was to make my DS18B20 temp sensor work on the 16x2 LCD, together with time (DS3231). That worked, however, after a while the LCD started showing weird characters. Tried to solve that, but did not succeed.
Since this was part of my learning progress in understanding Arduino I decided to stop trying to fix something that would probably not be a problem on a TFT screen and move on to the next stage: making my pH sensor work. That worked and using calibration buffer solutions I calibrated my pH sensor in the serial monitor.
Since i wanted to control temperature and my pH via CO2, I needed to be able to turn them on and off, depending on the sensor readings. Therefore I needed to understand how relays work. So, figured that out with a simple led setup, which wasn't to hard compared to some previous strugles.
Next stage was to learn how to use the TFT screen, touch and SD card slot. Switched from an Uno to a Mega because of the TFT. Took me a while to find the right library for SD card and what screenname I should use in the arduino code (ILI9341_16) for my TFT. It appeared I got the wrong TFT shield, which took me a while to realise lol
Got a new one and got everything to work. Ok, when i figured that all out I tried some tutorials like the Button tutorial.
Then I started to develop the layout of the screens. Just a 'homescreen' with time, temperature and pH readings and a 'Settings button'. The setting button brings me to my settings menu in which i can choose between Temperature and pH or go back to homescreen. Temperature and pH setting screen are both the same in which i want to show the current temp/pH and a temp/pH-threshold i can set to turn on the heator or CO2. This worked partly. I could jump through the different screens, but was not able to set the temp/pH treshold the way it should. I could change the value, but it would not show the new setting unless i got back a page and re-entered the settingscreen of either temperature or pH.
Ok, so on this moment I got all my seperate projects parts to work (except for the temp/pH setting):
- I know how my temp sensor works and how to get readings on LCD and serial monitor,
- I know how my pH sensor works and how to get readings on serial monitor,
- I know how to get the time on LCD and serial monitor,
- I know how my TFT and touch screen work.
So, I figured I should still continue simple, integrating one part at a time, using the working codes i already got.
However, here is were I cant figure out how to continue. First, displaying time on TFT, using the DS3231 library. No success. I tried different libraries, still no success. Took me a couple of days before I decided to park this problem and continue with other parts. pH i get to work, partly. It shows on the homescreen, but wont update. My temperature worked, then it stopped. I did not even got my temperature, time or pH to read in the serial monitor
Also, at some point my touch screen doens't work anymore and i cannot get through my menu. When i reload the Button-example, my touch screen does work?
So, back to the basics and retried everything on the Uno. On the Uno i CAN read my time/temp and pH through serial. At this point im stuck and I don't know what to test/try anymore. I even ordered a second Mega (since the first one was quite old and i got it from a friend, thought it might somehow be broken), but it didnt help.
I've been google-ing on these problems for a few weeks now, trying to get it to work. I just can't stand it that i seem unable to figure this out. However, i have to admit now that i am stuck and unable to figure it out without help. So, I really hope someone here has some idea how to continue?
Since my text with code is too long for a post, I'll place the code in the next post.
[edit] hm, my code exceeds the max of 9000 characters. I'll try posting in multiple posts i guess...not sure if that is nessecary.