Final (?) iteration of the billy bass project.

I’ve been using my time this summer to finish up a lot of long-standing projects. Not that I don’t have a lot of pressing matters to handle right now, but I need a break from them to do some smaller, simple things that I can wrap up easily. I decided that this fish should be one of them.

This has been around for years, and the last time I just repaired the jaw and removed the epoxy blob brain. I had replaced the epoxy blob with an msp430, but this time I ditched that too. Perhaps it would have been simpler to use the existing board to drive the motors, but I found another design that I figured would do most of what I wanted and I could safely copy most of that design. The design I found uses a bluetooth board and audio amp to drive some speakers, then takes that audio signal and reads it with an arduino while moving the fish’s motors with some motor control breakout boards. This works, but I had some issues.

The first issue is a ‘me’ thing, not a ‘fish’ thing. This is the bluetooth chip on the module this kit recommends to buy. I have experience with some CSR breakout boards that use a different chip, and I would have liked to use them here. The benefit to the CSR boards is I know how to reprogram the name of the bluetooth device and they sometimes have power drivers for going straight to speakers which would save some cost and size. The benefit of this board which (for now) outweighed that for me is that there’s an onboard relay that fires when a bluetooth connection is established so it switches from an aux in to the bluetooth automatically. That is a feature I REALLY like and want on something like my car’s radio bluetooth mod. I could probably implement it with a relay and an LED output from the CSR module, but for now the plan is to use a switched headphone jack and do that mechanically. There is someone who’s been playing with these zhuhai jieli chips, but not the one I have (look for AC690X on github).

The next issue was one where I tried to preserve all the functionality of the original device. I wanted to make it battery powered. That would mean fresh batteries would give it 6v, rechargeables (like I would be using) would give it 4.8v or so. That’s not a lot of voltage to start with. The project I linked used a microusb power source, and at least for my older fish that really, really wouldn’t work. I found too much trouble having the unregulated 5v arduino, the bluetooth module, and the audio amp being on the same power rail as the motor controllers. They caused a lot of spikes and frequently led to reboots of the arduino and constantly dropping the bluetooth connection. I eventually had to separate the rails, and that meant using a voltage high enough that I could regulate down to 5v for the logic.

Starting at the top we have the audio amplifier with the green light. That is unchanged from the original design. To the left we have the bluetooth board (the other black board). I elected to use the aux input like it was suggested, now this fish can take any audio device in and speak along with it, it doesn’t have to be bluetooth. That jack is located on the far right side, wired in to the JST pigtail and connectors that came with the bluetooth board. Next to that port is the DC-DC power supply that drives the motor controllers (blue LED). I have this set at around 4.5v, playing with that voltage and the motor speed commands in the code came up with a pretty decent response without browning out a whole bunch of the circuit. Bottom right is the power input jack (now 12v in). To the left of that is the 5v step down regulator (red LED). That powers the whole project minus the motor controllers. On the far left is an old diavolino board from Evil Mad Scientist Labs. That was my favorite board for a long time because it was cheap and minimal, it has since been replaced by the pro mini for the same reason. To the right of that board you can see a trimpot glued down, that is for the audio from the bluetooth board to go to an analog pin of the arduino. I made a nice hole in the battery compartment so it could be adjusted, turns out it really doesn’t help much. Above that is the motor controllers (red boards under the fabric). They’re cheap, and this guy wrote a library to use them so I just used them.

I could cherry pick a clip of audio where the speech seems to sync permanently, but this is most representative of how well it works. I think it’s pretty good. Here’s some things I should change in the code and some final thoughts. I added the button and the light sensor in, the button just flaps the tail and the light sensor isn’t implemented yet. I had to add a bit of code to drive the mouth shut because the spring just doesn’t do it fast and it doesn’t close all the way. That code should check if the mouth is closed and not try to do it again because since I did that the mouth is perpetually driven closed during silence. Speaking of the mouth, it broke again. I got fed up with plastic and bent a wireframe out of 12AWG solid core copper and soldered it on to the metal shaft. I really wish I had a picture, but I’m not taking that fish apart again if I don’t have to.

EDIT: I just couldn’t leave it alone. I wish I had put a hole in the back for a programmer so I didn’t have to open it up to reprogram it but I made a change to only close the mouth once unless it’s been opened again. The code is on github and really rather simple. Now I can leave the fish powered on at all times (and let’s hope I remember to disconnect or it’ll be flapping its lips as a recruiter tries to get me to talk back into a non-existent microphone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: