# The New $15 Picaxe Talking Skull Controller



## halstaff

I've been working this season on expanding my use of the Picaxe chip for controllers to use in my haunt. With hpropman coming up the concept and the help of Fritz42_male, we've come up with an inexpensive and easy to build controller utilizing the entry level Picaxe 08 to take an audio input and have it drive a servo for a talking skull. Cowlacious makes a great off the shelf unit, but I wanted to see if we could make one cheaper and with the ability to program it to better fit our needs. The basic board costs around $15 in parts if you order in quantity once you have the Picaxe download cable which runs about $20. The code for the board is very simple and you can just cut and paste it into the free editor.
So here is the basic board. I'll be modifying it yet to utilize the other 2 outputs in order to have it triggered by a PIR and to use one of the 300 second audio boards from Electronics123.


----------



## hedg12

Nice!


----------



## Otaku

Very nice indeed! And for next to nothing. Is the code specific to the music/vocal track being played in the video, or is the chip programmed to respond to any audio input?


----------



## halstaff

Otaku said:


> Very nice indeed! And for next to nothing. Is the code specific to the music/vocal track being played in the video, or is the chip programmed to respond to any audio input?


The chip is designed for any audio input just like the Cowlacious board. I'm using a split track with the tones which I feel gives much better response. The video is a small part of the routine my bar room singer is going to do. It was some extra work but looks much better plus it's really the only way when you're trying to get the skull to sing a song without a separate vocal track.


----------



## Otaku

So you simply load a single universal program? Does the board power the servo, or is a separate supply needed?


----------



## halstaff

Otaku said:


> So you simply load a single universal program? Does the board power the servo, or is a separate supply needed?


Yes, the program to convert the audio to the servo movement is very short. Here's what I'm starting with -

'08 Picaxe Audio/Servo driver

'#Picaxe 08M2

'b1 byte variable 0-255 in 10uS increments.
'b2 Pause variable 0-65535 in 1mS increments.
'Hitec servo's like signals between 0.740 and 2.740 mS and period of 1 to 20 mS
'C.0 is to audio player
'C.1 is from audio driver
'C.2 is PIR
'C.4 is Greeter jaw servo

symbol PIR_IN=pinC.2
symbol PIR_COUNT=b5

Pause 60000

Init: 'Just a starting point label

serout C.0,4800, ($EF); 'STOP MP3 module 
pause 1000
serout C.0,4800, ($E1); 'Set MP3 volume
pause 1000

Testit: 
Do : Loop Until PIR_IN=1

Do
PIR_COUNT = PIR_COUNT + 1 * PIR_IN
Loop Until PIR_COUNT = 10
PIR_COUNT = 0

goto Routine

Routine:

Servo C.4,205 'Initialises Pin4 as a servo output and sets servo to the start position
pause 500
serout C.0,4800,($01) 'Start playing first mp3
pause 500

Begin:

w3=5000 'Counter for number of loops needed, every 1000 = about 15 seconds +/-

b2=8 'Set pause delay
b3=178 'Set Servo Min position and also offset - mouth open
b4=204 'Set Servo Max position - mouth closed
Servopos C.4,b4 'Initialises Pin4 as a servo output and sets servo to the start position

OP:

ADCA: 'Reads input voltage in 256 steps Pin 1 (leg 6)

Readadc C.1,b0 'Read input voltage into b0
b1=225-b0+b3 'Add offset for servo's CCW output 
If b1<b3 then gosub servomax 'Test for less than servo min position and if less, set at servo min
If b1>b4 then gosub servomin 'Test for more than servo min position and if more, set at servo max

MoveA: 'Move servoA
servopos C.4,b1 'Pulse pin 4 (leg 3) width=b1 - Using servopos can help prevent jitter

pause b2 'Wait Delay b2

w3=w3-1 'Decrement the counter
if w3>0 then goto OP 'Test for counter being larger than 0 if yes, go round the loop again

goto Hold

goto OP

servomin:
b1=b3 
return

servomax:
b1=b4
return

Hold:
servopos C.4,212
pause 500
low C.4

for time = 1 to 15 '60 is the number of seconds of retrigger delay
pause 1000 'Pause for 1 sec 
next time

goto Testit

I'm using a regulated 5V power supply to run the board and the servo and it seems to work fine.
I've modified the board to utilize the other 2 outputs and plan to have it triggered by a PIR. I'm using the Tenda triggerable audio device that outputs in stereo so that I can use a tone track to activate the servo.


