{"id":2236,"date":"2015-01-23T10:35:34","date_gmt":"2015-01-23T09:35:34","guid":{"rendered":"http:\/\/telefab.fr\/?p=2236"},"modified":"2026-04-30T17:33:59","modified_gmt":"2026-04-30T15:33:59","slug":"lumiduino","status":"publish","type":"projet","link":"https:\/\/hub.imt-atlantique.fr\/fablab\/projet\/lumiduino\/","title":{"rendered":"LUMIDUINO"},"content":{"rendered":"<p><strong>Constat et concept<\/strong><\/p>\n<p>Aujourd\u2019hui, il existe de multiples effets de sons et lumi\u00e8res, pour agr\u00e9menter toutes les soir\u00e9es. Le syst\u00e8me r\u00e9alis\u00e9 porte le nom de lumiduino, c\u2019est un syst\u00e8me tr\u00e8s visuel. Il permet d\u2019afficher une luminosit\u00e9, d\u00e9finie selon l\u2019utilisateur, lors de la pr\u00e9sence de sonorit\u00e9s aux alentours du capteur.<\/p>\n<p>Il est compos\u00e9 d\u2019un capteur et d\u2019un n\u00e9on. Le tout fonctionne par l\u2019utilisation d\u2019un Arduino et d\u2019un code.<\/p>\n<p><strong>Technique<\/strong><\/p>\n<p><em>Pour r\u00e9aliser ce syst\u00e8me, j\u2019ai utilis\u00e9 une carte Aduino, un capteur et enfin un \u00ab\u00a0ring neo-pixel\u00a0\u00bb. J\u2019ai \u00e9labor\u00e9 le code pour me changement de luminosit\u00e9 selon la sonorit\u00e9.<\/em><\/p>\n<p><strong>Perspectives d\u2019am\u00e9liorations<\/strong><\/p>\n<p><em>La synchronisation du changement de couleur peut \u00eatre am\u00e9lior\u00e9e par l\u2019am\u00e9lioration du code existant. Enfin la cr\u00e9ation d\u2019un boitier pour contenir le syst\u00e8me sera int\u00e9ressant pour pourvoir transporter le syst\u00e8me.<\/em><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><strong>Le code<\/strong><\/p>\n<p style=\"text-align: left;\">#include &lt;Adafruit_NeoPixel.h&gt;<\/p>\n<p style=\"text-align: left;\">#define SOUND_SENSOR A0<\/p>\n<p style=\"text-align: left;\">#define PIN 6<\/p>\n<p style=\"text-align: left;\">#define NUMPIXELS\u00a0\u00a0\u00a0\u00a0\u00a0 16<\/p>\n<p style=\"text-align: left;\">Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);<\/p>\n<p style=\"text-align: left;\">void setup() {<\/p>\n<p style=\"text-align: left;\">\u00a0 pixels.begin(); \/\/ This initializes the NeoPixel library.<\/p>\n<p style=\"text-align: left;\">\u00a0 Serial.begin(9600);<\/p>\n<p style=\"text-align: left;\">}<\/p>\n<p style=\"text-align: left;\">void loop()<\/p>\n<p style=\"text-align: left;\">{int sensorValue = analogRead(SOUND_SENSOR);\/\/use A0 to read the electrical signal<\/p>\n<p style=\"text-align: left;\">Serial.print(\u00ab\u00a0sensorValue \u00ab\u00a0);<\/p>\n<p style=\"text-align: left;\">\u00a0Serial.println(sensorValue);<\/p>\n<p style=\"text-align: left;\">If (250 &gt;sensorValue\u00a0 )<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 for(int i=0;i&lt;NUMPIXELS;i++){\u00a0\/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.setPixelColor(i, pixels.Color(0,150,150)); \/\/ Moderately bright green color.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.show(); \/\/ This sends the updated pixel color to the hardware.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 delay(50); \/\/ Delay for a period of time (in milliseconds).<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"text-align: left;\">\u00a0 \u00a0 }<\/p>\n<p style=\"text-align: left;\">else if ( sensorValue &gt; 250 &amp;&amp; sensorValue &lt; 500)<\/p>\n<p style=\"text-align: left;\">{<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 for(int i=0;i&lt;NUMPIXELS;i++){\u00a0\u00a0 \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.setPixelColor(i, pixels.Color(250,100,0)); \/\/ Moderately bright green color.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.show(); \/\/ This sends the updated pixel color to the hardware.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 delay(1); \/\/ Delay for a period of time (in milliseconds).<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 }<\/p>\n<p style=\"text-align: left;\">\u00a0}<\/p>\n<p style=\"text-align: left;\">\u00a0else if ( sensorValue &gt; 500 &amp;&amp; sensorValue &lt; 700)<\/p>\n<p style=\"text-align: left;\">{<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 for(int i=0;i&lt;NUMPIXELS;i++){\u00a0\u00a0 \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.setPixelColor(i, pixels.Color(0,200,0)); \/\/ Moderately bright green color.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.show(); \/\/ This sends the updated pixel color to the hardware.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 delay (5); \/\/ Delay for a period of time (in milliseconds).<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 }<\/p>\n<p style=\"text-align: left;\">\u00a0}<\/p>\n<p style=\"text-align: left;\">\u00a0else<\/p>\n<p style=\"text-align: left;\">{<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 for(int i=0;i&lt;NUMPIXELS;i++) { \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.setPixelColor(i, pixels.Color(250,250,250)); \/\/ Moderately bright green color.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 pixels.show(); \/\/ This sends the updated pixel color to the hardware.<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0\u00a0 delay(1); \/\/ Delay for a period of time (in milliseconds).<\/p>\n<p style=\"text-align: left;\">\u00a0\u00a0 }<\/p>\n<p style=\"text-align: left;\">\u00a0}<\/p>\n<p style=\"text-align: left;\">delay (100);<\/p>\n<p style=\"text-align: left;\">}<\/p>\n<figure id=\"attachment_2237\" aria-describedby=\"caption-attachment-2237\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-content\/uploads\/archives\/2015\/01\/photo.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2237\" src=\"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-content\/uploads\/archives\/2015\/01\/photo-300x225.jpg\" alt=\"Photo du syst\u00e8me en cours de fonctionnement\" width=\"300\" height=\"225\" \/><\/a><figcaption id=\"caption-attachment-2237\" class=\"wp-caption-text\">Photo du syst\u00e8me en cours de fonctionnement<\/figcaption><\/figure>\n","protected":false},"author":1,"featured_media":2237,"parent":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[39,20],"type_projet":[],"class_list":["post-2236","projet","type-projet","status-publish","has-post-thumbnail","hentry","category-a-la-une","category-projets"],"acf":{"objectifs":"","categorie":false,"fichiers_associes":null},"_links":{"self":[{"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/projet\/2236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/projet"}],"about":[{"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/types\/projet"}],"author":[{"embeddable":true,"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/projet\/2236\/revisions"}],"predecessor-version":[{"id":10520,"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/projet\/2236\/revisions\/10520"}],"wp:attachment":[{"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/media?parent=2236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/categories?post=2236"},{"taxonomy":"type_projet","embeddable":true,"href":"https:\/\/hub.imt-atlantique.fr\/fablab\/wp-json\/wp\/v2\/type_projet?post=2236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}