Wednesday, February 20, 2008

Community Economics

Is it possible for the traditional startup / venture model to succeed when building community products? I don't know.
Looking past the bubble-inducing imagery seen in the link below, I think the "bloggers" in the following Big Idea broadcast ask interesting, albeit potentially misguided questions: http://search.redlasso.com/ClipPlayer.aspx?id=55176735-b7cc-4661-899f-f02317734444

They ask and assert:
How do you get it to the mass market? How many to sell the first year to survive? How many friends will own one? A lot will depend on pricing. The market's not big enough.
Most of these questions are off the mark, since the premise is that differentiated consumer products address a long tail of needs (not mass market). The one point I tend to agree with is pricing, since the community of DIYers tends to be very price sensitive.

After watching the video, I walked away with three impressions:
1) Hubris - why is it that every time I watch an entrepreneur, they're super confident and egomaniacal? What happened to the charismatic leaders in Jim Collins' "Good to Great"? Where are the closet geniuses, the garage tinkerers, and the purely curious?
2) Disconnection - why is it that I somehow do not "connect" with the personalities in that video? I'm a voice in the community, and I can say this much; I don't feel motivated to join them just to be another cog in the "crowd".
3) Disappointment - I work hard for my money, and I want it to support a real cause. Spending money to satisfy price premiums imposed in order to fulfill venture investor return requirements doesn't get me as psyched as it used to.

Something is missing. I wish I knew what it was. I think it's a structural problem. And somehow, I have this nagging suspicion that traditional VC isn't the right way to go for community-oriented companies. I'm inclined to think other models may be more appropriate. I wish this entry had a solution, but at the least I'm now motivated to find one.

Tuesday, February 19, 2008

Arduino Software Serial Correction

Looking through the Arduino libraries, I found "Software Serial" to be very useful. Serial communications in software (bit banging) should be checked for correct bit timing especially if multiple baud rates are used. Optimizations in the compiler, 16 bit numbers, and interrupts can create bit timing errors that will reek havok in communications.

So I decided to check out the Arduino's (receive) bit timing on a scope.

The picture below shows the receive routine (incorrect) timing,

When receiving, you try and read the pin at the middle of the bit. Which is, once you see the start bit, wait 50% of the bit time, then take a reading. Notice the middle of the scope pic above how the pin is being read incorrectly. It sampled off the edge of the bit resulting in an incorrect read on the 3rd bit.

With the corrected (fixed) bit time,


Notice the reads much more closer to the center?

That was for 9600 baud. The following code should receive correctly for bauds up to and including 14400

int SoftwareSerial::read()
{
int val = 0;
int bitDelay = _bitPeriod;// - clockCyclesToMicroseconds(50);

// one byte of serial data (LSB first)
// ...--\ /--\/--\/--\/--\/--\/--\/--\/--\/--...
// \--/\--/\--/\--/\--/\--/\--/\--/\--/
// start 0 1 2 3 4 5 6 7 stop


while (digitalRead(_receivePin));

// confirm that this is a real start bit, not line noise
if (digitalRead(_receivePin) == LOW) {

// frame start indicated by a falling edge and low start bit
// jump to the middle of the low start bit

delayMicroseconds((bitDelay/2)-25);

//digitalWrite(3,LOW);
//digitalWrite(3,HIGH);

// offset of the bit in the byte: from 0 (LSB) to 7 (MSB)
for (int offset = 0; offset < 8; offset++) {
// jump to middle of next bit
delayMicroseconds(bitDelay-14);

//digitalWrite(3,LOW);
//digitalWrite(3,HIGH);

// read bit
val |= digitalRead(_receivePin) << offset;
}

delayMicroseconds(_bitPeriod-8);

return val;
}

return -1;
}

Tuesday, January 22, 2008

Arduino Diecimila Reset Discussion

Note the Atmel's Reset pin characteristics

Also, note the brown out specs,

Monday, January 21, 2008

Arduino Motor Driving Discussion

Some people are having issues with resets when driving DC motors from their Arduinos. It has been suggested that previous Arduinos (without auto reset) are less sensitive to noise than the current ones. Lets not talk about the difference in Arduino makes for right now. Instead lets concentrate on whats happening with the motor setup and why this could cause problems. Finally, we'll suggest a proposal to reduce the noise in the circuit.

First, the different components involved are
1.) DC motor
2.) Output drive circuitry
3.) Arduino (of course)

Motor:
In it's most simple form (forgetting back EMF) the motor would look like this circuit:




