• Welcome back Guest!

    MARSH is a private reefing group. Comments and suggestions are encouraged, but please keep them positive and constructive. Negative threads, posts, or attacks will be removed from view and reviewed by the staff. Continually disruptive, argumentative, or flagrant rule breakers may be suspended or banned.

Arduino Club Code on Marsh, anyone? (1 Viewer)

Users who are viewing this thread

KyleH

Guest
Joined
Sep 14, 2010
Messages
221
Reaction score
0
Location
NW Houston (249 & 1960)
As I am building my Arduino up, I was wondering if anyone would be interested in the code. Then, I was wondering if all of us that are interested would rather have a single code for the Arduino that controls everything--we simply just need to save up and buy the components that we want to operate. Kind of like Microsoft Office satisfies needs for users that would use Notepad, Wordpad, Word, 1-2-3, Excel, Powerpoint, etc.

So far, the basic Arduino has 13 digital pins and 5 analog (I think). So that limits to what we can plug in (the MEGA has 3x, but that is for another day). I think one can be built to handle about 10 components. Among those components that I am interested in are: IR-remote, LED-dimming, Clock, Temperature, PH, Relays (maybe for dosing pumps), and Ethernet/Internet. Others features components are: 2-line LCD display, graphical LCD display, button, lights flashing, and beeps.

Of course, the code will have an "Use at your own risk. Use As-Is." to avoid any litigations.

If so, so far I have the following assigned based on Pins:

Pin 13: built-in led flasher
Pin 8: IR receiver
Pin 10:Led Controller for White
Pin 11:Led Controller for Non-White


Componenets with hesitations:
* 2-line LCD: requires 4-6 pins; I plan to use Internet accessibility
* graphical LCD: requires too many pins 8+ and can be difficult to program.
* wireless networking connection: too costly for the components
* 3G connection: too costly for the components, and requires a monthly contract.
* any buttons or keyboards: implementing IR provides alternative input.
 

TexanReef

Guest
Joined
Nov 30, 2010
Messages
627
Reaction score
0
Location
290 at 6
I'll jump on board.

Don't have an Arudio so I'll have to start begging now...

I agree about the displays -- too many ways around needing an LCD.

For now my needs are simple:
Temperature monitoring:
--backup kill for the heater
--turn on/off the sump fan
--coolness of logging

Timers
--Canopy lights on/off
--Moon lights on/off
--Sump light on/off

I've three Dallas one-wire temperature semiconductors that I can use for the effort though I've not done anything with them.

Edit: I'll be happy to help with the coding.
 

DustinB

Guest
Joined
Jun 2, 2010
Messages
874
Reaction score
0
Location
Santa Fe
You should really look into the hydra. We designed it to have an i2c bus to avoid using up so many arduino pins. It also uses 2 processors, has a built in pH amp, networking, RTC, etc... Only costs a few dollars more than a standard arduino, which it is essentially 2 arduinos with added features all combined into one board. Same exact programming. For about $120 I have everything I need for a FULL featured custom controller that can do anything a commercial controller can and more.

As for the programming, you're going to have to be very careful with the memory. After so many features you will run out if everything is not properly optimized.

I think I have 2 extra boards if you guys want to try it. www.hydra-reef.com

Not to try and talk you guys out of doing something yourself, just most of the work has already been done in a smaller consolidated package.
 

TexanReef

Guest
Joined
Nov 30, 2010
Messages
627
Reaction score
0
Location
290 at 6
The Wiki site is not very helpful but wow, what a thread on RC.

Interesting. I'd like to learn more.
 
OP
OP
K

KyleH

Guest
Joined
Sep 14, 2010
Messages
221
Reaction score
0
Location
NW Houston (249 & 1960)
hydra seems neat...I like the relays that was rigged up...

The hydras look cool Dustin. I definately need to look you up when I have a new application. I like the multiple relays.

In the meantime, I had my arduino lying around that I picked up for $20. on ebay a while back. It came in handy when I got my new led and tried dimming. Adding the IR-remote was only $5. extra. I had some extra parts that I was using as part of learning the thing a few months back.

A few little things are on my list:

$7. power supply
$4 temperature
$18 ethernet.

It may take me a while to setup the web interface, so I may not have too much time to complete all of that. PLus, I would like to add a solid state relay to turn a pump on/off, maybe a fan. But, I need to rewire a surge protector, I think (like the way you guys did to that power strip from guitar center), and I think each of the 2 relays costs about $7/ea.

-KyleH
 

DustinB

Guest
Joined
Jun 2, 2010
Messages
874
Reaction score
0
Location
Santa Fe
Yeah, the wiki is still a work in progress. Basically put assembly information and explainations of the different parts and capabilities. We are starting a new RC thread soon with everything consolidated.

