Sign in to follow this  

Project .Ux - Computerised Hamster Cage

Recommended Posts

Hey everyone, I thought you might like to see one of my other, non-LEGO projects I'm currently working on...The .Ux.
The .Ux at night with both white and red running.

The .Ux is a hamster cage I've been building for the last year that has a Raspberry Pi 1 model B to manage my hamster's environment. The cage itself is made from 15mm contiboard (chipboard with plastic outter coating) and is 1500mm long, 550mm wide and 630mm high (inc wheels). The top roof is hinged at the back and the front has split doors. There are 3 LED light strips each with 3 different colour LED's, white, red and infrared. 2 of the LED strips are attached to each side wall, the centre light bar is attached to the top roof. The cage also has an Adafruit BME280 temperature/humidity/air pressure sensor which is mounted under the curved shelf in a vented ABS case. I have also fitted a Raspberry Pi Camera V2 No-IR which together with the IR cage lights, gives full night vision ability. The camera board is mounted to a second circuit board with 4 extra white and 10 extra IR LEDs which is then mounted in a custom acrylic box. I have fitted the camera with a wide angle lens to allow more of the cage to be seen and I have cut some diffusion gel to help scatter the light from the camera LEDs to help even out light distribution across the cage.

The Rasperry Pi is powered through a custom power supply rated for a maximum total of around 2.6amp at 15V but this is limited to 2amp with fast blow fuses. The transformer has 2 secondary windings, one powers the RPi and camera, the second powers everything else. The power supply, RasPi and switch board are all enclosed in a ABS case which is screwed to the left side wall of the cage. The RasPi currently controls the following:
1) Automatic cage lights, white and red lights are switched at different times of the day regardless. The IR lights only come on when the camera is running and only at night.
2) Monitors the cage temperature and reports to a log file and to the camera when temperature is outside of a given range.
3) Uses the RPi Camera board to either live stream the camera data over my local network or to record camera data to a .h264 video file to be viewed/edited later. The video output for both streaming and recording have a text annotation displaying time/date/lighting status/temp sensor data ect and is updated once every second (faster if needed).
4) Logs system events to a text file. A new file is created every day, a new folder for logs is created once per week. The temperature sensor data is also logged to this text file every 30 mintues.

Location on the controller (blue cable is a network cable going to my router).

Raspberry Pi camera V2 mounted to LED circuit board and enclosed in a acrylic case. The camera's ribbon cable and the LED's power cables run through a slot cut in the cage's side wall.

Adafruit BME280 temperature/humidity/air pressure sensor inside vented ABS case.

The cage software is designed to run automatically but the system it can be controlled remotely from my home network (PC, laptop, phone). I am building and writing the code for a User Interface module with an Adafruit SSD1306 128x64 OLED display and powered by an Adafruit ProTrinket. However getting it to have the features I want but with less than 800 bytes of free memory is my current battle.

This project is an ongoing project and is nowhere near finished, more features will be added soon which I will submit as replies to this post.

I have published the full software for this project on my Github account for you to inspect/download ect. My code is released under the GNU General Public License V3 so you can download, execute, modify and redistribute it. This software contains code written by Adafruit Industries and Dave Jones which were released under the MIT license and the GNU GPL V2 license respectively. Full details on my repo which can be found here:
(please make sure you read the README file before downloading or executing) Please note that I will NOT offer proper help or support for this software, it is up to you to get it working on your setup. I have included "-no-sensor" versions of my streaming and recording software, these could be useful if your building a robot/rover, Dash-Cam or CCTV system.

Left hand side.

Right hand side.

Hope you like it.

Share this post

Link to post
Share on other sites

Bet the little buggers will love it, loads of fun for them. The only problem I can see is it might be a bear to clean. Anyway looks good and they have plenty of sticks and cardboard to chew up. The electronics are over the top and was probably not so easy to integrate so the rodents won't chew through. 

Share this post

Link to post
Share on other sites