----------



## halstaff

Here's the parts list for the board as shown above -

PART PART NUMBER SUPPLIER COST EACH
1.	PC Board 276-150 Radio Shack 2.19
2.	1/8 Phone Plug	274-286 Radio Shack 1.60
3.	5K Pot 43078 Jameco 1.25
4.	8 Pin Socket(2)	112206 Jameco .13
5.	0.1 Capacitor(2)	15229 Jameco .06
6.	10uF Capacitor	1946367 Jameco .05
7.	Header 160882 Jameco .59
8.	1K Pot 253982 Jameco .95 
9.	330ohm Resistor	690742 Jameco .03
10.	22K Resistor 691180 Jameco .03
11.	10K Resistor(4)	691104 Jameco .03	
12.	2.2K Resistor 690945 Jameco .03
13.	1K Resistor 690865 Jameco .03
14.	47K Resistor(2)	691260 Jameco .03
15.	N4148 Diode 179215 Jameco .05
16.	LM1458 23131 Jameco .35
17.	Microcontroller	08 Picaxe phanderson 2.65
18.	5V Power Supply	PS-513 AllElectronics 4.50	
19.	Assorted Wire links


----------



## CreeepyCathy

I don't have a clue how to do any of that, But it's pretty danged awesome!


----------



## Otaku

Hey, Steve, have you tried running this board with a 4AA (6VDC) source? I've used 4AA packs for a while for running Cow boards/servos. You need to have a spare pack available but the portability is nice.


----------



## halstaff

I haven't tried it with this board but it should work. I used battery packs for a couple of the Cowlacious boards myself last year and they really seemed to eat the batteries so this year I switched all of them to wall warts. I use the powered computer speakers which need to be plugged in anyway so that shouldn't be an issue for my haunt.


----------



## fritz42_male

Don't try running a Picaxe at anything higher than 5V - it will fry quickly. Even 5.5V is too much.

Maybe there is room for a regulator on the layout - a 78L05 wouldn't do the job as you need about 1.5V more than the regulator's rating but there are other regs around that would do the job. They are transistor size as well so not much increase in size.


----------



## Otaku

Thanks, fritz. I was wondering about the voltage capabilities of the Picaxe. And yeah, a 7805 needs a couple of volts for headroom. Sounds like the regulated supply is the best solution.


----------



## halstaff

Sorry I missed that. Last year I was using Fritz's VLC board and it has the capability to use split power supplies. I used 3 AA for the Picaxe and a 4AA battery pack to run the servos.


----------



## pshort

There are a lot of 5V LDO (low dropout) regulators available. One that I've used in the past is the LP2950CZ-5.0, which comes in a TO92 package and has the same pinout as the LM78L05. With a 100 mA load it should keep regulating with an input voltage as low as 5.45V.


----------



## Otaku

pshort said:


> With a 100 mA load it should keep regulating with an input voltage as low as 5.45V.


Sounds good to me. I'll check out the datasheet. Thanks!


----------



## IMU

Damn ... still have no clue what you guys are doing, but its freakin cool! Is anybody going to be building these boards for sale to the less inclined who can't build it?


----------



## Dead Things

I didn't see an audio out on the board. Are you splitting the signal (Y cable, perhaps) sending one side to the board and the other to the speakers?


----------



## halstaff

Dead Things said:


> I didn't see an audio out on the board. Are you splitting the signal (Y cable, perhaps) sending one side to the board and the other to the speakers?


Exactly. I have an RCA splitter coming from the computer with the tone track going to the board and the other track with the audio going to the computer speakers.


----------



## Dead Things

Are you going to use the tone track when you switch to the 300 second sound recorder? I have one and hope to use each of the four tracks.


----------



## Otaku

Unfortunately, the 300 sec board is mono only. You need a stereo source to do the tone track.


----------



## Dead Things

Otaku said:


> Unfortunately, the 300 sec board is mono only. You need a stereo source to do the tone track.


That's what I thought.


----------



## fritz42_male

There are plenty of cheap stereo players out there for tone tracks - search for Tenda or just hack a standard MP3 player


----------



## Jaybo

This is currently on sale at Parts Express.


----------



## Dead Things

That looks pretty cool, thanks Jaybo.


----------



## halstaff

