Ilujo Hack & Tech Blog

To content | To menu | To search

Tag - Raspberry Pi

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.

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

Hi,

 

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,

Jokke

 

* http://www.techrepublic.com/blog/security/hacker-vs-cracker/1400

** http://www.aliexpress.com