Ilujo Hack & Tech Blog

To content | To menu | To search

Tag - Hacking

Entries feed - Comments feed

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.

New Piece in the Puzzle


It has been quite a while quiet in my documentation as I have been travelling and working on my day job a lot lately. So let’s catch up with the latest.


First of all I got new addition to my digital tool belt few weeks ago. TBS2700 Hamlet Android Tablet. I purchased it with the idea that if it does not perform by my expectations I will just use it as 7 inch remote controller for my apartment. Well not going to happen that it would be dedicated. This beast is really impressive with it’s  1280x800 IPS screen, 4 core cpu, dual core gpu and in normal use easily 7-8 hrs of battery life. I haven’t touched my laptop too much since as the tablet is just convenient enough to do the daily surfing, tweeting and news reads.


There was a good deal for it in aliexpress* and got just under $120 delivered with 8gig extra memory card.


Only the firmware of this TBS2700 did not impress me too much. The apps manufacturer thinks everyone wants to use no matter what was something I really couldn’t agree. So fw upgrade package from tbs** website and I started to poke around. I got the tablet couple of times hanging at the boot and not coming up again, but fortunately the FW flash still worked. So I just dropped next try in and couple of hours of trial and error I finally got the vendor apps cleaned and some of my own into the FW bundle.


Yesterday I was shopping in local Woodie’s*** and got some things to improve my project. Nothing special just a table lamp (which will be cannibalized and instead being mains powered, I’ll fit that with the led stripe as well), 18V cordless drill and some fittings to get stuff hanging on the walls.


At the same trip I also visited D.I.D Electrical**** and got one TP-Link TL-WR841N wireless router. It seems that plain old switches are hard to come by nowadays. No worries, that is running OpenWrt***** already and will be serving my project network in future.


I’m also a bit in shortage of components and have been waiting some bits and pieces from China now almost a month. Today the tracking info gave me bit a light at the end of the tunnel as next 20m of the RGB led strip has arrived this morning to Dublin. Expecting having them tomorrow then.







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.

Friday 31 May 2013

Time to Start Documenting My Projects



I have been interested about technology and electronics since I was kid. I think I did not have a single electronic toy that was left unassembled during their lifetime. To be honest quite a few of them did not survive that operation either. Then I got into programming. Basic, Pascal, Delphi, etc. has been familiar at the times and forgotten as well.


I’m a hacker and nerd. I’m also proud to admit it. Don’t get me wrong, hackers and hacking has got really bad reputation due to misuse of those terms. There is great article covering this in TechRepublic* so I will not go into it over here.


I was thinking that it would be great to start hacking stuff again for a long time but the final trigger was when I got my first Raspberry Pi. The potential of GPIO pins in that little cheap computer got me thinking. I realized that I have old DVD player collecting dust. I had not used it since I moved to BluRay and sold all my DVDs. It had perfect power supply, plenty of room for custom electronics and some buttons and leds to use as user interface. I cannibalized that, hooked up the buttons to my RPi, used some connectors from it and built up a Internet radio for myself. You will be able to find more about that project in near future.


Suddenly I got really hungry. I realized what all I can do with it to get my mind out of work. I also noticed that the GPIO availability in RPi was not even close to what I needed to advance my radio to home centre. Obvious choice to fix that was to get Arduino next to it. So I got myself couple of them and started to play around.


Honestly even the basic components are cheap the amount of tools, bits and pieces you need eats significant amount of money. Of course you can save a lot by cannibalizing old junk what you have lying around but you always need something. I thought that as most of the electronics comes from China anyways, why should I pay for someone else to source it for me. Aliexpress** has proven to be really good place to source most of that.


I hope you get some ideas and inspiration for your own hacks when this blog gets some more content. Please don’t hesitate to give feedback to any of my posts.


Happy Hacking,