Arduino speech shield

Hardware incubation. See also our in development projects wiki.

Arduino speech shield

Postby t0mpr1c3 » Sat Nov 17, 2012 9:03 am

I have been messing about with the webbotlib speech library. You might say the speech quality is 8 bit, but them's the limitations :) Another niggle is that the CPU stops doing anything else when it is speaking. I suppose one option would be to simplify and shrink the library and adapt it for a RTOS. Another option would be to put it on a slave atmega168 which is what webbot recommends. This would have the advantage that updates to the library would be easy to incorporate into the firmware. Also the speaker, volume control and so on could be hived off to this separate module.

This could be the basis for an Arduino shield. The commercial offerings are http://www.ginsingsound.com/ and https://www.sparkfun.com/products/9578

Edit: I have found a couple more text-to-speech boards. The Emic2 implements DECtalk and sounds good. The VoiceBox Shield and RoboVoice Shield Kit use the SpeakJet IC which doesn't do text-to-speech on its own. Demos I have heard sound distinctly robotic, but possibly slightly better then webbot. Also there is the Cantarino software for Arduino which seems to be at an early stage of development.
Last edited by t0mpr1c3 on Thu Dec 13, 2012 4:29 pm, edited 2 times in total.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Tue Nov 20, 2012 12:48 pm

