documentation

This commit is contained in:
tilman
2017-01-12 19:46:53 +01:00
parent 811ee83660
commit 8253bef383
6 changed files with 229 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

+11 -2
View File
@@ -174,14 +174,14 @@ h2, h3 {
<li>Pimoroni PHAT DAC</li>
<li>ultra-cheap <a href="images/micro-usb-hub.jpg">Micro USB HUB with ethernet port</a></li>
<li>even cheaper <a href="http://www.penguin.cz/~utx/hardware/USB_Camera_AX2311/">USB webcam</a></li>
<li>Round Acrylic glass 2 mm, 75 mm diameter. You can order these on ebay.</li>
<li>2 mm acrylic glass circle with 75 mm diameter. You can order these on ebay.</li>
<li>5 &times; M2.5 screws for the Raspberry Pi and the case</li>
<li>
Electronic components:
<ul>
<li>3 &times; 12 mm momentary push buttons</li>
<li><a href="http://www.vishay.com/docs/83751/cny70.pdf">CNY70 reflective optical sensor</a></li>
<li>Resistors: 2 &times; 100 &#8486;, 4.7 k&#8486;, 10k&#8486;</li>
<li>Resistors: 2 &times; 100 &#8486;, 4.7 k&#8486;, 10 k&#8486;</li>
<li>2 &times; NPN transistor</li>
<li>White LED</li>
<li>Infrared LED (904 nm)</li>
@@ -203,6 +203,15 @@ h2, h3 {
<h3 id="jblpreparation">Preparing the JBL IIIp Speaker</h3>
<h3 id="electronics">Electronics</h3>
<p class="gallery">
<a href="images/2016-12-18_19-36-44.jpg" class="fancybox" rel="collection03"><img src="images/2016-12-18_19-36-44.jpg"
width="320" alt="" /></a>
<a href="images/audiosphere-electronics.png" class="fancybox" rel="collection03"><img src="images/audiosphere-electronics.png" width="320"
alt="" /></a>
</p>
<h2 id="software">Software</h2>
<h3 id="system">System Installation</h3>
<h3 id="python">Python Script</h3>
+218
View File
@@ -0,0 +1,218 @@
<!doctype html>
<html lang="de">
<head>
<title>PiPlayer 2: The AudioSphere</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta property="og:image" content="http://www.tilman.de/projekte/piplayer/photos/02.jpg" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<link rel="stylesheet" href="fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,800' rel='stylesheet' type='text/css' />
<link href='https://fonts.googleapis.com/css?family=Lora:400,400italic,700,700italic' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<style type="text/css" media="all">
<!--
body {
background-color: #FFFFFF;
color: black;
font-family: 'Lora', serif;
font-size: 160%;
}
h1 {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 800;
text-align: center;
color: #303030;
}
h2, h3 {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 800;
color: #303030;
}
#subtitle {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 800;
font-weight: 800;
text-align: center;
color: #303030;
font-size: 120%;
margin-bottom: 2em;
}
.gallery {
text-align: center;
}
.timestamp {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-align: right;
color: #888;
margin-top: 2em;
}
.fancybox-title {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
-->
</style>
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox({
openEffect : 'none',
closeEffect : 'none',
helpers : {
title : {
type : 'inside'
}
},
beforeShow : function() {
var alt = this.element.find('img').attr('alt');
this.inner.find('img').attr('alt', alt);
this.title = alt;
}
});
});
</script>
</head>
<body>
<div id="content" class="container">
<p class="timestamp">2017-01-14</p>
<h1>AudioSphere</h1>
<p id="subtitle">An MP3 player for children based on the Raspberry Pi Zero and the JBL On Stage IIIp</p>
<p style="font-weight: 700;">In spring 2016 I finalized the <a href="http://tilman.de/projekte/musikrakete/">Musikrakete</a>, an MP3 player that our boys could use without assistance. This is the second version: Not a rocket anymore, but with many improvements.</p>
<p class="gallery" style="float:right;">
<a href="photos/02.jpg" class="fancybox"><img src="photos/02.jpg"
width="480" alt="The AudioSphere. The QR cards are placed on the window on top, where they are detected by a photo sensor that triggers the recognition process. After the code has been read by the webcam, the respective playlist is loaded via network and played directly." /></a>
</p>
<h2 id="toc">Contents</h2>
<ol>
<li><a href="#idea">The Idea</a></li>
<li><a href="#piplayer2">PiPlayer, version 2.0: AudioSphere</a></li>
<li><a href="#case">3D Printed Case</a></li>
<li><a href="#hardware">Hardware</a></li>
<li><a href="#software">Software</a></li>
<li><a href="#manual">User Manual</a></li>
</ol>
<h2 id="idea">The Idea</h2>
<p>
This project started about a year ago, when Anica asked me if buying a <a href="https://de-de.hoerbert.com/">hörbert</a> mp3 player would be a good idea. After all our boys wasted two to three CDs every week, trying to get some music out of the small player in their room. And the CD player in the living room also seemed to reach its end of life pretty soon. Nevertheless, I wasn't too sure about the device. In order to get new files on the SD card of the player, the case had to be opened, the navigation with 11 buttons also seemed a little confusing and a single speaker operated with four batteries also did not seem promising to me.
</p>
<p>
I had seen a <a href="http://www.die-schembergs.de/index.php?page=qr-music">project description of an mp3 player for small children</a> shortly before: A Raspberry Pi, connected to a webcam and speakers reads QR codes and plays the respective track or playlist. So this was what I suggested and to my surprise it was considered a better solution right away. And I had a project.
</p>
<p>
As good as the description seemed to be - I wanted to make some improvements on the original design: The player should detect the QR cards on its own, all components should be put together in a single case and, most important, the mp3 should be delivered directly from our home server. No SD card replacement needed.
</p>
<p>
Since we had an old <a href="https://www.amazon.com/JBL-OnStage-30-Pin-iPhone-Speaker/dp/B0017XMN7C">JBL OnStage IIIp</a> speaker lying around that wasn't used anymore due to its outdated 30 pin iPhone dock connector, I decided to use this as a base. After playing around with <a href="https://www.onshape.com/">Onshape</a>, soldering and programming for three months, I had the <a href="http://tilman.de/projekte/musikrakete/">Musikrakete</a> ready by end of March 2016. It's been a huge success with the boys and has been in heavy use ever since.
</p>
<p>
But there were still some open ends on the technical side and I knew that we might need a second player, once the boys have both a room of their own. So when Anica was searching for a good gift to her best friend's son we decided that an updated version would be a good idea.
</p>
<h2 id="piplayer2">PiPlayer, version 2.0: AudioSphere</h2>
<p>
The major improvement in handling was switching from a QR card slot to a window on top where the QR cards are placed on. I had seen that especially the smaller one had problems getting the cards into the narrow slot. Unfortunately, this also meant that a rocket shape was not an option anymore. At first I tried to put only a hemisphere on top of the JBL speaker which would make it look like a UFO. But the webcam needed at least 10 cm distance to the card in order have the entire QR code covered. Technically, it would be possible to further reduce the size of the ball but fitting all the components in there is hard enough as it is. Also, I wanted to be able to use the cards from the first player in the new one as well.
</p>
<p>
Also, an ethernet port is now available (since we had problems with the Wi-Fi connection in the boy's room) and thanks to switching to the Raspberry Pi Zero, the Apple dock port is now able to provide power for all the components. No additonal power source needed. By incorporating a <a href="https://shop.pimoroni.com/products/phat-dac">Pimoroni PHAT DAC</a> I removed all the audio-related headaches.
</p>
<p>
On the software side there's two major improvements: The SD card is now mounted read-only by default. This makes unplugging the AudioSphere (by accident or for reboot) unproblematic. And the Python script that operates the player now uses interrupts instead of polling for checking the input sources. This removes unnecessary overhead from the CPU and also reduces power-consumption.
</p>
<p>
OK, so much for the overview - let's build this, step by step.
</p>
<h2 id="case">3D Printed Case</h2>
<p>
First step was the design of the new case. Like the first <a href="https://cad.onshape.com/documents/56f3cf83e4b02f6312a93771/w/785ccf8684baed006305bb0d/e/c68592f13fbf9a2c69b8dd05">rocket case</a> it's public, you can find it <a href="https://cad.onshape.com/documents/584e7d080f617710a60fc5d3/w/28f44a0afe402320fa3f3faa/e/765c3d5ab7a1032836866ac8">here on Onshape</a>. (You will need to create an account to open the document.) Or you can <a href="misc/audiosphere-stl.zip">directly download the STL files for printing if you are using the very same components</a>. (Please note that you will need to rotate the top of the sphere 180° for printing.)
</p>
<p class="gallery">
<a href="images/piplayer-04-04.png" class="fancybox" rel="collection01"><img src="images/piplayer-04-04.png"
width="320" alt="The base with the three main electronic components: The Raspberry Pi Zero with the PHAT DAC (blue), the USB hub with the ethernet port (green) and the camera with a representation of its viewport (black)." /></a>
<a href="images/piplayer-02-500.gif" class="fancybox" rel="collection01"><img src="images/piplayer-02-500.gif" width="320"
alt="Animation of the assembly" /></a>
<a href="images/piplayer-02-07.png" class="fancybox"
rel="collection01"><img src="images/piplayer-02-07.png" width="320"
alt="The assembled case" /></a>
</p>
<h2 id="hardware">Hardware and Assembly</h2>
<h3 id="parts">Parts list</h3>
<ul>
<li>JBL On Stage IIIP (used via ebay for less than 20 €)</li>
<li><a href="#case">The case</a>. Printed via <a href="https://www.3dhubs.com/">3dhubs.com</a></li>
<li>3 &times; M3 screws with nuts for mounting the case on the speaker (add some nylon washers, if available)</li>
<li>Raspberry Pi Zero</li>
<li>Pimoroni PHAT DAC</li>
<li>ultra-cheap <a href="images/micro-usb-hub.jpg">Micro USB HUB with ethernet port</a></li>
<li>even cheaper <a href="http://www.penguin.cz/~utx/hardware/USB_Camera_AX2311/">USB webcam</a></li>
<li>Round Acrylic glass 2 mm, 75 mm diameter. You can order these on ebay.</li>
<li>5 &times; M2.5 screws for the Raspberry Pi and the case</li>
<li>
Electronic components:
<ul>
<li>3 &times; 12 mm momentary push buttons</li>
<li><a href="http://www.vishay.com/docs/83751/cny70.pdf">CNY70 reflective optical sensor</a></li>
<li>Resistors: 2 &times; 100 &#8486;, 4.7 k&#8486;, 10k&#8486;</li>
<li>2 &times; NPN transistor</li>
<li>White LED</li>
<li>Infrared LED (904 nm)</li>
<li>Infrared LED (904 nm)</li>
<li>Jumper wires</li>
<li>0.5 mm copper wire</li>
</ul>
<li>
Tools:
<li>Soldering iron</li>
<li>Glue gun</li>
<li>Screwdriver</li>
<li>Cutting knife</li>
<li>Power drill</li>
<li>Superglue (for the window)</li>
</li>
</ul>
<h3 id="jblpreparation">Preparing the JBL IIIp Speaker</h3>
<h3 id="electronics">Electronics</h3>
<h2 id="software">Software</h2>
<h3 id="system">System Installation</h3>
<h3 id="python">Python Script</h3>
<h2 id="manual">User Manual</h2>
<h3 id="wi-fi"></h3>
<h3 id="qr-cards">QR Cards</h3>
</div>
</body>
</html>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB