Tesla Roadster Logs and Python

A few days ago I mentioned on my sustainable fuel site TheSmartDrive that I was given a Tesla Roadster to drive for a few days. I was asked to see what ECU information is available, collect and parse the data from it….enter python

Take a look at the full write up: http://mybitbox.com/articles/tesla-roadster-log-parsing/

// Ads between posts?

Salae Logic Analyzer Linux Support

Just got an email tonight with an announcement that the Salae Logic Analyzer now has support for Linux. Score! I use the Logic at work and it is really easy to use and almost essential for digital protocols like SPI or I2C.

Can’t wait to use it with my other Linux development tools; Eagle, AVR GCC, avrdude, cutecom, python terminal.

Check it out at http://www.saleae.com/logic/

Vail resorts go high tech social

This is really cool, Vail resorts is going social this ski season with their Epic Mix program. This program uses the RFID in season passes (and I am assuming GPS on your phone) to log runs and lifts taken. Being a Colorado resident with a 5 Mountain Pass this is really cool stuff. Gets me all excited for ski season.

Check out the video on their site: http://www.snow.com/epicmix/

I tried to find their android app on the Android Market but no luck, guess it isn’t out yet.

Quick python terminal

I like Python, it seems like it takes no time to make something that works.  Last night I found an example of a simple scrolling text box GUI done using Tkinter.  After an hour or so of modification it is a pretty usable terminal app. I posted the code here for everyone: http://www.mybitbox.com/mbbfiles/s1axter/pyterminal/

I am working on using this for a serial terminal. The idea is to have a program class that has a handle to an instance of this terminal, a serial port and a communication class.  If there is a local output function in the program class you can send text to the terminal rather than stdout.  Also, bind all keyboard inputs to a function in the program class and bingo, simple serial terminal.

More to come.

Music and headphones

Like I said last post, I’m going to be posting random stuff here, so get used to it.

I’m a big music fan, I am always playing something whether in the car or on the PC.  My main genre is rock and punk.  Sub genres include post-hardcore,  pop-punk, classic rock, 80s rock, hard rock, alternative rock, etc. Anything with a solid beat, good riff, guitar and good lyrics. I also like Techno, kinda an oddball but it’s high energy and goes well with coding. Right now I’m rocking some Senses Fail.

If anyone else out there likes music when they work but doesn’t want to be tethered to a desk via normal headphones, check out some bluetooth headphones.  I got a pair of Motorokr S9-HD headphones a while ago and I freakin love them. A full charge lasts for like 6-7 hours, so you can rock pretty much all day at work.  I work with car systems, so I am always working on the PC, then the car, then back to the PC.  These things don’t fall down, are light and sound pretty good, I know I am not at a live show, but they sound better than any other headphones I’ve had.

I use a version of this AZiO adapter with Windows, it works well and has a pretty good range

I’ve also used the Motorola s805 over the ear headphones, they last forever and the sound is great

Update and some python serial info

I had a realization over the past few days.  I realized there is a bunch of stuff I do that never makes it to full projects and write ups but would be pretty cool to post online for fellow electronics and software peoples.  Then I wished I had a personal blog. Then I hit myself and asked why I’m not posting here more often.  So I’ve made the decision that myBitBox is going to have more short posts on cool things rather than wait for the once every 6 month post. And I’m talking about everything, so don’t be surprised to see things on cars, software, analog hardware and even “music of the moment” when I am coding.

So I’m an embedded engineer and work with PIC processors on custom hardware.  This hardware is designed to be in cars, connected to other PIC boards, not connected to a PC.  Because of this, the communication protocol between the boards is packeted with commands and data payloads.  This works well in the system, but is kinda a pain in the ass when you want to test things from a PC. Because of this, I wrote a little terminal program in Python to wrap serial commands in packets to talk to my systems. Yesterday I was doing some research on pyserial and came across this site with a few write ups on serial packets and framing in Python.

http://eli.thegreenplace.net/2009/08/12/framing-in-serial-communications/
http://eli.thegreenplace.net/2009/07/30/setting-up-python-to-work-with-the-serial-port/

This guy has a lot of info on frame wrapping, byte stuffing and how to build a pretty robust serial receiver class, anyone who does serial with Python should check it out.

As for my python terminal program, I don’t have code I can post right now, but I do want to put something up for everyone at some point.

ATMega88 and Color TFT LCD

