Google’s voice assistant has been around for a while now as well as when Amazon released its Alexa API as well as ported the PaaS Cloud code to the Raspberry Pi 2 it was just a matter of time before everybody else jumped on the quick train to maker kingdom. Google just did it in style.

Few understand that the Google assistant API for the Raspberry Pi 3 has been available for a long time now however when they decided to provide away a free set with the may 2017 problems of MagPi magazine, they made an perception on everyone. unfortunately the world has more makers as well as hackers as well as the number of copies of the magazine are limited.

In this writeup, I design the diy version of the AIY set for everybody else who wishes to talk to a cardboard box. I take a better look at the free kit, take it apart, put it together as well as replace it with diy magic. To make things more convenient, I likewise designed an enclosure that you can 3D print to total the kit. aloitetaan.

The Teardown

A shout out to my buddy [Shabaz] in the UK for sending me a copy of the MagPi. The “Google AIY jobs Voice Kit”(henceforth understood as the kit) contains two PCBs as well as a lot of other stuff. The Voice HAT which appears like a Sound-Card-On-A-Diet has extremely restricted number of components. I will detail each section as well as draw the KiCAD schematic for the exact same one by one

Servos

Starting from the left side, there are 6 sets of 3-pin headers that are labelled ‘Servos’. The meant servo manage is made possible utilizing the Raspberry Pi 3’s on-board PWM module. Each set has a GPIO pin, 5V as well as GND connection. The GPIO pin does not link directly to the Raspberry Pi 3’s header however rather with 220Ohm present limiting resistors (labelled R1-R6).

Virtalähde

Just south of these are gadgets identified Q5 as well as Q6 which I am presuming are part of a power supply choice circuit. correct me if I am wrong however right here is my estimate. The working is simple where Q5 only turns ON when the input voltage is higher than the 5V from the USB port. A simple comparator should do so I am utilizing the LM393 for reference.

EDIT: [Raivsr] explained that this might be the equivalent of the Raspberry Pi ‘Ideal Diode’.

Communication Interfaces

North of the ‘Servo’ headers is J15 labelled I2C that directly link to the Raspberry Pi 3 header. That means these should not be linked to anything with 5V pull-ups. They are not being utilized on the board however we will discuss more on this later. right next to it is the SPI as well as 2-pin UART headers. once again these link directly to the primary header as well as serve only as a breakout.

The DAC as well as EEPROM

A bit lower as well as we show up at the boxed circuit with a 16-Pin QFN marked ‘AKK BDQ’. This is the Maxim MAX98357A(PDF) which is an I2S DAC with a class D amplifier. It drives the speaker directly nevertheless since there is only one output, it can only be mono or integrated stereo. It’s still pretty rocking for the budget.

The fascinating thing is the existence of JP6 which seems to have all the I2S connections from the Maxim MAX98357A as well as a few other choose lines. integrated with the two vias that link to the second speaker output, you might potentially in shape one more Maxim MAX98357A breakout board on top to get stereo sound. I am going to do the schematic as well as make it downloadable as well as if you want to provide it a shot let me understand the results. think about it optional homework.

Next to the DAC is an 8-pin SSOP which is a 24C32 (PDF) I2C EEPROM. It’s not linked to the I2C header I talked about earlier however rather to pins 27 as well as 28 of the Raspberry Pi 3 header. According to the Raspberry Pi Foundation’s blog.

“The EEPROM holds the board manufacturer information, GPIO configuration as well as a thing called a ‘device tree‘ fragment – basically a description of the connected hardware that enables Linux to immediately tons the needed drivers.”

So its got some additional sauce that makes things tick as well as I might utilize a BusPirate to Dump the data however I am not sure if Google considers it Intellectual residential or commercial property so I won’t. I have an alternate for it also so checked out on.

Kuljettajat

Moving towards the right, we discover 4 headers marked ‘Drivers’. These are MOSFET circuits for controlling tons such as relays. [Shabaz] did a fantastic task tracing out the elements on this as well as the 3 pins are GPIO, 5V as well as Driver.

The MOSFETs can drive tons of as much as 500mA each thanks to a polyswitch nevertheless the GPIOs are offered for utilize directly as well. tons to be driven should be linked between the pins marked ‘+’ as well as ‘-‘. The header pin on the left is a direct gain access to to GPIOs header pins from the Raspberry Pi 3 as well as the schematic shows the same.

