AVS Forum banner
1 - 15 of 15 Posts

·
Registered
Joined
·
148 Posts
Discussion Starter · #1 ·
Hi All,
I've designed and built a new all aluminium case for the RPi2 B and wanted to check interest here in such a case if I were to sell the design and list of components online, or mass produce it as a completed unit and sell it.

It started out as just a personal project as there isn't a case like this in the market and I thought maybe others would like it?
I designed and built it to run JRiver Media Center to have a portable bit perfect audio player that can run headless without any monitors etc. (JRiver has an experimental build for Arm out that I've been using which may also get video support in the future if they follow what's been done for the Linux build)


It would suite anyone wanting an all in one media player that has internal HDD and optional rechargeable battery.


It's not much bigger than a standard Pi case, however it has:
An internal lithium ion rechargeable battery with about 5-6hrs of charge. (maybe more I still haven't formally timed it, it's at least 5hrs)
A slot removable HDD up to 2TB 9.5mm (or SSD and will take the thinner 7.5mm drives too).
All the USB, Ethernet, HDMI and power ports on the rear.
Headphone/Lineout on the front. (ok I know the standard analog out isn't great but it's usable for non critical listening)
Power LED and switch on the front.
You can plug the HDD into a computer as a standard USB 3 Drive to load it up with content.
The HDD is removable through a slot without disassembling the case.


It's still in prototype stage but it's 95% complete and will have a few other changes in the final version;
More GPIO controls and buttons to control the media player.
Reboot and shutdown button.
Restart media player button.
Maybe an internal 2ch DAC if I can workout how to fit one.
A better heatsink and passive cooling design.
Battery LED charge/charging status.


Still a couple of cables to sort out for HDMI and a micro SD card ribbon extender to relocate the SD card so you can get to it without taking it apart.
Still have to finish the rear panel.


It's all aluminium to help dissipate the heat and to give that solid feeling you just cant get with plastic.
I'm going for the FiiO look and it actually looks pretty good even in it's raw aluminium state but it will be either painted or anodised black with a brushed metal finish.


I've been developing this for a few weeks since the RPi2 came out and it works well as a desktop media player or in the car, or just outside paired with a BT speaker or DLNA renderer. (or streaming bit perfect 96/24 FLAC to your iPhone/Android with JRemote via wifi personal hotspot or via a portable USB DAC such as the FiiO E17)


So what are peoples thoughts?? Would you buy one completely assembled, or as a kit, or the specs and plan to build it yourself?


Demo




 

·
Registered
Joined
·
148 Posts
Discussion Starter · #2 ·
Not much to report. The Pi2 and case has been working really well the last week. I'm getting between 5-7hrs out of the battery and it doesn't get too hot even after 4hrs of continuous play.


I did rewire power yesterday so now it has uninterrupted power capability. I can have the power plugged in, switch to battery and vice versa, without powering down.
This is handy in the mobile context where I use it at home, in the car and in the office. When ever I've got power available I can switch over to mains and charge the battery and then go back to battery. It's not automated yet but it can be with a little more work. For the moment I still have to remember to switch the battery on or off, but it's great to have the portability with continuous playback.


I've got really short 10cm/4" USB 3 HDD cables and SATA to USB dongles on the way for the HDD which will tidy the back ports a little more. They should arrive mid week.
This week I'll finalise the design for the LED's, RTC, switches and power circuit. I've decided to leave the playback controls out for now as I've been using JRemote to control it just fine and I've never missed having controls on the case.

I'll still include a discrete minimalist shutdown button and restart MC20 button though. The power LEDs will indicate whether it's on mains or battery and there'll be battery level indicators too.


Oh and I milled the lip off the back of the case now so the HDD can slide in and out without having to take the unit apart.
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #3 · (Edited)
Still waiting on a few more small pieces of the puzzle but the new powersupply works really well.
The internals are very nearly finished now.
I don't get any power brownouts at all any more with the new power circuit and I can plug and unplug the power without rebooting and it automatically charges when plugged in.
I got a new 4A 5V powerpack shipped with the internal power circuit with an inline switch too. :)
I finished working on my GPIO control scripts and have a single button to restartMC, reboot and shutdown. The LED shows when its finished booting and turns off to show when it safe to turn off the main power switch. I have it all assembled and working and will make a new video demo tomorrow.
Things left to do:
A couple better smaller switches.
A better smaller LED.
Fit the realtime clock somewhere.
Fit a battery level indicator somewhere.
Still waiting on my super thin HDMI cable.
Still waiting on delivery of some super short micro USB3 HDD cables.
Make a back panel.
Smaller rubber feet.
A paint job.


