23.12.12

Magic Mouth v0.1

Build a Magic Mouth shield from scratch using the materials in the Github repository. Hear it in action speaking in response to commands typed into the Arduino serial monitor.





Magic Mouth v0.1 Board


Shield Design. The Magic Mouth v0.1 single sided layout is designed for easy home manufacture using the toner transfer process. Eagle files are in the repository, as well as an image of the schematic and 1200 dpi images for the resist mask (used on the copper layer) and silk layer (for the other side of the board).

Toner transfer.  Instead of using glossy paper to transfer the images onto the board, I tried a variant of the process that prints onto adhesive vinyl sheet. (In my case "Kittrich" Clear Liner which is available for about $5 a roll.) This is done by sticking a rectangle of the liner onto a sheet of paper and laser printing the image on top. After cleaning the copper clad board, transfer the image to it by pressing lightly with a clothes iron on the maximum setting (160 °C, no steam) for 1 minute while rolling this way and that over a dowel or rolling pin. The paper layer can then be peeled off (carefully because the board is very hot!) and the plastic film lifted gently at the corner to see if the image has transferred properly. If not, cover with a sheet of paper and iron a little longer. Hollow traces or filled areas can be touched up with a black "Sharpie" permanent marker.

Magic Mouth PCB vinyl sticker for toner transfer Magic Mouth PCB copper clad board and vinyl sticker

Toner transfer using clothes iron and rolling pinMagic Mouth PCB after toner transfer

Etch. The board took about about 5 minutes to etch in a 2:1 mixture of 3% hydrogen peroxide solution and hardware store muriatic acid. Add acid to peroxide, not the other way around. For safety's sake, the etching should be done in a well-ventilated area while wearing splashproof goggles and chemical resistant gloves.

Magic Mouth PCB silk layer
Silk layer by vinyl toner transfer
Silk Layer. The vinyl sheet toner transfer method also works for the silk layer. The bare side of the board needs to be roughened up (for example, with a fine-grit wet sanding sponge) and degreased to help the toner stick.


Drilling. Apart from the headers which had 1.0 mm holes, most of the drill holes were 0.8 mm. Being lazy I used a 1.0 mm HSS bit throughout. The headphone socket required 1.2 mm and 1.5 mm drill holes: not having a 1.2 mm bit, I used a 1.5 mm bit to widen all these holes.

Magic Mouth v0.1 Schematic
Magic Mouth v0.1 Schematic (click to view)



Building the Magic Mouth


Bill of Materials. At the time of construction, every component on the board was available from Tayda with the exception of the thumbwheel trimmer and the 10 uF electrolytic capacitor which was too tall (ideally it should be 7 mm tall). I have given Digikey part numbers for these components. The terminal block was back ordered from Tayda. I may replace this part with a 2 pin 0.1" header. (You can always download the freeware version of Eagle and make the necessary changes yourself!) The Atmega328P-PU microcontroller can be purchased from Tayda but is cheaper elsewhere.

Optional components. Stackable headers (if required) are available from Dipmicro and elsewhere. The headers used on the board were free samples from Samtec which although high quality components were not the correct specification. 8 Ω mylar speakers are available inexpensively from Tayda: the one used in the demonstration was pulled from junk electronics.

Magic Mouth speech shield v0.1 (bottom)
Magic Mouth speech shield v0.1 (bottom side)

Substitutions. The board below features a few different components. Not having a 2-way 3.5 mm pitch terminal block, I soldered in a 0.1" female header to connect the speaker. The board has 100 uF capacitors because I didn't have any 220 uF capacitors with long enough leads. And I substituted a 20 MHz crystal for the specified 16 MHz crystal, so the speech is slightly faster than it should be.

Magic Mouth speech shield v0.1 mounted on Arduino Uno
Magic Mouth speech shield v0.1 mounted on Arduino Uno


Using the Magic Mouth


The firmware on the board was compiled using C++ libraries from Webbotlib v2.09. Communication is via the I2C protocol: the 7-bit shield address is 0x4F. A simple set of commands was implemented that is intended to resemble the commands used by the DECtalk software implemented on the Emic2 text-to-speech module.

Command
Description
Sx Speak phrase. x = any text, terminating in newline or CR.
Dx Play demonstration message. = 0,1,2.
Px Set pitch. x is a hexdecimal number between 0 and F. The default value is 7. A higher number will give a lower voice, a smaller number will give a higher voice.
Z Pause/unpause.
R Revert to default pitch.


Demonstration


The demo software in the repository obtains input to the Arduino over the serial connection. This can be input to the serial monitor, or a program like Hyperterminal or RealTerm. The text string is sent to the Magic Mouth when a carriage return is typed.



Revisions


After making this board I tweaked the layout. One problem was that the capacitor leads could short out if they touch the metal case of the Arduino USB connector directly below. Later versions of the board have moved the capacitor and copper traces to avoid this issue. The amplifier circuit has been improved in various ways. A 2 pole filter gives sharper frequency response, a bypass capacitor on the LM386 chip cuts down on power supply noise, and the thumbwheel trimmer has a better range of action with a series resistor.


Construction Tips


I tested the shield and demonstration software using an Arduino Uno R3. It should also work with Diecimila and Duemilanove compatible boards. Please note that the shield is not compatible with the Arduino Mega 2560 (at least not with the hardware implementation of the I2C protocol used in the Wire library) because the placement of the SCK and SDL pins is different on this board.

The vinyl film toner transfer method is a technique I will definitely use in future. The board etched satisfactorily with no defects and in sharper detail than I have ever achieved with paper transfer. For example, the board was noticeably easier to drill because the tiny drill-centering lines were faithfully reproduced. (If some of the traces look blobby, it is because I needlessly went over them with a Sharpie.) I liked being able to peek underneath the film to see if I need to iron the board a bit longer, and touching up the traces was far easier without paper fluff everywhere. The technique also required less heat, pressure, and time than paper transfer.

Having succeeded first time around with it, I reckon this way of making PCBs is Easy — just be careful with the Dangerous etching chemicals.

No comments:

Post a Comment