Pages

Monday, May 30, 2016

Using Filaflex to improve my cooler

Introduction


A week ago I finished my audio cooler. Although I was happy with the result improvements could be made (as is always the case). Most important I didn't particularly like the console on the side of the coolers lid. This was a 3d printed part of PLA that I glued to cooler with a superglue. This was far from ideal because of the space left between the printed console and the cooler . Another improvement could be made by the way that the speaker was fitted to the lid of the cooler. The speaker was directly attached to cooler with four screws again leaving some space between the two. I already had some FilaFlex filament but hadn't used it yet. Because of the elastic and flexible properties of Filaflex I figured that I could both fix the issues with the console and the speaker.

Left the cooler with improved speaker and console and right "old cooler" with printed part of PLA filament.

Making an improved console


I made a design in FreeCAD consisting of two parts, a bottom layer of FilaFlex that embeds the actual console. Furthermore I added two holes for machine screws to both ends of the console. This ensures a better way of attaching the console to the cooler than the superglue that I used previously. Printing the Filaflex part with my Hephestos 2 worked flawless on 235°C. I did use a lower speed than with PLA though (20mm/s instead of 50). The result is much better (see image below), with the console "sitting" on the Filaflex and the better fastening. I also find the result more pleasing to the eye (except for the color but I was out of blue filament).

New console design with the bottom layer made out of Filaflex and the top layer made out of PLA.
The new console fastened to the cooler with two machine screws. The two parts are hard to distinguish because the have the same grey color.


Making a Filaflex ring for the speaker


I designed a ring for the speaker again with FreeCAD. I gave the ring some profile so it encompasses the speaker and added three holes for the machine screws to fit through.

Filaflex ring for the speaker. The material is just perfect for this purpose because of it's flexible, even elastic nature.

The speaker sits perfectly on the ring. Haven't tried it but I bet that this construction is water tight.

Conclusion


I'm glad I had the Filaflex to improve the cooler. Besides the flexibility and elasticity the Filaflex is also very strong. I can apply a considerable force to the ring without tearing or other wise damaging it, so that's great. Also the combination of the PLA as top layer with Filaflex beneath it works perfectly in case of the console where the PLA part provides the needed rigidness and the Filaflex part seal the opening with the cooler.

Monday, May 9, 2016

Adding WiFi and audio streams to the cooler

Introduction

In my previous blog post I finished my audio cooler. It's a small cooler with a tiny audio system that nevertheless sounds good. The only way to control the audio is through a wired connection. It would be a nice addition to have some kind of remote control either by WiFi or Bluetooth. While testing the cooler I've got the idea to connect a Raspberry Pi A+, that was still unused, to the cooler and stream audio over WiFi to the Pi,with the Pi wired with the cooler. This could be useful for a garden party or BBQ where WiFi is available and I don't want to attach the smartphone to the cooler. In this blog post I'll share my experience with installation and operating the software needed for this project on the Pi.

