Guide: Arduino based LED controller for Current Satellite LED+ - Page 9
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY


Reply
 
Thread Tools Display Modes
Old 08-03-2013, 04:51 PM   #121
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

Hmmm... We're pulsing at around 36 kHz, which seems to have the most reliable response from the fixture. You can try tweaking the values for the frequency in the code. If you bump both delays up to 8 or 9 you get pretty close to 38 kHz, which is standard. I had issues with the fixture responding at that frequency. In effect, we are using modulation, just with an analog signal.

The other thing to consider is wavelength. There is really no easy way to tell what wavelength the current receiver uses, and we are just gambling on it being 940nm which is pretty standard. It may take some experimentation with difference wavelength emitters to find the correct one.

Also, the current remote uses a smaller emitter, which likely has a narrower beam width.

My guess is the wavelength is off. If you're pulsing at 1A and 36-38 kHz, wavelength is really the only variable we haven't put any thought into.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 08-03-2013, 05:55 PM   #122
Caver
Algae Grower
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: Austin TX
Posts: 56
Default

Well...

Thanks to some help from you guys I think I have my controller running. It should turn my tank lights on in about 10 minutes. We'll see how it does this afternoon...

FYI..I don't remember if it's been mentioned in this thread, but a cool trick to make sure your IR LED is lighting up...Most digital cameras can see into the IR range. My Samsung Galaxy Note 2 smartphone can see the LED on this unit quite well. An easy way to check that it's lighting up.
__________________
--
Tom
Caver is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 06:52 PM   #123
Caver
Algae Grower
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: Austin TX
Posts: 56
Default

To answer my own post...

My controller isn't talking to the light. Don't know if it's alignment with the emitter/receiver or something else yet.

If one of you guys has a test routine program you used to play with commands from the remote I'd appreciate a post.

I'd just like to avoid editing an alarm time, recompiling & loading just to test comms.
__________________
--
Tom
Caver is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 07:04 PM   #124
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,253
Default

Quote:
Originally Posted by Dahammer View Post
It's this one:
http://www.adafruit.com/products/387

The spec sheet is here:
http://www.adafruit.com/datasheets/I..._datasheet.pdf

It can handle up to 1a pulses, so I swapped in a 2N2222 with just a 133ohm resistor at the base and no resistor on the LED. That should have opened it up wide open. But I still only get 4 or 5 feet maximum and it doesn't work consistently at that range. That may be all it's capable of, I'm not sure. Putting the LED in a shroud may help also, I'm not sure. I need to get around 10 feet out of it to do what I wanted to do.

The one for my Samsung TV has no problem working at 30 feet away.
nice... Are you giving it 1A? The arduino can only give you 200/300mA unless you have an external power supply.
mistergreen is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 07:05 PM   #125
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

If it's a newer light, the IR codes may have changed. Current confirmed that they were changing them. There is a sketch at the beginning of this thread somewhere that you can upload to capture the IR signal and verify if its the same or not.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 07:22 PM   #126
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

I'm not pushing the LED anywhere near an amp. The 2N2222 has a max Ic of 600mA, according the specs, but I'm limiting the base input to around 33mA with the 133ohm resistor in order to keep from overloading the Uno. So I'm guessing it is only putting out around 320mA or so to the LED. If I'm calculating correctly. But I don't have a spec sheet on the transistor, just the specs that were on the package.

I'll play with it when I get back Monday. You may be right, it may be frequency or something else. I'm not sure what range to expect from it though go be honest, this is all new to me.

I may have to switch to a MOSFET to power the LED to get the range I'm looking for. I really don't know. I need to research it a bit. I just assumed the transistor would be enough since I've seen TV remote designs for the Arduino that use them. Anyone know what the range to power ratio is approximately?

Last edited by Dahammer; 08-03-2013 at 07:37 PM.. Reason: Added comment
Dahammer is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 07:36 PM   #127
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

I'm getting around 2 feet right now, but I was thinking the transistor amplifier would remedy that. I'm only pushing mine at 33 mA.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 07:57 PM   #128
Caver
Algae Grower
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: Austin TX
Posts: 56
Default

Thanks Indychus,

I checked the device ID already, and it's the same. I bought my light on Amazon about a month ago.

