Hasbro R2-D2 Interactive Toy Rebuild - New Sensors, New Brain, New Lease of Life.
by steve-gibbs5 in Circuits > Robots
73 Views, 1 Favorites, 0 Comments
Hasbro R2-D2 Interactive Toy Rebuild - New Sensors, New Brain, New Lease of Life.
Welcome reader.
In this Instructable, I will be showing you how I gave a non-functioning Hasbro Interactive R2-D2 a complete makeover with a brand new sensor array, microcontroller and a few more tricks up its sleave to not only get the little guy up and running again, but to give it some improvements and more functionality than it originally did. The accompanying video is a quick demo showing the new sensors installation and testing, and R2-D2s new features and fun dance routines.
The Project:
The challenge was to give this lil' guy a new lease of life by giving it a new set of sensors, new drive and dome control, and some new lights. To control it all, it needed a new microcontroller to make it all work, and having past experience with it, I decided to use the EZ-Robot platform and an EZB-V4 controller. The original setup had some king of navigation and sound processing sensors installed, but as the main circuit boards were fried, I decided to strip out everything and start from scratch, adding a pair of quality sound sensors, as well as a PIR, photoresistor (ambient light), smoke/Co2, ultrasonic distance, and computer vision camera sensors. Also added were a digital 180 degree servo, new RGB LED modules, and a motor controller to drive the original and working drive motors. The speaker mounted onside of the chest area still worked too, so I would use this for the new sound effects and speech synthesis... yes that's right, my R2 can now talk, because as I am not a Jedi or fluent in Astromech speak, I gave him a robotic human voice... a translator if you will that can be used with AIML (chatbots) or LLMs (ChatGPT, Gemini etc). And to control it all and to add more functionality, I used the EZ-Robot software called EZ-Builder/ARC. Now, R2 has a new and improved sensor array, speech recognition control, improved and additional sound files, a new mobile app control, and a whole new personality... all of the original features, but better and more of them.
The Insperation:
Some time ago, I was given this R2-D2 by a friend who was going to throw it away as it no longer functioned, but before he did, he asked if I would like it because he knew I liked making and repairing things. I gracefully excepted, took it home and set to work to see what was wrong. It turned out that the main circuit board had burnt out for some reason and was beyond repair, so he sat on a shelf as a display piece as the actual body was in really good condition. But after re-watching a couple of Star Wars movies, and finding a controller from an old project sitting in a draw after a clear and sort out, it got me wanting to pull R2 off the shelf and get to work... and I'm so pleased that I did because R2 has been a lot of fun.
The Plan:
- To dismantle and completely gut out the insides
- Cut away some internal plastic to make more room
- Replace the original sensors and add some additional ones
- To make these sensors genuinely useful, not just functional
- Replace the dome motor with a digital servo for more control
- Replace the LEDs with programmable RGB LED modules
- Fit a computer vision camera sensor for face/object recognition
- Add an H-bridge motor controller to control the original drive motors
- and to change the battery system from alkaline to a rechargeable and more powerful LiPo pack.
A quick note, there are cheap sensors, and there are quality sensors, and there are also some cheap, quality sensors around if you can find them. But if it becomes a choice of either cheap or quality, go for quality wherever possible... you won't regret it.
An explanation for what each sensor does will be at the start of each step. So lets get to it.
Supplies
Tools:
- Phillips screwdrivers
- Kinfe
- Soldering iron
- Hacksaw (optional)
- Wire cutter/stripers
- Sanding block
- Drill
- Hot glue gun
Materials:
- Hasbro R2-D2 Interactive Astromech Droid
- EZB-V4 controller
- Female to female jumper cables
- 2 x sound sensors
- Smoke/Co2 sensor
- PIR (Passive Infrared) sensor
- Photoresistor (ambient light) sensor
- Ultrasonic distance sensor
- EZB computer vision camera sensor
- Heavy duty 180 degree digital servo
- 2 x RGB LED modules
- H-Bridge motor controller
- 1 x 7.4V LiPo battery (or similar)
- Double sided tape
Computer:
Minimum Recommended Operating System Requirements...
- Windows 10 or 11
- Works on Mac computers with Bootcamp, a virtualizer like Parallels or VMWare, or using a ChromeConnect
- Intel Pentium or AMD 64 or 32 Bit 1.8 GHz CPU
- 6 GB RAM
- 200 MB free drive space
- OPTIONAL: Android or iOS device for mobile app control (The apps are basically the framework, but you create your own app interface, the way you want it to look and what controls you want to add, in the EZ-Builder/ARC PC program).
A Quick Word on Design
Here are a few things to keep in mind when doing a project like this, especially when making additions as well as replacements.
- Placement of the new sensors was one of the more critical elements so as not to interfere with R2-D2's looks, yet keeping them in useful positions where they would work their best. The one sensor I would have an issue with was the ultrasonic distance one, mainly used for object avoidance. I wanted this on the front foot but there was no room to install it from the inside because of the size of the roller ball wheel.
- Channeling wires from the head/dome into the body is also important. I used the original slip ring that turns the dome, but replaced the old DC motor for a servo. This had the limit of turning from 1 to 180 degrees, so no continuous dome spinning that could rip out wires from the controller. There were also areas where wires could be fed through where they couldn't get trapped or snagged.
- To make room inside, the battery compartment mold would have to be cut out. This R2 model has two opening flaps on the front, one containing a beverage holder, and the other is meant to hold the interactive voice command card and telescopic arm for the dome sensor. This compartment is the prefect size for the LiPo battery I used.
- After testing, I found the original drive motors for the wheels were still working. The total voltage from the 6 AA alkaline batteries added to 9 volts, but the higher capacity 7.4 volt LiPo batteries worked very well as DC motors tend do have a voltage tolerance. An H-bridge to control both drive motors independently both forwards and backwards would be needed for both manual and scripted control from the microcontroller.
- The final thing about the design is the mobile app interface. This is where you can be as creative as you like making your own control button designs, as well as adding what controls you want to add. I didn't give mine a professional/serious look as I wanted to keep the design bright and fun for when the kids want to play with it.
So lets move onto the build itself.
Dismantling
To start off, R2 needed to be gutted out. The battery panel was removed and the side legs were next. These are simply push fit and held on with plastic clips. They essentially pull off by holding onto the body and slowly pulling the legs off.
Using a Phillips screwdriver, all of the outer screws where removed and separated the front and rear body panels. There will be some wire that connect from the sensors in the front, to the PC board fitted to the back, but as we are not bothered about these, you can either remove the sensors or cut the wires. The center leg should just slide out, as should the dome and slip ring.
There are two sets of two wires that run from the the clear plastic side leg mounting rings (to control the drive motors) to the PC board, so cut these wires as close to the PC board as you can as we will reuse these to connect to the H-Bridge motor controller, later.
Finally I removed the PC boards (there were two, body and dome) and all of the wires and sensors so all that was left was the motor wires and the power switch and wires which I would also keep and use. Two side legs, front leg front panel, rear panel, battery panel, side flaps, slip ring and dome we keep... the PC boards, dome motor, sensors and wires we can discard or keep for something else.
Connect the EZ-B V4 Controller to Your Computer
Before any work started, it's best practice to connect the EZ-B V4 controller to your computer and set it up first. There are two connection methods... AP and Client modes, where the differences between Access Point (AP) mode and Client mode is how the controller connects to your computer or network: AP mode makes the EZ-B act as its own Wi-Fi hotspot, while the Client mode allows it to join your existing home/office Wi-Fi network. There are detailed tutorials where you can read about connecting your EZB controller and more, here. There is also a user guide that takes you through the set up steps when you open EZ Builder. When you have your EZ-B successfully connected, you are now ready to test your sensors, servos etc. before fitting.
Fitting a Servo to the Dome Slip Ring
Now we can get to work. The slip ring fits onto the body and attaches to the dome for rotation. With the original DC motor removed, the slip ring rotates freely. There are cut outs near the middle where wires can be traced through so the doke can rotate freely without the wires twisting and snagging.
To give the dome more rotational control, I fitted a heavy duty 180 degree digital servo that connects directly to a digital port on the EZ-B controller. To fit the servo, I cut out a piece of plastic just enough for the servo had a tight fit, located the servo spine dead center of the bottom part of the ring, and drilled then attached the servo with a couple of mounting screws.
I made an extended servo horn/arm and screwed it to a servo horn which came with the servo, centered the servo to 90 degrees, and screwed in the horn extension to the edge of the top part of the ring. Now the servo body will stay still in the lower ring and the top ring will rotate. With the servo cable fed through to the bottom of the slip ring, we can put it to one side for now.
TOP TIPS:
Connect the servo to the EZ-B, open a servo controller in EZ Builder (Project > Add > Servo > Horizontal Servo) and set the servo to 90 degrees for an accurate setup.
And for the servo cables, and for all of the other sensor and LED wires, stick on a little masking tape near the ends and mark down what wires are for which device. This takes out the guess work of knowing what wire is for what when it comes to setting up in EZ-Builder/ARC.
Dome - Sound Sensors
Sound sensors are small PC boards with a microphone, designed to detect sound waves in the surrounding environment and convert them into electrical signals, either analog or digital. I used these so they could pick up direction of sound (voice, clapping etc.), so when sound is louder on one side, the dome would face that direction such as asking R2 a question, he would hear my voice depending on where I am, and he would turn his head or his full body to look at me. Also when in autonomous sentry patrol mode, if R2 hears a sound, he would face that direction and the camera would point to what made the noise which could then be viewed or recorded.
Using the original sound sensor mounts in the dome, I cut off the blue screw hole grommets and used them as washers to secure the new sensors on the left and the right on the inside of the dome. I made the holes in the dome a little bigger so the sensors could pick up better sound as the microphones on the sensors were a little bigger than the original ones. Like many other sensors, these have adjustable POTs (potentiometers), a small screw that can be manually adjusted with a small screwdriver to change the sensors sensitivity, so testing them out and making these adjustments (if needed) will be easier before installing the sensors.
Dome - CV Camera Sensor
A computer vision (sometimes referred to as a 'machine vision') camera sensor is a device that converts incoming light into digital electrical signals to form images for analysis. These sensors, often arranged in pixel arrays and are the core components of machine vision systems, capturing precise spatial and color data for object recognition, face recognition and automated inspection in robotics and in industry.
R2-D2s camera is used for face recognition for both facial tracking (when I move, the camera tracks and moves the dome or body) and for regognising different people. The object recognition is used for identifying objects and different colours. The camera can also live stream to a computer of mobile device so you see what R2 sees, and can also record, useful for when he is in security sentry mode to keep an eye on our cat. Tied into the other sensors fitted via program scripts, this becomes quite a powerful tool.
To fit the camera, I used a soldering iron to carefully make a hole in the center of the black eye piece, just slightly larger than the camera lens. I connected the camera to the EZ-B controller to get a live video stream and make sure the hole was big enough and the view wasn't obscured.
The black eye piece was fitted back into the dome, and the camera fitted on to an existing blue plastic mounting panel just below the eye piece, then attached/adjusted with some double sided foam tape so it was secure and could see clearly through the eye piece hole.
TOP TIP: Check the orientation of the camera to make sure it is the correct way up before permanently fitting.
Dome - RGB LED Modules
The RGB (Red Green Blue) LED modules are digital and connect to the digital ports on the EZ-B controller, and with the correct script, you can make any colour you like. The modules I used would be for status lights and sound responsive/flashlight.
I used two modules, the first one was fitted where the original diode was fitted, but added a small piece of paper inside of the existing clear lens to act as a light diffuser, the applied a small blob of hot glue and attached the module to the inside of the dome, jumper wires fitted. These would flash red and blue every two seconds or so via a PWM (Pulse Width Modulation) script which I could change at any time.
Th second LED module was fitted behind the holo-projector part. This had a little magnifier lens already fitted so I added some hot glue and place the module behind this. This module would flash between yellow and green, with the flashing being sound responsive when R2 spoke or beeped. And in connection with the photoresistor sensor (next step), and setting the colour to as close to white as possible, this would act as an ambient light sensing flashlight, helped by the magnifier lens which increased brightness. Not a super bright flashlight, but it worked.
Dome - Photoresistor Sensor
A photoresistor sensor, also referred to as a Photocell, Light Dependent Resistor (LDR), or ambient light sensor, is essentially an On/Off switch triggered by ambient light. A passive sensor decreases its electrical resistance as light intensity on its surface increases... Bright ambient light = low resistance, low ambient light = high resistance. As an example, these are used in devices such as outdoor solar lighting where when the sun sets, the sensor will trigger the solar light to turn on and vice verse. These tend to be analog rather than digital sensors, so this would be connected to one of the analog ports on the EZ-B controller.
I fitted this sensor just under the eye/camera module next to the red/blue LED module. This was mounted on to blue mounting panel with a couple of small screws to hold it in place. The sensor diode pointed through a small hole that housed the old navigation sensor.
So with the dome pretty much finished, we move onto the body.
Body- Making Room
A short step, but this was a job that needed doing. I used a soldering iron with a cutting blade (in a well ventilated area, my garden work bench) to melt and cut out the old battery compartment. Below the compartment was a power rocker switch. I kept this in place as I decided to use this to turn the EZ-B/battery pack On and Off.
After it compartment was removed, I used a pair of snips and needle nose pliers to remove the remaining melted plastic, and rubbed down the edges with a sanding block to smooth out the cut edges. And that was pretty much it as this made all the room I needed.
TOP SAFETY TIP: If cutting plastic using heat like a plastic cutter or soldering iron with a cutting blade, do so in a well ventilated area, and use a mask for larger jobs, as the hot melting plastic is toxic... so be safe.
Body - PIR Sensor
A PIR (Passive Infrared) sensor is a module that monitors and detects motion by measuring changes in infrared light (radiant heat) emitted by surrounding objects, such as humans, animals, or vehicles. PIR sensors come in two flavours... analog or digital. This is also essentially an On/Off switch triggered by movement and is used in things like security lighting. R2 uses the PIR sensor for monitoring and detecting people when in security mode and sends an alarm when something is detected, and can be switched On or Off with a simple script.
I fitted this sensor where the wheel lock button was located (for its original use, this button locked the drive wheels so you could play with it on a table, and not have R2 run off and fall off the table edge). This was located on the front body panel at the bottom. It turned out it was just the right size for a PAR sensor, and because of the sensor cover is quite large, it didn't look to out of place when fitted, useful when R2 is on sentry duty in low power mode
For fitting, the wheel lock button was removed, and using a dog-boned shape piece of plastic that came from R2 (I can't remember what this was originally holding), I screwed one end into a spare screw mounting hole for the old button, and the other end acted as a clamp (no screws or glue needed) resting on the back of the sensors PC board. Jumper wires were fitted ready for controller connection.
Body - Smoke/Co2 Sensor
A smoke/carbon monoxide (CO) detector is something we all pretty much know about. It's a single safety device that detects both fire hazards and dangerous levels of odorless, colorless gas. These devices use dual-purpose sensors which are the main part of the detectors we have in our homes and offices, or at least should have. But the sensors alone can easily be found and be used with microcontrollers of all types. For R2, the use is a mobile smoke and gas detector that at low levels will warn with a low level alarm and speech warning, but if higher levels are detected, a much louder alarm will sound and can activate the camera in his dome.
It is an analog sensor, and I managed to fit it behind the silver chest area near the built in speaker. The silver chest part has vents on it for the sound of the speaker, so this was ideal for the smoke sensor.
Body - H-Bridge Motor Controller
An H-bridge is an electronic circuit that enables a DC motor to run forwards or backwards by switching the polarity of the voltage applied to it. They come as a single channel (controls one motor), duel channel (controls two motors) or multi-channel. It's named for its H-shaped configuration of four switching elements (transistors) around a central load, it allows for bidirectional motor control, braking, and, when combined with PWM, speed control.
As the original motors still worked and the original circuit board burnt out I needed to replace the motor controller, so for all of the dynamic uses, I when for a duel channel H-bridge motor controller. This is a digital circuit so connects to the digital ports on the EZ-B controller.
I fitted the H-bridge to the front body panel onto the back of one of the front compartments. A couple of short screws was all that was needed to hold it securely. The original side leg motor wires I kept were connected to the H-bridge motor terminals, and jumper wires connected for power and EZ-B connection. H-bridge to EZ-B V4 wiring connection can be found here.
Front Leg - Ultrasonic Distance Sensor
An ultrasonic distance sensor is a device that measures the distance to an object using high-frequency sound waves. It does this by calculating distance by emitting sound pulses, and measuring the time it takes for the echo to reflect back. Ultrasonic distance sensors are mainly used for object detection, proximity sensing, ands for robot navigation. So for R2, this sensor is used for detecting an object like walls, tables etc. then stopping/turning to avoid bumping in to them for both manual and autonomous control.
I decided to put this on the front leg/foot, but unfortunately, there was not enough room inside of the foot to mount the sensor from the inside because of the ball that acts as the front multidirectional wheel. So because it would not look too out of place, I mounted it on the outside of the foot and fed the wires through a small hole I drilled, then hot glued the sensor to the foot. I used extension jumper wires on the sensor then fed them through the leg into the body.
And that was the last sensor fitted, so onto the wiring up and assembly.
EZ-B V4 External Sound Breakout
The EZ-B V4 has an on-board speaker that works pretty well, but on the actual PC board of the controller, there are two solder points where you can fit a larger external speaker or a jack to connect to an external speaker to make things sound much better. Here is how it's done.
- Open up the EZ-B v4 casing and remove the PCB's and small speaker as you won't need this now.
- Carefully pull the two PCB's apart and put the board with the connection pins to one side.
- Using an old headphone lead, strip the wires and solder the bare copper wire to the "Ground" terminal, and the shielded wire to the "positive" terminal. If your using a non amplified speaker you can solder the wires to the "SPK" solder terminals. This is because the EZ-B v4 Has a small on-board amplifier.
- Then sandwich the two PCB's back together and replace the casing.
- You will need to modify the casing a little so the speaker cable can fit through it (as seen in the photos).
- Power up the EZ-B, plug to headphone jack in to a speaker and test it. All should be working.
Now came the time to connect the wires and put R2 back together.
Wiring & Assembling the Body
Before I did a full wiring and assembly, I hooked up the H-bridge to the EZ-B and battery, inserted the front foot, put in a couple of screws to join the front and back body panels, and refitted the legs. Then I opened and set up a drive control on the EZ Builder/ARC software (details in Step 15) and gave R2 (well most of him) a test drive to make sure he could move around okay.
After this, I switched R2 off, removed the battery and took apart the body panels. Here drilled a hole into one of the storage compartments, fed a two wire cable through and fitted a male terminal block (the female end I fitted to the LiPo battery). For the other end of this cable, I routed on wire to the old power switch (power in) , the other switch wire (power out) to a barrel jack for the EZ-B, and the other battery wire (negative) to the barrel jack.
I fed all of the sensor/device cables from the dome through the slip ring, then fitted the dome to the body panels making sure the dome was facing straight ahead (remember how we centered the servo to 90 degrees earlier), and screwed them back together. R2 becomes one.
Now I could start hooking up the cables to the EZ-B... camera to the camera port, analog sensors to the analog ports, digital sensors/servo/RGB LED modules/H-Bridge to the digital ports, all the while making a written list of what device was plugged into what port number, which we will use next.
Programming/scripting
This is where we open up EZ Builder/ARC on our computer, connect the EZ-B V4 and start setting up sensors, lights and servo as well as the H-bridge. I won't go into full programming/scripting detail here because you may want to set up your robot and its sensors, servos, sound effects to do different things and be more personal to you. But I will give the scripts to set up and use the sensors etc. and how to add them to give you a good start. From there you can build you project to how you want, combining sensor feedback with servos, lights, speech etc.
In EZ-Builder/ARC, there are many different controls you can choose from by clicking on Project > Add > then clicking on one of the category tabs. There are two main script controls we can use under Scripting, they are Script which is a single script control, and Script Collection which is where you can keep things organised and have many script controls in a single control... a script library if you will. This saves having lots of script control windows all over the place taking up room on your screen, and keeps things much more organised.
RGB LED Basic Script:
So lets start with something simple, making R2-D2s status light flash from red to blue. So to start we will use a single Script control. Click on Project > Add > Scripting > Script > click on the three dots icon, and this will open the script editor. The RGB LED will have 4 pins, negative power, red, green, blue. With the negative wire connect to an EZ-B negative port (it doesn't matter which one) and assuming you have the red LED colour wire connected to port D9 and the blue LED colour connected to port D10, use the following script...
Name this script "RGB Red Blue Flash" or whatever you like, then save the script. When you press "Start" this will turn On the red LED on for 1.5 seconds, then turn it Off and switch the blue LED On for 1.5 seconds, then turn it Off and loop the process again. On the script control, there is a Stop button where you can stop the script from running. You can call this, and any other scripts you made, to run and stop from another script or control using...
- ControlCommand("Control Script Menu", "ScriptStart", "RGB Blue Red Flash")
which can be found in the questionably named Cheat Sheet in the script editor. So lets have a look setting up some sensors.
Sound Sensors - Basic Script:
This runs the two sound sensors so if a sound is heard by either one (the sensor that hears the loudest sound level), the R2-D2s head will turn in that direction. This assumes that the sound sensors are connected to the EZ-B analog ports ADC 0 and ADC 1 with the dome servo connected to digital port D13 (90 being center, and 130 degrees so the dome moves in increments, not 1 degree and 180 degrees). This can be added to another Script control or a Script Collection control. So when a sound is heard either from the left or right sound sensor, the head/dome will rotate in 40 degrees. You can of course change these values so the dome rotates more of less in increments.
PIR Sensor - Basic Script:
This script runs the PIR sensor and if any movement is detected, a text to speech phrase will be played (the Say command plays the phrase through an external speaker, SayEZB will play through the on-board EZB speaker). You can also use a Soundboard control to play sound effects such as R2-D2s beeps and whistles, or an alarm. This assumes you have the PIR sensor connected to EZB digital port D23.
Photoresistor Sensor - Basic Script:
Something a little different, this script will use the first one in this step for the red/blue LED flash. It uses the ControlCommand shortcut mentioned above, for the "RGB Red Blue Flash" script, so when the ambient light reaches a certain level, the LED script will run and the red and blue lights will flash. This assumes that the photoresistor sensor is connected to analog port ADC2.
Smoke Sensor - Basic Script:
This script is the starting point of a multi level monitoring script, alerting when different levels of smoke or gas is detected. This assumes that the smoke sensor is connected to EZB analog port ADC0. This also triggers a simple text to speech phrase that comes out of the external speaker (Use SayEZB command instead if you want the voice to come out of the on-board EZB speaker).
Camera Setup:
In EZ Builder/ARC, click Project > Add > Camera > Camera Device to add a camera control. Then click on Device then click on your EZB address, then click Start. There are a few built in functions to play with, but to keep things simple, we will add a servo control to be used with camera/servo tracking so when something is recognised, the camera controls the servo so if the object moves, the servo will move to keep the object in frame. Click on the three dots icon, then under Tracking check the Servo Tracking square and in the X Axis Servo choose the digital port your servo is connected to (in my case, port D6), set the minimum and maximum servo travel and choose the servo increment steps (changes how far the servo travels between each movement), then save. Then under the Tracking tab, choose what you want to have tracked. There is a lot you can do with the camera, too much to add here, so it's best to see the tutorials to find out what you can do with the camera, and how. Below is a basic camera tracking for a colour script where if nothing is recognized after 10 seconds, a script or part of a script runs.
H-Bridge - Basic Setup:
I touched on this earlier for the test drive, but here is the setup and basic script processes to get R2 moving around. An example of port/pin wiring is as follows... H-Bridge (drive Motors) In1 connects to the Signal pin (white) of Port D8, In2 connects to the Signal pin (white) of Port D9, In3 connects to the Signal pin (white) of Port D10, In4 connects to the Signal pin (white) of Port D11, EnA Connects to the Signal Pin (white) of Port D16, EnB Connects to the Signal Pin (white) of Port D17. From here you can add a Movement Panel where you define the ports, or use a Custom Movement Panel that uses scripts, or use a simple script control. Below are some basic movement scripts I use (change the port values (D0 D1 D2 D3) for the ports you use on your EZB controller.
I have some more script examples you can look at from my full size Astromech and my K9 2.0 build Instructables. In EZ Builder/ARC if you click on File > Open (under Cloud Storage), you can also see and use other peoples projects and their scripts. If you look under Public And search for Steve G or R2D2 Beta Test, you will find my cloud project that contain most or R2-D2s scripts, controls etc. along with the dance routines which you may find useful. They are old as the more recent ones are stored on my laptops.
Sound Effects and Speech
The original setup had a basic speech recognition function to make R2 say phrases from the movie or to control movement by saying "Hey R2, ......". I decided to keep this feature but created new, better sounding phrases and more of them. These are triggered by using a Speech recognition control in EZ Builder, and used a script to randomise different phrases spoken by each movie character. There are several websites where you can download free to use sound clips and effect, this being one example, and I used Audacity music/sound editor to clear up the sounds as much as possible.
I added two Soundboards (Project > Add > Audio > Soundboard EZB), one for character phrases and the other for R2s beeps and whistles. I then added in all of the sound files, then added a Speech Recognition control. In this control I added a wake/enable phrase to start the speech rec listening "Hey R2", then all of the phrases I would ask "Do you remember Han Solo" etc. then added the control commands for each of the random phrase scripts, for example...
So every time I say "Hey R2, Do you remember Han Solo?" R2 would play a beeb boop sound, move his head, then play one of the four character phrases at random.
I already touched on this earlier, but to have a spoken voice, there a few options, an AIML control, Speech synthesis control, Bing or Google speech Recognition control, or you can use a script. Things like the Bing and Google controls offer two way spoken communication, where using a script, you can get him to say what you want...
What you see in the video is a combination of sound effects and speech synthesis in one script where R2 beeps and whistles, the speaks a response in English.
Custom Mobile App
To create your own mobile app in EZ Builder/ARC, you can use on an iOS or Android smartphone or tablet, or on a PC. It gives you some basic tools to control a robot, but to really make yourself a dynamic and unique app, and make it appropriate for your robot, a lot of work is needed on your part, but if you have a creative side and can think outside of the box, you can do some pretty amazing things. In EZ Builder, click Project > Add > Remote Control > Interface Builder to add a mobile control.
You can use the default buttons and backgrounds for your app design, or using a paint/draw program, you can design your own to make a more personalised UI. To be aware, the mobile app is limited and does not include many advanced features such as speech recognition, object tracking, and most plug-in robot skills. ARC Mobile is kept mainly for legacy use. For most new builds, it’s usually better to run ARC on a PC or an embedded computer (SBC) inside the robot.
My app is designed in such a way where one button has two functions. This saves a lot of room on the app screen where you don't need to have an On button and an Off button for example. One button does both. For example, to make E4-B4 move forward and stop using the same button, I use the following script...
As this script uses a variable, this needs to be defined first. You simply do this by placing a "Run Once" script in the EZ-Builder connection control, $pressed = 0
Pretty much all of the app buttons have this "toggle" design. I have also added a window to view the camera through. If you access the app using a cellular connection using a remote desktop (VPN) program, then this video feed, and indeed full control over E4-B4, can be done from anywhere that you can get an internet connection. This works great as part of a home security system.
Once you have finished designing and programming your new mobile app, you can save it to EZ-Robots "Cloud" server where you can access your app on your smartphone. Or you can save your project locally on your computer and access it using the VPN idea I mentioned above.
Conclusion
And that brings us to the end of this project. This was a particularly fun project to do and keep finding myself making little improvements to the scripting as I learn more, and getting more use out R2-D2s new sensors which are working really well.
I am going to ditch the AIML for two way conversation, and use Google or OpenAI plugins from EZ Builder/ARC as AIML doesn't seem to be supported much now as it is an older format and has been out paced by LLMs now.
So I hope you found this useful, and if you decide to give this a go, I'd love to know about it. One day I may drop the EZ Robot platform and go for Arduino or something when I have learned more about coding/scripting because I want to get away from a using a remote computer, and have something embedded in the robot itself.
Thanks for reading, and happy making.