PS. I'm using this several hours every day in the car and in the office and it hasn't missed a beat going between the office and the car without having to reboot.
I love it!



 

·
Registered
Joined
·
148 Posts
Discussion Starter · #4 ·
Here's the new look with combined switch and Blue LED ring.





Here's the rather crowded looking internal shot with most of the wiring done.




Only a few things left to do.
I have to fit and wire the RTC and battery indicator and there's still some space left believe it or not! I may even be able to fit an I2C DAC with analog out.
Im still waiting on my HDMI cable. :(


I like the switch with the blue circle led so much Im going to replace the power switch and green LED with another combined green LED main power switch.


Please excuse the bluetac holding things in place. It is a prototype after all. :)
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #6 ·
I went with red LED main power switch, I didn't like the colour of the green. It's slightly recessed as it's an instant momentary on/off power button that I don't want to accidently turn it off.
In the final prototype I'll recess the blue LED switch the same as the red one, though that's not as important as you have to hold the centre button for at least 2 secs to trigger anything.


The photos don't do it justice, they're a really nice crisp blue and red.


Power on and still booting up



Booted up
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #7 ·
A few overdue updates on progress, Ive been busy learning scripting and sorting out the battery circuit.


;D pi M8888T



The short micro USB3 to USB and SATA to USB cables arrived.
Looks a bit tidier now.
Micro USB3 to USB




SATA to USB


 

·
Registered
Joined
·
148 Posts
Discussion Starter · #8 ·
I got the sparkfun Lipo fuel gauge working with the Adafruit_I2C scripts on the Pi with the Adafruit USB charger. Should work with the Solar charger too.
It was pretty simple. Hook up the fuel gauge SDA (data) and SCL (clock) to Pi pins 3 (SDA) and 5 (SCL).
Charger Battery terminals connected to the JST on the fuel gauge.
Here it is measuring a very slow charge while the Pi is running with an almost flat battery.
First without power plugged in you can see it discharge and then with power plugged in, very slowly charging.
I installed the Adafruit I2C scripts and libraries and the fuel.py script from here> https://bitbucket.org/widefido/fuel/src
Code:
[email protected] ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C $ sudo python fuel.py
estimated time left: 0h 0m 0s (1.27%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.17%)
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.10%)
estimated time left: 0h 0m 0s (1.10%)
estimated time left: 0h 0m 0s (1.10%)
estimated time left: 0h 0m 0s (1.08%)
estimated time left: 0h 0m 0s (1.05%)
estimated time left: 0h 0m 0s (1.07%) **charging**
estimated time left: 0h 0m 0s (1.07%)
estimated time left: 0h 0m 0s (1.08%) **charging**
estimated time left: 0h 0m 0s (1.08%)
estimated time left: 0h 0m 0s (1.10%) **charging**
estimated time left: 0h 0m 0s (1.10%)
estimated time left: 0h 0m 0s (1.12%) **charging**
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.12%)
estimated time left: 0h 0m 0s (1.13%) **charging**
estimated time left: 0h 0m 0s (1.13%)
estimated time left: 0h 0m 0s (1.13%)
estimated time left: 0h 0m 0s (1.15%) **charging**
estimated time left: 0h 0m 0s (1.15%)
estimated time left: 0h 0m 0s (1.15%)
estimated time left: 0h 0m 0s (1.15%)
estimated time left: 0h 0m 0s (1.17%) **charging**
estimated time left: 0h 0m 0s (1.17%)
estimated time left: 0h 0m 0s (1.17%)
estimated time left: 0h 0m 0s (1.18%) **charging**
estimated time left: 0h 0m 0s (1.18%)
estimated time left: 0h 0m 0s (1.18%)
estimated time left: 0h 0m 0s (1.18%)
estimated time left: 0h 0m 0s (1.18%)
estimated time left: 0h 0m 0s (1.20%) **charging**
estimated time left: 0h 0m 0s (1.20%)
estimated time left: 0h 0m 0s (1.20%)
estimated time left: 0h 0m 0s (1.20%)
estimated time left: 0h 0m 0s (1.20%)
estimated time left: 0h 0m 0s (1.20%)
estimated time left: 0h 0m 0s (1.21%) **charging**
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
estimated time left: 0h 0m 0s (1.21%)
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #9 ·
I got the battery shutdown script working!
I didn't even need to use a GPIO it's all scripted to take the measurements from the fuel gauge board over the I2C bus. I've even got it all running in just one script now.
Because I can take accurate battery measurements now I can script actions at any voltage and I can trigger different led flashes for low battery and critical battery as well as the shutdown.
That's next. :) (along with play and pause toggle on the main button)
------
[email protected] ~ $ sudo ./gpio.py
Battery OK: 3.8119 volts
Battery OK: 3.8119 volts
Battery OK: 3.8119 volts
Battery Lo: 3.7045 volts - Checking for 20 seconds: 0
Battery Lo: 3.7045 volts - Checking for 20 seconds: 1
Battery Lo: 3.7045 volts - Checking for 20 seconds: 2
Battery Lo: 3.7032 volts - Checking for 20 seconds: 3
Battery Lo: 3.7032 volts - Checking for 20 seconds: 4
Battery Lo: 3.6996 volts - Checking for 20 seconds: 5
Battery Lo: 3.702 volts - Checking for 20 seconds: 6
Battery Lo: 3.702 volts - Checking for 20 seconds: 7
Battery Lo: 3.702 volts - Checking for 20 seconds: 8
Battery Lo: 3.702 volts - Checking for 20 seconds: 9
Battery Lo: 3.702 volts - Checking for 20 seconds: 10
Battery Lo: 3.702 volts - Checking for 20 seconds: 11
Battery Lo: 3.702 volts - Checking for 20 seconds: 12
Battery Lo: 3.7008 volts - Checking for 20 seconds: 13
Battery Lo: 3.7008 volts - Checking for 20 seconds: 14
Battery Lo: 3.7008 volts - Checking for 20 seconds: 15
Battery Lo: 3.6996 volts - Checking for 20 seconds: 16
Battery Lo: 3.6996 volts - Checking for 20 seconds: 17
Battery Lo: 3.6996 volts - Checking for 20 seconds: 18
Battery Lo: 3.6996 volts - Checking for 20 seconds: 19
Battery Lo: 3.6996 volts - Checking for 20 seconds: 20
Battery Low For More Than 20 Seconds Shutting Down:
Broadcast message from [email protected] (Tue May 5 20:45:17 2015):
System halted by Low Battery Alert
The system is going down for system halt NOW!
Battery Lo: 3.6996 volts - Checking for 20 seconds: 21
Battery Low For More Than 20 Seconds Shutting Down:
Broadcast message from [email protected] (Tue May 5 20:45:18 2015):
System halted by Low Battery Alert
The system is going down for system halt NOW!
Battery Lo: 3.6605 volts - Checking for 20 seconds: 22
Battery Low For More Than 20 Seconds Shutting Down:
Broadcast message from [email protected] (Tue May 5 20:45:19 2015):
System halted by Low Battery Alert
The system is going down for system halt NOW!
---------
Here's the cleaned up script with the battery monitor set for 3.2v - my scripting is getting a little tidier. :)
Code:
#!/usr/bin/env python2.7
from time import sleep
import os
import subprocess
import RPi.GPIO as GPIO
import fuel
BUTTON1 = 17 # GPIO channel 17 - RestartMC/Shutdown/Reboot
LED1 = 26 # GPIO channel 26 - Power LED
#BATTERY1 = 23 # GPIO channel 23 - Low Battery
POWEROFF1 = 22 # GPIO channel 22 - Power off kill switch

GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(LED1, GPIO.OUT, pull_up_down=GPIO.PUD_UP)
GPIO.output(LED1, 1)
GPIO.setup(BATTERY1, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(POWEROFF1, GPIO.OUT, pull_up_down=GPIO.PUD_DOWN)
fuel.writeAlertThreshold(5)

def button_action(BUTTON1):
    print('Button press = negative edge detected on Button %s'%BUTTON1)
    button_press_timer = 0
    while True:
            if (GPIO.input(BUTTON1) == False) : # while button is still pressed down
                button_press_timer += 1 # keep counting until button is released
            else: # button is released, figure out for how long
                if (button_press_timer > 7) : # pressed for > 7 seconds
                    print "long press > 7 : ", button_press_timer
                    # do what you need to do before halting
      subprocess.call(['sudo reboot &'], shell=True)
                elif (button_press_timer > 3 < 7) : # pressed for > 3 < 7 seconds
                    print "medium press > 3 < 7 : ", button_press_timer
                    # do what you need to do before rebooting
      subprocess.call(['./RestartMC20.sh & echo "Killing MC20" &'], shell=True)
                elif (button_press_timer > 1 < 3) : # press for > 1 < 3 seconds
                    print "short press > 1 < 3 : ", button_press_timer
                    # do what you need to do before restarting mediacenter20
      subprocess.call(['shutdown -h now "System halted by GPIO action" &'], shell=True)
  button_press_timer = 0
            sleep(1)
def battery_monitor():
    batt_timer = 0
    while True:
      if (fuel.readVCell()) >= 3.2: #check battery voltage
                #print("Battery OK: {0} volts".format(fuel.readVCell()))
                batt_timer = 0
     else: # batt is low
            print "Battery Low: {0} volts".format(fuel.readVCell()), "- Checking for 20 seconds: {0}".format(batt_timer)
         batt_timer += 1 # keep counting
            if (batt_timer > 20) : # batt low for > 20 seconds
          print "Battery Low For More Than 20 Seconds - Shutting Down: "
                subprocess.call(['shutdown -h now "System halted by Low Battery Alert" &'], shell=True)
         sleep(1) 
GPIO.add_event_detect(BUTTON1, GPIO.FALLING, callback=button_action, bouncetime=200)
#GPIO.add_event_detect(BATTERY1, GPIO.FALLING, callback=battery_monitor, bouncetime=200)
try:
    while True:
        sleep(5)# sleep and do the battery monitor loop
        battery_monitor()
except KeyboardInterrupt:
    GPIO.cleanup()       # clean up GPIO on CTRL+C exit
GPIO.cleanup()           # clean up GPIO on normal exit
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #10 ·
AND Got my Play/Pause button working. :)
Updated main script
Code:
#!/usr/bin/env python2.7
from time import sleep
import os
import subprocess
import RPi.GPIO as GPIO
import fuel
BUTTON1 = 17 # GPIO channel 17 - RestartMC/Shutdown/Reboot
LED1 = 26 # GPIO channel 26 - Power LED
#BATTERY1 = 23 # GPIO channel 23 - Low Battery
POWEROFF1 = 22 # GPIO channel 22 - Power off kill switch
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(LED1, GPIO.OUT, pull_up_down=GPIO.PUD_UP)
GPIO.output(LED1, 1)
#GPIO.setup(BATTERY1, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(POWEROFF1, GPIO.OUT, pull_up_down=GPIO.PUD_DOWN)
fuel.writeAlertThreshold(5)

