Abnormal low current from JK flip flop IC at toggle mode

In summary,The student is trying to create a balance indicator for farm quadbike to prevent them from rolling on steep hills. He is using an Arduino pro mini and 2 sets of strip leds, a gyro-accelerometer, and a battery from a farm motorbike. To power it, he is using the battery from the motorbike. He has a momentary button switch that gives normally close ground to the clock pin, and when he presses it, it gives 12V. He has connected the flip flop output to the power pins of the chips, but he is still just guessing at this point.
  • #1
BBruyne
15
0
Hello,

I am building a prototype of a balance indicator to prevent farm quadbike to roll on steep hills. I am using an arduino pro mini and 2 sets of assignable strips of 8 leds (https://www.adafruit.com/products/1426) and a gyro-accelerometer sensor. To power it, I am using the farm motor bike battery (12V). To switch the arduino on and off, I am using a momentary push button switch (NO, NC, C pins) and a JK flip flop ic (4027 dual jk flip flop cmos ic zc 4027). I have my 12V from the battery connected to the flip flop on vcc, j,k and the ground to vss,set and reset. My momentary switch give normally close ground to the clock pin and 12v when I press it. I use the flip flop as toggle mode with my switch as a clock. Next, from the ic, between the output Q and the ground, I have linked a 1F capacitor, my set of leds and the arduino in parallel. The capacitor is to prevent a damaging pike for the leds strip. I have tested it, I have the expected 12V after pressing once the switch and 0V after pressing it again. But when it is on 12V and the arduino and the leds should be running, the current is very low, too low to run the arduino and the leds. Could someone please help me ? I am lost. I am a student at high school very dedicated to my project. I have tried the device on the 12V battery without the switch and jk flip flop, it works fine.

Thank you very much,

Bbruyne
 
Engineering news on Phys.org
  • #2
If both J and K is at 0V, the F/F is told "do not change the output".

Another issue: A push-button will usually give a series of pulses when pressed. Therefore, you cannot use it on a clock input. Use it on the "set" input will work OK.
 
  • #3
Have you checked the output current specification for your flip-flop and the input requirements for your loads? You might find your answer there.

BoB
 
  • Like
Likes berkeman
  • #4
I can't really visualize your design and issue from your words (sorry). Posting a schematic always makes this easier.

What has been said previously all apply.

I will say that you need to first debug the flip-flop/switch operation. Connect an LED (through appropriate buffer) or an oscilloscope (or a meter) to the flop flop and verify that it toggles reliably on every button press. I am sure t won't, because of switch bounce. Look at hardware debouncing solutions on google and get the flop to work reliably.

My favorite has always been figure 1 in http://www.eng.utah.edu/~cs5780/debouncing.pdf (but it requires 2 pole switch)

You also need to verify that the JK flop can drive the circuit it is connected to. The meter/oscilloscope can help with that.
You can safely short the JK output to its power pins or ground to see if it is connected properly. It may be that it does no have enough drive for what you are connected to. and some stuff works and some doesn't. When you short the output, things will work. (I've never had a logic gate fail because of shorting to the supply or ground. But, if you short to something higher than the supply it will fry the chip.)
 
  • #5
Hello,

Thank you very much for your support, it is fantastic.
I have tried my ic with a led and my momentary push button as a clock and it toggles as expected. I have a schematic here. I decided to add a voltage regulator.

Thanks for your help,

Bbruyne
Bbruyne3_schem.jpg
 
  • #6
I can't see what you are doing. (its too small to read any print). Is it possible you are connecting the flip flop output to the power pin of those chips?

There is no way it can drive much more than some more gates. If you want to switch power with the FF, you need to use a small p-channel power fet.

But, I'm still just guessing at this point.
 
  • #7
Yes you are right, I didn't know that the flip flop output could not drive the chips. Thanks for this! I am new... Is a p-channel power fet similar to a transistor ? What is it exactly ? Thank you very much for your help.

Bbruyne
 
  • #8
a PMOS power FET is a "field effect transistor". It can be controlled by the FF to switch power on and off. The FET requires no drive current other than what is needed to charge/discharge its considerable gate capacitance. You can add a buffer for faster switching

upload_2015-5-30_21-2-53.jpeg


When ON-OFF is LOW, the PMOS transistor will conduct. When it is High, (equal to V+) it will stop conducting.

You will need to select a proper FET with low enough threshold voltage and on resistance. The AO6407 is RDS(ON) < 85mΩ (VGS = -1.8V). It may be a bit overkill.

If you google "pmos power switch" you will find a lot of images with examples.
 
  • #9
Hello,

Thank you for your help,

What do you mean by low on resistance ? I haven't found any good tutorials on power mosftets, do you recommend any ? What are the resistance on your schem for ? I have drawn a full schem of my project with the PMOS, I used the same resistance as you did without any knowledge ? Which pmos should I use ?

