iAqua: My Touch Interface Aquarium Controller (Arduino) - Page 3 - The Planted Tank Forum
 193Likes
Reply
 
LinkBack Thread Tools Display Modes
post #31 of 2072 (permalink) Old 07-12-2014, 07:09 PM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
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.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
Sponsored Links
Advertisement
 
post #32 of 2072 (permalink) Old 07-14-2014, 03:33 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
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.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by AnotherHobby; 11-17-2014 at 03:57 PM. Reason: clarity
AnotherHobby is offline  
post #33 of 2072 (permalink) Old 07-14-2014, 10:18 PM
Planted Tank Enthusiast
 
sumer's Avatar
 
PTrader: (27/97%)
Join Date: Feb 2010
Location: FoCo, CO
Posts: 797
Wonderful. Thanks so much again.
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?

||
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
||
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

sumer is offline  
 
post #34 of 2072 (permalink) Old 07-14-2014, 10:50 PM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
Quote:
Originally Posted by sumer View Post
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.

Quote:
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.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #35 of 2072 (permalink) Old 07-15-2014, 12:22 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
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.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #36 of 2072 (permalink) Old 07-16-2014, 02:00 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
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.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by AnotherHobby; 07-16-2014 at 02:56 AM. Reason: clarity
AnotherHobby is offline  
post #37 of 2072 (permalink) Old 07-16-2014, 02:31 AM
Planted Member
 
PTrader: (1/100%)
Join Date: May 2011
Location: Portland, OR
Posts: 286
Hey dude, no need to build a board. Its already been done for you: http://www.amazon.com/gp/aw/d/B008FWSGGK?cache=7fa36401535589d4e64bd03072f64cd7&pi=SY200_QL40&qid=1405477822&sr=8-3#ref=mp_s_a_1_3


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
bigd603 is offline  
post #38 of 2072 (permalink) Old 07-16-2014, 02:43 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
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.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #39 of 2072 (permalink) Old 07-16-2014, 02:44 AM
Planted Member
 
PTrader: (1/100%)
Join Date: May 2011
Location: Portland, OR
Posts: 286
I've got one and its never caused me any issues.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
bigd603 is offline  
post #40 of 2072 (permalink) Old 07-16-2014, 02:55 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
I guess this newer version fixes the issue. I bet it'd work, and for less than $10 it's worth a try.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #41 of 2072 (permalink) Old 07-16-2014, 02:59 AM
Planted Member
 
PTrader: (2/100%)
Join Date: May 2014
Location: Wichita, Ks
Posts: 222
Or there is the Adafruit version. http://www.adafruit.com/products/1932

Using Tapatalk
75ona76 is offline  
post #42 of 2072 (permalink) Old 07-16-2014, 03:04 AM
Planted Member
 
PTrader: (1/100%)
Join Date: May 2011
Location: Portland, OR
Posts: 286
Very good find on the new TFT shield, I really like he white silk screen too. Too bad you didn't get the screen with an SD card holder (like this one http://usd.dx.com/product/arduino-co...5#.U8XqWonn8m8) to clean up a lot more of those wires.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
bigd603 is offline  
post #43 of 2072 (permalink) Old 07-16-2014, 11:57 AM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
Quote:
Originally Posted by bigd603 View Post
Very good find on the new TFT shield, I really like he white silk screen too. Too bad you didn't get the screen with an SD card holder (like this one http://usd.dx.com/product/arduino-co...5#.U8XqWonn8m8) to clean up a lot more of those wires.
I do have the TFT shield with the SD card, but I couldn't get the SD part working. That's why I got the little $3 stand alone SD reader. I'm assuming it was my own inexperience and lack of knowledge that was making it not work, so I am also hoping this shield makes it work for me. For exactly the reason you state.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #44 of 2072 (permalink) Old 07-18-2014, 08:38 PM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
Today I started putting the project case together. I did all of the AC wiring, which included the relay board, the power outlets, a circuit breaker, a power switch, and a power cord. I'm pretty happy with how it all turned out.

Here are is the relay board wired up. 120v will go into the terminal bar, distributing power to each relay. All of the wires coming out are positioned and bent to drop right into the outlets. Each outlet pair has the little metal piece that connects the two outlets removed on the hot side, so each outlet is wired individually to a relay.



Here is the relay board dropped into place, and now connected up to the power outlets. You can also see where the power cord comes in and where the switch and breaker are (in the upper right of the pic).



Here is how it will actually stand. I plan on attaching a slightly larger platform base, but will wait until the end because it's easier to work on this way. The switch and breaker are mounted in on a small piece of flat aluminum. You can also see a long hole at the top of the box, that's where the 40 pin ribbon cable will go out to the display.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AnotherHobby is offline  
post #45 of 2072 (permalink) Old 07-18-2014, 10:37 PM Thread Starter
Wannabe Guru
 
AnotherHobby's Avatar
 
PTrader: (10/100%)
Join Date: Mar 2012
Location: Apple Valley, MN
Posts: 1,602
Well I just wired it all up to the arduino to test, and I didn't start any fires and no sparks flew. In fact, everything is working exactly as expected. This was a pretty exciting step for me, as it's now starting to look real.

Video:


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
•
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by AnotherHobby; 07-18-2014 at 10:50 PM. Reason: added video
AnotherHobby is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may 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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome