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
Experimenting with Extreme Environments
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Extreme Environments
  • More
  • Cancel
Experimenting with Extreme Environments
Blog Blog 3 - UrbanRest Guardian - Prototype Construction Journey
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experimenting with Extreme Environments to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: javagoza
  • Date Created: 2 May 2024 10:59 AM Date Created
  • Views 2261 views
  • Likes 11 likes
  • Comments 10 comments
  • UrbanRest Guardian
  • Midas MC42005A6W-SPTLYI-V2
  • Pi4 Compute Module
  • Hammond 1554VA2GYCL
  • raspberry pi
  • Experimenting with Extreme Environments
  • Hammond Manufacturing
Related
Recommended

Blog 3 - UrbanRest Guardian - Prototype Construction Journey

javagoza
javagoza
2 May 2024
Blog 3 - UrbanRest Guardian - Prototype Construction Journey

Introduction

We're now halfway through the Experimenting with Extreme Environments challenge, sponsored by Hammond Manufacturing and Element14. This marks my third blog, detailing the progress of my UrbanRest Guardian project, aimed at monitoring and classifying nighttime noises on city streets.

Let me walk you through the past two weeks. After presenting my project and meticulously studying the components, it was time to dive into the design and construction phase.

The biggest challenge? Figuring out how to arrange all the components inside the enclosure. I had quite the lineup: the Raspberry Pi4 Compute Module , a 12000 mAh battery, two external connectors, a 4x20 Midas display, a USB sound card, a sound sensor and a 12-position capacitive keyboard.

Initially, I tried a vertical layout, influenced by the engravings on the transparent enclosure cover. But it quickly became clear that if I wanted the display to be easily readable, my options were limited. So, I gave a horizontal arrangement a shot, inspired by a layout I saw in Ralphjy's project.

Surprisingly, everything fell into place much more smoothly in the horizontal layout.

Table of Contents

  • Introduction
  • Testing Component Arrangements in Enclosure
  • Integrating Capacitive Keyboard for Device Interaction
  • Configuring the Capacitive Keyboard
  • Introducing an Adjustable Sound Sensor
  • Designing the PCB on stripboard to connect the components
  • Designing the foam bed to house the battery
  • Constructing the foam bed to house the battery
  • Constructing the PCB on stripboard to connect the components
  • Assembling the cables
  • Experimenting with the microphone inside the enclosure
  • Summary and conclusions
  • References
  • UrbanRest Guardian blog series

Testing Component Arrangements in Enclosure

In the images, I show the initial trials of the horizontal layout. However, these trials unveiled several issues: the upper stripboard lacked rigidity to support the display, Raspberry Pi 4 compute module, and USB sound card; securing the 12000 mAh battery posed a challenge; and organizing the wiring and connecting the capacitive keyboard to the rest of the system proved tricky.

UrbanRest Guardian enclosure arangementimage

On the other hand, this layout left much more free space, resulting in a tidier arrangement and greatly facilitating assembly and disassembly.

Integrating Capacitive Keyboard for Device Interaction

I've added a new capacitive keyboard, MPR121, to the project for interacting with the device. Originally, communication was going to be solely remote, using the WiFi connection of the Raspberry Pi 4 compute module. However, out of curiosity, I wanted to explore the possibility of interacting with a capacitive keyboard placed on the inner side of the transparent lid of the enclosure. The cover thickness slightly exceeds the distance specifications provided by the keyboard manufacturer, so it'll be an experiment to see if this keyboard can be effectively used.

imageimage

Configuring the Capacitive Keyboard

Edit the firmware config file:

sudo nano /boot/firmware/config.txt
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtoverlay=i2c-gpio,bus=3,i2c_gpio_sda=17,i2c_gpio_scl=27

image

Reboot the system

 sudo reboot -h now

sudo i2cdetect -y 3

image

The keyboard is now responsive at address 5a on bus 3 of I2C.

Introducing an Adjustable Sound Sensor

To capture sound only during periods of bothersome noise, when a certain threshold is surpassed, I've incorporated an adjustable sound sensor with an LM393 comparator. This sensor triggers the events of sound capture and analysis. The concept is to place the sensor inside the enclosure. While I'm uncertain if this will effectively capture those noises, it's another experiment worth testing.

image

Some python code to test the sound sensor. It will be connected to GPIO26

#!/usr/bin/python
import RPi.GPIO as GPIO
import time

#GPIO SETUP
sound = 26

GPIO.setmode(GPIO.BCM)
GPIO.setup(sound, GPIO.IN)

def callback(sound):
    print "Sound Detected!"
    
GPIO.add_event_detect(sound, GPIO.FALLING, bouncetime=300)

GPIO.add_event_callback(sound, callback)  # assign function to GPIO PIN, Run function on change

# infinite loop
while True:
    time.sleep(1)

Designing the PCB on stripboard to connect the components

In the previous blog, I demonstrated how I connected the Midas I2C LCD Display to the Raspberry Pi 4 compute module using a breadboard and a jumble of messy wires. While it was sufficient for testing purposes, it lacked safety and aesthetic appeal. 

image

Therefore, for the prototype construction, I plan to tidy up all those connections by soldering them onto a stripboard. The next step involves a diagram I sketched on graph paper using a pencil and eraser.

UrbanRest Guardian stripboard diagram

