<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hardware on falkp.no/blog</title>
    <link>/blog/tags/hardware/</link>
    <description>falkp.no/blog (Hardware)</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
      

      
    

    
    <lastBuildDate>Wed, 01 Apr 2020 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/hardware/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Graphing X Aircontrol from Trox Technik</title>
      <link>/blog/posts/graphing_x_aircontrol_from_trox_technik/</link>
      <pubDate>Wed, 01 Apr 2020 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/graphing_x_aircontrol_from_trox_technik/</guid>
      <description>&lt;p&gt;Modern buildings have advanced HVAC systems, but they keep the data for themselves. Let&amp;rsquo;s fight that. =)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;graphs.png&#34; alt=&#34;Temperature, CO2, airflow.&#34;&gt;&lt;/p&gt;
&lt;p&gt;I got access to an X Aircontrol from Trox Technik, ZoneMaster HVAC system. It has a web server, so I started playing to see what data could be extracted.&lt;/p&gt;
&lt;p&gt;I ended up with this script &lt;a href=&#34;https://gitlab.com/larsfp/xaircontrol&#34;&gt;xaircontrol&lt;/a&gt;, which can send data to &lt;a href=&#34;https://grafana.com/&#34;&gt;Grafana&lt;/a&gt; via &lt;a href=&#34;https://collectd.org/&#34;&gt;Collectd&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ve used it to make some sweet floorplans.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;floorplan.png&#34; alt=&#34;Floorplan&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Non-invasive graphing of energy usage</title>
      <link>/blog/posts/non_invasive_graphing_of_energy_usage/</link>
      <pubDate>Wed, 01 Apr 2020 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/non_invasive_graphing_of_energy_usage/</guid>
      <description>&lt;p&gt;&amp;ldquo;If you can&amp;rsquo;t measure it, you can&amp;rsquo;t improve it.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Reducing energy usage is hard if you can&amp;rsquo;t see it. Here&amp;rsquo;s a cheap way to graph home or office energy usage.&lt;/p&gt;
&lt;p&gt;By reading data from the energy meter, one can get super accurate, real-time usage data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;energy.png&#34; alt=&#34;Energy graph&#34;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A smart home controller, &lt;a href=&#34;https://www.home-assistant.io/&#34;&gt;Home Assistant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A graphing system, &lt;a href=&#34;https://grafana.com/&#34;&gt;Grafana&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A micro controller, &lt;a href=&#34;https://en.wikipedia.org/wiki/ESP8266&#34;&gt;esp8266&lt;/a&gt;, ~$5&lt;/li&gt;
&lt;li&gt;An &lt;a href=&#34;https://en.wikipedia.org/wiki/Photoresistor&#34;&gt;LDR sensor&lt;/a&gt;, $1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You need some familiarity with all of the above to set this up.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s my energy meter:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;installation.jpg&#34; alt=&#34;Energy meter&#34;&gt;&lt;/p&gt;
&lt;p&gt;It doesn&amp;rsquo;t matter which one you have, as long as it has a LED that blinks each X kWh used. I&amp;rsquo;ve written software for the esp8266 in &lt;a href=&#34;http://micropython.org/&#34;&gt;MicroPython&lt;/a&gt;, called &lt;a href=&#34;https://gitlab.com/larsfp/esp_energy_meter&#34;&gt;esp_energy_meter&lt;/a&gt;, that measures the time between each blink. It works great, and I&amp;rsquo;ve had it running for several locations for years. See the gitlab repo for more info on setup.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hass.png&#34; alt=&#34;In home assistant&#34;&gt;&lt;/p&gt;
&lt;p&gt;When you have this set up, you can combine it with real-time energy prices to get full control of your energy usage. And then it&amp;rsquo;s time to adjust your usage based on pricing. =)&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>VEML7700 in ESPHome</title>
      <link>/blog/posts/veml7700_in_esphome/</link>
      <pubDate>Sat, 29 Feb 2020 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/veml7700_in_esphome/</guid>
      <description>&lt;p&gt;I have a &lt;a href=&#34;https://www.adafruit.com/product/4162&#34;&gt;VEML7700&lt;/a&gt; digital light level sensor, which is not supported by &lt;a href=&#34;https://esphome.io/&#34;&gt;ESPHome&lt;/a&gt;, but can be used as a custom i2c component. This is how:&lt;/p&gt;
&lt;h2 id=&#34;espnodeyaml&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#espnodeyaml&#34;&gt;
        #
    &lt;/a&gt;
    espnode.yaml
