Introduction: Smart Coaster With Arduino Nano 33 IoT

Greetings, DIY enthusiasts and tech aficionados! Today, I'm thrilled to present a project that seamlessly blends elegance and innovation – a smart coaster illuminated with 32 LEDs. This coaster, controlled through Arduino Cloud, is not just a dazzling accessory; it's a testament to the synergy of design and technology.

In this instructable, we won't get lost in intricate coding details. Instead, our focus will be on the pivotal steps required to bring this smart coaster to life, from designing the circuit and PCB to fabricating it with NextPCB.com, setting up Arduino Cloud, basic coding, testing, and finally, assembling the components. This project has been a passion project, driven by the vision of creating an IoT-enabled coaster that adds a touch of magic to any space.

This smart coaster isn't just about glowing LEDs; it's about crafting an experience. The Arduino Nano 33 IoT, circular PCB, 9V battery, and an array of 32 LEDs (8 of each color) converge to create a symphony of lights. Moreover, the 3D-printed case adds a sleek finish to house the electronics, making it a true centerpiece.

Furthermore, this project sets the stage for future innovations. As we move forward, the goal is to explore new possibilities, enhance design elements, and share the joy of creating IoT wonders. So, stay tuned for more exciting projects in the realm of DIY electronics.

Now, let's dive into the essential components driving this smart coaster – a fusion of creativity and technology that's bound to elevate your crafting experience!

Supplies

Please note that the following list of supplies is for reference only and is not sponsored unless mentioned otherwise. You can find these components at various online retailers, electronics supply websites, or local electronics stores

  1. Arduino Nano 33 IoT
  2. Circular PCB (designed for the project and sponsored by NextPCB)
  3. 9V battery
  4. 32 LEDs (8 red, 8 blue, 8 green, 8 white)
  5. Access to a 3D printer and filament for the case
  6. Soldering iron and solder
  7. Wires and connectors
  8. Arduino Cloud account
  9. Basic tools (screwdriver, pliers, etc.)
  10. 0.1" Pitch PCB Screw Terminal

Step 1: Building a Breadboard Prototype

Before diving into the intricacies of circuit design, it's essential to create a breadboard prototype to ensure our circuit functions as intended. Follow these steps to build a robust prototype:

  1. Gather Materials:
  2. Three breadboards
  3. Assorted LEDs (in this case, 32 LEDs – 8 each of red, blue, green, and white)
  4. A circular paper cutout for visualizing the design
  5. Jumper wires
  6. Any simple code to test LED functionality (LEDs for Beginners)
  7. Visualize the Design:
  8. Cut a circle out of paper to serve as a visual aid for your coaster's design.
  9. This step helps you plan the LED placements and ensures a neat and organized prototype.
  10. Connect LEDs on Breadboard:
  11. Begin placing a few LEDs of each color on the breadboard according to your design.
  12. For simplicity, let's designate digital pins D10, D11, D12, and D16 for red, blue, green, and white LEDs, respectively.
  13. Parallel Connections:
  14. Connect the LEDs in parallel within each color group. This means each color needs only one digital pin for control.
  15. Use jumper wires to link the LEDs of the same color together and connect them to the designated digital pin.
  16. Ground Line:
  17. Simplify the circuit by connecting all 32 LEDs to a single ground line. This minimizes clutter and streamlines the prototype.
  18. Test with Simple Code:
  19. Upload any straightforward code to test the LEDs' functionality.
  20. This step ensures that each LED responds correctly, setting the foundation for more intricate controls later.
  21. Prepare for Wireless Control:
  22. As a sneak peek into the future steps, ensure the connections are well-established.
  23. In the upcoming stages, we'll explore wireless control through Arduino Cloud, enabling you to manipulate the LEDs remotely.

Congratulations! You've successfully built a breadboard prototype for your smart coaster. This crucial step ensures that the basic circuit functions are in place before moving on to more advanced stages. In the next steps, we'll delve into designing the PCB and taking your smart coaster to the next level. Stay tuned for the exciting journey ahead!