imga0002Holy crap! Has it really been a year? Damn, I’m not good at this whole blog thing.  Eh, well can’t keep a crazy engineer down, over the past year I have been working as an embedded engineer working on battery systems for hybrid electric vehicles, really cool stuff.  For some of my other projects take a look at my site on electric and vegetable oil powered vehicles: http://thesmartdrive.com

If you take a look at The Smart Drive you will see I have an electric car I built with friends and family back in 2001.  A while ago the speedometer started to give out in it (hey, it is a 91) and I got the crazy idea of replacing the gauges in the dash with an LCD to show speed and cell voltage.  This back burner project has started to get some traction and I wanted to share my endeavors with everyone else.  Take a look at the full article!

Formula Car Gear Circuit

VT Shift Circuit ConnectionsMy brother is senior at Virginia Tech and is a memeber of the VT Formula SAE team which designs and builds vehicles for national competitions.  This week he told me the driver was having a difficult time managing the car and knowing what gear they were in.  One of the team members suggested a shift monitor that could read an analog signal from the engine and display the current gear.

There is a poteniometer attached to the transmission that outputs voltages in different gears.  Since the transmission voltage ranges are not uniform between gears I used a ATMega8 microcontroller with onboard analog to digital converter to read the voltages and determine the proper range.  Here are the ranges (btw, there is no gear 1)

Gear 1 – Display 0 – 4.88v to 5.00v
Neutral – Display 0 – 4.40v to 4.88v
Gear 2 – Display 2 – 3.80v to 4.40v
Gear 3 – Display 3 – 2.00v to 3.80v
Gear 4 – Display 4 – 1.00v to 2.00v
Gear 5 – Display 5 – 0.26v to 1.00v
Gear 6 – Display 6 – 0.00v to 0.26v

The dash on the car has very limited space so I separated the 7-seg from the control circuit.  Seperating the 7-seg the control circuit can be in a box away from the driver and the small display mounted on the dash.

Here are a few photos of the setup http://www.mybitbox.com/gallery/gallery.php?g=vt_circuit

And also a demo video of how the system works http://www.youtube.com/watch?v=dHIJK_iaXzc

For those interewsted in the code, here is a link to a ZIP of everything.  This code compiles on linux using gcc-avr and can be downloaded to an ATMega8 using a Dragon AVR USB programmer on Ubuntu if you have avrdude installed.  Also, here is a schematic of the final circuit.

Simple Breadboard Regulator PCB

Simple breadboard regulatorI recently sat down with my new favorite Linux PCB program Kicad and developed a simple PCB for a 5V breadboard regulator.  The idea main goal for this PCB is not to develop the ultimate breadboard power supply but to learn Kicad and how to get a PCB done professionally.  I’ve done a bunch of DIY PCBs in the past with “eh” results, thus, this time I am going to get a PCB made professionally from BatchPCB.  BatchPCB is a spin off from SparkFun Electronics and combines small prototype orders into full pallet runs.  There is a few weeks lead time but if you can wait it looks like the best option for DIYers.

I’ve learned a lot about PCB design in Kicad by looking at personal sites and tutorials and wanted to share my Kicad project with others.  Here is a ZIP file with all the project files.  I also use a custom library for the parts and footprints (much easier than using pre-made ones, which usually don’t work)

http://www.mybitbox.com/browser/files/s1axter/simple_bb_reg.zip
http://www.mybitbox.com/browser/files/s1axter/kicad_libs/

Guitar amp project

Acrylic guitar ampAfter making the Standalone Voltage Regulator I decided to see what else could be made on one of the single IC boards from RadioShack.  About a year ago I built a mini-guitar amp using an LM386 audio amplifier and a small 8 ohm speaker from an old computer, you can see the post on geeksinside.com.  Since the LM386 only needs a few capacitors and a resistor I wanted to see if it can be crammed on to one of the boards.  After a bit of study the answer is yes!  This week I soldered the unit together and mounted it an acrylic box you can find at craft stores.  I plan on doing a write up like the regulator, with part numbers and part layout, however for now I have a gallery up showing the finished product.

Here is a short list of the parts I used, for the ambitious:

  • RadioShack single IC PCB
  • 100 uF electrolytic capacitor
  • 0.1 ceramic capacitor
  • 4.7 uF capacitor
  • 10 uF capacitor
  • 10 ohm resistor
  • 8 ohm speaker
  • 25 ohm potentiometer
  • 9v battery and snap
  • 1/4″ mono phono jack
  • LED

Here are a few links to simple amps using the LM386. LittleGem Amp CigarBox Amp

WordPress Themes