Pages: 1 [2] 3   Go Down
Author Topic: Arduino based Ambilight for you computer :)  (Read 17535 times)
0 Members and 1 Guest are viewing this topic.
North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem with RGB or VGA is that if you also have to divide the screen
If you want to get good Ambilight you extend the screen with the colours projected on the wall.
So you have to divide the screen where each side gets the colour of that portion of the screen.
Thats not posible with the RGB output from your Tv set without additional hardware to devide the screen as far as I know.
Yeah, that was the conclusion I came to after a while.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there anyway for the script to avoid averaging the black bars on widescreen movies?
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 1
Posts: 27
C+ N00b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, define the screen portion that you need.

I'm curently developing a version with 4 the sides from the screen giving sepate outputs.
In that version I have a pixel offset feature,  with that you can skip the black bars.

By the way most of the work must be done in Processing, not on the Arduino
Logged

Urbana, USA
Offline Offline
Newbie
*
Karma: 2
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@chnics "Royboy, are you still interested in this project and looking to improve it or do you see yourself as done and going for the next challenge?"

My aim was to quickly create a platform which is easy to understand and modify. My job is done here smiley I am quite happy with it smiley It will at most take a person a day of coding and a week of shipping materials to extend this to screen borders and so on. So good luck to everyone who wants to extend this further! And please post your code somewhere where everyone can find smiley-grin

It is another weekend and thus time for me to work on something else :p
Logged

Offline Offline
God Member
*****
Karma: 2
Posts: 711
a, b = b, a+b
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

edit: just tried this myself. 9.6 volts works just fine...

Has anyone tried powering these strips off 9.6 volts? I assume it should work, but the LED's will simply be dimm. Does that make sense? Can anyone who has a working setup and a 9v battey lying around quickly give this a try and tell me the results? I would like to incroporate this into an excisting project and dont have 12v available...

Well, if someone has the equipment to quickly check this out for me, it would be apreceated.

Cheers

P.
« Last Edit: February 19, 2011, 07:43:38 pm by fkeel » Logged


Urbana, USA
Offline Offline
Newbie
*
Karma: 2
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried that initially. My 9V battery couldn't drive even one channel.
Logged

Offline Offline
God Member
*****
Karma: 2
Posts: 711
a, b = b, a+b
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Edit: I got this to work

I have the plus end of 9.6Volts (1600 mAh) connected to the power in of the LED strip and the minus connected to the ground of my arduino. I have the Red Green and Blue channels directly connected to digital pins 9,10,11.

In the arduino code, I inverted the values send to PWM (i.e. blue = 255 - Serial.read()smiley-wink

and tada. It works like a charm.


Hey Royboy, maybe you can help me. I have now officially butchered your project, and it "almost" works. Now I am a completel lay person at this and I am having the trouble finding the error.

I have 9.6Volts (1600 mAh) connected to the power in of the LED strip. I have the Red Green and Blue channels directly connected to digital pins 9,10,11. The ground of the battery is connected to a ground pin in the arduino.

This setup works (and makes me feel like a butcher). I can do RGB as well as CMYK and White using simple on & off. However, when I run your code, it does respond to the screen, but in a slightly random manner. Almost as if it where ouputting inverse values. (gets bright on a white background and dark on a black one etc.) One of the things I have tried is subtrackting 20 from all the values, which, for some mysterious reason improves the result (as in, black will dimm them, white makes it bright, yellows and blues are spot on, rest is random again.)

edit: the values that processing sends out are correct. something is going wrong on the arduino end.

Any Idea why it should have this issue?

I have had problems with this particular arduino board before, I suspect it might simply be bad. On the other hand, what I am doing seems rather unrefined, though I just cant find a reason for it not to work. (not that I actually know what I am doing.)

any ideas would be apreceated.

Thanks

P.
« Last Edit: February 20, 2011, 06:42:07 pm by fkeel » Logged


Urbana, USA
Offline Offline
Newbie
*
Karma: 2
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@fkeel
Alright I looked at the ULN 2003 datasheet: http://focus.ti.com/lit/ds/symlink/uln2003a.pdf and the thing is that the first thing the chip does is that it performs a logical NOT on the input. Thus a +5V signal into the chip creates a 0V output signal and a 0V signal creates a 12V output signal in my setup. Now this is wonderful because the led is bright when the difference between the +12V common anode and the output signal from the chip is 12V. a.k.a. The led is bright when the output signal is zero cause by a 5V signal from the arduino.  In your case this is switched because the if the arduino outputs a 5V, the difference voltage is 9.6-5 = 4.6 and the leds are off. while when your arduino output is a 0V, the difference voltage is 9.6V and your leds are on! So basically the whole ON/OFF of the leds is the opposite in your setup than my setup.

Now by doing (255-Serial.read), you are completely switching the ratio of the ON and OFF time in one duty cycle. So what the ULN2003 chip switches for me, you do the switching in your code instead; ending up with the correct result smiley

I hope my explanation is understandable.
Logged

Offline Offline
God Member
*****
Karma: 2
Posts: 711
a, b = b, a+b
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


 yep. that explains it. and thanks for posting this - whil I figured out how to solve the problem, it still confused me...

btw. could you explain your reasoning for using the ULN2003 chip?

anyway. thanks for posting this project - as you see, you inspired me to mess around with this myself and I learned some things which have become really handy in another project I am working on right now.

cheers

p.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What code modifications would be needed to make it so that if processing wasn't sending it any data, the strip would slowly pulsate blue, but when processing started sending data again, it would become an ambilight again?
Logged

Offline Offline
God Member
*****
Karma: 2
Posts: 711
a, b = b, a+b
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

check the processing webpage for the exact code. Its a sample matter of doing

if serial is available, do amblight
else, pulsate blue.

you want this implemented on your arduino.

check the arduino reference material on "serial" & "if", and for the pulsating you may want to use a "for2 loop. its trivial, you should be able to figure it out...

If you need more help, tell me, and I'll give you more detailed instructions.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would it be a serial.available that would serve this purpose?
Logged

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just made a new version of this, based on the original code.



This one got four rectangles where it gets the average color within. This makes the processing of the picture a bit faster, because it skips all the pixels outside of the boxes.

The form size is based on the screen (1/5th of the real size) and the rectangles inside are in scale to the settings with border (there are definable borders on all four sides of the screen), and to the size of each box.

http://captain-slow.dk/2011/02/26/ambilight-with-arduino-and-processing/
Logged

captain-slow.dk | non contagious!

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Neat bld smiley
Logged

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Already working on an update, want it to have more options, and work even faster than it currently do.
Logged

captain-slow.dk | non contagious!

Pages: 1 [2] 3   Go Up
Jump to: