Author Topic: Two MCUs reading the same analogue sensor?  (Read 3568 times)

0 Members and 1 Guest are viewing this topic.

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Two MCUs reading the same analogue sensor?
« on: January 21, 2016, 06:34:15 am »
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?
« Last Edit: January 21, 2016, 06:38:18 am by bearded_badger »
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Two MCUs reading the same analogue sensor?
« Reply #1 on: January 21, 2016, 06:52:25 am »
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.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Re: Two MCUs reading the same analogue sensor?
« Reply #2 on: January 21, 2016, 07:34:35 am »
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.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Two MCUs reading the same analogue sensor?
« Reply #3 on: January 21, 2016, 07:38:14 am »
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.
« Last Edit: January 21, 2016, 07:40:22 am by SL4P »
Don't ask a question if you aren't willing to listen to the answer.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Two MCUs reading the same analogue sensor?
« Reply #4 on: January 21, 2016, 08:04:11 am »
...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.

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Two MCUs reading the same analogue sensor?
« Reply #5 on: January 21, 2016, 08:08:24 am »
...but can also be educational, fun, and profitable. Nobody ever learned anything by being too afraid to experiment.
;)  but my workbench can't do 250km/h !
(well I haven't actually tested it!)
Don't ask a question if you aren't willing to listen to the answer.
 

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Re: Two MCUs reading the same analogue sensor?
« Reply #6 on: January 21, 2016, 08:29:00 am »
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.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Two MCUs reading the same analogue sensor?
« Reply #7 on: January 21, 2016, 08:33:12 am »
I wouldn't add any extra components on the (short wire) sensor side of the buffer/op amp as this may affect the value being sensed by the OEM computer.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Re: Two MCUs reading the same analogue sensor?
« Reply #8 on: January 21, 2016, 08:41:01 am »
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
« Last Edit: January 21, 2016, 08:42:39 am by bearded_badger »
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Two MCUs reading the same analogue sensor?
« Reply #9 on: January 21, 2016, 08:42:32 am »
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
Don't ask a question if you aren't willing to listen to the answer.
 

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Re: Two MCUs reading the same analogue sensor?
« Reply #10 on: January 21, 2016, 08:50:49 am »
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.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Two MCUs reading the same analogue sensor?
« Reply #11 on: January 21, 2016, 10:09:01 am »
I was hoping someone with experience could give the nod of approval.

I'm not "approving" anything, other than the very general principle that learning by experimentation is a good thing when done safely.

Offline bearded_badgerTopic starter

  • Contributor
  • Posts: 13
  • Country: au
Re: Two MCUs reading the same analogue sensor?
« Reply #12 on: January 21, 2016, 01:35:15 pm »
I meant the two diodes, that's what I was thinking, it's like you read my mind. But your disclaimer is noted also.
 

Offline pmbrunelle

  • Regular Contributor
  • *
  • Posts: 183
  • Country: ca
  • lost mech. guy
Re: Two MCUs reading the same analogue sensor?
« Reply #13 on: January 22, 2016, 04:14:31 am »
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...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf