Web Based IR Light Controller - Page 2 - The Planted Tank Forum
Reply
 
LinkBack Thread Tools Display Modes
post #16 of 20 (permalink) Old 11-03-2015, 12:18 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2015
Location: Pennsylvania
Posts: 39
Thanks! That has moved me in the correct direction. I have it serving up web pages from the Arduino. They load relatively fast. I still have to work out how to get the IR setup correctly. It appears the iAqua Lite is using the same IRRemote library. His instructions are very specific about which IR LED to use and where to plug it into the Mega board. His code also has some lines that yours doesn't (in reference to the IR). I haven't worked out all the differences yet, but since I have the Mega and the LED board he recommends I'm going to try to work that out.

I'll keep you posted how things go (and I'm sure I'll have more questions).
SL Dan is offline  
Sponsored Links
Advertisement
 
post #17 of 20 (permalink) Old 11-03-2015, 05:29 PM Thread Starter
Planted Tank Enthusiast
 
Harry Muscle's Avatar
 
PTrader: (1/100%)
Join Date: Mar 2007
Location: Canada
Posts: 591
Quote:
Originally Posted by SL Dan View Post
Thanks! That has moved me in the correct direction. I have it serving up web pages from the Arduino. They load relatively fast. I still have to work out how to get the IR setup correctly. It appears the iAqua Lite is using the same IRRemote library. His instructions are very specific about which IR LED to use and where to plug it into the Mega board. His code also has some lines that yours doesn't (in reference to the IR). I haven't worked out all the differences yet, but since I have the Mega and the LED board he recommends I'm going to try to work that out.

I'll keep you posted how things go (and I'm sure I'll have more questions).
Now I'm curious to know which lines his code has that mine doesn't ... if you recall what they are, please let me know when you have a moment.

Thanks,
Harry
Harry Muscle is offline  
post #18 of 20 (permalink) Old 11-03-2015, 09:26 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2015
Location: Pennsylvania
Posts: 39
Quote:
Originally Posted by Harry Muscle View Post
Now I'm curious to know which lines his code has that mine doesn't ... if you recall what they are, please let me know when you have a moment.
I'm not sure this is all the differences, just what I found and I suspect this is all for the specific IR LED that he's using:
He defines some pins:
Code:
#define IR_TRANS_5V_PIN           44 // Power to IR transmitter
#define IR_TRANS_GND_PIN          42 // GND for IR transmitter
Under his setup section:
Code:
  // Activate IR emmitter
  digitalWrite(IR_TRANS_GND_PIN, LOW);
  pinMode(IR_TRANS_GND_PIN, OUTPUT);

  digitalWrite(IR_TRANS_5V_PIN, HIGH);
  pinMode(IR_TRANS_5V_PIN, OUTPUT);
http://www.amazon.com/gp/product/B00EDMJ98K I'm using (as recommended in the iAqua Lite thread). I may just buy a standard IR LED, as I can't see advantage either way.
SL Dan is offline  
 
post #19 of 20 (permalink) Old 11-04-2015, 12:04 AM Thread Starter
Planted Tank Enthusiast
 
Harry Muscle's Avatar
 
PTrader: (1/100%)
Join Date: Mar 2007
Location: Canada
Posts: 591
Quote:
Originally Posted by SL Dan View Post
I'm not sure this is all the differences, just what I found and I suspect this is all for the specific IR LED that he's using:
He defines some pins:
Code:
#define IR_TRANS_5V_PIN           44 // Power to IR transmitter
#define IR_TRANS_GND_PIN          42 // GND for IR transmitter
Under his setup section:
Code:
  // Activate IR emmitter
  digitalWrite(IR_TRANS_GND_PIN, LOW);
  pinMode(IR_TRANS_GND_PIN, OUTPUT);

  digitalWrite(IR_TRANS_5V_PIN, HIGH);
  pinMode(IR_TRANS_5V_PIN, OUTPUT);
This is the LED module I'm using (as recommended in the iAqua Lite thread). I may just buy a standard IR LED, as I can't see advantage either way.
Looks like he's using the input/output pins to provide power to the IR led. It's not ideal but it makes connections easier.

Thanks,
Harry
Harry Muscle is offline  
post #20 of 20 (permalink) Old 11-04-2015, 08:04 AM
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2015
Location: Pennsylvania
Posts: 39
Quote:
Originally Posted by Harry Muscle View Post
2. The IR pin is determined by the IRRemote library and the pin differs for different boards. On the Arduino Uno it's pin 3. Here's the source for the library: https://github.com/z3t0/Arduino-IRremote. The pins for other boards I believe are defined in the irremote.h file.
I'm slow, but persistent. Your statement above is correct (of course). From what I see in the default library, the Mega1280/2560 boards use Pin 9 instead of the Pin 3 for the Uno boards. @AnotherHobby in his iAqua Lite had changed the IRRemote library file IRremoteInt.h to use Pin 46. It's a matter of commenting out Pin 9 and un-commenting Pin 46.

Also FYI, it appears you are using a slightly newer version of the library. It took me a while to figure this out because all the headers indicate "Version 0.1 July, 2009", so I incorrectly presumed you both were using the identical library. When I did a diff, it became apparent it was two different versions. I doubt it matters at all for our purposes, but I suspect the main difference is "Whynter A/C ARC-110WD added by Francesco Meschia" (the last line in the header of each library file).

Anyway, if I had a regular IR LED, I would use your code and just use Pin 9. But since I don't, I'll complicate my life. I'll just note the changes below, in case anyone else comes down this path (and remind myself later):

In IRRemote.ino, add the following:
Code:
// Define power pins for the IR module
#define IR_TRANS_5V_PIN           44 // Power to IR transmitter
#define IR_TRANS_GND_PIN          42 // GND for IR transmitter

// Add this to the "Setup code" section
// Activate IR emmitter
  digitalWrite(IR_TRANS_GND_PIN, LOW);
  pinMode(IR_TRANS_GND_PIN, OUTPUT);

  digitalWrite(IR_TRANS_5V_PIN, HIGH);
  pinMode(IR_TRANS_5V_PIN, OUTPUT);
In the library file IRremoteInt.h comment out using Pin 9 and use Pin 46:
Code:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  //#define IR_USE_TIMER1   // tx = pin 11
  //define IR_USE_TIMER2     // tx = pin 9
  //#define IR_USE_TIMER3   // tx = pin 5
  //#define IR_USE_TIMER4   // tx = pin 6
  #define IR_USE_TIMER5   // tx = pin 46
So, I have successfully managed to get this code controlling my Sat+Pro.

Now, I'm just trying to figure out the memory schedule page and how to sync the current color values with what is actually going on. I expected that when it sent the command for M1 (or whatever), it would reset the current color values to that setting, since you have a page that defines those values. But, that's clearly not what happens.

I'm making progress. I'm sure all this would be much simpler for someone used to coding and familiar with Arduino's in general. My learning curve has been fairly steep with all this. I am enjoying learning it, but hope you don't mind me cluttering up your thread.

And Harry, you mentioned you were running tight on space on the Uno board. Here's something to consider!
Code:
Sketch uses 30,290 bytes (11%) of program storage space. Maximum is 253,952 bytes.
Global variables use 1,477 bytes (18%) of dynamic memory, leaving 6,715 bytes for local variables. Maximum is 8,192 bytes.


Thanks again!

Dan
SL Dan 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