The speech samples on the webbotlib are actually 4 bit. I think I will put an atmega328p and ISP6 header on the shield to allow for upgrades. DIP chips in sockets and through hole components to make it kit friendly. 20 MHz crystal. Default I2C communication. Break out as many of the atmega pins as is feasible next to the stackable headers to allow for other IO. Was thinking of putting the basic LM386 amplifier on it (http://webbot.org.uk/WebbotLibDocs/39854.html) with a 3.5mm audio jack and speaker terminals which is basically what the GinSing has too (http://www.ginsingsound.com/download/ca ... -schematic). Not a huge fan of the thumbwheel trimmer on the Ginsing though, I thinkI would prefer a slider.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sun Nov 25, 2012 8:20 pm

First version of the hardware: I'm calling this Magic Mouth v0.1

https://github.com/t0mpr1c3/magicmouth/hardware/

It's an all through hole, single sided PCB with just 1 jumper, for easy home manufacture. The chip can be either an atmega168P or atmega328P and will communicate with the Arduino by I2C. The audio signal is on PB2. I have broken out most of the other pins to optional headers. The slave chip can be reprogrammed using the Arduino by jumpering digital pins 10-13 to 4 adjacent headers. I opted for a Bourns 3352T thumbwheel trimmer which I think is what the GinSing probably uses.

The firmware will be compilable using the webbotlib library and AVRstudio. I'll try to upload a demo this week.

Any and all comments welcome.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Wed Nov 28, 2012 6:27 pm

Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby matseng » Wed Nov 28, 2012 11:41 pm

I'm getting a bit confused over the purpose of the diode D1. I suppose that you've cloned the amplifier schematics from http://webbot.org.uk/WebbotLibDocs/39854.html and they also have a diode in series with the +5 power to the LM386 amplifier chip.

Either it is a misplaced protection diode to make sure that the two alternatives for power don't ever get connected to each other. Or it's a part of a lowpass filter for the power - but the 10 ohm resistor in series with the power together with the 220 uF capacitor should already take care of that. Or it is for dropping the 5 volt down to 4.3 volts, but why would anyone do that? The LM386 have a minimum supply voltage of 5 volts (or 4 in some special models) so dropping the voltage less than 5 makes no sense...

Anyho, it seems like a nice module - please upload a video of it in action.
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: Arduino speech shield

Postby t0mpr1c3 » Thu Nov 29, 2012 8:14 am

Yes, I have taken the webbot circuit directly. The circuit is intended for robots so I suspect part of the design consideration is that the alternative power input may be used to power motors.

Thanks for pointing out the curious diode. I don't see the purpose either. I just looked up on the datasheet and LM386N-1 accepts 4V so it is within spec.

R4 may well be there to avoid power fluctuations to the Arduino but is there a better way to achieve that? It seems to me that 10 ohms will limit power quite a lot.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sat Dec 01, 2012 9:48 pm

I made a test board (single sided) using toner transfer and it came out well, except that I printed it back to front (doh!) so I had to solder most of the components bent leg style on top of the board. I have already noticed a few modifications that could be made.

1. I replaced the diode with a wire jumper (thanks Matseng).
2. I should plan on using stackable female headers meaning that I need an extra row of 4 male headers for the programming jumpers.
3. The Uno R3 has 2 extra pins on the bottom right (IOREF and one other, not connected) that probably need breaking out upstairs.
4. There is room on the right hand extreme of the board to break out the ISP6 header from the Arduino board below. (Although I can't say I have ever used it.)
5. Perhaps more useful is to break out the Arduino reset button on the shield.
6. It would be nice to break out GND and +5V in or near the prototype area on the double sided board.
7. For the speaker terminals, 5mm pitch terminal block is probably a more commonly used size than 3.5mm.

Programming seems to work with ArduinoISP sketch uploaded and avrdude -b 19200 -c avrisp -p m328p ... but I wonder if some people might prefer the usual ISP6 header. That way you can program the shield with an external programmer without having to change the firmware on the Arduino. Any thoughts on that? It would squeeze area available for prototyping so I don't want to do it unnecessarily.

Also I am going to make the default chip the atmega328p instead of the atmega168. The difference is only 20 cents and the extra flash memory might be useful to futureproof the firmware.

For the double sided board I am considering shrinking the board to 5x5cm for cheaper prototyping as Matseng demonstrated that this would work acceptably (http://seeedstudio.com/forum/viewtopic. ... b6aed44b75)
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Tue Dec 04, 2012 12:14 pm

Thanks Matseng for those Eagle files! I can probably squeeze everything onto 5x5 and still use through hole components if I can source some smallish electrolytics. I'm wondering if I can get away with 100uFs instead of 220uFs.

Right now I'm taking a look at the RC filter on the amplifier input (C1 and R2, http://webbot.org.uk/WebbotLibDocs/39854.html). The purpose of it is apparently to filter out the 20 kHz carrier frequency.

I don't know the first thing analogue design but naively using this calculator http://sim.okawa-denshi.jp/en/CRtool.php it seems to me that this filter cuts off most stuff above 6 kHz. I might try experimenting with slightly lower values for R2 (1.5-2K) which will raise the threshold to around 8-10 kHz to see if that makes any kind of audible difference.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Thu Dec 06, 2012 12:13 am

Yay! I got the prototype shield talking over I2C. The amplifier needs tweaking but i can hear it loud and clear.

I compiled the shield firmware using the webbotlib project designer and avr studio. The documentation is good enough that this is pretty straightforward.

I uploaded a very brief sketch to the Arduino that would take any input over the serial connection and send it to the shield to be spoken. The only slight glitch was that the webbotlib library specifies 8 bit I2C addresses and Arduino specifies 7 bit addresses, so I had to use Wire.beginTransmission(slaveI2Caddress>>1)

So far so good. At some point in the next few days I will upload demo code to the github library and post a video and some instructions.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Wed Dec 12, 2012 1:11 pm

Made another single sided board the other night. This time I got the image the right way round, so the copper was on the correct side of the board :) I have all the bits except for the talking calculator demo except a 16 MHz crystal. I will substitute 20 MHz. Maybe it will talk a bit faster. ;)
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sun Dec 23, 2012 9:43 am

Here is a demo of the prototype shield:
http://www.youtube.com/watch?v=ErGDboTp ... e=youtu.be

Write up of build using adhesive vinyl sheet for the toner transfer:
http://smokedprojects.blogspot.com/2012 ... n-0-1.html

I have made a few changes to the amplifier circuit:
1. A 2 pole filter gives sharper frequency response. I set the cut off at 10 kHz rather than the 6 kHz in the original circuit.
2. A 10uF bypass capacitor on the LM386 chip cuts down on power supply noise
3. The thumbwheel trimmer has a better range of action with a series resistor.

Schematics, layouts, and firmware are all in the Github repository.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Tue Dec 25, 2012 8:20 pm

v1.0 of the shield is now in the Github repository, and 10 copies are on the way from Seeedstudio. This is the 2-layer version with a prototyping area. It's my first time ordering from any kind of PCB fab house, so I have been utterly anal about it. It has taken me literally weeks to get it all together.

I also squeezed BusPirate 3.6 and Sanguino PCBs into the 10x10cm footprint using a very basic panelizing program.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sat Jan 26, 2013 5:14 pm

Magic Mouth v1.0 PCBs are back from Seeedstudio.

Image

Image
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sat Jan 26, 2013 8:35 pm

Thanks Mick! Yes, eventually. First I want to build one and test it out. It might need a bit of beta testing to help tweak the design and firmware.
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am

Re: Arduino speech shield

Postby t0mpr1c3 » Sat Feb 23, 2013 10:35 am

Here's a build pic from @YT2095. I didn't specify that particular potentiometer, but I'm glad it fits the foot print.

Image

Blog link: http://smokedprojects.blogspot.com/2013 ... build.html
Magic Smoke projects
Tindie store
User avatar
t0mpr1c3
Full Member
Full Member
 
Posts: 200
Joined: Mon Sep 17, 2012 4:51 am


Return to Project development, ideas, and suggestions

cron