Use these to link LEDs or similar gadgets to suggest the operation of the relays or loads.

Microphone as well as Button Connectors

More fascinating stuff is happening on the right side’s upper right with a push button as well as two JST connectors. The 4 pin connector is meant for the push button that sits on top of the assembled enclosure. The little PCB mounted push button is wired in parallel with the outside switch as well as can be utilized in its location while setting up as well as testing. The 5 pin JST is for the microphone connector as well as has all the I2S pins.

The Microphones

Lastly, the microphone board is marked 432 QDF21G, as well as has Knowles SPH0645LM4H MEMs digital microphones that talk I2S directly.

Se siitä!

That about wraps up the teardown as well as all the info needed to make your own AIY Kit. The KiCAD schematic data are offered for download from GitHub nevertheless I leave you with the fun part which is the design as well as routing.

Here is some food for thought. Some parts can be omitted as well as the size of the hat can be shrunk down to the Pi Zero pHat.

For simplicity reasons, I am utilizing the preconfigured OS picture from the Google AIY page. It is a tad short of 900MB as well as can be downloaded directly from Goolge (huge file).

Add A Shutdown Button

You most likely noticed the little golden button next to the huge eco-friendly button in the picture above as well as that is the very first part of the exercise. It is a shutdown button as well as is added since I don’t want to SSH to the box every time I want to turn it off safely.

Get the button you want to utilize as well as add two wires with female headers. This bit works even without the Voice Hat so feel free to try it out. next if you have a voice hat, add male headers to the I2C part. You may select any type of other pins as well as it will still work. link the button to the SDA or GPIO 2 as well as boot the Pi 3 up.

Open up your favourite text editor as well as copy-paste the complying with code into it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/python
# simple script for shutting down the raspberry Pi at the press of a button.
# by Inderpreet Singh

import RPi.GPIO as GPIO
import time
import os

# utilize the Broadcom SOC Pin numbers
# configuration the Pin with interior pullups enabled as well as PIN in reading mode.
GPIO.setmode(GPIO.BCM)
GPIO.setup(02, GPIO.IN, pull_up_down = GPIO.PUD_UP)

# Our function on what to do when the button is pressed
def Shutdown(channel):
    os.system("sudo shutdown -h now")

# add our function to execute when the button pressed event happens
GPIO.add_event_detect(02, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)

# now wait!
while 1:
    time.sleep(1)

Save the data in your /home/pi folder as shutdown.py

In a terminal type the complying with commands

1
chmod +x shutdown.py python shutdown.py &

This should make the script run in the background. If you press the button, the Pi should shutdown immediately. You may select to add a delay by uncommenting the sleep phone call in the example code. Alternatively, you may likewise modification the GPIO by replacing the appropriate number in the python script.

Viileä! now we can shutdown by pressing a button.

Add a USB noise Card

The obvious alternate to the Google AIY Voice Hat is to utilize any type of USB noise Cards that are offered from a number of sources. The easiest method is to just plug one in as well as configure the software application to utilize that instead of the Hat however when there two drivers installed, the python scripts requirement to be reconfigured to make whatever seamless.

Once you plug in the soundcard, the very first thing to do is inspect if it was acknowledged or not. In the terminal window, type in:

1
aplay – l

‘aplay’ is utilized by the scripts to speak out the replies so you should be able to see two noise devices. note that the onboard noise has been disabled from within the config.txt (see gadget tree reference) and can be enabled if you plan to utilize a USB microphone instead of the noise card. The windows output should look like the picture below.

I would like to set the USB noise card as the default audio, as well as for that we requirement to customize the /etc/asound.conf .

1
sudo nano /etc/asound.conf

Delete the existing material as well as replace it with text as shown below. though this sets the default input as well as output gadget to the USB device, there is one more step to make things work. (To exit nano, utilize Ctrl+x, y, return)

Next we edit to audio.py data that handles all the audio playing as well as recording functionality. For that, open up the data in your favourite text editor; mine is nano:

1
sudo nano /home/pi/voice-recognizer-raspi/src/audio.py

