View Single Post
Old 05-23-2013, 06:33 PM   #42 (permalink)
jeff88
Lots of Questions
 
Join Date: Jan 2013
Location: San Jose
Posts: 665

Motor-Rolla - '01 Toyota Corolla LE
Team Toyota
90 day: 28.3 mpg (US)

Gaia - '99 Toyota 4Runner SR5 Highlander
90 day: 19.78 mpg (US)

Gaia - Round 2 - '99 Toyota 4runner SR5 Highlander
90 day: 17.3 mpg (US)
Thanks: 343
Thanked 101 Times in 79 Posts
Quote:
Originally Posted by Occasionally6 View Post
I think there may be some extra error with using separate IC's for accel. and gyro. There's some comment on that in one or more of the Sparkfun descriptions for their 6-axis boards.
So I will find an IC with both the accel and gyro then. What do you think about the MPU-6050 IC? MPU-6050 IC I found this supporting literature to go with it: MPU-6050 Lit. I can't seem to find a +/-1.5g, but I think I can live with a +/-2g. Not sure what to look for in the gyro specs though.

Quote:
Originally Posted by Occasionally6 View Post
V=IR is the basis for the proof. 10MOhm is my ballpark safe minimum resistance to avoid altering the ECM signals. It's arbitrary but based on the spec. that many vehicle manufacturers have for DMM's being used for diagnosis; >10M Ohm impedance.

The current you pull through the Arduino plus that through R2 also goes through the VSS, in addition to what is already being drawn by the ECM. Keeping the extra to a minimum minimises the possibility of damaging the VSS and avoids altering the signal that the ECM gets. I doubt it's going to be a problem though.

You might like to measure the current being drawn by the VSS (with the signal high i.e. 11V). That will tell you proportionally how much extra you are adding to it through the voltage divider.

Vout = {R2/(R1 + R2)} x Vin

5V = {R2/(10M + R2)} x 11V

Solving for R2 gives ~8M

Those resistances may be too high to get the Arduino to register the signal and you will have to reduce them. I don't know the lowest possible current it will detect on a pin. There's got to be spec. somewhere though.
I think I need to check the VSS output voltage before I go any further. Whether it outputs at 11V or 12V or 14V or whatever other #, will make a big difference in what resistors I get. I can also check the amps at the same time, so I have a control # when I start changing things. Having that # will help me determine if I am getting close to that amperage or if I am way off.

I get that when you have a 10M ohm resistor, the R2 will have to be ~8M ohms, but I don't get why you start with a 10M ohm resistor. How would a lower resistor alter the VSS? I had to write it out to make sure I understood correctly. Correct me if I'm wrong:

I assume by the way you say to hook it all up, that the ECM and Arduino will be in parallel, not in series. That means the current will change based off of resistance and that voltage will stay the same throughout. That is why we need the voltage divider. If we follow the law of nature in which an object (or energy) wants to go the path of least resistance, the higher the resistance (i.e. 10M ohms) on the Arduino side of the circuit, the more the current will want to go through the ECM. The more we can get through the ECM, the closer it will be to OEM current draw, meaning it will function properly. If we can get the Arduino to work at just a few mA, that will be best since the ECM will be really close to OEM specs.



Quote:
Originally Posted by Occasionally6 View Post
Yep. That's an expensive resistor though (I know it's the price for a pack).
Is 20 cents, not including shipping, an expensive resistor? (Seriously, I have no idea)

Quote:
Originally Posted by Occasionally6 View Post
The VSS can be a digital only pin i.e. any Arduino input/output pin, but otherwise, for analog accel and gyro input, yes.
Not sure how that works. Isn't digital on/off. If I want speed readings, I would need an analog pin to have more than just 1 or 0, right?

