Introduction: Aquarium Diorama With Ledstrip
Please find links: http://onsnatuurgenot.nl/aquarium/diorama.htm
Why this project
Before the Fish Feeder project I build a diorama for my aquarium. My diorama is a scenery outside and behind the aquarium. Benefits of this type diorama are:
- No space inside the aquarium is used
- It is easy to change the scenery
- No algae will grow on the surface
- It will not interact with the water
- You need to maintain a algae-free glass to see the diorama
Step 1: Components
The main components are:
- a nice picture
- Raspberry Pi
The frame has an angled rear wall. A picture will be be attached to the rear wall. The led strip will shine on this picture. The result is an aquarium with an interesting feeling of depth.
In this project all the components are build on the fly. For now I am satisfied with the result, but of course you are free to adjust to your own needs.
Building key points:
- To disperse the heat of the led, glue the led strip to an aluminum frame. The aluminum frame is made of a screen door. Check if this frame fits in the laminate flooring groove. See chapter “Building a frame” and “Building led strip”
- Use a ledstrip with all colors in a single SMD, see “Building a led strip”
Step 2: Building a Frame
The frame has an angled rear wall. All of the frame is made from scrap wood.
- Big wooden tent pegs 2x
- Side panels 2x
- Laminate flooring
- Wood glue
Measure the height of your aquarium to determine the height of the side panels of the frame. I had to make some cut-outs to provide room for the aquarium-cover and ledstrip.
Measure the width of your aquarium, subtract the thickness of the side panels, and you have the right length of rear laminate panels.
Use the pegs to angle the rear laminate panels. Glue the pegs to the side panels. Clamp carefully and wait a day to be sure that the glue is fully dry. The laminate is often foreseen with a “plastic” layer on which wood will not attach. Partially grind off these layers the give the glue some decent grip on the laminate. Wait another day for the glue to dry.
Laminate has a tongue and groove. Position the groove to the upside to accommodate the ledstrip, see next step!
Step 3: Building a Ledstrip
Be sure to use SMD5050 and not a SMD3528 ledstrip. The SMD3528 has separate red, blue and green leds. These three colors are clearly visible on your diorama. A SMD 5050 ledstrip has all colors incorporated in a single SMD and has a nice single colour.
- The main component is a ledstrip (in my case 1m) which is dimmable , with remote connector and has a self-adhesive layer
- 44 button remote controller
- power supply
- Grey pvc pipe
- Aluminum screen door
Before starting in building the ledstrip verify if the ledstrip is fully functional.
Use a small dremel grinder to grind a U-profile out of the aluminum door frame. In my case one side was ~20mm, topside ~20mm, other side ~10mm. The 20mm side is to cover the ledstrip to avoid direct sight of the bright leds. The 20mm top is to glue the ledstrip. The 10mm side slides into the groove of the laminate. In my case I ordered a 1m ledstrip which was too long. You can decide to shorten the ledstrip (when ordering the ledstrip verify if this is possible). The extra length can be housed inside the pvc-tube which can be mounted on the side of the frame.
The attached pictures show the first test run with the power supply connected and manually controlled with the remote control. Check if the result is according your liking.
Step 4: Picture
I used Gimp https://www.gimp.org/ to compose a picture, every other program is fine. Gimp is a free and open source program, it’s a bit difficult to learn, there a tutorials available, can handle large files, layers and has plenty of tools available. Be aware of the size of your picture, about 500MB. There are many other possibilities like a painting, sketch or whatever you like.
If you use a picture:
Please verify the licenses before you use these photo’s.
The width of the aquarium is 80cm, the heigth of the aquarium is 45cm. My aquarium has an internal filter, so the internal width is 70cm. For the picture the closest size is 75x50cm on photo-quality paper. I like this quality because it is a bit sturdy and not so fragile.
The size of the picture in your computer is 75x45, use 300dpi for a nice quality.
- The width of your picture is 750mm / 25,4mm/inch * 300dpi = 8858pixels
- The height of your picture is 450mm / 25,4mm/inch *300dpi = 5315pixels.
To attach the picture to the frame use double sided tape.
Because you can slide the frame sideways you have access to your picture so it’s very easy to adjust the picture. Be aware of the ledstrip and other cables that there is no interference.
Step 5: Schematics (connecting to Raspberry Pi)
The ledstrip receives commands from an infrared remote controller. The raspberry pi can be used to send infrared commands. The hardware and software is after an example on this site, see links: https://www.hackster.io/duculete/ir-remote-with-raspberry-pi-d5cf5f
Note: In this schematic the resistor R2 is replaced by a red led. Because of the red led on the breadboard you can see that commands are sent. A single infrared led is used to send the infrared signals. Also you can see the IR-led with a camera.
- Raspberry Pi
- Red led
- IR led emitter 940nm 5mm
- Transistor 2N2222 / BC547 / or equal
- Resistor 220Ohm
- Extension cord e.g. 3.5mm phone plug
- Bread board
- Jumper wires
Build the schematic on the breadboard and use the jumper wires to connect the schematic to the Raspberry Pi. The IR led is connected to the extension cord. This way your Raspberry Pi can be put in a place away from your aquarium (water).
For electrical safety always use a water drip loop!
To avoid interference in the receiver by other remote controllers the receiver is also housed inside the PVC-pipe on the side of the frame.
Step 6: Lirc
Now your Raspberry Pi is ready to send the IR signal by switching ON/OFF GPIO17. But how does it know HOW to send?
Setting up Lirc
“ LIRC is a package that allows you to decode and send infra-red signals of many (but not all) commonly used remote controls.”, see link http://www.lirc.org/
Install Lirc on your Raspberry Pi
sudo apt-get install lirc
Add the following lines to /etc/modules
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
Add the following lines to /etc/lirc/hardware.conf
# Arguments which will be used when launching lircd
# Don't start lircmd even if there seems to be a good config file
# Don't start irexec, even if a good config file seems to exist.
# Try to load appropriate kernel modules
# Run "lircd --driver=help" for a list of supported drivers.
# usually /dev/lirc0 is the correct setting for systems using udev
# Default configuration files for your hardware if any
Reboot your Raspberry PI
Now your Raspberry Pi is ready to send the IR signal by switching ON/OFF GPIO17. But how does it know WHAT to send?
There are 3 possibilities:
- On the website of Lirc there is a database available with remotes, common lircd.conf files are available. Put that file in folder
- On this website https://github.com/zl4bv/led_webserver/blob/master/lircd.conf. I found a working configuration file, unfortunately his blog is not available. The only thing is to re-order colors and commands.
- There is no configuration file available, so you have to make your own. Follow this link: https://www.instructables.com/id/Raspberry-Pi-Universal-Remote/step3/Making-LIRC-files/
Put your configuration file in the folder /etc/lirc
Reboot your Raspberry Pi and you are ready to go.
Step 7: Program & Result
In my case I wanted to simulate a sunrise with the ledstrip before the TL-lights were turned on and a sundown before lights were turned off. The timer power switch for the TL-lights is manually programmed and is not controlled by the Raspberry Pi.
The sunrise is programmed 2 minutes before the TL-lights are turned on, also the sundown is programmed 2 minutes after the TL-lights are turned off.
On day 1 to 10 of the month a blue color is turned on to simulate the light of the moon (moonrise and moondown). This feature can be left out.
To run this program:
- Copy the file to the home folder and put it i the desktop folder /home/pi/desktop
- Open a terminal
- pi@raspberrypi ~ $ python3 /home/pi/desktop/20151120_IR_4.py
Thoughts for a better design
- Add a LDR sensor to sense if the TL lights are turned on/off
- Use a remote powerswitch
We have a be nice policy.
Please be positive and constructive.