安卓otto_奥托(Otto)背后的硬件:猴子长毛绒,成为我的声音助手

安卓otto

by Flavio De Stefano

由弗拉维奥·德·斯特凡诺(Flavio De Stefano)

奥托(Otto)背后的硬件:猴子长毛绒,成为我的声音助手 (The hardware behind Otto: a monkey plush which became my vocal assistant)

Otto is a monkey plush that we found in a highway store during a trip with my girlfriend in February 2017.

奥托(Otto)是我们在2017年2月与我的女友旅行时在高速公路商店发现的猴子长毛绒。

Its ability, while being extremely cute, was to listen to you, then walk and repeat all things with a higher pitch.

它的功能虽然非常可爱,但是却能倾听您的声音,然后走路并以更高的音调重复所有事情。

My goal was to make it more powerful by transforming it into a vocal assistant.

我的目标是通过将其转换为声音助手来使其更强大。

This is the first part of a series about Otto.

这是关于奥托系列的第一部分。

Originally, it was composed by the following hardware:

最初,它是由以下硬件组成的:

  • A motor connected to his legs for allowing him to walk

    电机连接到他的双腿,使他可以走路

  • A simple, closed (for modifications), built-in board

    一个简单的封闭式(用于修改)内置板

  • A microphone and a speaker

    麦克风和扬声器

  • A push button to start the listening phase

    一个按钮开始收听阶段

  • Four AA batteries

    四节AA电池

  • A switch to completely power off the circuit

    完全切断电路电源的开关

I wanted to replace all these things with fresh and programmable hardware.

我想用新的可编程硬件代替所有这些东西。

The real challenge here was to find the rights components that fitted in the original enclosure. The available space wasn’t much, so every choice had to be done conscientiously.

真正的挑战是找到原始机箱中安装的版权组件。 可用空间不多,因此必须认真进行每个选择。

基板 (Base board)

The preferred hardware for this project are Raspberry PI boards.

此项目的首选硬件是Raspberry PI板。

They are tiny and powerful enough to allow developers to use a high-level programming language and built-in libraries without flashing the software every-time.

它们非常小巧,功能强大,足以使开发人员能够使用高级编程语言和内置库,而无需每次都刷新软件。

Furthermore, you can debug your application in a more comfortable environment.

此外,您可以在更舒适的环境中调试应用程序。

The best hardware at the time was the Raspberry Pi Zero W. Launched at the end of February 2017, the Pi Zero W has all the functionality of the original Pi Zero but with added connectivity.

当时最好的硬件是Raspberry Pi Zero W.Pi Zero W于2017年2月推出,具有原始Pi Zero的所有功能,但具有附加的连接性。

The board was not enough for such a project, so I added additional hardware.

该板还不足以进行此类项目,因此我添加了其他硬件。

音频组件 (Audio components)

To build a vocal assistant, we need audio components. The requirements for these components are, of course, a speaker and a microphone.

要构建人声助手,我们需要音频组件。 这些组件的要求当然是扬声器和麦克风。

For the microphone, I tried a USB microphone. The problem with this accessory was that it was not sensible as I wished. Furthermore an additional USB hub was required to connect it.

对于麦克风,我尝试了USB麦克风。 该配件的问题在于它不符合我的期望。 此外,还需要一个额外的USB集线器来连接它。

Moreover, I couldn’t connect a raw speaker easily.

而且,我无法轻松连接原始扬声器。

For this reason, I opted to buy an additional board that accomplished this task very well: ReSpeaker 2-Mics Pi HAT.

出于这个原因,我选择购买另外一块可以很好地完成此任务的主板: ReSpeaker 2-Mics Pi HAT。

ReSpeaker 2-Mics Pi HAT is a dual-microphone expansion board for Raspberry Pi designed for AI and voice applications.

ReSpeaker 2-Mics Pi HAT是用于Raspberry Pi的双麦克风扩展板,专为AI和语音应用而设计。

The board is developed based on WM8960, a low power stereo codec. There are 2 microphones on both sides of the board for collecting sounds. It also provides 3 APA102 RGB LEDs, 1 User Button and 2 on-board Grove interfaces.

该开发板基于低功耗立体声编解码器WM8960开发。 评估板的两侧都有2个麦克风,用于收集声音。 它还提供3个APA102 RGB LED,1个用户按钮和2个板载Grove接口。

