_20150110_094916

Big Sur, winter 2015

I had a couple of meetings in the SF Bay area in January, so I decided to add a couple of days to the trip so that I could return to Big Sur.  It’s a magical place, and probably my favorite road in the country.

The ocean lies so utterly expansive to the west of the crumbling, rocky mountains, and the road is mostly sharp curves and steep grades – so if you’re driving, you’re really forced to sip the view, a mere second at a time.

20150110_094938

_20150110_094907

Tent camping at Treebones Resort, Big Sur. They also have luxury yurts for rent.

_20150110_094916

Perfection.  Wish I could have stayed longer. Also wish I had taken a panorama shot…

_20150110_155946

I lucked out with the rental car – it was a brand new Golf.  It handled like a dream, racing through the curves of the PCH.

20150110_155707

It’s damn near impossible to capture the beauty of this place. My pictures don’t do it justice.

 20150110_163012

20150110_104527

South of Big Sur, there’s a length of beach with hundreds of elephant seals.
Strange, brutal creatures that make the most guttural noises.

__20150110_104836

SONY DSC

San Pedro – Ambergris Caye, Belize

I spent my 25th birthday and New Year’s in Belize.  Flying out of ATL, it’s the best value for getting some winter sun – cheaper than Florida.  The trick is to fly in to Cancun and take an ADO coach bus down to Belize City. It adds an extra day of travel, but cost less than half the price of a direct flight.

Almost everyone speaks English in Belize, the exchange rate is favorable for US currency, and the country is beautiful. It also costs way less than a similar trip to Mexico.

Anyway, I’ve finally gotten around to ripping the photos off my phone.

SONY DSC

Untouched photo – beachwalk south of town, Ambergris Caye, Belize

_20141231_164604

View from my room at Pedro’s Hotel.  They are a combination hotel/hostel with affordable prices, walking distance to downtown San Pedro.  Last year they loaned us bikes, which are the best way to get around the island.

_20150102_143426

A ‘bananango’ – the perfect mix of banana, mango, and alcohol. Palapa Bar, north of town, Ambergris Caye, Belize.

_1420229366962

_20150101_190949

Shrimp ceviche, Hurricane’s Bar, Ambergris Caye.  Unfortunately there was a shortage of conch during my visit, but the shrimp was excellent.  Best ceviche on the island.

_20141231_220024

Trash barge, covered in fireworks, shortly before the New Year.  San Pedro has a very impressive New Year’s fireworks show – much longer than most 4th of July displays!

_20150106_174557

One of the first shops you see when you get off the water taxi in Belize City.
The electronic cigarette and vaporizer market is rapidly spreading, globally.  (Pardon the lack of camera focus)

_20150104_220715

Take a close look. Yes, that’s “Blueberry Ice Cream Flavor” Oreos.  I never!

_1420086366886

Belikin, the national beer of Belize.  It’s almost like a Corona, but better.
I noticed at bars that there were lots of carpet coasters.

SONY DSC

On crimping

Ah, crimping wires! Such an exciting and useful skill to have.  But less obvious than you might imagine.

I feel compelled to write about crimping because of a recent interaction I had with a professional contract engineering team. First, they wanted to bill me over $300 for a special crimping tool. After I brought it up, they decide to waive the charge because the tool will go in their toolbox, not mine. Fine by me.

After testing it, they send me the device I had them working on. The device works fine for about two minutes before the battery dies. Due to time restrictions, they were unable to provide a way to charge the device without opening its shell, so I opened it up, connected the battery to its charger, and waited.

I had an important meeting the next day with an investor, and I was hoping to have the device ready for demo. The battery was charged – I verified voltage with a multimeter – so I figured it would be fine.

It wasn’t. I still cringe thinking about the demo I attempted. The indicator LEDs, which are supposed to flash when the device is turned on, remained silent and unblinking.

It’s pretty hard to perform electrical troubleshooting while pitching someone important, so when I got home I was able to take an analytical look at the device.  Almost by chance, I noticed the lights would activate when I gently moved one of the connecting wires.  Clearly, this was the result of a poor contact, and I just found which contact was bad: one of the leads from the power switch!

