Weather Station 3V PSU

It looks like we’re not getting enough sun light to charge the batteries in my weather station, so I had to built a simple LM317 based 3V supply that I could get into the battery compartment. This should allow me run a 12V supply to the remote station.

Tried to build in 3D to maximise space.. Heating won’t be a problem, the weather station draws 20mA for about 1sec every 30sec or so for the transmission, the rest of the time the draw is about 8mA. Here are a few photos of the build:

Compact LM317 3V supply (top)

Compact LM317 3V supply (top)

Compact LM317 3V supply (bottom)

Compact LM317 3V supply (bottom)

Compact LM317 3V supply (top)

Compact LM317 3V supply (top)

 

Installed in the battery box of the weather station remote

Installed in the battery box of the weather station remote

Arduino – WiFi controlled RGB Leds

Following on from yesterdays post, I’ve decided that the remote control is not the way to go… I think these RGB LEDs need to be controlled from Internet.  Had a dig around in my parts bin and found a WiFly Shield, wrote a simple Telnet server for it that parses the colour data from the input and updates the PWMs.

Arduino WiFly Shield and RGB LED controller

Arduino WiFly Shield and RGB LED controller

Then wrote a PHP application that uses a colour wheel (jQuery based, called Farbtastic) to get a set colour and transmit the colour code over our network to the Arduino.

Basic RGB LED control page

Basic RGB LED control page

It uses a very simple socket connection to get the data over to the Arduino.. Here is the set colour handler:

<?php

$colour = $_REQUEST["c"];

$fp = fsockopen("10.0.0.67", 23, $errno, $errstr, 30);
$rply = '';
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = $colour."\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        $rply .= fgets($fp, 16);
    }
    fclose($fp);
}

if ( substr( $rply, 0, 2) == 'OK' ) {
    header("location:./?d=y&c=".urlencode($colour) );
    exit();
    }

header("location:./?d=n&c=".urlencode($colour) );
?>

Work nice, now I can set the light colour over the web… cool!

 

Arduino and RGB LED Lighting

I was over in Maplin a few days ago and picked up their Flexible RGB Strip Lighting Kit [A99KU]. Only problem, when I got it home and hooked it up, I got a strip of LEDs that did not respond to the remote and were flashing out of control! Bummer.. Oh well I thought I’d take it apart and see if I could see what was up..

Maplin's Flexible RGB Strip Lighting Kit (A99KU)

Maplin’s Flexible RGB Strip Lighting Kit (A99KU)

It looks like the MCU has been flashed with the wrong code.. hard to say, but the rest of the circuit looks fine.

Oh well, the Maplin I got this in is a little far away to bother returning it, and anyway all I really wanted was the PSU and LED strip.  Sounds like the ideal way to get into Arduino RGB Led lighting (the dog on the street seems to be doing it!). Time to see how this control board is done..

The circuit diagram in Marko CAD (complete with notes!)

The circuit diagram in Marko CAD (complete with notes!)

The MCU looks like it a ELAN EM78P1535, again hard to say as there are no markings on the top of the chip, but a quick google search with the pins I could see lead me to this. For example the power goes in on pin 4 and GND is pin 11, ruling out Atmel or PIC. Crystal (while not populated on the PCB) would go to pins 5 and 6.

So time to rip off the MCP and EEPROM and attach some small jumper wire to the points of interest:

Hacked LED driver board

Hacked LED driver board

The pins I need are the three FET gate pins, a ground connection and the IR remote data pin. Arduino time!

Found a simple RGB serial decoder that uses PWM to drive the LEDS over at TodBot.com, that worked as a test.

Arduino, driver and RGB LED strip

Arduino, driver and RGB LED strip

Next to see if I could decode the IR signal from the remote. As with most things Arduino someone has done a IR decoder library, I used Ken Shirriff’s IR Library for this. Uploading and running the IRrecvDemo example code revealed that the remote talked a NEC protocol. Some time spent with this and I have a map of all the key codes.

Remote control key code map

Remote control key code map

Then a little code to use the IR library to decode the keys and then adjust the PWM signals.  The only problem with this is the IR library uses one of the timers that I need for the PWM. I have my RGB leds on pins 9,10 and 11.  Pins 9 and 10 use Timer1, pin 11 uses Timer2 and the IR library uses Timer2 also, so at the moment I can’t adjust the blue without effecting the IR decoder.. Need to look into this!  Any way here is the final project code running on my PC:

RGB control software

RGB control software

Update (21:45): Moved the code to an Arduino Mega.. used a different timer and it’s working really nice now!

Raspberry Pi B – ver 2

My long awaited Raspberry Pi just arrived this morning.. Can you spot any differences? One obvious is the addition of mounting holes!

The Raspberry Pi B Ver 2 board

The Raspberry Pi B Ver 2 board

This is not the UK made board, still made in China.