&lt;/div&gt;
&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;esphome&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;includes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    - veml7700_custom_sensor.h
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;libraries&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    - &lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;https://github.com/adafruit/Adafruit_VEML7700&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;sensor&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- &lt;span style=&#34;color:#ff6ac1&#34;&gt;platform&lt;/span&gt;: custom
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#ff6ac1&#34;&gt;lambda&lt;/span&gt;: |-&lt;span style=&#34;color:#5af78e&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    auto veml7700 = new VEML7700CustomSensor();
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    App.register_component(veml7700);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    return {veml7700, veml7700-&amp;gt;lux_sensor, veml7700-&amp;gt;white_sensor, veml7700-&amp;gt;als_sensor};
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    sensors:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    - name: &amp;#34;VEML7700 Light&amp;#34; # Required dummy sensor
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    - name: &amp;#34;VEML770 Lux&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        unit_of_measurement: Lux
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        accuracy_decimals: 0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    - name: &amp;#34;VEML770 White&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        unit_of_measurement: raw
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        accuracy_decimals: 0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;    - name: &amp;#34;VEML770 ALS&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        unit_of_measurement: raw
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#5af78e&#34;&gt;        accuracy_decimals: 0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;veml7700_custom_sensorh&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#veml7700_custom_sensorh&#34;&gt;
        #
    &lt;/a&gt;
    veml7700_custom_sensor.h
&lt;/div&gt;
&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-c&#34; data-lang=&#34;c&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#78787e&#34;&gt;&amp;#34;esphome.h&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#78787e&#34;&gt;&amp;#34;Adafruit_VEML7700.h&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;// Requires this lib installed: $ platformio lib --global install &amp;#34;Adafruit BusIO&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#78787e&#34;&gt;// based on https://github.com/adafruit/Adafruit_VEML7700/blob/master/examples/veml7700_test/veml7700_test.ino
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;class &lt;span style=&#34;color:#ff5c57&#34;&gt;VEML7700CustomSensor&lt;/span&gt; : public PollingComponent, public Sensor {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff5c57&#34;&gt;public&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Adafruit_VEML7700 veml &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;Adafruit_VEML7700&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;*&lt;/span&gt;lux_sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; new &lt;span style=&#34;color:#57c7ff&#34;&gt;Sensor&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;*&lt;/span&gt;white_sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; new &lt;span style=&#34;color:#57c7ff&#34;&gt;Sensor&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;*&lt;/span&gt;als_sensor &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; new &lt;span style=&#34;color:#57c7ff&#34;&gt;Sensor&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#57c7ff&#34;&gt;VEML7700CustomSensor&lt;/span&gt;() &lt;span style=&#34;color:#ff6ac1&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;PollingComponent&lt;/span&gt;(&lt;span style=&#34;color:#ff9f43&#34;&gt;15000&lt;/span&gt;) {}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#9aedfe&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;setup&lt;/span&gt;() override {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Wire.&lt;span style=&#34;color:#57c7ff&#34;&gt;begin&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;begin&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;setGain&lt;/span&gt;(VEML7700_GAIN_1);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;setIntegrationTime&lt;/span&gt;(VEML7700_IT_800MS);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#78787e&#34;&gt;// veml.powerSaveEnable(true);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#78787e&#34;&gt;// veml.setPowerSaveMode(VEML7700_POWERSAVE_MODE4);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#78787e&#34;&gt;// veml.setLowThreshold(10000);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#78787e&#34;&gt;// veml.setHighThreshold(20000);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#78787e&#34;&gt;// veml.interruptEnable(true);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#9aedfe&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#57c7ff&#34;&gt;update&lt;/span&gt;() override {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#9aedfe&#34;&gt;float&lt;/span&gt; lux &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;readLux&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#9aedfe&#34;&gt;float&lt;/span&gt; white &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;readWhite&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#9aedfe&#34;&gt;float&lt;/span&gt; als &lt;span style=&#34;color:#ff6ac1&#34;&gt;=&lt;/span&gt; veml.&lt;span style=&#34;color:#57c7ff&#34;&gt;readALS&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#57c7ff&#34;&gt;ESP_LOGD&lt;/span&gt;(&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;VEML7700&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;The value of sensor lux is: %.0f&amp;#34;&lt;/span&gt;, lux);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#57c7ff&#34;&gt;ESP_LOGD&lt;/span&gt;(&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;VEML7700&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;The value of sensor white is: %.0f&amp;#34;&lt;/span&gt;, white);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#57c7ff&#34;&gt;ESP_LOGD&lt;/span&gt;(&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;VEML7700&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#34;The value of sensor ALS is: %.0f&amp;#34;&lt;/span&gt;, als);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    lux_sensor&lt;span style=&#34;color:#ff6ac1&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#57c7ff&#34;&gt;publish_state&lt;/span&gt;(lux);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    white_sensor&lt;span style=&#34;color:#ff6ac1&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#57c7ff&#34;&gt;publish_state&lt;/span&gt;(white);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    als_sensor&lt;span style=&#34;color:#ff6ac1&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#57c7ff&#34;&gt;publish_state&lt;/span&gt;(als);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;};
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Nordlux lamp. Incompetence or planned obsolescence?</title>
      <link>/blog/posts/nordlux_crap/</link>
      <pubDate>Sat, 01 Feb 2020 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/nordlux_crap/</guid>
      <description>&lt;p&gt;I got this lamp from Nordlux, model 6315. It came with unreplacable LEDs, meaning you have to throw it away when they run out. Apparently the LEDs are rated for 30.000 hours, but will they last that long?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.bauhaus.dk/nordlux-plafond-kiel-led-o28-5-cm&#34;&gt;Nordlux at Bauhaus&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;overview.jpg&#34; alt=&#34;Overview&#34;&gt;&lt;/p&gt;
