Diode transistor logic problem

I have 2 inputs to each AND diode gate. Transistor am using as NOT gate here. My problem is that I have 2 different voltages at the inputs 3.3v and 5v. At logic HIGH from 3.3v I think diodes D2 and D5 will have enough potential difference to become forward biased. If 3.3v was 5v than I wouldnt have that problem.

for simple interlock circuit I thought diode-transistor logic would be enough and simple but turns out hard one for me.

Got any optoisolators around? Drive one with the 3.3V signal and get a 5V open-collector signal on the other side.

Dont have optoisolators. Never worked with them will order one now. 3.3v input current is only 2ma. Will they work?

+1 Good solution will definitely try.

  1. I don't think an optoisolator has any advantage over simple transistor in the given circuit.
  2. The circuit is unnecessary complicated. I.e. D1 and D4 are not needed as well as diodes to the base of the transistor.

Write what logic function you want to implement and what are drive requirements (M is for motor???) and someone may help you to make a better circuit.

What is the purpose of your circuit exactly? Can's see that easily from the circuit you devised.

Hi,
Ops diagram.


I hope both 5V and 3.3V inputs have the same gnd?

Tom... :slight_smile:

That's very complicated.

I don't understand the existing two diodes on the base of the transistor? Perhaps you copied this circuit from
the innards of a DTL IC? Lose them. One of them would be correct if it were a schottky diode, which would
prevent saturation and speed up the transistor, but a standard diode is useless for this.

You have two issues, one is the need to level shift from 3.3V to 5V, the other is you want some logic
gates to combine the signals into a single output.

A transistor can be used to level shift (and invert). Those could be used for the 3.3V inputs. Then a few
74HCxx series gates will combine the results. Probably a lot cleaner. You may be able to arrange things
so that a single package of NORs or NANDs is able to do the job - you are free to choose which polarity your
push button inputs are which will help.

Actually with a little bit of thought I think by choosing 74HCT00 quad-nand gate chip you can do this easily.
The HCT family accept 3.3V logic signals as well as 5V.

wire button to ground with a pull-up into one input, the 3.3V signal into the other, then that nand gate output
is only high if the button is pressed or the 3.3V input is low.

With two copies of this circuit each feeding the input of a third NAND, that gate's output will be high under the
right conditions I think - double check this.

First transistor acts as not gate with clamp MarkT you are right diodes are schottky was bit hard to draw with pen and paper.

2 inputs are going into AND gate to power up timers. Then to OR gate to check condition which timer is on and open transistor to the motor.

2x74xx series will do this job but i was trying to use parts that i have by hand.

Optoisolator as suggested will level up voltage and diode will be reverse biased and suppose to work.

Didnt copy circuit from anywhere except clamp part to first bjt which i came across somewhere that was suggested is better option in dtl logic.

Purpose of these was to try to work with analog circuits as i lack experience and knowledge in analog circuits.

Thanks

One thing to mention is 3.3v input has only 2ma max current. I searched for transistor bjt for that low current but couldnt find. Initially all this circuit was ttl but because of 2ma i decide to try dtl.

If you name the inputs A - D from top to bottom (i.e. B = the BLE input) you want
(not A and B) or (not C and D)?
Output of this drives base/gate of a transistor driving a motor?
Do you need any significant speed?

@Smajdalf

Sw1 and sw2 are normaly open may be pulled to ground with resistor for better logic 0 didnt test that yet. Call it A and D

3.3v inputs B and C

Logic: (A&(not B)) OR (C&(NOT D))
Only in this case motor must get power.

surepic:
@Smajdalf

Sw1 and sw2 are normaly open may be pulled to ground with resistor for better logic 0 didnt test that yet. Call it A and D

3.3v inputs B and C

Logic: (A&(not B)) OR (C&(NOT D))
Only in this case motor must get power.

Doesn't match the drawing.

Schottky diode in an inverter from a push button is entirely unnecessary unless you can push
the button a million times a second or so...

Sorry messed up a little in the previous post .
logic is: ((not A)&b)OR((not C)&D)

Which means transistor to motor side which is not in the drawing will switch on only if switch is open and logic high is present on one side OR same thing on the other side.

Does the switch need to be wired to 5V? Why not 3V3 or GND?
Edit: what is driving the motor? A BJT or FET? How much current/voltage is needed to open it?
Is 3V3 enough?

Hi,
Can you please draw a truth table for us, to show exactly what inputs have and output you need?

Label which are 5V and which are 3.3V logic.

Thanks.. Tom... :slight_smile:

@Smajdalf
I can power switch from 3.3v but the problem is with 5v to 3.3ble via diode its getting forward biased at that time cos of potential difference.

Motor is 5v 500ma through limiting polyswitch. I would like to use bjt to switch it on.

Source of the circuit is 6v 5cell NiMH battery.

Again i can do all the circuit via attiny85 without complications. But want to try via analog circuitry.

Edit: i think i will go with MarkT’s suggestion in post #6 and 7.

surepic:
@Smajdalf
I can power switch from 3.3v but the problem is with 5v to 3.3ble via diode its getting forward biased at that time cos of potential difference.

Motor is 5v 500ma through limiting polyswitch. I would like to use bjt to switch it on.

Source of the circuit is 6v 5cell NiMH battery.

Again i can do all the circuit via attiny85 without complications. But want to try via analog circuitry.

Edit: i think i will go with MarkT’s suggestion in post #6 and 7.

So do it with ATtiny85, it will be so much better, lower component count, less reliance on component tolerances and diode volt drops, especially with the 3.3V logic.
No brainer, "Use the ATtiny85 Luke..."
Digital to Analog to Digital !!!!!!!!!!!
Tom... :slight_smile:

@OP

1. The following circuit is an example of a discrete components based DTL NAND Gate.
301.png
Figure-1: Discrete components based DTL NAND gate.

2. Truth Table of Fig-1
301a.png
Figure-2: Truth Table of Fig-1

301.png

301a.png

@GolamMostafa thanks for circuit. But again its dealing only with same voltage inputs ....

Hi,
Can you post a truth table, showing ALL your inputs and outputs and how you want them to work?

How many and what are your inputs?

How many and what are your outputs?

Thanks.. Tom... :slight_smile: