Shop OBEX P1 Docs P2 Docs Learn Events
USB disconnects in automotive environment.... — Parallax Forums

USB disconnects in automotive environment....

So I have been testing a circuit that reads several sensors in a vehicle, but for some reason, the USB keeps disconnecting at high RPM. Everything else keeps working properly on the circuit board. I know that an automotive environment is quite electrically noisy, but even my 2 ADC circuits are reading smooth up to when the USB disconnects, then I can't see the data afterwards. The FTDI UART is connected exactly how the Parallax Prop Plug shows on the datasheet except for a removable jumper between the reset pin on the Prop and the UART. This is to prevent the circuit from restarting when plugging in the USB to the laptop while the circuit is running. The problem does not happen all the time, but happens quite often. The UART is powered from the Laptop and the negative (-) is bonded to the circuit board's low voltage ground plane. The shield of the USB cable is not bonded to anything on my current circuit board.

How can I fix this issue? Is it possible, my power supply is not filtering the 12V automotive power properly? Does anyone have a fail proof circuit to power the Prop and 5V ADC circuits in a very electrically noisy environment?
«13

Comments

  • eagletalontimeagletalontim Posts: 1,399
    edited 2016-05-30 21:12
    Maybe this will help... I don't have a schematic.

    *** EDIT : The top ground plane is unfilled for easier viewing purposes.
    670 x 700 - 425K
  • Can you try running the power from one of those little 5V Li battery 'charger' packs instead of the laptop/car system?
    Is your system in a well-shielded box ?
  • I don't think I could change the UART to run from a battery since it requires more circuitry and a couple of pin changes that I can't do without redoing the whole board. Unfortunately, the only box I can afford is a plastic box. It just seems strange that only the USB is having issues, but everything else works fine. The last circuit I tried had the UART tied to the box's 5V rail instead of powered from the laptop and it had the same disconnect issues as well. When I used the Prop Plug, I did not get any disconnects while using the Prop Terminal on a breadboard and wires all over the place in the floor board.
  • kwinnkwinn Posts: 8,697
    Try lining the box with aluminum tape to see if that helps.
  • Do I need to connect the ground to the shielding / tape if I do that?
  • kwinnkwinn Posts: 8,697
    Do I need to connect the ground to the shielding / tape if I do that?

    Depends on the type of interference so you could try it without grounding first and add it if that does not help.
  • Well, the foil tape did not work :( Maybe I need to redesign the whole board again.... I really need an electronics engineer to look at my circuit and give me pointers. I am by no means an engineer.

    I have tried no ground plane and single traces for the ground and a full ground plane for all 5V and 3.3V components. Neither worked. I am starting to wonder if I should connect the shield of the USB to the ground of the board. The device is plugged into a Laptop and hardly ever into a desktop so the shield is never contacting common ground of the vehicle. Should I try to connect the USB shield to the ground plane or straight to the negative input on the board? The ground plane is connected to the negative side via a 0.05 trace.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-12 14:38
    It sure would help if you posted the ground plane layer as well or even include a colored screenshot. I have my Protel package set to transparent with slightly reduced colors so I can see through the layers enough. I see so many opportunities in the routing to improve the ground plane just by moving a via a little out of the way here and there etc. It pays to put more than just one via in as you can reduce the impedance with vias strategically placed.

    Your FTDI circuit for some reason is copied straight from the Parallax Prop plug schematic without reference to the FTDI datasheet itself. I say this because you have a 4.7uF across the VCC but that is relatively high-impedance at high frequencies so you should always put a ceramic decoupler across it close to the chip as well such as a 0.1uf. I've seen quite a few Parallax schematics that are can I say.. a bit "amateurish". So always do your homework and don't just copy a circuit, even the best circuit, without checking to see what's best for you.

    The shield should normally be connected only from one end but I don't think it's going to affect anything in terms of ground loops if you do short it across to your board's ground, at least to see if this helps.

    I've attached a section of the schematic of my "Prop Plug" which while pin compatible also has 4 extra pins in IDC fashion which include VCC and I2C.
  • What is the FB1 in your schematic? You do have several more ceramic caps than I have in my design. I figured since the Prop Plug worked on the breadboard design, it would work on the final circuit board. I thought wrong :P

    I have attached the PCB in DipTrace format. Maybe that will help. Pretty much all components are filled out with their values.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2016-06-12 15:02
    Here is the datasheet to the the FTDI chip I am using : http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf Page 7 of the PDF.

    And here is the 5V regulator I am using now. The original one got too hot for my comfort. : http://www.recom-power.com/pdf/Innoline/R-78Exx-0.5.pdf
  • Try grounding pin 18 of the FTDI chip, I think you missed that one.
  • Oh wow. Did not see that. I will do that and see what happens.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2016-06-12 15:31
    Anything else you see I might need to change? I will have to order new boards so I hope to get all the circuit problems fixed before I wait for 3 weeks to get boards that are still messed up!

    EDIT *** I also have a strange thing that happens every time. If the circuit is turned on first, then the USB is plugged up, the Prop will reset which is highly undesirable. I ended up having to put a jumper on the Prop Reset pin so this would not happen. This makes it a pain to program the chip since I have to open the box, connect the jumper, then program it every time. Is there a different way to do this so I can leave the jumper always connected?
  • Well that was the most obvious and it is very easy to fix as I would just scrap off the solder mask next to pin 18, tin the bare copper and bridge it across either with a little solder or I like to use a single strand of wire from an IDC cable if necessary. I'm just having a general play with diptrace as it is a little awkward to use compared to my Protel and I wish these guys would add some quick keyboard shortcuts as the keyboard is otherwise wasted.

    Some questions which maybe a schematic would help with too:
    Why are you using a DIP EEPROM when everything else is SMD?
    What is the supply voltage as I see you are driving the 3.3V regulator directly from it. Careful of 5V switchers feeding A/D chips directly as you will have switching noise, either use a filter or follow it with a linear regulator (at a lower voltage).

    I try to avoid adding USB serial onto the board directly but if it's something you use all the time then that's fine although I prefer micro USB connectors (with through hold lugs).

    If you use an smd crystal, even 6MHz (96Mhz) or 10MHz (80Mhz) you will find it a lot easier to route it cleanly around that area. Those crystals are cheap and those frequencies are plenty plenty fine, believe me. I will see if I find anything else but you are doing well.
  • I thought about switching to an SMD EEPROM, but I have a bunch of DIP in stock already so I figured I would use those until I run out.

    The supply voltage is automotive "12V" and the regulator was a test to see if it would work. It can handle up to 40V input. I don't like the new chip, so I will revert back to regulating down to 5V, then use an LDO 3.3V regulator from there. I have had a bad problem with flyback spikes from relays or other coil type items on the same power input. I was thinking of putting a larger cap after the diode before the regulators and try an inductor again. My last power supply did not protect against flyback voltages either. Still battling with that one....

    The USB is not only used for programming the chip as the circuit provides the end user a way to communicate directly with the board and see live data through my Windows program I have written. It also allows the user to adjust certain variables that are used for calculating different outputs based on their vehicle.

    I did search for an SMD crystal that would fit, but was worried about using a different size than a 5Mhz crystal. Digikey is where I place my large stock orders and I was not able to match up a good fitting one :(
  • eagletalontimeagletalontim Posts: 1,399
    edited 2016-06-12 16:22
    And, C11 above the diode and inductor on the bottom left of the board is only a 100uf electrolytic cap.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-12 16:37
    If you are trying to use up old stock but don't allow for new stock then you just end up being stuck with ordering old stock again if you know what I mean. At least dual footprint stuff like this as you always have an option to use either DIP or SMD. Extra footprints costs nothing if there is room for them.

    Now I hope you are not saying it can handle 40V because the component datasheets says 40V. A car can get really good economy but you won't be able to drive it with your foot flat to the pedal at the same time. So in similar manner you may operate the regulator at up to 40V input but don't expect to draw much current from it before you start to exceed the power rating of the package and how it has been mounted. 12V down to 5V at 100ma will dissipate the difference in voltage as heat, so you are dissipating 700mw in a tiny package and the regulator will not like that. Try running it at its rated 40V but at 100ma and it should give you a nice bit of magic smoke in return.

    If you want a reliable design just use those switching regulators as you mentioned, the other thing is that because they use an inductor in series with the load it effectively becomes an extra filter. By the same token the output of a switching regulator has high frequency ripple, not a problem for digital circuits but don't try to run analog directly from it. The 3.3V regulator is really happy if you run it from the 5V switcher, it's a great partnership, use it.

    If you are battling with big spikes coming through the power rail then consider using a common-mode choke but that means feeding both the power and the input ground through it.

    As for crystals if you try to stick to 5Mhz you don't have much choice in SMD but use 10Mhz and change your clock parameters to x8 PLL mode so you still get 80MHz.
    I've used many different types including small through-hole cylindrical cases but also a lot of 5x3mm 2-pad smd devices like this one. I will have to dig deeper to find some other part numbers.

  • What do I need to look for in this common mode choke? I have never heard of these and would like to buy the right one to play with / test.
  • kwinnkwinn Posts: 8,697
    You want a choke with the highest impedance that will handle the current your circuit requires. Size and DC resistance should also be considered.

    What is the maximum current drawn of your circuit, and what is the minimum voltage drop across the regulator.
  • The maximum current draw is around 100ma on the low voltage side with the standard led display connected to the display port. With a digital back lit display, the draw can go up to 300ma. So I would probably have to base this from 300ma draw from the 5v regulator. Before the regulator, I am not sure...

    The minimum voltage drop across the regulator is not on the data sheet, so I am not sure. The data sheet is listed above in a pdf link.
  • The choke would always be in the input supply, never the regulated side. The other way around this and maybe even cheaper is to use a DC-DC converter. So in place of your 5V switcher you could fit a 12 to 5V switcher perhaps. You still might have a problem with you I/O but isolating the power sure helps. You can easily cut down your 300ma on the backlight if you PWM this as t is unlikely you would need it full brightness.

    However I thought your main problem was that you had not connected pin 18 ground of the FT232R chip, surely that would be a very good reason for it to disconnect on a little bit of noise. I haven't heard you mention anything about this.
  • The flyback issue was brought up and common mode chokes was brought up so I looked into them but was not sure what to look for as far as properties of the component.

    I have not been able to test the grounding of pin 18 yet. My day job takes 90% of my week days :(
  • The flyback issue was brought up and common mode chokes was brought up so I looked into them but was not sure what to look for as far as properties of the component.

    I have not been able to test the grounding of pin 18 yet. My day job takes 90% of my week days :(

    Well you certainly are only adding to the 90% if you ain't doing the .01%. No need to check, I know it is not connected according to your artwork, you just need to bridge it.

  • eagletalontimeagletalontim Posts: 1,399
    edited 2016-06-22 02:52
    Ok... I have checked the circuit board and I must have moved something on the PCB file because all the grounds are connected to the ground plane. So this means I have some other issue that I need to check.

    One thing that comes to mind is the fact that the USB disconnects randomly at higher RPM which means that it probably has something to do with the RPM signal. Since the RPM signal on the vehicle I am testing this in is a 5V pulse each ignition pulse, I use a voltage divider setup with resistors which is R19 and R20 on the above attached Diptrace file.

    The RPM signal can be either 5V or 12V to 15V so I need to be able to detect either voltage ranges without damaging the Prop. The values I have selected are 10K and 100K.

    I hope the spacing works...
    
    ---^v^v^----------- > to Prop
           10K        |
                      |      100K
                      ---^v^v^v-----> To Ground (low voltage ground plane).  It is on the far side of the board away from the UART)
    

    The one thing I see that could contribute to this issue is the ground plane on the top layer is not connected to the bottom ground plane anywhere close to the voltage divider for the RPM input signal. It is connected closer to the middle of the board so it is getting continuity though. Could that be an issue?

    The next thing could be noise filtering. I probably need a BUNCH of help with this. On the car we are testing this on, it has a methanol spray that kicks in once the intake pressure rises high enough. When that solenoid is fired off, the USB seems to disconnect due to that. If the spray is turned off, the USB still disconnects, but randomly and usually high RPM.

    Thoughts?

  • kwinnkwinn Posts: 8,697
    Ok... I have checked the circuit board and I must have moved something on the PCB file because all the grounds are connected to the ground plane. So this means I have some other issue that I need to check.

    One thing that comes to mind is the fact that the USB disconnects randomly at higher RPM which means that it probably has something to do with the RPM signal. Since the RPM signal on the vehicle I am testing this in is a 5V pulse each ignition pulse, I use a voltage divider setup with resistors which is R19 and R20 on the above attached Diptrace file.

    The RPM signal can be either 5V or 12V to 15V so I need to be able to detect either voltage ranges without damaging the Prop. The values I have selected are 10K and 100K.

    I hope the spacing works...
    
    ---^v^v^----------- > to Prop
           10K        |
                      |      100K
                      ---^v^v^v-----> To Ground (low voltage ground plane).  It is on the far side of the board away from the UART)
    

    The one thing I see that could contribute to this issue is the ground plane on the top layer is not connected to the bottom ground plane anywhere close to the voltage divider for the RPM input signal. It is connected closer to the middle of the board so it is getting continuity though. Could that be an issue?

    The next thing could be noise filtering. I probably need a BUNCH of help with this. On the car we are testing this on, it has a methanol spray that kicks in once the intake pressure rises high enough. When that solenoid is fired off, the USB seems to disconnect due to that. If the spray is turned off, the USB still disconnects, but randomly and usually high RPM.

    Thoughts?

    You're probably going to blow the prop pin if you connect the RPM signal like that. A 100K on the RPM signal and clamping diodes on the prop pin side would be safer. A 100K to a transistor & 10K pullup to 3.3V then on to the prop pin would be even better.
  • I have been using the 10K / 100K divider for several years and have not had a problem until now which still, it may not be the problem since I am only reading a 5V pulse. I also wondered about using a transistor and if that would affect the really high reving engine signal. Some of the engines can turn 9K RPM which is 3 to 12 pulses per revolution. I have several transistors on hand that I could test with, but they are standard switching transistors like the 3904 and 3906 or 2222. I would think they can switch fast enough to not "float" at a high RPM. Would I need to add a pull down resistor after the 100K to the base of the transistor?



  • kwinnkwinn Posts: 8,697
    I have been using the 10K / 100K divider for several years and have not had a problem until now which still, it may not be the problem since I am only reading a 5V pulse. I also wondered about using a transistor and if that would affect the really high reving engine signal. Some of the engines can turn 9K RPM which is 3 to 12 pulses per revolution. I have several transistors on hand that I could test with, but they are standard switching transistors like the 3904 and 3906 or 2222. I would think they can switch fast enough to not "float" at a high RPM. Would I need to add a pull down resistor after the 100K to the base of the transistor?

    The 10K as you have it now is OK with 5V, it was the 12V & 15V signal you posted that I commented on. Pretty much any transistor would be fast enough. 9000RPM at 12 pulses per revolution is only 1800Hz. Any one of the transistors you listed is good for 100MHz or more. Probably wouldn't need a pulldown resistor for this application.
  • @Peter Jakacki : What is the FB1 in the USB circuit you posted above? I would really like to get this USB disconnect issue figured out and I am gone as far as I can with my current knowledge :(

    The RPM change did not work. I even disconnected the RPM signal and it still dropped the USB connection :(
  • FB usually means Ferrite Bead, used to suppress EMI noise.
Sign In or Register to comment.