Jump to content
Chad

Interest in Arduino projects?

75 posts / 5060 viewsLast Reply

Recommended Posts

Guest thefishman65

It depends one what they decide to get. Do we save money and get stuff off of ebay. Or spend a little more and get stuff off a non discount site. The advantage of the second option is that when you decided you need a second of a part you know you can find it. I am comfortable going cheap, but if we do this as a group it will be a lot easier if we all use the same parts.

 

First question I think we need to answer (Chadd mentioned it earlier) is what kind of a display do you want?

Graphics - can probably get more information on the screen since you can use symbol, but coding is probably a little harder and takes more code space

LCD - Chadd suggested a 16 character by 2 line. I think we will find this limiting for a reef controller and should consider a 16x4 or maybe it is 20x4.

Share this post


Link to post
Share on other sites

GLCDs are not difficult to program (at least any more difficult than an LCD) so long as we go with a KS0108 chip which is quite common on a 128x64 GLDC display. There are libraries set up for this already so we just need to install it and use the commands http://www.arduino.c...Code/GLCDks0108.

 

That being said, GLCDs (at $20-35) are at least twice the cost of a 16x2 LCD (at $4-15) and require a bunch more inputs (16 vs. like 6 if memory serves). Also, LCDs can be purchased and installed with serial cables, which saves on inputs.

 

Basically what all this gibberish means is that if we choose a GLCD, it means we will want a Mega. If we choose an LCD we can use an Uno.

 

My recommendation is to go with a GLCD for two reasons: 1) I have run into the limitations on a 16x2 many times... and not only because of limited display space, but because with LCDs we are limited to characters where with a GLCD we can display whatever we want (remember my seahorse in this thread?). and 2) with some of the future expanded capability that is being talked about we are going to need the capability of a mega.

 

For those who are intrigued. I want to make sure that this is a modular project that we can bite off in small chunks. Speak up if interested!! This is about learning and expanding our capabilities :)

Share this post


Link to post
Share on other sites
Guest thefishman65

I agree on the mega and GLCD.

 

I also think that the prototype shield you mentioned in post 6 may be the way to go. We could take the 16 (if that is the correct count) lines and run them to a connector for the GLCD. Then we could take 2,4 (whatever we decide) for sunrise sunset control to another connector. Then X lines for an ATO. Anyone that wanted that feature would add that connector to the board. If the Arduino language is like standard C then each new connector would require a C module to handle that function.

 

The tricky part get into linking that feature in a nice way into the main loop. I have thoughts on this also, but I am not sure it is time to discuss this yet.

Share this post


Link to post
Share on other sites

I also vote for the mega and the higher quality setup. They are only $20 or $30 more expensive. Given the cost of buying corals and other things in this hobby I see that cost increase as barely noticeable. I'm willing to be outvoted if the rest of the group goes the cheaper route but the convenience is worth the extra money to me.

Share this post


Link to post
Share on other sites

How does one program these things? Via computer or via some control screen that is built in?

 

also what type of programming language is it called?

Edited by rocko918

Share this post


Link to post
Share on other sites
Guest thefishman65

You have to have the right tools (but they are free) then you write C code and download it through a USB cable. At that point the Arduino is free running and does what ever you tell it to do. For instance say you want your lights to come on at 8:00. You could write that into the code. Or write a menuing system that would allow you to set the time the lights come on.

Share this post


Link to post
Share on other sites

The programming language is C based (so if you know that you can apply your knowledge), but is a separate language and coming from a C background, this is a bit easier.

 

