Tronbike Meter (TBM) 4.0.0 Test Ride

Thursday, February 25, 2010

Serial TTL to RS-232 Using a MAX232 IC

My progress has been stymied since last week when I figured out TTL Serial != RS-232 serial. I fried one of my Arduino AVR chips discovering this - DO NOT PLUG THE 5 Volt Arduino wiring into the 12 Volt RS-232 ports on a PC!

Ebay is full of these TTL to RS-232 converters too, I ordered one from Canada that has yet to get here. Kits exist at Sparkfun too, but I am rapidly learning hardware supply chains take time - ie buying ordering and WAITING - ARG!

Turns out  I need a device that can convert the Arduino's 5V Serial to 12V RS-232, and this commonly uses a driver IC chip commonly called "MAX232". Problem is there was one of these in San Rafael (30 minutes away) so I decided to do a Jameco order for a bunch of them, armed with free schematics such as these

http://sodoityourself.com/max232-serial-level-converter/

Note the Capacitor sizes vary depending on the exact version of the MAX232 you get - mine is a MAX232CPE, so my caps are 10x smaller.The chip supports 2 IO channels, like this diagram I only turned one channel on (4 wires - TTL in/out and RS-232 in/out), no flow control.

My parts showed up Monday and this AM I put them together over a 2 hour stretch (slow soldiering) and the end result worked first try!




Next time I will get the MAX233 - caps are already built in - or I'll just be sure to get a lineup of the converters in stock, 2 hours of my time is a bit $$ ;)

Packaging these parts is going to become very interesting.

Time to test some TBM code on my Alltrax Serial simulator!

Saturday, February 20, 2010

TBM 4.x Underway, Stay Tuned For Lots More...

I have finally been able to carve out some serious time to go semi-pro with my EV efforts, focusing on the gauge work with a vision for an entire line of projects and potential products.

I'm back on the "analog kick" while I wait for the serial parts to test communication with the Alltrax. Below is my Arduino port of TBM driving an LCD panel as well as a servo-driven gauge. The 5g, $3.50 servo is amazing, I recall in my early RC days these things cost a ton and were pretty hefty.  I'm also looking for a very high contrast LCD panel, the blue above is transmissive - I need something transflective. The Arduino LCD library is pretty good, but the servos driving analog might be cheaper and more functional than character displays. Running both is possible too, use the LCD for ODO, etc.

Test mounting the servo-analog gauge is performed via foam-core and a hot glue gun. I am exploring gauge face generation tools and parts too. Do note the servos normal range is only 180 degrees, so I best keep Tronbikes speed under 130 if I want any accuracy at the current scale.

As far as Alltrax integration, I learned Arduino's speak "serial" ttl, not RS-232. I have the code ported into the "arduino-0018" IDE with no place to go :) I've ordered MAX232 ICs as well as complete TTL to RS-232 boards and I am stuck waiting for them. My electronics part hardware pipeline has been disturbingly slow, order early and often is my new motto.

I have successfully built a speedometer/odometer with the Arduino using bike computer pickups/magnets, so in my grand simplification, the GPS will be the first to go. Adding logging and WIFI/network might be next, but it drives up the cost quite a bit to my goal of <$100.