Before starting I put together a list of things I want and I didn't as below:
- I didn't want this thing to evolve around a single programming language or develop an API for a particular language or develop an API for each different language that I am planning to interface from.
- I did want this thing to be as simple and budget friendly as possible.
- I wanted this thing to be breadboard, jumper wires, duct tape, barely working hardware and software developer hardware noob friendly.
- I wanted to keep number of IO ports minimal unless absolutely necessary but with some flexibility so I can use same device, same ports for different purposes.
- I wanted this device to be budget as current USB based interfacing solutions around like Phidgets are quite expensive to dispose in a single hobby project.
Being a fan of PIC16F1455 and familiarity with Microchip's USB stack which definitely made interfacing stuff over USB easier for me for a while now, I decided to package what was laying on my desk being used all the time for debugging hardware projects and breath life into hardware experiments. Of course there are much capable and better chips out there but 16f1455 delivers amazing features for its price and I am quite familiar with this particular chip.
Years of java web application development also took its toll on me so the server side which simply said translates rest service calls to USB hid commands, is a java application using Jetty for jax/rs implementation. I also wanted to try consuming these services and needed a fancy client and put together dashboard with AngularJS. Also used Bootstrap just for fun.
While coding the server, I decided to stick with a good old fashioned test driven development approach as it was hard for me to resist the temptation to start with unit tests for rest service calls. Those JUnit tests later also covered without me noticing integration tests of hardware. This testing framework allowed me to test every port on every single device. I put together a dozen of resistors on a bread board connecting every port to a single point as a test circuit and came up with junit based integration tests which reads and writes to ports sequentially at least testing every solder joint and port on the device.
Well, while making this project I had this feeling of an overwhelming party going on where you have invited friends from high school, uni, workplace but didn't stop there also invited your next door neighbor, barista working at the coffee shop downstairs, your childhood best friend ... There are many things that can go wrong in that sort of a party as everyone knows you but not each other. You know everyone but some of them has changed in time, some of them you barely remember or know who they were actually. Surprisingly everything went sort of smooth and hopefully the fun will go on.
While I considered this project being completed, I will continue this party inviting a few more cool kids from the neighborhood. Here are a few upgrades I am planning for the next couple of months on this project.
- DAC: Utilizing DAC module on 16F1455
- PWM: May use hardware pwm modules on 16f1455 or implement my own loops around
- Serial comm
- Servo Control
- Interfacing with popular modules like DHT22 temperature and humidity sensor, ultrasonic distance sensors etc...
- Replacing application server with ESP8266
- Fancier analog features like frequency detection, capacitive sensing etc...
Special thanks to BSU - BS Free USB as it motivated to me to package stuff that I have been working on for a long long time now.