Here's the stereo board that I'll be trying. It's had great reviews on the Picaxe forum but there are only 8 left in stock. It sounds like they don't always have them so you need to jump on it when they are in stock. Great price as well at $10!

http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284


----------



## Dead Things

halstaff said:


> Here's the stereo board that I'll be trying. It's had great reviews on the Picaxe forum but there are only 8 left in stock. It sounds like they don't always have them so you need to jump on it when they are in stock. Great price as well at $10!
> 
> http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284


Just ordered it. Funny how the CA $ is $1.04 US but the CA price was a dollar more. Go figure.
Did you use the TX line into the Picaxe?


----------



## halstaff

Dead Things said:


> Just ordered it. Funny how the CA $ is $1.04 US but the CA price was a dollar more. Go figure.
> Did you use the TX line into the Picaxe?


I was told to use pin 15, the RXD pin. 
Mine are on the way and the Picaxe board is ready to go with the new modifications. It now will be triggered by a PIR and with the new stereo audio board, will be able to handle a tone track to better control the jaw movement.


----------



## fritz42_male

tx on picaxe to rx on Tenda board.


----------



## Dead Things

Would this work using just a voice track, no tone track?


----------



## halstaff

Dead Things said:


> Would this work using just a voice track, no tone track?


Yes it will. I just like to be able to fine tune it with a tone track.


----------



## hpropman

Halstaff is correct except that if the speaker lowers or raises his voice the jaw either may not open at all or stay open during the louder sections. That is why the tone track works better. Play the tone track on one channel and the voice on the other channel. you can just record yourself saying Baaaa or something like that and use that sound where you want the jaw to open at in sync with the voice track.


----------



## Dead Things

Halstaff, would you have a schematic? I'm having a hard time deciphering which resistors are which.


----------



## halstaff

I don't as I designed it on PEBBLE. If you would like to download PEBBLE, it's free and I would be happy to provide the code so that you had bring individual items up and move things around. You can find it here - http://www.picaxeforum.co.uk/showthread.php?t=12629&highlight=pebble

If you'd rather not go that route, I've labeled the resistors in this picture -


----------



## Dead Things

You da man! That helps immensely, thanks!
Downloaded Pebbles, as well.
A little off topic-how long can a servo run before it overheats/conks out/ gives up the ghost. I building a 3 axis witch and not sure if I want her to be triggered or just let her run.


----------



## halstaff

Dead Things said:


> You da man! That helps immensely, thanks!
> Downloaded Pebbles, as well.
> A little off topic-how long can a servo run before it overheats/conks out/ gives up the ghost. I building a 3 axis witch and not sure if I want her to be triggered or just let her run.


Mine are triggered so I'm not sure how much continuous duty they can stand. 
I'm working on another Picaxe upgrade to this circuit. It will be able to control two 3 axis skulls with 2 servos for eyes as well as the audio circuit. It won't require programming individual movements but instead will rely on random movement. If it works out like I hope, all you'll have to program is the minimums and maximums for the servos. 
I know there aren't many people interested in these circuits but I'm having fun learning and building them. They're allowing me to add an incredible amount of animation to my haunt and I'm not breaking the bank.
Send me a PM with your email and I'll pass along the PEBBLE code for the circuit.


----------



## Otaku

Unless you actually shut off the power to a servo, it's still "on". This was an issue for Dr. Morbius when he was selling his 3-axis skulls, he didn't want the motors to fail prematurely. He found that using a PWM relay to turn the power on and off using VSA was a good solution. You have to make sure to have an initialized position for re-starting programmed in VSA because the servos will shift position when the power goes off; they will lose their relative locations and you'll get some weird results.


----------



## Dead Things

Halstaff, PM sent and I agree, this stuff is so cool and the animation that can be had for a fraction of the cost of ready made prop controllers is remarkable. Kudos to you and the other Picaxe pioneers. Will the new circuit still be using the 08 or are you going to venture into the 18M?
Otaku, I get it. By applying power to a servo it is "on", that is why servos "center" and also how they maintain that "center".


----------



## fritz42_male

Obviously it depends on the quality of the servo and also the type. As I understand it, digital servos are a lot better than the older but cheaper analogue type. The problem is if your servo signal 'jitters' - the jitter might not be enough to cause visble movement but it would mean the servo was active all the time and that leads to issues with power consumption and eventually wear.