There is a downloaded program (http://arduino.cc/en/Main/Software) where you can edit and upload your code (called a "sketch" in arduino terms) to the chip and a window that can be used to display variables for debugging or inputing data (Side bar: Any project we do could also be done without a GLCD or LCD, instead using a computer monitor).

Share this post


Link to post
Share on other sites

Chad, does the Mega have a built in, battery backed clock or will you have to add a module for that? What is your input/user interface going to be? Very interesting. As I mentioned the other day, I ordered an Uno to play with and get familiar with the platform and the development tools.

Share this post


Link to post
Share on other sites

For instance say you want your lights to come on at 8:00. You could write that into the code.

 

 

can you show an example of this code? Just curious. Want to see if its going to be one line or 10 lines to make a light turn on.

Share this post


Link to post
Share on other sites

Thanks for bringing that up, Tom, that leads us to another decision that we will have to make (if we all want the same parts).

 

None of the Arduino platforms (that I know of) have a battery backed clock. They do have on-board timing functions, but it is not stable enough to use for a clock on a daily basis. (great for delay, debounce, or time-out functions, but not good for starting something at the same time every day).

 

We will need to add something that will allow us to do at least day to day functions (and perhaps monthly or annual functions as well).

 

I have previously used a real time clock (RTC) for this purpose and they work quite well... it is really a set it and forget it timing solution (well, I guess 9 -17 year battery life does mean that you would need to play with it eventually...). The RTC that I use has been this one, I have a few extras sitting around.

 

There are a couple of common chips out there that are used for RTCs. Some of them are standalone chips or we could go down the path of purchasing component parts and assembling the RTC ourselves (say on a prototyping board - schematic). There are some great standard libraries out there on the DS1307 variety of timing chip (which is commonly available).

 

Since we will likely be using a prototyping shield, my recommendation here is to aquire the parts needed to make our own RTC and make our own. It is an easy way to save a few dollars and polish soldering skills.

 

Here is the parts list:

 

One arduino protoshield pack

X1

Share this post


Link to post
Share on other sites

I find it kind of ironic you have a post going about your shiny new Apex, and also about this DIY controller. My question is what do you hope to benefit with this platform that you can't do with the Apex? OR, is this just for fun which I totally understand as well.

 

Just not sure what your end goal is, or if this will somehow tie into the Apex?

Share this post


Link to post
Share on other sites

Ahhh, yes, you have caught me!!

 

My timing could have been better, I think, but I am really just interested in the DIY project (I am a tinkerer). Truthfully, I am not sure if this will ever actually make it on my reef. As the start of the standalone modular project we are suggesting here, I will end up with a controller for some number of outlets... that will make my Christmas light display freaking awesome!!! ph34r.gif I also think that this community would benefit from a project like this and since I have a fair amount of background in it, I think I can help smile.gif

 

Rocko, defining the variables will probably be more than 10 lines.

 

But a dimming function for LEDs would be about 5 commands, like this:

 

void setLed(int mins,	// current time in minutes
       	int ledPin,  // pin for this channel of LEDs
       	int start,   // start time for this channel of LEDs
       	int period,  // photoperiod for this channel of LEDs
       	int fade,	// fade duration for this channel of LEDs
       	int ledMax   // max value for this channel
       	)  {
 if (mins < start || mins > start + period)  {
analogWrite(ledPin, 0)
 }
 if (mins >= start && mins < start + fade)  {
analogWrite(ledPin, map(mins - start, 0, fade, 0, ledMax));
 }
 if (mins <= start + (period - fade) && mins > start + fade)  {
analogWrite(ledPin, ledMax);
 }
 if (mins >= start + (period - fade) && mins < start + period)  {
analogWrite(ledPin, map(mins - (start + (period - fade)), 0, fade, ledMax, 0));
 }
}

Share this post


Link to post
Share on other sites

I'm assuming that there's an I2C routine that we can hijack easily enough for the clock interface.

 

At $15, the pre-assembled module that you pointed to is pretty affordable. Do you really think we can build it on the larger protoshield with savings that justify the custom assembly?

 

The protoshield is pretty nice, though, to have in the bag of tricks. I noted that it had a redundant row of holes duplicating the header interface to the microcontroller board. Most might use the holes to pick off signals, but I also see value in using them to assist in building up a stack of multiple protoshield boards.

Share this post


Link to post
Share on other sites

The RTCs are genrally tied into an I2C routine (although they don't have to be).

 

Side bar - An I2C routine is a standard two-wire interface that uses a set of standard commands and an address to control a device. Using this interface we can expand the arduino capability quite a bit without using a lot of wires.

 

I think the benefit is more in setting up the circuit than in cost-savings. I have a few of the standalone RTC modules already, so I am absolutely willing to go that way. But for the sake of a starting point, I made a recommendation.

 

You hit the nail on the head about why I like the prototyping shields! You can stack as many of them as you need and access, cleanly, all of the pins on any of the cards.

 

 

Share this post


Link to post
Share on other sites

Have you guys thought about building off the Reef Angel platform? It's all open source, and you'd have a big head start in all the boilerplate controller code.

 

IMO, the way to go is a headless (i.e., no display) controller that is simply wifi discoverable & accessible via phone or tablet. Why do you need another crummy display when your smartphone does it so much better?

 

I have a Reef Angel I'd be willing to donate to somebody here who wants to work on it. I wish I had time to work on this project; I have 15 years of software development background so this sort of thing really interests me.

Share this post


Link to post
Share on other sites

My son has gotten into Arduino, so I am going to follow along.

 

Just curious, what is the cost this is up to now and how does that compare to controllers out there that have about the same number of functions.

Edited by rioreef

Share this post


Link to post
Share on other sites

Have you guys thought about building off the Reef Angel platform? It's all open source, and you'd have a big head start in all the boilerplate controller code.

 

IMO, the way to go is a headless (i.e., no display) controller that is simply wifi discoverable & accessible via phone or tablet. Why do you need another crummy display when your smartphone does it so much better?

 

I have a Reef Angel I'd be willing to donate to somebody here who wants to work on it. I wish I had time to work on this project; I have 15 years of software development background so this sort of thing really interests me.

Nice idea, Justin.

 

Here's a link: http://www.reefangel.com/

 

It looks like they have Eagle schematics and layout files, too, if people want to build their own. Certainly worth a look.

Share this post


Link to post
Share on other sites
Guest thefishman65

It has the advantage that everything is nicely packaged.

Disadvange is that is it will end up costing more (I expect), and there maybe issue with expandability. Justin, could I take a look at yours?

Share this post


Link to post
Share on other sites

Justin, I may take you up on that reef angel so I can check out what/how type stuff on it.

 

What you are proposing is something that I have been tossing around in the back of my head for quite a while... I have a extremely limited software background (enough to be able to bang my head against something until I understand it and it does what I want, but I am not adept). Having a web interface that is controllable via computer/phone is an awesome idea.

 

Chris, good timing on that question, I was putting together a BOM this morning for the parts that would do what we are currently discussing (modular design with outlet control to start):

 

Honestly, a bit higher than expected. Two things on it: 1) These are full retail prices (searching for lowest prices is not something that I did and Max mentioned that we can get 15% off through a different site), also some of these items will be available for ~1/2 on ebay 2) there is a ton of capability that would be untapped with the first stage of the modular project.

 

