Hex inverter DIP8 package?

Started by Chugs, August 25, 2018, 07:28:20 AM

Previous topic - Next topic

Chugs

I am using a 4069 to make a latching switch out of a momentary switch to turn a led on and off.

Space is an issue and I only need two gates. Is there a two gate inverter in a dip8 package I could use?




tonyharker

Why not use a 555 timer instead?

diffeq

#2
Like said in the post above, 555 timer can be used as a flip-flop:
http://www.talkingelectronics.com/projects/555/Page3-555.html
I suspect a CMOS version of 555, for example TLC555, would be better and less noisy.
And then there is a 40107, two NAND gates in DIP8, which can sink up to 130mA:
https://www.ti.com/lit/ds/symlink/cd40107b.pdf

marcelomd

How about a microcontroller? They are relatively cheap now. You need a regulator and capacitor, but no other components.

anotherjim

You can make a 2 transistor flip-flop to do that. Basically what Boss pedals have. One of the transistors ought to able to drive the LED.
There are small gate count logic inverters. They are SMD only. Most are 74xx types and are limited to 6V max supply. Rohm do a 4000 series but only single inverters like the BU4SU69G2 so you'd need 2.


PRR

#5
It appears the only 8-DIP simple logic chip is CD40107BE, 2 Channel Open Drain NAND. This will require pull-up resistors to do your deed; however you may be able to design-out your 2N3904. Tie inputs A and B together to do inverter.
http://www.ti.com/lit/ds/symlink/cd40107b.pdf
DigiKey has 3K in stock at 54 cents each.
https://www.digikey.com/product-detail/en/texas-instruments/CD40107BE/296-3504-5-ND/376603

  • SUPPORTER


Chugs

I got this working with a 555 and then tried PPR's circuit with the 40107 which works well and requires less parts.

Is there any way to get the 40107 circuit that PPR posted to remember the on/off state when power is disconnected?

PRR

  • SUPPORTER

Pitchfork

Quote from: PRR on August 25, 2018, 12:38:01 PM
It appears the only 8-DIP simple logic chip is CD40107BE, 2 Channel Open Drain NAND. This will require pull-up resistors to do your deed; however you may be able to design-out your 2N3904. Tie inputs A and B together to do inverter.
http://www.ti.com/lit/ds/symlink/cd40107b.pdf
DigiKey has 3K in stock at 54 cents each.
https://www.digikey.com/product-detail/en/texas-instruments/CD40107BE/296-3504-5-ND/376603

I have built your CD40107 based switch running at 15V with 4K7 resistor in lieu of the 470R. Although not very knowledgeable of digital circuits, the output on pin 5 toggles between 0V & 15V as expected but when pin 5 is at 0V, pins 3,6 & 7 instead of being at 15V as I expected, they are at 4.8V. Is this correct? The reasons for asking is that I would like to have a second LED to indicate when the LED originally shown is off. 4.8V with a resistor in series with the anode of an LED (Cathode to ground) is insufficient to illuminate it adequately. I am driving a small DIL solid-state relay in series with the LED and this works perfectly. Thank you.

PRR

I'm not an expert on this chip. And it seems you have extended the plan. Can you crayon-up what you are really doing?
  • SUPPORTER

Rob Strand

#11
QuoteI have built your CD40107 based switch running at 15V with 4K7 resistor in lieu of the 470R. Although not very knowledgeable of digital circuits, the output on pin 5 toggles between 0V & 15V as expected but when pin 5 is at 0V, pins 3,6 & 7 instead of being at 15V as I expected, they are at 4.8V. Is this correct?
The load current when the output is in the low state is too much and the outputs can't pull down.  It might also be getting stuck in a linear part of the transfer curve because of that. 

Maybe try increasing the 2k2 to 10k.       You might find the circuit only works when that resistor is with in a certain range.  Play around and see how high you need to go before  the outputs drop.

I've got a circuit with 56k pull-ups and 2x2N7000 MOSFETs working.   I haven't tried to break it so it might only be working superficially.
----------------------
OK So I tried to break it and I'd say 56k is right on the limit.   Better to choose a lower value.   22k seems to work quite reliably.    So maybe 10k to 22k is a good choice.  If you want to use the output where the 2k2 connects then maybe it's better to use a lower value like 4k7 or 10k;  since you get little glitches when the resistor is too high.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Pitchfork

Quote from: PRR on September 03, 2019, 03:57:14 PM
I'm not an expert on this chip. And it seems you have extended the plan. Can you crayon-up what you are really doing?

Thank you, this is what I'm attempting to do:
I would like to have another LED to indicate when the Relay is open as well as when it is closed



R.G.