However, I tend to use cheapo eBay servos (metal gear) and just accept the attrition rate of 1 every few years.


----------



## halstaff

The new circuit will be using the new 18M2 which has 8 times the memory and is able to run four separate tasks in parallel. Plus almost every pin is individually configurable so it can have 13 outputs. It also has some new programming commands as well as new anti-jitter coding for the servo commands.
After DeadThings requested a schematic, pshort went to all the effort to put one together. This schematic corresponds to the diagram in my first post as there have been some modifications in later versions.
Here it is with my thanks.


----------



## pshort

It was my intention for the schematic to reflect the second layout. Besides transposing pins 5 and 6 on the micro, is there anything else that needs changing?


----------



## halstaff

pshort said:


> It was my intention for the schematic to reflect the second layout. Besides transposing pins 5 and 6 on the micro, is there anything else that needs changing?


The input from the LM1458 is using pin3 in the latest diagram but these differences are just a matter of convenience in the layout and a couple of changes in the coding. I'm in the process of testing the final designs which will allow for a PIR for a trigger as well as a connection for an audio source. I'm playing with 2 different designs. The first will be for triggering one of the audio players from electronics123 and will require an off board relay. The other design will use one of the Tenda stereo boards so that you can have a stereo output which will allow you to use a tone track for the jaw movement. The new designs will require the use of all 4 pins as well as use specific pins to allow for circuit to fit on the board. You'll need to use pin7 via a jumper to trigger the Tenda board. 
As soon as a couple of parts come it, I can finish this up.


----------



## Dead Things

Thanks pshort!
Halsatff, will the new design incorporate this talking circuit?


----------



## halstaff

Dead Things said:


> Thanks pshort!
> Halsatff, will the new design incorporate this talking circuit?


Yes, the new designs will have the audio circuit. You'll just use the one that works for your desired audio source.


----------



## Dead Things

I've read somewhere that the "noise" from servos can interfere with the picaxe if they are both using the same power supply. Have you run into that?


----------



## pshort

OK, since you are still working on the design, let's leave the schematic alone as 'reference only' for the time being.


----------



## pshort

Dead Things said:


> I've read somewhere that the "noise" from servos can interfere with the picaxe if they are both using the same power supply. Have you run into that?


That reminds me, there should be a filter cap between the +5 and ground on the board. A 0.1 uF ceramic cap should work fine, preferable as close to the PICAXE as possible.


----------



## halstaff

pshort said:


> That reminds me, there should be a filter cap between the +5 and ground on the board. A 0.1 uF ceramic cap should work fine, preferable as close to the PICAXE as possible.


You're right. Looking at how the circuit laid out on the actual board, there is an extra row where things could move down and make room for another cap right in front of the Picaxe. I'll make that change on the next board I build.


----------



## halstaff

I made the change and added the cap in front of the Picaxe on the latest layout.


----------



## halstaff

Here's a video of the completed board with the Tenda stereo board -






Now on to the next project.


----------



## IMU

OK ... that is awesome ... now I want to build one, or at least TRY and build one!


----------



## halstaff

If anyone is interested in building one and using the Tenda board, they only have 2 left in stock after I bought 3 more. Check them out at http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284


----------



## pshort

... one left in stock after I ordered one...


----------



## Dead Things

Looks excellent. Do you think this design could be incoporated into the 18M2? Or would it require a totally different set of components?


----------



## halstaff

Dead Things said:


> Looks excellent. Do you think this design could be incoporated into the 18M2? Or would it require a totally different set of components?


It will and I'm working on a design now that incorporates the 18M2. It will have 12 servo headers, power connections for LED eyes as well as the audio circuit. I'm hoping to be able to run two 3 axis skulls with 2 servos for eyes and have the audio circuit for the jaw movement. I've got it laid out on PEBBLE but still need to put it on a board to make sure it will fit like I think it will.
Fritz is working on streamlining the code so that we can have random head and eye movements.
If it works out as planned, we'll be able to run our 3 axis skulls without having to be tied to the computers.


----------



## Dead Things

That's brilliant! i'm building a witch and hope to have all of it (3 axis head, servo driven fingers, moving arm and talk) all controlled by the 18M2. Will be following this closely!


----------



## halstaff

Here's the completed layout for using the Tenda board as the audio source -


----------



## pshort

Should I start thinking about updating the schematic?


----------



## halstaff

