10浏览
查看: 10|回复: 4

[项目] 【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计

[复制链接]
该设备通常以不同的频率和强度向测试对象的耳机传输纯音,并记录对象的反应以产生阈值灵敏度的听力图。

听力计是一种用于评估听力敏锐度的仪器。它们通常由一个连接到耳机的嵌入式硬件单元和一个测试对象反馈按钮组成。该设备通常以不同的频率和强度将纯音传输到测试对象的耳机中,并记录对象的响应以生成阈值灵敏度的听力图。我最近在一家专业机构进行了听力测试,并以听力图的形式收到了结果。

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图1

驴友花雕  中级技神
 楼主|

发表于 4 小时前

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计

我决定尝试制作一个类似的设备,因为该设备的工作原理非常简单。在网上搜索了一番后,我发现了一些使用电脑声卡来实现类似功能的应用程序,但我的目标是制作一个实用的独立设备。我在 Arduino 论坛上找到了一位名为“cstram”的用户提出的此类设备的想法,并决定根据我当时的硬件条件进行一些修改。Arduino 是一个输入输出单元,它可以生成不同频率和强度的音调,然后将从被测者那里收到的反馈结果显示在由 64 个 RGB LED 组成的 8 x 8 像素分辨率屏幕上。屏幕上会显示两个不同颜色的图表,分别对应左耳和右耳。

  该设备构建起来相对简单,由以下几个组件组成:
   - Arduino Nano 微控制器
   - 8x8 矩阵由 64 个 RGB LED 组成,内置 WS2812 芯片。为了获得更有趣的视觉印象,我制作了一个 3D 打印网格
   - 带有 SSD1306 芯片的 128x64 Oled 显示屏
   - 旋转编码器
   - 按钮
   - 母耳机插孔
   - 和小耳机
   -
该设备由两个串联的锂电池供电,并在其输出端放置了一个 7805 5V 稳压器。这次我忽略了电池控制和充电电路,因为该部分之前已经描述过几次。

如果您想为这个项目或任何其他电子项目制作自己的 PCB,PCBway 是您的绝佳选择。PCBway 是中国在 PCB 原型和制造领域最有经验的 PCB 制造公司之一。他们有一个大型在线社区,您可以在其中找到开源项目,也可以在那里分享您的项目。根据我的个人经验,我可以告诉你,在这个社区你可以找到许多有用的项目,其中有已经设计好的 PCB,你可以直接从那里下订单。

现在让我们看看该设备的实际工作原理:打开设备后,第一个测试频率和以分贝为单位的音量会显示在OLED屏幕上。在矩阵屏幕上,行代表音量(以分贝为单位),列代表给定频率(以赫兹为单位)。现在,我们将耳机戴在一只耳朵上,并使用旋转编码器逐渐增加音量,直到听到声音。此时,我们按下按钮,按钮会记住第一个频率的结果并切换到下一个频率,如此循环至最后。完成最后一个频率的测试后,我们将耳机换到另一只耳朵,并对所有频率重复此过程。此时,二极管将亮起不同的颜色。最后,该设备会分别以红色和蓝色绘制双耳的听力图。显示屏将提供所有必要的信息,告诉您每个频率下的听力质量。红色代表左耳,蓝色代表右耳。需要说明的是,这不是专业设备,可以用于娱乐。然而,如果我们像我一样使用专业设备进行校准,我们就可以对我们的听觉器官的听觉能力有相当深入的了解。

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图9

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图3

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图6

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图7

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图8


【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图1

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图2

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图5

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图4


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 4 小时前

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计

更新:
项目完成几天后,我拿到了用于骨传导测试的骨传导耳机。这是另一种纯音测试,用于测量内耳对声音的响应。测试人员会将一个导体放置在耳后,它会将微小的振动通过骨骼直接传递到内耳。这与传统的利用空气传递可听声音的测试方法不同。如果骨传导测试的结果与纯音听力测试结果不同,您的听力学家可以使用这些信息来确定您的听力损失类型。确定阈值的方法与获取气导阈值的方法相同。骨传导测量通常限制在 250 至 4000 Hz 的频率范围内。我对之前描述的设备进行了小幅修改,扩展了它的功能,之后也可以用它来进行骨传导测试。

由于测试耳机振动器的欧姆电阻只有 4 欧姆,因此只需添加一个小型音频放大器即可。我使用了一个小型廉价的 D 类放大器,带有一个电位器,非常适合此目的。

