Benoit FrigonMy blog about electronic projects, telephony and other stuff...https://https://www.frigon.info"en-usBenoit Frigon2020-10-28T07:58:29-04:00Another alarm clock projecthttps://https://www.frigon.info/posts/projects/alarm-clock-v3/2018-12-08T01:00:00-05:002018-12-08T01:00:00-05:00This is my third alarm clock design. It has an RGB 7-segments display made from WS2812 LEDs, a VS1053 chip to playback MP3’s as alarm sound, WiFi connectivity. It is easily programmable as the main board design is based on an Arduino mega. It has an onboard USB->serial adapter and is compatible with the Arduino IDE and all the libraries.
The enclosure parts can be printed with your own 3D printer or by using an online 3D printing services. I included all the necessary STL files on the GitHub repository for this project.
<p>This is my third alarm clock design. It has an RGB 7-segments display made from WS2812 LEDs, a VS1053 chip to playback MP3’s as alarm sound, WiFi connectivity. It is easily programmable as the main board design is based on an Arduino mega. It has an onboard USB->serial adapter and is compatible with the Arduino IDE and all the libraries.</p>
<p>The enclosure parts can be printed with your own 3D printer or by using an online 3D printing services. I included all the necessary STL files on the <a href="https://github.com/bfrigon/alarm-clock-v3/tree/master/fab-files/stl-files">GitHub repository</a> for this project.</p>
<!--more-->
<h3 id="features-summary">Features summary</h3>
<ul>
<li>Arduino based design using the ATMEGA2560 MCU.</li>
<li>WI-FI connectivity</li>
<li>Plays MP3/WAV files from a SD card.</li>
<li>Large RGB seven segment display</li>
<li>16x2 character LCD display</li>
<li>RGB night lamp</li>
<li>Touch keypad</li>
<li>24h battery backup</li>
</ul>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/alarm-clock-v3/final-assembly-front.jpg" title="Final assembly (Front)">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 400px;">
<img src="/images/library/alarm-clock-v3/thumbs/final-assembly-front.jpg" alt="Final assembly (Front)" title="Final assembly (Front)" width="400" height="300" />
</div>
</a>
</div>
<h2 id="enclosure">Enclosure</h2>
<p>The enclosure is made from two parts, the upper section which contains the display and speaker and the lower section which consist of the LCD display module and motherboard. I used Shapeways to print the enclosure parts using their black dyed versatile plastic. The unfinished parts have a porous texture and if you scratch it lightly, it becomes shiny and really visible. To smooth it out, i spray paint the part and sand it with 1000 grit sandpaper between each coat and repeat until I get a smooth finish.</p>
<p>More details about this process <a href="/posts/diy/shapeways-plastic-smoothing/">here</a>.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/enclosure-raw-shapeways.jpg" title="Raw 3D printed parts for the enclosure.">
<img src="/images/gallery/clkv3-enclosure/thumbs/enclosure-raw-shapeways.jpg" alt="" title="Raw 3D printed parts for the enclosure." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/display-frame-shapeways.jpg" title="Raw 3d printed parts for the display frame.">
<img src="/images/gallery/clkv3-enclosure/thumbs/display-frame-shapeways.jpg" alt="" title="Raw 3d printed parts for the display frame." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/threaded-insert-installed.jpg" title="4-40 threaded inserts installed.">
<img src="/images/gallery/clkv3-enclosure/thumbs/threaded-insert-installed.jpg" alt="" title="4-40 threaded inserts installed." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/enclosure-first-sanding-bottom.jpg" title="Bottom of the enclosure after a few cycle of primer and sanding.">
<img src="/images/gallery/clkv3-enclosure/thumbs/enclosure-first-sanding-bottom.jpg" alt="" title="Bottom of the enclosure after a few cycle of primer and sanding." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/enclosure-first-sanding.jpg" title="Back of the enclosure after a few cycle of primer and sanding.">
<img src="/images/gallery/clkv3-enclosure/thumbs/enclosure-first-sanding.jpg" alt="" title="Back of the enclosure after a few cycle of primer and sanding." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/display-frame-assembly.jpg" title="Display frame painted.">
<img src="/images/gallery/clkv3-enclosure/thumbs/display-frame-assembly.jpg" alt="" title="Display frame painted." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/enclosure-varnish-layer-front.jpg" title="Enclosure painted and varnished.">
<img src="/images/gallery/clkv3-enclosure/thumbs/enclosure-varnish-layer-front.jpg" alt="" title="Enclosure painted and varnished." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-enclosure/enclosure-varnish-layer-bottom.jpg" title="Bottom of the enclosure after painting and varnishing.">
<img src="/images/gallery/clkv3-enclosure/thumbs/enclosure-varnish-layer-bottom.jpg" alt="" title="Bottom of the enclosure after painting and varnishing." width="128" height="96" />
</a>
</span>
</div>
<h3 id="decals">Decals</h3>
<p>There are many online sources where you can get your custom sheets relatively cheaply. Before applying the decals, it is best to spray at least two coats of varnish as it makes it easier to remove the decals without ruining the paint layer in case you make a mistake.</p>
<p>To make sure the transfer shift don’t shift while transferring the decal, I put masking tape on one side of the transfer sheet. Ideally, you should use a burnishing tool to transfer the sheet, but using the tip of a pen works fine. The key to apply enough pressure to successfully transfer the decal but not too much.</p>
<p>The decals are still quite fragile at this point. A few coats of varnish is required to seal the decals.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-decals/applying-decals-back-panel.jpg" title="Decal sheet positioning.">
<img src="/images/gallery/clkv3-decals/thumbs/applying-decals-back-panel.jpg" alt="" title="Decal sheet positioning." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-decals/decals-enclosure-back.jpg" title="Decals on the back of the enclosure.">
<img src="/images/gallery/clkv3-decals/thumbs/decals-enclosure-back.jpg" alt="" title="Decals on the back of the enclosure." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-decals/decals-enclosure-bottom.jpg" title="Decals on the bottom of the enclosure.">
<img src="/images/gallery/clkv3-decals/thumbs/decals-enclosure-bottom.jpg" alt="" title="Decals on the bottom of the enclosure." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-decals/decals-enclosure-side.jpg" title="Decals on the right side of the enclosure.">
<img src="/images/gallery/clkv3-decals/thumbs/decals-enclosure-side.jpg" alt="" title="Decals on the right side of the enclosure." width="128" height="96" />
</a>
</span>
</div>
<h2 id="display">Display</h2>
<p>The seven segment display was made using <a href="https://www.seeedstudio.com/document/pdf/WS2812B%20Datasheet.pdf">WS2812B</a> which i latter changed for the <a href="http://www.inolux-corp.com/datasheet/SMDLED/Addressable%20LED/IN-PI554FCH.pdf">IN-PI554FCH</a> (same pin out than the <a href="https://www.seeedstudio.com/document/pdf/WS2812B%20Datasheet.pdf">WS2812B</a>, but has lower power consumption). There are 4 PCB, one for each digit, mounted in a 3D printed frame. At the front, there is a 3mm laser engraved mirror acrylic sheet with the segment pattern. I added a texture to help diffuse the light a bit. On the back of the display assembly, between the two speakers, there is also a 3-led RGB lamp that serves as a night lamp which can be toggled on or off by swiping left-to-right on the keypad.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-display/front-frame-threaded-inserts.jpg" title="2-56 and 4-40 threaded inserts installed">
<img src="/images/gallery/clkv3-display/thumbs/front-frame-threaded-inserts.jpg" alt="" title="2-56 and 4-40 threaded inserts installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/diffuser-epoxy-kapton-tape.jpg" title="Applying kaptop tape to contain the white translucent epoxy used as a light diffuser.">
<img src="/images/gallery/clkv3-display/thumbs/diffuser-epoxy-kapton-tape.jpg" alt="" title="Applying kaptop tape to contain the white translucent epoxy used as a light diffuser." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/diffuser-epoxy-pour.jpg" title="Pouring the epoxy">
<img src="/images/gallery/clkv3-display/thumbs/diffuser-epoxy-pour.jpg" alt="" title="Pouring the epoxy" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/diffuser-epoxy-finished.jpg" title="Kapton tape is removed after the epoxy fully cures">
<img src="/images/gallery/clkv3-display/thumbs/diffuser-epoxy-finished.jpg" alt="" title="Kapton tape is removed after the epoxy fully cures" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/frame-front-assembly-glue.jpg" title="Glueing of the display front cover">
<img src="/images/gallery/clkv3-display/thumbs/frame-front-assembly-glue.jpg" alt="" title="Glueing of the display front cover" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/frame-front-assembled.jpg" title="Front part of the display assembly completed.">
<img src="/images/gallery/clkv3-display/thumbs/frame-front-assembled.jpg" alt="" title="Front part of the display assembly completed." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/frame-front-assembled-outside.jpg" title="Front view of the display assembly">
<img src="/images/gallery/clkv3-display/thumbs/frame-front-assembled-outside.jpg" alt="" title="Front view of the display assembly" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/frame-front-with-touch-keypad.jpg" title="Touch keypad installed on the display assembly.">
<img src="/images/gallery/clkv3-display/thumbs/frame-front-with-touch-keypad.jpg" alt="" title="Touch keypad installed on the display assembly." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/frame-back-cover-assembly-glue.jpg" title="Glueing of the display back cover">
<img src="/images/gallery/clkv3-display/thumbs/frame-back-cover-assembly-glue.jpg" alt="" title="Glueing of the display back cover" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/back-panel.jpg" title="Rear view of the display assembly">
<img src="/images/gallery/clkv3-display/thumbs/back-panel.jpg" alt="" title="Rear view of the display assembly" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-display/rgb-lamp.jpg" title="RGB lamp">
<img src="/images/gallery/clkv3-display/thumbs/rgb-lamp.jpg" alt="" title="RGB lamp" width="128" height="96" />
</a>
</span>
</div>
<h2 id="touch-keypad">Touch keypad</h2>
<p>The touch keypad is monitored by the <a href="https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-9596-AT42-QTouch-BSW-AT42QT1070_Datasheet.pdf">AT42QT1070</a> IC. On the PCB, there are three key electrodes placed closely together. I don’t use the adjacent key suppression feature but instead monitor which channel among the detected keys has the strongest signal value to determine which key was pressed. This allows me in software to detect swipe left and swipe right motions.</p>
<p>The keypad overlay is a 1.5mm thick Plexiglas sheet with laser engraved key legend which i filled with acrylic paint. I also sprayed the sheet with a few coats of clear varnish so that the finish matches with the rest of the enclosure.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/touch-keypad-pcb-back.jpg" title="Bottom view of the touch keypad PCB">
<img src="/images/gallery/clkv3-keypad/thumbs/touch-keypad-pcb-back.jpg" alt="" title="Bottom view of the touch keypad PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/touch-keypad-pcb-front.jpg" title="Top view of the touch keypad PCB">
<img src="/images/gallery/clkv3-keypad/thumbs/touch-keypad-pcb-front.jpg" alt="" title="Top view of the touch keypad PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/laser-engraving-overlay.jpg" title="Laser engraved Plexiglas sheet for the keypad overlay.">
<img src="/images/gallery/clkv3-keypad/thumbs/laser-engraving-overlay.jpg" alt="" title="Laser engraved Plexiglas sheet for the keypad overlay." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/masking-white-color.jpg" title="Masking with kapton tape the sections of the overlay to be filled later with orange acrylic paint.">
<img src="/images/gallery/clkv3-keypad/thumbs/masking-white-color.jpg" alt="" title="Masking with kapton tape the sections of the overlay to be filled later with orange acrylic paint." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/acrylic-paint-white.jpg" title="Filling the engraved graphics with white acrylic paint">
<img src="/images/gallery/clkv3-keypad/thumbs/acrylic-paint-white.jpg" alt="" title="Filling the engraved graphics with white acrylic paint" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/white-color-applied.jpg" title="White acrylic paint applied">
<img src="/images/gallery/clkv3-keypad/thumbs/white-color-applied.jpg" alt="" title="White acrylic paint applied" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/masking-orange-color.jpg" title="Masking with kapton tape the sections already painted.">
<img src="/images/gallery/clkv3-keypad/thumbs/masking-orange-color.jpg" alt="" title="Masking with kapton tape the sections already painted." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/acrylic-paint-orange.jpg" title="Filling with orange acrylic paint">
<img src="/images/gallery/clkv3-keypad/thumbs/acrylic-paint-orange.jpg" alt="" title="Filling with orange acrylic paint" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/dry-film-acrylic-paint.jpg" title="After removing the excess paint, it is allowed to dry and this leaves a thin film which can be scratched">
<img src="/images/gallery/clkv3-keypad/thumbs/dry-film-acrylic-paint.jpg" alt="" title="After removing the excess paint, it is allowed to dry and this leaves a thin film which can be scratched" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/engraving-filled.jpg" title="Completed keypad overlay">
<img src="/images/gallery/clkv3-keypad/thumbs/engraving-filled.jpg" alt="" title="Completed keypad overlay" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-keypad/clear-coated.jpg" title="Sprayed a few coats of varnish to match with the finish of the display frame.">
<img src="/images/gallery/clkv3-keypad/thumbs/clear-coated.jpg" alt="" title="Sprayed a few coats of varnish to match with the finish of the display frame." width="128" height="96" />
</a>
</span>
</div>
<h2 id="audio-sub-system">Audio sub system</h2>
<p>MP3/WAV files a read from an SD card and decoded by the <a href="https://www.sparkfun.com/datasheets/Components/SMD/vs1053.pdf">VS1053B</a> codec IC. The codec output is amplified with a TPA2016D2 stereo amplifier which can deliver 2.8 Watts per channel.</p>
<div class="media image alignright frame">
<a class="popup" href="/images/library/alarm-clock-v3/frame-back-assembled.jpg" title="Speakers">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 160px;">
<img src="/images/library/alarm-clock-v3/thumbs/frame-back-assembled.jpg" alt="Speakers" title="Speakers" width="160" height="120" />
</div>
</a>
</div>
<p>As for the speakers, I choose the <a href="http://www.puiaudio.com/pdf/AS04008PS-4W-R.pdf">AS04008PS-4W-R</a> from PUI audio. It has a decent sound quality for it’s size (40x28 mm). As expected with speakers in this category, the bass isn’t very loud, but once installed in the enclosure, it improves a bit. It performs better with song that contains higher frequencies, like the ring tones you find on a cell phone.</p>
<p>When the alarm goes off and if SD card was removed or for some reason, it cannot decode the file, the software will instead play a fallback sound file embedded in program memory.</p>
<h2 id="motherboard">Motherboard</h2>
<p>The motherboard design is based around the <a href="https://store.arduino.cc/usa/arduino-mega-2560-rev3">Arduino Mega 2560</a>. It’s 256k program memory was perfect for this application because of all the features I wanted to implement. The motherboard assembly consists of three parts: The motherboard itself which contains the <a href="https://ww1.microchip.com/downloads/en/devicedoc/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf">ATMEGA2560</a>, <a href="https://datasheets.maximintegrated.com/en/ds/DS3231.pdf">DS3231 RTC</a>, <a href="https://ww1.microchip.com/downloads/en/DeviceDoc/ATWINC15x0-MR210xB-IEEE-802.11-b-g-n-SmartConnect-IoT-Module-Data-Sheet-DS70005304C.pdf">WINC1500 WI-FI module</a> and onboard USB-serial adapter. The daughter board which has the <a href="https://www.sparkfun.com/datasheets/Components/SMD/vs1053.pdf">VS1053B</a> codec and amplifier and finally, the front panel PCB with the LCD module board and the light sensor next to it.</p>
<p>There are no screw to hold the front panel PCB in place, instead the board is joined to the motherboard and daughter board using solder tabs.</p>
<p>The power supply is located on a separate board and connect to the motherboard with plug-in headers. I opted to have the PSU on a separate PCB because, at the time of designing the motherboard, I wasn’t sure of the power requirements or whether to use a NiMh or lithium battery.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/Motherboard-assembled-top.jpg" title="Top view of the motherboard PCB">
<img src="/images/gallery/clkv3-motherboard/thumbs/Motherboard-assembled-top.jpg" alt="" title="Top view of the motherboard PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/motherboard-assembled-bottom.jpg" title="Bottom view of the motherboard PCB">
<img src="/images/gallery/clkv3-motherboard/thumbs/motherboard-assembled-bottom.jpg" alt="" title="Bottom view of the motherboard PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/daughterboard-assembled-top.jpg" title="Top view of the daughter board">
<img src="/images/gallery/clkv3-motherboard/thumbs/daughterboard-assembled-top.jpg" alt="" title="Top view of the daughter board" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/front-panel-lcd-installation.jpg" title="Installing the LCD module with 467MP adhesive on the front panel PCB before soldering the connector on the other side.">
<img src="/images/gallery/clkv3-motherboard/thumbs/front-panel-lcd-installation.jpg" alt="" title="Installing the LCD module with 467MP adhesive on the front panel PCB before soldering the connector on the other side." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/front-panel-lcd-installed.jpg" title="LCD module installed">
<img src="/images/gallery/clkv3-motherboard/thumbs/front-panel-lcd-installed.jpg" alt="" title="LCD module installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/light-sensor.jpg" title="Light sensor IC">
<img src="/images/gallery/clkv3-motherboard/thumbs/light-sensor.jpg" alt="" title="Light sensor IC" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/front-panel-pcb-assembled.jpg" title="Rear view of the front panel PCB">
<img src="/images/gallery/clkv3-motherboard/thumbs/front-panel-pcb-assembled.jpg" alt="" title="Rear view of the front panel PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/motherboard-final-assembly-back.jpg" title="The front panel PCB is joined to the motherboard and daughter board using solder tabs">
<img src="/images/gallery/clkv3-motherboard/thumbs/motherboard-final-assembly-back.jpg" alt="" title="The front panel PCB is joined to the motherboard and daughter board using solder tabs" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-motherboard/motherboard-final-assembly-front.jpg" title="Front view of the assembled motherboard.">
<img src="/images/gallery/clkv3-motherboard/thumbs/motherboard-final-assembly-front.jpg" alt="" title="Front view of the assembled motherboard." width="128" height="96" />
</a>
</span>
</div>
<h2 id="psubattery-backup">PSU/Battery backup</h2>
<p>There is a <a href="https://www.adafruit.com/product/2750">350mAh LIPO battery</a> which is the largest capacity I was able find that fits into the enclosure. The biggest power hog in the system is the display. There are 34 segments in total : 4 x 7 segments, 2 dots, 2 alarm status, am/pm and a time set led. The <a href="http://www.inolux-corp.com/datasheet/SMDLED/Addressable%20LED/IN-PI554FCH.pdf">IN-PI554FCH</a> RGB led consumes about 12mA per channel, so 3 x 34 x 12mA = 1224 mA. Under normal conditions, the maximum possible number of active segment is 29 (When the time is 20:08 in 24h mode). Still, this amounts to 1044mA, which is way more than the battery can handle.</p>
<p>So, to limit power consumption when running on battery, i implemented three power state in software. The normal mode, in which the clock is powered from DC and the display is allowed to take as much current as it needs. When running on battery power, the clock will go to low power mode. The display is limited to one color (red) and at a maximum of 40% brightness ( max. 140 mA ), WI-FI is disabled and the user interface remain active. The clock will remain in this state for 15 seconds after there is no input from the user, after which, it will go to standby mode.</p>
<p>In this mode, all peripherals, including the display is shutdown and only the LCD remain active displaying the time. It will remain in this mode until the alarm goes off or the user presses a key. The <a href="http://www.inolux-corp.com/datasheet/SMDLED/Addressable%20LED/IN-PI554FCH.pdf">IN-PI554FCH</a> led (same for <a href="https://www.seeedstudio.com/document/pdf/WS2812B%20Datasheet.pdf">WS2812B</a>) consume about 1 mA even when they are OFF so all 34 of them consume battery power needlessly. To mitigate this problem, a MOSFET was added to switch off the power going to the display.</p>
<p>In standby mode, the maximum power consumption is around 12 mA. Which is enough to provide a maximum runtime of 24 hours on a fully charged battery, given that it remains in standby mode the entire time. My goal was not to design something ultra low-power that could run for days on battery, just enough to last until the morning and wake you up in case the power goes out during the night.</p>
<p>The <a href="https://www.ti.com/lit/ds/slus810l/slus810l.pdf">BQ24075</a> IC is responsible for charging/monitoring the LIPO battery. It can automatically switch from external DC power to battery power if the voltage falls below 4.35v or goes over 6.4v. It’s output voltage varies between 3v and 5.5v in function of the battery charge and if external DC is present. For that reason, a step-up/step-down converter is needed after the <a href="https://www.ti.com/lit/ds/slus810l/slus810l.pdf">BQ24075</a>. I chose the <a href="https://www.ti.com/lit/ds/symlink/tps63070.pdf">TPS630701</a>. It is capable of outputting 5V at up to 2A from a wide input range (2v to 16v), perfect for the job.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/battery-holder.jpg" title="Battery holder for lithium battery.">
<img src="/images/gallery/clkv3-psu/thumbs/battery-holder.jpg" alt="" title="Battery holder for lithium battery." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/battery-holder-installed.jpg" title="Battery holder installed.">
<img src="/images/gallery/clkv3-psu/thumbs/battery-holder-installed.jpg" alt="" title="Battery holder installed." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/psu-pcb-solder-paste.jpg" title="Solder paste applied to the PSU board.">
<img src="/images/gallery/clkv3-psu/thumbs/psu-pcb-solder-paste.jpg" alt="" title="Solder paste applied to the PSU board." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/psu-pcs-reflowed.jpg" title="PSU board reflowed">
<img src="/images/gallery/clkv3-psu/thumbs/psu-pcs-reflowed.jpg" alt="" title="PSU board reflowed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/psu-pcb-assembled.jpg" title="PSU board fully assembled.">
<img src="/images/gallery/clkv3-psu/thumbs/psu-pcb-assembled.jpg" alt="" title="PSU board fully assembled." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-psu/psu-pcb-installed.jpg" title="PSU board installed.">
<img src="/images/gallery/clkv3-psu/thumbs/psu-pcb-installed.jpg" alt="" title="PSU board installed." width="128" height="96" />
</a>
</span>
</div>
<h3 id="pgoodsysoff-signal">PGOOD/SYSOFF signal</h3>
<p>The <a href="https://www.ti.com/lit/ds/slus810l/slus810l.pdf">BQ24075</a> has a PGOOD output pin which goes low when a DC input voltage within range is detected. The system monitors this pin and enters/exit low power mode accordingly.</p>
<p>It also has a SYSOFF pin which is used to disconnect the battery when the pin is set HIGH. Since the default state of this pin is HIGH, the software has to pull SYSOFF low to remain ON if DC power is lost. When it’s running on battery power, if the RESET button is pressed, the SYSOFF pin will return to its default state (HIGH) and disconnect the battery. This is the only way to power off the clock without manually disconnecting the battery. When DC power is present, the SYSOFF state is ignored, so pressing RESET will not power off the clock.</p>
<h3 id="usb-serial-sleep-mode">USB serial sleep mode</h3>
<p>The embedded USB serial adapter is handy because I can update the software without having to open the enclosure. However, it becomes an unwanted source of power drain when running on battery. I modified the USB-serial firmware so that it will monitor the USB voltage. When VUSB is not detected, the processor will enter power-down mode and wake up when VUSB is present again. This significantly reduces the power consumption when the serial adapter is not needed.</p>
<h2 id="final-assembly">Final assembly</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/assembly-display-panel-installed.jpg" title="Display panel assembled">
<img src="/images/gallery/clkv3-final-assembly/thumbs/assembly-display-panel-installed.jpg" alt="" title="Display panel assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/assembly-enclosure-top.jpg" title="Bottom view of the display panel assembly.">
<img src="/images/gallery/clkv3-final-assembly/thumbs/assembly-enclosure-top.jpg" alt="" title="Bottom view of the display panel assembly." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/assembly-final.jpg" title="Installation of the display panel assy.">
<img src="/images/gallery/clkv3-final-assembly/thumbs/assembly-final.jpg" alt="" title="Installation of the display panel assy." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/final-assembly-front.jpg" title="Front view">
<img src="/images/gallery/clkv3-final-assembly/thumbs/final-assembly-front.jpg" alt="" title="Front view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/rear-view.jpg" title="Rear view">
<img src="/images/gallery/clkv3-final-assembly/thumbs/rear-view.jpg" alt="" title="Rear view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/front-display-turquoise.jpg" title="RGB display set to turquoise">
<img src="/images/gallery/clkv3-final-assembly/thumbs/front-display-turquoise.jpg" alt="" title="RGB display set to turquoise" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/front-display-white.jpg" title="RGB display set to white">
<img src="/images/gallery/clkv3-final-assembly/thumbs/front-display-white.jpg" alt="" title="RGB display set to white" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/display-on-battery.jpg" title="RGB display is off when running on battery.">
<img src="/images/gallery/clkv3-final-assembly/thumbs/display-on-battery.jpg" alt="" title="RGB display is off when running on battery." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/front-display-dark-set-alarms.jpg" title="Display in the dark.">
<img src="/images/gallery/clkv3-final-assembly/thumbs/front-display-dark-set-alarms.jpg" alt="" title="Display in the dark." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/clkv3-final-assembly/night-lamp-in-dark.jpg" title="RGB night lamp ON.">
<img src="/images/gallery/clkv3-final-assembly/thumbs/night-lamp-in-dark.jpg" alt="" title="RGB night lamp ON." width="128" height="96" />
</a>
</span>
</div>
<h2 id="cad-schematics-and-fab-files">CAD, schematics and fab files.</h2>
<h3 id="mechanical-drawings">Mechanical drawings</h3>
<div class="media image alignnone frame">
<a class="link" href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/mechanical/clkv3-dwg.pdf" title="Drawings - Alarm clock V3">
<div class="caption">Drawings - Alarm clock V3</div>
<div class="img-container" style="padding: 66% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/clkv3-dwg.jpg" alt="" title="Drawings - Alarm clock V3" width="300" height="200" />
</div>
</a>
</div>
<h3 id="schematics">Schematics</h3>
<table>
<thead>
<tr>
<th>Dwg ID.</th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-01_rgb-digits.pdf">CLKV3-SCH-01</a></td>
<td>Display - RGB seven segment digit</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-02_rgb-dots.pdf">CLKV3-SCH-02</a></td>
<td>Display - RGB dots</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-03_touch-keypad.pdf">CLKV3-SCH-03</a></td>
<td>Touch keypad</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-04_front-panel.pdf">CLKV3-SCH-04</a></td>
<td>Front panel</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-05_motherboard.pdf">CLKV3-SCH-05</a></td>
<td>Motherboard</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-06_daughterboard.pdf">CLKV3-SCH-06</a></td>
<td>Daughterboard</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-07_psu.pdf">CLKV3-SCH-07</a></td>
<td>PSU PCB</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-08_rgb-lamp.pdf">CLKV3-SCH-08</a></td>
<td>RGB Lamp</td>
</tr>
<tr>
<td><a href="https://github.com/bfrigon/alarm-clock-v3/raw/master/drawings/schematics/clkv3-sch-09_alarm-switch.pdf">CLKV3-SCH-09</a></td>
<td>Alarm Swtich PCB</td>
</tr>
</tbody>
</table>
<h3 id="fab-files">Fab files</h3>
<ul>
<li><a href="https://github.com/bfrigon/alarm-clock-v3/tree/master/fab-files/stl-files">STL files for the enclosure</a></li>
<li><a href="https://github.com/bfrigon/alarm-clock-v3/tree/master/fab-files/laser-cut">Laser cut templates</a></li>
<li><a href="https://github.com/bfrigon/alarm-clock-v3/tree/master/fab-files/decals">Decals</a></li>
</ul>
How to smooth out Shapeways versatile plastichttps://https://www.frigon.info/posts/diy/shapeways-plastic-smoothing/2018-12-04T00:54:05-05:002018-12-04T00:54:05-05:00Versatile plastics from Shapeways is printed using a selective laser sintering (SLS) process. The 3D model is divided into thin slices and a laser draws the slice into a thin layer of nylon powder, once fused, another thin layer is deposited on top and the process continues until the part is complete. Those layers can create visible horizontal lines on the printed object, especially on rounded edges. This is fine for parts that won’t be visible but undesirable for enclosures.
Unpolished raw prints have a porous surface with a matte finish. If you scratch the material, even lightly, it will leave shinny marks all over. This is not as much of an issue with natural (white) but they are quite visible on black dyed prints.
The key to achieving a smooth finish is to fill the gaps between the nylon powder particles with primer. It is a lengthy process, but the results are worthwhile.
<p>Versatile plastics from Shapeways is printed using a selective laser sintering (SLS) process. The 3D model is divided into thin slices and a laser draws the slice into a thin layer of nylon powder, once fused, another thin layer is deposited on top and the process continues until the part is complete. Those layers can create visible horizontal lines on the printed object, especially on rounded edges. This is fine for parts that won’t be visible but undesirable for enclosures.</p>
<p>Unpolished raw prints have a porous surface with a matte finish. If you scratch the material, even lightly, it will leave shinny marks all over. This is not as much of an issue with natural (white) but they are quite visible on black dyed prints.</p>
<p>The key to achieving a smooth finish is to fill the gaps between the nylon powder particles with primer. It is a lengthy process, but the results are worthwhile.</p>
<!--more-->
<div class="media image alignleft frame">
<a class="popup" href="/images/library/shapeways-plastic/parts-washed.jpg" title="After washing the part. You can see how much this material absorbs liquid.">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 200px;">
<img src="/images/library/shapeways-plastic/thumbs/parts-washed.jpg" alt="Parts washed" title="After washing the part. You can see how much this material absorbs liquid." width="200" height="150" />
</div>
</a>
</div>
<p>The first step before painting is to wash the parts thoroughly with a toothbrush and leave them to dry completely. This is to ensure that you get rid of all loose leftover nylon powder.</p>
<div class="media image alignright frame">
<a class="popup" href="/images/library/shapeways-plastic/painting-halfway.jpg" title="After a few primer coats">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 200px;">
<img src="/images/library/shapeways-plastic/thumbs/painting-halfway.jpg" alt="" title="After a few primer coats" width="200" height="150" />
</div>
</a>
</div>
<p>You need to keep spraying light coats of primer paint, let it dry and sand between each coat using progressively finer grit sandpaper until the surface is completely smooth. If you spray too much at once, it will clog up the sand paper. I start with 400 grit for the first 3 coats, 1000 for the next ones and finish with 2000 grit sandpaper. It will usually require about 5-6 coats until the little gaps between the nylon particles are completely filled.</p>
<p>I use Rustoleum paint+primer. Look for the one that says “Also bonds to plastics”. It has a dry time of 20 minutes and is specially made to bond with plastic. I also tried Krylon for plastics in the past and it works just as well.</p>
<p>Once you achieve the finish you desire, you must let the part dry for at least one week before proceeding to the next step.</p>
<p>To protect the finish, i seal it by spraying a few coats of clear varnish.</p>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/shapeways-plastic/raw-texture-closeup.jpg" title="This is the material as-is.">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 250px;">
<img src="/images/library/shapeways-plastic/thumbs/raw-texture-closeup.jpg" alt="Before" title="This is the material as-is." width="250" height="188" />
</div>
</a>
</div>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/shapeways-plastic/finished.jpg" title="Finished part">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 250px;">
<img src="/images/library/shapeways-plastic/thumbs/finished.jpg" alt="After" title="Finished part" width="250" height="188" />
</div>
</a>
</div>
Call treatment for Asteriskhttps://https://www.frigon.info/posts/asterisk/call-treatment/2017-03-15T01:26:47-04:002017-03-15T01:26:47-04:00The thing i like the most about Asterisk is how flexible the dialplan is, and specifically how much creative you can get for dealing with undesired callers.
I use a database to store the call treatment rules and run a lookup query for each incoming call. If a number or caller name matches a rule, it takes the appropriate action for that call.
<p>The thing i like the most about Asterisk is how flexible the dialplan is, and specifically how much creative you can get for dealing with undesired callers.</p>
<p>I use a database to store the call treatment rules and run a lookup query for each incoming call. If a number or caller name matches a rule, it takes the appropriate action for that call.</p>
<!--more-->
<h2 id="the-database-table">The database table</h2>
<figure class="highlight"><pre><code class="language-mysql" data-lang="mysql">CREATE TABLE `call_treatment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(80) NOT NULL,
`extension` varchar(10) NOT NULL,
`caller_name` varchar(80) NOT NULL,
`caller_num` varchar(80) NOT NULL,
`action` varchar(45) NOT NULL DEFAULT 'quiet',
PRIMARY KEY (`id`),
KEY `idx_call_treatment_extension` (`extension`),
KEY `idx_call_treatment_caller_name` (`caller_name`),
KEY `idx_call_treatment_caller_num` (`caller_num`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;</code></pre></figure>
<p>The <strong>caller_name</strong> and <strong>caller_num</strong> columns are used as regex expression to match the caller phone number and name. You can define either of them or both.</p>
<p>Here are examples of rule syntax :</p>
<ul>
<li><strong>401[0-9]{7}</strong> will match all numbers beginning with the area code 401.</li>
<li><strong>4015551125</strong> will match a single number.</li>
<li><strong>401</strong> will match any numbers containing 401. e.g. (555) 555-0401</li>
<li>.* will match all numbers</li>
</ul>
<p>The <strong>action</strong> column contains the action to take if the incoming call matche this rule.</p>
<p><strong>Extension</strong> is optional. It defines to which user extension this rules applies to.</p>
<h2 id="query">Query</h2>
<p>Paste the following lines in func_odbc.conf :</p>
<figure class="highlight"><pre><code class="language-text" data-lang="text">dsn=asterisk
readsql=SELECT action FROM call_treatment WHERE (extension='${SQL_ESC(${ARG1})}' or extension='') AND ('${SQL_ESC(${ARG2})}' RLIKE caller_name OR caller_name='') AND ('${SQL_ESC(${ARG3})}' RLIKE caller_num AND NOT caller_num='') ORDER BY extension DESC, caller_num DESC LIMIT 1</code></pre></figure>
<p>You can run the query from the dialplan by using :</p>
<figure class="highlight"><pre><code class="language-text" data-lang="text">ODBC_CALL_TREATMENT(${extension}, ${CALLERID(name)}, ${CALLERID(num))</code></pre></figure>
<h2 id="dialplan">Dialplan</h2>
<p>This is an excerpt from my dialplan as an example. On an incoming call, the dialplan execute the lookup query. If the number doesn’t match any rules, the call is processed as normal. Otherwise, it jumps to the label <strong>treatment-</strong> followed by the acion. e.g. treatment-busy. If the label does not exists, the call is then proccessed as usual.</p>
<figure class="highlight"><pre><code class="language-text" data-lang="text">[context-incoming]
exten => s, 1, NoOp()
;**** Check if a call treatment exists for the caller ****
same => n, Set(action=${TOLOWER(${ODBC_CALL_TREATMENT(${EXTEN}, ${CALLERID(name)},${CALLERID(num)})})})
;**** Jump to label normal if none is found ****
same => n, GotoIf(${ISNULL(${action})}?normal)
;**** Jump to the propriate call treatment action, or treatment-invalid if not found ****
same => n, GotoIf(${DIALPLAN_EXISTS(context-incoming,treatment-${action})}?treatment-${action},1:treatment-invalid,1)
;**** Normal call processing ****
same => n(normal), NoOp()
same => n, Dial(....)
same => n, Hangup()
;--------------------------------------------
; call treatment : busy
;--------------------------------------------
exten => treatment-busy, 1, Verbose(0, Call treatment (busy) : ${CALLERID(num)})
same => n, Answer()
same => n, PlayTones(busy)
same => n, Wait(3600)
same => n, Hangup()
same => n, Return()
;---------------------------------------------
; Call treatment : Quiet
;---------------------------------------------
exten => treatment-quiet, 1, Verbose(0,Call treatment (quiet) : ${CALLERID(num)})
same => n, Answer()
same => n, PlayTones(ring)
same => n, Wait(3600)
same => n, Hangup()
same => n, Return()
;---------------------------------------------
; Call treatment : Torture menu (english)
;---------------------------------------------
exten => treatment-torture-en, 1, Verbose(0,Call treatment (torture-en) : ${CALLERID(num)})
same => n, Answer(500)
same => n, Wait(1)
same => n, Set(CHANNEL(language)=en)
same => n(torture-en-loop), NoOp()
same => n, Playback(custom/torture-menu-part1)
same => n, PlayTones(ring)
same => n, Wait(2)
same => n, Playback(custom/torture-menu-part2)
same => n, Goto(torture-en-loop)
;---------------------------------------------
; Invalid call treatment
;---------------------------------------------
exten => treatment-invalid, 1, Log(WARNING, Invalid call treatment for ${CALLERID(num)} : ${action})
same => n, goto(s,normal)</code></pre></figure>
Linux alarm clock - Displayhttps://https://www.frigon.info/posts/projects/alarm-clock/display/2015-05-26T23:31:00-04:002015-05-26T23:31:00-04:00This is the display i made for my alarm clock project. The first version was a 24x7 LED matrix but later changed the design for a four digits seven segment display. I decided to keep the drawings for the LED matrix and named it model A and Model B for the segment display.
The display is encapsulated in clear casting epoxy and is 5 inches wide by 2 1/4 inches high by 1 inch thick.
I was new to silicon molds and casting epoxy, so there was definitely a learning curve. I was unable to avoid the micro bubbles problem entirely. There are a few, but I can live with it, it’s not that bad. The assembly of each digits PCB, making the segments diffuser, gluing them, etc. takes a very long time. I did not want to start all over because of a few bubbles.
<p>This is the display i made for my <a href="/posts/projects/alarm-clock/">alarm clock project</a>. The first version was a 24x7 LED matrix but later changed the design for a four digits seven segment display. I decided to keep the drawings for the LED matrix and named it model A and Model B for the segment display.</p>
<p>The display is encapsulated in clear casting epoxy and is 5 inches wide by 2 1/4 inches high by 1 inch thick.</p>
<!--thumbnail-->
<p>I was new to silicon molds and casting epoxy, so there was definitely a learning curve. I was unable to avoid the micro bubbles problem entirely. There are a few, but I can live with it, it’s not that bad. The assembly of each digits PCB, making the segments diffuser, gluing them, etc. takes a very long time. I did not want to start all over because of a few bubbles.</p>
<!--more-->
<h2 id="design-process">Design process</h2>
<p>Sometimes, there is a gap between a design idea and what is realistically feasible. I had the crazy idea to make a clock with a fully transparent seven segment display. I looked into it, turns out such a display already exists and it’s called a transparent OLED or T-OLED. There are transparent display modules available on the market, such as <a href="https://www.4dsystems.com.au/product/uTOLED_20_G2/">this one from 4dsystems</a>, but it’s size was not practical for this project. While searching for a solution, I found a company that manufactures custom T-OLED display. But they usually deal with large production runs. Producing a single display would cost way too much.</p>
<h3 id="led-matrix-display-model-a">Led matrix display (model A)</h3>
<p>As a compromise, I came up with an LED matrix as the display (24 columns by 7 rows). To retain the transparent effect i wanted as much as possible, instead of mounting the LEDs directly on a PCB, I soldered them in a grid pattern, extending the leads vertically to the PCB located at the base of the display.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-jig3.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-jig3.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-rows2.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-rows2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-columns.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-columns.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-columns2.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-columns2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-columns3.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-columns3.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-columns4.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-columns4.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-led-matrix/led-matrix-base-assembled.jpg" title="">
<img src="/images/gallery/alarm-clock-led-matrix/thumbs/led-matrix-base-assembled.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<h3 id="seven-segment-display-model-b">Seven segment display (model B)</h3>
<p>I went back to the seven segment display idea. Instead of using pre-made display modules, I designed my own. Each digit has its own PCB with the shape of a number eight. The segments are comprised of two bright orange LEDs in parallel covered with a white epoxy diffuser.</p>
<p>The digits are 1 inch wide by 1.5 inch high and has 0.3-inch wide segments.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/display-base-pcb-top.jpg" title="Display - Base pcb">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/display-base-pcb-top.jpg" alt="" title="Display - Base pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/seg-display-board-assembled.jpg" title="Display pcb assembled">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/seg-display-board-assembled.jpg" alt="" title="Display pcb assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/display-assembled.jpg" title="Display base assembled">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/display-assembled.jpg" alt="" title="Display base assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/display-testing.jpg" title="Display pcb testing">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/display-testing.jpg" alt="" title="Display pcb testing" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/display-epoxy-sanding-3000grit.jpg" title="Display - encapsulated in epoxy">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/display-epoxy-sanding-3000grit.jpg" alt="" title="Display - encapsulated in epoxy" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/alarm-clock-front2.jpg" title="Display - finished">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/alarm-clock-front2.jpg" alt="" title="Display - finished" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-display/alarm-clock-display2.jpg" title="Display - testing">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/alarm-clock-display2.jpg" alt="" title="Display - testing" width="128" height="96" />
</a>
</span>
</div>
<h3 id="circuit">Circuit</h3>
<p>The brightness of those LEDs is controlled by a <a href="https://www.nxp.com/documents/data_sheet/PCA9634.pdf">PCA9634</a> dimmer chip. There is one for each digit plus one on the base PCB which controls the brightness of the two dots, am/pm led, alarm on/off led and the RGB lamp.</p>
<div class="media image alignleft frame">
<a class="popup" href="/images/gallery/alarm-clock-seg-display/digits-pcb-assembled.jpg" title="Assembled digits PCB">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-seg-display/thumbs/digits-pcb-assembled.jpg" alt="" title="Assembled digits PCB" width="128" height="96" />
</div>
</a>
</div>
<p>This chip communicates with the CPU via I2C and has a 7-bit hardware selectable address. The two lower bits are selectable using a solder jumper on the PCB so that each digit has a unique address on the bus. In addition to the device address, the <a href="https://www.nxp.com/documents/data_sheet/PCA9634.pdf">PCA9634</a> has 3 sub call address and an all call address. This feature makes it possible to broadcast a single command simultaneously to all the devices present on the bus. Each output has its own 8-bit resolution (256 steps) PWM running at 97 kHz and can also be dimmed globally with the group PWM.</p>
<p>I was hoping to be able to use the blinking feature on the <a href="https://www.nxp.com/documents/data_sheet/PCA9634.pdf">PCA9634</a> to make the digits flash when I program the alarm. Because the chips are not synchronized, the clock is drifting, but I did not expect it to be this much. It’s fine when dimming the LEDs but in blinking mode, it becomes really noticeable.</p>
<p>There is also a <a href="https://media.digikey.com/pdf/Data%20Sheets/Austriamicrosystems%20PDFs/TSL256x.pdf">TSL2561</a> ambient light sensor which I am going to use to automatically adjust the brightness of the segments.</p>
<h3 id="mechanical-drawings">Mechanical drawings</h3>
<table>
<thead>
<tr>
<th>Dwg ID.</th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-01.pdf">CLK-DWG-01</a></td>
<td>Led Matrix display board dimensions</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-22.pdf">CLK-DWG-22</a></td>
<td>Display (model A) - LED matrix</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-23.pdf">CLK-DWG-23</a></td>
<td>Display (model A) - LED matrix PCB assembly</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-24.pdf">CLK-DWG-24</a></td>
<td>Display (model A) - Assembly</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-06.pdf">CLK-DWG-06</a></td>
<td>Display base</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-08.pdf">CLK-DWG-08</a></td>
<td>Display (model B) - Segments PCB</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-09.pdf">CLK-DWG-09</a></td>
<td>Display (model B) - Dots PCB</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-10.pdf">CLK-DWG-10</a></td>
<td>Display (model B) - Base PCB</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-26.pdf">CLK-DWG-26</a></td>
<td>Display (model B) - Segment PCB Assembly</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-27.pdf">CLK-DWG-27</a></td>
<td>Display (model B) - Base PCB Assembly</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-28.pdf">CLK-DWG-28</a></td>
<td>Display (model B) - Assembly</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/design/clk-dwg-29.pdf">CLK-DWG-29</a></td>
<td>Display (model B) - Dots PCB Assembly</td>
</tr>
</tbody>
</table>
<h3 id="schematics">Schematics</h3>
<table>
<thead>
<tr>
<th>Dwg ID.</th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/schematics/clk-sch-01.pdf">CLK-SCH-01</a></td>
<td>Led Matrix display board (Model A)</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/schematics/clk-sch-05.pdf">CLK-SCH-05</a></td>
<td>Display (model B) - Segments PCB Schematic</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/schematics/clk-sch-06.pdf">CLK-SCH-06</a></td>
<td>Display (model B) - Dots PCB Schematic</td>
</tr>
<tr>
<td><a href="https://raw.githubusercontent.com/bfrigon/alarm-clock-hardware/master/drawings/schematics/clk-sch-07.pdf">CLK-SCH-07</a></td>
<td>Display (model B) - Base PCB Schematic</td>
</tr>
</tbody>
</table>
<h2 id="segments-diffusers">Segments diffusers</h2>
<p>The segments diffuser are made with clear casting epoxy with cornstarch at a ratio of 1 to 4 (25% cornstarch by volume, 75% epoxy). The cornstarch powder is fine enough so that it dissolve very well in epoxy and gives the mix a white translucent color. The key is to mix small amounts of it at a time and making sure the cornstarch is completely dissolved. Undissolved specs of cornstarch are more opaque and becomes visible when you shine a light through it.</p>
<p>I painted the sides of the diffuser. It makes it easier to see the digits if you look at them at an angle and it also reduce the light spillage to adjacent segments.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-model.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-model.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-mold-frame.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-mold-frame.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-mold.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-mold.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-dots-mold.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-dots-mold.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/epoxy-cornstarch.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/epoxy-cornstarch.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/translucent-white-epoxy-mix.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/translucent-white-epoxy-mix.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-epoxy-curing.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-epoxy-curing.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-demolding.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-demolding.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/carving-segments.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/carving-segments.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-diffusers/segments-painted.jpg" title="">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/segments-painted.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<h3 id="mold">Mold</h3>
<p>I use the <a href="http://blu-stuff.com/">“Blu Stuff” silicon rubber</a> which I found on eBay. It gives pretty good results, but you need to work fast with it. It sets within 5 minutes after you start mixing it, but after 3 minutes, it already starts to solidify a bit.</p>
<p>The mold was made in a way that I could fit the PCB inside it and pour the epoxy directly over the PCB. It did not work very well. Because the PCB is on top, the air bubbles get trapped under it and you cannot see if there is a problem until the epoxy is cured. Also, because the segments are so close together, it makes it impossible to paint the sides of the segments properly.</p>
<p>In the end, I casted the segments separately.</p>
<h3 id="assembly">Assembly</h3>
<div class="media image alignleft frame">
<a class="popup" href="/images/gallery/alarm-clock-seg-diffusers/gluing-diffuser-segments.jpg" title="Glueing each segments to the PCB">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-seg-diffusers/thumbs/gluing-diffuser-segments.jpg" alt="" title="Glueing each segments to the PCB" width="128" height="96" />
</div>
</a>
</div>
<p>I had to make a small cavity so that the LEDs could fit inside. I then glued each segment to the PCB using five-minute epoxy.</p>
<h2 id="display-base">Display base</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/cutting-jig.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/cutting-jig.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/cutting-template.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/cutting-template.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/cutting-opening-display-connector.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/cutting-opening-display-connector.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/drill-counterbore-hole.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/drill-counterbore-hole.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/force-fit-standoff.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/force-fit-standoff.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/test-fit-bottom.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/test-fit-bottom.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/gasket.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/gasket.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/display-base-bottom.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/display-base-bottom.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-base/display-finished.jpg" title="">
<img src="/images/gallery/alarm-clock-display-base/thumbs/display-finished.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<p>The base is made from a piece of 1 inch by 1/2-inch aluminum u-channel.</p>
<h2 id="encapsulating-the-display-in-epoxy">Encapsulating the display in epoxy</h2>
<h3 id="moldel">Moldel</h3>
<div class="media image alignleft frame">
<a class="popup" href="/images/gallery/alarm-clock-display-casting/plaster-model-unmolded.jpg" title="">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/plaster-model-unmolded.jpg" alt="" title="" width="128" height="96" />
</div>
</a>
</div>
<p>The first step was to produce a model (positive) for the silicon mold. I tried clay and polymorph plastic, but they both exhibited shrinkage problem when it dried (or cooled in the case of the polymorph plastic), the clay being the worst with 1/4 inch shrinkage over 5 inch. In the end, what worked the best was plaster of Paris with no shrinkage at all.</p>
<div class="media image alignright frame">
<a class="popup" href="/images/gallery/alarm-clock-display-casting/plaster-model-frame.jpg" title="">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/plaster-model-frame.jpg" alt="" title="" width="128" height="96" />
</div>
</a>
</div>
<p>I constructed an aluminum frame using 1-inch wide u-channels. This is the first time I use plaster of Paris. I did not know if it would stick to the frame too much. To reduce the risk of cracking the model during de-molding, I sprayed a small amount of wd-40 on the frame, which acts as a release agent. I then removed the excess with a cloth. It came out perfectly, without cracking or chipping.</p>
<div class="media image alignleft frame">
<a class="popup" href="/images/gallery/alarm-clock-display-casting/plaster-model-painting.jpg" title="">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/plaster-model-painting.jpg" alt="" title="" width="128" height="96" />
</div>
</a>
</div>
<p>I then applied several coats of paint, sanding between each coat. I sanded the last layer with 2000 grit paper to make the surface as smooth as possible. <strong>This is important because any imperfections will be picked up by the silicon rubber and will show up on the final product.</strong></p>
<h3 id="material">Material</h3>
<p>To make sure no epoxy would flow into the connector, I made a gasket with rubber foam and sealed the edges with silicon.</p>
<p>I was not sure whether to choose casting epoxy or polyester resin. I heard that you can achieve better results with polyester, but it produces a nasty odor while it cures. I live in an apartment, so I did not want to stink up the house for a week. It was winter at the time I made this so working outside was not an option either (especially with the crappy winter we had this year).</p>
<p>I opted for the <a href="http://en.pebeo.com/Creative-leisure/Gedeo-Resins-Plasters-and-Moulds/Casting">Pebeo Gedeo crystal resin</a> which I found at my local arts & craft supply store. It’s a mix of two parts resin to one part hardener and does not produce any odor while it cures.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-silicon-rubber.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-silicon-rubber.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-frame.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-frame.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-silicon-curing.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-silicon-curing.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-plaster-filler.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-plaster-filler.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-ready-1.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-ready-1.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/mold-ready-2.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/mold-ready-2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/casting-first-layer.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/casting-first-layer.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/casting-second-layer.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/casting-second-layer.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/casting-last-layer.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/casting-last-layer.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-display-casting/display-demolding.jpg" title="">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/display-demolding.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<h3 id="casting">Casting</h3>
<p>I did a test run before trying to cast the final product. On the first attempt, I tried to pour the epoxy in a single one-inch thick layer. It produced a lot of heat and lots of bubbles. As I found out, it is much more difficult to get rid of micro bubbles when mixing large quantities of epoxy. The best way was to pour the epoxy in three layers waiting at least 12 hours between layers.</p>
<p>Special care must be taken while mixing. I mixed the epoxy for five minutes as slowly as possible to avoid introducing air bubbles in the mix.</p>
<p>I found a tip on the Internet for getting rid of bubbles which suggested placing the mixing cup in hot water for five minutes. I tried it and it seemed to help a bit. I know the proper way to ensure a bubble-free mix is to place it in a vacuum chamber, but I did not want to invest 150-200$ for a vacuum kit just for one project.</p>
<h3 id="poslishing">Poslishing</h3>
<p>Epoxy resin fully cures in 24 hours but takes a few days before it becomes really hard. I waited two weeks before proceeding to sanding and polishing.</p>
<p>I started by sanding all surfaces by hand with a #120 grit paper until they were flush with the aluminum base. Then, I proceeded with #400, #1000 and #2000 grit and then, finished with 3M #3000 grit (wet sanding).</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-polishing/display-epoxy-sanding-120grit.jpg" title="Sanding - 120 grit">
<img src="/images/gallery/alarm-clock-seg-polishing/thumbs/display-epoxy-sanding-120grit.jpg" alt="" title="Sanding - 120 grit" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-polishing/display-epoxy-sanding-400grit.jpg" title="Sanding - 400 grit">
<img src="/images/gallery/alarm-clock-seg-polishing/thumbs/display-epoxy-sanding-400grit.jpg" alt="" title="Sanding - 400 grit" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-polishing/display-epoxy-sanding-1000grit.jpg" title="Sanding - 1000 grit">
<img src="/images/gallery/alarm-clock-seg-polishing/thumbs/display-epoxy-sanding-1000grit.jpg" alt="" title="Sanding - 1000 grit" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-polishing/display-epoxy-sanding-2000grit.jpg" title="Sanding - 2000 grit">
<img src="/images/gallery/alarm-clock-seg-polishing/thumbs/display-epoxy-sanding-2000grit.jpg" alt="" title="Sanding - 2000 grit" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-seg-polishing/display-epoxy-sanding-3000grit.jpg" title="Sanding - 3000 grit">
<img src="/images/gallery/alarm-clock-seg-polishing/thumbs/display-epoxy-sanding-3000grit.jpg" alt="" title="Sanding - 3000 grit" width="128" height="96" />
</a>
</span>
</div>
<p><a href="/posts/projects/alarm-clock/">More details about the project here…</a>.</p>
Python library for 364X series PSUhttps://https://www.frigon.info/posts/programming/python-psu364x/2015-05-24T22:00:00-04:002015-05-24T22:00:00-04:00I wrote a python library for remotely controlling an Array 364x series bench power supply. These PSU are re-branded under many names (Circuit specialist, Array, 3Com). It is likely they all have the same firmware, so it should be compatible. I have tested it on my Circuit Specialist 3645A.
<p>I wrote a python library for remotely controlling an Array 364x series bench power supply. These PSU are re-branded under many names (Circuit specialist, Array, 3Com). It is likely they all have the same firmware, so it should be compatible. I have tested it on my Circuit Specialist 3645A.</p>
<!--more-->
<h3 id="what-it-does">What it does</h3>
<ul>
<li>Read/Set operating parameters (max. current, max. power, max. voltage, voltage set)</li>
<li>Measure output parameters (output state, output voltage, output current, output power)</li>
<li>Set output ON-OFF</li>
<li>Read serial number, model number and firmware version</li>
</ul>
<h3 id="what-it-does-not-do">What it does not do</h3>
<ul>
<li>Calibration. The commands needed for calibration are not implemented yet.</li>
</ul>
<h3 id="dependencies">Dependencies</h3>
<ul>
<li>pyserial</li>
</ul>
<h2 id="installation">Installation</h2>
<p>If you already have Python and pip on your system you can install the library simply by running:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip install psu364x
</code></pre></div></div>
<p><strong>-OR-</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/bfrigon/python-psu364x.git
cd python-psu364x
python setup.py install
</code></pre></div></div>
<h2 id="interfacing-to-the-psu">Interfacing to the PSU</h2>
<p>These PSU have a DB-9 port on the back. It is not a standard RS-232 serial port, You need to use 3.3 volts TTL level serial, standard USB to RS232 converters will NOT work! You can buy a converter specially made for this. I built my own using the widely used FT232RL usb to UART IC. This chip has an onboard 3.3v regulator, if you connect the 3V3OUT to VCCIO, the output will be driven to 3.3 volts.</p>
<h2 id="example">Example</h2>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="kn">import</span> <span class="nn">os</span><span class="p">,</span><span class="n">sys</span>
<span class="kn">import</span> <span class="nn">psu364x</span>
<span class="n">PORT</span> <span class="o">=</span> <span class="s">"/dev/ttyUSB0"</span>
<span class="n">SPEED</span> <span class="o">=</span> <span class="mi">9600</span>
<span class="n">ADDRESS</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"Establishing communication with PSU...</span><span class="se">\n\n</span><span class="s">"</span>
<span class="n">psu</span> <span class="o">=</span> <span class="n">psu364x</span><span class="p">.</span><span class="n">Psu</span><span class="p">(</span><span class="n">PORT</span><span class="p">,</span> <span class="n">ADDRESS</span><span class="p">,</span> <span class="n">SPEED</span><span class="p">)</span>
<span class="n">info</span> <span class="o">=</span> <span class="n">psu</span><span class="p">.</span><span class="n">getInfo</span><span class="p">()</span>
<span class="k">print</span> <span class="s">"Power supply {0}, serial number {1}"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="n">info</span><span class="p">.</span><span class="n">model</span><span class="p">,</span> <span class="n">info</span><span class="p">.</span><span class="n">serial</span><span class="p">)</span>
<span class="k">print</span> <span class="s">"</span><span class="se">\n\n</span><span class="s">Closing connection..."</span>
<span class="n">psu</span><span class="p">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">except</span> <span class="n">psu364x</span><span class="p">.</span><span class="n">UnexpectedResponse</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"Unexpected response from PSU ({0})"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span></code></pre></figure>
DIY electronics workbenchhttps://https://www.frigon.info/posts/diy/workbench/2014-10-30T03:21:33-04:002014-10-30T03:21:33-04:00My previous electronics workbench was an old melamine office desk. It was not high enough to work comfortably on PCB assembly. I usually hand-solder small SMT components (0603, TSSOP, etc.) and I always ended up placing my PCBs on top of a box so I could see better what I was doing.
I looked online for a pre-built workbench, but I couldn’t find what I was looking for. Either it was too expensive or I didn’t like the design. I decided to build my own instead.
To be honest, woodworking isn’t one of my strongest skills, but in the end, I was quite satisfied with the results.
<p>My previous electronics workbench was an old melamine office desk. It was not high enough to work comfortably on PCB assembly. I usually hand-solder small SMT components (0603, TSSOP, etc.) and I always ended up placing my PCBs on top of a box so I could see better what I was doing.</p>
<p>I looked online for a pre-built workbench, but I couldn’t find what I was looking for. Either it was too expensive or I didn’t like the design. I decided to build my own instead.</p>
<p>To be honest, woodworking isn’t one of my strongest skills, but in the end, I was quite satisfied with the results.</p>
<!--more-->
<!--thumbnail-->
<h2 id="the-design">The design</h2>
<p>I don’t have a shop in a garage or basement, I live in an apartment, so I’m limited on space. My previous setup was composed of two desks in an “L” shape configuration. The desk was 56” by 26” and a smaller bench on the left side for my drill press (36” by 18”). With the drawers on the desk, it did not leave too much leg room.</p>
<p>I wanted to get rid of the smaller table and install my drill press on my workbench. I made it 58” by 28” of which 24 inches is reserved on the left side for the drill. That leaves 34 inches for the work surface which I find is plenty.</p>
<p>The bench top is 31.5 inch from the floor. The total height including the top section is 82.5 inches.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-finished/finished-workbench.jpg" title="Finished workbench">
<img src="/images/gallery/workbench-finished/thumbs/finished-workbench.jpg" alt="" title="Finished workbench" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-finished/work-area.jpg" title="Work area">
<img src="/images/gallery/workbench-finished/thumbs/work-area.jpg" alt="" title="Work area" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-finished/drill-press.jpg" title="Drill press">
<img src="/images/gallery/workbench-finished/thumbs/drill-press.jpg" alt="" title="Drill press" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-finished/outlets.jpg" title="AC outlets and network/usb connections">
<img src="/images/gallery/workbench-finished/thumbs/outlets.jpg" alt="" title="AC outlets and network/usb connections" width="128" height="96" />
</a>
</span>
</div>
<h3 id="shelves">Shelves</h3>
<p>I designed the shelves to be part of the workbench itself so I wouldn’t have to drill holes in the wall to hang them. The top section is 41 inch high and has a perforated board backing (Peg board). There are two 32 inches wide adjustable shelves on the right side and one fixed shelf on the top which spans the entire width of the workbench.</p>
<p>Now, anyone who had to move a refrigerator down the stairs in a three story apartment building knows how much fun it is. That is why I made the top section detachable so the whole thing would be easier to move. The legs on the back extends 12 inch from the top of the work surface. The frame of the top section is held in place on those legs with two bolts on each sides.</p>
<h3 id="drawers">Drawers</h3>
<p>There was no practical places to install drawers for my tools. I recycled the drawers from my old desk. As it turns out, it fitted perfectly on the side of the storage shelf near my workbench. I Built a frame for them with 2x2’s and painted it black. I installed ball bearing slides instead of the cheap tracks I had before.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-drawers/drawers.jpg" title="">
<img src="/images/gallery/workbench-drawers/thumbs/drawers.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-drawers/tools-drawer-1.jpg" title="">
<img src="/images/gallery/workbench-drawers/thumbs/tools-drawer-1.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-drawers/tools-drawer-2.jpg" title="">
<img src="/images/gallery/workbench-drawers/thumbs/tools-drawer-2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-drawers/tools-drawer-3.jpg" title="">
<img src="/images/gallery/workbench-drawers/thumbs/tools-drawer-3.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<h3 id="plan">Plan</h3>
<p>Here is the workbench plans (PDF) :</p>
<p><a href="/files/workbench/drawings.pdf">Download</a></p>
<div class="media image alignnone frame">
<a class="link" href="/files/workbench/drawings.pdf" title="Workbench drawings">
<div class="img-container" style="padding: 66% 0px 0px 0px; width: 300px;">
<img src="/images/library/workbench/thumbs/drawing-pdf.jpg" alt="Workbench drawings" title="Workbench drawings" width="300" height="200" />
</div>
</a>
</div>
<h2 id="construction">Construction</h2>
<h3 id="framing">Framing</h3>
<p>I started by cutting each piece of the frame using 2x4’s. I assigned each one letters so it was easier to keep track which goes where and to avoid mistakes. Then, I made 1.5 inch deep notches on the front and rear legs so that the horizontal support could sit inside the notches. That way, all the weight you put on top of the bench is transferred directly to the legs instead of the screws.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/lumber.jpg" title="All the pieces cut and ready for assembly.">
<img src="/images/gallery/workbench-construction-framing/thumbs/lumber.jpg" alt="Lumber." title="All the pieces cut and ready for assembly." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/notching-2x4.jpg" title="Notching the 2x4's">
<img src="/images/gallery/workbench-construction-framing/thumbs/notching-2x4.jpg" alt="" title="Notching the 2x4's" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/notching-2x4-2.jpg" title="Notching the 2x4's">
<img src="/images/gallery/workbench-construction-framing/thumbs/notching-2x4-2.jpg" alt="" title="Notching the 2x4's" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/notched-2x4.jpg" title="">
<img src="/images/gallery/workbench-construction-framing/thumbs/notched-2x4.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/side-assembly-1.jpg" title="Side assembly">
<img src="/images/gallery/workbench-construction-framing/thumbs/side-assembly-1.jpg" alt="" title="Side assembly" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/side-assembly.jpg" title="Side assembly completed">
<img src="/images/gallery/workbench-construction-framing/thumbs/side-assembly.jpg" alt="" title="Side assembly completed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/front-bracing.jpg" title="Horizontal support installation">
<img src="/images/gallery/workbench-construction-framing/thumbs/front-bracing.jpg" alt="" title="Horizontal support installation" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-framing/base-frame.jpg" title="Base frame completed">
<img src="/images/gallery/workbench-construction-framing/thumbs/base-frame.jpg" alt="" title="Base frame completed" width="128" height="96" />
</a>
</span>
</div>
<p>Once I cut all the pieces, I began assembling the sides first. Then, the front and rear support beams and finally, the lower shelf. This shelf serves as additional storage space, but more importantly, it also strengthens the structure. On most workbench plans, it spans the entire depth. I made it 11 inch wide instead so it would give me enough leg room.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-construction-lower-shelf/cross-bracing.jpg" title="Lower shelf support">
<img src="/images/gallery/workbench-construction-lower-shelf/thumbs/cross-bracing.jpg" alt="" title="Lower shelf support" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-lower-shelf/bottom-shelf.jpg" title="Bottom shelf">
<img src="/images/gallery/workbench-construction-lower-shelf/thumbs/bottom-shelf.jpg" alt="" title="Bottom shelf" width="128" height="96" />
</a>
</span>
</div>
<h3 id="bench-top">Bench top</h3>
<p>With the base frame completed, it was time to install the bench top. I glued and screwed the top in place with three inches screws. I then covered the screws with wood filler. Now this is the step I would differently if I did it again. Altough I did match the wood filler with the natural color of the wood. Once I stained it however, it became more apparent. The proper way to do it would have been to glue another 1/4 inch sheet on top of the base sheet</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-construction-bench-top/top-installed.jpg" title="Bench top installed">
<img src="/images/gallery/workbench-construction-bench-top/thumbs/top-installed.jpg" alt="" title="Bench top installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-bench-top/top.jpg" title="Notches in bench top">
<img src="/images/gallery/workbench-construction-bench-top/thumbs/top.jpg" alt="" title="Notches in bench top" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-bench-top/base-completed.jpg" title="Base framing completed">
<img src="/images/gallery/workbench-construction-bench-top/thumbs/base-completed.jpg" alt="" title="Base framing completed" width="128" height="96" />
</a>
</span>
</div>
<h3 id="top-section">Top section</h3>
<p>The next step was to assemble the upper section frame and then add the perforated board. I added a seven inches back-splash on top of the perforated board. This was not part of the original design, it was a way to cover a screw-up i made. Anyway, I think it looks better that way.</p>
<p>I cut openings for the two device boxes. The larger one is for AC and the smaller one on the left is for low voltage connections (network access and USB).</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/upper-section-frame.jpg" title="Upper section frame">
<img src="/images/gallery/workbench-construction-top-section/thumbs/upper-section-frame.jpg" alt="" title="Upper section frame" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/upper-frame-attachment.jpg" title="Upper section attachment">
<img src="/images/gallery/workbench-construction-top-section/thumbs/upper-frame-attachment.jpg" alt="" title="Upper section attachment" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/upper-frame-attachment-right.jpg" title="">
<img src="/images/gallery/workbench-construction-top-section/thumbs/upper-frame-attachment-right.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/perf-board-installed.jpg" title="Perforated board installed">
<img src="/images/gallery/workbench-construction-top-section/thumbs/perf-board-installed.jpg" alt="Perforated board installed" title="Perforated board installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/upper-frame-attachment-2.jpg" title="">
<img src="/images/gallery/workbench-construction-top-section/thumbs/upper-frame-attachment-2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/shelves.jpg" title="Shelves installed">
<img src="/images/gallery/workbench-construction-top-section/thumbs/shelves.jpg" alt="" title="Shelves installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/wire-grommet.jpg" title="Wire gromets">
<img src="/images/gallery/workbench-construction-top-section/thumbs/wire-grommet.jpg" alt="" title="Wire gromets" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/ac-outlet-boxes-installed.jpg" title="Devices boxes. The one on the right is for AC and the smaller one is for low voltage connections">
<img src="/images/gallery/workbench-construction-top-section/thumbs/ac-outlet-boxes-installed.jpg" alt="Devices boxes." title="Devices boxes. The one on the right is for AC and the smaller one is for low voltage connections" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-construction-top-section/ac-outlet-boxes-rear-view.jpg" title="Device boxes rear view.">
<img src="/images/gallery/workbench-construction-top-section/thumbs/ac-outlet-boxes-rear-view.jpg" alt="" title="Device boxes rear view." width="128" height="96" />
</a>
</span>
</div>
<h3 id="finishing">Finishing</h3>
<p>I originally planned to stain the entire workbench. The bench top looked fine, but trying to stain the 2x4’s was a mistake. I did one leg and it looked like crap. In the end, I decided to stain only the bench top and shelves and paint the rest with black melamine paint.</p>
<p>The melamine paint did not need any varnish (I’m not sure if it would be compatible anyway). To protect the stain, I used Varathane Nano Defence floor finish. The guy at the building supply store gave me the idea, I would never have thought of using floor varnish on a piece of furniture, but it actually works quite well. It is water based, so the smell was not an issue here.</p>
<p>To apply the varnish, I used a four inch wide foam brush. I applied about seven coats of varnish, sanding lightly between each application.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-painting/ready-for-varnish-coat.jpg" title="">
<img src="/images/gallery/workbench-painting/thumbs/ready-for-varnish-coat.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-painting/perf-board-painting.jpg" title="">
<img src="/images/gallery/workbench-painting/thumbs/perf-board-painting.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-painting/frame-black-paint.jpg" title="">
<img src="/images/gallery/workbench-painting/thumbs/frame-black-paint.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-painting/varnish-coat-first.jpg" title="First coat of varnish. I used Varathan Nano Defence">
<img src="/images/gallery/workbench-painting/thumbs/varnish-coat-first.jpg" alt="First coat of varnish." title="First coat of varnish. I used Varathan Nano Defence" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-painting/varnish-coat.jpg" title="">
<img src="/images/gallery/workbench-painting/thumbs/varnish-coat.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-painting/almost-done.jpg" title="">
<img src="/images/gallery/workbench-painting/thumbs/almost-done.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
</div>
<h2 id="lighting-fixtures">Lighting fixtures</h2>
<p>Lighting is one thing I made sure I had plenty of. In addition to the two fluorescent tubes on the top shelf, I have two LED “tubes” under the lower shelf about 10 inches away from the work surface. I don’t have the proper tool to measure the total LUX, but I think one would have sufficient light to perform surgery.</p>
<p>I made those lighting fixtures myself from flexible LED strips (120 LED per meter) I bought on Ebay. Each fixtures is composed of two 40cm (16 inches) strip in parallel for a total of four 40cm strips. At 12 Watt per meter, they consumes about 19W @ 12V. They are powered by a <a href="https://www.digikey.com/product-detail/en/LS25-12/285-1884-ND">25W 12V AC-DC PSU (LS25-12)</a> mounted on the frame behind the perforated board.</p>
<p>They are fixed on an “L” shape aluminum channel which helps dissipate the heat.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/custom-led-strip-frame.jpg" title="">
<img src="/images/gallery/workbench-lighting/thumbs/custom-led-strip-frame.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/custom-led-strip.jpg" title="">
<img src="/images/gallery/workbench-lighting/thumbs/custom-led-strip.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-lighting-custom-strips-wire.jpg" title="">
<img src="/images/gallery/workbench-lighting/thumbs/led-lighting-custom-strips-wire.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-fixtures-installed.jpg" title="Light fixtures installed">
<img src="/images/gallery/workbench-lighting/thumbs/led-fixtures-installed.jpg" alt="" title="Light fixtures installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-lighting-psu.jpg" title="12V 25W PSU for LED strip">
<img src="/images/gallery/workbench-lighting/thumbs/led-lighting-psu.jpg" alt="" title="12V 25W PSU for LED strip" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-lighting-psu-mounting.jpg" title="PSU mounted on the frame">
<img src="/images/gallery/workbench-lighting/thumbs/led-lighting-psu-mounting.jpg" alt="" title="PSU mounted on the frame" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-lighting-psu-ac.jpg" title="PSU connection to AC">
<img src="/images/gallery/workbench-lighting/thumbs/led-lighting-psu-ac.jpg" alt="" title="PSU connection to AC" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-lighting/led-lighting-done.jpg" title="LED lighting test">
<img src="/images/gallery/workbench-lighting/thumbs/led-lighting-done.jpg" alt="" title="LED lighting test" width="128" height="96" />
</a>
</span>
</div>
<h2 id="electrical">Electrical</h2>
<p>There are two AC outlets: The white one is always on and the gray outlet is controlled by the switch on the right. The second switch controls both the fluorescent tubes and the LED strips.</p>
<h2 id="cabinet-for-my-scope">Cabinet for my scope</h2>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/workbench/workbench-with-cabinet.jpg" title="Workbench with cabinet">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 400px;">
<img src="/images/library/workbench/thumbs/workbench-with-cabinet.jpg" alt="Workbench with cabinet" title="Workbench with cabinet" width="400" height="300" />
</div>
</a>
</div>
<p>With the drill press this close to my oscilloscope, there is a high risk of debris flying into the vents, especially when i’m drilling aluminum. Up until now, each time i was using the drill, I always put something over my scope to protect it, but that was not enough. There was always the possibility that I would lose my grip on the piece i’m drilling and that it goes flying towards the LCD screen, not a good thing… That’s why i decided to build this cabinet before something catastrophic happens.</p>
<p>There’s nothing too fancy here, it’s just a box with a door. It measures 23 1/2” long x 8” high by 12 3/4” deep. It’s made from 3 pieces of 12 inch wide, 3/4 inch thick plywood. The door frame is made from 2x1 pine strips with a groove in the middle to fit the 3/16 inch thick lexan sheet.</p>
<p>The cabinet itself is screwed to the shelf so that in case of an impact, it won’t hit the equipment inside.</p>
<p>As for ventilation, there is 2 inch clearance at the top and 5 inch behind which is not ideal, but good enough. I never leave the scope on with the door closed.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/workbench-cabinet/workbench-cabinet-door-closed.jpg" title="Door closed">
<img src="/images/gallery/workbench-cabinet/thumbs/workbench-cabinet-door-closed.jpg" alt="" title="Door closed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-cabinet/workbench-cabinet-door-open.jpg" title="Door open">
<img src="/images/gallery/workbench-cabinet/thumbs/workbench-cabinet-door-open.jpg" alt="" title="Door open" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-cabinet/workbench-cabinet-side.jpg" title="Side view">
<img src="/images/gallery/workbench-cabinet/thumbs/workbench-cabinet-side.jpg" alt="" title="Side view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/workbench-cabinet/workbench-cabinet-door-catch.jpg" title="Door catch">
<img src="/images/gallery/workbench-cabinet/thumbs/workbench-cabinet-door-catch.jpg" alt="" title="Door catch" width="128" height="96" />
</a>
</span>
</div>
SSH login without password?https://https://www.frigon.info/posts/linux/ssh-login-without-password/2014-04-02T10:54:43-04:002014-04-02T10:54:43-04:00If you need to manage multiple servers, having to re-enter your password each time you want to establish an SSH connection can become tedious. There is a better way. It is possible to initiate an SSH connection by using a public/private key pair instead. The main advantage is that you can use this key on multiple accounts and only need to remember the pass-phrase of your key.
<p>If you need to manage multiple servers, having to re-enter your password each time you want to establish an SSH connection can become tedious. There is a better way. It is possible to initiate an SSH connection by using a public/private key pair instead. The main advantage is that you can use this key on multiple accounts and only need to remember the pass-phrase of your key.</p>
<!--more-->
<p>If <strong><em>ssh-agent</em></strong> is running, you will only need to unlock your private key once per session. The unencrypted key will be stored in RAM until you logout of your session.</p>
<h2 id="generating-the-key">Generating the key</h2>
<p>Open a terminal and type:</p>
<blockquote>
<p>ssh-keygen -t rsa</p>
</blockquote>
<p>Keep the default location where to save the key (~/.ssh/id_rsa) and choose a pass-phrase.</p>
<blockquote>
<p><strong>user@local</strong> > <strong><em>ssh-keygen -t rsa</em></strong> <br />
Generating public/private rsa key pair. <br />
Enter file in which to save the key (/home/user/.ssh/id_rsa): <br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in /home/user/.ssh/id_rsa. <br />
Your public key has been saved in /home/user/.ssh/id_rsa.pub. <br />
The key fingerprint is: <br />
29:0f:37:fd:73:4c:85:a7:59:45:8e:75:62:bb:55:21 user@local</p>
</blockquote>
<p>This will generate the public/private key pair in <strong><em>~/.ssh/</em></strong>. Now, you need to upload your public key to the remote server by typing:</p>
<blockquote>
<p>ssh-copy-id user@www.example.com</p>
</blockquote>
<p>This command will read the public key in <strong><em>~/.ssh/id_rsa.pub</em></strong> and append it to <strong><em>~/.ssh/authorized_keys</em></strong> on the remote server.</p>
<h3 id="changing-the-pass-phrase">Changing the pass-phrase</h3>
<p>You can change the pass-phrase of an existing private key at anytime by issuing the following command:</p>
<blockquote>
<p>ssh-keygen -p</p>
</blockquote>
<p>This will re-encrypt the private key with the new pass-phrase. The public key remains untouched, so you don’t need to replace the key on your server. If you forget to include the <strong><em>-p</em></strong> argument, then a new public/private key pair will be generated instead and you will have to re-upload the public key to your servers.</p>
<h3 id="private-key-without-pass-phrases">Private key without pass-phrases</h3>
<p>It is possible to generate your private key without a pass-phrase, but doing so is not a good idea. True, you won’t have to enter your password ever again, but without it, your private key is vulnerable. If someone manages to copy your private key, he can use it to login to your remote system.</p>
<h2 id="ssh-agent-with-kde">SSH agent with KDE</h2>
<p>I had trouble making ssh-agent work with ksshaskpass, after much googling, i found the solution <a href="https://askubuntu.com/questions/82976/how-to-get-openssh-to-use-ksshaskpass-under-kde">here</a></p>
<p>Adding the following line to my <strong><em>~/.bashrc</em></strong> solved the problem for me:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">ssh<span class="o">()</span> <span class="o">{</span>
<span class="k">if</span> <span class="o">!</span> ssh-add <span class="nt">-l</span> &>/dev/null<span class="p">;</span> <span class="k">then
</span>ssh-add </dev/null &>/dev/null
<span class="k">fi
</span><span class="nb">command </span>ssh <span class="s2">"</span><span class="nv">$@</span><span class="s2">"</span>
<span class="o">}</span></code></pre></figure>
ASM delay subroutines for PIC16 mcuhttps://https://www.frigon.info/posts/programming/pic-delay-asm/2014-02-14T00:02:50-05:002014-02-14T00:02:50-05:00These are the delay subroutines i use in my PIC projects. It was written for the PIC16 family but should be compatible with the 18F instruction set as well.
The simplest way to produce delay is to write a subroutine that waste instructions cycles for the desired amount of time. This method should not be used for application that require a high level of precision since the delay subroutine may be halted by interrupts. The delay is offset by the time it takes to execute the interrupt service routine. For short delays however, this should not be a problem.
<p>These are the delay subroutines i use in my PIC projects. It was written for the PIC16 family but should be compatible with the 18F instruction set as well.</p>
<p>The simplest way to produce delay is to write a subroutine that waste instructions cycles for the desired amount of time. This method should not be used for application that require a high level of precision since the delay subroutine may be halted by interrupts. The delay is offset by the time it takes to execute the interrupt service routine. For short delays however, this should not be a problem.</p>
<!--more-->
<h2 id="how-many-cycles-are-required">How many cycles are required</h2>
<p>Let’s say that the processor clock runs at 8 MHZ. It takes 4 clock pulses to execute one instruction cycle. At 8 MHZ, the processor is able to execute 2 millions instructions per seconds. It also means that each instructions takes 0.0000005 seconds (0.5 micro seconds) to execute. To produce a 50 milliseconds delay, you then need to execute 100,000 instruction cycles.</p>
<p>Here is the formula to find out the number of instructions required :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>i_time = 1 / (fosc / 4)
0.0000005 = 1 / (8000000 / 4)
n = time / i_time
100000 = 0.05 / 0.0000005
</code></pre></div></div>
<h2 id="the-delay-subroutines">The delay subroutines</h2>
<p>There are 4 delay subroutines :</p>
<table>
<thead>
<tr>
<th> </th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<td>delay10cty</td>
<td>WREG x 10 cycles</td>
</tr>
<tr>
<td>delay100cty</td>
<td>WREG x 100 cycles</td>
</tr>
<tr>
<td>delay1kcty</td>
<td>WREG x 1000 cycles</td>
</tr>
<tr>
<td>delay10kcty</td>
<td>WREG x 10000 cycles</td>
</tr>
</tbody>
</table>
<p>Each routines can be looped ‘n’ times specified by WREG. For instance, if you put D’50 in WREG before calling delay10cty, the routine will waste 500 cycles. The routines takes into account the time it takes to call the routine itself except for delay10kcty. The 3 cycles it takes to call the routine is negligible over 10000 cycles.</p>
<p>The maximum possible delay using these routines is 2,550,000 instruction cycles or 1.275 second @ 8 MHZ</p>
<h2 id="usage-example">Usage example</h2>
<p>50 milliseconds:</p>
<figure class="highlight"><pre><code class="language-nasm" data-lang="nasm"> <span class="nf">movlw</span> <span class="nv">D</span><span class="s">'100'</span>
<span class="nf">call</span> <span class="nv">delay1kcty</span></code></pre></figure>
<p>250 milliseconds:</p>
<figure class="highlight"><pre><code class="language-nasm" data-lang="nasm"> <span class="nf">movlw</span> <span class="nv">D</span><span class="s">'50'</span>
<span class="nf">call</span> <span class="nv">delay10kcty</span></code></pre></figure>
<h2 id="the-code">The code</h2>
<script src="https://gist.github.com/bfrigon/3a052523fc82d71a9bbc9e7e0426b8ae.js?file=delay.asm"> </script>
LED strip lighting for my a/v rack cabinethttps://https://www.frigon.info/posts/diy/led-strip-lighting/2013-10-23T15:41:29-04:002013-10-23T15:41:29-04:00I installed a LED strip in my a/v rack to make it easier to see when I’m working on it. My plan was to buy white LEDs but it turned out to be cheaper to get RGB strips of the length I needed where I bought them. The kit comes with a controller and a remote control which allows you to set the intensity and change colors.
<p>I installed a LED strip in my <a href="/posts/diy/rack-cabinet/">a/v rack</a> to make it easier to see when I’m working on it. My plan was to buy white LEDs but it turned out to be cheaper to get RGB strips of the length I needed where I bought them. The kit comes with a controller and a remote control which allows you to set the intensity and change colors.</p>
<!--more-->
<h2 id="led-strips">LED strips</h2>
<p>I must say the white is not 100% pure, it has a blueish hue (much less than it appears in the pictures thought) but it doesn’t bother me much. Anyway, it’s still better than my previous lighting “solution”:</p>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/rack-lighting/rack-old-lighting.jpg" title="Old LED lighting">
<div class="img-container" style="padding: 133% 0px 0px 0px; width: 240px;">
<img src="/images/library/rack-lighting/thumbs/rack-old-lighting.jpg" alt="Old LED lighting" title="Old LED lighting" width="240" height="320" />
</div>
</a>
</div>
<div class="media image alignleft frame">
<a class="popup" href="/images/gallery/rack-led-lighting/rack-back-light-white.jpg" title="Rear view of the rack with led lighting on (White)">
<div class="img-container" style="padding: 133% 0px 0px 0px; width: 240px;">
<img src="/images/library/rack-lighting/thumbs/rack-back-light-white.jpg" alt="Rear view of the rack with led lighting on (White)" title="Rear view of the rack with led lighting on (White)" width="240" height="320" />
</div>
</a>
</div>
<h2 id="installation">Installation</h2>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/rack-lighting/led-strip-cutting-point.jpg" title="Led strip cut point">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 160px;">
<img src="/images/library/rack-lighting/thumbs/led-strip-cutting-point.jpg" alt="Led strip cut point" title="Led strip cut point" width="160" height="120" />
</div>
</a>
</div>
<p>These strip can be cut to the length you need. Every third LEDs, there is a quarter-inch of exposed traces where you can cut the strip without damaging it. Once it is cut, you are left with 4 tabs (12v, red, blue and green) on each ends which you can use to solder wires directly to the other strip or a connector to the controller. Usually, the spool already have a connector soldered to one end. It is important to make sure the wires goes to the controller and other parts of the strip in the correct order, otherwise it won’t work or the wrong colors are going to be produced.</p>
<div class="media image alignright frame">
<a class="popup" href="/images/gallery/rack-led-lighting/rgb-led-strip.jpg" title="Led strip installed in the upper section of the rack">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/rack-led-lighting/thumbs/rgb-led-strip.jpg" alt="Led strip installed in the upper section of the rack" title="Led strip installed in the upper section of the rack" width="128" height="96" />
</div>
</a>
</div>
<p>These strips have a 3M self-adhesive backing so they are easy to install. However, i found out that the adhesive is not very strong. I did not have any problems for vertical runs but when i tried to install them upside down, they came off after a while. The weight of the wire was too much for the adhesive. To correct this problem, i fixed the strip in place with 2 inch wide clear tape and used wire clips to hold the wires.</p>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/rack-lighting/led-strip-rgb-controller.jpg" title="RGB led strip controller with remote control">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 160px;">
<img src="/images/library/rack-lighting/thumbs/led-strip-rgb-controller.jpg" alt="RGB led strip controller with remote control" title="RGB led strip controller with remote control" width="160" height="120" />
</div>
</a>
</div>
<p>The controller I bought have an IR receiver and comes with a remote control. You can set the intensity and choose preset colors and effects (strobe, fade). When you turn the controller off, it will remember its previous setting, so you could use a PSU with an on-off switch and use the remote control only to switch colors.</p>
<h2 id="results">Results</h2>
<p>I bought these mainly to light up the back of my <a href="/posts/diy/rack-cabinet/">a/v rack</a> while i work on it but the way the light shines through the vents on the front is quite nice too.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-back-light-white.jpg" title="Rear view of the rack with led lighting on (White)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-back-light-white.jpg" alt="Rear view - lighting (white)" title="Rear view of the rack with led lighting on (White)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-back-light-blue.jpg" title="Rear view of the rack with led lighting on (Blue)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-back-light-blue.jpg" alt="Rear view - lighting (blue)" title="Rear view of the rack with led lighting on (Blue)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-back-light-green.jpg" title="Rear view of the rack with led lighting on (Green)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-back-light-green.jpg" alt="Rear view - lighting (green)" title="Rear view of the rack with led lighting on (Green)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-back-light-red.jpg" title="Rear view of the rack with led lighting on (Red)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-back-light-red.jpg" alt="Rear view - lighting (red)" title="Rear view of the rack with led lighting on (Red)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-front-light-green.jpg" title="Front view of the rack with led lighting on (Green)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-front-light-green.jpg" alt="Front view - lighting (green)" title="Front view of the rack with led lighting on (Green)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-front-light-purple.jpg" title="Front view of the rack with led lighting on (Purple)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-front-light-purple.jpg" alt="Front view - lighting (purple)" title="Front view of the rack with led lighting on (Purple)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-front-light-red.jpg" title="Front view of the rack with led lighting on (Red)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-front-light-red.jpg" alt="Front view - lighting (red)" title="Front view of the rack with led lighting on (Red)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rack-front-light-white.jpg" title="Front view of the rack with led lighting on (White)">
<img src="/images/gallery/rack-led-lighting/thumbs/rack-front-light-white.jpg" alt="Front view - lighting (white)" title="Front view of the rack with led lighting on (White)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip.jpg" title="Installed RGB led strip">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip.jpg" alt="" title="Installed RGB led strip" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/rgb-led-strip.jpg" title="Led strip installed in the upper section of the rack">
<img src="/images/gallery/rack-led-lighting/thumbs/rgb-led-strip.jpg" alt="RGB strip - upper section" title="Led strip installed in the upper section of the rack" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip-off.jpg" title="Led strip (Off)">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip-off.jpg" alt="" title="Led strip (Off)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip-blue.jpg" title="Led strip (Blue)">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip-blue.jpg" alt="" title="Led strip (Blue)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip-green.jpg" title="Led strip (Green)">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip-green.jpg" alt="" title="Led strip (Green)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip-red.jpg" title="Led strip (Red)">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip-red.jpg" alt="" title="Led strip (Red)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-led-lighting/led-strip-white.jpg" title="Led strip (White)">
<img src="/images/gallery/rack-led-lighting/thumbs/led-strip-white.jpg" alt="" title="Led strip (White)" width="128" height="96" />
</a>
</span>
</div>
Linux alarm clockhttps://https://www.frigon.info/posts/projects/alarm-clock/2013-10-07T14:31:30-04:002013-10-07T14:31:30-04:00I’ve been working on this project for some time now. This is my alarm clock running Linux.
These are the feature I wanted:
NTP time synchronization
Touch keypad
Transparent seven-segment display
Web interface to configure the clock, upload alarm sound, etc.
Battery backup
<p>I’ve been working on this project for some time now. This is my alarm clock running Linux.</p>
<p>These are the feature I wanted:</p>
<ul>
<li>NTP time synchronization</li>
<li>Touch keypad</li>
<li>Transparent <a href="/posts/projects/alarm-clock/display/">seven-segment display</a></li>
<li>Web interface to configure the clock, upload alarm sound, etc.</li>
<li>Battery backup</li>
</ul>
<!--thumbnail-->
<!--more-->
<h2 id="why">Why?</h2>
<p>I have an old digital alarm clock which I had for almost 25 years. It does not have a battery to keep the time in case of a power failure so I plug it on the UPS near my computer. I noticed something weird, whenever the UPS in running on battery, the clock actually runs faster. It keeps it’s time synchronized to the frequency of the power line (60 Hz). I think that when my UPS is running on battery, the DC/AC inverter is producing a higher frequency and it screw up the clock time base.</p>
<p>Anyway, this clock is ready for retirement, it was time for a new one. So, why not build my own then?</p>
<p>I based my design on a processor capable of running Linux because it is more flexible and already offers reliable tools for many of the features I want and also the one I have not thought of yet. I realize that running Linux on a simple alarm clock is a bit overkill, I’m sure there is a way to do all that with a microcontroller, but I don’t have much experience in programming on MCU. Also, this project was an excuse to stick Linux into yet another device.</p>
<p>This is more than a clock, it’s a platform for experimenting. There are all sorts of interesting things you could do with it. For example, turn on the lights in the room when the alarm goes off by sending a command to an Insteon hub. I also added an external USB as well as an internal expansion headers for add-ons.</p>
<h2 id="design">Design</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/alarm-clock-front.jpg" title="Front view">
<img src="/images/gallery/alarm-clock-assembly/thumbs/alarm-clock-front.jpg" alt="" title="Front view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/alarm-clock-back.jpg" title="Back view">
<img src="/images/gallery/alarm-clock-assembly/thumbs/alarm-clock-back.jpg" alt="" title="Back view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/alarm-clock-display.jpg" title="Alarm clock display">
<img src="/images/gallery/alarm-clock-assembly/thumbs/alarm-clock-display.jpg" alt="" title="Alarm clock display" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/alarm-clock-display-in-dark.jpg" title="Alarm clock display in the dark">
<img src="/images/gallery/alarm-clock-assembly/thumbs/alarm-clock-display-in-dark.jpg" alt="" title="Alarm clock display in the dark" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/alarm-clock-side.jpg" title="Side view">
<img src="/images/gallery/alarm-clock-assembly/thumbs/alarm-clock-side.jpg" alt="" title="Side view" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-assembly/assembly-top.jpg" title="Final assembly">
<img src="/images/gallery/alarm-clock-assembly/thumbs/assembly-top.jpg" alt="" title="Final assembly" width="128" height="96" />
</a>
</span>
</div>
<h3 id="3d-models">3D models</h3>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-model/final-render.jpg" title="3D model render (model A)">
<img src="/images/gallery/alarm-clock-model/thumbs/final-render.jpg" alt="" title="3D model render (model A)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-model/final-render-dark.jpg" title="3D model render (Model A) - In the dark">
<img src="/images/gallery/alarm-clock-model/thumbs/final-render-dark.jpg" alt="" title="3D model render (Model A) - In the dark" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-model/final-render-back.jpg" title="3D model render (Model A) - Back">
<img src="/images/gallery/alarm-clock-model/thumbs/final-render-back.jpg" alt="" title="3D model render (Model A) - Back" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-model/model-b.jpg" title="3D model render (Model B)">
<img src="/images/gallery/alarm-clock-model/thumbs/model-b.jpg" alt="" title="3D model render (Model B)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-model/model-b-dark.jpg" title="3D model render (Model B) - In the dark">
<img src="/images/gallery/alarm-clock-model/thumbs/model-b-dark.jpg" alt="" title="3D model render (Model B) - In the dark" width="128" height="96" />
</a>
</span>
</div>
<h3 id="display">Display</h3>
<p>It is a four digits <a href="/posts/projects/alarm-clock/display/">seven-segment display</a> encapsulated in a clear casting epoxy block measuring 5” by 2 1/4” by 1”. Each digit is one inch wide by 1.5 inches high and has 0.3-inch wide segments.</p>
<div class="media image alignleft frame">
<a class="link" href="/posts/projects/alarm-clock/display" title="More details about the display">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 128px;">
<img src="/images/gallery/alarm-clock-display-casting/thumbs/casting-second-layer.jpg" alt="" title="More details about the display" width="128" height="96" />
</div>
</a>
</div>
<p><strong>More details about the display construction <a href="/posts/projects/alarm-clock/display/">here</a>.</strong></p>
<h3 id="drawings">Drawings</h3>
<p>Here are the drawings for the version with the LED matrix display (model A) and the one with four digits seven-segment display (model B).</p>
<div class="media image alignnone frame">
<a class="link" href="https://raw.githubusercontent.com/bfrigon/project-alarm-clock/master/drawings/design/clk-dwg.pdf" title="Drawings - model A">
<div class="caption">Drawings - model A</div>
<div class="img-container" style="padding: 66% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/alarm-clock-drawings.jpg" alt="" title="Drawings - model A" width="300" height="200" />
</div>
</a>
</div>
<div class="media image alignnone frame">
<a class="link" href="https://raw.githubusercontent.com/bfrigon/project-alarm-clock/master/drawings/design/clk-dwg-model-b.pdf" title="Drawings - Model B">
<div class="caption">Drawings - Model B</div>
<div class="img-container" style="padding: 66% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/alarm-clock-drawings-model-b.jpg" alt="" title="Drawings - Model B" width="300" height="200" />
</div>
</a>
</div>
<p>All mechanical drawings and schematics are available on <a href="https://github.com/bfrigon/alarm-clock-hardware/tree/master/drawings">Github</a></p>
<h2 id="construction">Construction</h2>
<h3 id="case">Case</h3>
<p>My design is based around the <a href="http://www.digikey.ca/product-search/en?vendor=0&keywords=1553DBKBAT">1553DBKBAT</a> plastic enclosure from Hammond Mfg but it required a few modifications. The opening on the top for the <a href="/posts/projects/alarm-clock/display/">display</a> connector, the holes for the volume control buttons on the end panel and the holes for the speaker on the bottom. For those cuts, I used the tried-and-true method which consists of printing a 1:1 template from the CAD software and gluing it onto the surface to drill or cut.</p>
<p>The sides of this enclosure are made from a softer plastic, almost like rubber. I was not too sure about cutting it myself, so I went to local shop (<a href="http://www.umake.ca">umake.ca</a>) who laser cut it for me. I built a supporting jig so that the side to cut on the enclosure would face upward. A sent them a DXF file with the coordinates relative to a fixed reference point on the jig.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-case/case-drill-template-bottom.jpg" title="Drill template for speaker">
<img src="/images/gallery/alarm-clock-case/thumbs/case-drill-template-bottom.jpg" alt="" title="Drill template for speaker" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-case/case-drill-template-top.jpg" title="Drill template - top">
<img src="/images/gallery/alarm-clock-case/thumbs/case-drill-template-top.jpg" alt="" title="Drill template - top" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-case/case-bottom.jpg" title="Finished case">
<img src="/images/gallery/alarm-clock-case/thumbs/case-bottom.jpg" alt="" title="Finished case" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-case/laser-cutting-jig.jpg" title="Laser cuttin jig">
<img src="/images/gallery/alarm-clock-case/thumbs/laser-cutting-jig.jpg" alt="" title="Laser cuttin jig" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-case/laser-cutting-jig2.jpg" title="Laser cutting jig result">
<img src="/images/gallery/alarm-clock-case/thumbs/laser-cutting-jig2.jpg" alt="" title="Laser cutting jig result" width="128" height="96" />
</a>
</span>
</div>
<h3 id="top-graphic-overlay">Top graphic overlay</h3>
<p>I designed the overlay graphics in Inkscape and printed it on <a href="http://www.papilio.com/inkjet%20waterproof%20adhesive%20film%20media.html">Papilio waterproof inkjet vinyl paper</a> (matte). Although, this paper is waterproof, I sprayed a thin layer of acrylic to seal it permanently. It is best to apply multiple thin coats while holding the can at 20cm from the surface. On the first attempt, I put too much at once and the colors washed off.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-led-diffuser-holes.jpg" title="LED difuser holes">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-led-diffuser-holes.jpg" alt="" title="LED difuser holes" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-led-diffuser-kepton.jpg" title="Kepton tape to stop the epoxy from flowing">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-led-diffuser-kepton.jpg" alt="Kepton tape" title="Kepton tape to stop the epoxy from flowing" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-led-diffuser-epoxy.jpg" title="Filling the holes with epoxy">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-led-diffuser-epoxy.jpg" alt="" title="Filling the holes with epoxy" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-led-diffuser.jpg" title="Led diffuser">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-led-diffuser.jpg" alt="" title="Led diffuser" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-overlay-sheet.jpg" title="Keypad overlay printed on vinyl paper.">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-overlay-sheet.jpg" alt="" title="Keypad overlay printed on vinyl paper." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-keypad-overlay/keypad-overlay.jpg" title="Keypad overlay finished.">
<img src="/images/gallery/alarm-clock-keypad-overlay/thumbs/keypad-overlay.jpg" alt="" title="Keypad overlay finished." width="128" height="96" />
</a>
</span>
</div>
<h3 id="speaker-holder">Speaker holder</h3>
<p>I made this part using the same epoxy mix I used for the segments diffuser for the <a href="/posts/projects/alarm-clock/display/">display</a>.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-holder-model.jpg" title="Speaker holder model - Cutting each layers on bainbridge cardboard.">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-holder-model.jpg" alt="Speaker holder cardboard model" title="Speaker holder model - Cutting each layers on bainbridge cardboard." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-holder-cardboard-model.jpg" title="Speaker holder cardboard model assembled.">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-holder-cardboard-model.jpg" alt="Cardboard model assembled" title="Speaker holder cardboard model assembled." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-holder-mold.jpg" title="Making the silicon mold for the speaker holder.">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-holder-mold.jpg" alt="Speaker holder - silicon mold" title="Making the silicon mold for the speaker holder." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-holder-casting.jpg" title="Pouring the casting epoxy in the mold">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-holder-casting.jpg" alt="Speaker holder - casting epoxy" title="Pouring the casting epoxy in the mold" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-holder.jpg" title="Speaker holder finished">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-holder.jpg" alt="" title="Speaker holder finished" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-speaker-holder/speaker-assembly.jpg" title="Speaker assembly">
<img src="/images/gallery/alarm-clock-speaker-holder/thumbs/speaker-assembly.jpg" alt="" title="Speaker assembly" width="128" height="96" />
</a>
</span>
</div>
<h2 id="hardware">Hardware</h2>
<h3 id="processor">Processor</h3>
<p>I was looking for something compact that could easily run Linux, so I opted for an <a href="http://www.acmesystems.it/aria">Aria G25 SOM</a> (System-On-Module). It is based on an ARM <a href="http://www.atmel.com/images/atmel-11032-32-bit-arm926ej-s-microcontroller-sam9g25_datasheet.pdf">AT91SAM9G25</a> processor running at 400 MHz and have all the basic hardware (memory, ethernet PHY, power regulator) integrated. It is packaged in a 40mm by 40mm PCB (50mil pads pitch) that can be soldered directly to the motherboard.</p>
<p>This processor provides all the necessary I/O: Ethernet, 2 I2C buses, 2 SPI buses, 3 USB host ports, up to 60 GPIO lines and an SD card interface.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-motherboard/motherboard-pcb.jpg" title="Motherboard pcb">
<img src="/images/gallery/alarm-clock-motherboard/thumbs/motherboard-pcb.jpg" alt="" title="Motherboard pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-motherboard/motherboard-aria-g25-top.jpg" title="Motherboard - Top side, Aria G25 module">
<img src="/images/gallery/alarm-clock-motherboard/thumbs/motherboard-aria-g25-top.jpg" alt="Motherboard - Top side" title="Motherboard - Top side, Aria G25 module" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-motherboard/motherboard-bottom.jpg" title="Motherboard - Bottom side">
<img src="/images/gallery/alarm-clock-motherboard/thumbs/motherboard-bottom.jpg" alt="" title="Motherboard - Bottom side" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-motherboard/motherboard-installed.jpg" title="Motherboard - Installed">
<img src="/images/gallery/alarm-clock-motherboard/thumbs/motherboard-installed.jpg" alt="" title="Motherboard - Installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-motherboard/its-alive.jpg" title="It's alive!!!">
<img src="/images/gallery/alarm-clock-motherboard/thumbs/its-alive.jpg" alt="" title="It's alive!!!" width="128" height="96" />
</a>
</span>
</div>
<h3 id="touch-keypad">Touch keypad</h3>
<p>For the keypad, I choose the <a href="http://www.atmel.com/Images/Atmel-9625-AT42-QTouch-BSW-AT42QT1085_Datasheet.pdf">AT42QT1085</a> QTouch sensor IC from Atmel. It provides eight capacitive sensing inputs and 16 general purpose I/O. I use three of the GPIO for LEDs under the snooze, time set, and alarm set buttons. Those LEDs are reverse mount SMT (OSRAM P47F). Since the LEDs are mounted inside the sensing electrode area, using a standard SMT led would split the electrode and remove more area thus, making the electrode less sensitive. I also added, as suggested in the datasheet, a 10nF bypass caps to the cathodes of each LEDs to prevent false detections or stuck keys when the LED is switched off (Hi-Z state).</p>
<p>This chip communicates with the host using the SPI protocol with a maximum clock frequency of 750kHz. To make it works in Linux was not so easy. I enabled hardware SPI support and SPIDEV in the kernel config. The first byte of a transaction was received correctly, but all subsequent bytes failed intermittently. This is because the QT1085 requires at least 100 microseconds between each byte. The actual delay, even when setting the speed at 500 kHz (which is the minimum), was not enough. To the best of my knowledge, there is no way to specify an additional delay between each byte.</p>
<p>I was able to bypass this problem by sending only one byte per IOCTL call and setting the cs_change option to 0. This cause the chip select line to remain active after each transaction. That way, the delay between the calls was more than enough.</p>
<p>The touch keypad PCB is held in place with strips of <a href="http://solutions.3m.com/wps/portal/3M/en_US/Adhesives/Tapes/Products/~/3M-Adhesive-Transfer-Tape-467MP?N=5962555+3294274353&rt=rud">3M 467MP adhesive</a> film.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/alarm-clock-touch-keypad/touch-keypad-pcb.jpg" title="Touch keypad pcb">
<img src="/images/gallery/alarm-clock-touch-keypad/thumbs/touch-keypad-pcb.jpg" alt="" title="Touch keypad pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-touch-keypad/touch-keypad-assembled.jpg" title="Touch keypad assembled">
<img src="/images/gallery/alarm-clock-touch-keypad/thumbs/touch-keypad-assembled.jpg" alt="" title="Touch keypad assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-touch-keypad/touch-keypad-adhesive.jpg" title="467MP adhesive">
<img src="/images/gallery/alarm-clock-touch-keypad/thumbs/touch-keypad-adhesive.jpg" alt="" title="467MP adhesive" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-touch-keypad/touch-keypad-adhesive-trimmed.jpg" title="Touch keypad - adhesive">
<img src="/images/gallery/alarm-clock-touch-keypad/thumbs/touch-keypad-adhesive-trimmed.jpg" alt="" title="Touch keypad - adhesive" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/alarm-clock-touch-keypad/touch-keypad-installed.jpg" title="Touch keypad installed">
<img src="/images/gallery/alarm-clock-touch-keypad/thumbs/touch-keypad-installed.jpg" alt="" title="Touch keypad installed" width="128" height="96" />
</a>
</span>
</div>
<h3 id="sound-card">Sound card</h3>
<p>On the motherboard, there is an integrated USB sound card based on the <a href="http://www.ti.com/lit/ds/symlink/pcm2704c.pdf">PCM2704C</a> codec IC and a <a href="http://www.ti.com/lit/ds/symlink/tpa2005d1.pdf">TPA2005D1</a> amplifier to drive the tiny speaker in all its glorious, ground shaking 1.5 watts! I was not going for the best sound quality here, the speaker I choose is an <a href="http://www.puiaudio.com/pdf/AS04008CO-2-R.pdf">AS04008CO-2-R</a> which is 40mm long by 20mm wide and has a frequency response of 200 HZ to 20 kHz.</p>
<p>I was disappointed when I first tested it though. Outside the case, the sound was horrible but once it was installed inside the enclosure, it sounded much better.</p>
<div class="media image alignnone frame">
<a class="link" href="https://www.youtube.com/watch?v=DnK66ylj4cE" title="Watch on youtube : Alarm clock test">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 480px;">
<img src="/images/post-thumbnail/youtube-alarm-clock.jpg" alt="" title="Watch on youtube : Alarm clock test" width="480" height="360" />
</div>
</a>
</div>
<h3 id="battery-backup">Battery backup</h3>
<p>This part of the project is not completed yet. The circuit is going to be on a separate board which fits on the header near the ethernet connector. This header has 2 pins for voltage input, 2 pins for output, i2c bus and a pin for monitoring auxiliary voltage. For the moment, there are two jumpers that tie VIN and VOUT.</p>
<h2 id="software">Software</h2>
<p>As of writing this article, the hardware portion of this project is almost done and I’m beginning to work on the software.</p>
<p>The clock is running the Linux kernel 3.18 and I used <a href="https://github.com/bfrigon/alarm-clock-buildroot">Buildroot</a> to make my custom distribution.</p>
<p>For the <a href="https://github.com/bfrigon/alarm-clock-at91bootstrap">bootloader</a>, I used the AT91bootstrap from <a href="https://github.com/tanzilli/at91bootstrap">Sergio Tanzilli</a> as a starting point and made my modifications. When the <a href="/posts/projects/alarm-clock/display/">display</a> is powered up, the digits are at full brightness. The bootloader sets the brightness to the default level and puts “- - : - -“ on the display while Linux is booting. Other devices are initialized later in the boot process or by the main application.</p>
<p>The clock application is written in Python. For now, it does not do much except showing time.</p>
<h2 id="github-repositories">Github repositories</h2>
<p>These are the repositories on Github for this project :</p>
<ul>
<li><a href="https://github.com/bfrigon/alarm-clock-hardware">Hardware design</a></li>
<li><a href="https://github.com/bfrigon/alarm-clock-at91bootstrap">AT91bootstrap</a></li>
<li><a href="https://github.com/bfrigon/alarm-clock-buildroot">Buildroot (Kernel + file system)</a></li>
<li><a href="https://github.com/bfrigon/alarm-clock-app">Clock application</a></li>
</ul>
Custom 19 inch rack cabinethttps://https://www.frigon.info/posts/diy/rack-cabinet/2013-08-12T03:27:33-04:002013-08-12T03:27:33-04:00This is the rack cabinet i made for my a/v and network equipment. The cabinet is 75.5”H x 20.5”W x 19”D and consist of 3 sections, the 2 upper sections are 19-1/8” wide rack mount space and the lower section is a 16” height compartment to store my UPS. There are 18 units of rack space in the middle section and 12 units in the upper section.
<p>This is the rack cabinet i made for my a/v and network equipment. The cabinet is 75.5”H x 20.5”W x 19”D and consist of 3 sections, the 2 upper sections are 19-1/8” wide rack mount space and the lower section is a 16” height compartment to store my UPS. There are 18 units of rack space in the middle section and 12 units in the upper section.</p>
<!--more-->
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/cable-organizer.jpg" title="A cable organizer i made using leftover wire duct and a 1U blank.">
<img src="/images/gallery/rack-cabinet/thumbs/cable-organizer.jpg" alt="Cable organizer" title="A cable organizer i made using leftover wire duct and a 1U blank." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/ups.jpg" title="Compartment for my UPS (lower section)">
<img src="/images/gallery/rack-cabinet/thumbs/ups.jpg" alt="UPS compartment" title="Compartment for my UPS (lower section)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/rack-shelf.jpg" title="Rack rails">
<img src="/images/gallery/rack-cabinet/thumbs/rack-shelf.jpg" alt="" title="Rack rails" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/rack-cabinet-upper-section.jpg" title="Back (upper section)">
<img src="/images/gallery/rack-cabinet/thumbs/rack-cabinet-upper-section.jpg" alt="" title="Back (upper section)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/rack-cabinet.jpg" title="Back (middle section)">
<img src="/images/gallery/rack-cabinet/thumbs/rack-cabinet.jpg" alt="" title="Back (middle section)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/rack-cabinet-back.jpg" title="Wire ducts">
<img src="/images/gallery/rack-cabinet/thumbs/rack-cabinet-back.jpg" alt="" title="Wire ducts" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/power-distribution.jpg" title="Cheap power distribution">
<img src="/images/gallery/rack-cabinet/thumbs/power-distribution.jpg" alt="" title="Cheap power distribution" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/rack-cabinet/rack-cabinet-front.jpg" title="Front view">
<img src="/images/gallery/rack-cabinet/thumbs/rack-cabinet-front.jpg" alt="" title="Front view" width="128" height="96" />
</a>
</span>
</div>
<h2 id="design">Design</h2>
<h3 id="rack-space">Rack space</h3>
<p>This rack is obviously not designed to fit a standard server chassis. The 18U section has a depth clearance of 16-3/8” and the 12U section, 13-9/16” which is enough to accommodate most small server chassis (mini-itx).</p>
<h3 id="ventilation">Ventilation</h3>
<p>The equipment mounted in this rack produce very little to no heat so i do not need forced air cooling. The opening at the back and the 1U vent panels at the front are more than enough to keep everything cool. You could cut holes at the top and upper shelf and install 120mm fans.</p>
<h2 id="drawings">Drawings</h2>
<p>Here are the drawings of my rack (PDF) :</p>
<p><a href="/files/rack/rack-dwg.pdf">Download</a></p>
<div class="media image alignnone frame">
<a class="link" href="/files/rack/rack-dwg.pdf" title="Rack cabinet drawings">
<div class="img-container" style="padding: 65% 0px 0px 0px; width: 300px;">
<img src="/images/library/rack-cabinet/thumbs/rack-drawings.jpg" alt="Rack cabinet drawings" title="Rack cabinet drawings" width="300" height="195" />
</div>
</a>
</div>
<h2 id="construction">Construction</h2>
<h3 id="rack-rails">Rack rails</h3>
<p>I bought 4 18U “L” steel rack rails on Ebay and used two of them as is and cut the others to size (12U). I designed the cabinet so that the opening is exactly 19-1/8” wide. This gives 1/16” wiggle room on each side.
Power rails and cable management</p>
<h3 id="power-distribution">Power distribution</h3>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/rack-cabinet/power-rails.jpg" title="Power distribution">
<div class="img-container" style="padding: 133% 0px 0px 0px; width: 90px;">
<img src="/images/library/rack-cabinet/thumbs/power-rails.jpg" alt="Power distribution" title="Power distribution" width="90" height="120" />
</div>
</a>
</div>
<p>I wanted to add a power strip on each side but did not find any that were the length I needed nor one that was reasonably priced, so i went with the poor man’s solution instead. I installed three power strip : two for the a/v equipment and one for network.</p>
<p>There are two 1.5”W x 1.5”D wire duct on each side of the middle section and 1.25”W x 1”D (white) on each side in the upper section and at the top and bottom of the middle section.</p>
<h3 id="rackmount-cable-organiser">Rackmount cable organiser</h3>
<div class="media image alignright frame">
<a class="popup" href="/images/library/rack-cabinet/cable-organizer.jpg" title="Cable management">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 160px;">
<img src="/images/library/rack-cabinet/thumbs/cable-organizer.jpg" alt="Cable management" title="Cable management" width="160" height="120" />
</div>
</a>
</div>
<p>I also used the left over wire duct to make a rackmount cable organizer. I used a 1U blank panel and attached the wire duct on the back side of the panel and cut openings on each side for the wires.</p>
<h3 id="material">Material</h3>
<p>I Used 11/16” laminated pine sheets. They are 2 inch strips of solid pine glued together to form a 8 by 4 feet panel. That was the cheapest (after melamine) that I could find at my local hardware store. You can easily see the individual strips but once they are properly sanded, stained and varnished, they don’t look too bad. However, the sides which are cut against the grain are less pretty. To hide them, I applied a 3/4 inch iron-on pine veneer strip on the edges and trimmed the excess.</p>
<p>The parts are joined together with glued wooden dowels (5/16”) and steel corner braces on top and bottom of the rack (see the <a href="/files/rack/rack-dwg.pdf">drawings</a>).</p>
<h2 id="finishing">Finishing</h2>
<p>Because pine tends to not absorb stain evenly, you should use a pre-stain conditioner (minwax) before applying the stain. You should always use a conditioner even if you intend to paint it black otherwise it will look like crap!</p>
Recording voice prompts with Audacity and SOXhttps://https://www.frigon.info/posts/asterisk/custom-voice-prompts/2013-07-27T19:28:23-04:002013-07-27T19:28:23-04:00Asterisk comes with an extensive set of voice prompts in many languages but there are situations where you may need to record your own voice prompts. It can be tricky to get it right. This article describes the method I use to achieve that. I use Audacity and SOX to record and convert the voice prompt files.
<p>Asterisk comes with an extensive set of voice prompts in many languages but there are situations where you may need to record your own voice prompts. It can be tricky to get it right. This article describes the method I use to achieve that. I use Audacity and SOX to record and convert the voice prompt files.</p>
<!--more-->
<p>I use Linux, so <strong>I did not test this method with Audacity for Windows</strong>. I don’t know if SOX if available on Windows. Also, i know that you can export in ULAW,ALAW and GSM format directly with Audacity, but I did not test that either. The reason I use SOX is so that I can use a script to convert the prompts to multiple formats at once instead of manually doing it for each one..</p>
<h2 id="recording-your-own-custom-voice-prompts">Recording your own custom voice prompts</h2>
<p>If you have, or know someone with a good voice, you can record your voice prompts yourself with a microphone of decent quality. Try to find a place where you can control background noise.</p>
<p>You may also purchase your voice prompts online. They usually charge you by the word and send you back the recording in WAV format.</p>
<ul>
<li><a href="http://junewallack.com/store/new">June Wallack</a> (french, english)</li>
<li><a href="https://www.digium.com/en/products/ivr/allison-smith">Allison Smith</a> (english)</li>
</ul>
<p>personally, I use an online text to speech (tts) synthesizer to produce the prompts i need. I just record the output from the sound card for each prompts and put them together in a master file. By the way, yes, i am aware that you can use a TTS with Asterisk. I tried a few but did not find one of sufficient quality in french. I prefer to use pre-recorded prompts instead.</p>
<p>You can use these online TTS :</p>
<ul>
<li><a href="https://www.ispeech.org/text.to.speech">ispeech.org</a></li>
<li><a href="https://text-to-speech-demo.ng.bluemix.net/">IBM watson - tts demo</a></li>
</ul>
<h3 id="recording-with-audacity">Recording with audacity</h3>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/prompts-recording/capture.jpg" title="">
<div class="img-container" style="padding: 61% 0px 0px 0px; width: 425px;">
<img src="/images/library/prompts-recording/thumbs/capture.jpg" alt="" title="" width="425" height="261" />
</div>
</a>
</div>
<p>Make sure the audio track rate is 16000 Hz and also set the project rate to 16000 Hz. The track must also be 1 channel (mono) only.</p>
<h2 id="batch-exporting-with-audacity">Batch exporting with Audacity</h2>
<p>It is possible to export multiple parts of a file at once with Audacity. You can do that by creating labels. First, you need to select the part that you want to export and press <strong>CTRL+B</strong> or go to <strong>“Tracks > Add label at selection”</strong>. Then give a name to the label, Audacity will use this name to create the individual files. You can adjust the start and end position of the label later by using the “handles” on the label track.</p>
<div class="media static alignnone frame">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 500px;">
<img src="/images/library/prompts-recording/audacity-labels.jpg" alt="Create labels in audacity" title="Create labels in audacity" width="500" height="375" />
</div>
</div>
<p>I usually leave 60 milliseconds of silence before and after the prompts. It depends of where the prompts will be used. If it is at the end of a sentence, you can leave 100 ms after. For digits, you may need a shorter silence before and after to make it sound good when they are played back to back. For example, let’s say that i need three prompts : “The current temperature is”, “minus” and “15”. I will leave less silence after “minus” than the others. To test the silence delay, I copy and paste the three prompts together in another file and play it back. I adjust the delay until it sounds natural.</p>
<p>Click on <strong>File => Export multiple…</strong></p>
<div class="media static alignnone frame">
<div class="img-container" style="padding: 49% 0px 0px 0px; width: 627px;">
<img src="/images/library/prompts-recording/audacity-export-labels.jpg" alt="Exporting labels in audacity" title="Exporting labels in audacity" width="627" height="312" />
</div>
</div>
<p>Select <strong>“Other uncompressed format”</strong> in export format. Next, click on <strong>Options</strong></p>
<div class="media static alignnone frame">
<div class="img-container" style="padding: 50% 0px 0px 0px; width: 395px;">
<img src="/images/library/prompts-recording/audacity-export-settings.jpg" alt="Export options" title="Export options" width="395" height="200" />
</div>
</div>
<p>Select <strong>“Raw (header-less)”</strong> and <strong>“Signed 16-bit PCM”</strong>. Click <strong>OK</strong> and then, <strong>Export</strong></p>
<p>Audacity will export each segment defined by labels to a .raw file at the location you specified.</p>
<h2 id="convert-to-formats-used-by-asterisk">Convert to formats used by Asterisk</h2>
<p>I use sox to convert the files in other formats Asterisk uses (ulaw, alaw, gsm, etc…)</p>
<h3 id="sln16">SLN16</h3>
<p>The raw file audacity produced is already a signed 16 bit format, just rename the file to .sln16</p>
<h3 id="u-law">U-LAW</h3>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 input.raw <span class="nt">-t</span> raw <span class="nt">-r</span> 8k <span class="nt">-e</span> a-law <span class="nt">-c</span> 1 output.alaw</code></pre></figure>
<h3 id="a-law">A-LAW</h3>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 input.raw <span class="nt">-t</span> raw <span class="nt">-r</span> 8k <span class="nt">-e</span> u-law <span class="nt">-c</span> 1 output.ulaw</code></pre></figure>
<h3 id="gsm">GSM</h3>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 input.raw <span class="nt">-t</span> gsm <span class="nt">-r</span> 8k <span class="nt">-c</span> 1 output.gsm</code></pre></figure>
<h3 id="wav-8k">WAV (8k)</h3>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash">sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 input.raw <span class="nt">-t</span> wav <span class="nt">-r</span> 8k <span class="nt">-c</span> 1 output.wav</code></pre></figure>
<h3 id="g-722">G-722</h3>
<p>SOX does not support g722. So for this format, you will need a converter. I used a tool made by Kevin P. Fleming and Russell Bryant from Digium.</p>
<p>Here is the source code :</p>
<p><a href="/files/g722_encoder.tar.gz">g722_encoder.tar.gz</a></p>
<p>And this is the script i use to convert the files all at once :</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#!/bin/sh</span>
<span class="nb">mkdir</span> <span class="nt">-p</span> alaw
<span class="nb">mkdir</span> <span class="nt">-p</span> ulaw
<span class="nb">mkdir</span> <span class="nt">-p</span> gsm
<span class="nb">mkdir</span> <span class="nt">-p</span> wav
<span class="nb">mkdir</span> <span class="nt">-p</span> sln16
<span class="nb">mkdir</span> <span class="nt">-p</span> g722
<span class="k">for </span>file <span class="k">in</span> <span class="k">*</span>.raw<span class="p">;</span> <span class="k">do
</span><span class="nv">file_out</span><span class="o">=</span><span class="sb">`</span><span class="nb">basename</span> <span class="s2">"</span><span class="k">${</span><span class="nv">file</span><span class="p">%.*</span><span class="k">}</span><span class="s2">"</span><span class="sb">`</span>
<span class="nb">echo</span> <span class="s2">"converting </span><span class="nv">$file_out</span><span class="s2">..."</span>
<span class="nb">cp</span> <span class="nv">$file</span> sln16/<span class="nv">$file_out</span>.sln16
sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 <span class="nv">$file</span> <span class="nt">-t</span> raw <span class="nt">-r</span> 8k <span class="nt">-e</span> a-law <span class="nt">-c</span> 1 alaw/<span class="nv">$file_out</span>.alaw
sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 <span class="nv">$file</span> <span class="nt">-t</span> raw <span class="nt">-r</span> 8k <span class="nt">-e</span> u-law <span class="nt">-c</span> 1 ulaw/<span class="nv">$file_out</span>.ulaw
sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 <span class="nv">$file</span> <span class="nt">-t</span> gsm <span class="nt">-r</span> 8k <span class="nt">-c</span> 1 gsm/<span class="nv">$file_out</span>.gsm
sox <span class="nt">-t</span> raw <span class="nt">-r</span> 16k <span class="nt">-e</span> signed-integer <span class="nt">-b</span> 16 <span class="nt">-c</span> 1 <span class="nv">$file</span> <span class="nt">-t</span> wav <span class="nt">-r</span> 8k <span class="nt">-c</span> 1 wav/<span class="nv">$file_out</span>.wav
g722_encode <span class="nv">$file</span> g722/<span class="nv">$file_out</span>.g722
<span class="k">done
</span><span class="nb">echo</span> <span class="s1">'---------------------------------------------------'</span>
<span class="nb">echo</span> <span class="s1">'Done!'</span></code></pre></figure>
Analog A/V Routing Switcherhttps://https://www.frigon.info/posts/projects/avs50/2013-06-24T20:03:56-04:002013-06-24T20:03:56-04:00This is an old project! I made it 10 years ago. My DIY skills improved quite a bit since then…
It’s an audio/video (composite) routing switcher, i used it to switch between video sources on my tv. The tv I had back then only had 1 video input. It consist of a 8×8 video crosspoint (MAX4456) and a 16×16 analog crosspoint (AD8113) controlled by a small microcontroller (PIC18F452). It allowed me to distribute an audio/video signal from 5 different sources to 5 outputs by selecting it on the panel. I could split the audio from one input channel and take the video from another one if I wanted. It has 8 presets I can program to quickly recall channels assignation. It’s still working and I still use it today, but now, it’s used for routing audio only.
<p><strong>This is an old project!</strong> I made it 10 years ago. My DIY skills improved quite a bit since then…</p>
<!--thumbnail-->
<p>It’s an audio/video (composite) routing switcher, i used it to switch between video sources on my tv. The tv I had back then only had 1 video input. It consist of a 8×8 video crosspoint (<a href="https://www.maximintegrated.com/datasheet/index.mvp/id/1931">MAX4456</a>) and a 16×16 analog crosspoint (<a href="https://www.analog.com/en/switchesmultiplexers/analog-crosspoint-switches/ad8113/products/product.html">AD8113</a>) controlled by a small microcontroller (<a href="https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010296">PIC18F452</a>). It allowed me to distribute an audio/video signal from 5 different sources to 5 outputs by selecting it on the panel. I could split the audio from one input channel and take the video from another one if I wanted. It has 8 presets I can program to quickly recall channels assignation. It’s still working and I still use it today, but now, it’s used for routing audio only.</p>
<!--more-->
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-5.jpg" title="The PSU and my attempt at making a shield.">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-5.jpg" alt="" title="The PSU and my attempt at making a shield." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-lcd.jpg" title="Front panel lcd module">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-lcd.jpg" alt="" title="Front panel lcd module" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-6.jpg" title="Front panel">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-6.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/audio-crosspoint.jpg" title="The audio 16x16 crosspoint">
<img src="/images/gallery/project-avs50/thumbs/audio-crosspoint.jpg" alt="" title="The audio 16x16 crosspoint" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-3.jpg" title="Controller board">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-3.jpg" alt="" title="Controller board" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-2.jpg" title="Completed case">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-2.jpg" alt="" title="Completed case" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50/av-switcher-1.jpg" title="Completed case">
<img src="/images/gallery/project-avs50/thumbs/av-switcher-1.jpg" alt="" title="Completed case" width="128" height="96" />
</a>
</span>
</div>
<h2 id="crosspoint">Crosspoint</h2>
<p>There is a possibility of 8 inputs and 8 outputs but only 5 were used, 4 input/output on the back panel, 1 input/output on the front. I modified it later for 6 inputs and 2 outputs because i ran out of input channels. It can only accept a composite video signal in glorious full SD quality.</p>
<p>This was my first project using a PIC microcontroller, right after the “Hello World” equivalent of PIC programming, the blinking LED… I also used another PIC (16F675) for the black video generator, it generates a NTSC video signal by using 2 ports.</p>
<p>I had plan to add an LED audio level meter, but that idea never made it passed the prototype stage.</p>
<h2 id="front-panel">Front panel</h2>
<p>I did not built this one from scratch, I used Front Panel Express instead, you send them your design by using the software they provide and they ship you back the fabricated panel about 3 weeks later. This was not cheap tough. This panel, costed about 70$ US + shipping to fabricate, but the quality definitely worth it.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-6.jpg" title="Front panel">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-6.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-7.jpg" title="Front panel with RCA connector installed">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-7.jpg" alt="" title="Front panel with RCA connector installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-8.jpg" title="Front panel">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-8.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-9.jpg" title="Front panel">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-9.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-2.jpg" title="Front panel">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-2.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-1.jpg" title="Front panel window">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-1.jpg" alt="" title="Front panel window" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-4.jpg" title="Front panel (Back)">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-4.jpg" alt="" title="Front panel (Back)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-3.jpg" title="Front panel (Back)">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-3.jpg" alt="" title="Front panel (Back)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-pcb.jpg" title="Front panel PCB">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-pcb.jpg" alt="" title="Front panel PCB" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/front-panel-pcb-2.jpg" title="Front panel PCB (back)">
<img src="/images/gallery/project-avs50-front-panel/thumbs/front-panel-pcb-2.jpg" alt="" title="Front panel PCB (back)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/keypad-2.jpg" title="Keypad">
<img src="/images/gallery/project-avs50-front-panel/thumbs/keypad-2.jpg" alt="" title="Keypad" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/keypad.jpg" title="Keypad pcb">
<img src="/images/gallery/project-avs50-front-panel/thumbs/keypad.jpg" alt="" title="Keypad pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-front-panel/testing-1.jpg" title="Breadboard testing">
<img src="/images/gallery/project-avs50-front-panel/thumbs/testing-1.jpg" alt="" title="Breadboard testing" width="128" height="96" />
</a>
</span>
</div>
<h2 id="chassis">Chassis</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/case-5.jpg" title="Empty chassis">
<img src="/images/gallery/project-avs50-case/thumbs/case-5.jpg" alt="" title="Empty chassis" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/psu-1.jpg" title="PSU">
<img src="/images/gallery/project-avs50-case/thumbs/psu-1.jpg" alt="" title="PSU" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/psu-2.jpg" title="">
<img src="/images/gallery/project-avs50-case/thumbs/psu-2.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/case-6.jpg" title="Back panel">
<img src="/images/gallery/project-avs50-case/thumbs/case-6.jpg" alt="" title="Back panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/case-7.jpg" title="Back panel finished">
<img src="/images/gallery/project-avs50-case/thumbs/case-7.jpg" alt="" title="Back panel finished" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/psu-9.jpg" title="Power connector">
<img src="/images/gallery/project-avs50-case/thumbs/psu-9.jpg" alt="" title="Power connector" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/case-4.jpg" title="Cover">
<img src="/images/gallery/project-avs50-case/thumbs/case-4.jpg" alt="" title="Cover" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-avs50-case/front-panel-5.jpg" title="Front panel">
<img src="/images/gallery/project-avs50-case/thumbs/front-panel-5.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
</div>
<h2 id="the-next-version">The next version…</h2>
<p>I had plans to build a HDMI routing switcher based on the same concept as this one. I started building it but had put the project on hold for now. Maybe I did bite a little more that I could chew on this one… The front panel is done, a part of the case is built, but the switcher core is nowhere near complete.</p>
Home media serverhttps://https://www.frigon.info/posts/projects/media-server/2013-06-17T01:46:27-04:002013-06-17T01:46:27-04:00
This is my media server which stores my media library plus other services (pxe boot server, a private apt repository). It has a TV tuner and i use TVHeadend to stream the live tv to my HTPC. It also manage the recordings. I did not build a custom case for this project, i bought it off the shelf (iStarUSA D-118V2-ITX 1U rackmount case) but i made some modifications to it.
<!--thumbnail-->
<p>This is my media server which stores my media library plus other services (pxe boot server, a private apt repository). It has a TV tuner and i use TVHeadend to stream the live tv to my <a href="/posts/projects/htpc/">HTPC</a>. It also manage the recordings. I did not build a custom case for this project, i bought it off the shelf (<a href="https://www.istarusa.com/istarusa/products.php?series=Rackmount%20Chassis&sub=D%20VALUE&model=D-118V2-ITX&factor=1,%201.3#.UmiSD9-faXk">iStarUSA D-118V2-ITX</a> 1U rackmount case) but i made some modifications to it.</p>
<!--more-->
<h2 id="hardware">Hardware</h2>
<p>It has a <a href="https://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-dn2800mt.html">Intel mini-itx DN2800MT</a> motherboard with an embedded Atom N2800 (1.86 Ghz) and 4GB of ram. The TV tuner is a <a href="http://www.hauppauge.com/site/products/data_hvr2250.html">WinTV HVR-2250</a> dual ATSC tuner.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/empty-case-1.jpg" title="Empty iStarUSA D-118V2-ITX 1U rackmount chassis">
<img src="/images/gallery/projects-media-server-assembly/thumbs/empty-case-1.jpg" alt="" title="Empty iStarUSA D-118V2-ITX 1U rackmount chassis" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/empty-case-2.jpg" title="Empty iStarUSA D-118V2-ITX 1U rackmount chassis">
<img src="/images/gallery/projects-media-server-assembly/thumbs/empty-case-2.jpg" alt="" title="Empty iStarUSA D-118V2-ITX 1U rackmount chassis" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/dnt2800mt-motherboard.jpg" title="Intel mini-itx DN2800MT">
<img src="/images/gallery/projects-media-server-assembly/thumbs/dnt2800mt-motherboard.jpg" alt="" title="Intel mini-itx DN2800MT" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/hvr-2250-tv-tuner.jpg" title="WinTV HVR-2250 dual ATSC tuner.">
<img src="/images/gallery/projects-media-server-assembly/thumbs/hvr-2250-tv-tuner.jpg" alt="" title="WinTV HVR-2250 dual ATSC tuner." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/hard-drive-tray.jpg" title="Hard drive tray">
<img src="/images/gallery/projects-media-server-assembly/thumbs/hard-drive-tray.jpg" alt="" title="Hard drive tray" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/assy_1.jpg" title="Drive dray and PCIe riser">
<img src="/images/gallery/projects-media-server-assembly/thumbs/assy_1.jpg" alt="" title="Drive dray and PCIe riser" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/assy_4.jpg" title="Installed PSU and motherboard">
<img src="/images/gallery/projects-media-server-assembly/thumbs/assy_4.jpg" alt="" title="Installed PSU and motherboard" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/assy_3.jpg" title="Fully assembled">
<img src="/images/gallery/projects-media-server-assembly/thumbs/assy_3.jpg" alt="" title="Fully assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-assembly/assy_2.jpg" title="Fully assembled">
<img src="/images/gallery/projects-media-server-assembly/thumbs/assy_2.jpg" alt="" title="Fully assembled" width="128" height="96" />
</a>
</span>
</div>
<h3 id="power-supply">Power supply</h3>
<p>The <a href="https://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-dn2800mt.html">DN2800MT</a> does not have a conventional ATX power supply connector. There are two ways that you can power this board, one is the external power jack (laptop type) or the internal 2-pin molex header. It accept a wide 8v to 19v voltage range and use about 15 watts.</p>
<p>I used a 12V 35 watts (<a href="https://www.digikey.ca/product-search/en?vendor=0&keywords=tdk+ls35-12">TDK LS35-12</a>) switching power supply. Since the chassis i bought accept a standard mini atx power supply form factor, I made an aluminum bracket to mount the PSU.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-media-server-psu/psu_1.jpg" title="Mini ATX PSU "adapter" bracket">
<img src="/images/gallery/projects-media-server-psu/thumbs/psu_1.jpg" alt="" title="Mini ATX PSU "adapter" bracket" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-psu/psu_2.jpg" title="Mini ATX PSU "adapter" bracket">
<img src="/images/gallery/projects-media-server-psu/thumbs/psu_2.jpg" alt="" title="Mini ATX PSU "adapter" bracket" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-psu/psu_3.jpg" title="Power connector installed">
<img src="/images/gallery/projects-media-server-psu/thumbs/psu_3.jpg" alt="" title="Power connector installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-psu/psu_4.jpg" title="PSU Installed">
<img src="/images/gallery/projects-media-server-psu/thumbs/psu_4.jpg" alt="" title="PSU Installed" width="128" height="96" />
</a>
</span>
</div>
<p>Here is the template for the PSU bracket :</p>
<div class="media image alignnone frame">
<a class="link" href="/files/media-server/psu-bracket-template.pdf" title="PSU bracket template">
<div class="caption">PSU bracket template</div>
<div class="img-container" style="padding: 77% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/media-server-psu-bracket-template.jpg" alt="" title="PSU bracket template" width="300" height="232" />
</div>
</a>
</div>
<h3 id="pcie-riser">PCIe riser</h3>
<p>The only thing that this case is missing IMHO is better support for the PCI card. It is only held in place by its I/O bracket. So, i made an ‘L’ shape bracket to mount the PCI riser card to. Because it is now fixed, the PCI card needs to move sideway when it is inserted or removed. The opening on the right side of the card slot was not large enough, so i had to cut it wider.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_0.jpg" title="This chassis has no support for the riser card.">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_0.jpg" alt="" title="This chassis has no support for the riser card." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_1.jpg" title="Cutton templated glued to an aluminum sheet">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_1.jpg" alt="" title="Cutton templated glued to an aluminum sheet" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_2.jpg" title="Cutting the sheet using a nibbler">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_2.jpg" alt="" title="Cutting the sheet using a nibbler" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_3.jpg" title="Bending the sheet metal using a vise and aluminum angles">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_3.jpg" alt="" title="Bending the sheet metal using a vise and aluminum angles" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_4.jpg" title="">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_4.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_5.jpg" title="">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_5.jpg" alt="" title="" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_6.jpg" title="Completed PCIe riser bracket">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_6.jpg" alt="" title="Completed PCIe riser bracket" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_7.jpg" title="PCIe riser">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_7.jpg" alt="" title="PCIe riser" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-media-server-pcie-riser/riser_8.jpg" title="PCIe riser installed">
<img src="/images/gallery/projects-media-server-pcie-riser/thumbs/riser_8.jpg" alt="" title="PCIe riser installed" width="128" height="96" />
</a>
</span>
</div>
<h2 id="media-server-software">Media server software</h2>
<p>It runs <a href="https://www.ubuntu.com/server">Ubuntu Server 12.04</a> and <a href="https://tvheadend.org/">TVHeadend 3.5</a></p>
Asterisk dialplan syntax highlighting for gedithttps://https://www.frigon.info/posts/asterisk/asterisk-dialplan-highlight/2013-06-09T22:28:41-04:002013-06-09T22:28:41-04:00I made a language definition file for Asterisk dialplan in gedit (gtksourceview 2.0). I find that it makes the dialplan much easier to read.
<p>I made a language definition file for Asterisk dialplan in gedit (gtksourceview 2.0). I find that it makes the dialplan much easier to read.
<!--more--></p>
<h2 id="language-definition-file">Language definition file</h2>
<p>Paste the following in: <strong>/usr/share/gtksourceview-2.0/language-specs/ast_dialplan.lang</strong></p>
<script src="https://gist.github.com/bfrigon/9129e3b66405e50ec8c9a8c3049bd47c.js?file=gedit_syntax_dialplan.lang"> </script>
<h2 id="other-editors">Other editors</h2>
<p>These are language definitions for other editors (untested)</p>
<ul>
<li><a href="https://www.voip-info.org/wiki/view/vim+syntax+highlighting">VIM (by Tilghman Lesher)</a></li>
<li><a href="https://www.voip-info.org/wiki/view/Nano+syntax+highlighting">Nano (by jmcanfield, Johan Adler)</a></li>
<li><a href="https://www.voip-info.org/wiki/view/Kate+Kwrite+Syntax+Highlighting">Kate (by Robert Schneider)</a></li>
</ul>
Asterisk manager - Y.A.A.Mhttps://https://www.frigon.info/posts/asterisk/asterisk-manager/2013-06-09T22:28:41-04:002013-06-09T22:28:41-04:00Y.A.A.M is a web interface for managing an Asterisk server. The goal of this project is NOT to be an alternative to other GUI such as FreePBX. It is more like an assistant, for those who prefer to edit configuration files manually, but needs a web interface for quick access to server logs, call logs, etc.
<p>Y.A.A.M is a web interface for managing an Asterisk server. The goal of this project is NOT to be an alternative to other GUI such as FreePBX. It is more like an assistant, for those who prefer to edit configuration files manually, but needs a web interface for quick access to server logs, call logs, etc.</p>
<!--thumbnail-->
<!--more-->
<p>By default, users are only allowed to view call logs, listen to voice message or edit phone book records for their extension only. It is possible to give permissions for certain users to access the data for all users as well. Each plugins has a list of permissions which can be turned on or off for specific users.</p>
<p>Available plugins:</p>
<ul>
<li>Call log viewer</li>
<li>Call treatment</li>
<li>Voicemail (ODBC)</li>
<li>Phone book</li>
<li>Sys Admin (Log viewer, channel status, run CLI commands)</li>
<li>Originate call</li>
</ul>
<blockquote>
<p><strong>Y.A.A.M Is not production environment ready yet</strong>. It is still in an alpha stage. If you would like to contribute to the project, you can clone the <a href="https://github.com/bfrigon/yaam">git repository</a> and submit a patch.</p>
</blockquote>
<h2 id="screenshoots">Screenshoots</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/call-log.jpg" title="Asterisk CDR call log">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/call-log.jpg" alt="" title="Asterisk CDR call log" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/call-log-filters.jpg" title="CDR filters">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/call-log-filters.jpg" alt="" title="CDR filters" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/cdr-routes.jpg" title="Define cost for specific call routes">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/cdr-routes.jpg" alt="" title="Define cost for specific call routes" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/status-page.jpg" title="Server status page">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/status-page.jpg" alt="" title="Server status page" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/voicemail.jpg" title="Voicemail">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/voicemail.jpg" alt="" title="Voicemail" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/vm-listen.jpg" title="Listen to voicemail">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/vm-listen.jpg" alt="" title="Listen to voicemail" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/edit-user.jpg" title="Edit user">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/edit-user.jpg" alt="" title="Edit user" width="128" height="96" />
</a>
</span>
</div>
<h2 id="source-code">Source code</h2>
<p>Get the source code <a href="https://github.com/bfrigon/yaam">here on Github</a></p>
<h2 id="requirements">Requirements</h2>
<ul>
<li>Web server (Apache, lighttpd)</li>
<li>PHP 5.0+</li>
<li>ODBC (mysql)</li>
<li>Asterisk 1.8+ (with AMI enabled)</li>
</ul>
<h2 id="installation">Installation</h2>
<ol>
<li>
<p>Download or clone the repository on <a href="https://github.com/bfrigon/yaam">Github</a></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> git clone https://github.com/bfrigon/yaam.git
</code></pre></div> </div>
</li>
<li>
<p>Copy the content of the folder ‘root’ to your server base directory. (e.g. ‘/var/www’)</p>
</li>
<li>
<p>Create a folder named ‘cache’ in your server base directory and give write access to it.</p>
</li>
<li>
<p>Setup the database. Here is the mysql dump file used to create the necessary tables.</p>
</li>
<li>
<p>Copy the sample configuration file in ./setup/yaam.conf to /etc/yaam.conf and change the settings.</p>
</li>
<li>
<p>The default password for admin is ‘yaam’.</p>
</li>
</ol>
Asterisk PBXhttps://https://www.frigon.info/posts/projects/pbx/2013-05-06T21:14:56-04:002013-05-06T21:14:56-04:00This is my Asterisk telephony server (PBX). It consists of a SBC board (PcEngine ALIX 2d2) and a FXS/FXO board (Openvox A400M with 2 FXS and 1 FXO modules). The alix2d2 has a Geode LX800 processor at 500 Mhz and 256 MB of memory. Not particularly fast, but enough for the job. I needed it to be a very low power system (under 10 watts) since it has to run 24/7.
<p>This is my Asterisk telephony server (PBX). It consists of a SBC board (<a href="https://www.pcengines.ch/alix2d2.htm">PcEngine ALIX 2d2</a>) and a FXS/FXO board (<a href="http://www.openvox.cn/products/telephony-cards/analog-cards/a400m-detail.html">Openvox A400M</a> with 2 FXS and 1 FXO modules). The <a href="https://www.pcengines.ch/alix2d2.htm">alix2d2</a> has a Geode LX800 processor at 500 Mhz and 256 MB of memory. Not particularly fast, but enough for the job. I needed it to be a very low power system (under 10 watts) since it has to run 24/7.</p>
<!--thumbnail-->
<!--more-->
<h2 id="pbx-case-construction">PBX Case construction</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-1.jpg" title="Bare chassis - CH-14404 (Digikey)">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-1.jpg" alt="Bare chassis" title="Bare chassis - CH-14404 (Digikey)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-2.jpg" title="Aplying the cutting template.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-2.jpg" alt="" title="Aplying the cutting template." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-3.jpg" title="Cutting holes for the components.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-3.jpg" alt="" title="Cutting holes for the components." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-4.jpg" title="Cutting holes for the components.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-4.jpg" alt="" title="Cutting holes for the components." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-5.jpg" title="Holes for the standoffs to support the motherboard, PSU and fxo/fxs board.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-5.jpg" alt="Holes for the standoffs" title="Holes for the standoffs to support the motherboard, PSU and fxo/fxs board." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-6.jpg" title="Case ready for painting">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-6.jpg" alt="" title="Case ready for painting" width="128" height="96" />
</a>
</span>
</div>
<h2 id="front-panel">Front panel</h2>
<p>The front panel was made from the 1/8” panel that comes with the CH-1440 chassis and a 22 gauge aluminum sheet glued together. I made it that way, so the LCD module is almost flush with the surface of the panel. I made the decals by using the Decalpro FX toner transfer system. (I posted an <a href="/posts/diy/making-decals">article</a> that describe the process)</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-1.jpg" title="Cutting the oppening for the lcd">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-1.jpg" alt="" title="Cutting the oppening for the lcd" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-2.jpg" title="Joining the two layers (22 gauge aliminium sheet and 1/8" aliminium panel)">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-2.jpg" alt="Joining the two layers" title="Joining the two layers (22 gauge aliminium sheet and 1/8" aliminium panel)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-3.jpg" title="Adding the swage standoff for the lcd mount.">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-3.jpg" alt="" title="Adding the swage standoff for the lcd mount." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/touch-sensor-electrodes.jpg" title="Sensor electrodes for the capacitive switch">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/touch-sensor-electrodes.jpg" alt="" title="Sensor electrodes for the capacitive switch" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/electrode-insulation.jpg" title="Insulating layer between the panel and electrode">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/electrode-insulation.jpg" alt="" title="Insulating layer between the panel and electrode" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-painting-1.jpg" title="Covering the electrodes with epoxy">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-painting-1.jpg" alt="" title="Covering the electrodes with epoxy" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-painting-2.jpg" title="Body filler">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-painting-2.jpg" alt="" title="Body filler" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-painting-3.jpg" title="Ready for painting">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-painting-3.jpg" alt="" title="Ready for painting" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-painting-4.jpg" title="Primer coat">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-painting-4.jpg" alt="" title="Primer coat" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/front-panel-painting-5.jpg" title="Base coat">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/front-panel-painting-5.jpg" alt="" title="Base coat" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-4.jpg" title="Decals">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-4.jpg" alt="" title="Decals" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-5.jpg" title="Decals">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-5.jpg" alt="" title="Decals" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-6.jpg" title="'Developing' the decals">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-6.jpg" alt="" title="'Developing' the decals" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-1.jpg" title="Applying the decals">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-1.jpg" alt="" title="Applying the decals" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-2.jpg" title="Applying the decals">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-2.jpg" alt="" title="Applying the decals" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-front-panel/aplying-decals-3.jpg" title="Finished front panel">
<img src="/images/gallery/projects-pbx-front-panel/thumbs/aplying-decals-3.jpg" alt="" title="Finished front panel" width="128" height="96" />
</a>
</span>
</div>
<h3 id="capacitive-switches--lcd-module">Capacitive switches / LCD module</h3>
<p>Instead of using ordinary push buttons, i went with a capacitive switch solution and that was my first attempt with that kind of interface. As you can see in the pictures above, the sensor electrode (1 x 1cm, .7mm tich copper sheet) is encased in epoxy and painted over to make it seamless with the rest of the panel. The touch sensor IC is a 1 channel Atmel <a href="http://www.atmel.com/devices/at42qt1011.aspx">AT42QT1011</a>. In the rev. A, i used the <a href="https://media.digikey.com/pdf/Data%20Sheets/Quantum%20PDFs/qt320_103_datasheet.pdf">QT320</a> IC from Quantum (2 channel touch sensor), the IC was located on the lcd pcb and the electrode connected via a wire. BAD idea! It worked, but the controller had a hard time calibrating and false detection would occur sporadically. So, instead, I went for the <a href="http://www.atmel.com/devices/at42qt1011.aspx">AT42QT1011</a> on two separate boards (left and right buttons). The electrodes are now closer to the sensor IC and it’s working flawlessly. However, since the panel is made of aluminum, it must be grounded properly, otherwise, the entire panel becomes the touch sensor.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/pbx-lcd-module/lcd-with-qt320-touch-sensor.jpg" title="LCD Module with QT320 touch sensor">
<img src="/images/gallery/pbx-lcd-module/thumbs/lcd-with-qt320-touch-sensor.jpg" alt="" title="LCD Module with QT320 touch sensor" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/pbx-lcd-module/lcd-module-mod-AT42QT1011.jpg" title="Modified LCD module, QT320 removed and using Atmel AT42QT1011 instead (Ugly hack, i know).">
<img src="/images/gallery/pbx-lcd-module/thumbs/lcd-module-mod-AT42QT1011.jpg" alt="Modified LCD module." title="Modified LCD module, QT320 removed and using Atmel AT42QT1011 instead (Ugly hack, i know)." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/pbx-lcd-module/lcd-module-test.jpg" title="LCD Module testing">
<img src="/images/gallery/pbx-lcd-module/thumbs/lcd-module-test.jpg" alt="" title="LCD Module testing" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/pbx-lcd-module/lcd-with-qt320.jpg" title="LCD Module with QT320 touch sensor">
<img src="/images/gallery/pbx-lcd-module/thumbs/lcd-with-qt320.jpg" alt="" title="LCD Module with QT320 touch sensor" width="128" height="96" />
</a>
</span>
</div>
<h3 id="design-files">Design files</h3>
<table>
<thead>
<tr>
<th style="text-align: center">Type</th>
<th>Title</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">git</td>
<td><a href="https://github.com/bfrigon/project-pbx/tree/master/pcb/lcd-module">LCD module pcb cad files (Eagle)</a></td>
<td>–</td>
</tr>
<tr>
<td style="text-align: center">git</td>
<td><a href="https://github.com/bfrigon/project-pbx/tree/master/firmware/lcd-module">LCD module Firmware</a></td>
<td>–</td>
</tr>
<tr>
<td style="text-align: center">pdf</td>
<td><a href="https://raw.githubusercontent.com/bfrigon/project-pbx/master/drawings/schematics/lcd-module_rev-b.pdf">Schematic - Rev. A</a></td>
<td>50.3 KB</td>
</tr>
<tr>
<td style="text-align: center">pdf</td>
<td><a href="https://raw.githubusercontent.com/bfrigon/project-pbx/master/drawings/schematics/lcd-module_rev-b.pdf">Schematic - Rev. B</a></td>
<td>46.3 KB</td>
</tr>
</tbody>
</table>
<h2 id="final-assembly">Final assembly</h2>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/prototype_1.jpg" title="Components testing">
<img src="/images/gallery/projects-pbx-assembly/thumbs/prototype_1.jpg" alt="" title="Components testing" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/assembly_2.jpg" title="Back panel">
<img src="/images/gallery/projects-pbx-assembly/thumbs/assembly_2.jpg" alt="" title="Back panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/assembly_3.jpg" title="Front panel">
<img src="/images/gallery/projects-pbx-assembly/thumbs/assembly_3.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/assembly_1.jpg" title="Components">
<img src="/images/gallery/projects-pbx-assembly/thumbs/assembly_1.jpg" alt="" title="Components" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/ata.jpg" title="FXO/FXS Analog modules">
<img src="/images/gallery/projects-pbx-assembly/thumbs/ata.jpg" alt="" title="FXO/FXS Analog modules" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/assembly_4.jpg" title="Finished assembly">
<img src="/images/gallery/projects-pbx-assembly/thumbs/assembly_4.jpg" alt="" title="Finished assembly" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-assembly/rack.jpg" title="Installed in rack">
<img src="/images/gallery/projects-pbx-assembly/thumbs/rack.jpg" alt="" title="Installed in rack" width="128" height="96" />
</a>
</span>
</div>
<h2 id="the-os">The OS</h2>
<div class="media image alignleft ">
<a class="link" href="http://linux.voyage.hk/" title="Voyage linux">
<div class="img-container" style="padding: 100% 0px 0px 0px; width: 75px;">
<img src="/images/library/voyage-linux-logo.png" alt="Voyage linux" title="Voyage linux" width="75" height="75" />
</div>
</a>
</div>
<p>I use <a href="http://linux.voyage.hk/">Voyage Linux</a> which is a lightweight distro for embedded systems. It is a stripped down version of Debian and was optimized to run from a compact flash card. Frequently written files (eg. /var/log) are stored in memory (ramfs) rather than on the CF itself. A local copy of those files are kept on the CF card. It can be synchronized by running:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/init.d/voyage-sync sync
</code></pre></div></div>
<p>The obvious disadvantage is that the files that were not synced are lost if there is a power failure.</p>
<h2 id="asterisk">Asterisk</h2>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/screenshot-pbx-console.jpg" title="Asterisk PBX server console">
<div class="img-container" style="padding: 65% 0px 0px 0px; width: 320px;">
<img src="/images/library/thumbs/screenshot-pbx-console.jpg" alt="Asterisk PBX server console" title="Asterisk PBX server console" width="320" height="211" />
</div>
</a>
</div>
<h2 id="manager-interface">Manager interface</h2>
<p>I made a web interface for Asterisk, i called it Y.A.A.M (Yet Another Asterisk Manager), I’m not good at naming things… I started working on this about 2 years ago. At the time, i did not find any existing software that allowed me to do what i wanted or was way too ressource hungry for my tiny server. So i decided to make my own. It has only the basics : Status page, call log, voicemail, System logs. extension management, dialplan and other settings are still done with the good old config files…</p>
<p>More details <a href="/posts/asterisk/asterisk-manager">here</a></p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/call-log.jpg" title="Asterisk CDR call log">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/call-log.jpg" alt="" title="Asterisk CDR call log" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/call-log-filters.jpg" title="CDR filters">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/call-log-filters.jpg" alt="" title="CDR filters" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/cdr-routes.jpg" title="Define cost for specific call routes">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/cdr-routes.jpg" alt="" title="Define cost for specific call routes" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/status-page.jpg" title="Server status page">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/status-page.jpg" alt="" title="Server status page" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/voicemail.jpg" title="Voicemail">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/voicemail.jpg" alt="" title="Voicemail" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/vm-listen.jpg" title="Listen to voicemail">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/vm-listen.jpg" alt="" title="Listen to voicemail" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-asterisk-manager-screenshots/edit-user.jpg" title="Edit user">
<img src="/images/gallery/projects-pbx-asterisk-manager-screenshots/thumbs/edit-user.jpg" alt="" title="Edit user" width="128" height="96" />
</a>
</span>
</div>
Making front panels with decalshttps://https://www.frigon.info/posts/diy/making-decals/2013-05-06T21:14:56-04:002013-05-06T21:14:56-04:00When i design enclosures for my projects, the goal is to make it look professional as much as possible. I put many hours into designing, building and painting. Sure, I could go and buy a ready-made case, but I would not get the satisfaction that you get from designing and building it yourself. Most of the equipment in my rack cabinet is custom-made, even the rack itself. This article describes in details the techniques I use and how I apply the decals to the front panel.
<p>When i design enclosures for my projects, the goal is to make it look professional as much as possible. I put many hours into designing, building and painting. Sure, I could go and buy a ready-made case, but I would not get the satisfaction that you get from designing and building it yourself. Most of the equipment in my rack cabinet is custom-made, even the rack itself. This article describes in details the techniques I use and how I apply the decals to the front panel.</p>
<!--more-->
<p>I usually use the 1U CH-14401 bare rackmount chassis from Bud Industries (8in x 19in x 1U) which is more than enough for most projects. It also available in 2U height and various depth (4”, 8” and 16”). The chassis is made from 0.050” thick aluminum except for the removable front panel which is 1/8” thick.</p>
<h2 id="cutting-holes-for-components">Cutting holes for components</h2>
<p>First, i start by creating a 3D model of the case in SolidWorks. I then add the differents components to the model and add the cutouts to the front and back panel. Once the model is finished, I export the model of the front panel to a drawing view (Files => Make drawing from assembly). I now have a front view representation of the panel which i can use as a cutting template.</p>
<p>Then, i print out this drawing view to scale and glue it down to the panel. To cut small rectangular openings, I first drill a hole in the center big enough to insert a metal file then work my way to the border of the opening on each sides. For larger cutouts, I use a Dremel with a cutting disk.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-1.jpg" title="Bare chassis - CH-14404 (Digikey)">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-1.jpg" alt="Bare chassis" title="Bare chassis - CH-14404 (Digikey)" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-2.jpg" title="Aplying the cutting template.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-2.jpg" alt="" title="Aplying the cutting template." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-3.jpg" title="Cutting holes for the components.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-3.jpg" alt="" title="Cutting holes for the components." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-4.jpg" title="Cutting holes for the components.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-4.jpg" alt="" title="Cutting holes for the components." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-5.jpg" title="Holes for the standoffs to support the motherboard, PSU and fxo/fxs board.">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-5.jpg" alt="Holes for the standoffs" title="Holes for the standoffs to support the motherboard, PSU and fxo/fxs board." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/projects-pbx-case/pbx-custom-case-6.jpg" title="Case ready for painting">
<img src="/images/gallery/projects-pbx-case/thumbs/pbx-custom-case-6.jpg" alt="" title="Case ready for painting" width="128" height="96" />
</a>
</span>
</div>
<h2 id="painting">Painting</h2>
<p>I use Tremclad spray paint for metal. It can take up to a week to paint a part as i spray multiple coats separated by a day of drying. I sand away imperfections and dust particles with a fine grit sand paper(2000) between coats.</p>
<div class="media image alignright frame">
<a class="popup" href="/images/library/decals/spray-can-handle.jpg" title="Spray can handle">
<div class="img-container" style="padding: 125% 0px 0px 0px; width: 96px;">
<img src="/images/library/decals/thumbs/spray-can-handle.jpg" alt="Spray can handle" title="Spray can handle" width="96" height="120" />
</div>
</a>
</div>
<p>I also use a spray can handle attachment that you can find in any hardware store. This immensely improve the quality of the paint job because it gives you better control over the flow, avoid over spraying and gives a more even coat. It is very important to spray at a certain distance, about 10 inch, from the surface to be painted. If it is too close, the coating will be uneven and you will have runs.</p>
<h2 id="making-the-decals">Making the decals</h2>
<blockquote>
<p>Disclaimer : I am not affiliated in any way with decalpro fx, this is just what i happen to use.</p>
</blockquote>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/decals/decalprofx.jpg" title="Decalpro FX">
<div class="img-container" style="padding: 100% 0px 0px 0px; width: 120px;">
<img src="/images/library/decals/thumbs/decalprofx.jpg" alt="Decalpro FX" title="Decalpro FX" width="120" height="120" />
</div>
</a>
</div>
<p>To make the decals, i use the toner transfer system (<a href="https://pulsarprofx.com/">Decalpro FX</a>, available at <a href="https://pulsarprofx.com/">Digi-key</a>). It consist of a toner transfer sheet, a color overlay and a mylar carrier foil. The transfer sheet is a 8.5” x 11” sheet you print on using a laser printer. When exposed to water, it will release the toner from its surface allowing it to be transferred to another medium. Since the toner is black, it can be used as is or you can apply colors by using the toner reactive foil (TRF). The mylar carrier is used to temporarily carry the toner from the transfer sheet to the final surface.</p>
<p>It is very easy to screw it up, but once you get used with the process, it can produce a pretty descent quality decals.</p>
<p>These are the required steps :</p>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/decals/aplying-decals-1.jpg" title="Printing decal on transfert paper">
<div class="img-container" style="padding: 74% 0px 0px 0px; width: 160px;">
<img src="/images/library/decals/thumbs/aplying-decals-1.jpg" alt="Printing decal on transfert paper" title="Printing decal on transfert paper" width="160" height="119" />
</div>
</a>
</div>
<ul>
<li>
<p>Print the decals on a standard paper sheet, just to make sure the decals will fit perfectly. Once you’re sure everything is ok, print the decals again on the transfer sheet. You need to add a 1/4 inch border around your decals. <strong>This is crucial</strong>, otherwise, the decals will break up when the toner detach from the transfer sheet. Also, i found out that working with smaller sections (2 x 2 inches) at a time is much more easier. I divide my decals in smaller groups and print multiple version of each groups on the sheet. That way, if I screw up one area, I don’t have to start the whole process all over again…</p>
</li>
<li>
<p>Before applying the TRF (toner reactive foil), thoroughly dry the transfer sheet with a heat gun. Any moisture left will ruin the transfer as the TRF will stick to the any area where it is still humid. <strong>You must use a heat gun, a hair dryer is not hot enough</strong>.</p>
</li>
</ul>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/decals/aplying-decals-2.jpg" title="Applying the toner reactive foil (TRF)">
<div class="img-container" style="padding: 74% 0px 0px 0px; width: 160px;">
<img src="/images/library/decals/thumbs/aplying-decals-2.jpg" alt="Applying the toner reactive foil (TRF)" title="Applying the toner reactive foil (TRF)" width="160" height="119" />
</div>
</a>
</div>
<ul>
<li>
<p>Next step is to apply the TRF, this will be the visible side of your decal. To fuse the TRF to the toner, you need a laminator set on high heat (5 mil). Put the transfer sheet with the TRF on top on a 1/16” fiber glass board (provided in the decalpro starter kit). Pass the transfer sheet 2 times thought the laminator 2 times. Once it is done, let it completely cool before peeling away the TRF. Start from the corner and slowly peel back the foil and pull it downward. Once the TRF is removed, the foil will remains only where the toner is. Some foil may remain in areas not covered by toner (especially inside small letters. eg. “e”). The next step will take care of this problem.</p>
</li>
<li>
<p>Apply several strips of 3M 2080 blue masking tape (painter’s tape) over the transfer sheet in an overlapping fashion. Lightly press down the masking tape to make sure it stick to the sheet and then slowly peel it away at a 180 degree angle. Do not pull it straight up. The foil in areas that are not supposed to be there will stick on the tape. Once all the tape is removed, repeat the same process in the opposite direction.</p>
</li>
<li>
<p>Next, apply the mylar carrier over the decal. It is only temporary, there is no glue nor will it fuse to the toner or foil but will merely cling to the decal. The best way to do that is to put both the transfer sheet and the mylar film side by side on a paper towel. With another piece of paper towel folded in four, gently swipe both of them. This will create a static charge on the mylar film and will cling to the transfer paper. What is left to do is to pass it in the laminator 2 times. If you see the mylar uncling, even partly, forget it, it won’t work. Remove it and start again (This is the most frustrating step). Also, Make sure there is no dust trapped between the two sheets. Tip: For the TRF foil or mylar film, it is best to cut a piece 1.5 times longer than what you need. That way, you can fold the remaining foil under the carrier board making it easier to hold it in place while you pass it in the laminator.</p>
</li>
</ul>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/decals/aplying-decals-3.jpg" title="Separating the transfert sheet">
<div class="img-container" style="padding: 74% 0px 0px 0px; width: 160px;">
<img src="/images/library/decals/thumbs/aplying-decals-3.jpg" alt="Separating the transfert sheet" title="Separating the transfert sheet" width="160" height="119" />
</div>
</a>
</div>
<ul>
<li>
<p>Once the mylar is securely in place, cut away the excess mylar while making sure you don’t lift the film. Then submerge it slowly in water. There is a direction that the sheet will curl naturally, it is important to put the sheet in the water in that direction. After a minute or two, the backing paper will start to dissolve, releasing the toner along with the mylar film. <strong>Don’t force it, be patient</strong>. You can agitate the water <strong>lightly</strong> to facilitate the process, but not too much. When it is completely released, the remaining of the transfer sheet will sink and the mylar film will float to the surface.</p>
</li>
<li>
<p>GENTLY wipe the excess water and let it dry. With a sharp exacto, cut away only the part of the decal you need and place it on a paper towel <strong>toner side up</strong> (black). If the piece is really small, you may need to put masking tape on the corners to hold it down for the next step.</p>
</li>
</ul>
<div class="media image alignnone frame">
<a class="popup" href="/images/library/decals/aplying-decals-4.jpg" title="Applying the decal to the front panel">
<div class="img-container" style="padding: 74% 0px 0px 0px; width: 160px;">
<img src="/images/library/decals/thumbs/aplying-decals-4.jpg" alt="Applying the decal to the front panel" title="Applying the decal to the front panel" width="160" height="119" />
</div>
</a>
</div>
<ul>
<li>
<p>Spray a light coat of glue (Sulky KK-2000) at a distance of about 30 cm (12 inch) from the decal. It is difficult to apply the right amount. Too little, the decal won’t hold, too much, there will be visible traces around the decals. If you hold the sprayed mylar 12 inch away from the digits of the code bar on the spray can, you should still be able to read it.</p>
</li>
<li>
<p>Dry the glue it with a heat gun for about 10 seconds.</p>
</li>
<li>
<p>This step is the most delicate part. Position your decal on the panel and rub down the decal making sure you go over each letters or lines. Then, slowly peel away the mylar, again at a 180 degree angle, don’t lift it upwards. The decals will remain on the panel. If you see some parts of the decal starting to lift, put back the mylar, rub down the area and try again.</p>
</li>
</ul>
<p>It is very important to let it dry for a couple of days if you intend to apply a clear varnish coating over the decals. If you don’t wait long enough, the decals will lift and float away on the varnish coating. I screwed up an entire paint job because of that, i had to start all over because it looked like complete crap! Also, give it a week to let dry your base coat before applying your decals. It gives better results and if you make a mistake, it is easier to remove the decal without screwing up the base coat. If you need to remove a decals, don’t use any solvents, use masking tape instead and repeatedly stick and pull the tape over the decal to remove until it all comes off. This will only work for recent application (within 30 minutes), once the glue is completely dry, it’s too late.</p>
<h3 id="multi-color-decals">Multi color decals</h3>
<div class="media image alignleft frame">
<a class="popup" href="/images/library/decals/decal-pfsense-logo.jpg" title="PfSense logo decal using the multi layer technique">
<div class="img-container" style="padding: 75% 0px 0px 0px; width: 160px;">
<img src="/images/library/decals/thumbs/decal-pfsense-logo.jpg" alt="PfSense logo decal" title="PfSense logo decal using the multi layer technique" width="160" height="120" />
</div>
</a>
</div>
<p>It is not possible to apply multiple layers of decals at the same location. The problem is that when you try to apply the second layer, the mylar will stick to the previously applied layer and pull it away. If the second layer don’t overlap the first one, you can use a mask. Take a piece of paper and cut away a portion that correspond to the area where you want to apply the decal. There must be no parts of the first layer visible through the mask cutout, otherwise, the mylar will stick to it and pull it away. This works fine for larger area but it’s really difficult with smaller areas. So, I do the following :</p>
<ul>
<li>Apply the first layer</li>
<li>Wait a week to let it dry completely</li>
<li>Spray 2-3 thin coats of varnish</li>
<li>Wait another week</li>
<li>Apply the second layer</li>
</ul>
<p>That way the first layer is protected by the varnish and won’t lift up when you pull away the mylar film. By doing it that way, it is possible to overlap layers. I used that technique for my pfsense firewall chassis.</p>
<h2 id="finishing">Finishing</h2>
<p>I spray a clear varnish coating to seal both the base coat and the decals. It is done in the same way as the base coat, multiple layers over a span of a week and fine grit sanding between each coat except the final one.</p>
<p>From start to finish, it can take up to 3 weeks to build an enclosure.</p>
HTPC (home theater pc)https://https://www.frigon.info/posts/projects/htpc/2013-05-06T21:12:51-04:002013-05-06T21:12:51-04:00This is my HTPC. At first, it was supposed to be a PVR. I wanted to add a TV tuner, but i dropped the idea and instead, built a separate media server for this purpose. Now it only serve as a “frontend”.
I did not buy a ready-made case for this project, i took an old Scientific Atlanta Explorer 2000 and modified it to fit a mini-itx board.
<p>This is my HTPC. At first, it was supposed to be a PVR. I wanted to add a TV tuner, but i dropped the idea and instead, built a separate media server for this purpose. Now it only serve as a “frontend”.</p>
<p>I did not buy a ready-made case for this project, i took an old Scientific Atlanta Explorer 2000 and modified it to fit a mini-itx board.
<!--more--></p>
<h2 id="specifications">Specifications</h2>
<table>
<thead>
<tr>
<th> </th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<td>Motherboard</td>
<td><a href="http://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-dh61ag.html">Intel DH61AG</a></td>
</tr>
<tr>
<td>CPU</td>
<td>Intel i3 2100 3.1Ghz</td>
</tr>
<tr>
<td>Memory</td>
<td>Kingston 4GB DDR3</td>
</tr>
<tr>
<td>PSU</td>
<td><a href="http://www.cui.com/product/resource/vms-100.pdf">VMS-100-18</a> 18.0V 100W</td>
</tr>
<tr>
<td>SSD drive</td>
<td>mSata Crucial 32GB SSD</td>
</tr>
<tr>
<td>Hard drive</td>
<td>2.5” laptop HD bay (not used)</td>
</tr>
<tr>
<td>OS</td>
<td><a href="http://openelec.tv/">OpenElec</a></td>
</tr>
</tbody>
</table>
<h2 id="case-mod">Case mod</h2>
<p>This is the Explorer 2000 case i modified :</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-empty-4.jpg" title="Scientific Atlanta old case">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-empty-4.jpg" alt="" title="Scientific Atlanta old case" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-empty-2.jpg" title="Scientific Atlanta case gutted and cleaned.">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-empty-2.jpg" alt="" title="Scientific Atlanta case gutted and cleaned." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-empty-3.jpg" title="Scientific Atlanta case gutted and cleaned.">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-empty-3.jpg" alt="" title="Scientific Atlanta case gutted and cleaned." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-empty-1.jpg" title="Scientific Atlanta case gutted and cleaned.">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-empty-1.jpg" alt="" title="Scientific Atlanta case gutted and cleaned." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-1.jpg" title="Applying the template for cutting the opening of the IO shield">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-1.jpg" alt="Template for cutting the opening of the IO shield" title="Applying the template for cutting the opening of the IO shield" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-2.jpg" title="Cutting out the opening for the IO shield">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-2.jpg" alt="IO shield openning" title="Cutting out the opening for the IO shield" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-3.jpg" title="One hole for the standoff is right trought a vent">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-3.jpg" alt="" title="One hole for the standoff is right trought a vent" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-5.jpg" title="Adding an aluminum sheet to provide better support for the standoffs.">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-5.jpg" alt="" title="Adding an aluminum sheet to provide better support for the standoffs." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-6.jpg" title="Motherboard base plate installed">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-6.jpg" alt="" title="Motherboard base plate installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-8.jpg" title="IO Shield in place">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-8.jpg" alt="" title="IO Shield in place" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-4.jpg" title="IO Shield in place">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-4.jpg" alt="" title="IO Shield in place" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-10.jpg" title="I added an additional aluminum sheet on the back to cover unused holes.">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-10.jpg" alt="Aluminum sheet" title="I added an additional aluminum sheet on the back to cover unused holes." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-7.jpg" title="Test fit of the motherboard">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-7.jpg" alt="" title="Test fit of the motherboard" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-11.jpg" title="Completed case, MB and PSU installed">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-11.jpg" alt="" title="Completed case, MB and PSU installed" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-case-mod/pvr-case-mod-9.jpg" title="Testing the MB">
<img src="/images/gallery/project-pvr-case-mod/thumbs/pvr-case-mod-9.jpg" alt="" title="Testing the MB" width="128" height="96" />
</a>
</span>
</div>
<h3 id="io-shield-template">IO Shield template</h3>
<div class="media image alignleft frame">
<a class="link" href="https://raw.githubusercontent.com/bfrigon/project-htpc/master/drawings/templates/template_mb.pdf" title="IO Shield template">
<div class="caption">IO Shield template</div>
<div class="img-container" style="padding: 77% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/htpc-ioshield-template.jpg" alt="IO Shield template" title="IO Shield template" width="300" height="232" />
</div>
</a>
</div>
<p>This is the template i made for the IO shield cutout and for the MB mounting standoff locations. As you can see in the images above, i glued the template on the inside of the case so the thickness of the case walls don’t matters. I used 0.250” swage standoff to mount the motherboard and the template takes that into account. The original template had a reference height of 0.270” because of the aluminum sheet under the MB. I removed the additional 0.020” height in this template assuming that the standoffs are mounted directly on the case bottom.</p>
<p>If you do use this template, make sure you print it to scale! I included a calibration scale for this purpose. Just make sure it measures 6” in both directions.</p>
<h2 id="front-panel">Front panel</h2>
<p>Here are the specs :</p>
<ul>
<li>20×2 character lcd w/RGB backlight</li>
<li>6 navigation buttons (up,down,right,left,ok and menu)</li>
<li>Reset/power buttons and power led (bi-color) which are connected to the motherboard pwr control header.</li>
<li>Two additional bi-color leds (record and message led )</li>
<li>Microchip <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/39631E.pdf">PIC18f2520</a> MCU</li>
<li>USB interface (<a href="http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf">FT232</a> serial to usb)</li>
</ul>
<p>The lcd is controlled by a python script on the HTPC.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/pvr-case-mod-front-panel.jpg" title="Front panel">
<img src="/images/gallery/project-pvr-front-panel/thumbs/pvr-case-mod-front-panel.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/original-front-panel-pcb.jpg" title="The original Scientific Atlanta Explorer 2000 front panel pcb">
<img src="/images/gallery/project-pvr-front-panel/thumbs/original-front-panel-pcb.jpg" alt="Original front panel pcb" title="The original Scientific Atlanta Explorer 2000 front panel pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-connection.jpg" title="Front panel connector">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-connection.jpg" alt="" title="Front panel connector" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-mockup.jpg" title="Front panel pcb model. I wanted to make sure all the components would fit in the pannel assembly before i sent the board to the fab house.">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-mockup.jpg" alt="Front panel pcb model." title="Front panel pcb model. I wanted to make sure all the components would fit in the pannel assembly before i sent the board to the fab house." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-bare.jpg" title="Front panel pcb">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-bare.jpg" alt="" title="Front panel pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb.jpg" title="Front panel pcb assembled">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb.jpg" alt="" title="Front panel pcb assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-installed.jpg" title="Front panel installed">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-installed.jpg" alt="" title="Front panel installed" width="128" height="96" />
</a>
</span>
</div>
<h3 id="design-files">Design files</h3>
<div class="media image alignnone frame">
<a class="link" href="https://raw.githubusercontent.com/bfrigon/project-htpc/master/drawings/schematics/front-panel-rev-b.pdf" title="HTPC LCD schematic (Rev. B)">
<div class="caption">HTPC LCD schematic (Rev. B)</div>
<div class="img-container" style="padding: 64% 0px 0px 0px; width: 300px;">
<img src="/images/library/thumbs/pvr-front-panel-pcb-schematic.png" alt="HTPC LCD schematic (Rev. B)" title="HTPC LCD schematic (Rev. B)" width="300" height="193" />
</div>
</a>
</div>
<table>
<thead>
<tr>
<th style="text-align: center">Type</th>
<th>Title</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">pdf</td>
<td><a href="https://raw.githubusercontent.com/bfrigon/project-htpc/master/pcb/front-panel/docs/bom.pdf">LCD module - Bill of material</a></td>
<td>40.3 KB</td>
</tr>
<tr>
<td style="text-align: center">pdf</td>
<td><a href="https://raw.githubusercontent.com/bfrigon/project-htpc/master/drawings/schematics/front-panel-rev-b.pdf">LCD module - Schematic (Rev. B)</a></td>
<td>38.9 KB</td>
</tr>
</tbody>
</table>
<h2 id="hard-drive-bay">Hard drive bay</h2>
<p>I made an aluminum bracket for a 2.5” drive. It used to have a 750GB drive for my media files, but i moved those files to a separate server and use a 32GB mSata drive for the OS.</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-pvr-hd-bay/hard-drive-bay-1.jpg" title="Hard drive bay brackets">
<img src="/images/gallery/project-pvr-hd-bay/thumbs/hard-drive-bay-1.jpg" alt="" title="Hard drive bay brackets" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-hd-bay/hard-drive-bay-2.jpg" title="Hard drive bay assembly">
<img src="/images/gallery/project-pvr-hd-bay/thumbs/hard-drive-bay-2.jpg" alt="" title="Hard drive bay assembly" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-hd-bay/hard-drive-bay-3.jpg" title="Assembled drive bay">
<img src="/images/gallery/project-pvr-hd-bay/thumbs/hard-drive-bay-3.jpg" alt="" title="Assembled drive bay" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-hd-bay/hard-drive-bay-4.jpg" title="Hard drive test fit">
<img src="/images/gallery/project-pvr-hd-bay/thumbs/hard-drive-bay-4.jpg" alt="" title="Hard drive test fit" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-hd-bay/hard-drive-bay-5.jpg" title="2.5" Hard drive bay installed">
<img src="/images/gallery/project-pvr-hd-bay/thumbs/hard-drive-bay-5.jpg" alt="" title="2.5" Hard drive bay installed" width="128" height="96" />
</a>
</span>
</div>
<h2 id="media-center-os">Media center OS</h2>
<p>Currently, I use <a href="http://openelec.tv/">OpenElec</a>, a lightweight Linux distribution with <a href="http://xbmc.org/"><del>XBMC</del> Kodi</a>. At first, I tried Mythbuntu (xbmc 11), it worked fine, but i was unable to install the new version. I had problems getting the video card (intel) to work. Anyway, i tried Openelec, and it worked perfectly. Although, with the recent updates, I’m having problems with viewing live tv from my TvHeadend server, it constantly display the message “connection lost” and playback of recorded streams sometimes fail to play (“unknown command” error message)…</p>
<div class="gallery">
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/pvr-case-mod-front-panel.jpg" title="Front panel">
<img src="/images/gallery/project-pvr-front-panel/thumbs/pvr-case-mod-front-panel.jpg" alt="" title="Front panel" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/original-front-panel-pcb.jpg" title="The original Scientific Atlanta Explorer 2000 front panel pcb">
<img src="/images/gallery/project-pvr-front-panel/thumbs/original-front-panel-pcb.jpg" alt="Original front panel pcb" title="The original Scientific Atlanta Explorer 2000 front panel pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-connection.jpg" title="Front panel connector">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-connection.jpg" alt="" title="Front panel connector" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-mockup.jpg" title="Front panel pcb model. I wanted to make sure all the components would fit in the pannel assembly before i sent the board to the fab house.">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-mockup.jpg" alt="Front panel pcb model." title="Front panel pcb model. I wanted to make sure all the components would fit in the pannel assembly before i sent the board to the fab house." width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-bare.jpg" title="Front panel pcb">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-bare.jpg" alt="" title="Front panel pcb" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb.jpg" title="Front panel pcb assembled">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb.jpg" alt="" title="Front panel pcb assembled" width="128" height="96" />
</a>
</span>
<span class="media image frame">
<a href="/images/gallery/project-pvr-front-panel/front-panel-pcb-installed.jpg" title="Front panel installed">
<img src="/images/gallery/project-pvr-front-panel/thumbs/front-panel-pcb-installed.jpg" alt="" title="Front panel installed" width="128" height="96" />
</a>
</span>
</div>
<h2 id="why-did-you-not-use-a-raspberry-pi-instead-">Why did you not use a Raspberry PI instead ?</h2>
<p>The reasons why is simply because when i made this project, the PI had just been released and it was still hard to get your hands on it. Plus, from what i’ve read at the time, the support for XBMC was not as polished as it is today. My initial goal was to install a drive and the TV tuner which is something that the PI would not supports. That was before i built my media server. My next HTPC build might feature a Raspberry PI but for now, it is working just fine for me.</p>