My Links

Post Categories

Article Categories

Archives

Image Galleries

Tuesday, November 10, 2009

Boblight has moved to google code.

I have rewritten it in C++, right now there aren't any docs yet and it doesn't work on windows, but boblight-X11 can use Xrender to scale screenshots in hardware, so it works a lot more efficient.

posted @ 5:37 PM

Monday, January 26, 2009

Boblight 1.3 for linux and windows is here, you can find it at the downloads page.

Changes:

added XShmGetImage to boblight-X11
added threshold parameter
changed interpolation and method from 0/1 to on/off and average/median
fixed stdin/stdout/stderr file descriptors in cygwin
replaced posix timers with gettimeofday and usleep
replaced windows timers with multimedia timer
replaced windows gettimeofday with QueryPerformanceCounter
added realtime priority support
fixed a bug where a client mutex would be lost forever in case of a timeout
rewrote boblight-v4l, code looks a lot better
changed use from 1/0 to yes/no
added linux/videodev2.h detection to configure script


Please keep in mind that boblight is still in development.
posted @ 5:47 PM

Monday, January 05, 2009

Boblight for windows 1.2 beta 5 is released, you can find it at the downloads page.

Fixed a bug where printf statements would be sent out the serial port.

The rar file contains two configuration files, one for the standard momo controller and one for the standard atmo controller, either rename one to boblight.conf or start boblightd with the -c <filename> flag.
posted @ 5:58 PM

Sunday, December 14, 2008

When driving led strips with pwm, a strobing effect can be noticed when the dutycycle is changed slowly, this is because our eyes' sensitivity to light is logarithmic while pwm is linear, this effectively decreases the perceived resolution, this is noticed especially in the 0% to 10% dutycycle range.

Most rgb controllers have a resolution of 8 bit, why? Because pwm is usually done in software, a timer generates an interrupt every n-th clockcycle, the interrupt causes the controller to jump to a certain section of the program where calculations are performed to determine whether a pin should be at 0 or 1.

This is fine for most applications and doesn't require a very expensive controller, however it's very inefficient, making it impossible to get something like 16 bit pwm at a high enough frequency (at least 100 hertz).

To get pwm at 16 bit resolution a controller is needed with hardware pwm, I chose the dsPIC33FJ12MC201 from microchip, it has three pwm outputs (well six actually, but only three dutycycle generators) which is enough for a single rgb channel.

This is the schematic I came up with:



You might notice that it doesn't have a crystal, that's because it uses the internal oscillator. Internal oscillators are usually not accurate enough for rs232, but there's a simple trick to solve that, the uart of the dsPIC can measure the baudrate when set up correctly and 0x55 is sent to it.
Because most operating systems sent something out the serial port when booting, the dspic is set up to measure its baudrate 64 times in a row, this ensures that the byte used for auto baudrate measurement is really 0x55 and not something else, at least when the software is set up right.
LED1 turns on when the auto baudrate measurement is complete.
It works with baudrates from 50 to 115200 baud.

The protocol used is the LTBL protocol.

It doesn't use a level shifter for rs232, the tx signal is fed directly to the pin using R4 to limit the current, the rx signal is sent through the TSC427 because it had an unused mosfet driver section anyway, R6 is used to limit the current because the TSC427 has a very low output impedance, without R6 the TSC427 will blow up if the output is shorted.

When the controller is not being controlled over rs232, the color can be adjusted with S1, S2 and S3, S1 selects the channel to adjust and S2 and S3 are used to increase or decrease the selected channel's dutycycle. The selected color is stored in the eeprom.

The firmware and sourcecode for the controller can be downloaded here, to program the controller a programmer like the pickit2 is needed, as far as I know there are no simple programmers like the jdm programmer for the dspic.

I built it on some experimentation board and mounted it in a metal case that I got with my lighter from dealextreme.

posted @ 8:41 PM

Wednesday, November 12, 2008

Boblight for windows 1.2 beta 4 is released, you can find it at the downloads page.

Added all the new stuff in boblight-1.2, added -c and -h flags to boblightd, added -h, -s, -v, -i, -a, -p, -t, -u, -e, -h and -m flags to boblight-getpixel. Start boblight-getpixel with the -h flag for a help message. Added nicer icons for boblightd and boblight-getpixel.

The rar file contains two configuration files, one for the standard momo controller and one for the standard atmo controller, either rename one to boblight.conf or start boblightd with the -c <filename> flag.
posted @ 12:12 AM

Sunday, November 09, 2008