Step 2: PCB Designing With Fritzing

Now that our breadboard prototype is validated, it's time to transition to a more permanent and aesthetically pleasing solution – the Printed Circuit Board (PCB). Follow these steps to design your custom PCB, ensuring a seamless transition from concept to reality:

  1. Hand-Draw your Schematic: Begin by hand-drawing the schematic on paper. This step helps visualize and plan the connections, especially when dealing with a complex circuit.
  2. Utilize Fritzing for Design: Open Fritzing and navigate directly to the PCB pane. If you're new to Fritzing, consider using my hand-drawn design or create a similar one as a beginner's guide.
  3. Shape the PCB:
  4. To match the circular design of your coaster, select the PCB, open the Inspector pane, and choose 'ellipse' from the shape dropdown.
  5. Adjust the width and height to ensure a perfectly circular PCB.
  6. Place Components:
  7. Position the Arduino Nano at the center of the PCB.
  8. Arrange the 32 LEDs around the PCB, ensuring they aren't placed right at the edge for practical and aesthetic reasons.
  9. Label Everything: Crucially label every LED and component on the PCB. This step enhances clarity during the assembly process.
  10. Design the PCB: Follow your hand-drawn schematic and start designing the PCB. Use Fritzing's features to establish connections between components.
  11. Layer Toggle: Utilize the layer button at the bottom of the page to toggle between the top and bottom layers. This ensures comprehensive coverage of your design.
  12. Design Rules Check: Run the Design Rules Check to validate your design. This step identifies and rectifies potential issues in your PCB layout.
  13. Personalize Your PCB: Make the PCB uniquely yours by adding personal touches, such as your name or any desired artwork.
  14. Iterate and Customize: Use my design as a starting point and feel free to make adjustments to align with your preferences and project vision.

Congratulations! You've successfully transitioned from a conceptual breadboard prototype to a well-designed PCB. The meticulous planning and labeling ensure a smooth assembly process. In the upcoming steps, we'll explore fabricating the PCB with NextPCB.com, bringing us one step closer to a fully functional smart coaster. Stay tuned for the exciting progress ahead!

Step 3: Order PCB

This project came to fruition thanks to the invaluable assistance and support from NextPCB, a trusted manufacturer specializing in multilayer PCBs. NextPCB boasts over 15 years of experience in the global PCB and assembly industry, making it a reliable partner for projects like these. I accepted this partnership because I am familiar with their products, and I have consistently been satisfied with the quality and service they provide.

You can explore their high-quality PCBs, starting at just $1.9, and multilayer options beginning at $6.9 at the following link: NextPCB - Get a PCB Quote

As an added bonus, enjoy free PCB assembly for the first 5 boards through this link: NextPCB - Get a PCB Assembly Quote

Additionally, NextPCB offers a DFM (Design for Manufacturability) free online PCB Gerber viewer to help streamline your PCB design process: NextPCB - Free Online Gerber Viewer



Now that your PCB design is perfected, it's time to turn it into a physical reality. Follow these steps to order your custom PCB from NextPCB:

  1. Export Gerber Files: In Fritzing, export the Gerber files for your PCB design. These files contain the information needed for manufacturing your PCB.
  2. Create a Zip Folder: Compress the Gerber files into a single zip folder to make it easier for uploading and sharing.
  3. Visit NextPCB Website: Head over to the NextPCB website to get started: NextPCB
  4. Upload Your Design: Use the website's interface to upload your zipped Gerber files. Be sure to double-check the parameters that are automatically parsed from the Gerber file. Although they are generated automatically, it's crucial to review them for accuracy.
  5. Quantity and Solder Mask Color: Fill in the desired quantity for your PCB. The default solder mask color is green, but you have the option to change it to any color you prefer (note that the cost may vary depending on your choice).
  6. Online Gerber Viewer Pro: As a final check, utilize the very cool Online Gerber Viewer Pro on the website. It's a free tool that can provide a report with "pass," "warn," and "risk" items. Ensure that your design meets the necessary manufacturing standards.
  7. Proceed to Checkout: Once you're satisfied with the design, parameters, and the Online Gerber Viewer report, proceed to the checkout to place your order.
  8. Wait for Delivery: After placing your order, patiently wait for your custom PCBs to arrive. In the meantime, you can set up your Arduino Cloud.