The Arduino would be driving this motor with an external transistor configuration shown below using a fixed frequency and variable PWM (pulse width modulation) to control motor speed,




Now, lets put them together and we have our basic motor drive circuit,




Now lets look at how the current flows when the transistor is on,



Notice the clamping diode installed around the motor. This will help clamp any energy coming from the coil in the reverse direction when the transistor switches off.



Now that we understand the basic setup. Lets see if we can shed some light as to why resets are happening.


Lets start off with making sure we still have a clean 5v supply running the Arduino when we're running the motor...

DC motors can suck a lot of juice from the 500mA limited USB supply. Lets look at the high side of the motor's supply to make sure we're doing anything nasty to the poor USB.



The below image shows how a capacitor is used to bucket the energy.


So maybe, we should limit the capacitor's ability to draw too much current from the supply by adding a series resistor. Using a passive component like a resistor has some efficiency implications. There are much better ways to limit current through the use of active components.

For our purposes of trying to clean up the 5v supply, we can entertain the idea. See the image below.
Say for instance, the bucket capacitor is 10uF. On power up, it will take 25ohms * 10uF = 250 microseconds to charge up to 62% or 1 time constant. After that, the voltage ripple on your 5V supply should be much less than before because the current is safely limited to motor.



Wednesday, January 16, 2008

Bug Labs Packaging

Bug Labs is finally releasing pictures of their upcoming Bug modules on their website. Now more than ever we're able to see what they've spent their time working on.

These days, it takes a lot for mass produced electronics to get noticed. Usually when I look at something electronic these days, I tend to notice the outer packaging. Shopping for cell phones, mp3 players, etc. I usually go with the one that looks best.

Playing with electronics hardware has kept me busy and awake all hours of the night because there's something inherently self-satisfying about using electronics to create something. Wiring, connecting, and sometimes soldering to create projects has enabled me to learn a lot about electronics.

From the pictures, they've spent lots of time making the packaging of the modules, but it seems like they've missed the idea. How do premade and pre-packaged device allow people to make electronics creations?

Since I like to tinker, what if I don't like their screen or camera module? What do i do if it can't fit into my application? I'm just not sure I'll have enough ability to customize the modules to my liking. Where is the hardware tinkering? Everything is already done for you.

They have done a decent job at selecting some of the modules that people might like to play with, but I hope they leave something for me to do with them!

Tuesday, January 15, 2008

GPS for Arduino in less than 30 minutes!

I just grabbed a Libelium GPS shield for my Arduino, and wanted to make it work. With minimal effort (about 20 minutes), I was able to get a fully functional GPS system working - incredible. Pardon my enthusiasm, but rapid design and prototyping like this was never possible when I was in school. We were too busy making LED's blink back and forth ala nightrider - and for the adventurous - debounced button inputs ala simon. Fastforward to 2007, and you can have a fully functioning GPS-enabled accelerometer hiking / backpacking logging device in less than an hour of mixing parts together.

Without further ado, here's a picture of the GPS shield sitting on my Arduino:



I'd go into further detail about the circuit or the schematic, but there's really nothing to talk about. You just pull the board out of its wrapper, snap on the antenna, plug in +5V (red wire) to the pin tower labels "+5" and ground (black) to the pin tower labeled "GND". Set the board starting at the Arduino's pin number 8, and you're set to go.

As usual, I've posted the source code for the project over at liquidware - enjoy!

Prototyping board

This past weekend, I bought another prototyping shield from Ladyada here in NYC - but this time in an unassembled kit form. The funny thing is that it would have been much quicker to just drive down to Adafruit's headquarters downtown (from midtown) to pick it up. But the package showed up two days later, which isn't bad for NYC mail.

Here's a picture of the contents of the kit, poured out onto my desk (which is actually a small piece of cloth-covered corkboard from my old office):




I then clamped the PCB onto the "3rd hands" and began soldering away:





After only 15 minutes with the gun, and only 1 redo, I sat back and appreciated my work of art:





But it got me thinking... why not make an extender board, that allows someone to attach two modules onto the Arduino base? That way, you could put two breadboards on one Arduino, or possibly a breadboard and a GPS kit?

The possibilities would be endless... and I shall call it the "Pin Replicator Shield". I've started a project entry over at liquidware to hold my thoughts and progress on the new shield.

Saturday, January 12, 2008

Review of Bug Labs' launch

