tag:blogger.com,1999:blog-26857870416143761032024-03-11T01:14:42.075-07:00ludzincStill getting it wrong the first time.Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.comBlogger60125tag:blogger.com,1999:blog-2685787041614376103.post-80773698767113771042019-07-14T01:42:00.000-07:002019-07-14T02:07:19.803-07:00My Garage Door Opener - Software<h2>
Where the Rubber Hits the Road</h2>
<div>
(This is a post in my series about my Garage Door Opener. Yes I wrote a series. About a Garage Door Opener. Check it out:</div>
<div>
<ul>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-hardware.html">Hardware</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-software.html">Software</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html">Installation</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">Easier ESP8266 Development</a></li>
</ul>
<div>
Thanks!)</div>
</div>
<div>
<br /></div>
<div>
Okay, I'm an Electronics Engineer by trade, and while most of my projects are hardware-centric, I'm also comfortable with firmware and C.</div>
<div>
<br /></div>
<div>
So, naturally, I thought I'd give ESP8266 web page development a shot. <a href="https://www.youtube.com/watch?v=uL0ROeZw7wA">How hard can it be</a>?</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZUywyMlQmr2V3o8vdqMFRaxyTXKJbabFDTwgDKu_vQe2KMdAAUGdqqfUjWUjnGAY4LlS530Ag62ZyOuV5NyjcdONFR4GEGjdn1f3mYXuwdTOHJcBb18uwjjnETTUsxOdanSHJwaMVmiq/s1600/00.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="618" data-original-width="893" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZUywyMlQmr2V3o8vdqMFRaxyTXKJbabFDTwgDKu_vQe2KMdAAUGdqqfUjWUjnGAY4LlS530Ag62ZyOuV5NyjcdONFR4GEGjdn1f3mYXuwdTOHJcBb18uwjjnETTUsxOdanSHJwaMVmiq/s320/00.PNG" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Well, let's just say it took me longer than expected and I learnt quite a few lessons. Which I wrote about <a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">here</a>. </div>
<div>
<br />
But first, some requirements - this unit has to work independently of an internet connection. No cloud service, no If This Then That, it just has to work. it can act as an access point and you connect to it directly, or it can sit on your home network and be access by any device there.<br />
<br />
Also, any device that works with HTML5 can be used to access control this unit. So iPhone, Android, Desktop of choice will work with it. No special app needed!<br />
<br />
Okay, lets go!</div>
<div>
<a name='more'></a><h2>
I Suck at Art</h2>
<div>
First big tip - use some one else's template. I used <a href="https://bootswatch.com/slate/">Bootswatch Slate</a> after this previous attempt:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPH1VI8VtHIprL0JzU5ZM1ERz_5lrKtTXIluOkxDEJX10dg7cvQFDShlM2sagR3u2axyeiM8ShNyR-C6D6qB-SEResAcYCYCg804WELIDQGUHQ7FTrw0isVLQOIRqwRiutzYOnrDZcuwgq/s1600/DemoScreen00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPH1VI8VtHIprL0JzU5ZM1ERz_5lrKtTXIluOkxDEJX10dg7cvQFDShlM2sagR3u2axyeiM8ShNyR-C6D6qB-SEResAcYCYCg804WELIDQGUHQ7FTrw0isVLQOIRqwRiutzYOnrDZcuwgq/s320/DemoScreen00.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Yeah, pretty ugly... </div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgWXe6OWMyclwrLjHM90k-E9yCxEr3noohzxAqEt-33_5L1JS-tNeKZeGQ5yuuHekrXj9qDEpihVz3Q_HX4Tnp2tGFRkJmxidMl14lc3mm9S_5xHHm7qbzX70tmTVXEQp52P-tOGEyBzjW/s1600/IMG_1468.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgWXe6OWMyclwrLjHM90k-E9yCxEr3noohzxAqEt-33_5L1JS-tNeKZeGQ5yuuHekrXj9qDEpihVz3Q_HX4Tnp2tGFRkJmxidMl14lc3mm9S_5xHHm7qbzX70tmTVXEQp52P-tOGEyBzjW/s320/IMG_1468.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
See - much nicer. There's a great many templates out there so I'm sure you can easily find something that suits you. </div>
<h3 style="clear: both; text-align: left;">
Stuck Button Dilemma</h3>
<div>
One issue was that with the default behavior of Twitter Bootstrap (what Bootswatch is based on) is that once a button is pressed, it stays pressed.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcJNawHs7qDiH3J3XRPhNAT-biCuDfKDEIcker23-Sgfegre_anTvvl_eOvRD9co-CAS6tSXTEBuMlsvYORzgjZyQNY7W1QUYOWlZNM4NyqVJcoYMgi6EqZnrYfVbikrxiyFhyphenhyphen8YomdZf/s1600/IMG_1482%255B1%255D.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcJNawHs7qDiH3J3XRPhNAT-biCuDfKDEIcker23-Sgfegre_anTvvl_eOvRD9co-CAS6tSXTEBuMlsvYORzgjZyQNY7W1QUYOWlZNM4NyqVJcoYMgi6EqZnrYfVbikrxiyFhyphenhyphen8YomdZf/s320/IMG_1482%255B1%255D.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This wasn't going to do - I wanted the button to reset and I'll be dammed if I could sort this out with default behaviors.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Long story short, it was down to how 'hover' works on mobile devices. When on a desktop, you pass over a button with a mouse, and the button changes colour to reflect this behaviour. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When on a mobile device, the system has no idea where your finger is, and thus when you press something, it retains 'hover' and 'active' states until you press something else. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
CSS Mods</h3>
<div>
So, the first step is to disable 'hover' for buttons in the bootswatch css file like this:</div>
<div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;">.</span>btn,
<span style="color: #333333;">.</span>btn:hover {
border<span style="color: #333333;">-</span>color: rgba(<span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #6600ee; font-weight: bold;">0.6</span>);
text<span style="color: #333333;">-</span>shadow: <span style="color: #0000dd; font-weight: bold;">1</span>px <span style="color: #0000dd; font-weight: bold;">1</span>px <span style="color: #0000dd; font-weight: bold;">1</span>px rgba(<span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #0000dd; font-weight: bold;">0</span>, <span style="color: #6600ee; font-weight: bold;">0.3</span>);
}
<span style="color: #333333;">.</span>btn<span style="color: #333333;">-</span>default {
background<span style="color: #333333;">-</span>image: <span style="color: #333333;">-</span>webkit<span style="color: #333333;">-</span>linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#484e55, #3a3f44 60%, #313539);</span>
background<span style="color: #333333;">-</span>image: linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#484e55, #3a3f44 60%, #313539);</span>
background<span style="color: #333333;">-</span>repeat: no<span style="color: #333333;">-</span>repeat;
<span style="color: #007020;">filter</span>: progid:DXImageTransform<span style="color: #333333;">.</span>Microsoft<span style="color: #333333;">.</span>gradient(startColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff484e55'</span>, endColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff313539'</span>, GradientType<span style="color: #333333;">=</span><span style="color: #0000dd; font-weight: bold;">0</span>);
<span style="color: #007020;">filter</span>: none;
}
<span style="color: #333333;">/*</span> <span style="color: #333333;">.</span>btn<span style="color: #333333;">-</span>default:hover { <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> default slate hover <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> background<span style="color: #333333;">-</span>image: <span style="color: #333333;">-</span>webkit<span style="color: #333333;">-</span>linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#020202, #101112 40%, #191b1d); */</span>
<span style="color: #333333;">/*</span> background<span style="color: #333333;">-</span>image: linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#020202, #101112 40%, #191b1d); */</span>
<span style="color: #333333;">/*</span> match normal button view <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> background<span style="color: #333333;">-</span>image: <span style="color: #333333;">-</span>webkit<span style="color: #333333;">-</span>linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#484e55, #3a3f44 60%, #313539);</span>
background<span style="color: #333333;">-</span>image: linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#484e55, #3a3f44 60%, #313539); */</span>
<span style="color: #333333;">/*</span> comment <span style="color: #007020;">all</span> out so active <span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">is</span> displayed only <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> background<span style="color: #333333;">-</span>repeat: no<span style="color: #333333;">-</span>repeat; <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> <span style="color: #007020;">filter</span>: progid:DXImageTransform<span style="color: #333333;">.</span>Microsoft<span style="color: #333333;">.</span>gradient(startColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff020202'</span>, endColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff191b1d'</span>, GradientType<span style="color: #333333;">=</span><span style="color: #0000dd; font-weight: bold;">0</span>); <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> <span style="color: #007020;">filter</span>: none; <span style="color: #333333;">*/</span>
<span style="color: #333333;">/*</span> } <span style="color: #333333;">*/</span>
<span style="color: #333333;">.</span>btn<span style="color: #333333;">-</span>primary {
background<span style="color: #333333;">-</span>image: <span style="color: #333333;">-</span>webkit<span style="color: #333333;">-</span>linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#8a9196, #7a8288 60%, #70787d);</span>
background<span style="color: #333333;">-</span>image: linear<span style="color: #333333;">-</span>gradient(<span style="color: #888888;">#8a9196, #7a8288 60%, #70787d);</span>
background<span style="color: #333333;">-</span>repeat: no<span style="color: #333333;">-</span>repeat;
<span style="color: #007020;">filter</span>: progid:DXImageTransform<span style="color: #333333;">.</span>Microsoft<span style="color: #333333;">.</span>gradient(startColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff8a9196'</span>, endColorstr<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">'#ff70787d'</span>, GradientType<span style="color: #333333;">=</span><span style="color: #0000dd; font-weight: bold;">0</span>);
<span style="color: #007020;">filter</span>: none;
}
</pre>
</td></tr>
</tbody></table>
</div>
<br /></div>
<div>
Note I only disabled the hover effect on the default button (as that's all I'm using). All other buttons are unaffected.<br />
<br />
<h3>
Javascript Magic</h3>
</div>
<div>
But that's not all - I also needed some Javascript to reset the active state on a button - but after 500ms so you get the feedback that you actually pressed it.<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #333333;">//**************************************************************************</span>
<span style="color: #333333;">//</span> Show button <span style="color: black; font-weight: bold;">is</span> pressed by keepinng active <span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">asserted</span> <span style="color: #008800; font-weight: bold;">for</span> <span style="color: #0000dd; font-weight: bold;">500</span>ms
<span style="color: #333333;">//**************************************************************************</span>
<span style="background-color: #ffaaaa; color: red;">$</span>(document)<span style="color: #333333;">.</span>ready(function() {
<span style="color: #333333;">//</span> console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">'Document ready.'</span>)
<span style="background-color: #ffaaaa; color: red;">$</span>(<span style="background-color: #fff0f0;">'.btn'</span>)<span style="color: #333333;">.</span>click(function() {
<span style="background-color: #ffaaaa; color: red;">$</span>(this)<span style="color: #333333;">.</span>addClass(<span style="background-color: #fff0f0;">'active'</span>);
setTimeout(function() {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"removing class active"</span>);
<span style="background-color: #ffaaaa; color: red;">$</span>(<span style="background-color: #fff0f0;">'.active'</span>)<span style="color: #333333;">.</span>removeClass(<span style="background-color: #fff0f0;">'active'</span>);
}, <span style="color: #0000dd; font-weight: bold;">500</span>);
});
});
</pre>
</td></tr>
</tbody></table>
</div>
<br />
I can here you asking why didn't I also remove the 'Hover' class and the answer is God knows I tried, but it was beyond me. I believe that 'hover' is a pseduo-class and that's why I fail to remove it as required programmatically using Javascript.<br />
<br />
Again, if you know how to do this, please let me know!</div>
<h2>
Home Page</h2>
</div>
<div>
Once connected to the WiFi, and if using an apple product, or have <a href="https://en.wikipedia.org/wiki/Bonjour_(software)">Bonjour</a> <a href="https://support.apple.com/downloads/bonjour_for_windows">for Windows</a> installed on your Windows box, you can connect to the Garage Door Interface (GDI) by typing in http://gdi.local in your address bar. </div>
<div>
<br /></div>
<div>
Android uses need to know the IPaddress - unless there's a better way that I don't know about how to connect out there....</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqo_aLN9qWYxcQxIbx_1nP7mrJDopRwEvdpHQ867f9RO4chnMxdtHLD8FGETTXWLlAf-0NQxbVAaAa6p-8ykGfIiYf5XpXaGpXcY6a_nksf1oOSIwREMpAEWB4Yt9IQPb4JUfy_89xp7ty/s1600/IMG_1465.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqo_aLN9qWYxcQxIbx_1nP7mrJDopRwEvdpHQ867f9RO4chnMxdtHLD8FGETTXWLlAf-0NQxbVAaAa6p-8ykGfIiYf5XpXaGpXcY6a_nksf1oOSIwREMpAEWB4Yt9IQPb4JUfy_89xp7ty/s320/IMG_1465.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The home screen shows buttons for each of the door and light relay controls, and also the current temperature of the garage. </div>
<h2 style="clear: both; text-align: left;">
Calibration</h2>
<div class="separator" style="clear: both; text-align: left;">
However, whenever measuring ambient temperature of an electronic device, you have to take into account any self heating. So, over time I measured the reported temperature of GDI against a thermometer. I actually did this over many months, to capture the extreme swings of Summer and Winter -and came up with the following results:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSBohqI7jFZ_s8U_lgJeOB4J6RUXCdvuvnw6LbEYJ1cN08FyLt5HSfNSgHtClo2sbmIpjzTEqp0_k8KtgwuH7k2_pi7g-gp-6RorMOnJ8hM5SR5UBM6Mjrxksi0JWqjZISCTPvDSzvagI-/s1600/calibration.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="565" data-original-width="913" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSBohqI7jFZ_s8U_lgJeOB4J6RUXCdvuvnw6LbEYJ1cN08FyLt5HSfNSgHtClo2sbmIpjzTEqp0_k8KtgwuH7k2_pi7g-gp-6RorMOnJ8hM5SR5UBM6Mjrxksi0JWqjZISCTPvDSzvagI-/s320/calibration.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I was expecting some sort of curve, where I'd need some polynomial but was pleasantly surprised to find out how linear the response is. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Performing a <a href="https://en.wikipedia.org/wiki/Linear_regression">regression</a> on this data (using google sheets) I came up with the following results:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style></div>
<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="border-collapse: collapse; border: none; font-family: arial,sans,sans-serif; font-size: 10pt; table-layout: fixed; width: 0px;" xmlns="http://www.w3.org/1999/xhtml"><colgroup><col width="100"></col><col width="100"></col><col width="100"></col><col width="100"></col></colgroup><tbody>
<tr style="height: 21px;"><td data-sheets-value="{"1":2,"2":"Slope"}" style="overflow: hidden; padding: 2px 3px 2px 3px; vertical-align: bottom;">Slope</td><td data-sheets-formula="=slope(R[0]C[-2]:R[98]C[-2],R[0]C[-3]:R[98]C[-3])" data-sheets-value="{"1":3,"3":0.9855148192564671}" style="overflow: hidden; padding: 2px 3px 2px 3px; text-align: right; vertical-align: bottom;">0.9855148193</td><td data-sheets-value="{"1":2,"2":"Intercept"}" style="overflow: hidden; padding: 2px 3px 2px 3px; vertical-align: bottom;">Intercept</td><td data-sheets-formula="=intercept(R[0]C[-4]:R[98]C[-4],R[0]C[-5]:R[98]C[-5])" data-sheets-value="{"1":3,"3":-4.340888584318417}" style="overflow: hidden; padding: 2px 3px 2px 3px; text-align: right; vertical-align: bottom;">-4.340888584</td></tr>
</tbody></table>
<br />
I then immediately ignored all the decimal points and went with a slope (multiplier) of 1 and an intercept (offset) of 4.3 - perfect!<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmqdoBcYr4HyyqqBgpTRK_xDsoW5RIfMId3dSTvYejh2VYzVCN8g2GafWfEOGAbvzPC1q9mLd3VmVufQ7CrDarYRedJd2XfTDLy0BY21YJtUeiEZdQcHXMhjEwz-njTq9gsJ9oZJayJXpc/s1600/IMG_1475.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmqdoBcYr4HyyqqBgpTRK_xDsoW5RIfMId3dSTvYejh2VYzVCN8g2GafWfEOGAbvzPC1q9mLd3VmVufQ7CrDarYRedJd2XfTDLy0BY21YJtUeiEZdQcHXMhjEwz-njTq9gsJ9oZJayJXpc/s320/IMG_1475.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From the hamburger menu, you can access the calibration page, and enter your calibration coefficients. Note that the GDI itself doesn't use this information, but rather supplies it with the current temperature reading to the page requesting it, and Javascript in the Webpage performs the calculation and displays the calibrated reading. Nice. </div>
<h2 style="clear: both; text-align: left;">
Network</h2>
<div>
Selecting the Network page from the drop down menu:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT1y1K6v2rAKg7EC16MkDxqqCLpVIJRB9luo0CkGK_rg_7q-MeHIsoK33zeglOU30j7SNf_Sq_zp9IB-xbUaCUgihFhLGwTJCL7mOiFIBQ0Ufco219IBnd1QZCt8_1Y41mr9sfiocMM1Ua/s1600/IMG_1466.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT1y1K6v2rAKg7EC16MkDxqqCLpVIJRB9luo0CkGK_rg_7q-MeHIsoK33zeglOU30j7SNf_Sq_zp9IB-xbUaCUgihFhLGwTJCL7mOiFIBQ0Ufco219IBnd1QZCt8_1Y41mr9sfiocMM1Ua/s320/IMG_1466.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Gives you this page. When loaded it requests a list of SSIDs and the ESP8266 then scans and reports:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodqyEEbG8LslzUeKM2MyBN7cDD7VzfB3FeVotkzN6NYVI5snP1JM9lI2WIl9dsL-8ZIdT3ICilpqB8_8jHpyrNLIDtdlctbAngz2N24iNbXphmpCnPg6QU176ukHB8_fKk1yZBMUL51Qm/s1600/IMG_1467.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodqyEEbG8LslzUeKM2MyBN7cDD7VzfB3FeVotkzN6NYVI5snP1JM9lI2WIl9dsL-8ZIdT3ICilpqB8_8jHpyrNLIDtdlctbAngz2N24iNbXphmpCnPg6QU176ukHB8_fKk1yZBMUL51Qm/s320/IMG_1467.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can then easily select a network (just select any entry in the list) and enter the password ad your in. You can also change the Local Name to whatever you like so you could change it to 'garage' and then connect to http://garage.local afterwards. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdT3fv4hGmQzInHeGpmjGhyphenhyphenxIk7fzAVI4XXrImSGpt5A-Qc0FmxzEA5MGnhuf34D4CicSUHQqPJh7celNABUxXaOYVCzN0zqau7dwUmcPzROPPDV4k8su7d87k7-XjoLK9VqW39NpDGQM/s1600/IMG_1468.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdT3fv4hGmQzInHeGpmjGhyphenhyphenxIk7fzAVI4XXrImSGpt5A-Qc0FmxzEA5MGnhuf34D4CicSUHQqPJh7celNABUxXaOYVCzN0zqau7dwUmcPzROPPDV4k8su7d87k7-XjoLK9VqW39NpDGQM/s320/IMG_1468.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also, you can use this to configure the GDi to connect to your WiFi network when first started as an access point, but you need to power cycle or reboot it to have it take effect. I thought a 'reboot' button was a bit dangerous so you can type in http://gdi.local/reboot.html and it will reboot. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've since realised this is a crappy way of doing it so will add a GUI option to reboot it later. </div>
<h2 style="clear: both; text-align: left;">
More Options</h2>
Because I could, I made the buttons configurable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWUykR0tB5Y8-P7eEkxZcW3MHBYX_S9yPZCLj5OEsgcT_8xA7oksaS9faFTAO9XS2s3eZgQ0nNvvPgkpsZLg6tJvnHZO5PuFhPlMqLy7rKPttejrVeI_H276XXZSXgZCxFATxPLqWVksJp/s1600/IMG_1469.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWUykR0tB5Y8-P7eEkxZcW3MHBYX_S9yPZCLj5OEsgcT_8xA7oksaS9faFTAO9XS2s3eZgQ0nNvvPgkpsZLg6tJvnHZO5PuFhPlMqLy7rKPttejrVeI_H276XXZSXgZCxFATxPLqWVksJp/s320/IMG_1469.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
You can sent them to be hidden (Show, False) if you're not using all of them in your installation, and can change the name. </div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBLSVsbfnNkacCK3udMhpR1HLomTXlYeMWyqP7bPx_lhyrL7kbUbALxCZWtjh15fiBo6cWDfgimC8qG6vXzy_jHmIg6jQ687AUFyMWEEQVsuUawkvkCrh0a7l5UF3Sc4usYev9MFSenTLy/s1600/IMG_1470.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBLSVsbfnNkacCK3udMhpR1HLomTXlYeMWyqP7bPx_lhyrL7kbUbALxCZWtjh15fiBo6cWDfgimC8qG6vXzy_jHmIg6jQ687AUFyMWEEQVsuUawkvkCrh0a7l5UF3Sc4usYev9MFSenTLy/s320/IMG_1470.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Additionally, the on time of the relay can also be set there. For example I have the door relays pulse for 500ms and the light is set to 300,000 ms (5 minutes).</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ6yFhO5q9XyGhPfb80czuzrOdDB_pmrPz-ZhyphenhyphenW05gMN9CyqJDSa1WkXAek_QAkgS28DxPSuXT-cJjFJtQ18IIRUsxLxr-M8o4XrOi4ASw21HleeXlVwNjLkOkau8CGvHWhp9MpU3DfQja/s1600/IMG_1472.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ6yFhO5q9XyGhPfb80czuzrOdDB_pmrPz-ZhyphenhyphenW05gMN9CyqJDSa1WkXAek_QAkgS28DxPSuXT-cJjFJtQ18IIRUsxLxr-M8o4XrOi4ASw21HleeXlVwNjLkOkau8CGvHWhp9MpU3DfQja/s320/IMG_1472.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once you save your settings you get confirmation and you can return to the home page. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzdIZbf-fv8839gOfGN-lYN9RLLzpX1Pt1rjumPFoKly78bHuLi5r-bO2Zid_9zPAAiooe_uRR4Qjo5t8umq2src6ef6If-g5cHSQADWnLGCq3OVuP8C_4ulOlH3RNzC5l38IhtnmK0AyX/s1600/IMG_1473.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzdIZbf-fv8839gOfGN-lYN9RLLzpX1Pt1rjumPFoKly78bHuLi5r-bO2Zid_9zPAAiooe_uRR4Qjo5t8umq2src6ef6If-g5cHSQADWnLGCq3OVuP8C_4ulOlH3RNzC5l38IhtnmK0AyX/s320/IMG_1473.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can see here that I've now hidden an unused button now. </div>
<h2 style="clear: both; text-align: left;">
Brightness Control</h2>
<div>
Lastly, I also have a page where I can set the PWM value of the front buttons. Very handy. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0CkrVpAqPps3y82tc_xTxPCcZPZOjrHOrTp1Yiipy5vdp3cAi8FMQVeu00r5rzxQGOve4pxaaSm2oFeshbjeesbPf45rwxEcgUXSZbeZPCYn9Pvwp02ZGLi013FLUE0zYEPmMX10NCNlT/s1600/IMG_1474.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0CkrVpAqPps3y82tc_xTxPCcZPZOjrHOrTp1Yiipy5vdp3cAi8FMQVeu00r5rzxQGOve4pxaaSm2oFeshbjeesbPf45rwxEcgUXSZbeZPCYn9Pvwp02ZGLi013FLUE0zYEPmMX10NCNlT/s320/IMG_1474.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And of course, you can get a copy of the code yourself from <a href="https://github.com/ludzinc/Low-Cost-Labs/tree/master/GDI_DELUX_V3">Github</a>. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've not gone into details as to how the code works - take a look at it for details - as I covered most of my lessons / thoughts in this post <a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">here</a>. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But in summary:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Will boot as access point and let you connect and then configure your wifi credentials</li>
<ul>
<li>or you can keep it as an access point, it will still work, choice is yours!</li>
</ul>
<li>Is discoverable on your network using <a href="https://tttapa.github.io/ESP8266/Chap08%20-%20mDNS.html">mDNS</a></li>
<ul>
<li>Android users will need to deduce it's IP address</li>
</ul>
<li> Uses JSON files to transfer data using websockets and to read a config file at startup</li>
<li>Uses the SPIFFs file system to store webapges, and will serve them when fetched by name</li>
<li>Also blinks LEDs. </li>
</ul>
<br />
<h2 style="clear: both; text-align: left;">
Living With It</h2>
<div class="separator" style="clear: both; text-align: left;">
As with most of my projects here, I primarily did this to learn something new, and that was a crapload, so that alone made this project worth doing to me.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
However, it's also come in handy! I've been locked out of the house while gardening and rather than wail at the door, it's a snap to pop the door open using my phone (I often listen to podcasts while outside). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also occasionally take the train to work - and it's liberating to leave my keys at home knowing I can get into the house via the garage. Neat! Yes, you should get one too :)</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
</div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com2tag:blogger.com,1999:blog-2685787041614376103.post-14017452462811333992019-07-13T20:49:00.002-07:002019-07-14T02:07:10.222-07:00My Garage Door Opener - Hardware<h2>
The Nitty-Gritty (Hardware)</h2>
<div>
<div>
(This is a post in my series about my Garage Door Opener. Yes I wrote a series. About a Garage Door Opener. Check it out:</div>
<div>
<ul>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-hardware.html">Hardware</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-software.html">Software</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html">Installation</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">Easier ESP8266 Development</a></li>
</ul>
<div>
Thanks!)</div>
</div>
</div>
<div>
In a <a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html">previous long winded post</a> I detailed the history of how I built and installed my IoT Garage Door controller. However, that blog was light on technical details, and I'm going to cover those here.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2MUz4MZAprXXPFtxLR23e3RLntW9mbOv0BS5_SQbAR-ig2sjceIxfSHnliAr7kyOvlddFQp0U4eXR8NxmGDdTGKBd8-LBGqKumgGeMxvf7FqItzofnWs-iwQtV66A0mk4PrTAQO8WT9UZ/s1600/IMG_1180.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2MUz4MZAprXXPFtxLR23e3RLntW9mbOv0BS5_SQbAR-ig2sjceIxfSHnliAr7kyOvlddFQp0U4eXR8NxmGDdTGKBd8-LBGqKumgGeMxvf7FqItzofnWs-iwQtV66A0mk4PrTAQO8WT9UZ/s320/IMG_1180.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<br />
<h2>
Overview</h2>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGANMBfxXQL5N9Qb3HWZhNorWM2SbvHljO_hLuQvJnDlLgm1M1e8r_SFMyVeu7gxr_sv91c8my8qkfyh1wYHkCS28pcfexO-Oqk_2XA-Q06q6ETZvPcryH6mibDv4qIoZEP6W5k7zfb4t/s1600/GDI+00.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="783" data-original-width="1188" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGANMBfxXQL5N9Qb3HWZhNorWM2SbvHljO_hLuQvJnDlLgm1M1e8r_SFMyVeu7gxr_sv91c8my8qkfyh1wYHkCS28pcfexO-Oqk_2XA-Q06q6ETZvPcryH6mibDv4qIoZEP6W5k7zfb4t/s320/GDI+00.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The above block diagram helps explain the architecture of my build. I like having this at the start of my projects, as it helps communicate what I'm trying to do. And it's light-years in front of a lot of open-source schematics which are just a bunch of netlabels spread randomly over a page (end rant). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, working from the Top Left, P1 is the programming header (my bad for not labeling it) for the ESP-12 and his fans out to two other blocks - for the Door Buttons block there's two PWM lines for controlling the brightness of the buttons, and and I2C line to the Peripherals block. </div>
<h3 style="clear: both; text-align: left;">
ESP-12 Module</h3>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZw40hZ36pBibxqeQvprrO93b117DYMorDocFSYTy95Rv83WUq0fCf8bUbWXUB1alqhmLAbU6s8PAdqOCo7F8SiQoMvCJUvd1_8_pBwdeeiJ-Mgkfj3YSR0BtxoO9YdO9dETjSW8u9AhMG/s1600/GDI+02.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="785" data-original-width="1189" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZw40hZ36pBibxqeQvprrO93b117DYMorDocFSYTy95Rv83WUq0fCf8bUbWXUB1alqhmLAbU6s8PAdqOCo7F8SiQoMvCJUvd1_8_pBwdeeiJ-Mgkfj3YSR0BtxoO9YdO9dETjSW8u9AhMG/s320/GDI+02.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Looking at the ESP-12 sheet, you can see it's a pretty standard implementation of an ESP-12 module. There's te required pull ups for GPIO_0 and Reset (RST), I2C pull-up resistors and a reset line for the MCP23017 IO expander. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Finally, there's R7 / R8 as a voltage divider from the 12V supply rail so I can monitor if the supply rail is low. Well, I might in the future, it's not actually implemented at this time...</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Note how I clamp the VSUPPLY line to only 0.7V through the use of the BAV99. The upper limit on the ADC input on the ESP8266 is 1V, and this gives a good margin of error to protect it. As it's also exposed to the outside world it is possible that spikes coudl come in on this line, and the other half of the BAV99 will clamp these negative going spikes. Nifty. </div>
<h3 style="clear: both; text-align: left;">
IO and Other Peripherals </h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr9UmyyTwrvj7IT_8NHGhEfuQSEvGjXWSj2wkrxNcEmS_eBkIx6nYkV5Zz_79r4qfBVYpWzlkFiGab1hrgOaIlP4lYIelteXSnwUAhvLMZAgGwNLcQ8Q1xiCjUTSDiIuqiKkM1Ab8RPYeY/s1600/GDI+04.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="784" data-original-width="1189" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr9UmyyTwrvj7IT_8NHGhEfuQSEvGjXWSj2wkrxNcEmS_eBkIx6nYkV5Zz_79r4qfBVYpWzlkFiGab1hrgOaIlP4lYIelteXSnwUAhvLMZAgGwNLcQ8Q1xiCjUTSDiIuqiKkM1Ab8RPYeY/s320/GDI+04.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next, peripherals. As I was planning on using more IO than what the ESP-12 supports, I used an MCP23017 IO expander to cover the shortfall. I'll get more specific on how I use that later. I also have 4 on board status LEDs and those lines are also broken out to the lid of the controller where the same colour LEDs are used to show status there. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The IO expander has a fair bit to do:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>There's 4 inputs from the front panel buttons, which are used to either open a door or toggle the light control relay</li>
<li>There's an additional 4 inputs that serve as 'remote buttons' - this was so I can integrate the unit with my home alarm (the remote on that has buttons that can be used to control the roller door)</li>
<li>There's 4 outputs to drive the relays</li>
<li>There's 4 outputs to drive the status LEDs</li>
</ol>
<div>
There's also two other devices on the I2C bus being a TCN75 temperature sensor and a DS1338 Real Time Clock.</div>
<div>
<br /></div>
<div>
I've found the temperature sensor to be useful, but needed some calibration to offset some self heating. </div>
<div>
<br /></div>
<div>
As for the Real Time Clock, it's loaded, but never tested. If I can connect to WiFi I can easily get the time from the Web, or even as an access point I can nab the time from the device that connects. So it's redundant and wont be used. </div>
<div>
<br /></div>
<h3>
Power Supply </h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiinUpFSIOkLgFoyiqbG-uNOA1cUPKxldKsx82DLwrtb5S8nsABOpN3-mPszMHzq2ihfAVbLfigZJfol07CrXQWzhFWChwKqq_nScaMQAiDk_xaEkiNn8DqXVeqcahkW4KwHjbQMXDa1h7v/s1600/GDI+01.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="783" data-original-width="1188" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiinUpFSIOkLgFoyiqbG-uNOA1cUPKxldKsx82DLwrtb5S8nsABOpN3-mPszMHzq2ihfAVbLfigZJfol07CrXQWzhFWChwKqq_nScaMQAiDk_xaEkiNn8DqXVeqcahkW4KwHjbQMXDa1h7v/s320/GDI+01.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
Self explanatory really. I've designed this unit to run off 12V for a couple of reasons.</div>
<div>
<br /></div>
<div>
<ol>
<li>I have a lot of 12V supplies lying around</li>
<li>The relays I have are 12V </li>
<li>12V gives a nice overhead (error margin) when operating the relays. If run off the 5V rail, when switching relays there's a risk that the power draw may cause the rail to sag and reset the ESP module. </li>
</ol>
<div>
I also use an LM2596 buck regulator to supply a 3V3 rail for the ESP module, and D1 is for reverse power protection. </div>
</div>
<div>
<br /></div>
<div>
However, you might want to know what D2 and D3 are for.</div>
<div>
<br /></div>
<div>
D3 provides a rail for the relays, that wont draw power from C1 - keeping the buck regulator supplied and ticking to keep the ESP-12 running. </div>
<div>
<br /></div>
<div>
D2 is there to similarly isolate the power supplied to the remote switch inputs.<br />
<br />
Why all this effort to isolate supplies? It's almost as if this has bit me in the past before....</div>
<div>
<br /></div>
<div>
And lastly, there's F1, a polyswitch fuse to stop any disaster burning my house down. </div>
<div>
<br /></div>
<h3>
Relays</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqq4R6ipIvh_gyQrlgE33baYckc4T2XoMVEM7OkkiIdHz82x4IjAu7HehOr0VB2fv6LDWVy19TQjf_8Jaas_My6ZPYTVSoD1JooDaNSSPRsEd3WJ9E0vnXtvjQ77Zp3sH4YdAA-M3HG2kF/s1600/GDI+03.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="788" data-original-width="1190" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqq4R6ipIvh_gyQrlgE33baYckc4T2XoMVEM7OkkiIdHz82x4IjAu7HehOr0VB2fv6LDWVy19TQjf_8Jaas_My6ZPYTVSoD1JooDaNSSPRsEd3WJ9E0vnXtvjQ77Zp3sH4YdAA-M3HG2kF/s320/GDI+03.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
One of the safest ways to interface your system to another black-box (unknown) is to use '<a href="https://en.wikipedia.org/wiki/Dry_contact">dry contact</a>' relays. However as I wanted to make this board dual-purpose (visions of controlling watering solenoids come to mind) I added some solder blob links so I could alter their function.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwporEfcd0dIXCniOOdn3ztpY6LWK3Ahc25BwnHHY5YlYumr9ewH1tmS3cqzaxlqPi_LV_vY23HUYkdUz4tkF5G1TaD5cm_QRrSVVhCugE-upGkj-20qg0DjwGrjkYQxn9erP92VyKbjOh/s1600/relays.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="755" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwporEfcd0dIXCniOOdn3ztpY6LWK3Ahc25BwnHHY5YlYumr9ewH1tmS3cqzaxlqPi_LV_vY23HUYkdUz4tkF5G1TaD5cm_QRrSVVhCugE-upGkj-20qg0DjwGrjkYQxn9erP92VyKbjOh/s320/relays.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If I were to short LINK3 in the picture above, I'll have the dry contact I need to control my roller door.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
However if I connect LINK1 and LINK 5, I can now switch 12V by the relay and send this out the corresponding contact. I'll up-rev my board in the near future to remove this feature as:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>Controlling watering solenoids with 12V DC wont work (they are 24V AC) so I may make a version using SSRs rather than Relays and</li>
<li>I'd set up the 12V output for testig (drove some LEDs) forgot about this when<a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html"> I installed the unit in my garage</a> and promptly blew up my roller door motor controllers. Ouch. </li>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86WIN_nJaaB8QzQsYcMh-i80I09fcsLUuvdpJZKcFWF5W-HzZqUAl1VAitU-HUzlZIcAIhuVEsa3re3HSl4I6TmXoFGAPmRqwgEiOgCxqsvrvpX0nB7f5VkDcWvVGzeQL_XdbxDLvj-T1/s1600/PCB+05.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="507" data-original-width="772" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86WIN_nJaaB8QzQsYcMh-i80I09fcsLUuvdpJZKcFWF5W-HzZqUAl1VAitU-HUzlZIcAIhuVEsa3re3HSl4I6TmXoFGAPmRqwgEiOgCxqsvrvpX0nB7f5VkDcWvVGzeQL_XdbxDLvj-T1/s320/PCB+05.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After sending my roller doors to God, I took a look at the layout - and concluded that the clearances that the solder blobs offer aren't that good and could lead to inadvertent disaster in the future. So I removed the trace between 12V and DRY. Learn from my bad, people. </div>
<h3 style="clear: both; text-align: left;">
Remote Switches</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh27QkrA0W5nT5CpdE80bSvyeWKNsVWYkPRCOJXn-iub7Rehgw_VaGo6VBWV9ctGvbrgM47gocfml2OiLgSHvdCm18yCrZ-gVlEo-1IoJftKIKHLrt2tp24jQnYvw0l0HucXybLrKEI1d64/s1600/GDI+05.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="783" data-original-width="1187" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh27QkrA0W5nT5CpdE80bSvyeWKNsVWYkPRCOJXn-iub7Rehgw_VaGo6VBWV9ctGvbrgM47gocfml2OiLgSHvdCm18yCrZ-gVlEo-1IoJftKIKHLrt2tp24jQnYvw0l0HucXybLrKEI1d64/s320/GDI+05.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For the remote switches I went away from what you often see. There's many examples out there where the power rail is output on a terminal. and you run that through your button to a resistor divider onto the input of your micro.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This 'works' but exposes the unit to the following shortfalls:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>You need transient suppression. Induced voltages both positive and negative can come down the line and ruin your day. The BAV99 clamps will shunt negative voltages to ground and too high a positive spike to the 3V3 rail.</li>
<li>Shorts on the rail. If you were to take the 12V out directly on a terminal, you could have a failure mode where you short the rail to ground and you'll (at best) reset your device due to a momentary powerr blip, or at worse cook your power supply / torch you board. A 22k resistor in series with 12V limits the current to a tiny 500uA, no bad can come from this!</li>
</ol>
<br />
<h3 style="clear: both; text-align: left;">
Top Board Interface</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtcs7qxFB2pOh4ED_zju1jr2pxi0BQsVj4TGlB7q91WkvHSUYBrySfHQ-4sjkEKcFDrywRa7daagu8k1JVj6XjeCU24xcvyeRyOaIFeKBwDVXAih21VwqGfZPKx4nbLiEwePhY3ztUOw4Q/s1600/IMG_1413.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtcs7qxFB2pOh4ED_zju1jr2pxi0BQsVj4TGlB7q91WkvHSUYBrySfHQ-4sjkEKcFDrywRa7daagu8k1JVj6XjeCU24xcvyeRyOaIFeKBwDVXAih21VwqGfZPKx4nbLiEwePhY3ztUOw4Q/s320/IMG_1413.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
On the lid of the controller I added 4 illuminated buttons and 4 status LEDS.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>RED: Power OK</li>
<li>Yellow: External Input active (Remote button pressed)</li>
<li>Green: Blinks at 1 Hz to show system is running </li>
<li>Blue: WiFi connected</li>
</ul>
<div>
(When acting as an access point, the Blue LED blinks and the Green LED is on).</div>
<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF-kL6NE8q8Ykzf0qjnH-zHtVoXriSfiaHsvPiLv8cyOyWWiKRwlDinWw-wiw47frXRpfm2zlzIIKqtG1mEa7Cl_FJvE8cPn4VY0tUKX03L04cNITu9Xe52Wk7z_N2dSwH10dNP14cFVUg/s1600/GDI+06.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="786" data-original-width="1188" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF-kL6NE8q8Ykzf0qjnH-zHtVoXriSfiaHsvPiLv8cyOyWWiKRwlDinWw-wiw47frXRpfm2zlzIIKqtG1mEa7Cl_FJvE8cPn4VY0tUKX03L04cNITu9Xe52Wk7z_N2dSwH10dNP14cFVUg/s320/GDI+06.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To achieve this, the signals from the IO expander are buffered with 470 resistors to limit current to the status LEDs or with 1k resistors to buffer the button inputs (these are pulled to 3V3 on the carrier board). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The two BUTTON_PWM signals come direct from the ESP-12 and open collector transistors are used to drive the LEDs in the buttons themselves. I used PWM as in the past I'd found the LEDs in the buttons to be quite bright. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV8KDbYOFGTZsqo8A1U3-Kd3MEI33BHBviCSbT97qDSi8exoOc-d91dj5HgQ4oGaJtQsb7hPq5LqpV3BPsPQ9WpREZuWc32m5VdA0TR7G0NlfwqvrWh9oPCRAN8hq45STDIV73yLKkhTg4/s1600/carrier.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="787" data-original-width="1188" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV8KDbYOFGTZsqo8A1U3-Kd3MEI33BHBviCSbT97qDSi8exoOc-d91dj5HgQ4oGaJtQsb7hPq5LqpV3BPsPQ9WpREZuWc32m5VdA0TR7G0NlfwqvrWh9oPCRAN8hq45STDIV73yLKkhTg4/s320/carrier.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
And of course the obligatory 3D render follows.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXVWhfOB_mjSuHdkPBkyiFDeXLbO7F1WkFjHBTdukz8pfq9GTC7Sio3YdcZ43ApqDbvgbkP_D6kX-GXwsDVnm2aWqa0sYm_7iarHDCL7TNCy_e-SByTh-chGssmslJgrKMfkt5arq7-_iU/s1600/carrier+3D.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="784" data-original-width="1217" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXVWhfOB_mjSuHdkPBkyiFDeXLbO7F1WkFjHBTdukz8pfq9GTC7Sio3YdcZ43ApqDbvgbkP_D6kX-GXwsDVnm2aWqa0sYm_7iarHDCL7TNCy_e-SByTh-chGssmslJgrKMfkt5arq7-_iU/s320/carrier+3D.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I love that resources such as GrabCAD and 3D Content Central exist, and the abundance of 3D models you can get for free from there make these renders possible.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've not been able to find 3D models for the push buttons I've used, so if anyone can point me at one I'd be grateful. I do know they are of the R16-530 type and googling that shows these are abundant and cheap.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2VLnG3rG0BWBmWJRx-aA8GvGVqZbqp4lOnt4r1DzU2-hnGIcPZbqiCUWd_AKFaKqTPW9nnJoit5BGZ9O1J4rJCqgh7iBnLxSRrsTJh7hXnzAFN0qn42xyCpx4uzq1bO_m-fIR34nM1Y25/s1600/R16-503+GREEN.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="400" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2VLnG3rG0BWBmWJRx-aA8GvGVqZbqp4lOnt4r1DzU2-hnGIcPZbqiCUWd_AKFaKqTPW9nnJoit5BGZ9O1J4rJCqgh7iBnLxSRrsTJh7hXnzAFN0qn42xyCpx4uzq1bO_m-fIR34nM1Y25/s320/R16-503+GREEN.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
R16-530</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglr7ti8fZ5_vZ_9U-zaJl4t8s_wCbhiRcj0bIT7mJX2DCWnnIWcvOCW6zdZUOteaa4zMc9SHF2BZyudIrOsYM9mzsKZRDZ0ZydwL5CwmBXyChrV-XIv05PyfVOM903_uIPjRqPaiSHGkMj/s1600/R16-503+RED.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="150" data-original-width="336" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglr7ti8fZ5_vZ_9U-zaJl4t8s_wCbhiRcj0bIT7mJX2DCWnnIWcvOCW6zdZUOteaa4zMc9SHF2BZyudIrOsYM9mzsKZRDZ0ZydwL5CwmBXyChrV-XIv05PyfVOM903_uIPjRqPaiSHGkMj/s320/R16-503+RED.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
And with Dimensions. Sweet!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h4 style="clear: both; text-align: left;">
Riser Board</h4>
<div class="separator" style="clear: both; text-align: left;">
And here's the riser board for reference. The riser board carries the status LEDs and there's no passives on this board as the current limiting 470 ohm resistors are on the main board. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQeH6Ei-eWTiGG8o__AkiUhB_lckOVm_kK7utkHsuRqjxqIylUOIQjv9ct84BwQovDJCzv2Uq_RTPxjH9ugUlUakE3ByAiqftyimLkJ5bIQMuW87PYDm4wzw9QEjfSFo1s4PfTyuETWKxf/s1600/riser.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="785" data-original-width="1188" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQeH6Ei-eWTiGG8o__AkiUhB_lckOVm_kK7utkHsuRqjxqIylUOIQjv9ct84BwQovDJCzv2Uq_RTPxjH9ugUlUakE3ByAiqftyimLkJ5bIQMuW87PYDm4wzw9QEjfSFo1s4PfTyuETWKxf/s320/riser.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVcJsyCLF23JO9qSBxGRVr4TxthhdgLJwYPQQ1zsBU_mYAvX788juGYMKOWIqoJ9c9YKTkGpM24QADP4KoK1iCuCvXZA5CTs67fbot7UDjrfQeqleoZ4KvRM41iux2tGKFCSJ020Lah4X9/s1600/Riser+3D.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="639" data-original-width="597" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVcJsyCLF23JO9qSBxGRVr4TxthhdgLJwYPQQ1zsBU_mYAvX788juGYMKOWIqoJ9c9YKTkGpM24QADP4KoK1iCuCvXZA5CTs67fbot7UDjrfQeqleoZ4KvRM41iux2tGKFCSJ020Lah4X9/s320/Riser+3D.PNG" width="298" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Doesn't get much simpler than this. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Putting it Together</h2>
<div>
Layout was straight forward, the third time - and it was handy that the case manufacturer had dimension details on their site. Nothing in CAD format iirc so I have some fun converting PNGs to DXFs (thanks online conversion tools!) and was able to import these into Circuit Maker and ans tidy them up. Well worth the effort and everything just fitted after doing this.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbGQttN_b1OZ7KuoKg-Kxmk03LHYabGzaojyP8a_f2T_66_ED4PrGocOEdSHP1F36Y_qHZFqVMGVpD9wVT4WdLe3-YdHNbMZYrU7omJfK2SpcExOlc2hGTLSfr2OLOYYZMVxcnAFbrc9HO/s1600/PCB+03.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="470" data-original-width="591" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbGQttN_b1OZ7KuoKg-Kxmk03LHYabGzaojyP8a_f2T_66_ED4PrGocOEdSHP1F36Y_qHZFqVMGVpD9wVT4WdLe3-YdHNbMZYrU7omJfK2SpcExOlc2hGTLSfr2OLOYYZMVxcnAFbrc9HO/s320/PCB+03.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Bottom Layer</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglq_4pI3I9z7s_bodjy9L2rB2f9MyAppTkalOOzsImhVZjFCkwlobDpNmFAFsYRxnkxaniX80NGVYbZ5J-DB-v8E2A4ZRkaqWFEEC5j4USvcWRaY5aweaqgEgt0Q6ljpoHzq73mLjvibH5/s1600/PCB+01.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="670" data-original-width="833" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglq_4pI3I9z7s_bodjy9L2rB2f9MyAppTkalOOzsImhVZjFCkwlobDpNmFAFsYRxnkxaniX80NGVYbZ5J-DB-v8E2A4ZRkaqWFEEC5j4USvcWRaY5aweaqgEgt0Q6ljpoHzq73mLjvibH5/s320/PCB+01.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Top Layer</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKnKdJDLUtrOLKiYsItHEQsGmFrHLTFDTN1VNz09JCHMKsXEJSpjDPVyHiummxK2aeKIx4T8EI_ZAF2v8kyyXou4Qn6fSO05L6Vq6TrmDhKqGbZ9D8XUp7CPzHBcsSD7qjWr0rY8OuNksk/s1600/New+Case.webp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="800" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKnKdJDLUtrOLKiYsItHEQsGmFrHLTFDTN1VNz09JCHMKsXEJSpjDPVyHiummxK2aeKIx4T8EI_ZAF2v8kyyXou4Qn6fSO05L6Vq6TrmDhKqGbZ9D8XUp7CPzHBcsSD7qjWr0rY8OuNksk/s320/New+Case.webp" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Case</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPR6AvH8aAG5s7Ds5Pf4wfMO3A1ddeHevtB7NVNOXA7vgMvKvfQ3BoNw4p66Di6s2grVpAhorVuICiQaiaKQzdG4JqQYqvNIy7vPW5WqA1PFm5s7GFNW09bOc-pcz2sI454EwU2VFVPW_p/s1600/case+00.webp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="626" data-original-width="740" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPR6AvH8aAG5s7Ds5Pf4wfMO3A1ddeHevtB7NVNOXA7vgMvKvfQ3BoNw4p66Di6s2grVpAhorVuICiQaiaKQzdG4JqQYqvNIy7vPW5WqA1PFm5s7GFNW09bOc-pcz2sI454EwU2VFVPW_p/s320/case+00.webp" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Case Dimensions</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRI7J3EBWvanMhFQlBCWFi5ps5Sba98tVZWBgB2bHSsDMG7OJoB9R8OYCdo1-PxXaZmhNN24aE_BW_7jcWYZQ89QeHrB_GHk3jbdo0R0A8y0JOcEsEHQmlAnu8a8xoYU62gyoa2SQs89NW/s1600/PCB+02.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="601" data-original-width="963" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRI7J3EBWvanMhFQlBCWFi5ps5Sba98tVZWBgB2bHSsDMG7OJoB9R8OYCdo1-PxXaZmhNN24aE_BW_7jcWYZQ89QeHrB_GHk3jbdo0R0A8y0JOcEsEHQmlAnu8a8xoYU62gyoa2SQs89NW/s320/PCB+02.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
3D Render</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL_xSGgW9gL_l1qbLVG9Y4bHaftbDdneKtIyJREGF7RausfsJ8GP_QI4ZkzB8sKzrz3VXBigPSddVFP-MS1ciLh-_sPmbuyxRFIgpSbJACYFIOZ-GGZg2CWasMgAeb7GOKcoMA72V6Owri/s1600/IMG_1430.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL_xSGgW9gL_l1qbLVG9Y4bHaftbDdneKtIyJREGF7RausfsJ8GP_QI4ZkzB8sKzrz3VXBigPSddVFP-MS1ciLh-_sPmbuyxRFIgpSbJACYFIOZ-GGZg2CWasMgAeb7GOKcoMA72V6Owri/s320/IMG_1430.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd3jMSXzKIsWv32y-BEwCAvxBUX2kkEkaPPmK5od_N7XIy7jPbEOBtG6KpXQf9J4sXjeRAcAy8KbLiPNjfJTUuZ4aggSriwIV7J2NBF8lbJpxLlCVTsSDMhROE5hn9yikaLko7y_Ye44zs/s1600/IMG_1431.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd3jMSXzKIsWv32y-BEwCAvxBUX2kkEkaPPmK5od_N7XIy7jPbEOBtG6KpXQf9J4sXjeRAcAy8KbLiPNjfJTUuZ4aggSriwIV7J2NBF8lbJpxLlCVTsSDMhROE5hn9yikaLko7y_Ye44zs/s320/IMG_1431.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBj6iXjPJ2kQGUd0SObU1tAqQqI9Z2GbPk6s9dIWvFLA2Zhku3NDB22EkDSYpBZGYpv33qcDnKBGQz3skjbBJD_631Awnhik2Yd0L7buaGGnJViRHqlWN0zC1nqWz2nTw-j4TKk41Pa1jO/s1600/IMG_1433.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBj6iXjPJ2kQGUd0SObU1tAqQqI9Z2GbPk6s9dIWvFLA2Zhku3NDB22EkDSYpBZGYpv33qcDnKBGQz3skjbBJD_631Awnhik2Yd0L7buaGGnJViRHqlWN0zC1nqWz2nTw-j4TKk41Pa1jO/s320/IMG_1433.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Assembled. Note the ribbon cable connecting the top board to the bottom board. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNlZ6VgI5ph8XjV1hMZl3p-d1PKjFOyCSmMmah9ysNKyq9oahEwvEzYtGDqfT02fX_VTp58rSGdRINI19K7ZoUVh6hxmWOM6sje4cCQxgT0SsWnr-Ye1L083CuKwSJht3IKQ5WA1kfAlnk/s1600/IMG_1260.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNlZ6VgI5ph8XjV1hMZl3p-d1PKjFOyCSmMmah9ysNKyq9oahEwvEzYtGDqfT02fX_VTp58rSGdRINI19K7ZoUVh6hxmWOM6sje4cCQxgT0SsWnr-Ye1L083CuKwSJht3IKQ5WA1kfAlnk/s320/IMG_1260.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Installed!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
If you want to make your own, or fork my design for your needs, all can be found on <a href="https://workspace.circuitmaker.com/">Circuit Maker</a>:<br />
<br />
<br />
<ul>
<li><a href="https://workspace.circuitmaker.com/Projects/Details/Simon-Ludborzs/GDI">Main Board</a></li>
<li><a href="https://workspace.circuitmaker.com/Projects/Details/Simon-Ludborzs/GDI-Top-Board">Carrier Board</a></li>
<li><a href="https://workspace.circuitmaker.com/Projects/Details/Simon-Ludborzs/GDI-LED-Riser-Board">Riser Board</a></li>
<li><a href="https://workspace.circuitmaker.com/Projects/Details/Simon-Ludborzs/GDI-Top-Board-Drilling-Jig">Drilling Jig</a></li>
</ul>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com7tag:blogger.com,1999:blog-2685787041614376103.post-33932638968591605662019-07-12T06:15:00.001-07:002019-07-12T06:15:05.236-07:00USB CAN<h2 style="clear: both; text-align: left;">
USB TO CAN INTERFACE</h2>
<div>
Back in August 2015 my mate needed a USB to CAN converter. So we rolled our own, and here's some pics of the build. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWMFVglybbiaeUtd_0aEOUh_XF6SGBSuza-Lzdli9kZHcSii4C0jSZS2SICyvtNiB9Bo1d6NULxhh3rAVU6PR8eWNxGAdnsjbVerTautf_5DvUX2PK3LtGTonaVwpcY6XGWwDyw2Khp-mF/s1600/usb-can-001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWMFVglybbiaeUtd_0aEOUh_XF6SGBSuza-Lzdli9kZHcSii4C0jSZS2SICyvtNiB9Bo1d6NULxhh3rAVU6PR8eWNxGAdnsjbVerTautf_5DvUX2PK3LtGTonaVwpcY6XGWwDyw2Khp-mF/s320/usb-can-001.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAIxmfcGEuPV4ouwcLBJp-2S3AUwQR8plN2-_FsQheB0B9_Y83WMCnsZ4Buv64n1BckSbFcUI2FFl7dkgxGnLNW66eZMoJvV93EjgZ7eHFEqE7hyfqSGeY18phCOMH49R5eMysCPdvrObs/s1600/usb-can-002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAIxmfcGEuPV4ouwcLBJp-2S3AUwQR8plN2-_FsQheB0B9_Y83WMCnsZ4Buv64n1BckSbFcUI2FFl7dkgxGnLNW66eZMoJvV93EjgZ7eHFEqE7hyfqSGeY18phCOMH49R5eMysCPdvrObs/s320/usb-can-002.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpP8kcvlD71JypIR-J88SGoLjVh8liqvSy-Bm60k_ix8SnRmVQeYTc3zFqPbBqQWdbKh_a7wseEqAKFQA8KjwdMix9cHSs5NEoEgnDDk-HASJi2C9zJKT8AKXHhHm8ZCTgsN1jGfoaoi_-/s1600/usb-can-003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpP8kcvlD71JypIR-J88SGoLjVh8liqvSy-Bm60k_ix8SnRmVQeYTc3zFqPbBqQWdbKh_a7wseEqAKFQA8KjwdMix9cHSs5NEoEgnDDk-HASJi2C9zJKT8AKXHhHm8ZCTgsN1jGfoaoi_-/s320/usb-can-003.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTuF5eXOmj0HQpxsoDay3DYxYlvKp3mRPNGRo2-7KGkd6Wt1ZXD8DOTy7_er9nPO45WLWRIj1zsQbpxyH6exfay97CdQX-vvn_gJNTXjLxEbDs9CO7sbmZjudziI7rT4-_vZkrD2lsn5Nd/s1600/usb-can-004.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTuF5eXOmj0HQpxsoDay3DYxYlvKp3mRPNGRo2-7KGkd6Wt1ZXD8DOTy7_er9nPO45WLWRIj1zsQbpxyH6exfay97CdQX-vvn_gJNTXjLxEbDs9CO7sbmZjudziI7rT4-_vZkrD2lsn5Nd/s320/usb-can-004.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Let me know if you're interested in more details. </div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-69825897161410199952019-07-12T06:12:00.001-07:002019-08-23T17:10:21.757-07:00Optoisolated Serial Coms<h2 style="clear: both; text-align: left;">
When Digital Meets Analogue</h2>
<div>
For my <a href="http://ludzinc.blogspot.com/2014/07/multi-channel-meter.html">Multi-channel</a> <a href="http://ludzinc.blogspot.com/2014/08/multi-channel-meter-part-2.html">meter</a>, I used some FL817 opto-isolators from Aliexpress. Why? Cheapest I could find.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi35_N4AQvGXLN6WhkGNf5ib9vHvSfiGFkDNBHmPLm0auFdX8zAgXOb9nhP3bHCHbW5XscuFMLdtNoOtGza_yIbwlLZIvMh9kiSdC-xfbc_n9BwBPqiYTIlH81hbW6InStitloRlmvIaBGK/s1600/opto.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="389" data-original-width="730" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi35_N4AQvGXLN6WhkGNf5ib9vHvSfiGFkDNBHmPLm0auFdX8zAgXOb9nhP3bHCHbW5XscuFMLdtNoOtGza_yIbwlLZIvMh9kiSdC-xfbc_n9BwBPqiYTIlH81hbW6InStitloRlmvIaBGK/s320/opto.PNG" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
I was then dissapointed to find that they didn't work at 115200 baud, but did at 9600. I parked that for a while, then decided to take a look at it later. It's now later :)</div>
<div>
<a name='more'></a></div>
<h2>
Not Square Waves</h2>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqg9CUQE-7ofy6QseC583Ek4vWACXQRxvbrpRySjK9ffKfWrdTvxfpFjQ65tmxjxeMzYmMtTmb2KTWCuB8uJYp9YlDx4lU7BawSMJnjUMim2c7rM4d4GPSAwPiQzTbmfyQZXv1dwjCoIv/s1600/IMG_3016.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqg9CUQE-7ofy6QseC583Ek4vWACXQRxvbrpRySjK9ffKfWrdTvxfpFjQ65tmxjxeMzYmMtTmb2KTWCuB8uJYp9YlDx4lU7BawSMJnjUMim2c7rM4d4GPSAwPiQzTbmfyQZXv1dwjCoIv/s1600/IMG_3016.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhwixDDJli2z2dD-eyxrFG7DSb-oUvV5niAT2itXYfTlQ3imEEl7K_7JesVzVnKnFIP5v1rEVpbKSGFMoI63iAc0YYzs-uzK0fRDNqMfolCiALPC1t6QKF4x_pXoA_cq2Xz_Yre0orymE/s1600/IMG_3017.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhwixDDJli2z2dD-eyxrFG7DSb-oUvV5niAT2itXYfTlQ3imEEl7K_7JesVzVnKnFIP5v1rEVpbKSGFMoI63iAc0YYzs-uzK0fRDNqMfolCiALPC1t6QKF4x_pXoA_cq2Xz_Yre0orymE/s1600/IMG_3017.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Firstly, I took a look at the expected waveforms. The orange traces in the plots above are the signals from the microcontrollers UART, and the green are measured at the collector of the output transistor on the opto-isolator. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As you can see, the rise time of the green signals are much slower that the orange.</div>
<h3 style="clear: both; text-align: left;">
MATHS</h3>
<div>
Of course, I took the screen shots above using 19200 baud (probably as this was the speed things started to get flaky).</div>
<div>
<br /></div>
<div>
The pulse length of an 19200 baud signal is (1 / 19200 s) = 52 micro seconds.</div>
<div>
<br /></div>
<div>
However the green pulse takes a while to rise as per this pic:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxL5WecH5BSC2AE5Fc9hL_l44mSpuAP10YRS-BYcuM6HL8W8dGXpqY-vciUmLXpo2Horkh5dcQeN8Ejl064XdCzsNNjeQu6YnqUKlnb8h1pFsxrT0mnY3XaYZw4ZriWZ0GtqBm4qu0y6sC/s1600/baud+error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="259" data-original-width="338" height="245" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxL5WecH5BSC2AE5Fc9hL_l44mSpuAP10YRS-BYcuM6HL8W8dGXpqY-vciUmLXpo2Horkh5dcQeN8Ejl064XdCzsNNjeQu6YnqUKlnb8h1pFsxrT0mnY3XaYZw4ZriWZ0GtqBm4qu0y6sC/s320/baud+error.png" width="320" /></a></div>
<div>
<br /></div>
<div>
The time between the red lines looks to be about 2 1/2 ticks on the scope trace, and the time base (M) is set to 25 us per division, making the delay around (2.5/5)*25us = 12.5us.</div>
<div>
<br /></div>
<div>
Or 24% of a bit (symbol).</div>
<div>
<br /></div>
<div>
As most uarts sample multiple times (Pics sample 8 times the baud rate for example) you need a majority of reads to match to register a bit successfully. At 19200 baud as shown above, you'll get 6 out of 8 samples registering if you're lucky. At 9600 baud (104us) you'll get 7 reliably. </div>
<div>
<br /></div>
<div>
At 115200, where the bit length is 8.7us, the rise time of the opto is more than this and you have zero chance of any bits getting transmitted.</div>
<h2>
RTFM?</h2>
<div>
Ok, so why didn't I see this coming? Well, I didn't look. Remember, just bought the cheapest ones on the day...</div>
<div>
<br /></div>
<div>
So looking at a FL817 datasheet, there's this spec:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqJPmljA6oqz9GesdHjX43l9dtiZj90JKZrZM4pZma8Kz7oflSpWdqbwPpG_moFryPyyc-qJd_jLinzCIGvF1nJN4oFycmkUBYY2L4c-1r3DMD001tf3hFjjp9A-eYLgs-3-Cm5LWqc4uM/s1600/transfer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="734" data-original-width="735" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqJPmljA6oqz9GesdHjX43l9dtiZj90JKZrZM4pZma8Kz7oflSpWdqbwPpG_moFryPyyc-qJd_jLinzCIGvF1nJN4oFycmkUBYY2L4c-1r3DMD001tf3hFjjp9A-eYLgs-3-Cm5LWqc4uM/s320/transfer.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Notice the "TRANSFER CHARACTERISTICS" has a specified 'cut-off frequency' of 80kHz typical. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
9600 Baud is well under this rate, 19200 is within band and 115200 is way too high. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also, the inverse of 80kHz is 12.5us, just like the measured rise time above.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, it's all works as expected, and good to know why.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-67297233891623034272019-07-12T05:25:00.001-07:002019-07-12T05:27:41.668-07:00My ESP-8266 Programmer<h2>
Easier ESP-8266 Programming</h2>
<div>
When I started developing my ESP8266 based projects, I started with ESP-01 modules and built a programming jig to help put the ESP-01 into programming mode. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMWxq6x1ojK6AYCqZaMJy_kUplNpJHcTiy7ubghL_WnLY0pWHiBM4ueWH1GzZf5IIOauOozt7pYFn3rQDpfY3RDviZ193I2mnt7eZ2wdJKFNGUa8j9ZLcBPDWA4QcuQau_hIQVQvBBWFK0/s1600/ESP-01+JIG.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMWxq6x1ojK6AYCqZaMJy_kUplNpJHcTiy7ubghL_WnLY0pWHiBM4ueWH1GzZf5IIOauOozt7pYFn3rQDpfY3RDviZ193I2mnt7eZ2wdJKFNGUa8j9ZLcBPDWA4QcuQau_hIQVQvBBWFK0/s320/ESP-01+JIG.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
And this got tedious, fast. When your Arduino code was ready to be uploaded, you have to hold down GPIO_0, hit RESET and then hit upload. Never mind the fact with this ESP-01 unit you have to then unplug it an place it back in your main board afterwards.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjG74iRrlzS561Ogag1sDxaj6YyP3yOQbV8eWnuEZaqsYi9ZMmamPzACXD_euVdCkANTPcXqXqeOKfy0VYVUvhwr36V9VZnfUvRiqBbcVdCiUgdSm7-TuY92scl5JsdyQNrHvkDv1_fDh/s1600/IMG_1438.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjG74iRrlzS561Ogag1sDxaj6YyP3yOQbV8eWnuEZaqsYi9ZMmamPzACXD_euVdCkANTPcXqXqeOKfy0VYVUvhwr36V9VZnfUvRiqBbcVdCiUgdSm7-TuY92scl5JsdyQNrHvkDv1_fDh/s320/IMG_1438.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So to overcome the tedium, I cooked up this!</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><h2>
Inspiration!</h2>
<div>
When looking for a better way to develop, I came across the <a href="https://wiki.wemos.cc/products:retired:d1_mini_v2.3.0">Wemos D1-Mini</a>. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge0ySZ8RI4TlI6-qZCPY254qPvwzLXAFWpM8Wj3NS9lLjjNY7X0WaOQhX44xm_2JEEIkDvYHE42Wt4jNpCL77aTcVQsqca885fPxFmFbJ0qxU-S8hCqGtgdCT5iDg32s5kwYhfJed6EdvG/s1600/WEMOS+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1600" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge0ySZ8RI4TlI6-qZCPY254qPvwzLXAFWpM8Wj3NS9lLjjNY7X0WaOQhX44xm_2JEEIkDvYHE42Wt4jNpCL77aTcVQsqca885fPxFmFbJ0qxU-S8hCqGtgdCT5iDg32s5kwYhfJed6EdvG/s320/WEMOS+1.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWuuO-R4KCYUyz6ia1cmh26T9dy6lIAt7vyttWpFWjyYJ1J06YJbzwznLxuiW0qF9qRhruaniGyUINMkaCXt8qXZ5cx87IBDli2HAMoJ9PnFTgOH8NXAarvaD47kHZdVdzBWEDr-HV3ELN/s1600/WEMOS+2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1600" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWuuO-R4KCYUyz6ia1cmh26T9dy6lIAt7vyttWpFWjyYJ1J06YJbzwznLxuiW0qF9qRhruaniGyUINMkaCXt8qXZ5cx87IBDli2HAMoJ9PnFTgOH8NXAarvaD47kHZdVdzBWEDr-HV3ELN/s320/WEMOS+2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This little board is a beauty, and simply connects to your PC via a Micro-USB cable and code is uploaded aromatically when you compile. Nice, but how?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Looking at the Wemos schematic:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDB0ezloh5UngtDtQpQFfRDkUW9slJZo_lUI7HdGSCEkitsVrxqnnskjy4NoxLeDh-i4vlQfN9ZXLK07DflD46_k8WMuwun_xgpdIdAN8PUn25VE0m6hPsOqzlmzhjLJX4Ah-zQTSlQ3My/s1600/d1+sch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="712" data-original-width="954" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDB0ezloh5UngtDtQpQFfRDkUW9slJZo_lUI7HdGSCEkitsVrxqnnskjy4NoxLeDh-i4vlQfN9ZXLK07DflD46_k8WMuwun_xgpdIdAN8PUn25VE0m6hPsOqzlmzhjLJX4Ah-zQTSlQ3My/s320/d1+sch.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It's not that obvious what's going on.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVkG0ZS6kP7c08FJ91fbEtZQfq4z-lDehHsZWrlHBBpAb992cUEXQoPkg9uVk2TNP2VgCYKK8PjLIyv8o1Me9nVfrypMf2JaSfqT45gLCngl2vkuWUW-LCAIVovxGk4yRu6Tu6ynsuQCFj/s1600/d12sch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="422" data-original-width="943" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVkG0ZS6kP7c08FJ91fbEtZQfq4z-lDehHsZWrlHBBpAb992cUEXQoPkg9uVk2TNP2VgCYKK8PjLIyv8o1Me9nVfrypMf2JaSfqT45gLCngl2vkuWUW-LCAIVovxGk4yRu6Tu6ynsuQCFj/s320/d12sch.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There is some connection between the CH340G and the dual transistor package, and unsure as to how it works, I googled it. From the <a href="https://wiki.ai-thinker.com/_media/esp8266/esp8266_series_modules_user_manual_v1.1.pdf">AI_Thinker manual</a> on the ESP modules, there's this reference:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4OD45l-_n1ZB1gPKanFgbERw0NZPYGnmNqoal7B-cZD-HDtA81vvpLIJJs9KqzqN8Rcg7tiN-dC1O8qYiPs9WTkIYdPDKoZAc_fs0nZ0k5xtOAeuaZJPuiydQgjA2GhrGp1b04p1C1K_e/s1600/esp_prog.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="457" data-original-width="612" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4OD45l-_n1ZB1gPKanFgbERw0NZPYGnmNqoal7B-cZD-HDtA81vvpLIJJs9KqzqN8Rcg7tiN-dC1O8qYiPs9WTkIYdPDKoZAc_fs0nZ0k5xtOAeuaZJPuiydQgjA2GhrGp1b04p1C1K_e/s320/esp_prog.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Ah ha! This drawing makes it's operation seem much clearer, where the DTR and RTS lines set GPIO_0 low and pulse EN (reset) as required, and then go 'HI-Z' to allow normal operation of the pins. Nice. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, I decided to make my own board that carried a CH340G and some transistors - like this:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl3VPFnMy6SLKqaDVSGpjWgAJ-Q2by3jDIEDtaTW5Y7OGrSbbb0O1LouBqXcvtFVMNaXnBCZSSGe7yBH9VPeJz8rD4FKXrPJuqt328r-G7jAumEMDxWa21Xi19S1xq4kX2IoD52OhDRw0c/s1600/sch+00.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="781" data-original-width="1187" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl3VPFnMy6SLKqaDVSGpjWgAJ-Q2by3jDIEDtaTW5Y7OGrSbbb0O1LouBqXcvtFVMNaXnBCZSSGe7yBH9VPeJz8rD4FKXrPJuqt328r-G7jAumEMDxWa21Xi19S1xq4kX2IoD52OhDRw0c/s320/sch+00.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It's pretty simple - it takes 5V from the USB socket, adds a 3V3 regaultor for the CH340G and some Rx / Tx <a href="https://en.wikipedia.org/wiki/Blinkenlights">blinkenlights</a>. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then I knocked <a href="https://circuitmaker.com/Projects/Details/Simon-Ludborzs/ESP8266-Programmer">this </a>up in Circuit Maker. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPkY_o4VUp0m45gJryW98DYn0clxFhZ4EsyiP3cLCDtfm6T0RCzkc_Y8OMkd56wgpsIcAs3g9SS0VpvkvYDbEG-ww21tuIne_En13UHpGRdOf9niSkkP4-87Cr1eOWVwBLPq439IpsMmz-/s1600/my+programmer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="765" data-original-width="1447" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPkY_o4VUp0m45gJryW98DYn0clxFhZ4EsyiP3cLCDtfm6T0RCzkc_Y8OMkd56wgpsIcAs3g9SS0VpvkvYDbEG-ww21tuIne_En13UHpGRdOf9niSkkP4-87Cr1eOWVwBLPq439IpsMmz-/s320/my+programmer.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
Boards were then ordered, built and tested. To make it work, I simply set the Arduino IDE to think it's using a Wemos D1-Mini.</div>
<div>
<br /></div>
<div>
Although I haven't tested it but I'd suspect that selecting NodeMCU would work too as they also show the transistor network in their schematic.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5FRUh9J72eOGZjJTvtRyQhWKakgKNvX_YoKPaVayOFUSWGPGKOmj2b9TC8WjbeSwboQ14ijxI-l4RaqEnBbQh34knquMcxD_joiSShC6MjSkk4ZYVdj6NccOJks6uzD_WaRZQpZD2ejdi/s1600/NODEMCU.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="724" data-original-width="1024" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5FRUh9J72eOGZjJTvtRyQhWKakgKNvX_YoKPaVayOFUSWGPGKOmj2b9TC8WjbeSwboQ14ijxI-l4RaqEnBbQh34knquMcxD_joiSShC6MjSkk4ZYVdj6NccOJks6uzD_WaRZQpZD2ejdi/s320/NODEMCU.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
So I collected my bits:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU4W0FQMCOcvS-mntLTjCb20RBrSA9JPspJlGgZmFhhDk47ThHSNYnPCdd1blxRYRqIb0jofbTEy1xg-ofRaNrIKUwbyxT5PpCRo8H4BMikF93WqV7HCyIbWFxBIEUMWLjcf7thyphenhyphen3csn1J/s1600/IMG_1441.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU4W0FQMCOcvS-mntLTjCb20RBrSA9JPspJlGgZmFhhDk47ThHSNYnPCdd1blxRYRqIb0jofbTEy1xg-ofRaNrIKUwbyxT5PpCRo8H4BMikF93WqV7HCyIbWFxBIEUMWLjcf7thyphenhyphen3csn1J/s320/IMG_1441.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And built my board, plus a cable to hook it up to my target. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtz5WGB5pmgWVhy50_aH5Y9fEf7-Bre6nvZmgkjkIQ23Oy9QTSl59wOkgaH9V41M87xInc4t7PJjirL7GvvwHWzWZDtpkjC-3AODb-Fy-7slcsDYh2erIgCawnQrSuQ9Ww5nt3oERIDweO/s1600/IMG_1439.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtz5WGB5pmgWVhy50_aH5Y9fEf7-Bre6nvZmgkjkIQ23Oy9QTSl59wOkgaH9V41M87xInc4t7PJjirL7GvvwHWzWZDtpkjC-3AODb-Fy-7slcsDYh2erIgCawnQrSuQ9Ww5nt3oERIDweO/s320/IMG_1439.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In development, the programmer could hook up to to my board via the onboard header, but in the final installation I added a 5 pin socket to allow me to plug in for firmware upgrades should the OTA updater fail. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtz5WGB5pmgWVhy50_aH5Y9fEf7-Bre6nvZmgkjkIQ23Oy9QTSl59wOkgaH9V41M87xInc4t7PJjirL7GvvwHWzWZDtpkjC-3AODb-Fy-7slcsDYh2erIgCawnQrSuQ9Ww5nt3oERIDweO/s1600/IMG_1439.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtz5WGB5pmgWVhy50_aH5Y9fEf7-Bre6nvZmgkjkIQ23Oy9QTSl59wOkgaH9V41M87xInc4t7PJjirL7GvvwHWzWZDtpkjC-3AODb-Fy-7slcsDYh2erIgCawnQrSuQ9Ww5nt3oERIDweO/s320/IMG_1439.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Programmer and Cable</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsl2PcqQ9S8YKoquTYDuvrJS_mGBfmBp5OhsKSL2zz-M2u6gLkOAqXiIw6paEIgxdsSVprFPjvfDNGoLUyc_i5M_YQqmL8E6n8n7fn2MCt1tj9mtLYtFam75Fce_hchz7YhMzQjH17XJjE/s1600/GDI+HOOKUP.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="834" data-original-width="575" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsl2PcqQ9S8YKoquTYDuvrJS_mGBfmBp5OhsKSL2zz-M2u6gLkOAqXiIw6paEIgxdsSVprFPjvfDNGoLUyc_i5M_YQqmL8E6n8n7fn2MCt1tj9mtLYtFam75Fce_hchz7YhMzQjH17XJjE/s320/GDI+HOOKUP.PNG" width="220" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
5 Pin Socket Wired to Garage Door Opener</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
\<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2bNtGXbyqo-239W-EAT_8CJvitoAEZHdzt-vA5GSV0cfQVBSBrpU_Th2JtszMSL0yfLzvoFUEPy8dEOgCei04EBI8xAjxyZfvm-wci_x4S_AAFPdwG7xQc96iJTZUNGe02cMqAIeTT8Tx/s1600/IMG_1442.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2bNtGXbyqo-239W-EAT_8CJvitoAEZHdzt-vA5GSV0cfQVBSBrpU_Th2JtszMSL0yfLzvoFUEPy8dEOgCei04EBI8xAjxyZfvm-wci_x4S_AAFPdwG7xQc96iJTZUNGe02cMqAIeTT8Tx/s320/IMG_1442.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
And Field Installation of Programmer for Upgrades</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This little programming adaptor makes programming my designs much less tedious, and also helps reduce parts count as I don't need anything on board except a 5 pin header. Neat!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-91586200448437517862019-07-12T03:10:00.002-07:002019-07-14T02:07:07.881-07:00Yet Another IoT Garage Door Opener<h2>
Job Done, Finally!</h2>
<div>
<div>
(This is a post in my series about my Garage Door Opener. Yes I wrote a series. About a Garage Door Opener. Check it out:</div>
<div>
<ul>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-hardware.html">Hardware</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-software.html">Software</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html">Installation</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">Easier ESP8266 Development</a></li>
</ul>
<div>
Thanks!)</div>
</div>
</div>
<div>
<br /></div>
<div>
Okay, so I've written a little about this before. Back in 2013 I added a light to my garage door, and then started to work out how to control it with my phone.</div>
<div>
<br /></div>
<div>
Let me (finally) tell you how I did it!</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf43qBMK3s39TuLe3uEyecGY6gv04VwcHnzNHHnKf15Ouy8gZOMfz4l3Svv5j7HRvTtly_T-22UsRosbunjAZo0TEO7pYvXROfAF5hY0fkp-Nroe_cwO0li8cCQmMa4oOZumunD07OBscJ/s1600/8D65A10A-A00C-414C-8E93-BBF0FAD89308.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf43qBMK3s39TuLe3uEyecGY6gv04VwcHnzNHHnKf15Ouy8gZOMfz4l3Svv5j7HRvTtly_T-22UsRosbunjAZo0TEO7pYvXROfAF5hY0fkp-Nroe_cwO0li8cCQmMa4oOZumunD07OBscJ/s320/8D65A10A-A00C-414C-8E93-BBF0FAD89308.jpeg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Installed and Ready to Go!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><br />
<br />
<h2>
Design the First:</h2>
<div>
After grabbing some EDP-01 modules from eBay, I thought the way forward would be to simply use the two free GPIO's to drive relays salved across my roller door control buttons.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3-gdsDjKpnBJp4vzIeejOIXrLMTIm4HoIG9wjOsOKSHS8e-LGpfhP5_qpZRZDU8kvJ6dBL0gaBlFPN1x-kI1BU2SNh65BOrwsOT-bz1l56LV3mxq6InMYotdPULqOH_yfuIpuvYMkfpye/s1600/ESP01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="325" data-original-width="550" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3-gdsDjKpnBJp4vzIeejOIXrLMTIm4HoIG9wjOsOKSHS8e-LGpfhP5_qpZRZDU8kvJ6dBL0gaBlFPN1x-kI1BU2SNh65BOrwsOT-bz1l56LV3mxq6InMYotdPULqOH_yfuIpuvYMkfpye/s320/ESP01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But, this approach rapidly ran into a few issues:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>Of the 8 pins available, 2 are power, one is Reset, one is CHPD which is connected to VCC</li>
<li>Tx and Rx are required for programming - so it's awkward to build those into a design.</li>
<li>That leaves GPIO_0 and GPIO2 where:</li>
<ol>
<li>GPIO_) has to be held low when resettting the module to put it into programming mode and</li>
<li>GPIO_2 seems to randomly toggle when the module powers up</li>
</ol>
</ol>
<div>
So, all that combined means that if I was to control relays with the ESP-01 module directly, each time it rebooted it would fire the relays and open the garage door. For example, a black out in my neighborhood could open the door for all and sundry. Not an option.</div>
<br />
<div>
<br /></div>
<div>
My solution? Pair it with a microcontroller and send serial commands from the ESP-01 to the micro, and then have the micro control the relays. Simple!</div>
<div>
<br /></div>
<div>
Like this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_skk3IKwmGvWNv-W4s2Zn7lxLqKHiclOqtFWtUSBl_B_z066tTy4OvF1JnQ0tlgc6j-85WUGSOKYr5PRDEL0mNePfk6mdrLZ20yZCUIzRybN1LgeM78cBS6iyW39za-TxaXbbxWzMFSaQ/s1600/GDI+V1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="603" data-original-width="958" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_skk3IKwmGvWNv-W4s2Zn7lxLqKHiclOqtFWtUSBl_B_z066tTy4OvF1JnQ0tlgc6j-85WUGSOKYr5PRDEL0mNePfk6mdrLZ20yZCUIzRybN1LgeM78cBS6iyW39za-TxaXbbxWzMFSaQ/s320/GDI+V1.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I designed it to fit the following case, as it would allow me to easily mount the unit on some DIN rail, for a neat installation. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEYoreM_cE15O_MRSV4YXVMpAW3MG0b7qY7UoOPJ14SZlU-fvm-fX2XuSELYHHj78hqSJFhvI79T26TZIVbqdUJ4j1VpAUil1bNfSyqKJBuwEsrSFSv8CzX-Br7rAfthAZOkyi69VSj7c/s1600/SZOMK+SMALL.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="800" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEYoreM_cE15O_MRSV4YXVMpAW3MG0b7qY7UoOPJ14SZlU-fvm-fX2XuSELYHHj78hqSJFhvI79T26TZIVbqdUJ4j1VpAUil1bNfSyqKJBuwEsrSFSv8CzX-Br7rAfthAZOkyi69VSj7c/s320/SZOMK+SMALL.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And the prototype was built, and pretty much worked.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRcOuX5fM8sZuulhOGPdJLUlegQEZ_rStC8ar4eSuVUnphd2UxAmO45QzmE_NHahO0uzE2w5KcIDHEWfy4SHHUhoHDbxaR3hIp4jpClMeu00A9vUXnM5eLD2FWK56co-uKAobhaACQT25C/s1600/IMG_1420.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRcOuX5fM8sZuulhOGPdJLUlegQEZ_rStC8ar4eSuVUnphd2UxAmO45QzmE_NHahO0uzE2w5KcIDHEWfy4SHHUhoHDbxaR3hIp4jpClMeu00A9vUXnM5eLD2FWK56co-uKAobhaACQT25C/s320/IMG_1420.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
But there were a few issues, as always.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Programming it was a pain in the butt. I had to pull the ESP module to upload code and there was no way to trigger it locally (no button to push!).</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
It *did* give me a platform to cut my teeth on HTML / CSS and Javascript, but I was soon onto Version 2.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
(Files for this can be found <a href="https://workspace.circuitmaker.com/Projects/Details/Simon-Ludborzs/Garage-Door-Interface">here</a>.<br />
<br />
<h2>
Design the Second</h2>
</div>
My first design was put together without too much thought, other than to put it somewhere that can drive my current <a href="http://ludzinc.blogspot.com/2013/07/ive-seen-light.html">garage door opener / light</a> which while very useful was, to be frank, ugly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkhLWLX4eRyjyc0Mcj2PElQjK6n585SmDgL7Zk9vNWPR1RjQN-KnkEz7Gkg8fNn4DrX24d6ZdFBN4ckGhhnkMuvLcVE2vHHcNVAEN9A0La07hOODTC7ji1a5jqhTila_vjfnSCqglDFHg/s1600/uggo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1195" data-original-width="1600" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkhLWLX4eRyjyc0Mcj2PElQjK6n585SmDgL7Zk9vNWPR1RjQN-KnkEz7Gkg8fNn4DrX24d6ZdFBN4ckGhhnkMuvLcVE2vHHcNVAEN9A0La07hOODTC7ji1a5jqhTila_vjfnSCqglDFHg/s320/uggo.jpg" width="320" /></a></div>
<br />
So the requirements for the new opener became:<br />
<br />
<br />
<ol>
<li>Buttons, so it's easy to operate </li>
<li>Have a button to control a light, like the old opener</li>
<li>Use a better, 12V DC light rather than wedging in a mains voltage bulb</li>
</ol>
<br />
So I came up with this!<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDPHGg0_eORsQQJdTBokMy_hxU3VsGvvY_Qpdzoag-zBB2A_YVLi2Udv8CCzqnmwP9jMiHYtFJokCAt-zxJ4sIYNU7Pcj7fPIDxHsHAJZjmA2d8jem059oxJ0yf-r93zNJb6lvImpAlw23/s1600/IMG_4786.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDPHGg0_eORsQQJdTBokMy_hxU3VsGvvY_Qpdzoag-zBB2A_YVLi2Udv8CCzqnmwP9jMiHYtFJokCAt-zxJ4sIYNU7Pcj7fPIDxHsHAJZjmA2d8jem059oxJ0yf-r93zNJb6lvImpAlw23/s320/IMG_4786.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirZZQ4q9f1dFZAEHzvghXRHi_fFQDjjN3Wl8Op79oSOAKwqu3Kh7Rmg_WC4tLLkCTZj75qSlsfmGqPs-e9RAhUm4fmClVC6Sh2ajy3sR4Hmow5wzkaNY2q6i8zhDyiTVOME84sS-XBu09E/s1600/IMG_4787.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirZZQ4q9f1dFZAEHzvghXRHi_fFQDjjN3Wl8Op79oSOAKwqu3Kh7Rmg_WC4tLLkCTZj75qSlsfmGqPs-e9RAhUm4fmClVC6Sh2ajy3sR4Hmow5wzkaNY2q6i8zhDyiTVOME84sS-XBu09E/s320/IMG_4787.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Much Betterer!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To do this I moved up to the next case size (from Aliexpress):</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2AXfgPm5ON0m4_Ca1UJgV5vQBpHBmTfKp-fb3lzDwDtznKg34WYMIhjqCLAOGrU-Sk8V99IXIrRrnq8gg2ogwfcY0HYKkYl4d5zbSGS3ED8ppp2QKp-n3wGcDZ2aqzA-PgvjxgKv8lsoX/s1600/din+case.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="727" data-original-width="1074" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2AXfgPm5ON0m4_Ca1UJgV5vQBpHBmTfKp-fb3lzDwDtznKg34WYMIhjqCLAOGrU-Sk8V99IXIrRrnq8gg2ogwfcY0HYKkYl4d5zbSGS3ED8ppp2QKp-n3wGcDZ2aqzA-PgvjxgKv8lsoX/s320/din+case.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And mounted it inside this enclosure.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbQ8gMmcrVqwPm2FJJGdvnbPxoz1GzAtpe2XaWiBOJvQR-W8rEA6dF1dgRYD4SFMxBzgYwmqWlOQ6uFbXu0LMMxEs1kXn2EqpoaV3tbvSbRwZKlSSTCM9NyupWc5fP62ijNuTAeW_DxwBl/s1600/breaker+case.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="1218" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbQ8gMmcrVqwPm2FJJGdvnbPxoz1GzAtpe2XaWiBOJvQR-W8rEA6dF1dgRYD4SFMxBzgYwmqWlOQ6uFbXu0LMMxEs1kXn2EqpoaV3tbvSbRwZKlSSTCM9NyupWc5fP62ijNuTAeW_DxwBl/s320/breaker+case.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here is where I trial fitted the second prototype. The blue LEDS on the bottom were controlled by the relays that were to slave across the roller door buttons, with the yellow one simulating the to-be-installed light.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjelAtfyOXc_jDmcty0NGXz2E1kr6lKReTAAeI2CILx_8uABcNfyVN39C812_MIntjgKs2GsMWtTGvRvWCJwYzVtTNNkgxEy0SotMMNmLRsu1KpmRaawytzpwtmpRH8FNhpU_r0t4PkhaQK/s1600/IMG_4783.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjelAtfyOXc_jDmcty0NGXz2E1kr6lKReTAAeI2CILx_8uABcNfyVN39C812_MIntjgKs2GsMWtTGvRvWCJwYzVtTNNkgxEy0SotMMNmLRsu1KpmRaawytzpwtmpRH8FNhpU_r0t4PkhaQK/s320/IMG_4783.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The screw terminals on the top are for the power connection *and* remote inputs for each door (I went with three, because even thought I only have two doors, some friends have three) and the light. This is because my home alarm has remote controls that I use to open / close the roller doors. My <a href="http://ludzinc.blogspot.com/2013/07/ive-seen-light.html">post on the light installation</a> explains this in detail. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVPVKe3R1G64VmgNGYRdY2piUUExek5O62nBdQS7yM_l9UxVDGiEUQ20WoM4NC_KAsmthc2eeAlZ9OEmewnLhl5q7skEA9ks439IZAwtR1qnN6_VSKXaWUku1QmL3HjTv8rDSULO8qL7fx/s1600/IMG_1180.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVPVKe3R1G64VmgNGYRdY2piUUExek5O62nBdQS7yM_l9UxVDGiEUQ20WoM4NC_KAsmthc2eeAlZ9OEmewnLhl5q7skEA9ks439IZAwtR1qnN6_VSKXaWUku1QmL3HjTv8rDSULO8qL7fx/s320/IMG_1180.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Beauty shot with blinkenlights.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjTKwhVEYpRV2V299tDdKrfVr4vryyVoR6HHN23UM1lFc7WwzfYy-_LKFzpx_Rc11WCynX1q17Zm3T9KWoEaxOfuxvFgZzPnGEqx0snY6dIVhNsML_hCxd8jd0tn2jqK1DpiOthAQwbsO/s1600/IMG_4787.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjTKwhVEYpRV2V299tDdKrfVr4vryyVoR6HHN23UM1lFc7WwzfYy-_LKFzpx_Rc11WCynX1q17Zm3T9KWoEaxOfuxvFgZzPnGEqx0snY6dIVhNsML_hCxd8jd0tn2jqK1DpiOthAQwbsO/s320/IMG_4787.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Better Fitment shot.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcI2gNVoX1vAUYnwq8sFUfl_We__hqKtAbB2nz5uihluN2SLlmi9lA9NPI_ySodWwLEC-sKWEgIbv2bYT336no3K3NgXXmayVQpKTbQuDXGn1fIZRuybdbQRiPN-T9kgs4jz4UQESwbXeb/s1600/000.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcI2gNVoX1vAUYnwq8sFUfl_We__hqKtAbB2nz5uihluN2SLlmi9lA9NPI_ySodWwLEC-sKWEgIbv2bYT336no3K3NgXXmayVQpKTbQuDXGn1fIZRuybdbQRiPN-T9kgs4jz4UQESwbXeb/s320/000.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Final Installation with eBay '12W' LED Lamp</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Version 2 - The Misses</h3>
<div>
Version 2 came together pretty quickly, and to avoid messy internal wiring, I decided to mount the Buttons and Indicator LEDS on a separate board in the case. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMm5iQu6NxWiD9SyPnw0nGoiGSu9DWS_7YpL3px1WAptcO8qA_0szDVaQfrGS5STuMiN2HdlRU5-wYC5JFP2vcBg1Kz92JWg0NlpwBUMcwVolMVj_VQkJzw1YXswIHQgqUXmFt-aldK3eR/s1600/IMG_1197.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMm5iQu6NxWiD9SyPnw0nGoiGSu9DWS_7YpL3px1WAptcO8qA_0szDVaQfrGS5STuMiN2HdlRU5-wYC5JFP2vcBg1Kz92JWg0NlpwBUMcwVolMVj_VQkJzw1YXswIHQgqUXmFt-aldK3eR/s320/IMG_1197.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS0RNsdQJvvkGtu7voZmTZUFO-xq4_nBUHf4PkNwcztFyuvqA423kSfeq_SqjijniyG-6ZGYYBX2tSqPb-yrgM1bUMI1rfKqZf_fnheA3QM2Hobn6raxNeB0Wfp-aaqzDGCwhAf0AEZXz-/s1600/IMG_1198.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS0RNsdQJvvkGtu7voZmTZUFO-xq4_nBUHf4PkNwcztFyuvqA423kSfeq_SqjijniyG-6ZGYYBX2tSqPb-yrgM1bUMI1rfKqZf_fnheA3QM2Hobn6raxNeB0Wfp-aaqzDGCwhAf0AEZXz-/s320/IMG_1198.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Like this mess inside my old controller....</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
The Buttons themselves are panel mount, so it's a case of install buttons in the lid of the case, and solder the carrier board to them.</div>
<div>
<br /></div>
<div>
Like this:</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgibiGq2QnC9RkLtm3DHtkG7kJVrZFDRo5PBr25hYh6ev4XyDV41VCmCml5dOK3xSb9qkoEUbZO9NSyoM3ijPklVd-Pc-bAA8nvd1a9kiyZiLbGIH0AekjN8nl9LMFdi2kF3AqFzrdskyaB/s1600/mezzanine.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="676" data-original-width="861" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgibiGq2QnC9RkLtm3DHtkG7kJVrZFDRo5PBr25hYh6ev4XyDV41VCmCml5dOK3xSb9qkoEUbZO9NSyoM3ijPklVd-Pc-bAA8nvd1a9kiyZiLbGIH0AekjN8nl9LMFdi2kF3AqFzrdskyaB/s320/mezzanine.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here I'm showing the LED riser board I also used on the carrier board. My first attempt didn't use this riser, but instead I tried Light Pipes. However these were tricky to align and I wasn't that successful at blocking light from one LED bleeding into another light pipe. And in 'wasn't successful' I mean 'I never tried'.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Not to get this image above I had to make the LED riser board as a step model. However I couldn't work out how to do this in <a href="https://workspace.circuitmaker.com/">Circuit Maker</a>, so I laid it out again in Altium and exported it to a step model there. That said, I'll link to all my Circuit Maker files at the end. </div>
<div>
<br /></div>
<div>
To ensure alignment, I also designed a drilling template in Circuit Maker:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhprlgB9CX66aPCm-NiRzj1-oUE77LqHVnSvTXg_VX_GEZuAb_XHJdGuBJFHzKrdW20R_jiSwMapk2PXJ-73OYlgbEQ_Z8YFnqtNjX3OKZcT5olcNsmHSsVFdY0mQWB93dTRv3KnUal8v0S/s1600/drill+template.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="472" data-original-width="723" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhprlgB9CX66aPCm-NiRzj1-oUE77LqHVnSvTXg_VX_GEZuAb_XHJdGuBJFHzKrdW20R_jiSwMapk2PXJ-73OYlgbEQ_Z8YFnqtNjX3OKZcT5olcNsmHSsVFdY0mQWB93dTRv3KnUal8v0S/s320/drill+template.PNG" width="320" /></a></div>
<div>
<br /></div>
<div>
Of course I can't find it now... I milled this at work and it snapped nicely into the top of the case.</div>
<div>
<br /></div>
<div>
I drilled 1.5mm location holes with the jig, and then opened up all holes to 3mm (to suit the LEDs) and then finished the LED holes with a step drill.</div>
<div>
<br /></div>
<div>
Then, with the case hole drilled, I also had a nice jig for locating the LEDs in the riser board - like this!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9A5A7VOhvTWHE21koJpgFQjaRSVG_uy6BgvMxheUx_2J9G3fb2WcVP5ja6rA3N_nb3EJ6IOqQ5kR8V8eQKR-gmGvo6seoqcRKC27TpsccAT54IoGQFf9x4FdX7AvOQ3Q2UkRAWmu_m7c_/s1600/F2039EFE-9A5A-4D2B-BD97-5CFEED2FC292.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9A5A7VOhvTWHE21koJpgFQjaRSVG_uy6BgvMxheUx_2J9G3fb2WcVP5ja6rA3N_nb3EJ6IOqQ5kR8V8eQKR-gmGvo6seoqcRKC27TpsccAT54IoGQFf9x4FdX7AvOQ3Q2UkRAWmu_m7c_/s320/F2039EFE-9A5A-4D2B-BD97-5CFEED2FC292.jpeg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My soldering here was a touch unorthodox - I soldered the joints from the top and then sodlered the joints on the other side afterwards. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once the riser was ready, I assembled that on the carrier board:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6MpuGZoZIXPztF_x0mrpOLsQqpzw6IcJKnVuhBonn5vlFDtoMHJy1pKDdSYO5zK0AOiVCgSFAmN003lN63ipRtnAeJoosPYdtm7tUE3SVpPpkyt30sYFiWos090muMiUjPkVASXu00Ey4/s1600/IMG_1178.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6MpuGZoZIXPztF_x0mrpOLsQqpzw6IcJKnVuhBonn5vlFDtoMHJy1pKDdSYO5zK0AOiVCgSFAmN003lN63ipRtnAeJoosPYdtm7tUE3SVpPpkyt30sYFiWos090muMiUjPkVASXu00Ey4/s320/IMG_1178.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZoT2tUu-z36GejNL4a4jN7fPAEUe_hCwzGSoNgszSLQ7efX3VJYbrNLSO5ecWBpU4iraAQTyPsm8TddAveEiHrHLUTIUumxOfQwtZknLbV7Xjwpki1PxZ4FBsf7IhPuXDQ1Aize0mRoam/s1600/IMG_1179.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZoT2tUu-z36GejNL4a4jN7fPAEUe_hCwzGSoNgszSLQ7efX3VJYbrNLSO5ecWBpU4iraAQTyPsm8TddAveEiHrHLUTIUumxOfQwtZknLbV7Xjwpki1PxZ4FBsf7IhPuXDQ1Aize0mRoam/s320/IMG_1179.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then I fitted the CR2032 battery holder and the header for the ribbon cable to connect it to the motherboard. I then loaded the carrier board into the lid, soldering the button pins in place to secure it. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPR2qLtHsKyAQ5bRvsx4b6HPfx__OA0YBsCWIBcd1PyIalrvRA9rpmrXgqBOnKahyQOYQUA9SIOxVU756ZIBmTdKXUsmRZvSfBB-U9mtdNuIZrdHPSil4oAGY8E6uQLY3QI8hBK4WeMMCb/s1600/IMG_3764.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPR2qLtHsKyAQ5bRvsx4b6HPfx__OA0YBsCWIBcd1PyIalrvRA9rpmrXgqBOnKahyQOYQUA9SIOxVU756ZIBmTdKXUsmRZvSfBB-U9mtdNuIZrdHPSil4oAGY8E6uQLY3QI8hBK4WeMMCb/s320/IMG_3764.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This picture above shows the first board revision where the LEDs were to be fitted to the carrier board. Also you'll note that the IDC header is only 12 pins where the following version used 14. Why? Initially I'd tried multiplexing the LEDs but the ESP-12 was too busy processing webpages etc and the multiplexed LEDs would noticeably flicker. Adding extra lines to drive the LEDs directly solved this issue. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Gk7ILFhTtZ7psZ019nGZH0Bh8P03j8n7XyEQbMw-H0u-3OMSOmA_GzZaP8iAZoAmFkm-2dDGqxoIp014f5BocFCe_rhYq9VoGVNroZWhUVofGTLHdvFsuNheGwdIX6woMs49hlDdhVlm/s1600/IMG_1414.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Gk7ILFhTtZ7psZ019nGZH0Bh8P03j8n7XyEQbMw-H0u-3OMSOmA_GzZaP8iAZoAmFkm-2dDGqxoIp014f5BocFCe_rhYq9VoGVNroZWhUVofGTLHdvFsuNheGwdIX6woMs49hlDdhVlm/s320/IMG_1414.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRU1UWOeIamiECpnJAuouXpdoevz_tzS1kcRvVwjZ8nTNbuVcLXiUOiRqH_lCWFcDU_OJ0ruugPz4DJ9Hikc3isDFuueekarwxr6na4BzpQ8ekDa3gkJ2i7HS8frK5v08uGzqj8mO6t1nW/s1600/IMG_3765.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRU1UWOeIamiECpnJAuouXpdoevz_tzS1kcRvVwjZ8nTNbuVcLXiUOiRqH_lCWFcDU_OJ0ruugPz4DJ9Hikc3isDFuueekarwxr6na4BzpQ8ekDa3gkJ2i7HS8frK5v08uGzqj8mO6t1nW/s320/IMG_3765.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here you can see how mounting the LEDs directly on the carrier board (using the full length of the LED legs) had the LEDs falling short of the front of the case. The riser board fixed this issue. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbBa0SvawtMHUe6ark_dqsfxoetQniW-O3Cw-mvkolNJiJqiP7xV5Bi9apsnb-MSKQobWR3LXPBPol464JRS0DNwu_Z047dbi-LmjCcmHrubqpMeTTrhKSAvTeZMPR10FKO5yRT9_iXUbC/s1600/IMG_1415.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbBa0SvawtMHUe6ark_dqsfxoetQniW-O3Cw-mvkolNJiJqiP7xV5Bi9apsnb-MSKQobWR3LXPBPol464JRS0DNwu_Z047dbi-LmjCcmHrubqpMeTTrhKSAvTeZMPR10FKO5yRT9_iXUbC/s320/IMG_1415.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Why the battery? I design in a Real Time Clock into my board, with the thought that I could later add higher level features such as 'Door Open Too Long' or inhibit the door working when no one should be at home (e.g. between 10AM and 2PM) but I soon gave up on this idea. Why possible, I since discovered MQTT and Node Red, so will look at implementing these features using those tools later. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhStuD44DvFuaYgokYZs-EiaEcLd1cDnVgoXELZ0P_9cB7BlAXfoPr6rqJHvwqsHFLKHEGSKUqRIio3_MSvvRGKKTmKezK5AJIzjd5ltXFQE7bUN_w8l_UUStq2DBKvR8W8sz-f76u2Gk9d/s1600/IMG_1417.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhStuD44DvFuaYgokYZs-EiaEcLd1cDnVgoXELZ0P_9cB7BlAXfoPr6rqJHvwqsHFLKHEGSKUqRIio3_MSvvRGKKTmKezK5AJIzjd5ltXFQE7bUN_w8l_UUStq2DBKvR8W8sz-f76u2Gk9d/s320/IMG_1417.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As discussed, a Ribbon cable connects the carrier board to the main board. This is the first iteration and there's a few changes since this version:</div>
<ol>
<li>Like a newb, I'd surrounded the ESP-12 module with a ground plane. So I peeled it back except for the serial lines that lead to the programmer.</li>
<li>You'll see there's three tact switches on the board:</li>
<ol>
<li>Two are used to put the board into programming mode. Trust me, this is a pain in the butt that gets old fast.</li>
<li>The idea for the third was that if held down when power cycled, it was to boot as an access point so you could configure the WiFi settings. I also abandoned this idea!</li>
</ol>
</ol>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jUQ58CM3DQdQcKcYaqvULy5saiav01rG7jKTTVpW457R6Q9AITDQeI8-RiLyiuA7XHrMaOinjCj8bwKKRbV7L4d6HGRabfT8urS6CaKBPi7KBJVewGOJKsXIJ2ma6OdF8L-K_XRb8hFb/s1600/IMG_1418.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jUQ58CM3DQdQcKcYaqvULy5saiav01rG7jKTTVpW457R6Q9AITDQeI8-RiLyiuA7XHrMaOinjCj8bwKKRbV7L4d6HGRabfT8urS6CaKBPi7KBJVewGOJKsXIJ2ma6OdF8L-K_XRb8hFb/s320/IMG_1418.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My second iteration moved the ESP-12 module closer to the front of the board, and had the ground pour aoid it correctly, but still used two tact switches to set the programming mode. I'd dropped the 'force access point mode' button as I'd written the software to start as an access point if it cannot connect to the configured WiFi making this mode redundant. Also, it's this version where I'd realised the issues with multiplexing my LEDs. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
So, I took a third spin of my board:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbC-x_ep41xACAqNgaAdVaZdFKYwZKTAgeC-u9xUURGv9ptB5gLV2ONiDaEO3a9DsAeS_dUNT4ATiE2MKTzb5fxEJQC4gi0LIXmRXhs3NCXdSaDwdQJjbRzP4f8EIsdu5WW0vCqnkBXnt/s1600/IMG_1431.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbC-x_ep41xACAqNgaAdVaZdFKYwZKTAgeC-u9xUURGv9ptB5gLV2ONiDaEO3a9DsAeS_dUNT4ATiE2MKTzb5fxEJQC4gi0LIXmRXhs3NCXdSaDwdQJjbRzP4f8EIsdu5WW0vCqnkBXnt/s320/IMG_1431.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here you'll notice that there are no longer any tact switches on the board. I've broken out the GPIO_0 and Reset lines out on the 5 pin header (along with Ground, Tx and Rx data) and now use<a href="http://ludzinc.blogspot.com/2019/07/my-esp-programmer.html"> an external programmer</a>. This emulates the Ai-Thinker reference design:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaE7-L7VZxT9Yu4xPopaPVI7-LX6_hnfdxTYva17AJlWJVf4PwkE4jNYdHBy5u3AINiWU2G8B1MOvvRDEShX6005oE_uSgoDkOWCCL4wtwfSwJC5OzX1K-6ykKqOV_-Bk56wj_M4BNjFcT/s1600/esp_prog.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="457" data-original-width="612" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaE7-L7VZxT9Yu4xPopaPVI7-LX6_hnfdxTYva17AJlWJVf4PwkE4jNYdHBy5u3AINiWU2G8B1MOvvRDEShX6005oE_uSgoDkOWCCL4wtwfSwJC5OzX1K-6ykKqOV_-Bk56wj_M4BNjFcT/s320/esp_prog.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In this board:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_psT1RxMyku9911kZAYmTg5p6apj7Jp-xIcaQ9vTM8HnLC4JbPHCBdyEI3L6kgnLekQTQMOre-2lFeX3z1FInf2CMWMs5VRkuEFweR4JuemSaES6E-VpLCynkzr4mmX5JBlmPdBr2ZR4/s1600/my+programmer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="765" data-original-width="1447" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_psT1RxMyku9911kZAYmTg5p6apj7Jp-xIcaQ9vTM8HnLC4JbPHCBdyEI3L6kgnLekQTQMOre-2lFeX3z1FInf2CMWMs5VRkuEFweR4JuemSaES6E-VpLCynkzr4mmX5JBlmPdBr2ZR4/s320/my+programmer.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And I'll spill all the details about that in another post. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdVX5ODKPYUD3NnT5J0sNZzL8nh2PZrDuykvPXm3-ZDLcJraGVbMZuvH-gWt2vii4lx19odFc2lByipEI_TXI2kYKzw8CVv_lWnq-SyrZuaMY4pOWmG4FenXCDNYgKLI6oE8DJLUz5R0B2/s1600/IMG_1430.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdVX5ODKPYUD3NnT5J0sNZzL8nh2PZrDuykvPXm3-ZDLcJraGVbMZuvH-gWt2vii4lx19odFc2lByipEI_TXI2kYKzw8CVv_lWnq-SyrZuaMY4pOWmG4FenXCDNYgKLI6oE8DJLUz5R0B2/s320/IMG_1430.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And here's the latest version board with latest version carrier board. </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjse9jfMCqUK-L35vzGOjW6fEqNWSbZnbDl89U6EAv_txrdmlqUgW8hbSSOCCNcNIj0EMewwml7euk1HgCzmPc1fmAFjTmxHpHO-83H2-Xe2thmtCsF1gdSwxzV7sOWrFVDH4quzxsXkfcp/s1600/IMG_1413.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjse9jfMCqUK-L35vzGOjW6fEqNWSbZnbDl89U6EAv_txrdmlqUgW8hbSSOCCNcNIj0EMewwml7euk1HgCzmPc1fmAFjTmxHpHO-83H2-Xe2thmtCsF1gdSwxzV7sOWrFVDH4quzxsXkfcp/s320/IMG_1413.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For this iteration I used Yellow and Blue buttons, but fell back to Red and Green for the final installation. I may swap back to the Yellow / Blue later.</div>
<br />
Aware that this post is getting a little long, I'll go into a more detailed explanation of the schematics / software in another post. But for now I'll focus on the actual install.<br />
<br />
<h2>
Putting it on the Wall</h2>
<div>
First, the old light and switch box had to come out:</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtUVYQ9lLN8StDW2kaqbiEhZ435rGVfUwBqB6jwtpt1wagyqB-WY1eD1sTdFsIri7cwdHz9FO2BUzXa6yx5sg3EjQLLXNkk10ZnW7XX4se7CgY19lszNkHkl1ueRS-kJVFW4aqEhErBxiZ/s1600/A2A66354-6E65-4425-815E-0F921E34E93D.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtUVYQ9lLN8StDW2kaqbiEhZ435rGVfUwBqB6jwtpt1wagyqB-WY1eD1sTdFsIri7cwdHz9FO2BUzXa6yx5sg3EjQLLXNkk10ZnW7XX4se7CgY19lszNkHkl1ueRS-kJVFW4aqEhErBxiZ/s320/A2A66354-6E65-4425-815E-0F921E34E93D.jpeg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9p7T-dPXGSKzfhmmO9526d_dVfJMij_Txs0LICGWCNxDnoF4bS9Dc__ZUus0-WAPYRwe5IQHlF2YArMckjNIKIZ_4oN4Tf7CG0VDR5zQu_d2oOKIdjew9uUzPLOC3XLAUphdkNwWbbQhd/s1600/A78D2AF6-6596-48F7-8F2D-2565A7BDA37E.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9p7T-dPXGSKzfhmmO9526d_dVfJMij_Txs0LICGWCNxDnoF4bS9Dc__ZUus0-WAPYRwe5IQHlF2YArMckjNIKIZ_4oN4Tf7CG0VDR5zQu_d2oOKIdjew9uUzPLOC3XLAUphdkNwWbbQhd/s320/A78D2AF6-6596-48F7-8F2D-2565A7BDA37E.jpeg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And was unceremoniously dumped on the ground. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I used a small MDF board to mount the last controller, and thought I'd do the same again, but also incorporate the eBay LED lamp.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
A quick trial fit of the layout was sorted.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsyhDN0Ctv4y5Re0_DD-8FRyQjo3Qrb9q5Ga4Kc5st1nMdNUAl2IwEPAELERSEqUgVcQc7_jBxD5cfwCAwnILx1oUnQLvwsKWsiy_b0ACYpFxtOxmpRRDScCEVF7ekAo_K0prH2fVUtsXE/s1600/IMG_1202.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsyhDN0Ctv4y5Re0_DD-8FRyQjo3Qrb9q5Ga4Kc5st1nMdNUAl2IwEPAELERSEqUgVcQc7_jBxD5cfwCAwnILx1oUnQLvwsKWsiy_b0ACYpFxtOxmpRRDScCEVF7ekAo_K0prH2fVUtsXE/s320/IMG_1202.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also - note the Raspberry Pi case - I will install this as my Node Red / MQTT server 'soon'. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCQXntTQ9jnkyIcnITVT68cepd5zZ4clLhBIM1LauG4r7KD9rwuMtTkKZfJwzPsqGzJRjUE3D-Vslwl1AwFuwfGMQn2HxdYfBhfRb4OmUWZKJk1YIuXzI6q31Ub-UpNgT17OYWqIn_eJ34/s1600/IMG_1207.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCQXntTQ9jnkyIcnITVT68cepd5zZ4clLhBIM1LauG4r7KD9rwuMtTkKZfJwzPsqGzJRjUE3D-Vslwl1AwFuwfGMQn2HxdYfBhfRb4OmUWZKJk1YIuXzI6q31Ub-UpNgT17OYWqIn_eJ34/s320/IMG_1207.JPG" width="240" /></a></div>
<br />
Installed, wired up.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijcgiWk144CYOGb_YmvdgD6PCu2YunAHvaiiXFnC1K7OVf-y3VDR5U9vHAB0v3AKJueZAI-4sU1AGqIgBKg0b6my4xfCGJtGt8IT9wlzJamxWLgdXY5e5W235INKaunYkCtMw6wHE_uZ8i/s1600/IMG_1211.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijcgiWk144CYOGb_YmvdgD6PCu2YunAHvaiiXFnC1K7OVf-y3VDR5U9vHAB0v3AKJueZAI-4sU1AGqIgBKg0b6my4xfCGJtGt8IT9wlzJamxWLgdXY5e5W235INKaunYkCtMw6wHE_uZ8i/s320/IMG_1211.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And then I was ready to test. </div>
<h2>
Disaster!</h2>
Ok, this is where I admit I'm a dumbarse. When I laid out my PCB I thought I'd make it dual use. A change of software, and I could re purpose this as a garden watering controller. To do that, I'd included solder blob links to either configure the relays to be 'dry contacts' or switch 12V.<br />
<br />
In this mode, I did all my testing with LEDs attached. Press the button, on the opener or on the webpage and the LEDs would blink.<br />
<br />
Great. Except I forgot all about this. I pulled the LEDs, and wired the realys to my roller doors.<br />
<br />
Here, the plot thickens a but further. Most roller doors have in input for an external button. Mine didn't. Note, post tense.....<br />
<br />
Anyway, to get my old light controller working, I cracked open my roller door motors, and soldered some flying wires across the built in 'open' button. Like this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT_D8u4EFUMekJOkhcdrK_bfEap778gkjQ7m9cMCpjf0Pi4sdrGqxiBJqBoc_1oaB93oUyvd74IAyEugxKkjsqkah-zU-s49oBTDZKlR9mS4e9W2V2EKgNcflQbbd-ljujmL_NUovSWSng/s1600/IMG_1261.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT_D8u4EFUMekJOkhcdrK_bfEap778gkjQ7m9cMCpjf0Pi4sdrGqxiBJqBoc_1oaB93oUyvd74IAyEugxKkjsqkah-zU-s49oBTDZKlR9mS4e9W2V2EKgNcflQbbd-ljujmL_NUovSWSng/s320/IMG_1261.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Worked fine, literally, for years. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Until I tested my new opener. As this is an internal button, there's pretty much a direct run at the microcontroller from this contact. A PIC micro actually. With no over voltage protection on the pin.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI0Z-do2znhHXEBSNxUebrS2ZHZHtDRytSsLm6KOYN4ihnFgv19HCLTR90uIQZRCnxxqjuABW2VmF_sNsZAdJyGPTeqLL9BtyccLcxBESzl0MA76lKHgK8lSRomz3kN4b0a9xCGnWfg_pH/s1600/IMG_1262.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI0Z-do2znhHXEBSNxUebrS2ZHZHtDRytSsLm6KOYN4ihnFgv19HCLTR90uIQZRCnxxqjuABW2VmF_sNsZAdJyGPTeqLL9BtyccLcxBESzl0MA76lKHgK8lSRomz3kN4b0a9xCGnWfg_pH/s320/IMG_1262.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, one button press later, 12V was switched straight into the micro, and the input pin was forever buggered. So, out with the now ruined roller door motors....</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXfTh2zWhEu04IX_HkUSTjSyTDnwr6gVGIgcza7M8iR06BSfc6KLyB2RfCwVFdHRhcsiyoJ3fv1xUOQ_tIPp81JnmG2G-fhvDr3at_4CBTNnE5mJqz2fn5KzLus0HVjEsvrFQi7KHo2OA1/s1600/6BD27337-7DFF-4F2F-81A1-0D0E06BBC1AA.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXfTh2zWhEu04IX_HkUSTjSyTDnwr6gVGIgcza7M8iR06BSfc6KLyB2RfCwVFdHRhcsiyoJ3fv1xUOQ_tIPp81JnmG2G-fhvDr3at_4CBTNnE5mJqz2fn5KzLus0HVjEsvrFQi7KHo2OA1/s320/6BD27337-7DFF-4F2F-81A1-0D0E06BBC1AA.jpeg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And in with a new pair from Bunnings. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW2vQdnIEg3xmuOglS9kC39Fcuwfs_m4ZkRnTtd5hDA1IHNxYdWW-hXNR0zbak5u-NxpXGbUF8NDdQtw3sFDPPAVNTEGgEd2iSYTpzWED-VjxkKcLDWZ78YZczdriaTKMfscKWrEg34dVv/s1600/1357427B-4BD5-43BF-8D62-AF409E0B12B0.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW2vQdnIEg3xmuOglS9kC39Fcuwfs_m4ZkRnTtd5hDA1IHNxYdWW-hXNR0zbak5u-NxpXGbUF8NDdQtw3sFDPPAVNTEGgEd2iSYTpzWED-VjxkKcLDWZ78YZczdriaTKMfscKWrEg34dVv/s320/1357427B-4BD5-43BF-8D62-AF409E0B12B0.jpeg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
And yes, these new ones have lights. Darn it.</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgsoyZIy4I9LDX4GfijEvw8hNGCr923heV74mMmjs3R_NXq_yhws5XMYIPz7DX-GGVz-SjnoXYAyFSScQj9nKC_djm5yjQlY7Y30hDTnXxwph8MtS45mGDi64pLoMxULNAhiwtk969SQ3P/s1600/D985C60C-4718-46BB-B752-22D76AA1B748.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgsoyZIy4I9LDX4GfijEvw8hNGCr923heV74mMmjs3R_NXq_yhws5XMYIPz7DX-GGVz-SjnoXYAyFSScQj9nKC_djm5yjQlY7Y30hDTnXxwph8MtS45mGDi64pLoMxULNAhiwtk969SQ3P/s320/D985C60C-4718-46BB-B752-22D76AA1B748.jpeg" width="320" /></a></div>
<br />
<div class="" style="clear: both; text-align: left;">
Anyway, I continued with the install, using the 'Remote Input' on the new motors and, soon, Job Done!</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPs_ZQEu4yR62dmHnLwwjoM9iLENenD2CTzqZLDomGddQYR4020oNCxoJuPuhRmO9nqvEF5DKtoEtTZYC75AZsJ3tL0ylGCo-6mT-pOWl0Zui-_OwL2171kjsyZBRnfB-53dMcfQHRNJyZ/s1600/IMG_1260.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPs_ZQEu4yR62dmHnLwwjoM9iLENenD2CTzqZLDomGddQYR4020oNCxoJuPuhRmO9nqvEF5DKtoEtTZYC75AZsJ3tL0ylGCo-6mT-pOWl0Zui-_OwL2171kjsyZBRnfB-53dMcfQHRNJyZ/s320/IMG_1260.JPG" width="240" /></a></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Finally, I can open my garage doors, using my phone.</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEUNo1dW9bbYksX0dFFOL9pOm2rCENlS5l2YmCP4AiDt1IJnSfFypt-q0p041jYL7ByAq4KuWtCppSdZyWHlnsHgis73VV2_XTfT8kLPQT__zwMCywNNEokDVwecOcWlQoqDiGMuftDF9N/s1600/GDI+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEUNo1dW9bbYksX0dFFOL9pOm2rCENlS5l2YmCP4AiDt1IJnSfFypt-q0p041jYL7ByAq4KuWtCppSdZyWHlnsHgis73VV2_XTfT8kLPQT__zwMCywNNEokDVwecOcWlQoqDiGMuftDF9N/s320/GDI+01.png" width="182" /></a></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Next time the kids have an idea, I might think about it a while before committing to it!</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com3tag:blogger.com,1999:blog-2685787041614376103.post-20676767622429771642019-07-02T06:07:00.000-07:002019-07-29T20:57:41.812-07:00Easier ESP8266 Development<h2>
Or How to Learn from My 4 Years of Frustration</h2>
<div>
<div>
(This is a post in my series about my Garage Door Opener. Yes I wrote a series. About a Garage Door Opener. Check it out:</div>
<div>
<ul>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-hardware.html">Hardware</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-software.html">Software</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/yet-another-iot-garage-door-opener.html">Installation</a></li>
<li><a href="http://ludzinc.blogspot.com/2019/07/easier-esp8266-development.html">Easier ESP8266 Development</a></li>
</ul>
<div>
Thanks!)</div>
</div>
</div>
<div>
<br /></div>
<div>
Okay, so that took a little longer than expected.....<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYT6BzoJ9C55qm8-rzGLoYP9SWiQKhTmzt4UTlgxkX4D37x0lvA6Jbug72Qr4Joldu77Y7cC9HKKLsgyuJqmTI8lTr_JwZ7TdtIuM2S2SA8hu8ajlihrSh5ZSXJ7V7Eg9qYwiPOTW045N3/s1600/000.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYT6BzoJ9C55qm8-rzGLoYP9SWiQKhTmzt4UTlgxkX4D37x0lvA6Jbug72Qr4Joldu77Y7cC9HKKLsgyuJqmTI8lTr_JwZ7TdtIuM2S2SA8hu8ajlihrSh5ZSXJ7V7Eg9qYwiPOTW045N3/s320/000.JPG" width="240" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
Back in 2013 I built a light for my <a href="http://ludzinc.blogspot.com/2013/07/ive-seen-light.html">Garage Door</a> and my daughter said it would be cool if I could control it from my phone.</div>
<div>
<br /></div>
<div>
My original plan was to simply use a Bluetooth to serial converter, type 'open' in an iPhone app and job's done.</div>
<div>
<br /></div>
<div>
However, my iPhone 4 didn't support Blue Tooth Low Energy, and I was hearing good stuff about this $5 WiFi chip, the <a href="http://esp8266./">ESP8266.</a></div>
<div>
<br /></div>
<div>
So, I thought I'd give it a go. But, no, this post isn't about the widget I built, but rather a collection of tip's for anyone else who wants to try developing with an ESP8266 from scratch. There was a lot to learn, and if you're looking to get started with the ESP866, please read on and learn from my mistakes!</div>
<div>
<br />
<a name='more'></a><br /></div>
<h3>
Where to Start?</h3>
<h4>
Learn from my mistakes.</h4>
<div>
Not with an ESP-01! I did start with a few of these, but they suck.</div>
<div>
<br /></div>
<div>
Firstly, there's limited pins, and you need to bias the pins in the right states to either boot the unit or put it in a programming mode. Also, when you do boot an ESP-01 some of the IO pins toggle as part of the boot process, and you need to develop a method to ignore these pins for a short period of time when booting. Too much hassle.</div>
<div>
<br /></div>
<div>
If you insist on using one of these modules, there are <a href="https://www.allaboutcircuits.com/projects/breadboard-and-program-an-esp-01-circuit-with-the-arduino-ide/">many</a> <a href="https://randomnerdtutorials.com/getting-started-with-esp8266-wifi-transceiver-review/">tutorials</a> <a href="https://www.diyhobi.com/flash-program-esp-01-using-usb-serial-adapter/">out</a> <a href="https://www.instructables.com/id/Cheap-and-Easy-ESP8266-01-Programming-Jig-Use-With/">there</a> that can help you. </div>
<div>
<br /></div>
<div>
But trust me, you are better off starting with a module like the <a href="https://wiki.wemos.cc/products:d1:d1_mini">Wemos D1 mini</a> or <a href="http://nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e">Node MCU</a>. They are still pretty damn cheap, and you only need to connect them to your PC via a USB cable and you're ready to go. This may sound silly, but with the ESP-01 you need to hold GPIO_0 low, hit the reset button, release GPIO_0 and then start the programming process, which gets old, real fast. With the modules, you just hit upload and go.</div>
<h4>
Programming.</h4>
<div>
I used to have a love / hate relationship with the Ardino IDE, but if you are starting with ESP development, in my opinion you are nuts not to start here. Again, there's a heap of sites that explain how to get up and running <a href="https://randomnerdtutorials.com/esp8266-web-server/">better</a> <a href="https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon">than</a> <a href="https://tutorial.cytron.io/2015/07/23/esp8266-tutorial-part-ii-esp8266-hello-web-server-with-arduino-ide/">I can</a>. Don't forget to refer to the excellent <a href="https://github.com/esp8266/Arduino">ESP8266/Arduino resource on GitHub</a>.</div>
<div>
<br /></div>
<div>
Also, <a href="https://tutorial.cytron.io/2015/07/30/esp8266-tutorial-part-iii-customise-your-web-server-with-arduino/">this tutorial</a> was a great breakthrough for my understanding about how hosting the webserver on the ESP8266 works, and pointed me to <a href="https://www.w3schools.com/html/html_intro.asp">W3Schools</a> which is a great resource for learning about how to build a HTML page. </div>
<div>
<br /></div>
<div>
Ok, so far all I've done so far is summarise some links and save you some time googling stuff for yourself. From now on, I'd like to point out how I think you can minimise your development time going forward.</div>
<div>
<br />
But first some Do Nots:<br />
<h4>
Do not:</h4>
<div>
<ul>
<li><a href="https://tutorial.cytron.io/2015/07/30/esp8266-tutorial-part-iii-customise-your-web-server-with-arduino/">Try to fit the html code inline with your arduino code</a> (as an include file). Escaping quotes will do your head in. </li>
<ul>
<li>Okay, that's a little judgmental and I did get a great sense of achievement when I got this demo up and running. So a good start to check out that everything is working but for the Love of God please don't think this is the best way to move forward. </li>
</ul>
<li>Don't edit html pages in Notepad</li>
<ul>
<li>Yeah, this is what I did to 'just quickly make a small change'. Don't be like me. Use a good editor. See below!</li>
</ul>
<li>Don't used online WYSIWYG editor</li>
<ul>
<li>They all suck and will waste your time</li>
</ul>
<li>Don't think you can create a good looking style sheet yourself. </li>
<ul>
<li>Okay, that might be just my lack of artistic talent manifesting itself, but there are so many free style-sheets out there you're just wasting your time if your starting out and not using them</li>
</ul>
</ul>
</div>
</div>
<h2>
ESP Tips</h2>
<h3>
Start with Examples</h3>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTCru9pcrC6ZbD7G-G7STMVwcJTkSONnqkZ1NNG7LT4DcDhGdXtgh7xqP4Kmg-Url_M9kFWckkl_USj2z6G_XlRlSG5HFBjo8iLX2dlOn_aibf90V2SmJTfMfxPa_E9YcrpujQVXChSqTb/s1600/ESP000.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1040" data-original-width="960" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTCru9pcrC6ZbD7G-G7STMVwcJTkSONnqkZ1NNG7LT4DcDhGdXtgh7xqP4Kmg-Url_M9kFWckkl_USj2z6G_XlRlSG5HFBjo8iLX2dlOn_aibf90V2SmJTfMfxPa_E9YcrpujQVXChSqTb/s320/ESP000.png" width="295" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This is a big tip that I wish someone had pointed out to me when I was starting. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I managed to get bogged down in trying to write simple HTML files and adding them as an include files (with all the grief associated with wrapping all lines in quotes and dealing with strings and escape characters....) when you can simplify issues with using the SPIFFS file system. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Simply start the FSBrowser example that comes with the Arduino IDE and get cracking.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you place a HTML file in the data folder in your Arduino project, the FSBrowser code handleFileRead routine will simply search the SPIFFS folder for a matching file, and if found, get the server to, erm, serve it. Otherwise it returns a 404 error.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<!-- HTML generated using hilite.me --></div>
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #007020;">bool</span> handleFileRead(String path){
DBG_OUTPUT_PORT<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"handleFileRead: "</span> <span style="color: #333333;">+</span> path);
<span style="color: #008800; font-weight: bold;">if</span>(path<span style="color: #333333;">.</span>endsWith(<span style="background-color: #fff0f0;">"/"</span>)) path <span style="color: #333333;">+=</span> <span style="background-color: #fff0f0;">"index.htm"</span>;
String contentType <span style="color: #333333;">=</span> getContentType(path);
String pathWithGz <span style="color: #333333;">=</span> path <span style="color: #333333;">+</span> <span style="background-color: #fff0f0;">".gz"</span>;
<span style="color: #008800; font-weight: bold;">if</span>(SPIFFS<span style="color: #333333;">.</span>exists(pathWithGz) <span style="color: #333333;">||</span> SPIFFS<span style="color: #333333;">.</span>exists(path)){
<span style="color: #008800; font-weight: bold;">if</span>(SPIFFS<span style="color: #333333;">.</span>exists(pathWithGz))
path <span style="color: #333333;">+=</span> <span style="background-color: #fff0f0;">".gz"</span>;
File <span style="color: #007020;">file</span> <span style="color: #333333;">=</span> SPIFFS<span style="color: #333333;">.</span>open(path, <span style="background-color: #fff0f0;">"r"</span>);
server<span style="color: #333333;">.</span>streamFile(<span style="color: #007020;">file</span>, contentType);
<span style="color: #007020;">file</span><span style="color: #333333;">.</span>close();
<span style="color: #008800; font-weight: bold;">return</span> true;
}
<span style="color: #008800; font-weight: bold;">return</span> false;
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
It also redirects you to index.htm (which is included in the examples data folder) if you try to direct the server to the root, and also manages unpacking .gz files too.</div>
<div>
<br /></div>
<div>
You have to upload the contents of the data folder after programming the target by using the "<a href="https://github.com/esp8266/arduino-esp8266fs-plugin">ESP8266 Sketch Data Upload</a>" tool. Pro-tip: The tool won't work if you are using the serial monitor at the time you try to upload.</div>
<div>
<br /></div>
<div>
I cannot stress how helpful this example is. It also includes an <a href="https://tttapa.github.io/ESP8266/Chap08%20-%20mDNS.html">mDNS</a> server that lets you connect to the ESP by name, not ip address, (unless you are using an Android device...). You need to install <a href="https://support.apple.com/kb/DL999?viewlocale=en_US&locale=en_US">Bonjour Print Services for Windows</a> for this to work (comes packaged with iTunes btw) in Windows, <a href="https://wiki.archlinux.org/index.php/Avahi">Avhai</a> to work in Lunix, or nothing for an iPhone as it's standard with iOS.</div>
<div>
<br /></div>
<div>
So, following the above, from scratch within a hour or so you can load your HTML files from a SPIFFS file server. Impressive. Took me a year to get here.<br />
<br />
<div>
<h2>
Don't Develop on the ESP8266</h2>
</div>
</div>
<div>
Wait.. what?</div>
<div>
<br /></div>
<div>
Because I did not know better, I tried to develop my HTML pages buy uploading them to SPIFFS, testing, editing and re-uploading. As handy as SPIFFS is, this is a 5 minute code and text cycle that also gets old, real fast. </div>
<div>
<br /></div>
<div>
Also, you tend to have no idea why your formatting is broken, or where you broke your HTML page with your last series of edits.</div>
<div>
<br /></div>
<div>
Thankfully, the solution is real simple.<br />
<h3>
Develop HTML on Your PC</h3>
</div>
<div>
Open the file locally. Simply double click your HTML file you are developing and open it in Chrome (you are using Chrome, right?) and then hit F12. </div>
<div>
<br /></div>
<div>
This opens the <a href="https://developers.google.com/web/tools/chrome-devtools/">Chrome Developers Tools</a> panel which shows you a wealth of data about your page.<br />
<br />
What else it means is that you can edit, save and reload a page in seconds. Much speedier than uploading to your ESP board.<br />
<br />
<h3>
Use a decent Text Editor</h3>
<div>
While, in theory you can edit a HTML page with notepad, in practice it's nothing but a massive <a href="https://www.youtube.com/channel/UCHvBHWBzzB7NyU5tIiEZHBg">ball ache</a>. </div>
<div>
<br /></div>
<div>
Options include:</div>
<div>
<br /></div>
<h4>
Notepad++</h4>
<div>
<a href="https://notepad-plus-plus.org/download/v7.7.1.html">Notepad++</a> is lightweight, loads fast, has more than 1 level of Ctrl-Z. It also uses colour to stylise your text, making your HTML much more readable.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqsbmzkO-zJgfp_vk4wyXPgBIzzhfJ8zlgai1RwxF5mehS9ruQrxfQLSu6NjAbB00XmB8fXwBuP6e33n1uE888UnzyLkopRFmAxok0mmXpF0gtI0Jcxffl2Juak4rGKbiWr8NedOd9imNa/s1600/EDITORS_00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1050" data-original-width="1242" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqsbmzkO-zJgfp_vk4wyXPgBIzzhfJ8zlgai1RwxF5mehS9ruQrxfQLSu6NjAbB00XmB8fXwBuP6e33n1uE888UnzyLkopRFmAxok0mmXpF0gtI0Jcxffl2Juak4rGKbiWr8NedOd9imNa/s320/EDITORS_00.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And that's about it. Light years in front of Notepad and surprisingly very useful. But it by default will not point out any errors in your HTML.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There are <a href="https://github.com/bruderstein/NppTidy2">plugins</a> available but they seem to be in development so I moved on from here.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h4 style="clear: both; text-align: left;">
Sublime Text</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj231HAaI3aDl8CJuqGofqQbXWj-AiaEvbjQCijfkwwNlqEKInbfMnByfr_1AQy6RTX3oOaBiLVmYsy-2T1EX6cEBz6b7NPoitQFUqNJqywyuyCihA4jCa3IBrynfwGbTd6cbFulpNZYDeB/s1600/EDITORS_01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="463" data-original-width="433" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj231HAaI3aDl8CJuqGofqQbXWj-AiaEvbjQCijfkwwNlqEKInbfMnByfr_1AQy6RTX3oOaBiLVmYsy-2T1EX6cEBz6b7NPoitQFUqNJqywyuyCihA4jCa3IBrynfwGbTd6cbFulpNZYDeB/s320/EDITORS_01.png" width="299" /></a></div>
<div>
<br /></div>
<div>
I'll be completely honest here - I started using <a href="https://www.sublimetext.com/">Sublime Text</a> because I liked the dark theme :)</div>
<div>
It also colour codes your, um, code, and has <a href="https://packagecontrol.io/packages/SublimeLinter-html-tidy">linter</a> plug-ins to help style your code. Also lite and quick to load. </div>
<div>
<br /></div>
<h4>
Atom Editor</h4>
<div>
But forget all those - go for the <a href="https://atom.io/">Atom Editor</a> (with <a href="https://platformio.org/">Program IO</a> plug in). </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGRbWailGxC7shSx2TM64f8y3AytMVFer1TRNcYBRRI0zxiAyNnxXQo_BzhFQ2eFen2kbnvNKuSdKcSIYO6-iuf_jX_4Ci7DlWk6kYW_0OWi3t66MvvxuVzwWEurqTUFP5zYtxCwdkhizt/s1600/EDITORS_02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="875" data-original-width="1600" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGRbWailGxC7shSx2TM64f8y3AytMVFer1TRNcYBRRI0zxiAyNnxXQo_BzhFQ2eFen2kbnvNKuSdKcSIYO6-iuf_jX_4Ci7DlWk6kYW_0OWi3t66MvvxuVzwWEurqTUFP5zYtxCwdkhizt/s320/EDITORS_02.png" width="320" /></a></div>
<div>
</div>
<div>
<br /></div>
<div>
With a large community developing many plug-ins there is just massive levels of support. </div>
<div>
<ul>
<li><a href="https://atom.io/packages/atom-beautify">Atom Beautify</a></li>
<ul>
<li>Will (on save) fix any indenting and formatting issues in your file</li>
</ul>
<li><a href="https://atom.io/packages/pigments">Pigments</a></li>
<ul>
<li>Will display HTML colours in line while you are editing </li>
</ul>
<li><a href="https://atom.io/packages/linter">Linter</a></li>
<ul>
<li>Will use the W3Schools *validator* and point out errors in your code (more on this later)</li>
</ul>
</ul>
</div>
<h3>
Chrome Developers Tools</h3>
</div>
<div>
The Chrome Developers Tools are a Godsend when it comes to debugging your HTML pages.<br />
<br />
Take for example this 'settings' screen I was developing, and try to ignore it's ugliness for now. Whilst it loads fine, the save button didn't work (you have to scroll down to see it) and I had no idea why. It also isn't a great representation as to how it will look on a mobile device.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg79I3R4oU7iSkOj_O3HRaKPAHlvdrW4weLEGGYlO1UJ2FDHMOPbiCA8VEgZlrUbHGA_wG4dqRnzN6aRi-WPcdA0KA0DvxkSjqYsGZjDH8J7_3J70Ak8yTfc75QQCxHTvymF6RzqF-9lIs3/s1600/DemoScreen00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg79I3R4oU7iSkOj_O3HRaKPAHlvdrW4weLEGGYlO1UJ2FDHMOPbiCA8VEgZlrUbHGA_wG4dqRnzN6aRi-WPcdA0KA0DvxkSjqYsGZjDH8J7_3J70Ak8yTfc75QQCxHTvymF6RzqF-9lIs3/s320/DemoScreen00.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Pressing 'F12' brings up the developers view, and the Console tab, for now it's blank - so there were no errors loading this page. So far, so good.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9jKtWO0WN8cAOjO2lic3AwrhdRMoUoUq8hBb5nAhxnD04WUMlMVtv34kBiJSePD29Sk4KOt_lb8edCiuuZgizaW033sPpmdhBqYGCqnej4MNKXMpCdRdFPBMaoo0_LsCNnnOkcEhBooDV/s1600/DemoScreen01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9jKtWO0WN8cAOjO2lic3AwrhdRMoUoUq8hBb5nAhxnD04WUMlMVtv34kBiJSePD29Sk4KOt_lb8edCiuuZgizaW033sPpmdhBqYGCqnej4MNKXMpCdRdFPBMaoo0_LsCNnnOkcEhBooDV/s320/DemoScreen01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You'll also notice that it's been reformatted to show how it would look on a mobile device. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGp4ir8NfMYjs6eVNgtp6RK9ibYOdS6pnfQ83o6VvAyBm9R-NIz1uc_RxRilF5Oafe-OJ3Fso5p6GfUGyfT_-RlE11IDhZ0cJhEoOKWpRjCzX4U9JW_AqNMUU-QoikRO7QJ8WnBFDr9-xE/s1600/InkedDemoScreen01_LI.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGp4ir8NfMYjs6eVNgtp6RK9ibYOdS6pnfQ83o6VvAyBm9R-NIz1uc_RxRilF5Oafe-OJ3Fso5p6GfUGyfT_-RlE11IDhZ0cJhEoOKWpRjCzX4U9JW_AqNMUU-QoikRO7QJ8WnBFDr9-xE/s320/InkedDemoScreen01_LI.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In case it hasn't you can click the 'Toggle Device' toolbar icon circled in red above to change the view. I'll come back to the Console tab in a bit.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you select the Elements tab, you can poke around at your HTML and see the code that each block effects. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin6J_NtMfyBtiiIOw9BC-IgFNFpVboQaJ2o00FFhHVMOf2npKVISFj358IWTAJjGn-GMf2Mk2VOXv8ImkW4eQpiWgasLBINQk8RorrDY5flGVYYw1PPQJ7bbK4_c8wfBYyRUsi6N_lmT2n/s1600/DemoScreen02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin6J_NtMfyBtiiIOw9BC-IgFNFpVboQaJ2o00FFhHVMOf2npKVISFj358IWTAJjGn-GMf2Mk2VOXv8ImkW4eQpiWgasLBINQk8RorrDY5flGVYYw1PPQJ7bbK4_c8wfBYyRUsi6N_lmT2n/s320/DemoScreen02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can then highlight sections of your displayed page and work out what's going wrong there. It's handy when you drop a </div> statement.</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
Back to the console. In this example I wanted to save the settings but the SAVE button wasn't working. The Console tab is useful here - looking at the error message I can see that I'm calling buttonReset in my JavaScript but it's looking like I've done something wrong there, so I can focus my attention there. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuOoYLF0zZK6l6nykY_2qXDWz6dF_NbDt8kzUJ40ujHTOkdWiB1daCV9llGA_cGd9Qvg3w-AH5yC3oqqIZqtdN8XFw9dHE_8GrMWBVg9vV176V9mX4jH1dIcX7E9cbSDtt7EAJG2FJYBFq/s1600/DemoScreen04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="844" data-original-width="1168" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuOoYLF0zZK6l6nykY_2qXDWz6dF_NbDt8kzUJ40ujHTOkdWiB1daCV9llGA_cGd9Qvg3w-AH5yC3oqqIZqtdN8XFw9dHE_8GrMWBVg9vV176V9mX4jH1dIcX7E9cbSDtt7EAJG2FJYBFq/s320/DemoScreen04.png" width="320" /></a></div>
<br /></div>
<div>
But the Console tab is much more useful than that. If you want to trace progress in your script, in a similar manner to using Serial.printf statements in your Arduino code, you can use console.log('text to show') statements to output text to the Console. Very handy.<br />
<br />
Anyone reading this who has any experience would probably already know about this, but I didn't and I hope by sharing this, someone out there can benefit from this info quickly.</div>
<div>
<h4>
HTML (and Javascript) Validation</h4>
I'd love someone to show my there's a better way to develop HMTL, but for me I'm simply using the <a href="https://ide.atom.io/">ATOM IDE</a> (heck, my helloworld.html was written in notepad!) and then reloading the page in Chrome to test it.<br />
<br />
But, thankfully, Chrome (and other browsers) are pretty tolerant of mal-formed HTML. This partly explains why some browsers display the same page differently!<br />
<br />
The way forward I found was to use the <a href="https://validator.w3.org/">W3C Markup Validator</a>. It's online and you can simply upload your html file and get a report on what's wrong.<br />
<br />
For example, this 'Home Page' of mine works and looks fine, with no errors reported in the console log (ignore the comments around parsing data - I'll get onto websockets later):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkV8mFLsuDWgaPcik70Ckj7KFPkp9mF_fdogDuaQlI2tICOzCYmrFSWF1r1c0FNaAowt1v5LxGXuJ0rXeN0FUFuHZ7U5Vc2zPpcm3NHO47IvVnWq6BY-pew8jf0oqEetMfBZBWb1gJ9Ect/s1600/HTML+001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="903" data-original-width="1276" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkV8mFLsuDWgaPcik70Ckj7KFPkp9mF_fdogDuaQlI2tICOzCYmrFSWF1r1c0FNaAowt1v5LxGXuJ0rXeN0FUFuHZ7U5Vc2zPpcm3NHO47IvVnWq6BY-pew8jf0oqEetMfBZBWb1gJ9Ect/s320/HTML+001.png" width="320" /></a></div>
<br />
<br />
However, when I run it through the validator I get the following report:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7i8rCFUwLqFsTNP6yaHBRf0-cSWrgKyfgFGk4bcuUhXu9cMHiLV32DOxWJXdMTCobQgrS5Ez36_KcWq0xgCdwXAF5DavggxVD448W9sodrNVxm8EJLesx5UgnRNROGaiA9-4co2HzaZcL/s1600/HTML+002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1048" data-original-width="960" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7i8rCFUwLqFsTNP6yaHBRf0-cSWrgKyfgFGk4bcuUhXu9cMHiLV32DOxWJXdMTCobQgrS5Ez36_KcWq0xgCdwXAF5DavggxVD448W9sodrNVxm8EJLesx5UgnRNROGaiA9-4co2HzaZcL/s320/HTML+002.png" width="293" /></a></div>
<br />
Some minor issues to clean up - but otherwise completely hidden to me, and who knows how they will bite you later!<br />
<br />
Coming back full circle when talking about text editors prior, what's even better is that there's a plug-in for the Atom Editor - <a href="https://atom.io/packages/w3c-validation">W3C-Validation</a> that makes the process easier. I used the 'Check on Save (default) option'. For the example above, the results are as follows:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWzS4oZYWN4USbzIoFwskFg8EKhbFoQYCgUCVhKq7A5WEVlENeGQv3TegXIeq-OUwjhPLgheV5YMAnb9dX8cnnwlOUyVamgtCT4oz-Bzp66NIeMHcggi3YOpaZBnzl-GOqLaD0F9XEBgjo/s1600/HTML+003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1050" data-original-width="952" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWzS4oZYWN4USbzIoFwskFg8EKhbFoQYCgUCVhKq7A5WEVlENeGQv3TegXIeq-OUwjhPLgheV5YMAnb9dX8cnnwlOUyVamgtCT4oz-Bzp66NIeMHcggi3YOpaZBnzl-GOqLaD0F9XEBgjo/s320/HTML+003.png" width="290" /></a></div>
<br /></div>
<div>
<br />
Looking at the errors, there's an unclosed <div> statement on line 192. By placing the cursor on the next <div> statement, Atom's highlighting shows this statement is closed on line 210 (by the </div> statement) so I simply need an extra </div> on line 211.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFM3ZyhbWjIIB39wi0fU9bXMXnqElPjMvnGq4fQz9oDyHo_IDNz6snFDURUxVurbxqdr_h2LP456-PRzKWd0IczqX5duJ2FeN71UiLYN5oJt2iPYD5_OGV6335AtkaXiNztUhZfTA-_xTc/s1600/HTML+004.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1050" data-original-width="952" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFM3ZyhbWjIIB39wi0fU9bXMXnqElPjMvnGq4fQz9oDyHo_IDNz6snFDURUxVurbxqdr_h2LP456-PRzKWd0IczqX5duJ2FeN71UiLYN5oJt2iPYD5_OGV6335AtkaXiNztUhZfTA-_xTc/s320/HTML+004.png" width="290" /></a></div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<br />
So as you write your code, both HTML and Javascript, the Linter plug in will show you errors. <a href="https://www.youtube.com/watch?v=hs5zvzTcqrE">Fantastic</a>. I'm embarrassed to admit I've only started with Linter in the last few months, and do think that I'd have completed my project sooner if I started using it earlier!<br />
<h2>
Managing Data</h2>
<h3>
GET Vs Ajax</h3>
<div>
Just about every <a href="https://www.instructables.com/id/ESP8266-Web-Server-Without-Arduino/">introductory </a><a href="https://techtutorialsx.com/2016/11/19/esp8266-webserver-controlling-a-led-through-wifi/">tutorial </a><a href="https://hackaday.io/project/7186-esp-8266-web-server/log/22849-adding-gpio-control">out </a><a href="https://randomnerdtutorials.com/esp8266-web-server/">there </a>teaches you to type in commands through the address bar (when testing).</div>
<div>
<br /></div>
<div>
This is fine to get things up and running quickly, and the next step is typically making HTML calls when pressing a button on a webpage.</div>
<div>
<br /></div>
<div>
This seems fine, but has an annoying drawback:<br />
<br />
Cache. When you next go to type an address into your address bar to load your application, the auto-complete feature will populate the whole address.<br />
<br />
You attempt to load the home page and end up toggling an IO.<br />
<br />
For example, you type "192.168.1.1" and miss that the autocomplete has suggested "192.168.1.1/GPIO0_ON" and you hit enter. Annoying.<br />
<br />
This is known as the <a href="https://www.w3schools.com/tags/att_form_method.asp">GET Method</a> and was fine in the early days of HTML.<br />
<br />
The issue here is that when you assign a link to a button on a form, you send a GET message and it's also cached in the address bar. Back to square one.<br />
<br />
However, AJAX handles this in the background for you!<br />
<h4>
Using Ajax</h4>
</div>
<div>
<a href="https://www.w3schools.com/xml/ajax_intro.asp">AJAX</a> allows web pages to be updated asynchronously, effectively by sending GET messages in the background. <br />
<br />
This <a href="https://babaawesam.com/2015/11/26/control-input-output-of-esp8266-with-ajax/">post </a>was where I learnt how to format a request in Javascript.<br />
<br />
Firstly - declare a function in your script, similar to this:<br />
<br />
<div style="background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: green; font-weight: bold;">function</span> requestIO(selectButton) {
request <span style="color: #666666;">=</span> <span style="color: green; font-weight: bold;">new</span> XMLHttpRequest();
requestData <span style="color: #666666;">=</span> <span style="color: #ba2121;">"output_"</span> <span style="color: #666666;">+</span> selectButton;
request.open(<span style="color: #ba2121;">"GET"</span>, requestData, <span style="color: green; font-weight: bold;">true</span>);
request.send(<span style="color: green; font-weight: bold;">null</span>);
}
</pre>
</td></tr>
</tbody></table>
</div>
</div>
<br />
Then, call the code from your button:<br />
<br />
<div style="background: rgb(255, 255, 255); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 16.25px;">1</pre>
</td><td><pre style="line-height: 16.25px;"><span style="color: #333333;"><</span>button <span style="color: #007020;">id</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"b1"</span> <span style="color: #007020;">type</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"button"</span> class<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"btn btn-default btn-lg btn-block"</span> onclick<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"requestIO(1);"</span><span style="color: #333333;">></span>BUTTON <span style="color: #0000dd; font-weight: bold;">1</span><span style="color: #333333;"></</span>button<span style="color: #333333;">></span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
When your button is pressed, your code is called and your request is passed using AJAX, and never appears in the address bar. Win! Also, if you do insist on manually entering an address, it will still work. Nice.<br />
<br />
This will let you toggle IO on your device relatively easily, even send form data. In short, once you are at this point, you can basically control IO on your ESP at will. However, the following makes things much more manageable and dynamic!<br />
<h4>
JSON - Learn to Love It!</h4>
If, like me, once you have a hammer and everything looks like a nail, you might be tempted to forge ahead with implementing your own solutions for more advanced functions in your devices. For example, you may add a temperature sensor and have an options page where you can choose between displaying degrees in Celcius or Farenheit.<br />
<br />
The temptation might be to set up a _very long_ GET message and then use Arduinos' built in string compare tools to pick out the data you need.<br />
<br />
Perhaps something like this:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6</pre>
</td><td><pre style="line-height: 125%; margin: 0;">function sendOptions() {
request <span style="color: #333333;">=</span> new XMLHttpRequest();
requestData <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"options_temperatureChoice_C"</span>;
request<span style="color: #333333;">.</span>open(<span style="background-color: #fff0f0;">"GET"</span>, requestData, true);
request<span style="color: #333333;">.</span>send(null);
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Then search for it with something like this:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7
8</pre>
</td><td><pre style="line-height: 125%; margin: 0;">index_start <span style="color: #333333;">=</span> request<span style="color: #333333;">.</span>indexOf(<span style="background-color: #fff0f0;">"temperatureChoice"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (index_start <span style="color: #333333;">==</span> <span style="color: #333333;">-</span><span style="color: #0000dd; font-weight: bold;">1</span> ) {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Temperature Choice data not found"</span>);
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">95</span>; <span style="color: #333333;">//</span> change to page <span style="color: #007020;">type</span> that says Browser Data save error, retry
}
String newTempChoice <span style="color: #333333;">=</span> request<span style="color: #333333;">.</span>substring(index_start <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">11</span>, index_start <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">12</span>);
Serial<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">print</span>(<span style="background-color: #fff0f0;">"NewTempChoice: "</span>);
Serial<span style="color: #333333;">.</span>println(newTempChoice);
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
Like I did. Dammit.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-0GHj_kY86syq36-RVc1MUT5qqL7Y0O4y9KqA0biLpWQrl3eFBT0McmFAxg1Fn3Hm9GMREmwAn1GXaWHsevyf3UVAyGO4kWtn9wY9DrIDPgqSl4gqwfY3GW1SFxOW56EBZjuZzbDF7asp/s1600/faceplam.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="360" data-original-width="480" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-0GHj_kY86syq36-RVc1MUT5qqL7Y0O4y9KqA0biLpWQrl3eFBT0McmFAxg1Fn3Hm9GMREmwAn1GXaWHsevyf3UVAyGO4kWtn9wY9DrIDPgqSl4gqwfY3GW1SFxOW56EBZjuZzbDF7asp/s320/faceplam.gif" width="320" /></a></div>
<br />
This takes many lines of code and while effective it's a pain in the butt to manage.<br />
<br />
Then, some times in life, something magical happens. Your mechanic calls you and tells you it's just a blocked oil filter and you don't need your engine rebuilt. Your son or daughter is born. You discover JSON (and it's Arudino implementation with working examples).<br />
<br />
What this means for you, is that you simply need to pass a JSON formatted text string and the JSON libraries deal with the extraction of the data. At a machine code level, it's probably no more (or less) efficient than manually parsing strings as above, but it is a lot less headaches to manage.<br />
<br />
Taking our temperature choice example, to send the data using the JSON format you'd construct a string as follows:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3</pre>
</td><td><pre style="line-height: 125%; margin: 0;">{
<span style="background-color: #fff0f0;">"temperatureChoice"</span>: <span style="background-color: #fff0f0;">"C"</span>
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
and to read it you'd parse the JSON object:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;">JsonObject<span style="color: #333333;">&</span> root <span style="color: #333333;">=</span> jsonBuffer<span style="color: #333333;">.</span>parseObject(json);
</pre>
</td></tr>
</tbody></table>
</div>
<br />
then to read the value (in your Arduino sketch) you need:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;">temperatureChoice <span style="color: #333333;">=</span> root[<span style="background-color: #fff0f0;">"temperatureChoice"</span>];
</pre>
</td></tr>
</tbody></table>
</div>
<br />
The above is a very simplified overview, and in practice takes a little setup as per the examples here:<br />
<ul>
<li><a href="https://arduinojson.org/v6/doc/serialization/">Serialising Data</a> - create the JSON object to send to your client</li>
<li><a href="https://arduinojson.org/v6/doc/deserialization/">Deserialising Data</a> - parse the JSON object to read the data sent from your client</li>
</ul>
If you want to see how I did it you can view my source code <a href="https://github.com/ludzinc/Low-Cost-Labs/tree/master/GDI_DELUX_V3">here</a>.<br />
<br />
In summary the following is all I needed to read all my options from the settings file:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #007020;">bool</span> loadConfig() {
File configFile <span style="color: #333333;">=</span> SPIFFS<span style="color: #333333;">.</span>open(<span style="background-color: #fff0f0;">"/config.json"</span>, <span style="background-color: #fff0f0;">"r"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (<span style="background-color: #ffaaaa; color: red;">!</span>configFile) {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Failed to open config file"</span>);
<span style="color: #008800; font-weight: bold;">return</span> false;
}
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Opened config file successfully"</span>);
size_t size <span style="color: #333333;">=</span> configFile<span style="color: #333333;">.</span>size();
<span style="color: #008800; font-weight: bold;">if</span> (size <span style="color: #333333;">></span> <span style="color: #0000dd; font-weight: bold;">1024</span>) {
DEBUG_PRINTLN(<span style="background-color: #fff0f0;">"Config file size is too large"</span>);
<span style="color: #008800; font-weight: bold;">return</span> false;
}
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Congif file size is: "</span>); DEBUG_PRINTLN(size);
<span style="color: #333333;">//</span> Allocate a <span style="color: #007020;">buffer</span> to store contents of the <span style="color: #007020;">file</span><span style="color: #333333;">.</span>
std::unique_ptr<span style="color: #333333;"><</span>char[]<span style="color: #333333;">></span> buf(new char[size]); <span style="color: #333333;">//</span> <span style="color: #007020;">buffer</span> <span style="color: black; font-weight: bold;">is</span> named <span style="background-color: #fff0f0;">'buf'</span> <span style="color: black; font-weight: bold;">and</span> <span style="color: black; font-weight: bold;">is</span> <span style="color: #007020;">set</span> to the size of the opened json <span style="color: #007020;">file</span>
configFile<span style="color: #333333;">.</span>readBytes(buf<span style="color: #333333;">.</span>get(), size); <span style="color: #333333;">//</span> read <span style="color: #007020;">bytes</span> <span style="color: #008800; font-weight: bold;">from</span> <span style="color: #0e84b5; font-weight: bold;">congfigFile</span> (read <span style="color: #008800; font-weight: bold;">from</span> <span style="color: #0e84b5; font-weight: bold;">SPIFFs</span>) into the <span style="color: #007020;">file</span> <span style="color: #007020;">buffer</span> named <span style="background-color: #fff0f0;">'buf'</span>
<span style="color: #333333;">//</span> DynamicJsonBuffer jsonBuffer;
DynamicJsonBuffer jsonBuffer;
JsonObject<span style="color: #333333;">&</span> json <span style="color: #333333;">=</span> jsonBuffer<span style="color: #333333;">.</span>parseObject(buf<span style="color: #333333;">.</span>get()); <span style="color: #333333;">//</span> make a JasonObject of name <span style="background-color: #fff0f0;">"json"</span> to store the <span style="color: #007020;">file</span> contents read <span style="color: #008800; font-weight: bold;">from</span>
<span style="color: #0e84b5; font-weight: bold;">if</span> (<span style="background-color: #ffaaaa; color: red;">!</span>json<span style="color: #333333;">.</span>success()) {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Failed to parse config file"</span>);
<span style="color: #008800; font-weight: bold;">return</span> false;
}
uint8_t modeArraySize <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"buttonMode"</span>]<span style="color: #333333;">.</span>size();
uint8_t pwmArraySize <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"buttonPWM"</span>]<span style="color: #333333;">.</span>size();
json[<span style="background-color: #fff0f0;">"Version"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(gdiVersion, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"SSID"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(ssid, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"Password"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(password, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"hostName"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(hostName, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"temperatureChoice"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(temperatureChoice, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"APName"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(apSSID, <span style="color: #0000dd; font-weight: bold;">30</span>);
json[<span style="background-color: #fff0f0;">"APPass"</span>]<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">as</span><span style="color: #333333;"><</span>String<span style="color: #333333;">></span>()<span style="color: #333333;">.</span>toCharArray(apPASS, <span style="color: #0000dd; font-weight: bold;">30</span>);
const char<span style="color: #333333;">*</span> tempName <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"x"</span>;
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
buttons[i]<span style="color: #333333;">.</span>mode <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"buttonMode"</span>][i]; <span style="color: #333333;">//</span> choose mode of <span style="color: #007020;">input</span> buttons, <span style="color: #0000dd; font-weight: bold;">0</span> <span style="color: #333333;">=</span> door, <span style="color: #0000dd; font-weight: bold;">1</span> <span style="color: #333333;">=</span> light
inputs[i]<span style="color: #333333;">.</span>mode <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"inputMode"</span>][i]; <span style="color: #333333;">//</span> choose mode of <span style="color: #007020;">input</span> terminals, <span style="color: #0000dd; font-weight: bold;">0</span> <span style="color: #333333;">=</span> door, <span style="color: #0000dd; font-weight: bold;">1</span> <span style="color: #333333;">=</span> light
tempName <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"buttonNames"</span>][i];
htmlButtonNames[i] <span style="color: #333333;">=</span> tempName;
buttons[i]<span style="color: #333333;">.</span>show <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"show"</span>][i];
buttons[i]<span style="color: #333333;">.</span>onTime <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"onTime"</span>][i];
inputs[i]<span style="color: #333333;">.</span>onTime <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"onTime"</span>][i];
}
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
DEBUG_PRINT(<span style="background-color: #fff0f0;">"IO Config button "</span>); DEBUG_PRINT(i <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(buttons[i]<span style="color: #333333;">.</span>mode);
}
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"IOConfig data read"</span>);
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
DEBUG_PRINT(<span style="background-color: #fff0f0;">"IO Input "</span>); DEBUG_PRINT(i <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(inputs[i]<span style="color: #333333;">.</span>mode);
}
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Button name "</span>); DEBUG_PRINT(i <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(htmlButtonNames[i]);
}
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Button Show "</span>); DEBUG_PRINT(i <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(buttons[i]<span style="color: #333333;">.</span>show);
}
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> modeArraySize; i<span style="color: #333333;">++</span>) {
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Button onTime "</span>); DEBUG_PRINT(i <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(buttons[i]<span style="color: #333333;">.</span>onTime);
}
DEBUG_PRINTLN(<span style="background-color: #fff0f0;">"Reading PWM Values from JSON File"</span>);
DEBUG_PRINT(<span style="background-color: #fff0f0;">"PWM Array size is "</span>); DEBUG_PRINTLN(pwmArraySize);
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> pwmArraySize; i<span style="color: #333333;">++</span>) {
panelButtonPWM[i] <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"buttonPWM"</span>][i]; <span style="color: #333333;">//</span> Read PWM Value <span style="color: #008800; font-weight: bold;">for</span> button illumination, <span style="color: #0000dd; font-weight: bold;">0</span> <span style="color: #333333;">-</span> <span style="color: #0000dd; font-weight: bold;">1024</span>
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Button PWM_"</span>); DEBUG_PRINT(i); DEBUG_PRINT(<span style="background-color: #fff0f0;">" is "</span>); DEBUG_PRINTLN(panelButtonPWM[i]);
}
tempSlope <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"tempSlope"</span>];
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Temperature Slope Calibration is: "</span>); DEBUG_PRINTLN(tempSlope);
tempIntercept <span style="color: #333333;">=</span> json[<span style="background-color: #fff0f0;">"tempIntercept"</span>];
DEBUG_PRINT(<span style="background-color: #fff0f0;">"Temperature Slope Intercept is: "</span>); DEBUG_PRINTLN(tempIntercept);
<span style="color: #008800; font-weight: bold;">return</span> true;
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
And there's a lot there - but it's much easier to manage than trying to search longs strings of data!<br />
<br />
Same for saving data:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;">//******************************************************************************************************************************</span>
<span style="color: #333333;">//</span> Save settings to config <span style="color: #007020;">file</span>
<span style="color: #333333;">//******************************************************************************************************************************</span>
<span style="color: #007020;">bool</span> saveConfig() {
DynamicJsonBuffer jsonBuffer;
JsonObject<span style="color: #333333;">&</span> rootSave <span style="color: #333333;">=</span> jsonBuffer<span style="color: #333333;">.</span>createObject();
String tempString <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
rootSave[<span style="background-color: #fff0f0;">"Version"</span>] <span style="color: #333333;">=</span> gdiVersion;
rootSave[<span style="background-color: #fff0f0;">"SSID"</span>] <span style="color: #333333;">=</span> ssid;
rootSave[<span style="background-color: #fff0f0;">"Password"</span>] <span style="color: #333333;">=</span> password;
rootSave[<span style="background-color: #fff0f0;">"hostName"</span>] <span style="color: #333333;">=</span> hostName;
rootSave[<span style="background-color: #fff0f0;">"temperatureChoice"</span>] <span style="color: #333333;">=</span> temperatureChoice;
rootSave[<span style="background-color: #fff0f0;">"APName"</span>] <span style="color: #333333;">=</span> apSSID;
rootSave[<span style="background-color: #fff0f0;">"APPass"</span>] <span style="color: #333333;">=</span> apPASS;
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Save Config creating nested array's"</span>);
JsonArray<span style="color: #333333;">&</span> buttonMode <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"buttonMode"</span>);
JsonArray<span style="color: #333333;">&</span> inputMode <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"inputMode"</span>);
JsonArray<span style="color: #333333;">&</span> buttonNames <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"buttonNames"</span>);
JsonArray<span style="color: #333333;">&</span> show <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"show"</span>);
JsonArray<span style="color: #333333;">&</span> onTime <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"onTime"</span>);
JsonArray<span style="color: #333333;">&</span> buttonPWM <span style="color: #333333;">=</span> rootSave<span style="color: #333333;">.</span>createNestedArray(<span style="background-color: #fff0f0;">"buttonPWM"</span>);
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Save Config saving temp cal numbers"</span>);
rootSave[<span style="background-color: #fff0f0;">"tempSlope"</span>] <span style="color: #333333;">=</span> tempSlope;
rootSave[<span style="background-color: #fff0f0;">"tempIntercept"</span>] <span style="color: #333333;">=</span> tempIntercept;
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Save Config adding button modes."</span>);
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">4</span>; i<span style="color: #333333;">++</span>) {
buttonMode<span style="color: #333333;">.</span>add(buttons[i]<span style="color: #333333;">.</span>mode);
inputMode<span style="color: #333333;">.</span>add(inputs[i]<span style="color: #333333;">.</span>mode);
buttonNames<span style="color: #333333;">.</span>add(htmlButtonNames[i]);
show<span style="color: #333333;">.</span>add(buttons[i]<span style="color: #333333;">.</span>show);
onTime<span style="color: #333333;">.</span>add(buttons[i]<span style="color: #333333;">.</span>onTime);
}
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Save Config adding PWM data"</span>);
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #007020;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">2</span>; i<span style="color: #333333;">++</span>) {
buttonPWM<span style="color: #333333;">.</span>add(panelButtonPWM[i]);
}
File configFile <span style="color: #333333;">=</span> SPIFFS<span style="color: #333333;">.</span>open(<span style="background-color: #fff0f0;">"/config.json"</span>, <span style="background-color: #fff0f0;">"w"</span>);
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Save Config opening SPIFFS File"</span>);
<span style="color: #333333;">//</span> File configFile <span style="color: #333333;">=</span> SPIFFS<span style="color: #333333;">.</span>open(<span style="background-color: #fff0f0;">"/test.json"</span>, <span style="background-color: #fff0f0;">"w"</span>); <span style="color: #333333;">//</span> this <span style="color: black; font-weight: bold;">is</span> <span style="color: #008800; font-weight: bold;">for</span> testing
<span style="color: #008800; font-weight: bold;">if</span> (<span style="background-color: #ffaaaa; color: red;">!</span>configFile) {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Failed to open config file for writing"</span>);
<span style="color: #008800; font-weight: bold;">return</span> false;
}
rootSave<span style="color: #333333;">.</span>printTo(configFile);
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Config Saved."</span>);
<span style="color: #008800; font-weight: bold;">return</span> true;
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
So far, this description has focussed on using files from spiffs. But what about transferring data between the Server and the Client?<br />
<h3>
Run an Websocket Server on your Desktop</h3>
Wait, what?<br />
<br />
Websockets, for transferring data between your webpage and your server are excellent and easy.<br />
<br />
As the name suggests, you can open a socket between the server and client and share data.<br />
<br />
Following this chat-sever tutorial I was able to set up a <a href="http://node.js/">Node.js</a> server on my desktop (yes you have to install <a href="http://node.js/">Node.js</a> first).<br />
<br />
My version can be found <a href="https://github.com/ludzinc/Low-Cost-Labs/tree/master/SocketServer">here</a> and I simplified it a bit to help with my development.<br />
<h4>
How it Works: Sever Side</h4>
In short, my version:<br />
<br />
<ul>
<li>Receives a websocket packet, and checks to see if it's of type 'request'</li>
<li>If a request, it checks what the 'data' value is and then</li>
<li>Opens a .json file that has the same name as the data value and then</li>
<li>Sends the data in the file back to the requester</li>
<li>The requester in this case is typically the client (webpage) you are developing on your desktop. </li>
</ul>
The end goal will be to have the ESP8266 host your web socket server and respond to data requests, but while developing the compile / upload cycle in the Arduino IDE can suck up a lot of time. This way you simply add a .json file to your working folder and you can test changes in your page.<br /><ul>
</ul>
Yes, I've not yet explained how to use <a href="https://en.wikipedia.org/wiki/WebSocket">websockets </a>in your html pages - bear with me I'll get here.<br />
<br />
Working again with our temperature example, the client (webpage) sends a request using the following .json string:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3</pre>
</td><td><pre style="line-height: 125%; margin: 0;">{ <span style="background-color: #fff0f0;">"type"</span>: <span style="background-color: #fff0f0;">"request"</span>,
<span style="background-color: #fff0f0;">"data"</span>: <span style="background-color: #fff0f0;">"configTemperature"</span>
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
The socketserver.js file I'm running will first check if the 'type' is 'request' and if it is, it will then read what the 'data' is, and in this case check if the file 'configTemperature.json' is present. Then send the contents of that file back to the client. Nice.<br />
<h3>
How It Works: Client Side</h3>
</div>
<div>
<div>
Ok, thanks for sticking with me this far. Now it's time to discuss how to use Websockets in HTML pages. </div>
<div>
<h4>
Setting Up the Websocket, and Choosing Where to Connect</h4>
</div>
<div>
1. You need to use Javascript. I won't go into it here, but if you need to learn how to use it there are many great <a href="https://www.w3schools.com/js/default.asp">resources </a><a href="https://www.codecademy.com/learn/introduction-to-javascript">out </a><a href="https://www.learn-js.org/">there</a>.<br />
<br />
2. Set up the Websocket in your page with the following script:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;"><</span>script language<span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"javascript"</span> <span style="color: #007020;">type</span><span style="color: #333333;">=</span><span style="background-color: #fff0f0;">"text/javascript"</span><span style="color: #333333;">></span>
<span style="color: #333333;">//**************************************************************************</span>
<span style="color: #333333;">//</span> setup Websockets
<span style="color: #333333;">//**************************************************************************</span>
<span style="color: #333333;">//</span> use below when hosted on ESP8266
var wsUri <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'ws://'</span> <span style="color: #333333;">+</span> location<span style="color: #333333;">.</span>hostname <span style="color: #333333;">+</span> <span style="background-color: #fff0f0;">':81/'</span>;
<span style="color: #333333;">//</span> use below <span style="color: #008800; font-weight: bold;">for</span> connecting to ESP server via IP address (when testing code on PC)
<span style="color: #333333;">//</span> var wsUri <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'ws://192.168.1.111:81/'</span>;
<span style="color: #333333;">//</span> use below <span style="color: #008800; font-weight: bold;">for</span> connecting to Nodejs server (when testing code on PC)
<span style="color: #333333;">//</span> var wsUri <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">'ws://localhost:80/'</span>;
var output;
var echo <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
var requestMsg <span style="color: #333333;">=</span> []; <span style="color: #333333;">//</span> array of messages to be sent out the websocekt<span style="color: #333333;">.</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Note that I've got a few options in this setup:<br />
<br />
<ul>
<li>The uncommented line is used when connecting to a Websocket server on the ESP8266 itself, and the webpage is hosted on there also (file in SPIFFS). Good for final product, but makes for time consuming testing.</li>
<li>The commented out line with the hard coded IP address is for connecting to a Websocket server on the ESP8266 a you're testing your webpage on your PC. Quite nifty, if your ESP8266 code is mature and you're developing your webpage (good is you're reading and displaying live sensor data for example).</li>
<li>Lastly, if you're running a Websocket server on your desktop, and testing your webpage on your PC, the last line uses the localhost reference to connect to your websocket server.</li>
</ul>
<div>
You'll also see that in two case I use port 81, and in one case I use port 80. Why? Because that's the way it was shown to me, and I don't know if there are any advantages using other ports. But hey, it works!</div>
</div>
<div>
<h4>
Now Open It!</h4>
</div>
<div>
After setting up the Websocket, you need to open it, like this:</div>
<div>
<br /></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25</pre>
</td><td><pre style="line-height: 125%; margin: 0;">function init() {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Initiating Home page"</span>);
openWebsocket();
}
<span style="color: #333333;">//**************************************************************************</span>
<span style="color: #333333;">//</span> Open Websockets
<span style="color: #333333;">//</span> As Websocekts are asynchronous, when first opening messages may be sent
<span style="color: #333333;">//</span> to a que to be processed once the readyState <span style="color: black; font-weight: bold;">is</span> <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span> (opened)
<span style="color: #333333;">//</span> this will send <span style="color: #007020;">all</span> queued messages once the socket <span style="color: black; font-weight: bold;">is</span> opened<span style="color: #333333;">.</span>
<span style="color: #333333;">//**************************************************************************</span>
function openWebsocket() {
var message <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
websocket <span style="color: #333333;">=</span> new WebSocket(wsUri);
websocket<span style="color: #333333;">.</span>onopen <span style="color: #333333;">=</span> function() {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Websocket opened."</span>);
<span style="color: #008800; font-weight: bold;">while</span> (requestMsg<span style="color: #333333;">.</span>length <span style="color: #333333;">></span> <span style="color: #0000dd; font-weight: bold;">0</span>) {
message <span style="color: #333333;">=</span> requestMsg<span style="color: #333333;">.</span>pop();
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Popping message "</span>, message, <span style="background-color: #fff0f0;">" from queue."</span>);
websocket<span style="color: #333333;">.</span>send(message);
}
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Message queue now empty."</span>);
}
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Once open, as per the comments, this code will check for queued messages and send them out if needed.<br />
<h4>
Query for Messages</h4>
<div>
The following code processes Websockets when received<br />
<br /></div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;"> //**************************************************************************</span>
<span style="color: #333333;">//</span> Query Websockets
<span style="color: #333333;">//</span> Take action <span style="color: #008800; font-weight: bold;">as</span> required on webSocket
<span style="color: #333333;">//</span> Either queues <span style="color: black; font-weight: bold;">or</span> sends messages based on readyState of the socket
<span style="color: #333333;">//**************************************************************************</span>
function queryWebSocket(request) {
<span style="color: #008800; font-weight: bold;">if</span> (websocket<span style="color: #333333;">.</span>readyState <span style="color: #333333;">==</span> <span style="color: #0000dd; font-weight: bold;">3</span>) {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Websocket not open, opening."</span>)
openWebsocket();
}
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Requesting: "</span>, request);
<span style="color: #008800; font-weight: bold;">if</span> (websocket<span style="color: #333333;">.</span>readyState <span style="color: #333333;">!==</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
requestMsg<span style="color: #333333;">.</span>push(request);
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"request pushed to array"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
websocket<span style="color: #333333;">.</span>send(request);
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"request sent to websocket"</span>);
}
websocket<span style="color: #333333;">.</span>onclose <span style="color: #333333;">=</span> function(evt) {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Websocket disconnected"</span>);
};
websocket<span style="color: #333333;">.</span>onmessage <span style="color: #333333;">=</span> function(evt) {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Websocket message received."</span>)
onMessage(evt);
};
websocket<span style="color: #333333;">.</span>onerror <span style="color: #333333;">=</span> function(evt) {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Websocket Error! "</span> <span style="color: #333333;">+</span> evt<span style="color: #333333;">.</span>data);
};
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
So how does this actually work? WebSocket is a built-in Javascript class, and websocket is a variable of that class. The .readyState, .send, .onClose and .onMessage are functions called when required. For example, when a websocket message comes in, websocket.onmessage is active data (evt) is passed in, and is the passed to the function onMessage.<br />
<h4>
Processing Received Messages</h4>
<div>
In the example below, as I'm only expecting JSON formatted messages now, I parse it and if the 'echo' (jsonMessage.echo) is 'getEnvironmentals' I get on with business, otherwise throw an error message. And yes, I need to learn how to spell 'received'....</div>
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> function onMessage(evt) {
var messageRecieved <span style="color: #333333;">=</span> evt<span style="color: #333333;">.</span>data;
var jsonMessage <span style="color: #333333;">=</span> JSON<span style="color: #333333;">.</span>parse(messageRecieved);
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"Message Recieved is: "</span> <span style="color: #333333;">+</span> messageRecieved);
<span style="color: #008800; font-weight: bold;">if</span> (jsonMessage<span style="color: #333333;">.</span>echo <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"getEnvironmentals"</span>) {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"getting environmentals"</span>);
displayEnvironmentals(jsonMessage);
} <span style="color: #008800; font-weight: bold;">else</span> {
console<span style="color: #333333;">.</span>log(<span style="background-color: #fff0f0;">"ERROR: Unknown message received."</span>)
}
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
In the above example I look for 'echo' as it's my reply to any 'requests' I send. You can make up your own rules.<br />
<h3>
How It Works: Server Side</h3>
</div>
<div>
On the server (ESP8266) side there's<a href="https://techtutorialsx.com/2018/06/02/esp8266-arduino-socket-server/"> many tutorials</a> <a href="https://github.com/Links2004/arduinoWebSockets">on how to</a> <a href="https://tttapa.github.io/ESP8266/Chap14%20-%20WebSocket.html">set up your websocket server</a> so I'll skip over those details, and jump into my example directly.</div>
<h4>
Start with an Example</h4>
<div>
<a href="https://github.com/Links2004/arduinoWebSockets/blob/master/examples/esp8266/WebSocketServer/WebSocketServer.ino">This example</a> is a good place to start:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;">/*</span>
<span style="color: #333333;">*</span> WebSocketServer<span style="color: #333333;">.</span>ino
<span style="color: #333333;">*</span>
<span style="color: #333333;">*</span> Created on: <span style="color: #6600ee; font-weight: bold;">22.05</span><span style="color: #333333;">.</span><span style="color: #0000dd; font-weight: bold;">2015</span>
<span style="color: #333333;">*</span>
<span style="color: #333333;">*/</span>
<span style="color: #888888;">#include <Arduino.h></span>
<span style="color: #888888;">#include <ESP8266WiFi.h></span>
<span style="color: #888888;">#include <ESP8266WiFiMulti.h></span>
<span style="color: #888888;">#include <WebSocketsServer.h></span>
<span style="color: #888888;">#include <Hash.h></span>
ESP8266WiFiMulti WiFiMulti;
WebSocketsServer webSocket <span style="color: #333333;">=</span> WebSocketsServer(<span style="color: #0000dd; font-weight: bold;">81</span>);
<span style="color: #888888;">#define USE_SERIAL Serial1</span>
void webSocketEvent(uint8_t num, WStype_t <span style="color: #007020;">type</span>, uint8_t <span style="color: #333333;">*</span> payload, size_t length) {
switch(<span style="color: #007020;">type</span>) {
case WStype_DISCONNECTED:
USE_SERIAL<span style="color: #333333;">.</span>printf(<span style="background-color: #fff0f0;">"[</span><span style="background-color: #eeeeee;">%u</span><span style="background-color: #fff0f0;">] Disconnected!</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, num);
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_CONNECTED:
{
IPAddress ip <span style="color: #333333;">=</span> webSocket<span style="color: #333333;">.</span>remoteIP(num);
USE_SERIAL<span style="color: #333333;">.</span>printf(<span style="background-color: #fff0f0;">"[</span><span style="background-color: #eeeeee;">%u</span><span style="background-color: #fff0f0;">] Connected from </span><span style="background-color: #eeeeee;">%d</span><span style="background-color: #fff0f0;">.</span><span style="background-color: #eeeeee;">%d</span><span style="background-color: #fff0f0;">.</span><span style="background-color: #eeeeee;">%d</span><span style="background-color: #fff0f0;">.</span><span style="background-color: #eeeeee;">%d</span><span style="background-color: #fff0f0;"> url: </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, num, ip[<span style="color: #0000dd; font-weight: bold;">0</span>], ip[<span style="color: #0000dd; font-weight: bold;">1</span>], ip[<span style="color: #0000dd; font-weight: bold;">2</span>], ip[<span style="color: #0000dd; font-weight: bold;">3</span>], payload);
<span style="color: #333333;">//</span> send message to client
webSocket<span style="color: #333333;">.</span>sendTXT(num, <span style="background-color: #fff0f0;">"Connected"</span>);
}
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_TEXT:
USE_SERIAL<span style="color: #333333;">.</span>printf(<span style="background-color: #fff0f0;">"[</span><span style="background-color: #eeeeee;">%u</span><span style="background-color: #fff0f0;">] get Text: </span><span style="background-color: #eeeeee;">%s</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, num, payload);
<span style="color: #333333;">//</span> send message to client
<span style="color: #333333;">//</span> webSocket<span style="color: #333333;">.</span>sendTXT(num, <span style="background-color: #fff0f0;">"message here"</span>);
<span style="color: #333333;">//</span> send data to <span style="color: #007020;">all</span> connected clients
<span style="color: #333333;">//</span> webSocket<span style="color: #333333;">.</span>broadcastTXT(<span style="background-color: #fff0f0;">"message here"</span>);
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_BIN:
USE_SERIAL<span style="color: #333333;">.</span>printf(<span style="background-color: #fff0f0;">"[</span><span style="background-color: #eeeeee;">%u</span><span style="background-color: #fff0f0;">] get binary length: </span><span style="background-color: #eeeeee;">%u</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, num, length);
hexdump(payload, length);
<span style="color: #333333;">//</span> send message to client
<span style="color: #333333;">//</span> webSocket<span style="color: #333333;">.</span>sendBIN(num, payload, length);
<span style="color: #008800; font-weight: bold;">break</span>;
}
}
void setup() {
<span style="color: #333333;">//</span> USE_SERIAL<span style="color: #333333;">.</span>begin(<span style="color: #0000dd; font-weight: bold;">921600</span>);
USE_SERIAL<span style="color: #333333;">.</span>begin(<span style="color: #0000dd; font-weight: bold;">115200</span>);
<span style="color: #333333;">//</span>Serial<span style="color: #333333;">.</span>setDebugOutput(true);
USE_SERIAL<span style="color: #333333;">.</span>setDebugOutput(true);
USE_SERIAL<span style="color: #333333;">.</span>println();
USE_SERIAL<span style="color: #333333;">.</span>println();
USE_SERIAL<span style="color: #333333;">.</span>println();
<span style="color: #008800; font-weight: bold;">for</span>(uint8_t t <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">4</span>; t <span style="color: #333333;">></span> <span style="color: #0000dd; font-weight: bold;">0</span>; t<span style="color: #333333;">--</span>) {
USE_SERIAL<span style="color: #333333;">.</span>printf(<span style="background-color: #fff0f0;">"[SETUP] BOOT WAIT </span><span style="background-color: #eeeeee;">%d</span><span style="background-color: #fff0f0;">...</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, t);
USE_SERIAL<span style="color: #333333;">.</span>flush();
delay(<span style="color: #0000dd; font-weight: bold;">1000</span>);
}
WiFiMulti<span style="color: #333333;">.</span>addAP(<span style="background-color: #fff0f0;">"SSID"</span>, <span style="background-color: #fff0f0;">"passpasspass"</span>);
<span style="color: #008800; font-weight: bold;">while</span>(WiFiMulti<span style="color: #333333;">.</span>run() <span style="color: #333333;">!=</span> WL_CONNECTED) {
delay(<span style="color: #0000dd; font-weight: bold;">100</span>);
}
webSocket<span style="color: #333333;">.</span>begin();
webSocket<span style="color: #333333;">.</span>onEvent(webSocketEvent);
}
void loop() {
webSocket<span style="color: #333333;">.</span>loop();
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br /></div>
<div>
In the above, once set up, the webSocket.loop(); call processes websocket actions when needed.<br />
<br />
On a websocket event - the following code runs:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;">//******************************************************************************************************************************</span>
<span style="color: #333333;">//</span> Websockets Events
<span style="color: #333333;">//******************************************************************************************************************************</span>
void webSocketEvent(uint8_t num, WStype_t <span style="color: #007020;">type</span>, uint8_t <span style="color: #333333;">*</span> payload, size_t length) {
switch (<span style="color: #007020;">type</span>) {
case WStype_DISCONNECTED: <span style="color: #333333;">//</span> Add code here to execute <span style="color: #008800; font-weight: bold;">if</span> disconnected
DEBUG_PRINTLN(<span style="background-color: #fff0f0;">"Websocket disconnected"</span>);
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_CONNECTED: <span style="color: #333333;">//</span> Add code here to execute when connected
{
<span style="color: #333333;">//</span>getConfig();
IPAddress ip <span style="color: #333333;">=</span> webSocket<span style="color: #333333;">.</span>remoteIP(num); <span style="color: #333333;">//</span> Get ip address of connection
Serial<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">print</span>(<span style="background-color: #fff0f0;">"Websocket IP Address is: "</span>); Serial<span style="color: #333333;">.</span>println(ip);
}
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_TEXT: <span style="color: #333333;">//</span> Execute code here to match text etc
{
String text <span style="color: #333333;">=</span> String((char <span style="color: #333333;">*</span>) <span style="color: #333333;">&</span>payload[<span style="color: #0000dd; font-weight: bold;">0</span>]);
Serial<span style="color: #333333;">.</span><span style="color: #008800; font-weight: bold;">print</span>(<span style="background-color: #fff0f0;">"WStype_TEXT recieved was: "</span>);
Serial<span style="color: #333333;">.</span>println(text);
parseWebsocketText(text, num);
}
<span style="color: #008800; font-weight: bold;">break</span>;
case WStype_BIN:
DEBUG_PRINT(<span style="background-color: #fff0f0;">"WStype_BIN recieved."</span>);
hexdump(payload, length); <span style="color: #333333;">//</span> echo data back to browser
webSocket<span style="color: #333333;">.</span>sendBIN(num, payload, length);
<span style="color: #008800; font-weight: bold;">break</span>;
}
}
</pre>
</td></tr>
</tbody></table>
</div>
<br />
As I'm passing data using JOSN files I look to see if text was recieved, and if so process it in the following manner:</div>
<!-- HTML generated using hilite.me --><br />
<br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;">//******************************************************************************************************************************</span>
<span style="color: #333333;">//</span> Parse rx<span style="background-color: #fff0f0;">'s websocket text and check if it'</span>s a valid request
<span style="color: #333333;">//******************************************************************************************************************************</span>
void parseWebsocketText(String text, uint8_t num) {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Parseing Web Socket."</span>);
String message <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"{</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;">echo</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;">:</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;">Invalid Message Received.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;">}"</span>;
DynamicJsonBuffer jsonBuffer;
JsonObject<span style="color: #333333;">&</span> jsonData <span style="color: #333333;">=</span> jsonBuffer<span style="color: #333333;">.</span>parseObject(text);
const char<span style="color: #333333;">*</span> <span style="color: #007020;">type</span> <span style="color: #333333;">=</span> jsonData[<span style="background-color: #fff0f0;">"type"</span>];
<span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"type"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"request"</span>) {
<span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"data"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"configTemperature"</span>) {
message <span style="color: #333333;">=</span> sendTemperature();
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"data"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"configButtons"</span>) {
message <span style="color: #333333;">=</span> sendButtonConfig();
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"data"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"configButtonPWM"</span>) {
message <span style="color: #333333;">=</span> sendButtonPWM();
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"data"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"localName"</span>) {
message <span style="color: #333333;">=</span> sendLocalName();
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"data"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"listSSIDs"</span>) {
message <span style="color: #333333;">=</span> sendSSID();
} <span style="color: #008800; font-weight: bold;">else</span> {
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Unknown JSON Type"</span>);
}
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"type"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"saveNetworkData"</span>) {
message <span style="color: #333333;">=</span> saveNetworkConfig(jsonData);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"type"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"saveButtons"</span>) {
message <span style="color: #333333;">=</span> saveButtonConfig(jsonData);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"type"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"saveTemperature"</span>) {
message <span style="color: #333333;">=</span> saveTemperatureConfig(jsonData);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> ((jsonData[<span style="background-color: #fff0f0;">"type"</span>]) <span style="color: #333333;">==</span> <span style="background-color: #fff0f0;">"saveButtonPWM"</span>) {
message <span style="color: #333333;">=</span> saveButtonPWMConfig(jsonData);
}
Serial<span style="color: #333333;">.</span>println(<span style="background-color: #fff0f0;">"Sending Websocket Message:"</span>);
Serial<span style="color: #333333;">.</span>println(message);
webSocket<span style="color: #333333;">.</span>sendTXT(num, message<span style="color: #333333;">.</span>c_str(), message<span style="color: #333333;">.</span>length()); <span style="color: #333333;">//</span> Send update data
}
</pre>
</td></tr>
</tbody></table>
</div>
<div>
<br />
You can of course tailor this to your own requirements.<br />
<h2>
Wrapping Up</h2>
</div>
<div>
Okay, if you've made it hits far, thanks!</div>
<h3>
Granting a Wish</h3>
<div>
So, me from 4 years ago was trying to get started with a practical working example to control GPIO from a webpage, <a href="https://github.com/ludzinc/Low-Cost-Labs/tree/master/IOT_TEMPLATE">so here it is</a>!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijo4J0G3g4PNwuFspTGow9C8qAD6ZRE5oMzXtz6aDI99wne0XyrhVPL575Auxj-JZLhh85AC0qVagq27qDsTczpx4554d6EPTcftzhlgyPNanf4LEXbDrbZkw8Fe2GOeHFb6tLQjZKWxJj/s1600/IOT+TEMPLATE+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="676" data-original-width="385" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijo4J0G3g4PNwuFspTGow9C8qAD6ZRE5oMzXtz6aDI99wne0XyrhVPL575Auxj-JZLhh85AC0qVagq27qDsTczpx4554d6EPTcftzhlgyPNanf4LEXbDrbZkw8Fe2GOeHFb6tLQjZKWxJj/s320/IOT+TEMPLATE+00.png" width="182" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<div>
<br /></div>
<div>
This example:</div>
<div>
<ol>
<li>Uses Twitter Bootstrap theme to make it look half decent from the get go</li>
<li>Sends AJAX requests to control GPIO</li>
<li>Uses websockets to determine the current state of a GPIO with json formatted requests</li>
<li>Also shows an error message if the websocket cannot connect</li>
<li>Throws up a 404 not found page</li>
</ol>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqrkkWWp9YycPykirnWj02pRlzCzaK176ZRe-XuS5tX9kZry5_k2eoYdDu25U3gGRyf6Q-bxdJgzXR7iAhkOWiV1SL7pLSIeDSmY32qQ47p-7N4tJxjtNiYJti8PEN0jVNFi73hh60XEqA/s1600/IOT+TEMPLATE+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="190" data-original-width="385" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqrkkWWp9YycPykirnWj02pRlzCzaK176ZRe-XuS5tX9kZry5_k2eoYdDu25U3gGRyf6Q-bxdJgzXR7iAhkOWiV1SL7pLSIeDSmY32qQ47p-7N4tJxjtNiYJti8PEN0jVNFi73hh60XEqA/s320/IOT+TEMPLATE+01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
If you start with a <a href="https://wiki.wemos.cc/products:d1:d1_mini">WeMos D1 Mini</a>, you can be up and running in just a few minutes. You're welcome, past me!</div>
</div>
<div>
<br /></div>
<div>
(That said, there's a lot in there - I will go into details about this later!)</div>
<div>
<br /></div>
<div>
And, yes, I can now open my garage door from my phone :)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMG7DLvYVt55cykAZDNzVTwb-kF1dY5ReP9VAJhbBjlbmP5ZVe6kykqI1cFLiprUvGdx4U4kXCoTDtuzhU9m38tlBcGRntljkN0ZeQnTf88RCu1RXl64Jcd1LiNP0TsFh03vqYFiWGMemS/s1600/GDI+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="680" data-original-width="388" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMG7DLvYVt55cykAZDNzVTwb-kF1dY5ReP9VAJhbBjlbmP5ZVe6kykqI1cFLiprUvGdx4U4kXCoTDtuzhU9m38tlBcGRntljkN0ZeQnTf88RCu1RXl64Jcd1LiNP0TsFh03vqYFiWGMemS/s320/GDI+01.png" width="182" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
More on that <a href="http://ludzinc.blogspot.com/2019/07/my-garage-door-opener-software.html">here</a>. Enjoy!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com15tag:blogger.com,1999:blog-2685787041614376103.post-67241166933029160422019-06-28T07:12:00.003-07:002019-07-02T07:30:54.472-07:00TV TROUBLE<h2 style="clear: both; text-align: left;">
Unhappy Wife</h2>
<div>
The other night, the TV stopped working. Home and Away was getting missed and the wife wasn't happy.</div>
<div>
<br /></div>
<div>
About 10 years ago I installed an active antenna, and used some crimp connectors to terminate the Quad Shield RG6. This cable carries both the RF signal and 5V DC to power the amp. </div>
<div>
<br /></div>
<div>
A quick measure with the multimeter showed that the volts were around 2V at the feed to the amp so it looked like there was an issue with the cable. </div>
<div>
<br /></div>
<div>
The outer insulation looked ok, but there was grey powder at the crimp connection itself. </div>
<div>
<br /></div>
<div>
So I stripped back the outer jacket to find:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIwSofmFYSh7wUv5DdGDTzVESb78MI6G-7ol5eCI_QexmESN77Wi6dd71LboIfdDR3Xm47Jnn6njuxhv0YFRpQ_cHNrmCZn6rSbwV-WQteIdsA-WB5KIz6TkGEqqlGmgCf9su9ooBzYtYV/s1600/IMG_1096.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIwSofmFYSh7wUv5DdGDTzVESb78MI6G-7ol5eCI_QexmESN77Wi6dd71LboIfdDR3Xm47Jnn6njuxhv0YFRpQ_cHNrmCZn6rSbwV-WQteIdsA-WB5KIz6TkGEqqlGmgCf9su9ooBzYtYV/s320/IMG_1096.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
- that I was right. The cable was stuffed. </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><br /><br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It was cold, dark and I had no tools to work RG6 and F connectors, what could I do?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaSBf4EXOuRtLovOJH-4estxCGg3QL-AaaGbWWQW9WjwSEm9J2633CB4fPBxyFP-TKOH_fmlL6wCJp2WHadzJLQ64D23NxtYoUM7nKadieWe_o35787RshK6X9rgjTKuENDYd6rZ7UDTlE/s1600/IMG_1097.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaSBf4EXOuRtLovOJH-4estxCGg3QL-AaaGbWWQW9WjwSEm9J2633CB4fPBxyFP-TKOH_fmlL6wCJp2WHadzJLQ64D23NxtYoUM7nKadieWe_o35787RshK6X9rgjTKuENDYd6rZ7UDTlE/s320/IMG_1097.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With nothing to lose, I tried wrapping the connector with Al-foil. Complete bodge.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI6cLqfGXWhUrq5WkdDwhpm07G1ywsLzp-JumiFXz-S8-57zuzQAfhIi_32fofYtTQTGbzp-a-nfZ9jjBp3bMVfr6UZ320BFgxLSFs-56KwfvtS6pgBep9M1kXzNhn3XQz1rhC9vrOUuQQ/s1600/IMG_1098.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI6cLqfGXWhUrq5WkdDwhpm07G1ywsLzp-JumiFXz-S8-57zuzQAfhIi_32fofYtTQTGbzp-a-nfZ9jjBp3bMVfr6UZ320BFgxLSFs-56KwfvtS6pgBep9M1kXzNhn3XQz1rhC9vrOUuQQ/s320/IMG_1098.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So I wrapped it with duct tape. To make it a professional repair. :)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcch9ainwHFKCpchlQV_8Ax215ZBoDKC_TmLpDt5GwRaRzte-dxfxVfKRIZ2I0-roF_7Tn2nM2C2TV4p0E9IFX7bDc2vee9dLXizlh1Lru7AR2W115JT98eiJaBixVlJZ0QjcrCav7HHG7/s1600/IMG_1099.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcch9ainwHFKCpchlQV_8Ax215ZBoDKC_TmLpDt5GwRaRzte-dxfxVfKRIZ2I0-roF_7Tn2nM2C2TV4p0E9IFX7bDc2vee9dLXizlh1Lru7AR2W115JT98eiJaBixVlJZ0QjcrCav7HHG7/s320/IMG_1099.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then hooked it back up to the amp, with a new connecting cable.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2pEluUYb3ViYFoDF1s8VnWB0HoVsH6l-m6yldnE5FKpZa7i83c__VFgXGTWqbd014S2827kfZ2uQPMlMYBDvtHo-SDDB3fJzybM3wZEfbQHIJsCCOsD3ejKrG9GSqQZpKxfR1lJR37xck/s1600/IMG_1100.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2pEluUYb3ViYFoDF1s8VnWB0HoVsH6l-m6yldnE5FKpZa7i83c__VFgXGTWqbd014S2827kfZ2uQPMlMYBDvtHo-SDDB3fJzybM3wZEfbQHIJsCCOsD3ejKrG9GSqQZpKxfR1lJR37xck/s320/IMG_1100.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And, Success!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Doing It Right the Second Time</h2>
<div class="separator" style="clear: both; text-align: left;">
Ok, so the bodge worked, but for how long? Time to fix it properly.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuZ5uezoKvQS4qlb8PopftNbf3yncDXp9R66B3dVyDkq7baY5kFUC7IHF6MaB-bWIVIZnY6l8zugg70t_u3U5Z3J635B9ZwbWieHnmurcDFnBprFxpIthyphenhyphenxTLeSNxKY3bXxHc4RFn6is4Z/s1600/IMG_1101.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1334" data-original-width="750" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuZ5uezoKvQS4qlb8PopftNbf3yncDXp9R66B3dVyDkq7baY5kFUC7IHF6MaB-bWIVIZnY6l8zugg70t_u3U5Z3J635B9ZwbWieHnmurcDFnBprFxpIthyphenhyphenxTLeSNxKY3bXxHc4RFn6is4Z/s320/IMG_1101.PNG" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Aliexpress to the rescue - bunch of connectors and compression tool for < $20 delivered. Awesome. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuCpu7dmFLS4D9mqDMPQ54aBefVz0-q6AourZwjQ8yz7ErgrKtcL75SRqiRkVVfEyxbzuBCZg-QCXYGZI39W8hL_qy70VpOmlFxG5rDp8I3NcsUQfcJufV4BtebijrykMCNPSPpRYQn1M/s1600/IMG_1109.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuCpu7dmFLS4D9mqDMPQ54aBefVz0-q6AourZwjQ8yz7ErgrKtcL75SRqiRkVVfEyxbzuBCZg-QCXYGZI39W8hL_qy70VpOmlFxG5rDp8I3NcsUQfcJufV4BtebijrykMCNPSPpRYQn1M/s320/IMG_1109.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Took literally 3 minutes to chop off the old end and fit the new connector. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbmlSwq99cn-U_188-hXq59ItPYVqgyU-hWkRf5q1ecPnHIYme92jQo17q3JwhAwb-p8xoC02PkKxNsMj4u8B0MDZM5gu-hBfKbPpVWESdKBSOBwahO48GUYBlszaQTFAm0zYTP8vaWfBP/s1600/IMG_1110.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbmlSwq99cn-U_188-hXq59ItPYVqgyU-hWkRf5q1ecPnHIYme92jQo17q3JwhAwb-p8xoC02PkKxNsMj4u8B0MDZM5gu-hBfKbPpVWESdKBSOBwahO48GUYBlszaQTFAm0zYTP8vaWfBP/s320/IMG_1110.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Compared to the sawging type of connector, this was simple and easy to fit!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaASQJTfwcP8_WumU33I6LmYTUfclhAv1N9P5nlaHuQ2IkM7Yq9xFT_-w5nMNULxckawW5E60tFdFMT1EFsLrr16Vq4O8kveD6ZRb2DEVQQQ6UzU_Gr4aaURVD8qMxG9bmclMCgY_3oeq/s1600/IMG_1111.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaASQJTfwcP8_WumU33I6LmYTUfclhAv1N9P5nlaHuQ2IkM7Yq9xFT_-w5nMNULxckawW5E60tFdFMT1EFsLrr16Vq4O8kveD6ZRb2DEVQQQ6UzU_Gr4aaURVD8qMxG9bmclMCgY_3oeq/s320/IMG_1111.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I din't get a before pic - but the whole reason the cable corroded was that I'd simply ran it through a hole in the eaves, and it was exposed to the elements. So this time I finally fitted the mounting plate I had in my parts bin for 10 years.....</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ8pluc1XOKwyqEtCmlDCrin6R3OgziTmmNfee_Sqf14LgZ049D8LtwZ_0mCJteNyw3TuFd-AJ3KUk4E3hCrbG6QlNpMV170ES90TskpbWOu5IIwQllvWJ0eqF5nPlzBYy5DnSbK3zEkiJ/s1600/IMG_1112.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ8pluc1XOKwyqEtCmlDCrin6R3OgziTmmNfee_Sqf14LgZ049D8LtwZ_0mCJteNyw3TuFd-AJ3KUk4E3hCrbG6QlNpMV170ES90TskpbWOu5IIwQllvWJ0eqF5nPlzBYy5DnSbK3zEkiJ/s320/IMG_1112.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also fitted a new connector cable between the antenna and the mounting plate.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Job Done, Happy Wife, time to enjoy the Happy Life!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-24719759464148109592017-06-20T07:04:00.000-07:002018-01-03T17:19:31.629-08:00I Didn't Say Which Christmas....<h2>
Well, Halloween, anyway....</h2>
<div>
Growing up there was a saying in our house. Dad, when pushed for a deadline, would quip "By Christmas." If Christmas beat Dad to delivering the cubby house / painted kitchen / whatever he'd promised, he'd simply state "I didn't say <i>which</i> Christmas...."</div>
<div>
<br /></div>
<div>
At the time, that saying annoyed me. These days, I hide behind it!</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2UtJZ8ECYR6ssjIY-W1EmpzY6apv8wsCb0Vg5ve07NmN79xe4hyphenhyphenEQMlq3CZISCIPl5byE097AVcMUvdQf0bNzRrHycOt_iktkeg1GHzXJc9jhqyLQzmiuN4HopN6fxD1BOouR2XirGlfW/s1600/pumpkins.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2UtJZ8ECYR6ssjIY-W1EmpzY6apv8wsCb0Vg5ve07NmN79xe4hyphenhyphenEQMlq3CZISCIPl5byE097AVcMUvdQf0bNzRrHycOt_iktkeg1GHzXJc9jhqyLQzmiuN4HopN6fxD1BOouR2XirGlfW/s320/pumpkins.jpg" width="320" /></a></div>
<div>
<a name='more'></a><br /></div>
<div>
<br /></div>
<h2>
2015</h2>
<div>
2015 bought a lot of promise, not limited to just hoverboards, but more excitingly for me, Altium had promised to release <a href="https://workspace.circuitmaker.com/">Circuit Maker</a>, their free PCB design tool, targeted for hobbyists.</div>
<div>
<br /></div>
<div>
Naturally I was a little bit impatient....</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6iwa-Utx5TjTu4SL8Ps6K-ThPMaOu7_5uLVol_My56NR9Ie767qBP3XEMstwu9NeY2PHESolwa3GZYhupFFB9jITRxbNZ5qALgYNrlV9xLUwC9kkHJ8yhZk9GrtPQur-LvsxncgToPXqy/s1600/tweet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="108" data-original-width="596" height="57" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6iwa-Utx5TjTu4SL8Ps6K-ThPMaOu7_5uLVol_My56NR9Ie767qBP3XEMstwu9NeY2PHESolwa3GZYhupFFB9jITRxbNZ5qALgYNrlV9xLUwC9kkHJ8yhZk9GrtPQur-LvsxncgToPXqy/s320/tweet.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Anyway, Altium got their act together and in <a href="http://ludzinc.blogspot.com.au/2015/05/circuit-maker-open-beta.html">May went to Open Beta</a>. Woot.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now to truly test a CAD programme, you need a project. I happened to have a few tubes of PIC16F648A's lying around, and I've wanted to experiment with low power battery operated devices, especially with the aim to see how low a sleep current I can achieve.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, with micros, jelly bean parts, LEDs and lack of inspiration, I asked the kids if there was anything I could make them. My youngest came up with the idea of a Halloween Badge. That being 5 months away, I was confident we could get something sorted.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I'd also used '<a href="https://octopart.com/lo+t77k-k1m2-24-osram+opto-31119868">Top Mount</a>' LEDS in the past, and knowing that FR4 can be translucent, thought that shining orange leds through the boards might be a good approximation to a candle.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At the same time I started punching out a LED Heart trinket, to sort out Valentines day as well...</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So armed with some random clipart from the web (which I can't find now, sorry!) I knocked <a href="https://circuitmaker.com/Projects/Details/Simon-Ludborzs/Digital-Pumpkin">this</a> up in Circuit Maker.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6s328qnPIeIMWlE6vS95FwZ11fkLgCOcEDJKxy-qljIBMt_HZOxwDCTlKBMf377QOiCGMI1c6_-87koDQFUEIAPm0sqXBrBDtnss0ywIugYUVFZGo_1QbS1Yg7xyciAL0dRt8N6iTgnGo/s1600/cm+pumpkin+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="867" data-original-width="1600" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6s328qnPIeIMWlE6vS95FwZ11fkLgCOcEDJKxy-qljIBMt_HZOxwDCTlKBMf377QOiCGMI1c6_-87koDQFUEIAPm0sqXBrBDtnss0ywIugYUVFZGo_1QbS1Yg7xyciAL0dRt8N6iTgnGo/s320/cm+pumpkin+02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkx4WehCJJ4DRKMXrqsymnYtT6CeLqt0Ld-eMeuBsW8NXSyu-baVEX6gBnD-wrQDS6woPPMvUAJSMtKcFcIJ4kzOZSkSUsEZr7I_furxYs98EuNwvQnwF6NpBUrTCOsQAjPUIe7tKYr2ya/s1600/cm+pumpkin+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="867" data-original-width="1600" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkx4WehCJJ4DRKMXrqsymnYtT6CeLqt0Ld-eMeuBsW8NXSyu-baVEX6gBnD-wrQDS6woPPMvUAJSMtKcFcIJ4kzOZSkSUsEZr7I_furxYs98EuNwvQnwF6NpBUrTCOsQAjPUIe7tKYr2ya/s320/cm+pumpkin+00.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqW0fAEdRDWPKpjzjfm4_aZ1CyYC1SzKl62HqxqkEhJa7YLTLKeijmGhsYe_kxWzeFGketLHM8X5SuZKK9zC3caetKZI84HeU8ZcrHWon3iE7X2IVyHvKNV956257SWQXFvhpHsbBJQ-oa/s1600/cm+pumpkin+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="867" data-original-width="1600" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqW0fAEdRDWPKpjzjfm4_aZ1CyYC1SzKl62HqxqkEhJa7YLTLKeijmGhsYe_kxWzeFGketLHM8X5SuZKK9zC3caetKZI84HeU8ZcrHWon3iE7X2IVyHvKNV956257SWQXFvhpHsbBJQ-oa/s320/cm+pumpkin+01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Time Keep's On Slipping</h2>
<div>
Okay, I've skipped over a bit... What I've shown above is the final revision. I started with a prototype design that I could mill at work and start developing code with. I've never had to do effects with LEDs and again, this project was a great opportunity to learn.</div>
<div>
<br /></div>
<div>
However, by the time I'd milled and coded these...</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmAwZ8ZJx5ZaV1MIlS7AVgPxo5eNoTaBQKmrMSaFxxkoZW4xePkszyGOykaPQ4lKdftyXYQ1fWtuYGrOYoXNbDcbl5sDEI3OJN6ns-9Gxokp-jwC8hALib-y5vi1CVFYtZoczjtypl58pN/s1600/IMG_3506.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmAwZ8ZJx5ZaV1MIlS7AVgPxo5eNoTaBQKmrMSaFxxkoZW4xePkszyGOykaPQ4lKdftyXYQ1fWtuYGrOYoXNbDcbl5sDEI3OJN6ns-9Gxokp-jwC8hALib-y5vi1CVFYtZoczjtypl58pN/s320/IMG_3506.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
First Prototypes</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDHyAPDcMjawkp4_COTK_IThqNNQie0JoOrpcnDGWUsd2A1BfKhxO6ECFibL-0Udy6DzgZf2kCf49b7sZWlWsefxQa4tkSMDRtiZaWhIjxDFYEvZ4Zgm9FAiPMVs8AGkaAeoDYpAYdtOQU/s1600/IMG_3508.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDHyAPDcMjawkp4_COTK_IThqNNQie0JoOrpcnDGWUsd2A1BfKhxO6ECFibL-0Udy6DzgZf2kCf49b7sZWlWsefxQa4tkSMDRtiZaWhIjxDFYEvZ4Zgm9FAiPMVs8AGkaAeoDYpAYdtOQU/s320/IMG_3508.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Job Done, Recycle the Bits!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
.. Christmas was already upon us. Oh well, Halloween 2016 here we come!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From the pics above, you can see that I originally thought I'd use a single sided PCB, with the pattern engraved in top layer. However when I milled it, I screwed the registration and had to start again - but I only had double sided FR4 left in stock.</div>
<div>
<br /></div>
<div>
It was then that it occurred to me that I could selectively remove some copper to let the LEDs shine through the eyes and mouth parts for effect. Nice. Note that my first prototype used standard 0603 LEDs as I was waiting on delivery of the Top Mount LEDs, and I wanted to get cracking on the code.</div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgES8QQlQlihKmK0TT0INBf_n9fjQ4OYguijG994Qtm6mjYh753BPf3OVjCOrd1qZ0119vCoYecwH9WDs5RKmKB3IHYvhXioh0wfpNpvbrVGWfEFdDHizX5spezuRyz_zZvWTD4K26KtlEo/s1600/IMG_0966.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgES8QQlQlihKmK0TT0INBf_n9fjQ4OYguijG994Qtm6mjYh753BPf3OVjCOrd1qZ0119vCoYecwH9WDs5RKmKB3IHYvhXioh0wfpNpvbrVGWfEFdDHizX5spezuRyz_zZvWTD4K26KtlEo/s320/IMG_0966.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With the arrival of the Top Mount LEDs, the above prototype was assembled *and* I finished building my <a href="http://ludzinc.blogspot.com.au/2015/08/a-simple-plan.html">Simple Current shunt amplifier</a> (for measuring low currents typical of a sleeping micro).</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Of course, there were mods to the prototype. In an effort to minimise part count, I used the internal pull up resistors of the PIC16F648A (hidden under the coin cell holder) to bias my 'mode' switch, which is active low. With my super hi-tech test setup ready,</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8omS-lpSiAffA1TjKLnzfUEYj2VNMoFuXSIfN4RjjF57Mc903MawR1dtMOe8BD-w0VCEE9nOfYxo0mJIxki5QLEEkMtNCmwdz5z50fA-ly-QKvwbMhHQ8yDZ60imwmeoZztp1BlwyZisr/s1600/IMG_3552.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8omS-lpSiAffA1TjKLnzfUEYj2VNMoFuXSIfN4RjjF57Mc903MawR1dtMOe8BD-w0VCEE9nOfYxo0mJIxki5QLEEkMtNCmwdz5z50fA-ly-QKvwbMhHQ8yDZ60imwmeoZztp1BlwyZisr/s320/IMG_3552.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: left;">
.. I soon saw that the operating current was around 2.5mA (when running a LED pattern), and a sleep current of 10uA. Wow, not bad I thought!<br />
<br /></div>
<div class="" style="clear: both; text-align: left;">
(I don't have a picture of the uA measurement - in that case the smaller meter, measuring milliamps in series above, was removed. The larger meter is measuring mV coming out of the current shunt amp - where in the mA case it's 1mV/mA and in the uA range it's 1mV/uA).<br />
<br /></div>
<div class="" style="clear: both; text-align: left;">
But when you look at the capacity of a typical <a href="https://cdn-shop.adafruit.com/datasheets/maxell_cr2032_datasheet.pdf">CR2032 cell</a> is around 200mAh, that's not great.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
200mAh / 10uA = 2000 hours = 83 days, or almost 3 months..... eep.<br />
<br /></div>
<div class="" style="clear: both; text-align: left;">
Looking at the PIC16F648A datasheet you can see that the weak pullups alone consume typically 200uA. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj17YuZNrtPq6zaTVmeQuR41KAmwBgQiySjeQzXP7bFSpxZUnzV7JaaSYCguG8lWJaO8d74rNUyWNZ8ACQMnYypjHeS7GClsgQKxqzNFxQr6ezcYPzTldh1Alc9kIbXgTU-a0xwGoK4Qya8/s1600/IMG_0956.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj17YuZNrtPq6zaTVmeQuR41KAmwBgQiySjeQzXP7bFSpxZUnzV7JaaSYCguG8lWJaO8d74rNUyWNZ8ACQMnYypjHeS7GClsgQKxqzNFxQr6ezcYPzTldh1Alc9kIbXgTU-a0xwGoK4Qya8/s320/IMG_0956.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It's hard to tell from the pic, but the mod made was to add a pull down resistor to my button and wire the normally open contact to VCC. Also, I had just about every peripheral in the micro enabled, so if I didn't need it, I turned it off in the code configuration. With those mods made, sleep current fell to 4uA. This gives a standby life of over 5 years! Woot, <a href="http://www.pinsdaddy.com/another-job-well-done-typical-bender-meme-generator_szfiySxlwlsAXZNsBXVKZAZDFaujTg4bcb7AgQU4n5w5zBxcKUTqD739U6h3l2VhYnXCAI0KpytIIf066FmDOQ/NPOxwaSR1pGF889e5PTSDPPhwsYv6%7C7e5ZOsTG7iAu9h9jkgZcLelvH0LlPued4cio5Ihek8s*TwSE8DLb2JYw/">Job Done!</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With the prototype sorted, I ordered some updated PCBs and cranked out a<a href="http://ludzinc.blogspot.com.au/2013/06/stencil-mania.html"> solder stencil </a>at work.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ikfEW1pFRi4pER31vq-8s5KyfXbIUPMxbUVH_I_d6IMgyyQ1oE88weR0UCCDFd6_rW8a7l9DgrmTdkuKX3xOl4uq94QUcEsfQJrHHivKtZIQLOwe2xkmijFsiD_jMLL0KXafk8FubDJz/s1600/IMG_2218.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ikfEW1pFRi4pER31vq-8s5KyfXbIUPMxbUVH_I_d6IMgyyQ1oE88weR0UCCDFd6_rW8a7l9DgrmTdkuKX3xOl4uq94QUcEsfQJrHHivKtZIQLOwe2xkmijFsiD_jMLL0KXafk8FubDJz/s320/IMG_2218.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Again, it was time to try some new stuff. I applied paste to a group of boards,</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhAVEG3yGwfFmWOVLKeaZagmfiGcBtGMc4m3Uik6ZrvVwvJGlGGjBkY__10IsfW-JQXK27SabHcZ8ONEPWuTdhtY2-kvsPK7PeDrwGU5bpwjRNhAyLgN1JXpi6DioRPmEWR0QY05oE-rO/s1600/IMG_2220.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhAVEG3yGwfFmWOVLKeaZagmfiGcBtGMc4m3Uik6ZrvVwvJGlGGjBkY__10IsfW-JQXK27SabHcZ8ONEPWuTdhtY2-kvsPK7PeDrwGU5bpwjRNhAyLgN1JXpi6DioRPmEWR0QY05oE-rO/s320/IMG_2220.JPG" width="240" /></a></div>
<br />
and placed the parts using a $20 eBay vacuum pencil<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3yrL2Yz-qhNfdB5NHdao4gJup_p470ma8-frHuwqqS4TQb-oJXc_D0ydPoT24yd9omMkjHNqp7FNHPm85sXFXI7dl6yx-GAgihGDME4074DIuA663lkdmopQBMIxPu9x-iHLFT4zIDK3S/s1600/IMG_2223.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3yrL2Yz-qhNfdB5NHdao4gJup_p470ma8-frHuwqqS4TQb-oJXc_D0ydPoT24yd9omMkjHNqp7FNHPm85sXFXI7dl6yx-GAgihGDME4074DIuA663lkdmopQBMIxPu9x-iHLFT4zIDK3S/s320/IMG_2223.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
Once the parts were placed, it was time to crank out the hot air soldering gun.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/YhLXnYQ38Gs/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/YhLXnYQ38Gs?feature=player_embedded" width="320"></iframe><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The hot air was proving a little too slow, so I stepped up to using an electric frypan. Worked a hell of a lot quicker, but I didn't video that!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6d_ceCyRnLPhF6Ye6dYpg5tyic0FCuK0QRSm92uFJE1G1A9aZp2X2XXGN6tmFOAwnBpngVYg7gfOSc3BGSIypY_qxiAOmw_eFoT0-sVoXWjGBh8y4RjJI3v6mWbYgUUajXWVd8xLsJYtn/s1600/IMG_2243.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6d_ceCyRnLPhF6Ye6dYpg5tyic0FCuK0QRSm92uFJE1G1A9aZp2X2XXGN6tmFOAwnBpngVYg7gfOSc3BGSIypY_qxiAOmw_eFoT0-sVoXWjGBh8y4RjJI3v6mWbYgUUajXWVd8xLsJYtn/s320/IMG_2243.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Soon after, I had 13 pumpkins ready to roll. The kids can wear them as a badge by simply placing a magnet behind the coin cell with their shirt between them.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqHdoyyw0S75CecjQ40bXU7QNYoUXlLEqHGOIJvjJ_mS4RMPZ6X3MGTyEukJWbAY_LtGicfOlPvCkFIGcs6K7fV4nnftX4Qgdh69srTAKr3H8G5fGcK-SROTT_C7Q-4Sz_ndFNSf-dFXEB/s1600/IMG_2244.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqHdoyyw0S75CecjQ40bXU7QNYoUXlLEqHGOIJvjJ_mS4RMPZ6X3MGTyEukJWbAY_LtGicfOlPvCkFIGcs6K7fV4nnftX4Qgdh69srTAKr3H8G5fGcK-SROTT_C7Q-4Sz_ndFNSf-dFXEB/s320/IMG_2244.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Box 'o Pumpkins ready to go!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwaYDxgzDvJYScmzGWyIQyvmLzVigo0ofxN40J6vavm8ZINRPhdeJI-ZCuQtR_Zc_4wmqFd0PdCn65SATyFJagmmZK8-ahbNX2ru-ipaPNjnAGPv9e4hFcDtWCwVFodcA3wXOYkA3KIAZ-/s1600/IMG_3502.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwaYDxgzDvJYScmzGWyIQyvmLzVigo0ofxN40J6vavm8ZINRPhdeJI-ZCuQtR_Zc_4wmqFd0PdCn65SATyFJagmmZK8-ahbNX2ru-ipaPNjnAGPv9e4hFcDtWCwVFodcA3wXOYkA3KIAZ-/s320/IMG_3502.JPG" width="320" /></a> <iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/LnRcntHTusw/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/LnRcntHTusw?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Finished Items.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once the kids saw the pumpkins, they wanted other trinkets - Christmas Trees and Valentines Hearts. So they got punched out too!</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYDLr4s3NNQki7mXeBLEb34XWCuqEIk442_xJR38CM0wWV2Vftwdj-aNTBXNZmL7UVserXsI2RodaTIxgHwAxXsDt7TGDnSmAvUplAdnEjDe5dCfCl7scGSd5-i5zSUcU0es85nnzz3hP/s1600/IMG_3511.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYDLr4s3NNQki7mXeBLEb34XWCuqEIk442_xJR38CM0wWV2Vftwdj-aNTBXNZmL7UVserXsI2RodaTIxgHwAxXsDt7TGDnSmAvUplAdnEjDe5dCfCl7scGSd5-i5zSUcU0es85nnzz3hP/s320/IMG_3511.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/FZGXyBUCfYU/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/FZGXyBUCfYU?feature=player_embedded" width="320"></iframe><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpkM-6CDdrrXbKUojf0LwxgmTbh2wWE46Ia1nm-OaP1oiv-5Ygf5PCtG66AliWmSLwr99OKF2XXaoSfkUoIxuOiBudjXtQuOt3jRr3clfTgjJudukDGrDuf5vHK2tXZ1ZkaeZRmujHOKjG/s1600/IMG_3514.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpkM-6CDdrrXbKUojf0LwxgmTbh2wWE46Ia1nm-OaP1oiv-5Ygf5PCtG66AliWmSLwr99OKF2XXaoSfkUoIxuOiBudjXtQuOt3jRr3clfTgjJudukDGrDuf5vHK2tXZ1ZkaeZRmujHOKjG/s320/IMG_3514.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/BTHzxjmADgQ/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/BTHzxjmADgQ?feature=player_embedded" width="320"></iframe><br />
<br />
So, I'm all ready for the next Halloween, Christmas and Valentines. Finally!<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVA4t1uvKSFKYNBSYxnoNvVFqM4chVkHbFhpjYsDcHiUf4f7BHmSqapKD9-Kcaypeb1hDywEZk77HlkFIyxcdTOkqF6zgv5RSN9hGiFG8iYrArKrQlQw9pNbGoJApkXb3KPpQggmy1y4E/s1600/IMG_3517.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVA4t1uvKSFKYNBSYxnoNvVFqM4chVkHbFhpjYsDcHiUf4f7BHmSqapKD9-Kcaypeb1hDywEZk77HlkFIyxcdTOkqF6zgv5RSN9hGiFG8iYrArKrQlQw9pNbGoJApkXb3KPpQggmy1y4E/s320/IMG_3517.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
As usual, happy to share!<br />
<br />
<a href="https://workspace.circuitmaker.com/Projects#/digital%20pumpkin/7//1">PCB </a><br />
<br />
<a href="https://github.com/ludzinc/Low-Cost-Labs/tree/master/LED-Trinkets/Code">Firmware</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-37391863922924946882016-08-04T20:34:00.001-07:002016-08-04T20:47:00.131-07:00Hacking my Hakko<h2>
Hakko 936 LED Mod</h2>
So I've come home once again, to find, yet again, that after tinkering with some new toys I've left my soldering iron on ALL DAY yet again...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiPB_HSj24wWPD6k621retoV-qo9eoXH7a1DovrHyvDjfKrBlV_w9EjsxZiAGbDRs_dnKWpv6_-BXiSKMzd_nhmGw1MJWgdJkQ0O_h7Go6U4ShOVpYr96vssO6-4SmsVO3gj_ebs9VpB_s/s1600/IMG_0966.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiPB_HSj24wWPD6k621retoV-qo9eoXH7a1DovrHyvDjfKrBlV_w9EjsxZiAGbDRs_dnKWpv6_-BXiSKMzd_nhmGw1MJWgdJkQ0O_h7Go6U4ShOVpYr96vssO6-4SmsVO3gj_ebs9VpB_s/s320/IMG_0966.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And this time I'm taking care of business! (I'll talk about the toys later).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a>Shown above is my trusty HAKKO 936 soldering iron station. I was lucky enough to snag this from the bin many years ago - the handle was broken and work had upgraded to a bunch of Metcals, so I took it home. <br />
<div>
<br /></div>
<div>
For many years I lived with dodgy epoxy fix on the handle, and finally swapped it out with a cheapie from eBay. All the HAKKO bits (tip, barrel, heating element) got transfered to the plastic handle and all was good in the world.</div>
<div>
<br /></div>
<div>
Except for the heater LED. Like all Hakko's the LED only illuminates when heating. With a quick glance you can't tell if your station is on or not.</div>
<div>
<br /></div>
<div>
So, I did the first rational thing - I googled it. <a href="https://danielelectronics.com/2016/01/12/hakko-936-led-modification/">Daniel</a> had the same issue and his mod was quick and easy. I like quick and easy so I went down that route. With a twist, but I'll get to that in a bit.</div>
<div>
<br /></div>
<div>
First thing first, it was time to crack this puppy open. <br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8XQ-NWM0q0rErGcyr_MWd09O8EyxMfbZFB12LhFqrBcRIx5JBay5dk7S6TmGICUfoeJXinc7dXeuYH2qxD3Xuba-evmNFCb_yljHTvsSEYkXBbpx9nW1uHZkWOhFyYsXKotJUPQey9ncb/s1600/IMG_0967.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8XQ-NWM0q0rErGcyr_MWd09O8EyxMfbZFB12LhFqrBcRIx5JBay5dk7S6TmGICUfoeJXinc7dXeuYH2qxD3Xuba-evmNFCb_yljHTvsSEYkXBbpx9nW1uHZkWOhFyYsXKotJUPQey9ncb/s320/IMG_0967.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Score! This is a genuine Hakko and not a clone.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA34unddhD4hirCfIBEi-P7ob4Ro_oQ4gN2BFqA3iNGOhN0Z-4gdG6WSEwbijQMbXJRlr_PCNcmVkr3Lbob1-Ns2b5_e1Sg07k1VWZI76LpnMZa6ZCaS03P6Z-p3z1XVx6kzN3amvAQhga/s1600/IMG_0968.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA34unddhD4hirCfIBEi-P7ob4Ro_oQ4gN2BFqA3iNGOhN0Z-4gdG6WSEwbijQMbXJRlr_PCNcmVkr3Lbob1-Ns2b5_e1Sg07k1VWZI76LpnMZa6ZCaS03P6Z-p3z1XVx6kzN3amvAQhga/s320/IMG_0968.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Note the barrels for the high power connections to the soldering iron plug. Quality plus, and a real pain in the ass to desolder. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzzRcmYLsCH4279jqPQctpbjmg-18XIJKYWkjLqJHmXK4UhAWeJjAdEL0WE2lFtybi97J4QfkCOQy1-xPTA8CYj1AFgLEntzUNiL39le8A8jCkp4CPv7gmLvYgyvJmQs5awIGif91u6D_p/s1600/IMG_0969.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzzRcmYLsCH4279jqPQctpbjmg-18XIJKYWkjLqJHmXK4UhAWeJjAdEL0WE2lFtybi97J4QfkCOQy1-xPTA8CYj1AFgLEntzUNiL39le8A8jCkp4CPv7gmLvYgyvJmQs5awIGif91u6D_p/s320/IMG_0969.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But I got there in the end.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP2epET7x7qKj8q4D_1mVZKa-Q2PA7Q1v9pT8lRRfgZiyOInmnvb8izoDYlpNKInm_xK3ELDFzj1QdrapWdbovhpVQnsNFgFyjx7SmCRU_8B6cW0_17R_dfH80y2zY7mmK47LegHTCnzoe/s1600/IMG_0970.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP2epET7x7qKj8q4D_1mVZKa-Q2PA7Q1v9pT8lRRfgZiyOInmnvb8izoDYlpNKInm_xK3ELDFzj1QdrapWdbovhpVQnsNFgFyjx7SmCRU_8B6cW0_17R_dfH80y2zY7mmK47LegHTCnzoe/s320/IMG_0970.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I too had some 5mm RGB leds lying around ... </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuhj6aa2s0V5PZwXZt6x7cVsNaVdy1V2R4_Mo4JP52imRWwv_Q_5pc2shRKZRPgGKRiOPTmqipiAwTCgKCFN8Q4QbK7fJPCKHDzIir9vu4UpIKsm7LRMUjVIf1oM_2fJ3pSqIYICa8IsK/s1600/IMG_0971.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuhj6aa2s0V5PZwXZt6x7cVsNaVdy1V2R4_Mo4JP52imRWwv_Q_5pc2shRKZRPgGKRiOPTmqipiAwTCgKCFN8Q4QbK7fJPCKHDzIir9vu4UpIKsm7LRMUjVIf1oM_2fJ3pSqIYICa8IsK/s320/IMG_0971.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
.. and I also turned it into a RG LED. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1pmAlq_6pV8zXkKn0sOUIiIHYtMkZCF9nHePdSV7t7KcsOXdc1h3ywL44VawdxnqKYwiQD_JD2hWEya_4dGhGrz4xj9q-4oOGponzUM09RirhaRo23BQUMJsX1HJbf_W3HCuPEPj6rBl/s1600/IMG_0973.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1pmAlq_6pV8zXkKn0sOUIiIHYtMkZCF9nHePdSV7t7KcsOXdc1h3ywL44VawdxnqKYwiQD_JD2hWEya_4dGhGrz4xj9q-4oOGponzUM09RirhaRo23BQUMJsX1HJbf_W3HCuPEPj6rBl/s320/IMG_0973.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9yl0k_o392IgRks-w-2g0FfR2aoTo7-uIM1YgcsETLio4vhs8zgfJnMPIymXf2YjiHkMDtwcmKR3FWPlM1sYCaN_8sco6lAJabPY0Lgm_5PLHN1hZdFtdm-Ln3uI4Jk57O07bYpHMTzcf/s1600/IMG_0974.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9yl0k_o392IgRks-w-2g0FfR2aoTo7-uIM1YgcsETLio4vhs8zgfJnMPIymXf2YjiHkMDtwcmKR3FWPlM1sYCaN_8sco6lAJabPY0Lgm_5PLHN1hZdFtdm-Ln3uI4Jk57O07bYpHMTzcf/s320/IMG_0974.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I took a notch out of the stand-off so I could pass the Green LED Cathode out the side while installing the Red LED Cathode and the Common Annode in the position that the RED led used to occupy. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_yu-hB1-jPzAsc7NiH8K10CncVfIDtpW71fU16R5d9kBBMRAKXEP16dcl_NanDSVFTFKp4tGLD8EDBSRDHF-BPAxbLKoYep8-HG0r9lObXc_v82ZPzRzGRNuikmb8vkVYQt-cOnkCAA4h/s1600/IMG_0977.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_yu-hB1-jPzAsc7NiH8K10CncVfIDtpW71fU16R5d9kBBMRAKXEP16dcl_NanDSVFTFKp4tGLD8EDBSRDHF-BPAxbLKoYep8-HG0r9lObXc_v82ZPzRzGRNuikmb8vkVYQt-cOnkCAA4h/s320/IMG_0977.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Referring to the <a href="https://danielelectronicsdotcom.files.wordpress.com/2016/01/hakko_936_schematic.pdf">schematic </a>you can see that I also removed R2 and put the green Cathode through one of it's vacant holes.</div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNf3lZMgQ-0V5y7P35Kv5IO6imVLrm1peyKt1lOLk_wyAGuC3pcmNcn0tAYWryh-Ji3stXkwh1xlDHD9CDFOtsm7M7J9QWrzwmVOnx3kUZ3jqyu4LTtVIPGmHIgaE-a5YmIHWZ7OW6maMp/s1600/IMG_0978.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNf3lZMgQ-0V5y7P35Kv5IO6imVLrm1peyKt1lOLk_wyAGuC3pcmNcn0tAYWryh-Ji3stXkwh1xlDHD9CDFOtsm7M7J9QWrzwmVOnx3kUZ3jqyu4LTtVIPGmHIgaE-a5YmIHWZ7OW6maMp/s320/IMG_0978.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then took to the board with my trusty <a href="https://www.google.com.au/search?q=stanley+knife&oq=stanley+knife&aqs=chrome..69i57j69i60j69i65l3j69i60.2792j0j7&sourceid=chrome&ie=UTF-8">Stanely</a> knife and isolated all the pads. Why?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Remember I said 'Common Anode' above. Daniel's mod used a common CATHODE so I could not do what he did. I also like my hack better and this is why:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
With the 24V AC supply feeding the RGB led through a single dropping resistor, and by only switching on / off the Red LED, I can exploit the differences in forward voltage of the Red and Green LEDs to get a Green on / Red Heating display, rather than the Yellow on / Red Heating that Daniel achieved.<br />
<br />
How?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmzHz5N8hc2hzrF4D2LKm-gU2-JwUBL36zeGrZFZttIjdYIwhrolhS__42ucTmzZSI8BpGJdUTLva0vJJ35vJPkmnySxiHMh0I3R-9YKDLbIa3wc8nTypK7LX2bGlku1XQIuKvY1zi1IPh/s1600/leds.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmzHz5N8hc2hzrF4D2LKm-gU2-JwUBL36zeGrZFZttIjdYIwhrolhS__42ucTmzZSI8BpGJdUTLva0vJJ35vJPkmnySxiHMh0I3R-9YKDLbIa3wc8nTypK7LX2bGlku1XQIuKvY1zi1IPh/s320/leds.png" width="303" /></a></div>
<br />
<br />
With the Red Led off (switching controlled by IC1) the Green LED (being hard wired across the 24V AC supply) will light (at 50% duty as it's AC).<br />
<br />
The forward voltage of a Green LED is about 2 and a bit volts.<br />
<br />
When the Red LED is turned on (it's anode pulled low by IC1) it will conduct. As it's forward voltage is around 1.8 Volts, which is more importantly LESS that that of the Green LED, there's no longer enough voltage across the Green LED to light it and only the Red LED is illuminated.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXP2a31seH8q8lgoyen3_NxTKouHUDNGAFnCOKiN2p5bbPus9yzFS07Rc2Y5EhInrZnA-KIqh7yoQFEVlFjz7worlzOr519AONoHM0SsL2ZyH9DleFPFwtrSHBQkyEzC2enJ7DpjzTx16g/s1600/IMG_0981.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXP2a31seH8q8lgoyen3_NxTKouHUDNGAFnCOKiN2p5bbPus9yzFS07Rc2Y5EhInrZnA-KIqh7yoQFEVlFjz7worlzOr519AONoHM0SsL2ZyH9DleFPFwtrSHBQkyEzC2enJ7DpjzTx16g/s320/IMG_0981.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Wired up.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Modern day LEDs are much brighter than older counterparts and I knew that the 1k2 orignally used by Hakko for the Red LED would lead to a very annoying LED brightness. So I simply added another 1k in series. It's hard to see in the pic above, but the LED Common Anode is now connected to 24V AC through the resistor string, the Red LED Cathode is connected to Pin 2 on IC1 and the Green LED Cathode is connected to the other side of the 24V AC supply.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="344" src="https://www.youtube.com/embed/RIgjOc_clZ4" width="459"></iframe><br />
<br />
<div style="text-align: left;">
I just happened to have a random EEVBlog clip playing on youtube when I tested this, and Dave's timing was spot on. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So overall, success - at a glance I can see if my Hakko is on or not. Win.</div>
<br /></div>
<br />
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com2tag:blogger.com,1999:blog-2685787041614376103.post-92134600902155697272016-06-11T07:30:00.000-07:002016-06-11T07:45:33.138-07:00ESP8266-01 Programming Jig<h2>
Getting Jiggy With it</h2>
<div>
So, about three years ago(!) I rigged up a controller for my roller doors, and my daughter mentioned that it would be cool if I could open them using my phone. </div>
<div>
<br /></div>
<div>
My initial thoughts were to use a Bluetooth to serial adaptor and just use a keyboard app to send an open command.</div>
<div>
<br /></div>
<div>
And after getting delivery from eBay of a great <a href="http://www.ebay.com.au/sch/i.html?_sacat=0&_from=R40&_nkw=Serial+4+Pin+Bluetooth+RF+Transceiver+Module+with+Backplane+RS232+Wireless+New&_sop=2">HC06</a> module, I realised I was screwed by Apple. </div>
<div>
<br /></div>
<div>
No my iPhone 4 wouldn't connect to the HC06 and I wasn't going to upgrade my phone to take advantage of Bluetooth Low Energy either.</div>
<div>
<br /></div>
<div>
So I went searching for a solution that would work, not just on my phone, but on any mobile device. This is part of the story as to how I got there....</div>
<div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0d9_sY2Vi53qelzS0vK7OkFnJN_z6PwPpB0zCdWP6EoNR-jJWIhZT5kBdiwujmHG6CrpMO91YuseNBeuhxrcshJQ2e8f_1sThNA3iXoPGnxaRaBBZKjRoFnVPur9XREyJ9kRrHdfQgyW0/s1600/IMG_0701+%25281%2529.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0d9_sY2Vi53qelzS0vK7OkFnJN_z6PwPpB0zCdWP6EoNR-jJWIhZT5kBdiwujmHG6CrpMO91YuseNBeuhxrcshJQ2e8f_1sThNA3iXoPGnxaRaBBZKjRoFnVPur9XREyJ9kRrHdfQgyW0/s320/IMG_0701+%25281%2529.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
This will not do at all...</div>
<h2>
<a name='more'></a>Enter the ESP8266</h2>
<div>
At around the same time the *awesome* <a href="http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family#esp-01">ESP8266-01</a> module became available. As it supports a full Built-in TCP / IP protocol stack, it's a 3V3 powered web server with IO that can be used to open my door from any thing with a web browser.</div>
<div>
<br /></div>
<div>
Except I had no clue how to programme it!</div>
<div>
<br /></div>
<div>
Thankfully there is a ton of information on the web for getting an ESP8266 running, but I found <a href="http://randomnerdtutorials.com/esp8266-web-server/">Rui Santos</a>' tutorial to be an excellent starting point.</div>
<div>
<br /></div>
<div>
Anyway, a long story short I managed to get my prorotype up and running using breadboards and after managing to destroy three ESP8266 modules do to stupid wiring errors, I finally got around to building a robust Programming Jig. </div>
<div>
<br /></div>
<div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM0ecoapxnQapkNVQBjhYTuUwsYdX7VbBhxApdnCQ1FakuU_6BhGuHmYg8QBQkIaWV1_JHUaXlIL7PPnPsgd_enVhZ8Dar9HRdSe6MZXAERY8ykxYMdQI5-MJr8DB140TSfJRqWaWi1mWs/s1600/JIG+01.jpg" imageanchor="1" style="display: inline !important; margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM0ecoapxnQapkNVQBjhYTuUwsYdX7VbBhxApdnCQ1FakuU_6BhGuHmYg8QBQkIaWV1_JHUaXlIL7PPnPsgd_enVhZ8Dar9HRdSe6MZXAERY8ykxYMdQI5-MJr8DB140TSfJRqWaWi1mWs/s320/JIG+01.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
And here it is!</div>
<h2 style="clear: both; text-align: left;">
Circuit Making</h2>
<div>
In the past I've used Altium for my projects, and this makes sharing projects difficult. Altium now have a free (cloud based, nothing's perfect!) product called <a href="http://circuitmaker.com/">Circuit Maker</a> and you can find my Jig design <a href="http://circuitmaker.com/Projects/Details/Simon-Ludborzs/ESP8266-01-Programming-Jig">here</a>.</div>
<div>
<br /></div>
<div>
As I was going to mill this board at work, I stuck to a single layer design, and bitter experience has taught me that soldering wire links on these is a royal pain in the ass, so I was quite happy to punch this out without any.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHe_TC0e9R0LdkSyJpbEINsd2MMuRvj6GlPeMnwq6PRTq9P2oEAl0FpeKxpoEtEsmOloVUqTX6TKM4DpC8Ghitn2HZwxo7tCde0f07pATxqO_L84Sx0EofMNw4vKYCDo0LwQv06ZUox3pe/s1600/screen+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHe_TC0e9R0LdkSyJpbEINsd2MMuRvj6GlPeMnwq6PRTq9P2oEAl0FpeKxpoEtEsmOloVUqTX6TKM4DpC8Ghitn2HZwxo7tCde0f07pATxqO_L84Sx0EofMNw4vKYCDo0LwQv06ZUox3pe/s320/screen+00.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Look! No Links!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Actually, the above is a little lie - that's not the board I milled. I added some links on the GPIO lines after milling, and I don't have a screen shot of 'before'. but still, no links!</div>
<h2 style="clear: both; text-align: left;">
Toner Transfer Fail</h2>
<div>
I decided to try something new here (as I do with most home projects) and as I've never tried toner transfer before I thought I'd give it a whirl by trying to add my top layer silk to my milled boards.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSVYrxnfz_U89ph1rb5R9WnVLY4CIhxs7pZlczt9FbC1nRz9ewDpjqDPjyP6tnJ5B5IiAnRb1NKRQRDde38DqH8D8Pn021dUTpgYWJpSe1vRZwePlftU1vhxwZtG6id91fErsSRtKQqXXJ/s1600/IMG_0721.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSVYrxnfz_U89ph1rb5R9WnVLY4CIhxs7pZlczt9FbC1nRz9ewDpjqDPjyP6tnJ5B5IiAnRb1NKRQRDde38DqH8D8Pn021dUTpgYWJpSe1vRZwePlftU1vhxwZtG6id91fErsSRtKQqXXJ/s320/IMG_0721.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Looking promising...</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiutMXWYO9RfJXo94lu2WaDEjjxmjHbDrt1kysdpdzuuV5bqFnvl3goIlb2AJbjqiPkv2tNr0Srou0Td9jiyH60lMIdjFiwy2eti6GMgzrUCTpi7l7kPSVB20IVYuTut4zsZ-oVw6FpSIv7/s1600/IMG_0723.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiutMXWYO9RfJXo94lu2WaDEjjxmjHbDrt1kysdpdzuuV5bqFnvl3goIlb2AJbjqiPkv2tNr0Srou0Td9jiyH60lMIdjFiwy2eti6GMgzrUCTpi7l7kPSVB20IVYuTut4zsZ-oVw6FpSIv7/s320/IMG_0723.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div style="text-align: center;">
You can say it didn't work well at all...</div>
<div>
<br /></div>
<div>
There's a lot of reasons why this didn't work, the most likely being that my printer doesn't print heavily, not leaving a lot of toner to transfer. Might try different settings later, but might not too...</div>
<div>
<br /></div>
<div>
But still- my single layer design is out there if you want to roll your own board at home. Enjoy!</div>
<h2>
Keeping it Simple</h2>
<div>
The Programming Jig isn't the most complicated widget inn the world. What it needs to do is pretty simple</div>
<div>
<ul>
<li>Provide a TTL Serial to USB translation</li>
<li>Provide a 3V3 Rail</li>
<li>Provide the ability to hold GPIO_0 held low during reset (to enter programming mode)</li>
</ul>
<div>
What I also added was</div>
</div>
<div>
<ul>
<li>LEDs connected to GPIO_0 and GPIO_2 to help development</li>
</ul>
<h3>
COMS</h3>
</div>
<div>
To manage the USB-TTL translation, I planned on using a PL2303 module from <a href="http://www.ebay.com.au/sch/i.html?_from=R40&_sacat=0&_nkw=pl2303&_sop=15">eBay</a>, and at under a buck-fifty, I can't get the parts for that. A 5 way header on the board made for an easy connection.</div>
<h3>
POWER</h3>
<div>
Although the PL2303 module has a 3V3 output on it's pins, it's not powerful enough to run the ESP8266. Some people have reported differently, but at a buck a peice, these <a href="http://www.ebay.com.au/sch/i.html?_odkw=lm2596+module&_sop=15&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xlm2596+buck+module.TRS0&_nkw=lm2596+buck+module&_sacat=0">LM2596 modules</a> are what I use as 'order fillers' and it was a no brainer for me to use one (and add the external power input connector). </div>
<h3>
Keeping Up My Reputation</h3>
<div>
In my rush to get a working jig, I made a noob mistake. I hooked up the ESP8266 Tx line to my USB modules Tx line and also the same with Rx / Rx. If hooking up a module with flying leads it's no big deal, but I wanted to solder my module in place. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQo2lKWCOmpS4qGfAQXKBIWIzTMjCIkkNK2KKy_3Fzd3ClJdUb3FBLwh8C8udtHYqzmoJ6jR9biBaTYm3XTYeHxNLLLSvkPXvGZKc-X3ezCm_j_W9YbVLP-jMxavB0Rgke4XxqIA7BfH71/s1600/unnamed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQo2lKWCOmpS4qGfAQXKBIWIzTMjCIkkNK2KKy_3Fzd3ClJdUb3FBLwh8C8udtHYqzmoJ6jR9biBaTYm3XTYeHxNLLLSvkPXvGZKc-X3ezCm_j_W9YbVLP-jMxavB0Rgke4XxqIA7BfH71/s320/unnamed.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The pic above shows assembled, untested boards, and then I went to test I noticed that Tx LED on the USB module blinked when the ESP8266 was powered up. Yep the data the ESP spits out at boot was hitting the USB modules Tx line and that isn't going to work. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
So a little PCB track surgery and some wire links later, I was in business. </div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR5DjfBWAv6_UazpdnDBRu69C295z5PoMcg0tCs9iNbsWFMDxK7jhUSi87NPY2IxB4_NlWs8AT-QxUWlESUK7BMaxdhFmlqh_AOyF1xQTkPNth8JIyQ70Zys236LLnG7hMPj7YF7RTdMO4/s1600/links.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR5DjfBWAv6_UazpdnDBRu69C295z5PoMcg0tCs9iNbsWFMDxK7jhUSi87NPY2IxB4_NlWs8AT-QxUWlESUK7BMaxdhFmlqh_AOyF1xQTkPNth8JIyQ70Zys236LLnG7hMPj7YF7RTdMO4/s320/links.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also soldered the mounting nuts into place. That will let me take the screws off and have non-scratch low cost robust mounting feet. Woot.</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Getting the Job Done</h2>
<div>
My next step was to update my board to fix the Tx / Rx SNAFU, and while at it I added some headers so you can disconnect the LEDs from the GPIO lines, giving you a board that's useful for both programming and lets you break out the IO for prototyping. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2HEhdaeIjwl7aKmlAwk7xeLataT9bzOW_y214K35TjcUf-b3CXHOkKaKFOLzuPe2exMB0DJrjpADkhEsewgqIC3zhkxaDf4Hofsa5Mi8JGsUTmuG2EW1kciamx-vBjgmi3TC72n38xcU4/s1600/screen+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2HEhdaeIjwl7aKmlAwk7xeLataT9bzOW_y214K35TjcUf-b3CXHOkKaKFOLzuPe2exMB0DJrjpADkhEsewgqIC3zhkxaDf4Hofsa5Mi8JGsUTmuG2EW1kciamx-vBjgmi3TC72n38xcU4/s320/screen+01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The Simple Schematic</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEdTsu-TGouXuqcRMOiKurkPJSz2-Nj-K2t-sWA4c5csxJyBvrfW8lfXTbNNBFBykn6VAaRb5nzWLQUDSf4SIjc3lbCHfOiU5Y-14Y-u4i4bFZ_7h6PpTxjKZjbbclPjgeOn6Wijjy3JeT/s1600/screen+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEdTsu-TGouXuqcRMOiKurkPJSz2-Nj-K2t-sWA4c5csxJyBvrfW8lfXTbNNBFBykn6VAaRb5nzWLQUDSf4SIjc3lbCHfOiU5Y-14Y-u4i4bFZ_7h6PpTxjKZjbbclPjgeOn6Wijjy3JeT/s320/screen+03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also forked the design into a double sided design, with a pluggable header for the PL2303 module so you don't have to muck about removing the modules header so you can solder it into place. I'll get some boards in my next PCB order so hit me up if interested.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Serial Fixing</h3>
<div>
One trick I learnt a long time ago, and failed to use in this build, is to use a pair of jumpers in-line with your Tx and Rx lines.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRR_-6WauMkJboT2bCXE0a83IKaQLK6G1c-R5Wvf0wEjbK4Cs2bBQk5FED1wZsw_9le96D0BngrVgOYmZzTJPTYG3QAyvA2N5VsEiSVwfP4p-km_9-ET2aWyn_xICxQpBMc-I9ab4JiT51/s1600/rxtx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="309" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRR_-6WauMkJboT2bCXE0a83IKaQLK6G1c-R5Wvf0wEjbK4Cs2bBQk5FED1wZsw_9le96D0BngrVgOYmZzTJPTYG3QAyvA2N5VsEiSVwfP4p-km_9-ET2aWyn_xICxQpBMc-I9ab4JiT51/s320/rxtx.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When routed as shown above, you can either install the links horizontally to let the signals "flow through" as expected, or to install them vertically swapping the end points. Much easier than cutting tracks when you get your Tx and Rx mixed up!</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8-HFIuDfhq6QL-tptIQI4mKkKaIV4425lC2Qb7f6XjX_S6OXNhZQyJES4ZA_5Zj-qUJJHT9sOUA4wAurMUJSlZv4XCjZm9a-fUD9AlDaZNvfP0E4o903wqexYHoPZecv2zXQYU-CAbhmQ/s1600/JIG+02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8-HFIuDfhq6QL-tptIQI4mKkKaIV4425lC2Qb7f6XjX_S6OXNhZQyJES4ZA_5Zj-qUJJHT9sOUA4wAurMUJSlZv4XCjZm9a-fUD9AlDaZNvfP0E4o903wqexYHoPZecv2zXQYU-CAbhmQ/s320/JIG+02.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At the end of the day, I got my jig working and I was able to finish my next-generation garage door opener. But more about that later.</div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-56598492789686796672015-11-26T02:42:00.001-08:002015-11-26T02:42:43.819-08:00Sharing the Love<h2>
Share Alike</h2>
<div>
Today I was asked if I could share my <a href="http://ludzinc.blogspot.com.au/2015/01/soldering-station-conversion.html">soldering iron hack</a> PCB.</div>
<div>
<br /></div>
<div>
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYmYs9vawloFURaUiNnAbi-0y600AkKZNTSdUmFYWS5KW8m5MXbc8ozYrEUFj3OxGujlLMs7Vef-mMejhOg5JaMNqdWevmcMPPIj0TH_ykFcY1v3rdD-T3eE4bMQhjXu-mUXP00LRtlL8H/s1600/hakko+hack.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYmYs9vawloFURaUiNnAbi-0y600AkKZNTSdUmFYWS5KW8m5MXbc8ozYrEUFj3OxGujlLMs7Vef-mMejhOg5JaMNqdWevmcMPPIj0TH_ykFcY1v3rdD-T3eE4bMQhjXu-mUXP00LRtlL8H/s320/hakko+hack.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So I did!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><h2>
Enter Circuit Maker</h2>
<div>
Originally I spun my design in Altium, which isn't open source or easy to share.</div>
<div>
<br /></div>
<div>
However, Altium now have a free, community based programme called <a href="http://www.circuitmaker.com/">Circuit Maker</a>.</div>
<div>
<br /></div>
<div>
It took about an hour to port this design to Circuit Maker, and if you want it, install Circuit Maker and go nuts. <a href="https://workspace.circuitmaker.com/Projects/Details/B7E3ABD9-5271-4541-98C6-A7A82B461577">Link</a>.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsxz-x2tvpPxoeHZymMS0aOpenKT-G1A_FK6qHabQH-IzGea-fsVkUDhEjPckY_BLfh-D4Rj6JGiOhRUgfubD8eP2_-vm__-R78pzxKchwC9H86i9qauPOCGHLe6N72T004hn9uXe_z22/s1600/hakko+hack+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsxz-x2tvpPxoeHZymMS0aOpenKT-G1A_FK6qHabQH-IzGea-fsVkUDhEjPckY_BLfh-D4Rj6JGiOhRUgfubD8eP2_-vm__-R78pzxKchwC9H86i9qauPOCGHLe6N72T004hn9uXe_z22/s320/hakko+hack+1.png" width="320" /></a></div>
<div>
<br /></div>
</div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-27469423418531012532015-08-25T06:43:00.001-07:002015-08-25T06:43:06.769-07:00A Simple Plan<h2>
Exploring New Stuff</h2>
<h3>
A Simple Current Shunt Amplifier</h3>
<h2>
<div class="separator" style="clear: both; font-size: medium; font-weight: normal; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4e9WNAc-qWT47hr3-TgKO-1J14txQuJQmQxR5eIlOc06M4Ft0L1S2QRYfjyHPPE7_euroqKRs0aGLEGg7Y2AgdJHfxDm0h0pFEGHU-Qol7xzsUHcOqdHH0k-5JMOEuSPwzH6-H4-E3gIn/s1600/sc+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4e9WNAc-qWT47hr3-TgKO-1J14txQuJQmQxR5eIlOc06M4Ft0L1S2QRYfjyHPPE7_euroqKRs0aGLEGg7Y2AgdJHfxDm0h0pFEGHU-Qol7xzsUHcOqdHH0k-5JMOEuSPwzH6-H4-E3gIn/s320/sc+01.png" width="320" /></a></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
A while ago, I took advantage of a free PCB offer to <a href="http://ludzinc.blogspot.com.au/2014/03/getting-one-up-on-kids.html">knock up a quick project</a>, which is still 90% finished. Or more correctly, not finished.</div>
<a name='more'></a><div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
This was a chance to do some things I'd not done before, including running off a coin cell and using methods such as sleeping the micro to to save battery life. In face the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/40044G.pdf">datasheet</a> states that the micro in sleep mode can reduce current draw to 100nA. WOW!</div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div class="separator" style="clear: both; font-size: medium; font-weight: normal; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufUHrIAeCrqEdil8Vz4c9uDWhIdjQYSM8pS6Tgj4sKCfluLAUU16vBoTFlGAZDw8Qh34icJIwLK5hkngl0c8S7OHcaYey3BJ2EPknn_NuVi9l8SMtFIygj1l3pgMIJgvYGA3FrThKcYw9/s1600/sc+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufUHrIAeCrqEdil8Vz4c9uDWhIdjQYSM8pS6Tgj4sKCfluLAUU16vBoTFlGAZDw8Qh34icJIwLK5hkngl0c8S7OHcaYey3BJ2EPknn_NuVi9l8SMtFIygj1l3pgMIJgvYGA3FrThKcYw9/s320/sc+00.png" width="320" /></a></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
Of course, my basic multimeter will not come close to being useful for measuring current this low. But really, how low do I need to measure? A typical <a href="http://au.mouser.com/Search/Refine.aspx?Keyword=cr2032">CR2032 coin cell</a> has around 200mAh of capacity, and at 1uA that's 200,000 hours, or 22 years. So realistically speaking if I could confirm a current draw in the order of uA, I'd be happy. Of course that's 22 years of *sleeping* - actualy use will reduce battery life significantly!</div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
</h2>
<h3>
Off The Shelf</h3>
<h2>
<div style="font-size: medium; font-weight: normal;">
So the first option is to look at what's out there that will let me take a measurement of such low magnitude. The first option is the excellent <a href="http://www.eevblog.com/">EEVBlog</a> <a href="https://eevblog.myshopify.com/">uCurrent</a> but at nearly $100 delivered, I'm too tight to shell out for that!</div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
Option Two? DIY!<br />
<br />
The uCurrent uses a virtual ground, and has a positive / negative output swing. This is useful when measuring (for example) a battery that is charging and discharging.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMYuCNRisu7w-bNt2DhUzG1OVKazeFGoWL2wFA-mY4fGZuejy-oH3SUHfN-uVD833YM7C_pV_KnPIZBgJF9XW-zNj-2knQVuZGYy6jGcOkF1Vtb0vqPAsaZT8lto4XCiYHmqyywXluFDl/s1600/sc+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMYuCNRisu7w-bNt2DhUzG1OVKazeFGoWL2wFA-mY4fGZuejy-oH3SUHfN-uVD833YM7C_pV_KnPIZBgJF9XW-zNj-2knQVuZGYy6jGcOkF1Vtb0vqPAsaZT8lto4XCiYHmqyywXluFDl/s320/sc+02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Above shows the schematic of the original uCurrent. The uCurrent Gold is more complicated to give greater bandwidth, but works in the same way.<br />
<br />
Anyway, as I'm not interested in charging batteries, only estimating the draw under load, I can reduce part count by nixing U2 and associated parts. Also, to keep things simple I decided to use jumper links rather than dip switches, and I used a blue LED for low battery indication. Why? Well a blue LED needs about 3V to light it, and if the coin cell is flat the LED won't light. Not a high precision technique but good enough.<br />
<br />
The uCurrent also uses very stable shunt resistors with excellent temperature coefficients, but for my 1% tolerance will be good enough, so I've chosen basic 1% bits. My version appears below. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmEfMtSTO1cFDuDGpFs8UCZ4vyHn05Dx3uLd9MAd4Onr56wxnHGha6H05EyToMPWiAyQ8yEJPng6otvrSAwbGuLFLMmqXVDYvMjNVFECv_eo70r6WZZF9DibhtnfTV-NEDCLyY3hZwv7Gr/s1600/sc+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmEfMtSTO1cFDuDGpFs8UCZ4vyHn05Dx3uLd9MAd4Onr56wxnHGha6H05EyToMPWiAyQ8yEJPng6otvrSAwbGuLFLMmqXVDYvMjNVFECv_eo70r6WZZF9DibhtnfTV-NEDCLyY3hZwv7Gr/s320/sc+03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Because I have access to an LPFK mill at work, I knocked the above up in a break time, and milled a quick board. There wasn't any need to rush, as the sample <a href="http://www.maximintegrated.com/en/datasheet/index.mvp/id/3407">MAX4239's</a> weren't delvied yet, but you do these things. I was pretty chuffed that I made it single sided, without links.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
One other experiment was to mill designators and other text on the component side, and to try colouring these to make it easier to read. I'd thought I'd also make two, so I can give one to my mate.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFrV020KsjjGXGw0ud6RXxE25o2IY4ixaw0g-u8N7KNyiwRrIm2TyIXC0R9s0sck5eGizuFUpQh2d0M_g3N7TTgdJRZqUJWWdPpTEE1XUSazD-lubAnva5sUUL7iF5Vd1akUZOMXXkfEHX/s1600/photo+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFrV020KsjjGXGw0ud6RXxE25o2IY4ixaw0g-u8N7KNyiwRrIm2TyIXC0R9s0sck5eGizuFUpQh2d0M_g3N7TTgdJRZqUJWWdPpTEE1XUSazD-lubAnva5sUUL7iF5Vd1akUZOMXXkfEHX/s320/photo+1.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
NASCO - As is Nick And Simon Co.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU9loCT_sMV4BrMLExy_ApE2sKNFHJONRWN3smNnn9LILxITNztsK58QDK_499Mo0OvDu-pBCD6x36NkesfIHJlYr2kSY1MO5XMOWJpFdushoo1m7iGF4In1hsZjbu8KJh6N2cNa45invI/s1600/photo+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU9loCT_sMV4BrMLExy_ApE2sKNFHJONRWN3smNnn9LILxITNztsK58QDK_499Mo0OvDu-pBCD6x36NkesfIHJlYr2kSY1MO5XMOWJpFdushoo1m7iGF4In1hsZjbu8KJh6N2cNa45invI/s320/photo+2.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
TO get the coloured text, I simply drew over the engraving with a whiteboard marker, and then wiped over the board with a dry tissue. The colour effect worked quite well if you ask me.</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJJOWjhCTymyRaGN0Ayiwtyqx2TXq1W2HCysumZSYrnlaBrw0lbUlkT0dsSTUtR5mY5B_vR7sLyCPWVivKO12pwDkcbkvO7lZbBCeml0lMtFBS6j3lOctnfqGCKYmzM_j62kHrPQQ_ZSUE/s1600/photo+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJJOWjhCTymyRaGN0Ayiwtyqx2TXq1W2HCysumZSYrnlaBrw0lbUlkT0dsSTUtR5mY5B_vR7sLyCPWVivKO12pwDkcbkvO7lZbBCeml0lMtFBS6j3lOctnfqGCKYmzM_j62kHrPQQ_ZSUE/s320/photo+1.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Assembly was quote straight forward, and it was soon ready for testing. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjySW3GQ1PfHnG_FuPnhOrm3vVKRPWqh37uuUttd61pM30xFU7BtkN-MfbNqi6gdcO0vRTVQOZ5njIFoHne_SCXNo3zPxiSwMnQxoBASJty2mv9Z3_MDA7OjP4PGYl75DRZ_QLDveZQuprq/s1600/photo+2+%25281%2529.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjySW3GQ1PfHnG_FuPnhOrm3vVKRPWqh37uuUttd61pM30xFU7BtkN-MfbNqi6gdcO0vRTVQOZ5njIFoHne_SCXNo3zPxiSwMnQxoBASJty2mv9Z3_MDA7OjP4PGYl75DRZ_QLDveZQuprq/s320/photo+2+%25281%2529.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
You'll notice that the green connectors aren't loaded yet, and that the layout is a little different from the render at the start of this post. The reason is simple. THE PROTOTYPE DIDN'T WORK.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
The gain seemed to be too high - on the mA scale with a gain of 100, 10mA (0.010A) should output 1 volt. I was getting closer to 2 volts. Why was the gain out by a factor of two?</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
As I punched this design out in a break at work, I let a real simple rookie mistake creep in. If you look at the schematic, you'll see that I thought I was clever in using just two jumpers rather than 'complicated switches'.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDajJGQLeZzHq7ni8pWlrdvhm-YTDkKCm_aqP5ZbQ3eBJUaWS3CVH_pgHvWbvHv7Kp0XyrPUYWVN1jcaRCOBP5ihvcb2CMIK5hcDvJ4sYTftBRGjxNyCm-LOR5w6jBUycbhX8MI1lIbbwZ/s1600/sc+04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDajJGQLeZzHq7ni8pWlrdvhm-YTDkKCm_aqP5ZbQ3eBJUaWS3CVH_pgHvWbvHv7Kp0XyrPUYWVN1jcaRCOBP5ihvcb2CMIK5hcDvJ4sYTftBRGjxNyCm-LOR5w6jBUycbhX8MI1lIbbwZ/s320/sc+04.png" width="320" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
For the uA range, I'd select the 10R resitor as a shunt, and for the mA range I'd select the 0R1 (0.1 ohms) resistor. I only tested on the mA range when I discovered my issue - can you guess why?</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
I didn't take into account the fact that the jumper themselves have a small contact resistance. By dumb luck it was close to 0R1 as well, doubling the effective shut resistance, which doubled the burden voltage of the circuit, which was then amplified correctly and confused the heck out of me.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
So the fix? Version 2.0</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGFrJBHQF6Gk_9SWur1_rjs0DkOOATRJYo1fu8SUH37TnF82OnQrDQPxiry0ri6Uz5TiD94rbr1l3jNOA-58tMoakpJZwSD8wphpcS0XzgSHjcYOTYmn_mXXtNHni3l7PA5AeRIkl0xQxu/s1600/sc+05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGFrJBHQF6Gk_9SWur1_rjs0DkOOATRJYo1fu8SUH37TnF82OnQrDQPxiry0ri6Uz5TiD94rbr1l3jNOA-58tMoakpJZwSD8wphpcS0XzgSHjcYOTYmn_mXXtNHni3l7PA5AeRIkl0xQxu/s320/sc+05.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
You will see that i now have four jumpers, where two have to be inserted to select a range. Why?</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
To measure the mA range correctly, jumper P6 is needed to connect the load to the 0R1 resistor, and P4 is needed to connect the input of the amp to the load. Conversely P3 and P5 are used for the uA range. If you take a second look at the original uCurrent, the switching is done in this same manner.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Live and learn (to copy properly if you are going to copy something).</div>
<div class="separator" style="clear: both;">
<br /></div>
</div>
</h2>
<h3 style="clear: both;">
V2.0 Testing</h3>
<h2>
<div style="font-size: medium; font-weight: normal;">
<div>
So it was time to get on with Version 2.0, and still using Altium, knocked up this second prototype. You'll see that I also changed the name to 'Simple Current' to avoid ripping off the uCurrent name.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRS0mTgt73yhMt_4m9IJj9hEi2eKOUVLcwPUdQ7TxRiKb2pbNhMhmjmdToTkwqqUk784AB-Mfw3_zcCCtAYd0_uVRSWRyC3MZapc_Ghi0oMIPPb3vpRIWFaJ2P7Vw-nyjjEcl8Rcyqow6/s1600/IMG_4280.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRS0mTgt73yhMt_4m9IJj9hEi2eKOUVLcwPUdQ7TxRiKb2pbNhMhmjmdToTkwqqUk784AB-Mfw3_zcCCtAYd0_uVRSWRyC3MZapc_Ghi0oMIPPb3vpRIWFaJ2P7Vw-nyjjEcl8Rcyqow6/s320/IMG_4280.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Yes the LED is on, but wont photo for crap on the 'ole iPhone...</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9-weVo3En1Ih7wBpYdTxH-ARDeAnLBH_QNCDnLbKYcvbuW61cUphJYBKygCyoLWEdEeHr1rILZtU2ETzPRm8Wu1oDXNpJR3F3DARIl6wsbI_0lKtE0rGQ6_GVZHeRoNYdawDKXf3D6r-p/s1600/IMG_4281.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9-weVo3En1Ih7wBpYdTxH-ARDeAnLBH_QNCDnLbKYcvbuW61cUphJYBKygCyoLWEdEeHr1rILZtU2ETzPRm8Wu1oDXNpJR3F3DARIl6wsbI_0lKtE0rGQ6_GVZHeRoNYdawDKXf3D6r-p/s320/IMG_4281.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Bottom View. I need to learn to solder....</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
For the prototype, I didn't have my preferred values to hand. Also you'll see the value in the schematic set the gain to only 10, where I prefer 100. Why the difference? PEBKAC.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Anyway, for the prototype I used 56k and 39k for R4 / R5 (for a total 95k) and with 1k fitted for R6 the expected gain should be 95. My testing resistors only have 5% tolerance, so the gain could vary from 90.5 to 99.75. Close enough!</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
The test set up used my version of a <a href="http://ludzinc.blogspot.com.au/2014/12/improved-current-load.html">constant current load</a>, my cheap and trusty multimeter and lots of hook up wire.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHh0cKeq5jzUCQJs_7KrC2xhm8jts4MFY4Q58UmjADAaOz4smSCfsW7KZyd4CbDrGKIwAgJfiJ54F4RNvemneIbwLR-PnXZCtYVZQ8-RBIEBC-KIfmqsQzi9z8HF5wUOpzQLvhOb_hZ5PG/s1600/IMG_4277.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHh0cKeq5jzUCQJs_7KrC2xhm8jts4MFY4Q58UmjADAaOz4smSCfsW7KZyd4CbDrGKIwAgJfiJ54F4RNvemneIbwLR-PnXZCtYVZQ8-RBIEBC-KIfmqsQzi9z8HF5wUOpzQLvhOb_hZ5PG/s320/IMG_4277.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
With 200mA being drawn, there should be 20mV across the 0R1 resistor, multiply y the (almost x100 gain) and the expected output voltage is 2.00V. Meter says 2.19V, nearly 10% error. Nothing in my rig is calibrated and if I had to bet on it I'd say the biggest error might be in the eBay display on the current load. I'll borrow a meter from work (one day) and pin it down, but for now, close enough!</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
The next step for me in a project like this might have been to call it done and post a story, but I really wanted to be able to share my designs in a way that's better than posting my Altium files.</div>
<div class="separator" style="clear: both;">
<br /></div>
</div>
</h2>
<h3 style="clear: both;">
Open Source Adventure</h3>
<h2>
<div style="font-size: medium; font-weight: normal;">
<div>
Since May this year I've been involved with the <a href="http://www.circuitmaker.com/#why_circuitmaker">Circuit Maker</a> <a href="http://ludzinc.blogspot.com.au/2015/05/circuit-maker-open-beta.html">open beta</a> programme.</div>
<div>
<br /></div>
<div>
With this I tried my hand at importing my Altium design into Circuit Maker (CM). The schematic copied straight over, but none of the parts were linked to the Ciiva database. Long story short it was easier to drag new parts in than link the old ones, and the effort to do that wasn't much less than redoing the schematic from scratch.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgia4KVZfRs-P_UP-IYCoCGepCNPkNV5trySkXlDxWfPyjzpe-nYsFO2JCk_X2SNLWXHpDDoCkz99iJhys8Wwk9HzdoRqX0VbO10sOsAx7Uq7Pxo7LSzX8FP1TaFy_2b2BSlrmBZU020a1t/s1600/sc+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgia4KVZfRs-P_UP-IYCoCGepCNPkNV5trySkXlDxWfPyjzpe-nYsFO2JCk_X2SNLWXHpDDoCkz99iJhys8Wwk9HzdoRqX0VbO10sOsAx7Uq7Pxo7LSzX8FP1TaFy_2b2BSlrmBZU020a1t/s320/sc+10.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
CM Version of Schematic</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
From there, I tried to import my Altium PCB file. No dice, CM wont import Altium and fair enough, they need to protect their business tool. What I could do in Altium was save the layout in a legacy format (Binary V3 PCB) but losing 3D parts, board shapes and polygon fills in the process. The imported board into CM is presented below.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTCITMXc83954Gc20A-HaMKj5ysHh1U7Wc4oa_sRGMMtiB05lQXOT3Ph3hyphenhyphencrYsscX6FQ3Fuohtw2T1n0kL-OO2x_B6wRSlhnilDGBcopUFbKNfj8JqMafjocdI0huWdg2HW88Fb2mtDXD/s1600/sc+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTCITMXc83954Gc20A-HaMKj5ysHh1U7Wc4oa_sRGMMtiB05lQXOT3Ph3hyphenhyphencrYsscX6FQ3Fuohtw2T1n0kL-OO2x_B6wRSlhnilDGBcopUFbKNfj8JqMafjocdI0huWdg2HW88Fb2mtDXD/s320/sc+11.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
In addition to the above list of omissions, the fonts were mangled and the SMD footprints were lost. However the trackwork is there and part centres are shown. An evening of updating footprints and models later, the following was ready.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlhn89OxRKUE7vXY8gjNIOhqT8p1KQbvWdNFa6w_u0aqsifDVXd_BSrTYD_gOts1MZmujuWDimP8f5xJpdWpJ9KJJ0_lDZYmOo1ogbUQZcWHRoFqhKN0a3UCHGrpP7VTZfps4WmQA_2eGb/s1600/sc+21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlhn89OxRKUE7vXY8gjNIOhqT8p1KQbvWdNFa6w_u0aqsifDVXd_BSrTYD_gOts1MZmujuWDimP8f5xJpdWpJ9KJJ0_lDZYmOo1ogbUQZcWHRoFqhKN0a3UCHGrpP7VTZfps4WmQA_2eGb/s320/sc+21.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie4uu4VUP2MdZMch3agD6W4l3f1TrTwJSSutxOJdCHhP61DhnuUJIyt3-G6m9J_Z3BVHRZn6jwnagvKs8cWTskgvlWcbH9XPAc0DhMSeT6vlHpAsWpyxuAP3ja6sAwNeT5yiE2jPsMfGx1/s1600/sc+20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie4uu4VUP2MdZMch3agD6W4l3f1TrTwJSSutxOJdCHhP61DhnuUJIyt3-G6m9J_Z3BVHRZn6jwnagvKs8cWTskgvlWcbH9XPAc0DhMSeT6vlHpAsWpyxuAP3ja6sAwNeT5yiE2jPsMfGx1/s320/sc+20.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Lesson learnt - don't bother importing from Alitum, just start again from scratch!</div>
<div class="separator" style="clear: both;">
<br /></div>
</div>
</h2>
<h3 style="clear: both;">
Manufacturing</h3>
<h2>
<div style="font-size: medium; font-weight: normal;">
<div>
Once I released the project in CM the manufacturing files (gerbers and nc drill) were available and I ordered some boards from <a href="http://www.elecrow.com/">Elecrow</a>. I also made a tin can <a href="http://ludzinc.blogspot.com.au/2013/06/stencil-mania.html">solder paste stencil</a> and then got busy waiting for the rest of the parts to come in from overseas.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfoNYdsNT1zE2ps-x6rcl4DjzC2VQ9hbhtKzoO5xNEhihFq2kFxW_4KIscqYouafdbuI2d1Q6V6LU7qnGuAAuHkPEM3ctV9v5xh7FGaXeqr-Xt96xjJOAYp0glHA_phGJ1DNUIfwK7cZe/s1600/IMG_4282.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfoNYdsNT1zE2ps-x6rcl4DjzC2VQ9hbhtKzoO5xNEhihFq2kFxW_4KIscqYouafdbuI2d1Q6V6LU7qnGuAAuHkPEM3ctV9v5xh7FGaXeqr-Xt96xjJOAYp0glHA_phGJ1DNUIfwK7cZe/s320/IMG_4282.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Bottom View.</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgymdF2UfuHbgrgf4CcvbcvUjp9uWrVKch9sD7_3inT__JEx6zzI5LFHvkaNjlNSLsqP2OXcICNQEGtnhoi6QAjMIpn6uXe7xJuJ3YyVZ1So9-c337dcQwTZ1-Y4u8k9mXqDnfOZzlxwacA/s1600/IMG_4285.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgymdF2UfuHbgrgf4CcvbcvUjp9uWrVKch9sD7_3inT__JEx6zzI5LFHvkaNjlNSLsqP2OXcICNQEGtnhoi6QAjMIpn6uXe7xJuJ3YyVZ1So9-c337dcQwTZ1-Y4u8k9mXqDnfOZzlxwacA/s320/IMG_4285.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Top View.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Once my parts arrive, I'll post build results and maybe borrow some calibrated equipment from work to check actual performance!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
</h2>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com1tag:blogger.com,1999:blog-2685787041614376103.post-7057528973440557472015-07-27T17:35:00.000-07:002015-08-02T19:53:45.128-07:00Alarm Fob Replacement<h2 style="clear: both; text-align: left;">
I Hate Being Ripped Off</h2>
<div>
My home alarm remote control had seen better days. After more than six years of abuse, the case was finally cactus, as can be seen below. My wife's fob was in better shape but it's days were also numbered.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzSVmUqtsC35xLTZ1yuW-lAHWB5EcOhXySm-GRpWGhJFYZJ-pmxVQHoNtdGzf6EQkKBrv98mR1zmpcRLtMwBNxpLvuUZ-y3NocXEw_r4b-8Ynq8rCpzbKlUEPhPzg6lcRvTSAGpbWxDZ5V/s1600/IMG_5408.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzSVmUqtsC35xLTZ1yuW-lAHWB5EcOhXySm-GRpWGhJFYZJ-pmxVQHoNtdGzf6EQkKBrv98mR1zmpcRLtMwBNxpLvuUZ-y3NocXEw_r4b-8Ynq8rCpzbKlUEPhPzg6lcRvTSAGpbWxDZ5V/s320/IMG_5408.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a>I thought I'd just be able to jump on line and find a replacement, but it looks like my <a href="http://www.das.com.au/en-AU/Products/alarms/443mhz-wireless/wireless-receivers/nx-305-2-x-4-button-k-fobs">Nx-305</a> system is the 'old one' and while the '<a href="http://www.southlandsecurity.com.au/reliance-activor-remote-kit.html">new one</a>' has many sources of cheap fobs, I'm out of luck getting replacements for mine.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, I did a little investigation. Popping open a fob showed:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-xnxnrER-WGPAL8AllghSaO6hBgnqORJ6_Yd8tnF3qbJiXT951uifsXrIfotzFRVtktAn7z22J_BVRPxFguowqGAjMGq0WBiOOLVEPC6KdSZGs8kTitzDCnZyWOKMyIdzMjkASly5mBLT/s1600/IMG_5409.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-xnxnrER-WGPAL8AllghSaO6hBgnqORJ6_Yd8tnF3qbJiXT951uifsXrIfotzFRVtktAn7z22J_BVRPxFguowqGAjMGq0WBiOOLVEPC6KdSZGs8kTitzDCnZyWOKMyIdzMjkASly5mBLT/s320/IMG_5409.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
.. a little 8 pin SOIC that was marked <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/21137G.pdf">HCS300</a>. This is a Microchip <a href="https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0CCMQFjABahUKEwjRhZ6sxfzGAhVlKKYKHVkmCoE&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FKeeLoq&ei=EMm2VdG9POXQmAXZzKiICA&usg=AFQjCNHG5mUVoPis8pcOXGlBFUgri0IxTA&sig2=j_Xvvq834bB7If8V0keWsw&bvm=bv.98717601,d.dGY">Keeloq</a> rolling code chip, and when registered with my receiver, provides a more secure system than the old school fixed code remotes.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
The HCS300 handles all the functions of the remote - reads the buttons, provides the encoded output for the 433 MHz transmitter, even flashes the LED. Nifty.<br />
<br /></div>
<div class="" style="clear: both; text-align: left;">
So, a little reading up on the new Activor system showed that these fob also used <a href="https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB0QFjAAahUKEwja1bfdxfzGAhXGGKYKHQYuDLc&url=https%3A%2F%2Fwww.hills.com.au%2Fmedia%2Ffile_uploads%2FS1890A%2FS1890A_NX-Bus%2520receiver%2520kit_Installation.pdf&ei=eMm2Vdq5CsaxmAWG3LC4Cw&usg=AFQjCNGxA5-tjrIsyPu7xY9HIi90EbrH1g&sig2=AKfE93X6ufY9c1a_9uZ-5g&bvm=bv.98717601,d.dGY">Keeloq</a>. So I took a punt a bought a pair from eBay.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxwDKf43gnGWZ8orBhKzJn1dDl_JZZvZcUzKZYXjrrrZ8lOYBySlR2nIz2AOOhWu8rBgtLe8JJJYWuU4IBq4L9shGwBtq4tGyTRsBKLj5op_yIBeHgC-F-6WUq4qM0D4YM2zY9Ult0kJ05/s1600/IMG_5411.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxwDKf43gnGWZ8orBhKzJn1dDl_JZZvZcUzKZYXjrrrZ8lOYBySlR2nIz2AOOhWu8rBgtLe8JJJYWuU4IBq4L9shGwBtq4tGyTRsBKLj5op_yIBeHgC-F-6WUq4qM0D4YM2zY9Ult0kJ05/s320/IMG_5411.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<br />
Straight off the bat, I tried to enroll the fob into my receiver. Unsurprisingly, it didn't work. So I cracked that puppy open:</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8k3AYFnh3Fu_eNpVRXm7FT184zg44jkOBKrVY4gL5LRn4gQsurbURXQD6tchPzfeoSfyGanCcTPP4ODww9sVamWbxRcZuFuokF-I1s6WevjURPsSbpruO9OszJg78NbKpJjuHvW7QF4Fi/s1600/IMG_5412.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8k3AYFnh3Fu_eNpVRXm7FT184zg44jkOBKrVY4gL5LRn4gQsurbURXQD6tchPzfeoSfyGanCcTPP4ODww9sVamWbxRcZuFuokF-I1s6WevjURPsSbpruO9OszJg78NbKpJjuHvW7QF4Fi/s320/IMG_5412.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
And was happy to find that it also used a HCS300. So why didn't it work with my receiver?</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWo1yigxLXCX3AdqxXDU3OAj5Uv5FFa_1TRA1okBkE6Ht1PMxUDVlsWo8bqrordDv5UrcZzHhn7EfHCoYQrFffxJzZ9xahDcNX0E0i7dg7e0xrvdT7h0tMQltFScUVGNgWBbvDU94HVRxd/s1600/IMG_5410.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWo1yigxLXCX3AdqxXDU3OAj5Uv5FFa_1TRA1okBkE6Ht1PMxUDVlsWo8bqrordDv5UrcZzHhn7EfHCoYQrFffxJzZ9xahDcNX0E0i7dg7e0xrvdT7h0tMQltFScUVGNgWBbvDU94HVRxd/s320/IMG_5410.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you look at both boards, you'll notice they both have a row of test pads - or more correctly <i>PROGRAMMING</i> pads.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From reading the datasheet, a manufacturer's code is programmed into each fob.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXFCZeFMN-Ko21LOmWDTDinMYtVIVkwjJGh9z2DYzCgCUVV9KVEVkN_KWiHQLYHhzB4zS9VVqj667techv420N67eTHozsLJRJIqqrhKPrhSSBr3SSngZLNqQNF85Go1yJh4Q6Or6zKyn4/s1600/man+code.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="92" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXFCZeFMN-Ko21LOmWDTDinMYtVIVkwjJGh9z2DYzCgCUVV9KVEVkN_KWiHQLYHhzB4zS9VVqj667techv420N67eTHozsLJRJIqqrhKPrhSSBr3SSngZLNqQNF85Go1yJh4Q6Or6zKyn4/s320/man+code.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, what I obviously needed to do was build a reader to extract the code from my old fob, then upload that to the new one. Or swap chips.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To borrow from JFK:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
"I chose to do the latter, not because it's easy, but because the other way is hard." </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZFv8-R5bCZYvTTbrpLkMX_yYHJh-0lnUjK8f5XLUzhyphenhyphenDlyPNdPo1lfVEnCN_OClXHMJfH6zr-J4vrAZ3wPI6Gv85WBjbq2p0YJzWKj_M2WWPTn7y9fGW7wgucN0wjSAtBuYO9K2vJgZld/s1600/IMG_5416.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZFv8-R5bCZYvTTbrpLkMX_yYHJh-0lnUjK8f5XLUzhyphenhyphenDlyPNdPo1lfVEnCN_OClXHMJfH6zr-J4vrAZ3wPI6Gv85WBjbq2p0YJzWKj_M2WWPTn7y9fGW7wgucN0wjSAtBuYO9K2vJgZld/s320/IMG_5416.JPG" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
So a few minutes later with the hot air tool, the chips are off the boards, donor chip on the left, useless chip in the middle.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
But, of course, I'm not finished there. The boards have the switches connected to different pins on the HCS300, because of different PCB layouts. So the 'alarm on' switch is actually open roller door 2 and the disarm is the arm button ... or was it ... wait, nevermind.. time to fix it in hardware!</div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB1KmyPQ7H66NNHqbtKwHDltB3S8fS33wCCj1eUZB3as2J30iNR-9zHu4cIsGiMdvB8kSjEu4DlIo6Iwz8YysfYjxxhHZ-vtlvNOxg0gqwyDGMzjNqUQ4yPoaGWDNUA631l859EqIUKwry/s1600/IMG_5400.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB1KmyPQ7H66NNHqbtKwHDltB3S8fS33wCCj1eUZB3as2J30iNR-9zHu4cIsGiMdvB8kSjEu4DlIo6Iwz8YysfYjxxhHZ-vtlvNOxg0gqwyDGMzjNqUQ4yPoaGWDNUA631l859EqIUKwry/s320/IMG_5400.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The traces that connect the buttons to the HCS300 were simply cut</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9dHEltzb3wJMdTtVfeGdCR515VOUtARIp52rfv459Q6WHhYxuAdmLpqcjSxDlGxrmnh7q0ibUIC_j2Ha-BS30pfPMAUcRsQwWrMTrpg__83R4Zj7C2hIo2uJ2UuZLr3NBix_n32CvutZ_/s1600/IMG_5401.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9dHEltzb3wJMdTtVfeGdCR515VOUtARIp52rfv459Q6WHhYxuAdmLpqcjSxDlGxrmnh7q0ibUIC_j2Ha-BS30pfPMAUcRsQwWrMTrpg__83R4Zj7C2hIo2uJ2UuZLr3NBix_n32CvutZ_/s320/IMG_5401.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
.. and jumper wires installed. It's at this point I realised I was out of TCW and made a mental note to buy some more. Which I haven't done.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqDKLJ9blXOkOMNAYzi48gZUDZUXnSJvysE4YOOeK42VFs3fH1XYyn2fTltCUWaWsINPzJU8JEkhfLGawS6Zd7uH5TC2yazLJi83YofnrnW7BTgsX7N88utbf4RTr5O_6MICIA4Lw1v7gT/s1600/IMG_5406.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqDKLJ9blXOkOMNAYzi48gZUDZUXnSJvysE4YOOeK42VFs3fH1XYyn2fTltCUWaWsINPzJU8JEkhfLGawS6Zd7uH5TC2yazLJi83YofnrnW7BTgsX7N88utbf4RTr5O_6MICIA4Lw1v7gT/s320/IMG_5406.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
One down, one to go....<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2giHIvcJ3Ry2EUgtIXrWAJWr6WTAP3P-Cg2SQSP0Zd39IpdnBb3QylFhOQijmgE2IE_wESCud7xe-FDOtUhmILhbkRlGATTIT5HBNCjEmXGf0tBmWB-1bTDliYbfluGOXNF18zr0DKVke/s1600/IMG_5417.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2giHIvcJ3Ry2EUgtIXrWAJWr6WTAP3P-Cg2SQSP0Zd39IpdnBb3QylFhOQijmgE2IE_wESCud7xe-FDOtUhmILhbkRlGATTIT5HBNCjEmXGf0tBmWB-1bTDliYbfluGOXNF18zr0DKVke/s320/IMG_5417.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After all that, the cases still went back together and all worked well. And this style of case seems to be available all over eBay / Deal Extreme so next time the cases are beat up, I'll just be looking at a PCB swap. Woot!</div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com4tag:blogger.com,1999:blog-2685787041614376103.post-33662629018037682622015-05-21T06:19:00.001-07:002015-05-21T06:19:57.197-07:00Circuit Maker - Open Beta<h2>
Circuit Maker Open Beta</h2>
<div>
On the 16th of May Altium released Beta 1.04 of Circuit Maker, and opened the beta testing to all. </div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcMpicniyT15EVKefZqbUfOL2yPJJpmQ_X1pmrbhGiIYw1rJUuikQ2nYGYArJtKCGFyxzBuRfckz43ovTnXAoQ5AGPc1QCLRNHQNuCtblod6PYo3twoukSmiZ6scGLe7UqkORX9el2VOD4/s1600/020.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcMpicniyT15EVKefZqbUfOL2yPJJpmQ_X1pmrbhGiIYw1rJUuikQ2nYGYArJtKCGFyxzBuRfckz43ovTnXAoQ5AGPc1QCLRNHQNuCtblod6PYo3twoukSmiZ6scGLe7UqkORX9el2VOD4/s320/020.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You bet I was keen to try it!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><h3 style="text-align: left;">
Second First Impressions</h3>
<div style="text-align: left;">
Earlier I blogged about my experience with the closed beta, and I wanted to see the difference between the two.</div>
<br />
<div>
<br /></div>
<div>
<div class="separator" style="clear: both;">
I installed CM, opened it, logged in and started my first project. I find that if I have *some thing* in particular I can focus on it, rather than much about with simple circuits that my heart isn't really into.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
So when the <a href="http://www.clipsal.com/Trade/Products/ProductDetail?CatNo=780K1">Clipsal 780K1</a> Light Switch Multiplier <a href="http://www.eevblog.com/forum/projects/light-switch-multiplier/msg656170/?topicseen#msg656170">died at my folks place</a>, and after finding out it was $200 for replacement unit, I decided to make a clone of it so my pensioner parents can have a spare.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiKpGJOaQhGzku8mubn8QO8jh4h3FfB3FYpomiSq3JQ9m6huDBdLgYz-PZAsxLQgzJIPIN2LCNBGicS05ICWP_vmjL1-H10lk9Zti8Sq7PgE2gVZqt1Yd74w6_XBJlIMeFhQ38dktqFQyQ/s1600/001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiKpGJOaQhGzku8mubn8QO8jh4h3FfB3FYpomiSq3JQ9m6huDBdLgYz-PZAsxLQgzJIPIN2LCNBGicS05ICWP_vmjL1-H10lk9Zti8Sq7PgE2gVZqt1Yd74w6_XBJlIMeFhQ38dktqFQyQ/s320/001.png" width="320" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, if you get into CM, look up Switch Multiplier and you might find my project. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So I added a schematic sheet (from the Project command on the ribbon) and set to lookng up parts. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The first change is that CM no longer uses the <a href="https://octopart.com/about">Octopart </a>database, but one called <a href="http://ciiva.com/about-us">Ciiva</a>. No idea why, but it just is.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Anyway, the starting point I chose was the DPDT relay used in the 780K1. I knew that the Finder <a href="http://ciiva.com/part/5512-8230-0000-1009188">55.12 series </a> was suitable and, yay, it's there in the Ciiva database.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBun9csN6s_Qrv75VunMYDPUaxHDfm9gIEagXO1donawwfxSjruEsFzwupXdMDdu9fZTZdOHaRoX34mWOGluvD5-qAPQhyN_xqXMDguRTa_-xzDnmQNR83jT34R4EZD1qzqaaIOYnjm_bz/s1600/003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBun9csN6s_Qrv75VunMYDPUaxHDfm9gIEagXO1donawwfxSjruEsFzwupXdMDdu9fZTZdOHaRoX34mWOGluvD5-qAPQhyN_xqXMDguRTa_-xzDnmQNR83jT34R4EZD1qzqaaIOYnjm_bz/s320/003.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You get started by right clicking on your part, and selecting 'Build This Component'.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At the time there wasn't a schematic symbol or pcb footprint associated with the part. No worries, happy to build some!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Symbol Creation</h2>
<div>
The component screen shows the part, and shows the holding places for the schematic symbol and footprint models (and notably a simulation model - forum posts suggest that simulation is a feature yet to come to CM).</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL3uu2SeaiVF04Ba-BYdvukKZ7YMd7a_BxC2r1a3F81YD6qwoQt0zDhusoFY3GQD-F93g-fO-_RypbK7lHOlv16No4hve5mMDFhJWAEMCLxaqod8uMMqYaiXTYJ4SQGWUR3Ev9P89jD0bd/s1600/035.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL3uu2SeaiVF04Ba-BYdvukKZ7YMd7a_BxC2r1a3F81YD6qwoQt0zDhusoFY3GQD-F93g-fO-_RypbK7lHOlv16No4hve5mMDFhJWAEMCLxaqod8uMMqYaiXTYJ4SQGWUR3Ev9P89jD0bd/s320/035.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you have used Altium, you will find the Schematic Symbol editor to be very familiar. The ribbon is a bit cluttered (never been a fan of that interface) but it's easy to navigate. From there you can place pins, symbols and all the things you need to build a schematic symbol.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3eK7rxy2d5Jw4URYhHUMI7PVWgft7B5FIliG47atpgM18tIrMyXnq60Fc7yxwYrw8JVMpspsZ4anYRAkiL-gMttwcCGIkPnzx9zTRtoulz2vc-DWGuz_fFs0BuGWc9i5MvN7Hl7HTUwtc/s1600/004.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3eK7rxy2d5Jw4URYhHUMI7PVWgft7B5FIliG47atpgM18tIrMyXnq60Fc7yxwYrw8JVMpspsZ4anYRAkiL-gMttwcCGIkPnzx9zTRtoulz2vc-DWGuz_fFs0BuGWc9i5MvN7Hl7HTUwtc/s320/004.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The schematic part building is very familiar to the way Altium does it, with the exception of the higher power tools (like list editing groups of parts). But hey, time is money and Altium users have paid for the power tools. In CM, it's free so you can spend a little more time on it :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In a few minutes my pins were defined and my symbol was ready to go.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7s1uxgR1SBRYuizcRK1PpKAn9OprcndkNhj9L66g82sGRIMgH3-iJhbzeihGqvO8UTBhdUXljUaDzv36rHe_0EEkW0orWdJ_beEc517Af4XCE7p5ggK9Vgdz3PPfBUfGwdfB4XeqtSNWh/s1600/023.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7s1uxgR1SBRYuizcRK1PpKAn9OprcndkNhj9L66g82sGRIMgH3-iJhbzeihGqvO8UTBhdUXljUaDzv36rHe_0EEkW0orWdJ_beEc517Af4XCE7p5ggK9Vgdz3PPfBUfGwdfB4XeqtSNWh/s320/023.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Footprint Building</h2>
<div>
Each symbol needs a footprint. I'm happy that CM supports the use of 3D models, and import is as easy as in Altium.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqRpolGdf1wu83pLIMfsoBbd6eyAUFTmpcFACF5FcUoLxtSpNZw7RFtfLZ6Z6dmROMaoBaviZYi3TOWBvcFTp9gzOlhdIMZ9KxGQDNUCR5PXK-TUI0ys2GxWNHf6jhig3SfW70lI0jxvK/s1600/005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqRpolGdf1wu83pLIMfsoBbd6eyAUFTmpcFACF5FcUoLxtSpNZw7RFtfLZ6Z6dmROMaoBaviZYi3TOWBvcFTp9gzOlhdIMZ9KxGQDNUCR5PXK-TUI0ys2GxWNHf6jhig3SfW70lI0jxvK/s320/005.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After finding an appropriate Step Model from 3D Content Central, I placed it in the footprint editor and then tried to move it like you do in Altium. Left click, go to drag it and... error!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJl_qFaqrfdd88cSHVN7Jc3XesppPUeklaxSWS031JE7dY-fT0z1lpg8quM98quUxkaiI4CRlI2NvvpF-Hg0DlHTS6eumny7S1xKZORw9tMzv7-yj88nxGlxwQ5m6z5DZhMwlCajdOheAw/s1600/006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJl_qFaqrfdd88cSHVN7Jc3XesppPUeklaxSWS031JE7dY-fT0z1lpg8quM98quUxkaiI4CRlI2NvvpF-Hg0DlHTS6eumny7S1xKZORw9tMzv7-yj88nxGlxwQ5m6z5DZhMwlCajdOheAw/s320/006.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This left me confused! What is the point of having 3D models if you cant place them like you need? Sort answer is yes you can, but you need to get into the Ribbon interface. While in 3D view (keys 2 / 3 toggle between 2D and 3D in the footprint editor, the same with the PCB editor).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With the 3D options you can select move and then drag the part around, but you can also do the very cool things like 'Align face with board' (orients the step model and lays it on the top of the PCB in some simple step) and add snap points. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2xtrlUZRyLdsdRZxPs3iftQxP_wBAQ3Uc7sffEwqSkLD3QHSODK1NBh6zE3RAEwBmgKEkZwEEOpMx5yrNNQLIfe84cR8dgC3NflGwDJxrbhbPPHDxFUoT7m3x_laIpm2wH5vUiQwZqYNw/s1600/033.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2xtrlUZRyLdsdRZxPs3iftQxP_wBAQ3Uc7sffEwqSkLD3QHSODK1NBh6zE3RAEwBmgKEkZwEEOpMx5yrNNQLIfe84cR8dgC3NflGwDJxrbhbPPHDxFUoT7m3x_laIpm2wH5vUiQwZqYNw/s320/033.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Pro-tip - when placing snap points, press the space bar to toggle 'midpoint mode'. The snap point is then placed midway between two points you select and make the selection of the middle of a pin a breeze.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKWoXZzBxU1OkrMfA4mXZ6Yoif1YrBKq45MXMJbWLpZvvvFuRYlHwBmRumOFAcOa5AMrew9yPk2_K6GjJGHvDgzgHBTbqRelsmMhfSDqr1EweqesXvZMKJBwSFZmAqg-cOexux3PTN5Jxi/s1600/031.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKWoXZzBxU1OkrMfA4mXZ6Yoif1YrBKq45MXMJbWLpZvvvFuRYlHwBmRumOFAcOa5AMrew9yPk2_K6GjJGHvDgzgHBTbqRelsmMhfSDqr1EweqesXvZMKJBwSFZmAqg-cOexux3PTN5Jxi/s320/031.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the screenshot above you can see where I've added snap points to the pins (pads have already been placed).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In 2D mode, when you start placing your pads, and if you have selected the 'outline' layer (where step models are imported to by default) you can use the snap points to locate your pads</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgfGNN_KJLV3WIJxwiYxY4nlyf-dwVrSy9yeZthZPllWvt53_eHSrooE4EJUrFbneSYsAocO_qbVsjwumdCLSPA1Csap_K17xMwNUHSJeOQbSyk0BoBcuTDn8QApz4Edoh_jxCM6SA6Aw/s1600/032.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgfGNN_KJLV3WIJxwiYxY4nlyf-dwVrSy9yeZthZPllWvt53_eHSrooE4EJUrFbneSYsAocO_qbVsjwumdCLSPA1Csap_K17xMwNUHSJeOQbSyk0BoBcuTDn8QApz4Edoh_jxCM6SA6Aw/s320/032.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
And here you can see how when the pad I'm moving is 'locked' to the snap point (the white snap points turn the cursor grid black when all is aligned). </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Being able to do this I placed all my pads in less than a minute. I then checked that the model was correct by measuring the distance between the pads and comparing them to the datasheet dimensions. At this point, all is looking good!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once the symbol and footprint are built, you can push them back to the database by committing them. Now they are there for the rest of the world to use!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgij0U_J9UjOItz8S1FbkeTa0iHn8phY3qT7PWC3wrrXFqmj-sYFMxNezX0Y72JUTkYYrr1vN-xkoItqaq2I8AAJpMXHiP0rFTynyjbDPz_PIQfvW0KoJivvdnAYUn3JiPROnbF0_dxzEHj/s1600/030.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgij0U_J9UjOItz8S1FbkeTa0iHn8phY3qT7PWC3wrrXFqmj-sYFMxNezX0Y72JUTkYYrr1vN-xkoItqaq2I8AAJpMXHiP0rFTynyjbDPz_PIQfvW0KoJivvdnAYUn3JiPROnbF0_dxzEHj/s320/030.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once built, the part is automatically added to your 'Favourites' library. If you right click on the library name and select refresh, you new part shows up. You can then drag it into your schematic.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5M4ZGaAZgDvkf3xM9mbeiAS3BNzce2NxJpa8Wu3Jo6sO1Pap3xkL4uWF1ZXCrNZYZ3jJN0WhBOhs74HD-gqYaPKXH6Hwb4hVQ2wqede9RePhxNTQnfNqBU_BjLYgPmbx2-9ejsFWSoKi/s1600/011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5M4ZGaAZgDvkf3xM9mbeiAS3BNzce2NxJpa8Wu3Jo6sO1Pap3xkL4uWF1ZXCrNZYZ3jJN0WhBOhs74HD-gqYaPKXH6Hwb4hVQ2wqede9RePhxNTQnfNqBU_BjLYgPmbx2-9ejsFWSoKi/s320/011.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So far it's taken me about 15 minutes to get to this point, with the exception of the hour I spent seeking step models in 3D Content Central. Yes I got distracted....</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can also double click the part in your schematic and adjust parameters if needed.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSMUXd7i_PiuvBNldcBiGvAyHGkZbkK957c0d3P0KLPkm-xyRYzf4Nqn8n3RWyrLzNGBcDmWSgRk3kuQORHBnJ67MT8rI-76MIAKauqACOYO-kAN_3dyestZAtYOHhVvu90U3VW9NMmK8D/s1600/012.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSMUXd7i_PiuvBNldcBiGvAyHGkZbkK957c0d3P0KLPkm-xyRYzf4Nqn8n3RWyrLzNGBcDmWSgRk3kuQORHBnJ67MT8rI-76MIAKauqACOYO-kAN_3dyestZAtYOHhVvu90U3VW9NMmK8D/s320/012.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In my case I had to change the default designator from L? to K? - probably because I'd used an inductor symbol while building my relay.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Not in the Database (Custom Part Creation)</h3>
<div>
One big criticism I had with the closed beta was that if the part didn't exist in the Octopart database you were screwed. Things like Fiducial's, Edge Connectors and <a href="http://www.tag-connect.com/">Tag-Connect</a></div>
<div>
<a href="http://ludzinc.blogspot.com.au/2013/03/missed-it-by-that-much.html"> programming headers</a>. </div>
<div>
<br /></div>
<div>
Well, Altium have listened, and fixed it!</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBun9csN6s_Qrv75VunMYDPUaxHDfm9gIEagXO1donawwfxSjruEsFzwupXdMDdu9fZTZdOHaRoX34mWOGluvD5-qAPQhyN_xqXMDguRTa_-xzDnmQNR83jT34R4EZD1qzqaaIOYnjm_bz/s1600/003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBun9csN6s_Qrv75VunMYDPUaxHDfm9gIEagXO1donawwfxSjruEsFzwupXdMDdu9fZTZdOHaRoX34mWOGluvD5-qAPQhyN_xqXMDguRTa_-xzDnmQNR83jT34R4EZD1qzqaaIOYnjm_bz/s320/003.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you right click on any part in the Ciiva database, you can find the 'Build New Custom Component' menu entry.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtPR9eJWovbBh6tvxyjfpVbk-mSM5smcvKRCyDDWLadmqIDRynV-oC8Gt9CK0hbKmH6q63siV4m6N3y5h2dd3WXW_wdHCS4ZmKJuuSmxdRGYtla6Kwxpi2cHMLB_pBHs-6FnoWWnL71N3R/s1600/034.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtPR9eJWovbBh6tvxyjfpVbk-mSM5smcvKRCyDDWLadmqIDRynV-oC8Gt9CK0hbKmH6q63siV4m6N3y5h2dd3WXW_wdHCS4ZmKJuuSmxdRGYtla6Kwxpi2cHMLB_pBHs-6FnoWWnL71N3R/s320/034.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Just like before, you can launch the symbol and footprint editors by clicking on the model place holders, and you can build your part just like before.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizDO8CBAuQZsC4RBwH28rXWcO_F-F79zMQ5PG6-hfEW6xzhfNZar5nKTVmTKUZ_ErYQju1itou0zlAt9pcy0hHoH5GmAA1K0_SJ_B4DWyMoC8GeXq7jMxgFQ-STREg6Er6otJcZWoKbsBZ/s1600/013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizDO8CBAuQZsC4RBwH28rXWcO_F-F79zMQ5PG6-hfEW6xzhfNZar5nKTVmTKUZ_ErYQju1itou0zlAt9pcy0hHoH5GmAA1K0_SJ_B4DWyMoC8GeXq7jMxgFQ-STREg6Er6otJcZWoKbsBZ/s320/013.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
CM may be a free tool, but it's got some powerful features. You can for example set parts 'types'. In this case I've chosen 'Standard (No BOM)'. This will stop the BOM generator adding what is only pcb artwork being added to your Bill of Materials. Excellent!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1Ytha0_N2cD18wh4YzUSQ1zDOHCDCkdFEqgTf6FZapdPIarkDR-gUowGjV2qFe4EVjJ8_tZwxJ5u7FFeD-LmR_EqqaTE885BBh0WjX5W-2Q_pbcPLOFJeL6Mb7NT4AjjUH8E8m_VYJPM-/s1600/036.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1Ytha0_N2cD18wh4YzUSQ1zDOHCDCkdFEqgTf6FZapdPIarkDR-gUowGjV2qFe4EVjJ8_tZwxJ5u7FFeD-LmR_EqqaTE885BBh0WjX5W-2Q_pbcPLOFJeL6Mb7NT4AjjUH8E8m_VYJPM-/s320/036.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With that, my first custom, not-locked-to-a-database part was ready. Next up, I'll complete my schematic and talk about building my pcb.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com1tag:blogger.com,1999:blog-2685787041614376103.post-66669280973861010062015-04-27T04:46:00.000-07:002015-05-21T20:22:44.054-07:00Circuit Maker Beta Testing<h2>
Circuit Maker Beta Testing</h2>
** STOP READING HERE **<br />
<br />
The info below was true for the closed Beta, but no longer is the case. The open beta now offers no limitations, and in the words of the CM team, free should be free!<br />
<br />
Read all about it here: <a href="http://ludzinc.blogspot.com.au/2015/05/circuit-maker-open-beta.html">http://ludzinc.blogspot.com.au/2015/05/circuit-maker-open-beta.html</a><br />
<br />
<a name='more'></a><br />
<br />
WooHoo!<br />
<br />
I was recently contacted by Altium to find out that I was invited to join the Closed Beta for Circuit Maker. Initially, I had to agree to an Non Disclosure Agreement (NDA) and thus couldn't discuss my impressions of it with the outside world.<br />
<br />
Well, I've just received an email that's released my from the NDA - I guess they want want to spread the word - and thought I'd share what I know.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZNcCRY443BS-0tHpfxTZ0rMyj_EvSXo-p-NYBVRR4q6P1x-jhktP7XTibJyxcSopQWqAiiq01KqeaIGtt60OjrAY51EhXLACGk4C4VqC-JWZMsoEJgmsE7LSrpPSzpsgrQDjutTx3DJq_/s1600/Install+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZNcCRY443BS-0tHpfxTZ0rMyj_EvSXo-p-NYBVRR4q6P1x-jhktP7XTibJyxcSopQWqAiiq01KqeaIGtt60OjrAY51EhXLACGk4C4VqC-JWZMsoEJgmsE7LSrpPSzpsgrQDjutTx3DJq_/s1600/Install+00.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<h2>
Free, as in Beer</h2>
<div>
Yes, Circuit Maker is free, to start with. With the free package you get:</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7qUtB0JfAv83M4B3UX_Mt02-2I3_qnoDMMCYSPnEll7SCbO7gWrkm4nAj5Rbd8WQQeYJvvYh_6hKmE41LcNcJ9mnhjd2uXgUlIEcHkSgijYqQ6TqhUBO-AjnA_bEeItPzrEtT9BzP2657/s1600/USE+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7qUtB0JfAv83M4B3UX_Mt02-2I3_qnoDMMCYSPnEll7SCbO7gWrkm4nAj5Rbd8WQQeYJvvYh_6hKmE41LcNcJ9mnhjd2uXgUlIEcHkSgijYqQ6TqhUBO-AjnA_bEeItPzrEtT9BzP2657/s1600/USE+02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The two layers, 100 sqcm limitations were rumored to be limits before CM's release, and you can see those here. However the 75 nets / components limits are a shocker. You can reach 75 nets pretty damn quickly.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For comparison, here are some of my past Altium projects:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLYf1xRo4bD9Vtn3hgo9507BwPCjU4kf9vaCsikpctWYWolpGlumdv7Hrpn2gksYKBmHnLP8H-0eyHKLV5KHG7fqK_w2L1XLwvgYv9KWwt_rTCJU7-ZXAWvO1Nn95j4pZw_zr9D0e_bjwc/s1600/altium+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLYf1xRo4bD9Vtn3hgo9507BwPCjU4kf9vaCsikpctWYWolpGlumdv7Hrpn2gksYKBmHnLP8H-0eyHKLV5KHG7fqK_w2L1XLwvgYv9KWwt_rTCJU7-ZXAWvO1Nn95j4pZw_zr9D0e_bjwc/s1600/altium+01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My 4 channel voltage and current meter, clocks in at 166 Nets, with 234 parts.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRoD7EUjU02rJLjB4KB7TYV6Ory8bXXBiJyU3Vevr-w9e5VkAK00LRrjYlOewNSrmO47cm-LYPzwktGq7UKWkvRMSGsIiiGKy8CMbDA0L05AN50OQxLDkQyAoh_p-iWvcFY59h8FmLrO7/s1600/altium+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRoD7EUjU02rJLjB4KB7TYV6Ory8bXXBiJyU3Vevr-w9e5VkAK00LRrjYlOewNSrmO47cm-LYPzwktGq7UKWkvRMSGsIiiGKy8CMbDA0L05AN50OQxLDkQyAoh_p-iWvcFY59h8FmLrO7/s1600/altium+02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And my Alarm Interface clocks in at 99 nets and 122 parts. What's interesting there is I use a 100 pin QFP micro in that design, but the unused pins do not count as nets (nor should they). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So for the projects I like to build, I'll need to upgrade. But to keep comparisons fair, your run of the mill Current Load project:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBovNheOzfT0tFoIrtPaMGo1uL_HzLAWOLuhGHJw0D8___KQwWf-tKRPO5UTk0yPRl-dPUJqIq8JJHPzaPPCbRA5UGNE2jQ0cW-1Wm4K4uMJU3F5QwZdXwBGJKiHyrs9eHqp2jOHnJGo4Z/s1600/altium+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBovNheOzfT0tFoIrtPaMGo1uL_HzLAWOLuhGHJw0D8___KQwWf-tKRPO5UTk0yPRl-dPUJqIq8JJHPzaPPCbRA5UGNE2jQ0cW-1Wm4K4uMJU3F5QwZdXwBGJKiHyrs9eHqp2jOHnJGo4Z/s1600/altium+03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Has 15 parts and 10 nets - which is a great starter project.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Anyway, you can upgrade CM - all the options follow:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTuoe4BogrsN26zuoVN5mvVDCe30s4Gk2DQsBo80VncBtjObCAMrTl_jmCQrno3Q-welcIS4RUvuwUApTybDdBO9dXH7Bc2NyNxmIFG2qLisA2Vc2AMuVAB5k66NIZb-aKG83hkSgxJGT/s1600/USE+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTuoe4BogrsN26zuoVN5mvVDCe30s4Gk2DQsBo80VncBtjObCAMrTl_jmCQrno3Q-welcIS4RUvuwUApTybDdBO9dXH7Bc2NyNxmIFG2qLisA2Vc2AMuVAB5k66NIZb-aKG83hkSgxJGT/s1600/USE+03.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsVgHsctpbgyRG6GYCleeELs0ddGw79qzW1hgHeEbrduLC0RZgBdlyyEoZ0iwoiF_Q3oTNVUaQBBjU_w-5MHTVNqTk5t9A4M-2ybs-TGcmrzUd3kTv8Xb0vgh7hZb2bBEdbtH_GveccINP/s1600/USE+04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsVgHsctpbgyRG6GYCleeELs0ddGw79qzW1hgHeEbrduLC0RZgBdlyyEoZ0iwoiF_Q3oTNVUaQBBjU_w-5MHTVNqTk5t9A4M-2ybs-TGcmrzUd3kTv8Xb0vgh7hZb2bBEdbtH_GveccINP/s1600/USE+04.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8_uaYy1ZbBlsLgvGMquNSwu6m6lzVZFY-OqNjp_wZVxtgEKencDGLMIvI1CzKmaV4Bps49CF_WQqq0I5yKO4g9GTZFqOACivqLauAFd3ozEqg7s7MQt4KpNYlLAbw8tgnJ7d5Jld-5cVb/s1600/USE+05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8_uaYy1ZbBlsLgvGMquNSwu6m6lzVZFY-OqNjp_wZVxtgEKencDGLMIvI1CzKmaV4Bps49CF_WQqq0I5yKO4g9GTZFqOACivqLauAFd3ozEqg7s7MQt4KpNYlLAbw8tgnJ7d5Jld-5cVb/s1600/USE+05.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWAapdWOMSTW4s0cgUa_JKEOVgIBmC-TF3lnTRv8jTSM4ViDZpERWF6FYFFuT5CtHDG0bUrfA4zSplTba2SeEn4zJLwE6xmv7xgx2s03pVgsogEzAOPgeiSTu_NiBHqyMJm81SVog8NX41/s1600/USE+06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWAapdWOMSTW4s0cgUa_JKEOVgIBmC-TF3lnTRv8jTSM4ViDZpERWF6FYFFuT5CtHDG0bUrfA4zSplTba2SeEn4zJLwE6xmv7xgx2s03pVgsogEzAOPgeiSTu_NiBHqyMJm81SVog8NX41/s1600/USE+06.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Notice that the subscriptions are quarterly, so you could got to 8 layers only when you need them. Fully optioned, you're looking at $60 a year, but from a personal point of view I'd be happy with 2 layers, 150 sqcm area, 350 nets / parts and 5 private projects, for only $24 a year. Not a bad deal at all, but I wonder what happens when you come up to a hard limit? Get creative, I guess.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For those who don't want to share their projects, the option for 1000 private projects is a winner. I like to share my stuff, but only when finished and a limit of 5 private projects will keep my works in project to a manageable level. You know, where I actually finish something....</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Let's Make a Board</h2>
<h3>
Getting Your Bits Together</h3>
<div>
The first thing you need to get your head around is that there isn't any local libraries. You need to find something in the Commmon Parts library, based on what is available from Octopart. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPFlfis3L4vNYlwDUqo1VBRnmUILRXxXKu7v2Bd6aLh4yczPa_BR-p52yYxQ3FZ-MNgVQ8b4lXzxkroeymIJy_7tFQ6aFLXiKKdCj0MfR9hpJ64xtlSmLxum7THL0PXT-8l-9glIVYxEU4/s1600/CM+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPFlfis3L4vNYlwDUqo1VBRnmUILRXxXKu7v2Bd6aLh4yczPa_BR-p52yYxQ3FZ-MNgVQ8b4lXzxkroeymIJy_7tFQ6aFLXiKKdCj0MfR9hpJ64xtlSmLxum7THL0PXT-8l-9glIVYxEU4/s1600/CM+03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To start with, I built a new project with the highly imaginative name of "TEST00" . I've left this project as public, and you can see that no one has forked it yet. This I think is a nice touch.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilA9IXgWX7H8CYQwE0COhkR8aN-izEsHz25Lm-X7E1tzMXgPRC22c17_uRkVJHyiwX24RTe8NvnKSjgECP0WEp2cnv4x6DjHPQk2BoHZBwKXqi6lRxXQlCtL_QqTPz1_giUBuJh7Cmk0re/s1600/CM+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilA9IXgWX7H8CYQwE0COhkR8aN-izEsHz25Lm-X7E1tzMXgPRC22c17_uRkVJHyiwX24RTe8NvnKSjgECP0WEp2cnv4x6DjHPQk2BoHZBwKXqi6lRxXQlCtL_QqTPz1_giUBuJh7Cmk0re/s1600/CM+02.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As an aside, you can view community projects by selecting the "Open Projects" link in the Tasks panel. </div>
<br />
Once loaded, you can open your files. It looks like they are cached locally - when you first open a project you can see the task bar progressing while the files load. But once loaded the work with these files is snappy. That said I'd *LOVE* an off line mode but that's not the cloud model.<br />
<h3>
Octo-Search</h3>
<div>
Ok, so it's Beta so I'm expecting some clunky behaviour. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkUN38EZdwpUoxki7Zufzigny57RpwqvhbAhO4Ic-S34zvslhvUh9qxJbnEQ3mHIAjqR-J1IAsaSvY0chQeExgFatibUFPxIZ-gOwgvJRqv6uynB5bWbYw_DB_bURdh3rl-Xk6cl_LOdYy/s1600/CM+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkUN38EZdwpUoxki7Zufzigny57RpwqvhbAhO4Ic-S34zvslhvUh9qxJbnEQ3mHIAjqR-J1IAsaSvY0chQeExgFatibUFPxIZ-gOwgvJRqv6uynB5bWbYw_DB_bURdh3rl-Xk6cl_LOdYy/s1600/CM+03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you've ever used Altium, you know right click is your happy friend, and if you want to place a part, the menus are there in Circuit Maker.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5VjJoZXsZ0Lg74oEeFMXzK56fSRuEBqYaMZAFSXs1Kj6zBdFVkxQ6TjmFrPnQ3ZnpzWp6iiBEFvx7_508-pOA8dDRtqEOqcoZmuJiItQdQMcFsamIhUV0OZXRdgCiN5cyvzdc9FpHfX6v/s1600/CM+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5VjJoZXsZ0Lg74oEeFMXzK56fSRuEBqYaMZAFSXs1Kj6zBdFVkxQ6TjmFrPnQ3ZnpzWp6iiBEFvx7_508-pOA8dDRtqEOqcoZmuJiItQdQMcFsamIhUV0OZXRdgCiN5cyvzdc9FpHfX6v/s1600/CM+10.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Menu's bring up the familiar library dialogs, but there it hits the wall.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtnpy8Wo0gyqmSmT7iB_w6AdVGdiiGFtda42x9VeZj3NkDL5IOe8UnPxe2PPWetw3MQEF6o43QUrQM6swQes_ODTchJJ2l6LnIOlp7GylP0RUvzgSECvufk4aYCZYJHPi2Uj0PQgCs5Bor/s1600/CM+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtnpy8Wo0gyqmSmT7iB_w6AdVGdiiGFtda42x9VeZj3NkDL5IOe8UnPxe2PPWetw3MQEF6o43QUrQM6swQes_ODTchJJ2l6LnIOlp7GylP0RUvzgSECvufk4aYCZYJHPi2Uj0PQgCs5Bor/s1600/CM+11.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can chose from 'Favorites' and 'Octopart' libraries, and if you're a new starter this will confuse you as they will show up as empty libraries. I since learnt that you can associate Octopart library parts with your favorites library, and the Octopart library will only show what is in the Octopart search in the library menu.</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3mBlf13cjH-zVo81AbFOonB16_aqAzfm8DLp-AHmvgwzZ3fHoRij-Dj1kaJRFT79Tx4vqJLGLSIdXteA0CkalDtLBTYvzd19uPYhNqx9oJtZHGg8M5eBW7b3-kSHi-XWqOZIDm-XN1zJ5/s1600/CM+13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3mBlf13cjH-zVo81AbFOonB16_aqAzfm8DLp-AHmvgwzZ3fHoRij-Dj1kaJRFT79Tx4vqJLGLSIdXteA0CkalDtLBTYvzd19uPYhNqx9oJtZHGg8M5eBW7b3-kSHi-XWqOZIDm-XN1zJ5/s1600/CM+13.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you open up the Library window on the right, you can then search Octopart for your parts. If you find one with a schematic icon and footprint, you can then just drag that part into your schematic. If not, you may find a part that needs it's icon and footprint created. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Believe it or not, I had to do this for a 10k 0603 resistor! Of course I didn't screen shot that part, so here's one I tried later:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQWPsDVSRrEPB7Dzkcto2mr9CFQA97cyQaNGu8NM4cNbLJ4TDHPt1K3x_PQvv9eaGtE32J8lM5qBzWmtjeBbqASR3D6fWYQX37GBuAzRE1Fmu5q6LjYtW9fljvetis30vV2ISRC8KA4OVU/s1600/CM+30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQWPsDVSRrEPB7Dzkcto2mr9CFQA97cyQaNGu8NM4cNbLJ4TDHPt1K3x_PQvv9eaGtE32J8lM5qBzWmtjeBbqASR3D6fWYQX37GBuAzRE1Fmu5q6LjYtW9fljvetis30vV2ISRC8KA4OVU/s1600/CM+30.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You right click on the part in Octopart, and then the following editor is available.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-VuD7MqSj-JICvHnvZeNR5QJr92NvRoyYFAGJL7bYqDpF8GLdEu1N-AlkEv5OQBiAJHcnlPmRvTuiA2lKlKxMSi_H5rGTyZVt4z199RZYVI29dJrRiqXUAYB6AbcFz7Jk2fmhyphenhyphenMvVnjfk/s1600/CM+14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-VuD7MqSj-JICvHnvZeNR5QJr92NvRoyYFAGJL7bYqDpF8GLdEu1N-AlkEv5OQBiAJHcnlPmRvTuiA2lKlKxMSi_H5rGTyZVt4z199RZYVI29dJrRiqXUAYB6AbcFz7Jk2fmhyphenhyphenMvVnjfk/s1600/CM+14.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can then select 'Add New Symbol' or Add New Footprint' and familiar editors to those used in Altium open. I simply reused one of the canned schematic symbols.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1tFWYsQWjrAWhY0QIwHr2tYaJt9UHgG3B2e7tXKSlZZpb2dqrEneW1gvcdmgTAEjKA5BF-bxhlRGoGUtrA6T9qL-4nRfF5zoQ7uUhsfctFM073PPokKj-s6M_nleT11ovtsvWMAsEuq6r/s1600/CM+31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1tFWYsQWjrAWhY0QIwHr2tYaJt9UHgG3B2e7tXKSlZZpb2dqrEneW1gvcdmgTAEjKA5BF-bxhlRGoGUtrA6T9qL-4nRfF5zoQ7uUhsfctFM073PPokKj-s6M_nleT11ovtsvWMAsEuq6r/s1600/CM+31.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For the footprint I built my own, and then I was able to place the part in my schematic (after committing to Octopart). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE79ijKJrVgqSerVioQWOhJ4QIjh9z3QisQwyJ5fSElYGy3HOc0jfu8ie7ZjUyxJn_FDpLi6YnJGir0MlJQsWVv_Ru24YyGNwXY5Y7OESdQw9O3h-3nT9IWt8g5Xgi20N3D1I_GdsIVxAU/s1600/CM+16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE79ijKJrVgqSerVioQWOhJ4QIjh9z3QisQwyJ5fSElYGy3HOc0jfu8ie7ZjUyxJn_FDpLi6YnJGir0MlJQsWVv_Ru24YyGNwXY5Y7OESdQw9O3h-3nT9IWt8g5Xgi20N3D1I_GdsIVxAU/s1600/CM+16.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You also end up with a very long winded part comment - but you can simply edit that out. Double click the part and the editor dialogue pops up.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQqjegYdl0JscU7tW-CslsQ4VTJgLWMVPhgog_JYrE7-u8qANl6C6TAi7s6X3IcFOllOPZWw0xHEdeY0o18kSxr8agvroCOzIN3B-9WmXujbQI5UxJ7UNdHTmuGd5HfFfBq2evyN-5R7w/s1600/CM+19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQqjegYdl0JscU7tW-CslsQ4VTJgLWMVPhgog_JYrE7-u8qANl6C6TAi7s6X3IcFOllOPZWw0xHEdeY0o18kSxr8agvroCOzIN3B-9WmXujbQI5UxJ7UNdHTmuGd5HfFfBq2evyN-5R7w/s1600/CM+19.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As this is really just my first impressions, I ddin't have a real project in mind. So to get to a PCB test I just added some LEDs (complete from Octopart with Schematic Symbol and PCB Footprint) and whipped this little circuit up. Net labels, ports, power ports are all there and easily found in the Ribbon menu. Yes I could whine that the keyboard shortcuts from Altium aren't there, but thinking like a new user, the Ribbon is well laid out and you can easily find what you want to do next.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxe9rDiIrAWeGltHA1BtIXQrke9-c1Rv_sdwQvPFkQQfxGQvIJs-ORnmAD9Ma7-lAuhrtIzYwUshUDSbRK2CZJavinSrrszwWftjOM2sf_VAuL2lkuIKgE_M37ATBk4nb7_Or1zXOLr5YP/s1600/CM+22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxe9rDiIrAWeGltHA1BtIXQrke9-c1Rv_sdwQvPFkQQfxGQvIJs-ORnmAD9Ma7-lAuhrtIzYwUshUDSbRK2CZJavinSrrszwWftjOM2sf_VAuL2lkuIKgE_M37ATBk4nb7_Or1zXOLr5YP/s1600/CM+22.png" width="320" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To get to PCB, you add a file, then from the Project command in the Ribbon, you import changes and your parts are there with net lists and the like. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Ov_wfsrbvzc-XEveEDNLLorKsRjMiIO6H6W9-s7xCc3AEzhLOVPBXza89QMidNi2yh-OeLDjcxmcSg4Ijllmv3GMtgP5I0jEhZ5CWDUD92DbyHvMPWEjc3A92uxCMcpCOCXFy1AmOikB/s1600/CM+20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Ov_wfsrbvzc-XEveEDNLLorKsRjMiIO6H6W9-s7xCc3AEzhLOVPBXza89QMidNi2yh-OeLDjcxmcSg4Ijllmv3GMtgP5I0jEhZ5CWDUD92DbyHvMPWEjc3A92uxCMcpCOCXFy1AmOikB/s1600/CM+20.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The routing tools are easy to use and rely on the use of right click menus. This is one personal gripe and I prefer to use a scratchpad on a laptop, and hotkeys are your friend here. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-eNUfRhrbUmjCe7LOHcfkAGze0DjYgzaVHIB_xszRpHpwR4HLEt2WYVyskEO9d1RCfh1638QxzQ89L67AipVeju_sBkp6aZHGz2BQGWwpLc8H-1NqtLCrlo86EOihJyspYFY-Aly9Dq9q/s1600/CM+21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-eNUfRhrbUmjCe7LOHcfkAGze0DjYgzaVHIB_xszRpHpwR4HLEt2WYVyskEO9d1RCfh1638QxzQ89L67AipVeju_sBkp6aZHGz2BQGWwpLc8H-1NqtLCrlo86EOihJyspYFY-Aly9Dq9q/s1600/CM+21.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Two minutes later, I had this. The 'l' keystroke still swaps the part from top to bottom layer, '*' toggles between top and bottom traces, so that helps. You even have good polygon pour tools and some really powerful tools that I'd not expect in a free CAD tool are there (such as Net Classes ability to colour individual nets). So that's good.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But - and you knew there were some buts coming - it's far from perfect.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Schematic Hell</h3>
<div class="separator" style="clear: both; text-align: left;">
If you drag a part in the schematic editor, it drags the wires with it. OMFG NO!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNMFswLoDEQJ5qrqE-5vC0g9G1wI571qiYTZpZ-CVrU-WBinZhsFl29YO5s6yf_LeDOWYrRbC6ZLYylxm99P9Lp8BTI5XMccTUZGC9O9Ppy9KMgq9bS3LDjJxakiN_ioVIVA3Fb9Nsx_og/s1600/CM+23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNMFswLoDEQJ5qrqE-5vC0g9G1wI571qiYTZpZ-CVrU-WBinZhsFl29YO5s6yf_LeDOWYrRbC6ZLYylxm99P9Lp8BTI5XMccTUZGC9O9Ppy9KMgq9bS3LDjJxakiN_ioVIVA3Fb9Nsx_og/s1600/CM+23.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I moved two parts, caused a bunch of shorts and screwed up my schematic. THIS IS A VERY BAD THING. If you hold control while dragging a part, the traces get left behind. I really wish that this could be set to be vice-versa, or disabled all together.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Some other things I think Altium should address:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>You cannot import DXF or other cad files into the PCB. This is something I do all the time in Altium to help define my board shapes. But you can't even define a board shape from selected objects. This is aggravating!</li>
<li>In comparison, you can define a polygon pour from selected objects. WHY YOU MAKE BOARD SHAPE SO HARD?</li>
<li>You can't open Altium files in Circuit Maker. Okay, they need to protect their high end tool, and I believe that Altium can open Circuit Maker files. Fair cop, but it kills my plans to share my existing designs done in Altium in Circuit Maker. This could help Altium rapidly grow their community (maybe they could limit imports to match your licence options?)</li>
<li>Zoom hotkeys. I miss ZA (zoom - all) </li>
</ul>
<div>
One plus I didn't mention above is that Circuit Maker also allows the use of hierarchical schematic sheets (yay) but all the Altium 'room' features aren't there. </div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both;">
Closing Thoughts?</h2>
<div>
Are Altium onto a winner? At the moment I say no.</div>
<div>
<br /></div>
<div>
My internet access can be temperamental at time, and the loading from the cloud, and Octopart searches just take too long. Local files would be great. </div>
<div>
<br /></div>
<div>
A paid option to allow local libraries (and files!) would go a long way remedying this.</div>
<div>
<br /></div>
<div>
Aside from that, it's a slick interface, it's doesn't crash randomly, copy - paste just works (looking at you KiCAD!).</div>
<div>
<br /></div>
<div>
But the real deal breaker? You must have an Octopart part to use - things that you need on a PCB that are not parts include Fiducials, Edge Connectors, Programming Headers, Custom RF coils, mounting and tooling holes are things you cannot make in Circuit Maker. </div>
<div>
<br /></div>
<div>
Sadly, that's a deal breaker for me.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-16147893014626412132015-02-17T18:13:00.001-08:002015-02-17T18:13:51.211-08:002015<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfyBshQto2z7uDkNd0eIHk5jR6-GqxnMoWBW9sQGdOsOUXlpTtxE6rPI5WQoy0SUdgREGZo67SC7lnlOG-MGM0Ald8Ph6tRVDrbFC2D-APIHehWD8ZCvsR1kPYkzt4ajocZKZpOaFP5oE7/s1600/tweet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfyBshQto2z7uDkNd0eIHk5jR6-GqxnMoWBW9sQGdOsOUXlpTtxE6rPI5WQoy0SUdgREGZo67SC7lnlOG-MGM0Ald8Ph6tRVDrbFC2D-APIHehWD8ZCvsR1kPYkzt4ajocZKZpOaFP5oE7/s1600/tweet.png" height="113" width="640" /></a></div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-23680617528504597062015-01-22T05:08:00.001-08:002015-01-22T05:09:10.964-08:00PSU Console<h2 style="clear: both; text-align: left;">
Dead Simple Power Supply</h2>
<div>
At work I'm quite spoilt, there is an abundance of equipment in the labs, and if I need, I can borrow something for home use. Very handy when ding something specific (like the thermocouple I used <a href="http://ludzinc.blogspot.com.au/2015/01/soldering-station-conversion.html">here</a>) but it comes with a down side.</div>
<div>
<br /></div>
<div>
If I realise I need something, it means dropping work for a few days until I can borrow the equipment (if it's in use at work, I can't have it until it's free) and as I catch the train, it also means bringing the car in if it's too big to fit in my backpack.</div>
<div>
<br /></div>
<div>
When it came to powering my projects, I have a very basic dual rail Power Supply (I built one just like in in Uni, tortured it to death over the coming years by running a car amp from it in my bedroom) that I inherited from a guy-who-got-it-from-a-guy-from-a-garage-sale deal.</div>
<div>
<br /></div>
<div>
The updside: It's got dual isolated rails, 1.25V to 15V range and 'up to' 1A output. </div>
<div>
<br /></div>
<div>
The downside: It's so old the pots are scratchy, so setting an output voltage is a chore, and there isn't any current limit. And you need to whip out your multimeter to set the voltage / measure the current in use.</div>
<div>
<br /></div>
<div>
So I got cracking on this:</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Cu5OIoWynBs2KjUTBDJWd6OgmeNtGB39-WE63lebs-yrZ-jMQlOOO0d-t4rYZEjOHB9l1VX-eQEyX71HDeyAcfcyVjjzoDFJkrfFbPa1amqaXmJfpUwnFhGm85cwohrworW6RutQeFNo/s1600/IMG_3227.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Cu5OIoWynBs2KjUTBDJWd6OgmeNtGB39-WE63lebs-yrZ-jMQlOOO0d-t4rYZEjOHB9l1VX-eQEyX71HDeyAcfcyVjjzoDFJkrfFbPa1amqaXmJfpUwnFhGm85cwohrworW6RutQeFNo/s1600/IMG_3227.JPG" height="239" width="320" /></a></div>
<div>
</div>
<div>
<br />
<a name='more'></a><br /></div>
<h2>
Time For Improvement</h2>
<div>
Although it seems completely unrelated, I stumbled across some LM2596 switch mode modules on eBay, along with some really cheap panel volt meters.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwvit7ErqIWUVzrSP8Y9AQQ5hrsrDaWzUWU4MCX5oVT0GTDERYMfGhft4A8FgpLJpJUyWvNkpwT-yHN3dTNvTLCZg6NZ7w79Vp1qapnbxUM6tLkvQk22856MratWtFAPrZcx1OUgjWeeVL/s1600/switcher.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwvit7ErqIWUVzrSP8Y9AQQ5hrsrDaWzUWU4MCX5oVT0GTDERYMfGhft4A8FgpLJpJUyWvNkpwT-yHN3dTNvTLCZg6NZ7w79Vp1qapnbxUM6tLkvQk22856MratWtFAPrZcx1OUgjWeeVL/s1600/switcher.jpg" height="320" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
These switchers aren't the most efficient, and I really doubt their longevity at full current, but you just can't buy the parts for what these modules cost, delivered.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnmZ26qMhazAi_9vBoT8vEBVB37WRecUpPBX4iOMSKJCh5LdQIU91Il5zmPKG5bggbKZGW3LKzIqo5617nRogtUaqX-tZF2j-x3wpto6xkNZpTshkGq1tKxLVUAkibv6L7yqXBGuV1G2Vy/s1600/volt+meter.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnmZ26qMhazAi_9vBoT8vEBVB37WRecUpPBX4iOMSKJCh5LdQIU91Il5zmPKG5bggbKZGW3LKzIqo5617nRogtUaqX-tZF2j-x3wpto6xkNZpTshkGq1tKxLVUAkibv6L7yqXBGuV1G2Vy/s1600/volt+meter.JPG" height="303" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The same can be said for these volt meters, and they come in a full range of colours with a really neat clip in bezel, that makes mounting so simple.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And of course, that got me thinking, that I've got the genesis for a add on mod to my (or any) power supply - external voltage regulation and display.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
But Wait, There's More</h3>
<div>
If I was going to build a power supply display add on, I decided to add some current limiting to it as well - but it had to be simple, cheap, and work with the panel meters. Yes you can get similar Ammeters on eBay they are more suited to the 10A range, where I want to measure 10's to 100's of milliamps.</div>
<div>
<br /></div>
<div>
And seeing as I'm designing something, I thought I'd also add a feature that a lot of current limited (at least at the low end) miss - a method of adjusting the current limit *WITHOUT* having to short your rails. </div>
<div>
<br /></div>
<h2>
The Starting Point</h2>
<div>
As I have access to a PCB mill, the goal here was a though hole, single layer design that I could punch out one lunch time. Also, I was aware of pitfalls with conventional op-amps (such as headroom limits - i.e. your standard jellybean op-amp cannot swing it's output to the rails) and that a lot of Rail to Rail op-amps tend to have narrow (i.e. 5V) supply limits.</div>
<div>
<br /></div>
<div>
However, I had been fortunate to have some <a href="http://www.ti.com/lit/ds/symlink/lm6132.pdf">LM6134</a> samples from TI to hand, and these beauties are a lot closer to an ideal op-amp than others, I was able to punch out this following simple circuit:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhljOILjswB6AC2rNGCfSydLtCydm_uUKF_55Vgr9gt_Xlt05II3egD12DdfywWriz49_zYpCUxPg33jDk9DWPduwkAX3XO0oYwoDbMe5ZPAHgx_QxhktBnQVvRo4N_oPW9iyM0IkDg6gi3/s1600/psu+circuit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhljOILjswB6AC2rNGCfSydLtCydm_uUKF_55Vgr9gt_Xlt05II3egD12DdfywWriz49_zYpCUxPg33jDk9DWPduwkAX3XO0oYwoDbMe5ZPAHgx_QxhktBnQVvRo4N_oPW9iyM0IkDg6gi3/s1600/psu+circuit.png" height="208" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Current Limiting and Display</h3>
<div class="separator" style="clear: both; text-align: left;">
The first part of this circuit is the current limiter. Similar to my <a href="http://ludzinc.blogspot.com.au/2014/12/improved-current-load.html">low side constant current</a> load, I'd decided on a high side current limiter.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As I look the reference voltage from the output of the LM2596 module, I decided to use a LED as a poor man's voltage reference. I should have used the V+ rail, but I was punching this out in my lunch break, so, errors happen. If you see any in this post please feel free to comment!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Anyway, this voltage is buffered and sent to a pot, that I use to set a reference voltage for the MOSFET limiter. As it's a high side limiter, the trick is that the output current is a function of how far below the rail this set point is. As my current shunt is a 1 ohm resistor (from the ten 10 ohm resistors in parallel) there is also a direct 1:1 ration between current limit and voltage sense. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In short, if I set the node labelled SET to 500mV below the VREG rail, the MOSFET will limit the current to 500mA. Too easy.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
S1 is then used to select the SET or SENSE voltage on the OPAMP - then that voltage is buffered by U1A, and then summed in U1B, with the rail. U1B has a non inverting gain of 2, with an inverting gain of 1, and mashing these together, the output of U1B (IMEASURE) is the absolute value of the difference between the VREG rail and SET / SENSE voltage.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So if VREG were 10V, and I had dialed in a 500mA limit, SET would measure at 9.5V and the output of U1B will be 500mA. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
All made possible with the LM6134 being so close to an ideal opamp. This circuit won't even come close to working with an LM324!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="clear: both; text-align: left;">
Voltage Display</h3>
<div>
S2 is used to switch off the voltage output, and the panel meters are just wired in parallel to the output. When in current limit, you will see the voltage fall (as expected) and when S2 is OFF the display reads 0V. </div>
<div>
<br /></div>
<div>
The voltage is set using the LM2596 module, with it's on board trimmer removed and replaced with an external Pot.</div>
<div>
<br /></div>
<div>
That last point was a brain fart on my behalf. I cannot set my output voltage without turning S2 on. If I ever get around to a V3 of this I'll display the voltage before S2 and use an LED to indicate if the voltage output is on or not.</div>
<div>
<br /></div>
<div>
V3? Yeah, my first cut had a few issues....</div>
<div>
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRQ7fAP8Z5VsJ3H7DUQe4V3966t2X7HrOS5dUIWcaCeGNHkFT1Y3pLKJYKJ4M4l7j97O_Xk52XVOoxZ5NhaCz0dRRg2v0jSR_Bbl5PG712D9ExffNaNRAtze7_gYILvtVQrJNDrrkwAOB/s1600/IMG_3046.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRQ7fAP8Z5VsJ3H7DUQe4V3966t2X7HrOS5dUIWcaCeGNHkFT1Y3pLKJYKJ4M4l7j97O_Xk52XVOoxZ5NhaCz0dRRg2v0jSR_Bbl5PG712D9ExffNaNRAtze7_gYILvtVQrJNDrrkwAOB/s1600/IMG_3046.JPG" height="239" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWlNcdBabcDYJ9PVCSS_U-XeSd1uknLQxIWUfrgS71pqWItLB-HtaH2C5PGE4Q9zaOW1Dau8c1SiLLYR9aEcQH7h42gCwowpyA9KMLvW7cuLET-X1nAcW3TxLskGV4907u0E7Nd3-iKo07/s1600/IMG_3037.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWlNcdBabcDYJ9PVCSS_U-XeSd1uknLQxIWUfrgS71pqWItLB-HtaH2C5PGE4Q9zaOW1Dau8c1SiLLYR9aEcQH7h42gCwowpyA9KMLvW7cuLET-X1nAcW3TxLskGV4907u0E7Nd3-iKo07/s1600/IMG_3037.JPG" height="239" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
I used an Hammond hobby case for my board, with non symmetrical mounting holes. You guessed it, I got them wrong and the board didn't fit into the case. Which I discovered after assembling it.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Also I used some 1 ohm wire wound resistors for the current sense element (not shown in the above picture), and these being 10% tolerance parts just lead to a crap reading. 10% is just too coarse for this, and switching to an array of 1% resistors was well worth the effort. So yeah, this board is V2. </div>
<div style="text-align: left;">
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjSXPxvTAlr3Q-4Sy03kY5nPH98SGpqe6Gg8eOfgl2iQqk1OlA6AniG2ngr17ASNf1MrZVHrXV76zLW6iN5D3uZgQb4f4IN2FTslGuUK6DdfZKwL_JMDgtRv7yWaM5w0qOGCPTpIsbeduw/s1600/IMG_3039.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjSXPxvTAlr3Q-4Sy03kY5nPH98SGpqe6Gg8eOfgl2iQqk1OlA6AniG2ngr17ASNf1MrZVHrXV76zLW6iN5D3uZgQb4f4IN2FTslGuUK6DdfZKwL_JMDgtRv7yWaM5w0qOGCPTpIsbeduw/s1600/IMG_3039.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The front panel did fit, however.</div>
<div style="text-align: center;">
<br /></div>
<h2 style="text-align: left;">
Getting Funky</h2>
<div style="text-align: left;">
I've always had a preference for art-deco style on things, and I thought I'd flex my (tiny) artistic side and produce something that might pass for 'stylish' as opposed to purely functional!</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T0w5c4H9s7zRB6Q0UIU6fM6RFR0c00ATFLcif_YFdJIi_cPpvRr1RAWRoG_BZA2OgTIwjr-wFgINiYyndu8aikF335qa_iXGxi80qlyYnt5_KO9Y8OCtry_PfXihxPLwWWxkE82INf31/s1600/psu+panel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T0w5c4H9s7zRB6Q0UIU6fM6RFR0c00ATFLcif_YFdJIi_cPpvRr1RAWRoG_BZA2OgTIwjr-wFgINiYyndu8aikF335qa_iXGxi80qlyYnt5_KO9Y8OCtry_PfXihxPLwWWxkE82INf31/s1600/psu+panel.png" height="194" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From this I milled and dummy assembled this!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPods8F1hkfPhmh6PEWTkerUNY44jOcGEdYi7QaEGOG2TaxbVsmvmNR_UK0-oS0g5GHJr4K4vfJrlO-3kNshG8Y1Vuak-zcMtDR8AizOSR5jTCu7yaMZE55PlneDEyub981BHNuqLGfBAe/s1600/IMG_3038.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPods8F1hkfPhmh6PEWTkerUNY44jOcGEdYi7QaEGOG2TaxbVsmvmNR_UK0-oS0g5GHJr4K4vfJrlO-3kNshG8Y1Vuak-zcMtDR8AizOSR5jTCu7yaMZE55PlneDEyub981BHNuqLGfBAe/s1600/IMG_3038.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The panel was going to call for a lot of point to point wiring. If I was smart, I'd design a board for the panel gear to mount on, but I'm not smart.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Hd07bRAb1pPFjACM4nOOz4eifn12Ay_mR59wqUHneANBGoPvVqDaEvuJIgDjnAPPXmikjLiL-LfCgWaD9M_26xXjeOC4kQaVER7MyDgsTKpJnDcjDwUmAELe0EZM9q2A9DVsKboDB-uD/s1600/IMG_3040.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Hd07bRAb1pPFjACM4nOOz4eifn12Ay_mR59wqUHneANBGoPvVqDaEvuJIgDjnAPPXmikjLiL-LfCgWaD9M_26xXjeOC4kQaVER7MyDgsTKpJnDcjDwUmAELe0EZM9q2A9DVsKboDB-uD/s1600/IMG_3040.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After a bit of trail fitment, I had to light it up. In my opinion, it was looking good!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Tjgf9MwxvnOH36jGZR65-Z61EzrAIZrIarGQKw7A-ELDjq13golF-1xPJxxZk2GBlgfMx1CnKpUuraeo0ARMWMlnzGPx9ZZKpUVOycmzU4IYsjlt5wgKCh08MkcoCX85pZCURf9XQQY6/s1600/IMG_3042.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Tjgf9MwxvnOH36jGZR65-Z61EzrAIZrIarGQKw7A-ELDjq13golF-1xPJxxZk2GBlgfMx1CnKpUuraeo0ARMWMlnzGPx9ZZKpUVOycmzU4IYsjlt5wgKCh08MkcoCX85pZCURf9XQQY6/s1600/IMG_3042.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The top half of the panel is the Volt meter / switch / pot, the bottom half Current meter / switch / pot.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6eayy1YRAFudbghzEfCPvFSHKQelkjE1utekw5glCUMfKci2FOImMHSTL3iuAPxdrVlH-rhJLDnrBZFcNpaBju0FLwLpqU_gaotJGMWV7GMOaGZTXBGpNtQyhxS2GALVgIheOmNuln5uN/s1600/IMG_3044.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6eayy1YRAFudbghzEfCPvFSHKQelkjE1utekw5glCUMfKci2FOImMHSTL3iuAPxdrVlH-rhJLDnrBZFcNpaBju0FLwLpqU_gaotJGMWV7GMOaGZTXBGpNtQyhxS2GALVgIheOmNuln5uN/s1600/IMG_3044.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To make the point to point wiring more manageable, I tried using ribbon cable. This was a mistake and this stuff is a bastard to work with - the insulation melts very easily, the fine conductors break easily and you give up using it like this, easily!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
At this point I also felt that the panel was a bit boring still. </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRMKT_xCxrKnRJ9Z8xwXRqEYbSK3wyeHqkqntZ2E4-K7Hk9cxtz6rbb_JEEihql6KVBRfbTkg2SStlG6EG0JxPXe554kqt7uSrMCgVU1l_GUYVuki6onIYS5JYi1HJ_OL2KFC6MOPUMegZ/s1600/IMG_3215.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRMKT_xCxrKnRJ9Z8xwXRqEYbSK3wyeHqkqntZ2E4-K7Hk9cxtz6rbb_JEEihql6KVBRfbTkg2SStlG6EG0JxPXe554kqt7uSrMCgVU1l_GUYVuki6onIYS5JYi1HJ_OL2KFC6MOPUMegZ/s1600/IMG_3215.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I decided to try rubbing some colour into the milled lines. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCeoEAZAMojkVAEKYTqDiDeMR8Ab7vE4kpXOZ_Zg_7q70vqQwerscTroz020eGSG_c9SUdnPCjHv-BphjAsyqe8zbuWawFbUwWv38oFuaDZ57KnRSmhMisGXL_5iklYRS4WW1B5qkjuJLD/s1600/IMG_3216.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCeoEAZAMojkVAEKYTqDiDeMR8Ab7vE4kpXOZ_Zg_7q70vqQwerscTroz020eGSG_c9SUdnPCjHv-BphjAsyqe8zbuWawFbUwWv38oFuaDZ57KnRSmhMisGXL_5iklYRS4WW1B5qkjuJLD/s1600/IMG_3216.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I simply grabbed some white board markers, scribbled over the panel and wiped off the excess.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia9dac2SCIzMSHpPyOLZ-CqWdaJiHcoFGcR-zvb_Au9D2COUqM4FAzweA2F5I2ZnqXeHfl_S6EGDGUKN5ADmp6D0aiIHhrPmu8_hizO5xvuy0-TXRkNYKo-2vGGoiV_4vSQ_EMUOV7eRY3/s1600/IMG_3220.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia9dac2SCIzMSHpPyOLZ-CqWdaJiHcoFGcR-zvb_Au9D2COUqM4FAzweA2F5I2ZnqXeHfl_S6EGDGUKN5ADmp6D0aiIHhrPmu8_hizO5xvuy0-TXRkNYKo-2vGGoiV_4vSQ_EMUOV7eRY3/s1600/IMG_3220.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The blue stood out well, but not so much the red.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib57gIqsAhpw-9kL31ZOuU6XXTlgoGsXm0iDQoadOpbJK7-P9-RZQVfJE6W6NDKUDheRo6fUU25Y7oxIJ8BjHz_9tdIoiHQH6vTDDX25O4e6AVKog14qNwUwyoF5W06cOtldD4zdACBp0E/s1600/IMG_3221.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib57gIqsAhpw-9kL31ZOuU6XXTlgoGsXm0iDQoadOpbJK7-P9-RZQVfJE6W6NDKUDheRo6fUU25Y7oxIJ8BjHz_9tdIoiHQH6vTDDX25O4e6AVKog14qNwUwyoF5W06cOtldD4zdACBp0E/s1600/IMG_3221.JPG" height="239" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoybCMC-insjsQ5OXtnIUZGOLZtOWGHVw3WUIRRIhtdDIzegFfYZV2Fi0z-G4EXgwRELckjsD43MqdRj1jn80iu3kDNBfu9Ay5JB66eNQOdQPssZVsSxjedTMeSts95Z-IHqilOVp0QFa0/s1600/IMG_3222.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoybCMC-insjsQ5OXtnIUZGOLZtOWGHVw3WUIRRIhtdDIzegFfYZV2Fi0z-G4EXgwRELckjsD43MqdRj1jn80iu3kDNBfu9Ay5JB66eNQOdQPssZVsSxjedTMeSts95Z-IHqilOVp0QFa0/s1600/IMG_3222.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So blue for all it was then!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg38qOjQ9Vs9vaUUmd2TtPk7fcRwKNkCadvMAiYXkjq7T3yTsSIpeDKGldtQo0VrjPj67_NtbA8QRAROPn8PVQRqq4VpsiDKmlz-AELSCKyy1CYqDc5TpROADN97-n401w23UfXpYBQ8WGs/s1600/IMG_3223.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg38qOjQ9Vs9vaUUmd2TtPk7fcRwKNkCadvMAiYXkjq7T3yTsSIpeDKGldtQo0VrjPj67_NtbA8QRAROPn8PVQRqq4VpsiDKmlz-AELSCKyy1CYqDc5TpROADN97-n401w23UfXpYBQ8WGs/s1600/IMG_3223.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My second wiring attempt was conducted with stranded cable.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGZ-8Y5dPH1xCFCUYMW_lDIYKyFBk9r6zexosaCQJhGxQIRmhgCxQZwdpaerSatrAVsYfE7486RnL0Qek7gv1TKz3nI7VkOWLhMJpjUSduYSLXqmrHYY-mFUG0ajkdrMt9wrJ-pAIIFALN/s1600/IMG_3224.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGZ-8Y5dPH1xCFCUYMW_lDIYKyFBk9r6zexosaCQJhGxQIRmhgCxQZwdpaerSatrAVsYfE7486RnL0Qek7gv1TKz3nI7VkOWLhMJpjUSduYSLXqmrHYY-mFUG0ajkdrMt9wrJ-pAIIFALN/s1600/IMG_3224.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Which ended up pretty neat when lashed into a harness.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCw9eHyZZmp6N7g9Owim-Nm-5aZ5NZ0KDIkssY64HWIJtD-CJQ6KnyUdH09f9wz11TtTWXmCEWkWBTDaudlncF3rVQW1eYIJYvFbiRQH5MrxwGHreXt1W2YKkl9iXO40BB4F97lAw_e8t_/s1600/IMG_3225.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCw9eHyZZmp6N7g9Owim-Nm-5aZ5NZ0KDIkssY64HWIJtD-CJQ6KnyUdH09f9wz11TtTWXmCEWkWBTDaudlncF3rVQW1eYIJYvFbiRQH5MrxwGHreXt1W2YKkl9iXO40BB4F97lAw_e8t_/s1600/IMG_3225.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The lid went on the box, with Banana Sockets for the input and output voltage fitted.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikVnFb1s226_PVUwvdBXwXsexQoKnJ2iuCE68vKJ8AP4fsxVEckY1q3XlS6BRigWikQhN3fIy8Am7I_l1roulTEnfnrHE1UlITMpKxayOAAsd6VBVR70vXPA0ixw0DiyPLFvAvQuNg-p3F/s1600/IMG_3226.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikVnFb1s226_PVUwvdBXwXsexQoKnJ2iuCE68vKJ8AP4fsxVEckY1q3XlS6BRigWikQhN3fIy8Am7I_l1roulTEnfnrHE1UlITMpKxayOAAsd6VBVR70vXPA0ixw0DiyPLFvAvQuNg-p3F/s1600/IMG_3226.JPG" height="239" width="320" /></a></div>
<br />
<h2 style="clear: both; text-align: left;">
In Use!</h2>
<div>
Once finished, it was time to put the panel to work!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3kTbtxsZ1SgXDH-Ug4NbSTU2JaQ42GF2NWrWSxCrBtilKJHSCdxxGupcFR99Tv7PAIoJp5Fw8gfJgn_OKY8PGUHJRhYcaKYdWF8Q3bQEXjZ_1RMnG3sGqqH4SL3jtiQ37fhf3omjK5CE5/s1600/IMG_3228.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3kTbtxsZ1SgXDH-Ug4NbSTU2JaQ42GF2NWrWSxCrBtilKJHSCdxxGupcFR99Tv7PAIoJp5Fw8gfJgn_OKY8PGUHJRhYcaKYdWF8Q3bQEXjZ_1RMnG3sGqqH4SL3jtiQ37fhf3omjK5CE5/s1600/IMG_3228.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Apologies for the blurry photos, the blue isn't as bright in real life. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0gXGvJpmesdh5Siec0RO7Z7hT084S71yCJVuyibOKsfGC1itJF4i2syDv1ECRWTG0d2dn81CI-S9z5tn_mPw3nK7IKcTxZSULEVtrFPaKwKzv18muLrdYk72EzDyRhCsgA25nen7i8P7U/s1600/IMG_3230.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0gXGvJpmesdh5Siec0RO7Z7hT084S71yCJVuyibOKsfGC1itJF4i2syDv1ECRWTG0d2dn81CI-S9z5tn_mPw3nK7IKcTxZSULEVtrFPaKwKzv18muLrdYk72EzDyRhCsgA25nen7i8P7U/s1600/IMG_3230.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When in current limit, my panel agreed with my $2 ammeter to within 20mA. You tell me which one is more accurate! However, for my use this is fine. Remember the goal was to set current limits that will not destroy the project I'm developing, not give me laboratory spec readings.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlpBCQLPw9UNRM_XS2snvCK0Knbb6mGRDebH0k1d98aFkTcAHMx-OYStheYl4aC9Kod0Tp00piuMFDYniYhmtoW_HSNHLI8kmePyzbIGV8JX-R333vawt6R2amuZ-3mNycDtGEgUOk1daY/s1600/IMG_3233.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlpBCQLPw9UNRM_XS2snvCK0Knbb6mGRDebH0k1d98aFkTcAHMx-OYStheYl4aC9Kod0Tp00piuMFDYniYhmtoW_HSNHLI8kmePyzbIGV8JX-R333vawt6R2amuZ-3mNycDtGEgUOk1daY/s1600/IMG_3233.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And for a glory shot, here's a LED string being lit up. WIN!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you're interested Altium files are <a href="https://sites.google.com/site/ludzincdownloads/bench-psu/Bench%20PSU%20Hack%20.zip?attredirects=0&d=1">here</a>.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com4tag:blogger.com,1999:blog-2685787041614376103.post-42506893425555550882015-01-14T22:17:00.002-08:002015-01-14T22:18:18.681-08:00How to (Cheaply!) Repair Your TV Remote Control<h2>
Cheap and Cheerful!</h2>
The other day I scored a TV to fix. It also came with a remote that needed some attention. The volume buttons didn't work nor did 'Channel Down'.<br />
<br />
This is usually due to the conductive pads on the rubber membrane wearing out. You can buy conductive paint to rejuvenate the buttons, but that stuff isn't cheap, and probably isn't lying around when you want to fix something RIGHT NOW.<br />
<br />
So I thought I'd share a little trick I know.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhECCYDndFBlVxBmjltmlSqr5FDTeN5ersrQmZmt-omV6r55KftvcOKvpRHU8IO3AQmojrOrqye3CDpwSqZ9kw6ztxHo199A01gU3wbn-9TAnddWyYJouvTdfkMGzTuXgyMtO1XRnUBryfh/s1600/IMG_3522.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: left;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhECCYDndFBlVxBmjltmlSqr5FDTeN5ersrQmZmt-omV6r55KftvcOKvpRHU8IO3AQmojrOrqye3CDpwSqZ9kw6ztxHo199A01gU3wbn-9TAnddWyYJouvTdfkMGzTuXgyMtO1XRnUBryfh/s1600/IMG_3522.JPG" height="238" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The Patient, Tools and Operation Table.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a><h3>
1. Raid the Cupboards.</h3>
<div>
Find some glue. Super / Krazy / Contact types work a treat. Anything for wood / paper will not suit.</div>
<br />
<br />
Find some aluminium foil, and a disposable pointy thing. I went with a kebab stick.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4y03bu7rk6EPCNkJ45t0PpoYA7QLwUr5PPbEQpSA7r9xNSClONztgDGoBC1IxZM9TljB9Q1HKMGWOPgwxtbXLUzbHMlBLgLj0qYQSedU7H192AoClHfO_tzI7PXLqdiKN_vbqu57M3x4k/s1600/IMG_3520.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4y03bu7rk6EPCNkJ45t0PpoYA7QLwUr5PPbEQpSA7r9xNSClONztgDGoBC1IxZM9TljB9Q1HKMGWOPgwxtbXLUzbHMlBLgLj0qYQSedU7H192AoClHfO_tzI7PXLqdiKN_vbqu57M3x4k/s1600/IMG_3520.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
2. Get It Apart!</h3>
<div class="separator" style="clear: both; text-align: left;">
Then pull the remote apart. Jumble the bits up if you like puzzles, or be careful and take notes / pictures of the disassembly order if you don't.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxCwp6cCyXe1cf64sjiR5b-he7mxoO64IgVBo3zFNFe88-vZKidB4EiijpvyrMVpFbsdBDZTomh_fbzx9pQCiXFxRX3pEEq-EEI5mpu2SxttYDOrMwFEOw1zvUGEeO5zpxV8zo2R0sBFo/s1600/IMG_3515.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxCwp6cCyXe1cf64sjiR5b-he7mxoO64IgVBo3zFNFe88-vZKidB4EiijpvyrMVpFbsdBDZTomh_fbzx9pQCiXFxRX3pEEq-EEI5mpu2SxttYDOrMwFEOw1zvUGEeO5zpxV8zo2R0sBFo/s1600/IMG_3515.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you remembered which buttons are faulty, find them on the back side of the membrane.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_AK3Pbi19VDIMJvzJ6DHtMgMEEA6DE_QCcWL5OhUiF9Zf3bXiXAfmsQh07RJV3hk0-kh9HfFXLdVLO4gOgTfA1pXkAB0A-Y2auNpF0WqXhbXf5kZktj-dyLPSG2hVOIW4_hkSRJoi1m1/s1600/IMG_3516.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_AK3Pbi19VDIMJvzJ6DHtMgMEEA6DE_QCcWL5OhUiF9Zf3bXiXAfmsQh07RJV3hk0-kh9HfFXLdVLO4gOgTfA1pXkAB0A-Y2auNpF0WqXhbXf5kZktj-dyLPSG2hVOIW4_hkSRJoi1m1/s1600/IMG_3516.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Well, there's your problem!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
3. Glue It.</h3>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Carefully apply a dot of glue to the problem pad. I used contact adhesive which needs a short wait to go tacky. Apply with the pointy thing, otherwise it;s a mess on the fingers.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOkrOj3IYsRuSAGVF1tRfiPkZKL8uMOPJKnb2BDZKCpxw9eNtDVkhQ_iU7_Ej-QIVc5mhf1kZ7Iy-LDh65ebm9IcDisYruxRSy1erT2Cg5SWy_Xh0jJnO81b2HHSnIgmDoQ8ZyjmQz4QXp/s1600/IMG_3518.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOkrOj3IYsRuSAGVF1tRfiPkZKL8uMOPJKnb2BDZKCpxw9eNtDVkhQ_iU7_Ej-QIVc5mhf1kZ7Iy-LDh65ebm9IcDisYruxRSy1erT2Cg5SWy_Xh0jJnO81b2HHSnIgmDoQ8ZyjmQz4QXp/s1600/IMG_3518.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
While waiting for the glue to go tacky, I cut 4 small rectangles of the Aluminium Foil. Then drop on the pads, and mould any overhang around the buttons. Or trim them with a sharp knife if you are a neat freak.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq4Dze9cChVhzIdCvBMi5IxRx3TFFl-r-7tRyglwAm4F2S85cUEJTAdTACyGTGiVIX2WqjcvmrTJbXcm0F6MWemyQvGE0PG112uppLb0V1nBySHoetF-byssfrYQiOeekBbIhNPrxzKoO0/s1600/IMG_3517.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq4Dze9cChVhzIdCvBMi5IxRx3TFFl-r-7tRyglwAm4F2S85cUEJTAdTACyGTGiVIX2WqjcvmrTJbXcm0F6MWemyQvGE0PG112uppLb0V1nBySHoetF-byssfrYQiOeekBbIhNPrxzKoO0/s1600/IMG_3517.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
4. Reassemble</h3>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Reassembly is achieved by following your notes / photos in reverse order, or by solving the 3D puzzle of what your wife thinks is the ruined remote control.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjio7fbOLguj7ZWlzN3nftVsD78epLEM4A84mtnjaXf-Pw3L6vRx89eAqTVshMje0V2m0y3QngAZrb7EuAl9uJIi3cdLLBMRj7ZFg7nO2v1K_e34zee1tlh82B0LHjcE7Mr0wf4BXEWY5XX/s1600/IMG_3524.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjio7fbOLguj7ZWlzN3nftVsD78epLEM4A84mtnjaXf-Pw3L6vRx89eAqTVshMje0V2m0y3QngAZrb7EuAl9uJIi3cdLLBMRj7ZFg7nO2v1K_e34zee1tlh82B0LHjcE7Mr0wf4BXEWY5XX/s1600/IMG_3524.JPG" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
5. Test</h3>
<div class="separator" style="clear: both; text-align: left;">
Check if it works by giving it to the kids. If they stop complaining, it works!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Oh yeah, I sorted the TV out too. THE REMOTE WAS BROKEN!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com1tag:blogger.com,1999:blog-2685787041614376103.post-52609893581174497942015-01-11T18:31:00.001-08:002015-01-14T21:56:39.451-08:00MAY THE FORCE BE WITH YOU<h2 style="clear: both; text-align: left;">
New Component Types.</h2>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7F30y8qJcMGwtIO5CpkjREG_Hp_5ajHUQnin02icB7MTAJ18vwvTqmLp-yDhHLHOeb9CeCRWhlPYAh92nabL07oDca2Z8K0kXqBVKkuENG6x2TVZZwo2cmgEEFy4eKvTfj-SSu74Wz6xB/s1600/FETS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7F30y8qJcMGwtIO5CpkjREG_Hp_5ajHUQnin02icB7MTAJ18vwvTqmLp-yDhHLHOeb9CeCRWhlPYAh92nabL07oDca2Z8K0kXqBVKkuENG6x2TVZZwo2cmgEEFy4eKvTfj-SSu74Wz6xB/s1600/FETS.png" height="167" width="400" /></a></div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-20529516963809365182015-01-08T18:57:00.000-08:002015-01-14T21:49:47.728-08:00Soldering Station Conversion<h2>
Sentimental Issues</h2>
Back in my <a href="http://www.unisa.edu.au/">Uni</a> days, I bought what I thought was a pretty sweet soldering station - the Micron W/2172. If I remember right it cost about 4 weeks worth of part time wages, and I think it was worth it - it's lasted about 20 years so far.<br />
<br />
But, there are issues. I can't find a supply of new tips for it, and the last good tip is a conical one. So it was put away in the cupboard and I upgraded to a Hakko 396 station.<br />
<br />
Then I got to thinking... both stations used a 24V supply to heat their irons, so how hard would it be to graft a 907 handle into the Micron station? It would also be handy - I could load the Micron station with a big chisel tip for when you need a lot of thermal mass, standardise on one set of spares for both stations, and avoid having to swap tips on my Hakko all the time. WIN!<br />
<br />
<h2>
Will It Work?</h2>
<div>
There is a lot of information out there about the Hakko 907 handle, and this topic on the <a href="http://www.eevblog.com/forum/reviews/genuine-vs-fake-hakko-936-ceramic-heater-a1321/15/">EEVBlog forum</a> was exceptionally helpful. The important point to take away is that the 907 handle uses a thermistor to measure it's temperature.</div>
<div>
<br /></div>
<div>
If the Micron does the same, it should be a simple mod.</div>
<div>
<br /></div>
<h3>
Take it Apart!</h3>
<div>
So, I whipped to cover off and started to take a look.</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMFcwAKNZBtN4eYNCW2Dw_J_pzkoyeBlucOk8YNKWB9i4EmxddSIW8CY5p-Bjqj7zZIucuna37bkb0vwap3lovZ041gjox0WiIpy5RKf7qNgsw4KQ7-KWWFFH4BaKKnEme5sJ-sgzLohpU/s1600/IMG_3375.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMFcwAKNZBtN4eYNCW2Dw_J_pzkoyeBlucOk8YNKWB9i4EmxddSIW8CY5p-Bjqj7zZIucuna37bkb0vwap3lovZ041gjox0WiIpy5RKf7qNgsw4KQ7-KWWFFH4BaKKnEme5sJ-sgzLohpU/s1600/IMG_3375.JPG" height="239" width="320" /></a></div>
<a name='more'></a><br />
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
My first impression is that the unit seems to be well built, and that might explain why it's lasted so long. Of course just staring at the board won't tell me anything. I really should take a look at the handle.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWtOGp-K-WWq_r4iNID08ux-2Q_h4jry8IBVr00JZoKsmKfWokBJIRMpdkVsuhirkrPYvQ8p6jFkp_Uo0VlcYGaMOsrqrGjvYjvy8OtLXBWHMI5dKWf7GrGbpQvAI4WeHEnZBLj2O0HAuE/s1600/IMG_3376.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWtOGp-K-WWq_r4iNID08ux-2Q_h4jry8IBVr00JZoKsmKfWokBJIRMpdkVsuhirkrPYvQ8p6jFkp_Uo0VlcYGaMOsrqrGjvYjvy8OtLXBWHMI5dKWf7GrGbpQvAI4WeHEnZBLj2O0HAuE/s1600/IMG_3376.JPG" height="320" width="239" /></a></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Three screws later and the heater slid out of the handle.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg142IokvV1NFrTHR12VoAlRDtHdOPftkPkB1scVjLACWkf7Ff4fhZXucEZX_TWAN70GK9dGftWBGjvm4vZ79lEYNNA1wbkkzp7gmKJL7_XeeqpEZXr67nk6_DUw8Nr5QtAfy0oWBRueJiv/s1600/IMG_3379.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg142IokvV1NFrTHR12VoAlRDtHdOPftkPkB1scVjLACWkf7Ff4fhZXucEZX_TWAN70GK9dGftWBGjvm4vZ79lEYNNA1wbkkzp7gmKJL7_XeeqpEZXr67nk6_DUw8Nr5QtAfy0oWBRueJiv/s1600/IMG_3379.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Two wires for the heater, two for the temperature sensor, and an earth. Pretty standard affair, but I don't know which pair is the heater, which is the sensor...</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxqE67QLeXqp_QH3Nrgbp_RI6tfNPX00nL-eDTakU9JMKKje1m9FP9k46sURN4eJyAxmxZjeh-ZOCw4YFvBa22_W_pqy_8G3S3I_ZqUSkViCZVmq5q5y-PfIok8aBXixTnPOIuC9Spnm4w/s1600/IMG_3380.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxqE67QLeXqp_QH3Nrgbp_RI6tfNPX00nL-eDTakU9JMKKje1m9FP9k46sURN4eJyAxmxZjeh-ZOCw4YFvBa22_W_pqy_8G3S3I_ZqUSkViCZVmq5q5y-PfIok8aBXixTnPOIuC9Spnm4w/s1600/IMG_3380.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Flipping the board over, there was a pleasant surprise. Screw Terminals! This is a great idea - you can replace your heater with out needing working soldering iron.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
So, out with the multimeter and time to measure resistances. The red / white pair look like the heater pair (the connections on the PCB run off towards the MOSFET switch) and the multimeter shows a few ohms. That makes the yellow / brown pair the heater and .. that measures as a near dead short. Which is what a thermocouple looks like.<br />
<br />
Feck, it isn't going to 'just work'.<br />
<br />
<h2 style="clear: both; text-align: left;">
Challenge Accepted!</h2>
My initial thoughts were to modify the existing control PCB, and after an hour of tracing the circuit, a simpler approach dawned on me.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZFhruFcNH044mVIhzynEPB7elUsL23OVYnI4vBJ3VLlBloxVkx9mY4NJvGlQiIXHLMfWULa22aTRYZ_Tvt6rPerL_DmnwxtJIGjXEh3-gNSeC_44Uqvp-3QK-r5wIsN9N1XjHQKSDmIqv/s1600/IMG_3374.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZFhruFcNH044mVIhzynEPB7elUsL23OVYnI4vBJ3VLlBloxVkx9mY4NJvGlQiIXHLMfWULa22aTRYZ_Tvt6rPerL_DmnwxtJIGjXEh3-gNSeC_44Uqvp-3QK-r5wIsN9N1XjHQKSDmIqv/s1600/IMG_3374.JPG" height="320" width="239" /></a></div>
<br />
The original design uses an LM358, which is a dual op-amp. One half is used to amplify the thermocouple output, the other compares it to the temperature set point. Note that this station doesn't use a variable pot to set the temp, but a 5 position rotary switch.<br />
<br />
Also, there doesn't seem to be any hysteresis in the circuit. I guess the designers relied on thermal mass to damp any oscillations there.<br />
<br />
A few measurements later, I found out that the set point has a range of 400mV, around 9V. So if I build a little interface that has adjustable gain and offset, I can just disconnect the thermocouple amp, and feed my conditioned thermistor output into the comparator stage.<br />
<br />
This also has the advantage that if I want to return the station to normal, I can do so easily.<br />
<br />
<h3>
Maths. </h3>
So, I broke out excel and did some actual maths (file <a href="https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxsdWR6aW5jZG93bmxvYWRzfGd4OjM4NDdiYTllMWEzOWI0Mjg">here</a>).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2yuYxQoeGlGrNA7aym8JiHea_xqKkc0aQK9t-87OyYzio_fU3E_qXH5kwjFuBDKfBp5RqSLlG3QYGVfuNqYt_eGkOLMa60AmPZNJ_0LCb5DwuXHMZ8koav0I43WwPhYkPSVZfiEN20nlD/s1600/hakko+micron+excel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2yuYxQoeGlGrNA7aym8JiHea_xqKkc0aQK9t-87OyYzio_fU3E_qXH5kwjFuBDKfBp5RqSLlG3QYGVfuNqYt_eGkOLMa60AmPZNJ_0LCb5DwuXHMZ8koav0I43WwPhYkPSVZfiEN20nlD/s1600/hakko+micron+excel.png" height="298" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With a gain of 3.2 and an offset of around 5V, I get an error of (much!) less than 1% compared to the old thermistor settings. Cool.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivl4wc7dCBR64YwlrLKxFW1BfrugEs5wu90LpeZdke6GE7rwl4bWYbXOX3IuNl-u8w1diTY780LXEGo7WF2U5qknFMvs5XgCrPcz-8dotSzsZ2SbJn-4QzZoluO9VLf46oPlCdKxUcJjGL/s1600/interfce+circuit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivl4wc7dCBR64YwlrLKxFW1BfrugEs5wu90LpeZdke6GE7rwl4bWYbXOX3IuNl-u8w1diTY780LXEGo7WF2U5qknFMvs5XgCrPcz-8dotSzsZ2SbJn-4QzZoluO9VLf46oPlCdKxUcJjGL/s1600/interfce+circuit.png" height="192" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As I have a stash of LM324 quad op-amps I whipped up the above circuit.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3CIgifpRh_ya7XCwNW316IrMB2LTi7WqNUPz7AX7CJWt5mDhS-Mb6GT_F71C9zguB1HKvlHqYWWHUAx0FNftoIXD8XDBgyelKDv8bjwvwUndHb9Co0LcWeev1hEeqSYsQnB6BQwlSwfwb/s1600/interfce+pcb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3CIgifpRh_ya7XCwNW316IrMB2LTi7WqNUPz7AX7CJWt5mDhS-Mb6GT_F71C9zguB1HKvlHqYWWHUAx0FNftoIXD8XDBgyelKDv8bjwvwUndHb9Co0LcWeev1hEeqSYsQnB6BQwlSwfwb/s1600/interfce+pcb.png" height="274" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Quickly laid it out - single layer FTW!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzVCcJK33svC34LdCPXHOxok_r1VZAgrrLTaPeNhcgkRJkn2PslOuS0XX3KD6nLaHcgqmF7QlJKTnSaqpqLQfq0XTHricsZ4LTbwyFLIfEftpS08qpmnlC8G-DlI8bEe3TEg6axMJseMQA/s1600/IMG_3473.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzVCcJK33svC34LdCPXHOxok_r1VZAgrrLTaPeNhcgkRJkn2PslOuS0XX3KD6nLaHcgqmF7QlJKTnSaqpqLQfq0XTHricsZ4LTbwyFLIfEftpS08qpmnlC8G-DlI8bEe3TEg6axMJseMQA/s1600/IMG_3473.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqsbuutUoOj0P-i_ZKjZCMIQh_Iad3DFzgpTuDV4NKqIWi4jb8XPuJkgtCIgT52MOo6_NcfqIsuTfHTraIUhyphenhyphenaDvPDRhcoXGVfu2Mw0MnLlKZITj-0TTNrD6AM61JQpEIYAPyn5a76jB0E/s1600/IMG_3474.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqsbuutUoOj0P-i_ZKjZCMIQh_Iad3DFzgpTuDV4NKqIWi4jb8XPuJkgtCIgT52MOo6_NcfqIsuTfHTraIUhyphenhyphenaDvPDRhcoXGVfu2Mw0MnLlKZITj-0TTNrD6AM61JQpEIYAPyn5a76jB0E/s1600/IMG_3474.JPG" height="320" width="239" /></a></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
I then milled and assembled it. And bugger me, it worked first shot! I did simulate it in <a href="https://sites.google.com/site/ludzincdownloads/home/micron-hakko-mod/Hakko.asc?attredirects=0&d=1">LTSpice</a> first, which helps.<br />
<br /></div>
<h3>
Teardown Continues</h3>
<div>
So to install the change, I had to finish pulling it apart.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkb1LolliTg7vhnJKml2X234h-SsyiNI-IQlTEjg1jET8NcFNnq035ee_X6ttgAmG8o8HwfxvyNl8smxw8wMQ1WraQKti29Kn5V5nr1dNCxfzpoLXFDJ-QpOijuOqWFSTTa40tzkp5T4lH/s1600/IMG_3388.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkb1LolliTg7vhnJKml2X234h-SsyiNI-IQlTEjg1jET8NcFNnq035ee_X6ttgAmG8o8HwfxvyNl8smxw8wMQ1WraQKti29Kn5V5nr1dNCxfzpoLXFDJ-QpOijuOqWFSTTa40tzkp5T4lH/s1600/IMG_3388.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Okay, I pulled it apart *before* milling my board - I needed to work out where it was going to fit first.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also, I wanted to look at the control board traces to help with reverse engineering it, and was surprised to see that the bottom of the board was coated in, well, crud of some kind.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Or0sbdpEf9mFbfAVljndQohI_74byJ9Xz_TMqKiAfrrv42gUUCPY1X5j4RQ-A-F0Oi2ebfg13F8CNkVSGgmE87tu2FC1U1s6KUmJMqNjuCcLuB4sR9nuV5HeTbkiklEkRWLEWPWbsx7f/s1600/IMG_3389.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Or0sbdpEf9mFbfAVljndQohI_74byJ9Xz_TMqKiAfrrv42gUUCPY1X5j4RQ-A-F0Oi2ebfg13F8CNkVSGgmE87tu2FC1U1s6KUmJMqNjuCcLuB4sR9nuV5HeTbkiklEkRWLEWPWbsx7f/s1600/IMG_3389.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
By shining my LED torch behind the board, it became obvious that the trace connecting the Earth of the soldering tip, to the earth cabling of the mains, had gone away! The pad labelled G should be connected to the pad labelled E. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRbX1qeTs-PXBdP0jlKePFP8Zju5_-YaWf_AaNUQae7_2fwc0c8fpL0phvF2hogYzTklsWlW6TW7qJtRcIgrZq7_0QbWNQQXUn5B-CW9pmTlDfj4olAf7N0c4Kmpj5I4LgKMEa5xJBU0Z/s1600/IMG_3390.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRbX1qeTs-PXBdP0jlKePFP8Zju5_-YaWf_AaNUQae7_2fwc0c8fpL0phvF2hogYzTklsWlW6TW7qJtRcIgrZq7_0QbWNQQXUn5B-CW9pmTlDfj4olAf7N0c4Kmpj5I4LgKMEa5xJBU0Z/s1600/IMG_3390.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then the penny dropped. The crud was the pcb track that had been vapourised. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But how? </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Many moons ago the mains lead was tangled in the handle holder (iirc I was installing a car radio, with leads and wires all over the place), and when I absent mindedly put the handle in the rest, the tip soon melted through the mains lead, found active and scared the crap out of me with a all too close impromptu fireworks display. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I do recall replacing the mains lead and being relieved that the soldering station still worked, but I never checked that the tip was still earthed!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix2K_hY82DZZGQIFn8RK31SWRgADyUursyCtw8h6uybTbU8MTbNUJvQUwakvLHterbohGK-Z88T56U2t659G-DzYDdlyCNhCozwBPWucdsNMXEie6NaEDNhZqOnCL-WLSRAPKq9pOZVf5Q/s1600/IMG_3392.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix2K_hY82DZZGQIFn8RK31SWRgADyUursyCtw8h6uybTbU8MTbNUJvQUwakvLHterbohGK-Z88T56U2t659G-DzYDdlyCNhCozwBPWucdsNMXEie6NaEDNhZqOnCL-WLSRAPKq9pOZVf5Q/s1600/IMG_3392.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Pulling apart the new handle (the best $7 clone of the 907 I could find off of eBay), the red fibreglass sleeve shows the heater connections, the blue the thermistor connections. So before final assembly, I tested that the control board could heat the new handle. Soldered into place, and switched on, it rapidly drove the handle into overheat. Cool.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitgOjUmRS9iB-7U4cDvkYMSEW0PlZe2R9Ipq2629rEiAK5OBuYIm7FvyLh8y0he55K5CaJpXHFzsqOMjW7aaBW6ue1bLtATLCXOJCrUAKZQE6FXca323NeYYdqD7IZiHeNQ17fN5BpRTjt/s1600/IMG_3394.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitgOjUmRS9iB-7U4cDvkYMSEW0PlZe2R9Ipq2629rEiAK5OBuYIm7FvyLh8y0he55K5CaJpXHFzsqOMjW7aaBW6ue1bLtATLCXOJCrUAKZQE6FXca323NeYYdqD7IZiHeNQ17fN5BpRTjt/s1600/IMG_3394.JPG" height="239" width="320" /></a></div>
<br />
After that I started to integrate the new handle and my interface board into the station. It all fitted rather neatly. Power was taken directly from the pins of the LM358, and pin 1 was cut to isolated the thermistor amp, with my board's output (white wire) going direct to pin 5 of the LM358.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGF8TNzuqJ59II2yINLDKI9ToA18CRMlnpKBnB8WLJUBrphFjTJn0Nftp_TdLx7Fon77gzmJrVoLfp8_gGxnlB1CkLRIEgS_2gFbodwPgU7YI6XOV2DP8TQ9fCe2UUY2vyGhJwJYL6Ay2/s1600/IMG_3480.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGF8TNzuqJ59II2yINLDKI9ToA18CRMlnpKBnB8WLJUBrphFjTJn0Nftp_TdLx7Fon77gzmJrVoLfp8_gGxnlB1CkLRIEgS_2gFbodwPgU7YI6XOV2DP8TQ9fCe2UUY2vyGhJwJYL6Ay2/s1600/IMG_3480.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The blue wires are for the heater.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I'd designed the board with the idea that the DC supply 0V would be common to the mains Earth and you can see the black wire from the handle is connected there. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This was a bad thing, for two reasons.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To make the tip ESD Safe, your tip should be connected to ground via 1Meg, not via a short circuit. Also, the DC supply 0V is ISOLATED from the mains Earth, so that doesn't work either. The fix was to 'air wire' a standard through hole resistor into place. Sorted.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFTB9YEuRF52Kao5F1L_gum0vDcmoXJbPyVGUZwqJj2NeuQ3VblaWXfZXnm4jd5IJwKYnthONBuhGcKSNWV522YioHg2FAUvuel0ft1RTkvMcktyxVY30aR_onOGvkje-Qolo_0u5icptI/s1600/IMG_3482.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFTB9YEuRF52Kao5F1L_gum0vDcmoXJbPyVGUZwqJj2NeuQ3VblaWXfZXnm4jd5IJwKYnthONBuhGcKSNWV522YioHg2FAUvuel0ft1RTkvMcktyxVY30aR_onOGvkje-Qolo_0u5icptI/s1600/IMG_3482.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Of course, the next hurdle was to calibrate the unit. In the shot below I'm probing the set point and input of the comparator (scope is out of shot) and (also out of shot) I hooked up a thermocouple to tip of the handle. What I did before this was to measure the output of the thermistor and the it's amplifier (U1B in the schematic above) and adjusted the gain trimpot until I saw a gain of 3.2. (remembering it's all relative to a virtual ground via an inverting amp. Yeah, took a bit of grey matter to get that right!).</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjegcMq3lho_8CHXkflTBUKlD1ejlNIKPWvaBK908gVhZJQEMdVoigg2xriiHeBjLOaKH0H_opRfqtrt6HJO_9dr-s0uPg5cB3hcMvfUYxKWoQChZ5LlsFhTCCdMqBMlXJAaR6SQF9PnNrE/s1600/IMG_3478.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjegcMq3lho_8CHXkflTBUKlD1ejlNIKPWvaBK908gVhZJQEMdVoigg2xriiHeBjLOaKH0H_opRfqtrt6HJO_9dr-s0uPg5cB3hcMvfUYxKWoQChZ5LlsFhTCCdMqBMlXJAaR6SQF9PnNrE/s1600/IMG_3478.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The handle and thermocouple are out of shot here (on the floor - I ran out of hands) and set to calibrating the unit. Basically, I set the temperature to the middle setting (380 degrees C) which is the most used setting, and watched the input to the comparator rise. I'd set the offset too high so the tip was too cold when the heater turned off, so I was able to tweak the offset in small increments until I got a stable 380 on the thermocouple. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5eOjtcbSguFTzK8EmVK-E2dqnjUxlByzCkcI9cDX1-d06EnVBkd2TG9ui4HRMl-Tsgei3lXlS5c38dWZ3fJbPFW_2l0HK2Z2RVs9NqfNacRwyNMt45RwC6H-VxNSXedIIj5a_gJi1i3PE/s1600/IMG_3479.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5eOjtcbSguFTzK8EmVK-E2dqnjUxlByzCkcI9cDX1-d06EnVBkd2TG9ui4HRMl-Tsgei3lXlS5c38dWZ3fJbPFW_2l0HK2Z2RVs9NqfNacRwyNMt45RwC6H-VxNSXedIIj5a_gJi1i3PE/s1600/IMG_3479.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then checked the temp at the high (440) and low (320) ends and I was within +/- 5 degrees of the set points, and called it close enough. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjea7vP-TBB2N8cwxzmblrQP_bjAj7fe87M814Wtwkeh-tQCaC1ruj72E-HkhNpV5UEKaqafbS0EnT9AzhR9YC-cpPa1qRqS7NGesibQrgALgzglDGir6twN-MlNKpBB4vgCU0pycY6Tzf6/s1600/IMG_3484.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjea7vP-TBB2N8cwxzmblrQP_bjAj7fe87M814Wtwkeh-tQCaC1ruj72E-HkhNpV5UEKaqafbS0EnT9AzhR9YC-cpPa1qRqS7NGesibQrgALgzglDGir6twN-MlNKpBB4vgCU0pycY6Tzf6/s1600/IMG_3484.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The front panel and the cables still fit above the interface board, and the cover went on. Win.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi71BJjrMrXday6kRrkOXN2OVWkks-AgE-K1OSJg9YIYbmzIRLD27mG_GXlebsMAF9rdS4V0x8B_1kQrIc9mUhNUHfZVDAxz59lm2_QwUtQQBxh66yVYWpt-lkPlF3hXzbbOJoCmQQ7i1IT/s1600/IMG_3485.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi71BJjrMrXday6kRrkOXN2OVWkks-AgE-K1OSJg9YIYbmzIRLD27mG_GXlebsMAF9rdS4V0x8B_1kQrIc9mUhNUHfZVDAxz59lm2_QwUtQQBxh66yVYWpt-lkPlF3hXzbbOJoCmQQ7i1IT/s1600/IMG_3485.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
All screws were found and assembly was completed. All I need to do now is find a sponge and a spot for it next to my Hakko and my tip changing days are over. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Yes, I know I could have just bought a Hakko clone off of Hobbyking for not much more than I paid for the clone handle, but where's the fun in that. Plus, this station has way cool LEDs!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And yes, if anyone has a suggestion as to how I could make this handle work with the standard LM358, I'm all ears.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com7tag:blogger.com,1999:blog-2685787041614376103.post-74667865929781944172014-12-05T22:47:00.002-08:002019-07-12T18:51:51.594-07:00Improved Current Load<h2 style="clear: both; text-align: left;">
Some Free Advice!</h2>
<div class="separator" style="clear: both; text-align: left;">
(Update - July 2019 - see the end of this post regards how not to blow this up!).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Back when I wrote about my <a href="http://ludzinc.blogspot.com.au/2013/11/dangerous-assumptions.html">failure to build a current limiting circuit</a> for my <a href="http://ludzinc.blogspot.com.au/2013/04/cutting-out-middle-man.html">Alarm Panel Interface</a>, <a href="http://www.blogger.com/profile/05009286477306083017">Zega</a> was kind enough to offer me <a href="http://ludzinc.blogspot.com/2013/11/dangerous-assumptions.html?showComment=1390541514466#c2900114228600772199">some advice</a>.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Long story short, half the oscillations I was chasing in my limiting circuit were due to my quick and dirty Constant Current Load. </div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9SIlr31c7jdRzsifGWYvoZ0mTMW82TTTTaeSfeUJAb1Oxv06EyrlAaN-vtEnXkMGx80cx-rREq3zLPGk3Z2gAQauLs_9ra7kR-8IgfgHQQlaUHpuYA7cbuKqKR45NE0RhcXIbYXCpalAh/s1600/IMG_2234%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9SIlr31c7jdRzsifGWYvoZ0mTMW82TTTTaeSfeUJAb1Oxv06EyrlAaN-vtEnXkMGx80cx-rREq3zLPGk3Z2gAQauLs_9ra7kR-8IgfgHQQlaUHpuYA7cbuKqKR45NE0RhcXIbYXCpalAh/s1600/IMG_2234%5B1%5D.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Here's the Problem...</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXbtKhnco5aLzTHcdscqefOLk0ryW01zCIsMWa_T4ndKCcrQX86wy_npWAiHFp572jQ6IReHdkHV9B5GrUUQee6uOVc6hDGjZvhCmATsllJng6oApGJfSfPZ1o6QKjOg8p7s9dtrq_ro6e/s1600/IMG_2230%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXbtKhnco5aLzTHcdscqefOLk0ryW01zCIsMWa_T4ndKCcrQX86wy_npWAiHFp572jQ6IReHdkHV9B5GrUUQee6uOVc6hDGjZvhCmATsllJng6oApGJfSfPZ1o6QKjOg8p7s9dtrq_ro6e/s1600/IMG_2230%5B1%5D.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
And (a part of) the Cause!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Take Two</h2>
<div>
So thanks to the tip from Zega, I was ready to punch out V2 which would not only *not* oscillate, but provide a display of the current it's sinking, and provide a method to set the current limit before sinking a circuit.</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Kg26AXinfOmX3eh0KfMEze3_wIruDAmVY2CU7QX5ygd_Jay5Y_YQQr-I_VCGj_lAKs4vGgCz-7lgOyOjf3SzBBDuph59aLwUuu7K7yCVWxHgO4uO8WAGHN8Z4u1Ov7xZFdga6eC0gp-N/s1600/const+current+schematic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Kg26AXinfOmX3eh0KfMEze3_wIruDAmVY2CU7QX5ygd_Jay5Y_YQQr-I_VCGj_lAKs4vGgCz-7lgOyOjf3SzBBDuph59aLwUuu7K7yCVWxHgO4uO8WAGHN8Z4u1Ov7xZFdga6eC0gp-N/s1600/const+current+schematic.png" width="320" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
From the schematic, you'll see three sub-circuits. The first and most obvious is the constant current load section, with R2 and C6 added to curb oscillations.</div>
<div>
<br /></div>
<div>
You will also notice the 'Set Monitor' an 'Sense Monitor' sub-circuits. When S2 is in the 'Set' position, and as I have a 1 ohm sense resistor, the voltage is a sample of the set voltage from the adjustment pot, which happens to equal current in the load (i.e. 1V set = 1A limit, 0.1V set = 100mA limit etc).</div>
<div>
<br /></div>
<div>
Combine this with an eBay sourced voltage display, and I have a <strike>real quick and dirty</strike> easy method of displaying the target current limit. Flick S2 to Sense, and this displays to voltage across the sense resistor, for a display of the actual current being drawn. Sweet!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6WmAR8cqjRn77KALYTN8C-pEnVRKJCHMEOjBApONjSDFucr1hBtVnGDRLU9JwpoHkjAkERcicfcVdh8B_splsccHtPzzbbT50rKTMzP6BGezfimTAIFCDhh_yi3zB318qE84t3qe3-UVA/s1600/const+current+front+panel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6WmAR8cqjRn77KALYTN8C-pEnVRKJCHMEOjBApONjSDFucr1hBtVnGDRLU9JwpoHkjAkERcicfcVdh8B_splsccHtPzzbbT50rKTMzP6BGezfimTAIFCDhh_yi3zB318qE84t3qe3-UVA/s1600/const+current+front+panel.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Panel Design</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCBeNgrc3GA2pec2grJKUj5Wezie0aACQ9HOxVFAkeBC1GNo36qzEgjBJCWPK7F7tiwsTfSegDAVawZm_P86TSP3wQVJjgJj29qsbMCdrvTPJi35aC7CzDNZKNqAdT0QvJKzhbrAHpGwMT/s1600/IMG_3006.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCBeNgrc3GA2pec2grJKUj5Wezie0aACQ9HOxVFAkeBC1GNo36qzEgjBJCWPK7F7tiwsTfSegDAVawZm_P86TSP3wQVJjgJj29qsbMCdrvTPJi35aC7CzDNZKNqAdT0QvJKzhbrAHpGwMT/s1600/IMG_3006.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Front Panel Mockup </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
One other painful aspect of my first load was that it was a bastard to set for low currents. <br />
<br />
So to fix that I added S1 to give me a high / low range. Simply switching a higher resistance in series with my adjustment pot achieves this goal. Note that I've not attempted to increase the precision of the display - so piratically I'm limited to adjustments in multiples of 10mA (0.01 A) but that suits my purposes.<br />
<br />
Note the high range was limited to 3A to give the MTP3055 half a chance of a long life, and the low range was limited to 500mA.<br />
<br /></div>
<div class="" style="clear: both; text-align: left;">
I'd also had a nice heatsink lying around that was more compact than the last one I used, which was practically the same width as my voltage meter, so the goal was to make this version fit this heatsink.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To achive this, I decided to use a separate front panel, a single layer PCB (so could mill it at work), reverse mount the pot and direct mount the switches. Anything to avoid wiring :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Assembly Tips</h2>
The board was milled at work, along with a front panel. Time to solder. The copper stock I had was a touch tarnished and would have been even more of a bastard to solder than normal, so a fix was needed.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwepXN6mBg4wLoZptnJuXnWpXbdekdYKIe_RzsxItFRCO4ORRMsEyo5_RCGAAKDK16IhiL6n4NlY0Kh8GZG8VHVB2-jI-xyWU54gwXkx7NxucMMWUzvccB5m7WDpnrAlCEvisGBZTsxQFO/s1600/IMG_3060.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwepXN6mBg4wLoZptnJuXnWpXbdekdYKIe_RzsxItFRCO4ORRMsEyo5_RCGAAKDK16IhiL6n4NlY0Kh8GZG8VHVB2-jI-xyWU54gwXkx7NxucMMWUzvccB5m7WDpnrAlCEvisGBZTsxQFO/s1600/IMG_3060.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Dirty PCB, <a href="https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB8QFjAA&url=http%3A%2F%2Fdirtypcbs.com%2F&ei=fouCVPnbKdbh8AXD14LgAQ&usg=AFQjCNFiLlkGO1qbCLXKawlSotJALYtXXA&sig2=D5QGZv7gr6jSkJOYWJ0TBg&bvm=bv.80642063,d.dGc">Not the Good Kind</a></div>
<div class="" style="clear: both; text-align: left;">
Rading the kids pencil cases, I found a good old 'ink' rubber, and attacked the board. These are coarse enough to scrub the board clean, but not aggressive enough to rip up the races.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsDj45BaEfp20Ep5MlfBwYBreuoPU_aKHbJd6eb62WrJ022EgJpiHxGea2EB3YLAZjcFdxFGRgMP0BYzya0M3Op2ljQgFNCOeu0dOWY2mYjnZ3ZgMW0Qk4zt0PoHM17cUeKlO2vR1we_0/s1600/IMG_3061.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsDj45BaEfp20Ep5MlfBwYBreuoPU_aKHbJd6eb62WrJ022EgJpiHxGea2EB3YLAZjcFdxFGRgMP0BYzya0M3Op2ljQgFNCOeu0dOWY2mYjnZ3ZgMW0Qk4zt0PoHM17cUeKlO2vR1we_0/s1600/IMG_3061.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Spot the Difference.</div>
<div class="" style="clear: both; text-align: left;">
As much as I love having the ability to mill my own boards at work, I hate soldering them. It's just too easy to bridge from a pad to the ground pour, that these days I prefer any of the prorotype services out there over DIY. But when you are soldering a board with lots of copper, I have a few tips to share.</div>
<h3 style="clear: both; text-align: left;">
1. Tin the Pads First</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVt1rflSTXYqCw_sQkm6jqK0p73qO4GD0hR6qEE4HwCvHKlr-G4uaTWoUZnbD7yJwxKZS5fMGzmYpNNZAv0h_I9VQdwI3A6pi-IY8uA0TAYf_wN7WkYVkcW9di5uxASHclpuzvF6wblcGL/s1600/IMG_3066.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVt1rflSTXYqCw_sQkm6jqK0p73qO4GD0hR6qEE4HwCvHKlr-G4uaTWoUZnbD7yJwxKZS5fMGzmYpNNZAv0h_I9VQdwI3A6pi-IY8uA0TAYf_wN7WkYVkcW9di5uxASHclpuzvF6wblcGL/s1600/IMG_3066.JPG" width="320" /></a>]</div>
<div class="" style="clear: both; text-align: center;">
Lumpy!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
I solder the pads first, but this leaves a lump behind. So then I clean up the pads with solder wick, giving a nice, flat and easy to solder surface to load your parts on.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJUAkaPsjkRCMXbvyyuuw5jWTZ0I-CDBQ1K9DF4vEllrG7VOAPL_QJldb8lF5iyoxCjp4TqQ8_ZT85-pVktkA4nSLMkTqxrFx2Kk5EUVzGBROXmBb-aN8vX0D-zNWU3xx91TXRi5qlQN0B/s1600/IMG_3065.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJUAkaPsjkRCMXbvyyuuw5jWTZ0I-CDBQ1K9DF4vEllrG7VOAPL_QJldb8lF5iyoxCjp4TqQ8_ZT85-pVktkA4nSLMkTqxrFx2Kk5EUVzGBROXmBb-aN8vX0D-zNWU3xx91TXRi5qlQN0B/s1600/IMG_3065.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Tinned Pads</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
2. Check for Shorts</h3>
<div>
<div class="" style="clear: both;">
Before soldering, hold your board up to a lamp / torch and check the clearances. If you look about middle left of the board, you'll see a short that I didn't see before this trick. Yes I have had many a board cause me grief with hidden shorts like this before and looking for them like this saves a lot of time. Trust me!</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisMLpW31Pxsqt0lhnvINnavB8AGjTozUUviPb1gAfkYuH37JoMxS-0hoz9ScBMpV064WMTm23958m3R_h7Oow9Up6wnTgixnzUB8dMRXoxFCmaf3MuQ1gt6zoRXBT2OED8vt2m_p4fAbno/s1600/IMG_3067.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisMLpW31Pxsqt0lhnvINnavB8AGjTozUUviPb1gAfkYuH37JoMxS-0hoz9ScBMpV064WMTm23958m3R_h7Oow9Up6wnTgixnzUB8dMRXoxFCmaf3MuQ1gt6zoRXBT2OED8vt2m_p4fAbno/s1600/IMG_3067.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Inspect First!</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Rest of the Build</h2>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS0O8kUn5N928vlRqI5D_jxOfROu8kfr2eNMniYUWSJfjux_eGB-PLxX7I4mCzGTRObbazN3Th4wSjGnW-cb1Bxxs5n-eRIaYMFFmmp2M7wnJ9dYwB7b2uC36BvJ3pe7gf2aHjhE8W_1t3/s1600/IMG_3068.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS0O8kUn5N928vlRqI5D_jxOfROu8kfr2eNMniYUWSJfjux_eGB-PLxX7I4mCzGTRObbazN3Th4wSjGnW-cb1Bxxs5n-eRIaYMFFmmp2M7wnJ9dYwB7b2uC36BvJ3pe7gf2aHjhE8W_1t3/s1600/IMG_3068.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Not Orthodox</div>
<br />
Here you can see how I reverse mounted my pot, and only loaded one of my range resistors. At this point in the build I changed my mind about ranging and moved away from my original Low / Med / High idea and went with a dual range only design. I also did a dummy assembly of my display and found it fouled the op-amp, so a quick re-spin was required.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbCILL8Cw2OCYWqkdJc-lDG5_on5EIyr7WPshMzhIuLynJmwao6DC3bEgPX8wcQL9j7atqLjG6uNaG1xw50qf03IAl8HUuf8kzt54aoUg-MB0oysCEifOIpN5XH66MrVjqYqY-MIQmG1A3/s1600/const+current+pcb+layout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbCILL8Cw2OCYWqkdJc-lDG5_on5EIyr7WPshMzhIuLynJmwao6DC3bEgPX8wcQL9j7atqLjG6uNaG1xw50qf03IAl8HUuf8kzt54aoUg-MB0oysCEifOIpN5XH66MrVjqYqY-MIQmG1A3/s1600/const+current+pcb+layout.png" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
V3 PCB Layout<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vtxuIheucVp0KnEb7QQhZpv9skHPVDN3ubrJplhs3-1-XwYpS5mw2YB1rTanyGoC_ITdc1D3LSCLVgBVRwvpqsWDx2Oo0Mvg0WIDhMS4PKo6OHF3ZusweVfc1MpxPYN53ExuVOtnJVlQ/s1600/IMG_3082.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vtxuIheucVp0KnEb7QQhZpv9skHPVDN3ubrJplhs3-1-XwYpS5mw2YB1rTanyGoC_ITdc1D3LSCLVgBVRwvpqsWDx2Oo0Mvg0WIDhMS4PKo6OHF3ZusweVfc1MpxPYN53ExuVOtnJVlQ/s1600/IMG_3082.JPG" width="320" /></a></div>
<br />
V3 Milled<br />
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So this update of the layout placed the parts so they would actually clear each other and stack, and also allowed for me to directly mount the switches. I also went away from a wire wound 10% resistor to 10 1% resistors in parallel. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRI5-3Wrh6hAs7L-s7ZWdTbqnRg_j4heGu-4FrMOz9cDl7e0RBGKd8EZlwqLcj3dnB_ksxj_WhYQKgij5SSsnVFQZ_AxHsjZRB29_w8aj_JAHWkJ3AUIwFpfLab46Hm8lhqTMcth9gGAQT/s1600/IMG_3090.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRI5-3Wrh6hAs7L-s7ZWdTbqnRg_j4heGu-4FrMOz9cDl7e0RBGKd8EZlwqLcj3dnB_ksxj_WhYQKgij5SSsnVFQZ_AxHsjZRB29_w8aj_JAHWkJ3AUIwFpfLab46Hm8lhqTMcth9gGAQT/s1600/IMG_3090.JPG" width="239" /></a></div>
<div class="" style="clear: both; text-align: center;">
Side View</div>
<div class="" style="clear: both; text-align: left;">
I did have to use flying wires to connect the banana pugs to the bottom board, and I had to hunt around for the right M3 stand-offs, and ourgood friend JB weld was used to secure the MOSFET and the back of the POT to the heatsink (as well as the M3 standoffs).</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
Here's some shots of the assembled unit.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx1XD9twknYL7hqjAyE4BEWv-Mk6xxMBizu8_t4lpWFg23zCN1Ele_SSozVpbnpxjh_et-6BdFCjsokEcsaz1f6_wmwKhVPjtdXTiay82jh8mSvB-b_VmlnC13TZZxEhnYNSfpxnWkrTBw/s1600/IMG_3235.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx1XD9twknYL7hqjAyE4BEWv-Mk6xxMBizu8_t4lpWFg23zCN1Ele_SSozVpbnpxjh_et-6BdFCjsokEcsaz1f6_wmwKhVPjtdXTiay82jh8mSvB-b_VmlnC13TZZxEhnYNSfpxnWkrTBw/s1600/IMG_3235.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Perspective</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiA9I-OuW9GNaihu2r6kIFM-Y9_BL8xN1ZXheBQZAKyBCoY3AcE-U8-NY4r3UyBEb5A8ssm0le5trLqdHDGR2CG_sNW0i0O_ceAAp7miI1q4ZhfR0z93PbP7G0mbzDDAqIntZt3BiFowpr/s1600/IMG_3236.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiA9I-OuW9GNaihu2r6kIFM-Y9_BL8xN1ZXheBQZAKyBCoY3AcE-U8-NY4r3UyBEb5A8ssm0le5trLqdHDGR2CG_sNW0i0O_ceAAp7miI1q4ZhfR0z93PbP7G0mbzDDAqIntZt3BiFowpr/s1600/IMG_3236.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Side View</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZejbX-SK1b2g39WW7wf3up6B97Iu28v40Z2c7o36gOhDJ8s6_p1djd0b-c5o0CO8G9ub7vWHUUypeE9iQvHBGQrJWxKUMaltAlFJ3jKOiEKrPCyLOXvDaAN_FGYW2QMY-0DYl4NnhibHE/s1600/IMG_3237.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZejbX-SK1b2g39WW7wf3up6B97Iu28v40Z2c7o36gOhDJ8s6_p1djd0b-c5o0CO8G9ub7vWHUUypeE9iQvHBGQrJWxKUMaltAlFJ3jKOiEKrPCyLOXvDaAN_FGYW2QMY-0DYl4NnhibHE/s1600/IMG_3237.JPG" width="320" /></a></div>
<div class="" style="clear: both; text-align: center;">
Power Connector</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXj5mvA2lzyDZbL5goirHG-fu01GFt6TUe6VbUT4AjSx1FqKDVIo_Clqix6Yg1ge6qPaDzJzAFexsa06cOjn2vJe1_Ldpt7QHeLr2gW2R3ZS09PNpW_HjQTREMYfbyBi0iAlQf7Z2EZUSG/s1600/IMG_3089.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXj5mvA2lzyDZbL5goirHG-fu01GFt6TUe6VbUT4AjSx1FqKDVIo_Clqix6Yg1ge6qPaDzJzAFexsa06cOjn2vJe1_Ldpt7QHeLr2gW2R3ZS09PNpW_HjQTREMYfbyBi0iAlQf7Z2EZUSG/s1600/IMG_3089.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Ready to Test</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Testing was straight forward - the High / Low ranges set test voltages as expected, the Set / Sense switch works and the meter even agrees with my multimeter! Win.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD7UmQVtS21lK4Wb3kA8W2tTj3PIvrfk0_jYbdW9dJd5FZJ7kq85fC25cpRe6ezVtuMdkK6gSnkK79ZaD6lGAAdlG_wtlOOydvK4VS4wEaF-lggl6OwmyLFTiK3pzn8p_JpGsGkOycBqQn/s1600/IMG_3070.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD7UmQVtS21lK4Wb3kA8W2tTj3PIvrfk0_jYbdW9dJd5FZJ7kq85fC25cpRe6ezVtuMdkK6gSnkK79ZaD6lGAAdlG_wtlOOydvK4VS4wEaF-lggl6OwmyLFTiK3pzn8p_JpGsGkOycBqQn/s1600/IMG_3070.JPG" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
IT WORKS!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Things You Do For Your Mates</h2>
<div>
While I was in build mode, I actually built two meters. One was for my mate Nick - but rather than build his meter onto a heatsink, he prefers things in cases, so I made a different panel so he could mount his meter into a Hammond case (in the 145x1201 series).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXqhOh18X0tyQaQYpUzJlKoR7-8Pn9k_ieyxLQj2e14haHzEFEf6ZR92SzF6FRfcFfN4RRCEiS_M6mfB2jGLJFpSd1MwENd8fdQlRf_G4IwKw9GnLEXMnjOS4vh6O4J_mEXYPa1rOlN-lZ/s1600/hammond+145x1201.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXqhOh18X0tyQaQYpUzJlKoR7-8Pn9k_ieyxLQj2e14haHzEFEf6ZR92SzF6FRfcFfN4RRCEiS_M6mfB2jGLJFpSd1MwENd8fdQlRf_G4IwKw9GnLEXMnjOS4vh6O4J_mEXYPa1rOlN-lZ/s1600/hammond+145x1201.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Hammond Case Front Panel</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWMJ1S9f_-uhcXnRGMEgOaUCT-tgKimbRAU-YJ1zyLeeq0BeC2VWpBRkZaKl9UqgNeLxnwNaxC_dRxwINqXuyGkzjVKiP44WrjSSlB1fz-rLxIrKncrYcwaG7KC2ngywMlzJ5rKX-MLpmi/s1600/IMG_3185%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWMJ1S9f_-uhcXnRGMEgOaUCT-tgKimbRAU-YJ1zyLeeq0BeC2VWpBRkZaKl9UqgNeLxnwNaxC_dRxwINqXuyGkzjVKiP44WrjSSlB1fz-rLxIrKncrYcwaG7KC2ngywMlzJ5rKX-MLpmi/s1600/IMG_3185%5B1%5D.JPG" width="239" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Assembled</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
Files</h2>
<div>
Altium files can be found <a href="https://sites.google.com/site/ludzincdownloads/home/constant-current-load/Constant%20Current%20Load.zip?attredirects=0&d=1">here</a>. If people are interested, I'll post a KiCAD version of the PCB... after I get asked for it :)<br />
<br />
<h2>
Update: <a href="https://www.youtube.com/watch?v=t9wmWZbr_wQ">Where's the Kaboom</a>?</h2>
In case no one noticed before, the following picture shows how I measure current being sunk by the load:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid5BRwx-OMNAYLEU3eplR-yAv_cxVQz_nvYpqNpYFBInalYYMzchLPca8PZteze539zEtUuQwtyN9IXKDVluEdMfkow-JAjr_YYjqb5FrX8qdmcyLcBmmg5AVOVVyDaKqSEB5SBt8x-ceQ/s1600/LoadSense.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="313" data-original-width="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid5BRwx-OMNAYLEU3eplR-yAv_cxVQz_nvYpqNpYFBInalYYMzchLPca8PZteze539zEtUuQwtyN9IXKDVluEdMfkow-JAjr_YYjqb5FrX8qdmcyLcBmmg5AVOVVyDaKqSEB5SBt8x-ceQ/s1600/LoadSense.PNG" /></a></div>
<br />
<br />
I use ten 10 ohm resistors in parallel to form a 1 ohm resistor, and the volts across this equates to the current drawn. Easy maths.<br />
<br />
However, each resistor is only a 1/4 watt resistor, and all up the ten resistors can dissipate 2.5 watts. Now, with the high range set to 3A, the load will have to dissipate 3 watts, and that's bad.<br />
<br />
What's worse - I did dumb dumb in a <a href="https://www.etsy.com/au/listing/687412636/warning-stickers-mk-ii?ref=shop_home_active_1&crt=1">no dumb dumb area</a> - have a look at how I adjust my set point:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC_u7l8Pf_gkgILlWs0AMl5Cl-I7Hbfuizhzbvz_b9Lr4lMZUA6mRDlkKQ3ySXAbuRMfrniIyfmuy4_rLQGVCiU9u3ww8Qd3YPm43nwk-P7zPowmAsuohXzOqgun9IVMnRY78pEsjbAnvY/s1600/setpoint.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="307" data-original-width="456" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC_u7l8Pf_gkgILlWs0AMl5Cl-I7Hbfuizhzbvz_b9Lr4lMZUA6mRDlkKQ3ySXAbuRMfrniIyfmuy4_rLQGVCiU9u3ww8Qd3YPm43nwk-P7zPowmAsuohXzOqgun9IVMnRY78pEsjbAnvY/s320/setpoint.PNG" width="320" /></a></div>
<br />
I've limited the low range to 1 - 500mV (90k resistor in series with a 10k trim pot on the 5V rail) but on the high range I've not limited it to 3V but rather the full 5V.<br />
<br />
So now, you can dial in a 5V setpoint. But the output of the LM324 cannot swing to the power rail, but only 2 volts from it - for a maximum of 3V. So, if you crank the load to sink maximum current, and feed a beefy supply, you will rapidly cook the sense resistors.<br />
<br />
Just like I did when I was checking a spare laptop power supply I had lying around. So, yeah, don't to that.<br />
<br />
The fix is simple - put a 10k resistor in series with the 10k pot in the net labelled 'HIGH' above and this will limit the high range to 2.5A. The sense resistors will still get toasty at this load, but should be adequate for short time hobby use.<br />
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0tag:blogger.com,1999:blog-2685787041614376103.post-72685542642144880032014-12-04T23:28:00.003-08:002014-12-04T23:29:03.569-08:00nrf51822 QFN48 Reference Design<h2>
Giving Back</h2>
The other day I was looking at my blog stats, I was surprised to find that my <a href="http://ludzinc.blogspot.com.au/2014/04/whats-all-this-kicad-stuff-anyhow.html">KiCAD</a> <a href="http://ludzinc.blogspot.com.au/2014/05/closing-kicad-gaps.html">posts</a> were linked to, where someone was wanting help converting an <a href="https://devzone.nordicsemi.com/question/18183/kicad-version-of-nrf51822-qfn48-reference-design/">Altium reference design</a> into KiCAD.<br />
<br />
So, I thought I'd help out - here's the reference designs, converted to KiCAD PCB.<br />
<br />
<a href="https://sites.google.com/site/ludzincdownloads/nrf51822-qfn48-reference-design/nrf51x22%20KiCAD.zip?attredirects=0&d=1">Enjoy!</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgncFA1YzFKNlZS83RKFL5PrVdSXd_cezBSRyXHLE5xz0HcXUMqIQBxvy9MuTLVgJAKW6gNIKe5yk7DEcFXeIciZB_XZAqkU-hYsNQYvQF2lmutt2NHIfO1kMoUxl7J0fXaOPAuUFii2y7E/s1600/nrf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgncFA1YzFKNlZS83RKFL5PrVdSXd_cezBSRyXHLE5xz0HcXUMqIQBxvy9MuTLVgJAKW6gNIKe5yk7DEcFXeIciZB_XZAqkU-hYsNQYvQF2lmutt2NHIfO1kMoUxl7J0fXaOPAuUFii2y7E/s1600/nrf.png" height="308" width="320" /></a></div>
<br />
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com1tag:blogger.com,1999:blog-2685787041614376103.post-27385653548154707252014-12-02T03:26:00.000-08:002019-07-12T04:13:24.237-07:00KiCAD Tidbits<h2>
KiCAD, For Profit!</h2>
I recently picked up a small contract for a board design, and the client wanted to use KiCAD.<br />
<br />
I'd dabbled with <a href="http://ludzinc.blogspot.com.au/2014/04/whats-all-this-kicad-stuff-anyhow.html">KiCAD</a> before, and even though I wont favour it over Altium, it's still a useful package, at a great price :)<br />
<br />
But, it's not without it's quirks.<br />
<br />
<h2>
All About The Angles</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Pnsf2z1x_r6M6JuKpXKbC50as5duAZ8IecoQhZfDMliU3yCXW_f11FrfeixFeoi0MybaKauClXydHHeRqloJkYDvjeSMqKqq8sOqpvxXkOSRbk2yLiRMh_ypGWGQg4XJjAML9XrKCLwM/s1600/crazy+loop+completion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Pnsf2z1x_r6M6JuKpXKbC50as5duAZ8IecoQhZfDMliU3yCXW_f11FrfeixFeoi0MybaKauClXydHHeRqloJkYDvjeSMqKqq8sOqpvxXkOSRbk2yLiRMh_ypGWGQg4XJjAML9XrKCLwM/s1600/crazy+loop+completion.png" width="320" /></a></div>
<br />
<a name='more'></a>When faces with a dense board and a lot of fan out, it can be very helpful if you place large IC's at 45 degrees. This (at least in my experience) cuts down the number of via's needed, but at the cost of more board space.<br />
<br />
Anyway, KiCAD doesn't have a problem with placing pars at non-orthogonal angles ,but when you try to route long traces, the router gets wigged out.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI7S031hyphenhyphen2_fQwwEHJeFwx8vg0ReTbxdqu11EeJSxtD6XuQc3rct03g1pEICMHkwQbXk25fg8QAVtuYBO6Go2m-BKzGn7nDTqRXn723cEzj6Kds1P9iPGsdfU8gUrWv_bgfN6EOvXO-Nxm/s1600/image+(9).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI7S031hyphenhyphen2_fQwwEHJeFwx8vg0ReTbxdqu11EeJSxtD6XuQc3rct03g1pEICMHkwQbXk25fg8QAVtuYBO6Go2m-BKzGn7nDTqRXn723cEzj6Kds1P9iPGsdfU8gUrWv_bgfN6EOvXO-Nxm/s1600/image+(9).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here the trace is following the existing traces, and I'm dragging the mouse down and to the right. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGcEY6ovtzliyatcguFigO2j24aZS-VZ_y_nYjS0k2rgSb0EMKhtb9IDWX0YcxjPvlgFefYQakEwKUDVVNoLgs6uQewMM_VWtPk0CML6SGRx86d6y6JkY0qV9CGI-pmyvnUIJUAeJX8CFi/s1600/image+(10).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGcEY6ovtzliyatcguFigO2j24aZS-VZ_y_nYjS0k2rgSb0EMKhtb9IDWX0YcxjPvlgFefYQakEwKUDVVNoLgs6uQewMM_VWtPk0CML6SGRx86d6y6JkY0qV9CGI-pmyvnUIJUAeJX8CFi/s1600/image+(10).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then this happens. Sigh. You need to 'anchor' your trace early and often to keep it close to your intended route. Not a deal breaker, but just inefficient.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcYiNIpolbGQeOivKcPFJMIY-YAf5WOjUcQWnJJANukrse6rXdAgHydTI3AeulhVnbs727g9iUxLHrYxiAyAx1BixwxijXJc87byagFFiRDh_ecJ7psM2EMSQRO8KILZG2KJU1dhudZMNb/s1600/image+(11).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcYiNIpolbGQeOivKcPFJMIY-YAf5WOjUcQWnJJANukrse6rXdAgHydTI3AeulhVnbs727g9iUxLHrYxiAyAx1BixwxijXJc87byagFFiRDh_ecJ7psM2EMSQRO8KILZG2KJU1dhudZMNb/s1600/image+(11).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And then this happens, you get a kink in the corner. Once again, not a deal breaker, but more work for you to fix.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOtOeo1taVShD8pam89vukIGRT374VMQqD4EFUvZGpbAR-EAs7YWwcrs5wZHxrefFGTulgus9a87jiWBXGs9myNRdSkr85kwWLvmWJueNLgcsiyzeQpt5wPReZ4tQMcstXFUY1jyqyDuQt/s1600/image+(8).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOtOeo1taVShD8pam89vukIGRT374VMQqD4EFUvZGpbAR-EAs7YWwcrs5wZHxrefFGTulgus9a87jiWBXGs9myNRdSkr85kwWLvmWJueNLgcsiyzeQpt5wPReZ4tQMcstXFUY1jyqyDuQt/s1600/image+(8).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There is one real peeve I have with this behaviour. Sometimes, you may end up with a small bump in a trace. You then try to run a long trace parallel to this, and as this tiny section violates a clearance rule, poof, your freshly laid trace vanishes. </div>
<br />
The first few times this happened, it was confusing, but once you recognise the behaviour, you need to search and destroy the bumps. <br />
<br />
So routing is a chore with KiCAD. You could lay out the worlds most complicated boardin KiCAD but you'll be much older by the time it's done...<br />
<br />
<h2>
Push and Shove (A Bit)</h2>
Relatively new to KiCAD is push and shove routing, which is a big time saver if you need to nudge a bunch of traces over for room.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjeesXBhtLP0JiZlUDHtNxPi4UaO4kVQkrAnT0iQaIt9AQtIdCRKvRpT1le3OqN9gZFfq5l7saBsDv5lQV-GowYtcVNxCuVNtk5i2mMe3FDNLPuJF79xn5l13iF4yZ5wgbgzQzj4si-cbp/s1600/image+(12).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjeesXBhtLP0JiZlUDHtNxPi4UaO4kVQkrAnT0iQaIt9AQtIdCRKvRpT1le3OqN9gZFfq5l7saBsDv5lQV-GowYtcVNxCuVNtk5i2mMe3FDNLPuJF79xn5l13iF4yZ5wgbgzQzj4si-cbp/s1600/image+(12).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here you can see it shoving 5 trace to the side, great!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgAkG4ba5z5AM-y0dNhaB9o6gO7M6biOh1TQIhuP9syuneEAf-7-wDN1AuRxYDuvHsrhiBZdFQr8l4_wDhRE-twNf-SX84w4pa15v0hf7hiVAHEFa82M_-WxCq7YeIjBA1KJkLa8232FHH/s1600/image+(13).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgAkG4ba5z5AM-y0dNhaB9o6gO7M6biOh1TQIhuP9syuneEAf-7-wDN1AuRxYDuvHsrhiBZdFQr8l4_wDhRE-twNf-SX84w4pa15v0hf7hiVAHEFa82M_-WxCq7YeIjBA1KJkLa8232FHH/s1600/image+(13).png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But when the traces stack up, the Push and Shove fails. In the above shot, there is no way the races are moving. Time to delete and re-do, the old fashioned way :(</div>
<br />
<h2>
Random Stuff</h2>
<div>
KiCAD, in one respect, will never be boring. For example, when defining a plane, it decided to do this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDYeBKLBoGyoq4gXideS6P-KkQ5H1mLu6PEstaMQ3brg-ap_42O59QKhoWAxo_NkxFwGZE4WQweZjPSxkqVjPRBlqNwDj6lXfyY3Dve-sFQFCtJVZJnehPirUD-mUgTBnsx7XweFJDIebA/s1600/pla+ne+explosion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDYeBKLBoGyoq4gXideS6P-KkQ5H1mLu6PEstaMQ3brg-ap_42O59QKhoWAxo_NkxFwGZE4WQweZjPSxkqVjPRBlqNwDj6lXfyY3Dve-sFQFCtJVZJnehPirUD-mUgTBnsx7XweFJDIebA/s1600/pla+ne+explosion.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So not boring, but not nice either. Just exit, don't save, and try again. Tedious...</div>
<br />
<h2>
When connected Isn't</h2>
KiCAD, when checking for connected nets, seems to use the track's ends, not what the track itself is touching.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs5chwiZfs15OGsmUCSEraXL_wkAW7q8aSVL0fsjNzgykCXAD8ou-hKeAYXKKqJ4aaEA5OgJs-CXllE1Kd7QvjlFZcOW11MOw31hEkM86MBivwsql-uIjUNdrEPBWdRnFIDvWE_SDUJ81H/s1600/not+connected+net.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs5chwiZfs15OGsmUCSEraXL_wkAW7q8aSVL0fsjNzgykCXAD8ou-hKeAYXKKqJ4aaEA5OgJs-CXllE1Kd7QvjlFZcOW11MOw31hEkM86MBivwsql-uIjUNdrEPBWdRnFIDvWE_SDUJ81H/s1600/not+connected+net.png" width="320" /></a></div>
<br />
In the above pic, pins 2 and 4 are very much connected, but you can see the rats net where KiCAD believes that they are not connected. I did't work it out but a friend pointed out to me that as my trace runs from pin 2 to 6 *without an end in pin 4* the DRC fails.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlZQ4kzBpxncxSoEiUfrHkMDLWzc80hrK76QHJYo5FxeJBHz4KhvnxLu8ijoAFbtBEOWGrMXWgGrIc5fJwQttuTlyKtTyhjHyg4SPKhxdla6oe9QT-Aj6OBnbCjaI2TCrYCg35zbrPG7Gs/s1600/not+connected+net+00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlZQ4kzBpxncxSoEiUfrHkMDLWzc80hrK76QHJYo5FxeJBHz4KhvnxLu8ijoAFbtBEOWGrMXWgGrIc5fJwQttuTlyKtTyhjHyg4SPKhxdla6oe9QT-Aj6OBnbCjaI2TCrYCg35zbrPG7Gs/s1600/not+connected+net+00.png" width="283" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here is a better example using a via drawn in outline mode. You can see the traces touch the via, but don't meet in the centre, and the rats nest marker is there showing KiCAD's displeasure.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB4XVveStOErfm0G6SvYYUvh_xDX556dXK2Dg3LHFgb6mtUUdvh0jvA12VrLGcTYj-UwEPpAY3edAdmZJijQGG_mbu6rAatx_NDRtdNUwV5Dna4j3zA187U3w8HJSN9zRY1uZHwpZo4XGB/s1600/not+connected+net+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB4XVveStOErfm0G6SvYYUvh_xDX556dXK2Dg3LHFgb6mtUUdvh0jvA12VrLGcTYj-UwEPpAY3edAdmZJijQGG_mbu6rAatx_NDRtdNUwV5Dna4j3zA187U3w8HJSN9zRY1uZHwpZo4XGB/s1600/not+connected+net+01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The fix is to join up all the segments, with tracks that run to the centre of the via. AT the end of the day this makes zero difference to the gerbers that get generated, but the OCD in me lives to see zero errors in the DRC.</div>
<br />
Until the DRC screws you, that is....<br />
<br />
<h2>
DRC SNAFU</h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FfWw6i8-amaI_3PJ27Zc5UJiLV7U-uiJyijJGLe6fhNtulCzCiIy0bKH44BpAbKJr5aVTCjVFGQjhgE8HA5LfnONRmawBtCydGEa32Iw9M4VPWibrRpGsAjW5Ua7LJGdQAgSTtJJGR3R/s1600/drc+snafu+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FfWw6i8-amaI_3PJ27Zc5UJiLV7U-uiJyijJGLe6fhNtulCzCiIy0bKH44BpAbKJr5aVTCjVFGQjhgE8HA5LfnONRmawBtCydGEa32Iw9M4VPWibrRpGsAjW5Ua7LJGdQAgSTtJJGR3R/s1600/drc+snafu+1.png" width="268" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As I'd set pretty lose tolerances of 0.00" trace and clearance, I wanted the DRVC to pick up on this. And immediately it found one, only one, error and aborted the DRC.</div>
<div>
<br /></div>
<div>
Double clicking on the DRC message (a nice feature) takes you to the location of the error, as seen below:</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGdQz4dRjwEaUhzwANMEuWFSXCa4oW_5IwgX6SHRJDfop3RyGoHJ-iG8g1plGjNEjkfisGJYE8ZWQjY16z5DsIkXpW-yQowD035oVhhPb__Vib4UdzwtV0XrTUFzGvslI1FAEpryDo-Xc7/s1600/drc+snafu+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGdQz4dRjwEaUhzwANMEuWFSXCa4oW_5IwgX6SHRJDfop3RyGoHJ-iG8g1plGjNEjkfisGJYE8ZWQjY16z5DsIkXpW-yQowD035oVhhPb__Vib4UdzwtV0XrTUFzGvslI1FAEpryDo-Xc7/s1600/drc+snafu+2.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Out by the board's origin, there's some mythical 0.005" trace that i can't get rid of, and the DRC won't play nice with this error. To get the DRC to run, if you set minimum track width to 0.005", he DRC will complete and show you the rest of your errors.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
But this is bad - if I have a 0.006" trace out there, I'll never find it with this DRC engine.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Text Based Search</h2>
<div>
To find a part in the PCB or Schematic, Ctrl-F brings up a typical search dialog, and if you are looking for R127, you'll be taken right to it, either in PCB or SCH, depending on where you're currently working.</div>
<div>
<br /></div>
<div>
But if you were to search for C2, you will be shown C20, C22, C221 etc until you cycle around to C2. So annoying.</div>
<div>
<br /></div>
<h2>
Other Gripes</h2>
<div>
Some other issues I have with KiCAD include:</div>
<div>
<ul>
<li>No copy / paste in PCB</li>
<li>Can't just place a via, must place one with a trace</li>
<li>No copy / paste in PCB</li>
<li>Trace completion that give radical, mad loops </li>
<li>You have the ability to turn off individual rats nets, but not turn them ON. Argh!</li>
<li>No copy / paste in PCB!</li>
</ul>
<h2>
In Conclusion</h2>
</div>
<div>
KiCAD is here to stay. Circuit Maker may give it a run for it's money when it finally comes out, and with some work, it could be a real player. Copy / Paste is a must.</div>
<div>
<br /></div>
<div>
And finally, if I ever have another KiCAD contract, I'm doubling my time estimate. The layout tool needs a lot of improvement. But it is the right price for home hobby stuff!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<br /></div>
Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com2tag:blogger.com,1999:blog-2685787041614376103.post-87567172480654780772014-10-15T04:44:00.003-07:002014-10-15T04:44:33.838-07:00Bright Light<h2 style="clear: both; text-align: left;">
The Workshop</h2>
<div>
At home I've seconded a small corner of my garage for my work space. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPeUoylrze70Motrpd36tyKzaPPINj6m055mq3CdxzXnPFyAw3REffdq0sJz3dJgT0EeRG1xSEKwEGsYW5kP6lekaIBcfeH2SW-NW51ebk7HHFj0XEcJm956ht_r8qwPpUg7fzae9Uq1FD/s1600/IMG_2468.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPeUoylrze70Motrpd36tyKzaPPINj6m055mq3CdxzXnPFyAw3REffdq0sJz3dJgT0EeRG1xSEKwEGsYW5kP6lekaIBcfeH2SW-NW51ebk7HHFj0XEcJm956ht_r8qwPpUg7fzae9Uq1FD/s1600/IMG_2468.JPG" height="239" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You could describe it as 'spartan' or 'functional' but in reality, 'cheap' is more accurate. One problem with the bench is that it's poorly lit.</div>
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglMaqEFRhm_InppkulSdzmNkAOzP2EbvbD1_VcLnoa1a2v1Fnv060jLrYeHHzD-TK4Ljy4Vem3vccm3HN7s3w_-JzzIwxoOsfSb0j6ZFe64NfcSwJfDwc_f0u6dEoutIyDh4j5BD5efVKs/s1600/IMG_2939.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglMaqEFRhm_InppkulSdzmNkAOzP2EbvbD1_VcLnoa1a2v1Fnv060jLrYeHHzD-TK4Ljy4Vem3vccm3HN7s3w_-JzzIwxoOsfSb0j6ZFe64NfcSwJfDwc_f0u6dEoutIyDh4j5BD5efVKs/s1600/IMG_2939.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So the other day on my walk home, I found this on the road - it had a busted lens on it (that I forgot to photograph) but it had five 1 watt leds.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
AND they worked! Plus the mounting hardware was there to make installation a snap.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfJ2dUWdt7olQQmoG4Nrk_Gw8pJ0ldnKmgR2UvCPvZXzRw8uhkXGLcmHTQQXSUUR3MRSA-d_4zt7MokzrovWp0Aa5VF75k42tzFo3NNuIo7B_WrIbOgDRl8T5CAhdcCDEjl28q4F2ZwSBr/s1600/IMG_2940.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfJ2dUWdt7olQQmoG4Nrk_Gw8pJ0ldnKmgR2UvCPvZXzRw8uhkXGLcmHTQQXSUUR3MRSA-d_4zt7MokzrovWp0Aa5VF75k42tzFo3NNuIo7B_WrIbOgDRl8T5CAhdcCDEjl28q4F2ZwSBr/s1600/IMG_2940.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Argh, but nothing comes for free. The leds still cast a lot of light to the side that I just found blinding.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0P9e8qq-50flxXYqJnvc1WxAZ96d-hivCEoH_JR794434lx5U5RWiU1GaVDeLci82Q6MjbN8Ws7v31RuMRvoprb2B4ZEc5IYcdHDWCt5ekOZ4tsNvT3JnWBthOlcqRexwotj9K14tf9T/s1600/IMG_2941.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0P9e8qq-50flxXYqJnvc1WxAZ96d-hivCEoH_JR794434lx5U5RWiU1GaVDeLci82Q6MjbN8Ws7v31RuMRvoprb2B4ZEc5IYcdHDWCt5ekOZ4tsNvT3JnWBthOlcqRexwotj9K14tf9T/s1600/IMG_2941.JPG" height="320" width="239" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Some electrical tape, and a cut up Red Bull tin soon fixed that. Woot.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Onto the next project!</div>
<br />Ludzinchttp://www.blogger.com/profile/17715825628278881631noreply@blogger.com0