&lt;p&gt;After a few years of normal use it died. I could hear the relay turning on and off, but there was no light. I followed the power all the way, and there seemed to be no problem with the transformer, relay or wires. I tried checking the voltage drop over a LED, and that gave a slight glow in all the other LEDs. So it seems the LEDs are connected in series! Meaning that &lt;strong&gt;if any of the 24 LEDs die, you have to throw away the whole lamp&lt;/strong&gt;. I&amp;rsquo;m unsure wether this is incompetence or planned obsolescence. What are the odds of all LEDs lasting a long time?&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;brokenled.jpg&#34; alt=&#34;Broken LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;The broken LED is apparent with a small mark on it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;bridgedled.jpg&#34; alt=&#34;Briged LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;The lamp works again if the broken LED is shorted. This &amp;ldquo;repair&amp;rdquo; is only for testing. I do not suggest using a lamp in this state.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Ninjabox</title>
      <link>/blog/posts/ninjabox/</link>
      <pubDate>Fri, 23 Nov 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/ninjabox/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Untrickable laser alarm, with an easy-to-knock-out fusebox.&lt;/p&gt;
&lt;p&gt;A tribute to (the alarms in) &lt;a href=&#34;https://en.wikipedia.org/wiki/Mark_of_the_Ninja&#34;&gt;Mark of the Ninja&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;fusebox.jpg&#34; alt=&#34;Fusebox&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;background&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#background&#34;&gt;
        #
    &lt;/a&gt;
    Background
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;In the game you have to sneak into buildings with high tech alarms. Some of the laser traps can be deactivated by knocking out the fuse box with a dart.&lt;/p&gt;
&lt;p&gt;So I made a laser alarm with a fusebox that can be knocked out. This is mainly to keep kids occupied, and motivated to practice throwing.&lt;/p&gt;
&lt;h2 id=&#34;features&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#features&#34;&gt;
        #
    &lt;/a&gt;
    Features
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Glowing ⚡ with simple animations and color changes (start-up, alarm, sparks)&lt;/li&gt;
&lt;li&gt;Laser triggered alarm, which can&amp;rsquo;t be fooled by using a separate laser or flash light. This is done by pulsing the laser and making sure photo resistor is relatively dark when laser is off.&lt;/li&gt;
&lt;li&gt;Motion activated &amp;ldquo;play dead&amp;rdquo; (throw somehting on the fuse box, and it will black out for 10 seconds).&lt;/li&gt;
&lt;li&gt;Play sounds for alarm, sparks, start-up&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;demo&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#demo&#34;&gt;
        #
    &lt;/a&gt;
    Demo
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;demo.jpg&#34; alt=&#34;Demo setup&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/knockout.m4v&#34;&gt;Knocking out the alarm&lt;/a&gt; (~3MB).&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/foolalarm.m4v&#34;&gt;Attempting to fool the alarm&lt;/a&gt; (~2MB).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;inside.jpg&#34; alt=&#34;Inside&#34;&gt;&lt;/p&gt;
&lt;p&gt;Not shown here: speaker and tiltsensor.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;https://gitlab.com/larsfp/ninjabox&#34;&gt;gitlab&lt;/a&gt; for build instructions and code.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Car-logger - part 3</title>
      <link>/blog/posts/car_logger_part_3/</link>
      <pubDate>Fri, 25 May 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/car_logger_part_3/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;A self-hosted, real-time, inexpensive open source car tracker built with &lt;a href=&#34;https://www.raspberrypi.org/&#34;&gt;Raspberry Pi&lt;/a&gt; Zero W, &lt;a href=&#34;https://nextcloud.com/&#34;&gt;Nextcloud&lt;/a&gt;, and optionally &lt;a href=&#34;https://www.home-assistant.io/&#34;&gt;Home Assistant&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;plan.jpg&#34; alt=&#34;Plan&#34;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve had a few earlier tries at car position logging, read those first if you&amp;rsquo;re interested: &lt;a href=&#34;https://0p.no/2014/09/29/car_logger2.html&#34;&gt;Car logger 2&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;background&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#background&#34;&gt;
        #
    &lt;/a&gt;
    Background
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Goal: logging and sharing location of my non-connected car, for practicality and fun.&lt;/p&gt;
&lt;p&gt;Earlier tries was using a phone, but that had problems. No Android phone will switch back on if it runs out of power without manual intervention.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prerequisites&#34;&gt;
        #
    &lt;/a&gt;
    Prerequisites
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I needed power from the car, but want it to cut off when the ignition is off. My 12 V outlets didn&amp;rsquo;t. So I used a &lt;a href=&#34;http://www.biltema.no/no/Bil---MC/Bil-tilbehor/Bilelektrisk/Sikring/Flatsikringsholder-med-uttak-2-stk-2000035590/&#34;&gt;fuse holder with outlet&lt;/a&gt; to accomplish this. To that I attached a 12 to 5 V converter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;fuses.jpg&#34; alt=&#34;Fuse box in car&#34;&gt;&lt;/p&gt;
&lt;p&gt;Also I chose to go without any battery or UPS, so the Pi has to deal with unclean shutdown every time. For this I run the SD card read-only using &lt;a href=&#34;https://github.com/ways/rpi-readonly&#34;&gt;rpi-readonly&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware&#34;&gt;
        #
    &lt;/a&gt;
    Hardware
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I had little experience with Arduino at the time of start, but lots with Pi, so I used a Pi Zero. Mainly for it&amp;rsquo;s low power consumption.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;prototype01.jpg&#34; alt=&#34;Pi, usb hub, gsm modem in an old harddisk cabinet&#34;&gt;&lt;/p&gt;
&lt;p&gt;I first tried &lt;a href=&#34;https://www.amazon.com/Diymall-G-mouse-Glonass-Raspberry-Aviation/dp/B00NWEEWW8/ref=sr_1_2?ie=UTF8&amp;amp;qid=1527193287&amp;amp;sr=8-2&amp;amp;keywords=gps+dongle&amp;amp;dpID=319Yen02YIL&amp;amp;preST=_SY300_QL70_&amp;amp;dpSrc=srch&#34;&gt;Diymall-G-mouse-Glonass&lt;/a&gt; GPS dongle, but reception was very bad, so switched to &lt;a href=&#34;https://www.ebay.com/itm/BN-808-USB-GPS-Antenna-Receiver-Glonass-Dual-Module-Gmouse-For-Car-Laptop-PC-NEW/263511681859?hash=item3d5a852b43:g:vdkAAOSwbF1aRfrF&#34;&gt;BN-808-USB-GPS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For uplink I used a cheap 3G USB modem &lt;a href=&#34;http://www.dx.com/p/Tolkien-Portable-Mini-USB-3G-WiFi-Router-Mobile-Device-Hotspot-Unlocked-Wireless-Modem-Network-Doggle-with-SIMTF-Card-Slot--usb-router-only-916496537&#34;&gt;Tolkien-Portable&lt;/a&gt; and a data-twin SIM card.&lt;/p&gt;
&lt;h2 id=&#34;backend&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#backend&#34;&gt;
        #
    &lt;/a&gt;
    Backend
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I started writing a backend in 2014, &lt;a href=&#34;https://github.com/ways/BigBrotherGPSweb&#34;&gt;BigBrotherGPSweb&lt;/a&gt;, but didn&amp;rsquo;t get very far. Fortunately someone has filled my need. &lt;a href=&#34;https://nextcloud.com/&#34;&gt;Nextcloud&lt;/a&gt;, a self-hosted dropbox alternative, has a plugin called &lt;a href=&#34;https://apps.nextcloud.com/apps/phonetrack&#34;&gt;PhoneTrack&lt;/a&gt;. It has nice features like public sharing, users, filters, etc. and use Openstreetmap. SSL for transport encryption.&lt;/p&gt;
&lt;p&gt;For home automation I use Home Assistant, so I also wanted the data there as well.&lt;/p&gt;
&lt;p&gt;Map in Nextcloud/PhoneTrack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;map.jpg&#34; alt=&#34;Map&#34;&gt;&lt;/p&gt;
&lt;p&gt;Status in Home Assistant:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hass.png&#34; alt=&#34;Home assistant&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        #
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I found no premade solution to use &lt;a href=&#34;https://en.wikipedia.org/wiki/Wi-Fi_positioning_system&#34;&gt;wifi triangulation&lt;/a&gt; in python, so I wrote &lt;a href=&#34;https://github.com/ways/wifindme&#34;&gt;wifindme&lt;/a&gt; (available from pip, python 2 and 3). It can use Mozilla, radiocells.org or, with small changes, Google. Use what has best coverage where you need it.&lt;/p&gt;
&lt;p&gt;For the actual reporting I wrote &lt;a href=&#34;https://github.com/ways/locationreporter&#34;&gt;LocationReporter&lt;/a&gt;. It can use wifi triangulation, GPS or both. It will use wifi while the GPS is warming up, and when GPS fails. The results can be sent to both my backends.&lt;/p&gt;
&lt;h2 id=&#34;build&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#build&#34;&gt;
        #
    &lt;/a&gt;
    Build
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve not yet created any kind of case. The tracker lives in a card board box in my car door.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;door.jpg&#34; alt=&#34;Car door&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;internals.jpg&#34; alt=&#34;Internals&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;problems&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#problems&#34;&gt;
        #
    &lt;/a&gt;
    Problems
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PhoneTrack could be easier to use on a phone.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;improvements&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#improvements&#34;&gt;
        #
    &lt;/a&gt;
    Improvements
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The setup should be moved to the trunk, out of sight.&lt;/li&gt;
&lt;li&gt;I really should get a case and mount the parts properly.&lt;/li&gt;
&lt;li&gt;The Pi Zero has bluetooth, so I could fetch data from OBD and upload it. Unfortunately my cars OBD doesn&amp;rsquo;t supply very interesting info (no battery voltage, fuel consumption, fuel status).&lt;/li&gt;
&lt;li&gt;Should be enough to send data to either Nextcloud or Home Assistant, not both.&lt;/li&gt;
&lt;li&gt;A switch for private mode or you-don&amp;rsquo;t-have-to-post-every-ten-seconds mode could be nice.&lt;/li&gt;
&lt;li&gt;Radiocells.org let&amp;rsquo;s you download the data set for local use. Local wifi lookup is very fast, so this would make wifi triangulation faster, and less data used and leaked.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;conclusions&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#conclusions&#34;&gt;
        #
    &lt;/a&gt;
    Conclusions
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;m happy with the results. It&amp;rsquo;s been running for months now without problems. And it&amp;rsquo;s good sharing our position real-time on long drives.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Volumio based radio with NFC</title>
      <link>/blog/posts/volumio_nfc_build/</link>
      <pubDate>Tue, 19 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/volumio_nfc_build/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://volumio.org&#34;&gt;Volumio&lt;/a&gt; based internet radio, controlled by &lt;a href=&#34;https://en.wikipedia.org/wiki/Near-field_communication&#34;&gt;NFC&lt;/a&gt;, built in an old speaker.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;speaker1.jpg&#34; alt=&#34;Complete speaker&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;background&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#background&#34;&gt;
        #
    &lt;/a&gt;
    Background
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Inspired by the extreemly good looking &lt;a href=&#34;http://blog.zenona.com/&#34;&gt;Spotify Box&lt;/a&gt; and QR based systems like &lt;a href=&#34;http://tilman.de/projekte/audiosphere/&#34;&gt;Audiosphere&lt;/a&gt;, I wanted to make something similar for my kids. I&amp;rsquo;ve earlier built a few radios based on small, cheap bluetooth speakers like music angel, but wanted something with better sound this time.&lt;/p&gt;
&lt;h2 id=&#34;prototype&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prototype&#34;&gt;
        #
    &lt;/a&gt;
    Prototype
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;QR are fast and cheap, so I made a quick prototype. It turned out they are unreliable when there&amp;rsquo;s no display to give feedback on how the camera sees them. Both lighting and focus was a problem.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;qr1.jpg&#34; alt=&#34;QR reader&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;qr2.jpg&#34; alt=&#34;QR view&#34;&gt;&lt;/p&gt;
&lt;p&gt;Next up, NFC. I decided on a PN532 NFC reader, simply because I had one around. They&amp;rsquo;re about $8 / 70 NOK on ebay. It communicates via i2c, and there&amp;rsquo;s a python library for it. I decided to make it easy for myself and allow for any kind of NFC tag I could get hold of, so the plan was to read and use what ever data or ID the tags contain, and make a list to match IDs and URLs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;nfcreader1.jpg&#34; alt=&#34;NFC reader&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;volumio&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#volumio&#34;&gt;
        #
    &lt;/a&gt;
    Volumio
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://volumio.org&#34;&gt;Volumio&lt;/a&gt; is a general music player for small devices like the &lt;a href=&#34;http://raspberrypi.org/&#34;&gt;Pi&lt;/a&gt;. Due to &lt;a href=&#34;https://www.mopidy.com/&#34;&gt;Mopidy&lt;/a&gt; it supports playing music from lots of sources. The two I&amp;rsquo;m interessted in are internet radios and Spotify, but this will work for anything Mopidy can play.&lt;/p&gt;
&lt;p&gt;Volumio also has &lt;a href=&#34;https://volumio.org/forum/volumio-plugins-collection-t6251.html&#34;&gt;plugins&lt;/a&gt; for other stuff, like mono output, being a Spotify Connect speaker and button controls connected via GPIO like I will use here.&lt;/p&gt;
&lt;h2 id=&#34;setup&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#setup&#34;&gt;
        #
    &lt;/a&gt;
    Setup
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;As mentioned in the &lt;a href=&#34;https://github.com/ways/volumio-nfc&#34;&gt;readme&lt;/a&gt;, there are a few steps to install NFC support. You have to &lt;a href=&#34;https://volumio.github.io/docs/User_Manual/SSH.html&#34;&gt;enable SSH&lt;/a&gt; first. Then install packages, check that the i2c connection to the reader is working, enable services.&lt;/p&gt;
&lt;p&gt;Reading a tag looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ ./readnfc.py
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Reading tag list readnfc.list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ff9f43&#34;&gt;6&lt;/span&gt; tags in store. Ready to read.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Card data: bytearray&lt;span style=&#34;color:#ff6ac1&#34;&gt;(&lt;/span&gt;b&lt;span style=&#34;color:#5af78e&#34;&gt;&amp;#39;K\x01\x01\x00D\x00\x07\x04!T\xcao?\x81&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ff6ac1&#34;&gt;)&lt;/span&gt; / 4b010100440007042154ca6f3f81
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Stoping any music currently playing
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Play audio feedback.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Play selected &lt;span style=&#34;color:#ff5c57&#34;&gt;source&lt;/span&gt; webradio http://nrk-mms-live.telenorcdn.net:80/nrk_radio_alltid_nyheter_aac_h
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you add that tag to your list, readnfc.list, in the same directory. There are lots of examples for radios and spotify playlists in it already. Restart the service and you should be done.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://falkp.no/blog/_static/demo.m4v&#34;&gt;See demo video&lt;/a&gt; (~4MB).&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware&#34;&gt;
        #
    &lt;/a&gt;
    Hardware
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;For sound I connected a &lt;a href=&#34;https://www.ebay.com/itm/Mini-USB-2-0-3D-Virtual-480Mbps-External-7-1-Channel-Audio-Sound-Card-Adapter/162432421351?epid=11004887919&amp;amp;hash=item25d1ba0de7:g:~JQAAOSwWxNYyV1A&#34;&gt;cheap USB soundcard&lt;/a&gt; (first hit on ebay), via a &lt;a href=&#34;https://www.ebay.com/itm/Ground-Loop-Noise-Filter-Isolator-3-5mm-Cable-For-Home-Stereo-Car-Audio-GW/282776792501?hash=item41d6cf6db5:g:9fQAAOSwhsBaN1Pj&#34;&gt;ground loop filter&lt;/a&gt; to a &lt;a href=&#34;https://www.adafruit.com/product/1752&#34;&gt;Class D amplifier&lt;/a&gt;, to the terminals of the speaker.&lt;/p&gt;
&lt;p&gt;A 1k potmeter for volume, and two push-buttons for play/pause and next.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hardware1.jpg&#34; alt=&#34;Hardware&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;hardware2.jpg&#34; alt=&#34;Hardware&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;tags&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#tags&#34;&gt;
        #
    &lt;/a&gt;
    Tags
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Any tags works, but they need to look attractive, so I created some business card sized pictures to hold them.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags1.jpg&#34; alt=&#34;Assorted tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags2.jpg&#34; alt=&#34;Tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags3.jpg&#34; alt=&#34;A sheet of tags&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;tags4.jpg&#34; alt=&#34;Scanning tag&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>RadiOS part 2</title>
      <link>/blog/posts/radios_part_2/</link>
      <pubDate>Wed, 17 Aug 2016 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/radios_part_2/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;http://0p.no/2014/05/09/radios_part_1.html&#34;&gt;RadiOS part 1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So I started making a prototype to figure out if I could &amp;ldquo;sense&amp;rdquo; both selections with GPIO pins, while the designer started modeling and rendering suggestions for the physical design. The solution chosen was to first set all volume control pins to high, and check which channel control points registered as on, then reverse (control points high, check volumes).&lt;/p&gt;
&lt;h2 id=&#34;sound&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#sound&#34;&gt;
        #
    &lt;/a&gt;
    Sound
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;For sound we tore down a &lt;a href=&#34;http://musicangel.no/speakers/&#34;&gt;Music Angel&lt;/a&gt; portable speaker. It gave us two speakers, an amplifier running on 5V and a battery which we threw away. The built in soundcard gave horrible sound under certain conditions, so a cheap USB soundcard was used instead.&lt;/p&gt;
&lt;h2 id=&#34;case&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#case&#34;&gt;
        #
    &lt;/a&gt;
    Case
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;We wanted to try both a 3D-printed version and a &lt;a href=&#34;https://en.wikipedia.org/wiki/CNC_wood_router&#34;&gt;CNC&amp;rsquo;ed&lt;/a&gt; one. A print at &lt;a href=&#34;http://shapeways.com&#34;&gt;Shapeways&lt;/a&gt; would cost us ~$200, plus shiping and tax. We got one printed localy for ~$80. It&amp;rsquo;s has yet to be used. A local CNC person wanted ~$270. The case we&amp;rsquo;ve used in the final build is hand made of wood.&lt;/p&gt;
&lt;h3 id=&#34;plastic-case&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#plastic-case&#34;&gt;
        ##
    &lt;/a&gt;
    Plastic case
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;11.JPG&#34; alt=&#34;rendering back&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;12.JPG&#34; alt=&#34;rendering inside&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;13.JPG&#34; alt=&#34;rendering empty&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;14.JPG&#34; alt=&#34;rendering outside&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;plastic.png&#34; alt=&#34;actual case&#34;&gt;&lt;/p&gt;
&lt;h3 id=&#34;renderings-of-other-variations&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#renderings-of-other-variations&#34;&gt;
        ##
    &lt;/a&gt;
    Renderings of other variations
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;17.JPG&#34; alt=&#34;rendering ceramic&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;15.JPG&#34; alt=&#34;rendering standing&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;prototype&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#prototype&#34;&gt;
        #
    &lt;/a&gt;
    Prototype
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;rpi_gpio.jpg&#34; alt=&#34;GPIO connected.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;testing.png&#34; alt=&#34;testing&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;build-1&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#build-1&#34;&gt;
        #
    &lt;/a&gt;
    Build 1
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;We chose to paint the front in black board paint, to allow easy change of channel labels and a personal touch.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;blank.png&#34; alt=&#34;blank front&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;shelf.png&#34; alt=&#34;finished model on shelf&#34;&gt;&lt;/p&gt;
&lt;p&gt;Other builds may have a white board front, or be something very different.&lt;/p&gt;
&lt;h2 id=&#34;conclution-so-far&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#conclution-so-far&#34;&gt;
        #
    &lt;/a&gt;
    Conclution so far
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s an interessting UI, and people want to touch it. However programming the channels and first time setup is hard. Also the Pi or musicbox is very slow to start streaming. This kind of breaks the fun of it.&lt;/p&gt;
&lt;p&gt;To be continued&amp;hellip;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Cheap DIY babycam with night vision</title>
      <link>/blog/posts/cheap_diy_babycam_with_nightvision/</link>
      <pubDate>Tue, 30 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/cheap_diy_babycam_with_nightvision/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;When I did this project in 2012 babycams cost from NOK 2000 and up, so I decided to see if I could build one using a Raspberry Pi, an IR light and a very cheap webcam.&lt;/p&gt;
