Ilujo Hack & Tech Blog

To content | To menu | To search

Wednesday 6 November 2013

Cizilo taking baby steps forward

 

For long time I haven’t had time to focus on my little project and to be honest it has been working fairly well so far. I have few updates though.

 

I built new light controller around Arduino Nano v3. This time having linear slider potentiometers to have 4 channels of control (RGB + Master). This controller has not yet been connected to the RPi running Cizilo software. I got the controls pretty nice for the use and next steps would be creating more functionality to this controller. I need to change the Cizilo sw first to track UIDs for my light circuits. Easiest way for this is probably using ds18b20 temp sensors and their UIDs to track the different controllers (regardless how they are connected).

 

Next step is to add couple of led's and push buttons to that controller with the sliders so that I can rotate between these circuits provided by Cizilo, find the intended color locally and then send that back to Cizilo which in turn can provide it to the wanted controller. This way I have one physical interface where I can control the lights with immediate feedback and send the values out when I feel it’s right.

 

I’m also getting somewhere with the Android software to control all this. After I get that to the state where I can control all of this from my phone or Tablet I’m starting to be close to the point I wanted at the first place. Then it’s just adding different light circuits in, adding some functionality and integrating more of my apartment controlled by it.

 

One of these things I’d like to get added in is my latest purchase of “Easy on Easy off” remote controlled sockets I got yesterday for less than 30EUR for 3 sockets + remote. The remote uses 12v lithium battery, for some weird reason, which suites me perfectly fine as I probably can cannibalize that remote easily and get it controlled by either the RPi or Arduino while powering it from the same feed I power these Arduinos and leds.

 

I’ve made few modifications to the Cizilo code since last update. Including 10 minute timer for bedroom lights when I switch to the night-mode so I have time to wash my teeth and get to the bed before lights goes off.

 

Also based on the feedback last weekend I added light controls to the alarm clock so that when the alarm goes off it brings the lights on to make the wake up more comfy now when mornings are getting dark.

 

I have noticed more and more need to control the heating and air circulation in my apartment now when the days and nights have started to be cold again. I’m all the time tuning the heaters clock due different needs and I really don’t like up to 4 degrees Celsius temp difference between upstairs and downstairs. I need to get the air moving to balance this better.

Saturday 22 June 2013

Network Controllable Lights

 

So next steps of the project got together. I put the led strips around the bed and the Arduino controlling it. Also the Cizilo http server now gives the brightness values out and Arduino can parse them. The color change takes up to 15sec (the polling interval on Arduino) but I’m ok with that. The same output now controls the brightness of the LCD display. Just to make it bit more convenient for nights.

 

