Two MCUs reading the same analogue sensor? - Page 1
Forum section: electronics / general

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 06:34:15 am
content: Hello, first post, please be kind. I'm working on a vehicle project where I use a second MCU to read the existing sensors in the vehicle. I'm wondering how I can implement spike protection as well as an extremely high impedance maybe a buffer. Any ideas how I should go about this and pointers to good reading?

author: SL4P
author_rank: Super Contributor
timestamp: January 21, 2016, 06:52:25 am
content: Without more information on the exact car and sensors, it would probably help to start looking at OBD-II interfaces and projects... perhaps start with an Arduino to get your feet wet.

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 07:34:35 am
content: It's a very early 1990s Toyota, so no OBD at all. I think what I'm asking is more along the lines of how to read 0-5v analogue inputs without dropping the voltage so as not to affect the other MCU, but at the same time having current surge protection.

author: SL4P
author_rank: Super Contributor
timestamp: January 21, 2016, 07:38:14 am
content: ok, then start thinking short run high impedance inputs - so not to load existing circuits, but also consider some buffering that will minimise spikes/interference getting into the combined modified circuits.The existing sensor circuits will probably be pretty low impedance, so you want to piggy back without causing any variation...Remember that modifying car circuits can introduce dangerous operating conditions.

author: AndyC_772
author_rank: Super Contributor
timestamp: January 21, 2016, 08:04:11 am
content: ...but can also be educational, fun, and profitable. Nobody ever learned anything by being too afraid to experiment.A 0-5V signal is probably quite low impedance, but it doesn't really matter too much either way.On the input to your device, connect the signal to the high impedance input of an op-amp configured as a voltage follower.For protection:- put a 1k resistor between the connector pin of your device and the op-amp input. This won't affect the input voltage at all because the op-amp itself draws essentially no current, but will limit the current that can possibly flow into your device from the external source.- connect a pair of Schottky diodes between the op-amp input and its power and ground pins. This prevents the input going more than about 0.2V outside the supply rails, which won't damage anything.- to capture and limit fast transients, also consider fitting a Transient Voltage Suppressor across the input. This is a belt-and-braces approach; a TVS diode responds very quickly and can dissipate large amounts of power, albeit for short durations.

author: SL4P
author_rank: Super Contributor
timestamp: January 21, 2016, 08:08:24 am
content: Quote from: AndyC_772 on January 21, 2016, 08:04:11 ambut my workbench can't do 250km/h !(well I haven't actually tested it!)

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 08:29:00 am
content: Actually 250 is the top speed of my car, but I only plan on taking it to 100. Naturally I would keep away from injectors, timing and ABS systems while I'm a noob. Thanks Andy, that's about what I was imagining, but I was hoping someone with experience could give the nod of approval. Do you think a capacitor/resistor in there as well would be of any use since I plan on running wires up to about 3 meters long from the sensor so I imagine from my research I could get ring in? Is that right or am I off my head? Sorry I'm very beginner but I like to get my hands dirty. I haven't heard of a TVS diode I will do some research.

author: SL4P
author_rank: Super Contributor
timestamp: January 21, 2016, 08:33:12 am
content: I wouldn't addanyextra components on the (short wire) sensor side of the buffer/op amp as this may affect the value being sensed by the OEM computer.

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 08:41:01 am
content: That's what I don't quite understand. How do I use an op amp but at the same time protect it from surges... Edit: just reread Andy's post, I think it's sinking in now

author: SL4P
author_rank: Super Contributor
timestamp: January 21, 2016, 08:42:32 am
content: sorry, I should have been more specific... TVS etc are ok, but nothing that will 'modify' the sensor waveform.e.g. TVS are effectively open circuit until they kick in... I.e no loading on the circuit

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 08:50:49 am
content: Thanks everyone, I think I've got it now. Inline resistor and diodes before the op amp, then filtering and whatever in between op amp and MCU. Let the experiments begin. If I don't return to the forum again tell mum I love her.

author: AndyC_772
author_rank: Super Contributor
timestamp: January 21, 2016, 10:09:01 am
content: Quote from: bearded_badger on January 21, 2016, 08:29:00 amI'm not "approving" anything, other than the very general principle that learning by experimentation is a good thing when done safely.

author: bearded_badger
author_rank: Contributor
timestamp: January 21, 2016, 01:35:15 pm
content: I meant the two diodes, that's what I was thinking, it's like you read my mind. But your disclaimer is noted also.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: January 22, 2016, 04:14:31 am
content: Engine failure on a car is no big deal; it's not an airplane, you don't fall out of the sky because the engine doesn''t run.In terms of piggybacking something like a temperature sensor (with a temperature-dependent resistance), there may be a possible hiccup:A temperature sensor may be placed in series with a reference resistor, thus forming a voltage divider. The voltage output of the divider is measured, and with knowledge of the reference resistor's resistance, the unknown sensor's resistance can be determined.Sometimes, an ECU can be built to swap reference resistors as an "autoranging" function, to get the best accuracy over a wide range.From the outside, if the reference resistor is being automatically changed, then it will be hard to know what's going on...