While you're waiting for your PCB to arrive, why not check out some of my other projects? Exploring new ideas can be a great way to stay inspired and plan for your next creative endeavor.

Step 4: Setting Up Arduino Cloud

Now, let's establish a seamless connection between your smart coaster and the Arduino Cloud. Follow these steps to unleash the full potential of IoT capabilities. If you're new to Arduino IoT Cloud, check out this Instructables article for a detailed guide.


  1. Connect Your Device: After connecting your device to the cloud, create a Thing and name it "Smart Coaster" or a similar identifier. Follow the steps outlined in the provided article.
  2. Add Variables: Add four variables, one for each LED, and give them appropriate names. These variables will be crucial for controlling the brightness of each LED individually.
  3. Generate Functions: For every updating value of the variable, a corresponding function is automatically generated. Edit these functions using the Arduino Web Editor.
  4. Code Adjustments: Modify the sketch in the Web Editor, defining GPIO (PWM) pin number 12 and incorporating the 'analogWrite' function for LED brightness control with respect to the variable 'led_red'.
  5. Upload the Code: Once the code adjustments are made, upload the sketch to the Nano 33 IoT. This step establishes the board's connection to the internet.
  6. Configure Arduino IoT Cloud Dashboard: Set up your Arduino IoT Cloud dashboard, adding four sliders and associating each with a corresponding LED. Customize the appearance of the phone app for a more user-friendly interface.
  7. Circuit Connections: Make the necessary circuit connections on the breadboard prototype, aligning with the configured dashboard.
  8. Test on Breadboard Prototype: Give your smart coaster a test run on the breadboard prototype. Ensure the brightness control functions seamlessly through the Arduino IoT Cloud dashboard.