It looks like the folks over at Bug Labs have finally announced pricing, and it has been received with a giant thud. For the unfamiliar, Bug Labs is a startup based out of NY with a vision for making modular consumer electronics devices. On paper, this idea sounds great. If you look at most consumer products on the market today, most tend to consist of 4 main components:
  1. A screen
  2. An input device (buttons, switches)
  3. A power supply
  4. A functional component (GPS, MP3 decoder, Wifi, Cell phone, etc.)
If you can standardize the first 3 components, the 4th is effectively the primary differentiator of a consumer electronics device, and why not make it modular enough to plug-and-play and upgrade over time? The vision for consumers may be a modular device that they can build from components as they desire.

Sunday, January 6, 2008

Arduino Hardware Playground

Just the other day I picked up my first Arduino.

The first thing I did was rush over to the Arduino website and start browsing around. In search of ways to play with it, it didn't take me long to stumble on this section,

http://www.arduino.cc/playground/Main/InterfacingWithHardware

Wow! I could not believe how many hardware devices there are here. Tons of contribution to this area has really expanded the capability of my $30 Arduino. Definitively well spent cash.

It's so unbelievably easy to use one of these things. Take for example, you want to print out a number to PC via the serial port, you don't even need to do any processing at all on the bytes to get it into ASCII form -it's all done for you.

void setup()
{
Serial.begin(9600);
}

unsigned char num;

void loop()
{
Serial.print(num++)
}


This may seem silly to write about, but I'm used to writing tons of support code to make this soft of thing work. It really is plug-in and "play"!

Tuesday, December 25, 2007

Arduino with Radio Shack Parallax accelerometer

I think the theme for today will be rapid prototyping and speed. In between Christmas celebrations, and holiday movie re-runs, I've run back to my room to whip together some circuits. It's insane how easy it is to build functioning devices with the Arduino! Case in point: ~30 minutes tops to build a fully-functioning hand-held accelerometer driven device.

I started with the Parallax accelerometer, which I picked up from Radio Shack. The full name is "Memsic 2125 Dual-Axis Accelerometer".




Using the two diagrams above as the theory, and borrowing code from the Arduino community (special thanks to Marcos Yarza for the initial code, which I've cleaned up below). The first step was the wire up the chip to the board. That was easy, since the kit comes with a pinout sheet: two pins are tied to ground, one to +5V, Tout is ignored for now, which leaves Yout and Xout. Xout and Yout are PWM outputs that, according to the second schematic above, output a variable width pulse based on their reading. I wired it up, and then read the values out to the serial port:



Once I had ranges for the values, I got a little creative and threw in some condition "if" statements, tied to LEDs on the prototyping board. Now, an LED should illuminate whenever the board is tilted in that direction:



Here is the source code I pulled together. I moved around some of the original code, to make it more cut-and-paste-y into your own projects.

Arduino with Radio Shack Parallax motion sensor

Well, that didn't take long. It's been less than a week, and I'm already feeling quite familiar with the Arduino platform. I just mashed this circuit together in less than 5 minutes (in fact it took longer to video tape than it did to make)!

I picked up the new Parallax motion sensor circuit yesterday for $10 from Radio Shack. Parallax has done a great job of making these chips accessible and easy to use by making the documentation available online. I would recommend all parts vendors to be this accessible, in fact, since it makes circuitry approachable to the novice, and reduces headaches for experts too:







Here's a video of the motion sensor "in action" (pardon the pun):



The device only has 3 pins: one that connects to ground, one that connects to +5V, and a signl pin that I've connected to Arduino pin 8. Then, I've connected an LED to Arduino pin 5, which I turn on for a second whenever the motion sensor is triggered. Here's the source code.

Arduino with Parallax Sonar sensor

Yesterday, I picked up one of the heavily-advertised Parallax PING Ultrasonic sonar sensors from Radio Shack, and wanted to see how easy (or difficult) it would be to get operating with the Arduino. As it turned out, it was incredibly easy - in fact, it took less than 15 minutes of coding to get operating, and all I needed was the PDF spec-sheet from Parallax:


I plugged the sonar module into the top of the breadboard, wired ground, wired +5V, and then connected a wire from the signal port to the Arduino's pin 8. 15 minutes later, here's a video of me moving the sensor towards and away from my laptop's monitor:



After I wrote my own code, I found a slightly more elegant way to wait and count the length of the return pulse - there's Open Source community in action - thanks!

Anyway, here's my code - I've uploaded it to Liquidware.