只需将耳机信号连接到放大器的输入端即可。骨传导耳机通过合适的连接器连接到放大器的输出端。借助电位器,我们可以使用类似的商用设备进行精确校准。正如我之前提到的,测试方法与上一个案例完全相同,只是将骨传导振荡器放置在耳后骨头上,而不是耳机上。最后,将设备安装在一个合适的PVC板盒子中,并用彩色壁纸覆盖。

  1. #include <Volume.h>
  2. #include <RotaryEncoder.h>
  3. #include <Adafruit_NeoPixel.h>
  4. #include <OneButton.h>
  5. #include <U8glib.h>
  6. #define PIN 8
  7. Adafruit_NeoPixel strip = Adafruit_NeoPixel(64, PIN, NEO_GRB + NEO_KHZ800);
  8. U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);  // I2C / TWI
  9. Volume vol;
  10. // Change these two numbers to the pins connected to your encoder.
  11. //   Best Performance: both pins have interrupt capability
  12. //   Good Performance: only the first pin has interrupt capability
  13. //   Low Performance:  neither pin has interrupt capability
  14. // ----- Rotary settings here ----
  15. #define ROTARYSTEPS 1
  16. #define ROTARYMIN 1
  17. #define ROTARYMAX 8
  18. int lastPos = 0;
  19. int exitFlag = 0;
  20. // Setup a RoraryEncoder for pins A2 and A3:
  21. RotaryEncoder encoder(A2, A3);
  22. // Last known rotary position.
  23. // Setup a new OneButton on pin A1.  
  24. OneButton button(A1, true);
  25. int risultati[3][8];
  26. int j=0;
  27. int x=0;
  28. int y=0;
  29. int orecchio=1;
  30. int pos = 1;
  31. char db[9][10]=
  32. { "0 db",
  33.   "10 db",
  34.   "20 db",
  35.   "30 db",
  36.   "40 db",
  37.   "50 db",
  38.   "60 db",
  39.   "70 db",
  40.   "80 db"
  41. };
  42. char freq[8][10]
  43. { "125 Hz",
  44.   "250 Hz",
  45.   "500 Hz",
  46.   "1000 Hz",
  47.   "2000 Hz",
  48.   "3000 Hz",
  49.   "4000 Hz",
  50.   "8000 Hz"  
  51. };
  52. int freqn[8][2]
  53. {
  54.   125, 250, 500, 1000, 2000, 3000, 4000, 8000
  55. };
  56. char ear[3][11]
  57. { "Volume:",
  58.   "Vol. Left:",
  59.   "Vol. Righ:"
  60. };
  61. void setup() {
  62.   strip.begin();
  63.   strip.show(); // Initialize all pixels to 'off'
  64.   encoder.setPosition(0 / ROTARYSTEPS); // start with the value of 0.
  65.   u8g.setColorIndex(1);         // pixel on for Display
  66.   button.attachLongPressStop(longPressStop);
  67.   vol.begin(); // After calling this, delay() and delayMicroseconds will no longer work
  68.                // correctly! Instead, use vol.delay() and vol.delayMicroseconds() for
  69.                // the correct timing
  70.   vol.setMasterVolume(3.00); // Self-explanatory enough, right? Try lowering this value if the speaker is too loud! (0.00 - 1.00)
  71.   vol.delay(500);
  72.    
  73.   Serial.begin(115200);
  74.   Serial.println("Volume test with Encoder:");
  75. }
  76. void loop() {
  77.   button.tick();
  78.   encoder.tick();
  79.   int newPos = encoder.getPosition();
  80.   if (pos != newPos) {
  81.     if (newPos < ROTARYMIN) {
  82.     encoder.setPosition(ROTARYMIN / ROTARYSTEPS);
  83.     newPos = ROTARYMIN;
  84.     } else if (newPos > ROTARYMAX) {
  85.       encoder.setPosition(ROTARYMAX / ROTARYSTEPS);
  86.       newPos = ROTARYMAX;
  87.     }
  88.     Serial.print(newPos);
  89.     Serial.print(", ");
  90.     Serial.print(x);
  91.     Serial.println();
  92.     if (orecchio < 3){
  93.     u8g.firstPage();  
  94.     do {
  95.       draw(ear[orecchio], 25, 16);
  96.       draw("Freq:", 15, 55);
  97.       draw(db[newPos], 40, 35);
  98.       draw(freq[x], 60, 55);
  99.     } while( u8g.nextPage() );
  100.     } else {
  101.       u8g.firstPage();  
  102.     do {
  103.       draw("  FINAL GRAPH  ", 0, 20);
  104.       draw("   EXECUTED    ", 0, 50);
  105.     } while( u8g.nextPage() );
  106.     }
  107.    
  108.     pos = newPos;
  109.     vol.tone (freqn[x],pos);
  110.     if (orecchio < 3)
  111.       for (j=(x*8); j<64;j++)
  112.         strip.setPixelColor(j, 0, 0, 0);
  113.     strip.show();
  114.     if ((x==0 or x==2 or x==4 or x==6) and orecchio==1)
  115.       strip.setPixelColor((pos-1)+(x*8), 10, 0, 0);
  116.     if ((x==1 or x==3 or x==5 or x==7) and orecchio==1)
  117.       strip.setPixelColor(((x+1)*8)-(pos), 10, 0, 0);
  118.     if ((x==0 or x==2 or x==4 or x==6) and orecchio==2)
  119.       strip.setPixelColor((pos-1)+(x*8), 0, 0, 10);
  120.     if ((x==1 or x==3 or x==5 or x==7) and orecchio==2)
  121.       strip.setPixelColor(((x+1)*8)-(pos), 0, 0, 10);
  122.     strip.show();
  123.     }
  124. //  vol.delay(10); // solo per test
  125. }
  126. // This function will be called once, when the button1 is released after beeing pressed for a long time.
  127. void longPressStop() {
  128.   Serial.print("Button 1 longPress stop, x=");
  129. //  scanf("%d", &risultati[orecchio][pos]);
  130.   risultati[orecchio][x]=pos;
  131.   x=x+1;
  132.   pos=0;
  133.   encoder.setPosition(1);
  134.   if (x>7 and orecchio == 1) {
  135.     x=0;
  136.     orecchio =2;
  137.     }
  138.     if (x>7 and orecchio == 2) {
  139.     u8g.firstPage();  
  140.     do  {
  141.       draw("  PLEASE WAIT  ", 0, 20);
  142.       draw("  FINAL GRAPH  ", 0, 50);
  143.         } while( u8g.nextPage() );
  144.       strip.clear();
  145.       for (j=1; j<3;j++) {
  146.         Serial.println();
  147.         for (x=0; x<8;x++) {
  148.           if ((x==0 or x==2 or x==4 or x==6) and j==1)
  149.             strip.setPixelColor((risultati[j][x]-1)+(x*8), 10, 0, 0);
  150.           if ((x==1 or x==3 or x==5 or x==7) and j==1)
  151.             strip.setPixelColor(((x+1)*8)-(risultati[j][x]), 10, 0, 0);
  152.           if ((x==0 or x==2 or x==4 or x==6) and j==2)
  153.             if (strip.getPixelColor((risultati[j][x]-1)+(x*8)) == 0)
  154.               strip.setPixelColor((risultati[j][x]-1)+(x*8), 0, 0, 10);
  155.             else
  156.               strip.setPixelColor((risultati[j][x]-1)+(x*8), 10, 0, 10);
  157.           if ((x==1 or x==3 or x==5 or x==7) and j==2)
  158.             if (strip.getPixelColor(((x+1)*8)-(risultati[j][x])) == 0)
  159.               strip.setPixelColor(((x+1)*8)-(risultati[j][x]), 0, 0, 10);
  160.             else
  161.               strip.setPixelColor(((x+1)*8)-(risultati[j][x]), 10, 0, 10);
  162.           strip.show();
  163.           Serial.print(risultati[j][x]);
  164.           Serial.print(", ");
  165.           vol.delay(1000);
  166.         }
  167.         
  168.       }
  169.       x=0;
  170.       orecchio = 3;
  171.     }
  172.   Serial.println(x);
  173.   Serial.print("Ear = ");
  174.   Serial.println(orecchio);
  175.   
  176. } // longPressStop1
  177. void draw(char* parola, int posx, int posy) {
  178.   // graphic commands to redraw the complete screen should be placed here  
  179.   u8g.setFont(u8g_font_unifont);
  180.   //u8g.setFont(u8g_font_osb21);
  181.   u8g.drawStr( posx, posy, parola);
  182. }
复制代码



回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 4 小时前

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 4 小时前

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计

附录
【Arduino 动手做】用于评估听力敏锐度的机器:Arduino听力计
项目链接:https://hackaday.io/project/1879 ... t-device-audiometer
项目作者:米尔塞姆克 mircemk
项目视频 :https://www.youtube.com/watch?v=H_ecWkNRzCI
项目代码:https://cdn.hackaday.io/files/18 ... j%20za%20128x64.txt
电原理图:https://cdn.hackaday.io/files/1879208039969280/Schematic . jpg
https://cdn.hackaday.io/files/1879208039969280/Schematic%20Bone . jpg

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图2

【Arduino 动手做】评估听力敏锐度的机器:Arduino听力计图1

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4 备案 沪公网安备31011502402448

© 2013-2025 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail