Hi all, first time poster so I hope this is in the right place & my questions make sense. I will do my best to explain my goals, current position, followed by the questions I need help with. Sorry if its a bit long winded but I figured I should get as much information into the post as possible. Also I was not sure if I should post in this "Interactive art" forum or the "robotics" forum, but as you read my design goal my choice should become clear..... basically I do not need this to be able to think/interact with environment, it more so a remote controlled prop.
Design goal:
Like many people I enjoy fancy dress when out at festivals/nights out, I am working on a few different wearable animatronics for this reason. This one is for an animatronic parrot to sit on my arm/shoulder which will sit in "idle" mode where it will do random movements/sounds at random intervals, but also respond to a remote control when needed. It will need to be completely self contained as in all electronics & power onboard, the remote will obviously be a separate module that I can operate secretly in my pocket.
Plan / current status:
I have ripped apart a "FurReal Friends Squawkers McCaw" toy parrot & binned the onboard controller. I have extended the internal wiring to a breadboard so I can easily connect to the input/outputs which I am happy with controlling. Its movements are done through two 6v DC hobby motors connected to a series of cams which produce different motions depending on which direction the motor operates. So I currently have access / working of the following things;
-
Head motor: Direction 1 open's mouth, spring loaded closed when motor is stopped. Direction 2 cycles eyes open/closed.
-
Body motor: Both directions operate a series of cams which cause the body to move, wings to flap, head/neck to rotate.
-
Speaker - 0.5w 4Ohm speaker for sound
-
The following limit switch's / buttons, all 2 wire open/closed switches;
-
Tongue press switch - the original toy had a cracker which you could put in its mouth to depress the tongue & trigger an "eating" sequence (probably will not be used, but nice to have the option)
Eyes open limit switch - Limit switch for when the eyes are in the most open state.
Eyes closed limit switch - same as above
Leg limit switch - connected to a cam on the body motor which is activated on various points during the motors sequence. (again probably will not use, but it is something I have access too) -
There are a few other sensors on board connected through some funny ways which I do not think will be worth the effort to get working as I probably will not use them anyway.
Breakdown of plan/goal:
In the most basic sense I need to synchronize mouth movement to mp3 sounds played along with random body movements.
Expanding on that idea, I will run the animatronic in two basic modes;
- Idle: Store a selection of mp3's in an "idle" folder. At random intervals either play a random mp3/sync mouth or activate body motor for random time.
- Remote trigger: I have an 18650 integrated ESP8266 & 4x4 button matrix as a remote control. Split mp3's into 16 folders. Using ESP-NOW play random mp3 from selected 1-16 folder.
Intermission - unplanned question 1
I had not really thought to much about doing a project log, but I realise with how much I have already typed it might be an idea. So would anyone else be interested in me turning this into a log with photos, videos, updates that may help if you decide to do a similar conversion??
Okay, back to it!
Current status:
First up I am a bit of a newbie with all of this, so my design practice is very messy & inefficient. I have an ESP8266 + motor shield driving the motors which I have working. I can read the output from the eye limit switch's but have not implemented them yet as I have been focused on syncing mouth/mp3 movement.
I really should have done a circuit diagram of the next part, but will do that later to upload & maybe a video of current working. I have a BT201 module playing mp3's from an SD card, this is currently using onboard controls but with software implementation I should be able to control using AT commands on serial connection (please see in my questions section why I am thinking of changing). The BT201 module has a mono speaker connections (combines stereo to mono) and also a stereo headphone jack. BOTH of these outputs function at the same time, I was able to exploit this to allow me music/signing synchronising -- I edited mp3's so that all "vocals" were on the left channel & all "music" was on the right channel. Both play through the mono speaker output so you can hear the vocals & music. However from the headphone Jack I have connected the left "vocal" output to the ESP's analogue input which I read to trigger the mouth motor.
Current thoughts / roadmap / changes etc
Really was not sure what to title the heading as, but this is kind of a link between where I currently stand & why I am thinking about changing the current plan (which will link into my questions in the last segment)
- Eye control: I can read the eye limit switches & control the motor, however I have not implemented code to synchronise the two.
- Body movement: I can control the motor to make it run through the predefined series of motions, I can read the body limit switch, however I have not implemented code to synchronise the two.
- Tongue sensor: I can read the input, but have not implemented any code for it yet as I just do not know what I would use it for currently.
- Mouth/sound: This is the messy part. I have implemented code to trigger the mouth movement if the audio received on the analogue input exceeds a certain level. Watching the parrot sing to songs is most entertaining (I may be 40 but watching a parrot karaoke to "Walking on sunshine" with the voice of Gilbert Gottfreid is making me giggle like a 4 year old!!!!!) So this splitting of mp3's into left channel vocal, right channel backing track, has GOT to stay!!! With that being said there are a few issues I have run into using this BT201 sound module, which is the major cause for considering changing what I have currently.
Current issues / why I am thinking of changing
So I am thinking about moving this project over to an I2S based system instead, but I have never tackled any project using this (as stated I am a complete newbie to this!). Not to sure how I am going to explain/format questions so please bare with me;
- 1: The physical size of ESP8266, Motor shield, BT201 are at the very limit of what I can fit into the parrot. Even that is going to need some heavy modification which I am happy to do, but would rather avoid. Either way there will be some heavy modification to add extra space for the battery pack. The location of the original controller board really does not offer much in the way of usable space as both the circuit board & the parrots body was built around this, there for I am planning to use the area of the battery pack to hold the electronics & then add a hidden battery compartment elsewhere.
- 2: The ESP8266 motor shield only allows access to 8 digital I/O's & 1 analogue input. 4 of the digital I/O's are linked to the motors. So if I continue to use this setup I am limited on what I can do.
- 3: Only able to read analogue on one channel. As stated, the music/signing is very entertaining so will be something I plan to keep, however both the mouth movement & random body movement are triggered by the vocal input, this means there are times where just the backing track are playing & the parrot sits dead still. It would be nice to be able to read both Vocal/Music channels so I can sync mouth to vocals but also still have random body movement if music is playing. I think that I could query the BT201 to see if playing = true & use that to trigger the random movements, but I am concerned about sending to much traffic across serial to/from the BT201. Not to mention that I also need to make the serial connection in the first place which will cost 2 of my I/O ports and also having to try & make sense of the AT commands around the internet.
The new plan / the questions
So this is where I will outline what I am thinking about doing different & where I would really like some insight as to weather this is a sensible plan. As I said I am new to this, I am not asking anybody to do my work / solve my problems....... Its more to confirm or correct me if I am going about it the wrong way. As we all know learning this stuff takes a lot of time & I would rather someone tell me if I am wasting my time looking at something which will not work when I could be looking at something else which would do the job.
So..... I am thinking about putting all of this into the spares box & kind of starting again from scratch.
-
ESP: I have several different ESP32 boards laying about which are much smaller than the current setup & have access to many more of the I/O's. So changing to one of those seems like a sensible idea. Also I think I should stick to ESP MCU's as it will allow the use of ESP-NOW for the remote control.
-
Motor shield: I went for the 8266 & motor shield combo as I had thought it would be the easiest solution. After playing about with it I now realise that it is a limitation both in size & connections. I only need to drive two DC motors & I have some MX1508 H-bridge drivers laying about. These are a fraction of the size so again it seems like a sensible idea to change over to using these instead.
-
Audio section / where my real questions are: The BT201 board is pretty large, the footprint is the same as the motor shield, although 1/3 the thickness. Connecting to this board through serial seems a little be janky & limited, this is why I am thinking about swapping over to I2S instead but have no knowledge at all about it. So today I have been having a little read/look at the following library & modules. The following questions are where I would like some confirmation or guidance before I spend out any more cash on things which will end up living in my spares box!!
So this is the library Arduino Audio Tools
I2S Amplifier Max98357
SD card reader SD card reader -
Q1: Would that SD card reader be suitable? Either way having a small reader module would help with space limitations but also mean I could place it in a more suitable area for access when I need to update the files.
-
Q2: I believe that selecting a folder & playing a random mp3 would be easier to code using this SD reader than trying to code AT serial commands for the BT201 module, or am I thinking wrong about that?
-
Q3: Am I right in thinking that using the "VolumeOutput class" of the library I should be able to measure the output of both left/right channels, allowing me to synchronise mouth movement to the left channel & random body movement to the right channel?
-
Q3A: This is more a thought as I do not really need it but might be nice to look into later on down the line when everything else is complete..... Using this setup would it be possible to count beats on the right channel? kind of like you see with disco lights etc? this would allow me to sync the random body movements to the timing.
Final thoughts
Thank you very much if you have managed to get through that essay! I had not planned for it to be that long but here we are. I am thinking now that I will turn this into a combination "help me I'm lost" / "this is what I have learned" project log. I intend to condense all of this down into something more palatable, but will leave as is for the moment as it has already been incredibly useful to myself just getting all of this into words!! So rather than rushing off now & getting myself overwhelmed with all the possibilities, I think I will spend the rest of the evening grabbing some photos/videos of the current project as well as working on some circuit diagrams so that the following post will be a little less wordy & a little more interesting!!
Thank you again!
Pearl