element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors Projects
  • Challenges & Projects
  • Project14
  • Sensors Projects
  • More
  • Cancel
Sensors Projects
Blog Light up Coaster using sound sensor
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: carmelito
  • Date Created: 15 Nov 2020 1:48 AM Date Created
  • Views 1926 views
  • Likes 5 likes
  • Comments 3 comments
  • sensors_lights_sounds
  • sensorsch
  • arduino-ide
  • apa102
  • arduino
Related
Recommended

Light up Coaster using sound sensor

carmelito
carmelito
15 Nov 2020
image

Sensors

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

 

Holiday season is almost here, which means it time to make something that lights up. As part of this project, we are making a Light up Coaster using an Arduino Nano, LED strip and a grove sound sensor. The coaster changes colour as soon as it hears some sound/music playing.

image

 

Here are the steps to follow, to make the coaster

Download and 3D print the STL files attached

There are 2 STL files attached in the zip file below, You can print this coasterBottom.stl file using a coloured filament and the coasterTop.stl using a transparent filament to help with the diffusion of the APA102 LED strip.

image

Soldering the circuit together

Now for the circuit we will need an Arduino Nano, LED strip APA102 and a Grove sound sensor. Here are the connections to the Arduino Nano

  • apa102 led strip Data  connected to Arduino pin# 11
  • apa102 clock connected to Arduino pin# 12
  • Sound sensor connected to A0

image

 

Once done hotglue the Arduino, Sound sensor and LED strip to the 3D printed parts.

image

 

Upload the Arduino code

Now download latest Arduino IDE, and upload the sketch below to the Arduino IDE. Before uploading the sketch you will also need the APA102 Arduino library from https://github.com/pololu/apa102-arduino

//Created for Project14 Coaster using APA102 and Grove sound sensor 
//Download the APA102 libary from - https://github.com/pololu/apa102-arduino
#include <APA102.h>  
// Define which pins to use.  
const int pinAdc = A0;  
const uint8_t dataPin = 11;  
const uint8_t clockPin = 12;  
  
APA102<dataPin, clockPin> ledStrip;  
  
// Set the number of LEDs to control, till will depend on how many you want to add to the coaster 
const uint16_t ledCount = 10;  
//Create a buffer for holding the colors (3 bytes per color).  
rgb_color colors[ledCount];  
// Set the brightness to use (the maximum is 31).  
const uint8_t brightness = 20;  
const uint8_t delayTimes = 100;
uint8_t ared =255, bgreen =255, cblue=255; 
void setup()  
{  
  Serial.begin(115200);
}  
  
void loop()  
{ 
long vol = 0;   
vol = analogRead(pinAdc);
Serial.println(vol);
// change the condition values of the vol based on the output of the serial monitor.
if(vol<100) 
    ared =0, bgreen =0, cblue=255;
else if(vol>=100 && vol<150)
    ared =0, bgreen =255, cblue=0;
else if(vol>=150)
    ared =255, bgreen =0, cblue=0;
else
    ared =255, bgreen =255, cblue=255;
  
for(uint16_t i = 0; i < ledCount; i++)
{  
  colors[i] = rgb_color(ared, bgreen, cblue); 
  ledStrip.write(colors, ledCount, brightness);
}  
delay(delayTimes);   
} 

 

Here is a quick test of the circuit, and once done the top should snap fit to the bottom 3D printed part...

imageimage

 

Here is a quick video demo.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Attachments:
STLs_Coaster.zip
  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +1
    Nice build. Just be aware, some beverages are sensitive to high levels of light. DAB
  • dubbie
    dubbie over 4 years ago +1
    A really great project. I particularly like the idea of a light-up coaster - could be a Christmas present for the person who has everything. I might have a go at making something like this, but possibly…
  • carmelito
    carmelito over 4 years ago in reply to dubbie +1
    Thanks Dubbie, and yes, I have something similar planed for the Holiday theme in December..
  • carmelito
    carmelito over 4 years ago in reply to dubbie

    Thanks Dubbie, and yes, I have something similar planed for the Holiday theme in December..

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 4 years ago

    A really great project. I particularly like the idea of a light-up coaster - could be a Christmas present for the person who has everything. I might have a go at making something like this, but possibly without the sound part and maybe with a battery of some sort rather than a USB connection.

     

    Dubbie

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago

    Nice build.

     

    Just be aware, some beverages are sensitive to high levels of light.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube