{"id":75,"date":"2012-04-16T19:43:15","date_gmt":"2012-04-17T00:43:15","guid":{"rendered":"http:\/\/lutorm.wordpress.com\/?p=75"},"modified":"2012-04-16T19:43:15","modified_gmt":"2012-04-17T00:43:15","slug":"high-performance-wine-storage-system-6-troubleshooting","status":"publish","type":"post","link":"https:\/\/blog.familjenjonsson.org\/blog\/2012\/04\/16\/high-performance-wine-storage-system-6-troubleshooting\/","title":{"rendered":"High Performance Wine Storage System #6: Troubleshooting"},"content":{"rendered":"<p>This is post #6 describing the wine storage unit upgrade. See the <a title=\"introduction\" href=\"http:\/\/atom.familjenjonsson.org\/blog\/2012\/03\/27\/the-high-performance-wine-storage-system-introduction\/\">introduction post<\/a>\u00a0for the background.<\/p>\n<p>Time to start testing things. I had managed to burn the Arduino bootloader onto the Atmega 328, and I had previously written some test code to exercise the front panel LED display. The big thing to test now was the H-bridge to the cooler. This turned out to be more of a problem than I&#8217;d anticipated. Suffice to say that I&#8217;m not very experienced with switching circuits, and the amount of \u00a0noise generated when the bridge turned on was a way bigger problem than I&#8217;d anticipated. It screwed up the communication to the temperature probes, and initially it would even reset the Atmega when it first turned on. Highly suboptimal&#8230;<\/p>\n<div id=\"attachment_76\" style=\"width: 555px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76\" class=\"size-full wp-image-76\" title=\"Troubleshooting\" src=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021.jpg\" alt=\"Troubleshooting\" width=\"545\" height=\"643\" srcset=\"https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021.jpg 2592w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021-126x150.jpg 126w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021-846x1000.jpg 846w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_55021-1000x1181.jpg 1000w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><p id=\"caption-attachment-76\" class=\"wp-caption-text\">This is me trying to figure out what the problem was with the H-bridge. I'm really happy I got that oscilloscope, without it I would have been totally stumped!<\/p><\/div>\n<p>The key realization was to put an inductor in series with the thermoelectric element. This prevented the current rush and made everything much more well behaved. Below is a screenshot of the oscilloscope showing the inductor and thermoelectric element voltages during the switching cycle. There are still substantial spikes at the switches, but it&#8217;s at least low enough to not reset the Atmega \u00a0microcontroller.<\/p>\n<div id=\"attachment_64\" style=\"width: 555px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-64\" class=\"size-full wp-image-64\" title=\"tec_scope\" src=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123.png\" alt=\"Oscilloscope image\" width=\"545\" height=\"408\" srcset=\"https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123.png 800w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123-150x112.png 150w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123-300x225.png 300w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/20120413_362123-600x450.png 600w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><p id=\"caption-attachment-64\" class=\"wp-caption-text\">The switched output to the cooler using a 5uH inductor. The yellow line is the H-bridge output voltage, the red line the voltage across the inductor, and the green line (which is yellow minus red) the voltage across the thermoelectric element.<\/p><\/div>\n<p>The communication with the temperature probes now worked fine, but the front panel was still a problem. Since there&#8217;s much more data going that way, it was running in 1-wire &#8220;overdrive&#8221; mode, so the speed was higher. Even after adding a number of bypass capacitors by the connectors to the 1-wire probes, it would still refuse to communicate. (I found this good article on <a href=\"https:\/\/www.google.com\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CEoQFjAA&amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.63.8273%26rep%3Drep1%26type%3Dpdf&amp;ei=H7aMT9CdB4fs0gGw_tH4CQ&amp;usg=AFQjCNE7cQQLE35cZylLwxfUm4Zn5vEXbA\">&#8220;Power Supply Noise Reduction&#8221;<\/a> that I wish I&#8217;d read before designing the circuit board. There were some rules of thumb, obvious in highsight, that I wasn&#8217;t aware of.)\u00a0Since there was no way I could put an inductor on the board, I ended up making a little &#8220;extension cord&#8221; to the connector to the thermoelectric element. It looks a bit hoaky, but this is prototyping at its finest&#8230;<\/p>\n<div id=\"attachment_77\" style=\"width: 555px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-77\" class=\"size-full wp-image-77\" title=\"Inductor\" src=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513.jpg\" alt=\"Inductor\" width=\"545\" height=\"363\" srcset=\"https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513.jpg 3888w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513-150x100.jpg 150w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513-300x200.jpg 300w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513-1000x666.jpg 1000w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5513-600x400.jpg 600w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><p id=\"caption-attachment-77\" class=\"wp-caption-text\">The connection to the thermoelectric cooler, with the 5uH inductor retrofitted as a short &quot;extension cord&quot; before connecting the cooler.<\/p><\/div>\n<p>To &#8220;solve&#8221; the communication problem, I resorted to just turning off the cooler while sending things to the front panel. This lowers the maximum cooling power a bit, but it only takes a few milliseconds a couple of times per second, so it&#8217;s not a big deal.<\/p>\n<div id=\"attachment_79\" style=\"width: 555px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-79\" class=\"size-full wp-image-79\" title=\"Back boards\" src=\"http:\/\/atom.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512.jpg\" alt=\"Back boards\" width=\"545\" height=\"363\" srcset=\"https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512.jpg 3888w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512-150x100.jpg 150w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512-300x200.jpg 300w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512-1000x666.jpg 1000w, https:\/\/blog.familjenjonsson.org\/blog\/wp-content\/uploads\/2012\/04\/mg_5512-600x400.jpg 600w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><p id=\"caption-attachment-79\" class=\"wp-caption-text\">The circuit boards on the back. To the right is the power supply board that was originally there, on the left (with the oscilloscope probes attached) the board I made.<\/p><\/div>\n<p>The biggest remaining problem was that I kept burning out the ADP3120A driver chips for the H-bridge. It was always the same one, the one that should just keep the low-side MOSFET on continuously during cooling operation. After replacing 4 of them (at about a buck fifty each) I said &#8220;screw it&#8221; and just hardwired that MOSFET to be on all the time. I can live without \u00a0heating ability for now, especially since we&#8217;re moving to LA and are unlikely to need to heat the wine in the foreseeable future. I really don&#8217;t know what was going on, I double checked the wiring several times and the to 3120&#8217;s were connected exactly identically.<\/p>\n<p>I also ended up with an even bigger &#8220;event&#8221;: After adding the inductor, there was an uncomfortably large voltage spike when the bridge turned off, -35V or so. This is apparently expected according to the H-bridge articles I had read and is because it takes a while for the internal source-drain diodes in the MOSFET to start conducting. Since the inductor current has to flow, the inductor voltage builds up quickly. The solution recommended in those articles were to put a capacitor across the H-bridge output, so the current would go into charging the capacitor until the source-drain diodes start conducting. Not having any indication of how big such capacitor should be, I took one of the plentiful 1uF SMD capacitors I had. After soldering this on, the power supply would refuse to start when I plugged it in. (It has a LED that indicates whether the output is at 12V.) This seemed very strange, but after a few tries it started. However, when I attached the oscilloscope probes, I saw to my horror that both the 5V and 12V rails were swinging to +-10-20V. I have no idea what caused this, but the Atmega did not survive! When I changed the capacitor to 470pF, everything seemed fine and I haven&#8217;t had any problem since.<\/p>\n<p>If anyone has any idea what might have caused this, please let me know. The weird thing is that the H-bridge shouldn&#8217;t even be on when the power comes on, the disable input to the ADP3120A is pulled down and I&#8217;m pretty sure the Atmega outputs start up as high-impedance inputs&#8230;<\/p>\n<p>After desoldering the Atmega (lucky I got that heat gun) and attaching my spare one (another $4.50 in the trash can) it finally seems like things are behaving. Time for the final tuning of the software and testing how well the temperature regulation works.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is post #6 describing the wine storage unit upgrade. See the introduction post\u00a0for the background. Time to start testing things. I had managed to burn the Arduino bootloader onto the Atmega 328, and I had previously written some test code to exercise the front panel LED display. The big thing to test now was &#8230;<\/p>\n<p><a href=\"https:\/\/blog.familjenjonsson.org\/blog\/2012\/04\/16\/high-performance-wine-storage-system-6-troubleshooting\/\" class=\"more-link\">Continue reading &lsquo;High Performance Wine Storage System #6: Troubleshooting&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[5],"tags":[8,11],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-wine-storage","tag-arduino","tag-electronics"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":0,"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.familjenjonsson.org\/blog\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}