The http server returns two things in single JSON item. Format being { “downstairs temp” : “rWgXbYlZ#” }; W, X, Y & Z being the brightness value ranging from 0 to 255. This was just easiest to parse in the Arduino end.

 

Currently the LCD display gives the brightness values on the first row and the temperatures on the bottom. The one delivered from Cizilo at downstairs at the left and the bedroom, that is collected by Arduino, at the right. The first row is good for debugging as I still have anything meaningful to put in there. Maybe that could be good place to put reminders with the alarms or something like that.

 

I have been bubbling about the pictures. Still no detailed ones, but here is a video clip how it works: Cizilo Lights

Tuesday 11 June 2013

Cizilo is Getting Lights

 

So new week and new parts coming in.

 

DPD brought last components for my light controllers, TC4424A non-inverting power fet controller chips. Results looks so far pretty good. I have been running demo program I wrote for Arduino now few hours and the fet heat sinks are cold. And I do not mean bit warm, they are cold enough that I’m expecting the fets running on these loads without heat sinks just fine. Well this patch of the controllers can keep ‘em.

 

The light from that strip is nice. The 5050 LEDs are bright enough and the controllability is sensitive. I’m sure that these gives me just fine general light as soon as I get it all set up. It seems like a good time to start ordering some more LED-stripe.

 

First things first. I need to get the firmware of the bedroom Arduino set for controlling first set. The test program was just under 6kB which will be tight squeeze. Hopefully the fact that current firmware has all the basics imported already will save me up the space just enough to get it fitting in. Then of course altering Cizilo to provide me controls over network for those lights.

 

The TC4424A is nice chip. 2 channels and power consumption is almost non-existing. 1kOhm trimmer as voltage divider (IRF520N can take only 10v as gate voltage) gives enough power through to keep the driver working. No singing circuits/cables, no flickering and they were really easy to set up. I just put 4.7microF tantalum and 100picoF ceramic capasitors after the voltage divider and 1000 & 470microF + one of those ceramic 100picoF caps on the 12V power line on the circuitboard as well. 4k7 Ohm pull downs from inputs to ground and rest was just wiring the driver outputs to the fets and the fets to the LEDs.

 

I need 2 of these drivers for each led strips to cover all three colours. meaning I have one channel unused. Now as it seems that I do not need the heat sinks for the fets I might try to push these on single 5x7cm circuit boards. Other option is that I keep the layout I have with the first patch and leave the one side of the second board to seat Arduino Nano. It would fit perfectly and provide pretty neat package. Leonardo and Nano can both drive two sets of these controllers.

 

As a result for today I have HW set for a while and I need to focus the software side.

 

Lets see if I finally tomorrow get some pictures out. Now it’s time to get some sleep.

Thursday 6 June 2013

Cizilo - Raspberry Pi Internet Radio and Home Centre

So little base details about my radio project:

 

Hardware (current):

[Main unit]

Raspberry Pi model B rev 1

2GB SanDisk SD-card

Achme AM453B power supply

Old dvd-player (buttons and LED utilized)

Random Creative PC speakers

DS18B20 temperature sensors

Spot raster prototyping board with some homebrew electronics

 

[Satellite unit]

Arduino Leonardo

Ethernet Shield

16x2 character LCD display

More DS18B20 sensors

Breadboard to keep the connections together so far

 

The concept here is that Raspberry Pi is the control unit around this all. It controls the streams and playback, takes input from the satellite units (currently just temperature), gives commands to the satellite units and logs the temperatures. The RPi is powered by the Achme PS through the GPIO pins from that protoboard so there is no single USB connected.

 

OS running on the RPi is Arch Linux without GUI. All controls happens over HTTP API, physical buttons or ssh. There is no monitor, keyboard etc connected to it. I have MPD running and providing the audio playback functionality and playlists. That is controlled from Cizilo, homebrew python software keeping all this together.

 

Cizilo provides locking MPD client through python mpd lib wrapped in the locking class. It has also one thread controlling the hardware on the DVD enclosure, reading those buttons and controlling the led in the front panel. The HTTP API is also provided by the software and it’s utilizing simple web server from twisted. As everything so far is tied around this single piece of code I have avoided any complicated communications between different processes. If I need to split these things at some point I probably will utilise some message Q system, but so far there has been no need for it. There is no actual web page provided, but the web server just listens for the API commands and returns all values in cute JSON package. I have not planned to have web interface for this, but after all the basics have been put together I will work through Android app to have the controls transferred to my phone.

 

Current functionality is to have 3 buttons hooked up to the RPi providing short press Stop/Play, Previous item in playlist, Next item in playlist. Same buttons has also long press functionality in  same order Toggle Night mode, Volume down (5%/500ms), Volume up (5%/500ms). The software keeps track of the stream played and the volume for normal mode and night mode. Idea behind the night mode is that I prefer to have something playing through night when I’m sleeping and scrolling through the playlist for correct stream and adjusting volume was just frustrating. Now I can have my preferred stream and volume set by one button when I’m heading to bed. This also inspired me to implement alarm clock into this same interface. The alarm can be set through the HTTP API and will swap the night mode to normal mode or start playback if the state has been stopped. It also increases the volume 25% over a minute period to give bit smoother wakeup.

 

I will be doing couple of versions of those satellite units. The one I have currently running is just thermometer until I get my mosfet drivers from my supplier and get my light controls set up. It has the display so I can get some information from the RPi displayed along with the temp. I will probably put the same 3 button functions for it as the RPi has so I can control the radio from my bedroom without fiddling around with phone or laptop. The other version of the satellite unit will be black box just collecting the temperature data and controlling the lights.

 

I got my first 10m of RGB LED strip from China couple of weeks back but have had some problems to source all the rest of the components to get the light controllers running. The soul of it will be the PWM lines from Arduino together with homebrew power boards to drive the LEDs. The controls itself will be coming from the RPi and I need to extend my HTTP API to cover those as well when I get the first prototype running and see how those performs. I will get to more details when I get the components coming in. RS had the mosfet drivers on shelf so they should be coming any day now.

 

Next post will hopefully have some pictures as well how this all is getting together.