More than a decade ago, the sound chips were quite obscure and the only one in town was the ISD from Sequoia Technology. Or was it Winbond? It was so long ago that even Radioshack, which came to Malaysia for less than a year, has them in stock. But after that, I started to hear more from the East, we have the APR9600, the WT-588D and so on. At that time, the only way (I, the Engineering Cave Man) could activate them was using push buttons.
But there is a much better and more efficient method, which is by using a microcontroller. You can record a lot of voices in the chip and then use the microcontroller to combine them into sentences. Anyway, so, two decades later, here I am, still attempting to control them via the said device above. It is not easy since my microprocessor of choice is a Mircochip PIC and not Arduinos.
THE DILEMMA
You flip open the Tricorder flap, and after some ratcheting sounds, it comes alive. The worbling sound goes on and on until you close the flap with a resounding and satisfying ratchet clicks.
That sounded so simple, right?
For a Tricorder of such design, you would need a basic reed switch (Normally Closed) which powers unit when the flap is open. Things become complicated when you want the flap to close with the ratcheting sound as well. You cannot put another set of reed switch and magnets anymore.
Using reed switches to control the sound player can only get you so far. The solution would need clever electronics or microprocessor to solve this issue.
CLOSING THE SILENT FLAP
OK, let me explain this in a more clearer detail. You can control a Sound player with switches and the reed (magnet) switch is one. All you need it to play a sound is to just press the button or, in this case, open the flap. In theory, you can just hot wire the switch connection permanently and also, set the player to play the file without repeat (or looping). Then all you have to do is to merge the sound of the Tricorder’s opening flap and the worbling SFX into one single file. And for fun, you can extend the worbling sound effect to say, 2 minutes, which is more than enough ‘sound’ for anyone to do scanning.
As soon as you open the flap, the Tricorder would be powered and so is the sound player. Because of the permanent switch, it would play BOTH sounds because it is in a, single file. But this is where things get challenging. When you close the flap, there is no sound for that since the sound player has been hot-wired. And secondly, after the 2 minutes, or depending on how long you modified the file to play to completion, there is no more sound.
OK, so these are minor details which has been nagging me for years because, I knly know of one solution: microcontrollers.
THE MICROCONTROLLER
Yes, the do it all solution. There is a lot of things the microcontroller can do, to the point of replacing all the electronics. But for now, let us talk about controlling the sound player, the JQ8400FL. Originally, I was working on another equivalent years ago, the DY-SV17F. It has almost the same specs as the JQ8400FL but with a 5W amplifier and more importantly, connections for 8 switches. I chose the former because it is much more compact.
But what I discovered that both modules are able to accept the same UART Commands from the microcontroller or Arduino. Oh, speaking of which, if I need to say, sell any of my product using Arduinos, I would have to release my codes in the open. Or, if i do not want to do that, then the solution must come with an Arduino. So, this made me think twice (because my programming sucks and it is very embarrassing when they see my coding)
Coming back to the Tricorder, opening the flap will power everything up. The microcontroller will first play the FLAP OPENING sound and waits for it to finish. While the flap is still open, it will play the TRICORDER WORBLE and even loop it if necessary. And when the flap is closing, it will play the FLAP CLOSING sound.
Anyway,you can upload sounds via USB into this board and then control it through push buttons or from a microcontroller.
PROGRAMMED SOLUTION
I will be connecting the JQ8400FL Sound player (shown above) to the PIC chip and use the RS-232 to communicate. I chose this module because of a few reasons:
It has a 3Watt Amplifier which so far, got me normal results in a 3W speaker.
It is the smallest of MP3 Players that does not rely on microSD cards because it has its own 4Mbytes or memory.
And you can connect the player to the computer via USB2.0 which will see it as a normal memory device.
OK, so I can use the WT-588D but I want to try this.
Programming the PIC to control the player is not an issue anymore since I kinda worked out the commands. The problem starts when the PIC asks the player for its PLAY status. Without that response, the PIC would not know whether the sound file has finished playing and will not introduce the loop or other programmed commands.
YOUR WISH IS MY COMMAND
The command to play a file is very easy and the player has its own, um, rules. Take for example, the following command to play the first file:
AA 07 02 00 01 B4
The format is Starting Code + Command Code + Data Length + Data 1 – Data n + Checksum
You just have to get the microcontroller to sent them to the chip through the RS-232 command protocol. However, it took me weeks to understand why the RS-232 Software tool was not working. Once I upgraded the Software, it more or less made more sense and where I was in the Sea of Perplexity. Let’s take a look at the last byte of the command, B4, which is the checksum. Checksums are very important so that either side knows the command sent/received is valid and without errors. A short from YouTube below shows the result.
HOW ABOUT A SMALLER MICROCONTROLLER?
Another alternative would be to use a smaller microcontroller which can do all the work but with some limitations. There will not be various sounds of the opening and closing of the flap and the trade-off is that I can save some space and make the programming as simple as possible. But if I am only using it just for sound, I would be wasting a lot of ports.
HOW MANY PORTS AGAIN?
I would already have taken up three ports to control the sounds of opening the flap, the Tricorder worble and closing the flap. I would need another port to detect the reed switch of the flap when in opened position. Plus, another to detect if the Sound Player has finished playing. All in all, I would be looking at just a minimum of 5 ports, with an additional for standby. If I use a normal microcontroller which has 16 ports, about 7 will be used for sound alone. Then I can control the two or three sets of 4-step sequencing LEDs with the remaining ports.
But I prefer not to as I might want to tweak the running speed of each 555/4017 circuit independently. For a microcontroller, this means, tweaking the program, re-testing and re-programming until it looks good. And that can take all day compared to what a screw driver can do.
THE CATCH
There is always a catch to all plans and this is one of them. First is, I will have to design additional components to act as, ‘switches’ and also, widen the board. The second consideration is that the sound player is wider and so, the piggyback board would have to be wider too. I am going to try setting up a microcontroller circuit first before making the decision.