I did not plan to connect LEDs to my board, but the fact that this HAT has built-in LEDs made me think to use them.

我不打算将LED连接到板上,但是这个HAT内置了LED的事实使我考虑使用它们。

Then I took an old Bluetooth mini-speaker, disassembled it, and connected it to the JST 2.0 Speaker Out port.

然后,我拿起旧的蓝牙微型扬声器,将其拆解,然后将其连接至JST 2.0 Speaker Out端口。

To make it work, you have to install their drivers on your board. Drivers are also used to control LEDs within your application via a standard protocol.

要使其工作,您必须在板上安装其驱动程序。 驱动器还用于通过标准协议控制应用程序中的LED。

Hint: when you install a shield, all your GPIO pins are covered. It’s useful to know which pins are really used by your board. To accomplish that, use https://pinout.xyz/

提示:安装屏蔽时,所有GPIO引脚均被覆盖。 了解主板上确实使用了哪些引脚很有用 为此,请使用https://pinout.xyz/

For example, for this board, check out this link: https://pinout.xyz/pinout/respeaker_2_mics_phat

例如,对于此板,请查看以下链接: https : //pinout.xyz/pinout/respeaker_2_mics_phat

为电路板供电 (Powering the board)

The Raspberry Pi board can be easily powered via USB 5V input. The problem with this approach is that you have to buy a battery pack and connect it via USB.

Raspberry Pi板可通过USB 5V输入轻松供电。 这种方法的问题在于,您必须购买电池组并通过USB连接。

I didn’t find any battery pack small enough to fit my plush, then my unique alternative was using LiPo batteries.

我没有找到足够小的电池组来容纳我的长毛绒,所以我唯一的选择是使用锂聚合物电池。

You can’t connect your LiPo battery to your board, you have to use a converter. It can be powered by any 3.7V LiIon/LiPoly battery, and then it converts the battery output to 5.2V DC.

您不能将LiPo电池连接到板上,必须使用转换器。 它可以由任何3.7V锂离子/锂聚合物电池供电,然后将电池输出转换为5.2V DC。

Initially I bought a LiPo SHIM, but I didn’t notice that this controller provides power to your board without charging your batteries.

最初,我购买了LiPo SHIM ,但没有注意到该控制器无需充电即可为您的电路板供电。

For this reason I switched to Adafruit PowerBoost 500 Charger. It has a built-in battery charger circuit. You’ll be able to keep your project running even while charging the battery!

因此,我改用了Adafruit PowerBoost 500充电器。 它具有内置的电池充电器电路。 即使给电池充电,您也可以保持项目运行!

附加硬件 (Additional hardware)

The software uses the “hotword” concept to start the interaction. Basically, it continuously listens for an hotword, like “Hey Otto”, then you just talk and say commands.

该软件使用“ hotword”概念来启动交互。 基本上,它会不断听取“ Hey Otto”之类的热词,然后您只需说说命令即可。

For having an alternative method to start the interaction, I installed a push button connected directly to the GPIO board, at GPIO8 pin.

为了有一种替代方法来启动交互,我在GPIO8引脚上安装了一个直接连接到GPIO板的按钮

Now only one thing was missing: the power on-off switch.

现在只缺少一件事: 电源开关。

I connected this simple component to the PowerBoost Charger via its ENABLE port. The purpose of the ENABLE port is to disconnect the output completely.

我通过其ENABLE端口将此简单组件连接到PowerBoost充电器。 ENABLE端口的目的是完全断开输出。

将所有内容连接在一起 (Connect everything together)

Here you can see in details the complete circuit diagram (https://www.circuit-diagram.org/circuits/0d85ce05)

在这里,您可以详细查看完整的电路图( https://www.circuit-diagram.org/circuits/0d85ce05 )

And here a snapshot of the work:

这是工作的快照:

翻译自: https://www.freecodecamp.org/news/the-hardware-behind-otto-a-monkey-plush-which-became-my-vocal-assistant-96a25c634021/

安卓otto

文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览93689 人正在系统学习中 相关资源:火绒安全软件(安全防护软件)官方中文完整版V5.0.62.4|火绒杀毒…

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年6月16日
下一篇 2020年6月16日

相关推荐