I don't see why not Phil as I don't plan on any more changes to this board. If someone wants to use this with the audio boards from electronics123, they require an off board relay. I have that board designed and can pass it to anyone interested.


----------



## Jack Is Back

pshort said:


> Should I start thinking about updating the schematic?


I'd appreciate a schematic for this. I'd like to build one myself. Thanks for all your efforts. I wish I had the ability to actually design stuff like this.


----------



## halstaff

The Tenda boards are currently out of stock at mdfly. I'll try and watch and post when they have them back in stock.


----------



## Jaybo

I ordered a board on Monday, so hopefully my board will arrive today. If so, then I have a good project for this weekend. Looking forward to seeing what you and Fritz can do with the new M2 chips.


----------



## pshort

This is a dumb question, but how do you trigger the Tenda board. Looking at the datasheet, it seems to take a 4800 baud serial input signal. Is that how you're triggering it, and if so, where is that signal coming from?


----------



## Dead Things

Jack Is Back said:


> I'd appreciate a schematic for this. I'd like to build one myself. Thanks for all your efforts. I wish I had the ability to actually design stuff like this.


I hear ya! I excel at taking other peoples ideas . I've said it before and I'll say it again: really appreciate that y'all are sharing this knowledge!


----------



## halstaff

pshort said:


> This is a dumb question, but how do you trigger the Tenda board. Looking at the datasheet, it seems to take a 4800 baud serial input signal. Is that how you're triggering it, and if so, where is that signal coming from?


The Tenda board gets its signal when you move the jumper from the download position which is the pin on the left and the center pin. Move the jumper to the center pin and the right pin for the signal to get to the audio board from pin0.


----------



## JeffHaas

pshort, you're right, the Tenda board is controlled by a serial connection. You send commands over one wire to the board to tell it which file to play, etc. Once you understand how it works it's very versatile and produces good sound. There's an entire thread on the Tenda boards here:

http://hauntforum.com/showthread.php?t=22800&highlight=tenda

The one thing that's confusing in that thread is that more than one Tenda board is discussed; we're talking about the serial control one. However, go to page 8 where I discuss using the Tenda board with an Arduino and then later a Basic Stamp 2/EFX Prop-2. This will give you background and code on how the board works. There's also a thread on using it on the PicAxe forum (very long, but they figured the whole thing out):

http://www.picaxeforum.co.uk/showthread.php?t=16353&highlight=tenda

Jeff


----------



## Dead Things

Q for the electronic gurus. I want to put this onto a breadboard style circuit board as I want to have a self contained unit including an 18M2, a darlington driver and a 5V regulated supply. As i've been mocking things up on the breadboard, I find I have to cross wires over each other and over resistors (I'm using telephone wire as well as a breadboard wire kit). Is this ok, or am I asking for trouble?


----------



## JeffHaas

As long as the wires are insulated and don't create any connections (shorts) that you don't want, you're OK. Check out the pictures on the right of the Wikipedia entry:

Breadboard - Wikipedia, the free [email protected]@[email protected]@/wiki/File:Breadboard.JPG" class="image"><img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Breadboard.JPG/220px-Breadboard.JPG"@@[email protected]@commons/thumb/5/52/Breadboard.JPG/220px-Breadboard.JPG


----------



## pshort

As Jeff notes, you're fine.

Back in the days when we had our prototype boards wire-wrapped there was always a struggle with the prototype assemblers who did the wiring. They wanted to make their work look nice and professional, with wires all neatly bundled together in channels between the ICs. The engineers, though, wanted it to look messy, with wires running every which way, because running the wires closely parallel over any distance caused no end of trouble with cross-talk.


----------



## Dead Things

Thanks guys!


----------



## pshort

Somewhat off-topic, but does anyone have the dimensions of the Tenda board that halstaff linked to? The web-site that I ordered from indicates that it is 21 mm wide. I don't believe that, because an SD card by itself is 24 mm.

Thanks.


----------



## halstaff

I'm converting but mine are 1.25 inches or 31.75 mm wide by 2 inches or 50.8 mm long not including the pins.


----------



## pshort

halstaff said:


> The Tenda board gets its signal when you move the jumper from the download position which is the pin on the left and the center pin. Move the jumper to the center pin and the right pin for the signal to get to the audio board from pin0.


I didn't completely digest your reply at the beginning. Let me make sure I understand how it works in broad terms:

