tag:blogger.com,1999:blog-23505074299184465962024-03-12T17:23:23.609-07:00YetifrisstlamaA Blog about life, the universe and everything -- and pinball machines. Mostly pinball machines!Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-2350507429918446596.post-74934284408974072322018-12-02T21:59:00.001-08:002018-12-02T22:00:09.397-08:00Moving on to https://yetifrisstlama.github.io/I'm moving to github pages.<br />
<br />
Newposts will come out on <a href="https://yetifrisstlama.github.io/">https://yetifrisstlama.github.io/</a>Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com3tag:blogger.com,1999:blog-2350507429918446596.post-6453113770900837702018-06-06T22:13:00.004-07:002018-06-06T22:13:32.686-07:00Current state of Fan-Tas-Tic pinball<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/Wv0-pjCVWds/0.jpg" src="https://www.youtube.com/embed/Wv0-pjCVWds?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com1tag:blogger.com,1999:blog-2350507429918446596.post-16091752504767001832018-02-01T23:28:00.003-08:002018-12-17T00:35:34.139-08:00The ESP32 Pinball RGB Matrix Animation Clock (Espirgbani)<div style="clear: both; text-align: left;">
Displays the time and random DMD animations from various pinball machines. The whole show is run by a single ESP32. The inspiration came from <a href="http://run-dmd.com/">http://run-dmd.com/</a>.</div>
<h3 style="clear: both; text-align: left;">
The project on github</h3>
<div>
<a href="https://github.com/yetifrisstlama/Espirgbani">https://github.com/yetifrisstlama/Espirgbani</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-4sc8YXFKlE0/W_9IuN9UXPI/AAAAAAAAY0A/oTtRr_rur9w4Nv8lxbFTNpaxXPEpC1RfgCLcBGAs/s1600/ezgif.com-optimize.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="185" data-original-width="600" src="https://2.bp.blogspot.com/-4sc8YXFKlE0/W_9IuN9UXPI/AAAAAAAAY0A/oTtRr_rur9w4Nv8lxbFTNpaxXPEpC1RfgCLcBGAs/s1600/ezgif.com-optimize.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<br />
<h2>
LEDs</h2>
<div>
I got my two 64x32 LED panels from <a href="https://www.aliexpress.com/item/P4-Indoor-SMD-3-in-1-Full-Color-LED-Module-1-16-Scan-Current-Driver-256/32380311346.html?spm=a2g0s.9042311.0.0.w47cL0" target="_blank">Aliexpress</a>. Not surprisingly (with that price tag) they were refurbished and showed some signs of soldering rework on the boards. They do work perfectly fine though.</div>
<h2>
Frame</h2>
Easy if you have access to a laser cutter. I used 1/4 inch plywood for the back and grey tinted acrylic (expensive!) for the front. Right on top of the LED modules is a milky diffuser foil, which I got from broken LCD monitors. Hexagonal spacers hold everything together. Laser cutting is great. Stuff actually fits together just the way it should :D<br />
<br />
<a href="http://a360.co/2nFgDTn" target="_blank">Here's the Fusion360 preview</a><br />
<br />
<a href="https://github.com/yetifrisstlama/Espirgbani/tree/master/pcb/lasercut" target="_blank">Here's the actual .dxf files</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-fSIVvBXMwsM/WnQM9aqemUI/AAAAAAAAVZk/CquoF9EXgAIeeBRiXBOVMXYSQVfQdfE7wCKgBGAs/s1600/IMG_20180201_224228.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://4.bp.blogspot.com/-fSIVvBXMwsM/WnQM9aqemUI/AAAAAAAAVZk/CquoF9EXgAIeeBRiXBOVMXYSQVfQdfE7wCKgBGAs/s320/IMG_20180201_224228.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Everything runs of a re-purposed 19 V laptop power supply. The higher voltage makes it possible to use thin stealthy power cables when hanging the clock on a wall. I used two cheap step-down modules mounted to the back of the panels to generate the 5 V at up to 5 A they need.</div>
<h3>
PCB</h3>
<div>
Extremely straightforward. There's the ESP32, a 3.3 V regulator, a programming port, a SD card slot (from a dead RaspiA) and that's about it. All the tricky stuff happens in firmware.</div>
<div>
<br /></div>
<div>
<a href="https://github.com/yetifrisstlama/Espirgbani/raw/master/pcb/pdf/rgb.pdf" target="_blank">Schematic</a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/yetifrisstlama/Espirgbani/raw/master/pcb/pdf/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="389" data-original-width="800" height="193" src="https://github.com/yetifrisstlama/Espirgbani/raw/master/pcb/pdf/1.png" width="400" /></a></div>
<h2 style="clear: both; text-align: left;">
Firmware</h2>
<h3>
Features</h3>
<div>
<ul>
<li>Uses <a href="https://esp32.com/viewtopic.php?t=3188" target="_blank">sprite_tm's I2S DMA driver</a> to refresh the display at > 100 Hz with <b>zero</b> CPU load</li>
<li>Right now there's 3 graphical layers: <b>animated background</b>, <b>time string</b>, <b>pinball animations</b></li>
<li>All framebuffers are RGBA. Does full alpha compositing (with pre-multiplied RGB values) according to the <a href="http://www.cs.princeton.edu/courses/archive/fall00/cs426/papers/smith95a.pdf" target="_blank">classic paper</a>.</li>
<li>Uses a variable width & anti aliased bitmap fonts for writing the time. Supports the <a href="http://www.angelcode.com/products/bmfont/" target="_blank">AngelCode bitmap font format</a> and reads .bmp and binary .fnt files from the SD card.</li>
<li>Credit for collecting a huge number of pinball animations goes to <a href="https://rundmdimage.wordpress.com/">https://rundmdimage.wordpress.com/</a>. This clock supports the same image-file <a href="https://github.com/yetifrisstlama/Espirgbani/blob/master/dev/pinballAnimationExtractor.ipynb" target="_blank">format</a>.</li>
<li>Uses some nice C (almost) <a href="https://github.com/yetifrisstlama/Espirgbani/blob/master/dev/plasma.ipynb" target="_blank">one liners</a> to produce attractive animated backgrounds on the fly. It's like a poor mans shader</li>
<li>Has a simplistic (needs more work!) web-interface based on the excellent <a href="https://github.com/Spritetm/libesphttpd" target="_blank">libesphttpd</a></li>
</ul>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/yetifrisstlama/Espirgbani/raw/master/pcb/pdf/front.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="246" data-original-width="800" height="167" src="https://github.com/yetifrisstlama/Espirgbani/raw/master/pcb/pdf/front.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-eOgBO_-RiVI/WnQMccckhkI/AAAAAAAAVZY/s_lnd6ex8IYkHxwDlBGkqNHwpxvocrscQCKgBGAs/s1600/IMG_20180201_175925.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1463" data-original-width="1600" height="292" src="https://3.bp.blogspot.com/-eOgBO_-RiVI/WnQMccckhkI/AAAAAAAAVZY/s_lnd6ex8IYkHxwDlBGkqNHwpxvocrscQCKgBGAs/s320/IMG_20180201_175925.jpg" width="320" /></a></div>
<br />
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/gC0adwNcO7Q/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/gC0adwNcO7Q?feature=player_embedded" width="320"></iframe></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com10tag:blogger.com,1999:blog-2350507429918446596.post-57460274847942933012017-09-04T00:13:00.001-07:002017-09-04T00:34:16.234-07:00Fan-Tas-Tic Pinball, Part 8, LED - display!!!<div class="separator" style="clear: both; text-align: center;">
I've finally received the 32x32 panels in the mail and started assembling the play-field screen. Seeing this thing come together was a real joy!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-5xzWf-msr4A/Waz-LwPDhII/AAAAAAAATsk/uC5aALwcaoAFbDxIwAlMPoHg8_H1Uh7XgCKgBGAs/s1600/IMG_20170821_083400.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://1.bp.blogspot.com/-5xzWf-msr4A/Waz-LwPDhII/AAAAAAAATsk/uC5aALwcaoAFbDxIwAlMPoHg8_H1Uh7XgCKgBGAs/s320/IMG_20170821_083400.jpg" width="320" /></a><a href="https://2.bp.blogspot.com/-ArT3QI8oh6A/Waz-SkZOhZI/AAAAAAAATso/6eYTAbLM82YobsIEm7hzzHGJbi5r_Uy_wCKgBGAs/s1600/IMG_20170821_191257.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://2.bp.blogspot.com/-ArT3QI8oh6A/Waz-SkZOhZI/AAAAAAAATso/6eYTAbLM82YobsIEm7hzzHGJbi5r_Uy_wCKgBGAs/s320/IMG_20170821_191257.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-RCYMrqrr5B0/Waz-Z0txC0I/AAAAAAAATss/U18MLzSyq_ciVLLhwIE6N0Tj_zFQ9vgcACKgBGAs/s1600/IMG_20170821_191946.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://3.bp.blogspot.com/-RCYMrqrr5B0/Waz-Z0txC0I/AAAAAAAATss/U18MLzSyq_ciVLLhwIE6N0Tj_zFQ9vgcACKgBGAs/s320/IMG_20170821_191946.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
I made some brackets from scrap wood to precisely align the LEDs with the pixel grid, which worked out quite well. And yes, no joke, right now the panel is mounted with fishing line. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-KAg9UnT8fTE/Waz6J3pmhdI/AAAAAAAATsU/G7WEoOgFlNsTv4eGvC6IAlNXk_QT2ERiACKgBGAs/s1600/IMG_20170822_231713.jpg" imageanchor="1"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://1.bp.blogspot.com/-KAg9UnT8fTE/Waz6J3pmhdI/AAAAAAAATsU/G7WEoOgFlNsTv4eGvC6IAlNXk_QT2ERiACKgBGAs/s320/IMG_20170822_231713.jpg" width="320" /></a> <a href="https://1.bp.blogspot.com/-CrD7L-ZeLJY/Waz6J1bhefI/AAAAAAAATsU/LqTtaeaL4DsBrfp3AjXneo-K44JAhUZZQCKgBGAs/s1600/IMG_20170822_231724.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://1.bp.blogspot.com/-CrD7L-ZeLJY/Waz6J1bhefI/AAAAAAAATsU/LqTtaeaL4DsBrfp3AjXneo-K44JAhUZZQCKgBGAs/s320/IMG_20170822_231724.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The panel is driven directly from the GPIO ports of the Raspberry PI. This is possible thanks to <a href="https://github.com/hzeller/rpi-rgb-led-matrix" target="_blank">hzellers LED library</a>. The 3 ICs on the adapter board are TTL buffers for 3.3 V to 5 V conversion. On the right is the complete Fan-Tas-Tic controller board including all PSUs, mounted on a wooden plank</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
I'm quite happy with the way it turned out. Especially adding the diffusor sheet from a LCD screen and replacing the window with tinted acrylic gave it exactly the stealth and pixelated look I was after. This is especially obvious in the video below, where I put it all together:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/pe7TBkTFTuM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/pe7TBkTFTuM?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-Or1DkZdWMrQ/Waz6J_0O62I/AAAAAAAATsU/1bg7NEkLYPwGdPNiI6ROHC6gmNl8VYP6QCKgBGAs/s1600/IMG_20170822_234646.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://2.bp.blogspot.com/-Or1DkZdWMrQ/Waz6J_0O62I/AAAAAAAATsU/1bg7NEkLYPwGdPNiI6ROHC6gmNl8VYP6QCKgBGAs/s320/IMG_20170822_234646.jpg" width="320" /></a><a href="https://2.bp.blogspot.com/-4yOY5g1UWRY/Waz6JwKxbgI/AAAAAAAATsU/3ZOGB1XVD8MwIRnR4Swd2gN_FaMjN1iJACKgBGAs/s1600/IMG_20170822_234749.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://2.bp.blogspot.com/-4yOY5g1UWRY/Waz6JwKxbgI/AAAAAAAATsU/3ZOGB1XVD8MwIRnR4Swd2gN_FaMjN1iJACKgBGAs/s320/IMG_20170822_234749.jpg" width="320" /></a><a href="https://3.bp.blogspot.com/-ERxddu25HuI/Waz6JyzYlDI/AAAAAAAATsU/E2FXoQGc6cUzdWfJHsGr6TsWyEY-jGd_gCKgBGAs/s1600/IMG_20170822_234801.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://3.bp.blogspot.com/-ERxddu25HuI/Waz6JyzYlDI/AAAAAAAATsU/E2FXoQGc6cUzdWfJHsGr6TsWyEY-jGd_gCKgBGAs/s320/IMG_20170822_234801.jpg" width="240" /></a><a href="https://1.bp.blogspot.com/-iirHxLn4hhQ/Waz6J5-0yYI/AAAAAAAATsU/yibXxVwUEB4KGqCHWLQzjZG1ArWln-xQgCKgBGAs/s1600/IMG_20170822_234727.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://1.bp.blogspot.com/-iirHxLn4hhQ/Waz6J5-0yYI/AAAAAAAATsU/yibXxVwUEB4KGqCHWLQzjZG1ArWln-xQgCKgBGAs/s320/IMG_20170822_234727.jpg" style="cursor: move;" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next step is integrating the screen in the Mission Pinball framework and finally coming up with some game-rules, graphics and sound-effects.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-10745222573834875962017-08-20T00:43:00.001-07:002017-08-20T00:44:20.895-07:00Hydroponic Veggies Part 3 -- Calibrating the PH probe<div dir="ltr" style="text-align: left;" trbidi="on">
Step 1: Buy calibrated PH buffer solution (at least 2 different reference points are needed)<br />
<br />
Step 2: Dip the probe in, log the raw values<br />
<br />
Step 3: Install Python and calculate correction values<br />
<br />
<a href="https://github.com/yetifrisstlama/DrGreenThumb/blob/master/phCalibration/phCalibration.ipynb" target="_blank">Here's the Jupyter Notebook I used for that purpose</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-X4-wtczdZFM/WZk9PB3kOJI/AAAAAAAATjI/fJFXXUdS9vU-BbDoV-eXzeSapgSiBz9TgCKgBGAs/s1600/IMG_20170819_152705.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://4.bp.blogspot.com/-X4-wtczdZFM/WZk9PB3kOJI/AAAAAAAATjI/fJFXXUdS9vU-BbDoV-eXzeSapgSiBz9TgCKgBGAs/s320/IMG_20170819_152705.jpg" width="320" /></a> <a href="http://3.bp.blogspot.com/-wo-m284VV7w/WZk9UJFTxyI/AAAAAAAATjQ/97SLte2XVpIrpuCZZ145ZfoXboMzFEa5gCK4BGAYYCw/s1600/phCal.png" imageanchor="1"><img border="0" height="240" src="https://3.bp.blogspot.com/-wo-m284VV7w/WZk9UJFTxyI/AAAAAAAATjQ/97SLte2XVpIrpuCZZ145ZfoXboMzFEa5gCK4BGAYYCw/s320/phCal.png" width="320" /></a></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-22385279152884773452017-07-22T23:03:00.003-07:002017-07-22T23:30:49.692-07:00Hydroponic Veggies Part 2 -- The water level sensor<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
The initial idea was to stick a VL53L0X TOF distance sensor to the reservoir lid and get the water level from there.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://static4.arrow.com/-/media/images/research-and-events/articles/0916/vl53l0x_article2.jpg?h=400&w=500?mw=290&hash=84F598C0A38D21DA0BBC3C048502862B04897DBB" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="502" height="254" src="https://static4.arrow.com/-/media/images/research-and-events/articles/0916/vl53l0x_article2.jpg?h=400&w=500?mw=290&hash=84F598C0A38D21DA0BBC3C048502862B04897DBB" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Didn't work out. </b>Not enough light reflected from the water surface lead to super flaky readings. What did work out in the end is this ...</div>
<a name='more'></a><div class="separator" style="clear: both; text-align: center;">
1/2 inch PVC pipe, spray-painted black on the inside. Inside a white styrofoam `floater`.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-OyYmDkNO2Ew/WXQ4mztmF8I/AAAAAAAATXU/saJeeFIlhOsf-JVohiRs1Z76QuBXg-J-ACKgBGAs/s1600/IMG_20170722_115133.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://2.bp.blogspot.com/-OyYmDkNO2Ew/WXQ4mztmF8I/AAAAAAAATXU/saJeeFIlhOsf-JVohiRs1Z76QuBXg-J-ACKgBGAs/s320/IMG_20170722_115133.jpg" width="240" /></a> <a href="https://2.bp.blogspot.com/-LPw7Slj0Nrs/WXQ8fjQgFyI/AAAAAAAATYA/AGlZwsXfDG4BdVjYX9GLbj0mkZQeh_tTACKgBGAs/s1600/IMG_20170722_115138.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://2.bp.blogspot.com/-LPw7Slj0Nrs/WXQ8fjQgFyI/AAAAAAAATYA/AGlZwsXfDG4BdVjYX9GLbj0mkZQeh_tTACKgBGAs/s320/IMG_20170722_115138.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The sensor was hot-glued to a piece of acrylic, which was mounted to one end of the PVC pipe. Hot glue for waterproofing the electronics. If it looks stupid but it works, it's not stupid ;)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-DR7oriLadmY/WXQ8no0-OwI/AAAAAAAATYE/09EQAkDzu6otCSUduBYs843-vuK3vq6ywCKgBGAs/s1600/IMG_20170722_115034.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://1.bp.blogspot.com/-DR7oriLadmY/WXQ8no0-OwI/AAAAAAAATYE/09EQAkDzu6otCSUduBYs843-vuK3vq6ywCKgBGAs/s320/IMG_20170722_115034.jpg" width="320" /></a> <a href="https://4.bp.blogspot.com/-NiqOOK9YXqg/WXQ4m98yj_I/AAAAAAAATXU/t0d7SQ6Ua2YFl9ixO9q59ZMRCQsqdtbqQCKgBGAs/s1600/IMG_20170722_115027.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://4.bp.blogspot.com/-NiqOOK9YXqg/WXQ4m98yj_I/AAAAAAAATXU/t0d7SQ6Ua2YFl9ixO9q59ZMRCQsqdtbqQCKgBGAs/s320/IMG_20170722_115027.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Here's the water-level sensor, the PH-probe and the 1-wire temp. sensor in the reservoir.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-NP-4p2Orj5g/WXQ7Bn0s0nI/AAAAAAAATXw/fr6PcN7Fqm0NZ8XBv50t2g3YYQQsi2NOwCKgBGAs/s1600/IMG_20170722_191846.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://1.bp.blogspot.com/-NP-4p2Orj5g/WXQ7Bn0s0nI/AAAAAAAATXw/fr6PcN7Fqm0NZ8XBv50t2g3YYQQsi2NOwCKgBGAs/s320/IMG_20170722_191846.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The brown color of the water is due to using coconut coir as a growing medium. So far, this doesn't seem to have any negative effect on the plants.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-cilSJK0Gb94/WXRBnQyGl9I/AAAAAAAATYc/mYzJHwVyV5MAF0aQsB55tFpfVB7b1rN9wCLcBGAs/s1600/wl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="431" data-original-width="595" src="https://3.bp.blogspot.com/-cilSJK0Gb94/WXRBnQyGl9I/AAAAAAAATYc/mYzJHwVyV5MAF0aQsB55tFpfVB7b1rN9wCLcBGAs/s1600/wl.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Readings are a bit noisy (+- 1 mm) but seem to be stable and accurate. The large dips happen when water is pumped from the reservoir into the dutch buckets, flooding the system. There is a bit of delay until all the water has drained back into the reservoir.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com1tag:blogger.com,1999:blog-2350507429918446596.post-16545786999319488712017-07-06T11:15:00.002-07:002017-09-04T00:36:45.850-07:00Fan-Tas-Tic Pinball, Part 7, Back to a LED - display!<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
The original Fan-Tas-Tic machine had a mechanical roulette wheel assembly, visible through a window in the middle of the playing field. For some time now I had it replaced with a 1280x720 LCD panel.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-lRGILZpzxC4/WV6A-m31GkI/AAAAAAAATKs/QqVvvXgt-lwTbKaZCPFTxIGXlwyjHgOtACK4BGAYYCw/s1600/IMG_20160220_200546-8.jpg" imageanchor="1"><img border="0" height="320" src="https://4.bp.blogspot.com/-lRGILZpzxC4/WV6A-m31GkI/AAAAAAAATKs/QqVvvXgt-lwTbKaZCPFTxIGXlwyjHgOtACK4BGAYYCw/s320/IMG_20160220_200546-8.jpg" width="320" /></a> <iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/0eL0hHpMdWM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/0eL0hHpMdWM?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
However, I'm not completely happy with this configuration and recently decided, the LCD panel has to go! </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Even though it worked nicely with the Raspberry PI and Mission Pinball. It wasn't flashy enough, had some large borders at the top and bottom, and the rather high resolution was completely wasted at typical playing distance. Also I underestimated the effort it takes, designing high-res video content -- which kind of got me stuck for a while.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The replacement will be a 32 x 32 LED video tile. The 5 mm pitched versions have the perfect size to cover the 6 inch playfield cut-out. To adapt the square to the circle, I designed a `pixel-grid` in Fusion 360. It is supposed to give the pixels a well defined appearance and makes sure that light from neighboring LEDs does not spill over.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-Kn12T0fVzYo/WV559iRYyHI/AAAAAAAATKc/40sVqr8ZwZEdmM0yLNR3zMe5w__sMe9DQCK4BGAYYCw/s1600/cut.jpg" imageanchor="1"><img border="0" height="419" src="https://3.bp.blogspot.com/-Kn12T0fVzYo/WV559iRYyHI/AAAAAAAATKc/40sVqr8ZwZEdmM0yLNR3zMe5w__sMe9DQCK4BGAYYCw/s640/cut.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://a360.co/2tv8OCB" target="_blank">Link to the 3D model</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-p5ODC9hFUrQ/WV53o3yx0uI/AAAAAAAATKU/o88l_Kqt_QobMsJC9COFOHW3JEemrN2AwCK4BGAYYCw/s1600/Led-Tas-Tic%2Bv9.png" imageanchor="1"><img border="0" height="184" src="https://1.bp.blogspot.com/-p5ODC9hFUrQ/WV53o3yx0uI/AAAAAAAATKU/o88l_Kqt_QobMsJC9COFOHW3JEemrN2AwCK4BGAYYCw/s320/Led-Tas-Tic%2Bv9.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
I went for 1 mm wall thickness, hoping that the university laser-cutter can handle it. And it just about did!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/X0Vu9Ef8-Yc/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/X0Vu9Ef8-Yc?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
30 minutes later I got the finished piece. In one small spot the laser didn't cut through all the way due to some irregularities in the plywood. I finished it off with an x-acto knive. The result is not perfect but I think it will do the job.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-o_vZP4vzCow/WV53F9xZPEI/AAAAAAAATKM/3b_PVZD1LYsPdzrXH857-OviI79B_xaAwCKgBGAs/s1600/IMG_20170705_190118.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://4.bp.blogspot.com/-o_vZP4vzCow/WV53F9xZPEI/AAAAAAAATKM/3b_PVZD1LYsPdzrXH857-OviI79B_xaAwCKgBGAs/s320/IMG_20170705_190118.jpg" width="320" /></a> <a href="https://2.bp.blogspot.com/-xgVXeAJwJ6w/WV53F2olfWI/AAAAAAAATKM/AWAhCjLQ6UQI2yTidbLPTVuzbgSQRxWUgCKgBGAs/s1600/IMG_20170705_182841.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://2.bp.blogspot.com/-xgVXeAJwJ6w/WV53F2olfWI/AAAAAAAATKM/AWAhCjLQ6UQI2yTidbLPTVuzbgSQRxWUgCKgBGAs/s320/IMG_20170705_182841.jpg" width="320" /></a> <a href="https://4.bp.blogspot.com/-JISPIJCODHI/WV53F1GkSuI/AAAAAAAATKM/Rajw5f7ydaoElfb2BpJO7tRhYfzw1UzQgCKgBGAs/s1600/IMG_20170705_182808.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://4.bp.blogspot.com/-JISPIJCODHI/WV53F1GkSuI/AAAAAAAATKM/Rajw5f7ydaoElfb2BpJO7tRhYfzw1UzQgCKgBGAs/s320/IMG_20170705_182808.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-40839817428294262302017-07-03T11:47:00.001-07:002017-07-06T11:23:13.625-07:00Hydroponic Veggies<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
The goal is to grow tomatoes, chilis, carrots, lettuce and spinach on my balcony. It shall be hydroponic and as much automated as possible. Here's my setup so far ...</div>
<h2 style="clear: both; text-align: center;">
<span style="font-size: x-large;">
Plumbing and Dutch-buckets</span></h2>
<div>
No rocket since here. It's all made from 1/2 inch PCV pipe and fittings from the hardware store. The buckets were done according to<span style="font-size: large;"> <a href="https://www.youtube.com/watch?v=nXy32Dr4Z4A" target="_blank">these excellent instructions</a></span> by mhpgardener. As I wanted the setup to be removable, I didn't use any glue. To achieve a good seal anyway, I used a bit of silicone grease on all fittings. So far it holds up fine.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-T_0M11UlYzg/WVqMJYnUvtI/AAAAAAAATFM/32t3YGXovK0DzkpPaXavO6vJPQkFHWqhgCK4BGAYYCw/s1600/IMG_20170701_144657.jpg" imageanchor="1"><img border="0" height="320" src="https://2.bp.blogspot.com/-T_0M11UlYzg/WVqMJYnUvtI/AAAAAAAATFM/32t3YGXovK0DzkpPaXavO6vJPQkFHWqhgCK4BGAYYCw/s320/IMG_20170701_144657.jpg" width="240" /></a> <a href="http://2.bp.blogspot.com/-qCi9iP6wte4/WVqMMGVV_vI/AAAAAAAATFU/w8PshtUz--Qhq92M2CwCYuafy8al-49JgCK4BGAYYCw/s1600/IMG_20170701_144631.jpg" imageanchor="1"><img border="0" height="320" src="https://2.bp.blogspot.com/-qCi9iP6wte4/WVqMMGVV_vI/AAAAAAAATFU/w8PshtUz--Qhq92M2CwCYuafy8al-49JgCK4BGAYYCw/s320/IMG_20170701_144631.jpg" width="240" /></a> <a href="http://1.bp.blogspot.com/-hQ1fxoJhWqo/WVqMOusyEdI/AAAAAAAATFc/5s6hsnev0mon0uZ9GbUTeg_GJJCJbsnDACK4BGAYYCw/s1600/IMG_20170629_194519.jpg" imageanchor="1"><img border="0" height="180" src="https://1.bp.blogspot.com/-hQ1fxoJhWqo/WVqMOusyEdI/AAAAAAAATFc/5s6hsnev0mon0uZ9GbUTeg_GJJCJbsnDACK4BGAYYCw/s320/IMG_20170629_194519.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<h2 style="clear: both; text-align: center;">
<span style="font-size: x-large;">Dosing pump assembly</span></h2>
<div>
<div class="separator" style="clear: both; text-align: center;">
This contraption shall refill the reservoir with fresh water from the tap and add small amounts of plant food, ph-stabilizer and hydrogen peroxide. I'm using cheap peristaltic dosing pumps and a solenoid valve from ebay.</div>
<div class="separator" style="clear: both; text-align: center;">
The pumps feed into a 1 inch PCV pipe, which will guide the liquids directly into the reservoir.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-s9D9ZKxj8gA/WU2KMzAp6UI/AAAAAAAAS-I/kG1p2lWqStoJxd0zQINEMHnXJTBOnR9vwCLcBGAs/s1600/stand%2Bv14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="956" data-original-width="1452" height="262" src="https://2.bp.blogspot.com/-s9D9ZKxj8gA/WU2KMzAp6UI/AAAAAAAAS-I/kG1p2lWqStoJxd0zQINEMHnXJTBOnR9vwCLcBGAs/s400/stand%2Bv14.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
A 3D model has been designed in Fusion360, which helped to lay out the pumps in a space-saving pattern and to keep the piping as short as possible.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The 3D model is available here: <a href="http://a360.co/2sLctMa">http://a360.co/2sLctMa</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-SIRfinP1Apw/WU2F_fhrlgI/AAAAAAAAS94/e8njjR6rERwI4XI1NCcfXJXEha3qSGrqACKgBGAs/s1600/IMG_20170621_231545.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="400" src="https://2.bp.blogspot.com/-SIRfinP1Apw/WU2F_fhrlgI/AAAAAAAAS94/e8njjR6rERwI4XI1NCcfXJXEha3qSGrqACKgBGAs/s400/IMG_20170621_231545.jpg" width="300" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The two plates were laser-cut from 6 mm acrylic sheet. Pro tip: take apart old flat-screen monitors and extract the light-guide assembly behind the LCD. This is an excellent source of high-quality acrylic sheet material.</div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-JXGpcCp17wA/WU2F_YE-zYI/AAAAAAAAS94/QdYpKUarjoESRVIFIYO1GqXl_QDaxU64wCKgBGAs/s1600/IMG_20170621_231618.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="300" src="https://3.bp.blogspot.com/-JXGpcCp17wA/WU2F_YE-zYI/AAAAAAAAS94/QdYpKUarjoESRVIFIYO1GqXl_QDaxU64wCKgBGAs/s400/IMG_20170621_231618.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: center;">
<span style="font-size: x-large;">
Controller board</span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-ydYBIydJ7Ss/WVqNRDmm7CI/AAAAAAAATFk/KQ53p0AK0UQuI54wCFVg8J0qczf3q-nkgCK4BGAYYCw/s1600/xccxscscsxcsx.jpg" imageanchor="1"><img border="0" height="305" src="https://3.bp.blogspot.com/-ydYBIydJ7Ss/WVqNRDmm7CI/AAAAAAAATFk/KQ53p0AK0UQuI54wCFVg8J0qczf3q-nkgCK4BGAYYCw/s400/xccxscscsxcsx.jpg" width="400" /></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Xq2Miot8u5M/WVqRGiXVwvI/AAAAAAAATGI/Dfx_gtmgr58dSUy6ahbG7wm9h_pQeQswACK4BGAYYCw/s1600/front.jpg" imageanchor="1"><img border="0" height="316" src="https://4.bp.blogspot.com/-Xq2Miot8u5M/WVqRGiXVwvI/AAAAAAAATGI/Dfx_gtmgr58dSUy6ahbG7wm9h_pQeQswACK4BGAYYCw/s320/front.jpg" width="320" /></a> <a href="http://2.bp.blogspot.com/-MdxBu2YhCNM/WVqNeZ-cmDI/AAAAAAAATF0/HjvPa2OEVsQvQWt62eMMaBpF5PJLiWucACK4BGAYYCw/s1600/IMG_20170701_202136.jpg" imageanchor="1"><img border="0" height="292" src="https://2.bp.blogspot.com/-MdxBu2YhCNM/WVqNeZ-cmDI/AAAAAAAATF0/HjvPa2OEVsQvQWt62eMMaBpF5PJLiWucACK4BGAYYCw/s320/IMG_20170701_202136.jpg" width="320" /></a><a href="https://2.bp.blogspot.com/-gXKfILKQNuY/WU2F_TkPI4I/AAAAAAAAS94/1BkvFSM7QcMH8Xqa46dsQT9afTIu4zclgCKgBGAs/s1600/IMG_20170621_010225.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://2.bp.blogspot.com/-gXKfILKQNuY/WU2F_TkPI4I/AAAAAAAAS94/1BkvFSM7QcMH8Xqa46dsQT9afTIu4zclgCKgBGAs/s320/IMG_20170621_010225.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: center;">
<span style="font-size: x-large;">PH - Probe interface</span></h2>
<div>
Basically it's a voltage follower driving an inverting amplifier. Trick is to keep one end of the ph-probe at a certain bias voltage, so positive and negative voltages can be read with only a single supply. Some initial simulations were done in LT-Spice.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/yetifrisstlama/DrGreenThumb" target="_blank"><span style="font-size: large;"><b>PCB files (Kicad) and some initial firmware on GitHub</b></span></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-88554433743332900542016-05-01T05:18:00.002-07:002017-07-06T11:23:46.244-07:00Fan-Tas-Tic Pinball, Part 6, EMI trouble!<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
This is going to be a little story about electromagnetic interference (EMI). The good thing is: there will be a happy end :)</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Having installed all the WS2811 LEDs, I decided to play a quick game to see if everything is still working. It was quite surprising to see the LEDs flicker like a Christmas tree, even though they should have been dark. This happened everytime the flipper coils actuated. Clearly there was some kind of EMI problem, inducing noise on the data line of the LEDs.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
A quick scope measurement on the solenoids revealed the issue:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-3UHXtWfgQgM/VyXo7eYp0VI/AAAAAAAAN-o/hEzungHmU0Eetr2WapGMh842vH6IZMPswCKgB/s1600/IMG_20160424_150724.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://1.bp.blogspot.com/-3UHXtWfgQgM/VyXo7eYp0VI/AAAAAAAAN-o/hEzungHmU0Eetr2WapGMh842vH6IZMPswCKgB/s400/IMG_20160424_150724.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Note that at this time I still had some random PN diode directly across the solenoids terminal.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-Hq9k7I50LwA/VyXpA2e3l2I/AAAAAAAAN-s/m3fYK9l9KpY8pbQy9na_sOHrVVEs0SqxQCKgB/s1600/IMG_20160424_150812.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://4.bp.blogspot.com/-Hq9k7I50LwA/VyXpA2e3l2I/AAAAAAAAN-s/m3fYK9l9KpY8pbQy9na_sOHrVVEs0SqxQCKgB/s400/IMG_20160424_150812.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
I saw > 60 V voltage spikes when the coil was switched ON. Note that this pulse happened 20000 times a second, with the PWM frequency.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-Xc7Uxe4bU8s/VyXpZ-uC7eI/AAAAAAAAN-w/3SRJlJsFsjQf1FDBJB-eG7XNyIJSpaGcwCKgB/s1600/IMG_20160424_151331.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://4.bp.blogspot.com/-Xc7Uxe4bU8s/VyXpZ-uC7eI/AAAAAAAAN-w/3SRJlJsFsjQf1FDBJB-eG7XNyIJSpaGcwCKgB/s400/IMG_20160424_151331.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Then I measured right on the solenoid driver board. At this point there was no recovery diode here at all.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-dQ7CMrgrmiw/VyXpZ7AooCI/AAAAAAAAN-w/vHxpa3CtK5k-CIQqaxJrfNXvs9m2hAPEgCKgB/s1600/IMG_20160424_151339.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://1.bp.blogspot.com/-dQ7CMrgrmiw/VyXpZ7AooCI/AAAAAAAAN-w/vHxpa3CtK5k-CIQqaxJrfNXvs9m2hAPEgCKgB/s400/IMG_20160424_151339.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Again I measured 60 V spikes and strong ringing. Clearly this was the reason my LEDs freaked out.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-Pz6Dm0_ENRk/VyXpZ7uPlXI/AAAAAAAAN-w/c3EEsc89rcsqFNrlkmzEf4rQi8ULdY0-gCKgB/s1600/IMG_20160424_151738.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://4.bp.blogspot.com/-Pz6Dm0_ENRk/VyXpZ7uPlXI/AAAAAAAAN-w/c3EEsc89rcsqFNrlkmzEf4rQi8ULdY0-gCKgB/s400/IMG_20160424_151738.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
To get rid of those spike, I tried various combination of putting components across the solenoid or the solenoid driver outputs:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li style="text-align: center;">Fast Schottky diode</li>
<li style="text-align: center;">4.7 nF Capacitor</li>
<li style="text-align: center;">4.7 nF Capacitor + 47 Ohm resistor in series (snubber circuit)</li>
</ul>
<div style="text-align: center;">
Adding the capacitor changed the resonant frequency of the ringing, but not the amplitude. The snubber circuit helped slightly. The Schottky diode had the most positive effect, especially if put on the solenoid driver board.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-JHXZDTixrkY/VyXpZ1_OnJI/AAAAAAAAN-w/g0XlTggoezkx0zUqiPeRtSg3pK7UouWgACKgB/s1600/IMG_20160424_151746.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://1.bp.blogspot.com/-JHXZDTixrkY/VyXpZ1_OnJI/AAAAAAAAN-w/g0XlTggoezkx0zUqiPeRtSg3pK7UouWgACKgB/s400/IMG_20160424_151746.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
So what was going on? I think the problem was the parasitic inductance of the cables to the solenoid. The cables themselves also act like an inductor, hence also have a freewheeling current when switched off, and having installed the freewheeling diodes on the solenoid itself, there was no path for this current to go.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-d-P7vvwf3IM/VyXqdxB2AjI/AAAAAAAAN_A/_2TFt6Yd39Exu2ASNq0sQw00cO32Tx48ACLcB/s1600/Screenshot%2B-%2B01.05.2016%2B-%2B13%253A34%253A19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="197" src="https://3.bp.blogspot.com/-d-P7vvwf3IM/VyXqdxB2AjI/AAAAAAAAN_A/_2TFt6Yd39Exu2ASNq0sQw00cO32Tx48ACLcB/s400/Screenshot%2B-%2B01.05.2016%2B-%2B13%253A34%253A19.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
I got rid of the spikes by changing 3 things:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol style="text-align: left;">
<li style="text-align: center;">I installed the diodes right on the solenoid driver board. This way they also provide a path for the freewheeling currents of the cables</li>
<li style="text-align: center;">I installed Schottky diodes (<span style="background-color: #f8f8f8; color: #333333; font-family: "helvetica neue" , "helvetica" , "verdana" , sans-serif;">1N5822</span>), which do not have a reverse recovery time and hence switch much faster and cleaner.</li>
<li style="text-align: center;">I changed the gate resistors on the mosfets from 47 Ohm to 200 Ohm. Before they were driven much to hard, switching with < 10 ns and hence producing plenty of EMI in the MHz range. Of course, making them switch slower is a trade-off, reducing EMI but increasing switching losses. In this case there is still plenty of margin though and there is still no need for a heatsink so far.</li>
</ol>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-fs97bNBix8g/VyXpZ5XybAI/AAAAAAAAN-w/_Ega7XqK0vY3xAzO3flApuu1rUWlr4s2QCKgB/s1600/IMG_20160424_174919.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://3.bp.blogspot.com/-fs97bNBix8g/VyXpZ5XybAI/AAAAAAAAN-w/_Ega7XqK0vY3xAzO3flApuu1rUWlr4s2QCKgB/s400/IMG_20160424_174919.jpg" width="300" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The Mods were directly hacked onto the board. As a nice side effect, it's not necessary anymore to solder a diode across each solenoid.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-3R6ai_jw9Tw/VyXpZ73yv2I/AAAAAAAAN-w/WCbQEM-nBPECgUQJV2_deS0qTLxC2xqlQCKgB/s1600/IMG_20160430_001533.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://3.bp.blogspot.com/-3R6ai_jw9Tw/VyXpZ73yv2I/AAAAAAAAN-w/WCbQEM-nBPECgUQJV2_deS0qTLxC2xqlQCKgB/s400/IMG_20160430_001533.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Waveform at the solenoid driver after modification. Now all LEDs work as expected and without any glitches, even when flippering like crazy.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-XAxeYNyUKqQ/VyXpZ9j7_vI/AAAAAAAAN-w/OlnxDR94FNcURTkh2FGpfwD-XkkhgKU4ACKgB/s1600/IMG_20160430_183102.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-XAxeYNyUKqQ/VyXpZ9j7_vI/AAAAAAAAN-w/OlnxDR94FNcURTkh2FGpfwD-XkkhgKU4ACKgB/s200/IMG_20160430_183102.jpg" width="150" /></a> <a href="https://2.bp.blogspot.com/-2kIzVbzLP9k/VyXpZwNs5MI/AAAAAAAAN-w/ciCfUmX-MYM6k2fC0oRcKjSTTlO2RAp2gCKgB/s1600/IMG_20160430_183438.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://2.bp.blogspot.com/-2kIzVbzLP9k/VyXpZwNs5MI/AAAAAAAAN-w/ciCfUmX-MYM6k2fC0oRcKjSTTlO2RAp2gCKgB/s200/IMG_20160430_183438.jpg" width="200" /></a> <a href="https://1.bp.blogspot.com/--Y9ABa_H10E/VyXpZ8QNb1I/AAAAAAAAN-w/gTDCm38cEjEVSSUqPBSavgVYRFM5RzVTQCKgB/s1600/IMG_20160430_183459.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://1.bp.blogspot.com/--Y9ABa_H10E/VyXpZ8QNb1I/AAAAAAAAN-w/gTDCm38cEjEVSSUqPBSavgVYRFM5RzVTQCKgB/s200/IMG_20160430_183459.jpg" width="150" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Left: Current state of the playing field. All basic LEDs are installed. </div>
<div class="separator" style="clear: both; text-align: center;">
Middle: Closeup of the solenoid for the gate closing the right outline.</div>
<div class="separator" style="clear: both; text-align: center;">
Right: Closeup of the trough ball eject solenoid.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-33257540458563432582016-04-16T08:22:00.001-07:002017-07-06T11:17:11.350-07:00Fan-Tas-Tic Pinball, Part 5<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Adding some LEDs</h2>
<div>
I did a quick test with the WS2811 LED strand and I'm quite satisfied with the results. They are slightly brighter then the original bulbs, consume far less power and hence don't get hot. Especially under the white playfield inserts, the RGB colors look fantastic. The red inserts filter out all the other colors, so it only makes sense to have these LEDs configured for red only -- but that's not a big problem, considering how cheap those LED strands are.</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-vuMbGF4NWjw/Vw0bubw8NgI/AAAAAAAANpI/EA9NWXhQ-i0FD3JK1K936DPb2yF-VkDwwCLcB/s1600/12dqd6.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-vuMbGF4NWjw/Vw0bubw8NgI/AAAAAAAANpI/EA9NWXhQ-i0FD3JK1K936DPb2yF-VkDwwCLcB/s1600/12dqd6.gif" /></a><a href="https://1.bp.blogspot.com/-_WWu2W9xsPc/VxJdwSaOZ4I/AAAAAAAANqA/_48zK-VCGHwvK2hapC_yW1gkPaMCmHQ3wCLcB/s1600/WP_20160411_23_55_57_Pro.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://1.bp.blogspot.com/-_WWu2W9xsPc/VxJdwSaOZ4I/AAAAAAAANqA/_48zK-VCGHwvK2hapC_yW1gkPaMCmHQ3wCLcB/s400/WP_20160411_23_55_57_Pro.jpg" width="223" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I started to work on a platform driver for the Mission Pinball Framework v30. There is some basic functionality already -- but still some bugs need to be resolved.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://github.com/missionpinball/mpf/tree/dev" target="_blank">GitHub: Mission Pinball Framework</a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://github.com/yetifrisstlama/Fan-Tas-Tic-Firmware/blob/master/python/fantastic.py" target="_blank">GitHub: Fan-Tas-Tic platform driver (fantastic.py)</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<span id="goog_176591150"></span><span id="goog_176591151"></span><br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-88493756960447883052016-03-03T03:10:00.000-08:002017-07-06T11:17:19.660-07:00Fan-Tas-Tic Pinball, Part 4<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h2 style="clear: both; text-align: left;">
<span style="text-align: left;">Rewiring the switches</span></h2>
<div style="clear: both; text-align: left;">
There are around 40 switches on the playing field which were originally wired in a point to point fashion -- the cable management was quite impressive.</div>
<div>
<br /></div>
<div>
With the new electronics, switches are arranged in a 8 x 8 matrix. The row and column wires are tied together in two strands, which are routed in a serpentine fashion below the playing field. Finding a good way to keep the wires in order and organized took some time.<br />
<br />
Some pics of the cabling `making-of` ...</div>
<div>
<br /></div>
<a href="https://3.bp.blogspot.com/-l5je9HwiTFg/VubcMX5EjHI/AAAAAAAANZA/h7q9AvFtec4VuAnDAkVBB5wlHl0sBOWmA/s1600/IMG_20160304_010952.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="150" src="https://3.bp.blogspot.com/-l5je9HwiTFg/VubcMX5EjHI/AAAAAAAANZA/h7q9AvFtec4VuAnDAkVBB5wlHl0sBOWmA/s200/IMG_20160304_010952.jpg" width="200" /></a><a href="https://1.bp.blogspot.com/-SeNXo0UsEsA/VubcMbrxAWI/AAAAAAAANZA/mHYCPtE6P7IfoGYz1BwQnsEYQHn6eOiLg/s1600/IMG_20160304_011020.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="150" src="https://1.bp.blogspot.com/-SeNXo0UsEsA/VubcMbrxAWI/AAAAAAAANZA/mHYCPtE6P7IfoGYz1BwQnsEYQHn6eOiLg/s200/IMG_20160304_011020.jpg" width="200" /></a><span style="text-align: center;"> </span><a href="https://2.bp.blogspot.com/-FAEsUIN1bgQ/Vubcb3D9R7I/AAAAAAAANZI/Z6jbU26NzJ4VZaVdHtqzu5ROeHSmjpA3A/s1600/IMG_20160307_082206.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="200" src="https://2.bp.blogspot.com/-FAEsUIN1bgQ/Vubcb3D9R7I/AAAAAAAANZI/Z6jbU26NzJ4VZaVdHtqzu5ROeHSmjpA3A/s200/IMG_20160307_082206.jpg" width="150" /></a> <a href="https://4.bp.blogspot.com/-AI8bNypX9Hs/VubcsblBQhI/AAAAAAAANZQ/oGot2GmSlM04jkG8uq8SpCQ36hIQSUoVQ/s1600/IMG_20160307_082131.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="200" src="https://4.bp.blogspot.com/-AI8bNypX9Hs/VubcsblBQhI/AAAAAAAANZQ/oGot2GmSlM04jkG8uq8SpCQ36hIQSUoVQ/s200/IMG_20160307_082131.jpg" width="150" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The flipper buttons on the cabinet and the tilt switch (lead blob on a pendulum) was wired to a I2C port extender. The shielded white cable for the I2C is visible in the last picture.</div>
<div>
<br /></div>
<div>
<br />
<div>
<div style="text-align: center;">
</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-0orXN2vCe4s/VtgcfeB7JHI/AAAAAAAANTQ/zTS14HQ4tls/s1600/ScreenClip%2B%255B5%255D.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-0orXN2vCe4s/VtgcfeB7JHI/AAAAAAAANTQ/zTS14HQ4tls/s200/ScreenClip%2B%255B5%255D.png" width="130" /></a> <a href="https://3.bp.blogspot.com/-xPkdGoJMVjM/Vtgc3wiX2HI/AAAAAAAANTU/86F1MQCFL2E/s1600/IMG_20160303_021053.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-xPkdGoJMVjM/Vtgc3wiX2HI/AAAAAAAANTU/86F1MQCFL2E/s200/IMG_20160303_021053.jpg" width="150" /></a> <a href="https://3.bp.blogspot.com/-n2OBOHMGFTE/Vtgc6HeBfWI/AAAAAAAANTc/AD2S05Zqox0/s1600/IMG_20160303_021106.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-n2OBOHMGFTE/Vtgc6HeBfWI/AAAAAAAANTc/AD2S05Zqox0/s200/IMG_20160303_021106.jpg" width="150" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: inherit;">The initial test look promising. The Fan-Tas-Tic controller scans the switch matrix and reports input changes to the PC.</span></div>
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-47423166127563627822016-02-28T13:59:00.000-08:002017-07-06T11:17:28.005-07:00Fan-Tas-Tic Pinball, Part 3<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Some impressions from the cleaning process<br />
<br />
<h3 style="text-align: left;">
State of the playing field Before / After</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-rP9dL5QAdUQ/VsuiW03xgfI/AAAAAAAANM0/A904qwi3nhY/s1600/IMG_20160220_202156.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://4.bp.blogspot.com/-rP9dL5QAdUQ/VsuiW03xgfI/AAAAAAAANM0/A904qwi3nhY/s400/IMG_20160220_202156.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-uEmT9hklp6U/VtNj8mupIyI/AAAAAAAANQ4/pXu_2V9uHd0/s1600/WP_20160227_14_52_32_Pro.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" src="https://3.bp.blogspot.com/-uEmT9hklp6U/VtNj8mupIyI/AAAAAAAANQ4/pXu_2V9uHd0/s400/WP_20160227_14_52_32_Pro.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
I used white spirit and spot eraser pads for cleaning and automotive wax for sealing it.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: center;">
The insides Before / After</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-IKDx_tJhLGQ/VsukpbRAUkI/AAAAAAAANPA/9qqVygBsqME/s1600/IMG_20160220_210138.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://2.bp.blogspot.com/-IKDx_tJhLGQ/VsukpbRAUkI/AAAAAAAANPA/9qqVygBsqME/s320/IMG_20160220_210138.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-QYE0lLWkQik/Vsui-UAPrnI/AAAAAAAANNc/gN50ii_kC_k/s1600/IMG_20160220_232743.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://3.bp.blogspot.com/-QYE0lLWkQik/Vsui-UAPrnI/AAAAAAAANNc/gN50ii_kC_k/s320/IMG_20160220_232743.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-U5xdGJO-sBo/VtNkIlMTxxI/AAAAAAAANQ4/RinfhZbRFEk/s1600/WP_20160228_17_27_17_Pro.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://3.bp.blogspot.com/-U5xdGJO-sBo/VtNkIlMTxxI/AAAAAAAANQ4/RinfhZbRFEk/s320/WP_20160228_17_27_17_Pro.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The playfield has been stripped and all cables removed. I kept the leaf-switches but will read them in a matrix configuration.</div>
<div class="separator" style="clear: both; text-align: center;">
It was possible to take out the relay based control board in one piece. The new ARM based control board is already in place.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
In its original configuration, the pinball contains only one single transistor which is part of a delay circuit. All the other functions were done electromechanically.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-QdfoEaWG05Q/Vsuk6fAq8-I/AAAAAAAANPE/5iTg71ClvwA/s1600/IMG_20160220_212344.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-QdfoEaWG05Q/Vsuk6fAq8-I/AAAAAAAANPE/5iTg71ClvwA/s200/IMG_20160220_212344.jpg" width="150" /></a> <a href="https://3.bp.blogspot.com/-12b4jgx6Ydg/VtNtf6NLWaI/AAAAAAAANRE/jjupqpL6k6M/s1600/sch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-12b4jgx6Ydg/VtNtf6NLWaI/AAAAAAAANRE/jjupqpL6k6M/s200/sch.png" width="161" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-3996578021830409442016-02-07T02:33:00.000-08:002017-07-06T11:17:37.039-07:00Fan-Tas-Tic Pinball, Part 2<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="text-align: left;">
The Fan-Tas-Tic controller</h2>
<div>
The new homebrew controller board for the pinball machine. It's general job is to read a lot of switches and drive a lot of solenoids. </div>
<div>
<br /></div>
<div>
The game logic runs on a Raspberry pi, which communicates over a USB-serial connection with the controller board.</div>
<div>
<br /></div>
<div>
<div>
<a href="https://github.com/yetifrisstlama/Fan-Tas-Tic-PCB" target="_blank">Circuit board</a></div>
<div>
</div>
<br />
<div>
<a href="https://github.com/yetifrisstlama/Fan-Tas-Tic-Firmware" target="_blank">Firmware</a><br />
<br /></div>
</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-oC8p8kY3WI4/VrZ5WkQyukI/AAAAAAAAM-Q/kb-SfoZulgg/s1600/Mainboard_3d.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="229" src="https://1.bp.blogspot.com/-oC8p8kY3WI4/VrZ5WkQyukI/AAAAAAAAM-Q/kb-SfoZulgg/s320/Mainboard_3d.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">Mainboard, as rendered by KiCad</td></tr>
</tbody></table>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-ULXnjH0ZDq8/Vrcc6Q-zuXI/AAAAAAAANAs/LBN83RwGvVs/s1600/WP_20160125_20_01_22_Pro.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://2.bp.blogspot.com/-ULXnjH0ZDq8/Vrcc6Q-zuXI/AAAAAAAANAs/LBN83RwGvVs/s320/WP_20160125_20_01_22_Pro.jpg" width="273" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mainboard, getting CNCed</td></tr>
</tbody></table>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-CeR7R1j3rhA/VrcjmF069pI/AAAAAAAANBY/PUfAV69KYCc/s1600/g3411.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://4.bp.blogspot.com/-CeR7R1j3rhA/VrcjmF069pI/AAAAAAAANBY/PUfAV69KYCc/s320/g3411.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mainboard, tested and working</td></tr>
</tbody></table>
</div>
<div>
Unfortunately there was a glitch during toolpath generation of the second layer, which we only noticed very late in the milling process. While the board was functional, the high current traces for the solenoids turned out much more narrow than intended. They instantly burned up during the first test with a real solenoid (24 V, 3 Ohm, 8 Amps peak.). As a workaround I soldered thick copper wire on-top of these traces.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-wh3u51Ok9lw/Vta3lfml1UI/AAAAAAAANRk/0hWtrPIOAbM/s1600/WP_20160301_23_29_26_Pro.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="179" src="https://2.bp.blogspot.com/-wh3u51Ok9lw/Vta3lfml1UI/AAAAAAAANRk/0hWtrPIOAbM/s320/WP_20160301_23_29_26_Pro.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">High current traces fixed</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-pql9U19vP0k/VrcgkTBYuoI/AAAAAAAANBM/kSztS7zvCWs/s1600/waveForms.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://3.bp.blogspot.com/-pql9U19vP0k/VrcgkTBYuoI/AAAAAAAANBM/kSztS7zvCWs/s320/waveForms.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Driving WS2812 LED strings. Check of timing.</td></tr>
</tbody></table>
<br />
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-46403422697978990402016-02-06T14:47:00.001-08:002017-07-06T11:17:44.579-07:00Fan-Tas-Tic Pinball, Part 1<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Refurbishing and upgrading a electromechanical pinball machine from the seventies.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-rWLWZ6NelqU/VrZ203zDA-I/AAAAAAAAM90/tGRPSzY9b5Y/s1600/WP_20151212_14_19_29_Pro.jpg" imageanchor="1"><img border="0" height="320" src="https://3.bp.blogspot.com/-rWLWZ6NelqU/VrZ203zDA-I/AAAAAAAAM90/tGRPSzY9b5Y/s320/WP_20151212_14_19_29_Pro.jpg" width="180" /></a> <a href="http://4.bp.blogspot.com/-Kn5chAprCUw/Vrcaiy3flVI/AAAAAAAAM_4/DCGEahvS_PI/s1600/g4300.png" imageanchor="1"><img border="0" height="320" src="https://4.bp.blogspot.com/-Kn5chAprCUw/Vrcaiy3flVI/AAAAAAAAM_4/DCGEahvS_PI/s320/g4300.png" width="155" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Right: How it looks like now. Left: How it might end up</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;">Taking the monster apart<br />
<br />
<a href="http://1.bp.blogspot.com/-Zoi13p9LK4w/VrZ3KvgyWbI/AAAAAAAAM98/cAToZUUPLXo/s1600/WP_20151212_12_19_56_Pro.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://1.bp.blogspot.com/-Zoi13p9LK4w/VrZ3KvgyWbI/AAAAAAAAM98/cAToZUUPLXo/s320/WP_20151212_12_19_56_Pro.jpg" width="180" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Under the hood. This thing is full of relays and mechanical switches -- a lost art.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-cVqczklRfcE/VrZ3hFMpq1I/AAAAAAAAM-E/OGUtuspycU0/s1600/WP_20151212_12_59_07_Pro.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://2.bp.blogspot.com/-cVqczklRfcE/VrZ3hFMpq1I/AAAAAAAAM-E/OGUtuspycU0/s320/WP_20151212_12_59_07_Pro.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Underneath the playfield, showing the solenoids for the flippers.</td></tr>
</tbody></table>
<div>
<br />
At this point, the machine is in quite a bad state. All the rubbers have turned into brittle plastic, many lamps are blown, the playfield is a filthy mess and the playfield window is cracked.<br />
<br />
We took a last video of the machine with its original electromechanical brain, before we have teared it completely apart:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/oZDXTWclTG0/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/oZDXTWclTG0?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
<br />
Turns out it almost works. The score counting wheels have some issues. Sometimes they get stuck, sometimes the reset process never finishes.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-91870079941456025472014-11-11T05:36:00.000-08:002014-11-11T05:36:03.245-08:00Electric longboard<div dir="ltr" style="text-align: left;" trbidi="on">
A large RC car brushless motor + huge Lipo batteries + a rather smooth to ride longboard = a lot of fun :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-SinJaq-kEVY/VGIQsoLRaII/AAAAAAAALJA/kjGpUx3t_kk/s1600/IMG_20141102_172246.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://2.bp.blogspot.com/-SinJaq-kEVY/VGIQsoLRaII/AAAAAAAALJA/kjGpUx3t_kk/s320/IMG_20141102_172246.jpg" width="320" /></a></div>
<br />
<br />
Pictures and comments of the construction progress here:<br />
<a href="http://imgur.com/a/aZsbh">http://imgur.com/a/aZsbh</a><br />
<br />
The whole design is based on the experience from the endless-spheres forum:<br />
<a href="http://endless-sphere.com/forums/viewtopic.php?f=35&t=53506">http://endless-sphere.com/forums/viewtopic.php?f=35&t=53506</a><br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-22846029365135529042014-07-29T12:58:00.004-07:002014-08-04T15:11:31.581-07:00Fireflys in a jar<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
New! Webinterface</h2>
<div style="text-align: left;">
<div class="separator" style="clear: both; text-align: center;">
</div>
A toy webinterface for a similar jar can be found here:</div>
<div style="text-align: left;">
<a href="http://roesti.uk.to/fireflyJar.html">http://roesti.uk.to/fireflyJar.html</a></div>
<div style="text-align: left;">
Note that it is the real deal and the jar, standing next to my window, will actually start flashing if you click any of the buttons </div>
<h2 style="clear: both; text-align: left;">
Ingredients</h2>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-1Enoj6OPwCM/U9Dh9ZPkIiI/AAAAAAAAHu0/Q8jm0F4EssM/s1600/IMG_20140724_015709.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://2.bp.blogspot.com/-1Enoj6OPwCM/U9Dh9ZPkIiI/AAAAAAAAHu0/Q8jm0F4EssM/s1600/IMG_20140724_015709.jpg" height="200" width="150" /></a></div>
<ul style="text-align: left;"><span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">A large jam jar (Ikea)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">Mini USB Nano V3.0 ATmega328 5V Microcontroller Board (eBay)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">FTDI serial cable for flashing (eBay)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">Solar cell, </span><span style="background-color: white;">5.5 V, 50 mA or larger (eBay)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">Lipo - battery cell, 100 mAh - 600 mAh (eBay / old laptop / old cellphone, etc.)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">12 x tiny LEDs, different colors, the smaller the better, </span><span style="background-color: white;">with ~80 - 200 Ohm series resistors, depending on how bright you want it (kit from eBay)</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">Very thin magnet wire from the coil of a miniature relais</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">SMD resistors with 1 % tolerance: 2 x 560 kOhm, 2 x 160 kOhm. For two voltage dividers to sample the solar cell and battery voltage</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">SMD ceramic capacitors, </span><span style="background-color: white;">2 x 100 nF, to stabilize the analog inputs of the AVR</span></span></span></li>
<span style="font-size: small;"><span style="font-family: inherit;">
</span></span>
<li><span style="font-size: small;"><span style="font-family: inherit;"><span style="background-color: white;">Some circuit board, glue, prototyping wires, sticky tape </span></span></span></li>
</ul>
</div>
<div style="clear: both; text-align: left;">
The making-of after the click ...</div>
<div style="clear: both; text-align: left;">
</div>
<a name='more'></a><br />
<br />
<h2 style="clear: both; text-align: left;">
Making-Of</h2>
<div style="clear: both; text-align: left;">
The AVR board has been modified in the following way for very low power operation:</div>
<ul style="text-align: left;">
<li>The voltage regulator has been removed and VCC has been connected directly to the battery</li>
<li>The Schottky diode, which is already on the board, has been rewired to be in series with the solar cell. It only has 0.2 V forward voltage drop, which is excellent!</li>
<li>2 Voltage dividers with the 560k and 160k resistors and 100nF capacitors have been made and connected to Vsolar and Vbattery. The AVR uses the internal 1.1 V reference voltage for the ADC, which allows to measure voltages up to 4.95 V</li>
<li>The onboard serial <a href="https://code.google.com/p/optiboot/" target="_blank">bootloader</a> has been rebuilt to work at 8 MHz and 38400 Baud</li>
<li>The fuses have been reprogrammed to use the 8 MHz internal oscillator instead of the 16 MHz onboard crystal. This significantly speeds up the processor wake up time from sleep and hence saves power</li>
</ul>
<br />
<h2 style="text-align: left;">
Pinout</h2>
<div style="text-align: left;">
Note that this pinout allows to connect an optional nRF24 module to PORTB. So far this has not been utilized in the firmware though.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-m9r3W7Z4vIE/U9f5TZ3NvRI/AAAAAAAAIGE/fmdO2u0bISc/s1600/pinout.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://2.bp.blogspot.com/-m9r3W7Z4vIE/U9f5TZ3NvRI/AAAAAAAAIGE/fmdO2u0bISc/s1600/pinout.png" height="267" width="320" /></a></div>
</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b><span style="font-family: "Courier New",Courier,monospace;"> Silkscreen, Firmw. Ch. AVR (*) = on LED board<br /> 2, 6 PD2 LED y * + GND pin<br /> 3, 7 PD3 LED o *<br /> 4, 8 PD4 LED r *<br /> 5, 9 PD5 LED w *<br /> 6, 10 PD6. Led g *<br /> 7, 11 PD7. Led b *<br /> 8 PB0 Rf ce * (No LED)<br /> 9 PB1 Rf irq * (No LED)<br /> -------------------------------------------- <br /> 10 PB2 Rf csn<br /> 11 PB3. Rf Mosi <br /> 12 PB4. Rf Miso <br /> 13 PB5. Rf Sck <br /> A0, 0 PC0 LED w *<br /> A1, 1 PC1 LED r *<br /> A2, 2 PC2 LED y *<br /> A3, 3 PC3 LED g *<br /> A4, 4 PC4 led w *<br /> A5, 5 PC5 led b *<br /> A6 ADC6 Vbatt<br /> A7 ADC7 Vsolar</span></b></span></div>
<h3 style="text-align: left;">
</h3>
<h2 style="text-align: left;">
Construction</h2>
The battery and AVR board have been fixed with superglue and some
engineering tape to the backside of the solar cell. The female headers
on the LED board will connect to the male ones on the AVR board. <br />
<div style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-GTLGuXf8kC8/U9Dh6z1NxgI/AAAAAAAAHuE/3nVLa7CIvEI/s1600/IMG_20140706_215009.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-GTLGuXf8kC8/U9Dh6z1NxgI/AAAAAAAAHuE/3nVLa7CIvEI/s1600/IMG_20140706_215009.jpg" height="250" width="320" /></a></div>
<br />
<br />
The LED board breaks out the Port pins to different locations and incorporates a series resistor for each LED<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-nKg7jgyv_R8/U9Dh6jLYSYI/AAAAAAAAHuI/jGhWZrrwfaM/s1600/IMG_20140717_185219.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-nKg7jgyv_R8/U9Dh6jLYSYI/AAAAAAAAHuI/jGhWZrrwfaM/s1600/IMG_20140717_185219.jpg" height="320" width="311" /></a></div>
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-VoZS_fAPKWI/U9Dh6tyfs0I/AAAAAAAAHuA/9FksJCiLRpQ/s1600/IMG_20140724_014816.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-VoZS_fAPKWI/U9Dh6tyfs0I/AAAAAAAAHuA/9FksJCiLRpQ/s1600/IMG_20140724_014816.jpg" height="240" width="320" /></a></div>
<br />
The solar cell is clamped in place within the lid of the jam jar by a
loop of thick magnet wire. The loop, having a cut, has been placed in a
groove of the jar, then soldered together, which clamps it into place.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-EuCsCVzDXF4/U9Dh7khRccI/AAAAAAAAHuM/-evTQfZsFeI/s1600/IMG_20140724_014830.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-EuCsCVzDXF4/U9Dh7khRccI/AAAAAAAAHuM/-evTQfZsFeI/s1600/IMG_20140724_014830.jpg" height="240" width="320" /></a></div>
<br />
The magnet wire for the LEDs has been scavenged from a miniature relay.
Two wirestrands, about 3 m long, have been tightly twisted together
using a portable drill and then fixated with superglue. The resulting
wire has been cut to various lengths and soldere to the SMD LEDs on one
side and to the LED board on the other.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-F4ZrlzQmyEw/U9Dh76dJrwI/AAAAAAAAHuQ/rxHf670EeVA/s1600/IMG_20140724_015007.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-F4ZrlzQmyEw/U9Dh76dJrwI/AAAAAAAAHuQ/rxHf670EeVA/s1600/IMG_20140724_015007.jpg" height="320" width="240" /></a></div>
<div style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
</h2>
<h2 style="clear: both; text-align: left;">
Results</h2>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Z3paj3P0PUA/U9Dh8WEhLXI/AAAAAAAAHuc/WxHNSwyOCBA/s1600/IMG_20140724_015814.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-Z3paj3P0PUA/U9Dh8WEhLXI/AAAAAAAAHuc/WxHNSwyOCBA/s1600/IMG_20140724_015814.jpg" height="320" width="240" /></a></div>
<h2 style="clear: both; text-align: left;">
Firmware</h2>
The sourcecode for the AVR has been tentatively uploaded to <a href="https://github.com/yetifrisstlama/GluewuermleV3" target="_blank">GitHub</a>.<br />
It is based on hand-optimized assembler code, which does "<a href="http://www.batsocks.co.uk/downloads/art_bcm_01.pdf" target="_blank">Binary Code Modulation</a>". The shortest bit-period is only 2 machine cycles long.<br />
<br />
The <a href="http://nbviewer.ipython.org/github/yetifrisstlama/GluewuermleV3/blob/master/gluewuermle_3/myUtil/patterns.ipynb" target="_blank">flashing patterns</a> have been crafted in iPython Notebook and exported as a C header file.<br />
<br />
This project has been inspired by (and parts of the firmware have been shamelessly copied from) the <a href="http://www.mikrocontroller.net/topic/99803" target="_blank">Firefly project of Hagen Re</a><br />
<br />
<br />
More on the software part soon ...</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-74853351395501599302014-03-17T15:23:00.000-07:002014-08-04T14:52:43.491-07:00The "Foculus Rift" part 3: Spoofing the EDID<div dir="ltr" style="text-align: left;" trbidi="on">
The <span style="font-family: Courier New, Courier, monospace;">libOVR</span> SDK recognizes if an Oculus Rift is attached to the PC by checking two particular things:<br />
<ol style="text-align: left;">
<li>The USB tracker with the right VendorID, ProductID must be present (this has been solved in <a href="http://yetifrisstlama.blogspot.fr/2014/03/the-foculus-rift-part-2-reverse.html" target="_blank">Part 2</a>)</li>
<li>The Head Mounted Display (HMD) must be attached, which is nothing more than an ordinary monitor connected over HDMI. The HMD is identified by its so call<span style="font-family: inherit;">ed <span style="background-color: white; color: #222222; white-space: nowrap;">Extended display identification data (EDID).</span></span></li>
</ol>
<div>
<span style="color: #222222;"><span style="white-space: nowrap;"></span></span><br />
<a name='more'></a><br />
<span style="line-height: 19.200000762939453px;"><br /></span>
<span style="line-height: 19.200000762939453px;">Note that the following writeup is specific to changing the EDID data on a <i>RTD2660</i> based flat panel controller. It involves desoldering and reflashing the I2C chip holding its firmware. <span style="color: #660000;"><b>There are many things that can go wrong and it is very easy to end up with a bricked device</b></span> -- so be sure to backup the data before you reflash the chip.</span><br />
<br />
<span style="line-height: 19.200000762939453px;"><span style="line-height: 19.200000762939453px;">Alternatively, there is a simpler way to spoof the Oculus Rift EDID.</span> </span><br />
<span style="line-height: 19.200000762939453px;">The trick is to directly solder a programmed I2C eeprom to the right pins of the HDMI connector.</span><span style="line-height: 19.200000762939453px;"> </span><br />
<span style="line-height: 19.200000762939453px;">There is a beginner-friendly step-by-step guide by will1384: </span><br />
<ul style="text-align: left;">
<li><span style="line-height: 19.200000762939453px;"><span style="line-height: 19.200000762939453px;"><a href="http://imgur.com/a/r0K6U" target="_blank">Changing the EDID data</a></span> </span></li>
<li><span style="line-height: 19.200000762939453px;"><a href="http://imgur.com/a/Ewb8G">Hardwareof the spoofer</a></span></li>
<li><span style="line-height: 19.200000762939453px;"><a href="http://imgur.com/a/lDwhk" target="_blank">Flashing the eeprom with PonyProg</a></span></li>
</ul>
<br />
<br />
Here is the hard way how to do it ...<br />
<br /></div>
<div>
<span style="color: #222222;"><span style="white-space: nowrap;">The EDID is a 128 byte binary blob, which is transferred over an I2C bus to the PC.</span></span><br />
<span style="color: #222222;"><span style="white-space: nowrap;">This happens when the display is plugged in over a VGA, DVI or HDMI connection.</span></span><br />
<span style="color: #222222;"><span style="white-space: nowrap;">What is actually stored in this 128 bytes is nicely explained on <a href="http://en.wikipedia.org/wiki/Extended_display_identification_data#EDID_1.3_data_format">Wikipedia</a>.</span></span><br />
<span style="color: #222222;"><span style="white-space: nowrap;"><br /></span></span>
<span style="color: #222222;"><span style="white-space: nowrap;">To make the <span style="font-family: Courier New, Courier, monospace;">libOVR</span> believe that the generic LCD panel from eBay is actually an Oculus Rift, </span></span><br />
<span style="color: #222222;"><span style="white-space: nowrap;">several parameters in the EDID need to be changed.</span></span><br />
<span style="color: #222222;"><span style="white-space: nowrap;">In particular, the following bytes need to be set to the values read out from an original DK1:</span></span><br />
<ul style="text-align: left;">
<li><span style="color: #222222;"><span style="font-family: Courier New, Courier, monospace; white-space: nowrap;">Manufacturer ID (byte 8-9) "OVR" [</span></span><span style="color: #222222; font-family: Courier New, Courier, monospace;"><span style="white-space: nowrap;">0x3E, 0xD2]</span></span></li>
<li><span style="color: #222222; font-family: 'Courier New', Courier, monospace; white-space: nowrap;">Manufacturer Product Code (byte 10-11) [</span><span style="color: #222222; font-family: Courier New, Courier, monospace;"><span style="white-space: nowrap;">0x01, 0x00]</span></span></li>
<li><span style="color: #222222;"><span style="font-family: Courier New, Courier, monospace; white-space: nowrap;">Serial number (byte 12-15) [</span></span><span style="color: #222222; font-family: Courier New, Courier, monospace;"><span style="white-space: nowrap;">0x00, 0x00, 0x00, 0x00]</span></span></li>
<li><span style="color: #222222;"><span style="white-space: nowrap;"><span style="background-color: white; color: black; font-family: Courier New, Courier, monospace; line-height: 19.200000762939453px; white-space: normal;">Monitor serial number string </span></span></span><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 19.200000762939453px;">"Serial" + 0x0A</span></span></li>
<li><span style="background-color: white; color: black; font-family: Courier New, Courier, monospace;"><span style="color: #222222;"><span style="line-height: 19.200000762939453px;">Monitor name string "</span></span><span style="line-height: 19.200000762939453px;">Rift DK</span><span style="color: #222222;"><span style="line-height: 19.200000762939453px;">" + 0x0A</span></span></span></li>
</ul>
<div>
<span style="line-height: 19.200000762939453px;">I didn't want to override the other parameters, as they contain important information about the supported resolutions and color modes of the monitor. However, later I found, that this eBay display controller seems to send incorrect EDID data over the HDMI connection -- which didn't allow me to use it at its native resolution. While I was rewriting the EDID data anyway, I have fixed that mistake.</span><br />
<br />
<span style="line-height: 19.200000762939453px;">The <i>RTD2660</i> is a highly integrated chip, which does the format conversion from an VGA (analog) or HDMI (digital) input to a LVDS output. It also does gamma correction, displays the on-screen menu and many more things. To control all that, it contains a 8051 compatible microcontroller core. The slightly bizarre thing about it is, that the chip does not contain any flash memory for storing the program code. In fact, every instruction is fetched from the nearby <i>W25X40</i> flash chip over a serial SPI connection <b>on the fly</b> and then executed. It was clear, that the EDID information must be stored in this flash memory.</span></div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-yLL6vDZ57f0/UySWMQTRR6I/AAAAAAAAHYk/2PMUPB5HwEo/s1600/IMG_20140307_183734.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-yLL6vDZ57f0/UySWMQTRR6I/AAAAAAAAHYk/2PMUPB5HwEo/s1600/IMG_20140307_183734.jpg" height="314" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The LCD flat panel controller board in its original state.</td></tr>
</tbody></table>
</div>
<div>
So the first step was to desolder the <i>W25X40</i> chip and read out its data. Before soldering it back, I placed 300 Ohm SMD resistors between the CLK, MOSI and /CS pins. This allowed me to read and write the chip while it is "in circuit".<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-9G152bHmEvQ/UySWMPHGz4I/AAAAAAAAHYc/0VYVK8Zu6FY/s1600/IMG_20140309_122230.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-9G152bHmEvQ/UySWMPHGz4I/AAAAAAAAHYc/0VYVK8Zu6FY/s1600/IMG_20140309_122230.jpg" height="281" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">W25X40 Flash chip decoupled from the RTD2660 LCD panel controller by 300 Ohm resistors</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-rPTmsmXf5V8/UySWMRln9LI/AAAAAAAAHYg/3Gut8IgzvW0/s1600/IMG_20140309_124404.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-rPTmsmXf5V8/UySWMRln9LI/AAAAAAAAHYg/3Gut8IgzvW0/s1600/IMG_20140309_124404.jpg" height="211" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This allows to read and write the Flash memory without the need for desoldering the chip</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-t10TRlo8SH8/UySWOoHGW8I/AAAAAAAAHY0/gl0PP7nL_ZM/s1600/IMG_20140310_223031.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-t10TRlo8SH8/UySWOoHGW8I/AAAAAAAAHY0/gl0PP7nL_ZM/s1600/IMG_20140310_223031.jpg" height="240" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The STM32F3DISCOVERY board was used to read and write the flash memory</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
It turns out, there is over half a megabyte of binary data in there, which is quite a lot of program code for a small 8 bit microcontroller.</div>
<div>
<br /></div>
<div>
For reading (and writing) the chip, one possibility is <a href="http://www.lancos.com/prog.html" target="_blank">Ponyprog</a> and an easy to build parallel port interface. Another one is to use the <a href="http://dangerousprototypes.com/docs/Bus_Pirate" target="_blank">Bus Pirate</a>. I actually used the <i>STM32F3</i> discovery board, with a custom firmware so it acts like a USB to SPI bridge. With some Python code, I could send commands to the chip and read out its data. If you're interested in the USB to SPI source code, let me know.<br />
<br />
<br /></div>
<div>
<br /></div>
<div>
Having read out the binary data, I could search through it with a Hex editor. The EDID block always starts with these bytes: </div>
<div>
<span style="font-family: Courier New, Courier, monospace;">0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00</span><span style="font-family: inherit;">. </span></div>
<div>
<span style="font-family: inherit;">So it is quite easy to identify. I found 9 of these blocks! Starting at the following addresses:</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b>(1) 0x00C4F EDID (128 bytes) sent over VGA</b></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(2) 0x00CFF</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> EDID (128 bytes) not used. Almost identical to (1)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><b>(3) 0x01E00 EDID + CEA-861 extension block (256 byte) sent over HDMI</b></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(4) 0x10C4F identical to (1)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(5) 0x10CFF</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> identical to (2)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(6) 0x20C4F</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> identical to (1)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(7) 0x20CFF</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> identical to (2)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(8) 0x30C4F</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> identical to (1)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">(9) 0x30CFF</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> identical to (2)</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: inherit;">I was able to figure out which one is which by comparing the data blocks from the firmware to the EDID data I was reading out in Linux with the </span><span style="font-family: Courier New, Courier, monospace;">get-edid</span><span style="font-family: inherit;"> tool. (1) and (2) seemed to contain correct information for the specific LCD panel, which I bought with the controller board -- but (3) was completely wrong and looked like default values which </span><span style="font-family: inherit;">have never been customized.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
I modified all of the above EDID blocks and wrote them back to the Flash chip. With this modification, all Oculus Rift compatible games successfully recognize the generic LCD panel as an HMD.<br />
<br />
You can find the project files here:<br />
<br />
<a href="https://docs.google.com/uc?export=download&id=0ByUC1HOgy6yVaUQtR3Z6ZVZwc28" target="_blank">Reprogrammed EDID</a><br />
<br />
This includes the .py files with the commented original and modified EDID data. The binary files of the original and modified Flash image and two iPython notebooks which have been used for the binary manipulations and for flashing the image with the SMT32 board.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
<div>
<span style="line-height: 19.200000762939453px;"><br /></span></div>
<div>
<span style="line-height: 19.200000762939453px;"><br /></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com10tag:blogger.com,1999:blog-2350507429918446596.post-82046968343984548282014-03-04T15:03:00.004-08:002014-04-03T12:28:45.536-07:00The "Foculus Rift" part 2: Reverse engineering the motion tracker<div dir="ltr" style="text-align: left;" trbidi="on">
The function of the motion tracker is to estimate the current roll, pitch and yaw angles of the head mounted display (HMD), which allows the 3D game to know what you are looking at and render the scene accordingly.<br />
<div>
<br /></div>
<div>
The original Rift uses the following configuration (as nicely shown by <a href="http://www.ifixit.com/Teardown/Oculus+Rift+Teardown/13682">ifixIt</a>):</div>
<div>
<ul style="text-align: left;">
<li><span style="background-color: white; line-height: 23px;"><span style="font-family: Arial, Helvetica, sans-serif;">Invensense <a href="http://www.invensense.com/mems/gyro/documents/PS-MPU-6000A-00v3.4.pdf">MPU-6000</a>, gyroscope and accelerometer sensor</span></span></li>
<li><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Honeywell </span><a href="http://www51.honeywell.com/aero/common/documents/myaerospacecatalog-documents/Defense_Brochures-documents/HMC5983_3_Axis_Compass_IC.pdf" rel="nofollow" style="background-color: white; cursor: pointer; font-family: Arial, Helvetica, sans-serif; line-height: 18px; text-decoration: none;">HMC5983</a><span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">, magnetic field sensor / compass</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><span style="line-height: 18px;">ST </span></span><span style="background-color: white; line-height: 18px;"> </span><a href="http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1031/LN1565/PF164476" rel="nofollow" style="background-color: white; cursor: pointer; line-height: 18px; text-decoration: none;" target="_blank">32F103C8</a>, ARM 32 bit microcontroller (with USB connection)</span></li>
</ul>
<div>
<br />
<a name='more'></a><br class="Apple-interchange-newline" />
<div>
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="-webkit-text-stroke-width: 0px; font-family: 'Times New Roman'; letter-spacing: normal; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; orphans: auto; padding: 6px; text-align: center; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px;"><tbody>
<tr><td style="text-align: center;"><div style="margin: 0px;">
<a href="http://4.bp.blogspot.com/-bUH-v0awJ3Q/UxZHl8FdzjI/AAAAAAAAHVw/3GzOLFIUg0U/s1600/DSC_0178.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-bUH-v0awJ3Q/UxZHl8FdzjI/AAAAAAAAHVw/3GzOLFIUg0U/s1600/DSC_0178.jpg" height="189" style="cursor: move;" width="320" /></a></div>
</td></tr>
<tr><td class="tr-caption" style="font-size: 13px; padding-top: 4px; text-align: center;"><div style="margin: 0px;">
The Oculus Rift Tracker board (Picture from <a href="http://www.oculusvr.com/blog/building-a-sensor-for-low-latency-vr/">oculusvr.com</a>)</div>
</td></tr>
</tbody></table>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The ARM reads out the three sensors over an SPI and I2C interface and sends the data to the host PC over USB. The host runs the Rift SDK, which performs the sensor fusion and estimates the head position. New data is sent at a rate of ~ 1 kHz to minimize latency.</span></div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Now the interesting bit: the company ST is aggressively marketing their STM32 microcontrollers. You can get the STM32F3DISCOVERY board for as little as 15 Euro. This is an evaluation board, containing the three types of sensors mentioned above and comes with a programmable USB connection. It is an excellent hardware platform to emulate the Rift tracker.</span></div>
<div>
<br class="Apple-interchange-newline" />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://www.st.com/st-web-ui/static/active/en/fragment/product_related/rpn_information/board_photo/stm32f3discovery.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://www.st.com/st-web-ui/static/active/en/fragment/product_related/rpn_information/board_photo/stm32f3discovery.jpg" height="320" width="210" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">The STM32F3 discovery kit. (Picture from <a href="http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/PF254044">ST.com</a>)</td></tr>
</tbody></table>
The masterplan is the following:</div>
<div>
<ol style="text-align: left;">
<li>Reverse engineer the Rift USB communication protocol. Understand which messages are exchanged and how the raw sensor values are encoded.</li>
<li>Write a firmware for the STM board to appear just like a Rift to the Host PC. This includes setting the USB descriptors (including Vendor ID, Product ID and the String descriptors) to identical values.</li>
<li>Write a firmware which periodically reads out the sensors and sends the data to the host PC in Rift compatible format.</li>
</ol>
<h2 style="text-align: left;">
Reverse Engineering</h2>
</div>
<div>
Much information can be found on the web. For example the Vendor and Product ID can be found in many logfiles posted by Rift users in various forums. Google is your friend.</div>
<div>
<br /></div>
<div>
Furthermore an USB packet sniffer (such as Wireshark) can be used to get an idea of the USB traffic and what kind of binary data is sent. This is an important debugging tool.</div>
<div>
<br /></div>
<div>
Perhaps one of the most insightful options is to have a close look at the source code of the Rift SDK. A lot of interesting stuff can be found in the file: <span style="font-family: Courier New, Courier, monospace;">OVR_SensorImpl.cpp</span><br />
<span style="font-family: inherit;">I found it extremely useful to modify the SDK code slightly to print me debug messages, showing what is sent over USB. Specifically I modified </span><span style="font-family: Courier New, Courier, monospace;">OVR_Linux_HIDDevice.cpp</span> on line 630<span style="font-family: inherit;">:</span><br />
<span style="font-family: inherit;"><br /></span></div>
<div>
<pre><span style="font-size: x-small;">
bool HIDDevice::SetFeatureReport(UByte* data, UInt32 length){
if (DeviceHandle < 0)
return false;
UByte reportID = data[0];
if (reportID == 0) {
// Not using reports so remove from data packet.
data++;
length--;
}
LogText("HACK::SetFeature, length = %d, data[0-end] = ", length);
int temp;
for (temp=0; temp < length; temp++){
LogText("%02x ", data[temp]);
}
LogText("\n");
int r = ioctl(DeviceHandle, HIDIOCSFEATURE(length), data);
return (r >= 0);
}
bool HIDDevice::GetFeatureReport(UByte* data, UInt32 length) {
if (DeviceHandle < 0)
return false;
int r = ioctl(DeviceHandle, HIDIOCGFEATURE(length), data);
LogText("HACK::GetFeature, length = %d, data[0-end] = ", length);
int temp;
for (temp=0; temp < length; temp++){
LogText("%02x ", data[temp]);
}
LogText("\n");
return (r >= 0);
}
</span></pre>
</div>
<pre><length data="" hidiocsfeature="" int="" length="" logtext="" n="" r="" return="" temp="" x=""><length data="" logtext="" n="" r="" return="" temp="" x="">
</length></length></pre>
<div>
<span style="font-family: inherit;">With this change I got the following output, running the OculusWorld demo (with the fully functioning tracker):</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-Kk6d84G52tw/UxmVwTc2-NI/AAAAAAAAHWw/WGBYunOM3ww/s1600/0001.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-Kk6d84G52tw/UxmVwTc2-NI/AAAAAAAAHWw/WGBYunOM3ww/s1600/0001.png" height="274" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Configuration data exchange between Oculus Rift SDK and Tracker</td></tr>
</tbody></table>
<br />
<span style="font-family: inherit;">At the start of a game, the SDK will read several configuration parameters from the tracker, which contain information about the screen, the lenses and the tracker. This is done by exchanging HID "feature reports" over the USB endpoint 0. Here is a snippet showing some of the parameters describing the screen:</span></div>
<div>
<span style="font-family: inherit;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-S1yZ0QeG0rc/UxZSpT_T4AI/AAAAAAAAHWA/fMkkjPW5y0Q/s1600/1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-S1yZ0QeG0rc/UxZSpT_T4AI/AAAAAAAAHWA/fMkkjPW5y0Q/s1600/1.png" height="328" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Snippet from the Rift SDK, which decodes the 56 byte long configuration packet, containing information about the display.</td></tr>
</tbody></table>
<br />
To get an idea what kind of configuration packets are exchanged and what is encoded by their binary values, have a look at the <a href="http://mbetz.web.cern.ch/mbetz/foculusTypes.h">foculusTypes.h</a> file.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next, the host PC will send periodically (every 3 s) a "keep alive" packet to the tracker, telling it to keep sending sensor data. After the first received keep alive packet, the tracker will start to transmit the sensor data to the PC, typically every 1 ms. This is done in an "interrupt IN transfer" on USB endpoint 1.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The sensor data is arranged in a 62 byte long USB frame in the following way:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<pre style="white-space: pre-wrap; word-wrap: break-word;">uint8_t messageType; // = 1 indicates a sensor data frame
uint8_t sampleCount; // How many sensorData slots are used (1, 2 or 3)
uint16_t timeStamp; // Incremented for each packet
uint16_t commandID; // Not used yet
int16_t temp; // Temperature
uint8_t sensorData1[16];// Sensor data packet, 16 bytes each.
uint8_t sensorData2[16];// Sensor data packet, 16 bytes each.
uint8_t sensorData3[16];// Sensor data packet, 16 bytes each.
int16_t mX; // 16 bit Magnetometer data
int16_t mY;
int16_t mZ;</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
<div style="text-align: left;">
<br />
The magnetometer data is directly encoded in three 16 bit signed integers (mX, mY and mZ).<br />
The data from the gyroscope and accelerometer is formated as 21 bit signed integers and stored in the sensorData blocks.</div>
<div style="text-align: left;">
The three 16 byte arrays contain up to three readings of the gyroscope and accelerometer. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Let's show an example of how the data is packed in these blocks.</div>
<div style="text-align: left;">
We start with the data, read out from the gyroscope, formated as 21 bit signed integers:</div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">x - axis: x20 x19 x18 ... x3 x2 x1 x0 (21 bits)</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">y - axis: y20 y19 y18 ... y3 y2 y1 y0</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">z - axis: z20 z19 z18 ... z3 z2 z1 z0</span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;">This is aranged in the first 8 bytes of the sensorData block as such:</span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">sensorData[0] = x20 x19 x18 x17 x16 x15 x14 x13</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[1] = x12 x11 x10 x9 x8 x7 x6 x5</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[2] = x4 x3 x2 x1 x0 y20 y19 y18</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[3] = y17 y16 y15 y14 y13 y12 y11 y10</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[4] = y9 y8 y7 y6 y5 y4 y3 y2</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[5] = y1 y0 z20 z19 z18 z17 z16 z15</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[6] = z14 z13 z12 z11 z10 z9 z8 z7</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">sensorData[7] = z6 z5 z4 z3 z2 z1 z0 0</span></div>
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;">The last 8 byte in the sensordata block contain the X, Y and Z values of the accelerometer in the same format.</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<h2 style="text-align: left;">
<span style="font-family: inherit;">Developing a Rift compatible tracker</span></h2>
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After reverse engineering the communication protocol, it was possible to fully emulate the Rift tracker. I might post more details about the development process soon.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Until then, you can have a look at how the "Foculus" tracker has been implemented in the attached source code, which is heavily annotated with comments. I have uploaded the entire eclipse project folder:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Sourcecode on GitHub:</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://github.com/yetifrisstlama/Foculus_Rift_Tracker_STM32F3DISCOVERY" style="font-family: Arial, Helvetica, sans-serif; font-size: x-large; font-weight: bold;" target="_blank">Foculus Tracker for STM32F3DISCOVERY V0.3</a><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span><span style="font-family: Courier New, Courier, monospace; font-size: large;"><b>(3.4.14)</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you have a STM32F3DISCOVERY board, you might want to try out the code.</div>
<div class="separator" style="clear: both; text-align: left;">
Some hints on how to set up a full development environment can be found <a href="http://engineering-diy.blogspot.fr/2012/11/stm32f3-discovery-eclipse-openocd.html">here</a>.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you just want to flash the binary (.elf) file, have a look at <span style="font-family: Courier New, Courier, monospace;">how_to_flash.txt</span><span style="font-family: inherit;"> in the zip file.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This is pretty much a work in progress, so feedback is much appreciated. </div>
<div class="separator" style="clear: both; text-align: left;">
Let me know if you find bugs, if it works or doesn't work for you or if you have decided to continue development and came up with some new features to the firmware.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="text-align: left;">
Known Issues, open questions and things to do</h2>
<div>
<ul style="text-align: left;">
<li>The SDK can set the following flags: <span style="white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">Flag_CalibrationTest</span>, </span><span style="white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">Flag_UseCalibration</span>, <span style="font-family: Courier New, Courier, monospace;">F</span></span><span style="white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">lag_AutoCalibration</span>. I have no idea how the SDK expects the Tracker to behave after it set these flags. Currently they are not evaluated at all.</span></li>
<li><span style="background-color: white; font-family: inherit; white-space: pre-wrap;">Another thing is that </span><span style="background-color: white; font-family: inherit; line-height: 16.799999237060547px;">I can not use the Oculus Config Utility to calibrate the Magnetometer, as it checks for a connected HMD. Without the calibration, there is no Yaw drift correction in most of the games. I hope to fix this problem with a EDID hack.</span></li>
</ul>
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In <a href="http://yetifrisstlama.blogspot.fr/2014/03/the-foculus-rift-part-3-spoofing-edid.html">part 3</a> I want to have a look on how to spoof the EDID, to make the LCD display panel look like an actual Oculus Rift monitor to the SDK.</div>
</div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h2 style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">Update 20.3.14</span></h2>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">I wrote a small script in python, to receive the data from the fake rift and plot it. It turned out there were glitches in the Magnetometer data. I found this while recording data for 60 s while rotating the HMD randomly in all directions. The data as read from the magnetometer has been plotted on a 3D plane (left) and over time (right)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Arial, Helvetica, sans-serif;">
<table><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-uxqNfPedMaY/UytvRVeZmsI/AAAAAAAAHcA/B9vmnC7pwro/s1600/sensordat_glitch_move.npz_Magneto.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /><img border="0" src="http://1.bp.blogspot.com/-uxqNfPedMaY/UytvRVeZmsI/AAAAAAAAHcA/B9vmnC7pwro/s1600/sensordat_glitch_move.npz_Magneto.png" height="400" width="400" /></a></div>
<br /></td><td><div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-06Lk54JmW_w/UytvQQzGqNI/AAAAAAAAHcE/Je1xw8YTgYU/s1600/sensordat_glitch_move.npz_Mag2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-06Lk54JmW_w/UytvQQzGqNI/AAAAAAAAHcE/Je1xw8YTgYU/s1600/sensordat_glitch_move.npz_Mag2.png" height="305" width="400" /></a></div>
<br /></td></tr>
</tbody></table>
</span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<br /></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">I think that these glitches actually come from the LSM303 magnetometer sensor. First I thought it is a synchronization issue. But it turned out, the only way to get rid of them was to reduce the output data rate of the sensor from 220 Hz to 75 Hz:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Arial, Helvetica, sans-serif;">
<table><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-66iMphMuBhk/UytvQbsR4jI/AAAAAAAAHb0/UPYOWrgUsO4/s1600/sensordat_clean_move.npz_Magneto.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-66iMphMuBhk/UytvQbsR4jI/AAAAAAAAHb0/UPYOWrgUsO4/s1600/sensordat_clean_move.npz_Magneto.png" height="400" width="400" /></a></div>
<br /></td><td><div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Hy-2xVvH76w/UytvQR195DI/AAAAAAAAHbw/xylv7ug70X4/s1600/sensordat_clean_move.npz_Mag2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Hy-2xVvH76w/UytvQR195DI/AAAAAAAAHbw/xylv7ug70X4/s1600/sensordat_clean_move.npz_Mag2.png" height="305" width="400" /></a></div>
<br /></td></tr>
</tbody></table>
</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">By the way, the left plot illustrates nicely that each one of the magnetometer readings should theoretically be a point on an ellipsoid. The Oculus Rift calibration procedure determines the parameters (its diameters and center point) of this ellipsoid.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h2 style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">Update 29.3.14</span></h2>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Several bugs have been fixed and new features were added.</span></div>
<h3 style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">Scaling of sensor values</span></h3>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">In the previous releases, I was assuming the tracker does not actually do any rescaling and just transmits the raw numbers as they are read from the sensors. But as it turns out, this assumption is wrong. The Oculus SDK expects the sensor values to be scaled to 10^-4 [rad/s], </span><span style="font-family: Arial, Helvetica, sans-serif;">10^-4 [m/s^2] and </span><span style="font-family: Arial, Helvetica, sans-serif;">10^-4 [Gauss], independent on which measurement range the sensor is set to. In the current version of the Foculus Tracker I have accounted for that.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h3 style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">Gyroscope zero level error correction</span></h3>
Place the tracker on a table and make sure it absolutely does not move. Then press the blue "User button" on the STM32F3 DISCOVERY board. The LED pattern will blink a few times, to show that the calibration will now take place. Then 3 LEDs will turn on in sequence, showing which sensor range is calibrated at the moment. Then the IDLE LED pattern will be displayed again and the Tracker is calibrated and ready to use. Please note that the calibration values will be lost as soon as the Tracker is unplugged from USB.<br />
<br />
The calibration significantly reduces gyroscope zero-level error and hence gyro drift, as shown by the following plots:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-DBClYybwPxc/UzcKdIfaEEI/AAAAAAAAHc8/Zuxd_WCQrCA/s1600/beforeCalib.npz_Gyro.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-DBClYybwPxc/UzcKdIfaEEI/AAAAAAAAHc8/Zuxd_WCQrCA/s1600/beforeCalib.npz_Gyro.png" height="302" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before calibration. A bias error is clearly visible. This will be constantly integrated and lead to significant drift of tracker orientation.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-9a-c0fqwKCo/UzcKe-HeI8I/AAAAAAAAHdE/ynFaL341OhE/s1600/afterCalib.npz_Gyro.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-9a-c0fqwKCo/UzcKe-HeI8I/AAAAAAAAHdE/ynFaL341OhE/s1600/afterCalib.npz_Gyro.png" height="302" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After calibration. The zero level error has been reduced.</td></tr>
</tbody></table>
<br /></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<h2 style="text-align: left;">
Further updates (Changelog)</h2>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"></span><br />
<pre><span style="font-family: Arial, Helvetica, sans-serif;">// Changelog
//--------------------------------
// 09.03.2014: Fixed bug in handleConfigPacketEvent() by adding break; statements (data rate was always 1 ms before)
// 10.03.2014: Changed wMaxPacketSize from 62 to 64
// 19.03.2014: Changed I2C Bus speed to 400 kHz, which allows to read all 3 sensors in 0.65 ms (before it was > 2 ms)
// 20.03.2014: Now evaluating the "new data ready" pins of all 3 sensors (improves timing a lot, reduces jitter)
// Enabled FIFO in Streaming mode of Accelerometer and Gyro (no samples will be lost!)
// Fixed Glitches in Magnetometer output by setting it to 75 Hz measurement rate (was 220 Hz before)
// 23.03.2014: Fixed a problem with the USB interrupt and atomic access, not allowing the tracker to change sensor scale
// Changed sensor scaling to floating point numbers and scaled to values as expected from the SDK
// 29.03.2014: Added gyroscope "set to zero" calibration routine (Press the user button on the STM board and keep it very still)
// Added temperature readout from gyro
// Added some nice LED animations for IDLE mode, Tracker running mode and Calibration mode</span>
</pre>
</div>
<div>
<br /></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com43tag:blogger.com,1999:blog-2350507429918446596.post-68942517191063274932014-03-03T15:47:00.001-08:002014-03-04T15:05:14.284-08:00The "Foculus Rift" part 1: Building a Head Mounted Display<div dir="ltr" style="text-align: left;" trbidi="on">
Some time ago I read BitCortex's manual on building a homemade "head mounted display" (HMD), just like the Oculus Rift:<br />
<a href="http://bitcortex.com/oculus-libre-open-source-hmd-inspired-by-oculus-rift/">http://bitcortex.com/oculus-libre-open-source-hmd-inspired-by-oculus-rift/</a><br />
<br />
The concept is surprisingly simple and low tech. A LCD panel presents seperate pictures to the left and right eye, lenses are used to place the panel close to the eyes and hence produce a wide field of view (FOV). What I read about these very simple homemade glasses made me curios. The people on the <span style="background-color: white; color: #006621; line-height: 16.799999237060547px; white-space: nowrap;"><span style="font-family: inherit;"><b><a href="http://www.mtbs3d.com/">mtbs3d</a></b></span></span> forums (the birth-place of the rift) claimed that the 3D effect is fantastic and the head tracker allows the games to become extremely immersive.<br />
<br />
It was clear, I had to try to build some of these fancy 3D goggles.<br />
These posts will document the progress I have made, the problem I encountered and the improvements I came up with along the way.<br />
<br />
<a name='more'></a><br />
<br />
<br />
Here's what I used for the first (and very much hacked together) prototype:<br />
<ul style="text-align: left;">
<li><span style="font-family: inherit;">N070ICG-L21 </span><b>7" LCD panel</b>, 1280x800 (same size and resolution as the Rift), from ebay, 51 Eur</li>
<li><span style="background-color: white;"><span style="font-family: inherit;"><b>5x pocket loupe magnifier </b>with aspheric Lens (two times), from ebay, 19 Eur</span></span></li>
<li><span style="background-color: white;"><span style="font-family: inherit;">Lunch box as enclosure, Skiing goggles, some cardboard and tape, <b>lots of tape</b></span></span></li>
</ul>
<div>
The LCD panel includes a controller with VGA and HDMI inputs and runs on 5 V - 12 V power, drawing a maximum of 1 A. There is a secondary PCB, which features a boost converter for driving the backlight LEDs with 15 V.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-xOk7ojDP4gc/UxUKg4y2b0I/AAAAAAAAHUs/7CLMlUZ2fnQ/s1600/111220132841.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-xOk7ojDP4gc/UxUKg4y2b0I/AAAAAAAAHUs/7CLMlUZ2fnQ/s1600/111220132841.jpg" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The display panel was carefully attached to a cardboard "mounting plate" with tape. This plate fits tightly in the lunch box.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-6c_96AKqW8I/UxULDF8KaEI/AAAAAAAAHU0/ipqQo4JOWVI/s1600/121220132848.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-6c_96AKqW8I/UxULDF8KaEI/AAAAAAAAHU0/ipqQo4JOWVI/s1600/121220132848.jpg" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Cardboard spacers were attached to the display, so when it's placed in the lunchbox, it stays at a well defined position. This is important to keep it in the focal spot of the lenses.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-v85u8RHePsc/UxULyjy0IkI/AAAAAAAAHVM/Wu-Hb3e8gtw/s1600/121220132847.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-v85u8RHePsc/UxULyjy0IkI/AAAAAAAAHVM/Wu-Hb3e8gtw/s1600/121220132847.jpg" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Holes were cut to mount the lenses. They were first taped to some plastic spacers (actually some recycled juice bottles ;). The spacers were mounted to the lunchbox and then fine tuned, to get the lenses in focus and at the right positions. This was actually quite difficult and I still didn't get it perfect yet. The problem is, if the alignment is a little off, you will not notice immediately -- however it will result in a lot of eyestrain during longer use.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Actually at this point I noticed that the lenses are not the best choice and slightly too big. Although I think that it should be possible to get a well aligned picture, they can not be brought close enough to the eyes. The closer the lenses are, the larger is the field of view and the more of the LCD panel is actually visible. For these lenses, the sweet spot is very very close to the eyes. In fact, so close, that they touch the nose because of their rather large diameter. I'm planning to grind one side of them flat to make some nose-space :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-tFyBMC8meAY/UxUOKxg1HUI/AAAAAAAAHVY/hpqCffeRTFE/s1600/121220132849.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-tFyBMC8meAY/UxUOKxg1HUI/AAAAAAAAHVY/hpqCffeRTFE/s1600/121220132849.jpg" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After much playing around I fixed the lenses, mounted the display controller board and attached the whole thing to skiing goggles rather crudely with a lot of tape. No rocket science involved here.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-e33B4Dmpah4/UxUOhGcaZuI/AAAAAAAAHVg/mGADIxbCPKg/s1600/121220132846.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-e33B4Dmpah4/UxUOhGcaZuI/AAAAAAAAHVg/mGADIxbCPKg/s1600/121220132846.jpg" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At this point you can use the HMD already with many Oculus Rift Tech demos and watch 3D stereographic videos on Youtube. The 3D effect is fantastic indeed!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
However, one thing to improve is the weight!</div>
<div class="separator" style="clear: both; text-align: left;">
I included all the circuit boards in the lunchbox, which makes these goggles way too heavy to wear comfortably for longer period of time. The weight of the cables (power, USB and VGA) is also a considerable factor. The weight rests on the nose and even an improvised "headstrap" did not really provide relief. For the second prototype I'm planning to only include the display panel itself in the goggles and keep the controller in a separate box.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://yetifrisstlama.blogspot.fr/2014/03/the-foculus-rift-part-2-reverse.html">Part 2</a> will be about the "Inertial Measurement Unit" IMU, which is the sensor, tracking the orientation of the goggles. I will present a cheap and simple solution to building a "Tracker" which is fully compatible with the existing Oculus Rift games. Stay tuned ...</div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com1tag:blogger.com,1999:blog-2350507429918446596.post-90737902032051881662013-04-13T11:21:00.001-07:002013-04-13T14:41:40.417-07:00Microwave filters for dummies<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://4.bp.blogspot.com/-0N3WU4SyeJo/UWmio9x1zlI/AAAAAAAAHD4/fckvBN39wi0/s1600/model.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="126" src="http://4.bp.blogspot.com/-0N3WU4SyeJo/UWmio9x1zlI/AAAAAAAAHD4/fckvBN39wi0/s200/model.png" width="200" /></a>For a recent project I needed a bandpass filter in the microwave range, made from non-magnetic materials. Remembering this very nice <a href="http://www.w1ghz.org/filter/QEX_Mar_2010_p23-29.pdf">article</a> from Paul Wade, I decided to give it a shot and roll my own. As the results turned out to be spectacular, I had to share this experience.<br />
<a name='more'></a><br />
<b>Mission order:</b><br />
<ul style="text-align: left;">
<li>center frequency = 1.74 GHz</li>
<li>3 dB bandwidth ~ 20 MHz</li>
<li>As small and RF-tight as possible</li>
<li>Quote from a company for this: 400 $ and 3 weeks lead time</li>
</ul>
<br />
For my first filter I wanted to start off with a design which was proven to work in that frequency range, so I just copied these parameters from Paul:<br />
<br />
<b><span style="font-family: "Courier New",Courier,monospace;">Filter 1 </span></b><br />
<span style="font-family: "Courier New",Courier,monospace;">Distance connectors <--> capacitors: <b>12 mm</b><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------></--></span><!------><br />
<span style="font-family: "Courier New",Courier,monospace;">Distance capacitor <--> capacitor: <b>28 mm</b><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------></--></span><!------><br />
<br />
The capacitors are 2 x M8 brass screws centred (with a small air gap) within two copper tubes. I cut 2 threads in the bottom wall of the waveguide to support the screws, the tubes are soldered to matching holes in the the upper wall.<br />
<br />
This filter worked great and was easily adjustable from 1 GHz to 3 GHz. The waveguide itself is used far below its cut-off frequency (6.6 GHz for WR-90), so there is no actual electromagnetic wave propagation taking place. Signals coupled in on one side would normally be attenuated exponentially with waveguide length and only able to travel a few millimeters. Signal propagation is made possible by adding the two capacitors. They form a resonating circuit with the lengths of waveguide before and after each one. Signals on the resonant frequency can propagate, this forms the passband of the filter and works rather well, I measured less than 1 dB insertion loss for both filters I built.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-eGhcN9R2OIA/UWmgWrRx-II/AAAAAAAAHDg/cNRWVOVP6vg/s1600/020420132363.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/-eGhcN9R2OIA/UWmgWrRx-II/AAAAAAAAHDg/cNRWVOVP6vg/s320/020420132363.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Measurement of the first filter, showing its overcoupled passband on a network analyzer. It was not possible to flatten out these two peaks by tuning the filter</td></tr>
</tbody></table>
<br />
<br />
For the first filter, with the top dimensions, it was impossible to get a flat response. No matter how much I tuned the 2 resonators, there were always 2 bumps visible. The two resonators were overcoupled and influencing each other. The solution is to increase the length of waveguide between them to weaken the coupling.<br />
<br />
Before constructing the second filter, I did some simulations in CST Microwave Studio. Eventually I got confident in the simulation results as I could reproduce the measured data of the first filter quite accurately.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-LcmRSibQyYw/UWmfzCquxqI/AAAAAAAAHDY/tufOWMIMQcU/s1600/out_H.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="185" src="http://4.bp.blogspot.com/-LcmRSibQyYw/UWmfzCquxqI/AAAAAAAAHDY/tufOWMIMQcU/s400/out_H.gif" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">H-field in the filter, excited within its passband</td></tr>
</tbody></table>
<br />
In the simulation I then increased the distance between the 2 capacitors, giving me the perfectly flat passband I was aiming for.<br />
<br />
<b><span style="font-family: "Courier New",Courier,monospace;">Filter 2</span></b><br />
<span style="font-family: "Courier New",Courier,monospace;">Distance connectors <--> capacitors: <b>15 mm</b><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------></--></span><br />
<span style="font-family: "Courier New",Courier,monospace;">Distance capacitor <--> capacitor: <b>38 mm</b><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------><!------></--></span><br />
<br />
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<span style="color: #073763;"><span style="font-family: Verdana,sans-serif;">Then it was<b> hammer time</b>!</span></span></div>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-3yYm3RSZLJg/UWXIrX90SxI/AAAAAAAAHCM/oGLOU7x8cOc/s1600/080420132366.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/-3yYm3RSZLJg/UWXIrX90SxI/AAAAAAAAHCM/oGLOU7x8cOc/s320/080420132366.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">A piece of WR-90 waveguide with the golden dimensions for a 1.74 GHz filter marked on it</span></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-S-F9s9MWrUI/UWXIrQLoOAI/AAAAAAAAHCQ/MgXDxFFaZlM/s1600/080420132367.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://4.bp.blogspot.com/-S-F9s9MWrUI/UWXIrQLoOAI/AAAAAAAAHCQ/MgXDxFFaZlM/s320/080420132367.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">The additional parts you need: 2x M8 screws, 2x SMA connectors and 2x 10 mm copper tubes</span></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><span id="goog_330327697"></span><span id="goog_330327698"></span><br /></td><td class="tr-caption" style="text-align: center;"><span id="goog_330327697"></span><span id="goog_330327698"></span><br /></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-H7cW8HiJtIg/UWXIrLdG2FI/AAAAAAAAHCE/ZT9JKiAbSQ4/s1600/080420132368.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://2.bp.blogspot.com/-H7cW8HiJtIg/UWXIrLdG2FI/AAAAAAAAHCE/ZT9JKiAbSQ4/s320/080420132368.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Drilling the holes accurately is the hardest part. Go all the way through both sides with the smaller drill to keep them concentric.</span></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-b7nd26eBBXk/UWXIstWDxbI/AAAAAAAAHCw/JUvu1eti8L0/s1600/080420132370.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-b7nd26eBBXk/UWXIstWDxbI/AAAAAAAAHCw/JUvu1eti8L0/s320/080420132370.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Ready to be soldered. Note the spacer between copper tube and tuning screw to keep them centred. Spiral the solder around the parts first, then heat the whole thing up with a hot air gun or blowtorch.</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-ri9GqUCbVXI/UWXItPPkvkI/AAAAAAAAHDA/nHeToOKV5R8/s1600/080420132371.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://4.bp.blogspot.com/-ri9GqUCbVXI/UWXItPPkvkI/AAAAAAAAHDA/nHeToOKV5R8/s320/080420132371.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Et voila, check that there's a little airgap and no short circuit between tubes and screws and then it's tuning-time</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-vqDupo_4WoE/UWXIt1BG0RI/AAAAAAAAHC8/6I13jqeUoqQ/s1600/080420132373.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-vqDupo_4WoE/UWXIt1BG0RI/AAAAAAAAHC8/6I13jqeUoqQ/s320/080420132373.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Get a network analyzer and start screwing around. The passband of this one is easily adjustable from 1 GHz to 3 GHz, perfectly flat and about <span style="font-size: small;">25</span> MHz wide. Bullseye!</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-MSlUSqUf40k/UWXIuVRy-oI/AAAAAAAAHDE/-N8rBx8vH_M/s1600/080420132374.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://2.bp.blogspot.com/-MSlUSqUf40k/UWXIuVRy-oI/AAAAAAAAHDE/-N8rBx8vH_M/s320/080420132374.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">As the waveguide is well under cut-off you can actually stick your finger in there and there's no difference in the filter response. <span style="font-size: small;">However</span>, <span style="font-size: small;">as <span style="font-size: small;">EMI shielding is important in my application, I decided to solder all holes shut with copper foil. </span>I</span> had to apply some pretty creative soldering techniques for that.</span></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-h77ZThW0nW8/UWXIuwp1yEI/AAAAAAAAHDM/PZGNP5szrxU/s1600/080420132375.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/-h77ZThW0nW8/UWXIuwp1yEI/AAAAAAAAHDM/PZGNP5szrxU/s320/080420132375.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The RF-tight result! </td></tr>
</tbody></table>
<br />
And here is the measured and simulated filter response in comparison. The agreement is fantastic!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-7-_HcXoZbVY/UWmhUV9jscI/AAAAAAAAHDo/pAOurspD1Lg/s1600/compare_overview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://2.bp.blogspot.com/-7-_HcXoZbVY/UWmhUV9jscI/AAAAAAAAHDo/pAOurspD1Lg/s400/compare_overview.png" width="400" /></a></div>
<br />
Zoomed in on the passband: <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-UkDQo8CLL6M/UWmhWBKaAAI/AAAAAAAAHDw/Jlxz8E_dQEc/s1600/compare_zoom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://4.bp.blogspot.com/-UkDQo8CLL6M/UWmhWBKaAAI/AAAAAAAAHDw/Jlxz8E_dQEc/s400/compare_zoom.png" width="400" /></a></div>
<br />
<div>
So building microwave filters is much more straightforward than I expected it to be. Sometimes it's worth to get your hands dirty :)<br />
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com1tag:blogger.com,1999:blog-2350507429918446596.post-63913733429784009512013-01-21T14:13:00.001-08:002013-01-21T14:23:23.317-08:00The green flatscreen<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Well, what to do with a perfectly fine flatscreen, found in the trash with a blown backlight?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Convert it to solar power of course!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/--cp51Uj5YK8/UP2-5EK-tdI/AAAAAAAAHAI/K-X5JUVvYjM/s1600/111220122085-001.jpg" imageanchor="1"><img border="0" height="300" src="http://4.bp.blogspot.com/--cp51Uj5YK8/UP2-5EK-tdI/AAAAAAAAHAI/K-X5JUVvYjM/s320/111220122085-001.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It works surprisingly well as a secondary monitor. Provided there is enough sunlight, the image is quite crisp and colourful. And the best thing is: The brighter the sun, the better it looks -- while the picture on an ordinary monitors becomes unrecognisable.</div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-87862096280696542662012-10-04T13:58:00.002-07:002012-10-08T09:20:52.782-07:00Some nice "Hidden Sector Photon" fieldplots<div dir="ltr" style="text-align: left;" trbidi="on">
Some 3D plots I have done recently for a presentation. They were done with Python and Mayavi. They show how a hypothetical hidden photon field would look like. The emitting structure is a microwave cavity, with a strong electromagnetic field inside. This field is the driving force for the hidden photon field which can penetrate the cavity walls and propagate into space. Unfortunately you can not see the cavity geometry itself in these pictures.<br />
<br />
You don't need to understand any of this, just enjoy the visuals...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-cziyyVGAJ4s/UG6W5RuXePI/AAAAAAAAGjQ/Xb8tyQW7BAU/s1600/ani0.gif_web.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="http://1.bp.blogspot.com/-cziyyVGAJ4s/UG6W5RuXePI/AAAAAAAAGjQ/Xb8tyQW7BAU/s320/ani0.gif_web.gif" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-19iTPicC9eY/UG6W6Btn3bI/AAAAAAAAGjU/KrHSItgsNMQ/s1600/ani1.gif_web.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="http://4.bp.blogspot.com/-19iTPicC9eY/UG6W6Btn3bI/AAAAAAAAGjU/KrHSItgsNMQ/s320/ani1.gif_web.gif" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-YcRqnUlghWE/UG6W6ul6RcI/AAAAAAAAGjg/s4YDq8J2MJ4/s1600/ani2.gif_web.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="http://4.bp.blogspot.com/-YcRqnUlghWE/UG6W6ul6RcI/AAAAAAAAGjg/s4YDq8J2MJ4/s320/ani2.gif_web.gif" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-aObFbuHKLfw/UG6W7dadv0I/AAAAAAAAGjk/R30ZYvYwVk8/s1600/ani3.gif_web.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="http://4.bp.blogspot.com/-aObFbuHKLfw/UG6W7dadv0I/AAAAAAAAGjk/R30ZYvYwVk8/s320/ani3.gif_web.gif" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-I1Y06cdMGb8/UG34DFOTR7I/AAAAAAAAGik/0U2S65UUiI0/s1600/TM_1_0_10.txt_HSP_kk0.51_square.npz.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="139" src="http://4.bp.blogspot.com/-I1Y06cdMGb8/UG34DFOTR7I/AAAAAAAAGik/0U2S65UUiI0/s320/TM_1_0_10.txt_HSP_kk0.51_square.npz.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-GD1TfriNwGE/UG34CpNcKHI/AAAAAAAAGiY/ZXOAm8Mc_2E/s1600/TM_1_0_10.txt_HSP_kk0.51_square.npz1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-GD1TfriNwGE/UG34CpNcKHI/AAAAAAAAGiY/ZXOAm8Mc_2E/s320/TM_1_0_10.txt_HSP_kk0.51_square.npz1.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0tag:blogger.com,1999:blog-2350507429918446596.post-85454575268298073982012-10-02T08:59:00.000-07:002012-10-24T15:55:55.478-07:00A power amplifier for the serious garage door opener<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="" style="clear: both; text-align: justify;">
<div style="text-align: right;">
</div>
<a href="http://1.bp.blogspot.com/-XidhsP-9mHk/UHL-ix0L8pI/AAAAAAAAGlI/Usxz4AzUkAM/s1600/g5423.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="128" src="http://1.bp.blogspot.com/-XidhsP-9mHk/UHL-ix0L8pI/AAAAAAAAGlI/Usxz4AzUkAM/s200/g5423.png" width="200" /></a><span style="text-align: left;">While my serious garage door opener works nicely and reliably, it's output power is "only" 10 dBm (10 mW). It is able to open the garage door from about 100 m -- this is clearly not enough.</span></div>
<br />
So I thought an impressive looking garage door opener needs an impressive amount of RF output power as well. And I found a wonderful solution to that problem, the <a href="http://www.skyworksinc.com/uploads/documents/200510H.pdf">SKY65116</a> chip module.<br />
<br />
It provides up to 2 W of output power from 390 - 500 MHz, 30 dB of gain and its input and outputs are matched to 50 Ohm. In fact it contains a third matching circuit between the internal pre- and power-amplifier It can be put into standby mode drawing only a few uA and thus can be left connected to the battery. When running at full blast it draws 1.2 A at 3.6 V, so its efficiency is about 50 %. Not bad at all!<br />
<br />
<br />
<br />
<a name='more'></a><br />
<span style="color: #351c75;"><b><span style="font-family: "Courier New",Courier,monospace;">Fun fact: 2 W of output power into a 50 Ohm load correspond to an RMS output voltage of 10 V. The module is powered by only 3.6 V though. The trick is made possible by the magic of impedance matching. There are internal inductors and capacitors in the chip, acting like a step-up transformer. </span></b></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
Basically you get an impressive amount of technology and save so much hassle (implementing a pre- and a power-amplifier 3x matching impedance's 3x adjusting bias currents and stabilizing them against temperature variations) for the 6$ it costs.<br />
<br />
<h2 style="text-align: left;">
Construction</h2>
It comes in a surface mount package with a thermal pad. I found a old PCMCIA WIFI extension card which I sacrificed for this project. It contains a nice low loss circuit board with an almost continuous ground plane on the top and bottom layer and many many vias, connecting the two. This is what you want -- to get rid of the heat from the chip and to have a very low impedance ground connection, making RF circuits possible.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://4.bp.blogspot.com/-NeHNC64TC8M/UGoYxtV9FKI/AAAAAAAAGgc/OtHwxaETKTk/s1600/280920121773.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://4.bp.blogspot.com/-NeHNC64TC8M/UGoYxtV9FKI/AAAAAAAAGgc/OtHwxaETKTk/s320/280920121773.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">The circuit board from a WIFI card has been cannibalized for the amplifier.</td></tr>
</tbody></table>
<br />
I cut the copper with a scalpel to form 2 microstrip lines for RF in and output. For the remaining pins (VCC and Enable) copper sheet was cut and glued on the board. This was easier and much more precise than cutting out the pads by hand from the ground plane.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-OYJkAk3ndDc/UGoYy3evXRI/AAAAAAAAGgg/o3_vOmYNPog/s1600/280920121774.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="233" src="http://2.bp.blogspot.com/-OYJkAk3ndDc/UGoYy3evXRI/AAAAAAAAGgg/o3_vOmYNPog/s320/280920121774.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After applying lots of flux and little blobs of solder to all pads</td></tr>
</tbody></table>
<br />
<div>
A hot air gun was used to heat the board slowly from underneath. At some point the solder blobs melt, the chip is pulled in place and soldered with good thermal and RF contact to the board.</div>
<div>
<br /></div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://1.bp.blogspot.com/-IqvOthaC2h8/UGoY0FxnMII/AAAAAAAAGgs/Tc0nFst3-G0/s1600/280920121776.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-IqvOthaC2h8/UGoY0FxnMII/AAAAAAAAGgs/Tc0nFst3-G0/s320/280920121776.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption"><span style="font-size: x-small;">The result: Soldering SMD components with a hot air gun really works!</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://1.bp.blogspot.com/-YfaeBqINXEE/UGoY13dDjXI/AAAAAAAAGg0/hYTUcLFv8rM/s1600/280920121780.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://1.bp.blogspot.com/-YfaeBqINXEE/UGoY13dDjXI/AAAAAAAAGg0/hYTUcLFv8rM/s320/280920121780.jpg" width="316" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Next step is to add the decoupling capacitors (10 nF)</td></tr>
</tbody></table>
<br />
<br />
The board was cut to size and two SMA connectors were soldered to the micro-strip lines ...<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://1.bp.blogspot.com/-XDSJqJRYQwc/UGoYqeDnvQI/AAAAAAAAGfs/s29X-gW6DA8/s1600/011020121794.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-XDSJqJRYQwc/UGoYqeDnvQI/AAAAAAAAGfs/s29X-gW6DA8/s320/011020121794.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">The finished 2 W amplifier, based on the SKY65116 </td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="http://2.bp.blogspot.com/-Nl1ac0LvW7w/UGoYo6DIIsI/AAAAAAAAGfk/GBXEi0nwuDA/s1600/011020121793.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://2.bp.blogspot.com/-Nl1ac0LvW7w/UGoYo6DIIsI/AAAAAAAAGfk/GBXEi0nwuDA/s320/011020121793.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">There is still some leftover circuitry from the WIFI card visible on the bottom</td></tr>
</tbody></table>
<br />
<h2 style="text-align: left;">
Measurements (frequency sweep)</h2>
<div>
So let's measure how it performs. A Vector Network analyzer (VNA) was used, measuring the amplifier "in transmission". That means a signal of known frequency, amplitude and phase is applied on the amplifiers input and the amplitude and phase on the output is measured. This allows to determine the gain and power output of the amplifier.<br />
<br />
A 30 dB attenuator was placed on the second port of the VNA to protect it from overloading. The effect of the attenuator on the measurements is removed by the calibration procedure.<br />
<br />
<span style="text-align: center;">First measurement was a low power frequency sweep, gain was over 30 dB from 350 MHz - 500 MHz. Exactly like specified in the datasheet. Nice! Output power was about 30 mW. It pulled around 300 mA from the PSU!</span><br />
<div style="font-size: 13px;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="font-size: 13px; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-FTNqn0EykgQ/UGoYrtzv7CI/AAAAAAAAGf0/fS88GotVy6I/s1600/011020121796.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/-FTNqn0EykgQ/UGoYrtzv7CI/AAAAAAAAGf0/fS88GotVy6I/s320/011020121796.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Low power frequency sweep</td></tr>
</tbody></table>
<br />
<br />
The next measurement shows an output power of about 2.4 W at 0 dBm (= 1 mW) input. Current consumption went up to 1.2 A at 3.6 V. The board got quite warm after a while of CW operation :) But for pulsed operation the heat sinking is more than enough.</div>
<div style="font-size: 13px;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-anmLKTmOS9s/UGoYuNp3tFI/AAAAAAAAGgE/X2_Y4nsIUwE/s1600/011020121799.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://2.bp.blogspot.com/-anmLKTmOS9s/UGoYuNp3tFI/AAAAAAAAGgE/X2_Y4nsIUwE/s320/011020121799.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">High power frequency sweep</td></tr>
</tbody></table>
<span style="font-size: 13px;"><br /></span></div>
<div>
<span style="font-size: 13px;"><br /></span></div>
<div>
<br />
<h2>
Measurements (power sweep)</h2>
Next measurement is a sweep of the input power from -25 dBm to 0 dBm. It was impressive to see the meter on the PSU jump up and down between 0.3 A and 1.2 A, synchronized to the sweep of the VSA. That's a sign of an efficient amplifier. </div>
<div>
<br /></div>
<div>
At 2.2 W of output power (-0.55 dBm input power) we reach the 1 dB compression point. Then the internal non-linearities of the amplifier reduced the gain by 1 dB. The missing power ends up in unwanted harmonics on the amplifiers output. If a "clean" output is necessary the amp should be operated well below the 1 dB compression point. For the garage door opener that should be not much of a concern and the amp will be operated with around 0 dBm of input power. I also tried up to 10 dBm of input power, there was over 2.5 A flowing and the chip got really hot in CW mode. I'm sure it's not rated for that :) but I didn't manage to destroy it (yet)</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-c2gf0Lx6d7I/UGoYwW98g9I/AAAAAAAAGgU/5r4aeJe6muk/s1600/011020121801.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-c2gf0Lx6d7I/UGoYwW98g9I/AAAAAAAAGgU/5r4aeJe6muk/s320/011020121801.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Power sweep at 433.92 MHz</td></tr>
</tbody></table>
<div>
<br />
<br />
<h2 style="text-align: left;">
Update: IP3 measurements ...</h2>
<div>
I managed to do a two tone measurement with the power amplifier. The output of two 433 MHz signal sources is combined. They have a slight (100 kHz) frequency offset to each other. This is connected to the input of the amplifier. The output signal is displayed on a spectrum analyzer:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-NgNt9xkErkU/UHLLmK2vQlI/AAAAAAAAGko/blBH1UK2-Y8/s1600/041020121803.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="226" src="http://1.bp.blogspot.com/-NgNt9xkErkU/UHLLmK2vQlI/AAAAAAAAGko/blBH1UK2-Y8/s320/041020121803.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Signal at the output of the amplifier, driven by 2 sinusoidal signals with slightly different frequency. The "3rd order intercept point" is reached at an output power of 43.8 dBm</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
We see the two tones from the signal sources, but we also see all kinds of harmonics which have not been there in the input signal. They all appear in a 100 kHz raster and are generated by non-linearities in the amplifier.<br />
<br /></div>
<div>
To quantify these non-linearities, one defines the "3rd order intercept point" as:<br />
<br /></div>
<div style="text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><b>IP3 = Ptone + Pdelta / 2 </b>All in db or dBm </span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><i>Ptone </i>is the signal power</span> at the initial frequency. <span style="font-family: inherit;"><i>Pdelta </i>is the difference between <i>Ptone </i>and the harmonic next to it.</span></div>
<div style="text-align: left;">
<span style="font-family: inherit;">For this amplifier IP3 = 43.8 dBm. That means if we (theoretically) apply an input signal that is big enough to get 24 W of output power from the amplifier, only half of its output power would end up at the actual signal frequency, the other half would go into nasty harmonics.</span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-QZ2Hb6dD-EA/UHLNiIEv0aI/AAAAAAAAGk0/gTi4aKOkqDU/s1600/041020121806.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="274" src="http://1.bp.blogspot.com/-QZ2Hb6dD-EA/UHLNiIEv0aI/AAAAAAAAGk0/gTi4aKOkqDU/s320/041020121806.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: inherit; font-size: small; text-align: left;">Here is a nice size comparison to a slightly older table-top amplifier of similar performance I found in the lab. </span><span style="font-size: small; text-align: left;">Miniaturization really has come a long way</span></td></tr>
</tbody></table>
<br />
<div style="font-size: 13px;">
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
</div>
<h2 style="text-align: left;">
Update: It's doing it's job now</h2>
<div>
The amplifier has been integrated in the garage door opener. Some more tests need to be done over how much range it actually provides and there is still significant potential in optimizing the antenna but still, it's pretty damn powerful :).<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-dV7V-2vRZaY/UIEvAZqOqFI/AAAAAAAAGlc/dmt63mzHlyM/s1600/181020121835.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" src="http://4.bp.blogspot.com/-dV7V-2vRZaY/UIEvAZqOqFI/AAAAAAAAGlc/dmt63mzHlyM/s320/181020121835.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-HTWcK3i77EQ/UIEvBFmWKvI/AAAAAAAAGlk/vCZ8jOj_KFI/s1600/181020121836.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://4.bp.blogspot.com/-HTWcK3i77EQ/UIEvBFmWKvI/AAAAAAAAGlk/vCZ8jOj_KFI/s320/181020121836.jpg" width="320" /></a></div>
<div>
<b style="font-family: 'Courier New', Courier, monospace;"><br /></b>
<b style="font-family: 'Courier New', Courier, monospace;">Disclaimer:</b><span style="font-family: 'Courier New', Courier, monospace;"> With an output power of > 2 W, this device violates FCC regulations in some countries and should therefore never be operated outside the controlled environment of a shielded RF - laboratory.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com6tag:blogger.com,1999:blog-2350507429918446596.post-73911173476215882632012-09-15T09:54:00.000-07:002012-10-04T14:09:13.607-07:00The serious garage door opener<div dir="ltr" style="text-align: left;" trbidi="on">
Garage door openers are handy little gadgets. Most of them are cheap chinese plastic crap though. This one definitely isn't. It started by collecting parts from my favorite electronics shop: the dumpster.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-9rZ0Lifhr8c/UFSs7EgzpZI/AAAAAAAAGdw/f8Pst_iKN7w/s1600/100920121741.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="http://4.bp.blogspot.com/-9rZ0Lifhr8c/UFSs7EgzpZI/AAAAAAAAGdw/f8Pst_iKN7w/s400/100920121741.jpg" width="400" /></a></div>
<br />
An old emergency shutdown switch makes the perfect case with a seriously big red button.<br />
<br />
<br />
<a name='more'></a><br />
<br />
<br />
<br />
The original opener was available for reverse engineering. It sends a 433.92 MHz tone which is keyed on or off (ASK) to transmit the 10 bit entry code. What is actually sent is:<br />
<span style="font-family: "Courier New",Courier,monospace;">0 kkkkkkkkkk bb</span><br />
<span style="font-family: inherit;">where k is the secret 10 bit key and </span><span style="font-family: "Courier New",Courier,monospace;">bb</span><span style="font-family: inherit;"> <span style="font-family: inherit;"></span></span>is either 01 or 10, depending on which button is pressed.<br />
Before transmitting, the bits are converted to symbols:<br />
1 = 110<br />
0 = 010<br />
Each bit of the symbol then lasts for ~ 700 us.<br />
<br />
<br />
There are several ways of making a 433.92 MHz oscillator. The easiest is to use one of the many transistor oscillator circuits. Most of them use an LC resonator to set the frequency. At 433.92 MHz we would have to deal with single turn inductors and pF capacitors. Although it can be made to oscillate, the frequency would be extremely dependent of its surroundings and just putting your hand anywhere close to the antenna would detune the resonator too much. Replacing the LC resonator by a Surface Acoustic Wave Filter (SAW) would be the solution. These filters are very narrowband (a few 100 kHz) and act as a stable frequency determining element. Most RF remote controls use a SAW filter. However the component is hard to find for the exact frequency needed.<br />
<br />
As no SAW filter was available, the MAX7057 was used to generate the 433.92 MHz signal. It uses a 20 MHz crystal as frequency reference. A internal fractional PLL allows to generate any frequency between 380 MHz up to 450 MHz which can be set with a resolution of 4.8 kHz.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-hX_O_BGGac8/UFSs8lvY0TI/AAAAAAAAGd4/ikEE1Y_SdSU/s1600/100920121744.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-hX_O_BGGac8/UFSs8lvY0TI/AAAAAAAAGd4/ikEE1Y_SdSU/s400/100920121744.jpg" width="400" /></a></div>
<br />
<br />
A small PIC16LF819 microcontroller is used to key the RF signal and to configure the MAX7057 over SPI. The whole circuit is powered by a 3.7V rechargeable li-ion battery.<br />
<br />
Putting it all together:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-7F9MC5nf99g/UFSs952Pn-I/AAAAAAAAGeA/40AqkW5aepg/s1600/120920121747.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-7F9MC5nf99g/UFSs952Pn-I/AAAAAAAAGeA/40AqkW5aepg/s320/120920121747.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">From left to right: ICSP header, PIC uC, Crystal + LED, Inductors with 15 and 18 nH.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-WselJBmKV4Q/UFSs_ITmf6I/AAAAAAAAGeI/5JNJ280_6Lg/s1600/120920121748.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://1.bp.blogspot.com/-WselJBmKV4Q/UFSs_ITmf6I/AAAAAAAAGeI/5JNJ280_6Lg/s320/120920121748.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The MAX7057 is on the bottom side of the board. The thin orange wires are mostly for digital signals</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-t2p08yPykoU/UFStAozujeI/AAAAAAAAGeQ/u5qob36igIc/s1600/120920121749.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/-t2p08yPykoU/UFStAozujeI/AAAAAAAAGeQ/u5qob36igIc/s320/120920121749.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Details on the RF - circuitry with the tiny SMD ceramic capacitors. With some care protoboard can be used at these frequencies although a solid groundplane would have been nicer.</td></tr>
</tbody></table>
<br />
The small inductors close to the SMA connector are for impedance matching to 50 Ohm and bandpass filtering the output signal.<br />
<br />
In the case with battery and antenna:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-V_rdjCwfMdM/UFTAOryETpI/AAAAAAAAGfM/pU4jxeiQ7Y4/s1600/150920121759.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="278" src="http://2.bp.blogspot.com/-V_rdjCwfMdM/UFTAOryETpI/AAAAAAAAGfM/pU4jxeiQ7Y4/s320/150920121759.jpg" width="320" /></a></div>
Note how the footpoint of the antenna (the outer conductor of the coax) has been connected to the metal case by copper tape. This considerably improved performance.<br />
<br />
The timing has been fine tuned by comparing the output (yellow) to the original opener (white) on a scope:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-LZLvtk8ZNMA/UFStDT2P3XI/AAAAAAAAGeg/fxR2TA5bFBs/s1600/140920121754.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://4.bp.blogspot.com/-LZLvtk8ZNMA/UFStDT2P3XI/AAAAAAAAGeg/fxR2TA5bFBs/s320/140920121754.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
A measurement with the spectrum analyzer shows the carrier at 433.9 MHz and harmonics at +-20 MHz distance. This is the frequency of the crystal. Also the fractional PLL seems to generate a lot of phase noise. No big deal for this application though.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-zWZ_rQf7xn4/UFStEdheuyI/AAAAAAAAGeo/Cjv0cfG5eV4/s1600/150920121756.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/-zWZ_rQf7xn4/UFStEdheuyI/AAAAAAAAGeo/Cjv0cfG5eV4/s320/150920121756.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Reducing the span and zooming in. We see the frequency is off by ~ 100 kHz. This has been corrected now in software. The reason for the _huge_ noise floor is the PLL, having a quite wide loop bandwidth (600 kHz).</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-1H_qkwwK6Xg/UFStFZ0wLDI/AAAAAAAAGew/MfSUxhH0z2U/s1600/150920121757.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-1H_qkwwK6Xg/UFStFZ0wLDI/AAAAAAAAGew/MfSUxhH0z2U/s320/150920121757.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Et voila, the working garage door opener:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-fYRUul35aGA/UFStB42GjaI/AAAAAAAAGeY/0Ph0uTmW8Mc/s1600/140920121753.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-fYRUul35aGA/UFStB42GjaI/AAAAAAAAGeY/0Ph0uTmW8Mc/s320/140920121753.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
Next step is to include a serious <a href="http://yetifrisstlama.blogspot.fr/2012/10/a-power-amplifier-for-serious-garage.html">power amplifier</a>, stay tuned ...</div>
<br />
<br />
<br />
The software was written in PIC assembler and is available here:<br />
<a href="http://mbetz.web.cern.ch/mbetz/garage.asm">garage.asm</a><br />
<a href="http://mbetz.web.cern.ch/mbetz/garage_mplab.zip">MPLAB project</a></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com8tag:blogger.com,1999:blog-2350507429918446596.post-87894979849377205472012-03-26T04:31:00.001-07:002012-10-02T09:09:12.689-07:00PyAudio with 24 bit under windows<div dir="ltr" style="text-align: left;" trbidi="on">
Here are the results, proofing that with the WASAPI architecture I got true audio 24 bit samples under Windows 7:<br />
<br />
<a name='more'></a><br /><br />
Architecture: <b>MME </b>(default for PyAudio)<br />
Requested resolution: <b>16 </b>bit<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://3.bp.blogspot.com/-84gOkAYVlWI/T3BS018g2xI/AAAAAAAAGFw/Xn7g30XByj0/s1600/MME_16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-84gOkAYVlWI/T3BS018g2xI/AAAAAAAAGFw/Xn7g30XByj0/s320/MME_16.png" width="209" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
Architecture: <b>MME </b>(default for PyAudio)</div>
<div style="text-align: left;">
Requested resolution: <b>24 </b>bit</div>
<div style="text-align: left;">
Note that the returned data has still only 16 bit precission and is zero padded to 24 bit.</div>
<br />
<a href="http://3.bp.blogspot.com/-R4Aic-kArMI/T3BS2W7I1FI/AAAAAAAAGF4/zN6Jy_TFCwY/s1600/MME_24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="http://3.bp.blogspot.com/-R4Aic-kArMI/T3BS2W7I1FI/AAAAAAAAGF4/zN6Jy_TFCwY/s320/MME_24.png" width="209" /></a><br />
<br />
Architecture: <b>WASAPI</b><br />
Requested resolution: <b>16 </b>bit<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-OHPqLM21pag/T3BS3fTDsrI/AAAAAAAAGF8/fjgOcbXxTdc/s1600/WASAPI_16.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-OHPqLM21pag/T3BS3fTDsrI/AAAAAAAAGF8/fjgOcbXxTdc/s320/WASAPI_16.png" width="209" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-m0wobZnctC8/T3BS4XvurqI/AAAAAAAAGGI/bPGEo9mvNAQ/s1600/WASAPI_24.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"></a></div>
<div style="color: black; text-align: left;">
<br />
Architecture: <b>WASAPI </b></div>
<div style="color: black; text-align: left;">
Requested resolution: <b>24 </b>bit</div>
<div style="color: black; text-align: left;">
This is how it should be. Note the much better resolution. Now the analog part of the soundcard is determining the noise floor and not the quantization noise.</div>
<a href="http://4.bp.blogspot.com/-m0wobZnctC8/T3BS4XvurqI/AAAAAAAAGGI/bPGEo9mvNAQ/s1600/WASAPI_24.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-m0wobZnctC8/T3BS4XvurqI/AAAAAAAAGGI/bPGEo9mvNAQ/s320/WASAPI_24.png" width="209" /></a><a href="http://4.bp.blogspot.com/-m0wobZnctC8/T3BS4XvurqI/AAAAAAAAGGI/bPGEo9mvNAQ/s1600/WASAPI_24.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/15862249901477424550noreply@blogger.com0