Time for additional Ethernet add-on with PWM output

Expansion modules and attachments
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

lnevo wrote:Real NTP you give multiple nodes and both times are compared and sync'd accordingly. Maybe you should adapt that approach rather than primary / backup.
Good plan. I'll see which is easier lol
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

NTP primary and failover/backup server implemented. Edited code on page 12 of thread.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Time for additional Ethernet add-on with PWM output

Post by lnevo »

DrewPalmer04 wrote:Then they will just have to adjust the off set for -6, -4 etc
You could just split the difference...
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

I'm not sure anyone will even use this code or module. But I figured it was worth posting. I've got the backup NTP server in the code. Which reduces odds of NTP time failure. Might add a few more to completely remove the possibility
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Roberto: One last thing I would like to do...

Any way for the ethernet module to send a PWM percentage to make the portal "think" it is a Radion value? I would like the percentage to display on the portal under "Red" for PWM pin 9 value and "Green" for pin 6 value.

I've tried to think of ways to accomplish this, but I'm coming up short :(

Thanks as always!!

P.s. the code has change a bit versus page 12 of the thread..but it's basically still the same as what you see on page 12 at the top. :)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Time for additional Ethernet add-on with PWM output

Post by rimai »

You need to do that in the main unit for it to work.
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

CODE UPDATE:

Corrected code for potentiometers to override PWMParabola to allow for manual dimming of pin 9 and pin 6.
Return both potentiometers to "0" to have PWMParabola take back over...
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Also looking for suggestions/improvements/thoughts. If you have implemented this let me know too!!!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

I've been playing with the idea of how to send info from one arduino to the RA. I'll use the serial communications. I need to send a BYTE and then have the RA receive the byte incomingbyte incomingbyte=Serial.read();
But here is where I'm coming up short. What do I do with the byte once it is read? How do I get this to replace the "0" on RFR and RFG (radian values). of course I'll have different bytes of info for each.


Also, related to this thread:
I've gotten a Chinese version of the Uno/Ethernet combo. It is working great thus far and is a CHEAPER option for everyone at $25 (shipping included) versus $60(+or-) +shipping for the one I've been using so far. Super easy to patch the wifi cable into it FYI.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Time for additional Ethernet add-on with PWM output

Post by lnevo »

SetChannel(byte channel, byte value) seems to be the function to write your byte to whichever radion channel you want. The rest of the functions in the RF class are for setting slopes.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

hmmm...so in theory. I write the received byte to SetChannel() and it'll display on the portal? This is me trying to "fool" the portal after all to know my % of brightness off my ethernet module lol...I'd just prefer to know my % values at a glance versus Serial.print() I have to use now.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Time for additional Ethernet add-on with PWM output

Post by lnevo »

Yeah, it should set the channel even though nothing is written there.. Theoretically, there may be other code in the way that Im not aware of.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Updated page 12 to include the link to the build list/materials needed. :)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Hey, thanks...it's been updated!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Sorry losing my mind.... :lol:

Updated page 12 of thread.
Last edited by DrewPalmer04 on Fri Mar 29, 2013 8:13 am, edited 1 time in total.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Time for additional Ethernet add-on with PWM output

Post by lnevo »

Which thread? what did you update?
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

EDIT:
I should have been more clear...

Security option issue with the portal and Ethernet module. It must [<--Not 100% true] be disabled. That's all I added


I don't use security....but anyone can add this to the RA side of the code...

Use below for security option (IF needed):
ReefAngel SIDE
"key" must match on code and portal

Code: Select all

ReefAngel.Portal("username","key");
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

I have been using this for a few weeks and it really does work well. I am having a problem with the pwm for my Leds. They light up fine, but they flash, it's so fast that I thought it was just glimmer at first. I am using steve's led drivers. They work fine straight off of the RA dimming. Any suggestions?
Image
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Sounds like you don't have enough LEDs in the string. The driver is "protecting" itself. Either reduce the mA output from the driver or add more LEDs. That's what it sounds like to me :)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

can't be that. They work fine off the RA, and the drivers are maxed out as far as capacity.
Image
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Could be that you need an opamp to boost from 0-5vdc to 0-10vdc. Roberto posted a circuit for how to do it
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Or make sure they don't send more than 40mA to the arduino. I don't use Steve's so I'm not sure.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

DrewPalmer04 wrote:Could be that you need an opamp to boost from 0-5vdc to 0-10vdc. Roberto posted a circuit for how to do it
That might be it. I wonder what he uses for the relay that makes it work.
Image
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Lm358 opamp. Two 10k resistors make a gain of 1.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

The drivers I am using will work straight off an Arduino pwm. In fact they can even supply +5v to power the board. I think it is either some sort of noise induced from the power supply, or the pwm freq. is too low?

Not sure.
Image
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Time for additional Ethernet add-on with PWM output

Post by DrewPalmer04 »

Try to remove this line or //comment it out:

Code: Select all

bitSet(TCCR1B, WGM12); //force fast PWM
And check this page out:
http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

Commented out, same problem. There must be something causing it.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Time for additional Ethernet add-on with PWM output

Post by rimai »

If I remember correctly, Steve's drivers accept 0-5V PWM too, doesn't it?
Can you describe or post a video of such flickering effect?
Do you have access to a scope to check the signal?
Roberto.
topjimmy
Posts: 139
Joined: Tue May 08, 2012 8:16 am

Re: Time for additional Ethernet add-on with PWM output

Post by topjimmy »

No, scope available. The drive does except 0 - 5v pwm. I can record it, but it looks like a strobe light a very fast flicker with no perceived off.
Image
Post Reply