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

      
    

    
    <lastBuildDate>Sat, 21 May 2022 00:00:00 +0000</lastBuildDate>
    
    <atom:link href="/blog/tags/esp8266/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Bad battery choice</title>
      <link>/blog/posts/bad_battery_choice/</link>
      <pubDate>Sat, 21 May 2022 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/bad_battery_choice/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://shelly.cloud/&#34;&gt;Shelly&lt;/a&gt; sells a smarthome sensor called &lt;a href=&#34;https://shelly.cloud/products/shelly-door-window-2-smart-home-automation-sensor/&#34;&gt;Door/Window2&lt;/a&gt;. It works well, use wifi, is very configurable and can be used &lt;a href=&#34;https://everythingsmarthome.co.uk/5-reasons-your-smart-home-should-be-local/&#34;&gt;locally, without cloud&lt;/a&gt;. Unfortunately they&amp;rsquo;ve chosen a weird, expensive battery option, CR123A. It can cost around 70 NOK (~10 USD), and does not exist as a rechargable option. And you need two of them! So what do you do if you only have one left?&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;batterycover.png&#34; alt=&#34;Battery, ESP and cover&#34;&gt;&lt;/p&gt;
&lt;p&gt;Use a single, abundant 18650 instead!&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;18650.png&#34; alt=&#34;Battery, ESP and cover&#34;&gt;&lt;/p&gt;
&lt;p&gt;It fits almost perfectly, has higher capacity and can be found in any discarded electronics. They are always rechargable, and most have an included protection circuit.&lt;/p&gt;
&lt;p&gt;The CR123A is 3 V, so two gives 6 V. A standard lithium-ion is 3.7 V (2.7-4.2 actually), but this still works. The ESP8266, which the sensor is based on, can in theory run on 1.7-3.6V.&lt;/p&gt;
&lt;p&gt;Unfortunately the cover is just a bit too narrow for them. May need to design a new one suitable for 3D printing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;badfit.png&#34; alt=&#34;Battery, ESP and cover&#34;&gt;&lt;/p&gt;
&lt;p&gt;Edit: Never mind, someone beat me to it! &lt;a href=&#34;https://www.thingiverse.com/thing:5278675&#34;&gt;Shelly DW2 18650 Case&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Solar panel to DC heater</title>
      <link>/blog/posts/solar_panel_to_dc_heater/</link>
      <pubDate>Mon, 16 May 2022 00:00:00 +0000</pubDate>
      
      <guid>/blog/posts/solar_panel_to_dc_heater/</guid>
      <description>&lt;p&gt;In Norway electricity is the most popular form of heating for households at 96% (&lt;a href=&#34;https://publikasjoner.nve.no/rapport/2014/rapport2014_85.pdf&#34;&gt;source&lt;/a&gt;). Pure 230V AC is a very high-level energy, and we don&amp;rsquo;t really need that precision for heating.&lt;/p&gt;
&lt;p&gt;This is a project to see if easy, not-perfect, locally generated energy can be used to lower the heating bill.&lt;/p&gt;
&lt;p&gt;Disclamer: this is mostly for fun. A more economic aproach would be insulation, heat pump, put on a sweater, etc.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;outside.png&#34; alt=&#34;outside&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-plan&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-plan&#34;&gt;
        #
    &lt;/a&gt;
    The plan
&lt;/div&gt;
&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;             ┌──────────────────┐
             │                  │
             │                  │
   ┌─────┐   │  ┌──────────┐    │
   │     │   │  │          │    │
   │ PV  ├───┼──┤ Heater   │    │
   │     │   │  │          │    │
   └─────┘   │  └──────────┘    │
             └──────────────────┘
                  House
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A solar panel, with no controller or inverter, and a heater. Dumping heat in a basement that needs heating all year round.&lt;/p&gt;
&lt;h2 id=&#34;the-problem&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#the-problem&#34;&gt;
        #
    &lt;/a&gt;
    The problem
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;Solar panels have an optimal voltage, where they produce most power, and this changes based on light conditions. A proper controller (&lt;a href=&#34;https://en.wikipedia.org/wiki/Maximum_power_point_tracking&#34;&gt;MPPT&lt;/a&gt;) is expensive, so I want to see if I can do without.&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;Specs of my first setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.sparelys.no/solcellepanel-180watt-all-black-mono&#34;&gt;180 Watt panel&lt;/a&gt; (the most power I could get in a normal 12 Volt range)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.aliexpress.com/item/1005001315418433.html&#34;&gt;100 Watt heater with fan&lt;/a&gt; (I&amp;rsquo;ve ordered a 180 W model too)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/ESP8266&#34;&gt;ESP8266&lt;/a&gt; for statistics (with &lt;a href=&#34;https://esphome.io/components/sensor/dht.html&#34;&gt;dht22&lt;/a&gt;, &lt;a href=&#34;https://esphome.io/components/sensor/ads1115.html&#34;&gt;ads1115&lt;/a&gt;, &lt;a href=&#34;http://www.hotmcu.com/wiki/ACS712_Current_Sensor&#34;&gt;acs712&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&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;&lt;img src=&#34;outside.png&#34; alt=&#34;outside&#34;&gt;&lt;/p&gt;
&lt;p&gt;The panel, wall mounted in a very sub-optimal location (shadows from people, walls).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;sensors.png&#34; alt=&#34;sensors&#34;&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Panel connections in&lt;/li&gt;
&lt;li&gt;Current sensor&lt;/li&gt;
&lt;li&gt;Relay to switch off&lt;/li&gt;
&lt;li&gt;Connections out to load&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;heater.png&#34; alt=&#34;heater&#34;&gt;&lt;/p&gt;
&lt;p&gt;The heater with fan. It&amp;rsquo;s tiny. The heater is a &lt;a href=&#34;https://en.wikipedia.org/wiki/Self-regulating_heater&#34;&gt;PTC&lt;/a&gt;, so I don&amp;rsquo;t think it will pose a threat if the fan dies. In front of it is a white temperature sensor, to see that we actually produce heat.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;breadboard.png&#34; alt=&#34;breadboard&#34;&gt;&lt;/p&gt;
&lt;p&gt;A micro controller, with an external ADC. The micro controller generates graphs and control the relay. The resistors by the ADC are a voltage divider, to scale down the ~23 Volts the panel can deliver to a safe 5 Volts the ADC can measure.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;potential.png&#34; alt=&#34;Potential&#34;&gt;&lt;/p&gt;
&lt;p&gt;Unloaded the panel will be at ~22 V. With this load one can see that the output is only good when the potential keeps between 12-14 V. I have no way of controlling the voltage, except for changing to a smaller load (less effective heater).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;effect.png&#34; alt=&#34;Effect&#34;&gt;&lt;/p&gt;
&lt;p&gt;Graph of power output. Totally this gave around 600 Wh on a mostly sunny day.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;temperatures.png&#34; alt=&#34;Temperatures&#34;&gt;&lt;/p&gt;
&lt;p&gt;Green line is the temperature sensor next to the heater. Measuring right next to the fan, I&amp;rsquo;ve seen it at ~60 °C, but this one is placed a bit away. The orange line is a temperature sensor elsewhere in the room. The room seems to rise about 2 °C during a day. The gray field is cloudyness in percent.&lt;/p&gt;
&lt;h2 id=&#34;conclution&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#conclution&#34;&gt;
        #
    &lt;/a&gt;
    Conclution
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;So far this seems to generate heat as it should, but it will have to run for a pretty long time to earn back the ~1700 NOK I paid for the panel. I will test with different heaters to see if I find something that works better. A posibility is also to have several heater that can be switched on with relays based on the power available. A kind of very crude MPPT.&lt;/p&gt;
&lt;h2 id=&#34;thermal&#34; &gt;
&lt;div&gt;
    &lt;a href=&#34;#thermal&#34;&gt;
        #
    &lt;/a&gt;
    Thermal
&lt;/div&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;hotspot.png&#34; alt=&#34;Hotspots&#34;&gt;&lt;/p&gt;
&lt;p&gt;The panel seems to have some significant hotspots. Normal? Cheap panel?&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;relay.png&#34; alt=&#34;Relay&#34;&gt;&lt;/p&gt;
&lt;p&gt;The relay is producing heat, but waste heat isn&amp;rsquo;t a problem in this case. =)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;esp.png&#34; alt=&#34;ESP&#34;&gt;&lt;/p&gt;
&lt;p&gt;The relay is pulling more current than a GPIO from the ESP is rated for, so it&amp;rsquo;s voltage regulator is getting very hot. Should probably fix that.&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>
    
  </channel>
</rss>
