Robot Personality Display Add-on
by tekyinblack in Circuits > Robots
47 Views, 2 Favorites, 0 Comments
Robot Personality Display Add-on






This is a fun robot which can run standalone as a bit of fun or as an add-on to a robot design to give it additional personality through visual and audible signals, to make it more informative or fun. It might be particularly useful to children who need a bit more stimulation to gain their interest. The syntax is meant to be simple enough to make it easy for most of us to experiment and achieve results with different designs though younger minds might need a bit of assistance.
A 16x16 dot matrix display provides simple pictures and animations as to how the robot 'feels' , two servos wave arms to give additional waving signals, and a loudspeaker is available to provide sound output to aid communication.
The intention is that the user can easily code their own expressions and display them with commands from a separate robot or from another computer via a serial interface. An example of using a USB interface is shown later. As standalone, it will run a series of actions which can be coded to run continuously.
As described, the project uses 3D printed parts but the builder could make any case and arms they wanted and perhaps just glue the whole together. Static legs for the robot are shown but it could be just as well mounted as the face on a robot project or even a wall.
Pictures displayed are coded in a simple text based 16x16 matrix held in a file and both the display and arms can be controlled from these files.
There are many options for the arms, shown here is one with different sized waving arms, one with ears, and a sun and umbrella for say a weather display, these to be used to give extra expression or to aid getting attention. Others might be a sun and moon on a clock display.
It's based on a Raspberry Pi Pico running Micropython and four MAX7219 driven 8x8 led matrix's, built into a 3D printed case to give the 16x16 array. There are complete 16x16 LED arrays available, manufactured on a single PCB with the MAX7219 but I haven't tested them and they will possibly need the code to be changed slightly to get the pixel addressing correct but will be much easier to connect. Using Python means that this can be included in many current computer education syllabuses'.
The design has been based around a Raspberry Pi Pico, but could be ported to any processor capable of accepting serial input and driving a MAX7219 display chip, and other Raspberry Pi chips such as Pico W, Pico 2 and Pico 2W can be substituted directly.
Control is via a serial interface to issue commands or trigger stored actions held in files, the syntax being the same, but a default file, main.txt, will run from switch-on if defined. A typical file is listed below with explanatory text. Micropython code for the Raspberry Pi Pico is held on github. A variety of display files are attached in the last step and on github.
Supplies





4 x MAX7219 based LED matrix displays. These will be connected into a 2x2 square to give a 16x16 display
Raspberry Pi Pico (any version but the Pico 2W will be fastest and will accommodate future web control)
3D printed parts (see Step 1)
3mm nuts and bolts
2 x SG90 or MG90 servos
Dupont connector cables
Small piece of stripboard
PCB pins and sockets
Hookup wire
Buck power convertor
on/off switch
power connector
The following only needed if adding sound:
PCB loudspeaker
1k resistor
S8050 transistor
The following will be needed if controlling over USB (see pictures):
USB cable
USB serial interface
Print the 3D Parts




The parts for this project were printed on a 3D printer and are shown in the pictures, and the design files are attached. They were designed on TinkerCAD. While the parts are printing, the control board can be assembled as shown in the next step.
Because the printed holes can be slightly too small, it may be necessary to drill them out to the correct size of use a round file.
Downloads
Make the Control Board








The control board designed for this project is assembled on stripboard but a commercial board could be used instead though it may not be easily mountable on the main display. The board needs to be able to provide the ability to drive two servo motors, and the MAX7219 ICs via a three pin SPI interface . A Pico is used here, but ESP32 and Arduino could be used, code for these solutions is provided here. Provision is also made for a small loudspeaker.
The control card described can be powered by an external 5V supply directly or by a 7V-12V via the inbuilt buck convertor. If a 5V supply is to be used then the buck convertor socket can be bypassed.
The board has been tested with a USB power supply via the the USB socket on the Pico and found to work ok but the servos might struggle to operate correctly with the limited power.
Assemble the Display


The MAX7219 driven display matrix's should fit into the designed case and it's a good idea to test yours before progressing.
Separate the LED matrix from the PCB, taking a not of the matrix/pcb orientation, and fit the pcbs into the case, attaching them with small M3 nuts and bolts.
Add the Servo Extensions



These can be screwed to the sides of the main display or further secured with nuts on the inside though these may be very fiddly to attach.
Insert the LED Matrix


Fit the LED matrix's into the pcb pin holders, taking care not to bend any pins. It's a good idea to make sure all the pins are straight before beginning.
Add the Servos



Add the servos into their supports and screw them into place with the screws supplied with them. The arms are attached using one of the servo horns cut down as shown in the pictures, and secured in place with the supplied screw.
Before attaching the arms, attach the servos to the control board and run the Zeroarm.py program supplied on github which will rotate the servos to the zero position, which will be arms pointing straight down. The arms can then be attached pointing straight down so that their position is accurately reflected in the display files.
Wiring





Wiring up is a case of working through the few main connections, and using multiway Dupont cables makes this easier and more reliable. In the pictures above, my wiring is:
VCC Orange
Gnd Yellow
Din Green
CS Blue
Clk Purple
Connect the LED arrays first then run the cable from the first LED array to the control board.
Vcc can be any red pin
Gnd can be any green pin
Din yellow pin 19
CS yellow pin 17
Clk yellow pin 18
The serial and common ground pins are physical pins 2 and 3.
The left and right servo connections are fitted to pins 21 and 22, with the orange/yellow wire over the yellow pin.
Removing the buck power supply before fitting the wires makes this easier.
Load the Code

The code for this project is held on github here and comprises a python program with a couple of libraries and a set of demonstration files.
The program and libraries need to be copied to the Raspberry Pi Pico on the control board, and whichever display files are needed, using a Python development environment.
Renaming the main program as main.py will cause it to be run each time the Pico is rebooted. By default it will attempt to display the contents of the main.txt file but that can be changed in the code.
The display can be arranged to just run itself continuously by just using the AGAIN function or creating a loop of FILEs, chaining from one to the next.
New display files can be created and stored on the Pico but only when the display program is not running, use the QUIT command to stop it before saving to the Pico. The display files are text files and can have any suffix, all the examples use .txt, and can be created in the Python development environment or a basic text editor such as Notepad.
The display can be fully controlled over the serial interface, using the same syntax as files, though commands are only accepted once a display file has completed, so if there are lots of delays it may take a while.
A loudspeaker is included in the design and files for that will be added later.