Cmos circuit is automatically switched on when applying power

LesJones

Joined Jan 8, 2017
4,509
Your drawing in post #28 is what I described but I now realise that when I suggested that I was thinking that the latch was triggered with a high pulse. It is triggered by a low pulse so my suggestion will not work.
MisterBill2's suggestion in post in post #32 should work. I will draw a schemaatic of his suggestion and post it.

Les.
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
Your drawing in post #28 is what I described but I now realise that when I suggested that I was thinking that the latch was triggered with a high pulse. It is triggered by a low pulse so my suggestion will not work.
MisterBill2's suggestion in post in post #32 should work. I will draw a schemaatic of his suggestion and post it.

Les.
The output of my IR gate is HIGH when the gate is closed, switching mode + 5v. When the gate is open 2.6 volt = LOW
When I use the IR gate in ACTIVE mode, the output is HIGH until the IR gate is passed/blocked,the IR gate is LOW.
I have measured both IR gates with a multimeter when I designed the circuits
 

LesJones

Joined Jan 8, 2017
4,509
I realiseed that when I came to draw the schematic of MisterBill2's suggestion in post #32 that it required a NOR gate not an NAND gate.
Here is another suggetion.
Temp02.pngThe values of R2 and C1 gives a time constant of about 2 seconds. Any time constant betwoon about 0.1 and 10 seconds should be OK so you can use components that you have available
Re your post #42 2.6 volts is not low enough for a logic zero. Either increase the value of the collector resistor or increase the IR ilumination. (Try a 47k or 100K resistor.)

Les.
 

MisterBill2

Joined Jan 23, 2018
27,714
I use some IR photo-sensors that have a TTL compatible output in a standard product I designed quite a while back They work very well. the low is about0.2 volts max and the high is close to 5 volts. Presently the sense a red laser beam, possibly an IR LED should work over a shorter distance.
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
I realiseed that when I came to draw the schematic of MisterBill2's suggestion in post #32 that it required a NOR gate not an NAND gate.
Here is another suggetion.
View attachment 309176The values of R2 and C1 gives a time constant of about 2 seconds. Any time constant betwoon about 0.1 and 10 seconds should be OK so you can use components that you have available
Re your post #42 2.6 volts is not low enough for a logic zero. Either increase the value of the collector resistor or increase the IR ilumination. (Try a 47k or 100K resistor.)

Les.
Hi Les! MrBill said to use NAND: " Replace the last inverter with a nand, then have a delayed signal at the other input. No extra ICs to buy, just one R and one C to deliver a 2 second delay. " Correct me if I am wrong. A lot of info have to be "milled" in my brain and all details I have to put in TinyCad schematics in order to make the diagram simple and workable. So I will try yr circuit and this will take some time as you will understand
 

MisterBill2

Joined Jan 23, 2018
27,714
Hi Les! MrBill said to use NAND: " Replace the last inverter with a nand, then have a delayed signal at the other input. No extra ICs to buy, just one R and one C to deliver a 2 second delay. " Correct me if I am wrong. A lot of info have to be "milled" in my brain and all details I have to put in TinyCad schematics in order to make the diagram simple and workable. So I will try yr circuit and this will take some time as you will understand
My reasoning was partly that the present design already included the NAND gates with the required hysteresis for use with RC timing. A Very fortunate situation, as there are other types of NAND gates also available that would not be suitable.
 

LesJones

Joined Jan 8, 2017
4,509
I will start with the problem with your 2.6 volt reading at the collector of the phototransistor when the
beam is not broken. The phototransistor is pulling the voltage down on the bottom end of the 10K resistor
which is correct but that is considered an undefined (Neither a 1 or a 0) logic state for 4000 series ICs.
With a supply voltage of 5 volts between +3.5 and 5 volts is considered as a logic 1. Between 0 and +1.5
volts is considered as a logic 0.
Here is a screenshot of this information captured from a web page.
Screen Shot 12-05-23 at 06.13 PM.PNG
Now a description of how it works.This is for the second of the sensors that the train would pass.
First the latch circuit. (The two cross connected NAND gates.)
The normal state is the two input are at a logic 1 state and the output that it was last set to.
In the normal state where the beam is not broken the phototransistor is conducting so it's output will be at a low voltage which will be a logic 0 (When you fix the problem with it being +2.6 volts.) As the inverter input is a logical 0 it's output will be a logical 1. The diode on it's output only lets it pull the bottom of the resistor low. In the situation when power is first applied the capacitor will be discharged so it holds the bottom of the resistor low. This puts a logic low on the input of the lower NAND gate in the latch circuit which causes the gate's output to go high. The latch now remains in this state (Which you call the off state.) until the first sensor is broken by the train.