A couple of things come to mind. As mentioned earlier, I would probably use an 8 pin microcontroller and cope with it only being able to work at 5V on its power supply. But you could easily enough have whatever flipflop you use drive a diffamp switch with one LED in each collector leg. The current source in the common emitters would limit current to the LEDs, and the signal from the flipflop would tell the diffamp which way to steer the current.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Pitchfork

Quote from: R.G. on September 04, 2019, 09:26:13 AM
A couple of things come to mind. As mentioned earlier, I would probably use an 8 pin microcontroller and cope with it only being able to work at 5V on its power supply. But you could easily enough have whatever flipflop you use drive a diffamp switch with one LED in each collector leg. The current source in the common emitters would limit current to the LEDs, and the signal from the flipflop would tell the diffamp which way to steer the current.
It has to operate from the 48V Phantom Power and be small/simple enough to be in a small die-cast box. XLR sockets occupy most of the enclosure.
I have now changed the 2K2 to 10K and both gates now toggle between 0 & 15V so that issue is resolved.
I have tried an LED from the output of the first gate with resistors of various values to ground but this either prevents the 2nd gate from going to 15V or going to to a couple of volts which fails to operate the relay.
Resistor values that allow gate 2 to operate correctly only serve to make the added LED output very low and difficult to see

Rob Strand

#15
QuoteI have tried an LED from the output of the first gate with resistors of various values to ground but this either prevents the 2nd gate from going to 15V or going to to a couple of volts which fails to operate the relay.
LEDs to ground will cause problems.  Connecting the LEDs to +V with a series resistor is the way to go for sure.  In this case, the LEDs create a voltage drop.  If you need the output, at the output of the gates, to swing to 15V you can add another resistor from the gate to +V; basically in parallel with the whole LED + resistor thing.   The best value of the resistor depends on what you want to do with the outputs but a 47k to 100k would probably be fine in most cases.  You only need to add the resistor on the output with LEDs.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Pitchfork

I'm sorry but I don't understand. Is there any chance that you could jot down what you mean?
I would like a red Led to illuminate when the relay is closed (i.e. the output at pin 5 is high) and a green Led when pin 3 is high

Rob Strand

QuoteI'm sorry but I don't understand. Is there any chance that you could jot down what you mean?
I would like a red Led to illuminate when the relay is closed (i.e. the output at pin 5 is high) and a green Led when pin 3 is high

Try this one.


Here's what to do:
- At first, *don't use* the 100k's and see if it works
- If it doesn't work try adding the 100k's.
- If that doesn't work try reducing the 100k's
- Another thing to try is  to change the circuit slightly: connect the green_led+opto to pin 5 and the red_led to pin 3.  That might change the behaviour enough to get it to work (it could make it worse I haven't checked).
Be aware it  will change the what state the circuit tends to power up in - maybe that's what you want, maybe not!

If you get it to work and it needs the 100k's (or whatever value) in there you can also try removing one of then to simplify the circuit.

Unfortunately when you have circuits which aren't 100% clean and push the limits you need to play around with it to "develop" the circuit.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Pitchfork

#18
Thank you
This is how I used your suggestion & it works very well
I did not require the 100K resistors & I used 100nF simply because I have lots of them
Sometimes at power on the Red LED (pin 5 high) comes on, other times the Green (LED (pin 3 high)
It's totally random, but I need the Red LED to always come on at power on (so that the Microphone connected to the XLR is muted)
Are there any suggestions as to how this can be done?


Rob Strand

#19
QuoteAre there any suggestions as to how this can be done?
The only obvious way would be to add a reset circuit.

Take this circuit,  use 100nF for the cap and 1MEG for the resistor,


To force it to power up on the Green LED: disconnect pin 1 from pin 2, wire pin 1 to the Reset.
or
To force it to power up on the Red LED: disconnect pin 6 from pin 7, wire pin 6 to the Reset.

The way it works is the cap is initially discharged and pulls the one of the inputs up.  Since the gate is an OR gate that will force the output into the low state. [See Next Post.]

You may have to do a few extra things:

The problem with these reset circuits is they aren't 100% reliable.   For example if you switch the power off an on quickly they don't reset.    You can improve the reliability in this case by adding a diode pointing upwards across the resistor.  I don't know if this will help on your circuit as I suspect the CD40107 already has diodes on the input but it doesn't hurt to try.   The reason  for this behaviour is the reset cap must be given time discharge in order to reset on the next power-up.  The diode helps make this discharge process quicker.

You might need to change the reset resistor from 1M.  If you still have problems with the reliability of the circuit try smaller value or, most likely, a larger value.  Don't increase the cap unless you *really* have to.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.