====== Lampe NG ====== {{{project picture:{{:projets:lampeng:lampeng.jpg?300|}} machines: Trotec400 Ultimaker materiaux: CP PLA logiciels: Blender inkscape ArduinoIDE fichiers:{{:projets:lampeng:go2.svg|}} {{:projets:lampeng:socle.svg|}} {{:projets:lampeng:culot.stl|}} {{:projets:lampeng:bague-culot.stl|}} liens:https://www.simplydifferently.org/Geodesic_Dome_Notes?page=3#2V/L2%20Icosahedron%20Dome tags: usager:Go2 licence:cc-by-sa }}} Lampe géodésique pilotable avec le WIFI de votre mobile ! ;-) ===== Conception ===== L'idée de départ est de réutiliser une ampoule cassée pour en faire une lampe utilisant des LEDs. On peut trouver facilement des exemples d'ampoules de ce type dans le commerce ! {{ :projets:lampeng:ampouleled.jpg?300 |}} J'ajoute des LEDs bleues à l'intérieur. {{ :projets:lampeng:fairyleds.jpg?300 |}} Je calcule les dimensions d'une structure géodésique en barreaux avec le site internet https://www.simplydifferently.org/Geodesic_Dome_Notes?page=3#2V/L2%20Icosahedron%20Dome {{:projets:lampeng:2vl2.map.jpg?500 |}} {{:projets:lampeng:2vl2.calcul.jpg?500|}} Pour le socle, je m'inspire de la montagne du destin (Mount Doom) décrite dans le roman le Seigneur des Anneaux de J. R. R. Tolkien (Sauron forge l'anneau unique dans les flammes de la montagne de feux, au Mordor ). Dans la trilogie cinématographique de Peter Jackson adaptée du Seigneur des Anneaux, le mont Ngauruhoe, un volcan de Nouvelle-Zélande, est choisi pour représenter la montagne du destin (https://fr.wikipedia.org/wiki/Mont_Destin). {{:projets:lampeng:lotr-mount_doom.jpg?300 |}} {{:projets:lampeng:le_ngauruhoe_et_le_ruapehu_vus_du_sommet_du_tongariro.jpg?600|}} {{:projets:lampeng:montngauruhoe.jpg?1000|}} J'utilise ce tutoriel pour créer le socle de la lampe : https://johnflower.org/tutorial/make-mountains-blender-heightmaps et je découpe cette simulation 3D en tranche comme j'ai déjà utilisé dans d'autres projet (par exemple [[projets:t-rex_ball|]]). Et je modélise un nouveau culot en 3D pour assembler le tout ! {{:projets:lampeng:culot.jpg?500|}} Voici la simulation de l'assemblage sur Blender ! {{:projets:lampeng:01.png?1000|}} Intégration de la partie électronique dans le socle de la lampe ! {{:projets:lampeng:02.png?1000|}} ===== Réalisation ===== Récupération d'une ampoule cassée et découpage du culot [[https://www.youtube.com/watch?v=KHANh7x2XtM]]. Découpe à la découpeuse laser du socle {{:projets:lampeng:socle.svg|}}. Découpe à la découpeuse laser des barres géodésiques {{:projets:lampeng:go2.svg|}}. Impression 3D du culot {{:projets:lampeng:culot.stl|}} Coller l'ampoule au nouveau culot en PLA ! Assembler le tout avec de la colle à bois, 5 vis M4 dans le culot, 8 vis et 8 écrous M4 pour le socle (méthode "Sandwich" en superposant les couches). ===== Hardware ===== S’équiper d'un circuit ESP8266 (https://fr.aliexpress.com/item/32779189539.html) et de quatre guirlandes LEDs (https://fr.aliexpress.com/item/32799804772.html) Câbler les LEDs suivant ce schéma : {{:projets:lampeng:schemaelectronique.png?500|}} Connecter le circuit ESP8266 suivant ce schéma : {{:projets:lampeng:circuitselectronique.png?500|}} ===== Programmation ===== Voici un tuto pour comprendre les grandes lignes de la programmation de l'ESP8266 : https://f-leb.developpez.com/tutoriels/arduino/esp8266/debuter/ Ce programme comporte plusieurs animations pilotables via le navigateur WEB. Connectez-vous au WIFI de la Lampe NG avec votre téléphone, avec votre tablette ou avec votre ordinateur : {{:projets:lampeng:progng-20220805-vitrinecn2.ino|}} {{:projets:lampeng:prog2.gif?|}} // Program for "LampeNG" made by Go2 on 2022/08/05 // Load Wi-Fi library #include // Set web server port number to 80 WiFiServer server(80); // Variable to store the HTTP request String header; // Auxiliar variables to store the current output state String ONOFFState = "ON"; String GlittersState = "ON"; String FadeState = "OFF"; String GlittersSpeed = "2"; String FadeSpeed = "1"; int TimeTempo = 30; int count = 0; int brightness1 = 0; // how bright the LED is int brightness2 = 0; // how bright the LED is int brightness3 = 0; // how bright the LED is int brightness4 = 0; // how bright the LED is int fadeAmount1 = 10; // Set the amount to fade I usually do 5, 10, 15, 20, 25 etc even up to 255. int fadeAmount2 = 20; // how many points to fade the LED by int fadeAmount3 = 30; // how many points to fade the LED by int fadeAmount4 = 40; // how many points to fade the LED by static unsigned long lastTimeItHappened = 0; void setup() { Serial.begin(115200); // Initialize the output variables as outputs pinMode(D5, OUTPUT); // Initialize the D5 pin as an output pinMode(D6, OUTPUT); // Initialize the D6 pin as an output pinMode(D7, OUTPUT); // Initialize the D7 pin as an output pinMode(D8, OUTPUT); // Initialize the D8 pin as an output delay(2000); // 2 second delay for recovery // WIFI ACCESS POINT // ================= WiFi.mode(WIFI_AP); //Our ESP8266-12E is an AccessPoint WiFi.softAP("Go2design"); // Provide the SSID server.begin(); // Start the HTTP Server IPAddress HTTPS_ServerIP= WiFi.softAPIP(); // Obtain the IP of the Server Serial.print("Server IP is: "); // 192.168.4.1 Serial.println(HTTPS_ServerIP); } void loop(){ WiFiClient client = server.available(); // Listen for incoming clients // Call the current pattern function once, updating the 'leds' array if (millis() - lastTimeItHappened >= 1000) { // Ten seconds or more since it last happened lastTimeItHappened = millis(); count++; } if (count >= 115) // Reinit every 2mn (115 for execution of program) { ONOFFState = "ON"; GlittersState = "ON"; FadeState = "OFF"; TimeTempo = 30; count = 0; } if (count >= 1000) {count = 1;} // Reinit for limit of variable if (GlittersState == "ON") {Glitters(TimeTempo);} if (FadeState == "ON") {Fade(TimeTempo);} if (client) { // If a new client connects, Serial.println("New Client."); // print a message out in the serial port String currentLine = ""; // make a String to hold incoming data from the client while (client.connected()) { // loop while the client's connected if (client.available()) { // if there's bytes to read from the client, char c = client.read(); // read a byte, then Serial.write(c); // print it out the serial monitor header += c; if (c == '\n') { // if the byte is a newline character // if the current line is blank, you got two newline characters in a row. // that's the end of the client HTTP request, so send a response: if (currentLine.length() == 0) { // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK) // and a content-type so the client knows what's coming, then a blank line: client.println("HTTP/1.1 200 OK"); client.println("Content-type:text/html"); client.println("Connection: close"); client.println(); count = 0 ; // turns the variable // push on MARCHE adress is ONOFF/off if (header.indexOf("GET /ONOFF/off") >= 0) { Serial.println("ONOFF off"); ONOFFState = "OFF"; GlittersState = "ON"; FadeState = "ON"; TimeTempo = 0; } else if (header.indexOf("GET /ONOFF/on") >= 0) { Serial.println("ONOFF on"); ONOFFState = "ON"; GlittersState = "ON"; FadeState = "OFF"; TimeTempo = 30; } else if (header.indexOf("GET /Glitters/on") >= 0) { Serial.println("Glitters on"); GlittersState = "OFF"; FadeState = "OFF"; TimeTempo = 0; } else if (header.indexOf("GET /Glitters/1") >= 0) { Serial.println("Glitters 1"); GlittersSpeed = "1"; TimeTempo = 10; } else if (header.indexOf("GET /Glitters/2") >= 0) { Serial.println("Glitters 2"); GlittersSpeed = "2"; TimeTempo = 30; } else if (header.indexOf("GET /Glitters/3") >= 0) { Serial.println("Glitters 3"); GlittersSpeed = "3"; TimeTempo = 60; } else if (header.indexOf("GET /Glitters/4") >= 0) { Serial.println("Glitters 4"); GlittersSpeed = "4"; TimeTempo = 90; } else if (header.indexOf("GET /Glitters/off") >= 0) { Serial.println("Glitter off"); ONOFFState = "ON"; GlittersState = "ON"; FadeState = "OFF"; GlittersSpeed = "2"; TimeTempo = 30; } else if (header.indexOf("GET /Fade/on") >= 0) { Serial.println("Fade on"); GlittersState = "OFF"; FadeState = "OFF"; Glitters(0); } else if (header.indexOf("GET /Fade/1") >= 0) { Serial.println("Fade 1"); FadeSpeed = "1"; TimeTempo = 30; } else if (header.indexOf("GET /Fade/2") >= 0) { Serial.println("Fade 2"); FadeSpeed = "2"; TimeTempo = 60; } else if (header.indexOf("GET /Fade/3") >= 0) { Serial.println("Fade 3"); FadeSpeed = "3"; TimeTempo = 90; } else if (header.indexOf("GET /Fade/off") >= 0) { Serial.println("Fade off"); ONOFFState = "ON"; GlittersState = "OFF"; FadeState = "ON"; FadeSpeed = "1"; TimeTempo = 30; } // Display the HTML web page client.println(""); client.println(""); client.println(""); // CSS to style the on/off buttons // Feel free to change the background-color and font-size attributes to fit your preferences client.println(""); // Web Page Heading client.println("

NG by Go²

"); if (ONOFFState=="OFF") { client.println("

"); } else if (ONOFFState=="ON"){ client.println("

"); if (GlittersState=="OFF") { client.println("

"); } else { client.println("

"); if (GlittersSpeed=="1") { client.println(""); client.println(""); client.println(""); client.println(""); } else if (GlittersSpeed=="2") { client.println(""); client.println(""); client.println(""); client.println(""); } else if (GlittersSpeed=="3") { client.println(""); client.println(""); client.println(""); client.println(""); } else if (GlittersSpeed=="4") { client.println(""); client.println(""); client.println(""); client.println(""); } } if (FadeState=="OFF") { client.println("

"); } else { client.println("

"); if (FadeSpeed=="1") { client.println(""); client.println(""); client.println(""); } else if (FadeSpeed=="2") { client.println(""); client.println(""); client.println(""); } else if (FadeSpeed=="3") { client.println(""); client.println(""); client.println(""); } } } client.println(""); // The HTTP response ends with another blank line client.println(); // Break out of the while loop break; } else { // if you got a newline, then clear currentLine currentLine = ""; } } else if (c != '\r') { // if you got anything else but a carriage return character, currentLine += c; // add it to the end of the currentLine } } } // Clear the header variable header = ""; // Close the connection client.stop(); Serial.println("Client disconnected."); Serial.println(""); } } void Glitters (int TimeTempo) { if (TimeTempo > 0) { digitalWrite(D5, HIGH); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is active low on the ESP-01) delay(TimeTempo); // Wait for a second digitalWrite(D5, LOW); // Turn the LED off by making the voltage HIGH delay(TimeTempo); // Wait for two seconds (to demonstrate the active low LED) digitalWrite(D6, HIGH); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is active low on the ESP-01) delay(TimeTempo); // Wait for a second digitalWrite(D6, LOW); // Turn the LED off by making the voltage HIGH delay(TimeTempo); // Wait for two seconds (to demonstrate the active low LED) digitalWrite(D7, HIGH); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is active low on the ESP-01) delay(TimeTempo); // Wait for a second digitalWrite(D7, LOW); // Turn the LED off by making the voltage HIGH delay(TimeTempo); // Wait for two seconds (to demonstrate the active low LED) digitalWrite(D8, HIGH); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is active low on the ESP-01) delay(TimeTempo); // Wait for a second digitalWrite(D8, LOW); // Turn the LED off by making the voltage HIGH delay(TimeTempo); // Wait for two seconds (to demonstrate the active low LED) } else { digitalWrite(D5, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D6, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D7, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D8, LOW); // Turn the LED off by making the voltage HIGH } } void Fade(int TimeTempo) { if (TimeTempo > 0) { analogWrite(D5, brightness1); // change the brightness for next time through the loop: brightness1 = brightness1 + fadeAmount1; if (brightness1 <= 0 || brightness1 >= 255) { fadeAmount1 = -fadeAmount1; } // wait to see the dimming effect delay(TimeTempo); analogWrite(D6, brightness2); // change the brightness for next time through the loop: brightness2 = brightness2 + fadeAmount2; if (brightness2 <= 0 || brightness2 >= 255) { fadeAmount2 = -fadeAmount2; } // wait to see the dimming effect delay(TimeTempo); analogWrite(D7, brightness3); // change the brightness for next time through the loop: brightness3 = brightness3 + fadeAmount3; if (brightness3 <= 0 || brightness3 >= 255) { fadeAmount3 = -fadeAmount3; } // wait to see the dimming effect delay(TimeTempo); analogWrite(D8, brightness4); // change the brightness for next time through the loop: brightness4 = brightness4 + fadeAmount4; if (brightness4 <= 0 || brightness4 >= 255) { fadeAmount4 = -fadeAmount4; } // wait to see the dimming effect delay(TimeTempo); } else { digitalWrite(D5, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D6, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D7, LOW); // Turn the LED off by making the voltage HIGH digitalWrite(D8, LOW); // Turn the LED off by making the voltage HIGH } }
===== Difficultés rencontrées ===== Malheureusement après avoir transporté plusieurs fois à vélo la Lampe NG durant l'épisode du Covid19, l'ampoule s'est décollée... Je l'ai recollée mais comme le nouveau cordon de colle dépassait de sa position initiale cela n'était plus esthétique. La partie haute de la Lampe NG est indémontable, j'ai donc du modéliser, imprimer et monter une bague haute supplémentaire en plusieurs parties pour la coller à travers les barreaux géodésiques. {{:projets:lampeng:bague-culot.stl|}} ===== Rendu Blender Hotel ===== {{:projets:lampeng:lampeng-hotel_.jpg?1200|}} Inspiration : [[https://blendswap.com/blend/6355]] ===== Rendu Blender Chambre ===== {{:projets:lampeng:lampeng-perso_.jpg?1200|}} Inspiration : [[https://dimensiva.com/3dmodels/armchair-daw-by-vitra-eames/]] & [[https://www.designconnected.com/fr/category/Tables/E-Volved-table_p3882]] ===== GIF ===== {{:projets:lampeng:anim.gif}} ===== Photos ===== {{gallery>:projets:lampeng:photos}} ===== Suites du projet ===== Une nouvelle lampe est en préparation, inspirée des projets suivants : \\ - [[projets:lampe_champignon|]] par bumblebee \\ - [[projets:dome_geodesique_frequence_3|]] par bubuchelabuche \\ Retrouvez cette nouvelle version sur internet avec le QRcode ci-dessous 8-) \\ {{:projets:lampeng:gif500.gif}} **Made by Go2**