I'm using the cheap IR LED from Radio Shack at about 33mA. I found it has a range of about 2"...

I rigged up a little tubular coupler with the LED in one end and the light receiver in the other and it appears to work.

I'm letting it run now and see if it goes through the sequence I have programmed.

These Arduino things are pretty cool! I may have to go get another to play with...
__________________
--
Tom
Caver is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 08:34 PM   #129
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

There are still some issues with the thunderstorm code. It seems to run ok for 3-4 days then it starts scheduling storms for 5 pm every day. You guys may want to comment that out for now. I know there are issues with the rtc code as well. We will get this ironed out. I think dahammer and mistergreen have a good grasp on the programming aspect... A lot of it is above my head. I don't get to play with electronics much at work, and all of my school and training is in aerospace.

My LCD screen is supposed to be at my house right now, I wont be back to get it until Tuesday. My EE buddy is supposed to be tinkering with a solution to the short range.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 08:42 PM   #130
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,253
Default

Just a quick look at your codes

Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Cloud2);

RH + (TSDuration/3600) might be a float at some point and may blow up Alarms?

maybe cast it to int
RH + (int) (TSDuration/3600)

Last edited by mistergreen; 08-03-2013 at 09:00 PM.. Reason: +
mistergreen is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 11:11 PM   #131
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Caver,

You can replace the loop() function with the one below and it will just continuously emit clock display, wait 15 seconds, dawndusk, wait 15 seconds, fullspec, wait 15 seconds, night2, and then repeat endlessly. That will keep you from having to change the alarm times and reload it so much.

Code:
void loop(){                       
  digitalClockDisplay();
  //Alarm.delay(60000);               // Clock display update frequency (msec)
  
  
  Alarm.delay(15000);
  DawnDusk();
  Alarm.delay(15000);
  FullSpec();
  Alarm.delay(15000);
  Night2();
  Alarm.delay(15000);
}
Does anyone have an oscilloscope? It would be interesting to know what the exact frequency is. Could also use it to see exactly what frequency the Arduino code is on. From what I've read, the digitalWrite function has a little latency.
Dahammer is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 11:18 PM   #132
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

The digitalwrite latency is around 3 ms. 38khz is around 26 ms, so the total time for the frequency function can be estimated from the digitalwrite latency and the delays. I started at 26 ms then just tweaked it around until the fixture responded every time. If I change it either way it starts dropping a few commands. I really think the wavelength might be the issue with the range right now. I'm going to order a few different wavelengths and experiment with it some.

I have a few other Arduinos laying around, so I may try to make an o-scope.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 11:23 PM   #133
Dahammer
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2010
Location: Mississippi
Posts: 118
Default

Quote:
Originally Posted by mistergreen View Post
Just a quick look at your codes

Alarm.alarmOnce((RH + (TSDuration/3600)),RM,RS,Cloud2);

RH + (TSDuration/3600) might be a float at some point and may blow up Alarms?

maybe cast it to int
RH + (int) (TSDuration/3600)
That's a good point. The division may very well mess it up. On the Uno, an int is 2 bytes (-32,768 to 32,767), so no reason that won't work. All of those variables could be changed to int. I think the unsigned longs are remnants of some of the old code.
Dahammer is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 11:54 PM   #134
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,253
Default

Quote:
Originally Posted by Dahammer View Post
That's a good point. The division may very well mess it up. On the Uno, an int is 2 bytes (-32,768 to 32,767), so no reason that won't work. All of those variables could be changed to int. I think the unsigned longs are remnants of some of the old code.
Oh right, your duration is long datatype. It doesn't need to be that big. You'd save memory too.
Or leave it as is and just cast to long

RH + (long) (TSDuration/3600)
mistergreen is offline   Reply With Quote Quick reply to this message
Old 08-03-2013, 11:58 PM   #135
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 646
Default

Yeah, I had some pretty large values in there initially and was having issues doing arithmetic with int and unsigned long together, so I changed them all to unsigned long. Now that those large values are no longer used we can change it back to int.

Sent from my HTC One X
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote Quick reply to this message
Reply

Tags
arduino, automation, current led+, diy, light controller

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:

Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 02:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012