Introduction: Noisy Nancy - SPEEEduino (Part 1)
After obtaining your SPEEEduino, you may be wondering what are some of the IoT projects that you could embark on.
I am going to showcase to you one such example!
This project is called Noisy Nancy.
There are many implications of this project! For starters, you could make use of this device to detect which part of the day does your neighbourhood makes the most amount of noise. Or perhaps, you might be interested in making an anti-theft system that uses sound to detect whether the thief has invaded your home? The implications are limited only by your imagination!
Without further ado, let's get started!
This project is done by a group of students from Singapore Polytechnic, School of Electrical and Electronic Engineering. We have a total of 3 members in our group, Pan Ziyue, Julian Kang, and myself. Our supervisor is Mr Teo Shin Jen.
The purpose of our project is to create an IoT device for detecting sound. This data is sent to the Internet for further analysis, and collection.
This project was originally submitted for Tan Kah Kee's Young Inventors' Award 2017.
Step 1: Bill of Materials
Hardware
- CP2102 USB 2.0 to UART TTL 6-Pin Connector Module Serial Converter (we shall call it Serial Converter for short)
- Sound Detection Sensor Module (Microphone Module for short)
- ESP8266-01 that has already been flashed (ESP01 for short)(I'll be teaching about how to flash an ESP01 in due time)
- Female to Female wires
- Female to Male wires
- SPEEEduino
Software
- Arduino IDE
- Thingspeak account and channel
- Sample code for checking your microphone
- Sample code for SPEEEduino (available below)
Attachments
Step 2: Prerequisites
- Created thingspeak account and channel
- Flashed ESP8266
1. What is Thingspeak?
"ThingSpeak is an open source “Internet of Things” application and API to store and retrieve data from things using HTTP over the Internet or via a Local Area Network. With ThingSpeak, the user can create sensor logging applications, location tracking applications, and a social network of things with status updates."
from https://www.rs-online.com/designspark/thingspeak-a...
In short, it is a free IoT platform!
What is the purpose of creating a thingspeak account and channel?
We can store and view our data using thingspeak.
How do I create an Thingspeak account?
Click here and press the "Sign Up" Button.
Follow the instructions given to sign up
How do I create a Thingspeak channel?
Follow only the steps on the page given above.
2. How do I flash the ESP8266?
(Refer to Steps 4 and 5)
Step 3: Connect Your SPEEEduino to Your Computer
- Connect your Serial Converter to your SPEEEduino and one of the USB ports of your computer
- Connect your microphone module to Vcc and ground (Depending on what type of microphone module you used, the microphone module's Vcc can vary from 3.3V to 5V. Therefore, please check your module's datasheet! Do not assume!)
- Connect your microphone module "Output" pin to Digital Pin 4. Digital Pin 4 is to detect whether the microphone module is detecting high or low.
Step 4: Testing and Adjusting Your Microphone
We have to make sure that your microphone module is working properly before we get to the Noisy Nancy program.
1. Click on the file at the bottom to download the sample code for testing your microphone.
(Adjust your microphone module in a quiet place, as most microphone modules are sensitive.)
2. Upload your code onto the SPEEEduino.
(Make sure that you have chosen the correct COM Port to upload.)
3. Connect your microphone module to Vcc, Ground and Digital Pin 4 if you have not already done so.
(Refer to the previous step if you have not already done so.)
4. Open up the serial monitor. You should notice on your screen either "0" or "Sound Detected".
5. Adjust the knob of the microphone module until the serial monitor constantly outputs "0", but outputs "Sound Detected" whenever you make some noise. It will be a tiny sweet spot.
(Once you are done with this, head to the next step)
If you adjust the knob too much to the left or right, the serial monitor will output all '"0"s even if you make a lot of noise, or will output all "Sound Detected" even if you did not make any noise!
Attachments
Step 5: Setting Up Your Noisy Nancy Code
Please download your sample code for Noisy Nancy, if you have not already done so!
This sample code was created by my friend, Pan Ziyue! Shout out for him!
Click on the folder at the end of this step to download.
As seen from the picture that is shown above, you will notice that the wifi name and password is left blank for you! Fill them up so that your SPEEEduino can connect to your own wifi!
Do take note that you may not be able to connect to your campus or office wifi due to authentication reasons. However, you should be able to connect to your mobile hotspot, or home wifi with no problem at all!
Option 1: Connect to Mobile Hotspot
You may use your mobile phone and switch on mobile hotspot.
Then, enter your mobile hotspot's name and password.
For instance, mine is
String ssid = "AndroidAP"; // Name of your wifi
String password = "tinisking"; // Password for your wifi
Option 2: Connect to Home wifi
Enter your home wifi's name and password in the respective fields given above.
Typing in your channel's API Key
In order to send data to a Thingspeak channel, you will need to have a Write API Key.
This can be found under the API Keys tab, as shown in the picture above.
Enter your Write API Key into the given field.
For instance, mine is
String APIKey = "7NEPO0A65IY3WYKY";
Attachments
Step 6: Run Your Code!
Upload your code onto the SPEEEduino!
Watch as the magic unfolds!
Firstly, your SPEEEduino will attempt to connect to your wifi.
Then, it will send data to the Thingspeak server!
(You can observe from the pictures that I live in a rather noisy neighbourhood!)
You are able to observe the data in a field chart!
Remember that your microphone's output pin has to be connected to Digital Pin 4!
Step 7: Congratulations!
You have obtained sound data from your environment and sent it to the Internet!
This concludes my Instructables!
You may want to refer to these links to analyse your data, and act on your data (like sending a tweet, for instance)
Step 8: Conclusion
I will be adding a noob guide on how to flash the ESP01 soon! It is a painpoint for many people, including me!
I will also be setting up my very own python http server to echo the data received on a web page hosted in it!
This project was originally submitted for Tan Kah Kee's Young Inventors' Award 2017.