Search the Community
Showing results for tags 'arduino nano'.
-
Bring life to your home with this enchanting 4x4x4 LED cube. From static to flashing, chasing, or fading this cube can be programmed to display many different types of 3D LED transitions. This customizable PCB LED cube is super easy to make and fun to have in your home. Go ahead and create a forest of these cubes using various color LEDs to enhance the beauty of your Christmas Tree this Christmas. This cube has 64 Blue LEDs organized in 4 layers. These LEDs are wired up to an Arduino Nano. Each LED can be addressed individually using Arduino IDE, enabling it to display amazing 3D transitions! There are hundreds of tutorials of these cubes made using exposed metal wires and by using crazy soldering techniques, which just gives me shivers. In this tutorial I'll show you guys how to make this super simple 4x4x4 PCB LED cube "without over complicating anything". With just basic soldering skills, you can create this PCB cube and light up your living room making everyone jealous. Components Required For this project we need: 64 x Blue Color Round LEDs (plus some extra just in case you make a mistake) 4 x Blue Color Flat LEDs 4 x 100Ohm Resistors 8 x 4GX9 Pan Head Screws 1 x 220v to 5v Step Down Converter An AC Power Cord 1 x Arduino Nano A 3D Printer Acrylic Colors Custom Built PCBs 20 x Exposed Thick Copper Wires and An x Optional switch ** All the project related resources can be downloaded from my GitHub repository : https://github.com/tarantula3/4x4x4-LED-Cube. Testing The LEDs Before we start assembling our LED cube, it is a very good idea to test these LEDs. Since few of the LEDs will remain absolutely inside the cube, so accessing them after the assembly will become an absolute nightmare. Hence a simple mistake can bring a lot of greif. Using a coin cell, I tested all the 64 main LEDs and the 4 Square LEDs. The Board So, I designed two types of PCBs for this project. One for the base and the other one that will be installed 4 times to create the top 4 layers of the cube. Both PCBs have "TOP" and "BOTTOM" written on them. The "Top" section faces up and the "Bottom" section faces down. While assembling the cube, I will first solder the 16 copper wires to the "Top Section" of the base plate. Then I will solder the remaining 4 wires to the board. Each of these wires will connect to only one layer. Hence, all these wires are of different sizes. The 1st one from right connects to layer 1, next one to layer 2 and so on. Once all the wires are soldered to the "Top Section" of the base plate, I will one by one slide the LED meshes over these wires and solder them accordingly to form the top 4 layers. Soldering The LED Mesh So, this is what came in the mailbag. Thanks to PCBWay, the boards are very well fabricated and look absolutely amazing. The black color solder mask is adding to the beauty of the boards. As discussed earlier we need 4 of the "LED Mesh Boards" and 1 board for the "Base". One by one I added all the LEDs to the board. While soldering the LEDs, please make sure that they are all added to the "Top" side of the board. Once all the LEDs were in, I went ahead and soldered them to the board. Soldering The Base After sorting out the top layers, it was time for me to set up the bottom bit. I started the setup by soldering the 4 x 100ohm resistors to the board. Then, I soldered the Arduino Nano to the board. Instead of soldering the Arduino Nano directly to the board, I used female pin headers to house the Arduino Nano Micro controller. Please make sure all these components are soldered to the "Bottom" side of the base plate. After that, I one by one soldered all the copper wires to the base plate. While soldering the wires, please make sure you solder them to the "Top" side of the board. After soldering the wires to the base plate, slide the 1st LED Mesh and solder all the wires to it. Then slide the 2nd one and so on. I left a 1.7cm gap between each layer and 1.2cm gap between the 1st layer and the base plate. In this setup, the 4 wires that we saw earlier that connect to individual layers are soldered to the middle rail. However, in the final version I moved them to the outer rail to make the soldering process easy. Coding I found this sketch online, and then I edited it to work with my LED cube. You can download the code from my GitHub repository (https://github.com/tarantula3/4x4x4-LED-Cube). The code is exactly the same as any other 4x4x4 LED cube code with some additional transitions that I added. I also found that the Arduino Nano freezes after a while. So, to keep the process going without any interruptions, I added a function to reboot the board after it completes one set of transitions. 3D Model Using Microsoft 3D Builder I designed the base of the cube. The onscreen 3D model is actually upside down. On one of the sides, I left a hole for inserting the power chord. These groves are for the 4 x Flat Head LEDs. The lid sits on top of the base and is screwed to the base using 4GX9 Pan Head Screws. 3D Printing Once the 3D models were sorted, it was time for me to fire up my 3D printing oven and start printing these 3D models. As we all know, 3D printing is the process that uses computer-aided design or CAD, to create objects layer by layer. 3D printing is not a new technology, its been there since the 1980's, when Charles W. Hull invented the process and created the first 3D-printed part. Since then, the field of 3D printing has grown exponentially and holds countless possibilities. The 3D printing process fascinates me a lot and I sometimes love to sit near my printer and watch these layers getting printed. After extracting all the 3D printed bits, I sanded them to give them a nice and smooth texture. Coloring Using Acrylic Colors, I painted the body of the 3D printed base. Assembling Now the final bits. I soldered the base-plate and the 4 x flat-head LEDs to the 220v-to-5v Step Down Converter. Then I pushed all the flat head LEDs through the groves that I created in the 3D printed base. Then using the 4GX9 Pan Head Screws I screwed the 3D printed base to the base plate. Next, I soldered the AC power-cord to the step-down converter and hot-glued it to one of the sides of the 3D printed base. I created an acrylic box for the cube which will keep the LED Mesh dust free. To conclude the assembly, I screwed the cover to the base. That's it, all done. Final Demo So, this is how my final setup looks like. Do comment, and let me know if there are any scopes of improvement. Thanks Thanks again for checking my post. I hope it helps you. If you want to support me subscribe to my YouTube Channel: https://www.youtube.com/user/tarantula3 Video: View Full Blog Post: View References GitHub: View Code: Download Stl Files: Download Gerber Files: Download Support My Work BTC: 1Hrr83W2zu2hmDcmYqZMhgPQ71oLj5b7v5 LTC: LPh69qxUqaHKYuFPJVJsNQjpBHWK7hZ9TZ DOGE: DEU2Wz3TK95119HMNZv2kpU7PkWbGNs9K3 ETH: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4 BAT: 0x9D9E77cA360b53cD89cc01dC37A5314C0113FFc3 LBC: bZ8ANEJFsd2MNFfpoxBhtFNPboh7PmD7M2 COS: bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23 Memo: 572187879 BNB: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4 MATIC: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4 Thanks, ca again in my next tutorial
-
- led cube
- arduino nano
-
(and 2 more)
Tagged with:
-
If you are looking for a way to add some colorful and dynamic lighting effects to your Arduino projects, you might want to try using neo-pixel rings. Neo-pixel rings are circular arrays of RGB LEDs that can be controlled individually by a single data line. They are easy to use and can create amazing patterns and animations with Arduino code. In this article, I will show you how to integrate a pixel ring with Arduino Nano, a small and cheap microcontroller board that can be programmed to interact with various sensors and devices. You will learn how to wire the neo-pixel ring to the Arduino Nano, how to install and use the Adafruit Neo Pixel library, and how to code some basic lighting effects using the neo-pixel ring. By the end of this article, you can create your custom lighting effects using a neo-pixel ring and Arduino Nano. You will also be able to modify and customize the code according to your preferences and needs. Let’s get started! Get PCBs For Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Also, check out this useful blog on PCBWay Plugin for KiCad from here. Using this plugin, you can directly order PCBs in just one click after completing your design in KiCad. Materials and tools: 8-bit neo-pixel ring Arduino nano Jumper wires Mini USB cable Adafruit Neo Pixel library for Arduino Wiring: Connect the IN pin of the neo-pixel ring to the D2 pin of the Arduino nano Connect the VCC pin of the neo-pixel ring to the +5V pin of the Arduino nano Connect the GND pin of the neo-pixel ring to the GND pin of the Arduino nano Programming: Once all the connections are made, open up the Arduino IDE and go to the Include library option. Then add the downloaded zip library that we have previously mentioned. Once the library installation is successful, you can see the neo pixel library examples in the examples sketch. Next, open up the strandtest_wheel sketch and change the pin to 2. Because we have connected our Neo pixel to the D2 pin of the Arduino. # include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #define PIN 2 // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800); // IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across // pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input // and minimize distance between Arduino and first pixel. Avoid connecting // on a live circuit...if you must, connect GND first. void setup() { // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket #if defined (__AVR_ATtiny85__) if (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif // End of trinket special code strip.begin(); strip.setBrightness(100); strip.show(); // Initialize all pixels to 'off' } void loop() { // Some example procedures showing how to display to the pixels: colorWipe(strip.Color(255, 0, 0), 50); // Red colorWipe(strip.Color(0, 255, 0), 50); // Green colorWipe(strip.Color(0, 0, 255), 50); // Blue //colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW // Send a theater pixel chase in... theaterChase(strip.Color(127, 127, 127), 50); // White theaterChase(strip.Color(127, 0, 0), 50); // Red theaterChase(strip.Color(0, 0, 127), 50); // Blue rainbow(20); rainbowCycle(20); theaterChaseRainbow(50); } // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, c); strip.show(); delay(wait); } } void rainbow(uint8_t wait) { uint16_t i, j; for(j=0; j<256; j++) { for(i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, Wheel((i+j) & 255)); } strip.show(); delay(wait); } } // Slightly different, this makes the rainbow equally distributed throughout void rainbowCycle(uint8_t wait) { uint16_t i, j; for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel for(i=0; i< strip.numPixels(); i++) { strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); } strip.show(); delay(wait); } } //Theatre-style crawling lights. void theaterChase(uint32_t c, uint8_t wait) { for (int j=0; j<10; j++) { //do 10 cycles of chasing for (int q=0; q < 3; q++) { for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, c); //turn every third pixel on } strip.show(); delay(wait); for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, 0); //turn every third pixel off } } } } //Theatre-style crawling lights with rainbow effect void theaterChaseRainbow(uint8_t wait) { for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel for (int q=0; q < 3; q++) { for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on } strip.show(); delay(wait); for (uint16_t i=0; i < strip.numPixels(); i=i+3) { strip.setPixelColor(i+q, 0); //turn every third pixel off } } } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { WheelPos = 255 - WheelPos; if(WheelPos < 85) { return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } if(WheelPos < 170) { WheelPos -= 85; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } Next, select the correct port and board. Here is the response. Conclusion: You have learned how to connect neo pixel ring with Arduino Nano and create some lighting effects using Arduino code, You can try different colors, patterns, and speeds for your animations by changing the code parameters. You can also use other types of neo-pixel products, such as strips, matrices, or jewels, for more variety and complexity.
- 2 replies
-
- led
- neo pixel ring
-
(and 2 more)
Tagged with:
-
Sending data from an Arduino microcontroller to the ThingSpeak platform using a GPRS module is not a novel project concept. While it may appear outdated in numerous regions, owing to the rapid evolution of communication technologies such as 2G, 3G, 4G, 5G, and the potential for 6G, this is not the case in my country. In India, 2G technologies remain prevalent, and major network operators have confirmed their intent to sustain 2G services. The legacy project documents that were originally designed with the SIM800 module may necessitate slight adjustments. This project will prove invaluable to those who continue to rely on 2G and GPRS technology. It offers essential support and guidance for individuals who intend to persist with these communication methods. Sending data from an Arduino microcontroller to the ThingSpeak platform using a GPRS module, specifically the SIM800, is a fundamental concept. The crucial aspect is that this communication method operates independently of Wi-Fi, constituting an IoT connectivity solution that relies on GPRS for data transmission. 1 / 2 In this project, LM35 temperature sensor data is being transmitted to the ThingSpeak platform through an Arduino Nano and a SIM800 module. The SIM800 module is leveraged to establish a GPRS connection, facilitating the transmission of data to ThingSpeak at specified intervals. To ensure a reliable connection between ThingSpeak and the hardware, users must configure the SIM800 module to establish a connection with their mobile network. This configuration encompasses setting the Access Point Name (APN) specific to their mobile carrier. It's important to note that the specific AT commands for this configuration may vary based on the user's chosen mobile network provider. For this project, I utilized the services of the network provider Airtel to establish the connection. Communication between the hardware components, specifically the SIM800 module, Arduino Nano, and ThingSpeak platform, relies entirely on AT commands. To ensure successful project implementation and effectively troubleshoot any issues that may arise, users must possess a basic understanding of SIM800 AT commands. This knowledge is crucial for configuring, managing, and diagnosing the communication process and resolving potential challenges during the project. Get PCBs For Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Also, check out this useful blog on PCBWay Plugin for KiCad from here. Using this plugin, you can directly order PCBs in just one click after completing your design in KiCad. Networking testing The table provided below lists several common AT commands that serve to swiftly and effectively verify the proper functioning of the SIM800C's AT serial communication and network connection. Before proceeding with the steps outlined for the network communication demonstration, it is advisable to conduct a straightforward network test. This preliminary test ensures that the intended network connection is in working order and fully operational. TCP/IP Communication The SIM800 serial module's TCP/IP application offers two connection modes, selectable through the AT command `AT CIPMUX=<n>`. When `AT CIPMUX` is set to 0 (`AT+CIPMUX=0`), it operates in single-link mode. When `AT CIPMUX` is set to 1 (`AT+CIPMUX=1`), it operates in multi-link mode. By default, the module is configured in single-link mode. In single-link mode, the SIM800 serial module can function in both transparent and non-transparent transmission modes. In both of these modes, the module can be configured as either a TCP/UDP client or a TCP server. In multi-link mode, the SIM800 serial module operates solely in non-transparent mode. In this mode, it can serve as a TCP/UDP client, allowing for the establishment of a maximum of 6 connections. It can also be configured as a TCP server, with support for 5 TCP/UDP clients. SIM800C TCP/IP operates with a multi-client architecture by default, enabling up to five sockets for TCP or UDP connections. In the upcoming demonstrations, our focus will be on the client communication capabilities of the SIM800C module. Specifically, we will explore its operation in single-link non-transparent mode and transparent mode. Client communication in non-transparent mode Client communication in non-transparent mode refers to the way the SIM800C module interacts with remote servers or devices when it acts as a client, transmitting data using a specific protocol such as TCP or UDP. In non-transparent mode, the module sends and receives data through AT commands and does not directly pass data between the microcontroller and the remote server. This mode provides control over the data transmission process, allowing you to send and receive data, manage connections, and configure communication settings using AT commands. It is suitable for applications where you need fine-grained control over the communication process and want to ensure data integrity. To use the SIM800C in client communication in non-transparent mode, you will typically configure the module using appropriate AT commands and establish connections with remote servers or devices for data exchange. Client communication in transparent transmission mode Client communication in transparent transmission mode refers to the SIM800C module's ability to act as a client while allowing data to flow directly between the microcontroller (e.g., an Arduino) and a remote server or device. In this mode, the SIM800C module operates as a transparent bridge, forwarding data between the microcontroller and the remote server without the need for explicit AT commands to send or receive each piece of data. This mode simplifies data transfer by treating the SIM800C module as a transparent conduit. Data sent by the microcontroller is transmitted to the remote server without manual packetization, and data received from the server is forwarded to the microcontroller without manual processing. Using the SIM800C in transparent transmission mode is advantageous when you want to streamline data transfer and reduce the complexity of managing data packets and AT commands for each communication task. It's particularly useful for applications where data throughput and efficiency are essential. HTTP Communication This chapter provides an overview of the HTTP communication capabilities of the SIM800C module, focusing on HTTP GET and HTTP POST methods. For in-depth information about HTTP and FTP (File Transfer Protocol) communication with the SIM800C module, please refer to the "SIM800C Series_IP_Application_Note." This additional resource will provide comprehensive details and guidelines for utilizing these communication functions effectively. HTTP GET HTTP Post SIM800 Series_AT Command Manual_V1.10 SIM800 Series_TCPIP_Application Note_V1.02 Connection Diagram Establishing Communication Between Arduino Nano, SIM800, and ThingSpeak (Serial Monitor Data Captured During Project Execution). AT+CSTT="airtelgprs.com"<CR> OK AT+CIICR<CR> OK AT+CIFSR<CR> 100.78.215.26 AT+CIPSPRT=0<CR> OK AT+CIPSTART="TCP","api.thingspeak.com","80"<CR> OK CONNECT OK<CR>AT+CIPSEND<CR>GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&field1=20.00&field2=10.00 GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&<SUB> SEND OK 6 CLOSED <CR>AT+CIPSHUT<CR>Temperature = 20.00 °C Humidity = 10.00 % SHUT OK AT<CR> OK AT+CPIN?<CR> +CPIN: READY OK AT+CREG?<CR> +CAT+CSTT="airtelgprs.com"<CR> OK AT+CIICR<CR> OK AT+CIFSR<CR> 100.90.199.122 AT+CIPSPRT=0<CR> OK AT+CIPSTART="TCP","api.thingspeak.com","80"<CR> OK CONNECT OK<CR>AT+CIPSEND<CR>GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&field1=20.00&field2=10.00 GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&<SUB> SEND OK 7 CLOSED <CR>AT+CIPSHUT<CR>Temperature = 20.00 °C Humidity = 10.00 % SHUT OK AT<CR> OK AT+CPIN?<CR> +CPIN: READY OK AT+CREG?<CR> +CAT+CSTT="airtelgprs.com"<CR> OK AT+CIICR<CR> OK AT+CIFSR<CR> 100.102.108.63 AT+CIPSPRT=0<CR> OK AT+CIPSTART="TCP","api.thingspeak.com","80"<CR> OK CONNECT OK<CR>AT+CIPSEND<CR>GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&field1=20.00&field2=10.00 GET https://api.thingspeak.com/update?api_key=5XC1TCVONJVK1PNN&<SUB> SEND OK 8 CLOSED