Quote:
Originally Posted by Occasionally6 View Post
Yes, you can use that. As it stands, it will require 9 or 10 pins on the Arduino, yes, configured as digital pins. You use 7 pins to drive each of the segments, plus 2 to switch between which of the two digits is on. (Very fast; like a movie film, the human eye doesn't register that the displays are being switched on and off.) Use transistors between the Arduino and each common pin.
Does it matter which common side LED I use? Will there be a benefit for a common anode or cathode?
So I don't get to have both digits on at the same time? Or can I do that, it would just use twice as many Arduino pins?
Transistors like this?: Transistors Is a dollar a transistor a decent price?

Quote:
Originally Posted by Occasionally6 View Post
You don't necessarily need to use an Arduino pin for the decimal point(s). If that doesn't move; wire it to ground (common anode) or power (common cathode) through a current limiting resistor. The 7 led segments also each need (just 7, not 2 x 7; only 1 digit is on at a time) resistors in between them and the Arduino pin.
Ideally, I would like to have the display show a decimal (say 7.2 or 8.4). The percent would be implied. Because of that, I would like to have the decimal point. So I can just wire it to ground or power and it will always show? A current limiting resistor similar to the 10M or 8.2M ohm ones? I'm confused does the wire between the arduino and LED need transistors or resistors or both?

Quote:
Originally Posted by Occasionally6 View Post
A way to reduce the number of pins from 7 to 4 is to use the BCD to 7-segment IC (4511) that I mentioned earlier. That converts a 4 bit binary number to the 7-segment output. You use 4 of the Arduino pins to describe the binary. eg. 8 dec is 1000 bin; one of the Arduino pins is switched high, the rest low (in the sketch), and that is fed into 4 of the 4511 pins. The 4511 IC then switches (all) the 7 segment outputs on to display the 8. With a common anode 7 segment you might need transistors to reverse the 4511 output from supply to ground. (I'd have to look at a data sheet to check how it works. I am pretty sure that it supplies current.)

If you are going to use that, you will need a board to make the circuit on i.e. a shield.
So something like this? 4511 IC Seems a little expensive, but is it the right part?

Quote:
Originally Posted by Occasionally6 View Post
Are you sure you want to use that though? The LCD display module is easier and allows more display options (any ASCII character). The only downside is it costs more.
I'm not sure what you mean by it being easier, but all I want is a 2 digit screen, not a screen that will display a whole lot of info (that's what my ultragauge is for!). If I decide to do some other project that needs a larger display, then I might consider a larger one.

Quote:
Originally Posted by Occasionally6 View Post
You will have to reset at some point; there will always be some error. The time idea is interesting. You may have a better idea if it is workable or not with more accurate knowledge of how much error there is. I suspect that a typical length trip is too long not to require a baseline reset several times throughout it. That shouldn't be a problem if you stop at least a few times or possibly travel at a steady speed for a few seconds at a time.
Obviously, that is a lot further down the road, so we can worry about this part later. For now, though, I will still consider theory. I wonder if I should do the Kalman filter to help keep the creep away between resets. Once everything is up and running, I can see if the creep is low enough for a full days trip. Or maybe I can set it up to reset in the morning before I go to work and in the afternoon before I leave work. Or I can do it after those trips (i.e. after parking at work; after parking at home, but still set on a pre-set time). My work days usually require stops at the beginning and end of the trip, but not in the middle. I use the CC almost exclusively, so speed changes won't happen often. Again though, we will have to see how in-depth we have to get once it is all setup.

Thanks for the redone diagram of the wiring. So I will have to solder on some pins that fit into the terminal onto the patch harness. From there, I can splice into the patch wires and essentially make a 'T' or 'Y' splice, one to ECM and one to Arduino.
So R1 will go to the 5V input pin and R2 goes from ground pin to ground? That would put the Arduino in series between the two resistors. The diagram can be a little misleading, I just want to make sure I have that correct.
__________________
Don't forget to like our Facebook page!




Best EM Quotes:
Quote:
Originally Posted by aerohead View Post
It has been said, that if you peel the duct tape back on Earth's equator, you'll find that the two hemispheres are held together with J B Weld.
Quote:
Originally Posted by Dan9 View Post
subscribed with a soda.
Quote:
Originally Posted by aerohead View Post
If you're burning,and someone throws gasoline on you,there will be a localized cooling effect, but you're still on fire.
  Reply With Quote