Lately my Celica ('91 GT Convertible, if you were wondering) has a very slight hesitation. Not really a big deal, but I'd like to fix it, and I can't quite put my finger on it. A couple weeks ago, I was driving it thinking, "I'd sure like to be able to monitor AFRs in this without having to mount a gauge". Then I looked at the clock in the center of the dash (which randomly resets itself. Probably a broken solder joint, but there's a clock on the radio...so whatever), and thought that would be a great place to display some information.... Some thinking, and googling, and I found this: https://www.instructables.com/id/Custom-OBD-II-Gauge-in-With-OEM-Look/ It's in a BRZ, and the code is written to read the data from the OBD II port, but the arduino has Analog read capability.... So after making some measurements, I ordered the exact hardware that he used (Adafruit pro trinket 5v, and 128x32 SPI OLED display). Last week I hacked up the stock radio, soldered some wires to the 4 traces for the 3 buttons (3 signal wires, one common). 20170923_185526 by Numbchux, on Flickr I had to cut a notch in the board for the wires to pass through. I might have to cut through the one trace I'm using for the buttons to get the display centered vertically in the housing. So I might have to run a wire around it, but we'll see. 20170923_185432 by Numbchux, on Flickr With the test program installed, and the first test fit in the dash piece. 2017-09-22_08-29-47 by Numbchux, on Flickr This weekend I soldered a couple resistors onto a board to give the 3 signal wires from the buttons different resistance values (so they can all be wired into the same input on the arduino) 20170924_165403 by Numbchux, on Flickr And wrote a small test program to test my oil logo, and to display the values generated by the 3 buttons: 20170923_182330 by Numbchux, on Flickr Today I ordered this bare-board wideband controller, as well as a sensor and connector https://www.14point7.com/products/spartan-2-oem and a simple voltage divider board from another source so it can convert battery voltage to 0-5v that the arduino can read. Plan is to have it display AFR, battery/alt voltage, Intake temp, Ambient temp, Coolant temp, and oil pressure.
Huge progress today....... Custom splash screen when it turns on: 2017-09-26_12-25-23 by Numbchux, on Flickr
It's surprisingly easy. I've experimented a little with simple coding, and never had much luck with it....but this is coming pretty quickly to me. The Arduino support base is really strong, and between the sample program for this display, and the program STiRobot wrote (which would probably mostly work right out of the box on most OBD II cars), I'm writing very little new code, just modifying things for my application.
14point7 Spartan2 OEM wideband controller and bosch 4.9 sensor arrived yesterday (and the Toyota O2 flange last week) 2017-10-04_08-20-50 by Numbchux, on Flickr Voltage divider just cleared customs from Hong Kong (because budget build). Then I can really dial in the calibrations for temperatures.
Shortly after that last post, I put the Celica in storage for the winter, and this project fell off my radar. Well, it's back on the road, the other cars are in good shape, so I'm back at this. I ran wires through the firewall for the wideband, and found the main body connector where I can tap into powers and signals that I want to experiment with. I did a mock-up in the car, and in the daylight, the display is too dim (especially with the top down). So I cut a window in the tinted lens. I also put an LED in there which the 14point7 controller can use to display when the sensor is warming up. 2018-05-24_09-27-09 by Numbchux, on Flickr I'm having troubles with voltage dividers. I want to be able to read battery voltage, but the analog inputs are only designed for 0-5v, so the logical option is a voltage divider. It's been done thousands of times, it's a simple circuit, and well documented. I got an "off-the shelf" arduino voltage divider (from china), but got no voltage coming out of it. So I did the math, ordered some resistors from digi-key (when I ordered the LED and resistor for the above modification), and set up my own. But again, no power coming out of it. Resistors ohm out as expected individually and together, and no voltage coming out (positive probe between the resistors, common ground), tested on the car, and then I tore it apart and bench tested it with a 12v AC/DC converter.
Woohoo... Analog Electronics 101...feels like I am back in school. As Todd asked, show us a drawing... They should all be in series between 5V and GND. Tap off in between each adjacent pair. Sum of all the resistances will determine the current (I= V/R). To find the voltage at any tap: calculate the ratio of resistance between GND and the tap point over the total resistance, and multiply by the input voltage (5V in this case). So, if you had one 80Ohm and then one 20Ohm resistor is series, the total current would be 50mA (0.05A), and the voltage between the resistors would be 1V ([20/100]*5).
Yea, seems like it should be a super simple circuit, but I can't seem to get it to work. I started with this little bastard. https://www.geekbuying.com/item/Ard...odule-Compatible-With-RPi---STM32-343459.html Seemed like a simple solution, but I could not get anything out of it. It was designed for a much higher voltage range than I needed, so I was pretty quick to give up on it. But even with my homemade setup (which I jumped right in and wired in the harness and tested on the car, and then cut out and bench tested after it didn't work) I'm getting nothing. 2018-05-31_09-30-03 by Numbchux, on Flickr Resistor tests 20180520_161925 by Numbchux, on Flickr 20180520_161850 by Numbchux, on Flickr 20180520_162022 by Numbchux, on Flickr Voltage in, using a 12v DC power supply: 20180520_162122 by Numbchux, on Flickr .02 V coming out 20180520_162138 by Numbchux, on Flickr
You could hook up the horn as another button and make it display an angry face or something each time you honk. Or as a security light and make it show a gun or whatever.
First...who the hell designed that DMM?! I cannot tell what is supposed to be a decimal, and what is a 'selection'. Anyway... Not all of the pictures are showing for me on Flickr. Also, I cannot read the color bands accurately, so I will have to trust that your assessment of the resistance is correct. So, going from the 'voltage in' pic to the '.02V coming out' pic... Did you just pick up the pos probe and move it to the other side of the resistor, or did you do something in between measurements (both probes were removed)? What do you get if you measure the voltage across the 1M resistor? Just trying to determine if you have a bad connection.
Yea, reading the decimals on that thing is a little weird. They all display all the time, but depending where you have the dial set depends which one you use...took me some time to get used to, but other than that, I like it. I don't know what's up with the Flickr links, it'll work one time, and then not the next. Here's the album link: https://www.flickr.com/photos/48523836@N06/albums/72157686180046115 It's reading 993k on one and 297k on the other, and 1290k combined. The negative probe didn't move at all between the combined resistance reading, voltage input, and voltage output. I can't tell you how many times I shuffled things around to make sure I was getting a good connection. It seemed like the only explanation, but I'm confident the connections are good.
The math looks good. 12.2V / 1290K ohms (total resistance) = 0.0000094A 993K ohms * 0.0000094A = 9.33 volt drop 297K ohms * 0.0000094A = 2.79 volts 9.33 + 2.79 = 12.12V What does the Arduino use for sensor reference ground?
This is all independent to the Arduino, based on what I am seeing, correct? Assuming such, this is just a simple V=IR circuit. Hmmm...don't know what else to say without getting a hands-on. You verified the voltage and the resistance, the rest is physics.
For the record, I haven't touched it since then. Best place to work on it is the table in the house, but with a 15 month old daughter, I don't get stuff set up unless I have some serious time to work. It doesn't have a separate reference pin like an ECU would, so it's just using the ground from the power supply. Certainly a variable. But, I originally hooked it right up to the arduino, but I've since isolated it so it's just the resistors, multi-meter, and power supply. Thanks for confirming that I should be doing it right, anyway. It was a weird day when I googled whether resistors have polarity..... I'll get back to it, sometime.
Don't use the Batt selections on the multimeter, switch to the regular Voltage measurement and I'm 99% sure it will be fine. The Batt test puts 10-20mA drain through what it's connected to (simulating a load on the battery) and measures how the battery responds. It's going to give you all sorts of wacky readings when you try to use it for what you're measuring.
Does your Arduino have overvoltage protection on the analog inputs? Otherwise car electrical systems are prone to voltage spikes that could kill unprotected analog ins. Also just FYI for future reference, you'd get more accurate measurements if the resistors were something like 100k/30k instead of 1M/300k.
I thought that, as well, but when I pulled the manual for that meter they didn't mention load testing... I went back and found a reference elsewhere: 4mA test current when in Battery Mode. Good call.
hmm...that's an interesting development. Never occurred to me. It does not have any built in voltage protection. That's part of how I picked this ratio of resistors, as the input voltage would have to get over 21V in order for the output to hit 5V. My other 0-5V input is coming from a wideband controller, so I'm not worried about over voltage there. And the rest will be reading resistance.