low voltage tripping bounce?

Status
Not open for further replies.

Magnethead494

Well-known member
On the racecar, dad was running the valvelash tonight, and noticed the numbers on the dial board changing. The numbers can only change via the bounce command....

I can't think of a reason for it to happen unless the teensy chip is staying powered up, but the 5V line is otherwise falling under 2.5 volts and registering a digital low?

battery is 18 volts, goes through an STMicro 12 volt regulator (KA378R12) to a 7805 5 volt reg to the teensy. The LED's (12 volt) turn off when the starter is bumped, which causes me to think teensy is somehow staying up yet registering a logic low...

It's random between the 3 switches/6 bounce commands.
 
Not sure what you're asking for Paul? Everything has been in your inbox at some point or another (same project I've been dealing with for ~6 months).

When the starter is engaged, the board shuts off (lack of voltage- expected) but the teensy (2.0) changes a number up or down. The numbers can only activate through the bounce library, so something, somewhere is causing errant recordings to the bounce.
 
Not sure what you're asking for Paul? Everything has been in your inbox at some point or another (same project I've been dealing with for ~6 months). .
I think the point is to have anyone in this forum to assist with your problem you need to provide more information. If you are soliciting an individual's assistance your posting probably belong in that person's inbox and not on this forum.
however, please share! based in the little information your project seems very interesting.
 
I think the point is to have anyone in this forum to assist with your problem you need to provide more information. If you are soliciting an individual's assistance your posting probably belong in that person's inbox and not on this forum.
however, please share! based in the little information your project seems very interesting.

I was working with paul over email significantly but he moved me to the forum. it's something so simple (Control 3 7-segment numbers) but between ignition interference, voltage issues, and a plethora of other stuff, something that should have cost $150 at most, has instead cost The better part of $6,000. And I've already got several sold as soon as I get them debugged....

The easy route was using 6B595 shift registers with a custom made controller based on the 328P, but ignition interference jumbled up the bit stream and I couldnt get an ISP to behave on my system to load arduino bootloader. Switched to teensy, darlingtons, and a whole new set of PCB's, ran into issues with cable design, requirements, overloading of cable conductors, and now faulty number changes due to the starter being engaged.
 
Last edited:
Not sure what you're asking for Paul? Everything has been in your inbox at some point or another (same project I've been dealing with for ~6 months).

I answer many emails daily. Unless it's an unresolved bug in Teensy or the website, I delete every message immediately after answering. Still, I get far behind on emails while doing any sort of development, but at least deleting them helps. Whatever emails I previously answered are long gone. I also don't generally keep track of who sent what questions. It's just too much to manage while also writing software, developing hardware, and resolving compatibility issues.

Yes, it's impersonal.... but I'm just one guy and there's only so many hours in each day...... never enough to accomplish even a fraction of all the things I want to do. I have to make compromises, and quickly answering questions without following the ongoing conversation in many hundreds of people's projects is one of them.

That is why I wrote that message. I can do much more to help you in less time if you post complete info. In fact, probably one third of all the time I spend on support is begging people to give me enough info to solve their problems!
 
Last edited:
Have you looked into the MegaSquirt EFI schematics? They're posted online. That is a device with an 8 (optional 16) bit Microcontroller running at 5v, it survives cranking, and most any electrical noise when wired in properly. They use an LDO regulator, a couple 1uH inductors, and a few caps. Here's the schematic.
v3pcb_6.gif
Also, make sure you're tapped into the ignition circuit, and not the accessory/radio circuit. The acc circuit gets powered down while cranking in most cars.
 
Last edited:
I wrote software for a system that was located in areas with high EMF and electrical noise back in the early 1990's and this sounds similar to things we would see. The system in question controls high voltage switches (up to 30KV AC at 1000A), and in most cases the controller was located inside the same large metal box as the switches, with the interrupter switches only a couple feet away.

Note I was only the software guy with a little hardware knowledge, so my comments may seem a bit vague and non-specific.

We had three areas that caused us issues. Power supply, isolation, grounding, grounding, grounding and, you guessed it grounding. Did I say only three issues? ;)