&lt;p&gt;This will of course only be a level 0 night vision (active).&lt;/p&gt;
&lt;h2 id=&#34;parts&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#parts&#34;&gt;
        #
    &lt;/a&gt;
    Parts
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.dx.com/p/ir-48-led-infrared-illumination-light-for-night-vision-dc-12v-500ma-15235&#34;&gt;IR LEDs&lt;/a&gt; with a 12V PSU.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.raspberrypi.org/&#34;&gt;Raspberry Pi&lt;/a&gt; with a 5V PSU.&lt;/li&gt;
&lt;li&gt;Webcam. I don&amp;rsquo;t have a link to it, but pretty much any webcam will do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;sku_15235_1.jpg&#34; alt=&#34;IR LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;Raspberry_Pi_-_Model_A.jpg&#34; alt=&#34;Raspberry Pi, from Wikipedia.org&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;hardware-setup&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#hardware-setup&#34;&gt;
        #
    &lt;/a&gt;
    Hardware setup
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;I set up a test and was disappointed that the IR setup hardly gave any visible picture at all, so I threw it in the trash. Then I rememberd that all digital cameras have an IR filter to sharpen daylight pictures. To remove it I did this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unscrew any lense or cover.&lt;/li&gt;
&lt;li&gt;Look for a small, slightly colored piece of glass covering the CMOS chip, and remove it by force.&lt;/li&gt;
&lt;li&gt;Reassemble.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now the IR seemed to light up objects several meters away. As IR light can hurt eyes, I have the light pointed towards the ceiling, so only reflected light is ever hitting people.&lt;/p&gt;
&lt;h2 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        #
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Installed raspbian.&lt;/li&gt;
&lt;li&gt;Installed motion.&lt;/li&gt;
&lt;li&gt;Webcam is now available to local network for PCs (browser, VLC) and phones (VLC, video streaming apps).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;result&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#result&#34;&gt;
        #
    &lt;/a&gt;
    Result
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;irled.png&#34; alt=&#34;IR LED&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;webcam.png&#34; alt=&#34;Webcam, stripped and attached to wall.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;babyphone.png&#34; alt=&#34;Baby in nightvision viewed on a phone.&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>RadiOS part 1</title>
      <link>/blog/posts/radios_part_1/</link>
      <pubDate>Fri, 09 May 2014 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/radios_part_1/</guid>
      <description>&lt;h2 id=&#34;overview&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#overview&#34;&gt;
        #
    &lt;/a&gt;
    Overview
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;In my opinion most radios, especially internet radios, have horrible interfaces. Small buttons, small displays, often touch, often several functions for each button.&lt;/p&gt;
&lt;p&gt;So &lt;a href=&#34;http://no.linkedin.com/pub/erik-falk-petersen/b/286/a07&#34;&gt;Erik&lt;/a&gt; and I set out to design a new, better radio for ourselves. Our main requirements were ease of use and a very physical UI. Something you&amp;rsquo;d want to touch and play with.&lt;/p&gt;
&lt;h2 id=&#34;platform&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#platform&#34;&gt;
        #
    &lt;/a&gt;
    Platform
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;The Raspberry Pi is our platform of choice at the moment, so we have some physical restrictions and long boot time.&lt;/p&gt;
&lt;h2 id=&#34;physical-designs&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#physical-designs&#34;&gt;
        #
    &lt;/a&gt;
    Physical designs
