I2C-LTS-LC device finished


Posted on

I2C-LTS-LC device finished image

You might wonder what this strange name stands for. Well it's quite simple actually. I2C-L(ux)T(emperature)S(ensor)-L(ighting)C(ontrol). And it's just that. (what's in a name :-) ) It has been made for the PiDome project, which is mainly build for the Raspberry Pi and is a system for automating all kinds of stuff in and around the house. This device reads out some sensors (temperature and light intensity). The light intensity is internally converted to Lux, which is an standard for measuring light intensity. These values are stored for the server to collect it. Besides that it is used to control (in this case) the Adafruit NeoPixel Digital LED-strip.

It can communicate over two different busses, I2C and Serial. The main focus for communication lies on the I2C-bus as where the Serial interface is more for monitoring and testing (only reading values).


I have simplified the code and made some improvements regarding memory usage and the availability of the I2C bus. Next to that I added some extra features. So the complete list of features looks like this:

I2C-bus features:

  • Get the current temperature reading
  • Get the current Lux-measurement reading
  • Get the current RGB values the LED-strip is set to
  • Color the LED-strip at once
  • Color the LED-strip using the fade function
  • Color the LED strip using the wipe (from left to right or the other way around)
  • Color the LED strip using the random function
  • Color just one particular LED
  • Turn the LED strip off immediately
  • Turn the LED strip on to the last know state it was before turning it off (fading it to black doesn’t turn it off!)
  • Set the transitiondelay
  • Set the number of LED to handle in the strip (255 max)
  • And last but not least; store the settings and last known color to the EEPROM (IE. for restoring after power outage)

Serial-bus features:

  • Get the current temperature reading
  • Get the current Lux-measurement reading
  • Get the current RGB values the LED-strip is set to and the transitiondelay

How to use it

As said before it is mainly build for the PiDome project but can also be used in a more generic way. One example to do that is to install the “i2c-tools”-package for Linux. Then you can simply send a command and parameters to the connected device and control it that way. For example:

i2c-set -y 0 0x40 0x20 0xFF 0xFF 0x00 i

This will fade the LED-strip as a whole to yellow.

At this moment the I2C address of the device is 0x40 and will remain fixed for now. The speed it communicates over the bus is 400kHz.

To get the measurements in a serial monitor, connect to it’s COM port (8N1) and send one of the ‘T’, ‘L’, ‘C’ commands to get respectively temperature, Lux or the color/speed.


Below is a picture of the setup as I have it now (working). The idea, in my case, is to make a custom PCB for it and put it in a casing so it can be mounted somewhere in my livingroom.


Latest news/blog

Friends of PiDome

Home-automation hardware manufacturer
Affordable 433Mhz RF transceivers
Products for teams, from startup to enterprise

Latest added technology

  • SMS
  • Z-Wave
  • PushBullet
  • PlugWise
  • MQTT

Some project stats

Open Hub project report for PiDome Platform


Official NLJUG Member