I hardly had to pull on the wire at all, and it popped out of the connector – not just the plastic housing, but the actual tin crimp connector! That’s what we call a bad crimp.

SONY DSC

Note the loose, dangling green wire (out of focus). It’s missing a terminal!

For clarity, wires for micro-electronics and prototyping are often crimped into tin crimp connectors, which are then mated into plastic housings that lock into matching plastic housings. The molex connector is a relatively large version of this general interconnect system. 2.54 mm headers are common with microcontrollers, and it’s extremely cheap to buy crimp connectors and crimp connector housings instead of paying too much for pre-fab ‘jumper cables.’

0J2541.1200

Detail view of a decent crimp using a female crimp terminal for 2.54 mm header. Image credit: pololu.com

There are two key parts to this interconnect system: first (and most importantly), the crimp connector has to be secure; second, the crimp connector must exactly match the plastic housing.

Let’s take a quick pictorial look at the crimping process.

It doesn’t take any special tools, just some $2 Harbor Freight needle-nose pliers, generic $10 Radioshack crimpers, and a pair of needle-point forceps borrowed from the biology lab.

crimping tools

Above: crimping tools, cut-tape reel of female crimp connectors, 2.54 mm header pins with female-female jumper cable

SONY DSC

Use the pliers to bend the outer jacket clips (far right end of pictured connector) into a tighter, rounder shape.

SONY DSC

If you tighten them too much, the wire jacket won’t fit. Just slide the forceps inside and loosen the circle until the wire can slide in.

Strip the wire, making sure there is only enough exposed wire to make contact with the wire clips. If you strip too much, then the excess length of stripped wire will extend past the wire clips. Slide the wire into the connector to test fit, and trim any extra bare wire if necessary.

SONY DSC

Above: too much stripped wire. Also, note the proper position of the wire jacket – it should extend slightly past the jacket clips. When the jacket clips are crimped, the connector will be secured to the wire jacket and cannot be pulled off, even if you use significant force.

Crimp ONLY the jacket clips first. I crimp once, then turn the connector 180 degrees in my crimpers and press down hard, using both hands.

SONY DSC

Half of a secure crimp. See how the jacket clips come together?

At this point, check the crimp – are the jacket clips secure? Can you pull the connector off at this point? If so, you have the foundation for a bad crimp.

Use the forceps and push the stripped wire back against the back of wire clips. Make a second crimp at the wire clips – again, rotating the connector 180 degrees in order to create an even crimp.

SONY DSC

The result? A connection that won’t fail.  I can pull on it with pliers, using extreme force, and it won’t come apart. There’s good reason the wiring connections in the International Space Station are all crimp connections.

Slide the tin connector into the appropriate plastic connector housing, ensuring proper orientation.  It should make a satisfying ‘click’ when mated properly, otherwise, it may be easily pulled out of the connector housing.

connector housing

Simple, right?

Raspi blinds project update

MicroSD cards…the bane of my existence.

Months ago, I received the cable for the inexpensive stepper motor, only to find that it could not produce enough torque without being geared. So, I ordered three additional steppers (thanks Sparkfun) that produce increasing amounts of torque – the largest of which more than triples the torque provided by the little $10 eBay special.

stepper assortment

I was waiting on the motors to arrive, expecting that all I would have to do is swap out the motor and double-check the power specs for the motor input. Five-minute job to finally get this up and running, right?

WRONG. Swapped out the motors, checked the power, and, what’s this? The damn Raspi is down! My TightVNC setup wouldn’t remotely connect to the Raspi.

I checked the lights on the board, and something wasn’t right. I dragged the old keyboard and monitor to the Raspi to see if I could get any kind of signal, but no luck.  Checked the contacts on the microSD card adapter, and ultimately plugged it into my laptop.

Laptop tells me I have to format this card before I can use it.  How amusing.  It’s corrupt.

I should have made an image of the card after installing everything, because I now have to start from scratch on the software side.  And though I took notes in an annotated log file while I initially setup the Raspi, I started running into errors the second time around, so it’s more work than I was hoping for.

Because my priorities currently lie with Quantified Vapor, I have not made the time to push through on this just yet.