Thank you very much,
 

Attachments

  • bbruyne_schem.pdf
    979.1 KB · Views: 235
  • #10
The 1K in meBigGuy's schematic is the load. It is equivalent to the Arduino and led's in your schematic. You don't need anything in series. You will probably want a small capacitor (0.1uF or so) in parallel with the output of the FET if the wire from the FET to the load is long. Long being more 100mm or so. Pick a FET specified for a logic level gate and at least double your input voltage https://www.fairchildsemi.com/products/discretes/fets/mosfets/NDP6020P.html will work. The LED's should be powered from RAW not 5V as the Arduino has only 150mA total current capability.

BoB
 
  • #11
http://electronics.stackexchange.com/questions/42030/p-channel-mosfet-high-side-switch

Let's dissect this statement:

The AO6407 is RDS(ON) < 85mΩ (VGS = -1.8V).

That basically says that the AO6407 PMOS MOSFET has less than .085 ohms on-resistance (RDS = resistance drain to source) when the gate is at least 1.8V less than the source. So, if you connect the gate to the FF, when the FF is low, the gate will be at ground and the source will be at whatever supply you are running at (5V? 3.3V?). That means the FET will be ON when the FF output is LOW. The link above tries to explain it also.

You can use a buffer or transistor to drive the gate.
 
  • #12
Thank you both, you are fantastic, I am learning so much. So, rbelli1, the PMOS that you recommended me will work with the signal coming from the Q1 output of my FF because the PMOS is specific for logic level gate, is that right ? No need for any transistor or buffer ? I won't need any capacitor, the distance is not long. On MeBigGuy schem, what is R1 for ? Do I need to add it to my circuit ? Thank you,

BBruyne
 
  • #13
You may not need R1 since the FF output will drive high. It's purpose is to turn off the FET if the ON-OFF becomes an open circuit. Otherwise gate-source leakage would cause it to turn on.
 
  • #14
I suggested NPD6020P because that particular device is designed to be controlled by 5V logic level signals and is through hole. It will be easier to work with than a surface mount device. If you ever change to 3.3V or lower logic you will need to change to a different device such as the one meBigGuy suggested. That one is surface mount so it is a bit more difficult to work with.

Through hole alternatives might also be available for lower voltages. However I have found that when looking for 3.3V (Well 2.7V in my case) devices you will find few parts that are suitable and through hole. The good news is that there are adapter boards available to use them on 0.1 inch (2.54mm) bread boards and perf boards.

BoB
 
  • #15
I showed a picture with AO6407 because that's what popped up on google. I have not looked at any selection guides. if I get a chance, I'll try to find something on mouser or digikey.
 
  • #19
The IRF6218PBF has a MAX threshold voltage of -5V. This part under some circumstances will not turn on with your 5V supply. I would not use that part.

The LED in the push-button does not have to be wired to the end of the pixels. Wiring it to the beginning might make it easier to route the LED strings.

If you notice that sometimes the push-button does not work then you probably have too much switch bounce. Wiring the flip flop up with some hysteresis will be necessary to overcome that problem.

BoB
 
  • #20
Hello,
On the NDP6020P, I am reading the datasheet and it is saying that the max gate threshold voltage is -1V. Does that mean the the voltage Gate-Source can't be higher than -1V or that it has to be more that -1V to put the PMOS on ? The min max value are confusing me. Thank you very much! Bbruyne
 
  • #21
The "damage" specs are always given in the absolute maximum ratings section. Those are important to understand. The Electrical specs are generally operational parameters.

The way to read the threshold spec is that a maximum gate-source voltage of -1v (gate one volt less than the source) is required to turn on enough to conduct 250uA.
Or, you can read it that you need to be below -0.3V to guarantee turn off to less than 250uA. That's why there should be a resistor from gate to source. (to get fully turned off when the FF output is high)

The min-max range is because of device to device variation. Not all devices manufactured are matched in performance. That fall in a range. You may get a sensitive device, or an insensitive device.

The Rds(on) spec says that Vgs = -4.5V will turn it on enough to conduct 12A with a Rds of 0.08 ohms.
 
  • #22
I must apologize for the low voltage information I stated before. I must have had the wrong datasheet. The NDP6020P is in fact suitable for voltages as low as 2V and in some cases lower.

BoB
 
  • #23
Oh thank you all very much! I will order the NDP6020P today and try it as soon as possible. I am so pleased that forums like this one exist, they are fantastic! Thanks, I learned a lot!

BBruyne
 
  • #24
Not that the switch logic is inverted. That is, when the gate ,(FF?) is LOW the switch (FET) is on. Also, be sure to add R1.
 
  • #25
Ok great, thanks a lot.

Bbruyne
 
  • #26
Hello the switch story is not finished yet. It doesn't work sometimes. I think I am experiencing some switch bounce. Could you recommend me a component to overcome this problem ? What is hysteresis ? Thank you very much Bbruyne
 
  • #27
There are multiple ways to debounce a switch, but the simplest is an RC circuit and a Schmidt-trigger gate.

See http://www.eng.utah.edu/~cs5780/debouncing.pdf. Maybe figure 3.

Hysteresis in a logic gate (called a Schmidt trigger) uses positive feedback to change the logic threshold when the output switches.

Say we use a cmos schmitt-trigger inverter on a 3V supply. The "nominal" switching point would be 1.5V. If we have 10% hysteresis, then when the output is high, the threshold will be increased to 1.5 + 10%. When the input rises and crosses the threshold (no matter how slowly), the output goes low, and the threshold switches to 1.5V - 10%. That way, slow rising/falling signals will not switch the gate multiple times as you go through the threshold. This makes them very iseful in debounce circuits where you are trying to slow things WAY down with RC circuits to filter out switch bounce.

An example is the 74c14, but there are many others.

This explains it well.

http://www.ti.com/lit/an/scea046/scea046.pdf
 
  • #28
Hello, I used a the set and reset imput of a second JK flip flop to avoid the bouncing of my switch. It is still not working properly. I was wondering if I need a pulse detector at the imput of the clock of the JK flip flop ? What do you think ? Thank you very much,

Benjamin
 
  • #29
I guess you need to describe the circuit and symptoms a little better.

BTW, You need pullup resistors on the S and R pins so they do not float when the switch is open. 1K on each to VDD will be fine. (10K is probably fine also)

I would have expected you to connect one pole to JK-S and one pole to JK-R and the common of the switch and the JK clock to ground. The JK-Q then becomes the clock for the toggling JK.

If all that doesn't fix it, then It is possible that ground bounce or power supply noise is causing issues.

You need to have a 0.1uf ceramic bypass from VDD to GND on the JK's (very short leads) and the ground system also needs to be short straight wires.
The 2 JK's should have good ground connections to each other.
 
  • #30
I'm assuming the S and R pins are actually SN and RN (low true) when I say you need pullup resistors. You are trying to emulate this with the JK flop:
upload_2015-6-17_20-2-50.png


If it is a REALLY terrible switch that bounces between NO and NC, then this circuit won't work and you need an RC and Schmidt trigger.
 
  • #31
just a suggestion, but why can't you poll the switch with the ardrino and use a small wait state loop to control debounce?
 
  • #32
Doh! Because the whole point is to power on/off the arduino with a push button switch.
 
  • #33
Hello,

Here is how I finally did it! It works fine. Thanks a lot for your help. I learned a lot about a world that I didn't know about, electronics!

Thank you!

Bbruyne
 

Attachments

  • Bbruyneww_schem.pdf
    1,002.4 KB · Views: 208
  • #34
Glad it works. That was a good idea, using the JK SET/RESET like an RS latch for debounce. I'll probably end up using that at some point.
 
  • #35
Great, thanks again for your help.

Bbruyne
 

1. What is a JK flip flop IC?

A JK flip flop IC is an integrated circuit that is used to store and manipulate digital data. It is a type of sequential logic circuit that has two inputs (J and K) and two outputs (Q and Q̅). It is commonly used in digital electronics for applications such as counters, shift registers, and memory storage.

2. What is toggle mode in a JK flip flop IC?

Toggle mode in a JK flip flop IC refers to the state in which the output changes from 0 to 1 or from 1 to 0 depending on the input signals. In this mode, the output will toggle or alternate between these two states with each clock pulse.

3. What causes abnormal low current from a JK flip flop IC in toggle mode?

There could be several reasons for abnormal low current from a JK flip flop IC in toggle mode. It could be due to a faulty IC, incorrect wiring or connections, a damaged power supply, or a short circuit. It is important to troubleshoot and identify the exact cause in order to fix the issue.

4. How can I troubleshoot abnormal low current from a JK flip flop IC in toggle mode?

To troubleshoot this issue, you can start by checking the wiring and connections to ensure they are correct and secure. You can also check the power supply and make sure it is providing the correct voltage and current. If these do not solve the issue, you may need to replace the IC or seek assistance from a professional.

5. How can I prevent abnormal low current from occurring in a JK flip flop IC in toggle mode?

To prevent abnormal low current from occurring, it is important to use high-quality components and ensure proper wiring and connections. It is also recommended to use a stable and reliable power supply. Regular maintenance and testing can also help identify and prevent any potential issues with the IC.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
20
Views
2K
  • Electrical Engineering
Replies
5
Views
2K
  • Electrical Engineering
Replies
5
Views
3K
  • Electrical Engineering
Replies
2
Views
17K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top