https://electronics.cba.si/index.php?title=Control_Relays_With_AVR&feed=atom&action=historyControl Relays With AVR - Revision history2024-03-28T10:19:15ZRevision history for this page on the wikiMediaWiki 1.34.2https://electronics.cba.si/index.php?title=Control_Relays_With_AVR&diff=1837&oldid=prevPit at 21:50, 5 November 20162016-11-05T21:50:40Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 21:50, 5 November 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l52" >Line 52:</td>
<td colspan="2" class="diff-lineno">Line 52:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cheers,</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cheers,</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[User:Pit|pit]], <del class="diffchange diffchange-inline">2011</del>-07-15</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[User:Pit|pit]], <ins class="diffchange diffchange-inline">2015</ins>-07-15</div></td></tr>
</table>Pithttps://electronics.cba.si/index.php?title=Control_Relays_With_AVR&diff=1722&oldid=prevPit at 09:09, 15 July 20152015-07-15T09:09:11Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:09, 15 July 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l41" >Line 41:</td>
<td colspan="2" class="diff-lineno">Line 41:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Image:pit_relay_dev1.jpeg|'''Fig.1:''' The device during first boot up.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Image:pit_relay_dev1.jpeg|'''Fig.1:''' The device during first boot up.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Image:pit_prog5.jpg|'''Fig.5:''' The device being programmed (via [[AVR_Programmer_Pogo_Adapter]]).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Image:pit_prog5.jpg|'''Fig.5:''' The device being programmed (via [[AVR_Programmer_Pogo_Adapter]]).</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Image:Pit_relay_box.jpeg|'''Fig.6:''' Not yet fully wired but already in some app-box.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></gallery></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></gallery></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Is it good?=</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Is it good?=</div></td></tr>
</table>Pithttps://electronics.cba.si/index.php?title=Control_Relays_With_AVR&diff=1720&oldid=prevPit at 08:57, 15 July 20152015-07-15T08:57:48Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 08:57, 15 July 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l51" >Line 51:</td>
<td colspan="2" class="diff-lineno">Line 51:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cheers,</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cheers,</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[User:Pit|pit]], 2011-07-<del class="diffchange diffchange-inline">11</del></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[User:Pit|pit]], 2011-07-<ins class="diffchange diffchange-inline">15</ins></div></td></tr>
</table>Pithttps://electronics.cba.si/index.php?title=Control_Relays_With_AVR&diff=1719&oldid=prevPit: Created page with "__NOEDITSECTION__ Category: Projects done Category: Author_Pit ''How to control relays/coils/selenoids with an AVR (or any other MCU).'' Image:pit_relay_dev1.jpeg|th..."2015-07-15T08:57:28Z<p>Created page with "__NOEDITSECTION__ <a href="/index.php?title=Category:Projects_done&action=edit&redlink=1" class="new" title="Category:Projects done (page does not exist)">Category: Projects done</a> <a href="/index.php?title=Category:Author_Pit&action=edit&redlink=1" class="new" title="Category:Author Pit (page does not exist)">Category: Author_Pit</a> ''How to control relays/coils/selenoids with an AVR (or any other MCU).'' Image:pit_relay_dev1.jpeg|th..."</p>
<p><b>New page</b></p><div>__NOEDITSECTION__<br />
[[Category: Projects done]]<br />
[[Category: Author_Pit]]<br />
''How to control relays/coils/selenoids with an AVR (or any other MCU).''<br />
[[Image:pit_relay_dev1.jpeg|thumb|'''Fig.1:''' The first LED blink on board.]]<br />
<br />
=What's this all about?=<br />
Want to use high current load outputs in your projects? Here I present you the easiest way of doing it.<br />
This allows me to use MCU based low voltage control system in any other automatics standard system.<br />
<br />
=What is it exactly?=<br />
Lawn watering systems got really accessible in recent years. Why not just use few valves to water whole lawn nicely?<br />
But these electro-valves (selenoids) take much current... Why not control these via relays?<br />
But relays are easier to get for rather high (compared to MCU) voltage control... So why not use the typical common-emitter circuitry?<br />
Yeah, the ULN2803 has some protection agains inductive loads built in. <br />
<br />
=The device=<br />
''Implementing timer in this device would complicate it a lot. Crystal, inputs to set clock, display to check clock... The PCB would get at least twice as big. I decided to simplify the design and drop the software timer idea. Instead, an electromechanical rotary wall-outlet mount programmer will be used to set when this is going to work.''<br />
<br />
<br />
What I've come up with is a small PCB (visible on Fig.1). What is its rule of operation? <br />
* It enables up to 8 output relays in order ''1'' to ''n''. Then it starts from the number ''1'' again, and so on...<br />
* The number of output relays used in a cycle is given to the device by 4 input lines (with help of a decimal to BCD encoder). The selected number of outputs is being blinked at every boot. <br />
* The default number of relays to use is set in firmware (takes effect when encoder isn't attached (or has value 0 set)). <br />
* The default time for each cycle is 5 minutes. This means, that each relay will be energized for only 5 minutes.<br />
* Each relay can take up to 500mA with the ULN2803.<br />
* One connector (left on '''Fig.3''') is to attach the encoder, other connector (bottom) is used to deliver 24VDC, the last connector (right) is used to connect output relays.<br />
<br />
<br />
The original concept featured some optional LED, but I never used it. Instead there's a switch attached to this AVR input line:<br />
* If the switch is pressed during the boot up, the device only idles w/o energising any relay. This allows to manually open some valve with the pump enabled, etc.<br />
* Keeping the switch pressed for 3 seconds during normal cycle forces the driver to another cycle step, i.e. turn off relay ''2'' and turn on relay ''3''.<br />
<br />
<br />
<br />
=The gallery=<br />
<gallery widths=200px><br />
Image:pit_relay_sch.jpeg|'''Fig.2:''' The schematic.<br />
Image:pit_relay_pcb.jpeg|'''Fig.3:''' The PCB (one sided, no s/c wires).<br />
Image:pit_relay_test.jpeg|'''Fig.4:''' First conceptual test with some tiny13.<br />
Image:pit_relay_dev1.jpeg|'''Fig.1:''' The device during first boot up.<br />
Image:pit_prog5.jpg|'''Fig.5:''' The device being programmed (via [[AVR_Programmer_Pogo_Adapter]]).<br />
</gallery><br />
=Is it good?=<br />
So far it's all been only tested on my desk. No flaws noticed so far, no reason to doubt it will work perfectly well. However I will comment the device once the final app serves it's time.<br />
<br />
<br />
<br />
--<br />
<br />
Cheers,<br />
<br />
[[User:Pit|pit]], 2011-07-11</div>Pit