Shop OBEX P1 Docs P2 Docs Learn Events
Using the BS2 for auto gauges? — Parallax Forums

Using the BS2 for auto gauges?

jknightandkarrjknightandkarr Posts: 234
edited 2009-05-12 06:36 in BASIC Stamp
I"m fairly new to microcontrollers & have a question. Can the BS2 be used for creating Automotive gauges? Specifically the Speedo, Tach & an odometer, as well as other gauges. If so whats the best way to go about making them? Thanks

Joe

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-04-11 03:47
    Your question is way too broad to answer. Yes the bs2 can be used to read and display data fron an engine and other sensors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-11 07:47
    I know I cant to run LED displays, I guess first step needs to be designing the circuit itself then go after programing?

    Joe
  • AmaralAmaral Posts: 176
    edited 2009-04-11 11:54
    First Thing is knowing what you want !
    once the "need" is listed, start aproaching the problem one part at a time.
    Finishing it is to design you circuit board and join everything.

    but , About the question.. Yes, BS2 is capable of mesuring speed, distance and a whole bunch of sensors , but it is a single task microcontroler, witch for automotive purpose is not a problem since the mesurements taken can be so fast that you wouldn´t note that this is not happening all together !

    If you are planning to start with Microcontrolers ,, BS2 is the right place, it´s tutorials and materials for self learning is just amazing !

    Amaral
  • autotechautotech Posts: 4
    edited 2009-04-11 23:21
    Try thinking out side the box. What is speedo, tac to the automotive computer. pulse vs time or hz. Note danger bs2 only input is dc 0volts or 5volts. on or off.
    (VSS) Vehicle Speed Sensor is an a/c signal up to 30volts. Ref books can be found at parallax. Whats a mircocontroler and Basic analog and digital. Very good place to start.
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-11 23:26
    I have the homework board, I know what I want to do designwise, I got non-microcontroller designs already, I'm looking at alot of options though. I really do require an odometer, I got one set up, but the guy who designed the system, they aren't very reliable, some say they are, others think they aren't. I choose not to trust a setup if the tach reads negative rpms.... esp when the engine isn't running.
  • Radridz3Radridz3 Posts: 49
    edited 2009-04-12 06:38
    Some tach's will read negative when theres no signal going to it. But should be accurate at idle 600-1100 or whatever. I have done this project with 2 separate bs2's And 2 graphic Lcd display's getting the code correct was the hardest part. This setup is on a dash in a boat and I monitor 3 temps...AIR...WATER....Engine...Also measure Tach ,Speed, G's, tilt , Speed with a gps module. My LCD's look way sweet on a boat dash...If your asking its a 73' Glastron with a Merc 2.5xtreme dry sump and full hydraulics. The project I'm working on now is a dual pressure sensor for hydro pressure. It's a really tough 1 for some reason. The odometer I cant really help you on. I use a digital hour meter instead...Just keep the questions coming and this forum is real good about answering them...Good Luck and remember set a game plan and do each part 1 at a time then intergrate everything when its all said and done. First you need to figure out how you want to view all your data...
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-12 15:27
    I think by how I want to view data I think you mean how it needs to look when complete correct? I've got that done as well as final layouts, but i want speed in MPH(KPH selectable), with a 000,000.0 odometer w/trip odometer ran from my 89 Trans-Am VSS. Tach just rpms with a readout starting at the 10's digits to 1k digits, and various sensors & such like Volts, water Temp, Amp(bargraph & numerical read out, Fuel Level, Oil pressure, Fuel Pressure as well as other options in numerical read out form. I litterally want to be able to know what my engine is doing from any point. lol I got all my bargraph gauges figured out using an LM3914/15's It's maily the numerical readout parts I'm havine throuble with. I just want accuracy. The other plans I mentioned are NOT reliable. I've heard this from many many people & seen them first hand. Some of this guys customer cars, some gauges flat out never worked, and the plans of his I have are his outdated old designs. I have a few project vehicals for me & some friends who want me to build them gauges, but accuracy as well as reliability are a MUST.

    Joe
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-19 17:16
    Ok, I've been thinking on my odometer & heres what I've come up with. I think the pulsin command will work along with count. Now my test bench speedo has 1,001 printed on it. I think that means it takes 1,001 pulses to advance the odometer 1 mile? If thats the case, wouldn't the math be something like Odometer=Pulsin/1001 for 1 mile readings or (Odometer=Pulsin/100.1 if I wanted tenths of a mile included) wouldn't I? Also I was thinking of using the Intersil ICM7243B LED AlphaNumeric Display Driver IC to operate the 7 Common Cathode Numerical Displays (000,000.0) off of my BS2. Would this work well?
  • FranklinFranklin Posts: 4,747
    edited 2009-04-19 17:35
    Just remember you are working with integer math on the BS2 so /100.1 won't work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • bdbbdb Posts: 30
    edited 2009-04-20 15:36
    For some ideas, Parallax has 2 books (available online) for the courses for Process Controls and Sensors.

    For example, Process Control has a tach - but I wouldn't use that with your fan as you'd need to be within an inch or so of the moving fan.
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-25 21:23
    Thanks everyone. I think I got the programing figured out. Do any of those books cover adding an external EEPROM? I friend of mine suggested using one to hold the memory on the odometer safe, so it wouldn't get lost.

    Joe
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-04-26 17:07
    Of course, as a very general answer, you can use a BS2 to make automotive gauges.· Surely that is the most expensive possible way to make automotive gauges, though, isn't it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-04-28 16:17
    I got that answer long ago. As for me using the BS2 for my gauges, probably, however I don't have a kit to learn the pic micro nor the cash for a pic microcontroler set up. I'm mearly using what I got to start with.

    Joe
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-04-28 16:55
    This thread kind of takes me back to about 1997 when I converted a 1980 Pontiac Grand Prix to a digital dashboard. I had been inspired for some time by an article in Popular Electronics (1982?). I drew from the concepts used there and created each gauge using and ADC with parallel output. Each output was connected to a latch on the data bus for a Z80 system. Likewise each gauges display was connected to and output latch into decoders. All the Z80 had to do was read each ADC, calculate the value and throw it onto the display. There were some additional indicators on certain gauges driven via external latch as well such as low fuel, oil pressure, temperature, etc. I also had the ability to dim, blink or turn off a gauge display, including the LED bar behind the bezel which lit up the name of the gauge. Speed was derived from a hall-effect pickup and handled by a counter. I did store the odometer values in a Dallas battery-backed SRAM chip. Both the Tach and Speedometer had analog gauges as well driven from the analog going to the ADC. I remember using a frequency to voltage converter IC back then. Anyway, my point in bringing this up is that the entire system could be run off the BASIC Stamp 2 given how much was really done in hardware.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-04-28 18:57
    I'll bet it was fun, too, Chris. I consider that an adequate reason for doing it. Fun is often expensive -- but without fun, why live at all?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-03 19:12
    Since I have the Homework & cannot replace the chip, nor would I want to anyhow. What is the maximum input voltage the I/O ports on the BS2 can handle? According to my book it can supply up to 20 mA of power to each circuit from P0-7 & 20 mA to P8-15, and can take in 25 mA, I assume that to each pin or total across pin 0-7 & 8-15? Now what about voltage? I'm ready to hook my vehical speed sensor up to the VSS buffer that came from a junk car & from the buffer to my BS2 & don't wish to blow it when I test my odometer or speedometer programs. Please help.

    Joe
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-03 19:14
    Franklin said...
    Just remember you are working with integer math on the BS2 so /100.1 won't work.

    Is there a way to get the BS2 to use integer math or is there an alternate BS2 series chip that will use it?

    Joe
  • Craig EidCraig Eid Posts: 106
    edited 2009-05-03 19:34
    You can manipulate the BASIC Stamp's integer math to perform quasi-floating point math by using the Multiply High (**), Multiply Middle (*/) and Modulus (//) binary operators. See the PBASIC Syntax guide for more information. You can also·do floating point math with the floating point copressor listed here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-04 19:45
    According to my book the basic stamp 2 can store values up to 65,535. Can any of the other chips go higher or are they all limited to 65,535, or is there away around this like using an external EEPROM?

    Joe
  • Craig EidCraig Eid Posts: 106
    edited 2009-05-04 21:03
    The·BASIC Stamp can manipulate 32 bit words in a calculation and can store a 32 bit value in external EEPROM.·Storing the 32 bit word requires a minor amount of additional code·to parse the number into 8 bit segments. The Multiply High (**) binary operator will access the upper 16 bits of the 32 bit word.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-04 21:10
    Thanks.

    Joe
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-11 06:42
    Ok, after a problem with my buffer, I got my BS2 to act as a speedometer, but I noticed that as the speed of my drill on my test bench increased, at a certain speed the reading dropped down. I guess the BS2 can't read the signal from the buffer as well as it can on slower speeds. Is there anyway to fix this? I've included a copy of my starter program. I need this issue fixed before I can calibrate the speed reading. Then I'll continue on to removing the readings from the computer screen & onto my digital dash.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    Pulse PIN 15
    vss VAR Word
    Mph VAR Word

    DO

    COUNT Pulse, 1000, vss
    Mph=vss
    DEBUG HOME, " MPH = ", DEC Mph

    LOOP

    Thanks

    Joe
  • Craig EidCraig Eid Posts: 106
    edited 2009-05-11 17:41
    Joe,

    Review this posting on High resolution RPM code for an alternative using the PULSIN command.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-12 00:16
    Thanks once again.

    Joe
  • Craig EidCraig Eid Posts: 106
    edited 2009-05-12 00:59
    Joe,

    It sounds like you are making good progress on your digital dash. Keep up the good work!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • jknightandkarrjknightandkarr Posts: 234
    edited 2009-05-12 06:36
    Thanks. Now that I got the stupid Vehical Speed Sensor Buffer to send a signal without my stock Trans-Am 89 Speedometer being connected, lol.gif I can get progress done. Thanks again everyone!

    Joe
Sign In or Register to comment.