def button_action(BUTTON1):
    print('Button press = negative edge detected on Button %s'%BUTTON1)
    button_press_timer = 0
    while True:
            if (GPIO.input(BUTTON1) == False) : # while button is still pressed down
                button_press_timer += 1 # keep counting until button is released
            else: # button is released, figure out for how long
                if (button_press_timer > 7) : # pressed for > 7 seconds
                    print "long press > 7 : ", button_press_timer
      subprocess.call(['sudo reboot &'], shell=True)
                elif (button_press_timer > 4  4  4  2  2  0  0 = 3.2: #check battery voltage
                #print("Battery OK: {0} volts".format(fuel.readVCell()))
                batt_timer = 0
     else: # batt is low
            print "Battery Low: {0} volts".format(fuel.readVCell()), "- Checking for 20 seconds: {0}".format(batt_timer)
         batt_timer += 1 # keep counting
            if (batt_timer > 20) : # batt low for > 20 seconds
          print "Battery Low For More Than 20 Seconds - Shutting Down: "
                subprocess.call(['shutdown -h now "System halted by Low Battery Alert" &'], shell=True)
         sleep(1) 
GPIO.add_event_detect(BUTTON1, GPIO.FALLING, callback=button_action, bouncetime=200)
##GPIO.add_event_detect(BATTERY1, GPIO.FALLING, callback=battery_monitor, bouncetime=200)
try:
    while True:
        sleep(5)# sleep and do the battery monitor loop
        battery_monitor()
except KeyboardInterrupt:
    GPIO.cleanup()       # clean up GPIO on CTRL+C exit
GPIO.cleanup()           # clean up GPIO on normal exit
the play/pause script using xdotool
Code:
#! /bin/bash
sudo su -c "DISPLAY=:0 xdotool key XF86AudioPlay" pi
 

·
Registered
Joined
·
3,228 Posts
Although I have no need for such a device, since I don't go anywhere anymore...

I'd just like to say that the 'do it yourself' part of me is quite impressed with your ability to put something like that together.
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #12 ·
Although I have no need for such a device, since I don't go anywhere anymore...

I'd just like to say that the 'do it yourself' part of me is quite impressed with your ability to put something like that together.

Thanks appreciate the encouragement. I guess that's whole point of the opensource hardware/software and the popularity of the Pi and Arduino. There's so much that can be done that used to be the domain of specialist engineers in the big electronics and tech companies. It's not too much of a stretch of the imagination to see this launched as viable portable media player/server even with a touch enabled OLED display.
 

·
Registered
Joined
·
3,228 Posts
There's so much that can be done that used to be the domain of specialist engineers in the big electronics and tech companies.
I lived through that in Telecom, as commodity chipsets and transceivers and microprocessors (along with a big dose of deregulation) turned that business upside down.

Here's the last machine I worked with at NEC. 1998, 40gigabit optical core switch for national ATM (Asynchronous Transfer Mode) networks. This one went (with me) to Sprint Labs.



Here's a firmware engineer's desk for some piece of it:

 

·
Registered
Joined
·
148 Posts
Discussion Starter · #14 · (Edited)
I've nearly finished the revision to the prototype. I'll finish in the morning just before I go to the Sydney Audio meet.
New circuit board mount.
20150815_104807305_iOS by Hilton, on Flickr


20150815_104824342_iOS by Hilton, on Flickr
20150815_131658850_iOS by Hilton, on Flickr
I cut some tin sheet to make the internal mount.
20150815_105006407_iOS by Hilton, on Flickr
It lives! :eek:
20150815_130547014_iOS by Hilton, on Flickr
20150815_130555372_iOS by Hilton, on Flickr
20150815_105024639_iOS by Hilton, on Flickr
20150815_133017822_iOS by Hilton, on Flickr
20150815_133028833_iOS by Hilton, on Flickr
20150815_133059852_iOS by Hilton, on Flickr
 

·
Registered
Joined
·
148 Posts
Discussion Starter · #15 · (Edited)
Here's the finished product.
I still have to do a sand and one more coat of paint. It was a quick rough coat friday night and I've already chipped the paint with the revisions I was making last night.
At the audio meet today I had 4 people ask to audition at their place on their system and two people wanted to part with cash to get one. :) (out of about 35 people and I didn't speak with everyone)
IMG_5827 by Hilton, on Flickr
20150816_084917070_iOS by Hilton, on Flickr
20150816_084935656_iOS by Hilton, on Flickr
20150816_084950010_iOS by Hilton, on Flickr



A gratuitous shot of my Pi Brick flanked by FiiO E09k headphone amp and E17 DAC, Acer Iconia Tab 8 running JRemote and iPhone 6+ running JRemote and Klipsch Image One HeadPhones. :)
One happy little digital (JRiver) family. ;)
IMG_5822 by Hilton, on Flickr
 
1 - 15 of 15 Posts
Top