&lt;/div&gt;
&lt;/h2&gt;
&lt;h3 id=&#34;the-cone&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-cone&#34;&gt;
        ##
    &lt;/a&gt;
    The cone
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;cone.jpg&#34; alt=&#34;The cone radio.&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;cone2.jpg&#34; alt=&#34;The cone sketch.&#34;&gt;&lt;/p&gt;
&lt;p&gt;Our first idea was a cone that would rotate for volume and press down for on, next channel, off. A very basic look, and extreamly easy to use. What killed this was the size it would need to be to accomodate an rPi and the mechanical complexity of making the twist and click switch.&lt;/p&gt;
&lt;h3 id=&#34;brainstorming&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#brainstorming&#34;&gt;
        ##
    &lt;/a&gt;
    Brainstorming
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;brainstorm.jpg&#34; alt=&#34;Brainstorming.&#34;&gt;&lt;/p&gt;
&lt;p&gt;So we hit the whiteboard. Some of the designs from our brainstorming:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A vertical rod with the radio sliding up/down for volume.&lt;/li&gt;
&lt;li&gt;A body-like shape hanging from the wall.&lt;/li&gt;
&lt;li&gt;A horizontal rod, where you pick up the radio and hang it on the position of the channel you want.&lt;/li&gt;
&lt;li&gt;Magnets! Anything with magnets!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;the-chosen-design&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-chosen-design&#34;&gt;
        ##
    &lt;/a&gt;
    The chosen design
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Inspired by the switch boards of early phone systems, we chose to make rows of connections where you&amp;rsquo;d short two rows to make two selections at once. One row for the channels, one for the volumes.&lt;/p&gt;
&lt;p&gt;We went with magnets instead of jacks to make it look more modern and be quick to use.&lt;/p&gt;
&lt;h3 id=&#34;software&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#software&#34;&gt;
        ##
    &lt;/a&gt;
    Software
