Android Side Project

Much like the girl has decided to keep at the in-womb thing, I have decided to keep at the Java thing. Little brat. I decided to figure out how to dump accelerometer / orientation data off of the phone, for use with the IOIO.

In short, I am roughly attempting to see how the data exists in its natural state, in order to figure out how to scrub and interface with my physical components.

android side project beta

warning beta stage warning

So far, I have nice looking code that blasts a force close scenario. Great.

Anyhow, I’m hoping my time on this effort comes to a close and the girl decides to join us. Teamwork…I’ll code, she can practice her singing.

IOIO Servo Project Recap

So, good news and bad news in regards to my IOIO servo controller project.

Good: I have published my code to GitHub. See…

IOIO sample code

git stuffs

Bad: Ytai, the creator of IOIO itself, let me know that my code is in need of an overhaul. Big time.

I am experiencing too much lag…losing a ton of time in the writing phase of my app. Expect an overhaul of said code, in preparation for my next project.

I have seen some activity on both of my apps on the Android Market. I feel some moral obligation to fix both apps, cite some versions, etc. This one could take some time, but should result in a pretty sweet project. On a strange note, Ytai has a sample app that handles the analog input that I need for my next effort. I should be able to stand up a project before too long…pretty pumped.

Anyhow, check that code if you are bored. Really bored. I will update when I get some decent code committed…until then…

IOIO Servo Controller

I just doubled my Android Market presence with one fell swoop. IOIO project number two is in the books: IOIO Servo Controller.

IOIO Servo Controller

servo in altoids can smells like altoids

This project is a one-off of the PowerSwitch Tail relay project I have out in the wild. I took the button out of the mix and implemented a slider bar…removed the relay and am now driving a hobby servo.

IOIO Android app

brand placement

Displayed is the relative level (zero to one) of the slider, the slider itself, and a shameless plug. The onboard LED also fires with a brightness relative to the slider position…which I implemented in the coding and sort of left in there.

The basic concept was to get the PWM output configured correctly, in order to control the servo positioning…the slider function is pretty much just the stock slider from the Android Development docs, widened a bit for the sake of video capture. The rest was just mashing around the code I had out there…not too bad.

Check the thing in action:

This project is available for download in app form on the Android Market. Right next to my other guy…search for IOIO. I will toss the code on my GitHub account as well. Fun project…I may branch and see If I can do anything cool with a few servos. We’ll see.

Shoot any comments to joe(at)swantron(dot)com. I can help with any setup issues, if they may arise. Good luck…

Git er Hub

Making progress on the IOIO marathon project.

GitHub has been chosen as the initial hosting deal. Configured with a little hello world this evening.

git hub linux


Click on that for some CLI awesome junk. If not, tune back in for the larger effort soon. Android app may follow.

Adding Surface Mount Power to IOIO

Some career-oriented things have kept me largely out of the Bad Lab. I finally decided to dust of the soldering station and get a permanent power connector surface mounted to my IOIO board.

I tackled this project before I headed to work…I think the pre-coffee pre-jitter scenario worked out well. Anyhow, this is the component from SparkFun:

surface mount power jack

tiny surface mount is tiny

It is a simple two pin surface mount compact connector. Nice current rating, so I am hoping it will give me enough juice to pull 5V in my pull-up project.

The issue to overcome in the actual soldering was keeping this little sucker in place and stable to get the first joint in place. My solution, once again, ended up involving my adjustable clamps. These things are great, especially compared to the ‘helper hands’ alligator clip stand. Wonky hands would be more apt.


+2 clamps

For a little connector, it seems to be fairly secure. I also picked up a barrel jack to two pin connector from SparkFun.

mount surface

surface mount mounted

Hooked up to a wall wart…survey says:

ioio power

power-ed up

We have power. I will test it against some loads, and get back on the pull-up project. Here goes nothing…

Open Drain Example IOIO Android


This project never ends.

I have been cutting my teeth on some electrical engineering 101, in an effort to push 5V through my IOIO. At this point, I am still not able to report a success.

I do have the ‘open drain’ setup working, at a lower voltage than I am intending. My configuration is as follows:

pull up resistor

pulling up to 5V

The Java snippet that is doing the pin defining is this guy:

DigitalOutput out = ioio.openDigitalOutput(25, DigitalOutput.Spec.Mode.OPEN_DRAIN, true);

The only issue is with my setup…for some reason, my circuit isn’t able to pull to 5V. See the DMM readout v

almost there

so close...

So, back to the drawing board. When the switch is open via my app, the pull up resister should settle Vout to 5V. The other half of the scenario is fully functional, as a closed switch grounds as intended.

My next plan of attack involves a more permanent power source, and I have placed my order with SparkFun for a surface mount / wall wart combo that will do the trick. I am hoping that my issue is with the power, but time will (shortly) tell if this is the case.

Stay tuned. Getting close on this one…

Bad Lab in Action

My enjoyable night of programming my IOIO slowly devolved into a digital multimeter-needing mess.

bad lab in action

bad lab

Either I am reading the spec sheet incorrectly, or this thing is wonky. I have implemented a pull-up resister, and *should be pushing 5V. In reality, I am seeing 3.8V…something is amiss.

Back to the drawing board.

Arduino 120V AC Relay Example

I got tired of poking around with LCD drivers with my Arduino. Time for a quick project to mix it up…staring at a surge protector always puts 120V on my mind. As it turns out, I tore apart an old humidifier a while ago on my ‘workbench.’ Monday night is Katie’s reality TV night…time for something sweet.

Investigating duty cycles on this plastic fan:

fan hack

fan hack

I figured that I could horse around with my PowerSwitch Tail, and make it somewhat mimic a PWM 5V setup. I was curious how long I would have to ‘pulse’ the switch with juice to keep the fan constantly rolling. I started with it fully on, and kicked my ‘active’ duty cycles lower until I reached a nearly-continual state of motion. Pause for Arduino code snippet:

PowerSwitch Tail Template

120V AC Driver w/ LED indicator

Joseph Swanson
2011 |

void setup() {
// declare pins (13, 7) for writing
pinMode(13, OUTPUT);
pinMode(7, OUTPUT);

void loop() {
// Fire relay / LED
digitalWrite(13, HIGH);
digitalWrite(7, HIGH);

// Configure for “on” time
delay (50);

// Kill relay / LED
digitalWrite(13, LOW);
digitalWrite(7, LOW);

// Configure for “off” time
delay (950);

Pause for a small small-video break:

As that code and vid indicate, 1/20th of a second is all it took to keep the fan rolling, with 19/20th of a second idle. Not bad. Not sure what the takeaway is, but that is something to mention.

Put that knowledge somewhere safe, provided the question of humidifier fan duty cycles should spring up.

Evolution of a Project

I have two speeds when it comes to projects: percolate and bazooka. Whereas my swantron comment / to / LCD project was bazooka, this Twitter deal has been percolate. Haven’t been able to jump in completely, rather, I have been poking this one with a stick.

Still poking…

arduino controlling blue lcd

dual terminals and a terminal

Making progress…snagging my Twitter page via Python, and dumping it to LCD:

body and html closing tags on my lcd

+1 closing tags

I just need to hammer out some parsing, and I will be good to go. I really need to figure out some sweet regex and drop this whole ‘import (some junk)’ stuff. Who knows…at this rate, I just may.