I didn't rewire anything on the guitar center strip, that was another guy with a dj strip. The guitarcenter strip has relays built in. All I needed was a port expander and some transistors feeding 12v to the relay strip via a db9 cable. Plugs right into the strip.

The i2c on the board is very useful. Same concept as the commercial controllers allowing added modules.
 
OP
OP
K

KyleH

Guest
Joined
Sep 14, 2010
Messages
221
Reaction score
0
Location
NW Houston (249 & 1960)
Arduino Code V1.2.x.1 that integrates PWM and IR

FYI. Arduino Integrated Code V1.2.x.1.

If anyone is interested, attached is arduino code that works for me. It has no delay() routine to make it highly responsive to reading the remote control.

This code is the most robust example of a remote receiver that I came across. The code uses the NEC IR protocols, but it alters the Arduino timers for TCCR1A = 0X00 and TCCR1B = 0X05. Which impacts the timing on some of the Arduino Pins.

If you choose to download this to your Arduino, you do it at your own risk. The code is presented "as-is" with no guarantees or implied functionalities. This code cannot be used in any commercial applications or be sold directly or indirectly, it must be distributed freely or not at all.

There is a high chance that you are not using my exact LG television remote. So, to get some debugging messages, you can un-comment the 2 "serial" lines near the comment "TEST". (Note, the 2 lines near the "IR Example" are not part of this effort.) Next, go to the menus of the Arduino program to recompile your changes, find "Sketch->Verify / Compile"; then send it to your arduino by "File->Upload to I/O Board". After you wire it up, you can leave it connect to your computer. With the Arduino program's "Tools->Serial Monitor", each time you press your remote, it will send out the number to the screen. Write down the number and keys that you want to use for PWM_White, PWM_Blue, up, down.

After Downloading this code, the following are the next steps:

1. wire up IR. The IR example of NEC protocol document is too large to attached here, so you can PM me for the documentions until I can find the best way to distribute it. You should check your IR documentation, but I think this is a common device. If it is like mine you can do the following: for pin 1 on the IR, connect it to Pin8 on the Arduino. For pin 3 on the IR, that goes to the VCC or the 5V on the Arduino's analog row. For pin 2 on the IR, that goes to Ground next to the 5V on the Arduino. PLUS, you need a 10,000 ohm resiter from pin 1 on the IR to pin 3 on the IR.

2. Run your testing for IR signals of your own remote, and write the ones you want on a piece of paper. (note, there are many different IR protocols, not all use the NEC kind. But, the ones in the Arduino Kit does, as well as some LG tv's.)

3. turn off, go back into the code, and re-comment the lines you commented out. Take your values, and edit the sub program named "runLedDimProgramUsingIr()". Currently they are next to the number with the word "Case" to. For instance, 17, 18, 3, and 2 are the current values for Button#1 (White), Button#2 (Blue), down value (-), and up value (+). Save, recompile, and upload.

4. Wire up your PWM. Wire to control your White lights goes to Arudino Pin 11 and Blue wire goes to Arduino Pin 3, finally the Ground wire on your all of your drivers should go to the Ground wire on the same rows as Pin 3 and Pin 11.

I already have some ideas on the next features...

Currently, I think the arduino hangs if the IR is not wired up. My goal is to make any component optional, however, I do not know if I can make that happen directly.

-KyleH
 

merkurmaniac

Guest
Joined
Dec 2, 2009
Messages
309
Reaction score
0
Location
Greatwood Sub of Sugar Land
Kyle, we met at the LED lighting workshop. We spoke a bit about Arduinos and how you were looking to mount some relays to control power inside a power strip. Well, I am looking to replace my sprinkler controller with an arduino based one called opensprinkler.com. The guy who builds them has done a lot of neat things with his setup.

The arduino automatically controls the lawn sprinkler heads on an internet based timer schedule. I was wondering about its ability to control landscape lighting as well. One of his hacks/extensions is to control a radio frequency remote control that is "off the shelf" from amazon using an RF transmitter on his arduino. The receivers and a transmitter can be had in a 3 pack for $60, but others are a lot cheaper. I thought that his approach was ingenious. It would be a nice way to keep the arduino a long way from water and salt and still control 110V plugged in items. The RF transmitter can be had on his website for $5 or so.

If you haven't yet seen his website, I bet that you'd get a kick out of it and it might get some gears turning. Here is a link :
Interface with Remote Power Sockets – Final Version « Rayshobby LLC

I dunno anything about Arduino but it seems fascinating. I plan to buy his opensprinkler controller, and it would be nice to have it control my aquarium lighting also. No wires....

Let me know what you think,
Richard
 
Last edited:
Top