The power supply needed to be heavily isolated and had to have relatively large capacitors to smooth out the bumps and handle short power interruptions. IIRC we had about half a second hold over before the relays started dropping out. The depending on the relay load the CPU might last a full second. So make sure you power supply to the electronics is rock solid.

ALL of the inputs and outputs were isolated using opto-isolators. Each side had it's own independently isolated power supply.

Proper grounding was the biggest issue with all of the stuff I worked with. It sounds simple, but it is very, very easy to end up with a ground loop in your circuit somewhere, and this will ruin your day. I have seen dozens of situations where the problem ended up being an unintended ground loop that ended up putting two separate parts of a circuit at different voltage levels. This, along with the high voltages, is why the everything was optically isolated in our case.

I would quadruple check your full schematic for any possible ground loops, and make triple sure that your actual circuit matches the schematic. Multiple times I have seen cases where the floating grounds of parts that are supposed to be isolated are actually tied together when stuff is actually installed.

There was one other problem that we had that may or may not come into play here. On the output side we had plain old 8-bit latch chips driving output to opto-isolators that in turn drove relay drives to 12 volt relays. We would have cases where the EMF was so strong that the output of the latches, opto-isolators and/or the relays themselves would "drop out". The relays would even drop out occasionally due to physical vibration under some very extreme situations. The opto-isolators and relays would "pick up" again quick enough to not be a problem. The real problem was when a latch would reset to all zero outputs when you had previously written a value to them. We believe that the traces to some of the latches were acting as antenna that would pick up the EMF generated by the opening and closing of switches carrying large currents.

The quick fix was to not write directly to the latches. The main code would write to some global variables. A very low level, high priority hardware timer interrupt routine would write the values out to all of the latches 360 times per second.
 
I agree with your comments about grounding.

Many times I've seen systems where people believed in capacitive or magnetic or radio frequency coupling through air between wires, where the problems really turned out to be improper grounding. Those problems do exist, but I've seen many times where people naturally suspected through-air coupling, where the actual cause was through-conductor problems, where return currents took an unexpected path and induced unexpected voltage.

It's particularly important to run a good ground wire together (in as close proximity as possible) to every sensitive signal wire. Shielded cables are best. The shielding helps too, but the most important part is the shield absolutely guarantees a high quality ground is run together with the signal. Especially for complex systems (like cars) where somebody else may later make modifications to the wiring without knowledge of the original design (or knowledge of good signal grounding practice), a shielded cable is the one really reliable way to thwart the human factor or somebody later changing the wiring in a way that eliminates a quality ground together with the signal. Well, usually anyway.
 
Yes, the big issue with the ignition screwing up the bit-shift system was through grounding. If we put 40 feet of #4 wire between the box and the chassis, it worked fine. 2 feet of #18, it screwed up.

On these ones, I have 500uF FM capacitor across the input lines.

this doesnt help with the starter bumping (ignition off) causing the board to run the bounce on a random switch contact. I need to know why it's happening and how to make it not happen.
 
Paul, any idea why it triggered the bounce circuit? The only thing I can see is that the teensy stayed at operational voltage, but the digital pin registered a low through the pullup resistor?
 
Paul, any idea why it triggered the bounce circuit?

I don't even know what "bounce circuit" you're using, so how could I know? Is the circuit a resistor-capacitor filter of some sort?

The only thing I can see is that the teensy stayed at operational voltage, but the digital pin registered a low through the pullup resistor?

If you're talking about the on-chip pullup resistors (again, you mentioned a special circuit but gave no technical info about it), those on-chip pullups are connected to the same power as the rest of the chip. It's virtually impossible for those on-chip pullup resistors to cause an unconnected pin to read low.

