{"id":1170,"date":"2020-12-27T00:00:00","date_gmt":"2020-12-26T22:00:00","guid":{"rendered":"http:\/\/www.ljudmila.org\/~savskib\/?p=1170"},"modified":"2024-12-30T22:43:04","modified_gmt":"2024-12-30T20:43:04","slug":"tech-for-name-policijska-ura","status":"publish","type":"post","link":"https:\/\/www.turborebop.net\/?p=1170","title":{"rendered":"Tech for NAME: POLICIJSKA URA (-> curfew)"},"content":{"rendered":"<p>This is some help on the level of electronics and arduino programming to bring NAME:&#8217;s idea of &#8220;policijska ura&#8221; (-&gt; curfew) to materialization.<\/p>\n<p><iframe loading=\"lazy\" title=\"NAME: POLICIJSKA URA | CURFEW\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/C-nNanV95OE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p><strong>LED lights<br \/>\n<\/strong>Name: had a large number of LED lights taken from a Lidl&#8217;s dump. Each of these led strips originally used a separate constant current driver (42V \/ 300mA), which was useless for this project. In the end we used a simple current limiting resistor per led strip -&gt; 39ohms \/ 0.5W and one PSU block with 43Vdc (toroidal transformer needed to have some additional turns of wire added &#8211; to bring it from 4x12V\/5A to 2x24V\/5A &#8211; and finally to 1x 30V\/10A).<\/p>\n<p>Since the number of segments needed for the six digit display was large (42 segments) &#8211; we had to add additional 24V LED strips which had current limitiing. Luckily &#8211; two of these in series were able to provide enough light even at 43Vdc.<\/p>\n<p>To drive LED segments from microcontroller &#8211; each segment got a MOSFET transistor driver &#8211; 42 of them. I tried some smarter options first (like reading the differential voltages at the dedicated led driver chips &#8211; this would reduce the need for three arduinos to one; the best solution could be this chip and optocouplers &#8211; but optocouplers are quite expensive&#8230;), but at the end the simplest solution was to use three arduino uno with I2C connections. One is master (seconds), the other two are slaves (minutes, hours). So: each arduino has 2&#215;7 pins\u00a0 to drive directly (without scanning!) the relevant digit segments. The master arduino has some additional options on four analog pins. This includes a simple tick sound &#8211; via a dedicated loudpeaker MOSFET driver (linking to 43Vdc PSU). Arduinos are powered with one 9V wall adapter &#8211; and paralleled via +5V and GND pins.<\/p>\n<p>The code can be downloaded here:<br \/>\n<a href=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/0202\/12\/CountDownEightSegmentI2C_5.ino_.txt\">CountDownEightSegmentI2C_5.ino<\/a><br \/>\n(remove the .txt at the end of filename, create CountDownEightSegmentI2C_5 folder and put the .ino file into it.<\/p>\n<p>Below are various stages with the focus here on my work. The 6 x 7 MOSFET driver board + loudspeaker driver (BUZ11). The 42 MOSFETs for LED strips were much cheaper IRFD110. Simple 39 ohm current limiting resistors were fine.<\/p>\n<p>Testing was also done on two dedicated led driver chips:<br \/>\n&#8211; TM1638 chip with arduino library TM1638plus.h (green display below)<br \/>\n&#8211; MAX7219 chip with LedControl.h MAX7219 library<br \/>\n&#8211; at the end no special arduino library was needed<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-1170 gallery-columns-3 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image004.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"224\" height=\"300\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image004-224x300.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image004-224x300.jpg 224w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image004-768x1027.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image004-766x1024.jpg 766w\" sizes=\"auto, (max-width: 224px) 100vw, 224px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image002.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image002-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image002-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image002-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image002-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image006.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image006-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image006-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image006-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image006-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><br style=\"clear: both\" \/><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image008.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image008-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image008-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image008-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image008-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image005.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image005-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image005-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image005-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image005-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image014.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image014-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image014-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image014-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image014-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><br style=\"clear: both\" \/><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image017.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image017-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image017-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image017-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image017-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image016.jpg' class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"224\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image016-300x224.jpg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image016-300x224.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image016-768x574.jpg 768w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2021\/01\/image016-1024x766.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n\n<p><strong>Advanced: LED strips and current limiting<br \/>\n<\/strong>LED is a diode which is used in so-called forward direction. In general diode is used for rectification of alternating current. It has a so-called forward threshold voltage level. This means that the signal voltage over the diode has to go over the threshold &#8211; for the current to run. Once this is over the current would run freely &#8211; and even in excess (-&gt; burn the diode). Usual Si diodes have threshold voltage around 0.6V.<\/p>\n<p>LED is a diode made of different material than Si &#8211; with around 3.0V threshold voltage (&lt;- the white color LED!). 12 LEDs in series is a LED strip that has around 36V threshold voltage. We have to go over this with voltage &#8211; and at the same time limit the current to around 200mA &#8211; with a series resistor. A resistor of 39 ohms at this current has a voltage drop of about 7.8V. This would mean that our power supply voltage should be around 43.5V.<\/p>\n<p><a href=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2020\/12\/arduino_mega.jpg\" class=\"thickbox no_icon\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1197 alignright\" src=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2020\/12\/arduino_mega-300x190.jpg\" alt=\"\" width=\"360\" height=\"228\" srcset=\"https:\/\/www.turborebop.net\/wp-content\/uploads\/2020\/12\/arduino_mega-300x190.jpg 300w, https:\/\/www.turborebop.net\/wp-content\/uploads\/2020\/12\/arduino_mega.jpg 520w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/a>Last but not least:<br \/>\n&#8211; could be solved with Arduino Mega 2560 -&gt; arduino 8-bit board with 54 pins<br \/>\n&#8211; and without I2C serial master-slave communiction<br \/>\n<a href=\"https:\/\/store.arduino.cc\/arduino-mega-2560-rev3\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/store.arduino.cc\/arduino-mega-2560-rev3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is some help on the level of electronics and arduino programming to bring NAME:&#8217;s idea of &#8220;policijska ura&#8221; (-&gt; curfew) to materialization. LED lights Name: had a large number of LED lights taken from a Lidl&#8217;s dump. Each of these led strips originally used a separate constant current driver (42V \/ 300mA), which was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1171,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,9,1,3],"tags":[16,40,23,17],"class_list":["post-1170","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devices","category-turboblog","category-archive","category-tech","tag-arduino","tag-builds","tag-collaborations","tag-objects"],"_links":{"self":[{"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1170"}],"version-history":[{"count":1,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":2304,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions\/2304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=\/wp\/v2\/media\/1171"}],"wp:attachment":[{"href":"https:\/\/www.turborebop.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.turborebop.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}