/*
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/bbedde4c-20e2-401e-9623-8edcb92f3ae2


  Arduino IoT Cloud Variables description


  The following variables are automatically generated and updated when changes are made to the Thing


  int lED1;
  int lED2;
  int lED3;
  int lED4;


  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/


int LED = 12;
int LED_2 = 11;
int LED_3 = 10;
int LED_4 = 16;
#include "thingProperties.h"



void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500);
  //pinMode(LED_2, OUTPUT);
  // Defined in thingProperties.h
  initProperties();


  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);



  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();


}


void loop() {

  ArduinoCloud.update();


  onLED1Change();
  onLED2Change();
  onLED3Change();
  onLED4Change();
}


/*
  Since LED1 is READ_WRITE variable, onLED1Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED1Change()  {
  // Add your code here to act upon LED1 change
  analogWrite(LED, lED1);
}


/*
  Since LED2 is READ_WRITE variable, onLED2Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED2Change()  {
  // Add your code here to act upon LED2 change


analogWrite(LED_2, lED2);
}


/*
  Since LED3 is READ_WRITE variable, onLED3Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED3Change()  {
  // Add your code here to act upon LED3 change
  analogWrite(LED_3, lED3);
}


/*
  Since LED4 is READ_WRITE variable, onLED4Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED4Change()  {
  // Add your code here to act upon LED4 change
  analogWrite(LED_4, lED4);
}


Congratulations! You've successfully integrated your smart coaster with the Arduino Cloud, paving the way for remote control and customization. The upcoming steps will guide you through the fabrication of the PCB with NextPCB.com, bringing us closer to a tangible, functional smart coaster. Stay tuned for the exciting developments ahead!

Step 5: 3D Printing the Case

Now, let's bring a tangible form to your smart coaster by 3D printing the meticulously designed case. Follow these steps to craft the housing for your PCB and electronics. Download the 3D design files for the base and top of the case. These files were expertly crafted to house the PCB and electronics securely. Opt for natural filament for a clean and classic finish. Standard quality should suffice for this project. Ensure your 3D printer is in good working order. Calibrate if necessary and load the selected filament. If you wish to make personal adjustments to fit your design preferences, feel free to modify the base and top files before printing. Begin the 3D printing process, keeping an eye on the progress to ensure a smooth and accurate result. Once the printing is complete, carefully inspect the printed base and top parts for any imperfections or issues.

Step 6: Assembling and Soldering

As we approach the final stages of creating your IoT-enabled smart coaster, precision and care become paramount. Follow these steps to assemble and solder everything into place:

  1. Test LED Functionality: Before diving into assembly, conduct a quick test to ensure all LEDs are functioning correctly. Spend a few minutes verifying that each LED responds as expected. This step is crucial for identifying and addressing any issues before proceeding.
  2. Organize Components: Lay out all components, including the 3D-printed case, PCB, Arduino Nano 33 IoT, LEDs, and other necessary elements in an organized manner. This ensures a smooth and efficient assembly process.
  3. Careful Soldering: Begin soldering the components onto the PCB. Exercise precision and care to ensure secure connections. Follow your designed layout and schematic closely.
  4. Secure Arduino Nano: Solder the Arduino Nano 33 IoT onto the designated area on the PCB, ensuring a stable and reliable connection.
  5. Connect LEDs: Solder the 32 LEDs onto the PCB, adhering to the planned positions and color-coding. Verify each connection to prevent potential issues.
  6. Verify Connections: Double-check all connections and solder joints to guarantee a solid electrical connection. This step helps prevent future malfunctions and simplifies troubleshooting.
  7. Place in 3D-Printed Case: Carefully position the assembled PCB, Arduino Nano, and LEDs into the 3D-printed case. Ensure a snug fit and proper alignment.
  8. Secure the Case: Affix the top part of the 3D-printed case onto the base, securing the internals in place. Confirm that the case is securely closed and that all components are protected.
  9. Final Test: conduct a final test to ensure all components work harmoniously within the 3D-printed case. Verify that the LEDs respond to commands from the Arduino IoT Cloud dashboard.


Congratulations! You've successfully assembled and soldered all components into your IoT-enabled smart coaster. The final steps involve testing the coaster's functionality and ensuring a seamless connection with the Arduino IoT Cloud. Stay tuned for the upcoming steps, where we'll explore the dashboard setup and conduct thorough testing. The finish line is in sight!

Step 7: Next Steps

Congratulations on completing the assembly of your IoT-enabled smart coaster! As you marvel at your creation, consider these next steps to enhance and explore the full potential of your innovative project:

Arduino IoT App: Download the Arduino IoT app on your phone. This app allows you to manipulate the colors of your smart coaster remotely, adding an extra layer of convenience and accessibility.

Remote Color Control: Experiment with the Arduino IoT app to remotely control and change the colors of your smart coaster. Enjoy the flexibility of adjusting the ambiance to suit different moods and occasions.

Advanced Functionality: Take your project to the next level by exploring more advanced functionalities. Consider adding features such as dynamic lighting patterns, color cycles, or even integrating sensor inputs for interactive responses.

Explore Arduino IoT Cloud Features: Dive deeper into the features of the Arduino IoT Cloud. Explore automation, triggers, and notifications to create a truly dynamic and responsive smart coaster.

Share Your Creation: Share your smart coaster project with the DIY and maker community. Document your journey on platforms like Instructables or social media to inspire and guide others in creating their IoT wonders.

Continuous Iteration: Embrace a mindset of continuous iteration. Consider refining the design, adding new features, or even incorporating user feedback to make your smart coaster an evolving and dynamic creation.

Learn and Experiment: Use this project as a learning opportunity. Experiment with different components, coding techniques, and IoT functionalities. The skills gained can be applied to future projects and innovations.

Remember, the journey doesn't end here. Your smart coaster is a testament to your creativity and technical prowess. As you explore the vast possibilities of IoT and connected devices, let your imagination guide you toward even more exciting projects.

Enjoy the mesmerizing glow of your smart coaster and the endless possibilities that the world of DIY electronics has to offer!


Thanks for reading,

Yiannis