Your board has two modes: one for programming the PICAXE, the other for operation after you've programmed the PICAXE. The jumper on the board needs to change position depending on whether you are programming the PICAXE or not.

In the latter mode, the PIR input is used to take the PICAXE program out of the 'idle' state. It sends a command to the Tenda board to make it start playing a tune. This tune has one channel (the right one?) dedicated to the song that the user hears, and uses the other as a 'cue' channel going back to the PICAXE through the op-amp circuitry. When the PICAXE detects the cue on its pin 6 it will perform some action, such as using the servo output to make the jaw wiggle. After some time the PICAXE program goes back to the idle mode, waiting for the next trigger from the PIR connector.

Is this fairly close?


----------



## pshort

halstaff said:


> I'm converting but mine are 1.25 inches or 31.75 mm wide by 2 inches or 50.8 mm long not including the pins.


Thanks.


----------



## halstaff

Correct except I have my tone on the right channel and the left channel goes to the computer speakers.


----------



## pshort

Thanks.


----------



## halstaff

Pshort has come through again and put together a schematic with the current modifications. My thanks to him for continually updating the schematic when I decide to make improvements. His work is greatly appreciated.


----------



## pshort

The mp3 player from mdfly just arrived in the mail, surprisingly quick. Now to start playing with it... I just wish that the pins were at right angles to the board rather than parallel to it.


----------



## fritz42_male

Yes it's a bit of a pain but Sparkfun sell right angle headers:

http://www.sparkfun.com/products/9429

Just FYI I will be ordering this module soon:

http://www.tendaelectronics.com/?action=wareshow|tenda|128|en|110,427|427

Seems to be simpler than the one MDFLY with ONLY serial control (no button control) and better positioning of the SD card.


----------



## pshort

Yes! I've got sound from the module!

Have to play with getting the volume to work now...


----------



## pshort

Got it working now. I had the bit order reversed in my software uart routine, I don't know how I could even play one clip with that mistake.


----------



## pshort

A few observations on that Tenda serial controller...

1) It appears to have a capacitor on its output. No particular surprise here...

2) The maximum output voltage appears to be about 600 mV peak-to-peak. This is based on playing an mp3 file containing a fairly large amplitude tone, chosen so that it isn't clipped when played on my FreeBSD-based netbook.


----------



## pshort

fritz42_male said:


> Yes it's a bit of a pain but Sparkfun sell right angle headers:
> 
> http://www.sparkfun.com/products/9429
> 
> Just FYI I will be ordering this module soon:
> 
> http://www.tendaelectronics.com/?action=wareshow|tenda|128|en|110,427|427
> 
> Seems to be simpler than the one MDFLY with ONLY serial control (no button control) and better positioning of the SD card.


How do you order that? There doesn't seem to be either a price given or an on-line order process at the Tenda web-site.

Also, that other device seems to have completely disappeared off the MDFly site, although the same device appears on the Tenda site.


----------



## fritz42_male

Just email Tenda at the address on the website - they are the manufacturer.

I have a current pricelist and some data sheets here:

http://www.ipprofessional.com.au/Tenda.htm

Prices are in US$ but please note that I don't sell them. Tenda will sell small amounts at the sample price and will happily quote you including postage.


----------



## pshort

Thanks.


----------



## JeffHaas

MDFly has the Tenda board back in stock.


----------



## pshort

Has anyone measured the current draw of that player?


----------



## redg8r

Thanks to heads up from Jeff, i have 2 on the way. I'll check when they get here.


----------



## pshort

Has anyone looked into how long it takes before the player responds to serial input data after power is applied? The one that I have seems to require somewhat more than 600 ms.


----------



## halstaff

Here's the design of the audio/servo driver daughter board with a female header to install the Tenda board and a jack to plug in the speakers .


----------



## halstaff

I've finally got the Tenda boards to play nice with the servos for my talking skulls. Best single piece of advice I can give is to use a separate power source for the Tenda boards. After many frustrating hours spent, it was found that this was the biggest cause of problems we thought were due to programming.


----------



## halstaff

