Monday, February 28, 2011

555 Contest Entry - Audible Level

The deadline for this 555 contest came up very fast, so here I am wiring my blog post for it's entry right around 2am. Over the past few weeks I have been thinking and thinking, trying to come up with an awesome design that used just tons of 555 timers, but with lack of time this month and after seeing some of the other designs posted around I decided to go for something simple.

The design I am submitting is a level that can be used for any purpose where you need to find a level surface in respect to gravity. Typical levels have a clear tube full of a liquid and an air bubble that you have to visually watch. This design uses two separate audio tones at different frequencies that when a level surface is found, the two tones exactly match producing a single uniform tone. With this design, you can listen for a level surface instead of watching. The video has a brief outline of it's function.




When designing it my first idea was to generate two individual frequencies and mix them together, the results being a sounds similar to DTMF tones you hear on a phone. After testing this I realized that it didn't work as well as I would have liked, it was very difficult to accurately detect the 'true' portion of the level. The resulting design ended up working quite well using two tones that are switched back and forth by a 555 as an oscillator controlling an analog multiplexer to switch the voltages. The second 555 is the actual VCO that generates the tones. When an axis on the accelerometer outputs a voltage that is equal to a reference voltage set, the two tones being generated will exactly match and no difference in frequency is heard. To detect a 45 degree angle, you can take the z axis and either the x or y axis outputs and put them both into the multiplexer instead of the reference voltage.


I left the circuit on a breadboard as I didn't see any rule stating that the design must be a finished product, hopefully that holds true. The 555s are basic NE555 timers that I have had forever. The analog multiplexer is a 508A that came off of some old wire wrapped boards that I believe to be used in old radar hardware. The 508A is a very cool chip, it adds to the vintage of the 555s. The accelerometer is a ADXL-330, 3 axis plus or minus 3G which I happened to have on hand. Another idea originally was to cycle between both x and y axis of it along with the reference voltage in order allowing you to be able to level something in two dimensions. This proved to be more difficult to listen to so I stuck with the single axis idea to measure.


I tested the accuracy of this level to see if it was actually practical to use. I mounted this circuit to a small board and lined it up on a piece of wood. I then 'listened' for 45 degrees and drew a line on the board. Using a regular level and protractor I found that I was at 46 degrees which was pretty close. My accuracy became better in subsequent tests resulting in most of my lines being right at 45 degrees. It is cool to see that this circuit has an actual practical application.

Saturday, February 12, 2011

Vehicle Lateral Acceleration Meter

I have often been curious when driving through a sharp turn how much lateral acceleration I am able to reach. Being a Car and Driver subscriber for nearly 15 years now I am well aware of how many G's a vehicle can reach because of centrifugal force. The best vehicles with the best suspension and tires an reach just over 1G of lateral acceleration, so being a spirited driver I want to know what I am able to reach as my tires begin to chirp as I am accelerating out of the apex of a highway cloverleaf at nearly 65 mph.

You can buy inexpensive G meters that you can place on your dash that can show you and log this data along with other fun things like 0-60 times. But these devices are clunky and I hate having things stuck to my dash. In my car there is also no good location to place one. Thinking about this, it would be extremely easy to make one. Accurate accelerometers are dirt cheap, plus wouldn't it be nice to have the data overlaid on my vehicles in-dash navigation system for a nice clean look? I thought so :)

The system is very basic. I'm using a 3-axis accelerometer (only two of the three axis' are in use, the third can be used for acceleration at a later time. Now I am focused on lateral acceleration), a MAX7456 on-screen display generator, and a PIC18F2520 to make it all work.


The PIC utilizes it's 10 bit A/D converters to read in the accelerometer data from an ADXL330 which is good for plus or minus 3G. This data is then manipulated using some basic trig to remove any z-axis rotational data to eliminate false acceleration caused by body roll of the car in a turn. The PIC then sends data to the MAX7456 via i2c to generate a simple bar graph showing relative acceleration between 0G and 1G along with text of the actual current acceleration. The device was easy to calibrate as all you have to do is rotate the accelerometer exactly 90 degrees and get a reading of the earths gravity.


The video output of the MAX7456 will then be overlaid onto my in dash navigation system display. I am using a simple ntsc display for testing on the bench. Looking into the Lexus navigation system in my car I had assumed that the video would be simply composite ntsc, but this was not the case. The video from the nav computer to the in-dash display was RGB destroying my hopes of simply placing the MAX7456 inline with the nav system. Luckily there are inexpensive devices that can plug into the factory wiring harness that can accept composite video and display it on the display. Here is the video output on my bench at rest:


Here is output at 1G (device turned 90 degrees with z-axis compensation disabled):

Here is the device with me shaking it randomly.


Now I just need to get it on the pcb I am in the process of making and get it installed in my car. It has been so cold here in Michigan I haven't had the motivation to get out to the garage and get it going, but should be done soon for it's first test. Once tested the next obvious steps will be to add a datalogger and GPS to track both vehicle speed and acceleration.