I find this method quicker than creating it on a computer; I'll work on a digital version later.

image

...

Designing the foam bed to house the battery

As shown in the photo of the test arrangement, the battery sits on a lower level at the base of the box, but there's nothing securing it in place.

UrbanRest Guardian enclosure arangement

I considered various options, like crafting a support from wood or acrylic plastic, or 3D printing a structure for the battery. However, due to an injury to my right hand that limits my ability to exert force with it, I thought of opting for a softer material. Discussing it with my family, we came up with the idea of making a foam bed for the battery.

imageimage

Constructing the foam bed to house the battery


I had a foam sheets left over from the packaging of a small HDMI display. I designed the bed like a puzzle to maximize the use of the foam sheet.

imageimage

image


Cutting the foam is extremely simple with a sharp blade or knife. In the image, I used a typical ham knife for slicing Iberian ham.

image

The foam bed rests on the inner panel made of acrylic plastic. It includes pass-through holes for the standoffs that will support the stripboard panel with the interconnected electronic devices. Additionally, it features cable guides at the bottom to help organize the wiring.

image image

imageimage

image

Finally, a small panel that will be inserted into the PCB rails of the box will secure the battery on the side that remains free. The top part of the battery is secured by some standoffs at the bottom of the stripboard.

Constructing the PCB on stripboard to connect the components

The PCB construction was carried out on a single-sided stripboard prototype board. Both the capacitive keyboard and the sound sensor are connected using cables with JST-XH connectors, which have a pin pitch of 2.54 mm. I used a  ROTH ELEKTRONIK RE520-HP Prototyping Board  Eurocard, FR2, Epoxy Paper, 1.5mm, 100mm x 160mm.

The Raspberry Pi 4 compute module is inserted into a 2x40 female header, while the MIDAS LCD display is placed on a 1x16 female header.

A jumper cap allows you to turn the backlight LED of the LCD display on or off.

The 20 kOhm Bourns potentiometer enables adjustment of the LCD display contrast. The 18 Ohm resistor serves to limit the current of the LED backlight.

image image

Assembling the cables

For assembling the connection cables, I used a specialized crimping tool for the JST connectors.

image 

Experimenting with the microphone inside the enclosure

I haven't drilled the enclosure yet to install the TRS audio connector for the external microphone. I thought I could conduct tests with the microphone inside the box first. This would simplify the device construction considerably. So, I'll compare the spectrograms of the sound by placing the microphone both inside the sealed enclosure and in its intended position outside the enclosure. Testing in both scenarios will determine if the device can accurately classify the sound in both situations.

image

Construction noises on a nearby street. The video demonstrates sound capture both with the enclosure lid removed and with the enclosure lid in place.

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

Same test indoors with the noise of a radio broadcast from a Spanish radio station.

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

Finally, repeating the test outdoors with the background noise of two air conditioning units from a nearby building.

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

Summary and conclusions

This has been my journey with the enclosure over the past two weeks. The tests with the capacitive keyboard have been somewhat discouraging. While the keyboard works well outside the box, it's unable to recognize keystrokes through the polycarbonate of the enclosure lid, which may be too thick. However, it manages to detect keystrokes under other acrylic plastic sheets. I'll conduct further tests or try to increase the surface area of the keys.

The next steps will involve starting to automatically record sounds and preparing the sound classification models.

Update 2024-05-04

After carefully reading the datasheet for the MPR121 capacitive touch sensor I've written my own library to drive to configure the sensor and it works quite well for the Hammond enclosure. In the video a sample of the first tests.

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

References

  • https://www.farnell.com/cad/2239464.pdf

UrbanRest Guardian blog series

Want to know more about this project? Check out the full blog series here:

  •  Blog 1 - UrbanRest Guardian - Project Introduction 
  •  Blog 2 - UrbanRest Guardian - First contact with the kit components. 
  •  Blog 3 - UrbanRest Guardian - Prototype Construction Journey 
  •  Blog 4 - UrbanRest Guardian - Classifying Urban Sounds 
  •  Blog 5 - UrbanRest Guardian - Remote Monitoring 
  •  Final Blog - UrbanRest Guardian - Smart Street Noise Monitor 
  • Sign in to reply
  • javagoza
    javagoza over 1 year ago in reply to beacon_dave

    That is a very interesting test. I'll see what I can do. I have also done tests without the lid.

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

    Better results without the lid. I will probably put the microphone out of the box as I had planned.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to javagoza

    Looks like it is working well. A piezo contact mic pickup attached to the inside of the enclosure lid might also be worth a try.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza over 1 year ago

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

    I've achieved promising results in identifying night sounds with the microphone inside the box. Though I still to fine-tune the gain levels programmatically, the progress so far is quite encouranging.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 1 year ago in reply to javagoza

    I like the keypad you created.

    Very useful if you need to make field adjustments.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza over 1 year ago

    I have added an update with a demonstration of the operation of the capacitive keyboard, with a  MPR121 sensor, behind the transparent lid of the enclosure. Although the distance imposed by the thickness of the transparent lid is above the limits that the manufacturer guarantees, by adjusting the sensor parameters I have managed to read the keys well. Another option that I have tried is as a proximity sensor, an option that allows you to launch proximity events without even touching the box, using all the sensors to create a virtual one.

    • Cancel
    • Vote Up 0 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