I received the 5V power supply to run the wiper motor for the Kiwi controller board for the seance room and it works perfectly. All the components are happy and working together now.
The Kiwi board controls the entire scene. When the PIR is triggered, it starts a wiper motor on the rocking chair, starts the moving books, turns on the LED lights on both the books and the rocking chair, triggers the Tenda board to start and runs the jaw servo on the skeleton. After the skeleton says his piece, the audio, the rocking chair and its light stop. A second servo pushes down on the DVD remote and starts the Madame Leota projection. After it finishes, the moving books and its lights go off and the system waits for 60 seconds before it can be retriggered.
Everything including the PIR, Tenda board, Kiwi board, components, speakers and power supplies came to around $80 with the 5A power supplies costing $30 alone. I have to order some off Ebay to cut down that cost. 
I'm posting it here instead of in its own thread as the few people interested seem to be following this thread.


----------



## Dead Things

halstaff said:


> I've finally got the Tenda boards to play nice with the servos for my talking skulls. Best single piece of advice I can give is to use a separate power source for the Tenda boards. After many frustrating hours spent, it was found that this was the biggest cause of problems we thought were due to programming.


Seperate power supply? Do tell. I want to use a computer power supply to run my prop, using the 5V rail to power the picaxe, servos and tenda. Am I asking too much of it?


----------



## halstaff

Using a computer power supply is certainly something I'm thinking of trying.
I have a 12V power supply coming into the Kiwi board with one rail running the 12V components except the wiper motor which has a separate 5V power supply. The Kiwi board has a 5V regulator to get the power for the Picaxe, PIR, LED eyes and the 2 servos. I tried running the wiper motor from the Kiwi board power but it was too big a load.
The audio/servo board with the Tenda player requires a separate power supply to eliminate interference.


----------



## fritz42_male

Hi Steve,

I've been reading up on the use of decoupling (bypass) capacitors and I think your trouble could be alleviated by putting a lot more decoupling on both boards. It's certainly worth a try.

Try a combo of 47nF Ceramic and 47uF/10V across the power lines as close to the chips as possible - a pair per chip and another pair on the power lines by the Tenda board

If it works then you can run on 1 5V supply for both boards.


----------



## pshort

If you have access to an oscilloscope, it might be interesting to see what the power pins on the PICAXE and the Tenda board look like. I'm working on a project with the Tenda board, powering it from a 9V battery (no servos running at the moment). I've noticed that there are some interesting glitches on the power input pins to the Tenda board when it's playing a clip. These pulses are about 100mV, last around 2.5 mS, and occur at random intervals on the order of 50-100 mS. Assuming that the output impedance of the battery is around 2Ω, this translates to about a 200 mA pulse, suggesting perhaps some sort of SMPS.

Do you think that the Tenda board is interfering with the servos, or the opposite?


----------



## fritz42_male

I'd say the Tenda board is interfering as that was the consensus on the Picaxe forum but Servos will interfere as well.

Steve (Halstaff) doesn't yet have an Oscilloscope but I have a couple of small ones that I can use when I get some time Xprotolab - brilliant!) http://www.gabotronics.com/development-boards/xmega-xprotolab.htm

I'm also about to try an iTouch based scope (uses a microphone link and a 1x /10x probe). Also got a USB soundcard on order to try a PC based scope that uses the mic input (I can fry a USB soundcard and not worry - they are less than $5 delivered)


----------



## hpropman

yes you can use the computer power supply to power the board. Fritz please let us know how that USB scope works out for you I was looking at one myself.


----------



## Dead Things

hpropman said:


> yes you can use the computer power supply to power the board. Fritz please let us know how that USB scope works out for you I was looking at one myself.


Will it be able to power all the components? Picaxe, Pololu micro maestro,Tenda, 3 vent motors and 5-6 servos. I might be asking a lot of the 5V rail.


----------



## fritz42_male

hpropman said:


> yes you can use the computer power supply to power the board. Fritz please let us know how that USB scope works out for you I was looking at one myself.


Will do. There are usb 2 channel scopes on ebay that are Ok - 5v max input or make your own resistor divider probe.

http://www.ebay.com/itm/2-Channel-P...26871?pt=BI_Oscilloscopes&hash=item335fd379b7

But I like the idea of using a sound card and a cheap probe to do it. Then the same idea for a spare iTouch I have.


----------



## pshort

The difficulty with the sound card scopes is that they won't go down to DC in frequency, as they are (usually?) capacitively coupled.


----------



## hpropman

Dead Things said:


> Will it be able to power all the components? Picaxe, Pololu micro maestro,Tenda, 3 vent motors and 5-6 servos. I might be asking a lot of the 5V rail.


