8.8v differential

Status
Not open for further replies.

Detroit_Aristo

Well-known member
So, I have a digital dashboard for my car that takes a serial stream. I have the serial stream sorted and it's working when monitoring on my PC via their software.

When I hook up the DB9 to the dash, with just Rx and Tx, it does not register the signal.

A wise man told me that I need pin 5 on the DB9(gnd) to be connected to the Teensy's ground.

Before I hooked the gnd up, I tested the voltage across gnd from the teensy and gnd on the db9 leading to the 12V dashboard. The differential was 8.8VDC.

Will hooking the ground up melt my teensy?
 
Yep

Are you doing anything to convert 3.3/5V logic to RS232 ~12-15V logic?

If you don't that may already be toast.

If you already have a level converter then you need to sort out what your PSUs are up to, since it sounds like your positives are commoned (+12V and +3.3V are the same, making 3.3V gnd and 12V gnd 8.7 volts apart. Does your car happen to have +12V as the chassis?

Do not believe this is the case, but if your PSU is just floating towards the chassis potential try connecting a ~5k resistor between the gnds and seeing if the shift to the same potential (ie, no voltage across resistor and thus no current flow)

If the design of your power system does not allow you to get a common gnd you may need to add optoisolators to your system, either on the RS232 side or the TTL side whichever works. Which may not be a terrible idea anyway due to the noise suppression you gain from that in the car enviroment.
 
Right now, I am using a linear dc power supply. All the components are on my bench here. I don't understand why the serial connector on the dashboard and the ground on the teensy (connected to USB on my PC) are so different. I thoguht Ground was ground was ground.

Luckily, I haven't connected the ground yet, so the Teensy is still fine. I haven't let out the magic smoke yet.
 
IMG_0033.jpgsome cars have different voltage and not common grounds, like the cluster and hvac in my car, the led outputs are about 2 volts, from the led contacts. however, if you use chasis gnd, when led is off, theres a 12v feedback
 
Actually gnd is not gnd, it's just an arbitery position in a voltage scale and unless they are tied together by design can be quite different, especially for mains powered equipment that may float them high enough to give a tingle if you touch them. An example I like to use is if you have a insulated bench with a battery sitting on it and a multi meter with the black lead on the building gnd, you can measure 0 volts on both the positive and negative ends of the battery because there is no gnd reference for the voltage within the battery, so it's potential difference moves each time you connect the lead. If you connect two grounded meters at the same time you measure half the battery voltage on each. Ground as 'stake stuck in the soil' will be different in difference locations as well, which can be interesting for phone and power services before optic fibres when they had >12 volt differences between stations being controlled via relay logic.

So re your test bench it looks like your PC and bench power supply have different methods to produce gnd. Desktop PCs normally use power socket gnd or close to, laptops often float at 1/2 mains and often have a ripple on it for good measure. If the 12V supply is a proper bench version it will be isolated by design, but should be safe to gnd to your PC since that's the whole point of isolated bench supplies (allow arbitrary gnd connection, say if you want a -Ve supply you just gnd the +ve output). Would suggest the resistor check first just in case it's using a cheaper PSU that isn't fully isolated.

Same issue can come up when trying to connect an osciliscope gnd, or if you need to connect the same device to two different devices via USB ports. reasonable potential for an initial spark as things equilise and potential for a steady leakage flow between the gnds.
 
I am still really confused.

The Teensy is running off the USB connector (desktop. PSU connected to AC). That's +5V/Gnd(via USB port).

The Digital Dashboard is running via a linear power supply (12V/Gnd(Via front connectors).

Both the computer and the linear power supply are plugged into the same outlet, so the mains are tied.

I have been searching for two days on how to test potential between one circuit and a second circuit. Seems I can't find an answer.

I need the Serial.write(message) to send a serial stream to the dashboard from the Teensy (3.6) (connected to the desktop PC). The DB9 has Rx/Tx and GND. Can the GND from the dashboard be tied to the ground on the teensy without harming the teensy? How can I test for isolation? When I put the positive test lead form my DMM on the Teensy ground, and the negative test lead from my DMM on the gnd pin of the DB9 that's connected to the 12V dashboard, it shows 8.8V. Is that normal? Is there anyway to explain this to a layman? I can write code like a madman, but when it comes to circuitry, I am flying a bit blind.

I'll order anyone who helps me a pint.. or a Tall-Dog board or anything. I just don't want to melt this Teensy. They are not something I can just zip up to the store and replace.

Here's a picture(s)!
PSU_small_zpsm84tve1n.jpg

complete_layout_small_zpspmvxvbtp.jpg

db9_from_Dash_zpsdnjvwy63.jpg

dash_bigger_with_db8_zpsnc2uqvbf.jpg
 
Ever hear the phrase potential difference? The problem you have is the voltage is not the absolute level of the point, but the difference in electrical potential between that and something else, usually ground.
Think of 12 volt batteries. If you wire them in series each battery still has 12V across it, but together they have 24V. But if you have 2 batteries completely unconnected from each other and you try and measure the difference between the positive of one and the negative of the other you'll read 0, not because there is no difference but becuase they're un-relatable.

The Idea of ground in a circuit is simply the place we expect all the electrons to flow from/to; its name comes from the actual ground, which you can stick a big old peice of metal into to use. But it's not that it has zero potential, it's that we're using it as our reference point and for our circuit any greater voltage is positive and any lesser is negative. You could call the positiver terminal of your battery ground, and the negative terminal -12V if you liked; it matters not unless you go swapping the cables round!

The problem here is that two circuit's ground (or reference voltage) can be quite different. One's can be at a singificantly higher potential than the other, often DC supplies are isloated from their AC sources; so two supplies might both run from the same mains (or even the same socket) but there's actually no direct connection between the reference voltages. And because they're generated from 110/220V there's no reason why you're 5V supply couldn't be the 5 volts between 100V and 105V, and the other being -20 and -15V. Hence you can get quite the tingle if you personally make the connection, and you can quite badly damage electronics.

The soloution is just to tie all your grounds together, preferably before you turn it all on (otherwise it can spark a bit). The direct connection between the ground will force the voltages to be relative to the same ground and the problem goes away. For extra caution you can do this and measure all the voltages before plugging in the teensy, and it's a good idea not to run the connections through the teensy - dont use the teensys ground pin to tie all the supplies together, use the breadboard.

From then on you can use the teensy's usb to communicate with your pc to your hearts content, subject to the maximum baud rate.
When interfacing the teensy to other devices, be sure to check that the device wont send to great a voltage to the teensy's pins. You'll need to check the datasheet of the dashboard to see what voltage level is used for its serial. If it's greater than 5, you will have to "level shift" between the teensy and the dash.
 
It works.

Well, it gets data. Something's not quite right however.

The PC software shows the test pattern (RPM from 100 to 5,000 over 10 seconds) and the speed pattern, but the dash isn't decoding properly.

Thanks Edward for the sagely advice.
 
Further to the previous post, you will notice that your power supply has a gnd post in the middle. That will be tied to mains gnd with the two power terminals transformer isolated. Idea is that you can elect to gnd +,-v or even some other point in your circuit (say because you need a waveform centered on gnd going both negative and positive). In your case running with a link (A small bar may be part of the PSU accessories) between -Ve and the gnd terminal will reference everything to the mains socket gnd, assuming that is what your PC also has.
 
Well that sounds like progress! If you're sure that you're teensy and dash are happy communicating together (same voltages) then there's other things to check.
If you've got data coming through but it's nonsense check the UART settings are the same: speed, stop bits, flow control, baud rate; and obviously the code in the teensy - which you can post if you'd like use to have a look at it :)
 
When I put the positive test lead form my DMM on the Teensy ground, and the negative test lead from my DMM on the gnd pin of the DB9 that's connected to the 12V dashboard, it shows 8.8V. Is that normal?

That's normal for RS-232 signals. Even if the grounds are the same, you should NOT directly connect such a signal to Teensy. It needs to be converted from RS-232 levels to what's called "TTL level". The simplest way is with a product like this:

https://www.amazon.com/Ultra-Compact-RS232-Converter-Male/dp/B00OPU2QJ4

RS-232 is one of many (and perhaps among the oldest) ways signals are sent over longer distances. Almost all digital logic chips use TTL or CMOS level signals, where the voltage changes from 0 to 3.3V or 5V. But TTL level signals aren't good for long wires. RS-232 tries to allow long wires by using a larger voltage with limited bandwidth. The transmitter circuits used to convert to higher voltage also limit how fast the voltage can change, which is still plenty fast enough for normal (fairly slow) baud rates. The receiver circuits reduce the voltage back to TTL level, and can reject circuit types of high frequency interference. Certain types of interference can disturb the voltage slightly, so using a higher voltage allows a lot more margin before such interference can corrupt your data. RS-232 is an old but still widely used technology. Modern ways usually involve a pair of wires. Of course you don't need to know these details, only that the voltage needs to be converted from RS-232 levels down to TTL levels, but sometimes knowing why higher levels are used can help.
 
Thank you all for the words. I do appreciate them.

I am ordering the RS232 to TTL converters. I think that the dashboard is expecting 0 to 5V.

I am positive the configuration is correct. It's just the logic levels that are wrong.

Fun fact.. I used to have to flip dip switches on my 9600 U.S. Robotics Parallel modem to configure it. I am pretty solid on the software stuffs. The hardware is what I am learning.
 
Status
Not open for further replies.
Back
Top