The Planted Tank Forum banner

21 - 40 of 2156 Posts

·
Registered
Joined
·
12,233 Posts

·
Registered
Joined
·
1,602 Posts
Discussion Starter #23
Thanks for all the feedback everybody!

My friend, you need to TFT LCD Shield (evil bay number 280930524149) and a good ol Arduino Mega Proto shield. This one is my favorite. That will solve your LCD cable woes, and give you a nice tidy build once you're ready to put it all together.
I am going to clean the whole thing up for final build. The breadboard is only for testing and initial building. Those links look great! Thanks!

I have no Internet at our cabin (I'm in town now), but I did bring my laptop. I wrote all of the smart startup code while my wife was napping yesterday afternoon. It will turn all power inputs to their appropriate state base on the schedule upon startup, and put the lights into the correct mode.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #24
Nice controller, I like it. Have you considered consolidating all of the peripheral components onto a "shield" for the Mega? Plug-N-Play components rather than breadboards & wiring would make the controller much easier for the less electronically savvy to put together.

If you can provide a final draft of your wiring diagram- I'd be more than happy to design a shield for you.
A breadboard is no way to finish a project. I am definitely going to tidy it all up on a shield, and I'd love your input/help on design. I'll get a parts list when I get back.
 

·
Premium Member
Joined
·
4,840 Posts
Wow, I saw this in your journal but it's more impressive here. I will admit, I know absolutely nothing about coding and Arduino scares me but it keeps on appearing in almost all my hobbies in one way or another so at some point, I may just have to jump on board and see what's up. The electrical part doesn't scare me, I have done enough of that, just the coding.

I think it's awesome that you can change everything in the GUI. That's one thing I didn't know if you could do very easily, or at all with Arduino. That's what made me not so interested, the continuous code tweaking until it works, then you change or add things and redo. To me, that is punishment haha, I am not that type of person so this inspires me to maybe get into this, or get my brother to make me one, haha.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #31
Well I would, except the only Internet I have up here (on Lake Superior north of Grand Marais, MN near the Canadian border) is when I'm in town with my phone. Laptop is at the cabin, and there is no service there. I'll be home tomorrow afternoon and should have time to post it.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #32 (Edited)
I'm home safe and sound. As requested, I've uploaded my in-progress Fritzing document. I also verified this is how I indeed have my project wired. The resistor values are correct also. They don't have all of my exact parts, so I had to wing it on a few things (like the 8-relay board), but I think it's something somebody could build from. The breadboard diagram is complete up to where I am at in my project, and the wiring schematic in the file is maybe half done.

You can download the Fritzing file here EDIT: updated file 8/14/14: iAqua.fzz

Keep in mind, that's a living document on my end, and it's not final. :)

For those that just want a quick glance, here is what the breadboard looks like (NOT INCLUDING THE SCREEN):

EDIT: updated image 8/13/14


As I said, what is not on there are the screen connections. That's because there are almost 30 of them, and it'd just clutter it all up. Below is an image of how the screen hooked up, with the exception that I hooked LCD pin 6 to 5v and not 3.3v. Also, pin 19 on the screen goes to the breadboard lead that says "LCD BACKLIGHT PIN." That allows for the auto-dimming and backlight brightness control that i wrote. The image was taken from the stilo documentation:



This is my first time ever using Fritzing, or ever making a wiring diagram. I'd love to hear if anybody has any pointers, or notices any mistakes.

Also, on the stilo project that got me started, he had put 20K resistors on every single pin between the Arduino digital pins and and the screen. I think I found somebody else that had none, but I don't recall. I've noticed that most things that plug into an arduino end up with a resistor on them. In the process of wiring my screen, I either copied a person that didn't use them, or I completely forgot. I just realized that I have no resistors, but it works fine. I would love input on if I should use them, and why. Go easy on me, I'm still in the early stages of learning this level of electronics. ;)

Also, I updated the first post with version 1.0.1 code: iAqua.zip

CURRENT VERSION: 1.0.1 (7/13/14)
  • created smart startup routine
  • fixed math bug with dosing pump speed saving to eeprom
  • changed PWM pins for dosing pumps to make room for RGBW PWM pins
  • changed from previous RTC library to the more common RTClib
The smart startup routine looks through the schedules and turns on any power relays that are supposed to be on. If it turns the lights on, it looks through the ramping schedule to see what mode it should be in. I didn't go so far as to pick up the ramp (too complicated with the CSP lights), but I did calculate if it's closer to the beginning or end of the ramp, and then it chooses that mode. I'm not sure if that's the best logic, but it's what I went with. Reboots shouldn't happen very often, so I think it's probably just fine.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #34
Wonderful. Thanks so much again.
You're welcome. I realized I had to build the whole schematic anyway, because I have to rip it all apart to build it into it's case (a wood box from a bottle of Bookers bourbon). I could figure it all out again, but it'll be a lot easier with the schematic.

I have a very dumb kinda question here. Is there anything out there which can help simulate the circuit even before I attempt it? Something like circuitlab that electronics people use?
That would be cool. I have no idea, but it'd have to be super advanced to know all of the electronic devices, and how they'd work together. Plus, it'd have to emulate Arduino hardware and code.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #35
Right now I'm pretty happy with where the code is at. I'm sure I'll find things to fix and tweak, but for now I'm going to start working on the case and assembly.

Below is the case I'll be using. It's free to anybody who enjoys a great bottle of bourbon. It's dimensions are roughly 4"x4" and 14" tall. It'll be in a "tower" configuration with the power outlets on the back of it. It'll sit on the floor next to my tank, which is next to my main sitting chair. The clear front panel slides out for easy access, and lets you see all of the nerd guts when it's in place.



The screen will be mounted in an acrylic housing that I'm making that'll be fixed at about a 45° angle tilt backward. I just picked up the acrylic today from a local acrylic shop. They have scrap pieces, so it was only $2 for way more than I need. Here is a quick sketchup of what I'm thinking of.

 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #36 (Edited)
To make the touch screen easy to connect to the mega, I'm making an adapter board. One side will have 2 rows of 16 header pins (42 total) and the other side will be two rows of 20 header pins (40 total). I have a female-female 40-pin cable, and a male-female 40 pin ribbon cable.

The male-female cable will have the male end going to the mega's double row of pins (32 total) where all of the LCD pins are, and the female end will go to the two rows of 16 header pins on my adapter board. The outer 4 pins of the cable will go unused.

One end of the female-female cable will plug into the two rows of 20 header pins on the adapter board and the other end will plug into the 40 pins on the display.

The board will map the pins, so once it's soldered it'll just be simple plug-ins.

It'll go on a small piece of perfboard. This is the mapping from the bottom of the board. Also, since the outer pins on the mega cable care 5v and ground, I can use those to power the brightness PWM circuit on the same board, and just send one wire back to the mega for pin 4.

Also, if it really does need the 20k resistors, this is where they'd go. From what I read, the screen's communication was meant to run at 3.3v, and the mega's pins are 5v, so that's why some people had it hooked up with 20k resistors. It brought the voltage down to 3.3v. Mine's been running fine with no resistors for over a month, so I'm not sure what to think.

EIDT: <pic of board removed> Ordering a pre-built board on bigd603's recommendation, see below.
 

·
Registered
Joined
·
1,602 Posts
Discussion Starter #38
I saw that, but read it had issues. Maybe it would work. It also looks like it's using a bunch of pins it doesn't need to. I'm also not connecting the screen directly to the mega, but I suppose the cables I have could extend this connection as well. I should read up on it more.
 
21 - 40 of 2156 Posts
Top