This is what I came up with:
Arduino Mega                                        	1 58.95 58.95 [url="http://www.sparkfun.com/products/9948"]http://www.sparkfun.com/products/9948[/url] 
GLCD                                                    1 19.95 19.95 [url="http://www.sparkfun.com/products/710"]http://www.sparkfun.com/products/710[/url] 
RTC                                                	1 14.95 14.95 [url="http://www.sparkfun.com/products/99"]http://www.sparkfun.com/products/99[/url] 
Prototyping board                                	1 17.95 17.95 [url="http://www.sparkfun.com/products/9346"]http://www.sparkfun.com/products/9346[/url] 
American DJ-100A rack mount 8 outlet power strip    	1 29.99 29.99  
Relay 30A                                          	8  3.56 28.48 [url="http://www.sparkfun.com/products/101"]http://www.sparkfun.com/products/101[/url] 
Relay PCB                                          	8  3.56 28.48 [url="http://www.sparkfun.com/products/9096"]http://www.sparkfun.com/products/9096[/url] 
PCB part transister 2n3904 npn                  	8  0.68  5.44 [url="http://www.sparkfun.com/products/521"]http://www.sparkfun.com/products/521[/url] 
PCB part 1k ohm resistor                          	16 0.23  3.68 [url="http://www.sparkfun.com/products/8980"]http://www.sparkfun.com/products/8980[/url] 
PCB part 10k ohm resistor                        	8  0.23  1.84 [url="http://www.sparkfun.com/products/8374"]http://www.sparkfun.com/products/8374[/url] 
PCB part indicator LED                              	8  0.86  6.88 [url="http://www.sparkfun.com/products/528"]http://www.sparkfun.com/products/528[/url] 
PCB part diode                                        	8  0.14  1.12 [url="http://www.sparkfun.com/products/8589"]http://www.sparkfun.com/products/8589[/url] 
PCB part 2 pin screw terminal                    	8  0.86  6.88 [url="http://www.sparkfun.com/products/8432"]http://www.sparkfun.com/products/8432[/url] 
PCB part 3 pin screw terminal                    	8  1.35  10.8 [url="http://www.sparkfun.com/products/8235"]http://www.sparkfun.com/products/8235[/url] 

 Total 235.39 

Share this post


Link to post
Share on other sites
Guest thefishman65

Wow that much already. I would like to know how hard it would be to hook up some non Reef Angel device. I purchases 10 float switches a while back - I wonder how hard it would be to integrate those. On more difficult integration I have relay boards purchases also. But that is looking like a better way to go and maybe we could get a group discount. Do you want me to look into that?

Share this post


Link to post
Share on other sites
Guest thefishman65

The ReefAngel actually has a much nicer display 128x128 and color. Chad listed a very popular 128x64 black and white version.

Share this post


Link to post
Share on other sites

I wasn't implying that everyone needs to go out and buy RA hardware, although I do think it is pretty reasonably priced, compared to what's listed up above. But if you use that codebase with whatever board you want, at least you don't have to debug stupid things like temp control sensors etc.

 

I think if you took out the display and just make a black box with the probe ports and a wifi module with indicator LEDs (on/off & active) then that would be the cheapest way to go. The displays add a lot of cost and take time to program. Writing an android or iphone webapp is much faster for the quality of UI you'd get. I did primitive phone UI programming back around 2000-2002 with the first version of mobile Java and it was a lot of pixel-level manipulations to do things like display graphs, etc. I'd imagine that these screens would be even lower level with less available libraries for functions. Comparatively, I could whip up a full dynamically zooming and panning graph of temp, pH, and ORP in about 2 hours with the UI tools available for modern phone OSes.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...