genuinequality

Download free music MP3s on genuine quality, the world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, The world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, stats, charts, biographies and concerts. stats, charts, biographies and concerts.

Saturday, October 12, 2024

AIY Voice HAT and MiniDexed

Someone asked on the MiniDexed forums if the Google/Raspberry Pi AIY Voice HAT could be used with MiniDexed. This reminded me that I had V1 of the kit tucked away in a corner somewhere, so decided to finally take a look at it! Warning! I strongl…
Read on blog or Reader
Site logo image Simple DIY Electronic Music Projects Read on blog or Reader

AIY Voice HAT and MiniDexed

By Kevin on October 12, 2024

Someone asked on the MiniDexed forums if the Google/Raspberry Pi AIY Voice HAT could be used with MiniDexed. This reminded me that I had V1 of the kit tucked away in a corner somewhere, so decided to finally take a look at it!

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

If you are new to microcontrollers and single board computers, see the Getting Started pages.

Parts list

  • Raspberry Pi 3
  • AIY VoiceKit
  • USB MIDI Controller

AIY Voice HAT

The core project information can be found here:

  • https://aiyprojects.withgoogle.com/voice-v1
  • https://pinout.xyz/pinout/voice_hat
  • https://github.com/google/aiyprojects-raspbian/tree/aiyprojects

And here are some additional sources of information:

  • https://dronebotworkshop.com/hacking-google-aiy-voice-kit-part-1/
  • https://community.element14.com/products/raspberry-pi/b/blog/posts/google-s-alexa-like-pi-aiy-kit-mini-teardown

The Google-designed AIY Voice HAT is an add-on board designed for use with a Raspberry Pi 3 to provide audio input and output, with breakout connections for I2S, SPI, servos and motor drivers. Audio input is provided via two MEMS microphones that stream I2S directly into the Pi and audio output is provided by a MAX98357A - a "Tiny, Low-Cost, PCM Class D Amplifier with Class AB Performance" according to the datasheet.

This is the same device used on the "Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A" and in fact, if you look at the schematic for the voice HAT there is an interesting section that seems to imply that one of the Adafruit modules can be added to provide a second channel output for full stereo operation.

And it can be seen that there is a row of 7 unmarked pin header holes that when paired with a couple of additional holes the other side of the onboard MAX98357A, looks suspiciously like the pin footprint of the Adafruit board.

And sure enough, in the guide it does suggest adding that module to give a right channel output (see more here).

Audio on the AIY Voice HAT

In terms of GPIO interface, the full details can be found at pinout.xyz here and in the AIY Voice datasheet, but the relevant ones for audio output are as follows:

Physical Pin GPIO Function
2 5V Power
6 GND
12 18 I2S Clock
35 19 I2S WS
36 16 Amp Shutdown
38 20 I2S Data IN
40 21 I2S Data OUT

These are standard power and I2S (PCM) audio connections, apart from GPIO16 "Amp Shutdown". This is connected to "SD_Mode" of the MAX98357A (see above schematic section). The datasheet tells us that driving this LOW will put the amp into shutdown. But it also says it is responsible for selecting the mode of the amplifier, depending on the resistor used to drive SD_Mode HIGH. Example resistor values are provided for 1.8V and 3.3V operation:

There is a solder jumper on the board that changes the resistances to enable stereo mode - i.e. L channel goes to the onboard MAX98357A and R channel goes to the Adafruit add-on module.

For operation with MiniDexed, this pin just has to be held HIGH to 3.3V.

Also, of course, MiniDexed has no audio input, so GPIO20 (pin 38) just has to remain unused.

AIY Voice HAT Other Pins

Key additional functions for a MiniDexed would typically be:

  • Serial MIDI interface via the UART (RX/TX).
  • Display either via direct GPIO or over I2C.
  • Button inputs.
  • Rotary encoder.

In terms of the AIY Voice HAT, there are breakouts for I2C, SPI and then bespoke output driver connections for servos or motors. The button header includes outputs for a LED and an input for a button switch (which is also duplicated by the on-board button).

This means the following GPIO pins are easily available for MiniDexed purposes:

GPIO Typical AIY Use Possible MiniDexed Use
2 I2C header I2C SDA for display
3 I2C header I2C SCK for display
7 SPI header General IO
8 SPI header General IO
9 SPI header General IO
10 SPI header General IO
14 TXD header TX for MIDI
15 RXD header RX for MIDI
22 SPI header General IO
23 Button Button Input

All other GPIO pins include electronic circuitry as part of the AIY HAT which means it would be somewhat problematic to use for other purposes.

Use with MiniDexed

So for basic audio output it is possible to use the AIY Voice HAT with MiniDexed provided that GPIO 16 (Amp Shutdown) can be set HIGH.

Thankfully the Raspberry Pi has the config.txt file which is read and processed on startup before any operating system runs and this has the ability to preset GPIO pins to a defined state.

To use the AIY Voice HAT with MiniDexed therefore requires the following configuration.

In MiniDexed.ini, configure sound output to be I2S:

SoundDevice=i2s

In config.txt, preset GPIO 16 to be HIGH:

gpio=16=op,dh

Then be sure to check that any other GPIO uses in minidexed.ini do not conflict with any of the GPIO pins used by the AIY Voice HAT.

Then it is just a case of connect up the speaker, plug in a USB MIDI controller, and it just works.

Closing Thoughts

Apparently these HATs can be bought quite cheaply these days, and I suppose if you have one lying around already (that you got a number of years ago off a magazine!) then it is an easy source of an I2S DAC.

But really, it isn't easy to build out the other MiniDexed interface components to make a fully functional system, so I'd probably say save you AIY HAT for some neat robotics applications and just get a GY-PCM5102 module.

But if you want to get on an use the AIY Voice HAT as your sound output for a MiniDexed, then yes. It works. And so would the Adafruit MAX98357A breakout.

Kevin

Comment
Like
You can also reply to this email to leave a comment.

Simple DIY Electronic Music Projects © 2024.
Manage your email settings or unsubscribe.

WordPress.com and Jetpack Logos

Get the Jetpack app

Subscribe, bookmark, and get real‑time notifications - all from one app!

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com Logo and Wordmark title=

Automattic, Inc.
60 29th St. #343, San Francisco, CA 94110

Posted by BigPalaceNews at 8:56 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search This Blog

About Me

BigPalaceNews
View my complete profile

Blog Archive

  • August (105)
  • July (141)
  • June (136)
  • May (82)
  • April (84)
  • March (87)
  • February (90)
  • January (74)
  • December (72)
  • November (95)
  • October (105)
  • September (112)
  • August (116)
  • July (96)
  • June (100)
  • May (105)
  • April (95)
  • March (131)
  • February (111)
  • January (104)
  • December (98)
  • November (87)
  • October (126)
  • September (104)
  • August (97)
  • July (112)
  • June (113)
  • May (132)
  • April (162)
  • March (150)
  • February (342)
  • January (232)
  • December (260)
  • November (149)
  • October (179)
  • September (371)
  • August (379)
  • July (360)
  • June (385)
  • May (391)
  • April (395)
  • March (419)
  • February (356)
  • January (437)
  • December (438)
  • November (400)
  • October (472)
  • September (460)
  • August (461)
  • July (469)
  • June (451)
  • May (464)
  • April (506)
  • March (483)
  • February (420)
  • January (258)
  • December (197)
  • November (145)
  • October (117)
  • September (150)
  • August (132)
  • July (133)
  • June (117)
  • May (190)
  • January (48)
Powered by Blogger.