Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Trying to add switching transistor to my diagram

Status
Not open for further replies.

iso9001

New Member
Hi,

I'm using a pic to read in a square wave at 8V... To do this I'm running though a resistor and then spliting to my pic and a zener diode connected to ground. End result is that my pic can see 0V and 4.5V for the high of the wave.

Now I've decieded I want to also transimit on the wire the wave is coming in on. I plan to wait for a long silence and then begin transmitting via turning the pin high and low, creating my own wave on the wire I already have coming in.

My problem is I have no idea how to send 5V out of the pic and have it go into a transistor of some sorts, and then have an 8V signal get into the square wave wire.

A problem I see is that I believe I will be cutting my own signal down with my resistor/zener setup that I need to read the signal in.

Ideas ?
 

Attachments

  • putwhatwhere.gif
    putwhatwhere.gif
    3.8 KB · Views: 1,045
iso9001 said:
Hi,

I'm using a pic to read in a square wave at 8V... To do this I'm running though a resistor and then spliting to my pic and a zener diode connected to ground. End result is that my pic can see 0V and 4.5V for the high of the wave.

Now I've decieded I want to also transimit on the wire the wave is coming in on. I plan to wait for a long silence and then begin transmitting via turning the pin high and low, creating my own wave on the wire I already have coming in.

My problem is I have no idea how to send 5V out of the pic and have it go into a transistor of some sorts, and then have an 8V signal get into the square wave wire.

A problem I see is that I believe I will be cutting my own signal down with my resistor/zener setup that I need to read the signal in.

Ideas ?

First thing, you don't need the zener diode, the PIC inputs have clipping diodes to supply and ground - so you simply need a series resistor, personally I'd use a higher value resistor though.

Transmitting on the same wire depends on how it's connected elsewhere, as long as it's connected via open-collector drivers with a pull-up resistor you could easily do it with a single NPN transistor and one resistor.

If it's not done in that way it might not be possible, you really need to post the circuit diagram for the other end. You also, obviously, need to implement a suitable protocol for the communication - at both ends.

Also, 8V is a strange level, how come?. This is what worries me about making the link two way!, I suspect the other end isn't built by you, and you don't have design access to it?.
 
iso9001 said:
My problem is I have no idea how to send 5V out of the pic and have it go into a transistor of some sorts, and then have an 8V signal get into the square wave wire.

It's quite easy to do, but like Nigel already suggested, do you know what's inside the device you are trying to interface with and how it works?

If it really supports 2way communication over 1 wire then it's very likely to be a open-collector bus (the wire beeing pulled to 8V inside the device witha pullup resistor). If you were to force 8V into it you might damage it.
 
The a good assumtion that I do not have access to the other end :D

Its an automotive iso9141 bus (very similar to J1850 except for the data layer)

I believe that it is weakly pulled to ground. Any node speaking on it outputs 6-8 and then can simply 'let' the bus return to ground or force it to ground by sinking an ouput.

What I am doing is basicly adding my own node.

Are you sure about the not needing a diode? I can see that the voltage is 4.5-5 at the pin, I'de be a little worried just letting 8V into it and assuming that its just going to be ok.

The spec calls for 6-8V ouputs... I've read that it may possibly accept 4.5-20V for inputs... My guess is that it would accept 5V just fine and that the 6-8V is required for noise or somthing like that. Its likely I could just hook it up to an output and VROOM away I go.

The bus being pulled up would also be my first guess, however the sheet says "weakly pulled to ground". The only papers I can find for it are titled "Implementing J1850 Bus" by intel. The link is the first hit of google i think, I cant get onto google now or I'de post it.
 
iso9141 is an open collector bus, like i said...

You only need to be able to read it and pull it low. You should never directly put a voltage on it, this may damage the device. The wire should be pulled high with a resistor, eighter in the device, or by you if it isn't already pulled high...
You can use a single pin on your pic to read/write this bus, by tri-stating it.

iso9141 is sort of a cross between I²C and RS232. The setup of the dataline is similar to I²C, but there is no clock line, it uses start and stop bits similar to RS232.
 
The bus is definetely zero volts at idle.

I think its almost a sort of bastardized hybrid... Its almost exactly J1850 except that it has some difference in the data layer (like how long 0s and 1s are, plus there is no CRC)

I'm sure that while the bus is idle it is 0v,
 
It could just be that the device expects the pull-up to be external, so you should incorporate it into your design.

You really should exactly know what you're dealing with.
 
iso9001 said:
What I am doing is basicly adding my own node.

Are you sure about the not needing a diode? I can see that the voltage is 4.5-5 at the pin, I'de be a little worried just letting 8V into it and assuming that its just going to be ok.

Yes, the internal protection diodes are there for that exact purpose, all you need is a current limiting resistor - try looking at the input pin diagrams in the datasheet. The input pin can't go above 5.7V or below -0.7V, the internal diodes clamp it to the supply rails - unless you feed it too much current and blow the inputs, the resistor limits the current keeping it safe.

As for adding your own node, you need to know exactly what is going on, both in hardware and software - from your posts so far, it looks like you know neither?.
 
Re: help me

pierrepierre19 said:
how can i descramble a cable box

I don't see how it's relevent to this thread, but you can descramble it by paying for a subscription!. This forum doesn't exist for you to steal TV programming, if you want it then pay for it!.
 
WOW. Thanks.... Instead of helping me figure out the cleanest way to do this, I get "Um... You don't know enough about the system"... Well no sh¡t I don't know. Thats why I'm asking. :D (If I understood this I wouldn't be up till 2am every night/day looking for answers and examples)

The bus is normally Zero Volts. Elm has a digram for thier J1850 chip that has a cluster of things going on to deliver 8V into the line. I put thier diagram into a simulator and I cant get it work, I have no idea what they're doing so I don't want to incorperate it. (Not much sense just copying if I don't know whats going on...)

This bus is not rocket sciene. It is normally low and fed 8V to make the wave. I KNOW of at least one diagram to do this but I dont understand what they are doing (2 transistors, 2 resistors and a diode JUST on the output line? Thats seems a little much.

Also, if what Nigel says is right, then why does Elm put 3 resistors and 2 transistors JUST on the input line... Don't they know all they need is a limmiting resistor ?

Here is the link to Elm's datasheet, It has 2 diagram at the bottom, one for ouputing 5V and one for outputing 8V.... I think they are overcomplex.
https://www.electro-tech-online.com/custompdfs/2004/09/ELM322DS.pdf
 
I was building that interface and it didn't work for me
(it might work elsewhere but sure didn't like to talk to
ECUs we had to work with).
We had the same problem with all commercial products we could find
(NetWay, B&B electronics and Scantool - which actually uses
ELM chip which is really PIC). we started this ca two years ago.
I am sure all these guys have worked out solutions by now but
at that time we ware quite desperate to get working interface so
simple schematics like in previous post seamed attractive enough
to try them out. Unfortunatelly first two didn't work for us and
we all had sinking feeling and then I came accross circuit that was
using MAX232 and 7407.
Quick comparison with the block diagram of the ISO9141-2 chip
confirmed same inner working.
I've built the first unit and after it worked, I asked our technician
to make more. (so far we did ca 30 of them).
For your circuit (it uses PIC) I would recommend simple interface
like in the K-Line of following drawing. I'm no expert in Russian
language but you should be able to copy two transistor circuit
up to schmidt trigger inverters and substitute those components
with parts you keep in your drawer.
http://www.radioland.net.ua/images/Avto/auto_comp1.gif
 
Btw. the K-line is normally high (+8 to 12V). It is pulled low
by transmitting node. L-line is only used for initialization and
most systems don't use it (I've not seen one yet to be honest).
The inverters KR1533TL2 are same as 74ALS14 according to chipdir.
Zener diode KS133 is supposedly 3.3V.
Transistors KT3102V are equivalent of BC546B,C; BC547B,C
and also replace the KD522 diodes with 1N4148 for example.
Hope this helps.
 

Attachments

  • odb.jpg
    odb.jpg
    92.6 KB · Views: 871
I'll look over those diagrams in a bit. Did you say one uses a MAX232?

I'm VERY VERY certain that the line is not high and is pulled low. It is identical to the J1850 bus except the data layer (it has some odd symbols and timings... The data layer is close to iso9141 / No CRC)

This paper here tells what I'm dealing with (sorta):
https://www.intel.com/design/intarch/papers/j1850_wp.pdf

I just want to send 5V out to somthing and have it allow 8V to get onto the bus line. I cant any (understandable) transistor configurations to work

:(
 
It looks to me you have to sort out what interface you need. Anyway, here is the circuit we used as reference
 

Attachments

  • sample_interface_161.gif
    sample_interface_161.gif
    10.9 KB · Views: 828
Why don't you do as in fig.5 of the ELM322 datasheet? See below for a schematic of the relevant circuit. Keep in mind that this inverts. If you want it to be non-inverting, you can change Q1 from common base to common emitter, although that would seem unnecessary if you are driving from a PIC.
 

Attachments

  • xlator.gif
    xlator.gif
    4.6 KB · Views: 817
Ron H:

The more I look at that one the more sense it makes (almost).... at first I didnt like the idea of it inverting, but really, all that is going to mean to me is that when I want to send a high on the line, I ground my pin and when I want a low I float it ?

One question though. In my setup I have very easy access to a buffered (not direct to battery) 12V. I'm curious as why my simulation says that no matter what voltage I put instead of 8, lets say anywhere from 9 to 20V the output is always close to 7.66V ? (Which is PERFECT, I'm just wondering why)

I know someone is going to tell me ohms law bla bla bla and not explain it so if you are reading this and plan to say "Cause of Ohms Law" and not explain yourself, please try and refrain. :D
 
Actually, it's due to Murphy's law. :D
Seriously, your results make no sense. Can you post the complete schematic that is giving you those results?

To get a low output, you could float the input or pull it high actively. I think that if you want to float it (open collector or open drain drive), then you should add a 10k resistor from the emitter of Q1 to +5V (preferred), or from the input to +5V. It will probably work without the resistor added, but it will switch more rapidly and cleanly with it.
 
I know it doesn't make any sense, but its what Crocodile Clips is telling me... (I like the funny sounds and pictures for the symbols... and oh man, that crocodile that eats broken components, ha don't even get me started on that crazy crocodile)

Anyway, I can enter in 9-20V where I now have 12V and the voltage on the probe stays the same... This all only happends when I press the PUSH button o/c

The STDP switch is to pretend the other nodes changing the wave from 0 to 7.5.

I figured that it might be possible because of the emitter follwing the somthing else or somthing like that (that I never really understood)

I posted the diagram, let me know,
 

Attachments

  • look_at_me_i_can_use_crocodile_clip___yayyy.gif
    look_at_me_i_can_use_crocodile_clip___yayyy.gif
    3.3 KB · Views: 776
Status
Not open for further replies.

Latest threads

Back
Top