Scroll down to the part thatValtioiden arecord “, joka on __init__-toiminnossa. On selvää, että on omistettu prosessi, joka pitää tallennin käynnissä, kun näytön videossa. Tällä hetkellä haluamme muokata argumentteja sen varmistamiseksi, että se hyödyntää USB-korttia saadaksesi äänen alkuperäisen äänihattun sijasta. Yksinkertainen säätö “-d”, “sysdefault: kortti = 1 ‘pitäisi riittää alla olevan kuvan mukaisesti.

Samankaltainen muutos on tarpeen, että APLAY-toiminto on hieman edelleen koodissa.

Tämän kanssa hack on valmis! Kaksoisnapsauta “Test_audio.py” tarkastaa, jos ääni toimii. Meiltä puuttuu vain yksi osa palapeliä – “Kuuntele” -painiketta! Joten vain kaapeli painike GPIO23: n välillä sekä vierekkäisen maanpinnoitteen sekä sitten ajaa ‘SRC / Main.py’ aloittaaksesi pelaamisen DIY Google Aiy.

Demo

Pieni video-demo ehdotettu hakata USB-äänikortti, ulkopuolinen kaiutin sekä edullinen mikrofoni.

Kotelo

3D-painettu kotelo on suunniteltu Fusion360: ssä sekä STL-tiedot ovat osa GitHub-arkistoa. Voit hyödyntää täsmälleen samaa koteloa useille työpaikoista, koska vadelma PI sekä satamat tuodaan mukavuutta. Sisällä on paljon aluetta lisätä hattuja sekä ylimääräisiä piirejä.

Tein kotelon jakautumisen keskeltä sen varmistamiseksi, että se on helppo päästä GPiosiin. Koko asia painaa muodossa, mukaan lukien yläkansi, jolla on reikiä kolmelle painikkeelle. Vaikka olisi järkevää saada pienempiä painikkeita, koska tuloksen odotetaan olevan kovempi kuin pahvi. Kaiuttimella on runsaasti aluetta, jos valitset, että se sisältää jonkin verran erilaisen.

Minulla ei ole ollut mahdollisuutta tulostaa yhtä ja päivittää tämän sivun, kun aiheessa on jonkinlainen kehitys. Täällä on muotoilu.

Yhteenveto

Googlella on jo API: n käytettävissä yleisölle, mutta ennalta määrätty Raspbian kuva auttaa paljon ihmisiä pääsemään alkuun. Olen yrittänyt suunnitella melukortin perusteet lisäksi tarjota suunnitelmat vastaavan kortin, jos haluat tehdä yhden. Toisille selitetään valinnan ulkopuolisen melukokon ulkopuolisen kortin hyödyntämisen sekä osoittamaan, että toivon, että se vaikuttaa ihmisiin todella pääsemään tällaisiin hankkeisiin. Maailma tarvitsee enemmän Aiyä ja täällä on sinun mahdollisuus aloittaa, joten mitä odotat? Hanki hakkerointi.

Leave A Comment

Recommended Posts

Anker tarjoaa Powerwave Stand + Pad -paketin vain 25,99 dollarilla tänään, se on hullu vastinetta rahalle

Kaikki pitävät kahdesta-for-one-deal-arvosta. Varsinkin kun jompikumpi nipun kahdesta tuotteesta saattaa todennäköisesti olla kysyntäkustannusten arvoinen molemmille. Amazon ja Anker ovat ryhtyneet niin paljon kuin tarjoavat Powerwave Qi -valmiutta latausosastoa ja tyynyä kuin pakattu yhdeksi ostokustannukselle, joka on vain 25,99 dollaria. Langattomat lataustyynyt ja […]

kctsj

Anker Heals: 130 dollaria Nebula Mars II -projektorista, USB-C PD -autoista ja kuorma-autolaturista 22 dollarilla, QC 3.0 -pöytälaturi 26 dollarilla, tonnia enemmän

osana jatkuvaa ja jatkuvaa kumppanuutta Ankerin kanssa, olemme Iloinen pystyä tarjoamaan sinulle vielä yhden valikoiman erinomaisia ​​tarjouksia, joihin sisältyy laaja valikoima eri luokkia. Jos sinulla on mieliala toivottaa tervetulleeksi uutta innovaatiota elämääsi alennetulla hinnalla, sinun on ehdottomasti löydettävä jotain houkuttelevaa täältä. Yksi […]

kctsj