Jekyll2018-07-12T21:58:06+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/Ilias Bartolini @FabAcademyBlog about my assignments at FabAcademy2018 in BarcelonaIlias Bartoliniilias.bartolini@gmail.comProject Summary - Privacy Seed2018-06-09T23:53:58+00:002018-06-09T23:53:58+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/06/10/project-final-summary<p>My final project is an interactive installation: <strong>Privacy Seed</strong>.</p>
<blockquote>
<p><strong><em>“WHAT DO YOU LOVE AND HOPE TO PROTECT FROM</em></strong><br />
<strong><em>DIGITAL MASS SURVEILLANCE AND EROSION OF PRIVACY?”</em></strong></p>
</blockquote>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/presentation.png" alt="Presentation_image" /></p>
<video style="object-fit: initial; width: 640px; height: 360px;" id="presentation" src="/2018/labs/barcelona/students/ilias-bartolini/presentation.mp4" controls=""></video>
<p>Note: Work in progress - I will keep updating this page with a summary of the Fab Academy final project.</p>
<!--more-->
<p><strong>Privacy Seed</strong> is an art installation to challenge the intersections of personal spaces and data privacy, the connection of human identity and its digital extensions.</p>
<p>A wooden tree structure holds at its center an anatomical heart object with an heartbeat sensor.<br />
By holding this heart in their hands the participants start interacting with the tree lights and sounds.<br />
The participants’ heartbeat will be used to “seed” a secure digital random number generator that publishes its results to the web.</p>
<p><strong>Privacy Seed</strong> is a reflection on our personal-and-digital identity boundaries. It is an exploration of our intimate spaces and their public digital shadows.</p>
<ul id="markdown-toc">
<li><a href="#ideation-sketching-and-planning" id="markdown-toc-ideation-sketching-and-planning">Ideation, sketching and planning</a></li>
<li><a href="#anatomical-heart-shape" id="markdown-toc-anatomical-heart-shape">Anatomical heart shape</a></li>
<li><a href="#heart-rate-sensor" id="markdown-toc-heart-rate-sensor">Heart rate sensor</a></li>
<li><a href="#tree-structure" id="markdown-toc-tree-structure">Tree structure</a></li>
<li><a href="#lights-ad-sound-control" id="markdown-toc-lights-ad-sound-control">Lights ad sound control</a></li>
<li><a href="#random-number-generation-and-interface" id="markdown-toc-random-number-generation-and-interface">Random number generation and interface</a></li>
<li><a href="#progress-and-next-steps" id="markdown-toc-progress-and-next-steps">Progress and next steps</a></li>
</ul>
<h3 id="ideation-sketching-and-planning">Ideation, sketching and planning</h3>
<p>The main inspiration comes from the <a href="http://www.theclimateribbon.org/the-climate-ribbon/2016/1/19/dispatch-4-the-story-of-the-trees-in-paris">Climate Ribbon’s tree</a> that I saw during the COP21 climate conference in Paris:<br />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_ribbons_tree.jpg.jpg" alt="IMG_2_tree_ribbons_tree" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_ribbons_tree_people.jpg.jpg" alt="IMG_2_tree_ribbons_tree_people" />
<small>Pictures from <a href="http://www.theclimateribbon.org/the-climate-ribbon/2016/1/19/dispatch-4-the-story-of-the-trees-in-paris">The Climate Ribbons</a> project</small></p>
<p>In one of the first weeks I started sketching:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_sketch.jpg.jpg" alt="IMG_2_tree_sketch" /></p>
<p>and I came with a list of main parts and problems to solve:</p>
<ul>
<li>Anatomical heart shape</li>
<li>Tree structure (cardboard, small)</li>
<li>Heart rate sensor</li>
<li>Tree & heart lights</li>
<li>RNG, Web API & pages</li>
</ul>
<p>Optionally also:</p>
<ul>
<li>Heart pressure switch</li>
<li>Heartbeat sound</li>
<li>A bigger tree structure made of wood</li>
</ul>
<p>The full <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/03/23/project-privacy-seed.html">initial plan is available here</a> and more details in the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/05/27/week17-applications-and-implications.html">applications and implications</a> week assignment.</p>
<h3 id="anatomical-heart-shape">Anatomical heart shape</h3>
<p>Starting from a sample heart shape available on thingverse (eg. <a href="https://www.thingiverse.com/thing:693895">Solid Anatomical Heart</a> by huntgather98 - CC-BY-SA):
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_2_anatomic_heart.png.jpg" alt="Screenshot_2_anatomic_heart" /></p>
<p>I designed a mesh for the heart shape:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_2_anatomic_heart_blender.png.jpg" alt="Screenshot_2_anatomic_heart_blender.png" /></p>
<p>And 3D printed it:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_4.3_heart_shape_assembled.jpg.jpg" alt="IMG_4.3_heart_shape_assembled" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_4.7_heart_shape_mould_result.jpg.jpg" alt="IMG_4.7_heart_shape_mould_result" /></p>
<p>More details at the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/04/19/project-anatomical-heart-shape.html">Casting a heart shape</a> page.</p>
<h3 id="heart-rate-sensor">Heart rate sensor</h3>
<p>At this point I selected a sensor that uses <a href="https://en.wikipedia.org/wiki/Pulse_oximetry">Pulse Oximetry</a> to detect the hartrate: The <a href="https://www.digikey.com/catalog/en/partgroup/max30101/62077">MAX30101</a> sensor</p>
<p>I had many iterations to design a tiny sensor board</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_3.3_heart_sensor_board_3nd_try.jpg.jpg" alt="IMG_3.3_heart_sensor_board_3nd_try" /></p>
<p>This is supposed to be controlled by another board with a microcontroller that is meant to be integrated and casted inside the heart shape and give some visual feedback with an LED.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_3.4_heart_sensor_master_board_stuffed.jpg.jpg" alt="IMG_3.4_heart_sensor_master_board_stuffed" /></p>
<p>More details at the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/04/30/project-heart-rate-sensor.html">Heart rate sensor</a> page.</p>
<h3 id="tree-structure">Tree structure</h3>
<p>I started designing a small scale 3D model to prototype first with cardboard then in plywood</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.1_tree_structure.png.jpg" alt="Screenshot_5.1_tree_structure" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.13_Tree_wood_small_structure_all_together.jpg.jpg" alt="IMG_5.13_Tree_wood_small_structure_all_together" /></p>
<p>More details at the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/05/28/project-tree-structure.html">Tree structure page</a> page.</p>
<h3 id="lights-ad-sound-control">Lights ad sound control</h3>
<p>I tested AdaFruit DotStar LED pixed strip to generate light patters and created a custom board to control the lights.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.23_dotstar_driver_board_stuffed.jpg.jpg" alt="IMG_5.23_dotstar_driver_board_stuffed" /></p>
<p>I also creates initial simple interactions from the input sensor to the light controls:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/K6Ep3WfOVeo?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<p>More details at the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/05/29/project-lights-and-sound-control.html">Lights and sound control page</a> page.</p>
<h3 id="random-number-generation-and-interface">Random number generation and interface</h3>
<p>I started analising the possible options to generate “cryptographically secure” pseudo-random numbers.<br />
The preferred option would be to use a linux based board like a Raspberry-Pi zero. Optionally an AVR board could be used for non “non-cryptographically secure” random numbers.</p>
<p>More details at the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/04/27/project-random-number-generator.html">Random number generator</a> page.</p>
<h2 id="progress-and-next-steps">Progress and next steps</h2>
<p>A simple MVP (to complete pass the FabAcademy exam :)) could be composed of the heart shape, electronics only and a small plywood board tree.</p>
<style>
.perc {
width:300px;
border:2px solid blue;
padding:1px;
}
.perc_in {
background:#4fb1ba;
}
</style>
<table>
<thead><tr><th>Activity</th><th>Progress</th></tr></thead>
<tbody>
<tr><td>Anatomical heart</td>
<td><div class="perc"><div class="perc_in" style="width:45%">45%</div></div></td></tr>
<tr><td>Tree structure (small)</td>
<td><div class="perc"><div class="perc_in" style="width:100%">100%</div></div></td></tr>
<tr><td>Heart rate sensor</td>
<td><div class="perc"><div class="perc_in" style="width:90%">90%</div></div></td></tr>
<tr><td>Tree & heart lights</td>
<td><div class="perc"><div class="perc_in" style="width:90%">90%</div></div></td></tr>
<tr><td>RNG, Web API & app</td>
<td><div class="perc"><div class="perc_in" style="width:5%">5%</div></div></td></tr>
<thead><tr><th>Optional</th><th>Progress</th></tr></thead>
<tr><td>Heart pressure switch</td>
<td><div class="perc"><div class="perc_in" style="width:1%">0%</div></div></td></tr>
<tr><td>Heartbeat sound</td>
<td><div class="perc"><div class="perc_in" style="width:5%">5%</div></div></td></tr>
<tr><td>Tree structure (big)</td>
<td><div class="perc"><div class="perc_in" style="width:5%">5%</div></div></td></tr>
</tbody>
</table>
<p>See more details in <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/06/02/week18-invention-intellectual-property-and-income.html">future steps and dissemination plan</a> page.</p>Ilias Bartoliniilias.bartolini@gmail.comMy final project is an interactive installation: Privacy Seed. “WHAT DO YOU LOVE AND HOPE TO PROTECT FROM DIGITAL MASS SURVEILLANCE AND EROSION OF PRIVACY?” Note: Work in progress - I will keep updating this page with a summary of the Fab Academy final project.Week 18: Invention, intellectual property, and income2018-06-02T22:01:53+00:002018-06-02T22:01:53+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/06/02/week18-invention-intellectual-property-and-income<p>This week we followed the <a href="http://academy.cba.mit.edu/classes/invention_IP_business/index.html">invention, intellectual property, and income class</a>
(see video <a href="https://vimeo.com/272969759">here</a>)</p>
<p>This page is about the individual assignment and exploring licensing and a dissemination plan for my final project.
<!--more--></p>
<h2 id="dissemination-plan">Dissemination plan</h2>
<p>Thinking about how to make my project more visible it came to mind that… I need a logo! :D</p>
<h3 id="building-a-logo">Building a logo</h3>
<p>So before doing that I did a quick search…</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_6.1_Search_inspiration_logo.png.jpg" alt="Screenshot_6.1_Search_inspiration_logo.png" /></p>
<p>…which inspired a sketch based on those inspirations</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_6.2_Logo_sketch.jpg.jpg" alt="IMG_6.2_Logo_sketch.jpg" /></p>
<p>So while I was starting inkscape to make a digital version of it… I suddenlty realised I could reuse the KiCAD board desing for my <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/04/30/project-heart-rate-sensor.html#heart-rate-sensor-test-device-3nd-try-">heart sensor</a> to easily build it!</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_3.1_heart_sensor_simplified.png.jpg" alt="Screenshot_3.1_heart_sensor_simplified" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_6.3_KiCAD_logo_design.png.jpg" alt="Screenshot_6.3_KiCAD_logo_design.png" /></p>
<p>And was extremely easy to do so and have it exported to .svg for modifications.</p>
<h3 id="building-a-slide-presentation">Building a slide presentation</h3>
<p>For this I used inkscape and here the final result!</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/presentation.png" alt="Digita_Heartbeat_Tree_Presentation_Slide" /></p>
<h3 id="building-a-short-video">Building a short video</h3>
<p>I used for editing my video <a href="https://www.apple.com/final-cut-pro/">Final Cut Pro</a>. I was hoping to try <a href="https://kdenlive.org/en/">Kdenlive</a> but had no time in the end.</p>
<p>Many of th images and short video fragments are just pictures taken with my phone during this last weeks.<br />
I added as sound background the heartbeat sound effect from <a href="https://freesound.org/people/patobottos/sounds/369017/">Patobottos on Freesound</a> - (CC-0 license)</p>
<p>After a first cut I decided to re-edit the video reducing the title and making faster transitions.</p>
<video style="object-fit: initial; width: 640px; height: 360px;" id="presentation" src="/2018/labs/barcelona/students/ilias-bartolini/presentation.mp4" controls=""></video>
<p>Next steps and improvements are:</p>
<ul>
<li>Adding final credits</li>
<li>Improving logo quality</li>
<li>Create a separate video for participant users (not makers)</li>
<li>Shoot and add better quality footage</li>
<li>Record reactions from participants</li>
<li>Future versions will be shared on social media sites</li>
</ul>
<h3 id="where-to-exhibit-it">Where to exhibit it?</h3>
<p>I plan to bring my installation to public spaces and art&technology conferences where it could be used exhibited:</p>
<ol>
<li>Makerfarie Barcelona: the event is on 16-17 June… too soon! O_O …I made a submission but I plan to use that mainly for bringing a beta small size version and get feedback.</li>
<li>FAB14 in Tolouse: the event is in July, by then I should be able to have a “big” size version but I have to plan the transport of the structure.</li>
<li>Other events that might be interested: THK (August, Tarnac), CCC (December, Leipzig), Internet Freedom Festival (March, Valencia), IAM (April, Barcelona).</li>
</ol>
<p>There are also possible permanent locations for the tree to be hosted where I already have connections: ThoughtWorks, IAAC/FabLab …and other art and tech spaces in Barcelona that I could reach out to.</p>
<h3 id="how-to-make-it-viral">How to make it viral?</h3>
<p>In these event if necessary is useful to build a bit of PR around the installation and add elements that sould make it shareable on social media: eg. create unique URLs of your personal interaction visualization, hastags, invite funny ways for people to share, etc…</p>
<p>A second option is about focusing on the aspect of creating a simple visual way to aggregate random data coming from different sources on a common service.<br />
This would be more of a visual experiment and allow to others that want to create a random number generator that is seeded by intimate data of human interactions to publish it on the same platform.<br />
A cool common name and an attractive visualization would be the trigger to expand its reachability…<br />
Think something like like: <em>wouldn’t you love to have on your screensaver a random visualization based on the heartbeat or random strangers around the world!</em></p>
<p>Finally I’ve been thinking to insert this installation in a “meta-ribbon-tree” lager project. In this context to create a link with the <a href="http://www.theclimateribbon.org/">Climate Ribbon</a> project and start a series of multiple ribbon trees projects touching different social justice issues.<br />
The “ribbons tree” could also become a module to contribute to the <a href="http://beautifultrouble.org/all-modules/">Beautiful Trouble</a> toolbox of creative artivism tactics.<br />
This could encourage other designers, artists and activists to “remix” the idea to bring visibility to their causes.</p>
<h2 id="licensing">Licensing</h2>
<p>Licensing should allow remix of the work for future adaptations that are described above.</p>
<p>Code:</p>
<ul>
<li><a href="https://opensource.org/licenses/GPL-3.0.html">GPL</a>:<br />
In line with Debian and Linux codebase. This would be necessary in case I decide to reuse part in the RNG implementation from the linux kernel. It still I don’t have a final solution on this aspect but I believe is unlikely. Adopting this license will force people to publish future changes back to the community when the software is distributed (which is also unlikely).</li>
<li><a href="https://opensource.org/licenses/AGPL-3.0.html">AGPL</a>:<br />
The variant of AGPL over the GPL is interesting in the case I’m going to build an external service that aggregates data coming from multiple tree developed by others. AGPL is similar to GPL but designed for the case of network server software. The ensures that in case code is modified and deployed as a public service, the modified source code becomes available to the community.</li>
<li><a href="https://opensource.org/licenses/MIT">MIT</a>: <br />
This would require my code to be distributed separately from any dependency on the linux RNG or the Raspberry Pi distribution which is the most likely and simple case anyway. The advantage is to leave more ample and simple possibility of reuse of my code. Who wants to use it has probably to setup and download their Raspbian version independently.</li>
</ul>
<p>For other digital artifacts:</p>
<ul>
<li><a href="http://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA</a>:<br />
This would be in line with the adoption of the [A]GPL above. BTW is already how I initially decided to license the this documentation site content. This requires people to keep the licence if they do derivative works.<br />
For the heart object anyway I have to use this license to be compatible with the original CC-BY-SA <a href="https://www.thingiverse.com/thing:693895">file</a> used by the initial author.</li>
<li><a href="http://creativecommons.org/licenses/by/4.0/">CC-BY</a>: Less restrictive and in line with the adoption of the MIT above. Usually a good starting point if you want to just be credited for the work.</li>
</ul>
<p>Why not the CC NonCommercial? The NonCommercial clause hase been in various cases a debated interpretation and at times reduced the possibility of a piece or work to be disseminated and reused. <br />
At the moment I don’t plan to make any money out of this but I don’t care if others do.</p>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the invention, intellectual property, and income class (see video here) This page is about the individual assignment and exploring licensing and a dissemination plan for my final project.Lights and sound control2018-05-29T17:03:55+00:002018-05-29T17:03:55+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/29/project-lights-and-sound-control<p>In this page I’m going to show the design and creation of lights and sound control system for the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/03/23/project-privacy-seed.html">Privacy Seed</a> project.
<!--more--></p>
<ul id="markdown-toc">
<li><a href="#lights" id="markdown-toc-lights">Lights</a> <ul>
<li><a href="#dotstar-led-strip-test" id="markdown-toc-dotstar-led-strip-test">DotStar LED strip test</a></li>
<li><a href="#more-color-patterns" id="markdown-toc-more-color-patterns">More color patterns</a></li>
<li><a href="#dotstar-driver-board" id="markdown-toc-dotstar-driver-board">DotStar driver board</a></li>
<li><a href="#dotstar-driver-with-fastled" id="markdown-toc-dotstar-driver-with-fastled">DotStar driver with FastLED</a></li>
</ul>
</li>
<li><a href="#sound" id="markdown-toc-sound">Sound</a></li>
<li><a href="#lessons-learned" id="markdown-toc-lessons-learned">Lessons learned</a></li>
<li><a href="#next-steps" id="markdown-toc-next-steps">Next steps</a></li>
</ul>
<h2 id="lights">Lights</h2>
<p>One of the open questions about lighting the structure was about how to drive large number of RGB LED.</p>
<p>I investigated different options like <a href="https://www.maximintegrated.com/en/app-notes/index.mvp/id/1880">Charlieplexing</a> of custom built LED arrays, existing boards and different type of LED strips.</p>
<p>I ended up choosing the AdaFruit <a href="https://learn.adafruit.com/adafruit-dotstar-leds">DotStar</a> LED strips</p>
<p>DotStar LEDs are 5050-sized LEDs with an embedded microcontroller inside each LED. The PWM is built into each LED-chip so once you set the color you can stop talking to the strip and it will continue to PWM all the LEDs.
These LEDs have 2 wires for sending data (clock pin and data pin acting like an SPI interface) making the timing control easier for any microcontroller.</p>
<h3 id="dotstar-led-strip-test">DotStar LED strip test</h3>
<p>As a first test of a small strip I wanted to understand how to simply interface with the strip using an Arduino board.<br />
I took advange of the AdaFruit-DotStar library for Arduino and modified an existing small example.</p>
<p>Things to keep in mind:</p>
<ol>
<li>I had mistaken the pins with the SDA/SCL pins for the I2C protocol! :)</li>
<li>Different pixel version come with different order of the RGB bytes. That need to be configured with the eg. DOTSTAR_BGR initialization parameter.</li>
</ol>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#include <Adafruit_DotStar.h>
#define RED 0xFF0000
#define GREEN 0x00FF00
#define BLUE 0x0000FF
#define ON 0xFFFFFF
#define OFF 0x000000
#define DATA_PIN 4
#define CLOCK_PIN 5
#define NUM_PIXELS 5 // Number of LEDs in strip
Adafruit_DotStar strip = Adafruit_DotStar(NUM_PIXELS, DATA_PIN, CLOCK_PIN, DOTSTAR_BGR);
void setup() {
strip.begin();
strip.show();
}
int headIndex = 0;
void loop() {
strip.setPixelColor((headIndex) % NUM_PIXELS, RED);
strip.setPixelColor((headIndex - 1) % NUM_PIXELS, GREEN);
strip.setPixelColor((headIndex - 2) % NUM_PIXELS, BLUE);
strip.setPixelColor((headIndex - 3) % NUM_PIXELS, ON);
strip.setPixelColor((headIndex - 4) % NUM_PIXELS, OFF);
strip.show();
headIndex++;
delay(200);
}
</code></pre></div></div>
<p>Here is the first successful result! :)</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/Rv9bciBAUR0?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<p>From this test I verified the current requirements of the strip.
Up to 60mA for ‘on’ pixels, and 10mA for ‘off’ pixels (5V). We should be able to power with one 2A source a long strip from the bottom to top of the structure. Longer strips tend to have a brown-out effect and require a power tap.</p>
<p>Here an example of a 5 meter strip brown-out effect:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.20_tree_lights_brown_out.jpg.jpg" alt="IMG_5.20_tree_lights_brown_out" /></p>
<p>2-3 meter long strips from the bottom to top of the structure should be still OK.</p>
<p>On a 5 meter strip (145 pixels) I managed to drive from an Arduino leonardo power supply pins the following amount of pixels:</p>
<ul>
<li>20 white pixles</li>
<li>40 red pixels</li>
<li>140 blue pixels</li>
<li>140 green pixels
Therefore red pixels are the ones absorbing most power.</li>
</ul>
<p>On the same 5 meter strip (145 pixels) I managed to drive with an external power supply the entire strip (consuming 1.44A) but with a very visible browning effect.
Note that in this case both the arduino and the strip need to be powered from the same power supply.</p>
<p>On the 5m strip to make the browning effect non visible no more than 30 pixels should be ON. The browning effect deteriorates when increasing the leghth of the strip, how many pixels are ON, how far from the first pixel the ON ones are.</p>
<h3 id="more-color-patterns">More color patterns</h3>
<p>Random colouring (using the Arduino RNG)</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>for (int i = 0; i < NUM_PIXELS; i++){
if (random(NUM_PIXELS) < NUM_PIXELS/10){
strip.setPixelColor(i, random(0xFFFFFF));
} else {
strip.setPixelColor(i, OFF);
}
}
strip.show();
</code></pre></div></div>
<h3 id="dotstar-driver-board">DotStar driver board</h3>
<p>At this stage I wanted to create my own board based on ATTiny84A to control the DotStar LED strip.</p>
<p>I designed the board to be able to control two independent DotStar LED strips (via pins 2-3 and 5-6) and to be reachable as an I2C slave.</p>
<p>The idea in the future is that many of these board can control separate LED strips. The communication on the I2C bus is limited to the heart rate or very few additional information, while this board does the number crunching necessary to address hundreds of LED and draw light patterns and animations.</p>
<p>Here is the board schema, pcb and final result</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.21_dotstar_driver_board_schema.png.jpg" alt="Screenshot_5.21_dotstar_driver_board_schema" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.22_dotstar_driver_board_pcb.png.jpg" alt="Screenshot_5.22_dotstar_driver_board_pcb" /></p>
<p>And the stuffed board</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.23_dotstar_driver_board_stuffed.jpg.jpg" alt="IMG_5.23_dotstar_driver_board_stuffed" /></p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/dotstar_driver_board.zip">Download KiCAD project and GCode for Dot* driver board</a> (.zip archive: KiCAD project, .png and .rml files)</p>
<h3 id="dotstar-driver-with-fastled">DotStar driver with FastLED</h3>
<p>TODO: DOCUMENT CODE …</p>
<h2 id="sound">Sound</h2>
<p>I haven’t done much progress on the sounde generation but I started investigeanting the sound properties of an heartbeat.</p>
<p>This diagrams show which hart movements are generating the sounds and which “shape” and time difference they have.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.40_Heart_EGC_and_sound.png.jpg" alt="IMG_5.40_Heart_EGC_and_sound" /></p>
<p>This diagam shows a spectral analysis of the heartbeat sound. It is important to notice that all sounds are low-frequency: 50 - 512 Hz. A bigger speaker than the one we have in the inventory is necessary to have an hi-fidelity immersive sound reproduction.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.41_Heart_sound_spectrum.png.jpg" alt="IMG_5.41_Heart_sound_spectrum" /></p>
<p>I foresee that to be able to work with a sound amplifier and generate algorithmically a sound wave will take quite a bit of time.<br />
I will likely postpone this part of the project.</p>
<h2 id="lessons-learned">Lessons learned</h2>
<ol>
<li>The DotStart strips are very easy to use with a dedicated library but the power consumption has to be well estimeted</li>
</ol>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Try the FastLED library - http://fastled.io/</li>
<li>Performance: How many DotStar LEDs can I control from a single ATTiny or RaspberryPI ? At what refresh speed? Driving how many pins in parallel?</li>
<li>Can I use <a href="https://www.tapecase.com/pd/cn/tapes-die-cuts/1034/1000756/3m-1245-embossed-copper-foil-nonconductive-acrylic-adhesive-linered.aspx">conductive tape</a> to connect LED strips cables?</li>
<li>Integrating lights in the structure</li>
<li>Generate a heartbeat sound</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comIn this page I’m going to show the design and creation of lights and sound control system for the Privacy Seed project.Tree structure2018-05-28T22:12:41+00:002018-05-28T22:12:41+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/28/project-tree-structure<p>In this page I’m going to show the design and creation of the tree structure and lightning for the <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/03/23/project-privacy-seed.html">Privacy Seed</a> project.
<!--more--></p>
<ul id="markdown-toc">
<li><a href="#structure" id="markdown-toc-structure">Structure</a> <ul>
<li><a href="#sketching" id="markdown-toc-sketching">Sketching</a></li>
<li><a href="#first-cardboard-prototype-small-scale" id="markdown-toc-first-cardboard-prototype-small-scale">First cardboard prototype (small scale)</a></li>
<li><a href="#second-plywood-prototype-small-scale" id="markdown-toc-second-plywood-prototype-small-scale">Second plywood prototype (small scale)</a></li>
<li><a href="#wood-structure-large" id="markdown-toc-wood-structure-large">Wood structure (large)</a></li>
</ul>
</li>
<li><a href="#next-steps" id="markdown-toc-next-steps">Next steps</a></li>
</ul>
<h2 id="structure">Structure</h2>
<h3 id="sketching">Sketching</h3>
<p>During the CNC milling week I started sketching a simplified version of how the tree structure could be built:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_sketch_0.jpg.jpg" alt="IMG_2_tree_sketch_0" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_sketch_2.jpg.jpg" alt="IMG_2_tree_sketch_2" /></p>
<p>Here are some details of the traces carved on the tree trunk:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_sketch_1.jpg.jpg" alt="IMG_2_tree_sketch_1" /></p>
<p>I also built a 3D model that could be built for testing on smaller scale
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_2_simplified_tree.png.jpg" alt="Screenshot_2_simplified_tree" /></p>
<p>I decided to created a small scale cardboard prototype (< 1m height) and then to think about a large scale wood one (< 2m height).</p>
<h3 id="first-cardboard-prototype-small-scale">First cardboard prototype (small scale)</h3>
<p>I then decided to refine my structure to create a model to laser cut a first prototype:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.1_tree_structure.png.jpg" alt="Screenshot_5.1_tree_structure" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.2_tree_structure_for_laser_cut.png.jpg" alt="Screenshot_5.2_tree_structure_for_laser_cut" /></p>
<p>I struggled a bit finding correct values for cardboard … :) :( … then I ended up with some failed cuts and these values for next time:</p>
<table>
<thead>
<tr>
<th>Power</th>
<th>Speed</th>
<th>PPI/Hz</th>
</tr>
</thead>
<tbody>
<tr>
<td>100</td>
<td>2</td>
<td>1000</td>
</tr>
</tbody>
</table>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.3_tree_structure_prototype.jpg.jpg" alt="IMG_5.3_tree_structure_prototype" /></p>
<p>By looking at this first prototype I came up with few improvements to do:</p>
<ol>
<li>In the top pressfit part: reduce the circle radius, create easier to fit shapes, make the trunk shape join precisely the circle.</li>
<li>In the base element: create a 2 layers base and hide the trunk bottom part under it</li>
<li>Increase the differences between the branches shapes</li>
<li>Two possible solutions to test how to connect the heart shape: hold in one of the trunk element or hanging from top</li>
</ol>
<h3 id="second-plywood-prototype-small-scale">Second plywood prototype (small scale)</h3>
<p>Before the final presentation I built a new version of the tree structure with 3mm plywood material.
This structure is ment to be a 1:5 scale of the final version.</p>
<p>I incorporated in the design the improvements from the first prototype and laser cut the plywood with the same settings used in <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/02/13/2018-02-13-week3-computer-controlled-cutting.html">week3</a>).</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/Screenshot_5.9_Tree_structure_improvements.png.jpg" alt="Screenshot_5.9_Tree_structure_improvements" /></p>
<p>In the interest of time I cut 7 identical trunk shapes while in the previous one I had 3+4 different arrangement on the banches on each.<br />
Also to speed up the process I thought to not include the kerf tolerance for the pressfit to have a structure that is easy to mount: Later I regretted this choice because my structure was easily falling apart :)</p>
<p>Here is the result:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.10_Tree_wood_small_structure.jpg.jpg" alt="IMG_5.10_Tree_wood_small_structure" /></p>
<p>The detail of the top circle that will support the led strip and will be covered to hide some cables.<br />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.11_Tree_wood_small_structure_cables_detail.jpg.jpg" alt="IMG_5.11_Tree_wood_small_structure_cables_detail" /></p>
<p>The detail of the bottom plate with a slot to hold the led strip.<br />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.12_Tree_wood_small_structure_led_detail.jpg.jpg" alt="IMG_5.12_Tree_wood_small_structure_led_detail" /></p>
<p>The final structure all together with the heart hanging in the middle.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_5.13_Tree_wood_small_structure_all_together.jpg.jpg" alt="IMG_5.13_Tree_wood_small_structure_all_together" /></p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/tree_structure.zip">Download models for the tree structure</a> (.zip archive: SolidWorks, STL and Rhino files)</p>
<h3 id="wood-structure-large">Wood structure (large)</h3>
<p>Changes to incorporate:</p>
<ul>
<li>LED strip lights on the trunk</li>
<li>Design a more solid base</li>
<li>Reinforce structure against vertical axis rotation</li>
<li>Think a system for easy assembly</li>
</ul>
<p>…WORK IN PROGRESS…</p>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Design and mill a big wood structure with improvements</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comIn this page I’m going to show the design and creation of the tree structure and lightning for the Privacy Seed project.Week 17: Project applications and implications2018-05-27T10:47:39+00:002018-05-27T10:47:39+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/27/week17-applications-and-implications<p>This week we followed the <a href="http://academy.cba.mit.edu/classes/applications_implications/index.html">applications and implications class</a>
(see video <a href="https://vimeo.com/272007103">here</a>)</p>
<p>This page is about the individual assignment and exploring some aspecs of my final project.
<!--more--></p>
<h3 id="what-will-it-do">What will it do?</h3>
<p>My final project is “Privacy Seed” a digital tree seeded by your heartbeat.</p>
<p>“Privacy Seed” is artistic installation to challenge the intersections of personal data and privacy, of natural and digital worlds.</p>
<p>A tree structure holds at its center an anatomical heart object with an heartbeat sensor.
By holding this heart in their hands the participants start interacting with the tree lights and sounds.
The participants’ heartbeat signal then will “seed” a secure digital random number generator that publishes its results to the web.</p>
<h3 id="whos-done-what-beforehand">Who’s done what beforehand?</h3>
<p>The tree structure comes from the <a href="http://www.theclimateribbon.org/the-climate-ribbon/2016/1/19/dispatch-4-the-story-of-the-trees-in-paris">Climate Ribbon’s tree</a> project at COP21 in Paris:<br />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_ribbons_tree.jpg.jpg" alt="IMG_2_tree_ribbons_tree" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/project/resized/IMG_2_tree_ribbons_tree_people.jpg.jpg" alt="IMG_2_tree_ribbons_tree_people" />
<small>Pictures from <a href="http://www.theclimateribbon.org/the-climate-ribbon/2016/1/19/dispatch-4-the-story-of-the-trees-in-paris">The Climate Ribbons</a> project</small></p>
<p>The heartbeat sensor come in various previous examples</p>
<ul>
<li><a href="https://morf.lv/implementing-pulse-oximeter-using-max30100">Implementing pulse oximeter</a> by Raivis Strogonovs</li>
<li><a href="https://learn.sparkfun.com/tutorials/max30105-particle-and-pulse-ox-sensor-hookup-guide">Particle and Pulse Ox Sensor</a> by SparkFun</li>
</ul>
<h3 id="what-will-you-design">What will you design?</h3>
<ul>
<li>Tree structure</li>
<li>Anatomical heart object</li>
<li>Heart rate sensor with microcontroller</li>
<li>Tree & heart output lights and sound system</li>
<li>RNG, Web API & pages</li>
</ul>
<h3 id="what-materials-and-components-will-be-used-where-will-come-from-how-much-will-they-cost">What materials and components will be used? Where will come from? How much will they cost?</h3>
<p><strong>Tree structure</strong></p>
<table>
<thead>
<tr>
<th>Material</th>
<th>Quantity</th>
<th>Supplier</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cardboard (small structure)</td>
<td>100x80cm, 3mm thickness</td>
<td> </td>
<td>?</td>
</tr>
<tr>
<td>Wood (large structure)</td>
<td>2.5x1,5m, 1.5cm thickness (8x)</td>
<td> </td>
<td>?</td>
</tr>
<tr>
<td>Rope</td>
<td>5m</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Silk ribbons</td>
<td>5m, green & various colours</td>
<td> </td>
<td>€12</td>
</tr>
</tbody>
</table>
<p><strong>Anatomical heart object</strong></p>
<table>
<thead>
<tr>
<th>Material</th>
<th>Quantity</th>
<th>Supplier</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<tr>
<td>PLA for 3D printing</td>
<td> </td>
<td>?</td>
<td> </td>
</tr>
<tr>
<td>Smooth-On XTC-3D finishing</td>
<td>30g</td>
<td> </td>
<td>$1</td>
</tr>
<tr>
<td>Smooth-On Mold Star 30 rubber (mould)</td>
<td>1kg</td>
<td> </td>
<td>$60</td>
</tr>
<tr>
<td>Smooth-On SORTA-Clear 37 rubber (cast)</td>
<td>1kg</td>
<td> </td>
<td>$40</td>
</tr>
</tbody>
</table>
<p><strong>PCB with SMD components</strong></p>
<table>
<thead>
<tr>
<th>Material</th>
<th>Quantity</th>
<th>Supplier</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<tr>
<td>MAX30101 heartrate sensor</td>
<td>2</td>
<td>DigiKey</td>
<td>$8</td>
</tr>
<tr>
<td>AVR microcontroller for the heart sensor & lights</td>
<td>1</td>
<td>DigiKey</td>
<td>$2</td>
</tr>
<tr>
<td>PCB and other SMD components</td>
<td> </td>
<td>DigiKey</td>
<td>$5</td>
</tr>
</tbody>
</table>
<p><strong>Tree & heart outputs</strong></p>
<table>
<thead>
<tr>
<th>Material</th>
<th>Quantity</th>
<th>Supplier</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<tr>
<td>DotStar led strip</td>
<td>5m, 30 LED/m</td>
<td>AdaFruit</td>
<td>$100</td>
</tr>
<tr>
<td>10A 5V DC power supply</td>
<td>1</td>
<td>Amazon</td>
<td>€20</td>
</tr>
</tbody>
</table>
<!-- Female DC Power adapter - 2.1mm jack to screw terminal https://www.adafruit.com/product/368 -->
<!-- 2-pin JST SM Plug + cable set https://www.adafruit.com/product/2880 -->
<!-- | Speaker | 1 | local supplier | $15 | -->
<p><strong>RNG, Web API & pages</strong></p>
<table>
<thead>
<tr>
<th>Material</th>
<th>Quantity</th>
<th>Supplier</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<tr>
<td>Raspberry PI zero</td>
<td>1</td>
<td>local supplier</td>
<td>$10</td>
</tr>
<tr>
<td>AWS EC2 instance</td>
<td>1</td>
<td>amazon</td>
<td>$5/month</td>
</tr>
</tbody>
</table>
<h3 id="what-parts-and-systems-will-be-made--what-processes-will-be-used">What parts and systems will be made? What processes will be used?</h3>
<ul>
<li>Tree structure
<ul>
<li>Laser cutting (small)</li>
<li>CNC milling (large)</li>
</ul>
</li>
<li>Anatomical heart object
<ul>
<li>3D printing (1st test)</li>
<li>Moulding and casting (2nd test)</li>
</ul>
</li>
<li>Electronics
<ul>
<li>PCB milling and soldering</li>
<li>Embedded programming</li>
</ul>
</li>
<li>Application interface
<ul>
<li>Website build with Node.js</li>
</ul>
</li>
</ul>
<h3 id="what-questions-need-to-be-answered">What questions need to be answered?</h3>
<ul>
<li>How to build a functioning heartrate sensor</li>
<li>What is best process to create the anatomic heart object</li>
<li>How to compose the lights on the tree</li>
<li>How to better control large numbers of LED lights</li>
<li>How to syntesize an heartbeat sound at different frequencies</li>
</ul>
<h3 id="how-will-it-be-evaluated">How will it be evaluated?</h3>
<p>As an ART project the main outcome comes from the qualitative experiences and responses from the visitors of the exhibition</p>
<ol>
<li>The interactions with the objects create an interactive experience for the visitors</li>
<li>Quality of the finishing of the objects to create an immersive experience</li>
<li>Exhibition gets hosted in more than 2 international art and technology conferences (eg. FABx, CCC, Internet Freedom Festival, etc.)</li>
<li>The tree structure gets replicated by others in more locations</li>
</ol>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the applications and implications class (see video here) This page is about the individual assignment and exploring some aspecs of my final project.Week 16: Soft robotics (wildcard week)2018-05-22T00:07:39+00:002018-05-22T00:07:39+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/22/week16-soft-robotics-wildcard-week<p>This week we followed the <a href="http://academy.cba.mit.edu/classes/composites/index.html">composites class</a> as part of the <a href="http://academy.cba.mit.edu/classes/wildcard/index.html">wildcard week</a>. You can see video <a href="https://vimeo.com/270980582">here</a>.</p>
<p>I decided in this week to touch the topic of <a href="https://en.wikipedia.org/wiki/Soft_robotics">soft robotics</a> trying to build some basic inflatable deformable structures the beginner way (…still far away to make soft robots).
<!--more--></p>
<h2 id="simple-design">Simple design</h2>
<p>An easy way to create inflatable structure is to alternate vinyl sheets with baking paper. By heating them, the vinyl sheets will stick to each other leaving a chamber in the surface occupied by the baking paper.</p>
<p>We used foe the initial tests a <a href="http://www.happyfabric.co.uk/equipment/transfer-presses/happypress.html">Happy Press</a> heat transfer press from Happy Fabric.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_00_happy_press.jpg.jpg" alt="IMG_00_happy_press" /></p>
<p>The material that we choose is made of PU+PET sheets.<br />
<a href="https://en.wikipedia.org/wiki/Polyurethane">PU</a> (or polyurethane) is a polymer used in many applications. It will give to our material a “fake leather” look. The PU film is the part that is going to adhere to the application surface when heated.
<a href="https://en.wikipedia.org/wiki/Polyethylene_terephthalate">PET</a> (or polyethylene) is the support layer that will be peeled away after heat-pressing the material.</p>
<p>The leaflet below summarises all the characteristics of this material:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_00b_material_spec.jpg.jpg" alt="IMG_00b_material_spec" /></p>
<p>Using the control on the Happy press we can set the temperature required for our material 150-160 deg (for around 10-15sec).</p>
<p>The first test I did was to check how a saw type of structure bends and test the use of the material.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_01_initial_test_structure.jpg.jpg" alt="IMG_01_initial_test_structure" /></p>
<p>Unfortunately using a single sheet of vinyl fabric is leaking air. Folding the same sheet of material causes bends along which air tend to leak.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_02_initial_test_leak.jpg.jpg" alt="IMG_02_initial_test_leak" /></p>
<p>I created a new simple examples just to test the sealing.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_03a_second_simple_test.jpg.jpg" alt="IMG_03a_second_simple_test" /><br />
And it works! :)
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_03b_second_simple_test.jpg.jpg" alt="IMG_03b_second_simple_test" /></p>
<h2 id="multiple-layers-folds">Multiple layers folds</h2>
<p>As a second test I wanted to create a structure with holes created by overlapping 4 sheets of vinyl material (and two of baking paper)
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_05_multilayer_structure.jpg.jpg" alt="IMG_05_multilayer_structure" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_06_multilayer_structure_pressed.jpg.jpg" alt="IMG_06_multilayer_structure_pressed" /></p>
<p>After presssing I unfortunately relaised that becomes almost impossible removing the vinyl support material from the iternal parts of the holes.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_07_unfolding_problem.jpg.jpg" alt="IMG_07_unfolding_problem" /></p>
<h2 id="circle-structure">Circle structure</h2>
<p>Finally I wanted to create a structure that could be used to grap objects like a circle that changed diameter.<br />
I designed for this purpose the following structure.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_10_circle_structure.jpg.jpg" alt="IMG_10_circle_structure" /></p>
<p>The inflatable at rest
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_11_circle_at_rest.jpg.jpg" alt="IMG_11_circle_at_rest" />
…and under pressure! :)
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_12_circle_compressed.jpg.jpg" alt="IMG_12_circle_compressed" /></p>
<p>You can notice that the internal circle has a smaller diameter and can be used to grab light objects,</p>
<h3 id="model">Model</h3>
<p>I designed the model in inkscape to be used with a laser cutter machine.</p>
<p>The design was easy to make combining circles and triangles and rotating them by +45 degrees.<br />
After overlapping them accordingly we can transform objects to paths and use Path->Union and Path->Difference until we get a single contiuous path.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/Screenshot_13_inflatable_structure.png.jpg" alt="Screenshot_13_inflatable_structure" /></p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/inflatables.zip">Download .svg file</a> (.zip archive)</p>
<p>We then just import the .svg files in Rhino for processing them with the laser cutter machine.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/Screenshot_14_inflatable_to_laser_cut.png.jpg" alt="Screenshot_14_inflatable_to_laser_cut" /></p>
<p>The materials can be used in a laser cutter with the following settings:</p>
<p>Baking paper:</p>
<table>
<thead>
<tr>
<th>Power</th>
<th>Speed</th>
<th>PPI/Hz</th>
</tr>
</thead>
<tbody>
<tr>
<td>6</td>
<td>0.9</td>
<td>1000</td>
</tr>
</tbody>
</table>
<p>Vinyl:</p>
<table>
<thead>
<tr>
<th>Power</th>
<th>Speed</th>
<th>PPI/Hz</th>
</tr>
</thead>
<tbody>
<tr>
<td>20</td>
<td>0.9</td>
<td>1000</td>
</tr>
</tbody>
</table>
<p>The baking paper was hard to cut because it tends to bend and wrinkle when heated. The paper was also too light and easily blown away by the laser cutter air aspirator: I decided to turn it off for this specific cut.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_15_lasercut_baking_paper.jpg.jpg" alt="IMG_15_lasercut_baking_paper" /></p>
<p>The vinyl cut was easier, I I realised I had made a design dimension error and had to do it twice to get the correct result here:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_16_laser_cut_vinyl.jpg.jpg" alt="IMG_16_laser_cut_vinyl" /></p>
<p>After pressing two sides together in the heat press machine and removing the protection layer here is the result ready to be tested:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week16/resized/IMG_17_inflatable.jpg.jpg" alt="IMG_17_inflatable" /></p>
<p>In the video below you can see the object shape changing when the structure is inflated with a manual pump.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/UpVXinPpxIQ?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<p>Personally I was expecting a bigger effect… not very impressed.<br />
I realised the bigger air chambers are needed to have a bigger effect like on the one I manually cut.</p>
<h2 id="lessons-learned">Lessons learned</h2>
<ol>
<li>Avoid folding the same sheet of material</li>
<li>Avoid multiple layers of fold overlapping the air chamber</li>
<li>Probablyy I have to design the air chanbers bigger to produce bigger displacements</li>
</ol>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Try silicone and fibers based structures combining materials with different elastic characteristics.</li>
<li>Experiment the same structure in dofferent sizes of the circle radius and air chambers diameter to find optimal result.</li>
<li>Work with electronically controlled pumps to inflate the objects</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the composites class as part of the wildcard week. You can see video here. I decided in this week to touch the topic of soft robotics trying to build some basic inflatable deformable structures the beginner way (…still far away to make soft robots).Week 15: Machine design (group assignment)2018-05-14T00:07:39+00:002018-05-14T00:07:39+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/14/week15-machine-design<p>This week we followed the <a href="http://academy.cba.mit.edu/classes/machine_design/index.html">machine design class</a>. You can see video <a href="https://vimeo.com/267903531">here</a>.</p>
<p>For this assignment we decided to build a camera time-lapse dolly! :)<br />
This page is about the 1st part of the process in the group comprised by: <a href="http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/">Ilias Bartolini</a>, <a href="http://fab.academany.org/2018/labs/barcelona/students/marta-bocos/">Marta Bocos</a>, <a href="http://fab.academany.org/2018/labs/barcelona/students/andreluis-pulcinodefreitas/">André Pulcino</a>, <a href="http://archive.fabacademy.org/2018/labs/barcelona/students/oscar-gonzalezfernandez/index.html">Óscar González</a></p>
<!--more-->
<p>In this week I in particular contributed to:</p>
<ul>
<li>Cableing and power source tests</li>
<li>Initial simple control of a step motor and testing it on the machine</li>
<li>Designing and adding the endstop sensors solution (related firmware changes was done by Oscar)</li>
<li>Camera header integration</li>
<li>Final test videos with camera</li>
</ul>
<p>See full the documentation on the <a href="http://barcelonamachines.fabcloud.io/group4/2018/05/08/week14-mechanical-design.html">group website</a>.<br />
Below is part of the documentation for the part that I directly contributed to in my group:</p>
<ul id="markdown-toc">
<li><a href="#using-a-stepper-motor" id="markdown-toc-using-a-stepper-motor">Using a stepper motor</a></li>
<li><a href="#testing-the-motor-on-our-machine" id="markdown-toc-testing-the-motor-on-our-machine">Testing the motor on our machine</a></li>
<li><a href="#adding-endstops" id="markdown-toc-adding-endstops">Adding endstops</a></li>
<li><a href="#final-result" id="markdown-toc-final-result">Final result</a> <ul>
<li><a href="#summary-slide-and-video-" id="markdown-toc-summary-slide-and-video-">Summary slide and video! :)</a></li>
</ul>
</li>
<li><a href="#lessons-learned" id="markdown-toc-lessons-learned">Lessons learned</a></li>
<li><a href="#next-steps" id="markdown-toc-next-steps">Next steps</a></li>
</ul>
<h2 id="using-a-stepper-motor">Using a stepper motor</h2>
<p>First simple example we took ad Arduino CNC shield with a DRV8825 stepper motor driver.</p>
<p>A good introductory guide to have our example working is <a href="https://aconcaguasci.blogspot.com.es/2016/11/arduino-cnc-shield-control-stepper.html">this</a>.</p>
<p>Documentation for the DRV8825 features and pinout is available <a href="https://www.pololu.com/product/2133">here</a>.<br />
Documentation for the Arduino CNC shiled is available <a href="https://blog.protoneer.co.nz/arduino-cnc-shield/">here</a>.</p>
<p>The DRV8825 driver allow for various step resolution which can be configured via the jumpers on the CNC shield:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week15/resized/Screenshot_40_Stepper_motor_resolution.png.jpg" alt="Screenshot_40_Stepper_motor_resolution" /></p>
<p>We picked the higher resolution and then tested with the sample code from the tutorial modified as below:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#define EN 8
//Direction pin
#define X_DIR 5
//Step pin
#define X_STP 2
//DRV8825
int delayTime=3200; //Delay between each pause (uS)
int steps=6400;// Steps to move
void move(boolean dir, byte dirPin, byte stepperPin, int steps)
{
digitalWrite(dirPin, dir);
delay(100);
for (int i = 0; i < steps; i++) {
digitalWrite(stepperPin, HIGH);
delayMicroseconds(delayTime);
digitalWrite(stepperPin, LOW);
delayMicroseconds(delayTime);
}
}
void setup(){
pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);
pinMode(EN, OUTPUT);
digitalWrite(EN, LOW);
}
void loop(){
move(false, X_DIR, X_STP, steps); //X, Clockwise
delay(1000);
move(true, X_DIR, X_STP, steps); //X, Counterclockwise
delay(1000);
</code></pre></div></div>
<p>Here is the result.</p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/Ft-0wG1Wze4?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<h2 id="testing-the-motor-on-our-machine">Testing the motor on our machine</h2>
<p>First of all we had to register the torque/current limit supplied to the motor by the stepper driver.
The DRV8825 has a potentiometer which lets you regulate this setting. Later on I found <a href="https://www.youtube.com/watch?v=89BHS9hfSUk">this useful guide</a> for this process.</p>
<p>After registering the current limit here is the functioning prototype assembled on our machine.</p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/TGHIgeM2Vmw?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<p>A little bit of adjustment was necessary to find the correct steps frequency and belt tension to avoid vibrations but still have a slow movement of the platform.</p>
<h2 id="adding-endstops">Adding endstops</h2>
<p>We started thiking at different ways to add the endstops to the dolly structure and ended up with a simple glue solution :)
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week15/resized/IMG_42_Endstop.jpg.jpg" alt="IMG_42_Endstop" /></p>
<p>Here is the endstop assembled with the machine.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week15/resized/IMG_43_Endstop_assembled.jpg.jpg" alt="IMG_43_Endstop_assembled" /></p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/-FABiRmL9Bs?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<h2 id="final-result">Final result</h2>
<p>And now! The final result of our work!</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week15/resized/IMG_50_Final_assembled_slider.jpg.jpg" alt="IMG_50_Final_assembled_slider" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week15/resized/IMG_51_Final_assembled_slider.jpg.jpg" alt="IMG_51_Final_assembled_slider" /></p>
<p>And here a sample video of our Sloth time-lapse recording!!!<br />
\o/ \o/</p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/8E1p97AanXc?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/ORt4_dDTUxs?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<h3 id="summary-slide-and-video-">Summary slide and video! :)</h3>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/IMG_80_project_summary_slide.jpg" alt="IMG_80_project_summary_slide" /></p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/hj5T4961ZuM?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<h2 id="lessons-learned">Lessons learned</h2>
<ol>
<li>How to drive a stepper motor! :)</li>
<li>When we built our final structure, we made assumptions about the motor and drive mechanism: ideally we should be iterating on the mechanical structure once we learned about the components used.</li>
<li>Driving a single motor is quite easy in code and we do not require a more complex CNC shield for this.</li>
</ol>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Add a speed control potentiometer.</li>
<li>Optimize for battery powered components.</li>
<li>Try smaller 5V stepper motor with gearing: eg. <a href="https://www.adafruit.com/product/858">this</a>.</li>
<li>Try wiring the stepper driver without using the CNC shield.</li>
<li>Design a better enclosure and wiring of the electronic parts.</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the machine design class. You can see video here. For this assignment we decided to build a camera time-lapse dolly! :) This page is about the 1st part of the process in the group comprised by: Ilias Bartolini, Marta Bocos, André Pulcino, Óscar GonzálezWeek 14: Mechanical design (group assignment)2018-05-08T17:31:10+00:002018-05-08T17:31:10+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/08/week14-mechanical-design<p>This week we followed the <a href="http://academy.cba.mit.edu/classes/mechanical_design/index.html">mechanical design class</a>. You can see video <a href="https://vimeo.com/267903531">here</a>.</p>
<p>For this assignment we decided to build a camera time-lapse dolly! :)<br />
This page is about the 1st part of the process in the group comprised by: <a href="http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/">Ilias Bartolini</a>, <a href="http://fab.academany.org/2018/labs/barcelona/students/marta-bocos/">Marta Bocos</a>, <a href="http://fab.academany.org/2018/labs/barcelona/students/andreluis-pulcinodefreitas/">André Pulcino</a>, <a href="http://archive.fabacademy.org/2018/labs/barcelona/students/oscar-gonzalezfernandez/index.html">Óscar González</a></p>
<!--more-->
<p>In this week I in particular contributed to:</p>
<ul>
<li>Initial concept and 2nd iteration design</li>
<li>Creating the laser cut models and wood prototypes</li>
<li>Running the 3d printing process and integrating parts</li>
<li>Structure for the group website documentations</li>
</ul>
<p>See the documentation on the <a href="http://barcelonamachines.fabcloud.io/group4/2018/05/08/week14-mechanical-design.html">group website</a>.<br />
Below is part of the documentation for the part that I directly contributed to in my group:</p>
<ul id="markdown-toc">
<li><a href="#intial-concept" id="markdown-toc-intial-concept">Intial concept</a></li>
<li><a href="#2nd-iteration-design" id="markdown-toc-2nd-iteration-design">2nd Iteration design:</a> <ul>
<li><a href="#laser-cutting-parts" id="markdown-toc-laser-cutting-parts">Laser cutting parts</a></li>
<li><a href="#putting-it-all-together" id="markdown-toc-putting-it-all-together">Putting it all together</a></li>
<li><a href="#structure-for-the-group-website-documentation" id="markdown-toc-structure-for-the-group-website-documentation">Structure for the group website documentation</a></li>
</ul>
</li>
<li><a href="#lessons-learned" id="markdown-toc-lessons-learned">Lessons learned</a></li>
<li><a href="#next-steps" id="markdown-toc-next-steps">Next steps</a></li>
</ul>
<h2 id="intial-concept">Intial concept</h2>
<p>We would like the slider to have at least two controlled axis: (1) an horizontal rail and (2) and vertical camera rotation.</p>
<p>The camera would be placed on a flat plate and be supported by a conventional tripod head, attached to the plate by a screw. The plate would be sliding onto rails or tracks, and this would be moved by a stepper motor at the end of the rails. The rotation along the vertical axis would be done by a second servo motor, initially attached to the plate itself.</p>
<p>After looking at the various sample projects we started sketching together a solution.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_2_Refined_sketch.png.jpg" alt="Screenshot_2_Refined_sketch" /></p>
<p>Below there is an initial list of components:</p>
<ul>
<li>Pipes: steel 8mm available at the lab</li>
<li>Belt + pulleys: 6mm wide belt + pulleys</li>
<li>End supports: to be laser cut with acrylic + 3D printed components</li>
<li>Camera holder (PanaVise): to buy</li>
<li>x1 Stepper motor (rails)</li>
<li>x1 Servo motor (camera rotation)</li>
</ul>
<h2 id="2nd-iteration-design">2nd Iteration design:</h2>
<p>In this section, we will describe the final solution we went for. We took inspiration from the 3D printers mechanical design such as the <a href="https://www.thingiverse.com/thing:2254103">HyperCube Evolution</a> and some other <a href="https://reprapbcn.wordpress.com/">RepRap</a> solutions.</p>
<p>The shafts would be held by the rail ends with this solution, combining 5mm acrylic and 3D printing. We decided to use 3D printed parts to hold in the shafts, making use of the material’s flexibility to tighten in the shaft:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_9a_Sketch_design2.jpg.jpg" alt="Screenshot_9a_Sketch_design2" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_9b_Sketch_design2.jpg.jpg" alt="Screenshot_9b_Sketch_design2" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_9c_Sketch_design2.jpg.jpg" alt="Screenshot_9c_Sketch_design2" /></p>
<p>The plate would be held by a similar solution to <a href="https://www.cgtrader.com/free-3d-print-models/hobby-diy/other/reprap-pen-holder-plotter-extruder">this one</a>. We will be using 4x linear bearings in two separate modules to be attached to the shaft.</p>
<p>Finally, the belt would be pulling from this type of solution, so that we guarantee the belt tightening:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_9d_Sketch_design2.jpg.jpg" alt="Screenshot_9d_Sketch_design2" /></p>
<h4 id="laser-cutting-parts">Laser cutting parts</h4>
<p>We quickly designed few new parts to build a quick prototype of the foot of our machine:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_10_Laser_cut_part.png.jpg" alt="Screenshot_10_Laser_cut_part" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_11_Laser_cut_part.png.jpg" alt="Screenshot_11_Laser_cut_part" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/Screenshot_12_Laser_cut_parts.png.jpg" alt="Screenshot_12_Laser_cut_parts" /></p>
<p>And assembled it in the afternoon to have an idea of how it would look like:</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_13_plywood_prototype.jpg.jpg" alt="IMG_13_plywood_prototype" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_14_plywood_prototype.jpg.jpg" alt="IMG_14_plywood_prototype" />
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_15_plywood_prototype_v1.jpg.jpg" alt="IMG_15_plywood_prototype_v1" /></p>
<p>Quickly prototyping with laser cutting and plywood allowed us to quickly iterate on our design.</p>
<p>First we fixed the motor positioning, the screws holes tolerances, chamfers and dogbones:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_16_plywood_prototype_v3.jpg.jpg" alt="IMG_16_plywood_prototype_v3" /></p>
<p>In a following iteration we increased the support plate width for the motor, added lateral-bottom pressfit parts, increased the dogbones sizes:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_17_plywood_prototype_v4.jpg.jpg" alt="IMG_17_plywood_prototype_v4" /></p>
<p>Finally we fixed the belt hole and a mistake between the bottom support plate width and the new lateral-bottom pressfit parts:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_18_plywood_prototype_v5.jpg.jpg" alt="IMG_18_plywood_prototype_v5" /></p>
<p>The camera support plate also went through a couple of iterations while we designed our 3D printed parts to attach to the pipes and belt:
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_19_plywood_prototype.jpg.jpg" alt="IMG_19_plywood_prototype" /></p>
<p>At this point we were ready for cutting the prototype in acrylic material.</p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/cad_files/LaserCutModels.zip">Download Sources</a> (.zip archive)</p>
<h3 id="putting-it-all-together">Putting it all together</h3>
<p>Pulleys, screws, etc.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_40_Assembling.jpg.jpg" alt="IMG_40_Assembling" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week14/resized/IMG_41_Assembling.jpg.jpg" alt="IMG_41_Assembling" /></p>
<h3 id="structure-for-the-group-website-documentation">Structure for the group website documentation</h3>
<p>For the purpose of building a group documenation website I copied the structure of my personal one that I documented in week 1 <a href="http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/01/26/week1-how-to-build-this-website.html">here</a></p>
<p>I only had to do minor changes:</p>
<ul>
<li>review some of the jekyll basic configuration (eg. the variables <code class="highlighter-rouge">/2018/labs/barcelona/students/ilias-bartolini</code>, etc.)</li>
<li>removed some of the plugins for comments & analitycs (they rely on external services that need to be reconfigured otherwise)</li>
<li>changed the menu bar removing personal links and removing posts categories</li>
<li>changed the page “About me” to “Team” page.</li>
</ul>
<h2 id="lessons-learned">Lessons learned</h2>
<ol>
<li>Visualising things early even with simple sketches gets more important when more people are working together as a team;</li>
<li>For the purpose of the first few prototypes with the laser cutter we could have easily used cardboard instead of plywood;</li>
<li>3D printing process get a lot slower with the volume of the pieces to print and the probability of failure makes it less valuable for quick iterative prototyping;</li>
<li>Mechanical properties of 3D printed material relies upon highly on layer height, printing direction and positioning of the piece on the printing plate;</li>
</ol>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Easy to assemble platform: the clamps opening at the bottom of the platform could be wide enough to allow it to be easily detachable: currently we need to remove the foot.</li>
<li>Improve the belt tensioning mechanism with a screw & bolt that allow an easy regulation.</li>
<li>Check press-fit tolerances and design a way to block the bottom layer of the feet.</li>
<li>Test a different solution with rails instead of pipes to limit the bending of the structure.</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the mechanical design class. You can see video here. For this assignment we decided to build a camera time-lapse dolly! :) This page is about the 1st part of the process in the group comprised by: Ilias Bartolini, Marta Bocos, André Pulcino, Óscar GonzálezWeek 13: Networking and communication2018-05-02T04:36:33+00:002018-05-02T04:36:33+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/02/week13-networking-and-communication<p>This week we followed the Networking and Communication class(http://academy.cba.mit.edu/classes/networking_communications/index.html)
(see video <a href="https://vimeo.com/266680223">here</a>)</p>
<p>This page is about the individual assignment.
<!--more--></p>
<ul id="markdown-toc">
<li><a href="#create-a-i2c-bus" id="markdown-toc-create-a-i2c-bus">Create a I2C bus</a> <ul>
<li><a href="#simple-masterslave-bus" id="markdown-toc-simple-masterslave-bus">Simple master/slave bus</a></li>
<li><a href="#one-master-two-slaves-and-sensor-data-bus" id="markdown-toc-one-master-two-slaves-and-sensor-data-bus">One master, two slaves and sensor data bus</a></li>
<li><a href="#master-slave-communication-between-attiny" id="markdown-toc-master-slave-communication-between-attiny">Master-slave communication between ATtiny</a></li>
</ul>
</li>
<li><a href="#lessons-learned" id="markdown-toc-lessons-learned">Lessons learned</a></li>
<li><a href="#next-steps" id="markdown-toc-next-steps">Next steps</a></li>
</ul>
<p>The production process for all the boards described below followed the same processes documented in <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/03/05/week6-electronics-design.html">week 6</a> (design with KiCAD, .png conversions, using mods) and <a href="/2018/labs/barcelona/students/ilias-bartolini/2018/02/20/week4-electronics-production.html">week 4</a> (electronics production, milling PCB and soldering)</p>
<h2 id="create-a-i2c-bus">Create a I2C bus</h2>
<h3 id="simple-masterslave-bus">Simple master/slave bus</h3>
<p>I had a previous week I already created and debugged a I<sup>2</sup>C connection for the accelerometer sensor with an ATtiny45 and Arduino board.</p>
<!-- For my final project I plan to use an heart rate sensor so I decided to create a test I<sup>2</sup>C bus using an ATtiny45 master, both sensors that I fabricated and a separate ATtiny45 slave that transfer the messages to a serial port to the PC (for debugging). -->
<p>I plan to use the Wire Arduino library for my ATTiny45. Nick Gammon’s blog has an excellent <a href="http://www.gammon.com.au/forum/?id=10896">blog post</a> to document the use of he I<sup>2</sup>C protocol and the Wire library.</p>
<p>I created for this assignment two ATtiny45 boards with just a I2C interface and a serial interface for debugging.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/IMG_0_ATtiny45_I2C_node.jpg.jpg" alt="IMG_0_ATtiny45_I2C_node" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_0_ATtiny45_I2C_node_PCB.png.jpg" alt="Screenshot_0_ATtiny45_I2C_node_PCB" /></p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/i2c_network_node.zip">Download KiCAD project and GCode</a> (.zip archive: KiCAD project, .png and .rml files)</p>
<p>The first example is made of a simple master-slave configuration</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ATtiny45 Arduino Leonardo PC
(I2C master) —————> (I2C slave) =====> (serial)
AVR-libc Arduino lib
</code></pre></div></div>
<p>In this scenario the Arduino slave just forwards some characters to the serial port.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/IMG_2_Simple_I2C_bus.jpg.jpg" alt="IMG_2_Simple_I2C_bus" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_1_Simple_I2C_bus.png.jpg" alt="Screenshot_1_Simple_I2C_bus" /></p>
<p>The slave implementation uses interrupts to receive the data (the interrupts should be as fast as possible to avoid race contitions). Later in the main loop we send the data back via serial port.</p>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/Sources.zip">Download Sources</a> (.zip archive)</p>
<p>It is necessary for the main loop to be faster than the interrupts frequency otherwise we loose some data like in the example below.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_3_Simple_I2C_bus_speed.png.jpg" alt="Screenshot_3_Simple_I2C_bus_speed" /></p>
<h3 id="one-master-two-slaves-and-sensor-data-bus">One master, two slaves and sensor data bus</h3>
<p>In the second example I decided to add a ADXL343 accelerometer on the bus.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ATtiny45 Arduino Leonardo PC
(I2C master) —————> (I2C slave) =====> (serial)
AVR-libc | Arduino lib
|
| ADXL343 Accelerometer
———> (I2C slave)
</code></pre></div></div>
<p>In this scenario the ATtiny carries the task or reading accelerometer data from the sensor and sending them to the Arduino board. Arduino slave just forwards some characters to the serial port.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/IMG_5_I2C_bus_with_accelerometer.jpg.jpg" alt="IMG_5_I2C_bus_with_accelerometer" /></p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_4_I2C_bus_with_accelerometer.png.jpg" alt="Screenshot_4_I2C_bus_with_accelerometer" /></p>
<p>It is important here that the Arduino slave address that we choose <code class="highlighter-rouge">0x2A</code> must be different from the ADXL343 address <code class="highlighter-rouge">0x55</code></p>
<h3 id="master-slave-communication-between-attiny">Master-slave communication between ATtiny</h3>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ATtiny84 ATtiny84 PC
(I2C master) —————> (I2C slave) =====> (serial)
TinyWireM lib TinyWireS lib
</code></pre></div></div>
<p>In this scenario I built a master-slave setup brtween two ATtiny84 boards that I’ve been using for my final project.</p>
<p>The master board is the board that has the role of reading and analysing the heart-rate sensor, the slave board has the role of controlling different light patterns of DotStar LEDs.</p>
<p>I decided to build a simple scenario in which the master board sends an integer value to the slave board as could be an heartrate value.</p>
<p>I stopped using Niel’s I2C C code implementation and to look for other libraries that have a complete implementation of the protocol.<br />
Various on-line documentation is a bit outdated or low quality so it took me a while to get to a working solution.<br />
Only at the end I came to uderstand well this comparison table available <a href="https://github.com/Testato/SoftwareWire/wiki/Arduino-I2C-libraries">here</a></p>
<p>Initially I choose the library <a href="https://github.com/stevemarple/SoftwareWire">SoftwareWire</a> that could allow me to use any pin of the ATtiny but didn’t succed with it.</p>
<p>I also faced the issue of recognising late that pull-up resistors are needed when connecting two ATtiny boards (while they are not necessary when using an Arduino board). I also found <a href="https://electronics.stackexchange.com/questions/23645/how-do-i-calculate-the-required-value-for-a-pull-up-resistor">here</a> and <a href="www.ti.com/lit/an/slva689/slva689.pdf">here</a> some good documentation on how to size correclty pull-up resistors.</p>
<p>I decided in the end to use the dedicated SDA/SCL pins that come with hardware support on the ATtiny as documented in the chapter below of the datasheet. These are respectively the PA6/PA4 pins.</p>
<p><img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_10_datasheet.png.jpg" alt="Screenshot_10_datasheet" /></p>
<p>I ended up using the libraries <a href="https://github.com/adafruit/TinyWireM">TinyWireM</a> for the master board and <a href="https://github.com/lucullusTheOnly/TinyWire">TinyWire</a> for the slave board.
Both libraries use an inteface very similar to the Arduino Wire library (see details below).</p>
<p>In this screenshot you can see me running the code for the slave (right side) and master (right side) with a serial monitor to debug the valuse being transmitted.
<img src="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/resized/Screenshot_11_master_slave_running.png.jpg" alt="Screenshot_11_master_slave_running" /></p>
<p>Master code using the TinyWireM library looks like the following</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#include <TinyWireM.h>
[..omitted...]
#define I2C_SLAVE_ADDRESS 42
[..omitted...]
uint8_t byteValueToTransmit = 0;
void loop()
{
byteValueToTransmit = readSomeValue();
TinyWireM.beginTransmission(I2C_SLAVE_ADDRESS);
TinyWireM.write(byteValueToTransmit);
TinyWireM.endTransmission();
delay(50);
}
</code></pre></div></div>
<p>This sample snippet shows the setup of the transmission <code class="highlighter-rouge">beginTransmission(SLAVE_ADDDRESS)</code>, writing the values with <code class="highlighter-rouge">write(BYTE_VALUE)</code> and the end of request with <code class="highlighter-rouge">endTransmission()</code>.</p>
<p>Slave code using the TinyWire library looks like the following</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#include <TinyWire.h>
#include <twi.h>
[..omitted...]
#define I2C_SLAVE_ADDRESS 42
#define UNAVAILABLE_COUNT_MAX_TIMEOUT 10
#define VALUE_THREASHOLD 100
void setup() {
[..omitted...]
TinyWire.begin(I2C_SLAVE_ADDRESS);
}
[..omitted...]
void loop() {
available = TinyWire.available();
if (available != 0 || unavailableCount < UNAVAILABLE_COUNT_MAX_TIMEOUT) {
if(available == 0) {
unavailableCount++;
} else {
unavailableCount = 0;
lastReadingValue = TinyWire.read();
}
if (lastReadingValue < VALUE_TREASHOLD ){
typeAResponse();
} else {
typeBResponse();
}
} else {
notReceivingDataResponse();
}
delay(10);
}
</code></pre></div></div>
<p>This sample snippet shows the setup of the bus using the same slave address with <code class="highlighter-rouge">begin()</code>, checking the presence of data coming from master with <code class="highlighter-rouge">available()</code> and the actual reading with <code class="highlighter-rouge">read()</code>.<br />
This code is also able to handle the situation in which the master is slightly faster/slower and to be reslient in case of short interruptions of the communication of <code class="highlighter-rouge">UNAVAILABLE_COUNT_MAX_TIMEOUT</code> times the loop is called.</p>
<p>One extra note on the slave side is that when using TinyWire together with SoftwareSerial they end up conflicting on the use of the interrupt on the <code class="highlighter-rouge">PCINT0_vect</code> vector (see details on interrupts <a href="http://ee-classes.usc.edu/ee459/library/documents/avr_intr_vectors/">here</a>).</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Linking everything together...
[...omitted...]
"/tmp/arduino_build_687301/../arduino_cache_751804/core/core_attiny_avr_ATtinyX4_cpu_attiny84,clock_internal8_6b6d5fe56a52a1cf6f3398f4a18ca1e8.a" "-L/tmp/arduino_build_687301" -lm
/tmp/arduino_build_687301/libraries/SoftwareSerial/SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_2'
/tmp/arduino_build_687301/libraries/TinyWire-master/twi.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
</code></pre></div></div>
<p>I ended up commenting the interrupt from twi.cpp during the sessions in which I needed to debug.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//// Interrupt Routine, triggered when SDA pin changes; for detecting Stop condition
//ISR( PCINT0_vect )
//{
[...omitted...]
</code></pre></div></div>
<p><a href="/2018/labs/barcelona/students/ilias-bartolini/assets/img/week13/i2c_tiny.zip">Download full Sources</a> (.zip archive)</p>
<p>Here is a video of the working solution. First you can see the master board, then the slave board controlling the lights.<br />
When the wire_light_counter changes between 0-100 the lights pattern changes to a rainbow then goes back to normal.</p>
<p><br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/JZOMGfUTTmA?&cc_load_policy=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
<h2 id="lessons-learned">Lessons learned</h2>
<ol>
<li>Setting up I2C network is simple and communication between eterogenous hardware and different libraries works just fine</li>
<li>Pull-up resistors are needed on ATtiny based boards for the I2C bus</li>
<li>Libraries that use the ATtiny hardware support need dedicated pins. Software implementations are generally less performant.</li>
</ol>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Create a network with an heartrate sensor</li>
<li>I’d like to try a Blutooth module because useful for a tracker project</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comThis week we followed the Networking and Communication class(http://academy.cba.mit.edu/classes/networking_communications/index.html) (see video here) This page is about the individual assignment.Random number generator2018-05-01T00:28:59+00:002018-05-01T00:28:59+00:00http://fab.academany.org/2018/labs/barcelona/students/ilias-bartolini/2018/05/01/project-random-number-generator<p>The Privacy Seed random number generator doesn’t need to be a “cryptographically secure” pseudo-random number generator (CSPRNG) …but it would be really cool if it does :sunglasses:</p>
<h3 id="state-of-the-art-of-random-number-generator-algorithms">State of the art of random-number generator algorithms</h3>
<p>Most modern CSPRNG use a combination of a stream block cipher (eg. AES) with a seeding & entropy accumulation mechanism to generate its key (usually these use some hash functions eg. SHA-family).</p>
<p>One of the challenges of modern CSPRNG implementations is to have good non-deterministic entropy sources: Here is where the heartbeat sensor is going to be useful!</p>
<p>A bit of research in the ares show that a couple of openly available solutions for <a href="https://en.wikipedia.org/wiki/Pseudorandom_number_generator#Cryptographically_secure_pseudorandom_number_generators">CSPRNG</a> are:</p>
<ul>
<li>[Fortuna](https://en.wikipedia.org/wiki/Fortuna_(PRNG) algorithm that is an evolution of the <a href="https://en.wikipedia.org/wiki/Yarrow_algorithm">Yarrow</a> algorithm (used by MAC OS-es) designed by Bruce Schneier and Niels Ferguson. Currently FreeBSD uses this.</li>
<li><a href="https://en.wikipedia.org/wiki/Salsa20#ChaCha_variant">ChaCha20</a> stream cypher designed by Daniel J. Bernstein and currently used by the Linux kernel.</li>
</ul>
<p>Some useful links:</p>
<ul>
<li>ChaCha20 description in the <a href="https://tools.ietf.org/html/rfc7539">RFC 7539</a></li>
<li>Linux <a href="https://github.com/torvalds/linux/blob/master/drivers/char/random.c">random.c</a> and <a href="https://github.com/torvalds/linux/blob/master/crypto/chacha20_generic.c">chacha20</a> implementations</li>
<li>Randomness <a href="https://en.wikipedia.org/wiki/Randomness_tests#External_links">tests suites</a></li>
<li>How do we know our PRNGs work properly? <a href="https://fahrplan.events.ccc.de/congress/2016/Fahrplan/events/8099.html">lecture</a> by Vladimir Klebanov, Felix Dörre at 33C3</li>
<li>Ensuring randomness <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/">article</a> by Nick Sullivan (this in part could be misleading)</li>
</ul>
<h3 id="random-numbers-on-avr--arduino">Random numbers on AVR / Arduino</h3>
<p>The avr-libc library offers a Pseudo-Random Number Generator (PRNG) in form of a simple Linear Congruential Generator (LCG)).<br />
Link: <a href="https://medium.com/@LargeCardinal/what-do-we-want-all-t3h-arduino-randomz-630dd2aceea7">Random numbers on the arduino - part2</a><br />
Link: <a href="https://medium.com/@LargeCardinal/random-numbers-on-the-arduino-97f325820284">Random numbers on the arduino - part1</a></p>
<p>This generation algorythm is not cryptographically secure and the leaves open the challenge to create a seed with a good amount of entropy.<br />
A simple approach would be to just use the <code class="highlighter-rouge">random()</code> and <code class="highlighter-rouge">randomSeed()</code> functions provided by the arduino library (or directly AVR-libc) with the heartbeat as simple entropy source for the seed.<br />
See: <a href="https://www.arduino.cc/reference/en/language/functions/random-numbers/random/">Arduino random()</a> documentation.</p>
<p>To have a CSPRNG would require to port the ChaCha20 and entropy management, SHA-256 to AVR/Arduino using the Linux Kernel implementation as inspiration.</p>
<h3 id="random-numbers-on-rasperry-pi--linux">Random numbers on Rasperry Pi / Linux</h3>
<p>Raspberry Pi uses a linux kernel therefore could be easily possible to take advantage of the ChaCha20 implementation.<br />
One simple solution would be to use the existing implementation and <a href="https://wiki.archlinux.org/index.php/Rng-tools">RNG-tools</a> to add an heartbeat file to the entropy sources (eg. <code class="highlighter-rouge">rngd -r /path/to/heartbeat/file</code>).</p>
<p>This solution would also allow to run a simple web API/application on a pi-zero as interface.</p>
<p>…WORK IN PROGRESS….</p>
<h2 id="next-steps">Next steps</h2>
<ul>
<li>Try interfacing the heartbeat sensor with a Raspberry Pi via I2C bus.</li>
</ul>Ilias Bartoliniilias.bartolini@gmail.comThe Privacy Seed random number generator doesn’t need to be a “cryptographically secure” pseudo-random number generator (CSPRNG) …but it would be really cool if it does :sunglasses: State of the art of random-number generator algorithms Most modern CSPRNG use a combination of a stream block cipher (eg. AES) with a seeding & entropy accumulation mechanism to generate its key (usually these use some hash functions eg. SHA-family). One of the challenges of modern CSPRNG implementations is to have good non-deterministic entropy sources: Here is where the heartbeat sensor is going to be useful! A bit of research in the ares show that a couple of openly available solutions for CSPRNG are: [Fortuna](https://en.wikipedia.org/wiki/Fortuna_(PRNG) algorithm that is an evolution of the Yarrow algorithm (used by MAC OS-es) designed by Bruce Schneier and Niels Ferguson. Currently FreeBSD uses this. ChaCha20 stream cypher designed by Daniel J. Bernstein and currently used by the Linux kernel. Some useful links: ChaCha20 description in the RFC 7539 Linux random.c and chacha20 implementations Randomness tests suites How do we know our PRNGs work properly? lecture by Vladimir Klebanov, Felix Dörre at 33C3 Ensuring randomness article by Nick Sullivan (this in part could be misleading) Random numbers on AVR / Arduino The avr-libc library offers a Pseudo-Random Number Generator (PRNG) in form of a simple Linear Congruential Generator (LCG)). Link: Random numbers on the arduino - part2 Link: Random numbers on the arduino - part1 This generation algorythm is not cryptographically secure and the leaves open the challenge to create a seed with a good amount of entropy. A simple approach would be to just use the random() and randomSeed() functions provided by the arduino library (or directly AVR-libc) with the heartbeat as simple entropy source for the seed. See: Arduino random() documentation. To have a CSPRNG would require to port the ChaCha20 and entropy management, SHA-256 to AVR/Arduino using the Linux Kernel implementation as inspiration. Random numbers on Rasperry Pi / Linux Raspberry Pi uses a linux kernel therefore could be easily possible to take advantage of the ChaCha20 implementation. One simple solution would be to use the existing implementation and RNG-tools to add an heartbeat file to the entropy sources (eg. rngd -r /path/to/heartbeat/file). This solution would also allow to run a simple web API/application on a pi-zero as interface. …WORK IN PROGRESS…. Next steps Try interfacing the heartbeat sensor with a Raspberry Pi via I2C bus.