Skip to main content

it's been a while (but not without updates!)

I did not have much free time to work on this over the last couple of months,

but every once in a while when I did remember (hard not to, I keep the robot hand right in front of the computer), I tried to do something, mostly in the hardware procurement side of things.

some of the things I ended up acquiring:

- Raspberry Pi Zero (also the Raspberry Pi Zero W, which has wifi+bluetooth internally, but I just received it today thanks to Mr. Arjun Rao), for more versatile control (also to make possible to connect to the Leap Motion)
- AA battery power holders, to use AA batteries to power the servos
- A PCA9685 chip, for multiple servo control
- various electronic circuitry (probably won't be necessary for this project anymore)

in addition, I was made aware of a nice project called Cylon.js and its sister project Gobot, which allows users to program microcontrollers using JavaScript and Golang, respectively.

I really wanted to try Gobot and take a dive into the Golang world, but it currently does not have support for the PCA9685, which Cylon.js seems to provide. 

with that said, and with a few lines of code, here is the result:


the control of the servos are done through the PCA9685 connected to a Raspberry Pi Zero (no more Arduino), and the servos are powered through the 4-AA batteries. 

the next step is to read values from the Leap Motion, which Cylon.js claims to provide. 

when that works, we are starting to reach a good place. 


Comments

Popular posts from this blog

json messaging (2/2)

Took a good 2 hours to change all the messages into JSON format and make it work. But it is done. All is JSON. Using it like a map, currently with three key-value pairs: "id" : for entering a session ID of another session if needed. Currently used for the web client to receive a acknowledge response to confirm that the target received the message (mainly for testing purposes). "type" : probably the most functional data going through all this. Current types are STARTUP_TYPE - for when the target sends its initial message, the server uses this to mark which session is the target. REQUEST_TYPE - for when the web client sends a request to the target. Server uses this to send request to target. ACK_TYPE - for when the target finishes carrying out the requests and sends an acknowledgement of the completion of the request to the server. Server uses this to send confirmation to the web client  MISC_MSG_TYPE - for anything else. DEBUG_TYPE - current...

come back

The last couple of weeks have been quite refreshing. The drive for learning and trying out new things has never been higher. Currently fascinated with Node.js; Javascript truly isn't the make-a-website-pretty script I had known anymore.  Playing around with back-end and front-end frameworks. Currently playing around with Sails.js, and once I get used to that, I am looking forward to trying out Angular.JS as a front-end framework. Other than that, currently have couple of other random APIs (non-Node.js) I would like to play around with, but I'm just keeping them up in my browser tabs to that I'll get to them eventually. In addition, I reviewed the Android Developer tutorial again--hoping to try making something in that end as well.

adding a servo

Since I don't have any lock that works based on a digital signal, it seemed appropriate to at least have something in place that would emulate the behavior of such a lock, and I thought that a servo would be a good substitute. (note: a servo is a device with which one can control a specific rotational position) Connecting a servo to the current circuit isn't too much of a challenge, as it just requires a single output connection along with the ground/power. Making the servo also just requires an addition of a few lines of code, using the Servo library . A simple video of the servo in action: Now, at least with a locking behavior in place, the one visible functionality that needs to be addressed is the device's ability to distinguish between a "standby" state (no alcohol/no breathing in: should be in "lock" mode) and a "open" state (no alcohol/breathing in: should be in "open" mode).