Les.
 

MisterBill2

Joined Jan 23, 2018
27,714
Post #47 certainly describes the cause of a bit of uncertainty, which is the "lighted condition" output voltage from the photo-transistor. An easy way around the problem could be a higher value series resistor, a less easy way to reduce the voltage is to provide stronger light. A brighter LED or a better lens may be possible fixes.
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
I will start with the problem with your 2.6 volt reading at the collector of the phototransistor when the
beam is not broken. The phototransistor is pulling the voltage down on the bottom end of the 10K resistor
which is correct but that is considered an undefined (Neither a 1 or a 0) logic state for 4000 series ICs.
With a supply voltage of 5 volts between +3.5 and 5 volts is considered as a logic 1. Between 0 and +1.5
volts is considered as a logic 0.
Here is a screenshot of this information captured from a web page.
View attachment 309221
Now a description of how it works.This is for the second of the sensors that the train would pass.
First the latch circuit. (The two cross connected NAND gates.)
The normal state is the two input are at a logic 1 state and the output that it was last set to.
In the normal state where the beam is not broken the phototransistor is conducting so it's output will be at a low voltage which will be a logic 0 (When you fix the problem with it being +2.6 volts.) As the inverter input is a logical 0 it's output will be a logical 1. The diode on it's output only lets it pull the bottom of the resistor low. In the situation when power is first applied the capacitor will be discharged so it holds the bottom of the resistor low. This puts a logic low on the input of the lower NAND gate in the latch circuit which causes the gate's output to go high. The latch now remains in this state (Which you call the off state.) until the first sensor is broken by the train.

Les.
Thanks everybody. I need some time also because my laptop has to be fixed so I am until further notice "out of reach". I will print the posts and try to make the circuit in accordance with the suggestions.
greetings
Harry
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
Post #47 certainly describes the cause of a bit of uncertainty, which is the "lighted condition" output voltage from the photo-transistor. An easy way around the problem could be a higher value series resistor, a less easy way to reduce the voltage is to provide stronger light. A brighter LED or a better lens may be possible fixes.
Hello Guys . You are all working for a solution, thanx! with respect to theIR gates I have used the information from TT Electronics/Optek. I saw in my notes , which I made during the testfase, that the voltage is lower than 1 volt, so not 2 volt. And now I bring my laptop to the shop
Regards and again THANK you!!!!
 

Attachments

eetech00

Joined Jun 8, 2013
4,709
Hi

Borrowing from LesJones Post #43, I've modified the circuit to use BJT buffers instead of CD40106. The BJT's will switch at lower level and stabilize much quicker than using a digital buffer, and prevent the false trigger. See Below.

I show the supply voltage rising slowly in the simulation below.
I wasn't sure which Flip flop output should be asserted, so I made Qbar low, but it can be easily changed if necessary. PB3/4 are used to simulate the circuit behavior when the IR beam is broken.
1701882429434.png

1701882469599.png
 

LesJones

Joined Jan 8, 2017
4,509
Here is another idea using existing components which is based on MisterBil2's suggestion in post #32
Idea2.pngEither input being low on IC1 C would make its output high (Think of it being a NOR gate for negative logic.) the following inverter output would be low triggering the latch. At power on the capacitor would hold pin 8 low. in normal operation breaking the beam would make pin 9 low.

Les.
 

eetech00

Joined Jun 8, 2013
4,709
Here is another idea using existing components which is based on MisterBil2's suggestion in post #32
View attachment 309303Either input being low on IC1 C would make its output high (Think of it being a NOR gate for negative logic.) the following inverter output would be low triggering the latch. At power on the capacitor would hold pin 8 low. in normal operation breaking the beam would make pin 9 low.

Les.
I don't think using a digital solution is gonna work because the digital devices rely on the supply voltage to rise, stabilize, then trigger at VDD/2. The BJT's do not, they'll trigger just above 0.6v (and with sufficient base current of course).

Anyway...at least that's my theory...
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
I don't think using a digital solution is gonna work because the digital devices rely on the supply voltage to rise, stabilize, then trigger at VDD/2. The BJT's do not, they'll trigger just above 0.6v (and with sufficient base current of course).