(Almost had to remind myself that whenever you say ‘I don’t have time’ you are actually confusing lack of time with lack of priorities.  You make time for things that are important to you – i.e., your priorities.)

I have to go on to say that MicroSD cards are killing me. I’ve had two of them fail in my latest phone, two failed in my previous phone, and now this one failed in my Raspi.  And this doesn’t include DOA cards.

I’m pretty big on hardware, having built my first desktop PC from scratch in middle school, so I’ve bought more than my share of spinning platter HDDs.  I’ve only had three HDDs fail on me, and one of these got bad sectors because I physically knocked it off a table.  Compare HDD failure rates to microSD cards, where about 50% have randomly failed.

Maybe my body exerts some sort of crazy magnetic field that only affects my SD cards.

Raspi and internet-controlled blinds

There has been a recent surge in the availability of Arduino and other inexpensive microcontrollers great for tinkering with. About a year ago, I started playing around with a Raspberry Pi board.  At first I was going to use a Raspbmc distro to run a networked media player using an old laptop LCD screen, but ultimately I decided it would be better used solving a certain problem I’ve been experiencing.

I have these great cordless cellular shades that basically black out the living room when drawn completely closed.  At least, they were great until the mechanism inside that makes them ‘cordless’ stopped working.

It’s still easy to draw them open, but it takes a frustrating amount of time and effort to close/retract them.  You have to jiggle and coax these shades, rapidly pressing and releasing the button that controls cord mechanism inside the frame to get the cord to re-spool.

I took them apart and examined the mechanism without destroying it.  I found that you can simply cut the cord that attaches the internal spool to the plastic slider, tie your own cord to the slider, and control the new cord’s spool with a stepper motor.

blinds open

Blinds – open. Note the position of the white plastic slider (top right).

blinds closed 1

Blinds – closed. Note the white plastic slider has moved to the top left.

blinds closed 2

Blinds – detailed view. I’ve attached a length of black upholstery thread to the white plastic slider and wound it around a spool of thread as a mock-up of the stepper motor spool.

To safely control the stepper motor with Raspi, you need a motor driver board that acts as a sort of relay for Raspi’s low voltage GPIO (multipurpose) pins.  The Easy Driver board provides this function at a nice price.

SONY DSC

Overall wiring diagram, stepper motor pinout, and Raspi GPIO pinout for WiringPi.

SONY DSC

Putting it all together.

motor detail

Stepper motor hardware detail: NEMA 17 stepper motor with stamped L-bracket, Acrobotics 6 mm set screw hub, Acrobotics 1″ smooth pulley

 SONY DSC

Stepper motor installed and connected to blind slider

On the software side, you have to image the SD card with a Raspi distro, install and configure WiringPi to drive the GPIO pins, and install Nginx and PHP and setup a local webserver (I don’t need to control my blinds from outside my home, yet). Chris Rieger’s project was very helpful with software documentation for these steps, but some familiarity with programming UNIX-based systems is required.

A couple of key parameters on the controller script control the speed (and noise) of the stepper motor, as well as its range of rotation.

#motor speed (time between steps)

STEP_PAUSE=0.0001

#motor range ‘DIRECTION, TOTAL NUMBER OF STEPS’
#open

root echo ‘1 2000’ >> /var/www/local/controller_queue” >> $CRON_JOB_PATH

#close

root echo ‘2 2000’ >> /var/www/local/controller_queue” >> $CRON_JOB_PATH

The number of steps it will take your motor to perform the amount of spooling you need will depend on how you wired the EasyDriver, which has setting to split steps into sub-steps, allowing for precision control in applications like 3D printing.

Then when you press the ‘Open’ button on the controller page, the appropriate command is sent and the motor does its job.

blind controller screenshot

Screenshot from controller page

I’ll note that the visualization on the controller page needs to be changed – it’s currently based on vertical blinds, which simply rotate to open.  It’s Java-based, so I will be piecing together a solution in the coming weeks.

It’s all been tested and confirmed working.  I’ll have a brief video of it in action soon.

Unfortunately, I am stuck waiting on wiring connectors for the stepper motor – I got a defective cable and it doesn’t use standard 2.54 mm connectors.  Logistics is a drag for these sorts of projects when you live in a small town.