Boblight 1.2 is released, you can find it at the downloads section.
Changes
Fixed a bug where a light would select a wrong color.
Made the proportional independent of interval.
Added boblight-getpixel.
Boblightd exits when an LTBL device does not respond, instead of completely freezing.
Changed the LTBL protocol to allow for auto baudrate measurement.
Added median method.
Added interpolation, proportional, saturation, value, valuerange, method and use parameters to the global section, useful if you have a lot of lights with the same parameters.
Added support for atmo devices.
Added parameters to boblight-jack to change the low, mid and high multipliers.
Added RGB24, BGR24 and RGB32 formats to boblight-v4l.
Added alsa, jack and X11 detection to the configure script.
Added alsa, jack, X11, v4l2 and cygwin parameters to the configure script.
Added a ping timeout checker to the clients, the clients will exit when the server exits or times out.
Added a grab parameter to boblight-X11.
Changed the parameter for address:port to also accept an address without a port.
Added version to the help messages.
Removed useless debugging info from the clients.
Banged my head on a table for not writing down changes when they're made.
posted @ 9:48 PM

Wednesday, October 29, 2008

Boblight for windows 1.2 beta 3 is released, the cygwin timers are replaced with native windows timers and the return value of GetDC() is checked for NULL.
The cygwin timers have a lot of overhead, this works a lot more efficient.

You can find it on the downloads page.
posted @ 4:45 PM

Monday, October 27, 2008

Boblight 1.2 will have support for atmo hardware, but since it's not done yet you can use this config file to get your atmo hardware working with boblight.
posted @ 9:05 PM

Sunday, October 19, 2008

I made a pickit2 clone based on this article with some modifications.
I used a PIC18F4550 instead of a PIC18F2550 and added some extra components to make the target voltage auto adjustable.

Here's the schematic:



R4 is used for minor adjustments of the target voltage, because the original pickit2 has an extra schottky diode which causes a 0.3 volt drop.

The circuit board is a bit messy, but it works great. The 40 pins socket is wired for PIC16 and PIC18, the 28 pins socket is wired for dspic33F.

posted @ 7:41 PM

Saturday, October 11, 2008

With cygwin I was able to compile boblightd on windows, I also made a client for it that uses the getpixel api.
You can download it at the downloads page.

Extract the rar file to a directory somewhere, edit boblight.conf with notepad, it's already set up for a momo controller on com1.
Check the page of boblightd for the options in boblight.conf.

Start boblightd.exe, you'll get a trayicon, now start boblight-getpixel.exe and everything should work.
To close boblightd and boblight-getpixel, doubleclick on the trayicon.
posted @ 8:31 PM

Thursday, October 02, 2008

I wanted to make a headphone amplifier with a crossfeed like this one, elsewhere on the net I saw that some people where using the LM317 voltage regulator as output devices, I had a couple spare ones laying around so I figured, why not?

After some thinking and experimenting I finally settled on this schematic:



R1 and R2 simulate a headphone load, because the headphone output of my receiver is connected to the outputs of the amplifiers with a 390 ohm series resistor. That's fine for driving a pair of headphones but it can destroy an opamp if it's directly connected to its input.
Without R8 and R9 the amplifier oscillates, the 10k resistor forms a lowpass with the input capacitance of the opamp, this attenuates the feedback signal at high frequencies.

If you want an amplifier that can handle a line level input, you can use this schematic:



This is what it looks like, the power supply is in a separate casing.

posted @ 6:12 PM

Saturday, September 20, 2008

Boblight 1.1 is released, you can find it at the downloads section.
Changes
Fixed a bug where a really low interval value in boblightd would cause a memory leak.
Boblight-X11 can handle resolution changes now.
Added black bar detection to boblight-v4l.
Cleaned up error handling.
Fixed some other things, forgot what they are though.
posted @ 7:27 PM

Friday, August 29, 2008

Boblight version 1.0 is released, together with a howto for adding ambilight to your tv.
The results are very nice.


Check out more in the pictures and videos section.
posted @ 2:05 AM

Wednesday, August 20, 2008

Microchip has a very useful bootloader for the PIC18F4550 so you can program it using usb.
Look here for more information.

You can use the bootloader to program the 18F4550 using Piklab, but since piklab uses libusb, you have to set the permissions to be able to program it as a user.
In /etc/udev/rules.d create a file called 46-microchip-picdem.rules (as root) and put in this line:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="000b", MODE="0666"

Now run "/etc/init.d/udev restart" (as root) and you should be able to use the bootloader from piklab without root permissions.
posted @ 4:38 PM

Friday, August 15, 2008

Recently I bought a cheap rc car from dealextreme, it can go forwards, backwards, left and right.

It also has a turbo button which makes the car go faster, the only downside is the turbo button doesn't work when you steer left or right. I wanted to do something about that, so I opened it up and discovered that there was an ic inside called RX-2C, which apparently is a very common ic for these cars.

I looked up the datasheet and found that the turbo function is on pin 12 while the forward function is on pin 11, I soldered these pins together and tried it out.

Now when you press forward the turbo mode is engaged and also works when you steer left or right.
This has the added effect of being able to get more power out of the battery so you don't have to recharge as often.
posted @ 1:30 AM

Blog Stats