I already have a Syrian hamster, Archimedes (or my ickle fluff-ball) (see below), I got him on the 27th Feb 2018. I can't ask him directly of course but he seems to love it. Compared to the cage/tank he was in at Pets@Home, this cage miles bigger and better. He seemed lost in it when I first got him but now he loves running around, climbing over everything ect :D.
On the contrary, it is really easy to clean out. I only do a full clean out ever 6-8 weeks with spot cleans every couple of days (full cleanouts weekly causes more harm than good ad it is very stressful for hamsters and it can cause wet-tail which is deadly). Archimedes is litter trained so his cage doesn't get "dirty" so once every 6-8 weeks is about ideal for this type of cage. The acrylic panels at the front take less then 10 seconds to remove so once I remove his toys, remove the top layer of bedding/substrate which gets binned and remove the bottom layer which gets saved and reused, I then remove the acrylic panels and use a dustpan and brush to sweep up the rest of the finer particals of bedding, wipe the cage down with warm water with a drop of washing up liquid and then put everything back it. The bottom layer of bedding removed earlier gets mixed with fresh bedding. Reuseing the bottom layer of bedding will have his scent on it which mimimizes stress but also makes it cheaper (although a 20KG bag is only £10.85 and lasts for around 3 full cleanout) and more eco-friendly. It does take a while due to the size of the cage but it is really easy.
The electronics indeed are over the top but there are reasons behind my madness. For example, torpor (a hibernation like state triggered by temperatures below about 15°C) can kill a hamster really quickly and since I prefer to use a hot water bottle to warm myself up in the winter rather than turning on really expensive night store heaters, the temperature sensor allows me to know the exact temperature so I can take action before it drops too far by either a turning on the heating or putting a hot water bottle wrapped in a towel under the cage.
Most of the wiring is outside of the cage and runs through trunking at the back and left side to prevent Archimedes from being able to access it. The wiring that is inside the cage only runs at around 5VDC and is protected by a fast blow fuse which would blow within 50 milliseconds of a fault. The lighting circuits for example only draw between 30-50 milliamp depending on the colour. At that voltage and current, it is highly unlikly to cause any harm if he did chew through the light bars. The temperature sensor and can camera are not accessable but again only run at 5VDC (sensor chip runs at 3.3V with 3.3V logic, the board has level shifting built in). There is more chance of a static discharge from me picking him up than him being harmed or killed by the cage's electical system if he were to chew any internal wiring. I inspect the light bars, sensor and camera cases every night for any damage and I see any, I can turn the system off untill I fix or replace what he's chewed. I would then put olive oil on the replacement to deter him from chewing it again (olive oil is safe but hamsters hate the taste of it). I also have an emergency stop button that I can punch if I see him chewing anything he's not meant to either first hand or via the camera.

One of my favorite photos of him playing in his spider plant.

Edited by MxWinters

Share this post

Link to post
Share on other sites

Very cool!  Have you done any experimenting with Archimedes' response to different colored lighting?  From what I've read they seem to be mostly colorblind but with great night vision.

Share this post

Link to post
Share on other sites

Thanks :classic:
He only reacts when I turn the white lights on as he can then see properly but not the to red or IR lights, hamsters can't really see red light and infrared light is invisible to them, I can flash the IR lights and he doesn't notice them turning on/off. The white lights are currently activated between 1000 and 1730. Outside of this range, I turn the white lights on when I go into my bedroom to play with him, when the white lights fade up during darkness, he knows it's playtime and he's sat near the front doors waiting for me. If I did the same with the red or IR lights, he just continues his hamstery business until he hears me opening the door.
As for "experimenting", no I try to avoid messing around with the lighting too much so I don't stress him out. The computer and the switch board can handle rapid changes (the switch board uses 1x 2N3706 NPN and 1x 2n3704 PNP transistors per switch channel which can switch up to 100MHz (in total there are 6x transistor switch channels plus 1x 230VAC relay via a 2N3706 although the relay is currently not connected to anything)). When the LED's are fading up and down, the RasPi currently pulses at 120Hz which is faster then the human and hamster eye can register (note that the code I published is the basic core software, it is different to the code that the computer is currently running). As for other colours such as blue, pink, green ect, I tried it once with my LED parcan stage light but he didn't seem to react, but I didn't play do any kind of proper light show for him, again I don't want to stress him out.
Technically hamsters have poor eye sight but their eyes have wide angle lenses which allows more light to enter the eye and allows them to see better in darkness compared to humans. They use smell, sound/vibration and their whiskers as their main senses. Indeed they are pretty much colourblind, its one reason I haven't painted the inside on the cage, it seems pointless when he only sees grayscale plus if he chews the ice lolly sticks for example, said paint may get ingested and regardless of how "non-toxic" a given paint claims to be, paint isn't something that should be eaten.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.