Yes most computer power supplies are rated for 8 to 20 amps or more on the 5 volt rail. More than enough for you want. got to figure 1 amp per motor / servo to be safe and the boards do not use that much power figure another amp in total probably a lot less. as long as you have a few amps of headroom you should be fine. If you have small supplies then use two. Just make sure that all the grounds are tied together.


----------



## halstaff

Here's a picture of the completed electronics package for the seance room -


----------



## halstaff

I'm in the process of building a greeter for a friend so I went ahead and did the final (I hope) revision for the stand alone audio/servo driver. It uses a Picaxe 08M2 and is fully contained on a Radio Shack board. It has a 20 pin female header for the stereo Tenda board, is triggered by a PIR and includes a speaker jack.
The entire package which includes the circuit and stereo boards, the SD card, the computer speakers, a power supply and a PIR comes in under $50.


----------



## pshort

Does anyone have any idea what's going on at mdfly? Their store doesn't seem to be open right now.


----------



## fritz42_male

Site works fine for me?


----------



## pshort

For a while the site said that their store was closed for some sort of renovation, now it just says that the store is closed and to call them instead. You can see all of their selection, it just didn't seem to let me order. Quite strange.


----------



## JeffHaas

The front page works but when you get to one of the product pages there's a note that says the store is down. Has anyone tried calling them?


----------



## robp790

My question may go off on a different tangent but how does one generate the tones? How do we get the tones to match the movements?


----------



## pshort

Audacity is one free audio editing program that can be used to generate the audio tone, to place it on one channel of the audio file, and then create an mp3 output file.

As for specifying the specific servo movements, that would be programmed in the PICAXE programming language. That program would typically activate a specific subroutine when the tone is detected (i.e. uses the audio tone as an activating trigger).


----------



## halstaff

robp790 said:


> My question may go off on a different tangent but how does one generate the tones? How do we get the tones to match the movements?


Here's a short tutorial showing how it's done -


----------



## robp790

thanks for posting the tutorial I will try this out in Audacity.


----------



## pshort

FWIW, I sent out a small (1.5" x 1.5") PCB for fab, which holds most of the circuitry from halstaff's design. For audio input it can connect to either the Tendy board, a VMUSIC2, or a plain-jane mp3 player. On-board it has a 4-channel op-amp and an 8-pin PIC. Most of the pins on the PIC are brought to a pin-strip header, along with two of the outputs of the op-amp. One channel of the op-amp is used to generate a virtual ground, one is an input buffer from the audio input, one is a Sallen-Key low-pass filter, and the fourth is an output buffer from the low-pass filter.

The board is intended for use with a semi-related project, but might be of interest for a simple one-channel servo-controller similar to halstaff's project. The biggest obstacle here is that I've used the PIC pins in a way that might not be compatible with PICAXE programming (I've used pin 2 as a serial output to the Tendy board, and pin 7 as an analog input).


----------



## pshort

Searching for an op-amp for another project, I took a look at the specs for the LM1458. At this point I would not recommend using it on a 5V project, because the outputs are not guaranteed to go anywhere near the power supply rails. While the circuit seems to work for halstaff, I'd recommend using a better op-amp to avoid problems. The part that I like is the MCP6002 from Microchip, which has rail-to-rail outputs and is not too expensive (although you're not going to find it at Radio Shack).


----------



## halstaff

Thanks Phil for the revised and improved component! Mine were working fine so far but I went ahead and got some from Futurlec for 32 cents each and they seem to work great. Here's the link - http://www.futurlec.com/SFMicrochip/MCP6002.shtml


----------



## halstaff

pshort said:


> Searching for an op-amp for another project, I took a look at the specs for the LM1458. At this point I would not recommend using it on a 5V project, because the outputs are not guaranteed to go anywhere near the power supply rails. While the circuit seems to work for halstaff, I'd recommend using a better op-amp to avoid problems. The part that I like is the MCP6002 from Microchip, which has rail-to-rail outputs and is not too expensive (although you're not going to find it at Radio Shack).


Phil, 
I just noticed that the op amps I received are the MCP6022 instead of the MCP6002. Both are low supply voltage. Do you see any reason I couldn't use them? If they won't work, I'll get after the company to send the right ones.
Thanks.
Steve


----------



## pshort

I think that they'll work, although they are more expensive and much faster than what I suggested.


----------