&lt;/div&gt;
&lt;/h3&gt;
&lt;p&gt;Netradio functionality can be solved in so many ways on the command line. From the most basic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;cvlc url / aplay url / mplayer url&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The medium:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.musicpd.org/&#34;&gt;Music Player Daemon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;screen0.jpg&#34; alt=&#34;A cli frontend to MPD.&#34;&gt;&lt;/p&gt;
&lt;p&gt;The advanced:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.woutervanwijk.nl/pimusicbox/&#34;&gt;Musicbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;browse-desktop.png&#34; alt=&#34;Musicbox. Image from woutervanwijk.nl.&#34;&gt;&lt;/p&gt;
&lt;p&gt;The latter one is a brilliant use of the rPi. In short it includes out of the box support for &lt;a href=&#34;https://www.spotify.com/&#34;&gt;Spotify&lt;/a&gt;, &lt;a href=&#34;https://music.google.com/&#34;&gt;Google Music&lt;/a&gt;, &lt;a href=&#34;http://www.last.fm/&#34;&gt;Last.fm&lt;/a&gt;, internet radio, &lt;a href=&#34;https://soundcloud.com/&#34;&gt;SoundCloud&lt;/a&gt;, local files, files from network shares. Controlled by a webUI or any existing MPD app.&lt;/p&gt;
&lt;p&gt;We chose Musicbox.&lt;/p&gt;
&lt;p&gt;To be continued&amp;hellip;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
