{"id":20011674,"url":"https://github.com/roscoe81/northcliff_spl_monitor","last_synced_at":"2025-05-04T20:31:13.462Z","repository":{"id":129683472,"uuid":"327276125","full_name":"roscoe81/northcliff_spl_monitor","owner":"roscoe81","description":"A Python Script that performs a basic sound pressure level monitor using the Pimoroni Enviro+","archived":false,"fork":false,"pushed_at":"2024-05-10T20:32:14.000Z","size":193,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T12:02:22.934Z","etag":null,"topics":["noise-monitoring","pimoroni","pimoroni-enviroplus","raspberry-pi","raspberrypizerow","sound-levels","sound-pressure-level"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roscoe81.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-06T10:26:05.000Z","updated_at":"2024-12-16T20:33:45.000Z","dependencies_parsed_at":"2023-03-13T11:19:51.416Z","dependency_job_id":null,"html_url":"https://github.com/roscoe81/northcliff_spl_monitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roscoe81%2Fnorthcliff_spl_monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roscoe81%2Fnorthcliff_spl_monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roscoe81%2Fnorthcliff_spl_monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roscoe81%2Fnorthcliff_spl_monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roscoe81","download_url":"https://codeload.github.com/roscoe81/northcliff_spl_monitor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252395254,"owners_count":21741001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["noise-monitoring","pimoroni","pimoroni-enviroplus","raspberry-pi","raspberrypizerow","sound-levels","sound-pressure-level"],"created_at":"2024-11-13T07:27:02.585Z","updated_at":"2025-05-04T20:31:13.455Z","avatar_url":"https://github.com/roscoe81.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Northcliff SPL Monitor\nA Python Script that performs a basic sound pressure level monitor using the Pimoroni Enviro+\n\nThis script explores the potential of using the Pimoroni Enviro+ as a sound pressure level monitor. This project is still in the experimental phase. It should therefore not be used when accurate sound pressure level readings are required and should only be used as a base for future development.\n\nVersions 1.0 and later use streaming to overcome the microphone's startup \"plop\" that was identified in the excellent review [here](https://flipreview.com/review-of-pimoronis-enviro-board-part2-lcd-noise-level-lightproximity/)\n\nThe microphone's startup \"plop\" can be seen [here](https://github.com/roscoe81/northcliff_spl_monitor/blob/main/Mic%20Graphs/mic_startup_no_offset.png) and it plays havoc with the sound readings if the microphone is started for each sampling. A DC offset remained after removing the startup \"plop\", seen [here](https://github.com/roscoe81/northcliff_spl_monitor/blob/main/Mic%20Graphs/mic_stable_no_offset.png) and removing that DC results in [this](https://github.com/roscoe81/northcliff_spl_monitor/blob/main/Mic%20Graphs/mic_stable_offset.png).\n\nVersion 2.8 introduces improved A-Curve weighting. This requires the installation of some additional modules and an adjustment of the alsamixer microphone level to avoid clipping. These are highlighted in the Setup section.\n\n# Setup\nsudo apt-get update\n\nsudo apt-get upgrade\n\ncurl -sSL https://get.pimoroni.com/enviroplus | bash\n\nsudo pip3 install matplotlib\n\nsudo python -m pip uninstall sounddevice\n\nsudo pip3 install sounddevice==0.3.15\n\n-------------------------------------------------\n\nFor Versions 2.8 and later:\n\nsudo apt-get install python3-scipy\n\nsudo pip3 install git+https://github.com/endolith/waveform_analysis.git@master\n\n-------------------------------------------------\n\nFor Versions 2.8 and later if wishing to use matplotlib for microphone debugging:\n\nsudo apt-get install python3-gi-cairo\n\n-------------------------------------------------\n\n\nFollow instructions at:\nhttps://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test\nincluding “Adding Volume Control”\n\nUse the following instead of the documented text for ~/.asoundrc:\n\n1.\t#This section makes a reference to your I2S hardware, adjust the card name\n2.\t#to what is shown in arecord -l after card x: before the name in []\n3.\t#You may have to adjust channel count also but stick with default first\n4.\tpcm.dmic_hw {\n5.\ttype hw\n6.\tcard adau7002\n7.\tchannels 2\n8.\tformat S32_LE\n9.\t}\n10.\t \n11.\t#This is the software volume control, it links to the hardware above and after\n12.\t#saving the .asoundrc file you can type alsamixer, press F6 to select\n13.\t#your I2S mic then F4 to set the recording volume and arrow up and down\n14.\t#to adjust the volume\n15.\t#After adjusting the volume - go for 50 percent at first, you can do\n16.\t#something like \n17.\t#arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav\n18.\tpcm.dmic_sv {\n19.\ttype softvol\n20.\tslave.pcm dmic_hw\n21.\tcontrol {\n22.\tname \"Master Capture Volume\"\n23.\tcard adau7002\n24.\t}\n25.\tmin_dB -3.0\n26.\tmax_dB 30.0\n27.\t}\n\n-------------------------------------------------\n\nFor versions prior to Version 2.8:\n\nUse alsamixer to set adau7002 capture level to 50\n\n-------------------------------------------------\n\nFor Version 2.8 and later:\n\nUse alsamixer to set adau7002 capture level to 10\n\n-------------------------------------------------\n\n\n# Operation\n\nFor a numerical display of the current approximate overall sound level (Display 0):\n\nRun python3 northcliff_spl_monitor.py or python3 northcliff_spl_monitor.py 0\n\nor for a graphical display of current and past approximate overall sound levels (Display 1):\n\nRun python3 northcliff_spl_monitor.py 1\n\nor for a graphical display of current and past approximate sound levels by frequency band (Display 2):\n\nRun python3 northcliff_spl_monitor.py 2\n\nVersion 2.1 adds the ability to cycle through the three displays by briefly touching the Enviro+'s light/proximity sensor\n\nVersion 2.2 adds a line in Display 1 that shows the maximum sound level that's been recorded since selecting that display, as well as the time and date when it was recorded. The maximum sound level is reset when selecting another display.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froscoe81%2Fnorthcliff_spl_monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froscoe81%2Fnorthcliff_spl_monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froscoe81%2Fnorthcliff_spl_monitor/lists"}