Anyway...at least that's my theory...
Hello guys, thanks for posting the circuits. I have studied the circuits and I will build them. This will take some time.
Greetings
Harry
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
Hello guys, thanks for posting the circuits. I have studied the circuits and I will build them. This will take some time.
Greetings
Harry
Good morning to you all!
I have made the circuit on the breadboard: IT WORKS!, however----------->
I controlled the output of IR gates:
IR gate 1: unblocked = 5 Volts (logic HIGH)) blocked = 0.20V (logic LOW)
IR gate 2: unblocked = 5 Volts blocked = 0.17 V (logic LOW)
Than I made the circuit on the breadboard.
I inserted the plug into the mains (230V AC) : the circuit output (LED connected to OUTput of CD 4093) remained OFF, Crossing 1st IR gate, LED turns ON, activating the 2nd IR gate, LED turned OFF. Oké, fine. I pulled out the plug out of the mains, the led turns ON again for a brief moment. Put the plug in the mains, IR led turns on. deactivating the 2nd IR gate, pull out the plug, LED remains off.

The I turned the plug 180 degrees and plugged into the mains. IR led is OFF. and so on and on. It was ON and the again OFF.
So most of all it is not flawless. I made a Tiny Cad drawing, some photos of the circuit and I present an pdf in which the power and current in theNetherlands is labeled. I think this is somewhat overdun but maybe...?

I think I will install the other diode RC circuit also on the 1st IR gate.
PS I don't have 1N914 but I use 1 N4148 because the specs are almost the same.
NO,THAT WONT WORK. led IS on CONSTANTLY
 

Attachments

Last edited:

LesJones

Joined Jan 8, 2017
4,509
You said thet you have built the circuit but you did not say WHICH of the suggested circuit you used.
Also you say " I turned the plug 180 degrees " but you do not say what blug and where it is in the circuit.
Post the schematic of EXACTLY how every thing is wired together. Just drawn on paper is fine. You do not need to use a schematic drawing program.

Les.
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
You said thet you have built the circuit but you did not say WHICH of the suggested circuit you used.
Also you say " I turned the plug 180 degrees " but you do not say what blug and where it is in the circuit.
Post the schematic of EXACTLY how every thing is wired together. Just drawn on paper is fine. You do not need to use a schematic drawing program.

Les.
You are correct: sorry. I built the circuit in accordance with post 51. in my reply post 55 I have attached the drawing with the Marklin transformer. The plug is the plug attached to the powercord of the Marklin transformer. This plug is inserted into the wall mains of 230V AC. The output of this transformer is appr. 18 V AC. This 18 V AC
is converted into a stabilized power supply of 5 Volt DC.
As explained, when turning the wall plug( CLock wise position A) 180dgrees the LED is ON, de-activate circuit through IR gate 2 and then unplugging the mains the is briefly turned ON.When insertingthe plug in the same way (A) as unplugged, the LED is ON again.

Repeat everything,but then with the plug (Counter clwise position B) LED is OFF. Activate IR gate 1 led ON, deactivate IR gate 2, led is OFF. Unplug plug mains, led is OFF, plug again LED is OFF repeat,led is ON?????? This is a strange behaviour and I guess it has something to with the ELCo capicitor that it is somepowerleft and when powering on, the circuit is automaitcally turned ON and the led is also ON.
 

eetech00

Joined Jun 8, 2013
4,709
Any IC you use should have a 0.1uf cap connected across its power pins, otherwise, the circuit behavior can be erratic.

I understand there is a language barrier here, so PLEASE draw your WHOLE circuit on a sheet a paper and post, so we can communicate effectively, and see what we are working with.

Also, to be clear:
Blocked = the IR beam is broken.
unBlocked = the IR beam is not broken.
Correct?
 
Last edited:

eetech00

Joined Jun 8, 2013
4,709
Rotation of the 220v wall plug shouldn't effect operation of the breadboard circuit. There might be glitches causing the circuit to misbehave.
Also, after looking at the photos, I see there are long wires to the breadboard.
Try adding a 470uf (or 680uf) cap, and a 0.1uf cap, across the supply wires where the 5v supply wires connect to the breadboard.
 

Thread Starter

Holz1

Joined Jan 21, 2020
87
Any IC you use should have a 0.1uf cap connected across its power pins, otherwise, the circuit behavior can be erratic.

I understand there is a language barrier here, so PLEASE draw your WHOLE circuit on a sheet a paper and post, so we can communicate effectively, and see what we are working with.

Also, to be clear:
Blocked = the IR beam is broken.
unBlocked = the IR beam is not broken.
Correct?
Yes, correct. When the object is passing through the IR gate, the gate is blocked. When the object is NOT near the IR gate, the IR gate is unblocked.
I will make a new drawing and I am aware that there are long cables that is because I am testing the circuits before soldering to a pcb.
re adding capacitors: Also I will place an ELCO 470uF and a ceramic 100nF (104) in the powersupply(powerpins) of the breadboard
 
Top