From Star Wars to Short Circuit, Go-bots to Transformers - the 1980s was a time in pop culture where people thought a lot about how robots might exist alongside us in the future.
Along with robots appearing in mass media, a good number of toy robots made their way into homes. While these robots certainly were fun for those fortunate enough to have one, they were often a fairly crude combination of common tech of the times. Cross a remote control car with a cassette player, walkie-talkie, and alarm clock - you had the top of the line toy robot of the 1980s: the Tomy Omnibot 2000.
Let’s bring the Omnibot 2000 closer to the home robot vision that many had (and still have) by bringing in new technology and rename it the Omnibot MAIV (Modernized with AI and Viam).
We will keep the original housing, style and motors where possible - but bring it into the modern era with:
- Programmatic control
- Secure internet communication
- Upgraded sensors
- Computer vision
- Machine learning and AI
By the end of this tutorial, you'll be able to securely control your Omnibot from anywhere, and leverage machine learning capabilities to have MAIV interact with the world.
Introduce yourself to Omnibot 2000Your Omnibot 2000 arrival will likely be both exciting and full of dust. Get out your window cleaner and paper towels and get to know it while giving it a good cleaning.
The Omnibot is driven by two wheels on each side, with a third un-powered wheel per side. The powered wheels have treads - you'll want to see if yours are intact and usable as they are important for traction. Ours were in decent shape - if yours are not you can find them for sale on eBay or 3D-printable at Thingiverse.
Note that Omnibot seems to be right-handed - its right arm and hand are motorized, while the left is manually posable. This tutorial does not cover how to control its arm and gripper.
The tape player is an interesting device to have built-into a robot - and it certainly adds to the retro look.
It is powered separately from the rest of the robot. We won't attempt to resurrect it, but if you do tell us how it goes!
There is a panel in the middle of Omnibot's back with a few switches and a number of ports. With a screwdriver, open this panel. This compartment is a good size for our battery pack, and you will see a barrel jack that we'll later use to plug the battery pack into. Leave this panel open as we move to the next steps.
Wiring MAIV's base motorsNow is the time to start transforming Omnibot into MAIV (Modernized with AI and Viam). This will take some surgery - but fortunately its all low-risk. Just remember to set aside any screws you remove in a place where they remain organized and will not get lost.
Start by placing MAIV face-down on a large table or floor, and find the six screw locations on the bottom near the wheels. Unscrew each screw (if yours has all of its screws intact, ours was missing a few), detach the lower base and place it wheels-down.
The first thing you may notice is that inside the base, there is a good amount of room to work. We'll be adding electronic components here, as this is also a fairly easy place to access. In the rear, there is a thick plastic box. Locate the screws, and carefully open it.
Inside you'll see 3 motors and some gears that drive the base's left and right wheels. Inside this gearbox is probably one of the cleanest places within your robot - we were amazed to see clear, clean grease on the gears. Be sure to keep it this way!
You will see two wires leading to each motor. Trace them to the outside of the gearbox, and mark them left, right, and front - we used masking tape and a marker.
The front motor allows a switch from high to low gear. We won't wire this as part of this tutorial - if you want to shift the gear, you can do so manually with the gearbox cover off.
Once you've marked the wires, close up the gearbox with the screws you removed earlier.
With this step completed, we now transition into the exciting part of the tutorial where we will begin to actually modify the robot. If you hesitate at the thought of physically modifying an Omnibot 2000, remember that it was in someone's attic gathering dust for years. Plus, we will re-use the motors and gears and leave the original circuit boards in-place (albeit no longer used). It's a restomod!
Let's get started with wiring the left and right motors to a motor controller and Raspberry Pi - this will allow your Omnibot to be controlled with Viam as a wheeled base.
First, detach the left and right base motor's wires from the small printed circuit board. Orient your L298N so that the OUT1 and OUT2 terminals are on the left side. Using a screwdriver, attach the 2 wires from the left motor to the OUT1 and OUT2 terminals. Now, attach the 2 wires from the right motor to the OUT3 and OUT4 terminals.
Ensure your Raspberry Pi is powered off, and connect GPIO pins for the left motor with female-to-female jumper wires. You can use any GPIO pins, but we connected pin 32 to IN1, pin 38 to IN2, and pin 35 to ENA. Now, do the same for the right motor, connecting pin 31 to IN3, pin 36 to IN4 and pin 22 to ENB. Cut off one end of a jumper wire, strip it and connect pin 34 (ground) to the common ground terminal GND on the L298N.
Powering MAIVConveniently, MAIV has easy-to-access external switches, a barrel jack in the battery compartment, and a barrel jack on the exterior. Spending a little time now repurposing these will make it easy for you to power up, power down, and charge your robot.
Behind the battery panel door, you'll see a cover with 4 screws. Unscrew the cover to access the circuit board. We will use the top switch on this circuit board to power our robot. Soldier two wires (50 cm each or so) to the outer top two pins on the backside of the switch.
We are not going to use any of the existing wires coming out of this switch panel, so you can cut them. In case you want to connect to them later, leave enough length before the cut to do so. Now, screw the cover back on with all wires extending out through the bottom of the cover. Feed the two wires you just added into the center cavity of the robot through one of the openings at the back side of the battery panel.
If your battery pack does not have a barrel jack connector, you'll need to add one. Cut off any existing connector, and solder the red wire of a male barrel connector pigtail to the positive battery wire, the black wire from the pigtail connector to the negative battery wire.
To avoid potential issues, please do not plug the battery in at this stage.
Next, you need to open the center/torso compartment of MAIV in order to access the wiring within. From the top portion of the already open base, locate any screws that attach the lower base to the torso and remove them. Then, locate the screws on the sides of MAIV's torso and remove them. You should now be able to remove the back portion of the torso. Turn this over so that the wires coming out of the battery box and switches are facing upwards.
At the top of the torso, you'll notice a large printed circuit board that was originally the main digital control center of the Omnibot 2000. We won't use it at all as we modernize MAIV, but we can leave it intact.
Now, using wire cutters and quick wire connectors, connect the battery, switch, and charger wires as shown.
One 3-terminal quick connect joins the negative wire from the battery, the negative wire from the charging port, and a new wire that you need to run from the torso into the base to power the robot.
Another 3-terminal quick connect will join one end of the power switch, the positive wire from the battery, and the positive wire from the charging port.
Finally, run the unconnected wire from the switch (the positive to power the robot) into the base through one of the holes in the top portion of the base (in the picture we have a 2-terminal quick connect in order to extend the length of our wire - yours is likely long enough to avoid this).
Working in the robot base, use a 4-terminal quick connector to connect the positive power supply wire (from the previous step) to the step down converter positive input wire. Using a length of 18 gauge wire, connect another terminal in this quick connector to the 12V VCC screw terminal on the L298N motor driver to which you previously connected the base motors and Pi. One of the terminals to the quick connector is empty. This is expected, you will use it later.
Now use another 4-terminal quick connector to connect the negative power supply wire from the torso to the step down converter negative wire.
Using a length of 18 gauge wire, connect another terminal in this quick connector to the GND screw terminal on the L298N motor driver to which you previously connected the base motors and Pi. As with the positive connector, one of the negative terminals will be left empty.
Finally, plug the USB-C output from the step down converter into the Raspberry Pi.
Now you can test that your wiring is correct. Ensure the power switch you just wired is off, and your battery is charged. Plug the battery into the barrel connector inside the battery compartment, then turn on the power switch. You should see LEDs on the motor driver and Pi light up!
When troubleshooting, if you do not see the LEDs light up, turn the power switch off. Check your wiring, use a multimeter to ensure that your battery has enough power, and that the positive and negative polarity is as expected. You can also try unplugging the battery and powering it instead with the wall adaptor.
Adding Viam and AI CapabilitiesMerging 40-year-old tech with modern tech to light up LEDs is exciting, but we need to configure our robotic base before we can get to the true prize of controlling MAIV through the internet and programmatically. For now, turn the power switch to the off position. In just a few minutes, you'll have it back on.
Now, go to the Viam app and create a new robot called MAIV
. Navigate to the Setup tab of your new robot's page and follow the steps to install viam-server
on your Raspberry Pi. Once that's done, head to the Config tab of your robot's page and click on the Components subtab.
Next, let's set up the groundwork for controlling MAIV through the Viam app. You have two options for configuring your components: either individually configuring each component, or by using a JSON configuration.
Toconfigureyour components inBuilder mode:
1. Add the board
- Click the Create component button in the lower-left corner of the page.
- Select the type
board
, then select thepi
model for the board type. - Enter
local
as the name for your board component, then click Create.
2. Add the left motor
- Click Create component to add the motor component on the left side of the robot base.
- Select the type
motor
, and select thegpio
model. - Enter
base-l
for the name, then click Create. - Next, select
local
for the board attribute. - Set Max RPM to
200
. - Click Showmore and toggle Direction Flip on (depending on how you wired your motor, you may need to turn this off later).
- Toggle Type to
In1/In2
. - Now, select
32 GPIO 12
for A/In1. - Select
38 GPIO 20
for B/In2. - Select
35 GPIO 19
for PWM. - Add
local
to Depends on - this ensures that thelocal
board component is fully initialize prior to this motor.
3. Add the right motor
- Click Create component.
- For your right base motor component, select the type
motor
, and select thegpio
model. - Enter
base-r
for the name, then click Create. - Next, select
local
for the board attribute. - Set Max RPM to
200
. - Leave Direction Flip off (depending on how you wired your motor, you may need to turn this off later).
- Toggle Type to
In1/In2
. - Now, select
31 GPIO 6
for A/In1. - Select
36 GPIO 16
for B/In2. - Select
22 GPIO 25
for PWM. - Add
local
to Depends on.
4. Add the base
- Configuring a base component allows you to create an interface to control the movement of MAIV without needing to send individual motor commands.
- Click Create component.
- Select the type
base
, and select thewheeled
model. - Enter
base
for the name for your base, then click Create. - Add
base-r
to Right Motors - Add
base-l
to Left Motors. - Set Wheel Circumference to
90
and Width to220
. - Add
base-l
andbase-r
to Depends on. - Click Save config in the bottom left corner of the screen.
Toconfigure your components in Raw JSON mode:
If you prefer this method, you replace the default configuration with the following JSON configuration for your board, left motor, right motor, and base:
{
"components": [
{
"name": "local",
"model": "pi",
"type": "board",
"namespace": "rdk",
"attributes": {},
"depends_on": []
},
{
"depends_on": ["local"],
"model": "gpio",
"name": "base-l",
"type": "motor",
"attributes": {
"pins": {
"a": "32",
"b": "38",
"pwm": "35"
},
"board": "local",
"dir_flip": true,
"max_rpm": 200
}
},
{
"depends_on": ["local"],
"model": "gpio",
"name": "base-r",
"type": "motor",
"attributes": {
"pins": {
"a": "31",
"b": "36",
"pwm": "22"
},
"board": "local",
"dir_flip": false,
"max_rpm": 200
}
},
{
"model": "wheeled",
"name": "base",
"type": "base",
"attributes": {
"left": ["base-l"],
"right": ["base-r"],
"wheel_circumference_mm": 90,
"width_mm": 220
},
"depends_on": ["base-l", "base-r"]
}
]
}
Remember to click Save config in the bottom left corner of the screen!
MAIV is still in pieces, but its time to ensure that the motors and base controls are working. Check to see if you might have something that you can use to set MAIV's base upon so the motorized wheels can spin freely. Or, if the wires between the base and the torso are long enough to allow small movements of the base you can leave the base on the flat surface.
Navigate to your robot's Control tab. Click on the base panel and use the arrows to control the base. Ensure the motors on both sides are working, and that the wheels are spinning as expected. If the wheels on a given side are spinning in the opposite direction of what you would expect, go back to the Config tab, toggle Direction Flip for the appropriate motor, Save config and repeat the test steps.
You can also test the individual motors directly in the Control tab. First select the desired direction and power percent, then start the motor by clicking RUN
and stop the motor by clicking STOP
.
In order to give MAIV a bit more personality and capability, let's wire MAIV's neck motor and eyes. We'll also add a camera so MAIV can see the world. As we enhance MAIV's features, the next step involves converting its eyes to LEDs.
Because MAIV's torso is already open, the neck and head is detached. Turn the head over, locate and unscrew the two screws holding MAIV's face plate. You will be replacing the current incandescent bulbs with more energy-efficient LEDs that can be controlled directly from your Raspberry Pi. In order to access the eye wiring, locate the screws on the underside of the head and unscrew them.
Remove the eye shield, unscrew the incandescent bulbs and screw in the LED bulbs.
The original wires to the eye bulb sockets won't be long enough to reach the Raspberry Pi. Cut the original wires (leave some length) and strip the ends. You will control both eyes at once, so use a 3-terminal quick connect to connect both eyes positive wires and a third long breadboard wire. Repeat the same with another 3-terminal quick connect for the negative wires.
Now, run the long breadboard wires through the robot neck, torso, and into the base.
With the robot powered off:
- Plug the positive breadboard wire into pin 1 on the Raspberry Pi (3.3V).
- Plug the negative breadboard wire into pin 18 (GPIO 24) on the Pi.
Power your robot back on to test the eyes. You will use GPIO directly to control the eyes through the `board` component you already configured. Once viam-server
is running (it will take a minute or so to initialize), go to the Control tab and open the local board card.
From here, you can test MAIV's eyes by setting GPIO pin 18 to high
(to turn the eyes on) or low
(to turn the eyes off).
Now it's time to connect to and test the neck motor. The Omnibot 2000 has a motor that allows the head to turn from side-to-side. This motor is a simple DC motor like those found in its base; the motor is not encoded nor is it a stepper motor so precise control is not an option.
You will notice that there are two wires that are running to some sort of limit switch and two wires that are running to the motor. Ignore those running to the limit switch. Extend the wires running to the neck motor through the torso and into the base.
Again, power off your robot.
Take another L298N motor driver and using a screwdriver, attach the 2 wires from the neck motor to the OUT1
and OUT2
terminals.
Using a length of 18 gauge wire, connect the final terminal of the positive quick connector to the 12V VCC screw terminal on the L298N. Connect the final terminal of the negative quick connector to the GND terminal on the L298N.
Connect GPIO pins for the neck motor with female-to-female jumper wires. You can use any free GPIO pins, but we connected pin 16 to IN1
, pin 37 to IN2
, and pin 29 to ENA
.
To add the neck motor, navigate to the **Config** tab of your robot's page in the Viam app. For configuration, you have two options: either individually configuring the component in Builder mode, or by using a JSON configuration in RawJSON mode.
Toconfigureyour neckmotorinBuildermode:
1. Navigate to the Components subtab and click Create component in the lower-left corner.
2. To create your motor component, select the type motor
, and select the gpio
model.
3. Enter neck
as the name for your neck motor, then click Create.
4. Next, select local
for the board attribute.
5. Set Max RPM to 200
.
6. Leave Direction Flip off.
7. Toggle Type to In1/In2
.
8. Now, select 16 GPIO 23
for A/In1.
9. Select 37 GPIO 26
for B/In2.
10. Select 29 GPIO 5
for PWM.
11. Finally, add local
to Depends on.
12. Click Save config in the bottom left corner of the screen.
Toconfigureyour neckmotorinRawJSONmode:
If you are editing the configuration of MAIV using JSON directly, add the neck motor by adding the following within the components list in your configuration:
{
"type": "motor",
"model": "gpio",
"name": "neck",
"attributes": {
"max_rpm": 200,
"pins": {
"a": "16",
"b": "37",
"pwm": "29"
},
"board": "local"
},
"depends_on": [
"local"
]
}
1. Click Save config in the bottom left corner of the screen.
2. Power your robot back on and use the Control tab to test that the neck motor is connected properly and can be powered on and off.
3. Next, before re-assembling MAIV, you can add a camera "nose" to your robot's face. We can use this camera to stream video and capture images, as well as leverage it for computer vision and machine learning.
4. Take MAIV's gray face plate and measure to find the center between and below the eye sockets.
5. Be careful not to crack MAIV's face plate when drilling (as we did)!
6. Use a sharp (non-spade bit) at high RPM. Covering both sides with masking tape before drilling (remove afterwards) can also help.
7. Find a drill bit that is about the same circumference as the USB camera you purchased and carefully drill a hole through the face plate.
8. Ensure that the camera fits.
9. Run the USB wire through the robot neck, torso and into the base. Plug it into the Raspberry Pi.
10. Now re-assemble MAIV's head, eye plate, and face plate with the screws you removed earlier. Fit MAIV's neck into the torso, and re-assemble the torso.
11. To configure the "nose" camera in the Viam app, you can use Builder mode or RawJSON mode.
Toconfigureyour "nose"camerainBuildermode:
1. Add the camera component to your robot by navigating to the Config tab of your robot's page in the Viam app.
Click on the Components subtab and click the Create component button in the lower-left corner.
Select the type camera
, and select the webcam
model.
Enter face-cam
for the name, then click Create.
Being that this is the only camera currently configured for MAIV, keep video path blank, and viam-server
will auto-detect the path on startup or reconfiguration.
Finally, add local
to Depends on.
Click Save config in the bottom left corner of the screen.
Toconfigureyour "nose"camerainRawJSONmode:
To edit the configuration of MAIV using JSON directly, add the camera by adding the following within the components list in your configuration:
{
"attributes": {
"video_path": ""
},
"depends_on": ["local"],
"model": "webcam",
"name": "face-cam",
"type": "camera"
}
Test your camera by navigating to the Control tab, opening the camera card, and turning on the video stream.
Turning MAIV's head while streaming video will give you a sense of how MAIV is starting to see the world!
Now that you've wired, configured, and tested all the components, put MAIV back together:
- Screw the upper base to the torso.
- Screw the lower base to the upper base.
Now MAIV is ready to interact with the world!
Start by driving MAIV through the Control panel, then try writing some code. A simple first exercise would be to have MAIV drive in a square.
The same code that works with any configured base will work with MAIV, you'll just need to update the robot location, robot API key and key id and any component names that differ in the code.
Since MAIV has a camera, you could also set up a color detector or detect objects using a machine learning model.
There's a lot more you can do with MAIV - for inspiration, check out our other tutorials.
If you end up building your own MAIV or another retro robot, we’d love to hear - let us and the Viam community know!
Matt Vella
Comments