Again, this is just guesswork (did I mention how utterly inadequate the information you're posted here is for giving any solid advice)....

If you've got pushbuttons, or any type of open-collector device that only connects to ground and depends on a pullup resistor to establish a logic high, those on-chip pullups are really only useful for relatively short wires in a low-noise environment. Again, I'm only guessing here, because you haven't given a schematic or photo of your wiring, but if the wires are long and especially if they run across some length of the car, you really need a much stronger pullup than the on-chip resistor. A value like 470 ohms might be good.

Also, the wires are long and run span across a car, connecting them directly to the pins is probably not a good plan for long-term reliability. In those sorts of cases, a strong pullup like 470 ohms, or even less, should be used, and then a resistor like 10K between the pullup and the Teensy's pin can offer a huge amount of protection to the Teensy, if bad things like induced noise or accidentally shorting the line to a higher voltage happens. Even that is the most basic level of protection... many systems do much more, like optocouplers.

Yet again, this is really just guesswork. Even working on these types of system in person with excellent documentation is difficult. Remotely through the internet, without specific knowledge of what you're connecting and trying to accomplish makes this advise very generic. I hope it helps, but honestly, I'm really shooting in the dark here trying to help you.
 
On the racecar, dad was running the valvelash tonight, and noticed the numbers on the dial board changing. The numbers can only change via the bounce command....
There is no info there that anyone can use to help you with your problem.
 
Last edited:
If I were working on this in person, I'd connect an oscilloscope, making sure the car isn't earth grounded (the scope is). I'd attach the scope ground to the ground at the board, and the put channel 1 on the pin that's going low unexpectedly, and maybe channel 2 on the power supply. I'd set the scope to trigger on falling edge with the trigger level at about 1 volt.

Without a scope, I'd probably do something like use a second Teensy running on 3 AA cells with a LCD. I'd program it to just increment a count every time the pin changes from high to low, maybe using attachInterrupt().

Or I might write a little scope-like program than stores analogRead() to a circular buffer, but when it sees the pin change from high to low, it stops after about another half the buffer length.

Of course, if I had this stuff in from of me, I'd take a look at how it's all wired up.

Every day I get these kinds of questions. It is frustrating, but I'm pretty used to it. This one is particularly evasive about giving almost any info. Usually when people do that, it's either a student project, or something intended to be sold as a commercial product (by someone without a company, just the idea of forming a company). It's unfortunate, because with good info, I can usually help quite a bit. It's also a bit sad, because these "no info" questions are so time consuming. But it is what it is.
 
I don't even know what "bounce circuit" you're using, so how could I know? Is the circuit a resistor-capacitor filter of some sort?

The bounce library on Teensy.

If you're talking about the on-chip pullup resistors

Yes I am

(again, you mentioned a special circuit but gave no technical info about it), those on-chip pullups are connected to the same power as the rest of the chip. It's virtually impossible for those on-chip pullup resistors to cause an unconnected pin to read low.

If you've got pushbuttons, or any type of open-collector device that only connects to ground and depends on a pullup resistor to establish a logic high, those on-chip pullups are really only useful for relatively short wires in a low-noise environment. Again, I'm only guessing here, because you haven't given a schematic or photo of your wiring, but if the wires are long and especially if they run across some length of the car, you really need a much stronger pullup than the on-chip resistor. A value like 470 ohms might be good.

7 foot Cat50 cable from Winford Engineering, shielded (shielding is not grounded)

Also, the wires are long and run span across a car, connecting them directly to the pins is probably not a good plan for long-term reliability. In those sorts of cases, a strong pullup like 470 ohms, or even less, should be used, and then a resistor like 10K between the pullup and the Teensy's pin can offer a huge amount of protection to the Teensy, if bad things like induced noise or accidentally shorting the line to a higher voltage happens. Even that is the most basic level of protection... many systems do much more, like optocouplers.

See previous statement

Usually when people do that, it's either a student project, or something intended to be sold as a commercial product (by someone without a company, just the idea of forming a company).

Both, in my case. Getting class credit and trying to build something I can sell.
 
Ok, here's my recommendation. For testing, add another 7 foot cable. Connect the shield to ground at the Teensy, and leave the shield unconnected at the end with the switch.

Use 2 of the wires in the new cable for the switch signal and ground. Leave the other 6 wires unconnected. For the sake of this test, it's important to NOT connect anything other than the switch to this new cable, so definitely do not use the ground wire inside the new cable for anything other than the switch.

Add a 470 ohm pullup resistor at the Teensy side. The switch either does or does not connect the signal to ground. While you're making changes, add a 10K resistor between the Teensy pin and the cable, so the only thing connected to Teesny's pin is 10K, then 470 ohm and the cable connect to the other end of that 10K. The 10K resistor should be located as close to Teensy as is reasonably possible. Also, because of this 10K resistor, you need to edit your code to use INPUT rather than INPUT_PULLUP.

When it comes to troubleshooting electronics, there's generally 2 approaches. The first involves using test equipment to carefully measure everything and discover what's actually happening (which must be different than anticipated, since the system isn't behaving properly). The other general approach, which fits recommendation, involves trying or experimenting different ways that are more conservative (if trying to fix a problem) or more aggressive (if trying to improve performance or lower costs) until you discover something that makes the difference you want. It's a quite a bit of trial and error, and sometimes you never do end up with a full explanation of why the original way didn't work perfectly.

Let us know if this makes the switch signal more reliable?
 
Paul, I've had to put this aside for a bit but I'm back on it, but I'm not using INPUT_PULLUP, just input pulled high. Perhaps this is part of my problem? I have a slew of 430 ohm resistors (I bought 500 at 3 cents each last year, an EOL product mouser was trying to offload) if I have to go that route, but it won't look pretty.

I had 2 boxes returned to me because the numbers "scroll" up/down randomly with the car running, which tells me that the teensy pins going to the switches are somehow being grounded, or having a ground induced to them. They operate normal with engine off.

This is my entire front-half of the program:

Code:
#include <Bounce.h>
#include <EEPROM.h>

Bounce one = Bounce(1, 20);  // 10 ms debounce
Bounce onetwo = Bounce(1, 1500);  // 10 ms debounce
Bounce twoup = Bounce(0, 40);
Bounce twodown = Bounce(25, 40);
Bounce threeup = Bounce(24, 40);
Bounce threedown = Bounce(23, 40);
Bounce fourup = Bounce(13, 40);
Bounce fourdown = Bounce(27, 40);

HardwareSerial Uart = HardwareSerial();

   unsigned long previousMillis = 0;
   unsigned long currentMillis = 0;
   elapsedMillis sw1lowtime = 0;
   int sw1waiting = 0;

void setup(){
  
  Serial.begin(9600);
 
  int i;
  
 Uart.begin(9600);
 
 pinMode(4,OUTPUT);
   digitalWrite(4, LOW);
 pinMode(26,OUTPUT);
   digitalWrite(26, HIGH);
 pinMode(5,OUTPUT);
   digitalWrite(5, HIGH);
 pinMode(38,OUTPUT);
   digitalWrite(38, HIGH);
 pinMode(39,OUTPUT);
   digitalWrite(39, HIGH);
 
 for(i = 7; i<13; i++){  
     pinMode(i, OUTPUT);
     digitalWrite(i,HIGH);
  }
  for(i = 14; i<23; i++){  
     pinMode(i, OUTPUT);
     digitalWrite(i,HIGH);
  }
  for(i = 43; i<46; i++){  
     pinMode(i, OUTPUT);
     digitalWrite(i,HIGH);
  }

 pinMode(27,INPUT);
   digitalWrite(27, HIGH);
   
 pinMode(13,INPUT);
   digitalWrite(13, HIGH);
   
  for(i = 0; i<2; i++){  
     pinMode(i, INPUT);
     digitalWrite(i,HIGH);
  }
    for(i = 23; i<26; i++){  
     pinMode(i, INPUT);
     digitalWrite(i,HIGH);
  }
    
    updateDisplays(9);
  
}
 
Last edited:
Here are my thoughts:
Ok, here's my recommendation. For testing, add another 7 foot cable. Connect the shield to ground at the Teensy, and leave the shield unconnected at the end with the switch.

Use 2 of the wires in the new cable for the switch signal and ground. Leave the other 6 wires unconnected. For the sake of this test, it's important to NOT connect anything other than the switch to this new cable, so definitely do not use the ground wire inside the new cable for anything other than the switch.

Add a 470 ohm pullup resistor at the Teensy side. The switch either does or does not connect the signal to ground. While you're making changes, add a 10K resistor between the Teensy pin and the cable, so the only thing connected to Teesny's pin is 10K, then 470 ohm and the cable connect to the other end of that 10K. The 10K resistor should be located as close to Teensy as is reasonably possible. Also, because of this 10K resistor, you need to edit your code to use INPUT rather than INPUT_PULLUP.

So, here it is again.

  1. add a dedicated cable for the switch
  2. connect the cable's shield at the Teensy side
  3. only 2 wires in the cable used, any others unused
  4. add a 470 ohm pullup resistor close to Teensy

From your reply, it sounds like you have not actually done any of these. You're complaining that adding resistors would not be pretty.

Well, what do you expect? Do you honestly believe this is going to be so easy? Are you waiting for some magical text to be written on this thread that will make your circuitry start working reliably in a noisy and hostile environment, without you having to actually do anything, even just soldering an extra resistor?

The reality is electrons don't care about your goals. They respond to the physical world. You have a hardware problem. The only way it's going to be solved is by working on the hardware. Yes, it would be nice and easy if you didn't actually have to do any physical work. But that just isn't going to happen. This isn't the sort of thing you can fix in software. There is no magic answer. There's no "thoughts" that will make your project start working, without you having to physically change your hardware.

I believe you will be very lucky if only adding the 430 ohm resistor solves the problem. You probably will need to add a cable or at least a dedicated ground wire. Yes, I know you've already designed your system and adding another wire or another cable is very inconvenient. But the electrons don't care. They respond to the system as it exists, not what you want it to be.

You have real work to do. Get to it.
 
It's more of, I'm working on a negative budget with 5 people mad at me right now. I need simple fixes that I can try without spending $20 on experimental cables and $22 on teensy's (I already found one potentially burned out- parts of ports B, E, and F are completely unresponsive to code)). I'm trying to find out if it's an induced ground, insufficient high signals, or logic issues. I'm working with 2 EE's and neither of them can figure this out on their own time and I can't pay them to do it. I already owe one $3,000 that I don't have on top of the 7,000 I've already spent, for designing this whole system. I'm creeping up on the cost of teensy, and I'm just trying to turn damn LED's on.
 
Last edited:
I'm sorry you're having to experience this so painfully. If I knew a simple solution (not involving hardware changes), I would certainly post it.
 
I'm sorry you're having to experience this so painfully. If I knew a simple solution (not involving hardware changes), I would certainly post it.

I'm trying to do what I can with what I have. I've emptied my savings account and I have $24.81 in my checking account right now, nevermind unpaid school tuition. I spent $7,000 on these last year at Mouser alone (I live 2 miles from their texas HQ, at least that part makes experimenting cheap when I can), and I owe one guy $3,000 for doing all the PCB designs for both versions of these (the design using 595 shift registers, and this version with a masterboard and darlingtons. He is keeping the Eagle files away from me, so I can't send them to you for inspection until I pay him...a long way off). I'm slowly approaching the initial cost of your Teensy project, but I'm not getting any donated funding, and I'm just trying to turn damn LED's on.

Here are some pictures so you can see what I'm working with. Adding 5V pull-ups isn't very feasable because alot of the solder joints are against the case (thus the heavy paper isolator backing), I can add them at the controller but the only 5V source there is in the pin header for the Serial 7 segment module, and I can't see fitting 7 resistor connections on that 1 solder pad easily, without risking further shorts.

I'm under 40 pounds of Bookwork and Assembly, Java, and Objective C programming homework (So much for that spring break thing, doesn't happen in computer engineering), so I still can't do a whole hell of a lot of debugging.

The board pictured, I was supposed to have finished in january, that clearly didn't happen. I had 4 that were supposed to be done in december, i finally got them delivered 3 weeks ago, it took 2 weeks for the people to install them, then sent back because they are scrolling like the switches are being hit. So I have 5 boxes on my hands, and trying to figure this issue out so I can prevent it from happening on this last one. I got laid off from my job 2 weeks ago after wrecking my truck due to falling asleep at the wheel on the way to said job, so I'm rolling on no budget and alot of work. I can make good money selling these things at $250 a piece (bigger companies sell for upwards of $400), but I have to make these things function and work reliably first.

One of those "I need money to make these work so I can make money to pay the people that made these things work so that I could make money" things.
 
Last edited:
Status
Not open for further replies.
Back
Top