• Full Test Suite

    smartroad09/15/2019 at 08:53 0 comments

    Complete video of the test program I am using to make sure the device doesn't lock up. Ran for over 24hrs with no issues.

  • PCB's Assemble!

    smartroad09/13/2019 at 21:45 0 comments

    The prototype PCBs turned up this week and I have been having fun getting then working. I am still reasonably new to soldering SMT but flux is my friend! Even so, I was still having problems reprogramming the ATMEGA on my board. Turned out there was a minuscule solder jump between the SPI clock pin and the adjacent pin on the chip. Once I had that clear the chip took on the firmware with no issues.

    Finally Working with wires to allow for SPI programming! And I really should clean the board better but practise...
    Using my i2c scanner to find the devices on the bus
    I used my i2c scanner to check the devices were communicating, 0x27 is the LCD backpack and 0x30 is my RGB backpack.
    Bit of a bodge though - the ribbon cable is a wedge to get a good connection for the LCD backpack.

    There are some changes I would like to do to the PCB. As mentioned in the image above I've had to wedge the boards apart to make the LCD backpack work. I de-soldered the connector to allow my backpack to attach, but I don't think the solder has flown back down fully. Next version I will use larger holes so the connector can stay soldered.

    Also my backpack doesn't lay flat as I have used through hole parts for the resistor and capacitor. The resistor is the issue as it obviously comes through. I have two thoughts on this. The obvious is to go over to surface mount components. The second is to solder the top side so the excess legs can be cut flush.

    To finish off this log; another video demo!

  • Firmware Update V0.2

    smartroad09/07/2019 at 09:31 0 comments

    While waiting for the PCBs to arrive I have been refining the firmware more. It is now possible to set the Hue, Saturation and Brightness separately in single byte commands. The 3 byte RGB command has been augmented with additional commands to set each colour separately.

    There is also now an 8-bit RGB command which enables selection of 255 colours from a single byte (well 255 colours plus black). It uses the format BBGGGRRR. So red and green both have 8 possible combinations and blue has 4 giving the full 256 options. Below is the new command set and what colours are available with the 8-bit palette (please note the colours on screen WILL display differently compared to the LED output!)

    Here is a quick video of my test unit randomly selecting palette colours:

  • IIC Communications

    smartroad09/01/2019 at 17:46 0 comments

    I have added the current firmware for the backpack. It uses the FastLED library to enable some features. Due to a small mistake on my PCB design I forgot to add in the solder jumpers to enable the device to change it's IIC address, which is currently hard coded to 0x30. Of course this can be changed in code if it is a problem, however jumpers would enable an easier change should it conflict.

    The current code enables turning the backlight off and 4 other modes to set the colour. These modes are:

    • Set Hue only (leave saturation and brightness at full) (1 byte command, 1 byte data)
    • Set hue and brightness (leave saturation at full) (1 byte command, 2 byte data)
    • Set hue, saturation and brightness (1 byte command, 3 byte data)
    • Set red, green and blue values individually (1 byte command, 3 byte data)

    Here is a chart for the command structure:

    As indicated when setting hue, saturation, brightness, red, green or blue values they can be anything in the range of 0-255, allowing a full 16 million colour palette.

    When sending a command standard IIC commands need to be sent, first the address, then the command and finally up to 3 bytes of data (depending on the command).

    Using Arduino to tell the board to show red you could do:
      Wire.beginTransmission(0x30); // device address
      Wire.write(4);                // RGB command
      Wire.write(255);              // sends red byte
      Wire.write(0);                // sends green byte
      Wire.write(0);                // sends blue byte
      Wire.endTransmission();       // stop transmitting

    Given FastLED starts it's hue spectrum at red (https://github.com/FastLED/FastLED/wiki/Pixel-reference) you could send:

      Wire.beginTransmission(0x30); // device address
      Wire.write(1);                // RGB command
      Wire.write(0);                // sends hue byte
      Wire.endTransmission();       // stop transmitting 

    One other feature of the code is that the unit stores the last colour settings in EEPROM (there is a 5 second delay after the last change to reduce wear on the EEPROM). So when the board powers up it will recall the last colour it was set on. That way it could be used to setup the colour you want but also be used on something that doesn't have the ability to interface with the board.