Noise Sensor & Companion Device

by 2572406 in Circuits > Arduino

258 Views, 5 Favorites, 0 Comments

Noise Sensor & Companion Device

IMG_3448.jpg
IMG_3447.jpg

This project is called DeciSense, it's made up of two parts. One device measures the levels of noise in an environment, while a companion device displays the readings using an OLED screen. The client we had in mind when designing this was parents with children who have sensory issues, although there could be many use cases.

Supplies

sound-sensor-1.jpg
H77c44a32035642de8574770947bfabeeN.jpg.jpeg
d1-mini-nodemcu-mit-esp8266-12f-wlan-modul-kompatibel-mit-arduino-295656.jpg.jpeg

The supplies needed for this project are listed below:

Hardware

  1. Arduino ESP8266 (x2)
  2. Pin headers for the Arduino's (optional if you want to solder instead)
  3. Microphone (we used the LM 393 Sounds Detection sensor)
  4. OLED display
  5. Wires

Access to Devices

  1. Computer with Arduino IDE, MQTT explorer, and access to the internet
  2. 3D printer

Files

  1. The code - two programs for the two devices
  2. STL files (for the enclosures)

Misc

  1. Filament for 3D printing
  2. A cable that can connect the Arduino's to your computer

The 3D Print

IMG_3764.jpeg
IMG_3765.jpeg

In order to make this project for yourself, firstly, using the STL file attached, 3D print the enclosures. The supports should be removed and they should be sanded down to ensure a good fit before continuing.

Downloads

Construction

IMG_3444.jpeg
wiring diagram1.jpg
IMG_3446.jpeg

The next step is to wire everything up, and put the components inside the enclosures.

Please refer to the wiring diagram attached, and connect all of the cables. Once everything is connected you can put the components into their enclosures.

Ensure the Arduino's are sat in the recessed part of the inside of the enclosures, with the micro USB ports accessible through the rectangular holes in the enclosures. The screen should sit in the recessed part on the outside of the enclosure, there are holes for mounting if required. The microphone should poke through the circular hole in the other enclosure.

Really it all only fits together one way, so this step should be fairly straightforward, but you can refer to the images attached.

Downloads

The Code

Next, you will need to make some small adjustments to the code, and set up MQTT explorer, in order for this to work on your network. Please go through the steps provided.


MQTT


  1. First ensure you have MQTT installed, head to https://mqtt-explorer.com
  2. Open MQTT
  3. Give the connection a name, it could be anything but should be unique
  4. In the "host" field type "test.mosquitto.org"
  5. Enabe "Validate certificate"
  6. Disable "encryption (TLS)"
  7. Press connect
  8. Enter your topic ID, it could be anything but should be unique
  9. That's all for MQTT!


Subscribe Code


Open Arduino IDE and connect your Arduino that's connected to the display. Open the "Subscribe" code attached below. You will need to install the libraries listed below in the "library manager".

Librarys

  1. ESP8266WiFi.h (Library for to allow the D1 mini to connect to the MQTT throught the WiFi)
  2. MQTT.h (allows to send data to the MQTT)
  3. Adafruit_GFX.h (library for the OLED screen, this may change depending on your display)
  4. Adafruit_SSD1306.h (Library for the OLED screen, this may change depending on your display)

Code

You will now need to make some edits to the code, follow the steps listed below.

  1. Line 6 - change "StudentResidences" to your wifi network
  2. Line 7 - you may need to enter your wifi password within the quotation marks
  3. Line 40 - change "ACameron2" to the topic ID that you entered in MQTT

Now you can send this code to your Arduino.


Publish Code


Next, have Arduino IDE open and connect your Arduino that's connected to the microphone. Open the "Publish" code attached below. You will need to ensure the libraries listed below are instaled in the "library manager".

Librarys

  1. ESP8266WiFi.h (Library for to allow the D1 mini to connect to the MQTT throught the WiFi)
  2. MQTT.h (allows to send data to the MQTT)
  3. conns.h

Code

You will now need to make some edits to the code, follow the steps listed below.

  1. Line 24 - change "ACameron2" to the topic ID that you entered in MQTT
  2. Line 51 - change "ACameron2" to the topic ID that you entered in MQTT

You can now send this code to your Arduino.


That's all, your code should be working now.

Optionals

Although the devices should work perfectly fine now, there are a few extra steps that could (optionally) be taken to customise and upgrade these devices, as listed below.

Cosmetic

  1. Paint - we opted to spray paint the enclosures for an even finish
  2. Stickers

Enclosures

  1. We found that the enclosures work well as is, however there are areas that magnets could easily be recessed into the plastic, with simple modifications to the STL files. This would help hold the enclosures together.

Batteries

  1. There are no internal batteries in our design, however we have intentionally left space inside the enclosures so that a small battery could be installed if required.