The project is to develop a desktop R2D2 replica that provides audio and visual feedback for internet based events. This could include facebook updates, email messages, PC status, etc.
One of the most memorable R2 moments is the scene involving the projection of Princess Leia... "Help me Obiwan Kenobi, you're my only hope!". As a result, R2Desk2 is going to have the ability to project basic images onto a nearby wall. At this stage this is going to be achieved through a POV laser setup.
Needless to say, little R2 will be able to Beep and Whistle and dance to his hearts content as well.
This project is a collaboration between two Australians, cognismith and kensbey.
The application is still console based at this stage, and whilst most of the code is complete, there are a still a few things left to finish before we can call it entirely functional.
I have broken the development down into relevant modules, have developed them as below.
Once I have had a chance to clean up the code, I will provide a link to a github repo.
Connect to, send structured packets to, and receive responses from the hardware is completed.
A packet structure class was defined that allows for easily creating correctly formed messages to send to the hardware
A small wrapper class that uses the Microsoft serial port library takes care of sending and receiving messages.
providing a method to send and wait for a response, or send and provide a call-back for later processing of response.
serial receive occurring in a separate thread.
Create all required message types has been completed.
A base class that defines how messages are formed and responded to. Also providing base functionality for xmlSerialisation for saving configuration.
Each message type that is sent to the hardware implements the base class, overriding the data component of the message and adjusts its parameters to suit.
Allow alerts to be pulled from any source is completed.
Using .net MEF, loading a folder full of dll's was actually quite a straightforward task.
An interface is defined requiring:
methods to read and write the plugins configuration to a byte array,
perform a check for if the alert should fire,
and provide a small data structure for use in the alert.
Reading and writing configuration data to xml has been 70% completed.
A class storing all of the applications configuration was created.
Which Com port to use
The alert polling Frequency
A list of:
Which Plugins to use,
that plugins configuration byte array,
a list of messages to send to the hardware once the alert fires.
each alerts configuration details.
Using xmlSerialisation, the above structure is read and written to/from an xml file.
The functionality to do the serialisation was completed, however only half of the rest of the code was modified to be correctly serialised.
Plugins: very little completion.
A pop3 plugin was written, but not tested or completed.
The above code was unit tested to as great an extent as was possible.
A basic routine was written to perform serial initialisation, load config and begin polling for updates.
a lot of error handling and tweaking is required before I would call this complete.
So i am 90% complete on the laser scanner component of the project. unfortunately time is running out and the firmware still needs a little work. two rotating hubs were machined on my 3 axis router out of plastic. 6 mirrors were then glued to these hubs and press fitted to the motors. IR reflectance sensors detect the motor speed and position for calibrating with the laser control. This was all taped into place for positioning and then epoxied in place. Hackaday style if i ever saw it.
The laser shines on the horizontal mirror assembly first which scans slowly (1 revolution for every six frames). this is then reflected onto the high speed mirror which scans at a much faster rate. this allows the laser to be toggled to produce a picture on a nearby wall. Hurrah.
So after a week or two of breadboarding and ratsnesting, I am pretty happy with the circuit design and am currently working on a pcb. Due to time constraints, i am going to route the Pcb on my 3 axis cnc router. I have also been making good progress on the firmware for the atmega. As we want this to be an open platform for future use, there is a fair amount of work in the software/firmware to create a framework that makes future expansion easy. Screencaps of progress on pcb and schematic below.
In addition, the laser and mirrors have arrived, so i can start the mechanical design of the rotating assemblies for the laser projector.
After settling on an overall concept, we began to hash out a few details.
Our plan is to create an easily extensible project so that we, or others, can
refine and further extend R2 in the future.
To this end our initial design was to create a multipurpose hardware
platform for configurable information reporting, with a view to basic human interaction
in the future.
First we came up with a list of features we wanted to implement, discussed
various feasibility issues then settled on a list of components that would make
it into the first iteration of R2.
Below is a list of features that will make up R2 version one.
Hardware will include:
A basic platform utilising open hardware, that will receive input via com
port care of usb FTDI.
A homemade open hardware hackaday-worthy POV scan-line laser projector, capable
of displaying symbols and small amounts of text.
RGB LED lamp, configurable on colour and flashing pattern.
Modulated Piezo speaker for a collection of preprogrammed chirps and
If time permits a servo driver to allow R2 to dance and jiggle its legs
Software implementation will include the following components:
A PC based management application that will configure and stream what
events R2 will alert you to.
An initial plugin based frame work to allow adding any sort of alert
The serial protocol completed with which communicate alerts to R2
Basic initial UI with allowances for a few preprogrammed beeps and
whistles, a collection of preprogrammed projection images, and a collection of
preprogrammed light patterns.
A couple of alert plugins, probably for facebook, twitter, and/or email.
This week Kensbey will tackle some initial hardware tests, whilst Cognismith will complete design stage for each software component, and create some test
framework for serial com and the plugin system.
The initial specs are mostly a product a tight time frame, and far from
what we want to see as a complete R2Desk2.
Although we can't add all of our ideas to the initial build, we will be
designing R2 to be as modular and upgradeable as possible.
It also goes without saying, we will completely open sourcing our hardware and
software, so that other hackers will be able create and improve on R2.
Below is a list of additional functionality we want to give R2 after the
completion of the Iteration 1.
A large variety of reporting plugins such as facebook alerts, twitter
retweets, instagram, pintrest, hackaday.io, your network connected toaster,
software build completion, github requests, etc)
Full audio output for beeping, whistling, and pleading from annoying intergalactic
princesses (possible text to speech implementations?)
completely user configurable alerts, allowing any combination of projected
image, whistly beeps, and flashing lights, along with editors to create images,
melodies and flash patterns.
Code ported to be more cross platform friendly (possibly web based management, possibly mono'ed?)
ethernet/wifi based module for untethered usage
motion sensors and camera
various additional signal lamps
ability for R2 to move around, possibly follow you, dance, and spin his