Raspberry Pi A+ (in it's Pimoroni Pibow case)  connected with the headphone jack to the cooler. The Pi has a small Edimax Wifi adapter.

Installing MPD and MPC on the Raspberry Pi

Since I run the Raspberry Pi headless I use SSH login to the Pi. SSH is available for most operating systems with the notable exception of Windows. I already had Raspbian installed on the Pi so first I updated the OS and rebooted.

sudo apt-get update
sudo reboot -h now

Next I created a .conf file for the Edimax WiFi USB adapter. I learned from a previous project that, for a good remote connection, the sleep mode of the Edimax needs to be disabled. In the /etc/modprobe.d folder on the Raspberry Pi a file needs to be created with the name 8192cu.conf (8192cu is the name of the Realtek WiFi chip where the Edimax is based on).

cd /etc/modprobe.d
sudo nano 8192cu.conf

Add the following line in the nano editor and save the file

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

reboot again

sudo reboot -h now

Now I needed software on the Pi that allows me to remotely play (and organize) music. I installed the MPD (music player daemon) and the very lightweight MPC (music player client) and this server/client combination seemed perfect for this purpose. There are many other clients for MPD, even for Android and iOS, but for now MPC is good enough. To install MPD and MPC on the Pi:

sudo apt-get install mpd mpc

According to some sources on the internet a sound driver (sudo modprobe snd-bcm2835) should be installed on the Pi however I found it was already installed, probably with Raspbian.  This can be checked with the lsmod command.

Adding streams to a playlist

With MPD and MPC installed I'm finally able to stream a radio station from my Pi to the cooler but I needed to add stream urls of my favorite stations. In the example below I add the stream of a Dutch radio station to the current playlist.

mpc add http://icecast.omroep.nl/radio1-bb-mp3

In order to play the stream just type and the added stream starts playing

mpc play

To save the current playlist type

mpc save aplaylist

The file with the name aplaylist.m3u file is created in the folder /var/lib/mpd/playlists with the above url of a stream in it. Of course other urls can be added to the playlist. I've found this list very helpful if you're looking for (Western) European streams.

Adding music to a playlist

To create a playlist of music that is stored somewhere as mp3's just add these files to the folder /var/lib/mpd/music on the Pi. Before the files are copied however the permission of this folder has to be changed. That is done by adding write permission to the group and by changing the group to audio (which is currently root).

sudo chmod g+w /var/lib/mpd/music
sudo chgrp audio /var/lib/mpd/music

Now the mp3's can be copied. To create a playlist of these mp3's first clear the current playlist, create a new one by adding mp3 files and save the playlist.

mpc clear
mpc add /var/lib/mpd/music/my_cool_music.mp3
mpc save cool_playlist
mpc update

The last command updates the database of MPD. By adding more files the playlist increases in length. To play the playlist use the same command as above (mpc play).

Conclusion

A music or internet stream over WiFi to the cooler is a nice addition. MPD is a very stable music player with lots of different clients, perfect for these kind of projects. With MPC I can easily add streams, create playlists, play music or even store mp3's on the Pi. Unfortunately WiFi with a Pi has some downsides too. The Raspberry Pi takes up space in the cooler and it will drain the small battery fast. Therefore as a next step I'll try bluetooth because it probably adds less weight to the cooler and has less power consumption.

Yes, the Raspberry Pi with MPD is a nice addition to the cooler but it has it's drawbacks such as power consumption and added occupied space.


Sunday, May 1, 2016

Audio system for cooler finished

Introduction

A couple of weeks ago I started to make a tiny audio system for our cooler. In my previous blogpost I described all the audio components that I chose for this project. I wanted the components to be small since I didn't want to waste too much space in the cooler. With the audio components in hand I could design other parts for the audio system. I needed an enclosure for most of the audio components and a simple console to operate the audio. The parts were 3d printed with my Hephestos 2.

The complete audio system in the lid of the cooler. Most components are placed in the 3d printed enclosure.

The enclosure for the amplifier

While designing I borrowed heavily from Adafruits Trinket Neopixel led longboard, a project that upgrades a longboard with Neopixel LEDs. The battery, amplifier and Powerboost 500c had to fit into a small enclosure for protection. The enclosure needed several rectangular cavities for a switch, micro usb and wires.

Enclosure (bottom and lid) for the battery, amplifier and Powerboost 500c designed in FreeCAD.
The Powerboost 500c and the amplifier are screwed directly to the lid of the 3d printed enclosure while the Li polymer battery is pressed to the bottom by a PLA strip.

Kemo 3.5W Amplifier and Adafruit Powerboost 500c are screwed directly to the lid of the 3d printed enclosure. The battery is placed firmly under a PLA strip.
In the front the enclosure with the Powerboost and amplifier screwed to the lid. On top of the enclosure is the lock.

Attaching the enclosure to the cooler lid

I needed a simple design to attach the enclosure firmly to the inside of the cooler lid but I also wanted to be able to slide the enclosure out and back in again if necessary. Again I took an idea from the Adafruit Trinket Neopixel LED longboard . I designed a slide lock that consists of two pieces a mount and a lock. The lock slides into the mount until the stop on the lock reaches the mount.

The lock fits into the mount but can be slided in and out. Two two holes in the lock are used to screw the lock to the enclosure.

The console

I also needed some kind of console to operate the audio system. I decided to keep it simple with a 3.5mm audio plug and volume control. The on/off switch is in the enclosure (for now).

Back side of the console with the 3.5mm audio plug for audio-in and 10K potentiometer for volume control.

Preparing the cooler

Preparing the cooler is pretty straightforward. First I drilled a circular hole in the top of the lid just wide enough (68mm) for the speaker. This hole is centered on the top. Next I cut with my Dremel a rectangular hole in the side of the lid just wide enough for the console to fit. With these two holes the cooler lid was ready and all components could be attached. The speaker was screwed onto the lid while the console and the mount were glued to the lid. Glueing proved to be difficult. I tried  two-component expoxy and superglue (cyanoacrylate base) for glueing the enclosure to the cooler lid but the enclosure came loose in both events. Next I tried double-sided tape and this works however time will tell if it is a lasting solution. With most of the work done it is time to test my audio enabled cooler. Which some nice weather coming up I'll test the cooler outside and report back the results.

Circular hole in the center of the lid for the speaker to fit in.
The finished products. In the upcoming month I'll see how it performs.