<h1>Input Devices</h1> <h4>Wednesday 04 April, 2018</h4> <div style="width:40%; float:right"> <img src="media/week11/fab-family.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <div style="width:50%; float:right"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/8RtTsTI.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> </div> <div style="width:50%; float:right"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/xGek5Kp.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> </div> <img src="media/week11/fab-team-dubai.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/case-1.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/case-2.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/case-3.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> </div> ## A New Hope #### A FabAcademy Story So this is it. My last week in the Emirates for this journey. Even right up to the last minute, there was a bunch of things I still had to do: + Visit Ahmad's lab at Origin Base + Go to Abu Dhabi + Assemble my hard case ready for travel (need bolts and some other hardware) + Have a beer with Gabriel + Catch up with Julia from London who was in town A couple of short hours before getting on the plane to Helsinki and ending this wonderful stage of the journey in the Emirates I also managed to get some final things out of the way: + Visited Ahmad's lab at Origin Base and had a really awesome chat about the state of affairs with makers and trying to monetise both labs and projects sustainably + Got the bolts I needed Went 'boy shopping' with Engineer Hashim, found new suppliers for nuts and bolts (the good kind!) + Got my henna done with Zahrah + By the end of the week we ended up killing three birds with one stone - Gabriel's house was in Abu Dhabi and Julia wanted to meet up on the weekend so we all took a trip to Gabriel's place. We drove around the city at night had dinner and had beer for the first time in a long while + We got stranded in Abu Dhabi overnight so Julia and I booked a last minute hotel + Abu Dhabi had some really awesome architecture and it was really quite great to take the chance even if I had left it to four months having been in Dubai to do so. #### Restored faith in everything I'd given up on If you were following along with <a href="assignment10.html">the end of last week</a> I had a few Fab problems going on (and some life ones too). Deep thanks to Wendy for assembling an amazing team. Thanks for pushing us all further than we wanted to go. I don't know what you saw in us but you had a plan for us beyond what we already knew. We are all makers with heart and I look forward to the next phase of us all working together after FabAcademy! Moving to a different place and being pressed for time <a href="media/week11/out-of-nowhere-thank-you.jpg">crazy awesome things just happen</a>. I could never have anticipated what I would learn here. <div class="row"> </div> <div style="width:40%; float:left"> <img src="media/week11/circuit-tattoo-1.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/circuit-tattoo-2.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/circuit-tattoo-3.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/circuit-tattoo.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <div style="width:50%; float:left"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/RGNBnnx.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> </div> <div style="width:50%; float:right"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/LZ5txpC.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> </div> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/d8jN2L7.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> </div> I'd been struggling with the Fab life but it forces you to be social, which is pretty out of character <a href="media/week11/solitude.jpg">for an engineer</a>. The inspiring words of our lecturer and saviour: <legend>"I am a bag of charge." -Gershenfeld, 2018</legend> --- <div class="row"> </div> <div style="width:30%; float:right"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/saD9CGP.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> <legend>"Testing the outputs on the ATtiny45 CopyCat board. See below for detail."</legend> </div> ## How do you even "Input Devices"? Input Devices week is about using the inputs on a microcontroller. There are a variety of ways you can use them, namely analog like a temperature sensor, or serial like an LCD or digital accelerometer. After being inspired by the possibilities in Neil's lecture I had planned to try out three different types of input devices. Given the timeframe and how life generally gets in the way however, things didn't quite go to plan. That's ok though, as we all say the real Fab Academy actually happens once you've finished. So one of the cool things about documenting is that I'll look back on this in a period of time and have some documentation to continue from. I've always likened my workflow to be like working on a team of developers that learned their work ethic from a roadworks labourer - the team has a broad range of capabilities but can only ever make progress on one facet at a time. This is where documentation can be very handy, since as a specimen of the Mechatronics variety I do have a lot of distracting areas of curiousity, and writing down my thoughts has helped a lot with managing a teams' worth of tasks for just one person. <div class="row"> </div> <div style="width:100%; float:left"> <img src="media/week11/copycat-schem.JPG" style="width:32%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/copycat-pcb.JPG" style="width:32%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/copycat-board-1.JPG" style="width:36%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Back to KiCad for this one. I needed something done pronto, and I wasn't going to risk Eagle again. Also, I would have used Altium if the Fab library footprints were available (project for later I suppose). Thanks Wendy!"</legend> </div> <div style="width:50%; float:left"> <div style="width:50%; float:right"> <img src="media/week11/copycat-board.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Stuffed! (In a good way)"</legend> <img src="media/week11/isp-to-ftdi-conversion.JPG" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week11/isp-to-ftdi.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> </div> <div style="width:50%; float:left"> <img src="media/week11/copycat-board-sanded.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Sanding the board this time to make sure no loose swarf causes problems like last time."</legend> <img src="media/week11/isp-to-ftdi-working.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> </div> <div class="row"> </div> <legend>"Sick of these damn connectors. I wanted to replace the ISP headers with FTDI, or at lease have both connectors on the board. I gave up in the end but I'll leave this schematic here for future reference (works as far as I can tell). In the meantime I had to make a patch cable."</legend> </div> #### Board One: CopyCat w/Power Meter So this week I was distracted in three directions: Firstly I wanted to build a power-meter. This would require a current sensor, implemented as an op amp with a shunt, and a voltage sensor, implemented as a voltage divider. I ended up building this into the CopyCat board shown above, which you can see the files in the <a href="design-files.html">design files</a> list. The idea with the CopyCat board was that it would double as my Output Devices assignment, which was <a href="assignment12.html">next week</a>. I wanted to be able to take in an input signal and re-play it as an output signal. The power sensing is on there just as a matter of convenience, and to give me something specific to do as this week's assignment. The board went to plan but I didn't end up using it for Output Week, having a major shift in my final project ambitions. <div class="row"> </div> <div style="width:25%; float:right"> <div style="width:95%; float:left"> <img src="media/week11/modela-mdx20.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Teething issues with this ancient relic."</legend> <img src="media/week11/copper-swarf-short.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Short circuit from swarf because I used a dull milling bit."</legend> <img src="media/week11/flashing-tiny45.JPG" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Flashing hex code compiled from C."</legend> <img src="media/week11/audio-working.JPG" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Microphone input seemingly working."</legend> </div> </div> <div style="width:25%; float:right"> <div style="width:95%; float:left"> <img src="media/week11/hello-mic-45-board.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"After all this the vacuum cleaner also sucked up my board. The new lab was playing me as the new guy."</legend> <img src="media/week11/make-hex-file.JPG" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Uploaded Neil's code after fixing his Makefile."</legend> <img src="media/week11/hello-mic-45-working.jpg" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Using a Fruit-Fun FTDI board I had handy since the one I made back in Dubai got fried out."</legend> <img src="media/week11/fast-car-by-tobtok.JPG" style="width:100%; float:left; padding:5px 5px 5px 5px;"/> <legend>"Not sure how to raise the buffer length but here's presumably a few microseconds of <em>Fast Car by Tobtok</em>."</legend> </div> </div> #### Board Two: ADC Board, feat. Electret Mic The second thing I wanted to do was set myself up well for <a href="assignment13">Applications and Interface Programming week</a> by taking in a signal and then plotting it in Python. This is a particularly awesome concept because (in concert with the fact that all my ideas are awesome) this framework would allow me to use any analog signal and plot it like an oscilloscope. Eventually I had intended to replace the microphone with some kind of oscilloscope probe, but I'll chuck that one in the Trello for Future Carl. As it turns out, Bas had actually done this for his final project (<a href="http://fabacademy.org/archives/2012/students/bas.withagen/final.html">which was so long ago in an era when oscilloscopes were still carved out of stone</a>) and so that will be a good reference for me to work from in future endeavours. Back to the microphone though, I directly downloaded Neil's circuit images for the microphone examples (<a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.traces.png">traces</a>, <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.interior.png">outline</a>) and soldered according to the diagrams (<a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.png">layout</a>, <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.jpg">photo</a>). I wasn't intent to redesign anything new at this point since I was moving country. Next I uploaded the <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.c">C code</a> using the associated <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.make">makefile</a>, and used the provided <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.SPU0414HR5H.py">python script</a> to read the buffer. Turns out I'd tried the wrong board; I needed to use the one for analog electret mic feat. (DJ) Op Amp. The digital microphone didn't use an op amp so even though I managed to get it working with no problems it took me in the wrong direction for what I intended to learn this week. The real <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.traces.png">traces</a>, <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.interior.png">outline</a>, <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.png">diagrams</a> and <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.jpg">photo</a> are hosted on the archive too. You can also find the <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.c">C code</a>, <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.make">makefile</a>, and <a href="http://academy.cba.mit.edu/classes/input_devices/mic/hello.mic.45.py">python script</a> that I used on the archive as well. An issue I ran into was that the board was supposed to accept 3.3V and the FabISP I am using has the power supply connected. Somehow I was able to upload the hex file, but my FabFTDI which was also connected fried out and stopped working. I know this because I used a known-working Sparkfun FTDI board and I was able to get the microphone output to display on the computer. It's pretty routine nowadays that I have to look back at previous weeks to remember how to upload *.c files through avrdude, so this time I'll include it as text instead of a screenshot for convenience next time (probably tomorrow). # Make the C file using the MakeFile make -f hello.mic.45.make # Upload he do-hickey to the whats-a-majig # (hex file, ATTiny45) avrdude -p t45 -c usbtiny -P usb -U flash:w:hello.mic.45.c.hex:i # Open the python script using Python 2.* and listening on COM9 py -2 hello.mic.45.py COM9 Occasionally, Neil's Makefiles were broken (indentation errors) so I would just grab one that I'd used before and copy the body of the file to fix it. I think the error was a "<em>\*** missing separator</em>" error usually. <div class="row"> </div> #### Board Three: Capacitive Touch Bar The idea with this one was not anything to do with my final project, but I was compelled after Neil showed what they can do. I'd seen these used a lot before, the most recent interaction with one was when I was in Shenzhen and I stayed at a Capsule Hotel! Due to their simplicity they made a perfect input device for controlling the airflow and complex lighting system of of the space pods. The idea for this week was to build a touch bar like on the new MacBook Pro (or at least give it a go), but then one day use an array of such sensors to determine x/y position for a capacitive joystick. I would like to know how to build a joystick low profile like for example the <a href="https://www.google.is/search?q=PSP+joystick&oq=PSP+joystick&aqs=chrome..69i57.2503j0j7&sourceid=chrome&ie=UTF-8">PSP Joystick</a>, which I found is also known as a <em>Thumb Slide Joystick</em>. In order to do this I'd use Neil's step response information, considering differential input and charge/discharge sensing and I may also want to use an ATMEGA16u4 for USB HID compliance or perhaps just pipe the output via serial to an external 16u4 instead of building the whole board around it. Neil recommended that we check out <a href="http://fab.cba.mit.edu/classes/863.10/people/matt.blackshaw/week8.html">Matt Blackshaw's capacitive sensor writeup</a> and after that I'd give <a href="http://academy.cba.mit.edu/classes/input_devices/step/hello.load.45.c"> Neil's circuit code a go</a>. I proposed some pseudo-code on the plane ride from Helsinki to Reykjavik. You can find it in the <a href="design-files.html">design files</a> page. (Spoiler alert it's not particularly exciting but you can piece together some logic yourself if you were already thinking about doing one). I didn't get around to building this board at all unfortunately, but I did instead make use of a joystick that I brought with me from Australia in my <a href="assignment12.html">Output Week assignment</a> to control three stepper motors for the final project. #### Board Four: Wireless Camera Yes, I did mention I only wanted to try three boards. It's like shopping, you don't know what speaks to you until you're amongst it. Also, it wouldn't be my representative of my style if I hadn't <a href="https://i.imgur.com/yZHjDiH.gifv">bitten off more than I could chew</a>, especially at a time that I was moving between countries! Neil showed a <a href="http://academy.cba.mit.edu/classes/input_devices/video.html">snippet of WebRT</a> which was pretty cool because I had brought a RaspberryPi ZW and an infra-red camera module with me. I did eventually get around to this in <a href="assignment13.html">Week 13</a>, but it was much more of an Applications and Interface Programming assignment than one for this week. ##Design Files Design files for this week can be found at <a href="design-files.html">Design Files</a>. <div style="width:40%;"> <video width="100%" autoplay loop controls muted><source src="https://i.imgur.com/Yv1zeua.mp4" type="video/mp4"/>Your browser does not support the video tag.</video> <legend>"So long Dubai! It's been real 😍"</legend> </div> ---