Earthed USB Connection required for a specific Sensor to work

Discussion in 'Digital Circuit Design' started by Vladimir Savchenko, Oct 12, 2016.

  1. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Hi Guys,

    I am having trouble with a CO2 Sensor - CDM7160
    I takes 5v and i power it from the same power lines on my PCB though which i power some other sensors and they work quite well.
    This one though seems to be quite sensitive to the ground line.
    If i just power via a standard USB Charger - the internal ADC logic apparently does not work well, and produces some weird results
    If i then connect the Ground of my PCB to the Earth terminal of a power outlet, or to the Ground of a Laptop USB port (connected to the same power outlet) - everything is fine!

    So it seems like the sensor is quite sensitive to some potential difference between the Ground and Earth.
    As in the normal case, where the device is powered via USB- there is no earth, then it is really misbehaving.

    In addition the spec explicitly states:
    CDM7160 is an ESD-sensitive product. No ESD protection components such as zener diodes or varistors are used in this product. It is recommended that ESD protection equipment be used for handling the module during assembly of application products. It is also recommended that ESD protection components and/or an ESD protection enclosure should be used as required for the intended application when this product is embedded into finished products.

    But i understand this - rather that i should be sensitive touching it, and that i should protect it from ESD in terms of static electricity and such.
    Though i am a newbie in this topic, so it may be as well wrong understanding.

    Thanks in advance, Vladimir
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Hello, welcome to the forums!

    If I follow your description the device only works when your system ground is connected to the power line ground? That seems strange by itself. Do you have a link to a data sheet on this device? Your link is more of a sales sheet and short on technical details, even items like what the pins do are missing.

    Do you have a schematic and perhaps even a picture of your build to share? I am wondering if it can be something like a missing power bypass capacitor that "everyone just knows should be there" (so they don't show it).

    As far as ESD goes, that is more likely to cause a hard failure when a zap enters the device and blows up some miniature part inside. Protecting against this can be as simple as having a grounded mat to work on, and wearing a grounded strap. Usually once a unit is assembled inside a case the ESD problems are much lessened.

    Good luck on your projects!
  3. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Thanks for the feedback!
    Yeah.. i am attaching the documents that i got from the manufacturer
    The "Communications Spec.." contains some more details on electrical requirements at the bottom.
    I have also contacted the manufacturer, about a week ago, but since they have not yet replied (besides telling me they are testing), i believe it is either too specific to my circuit or they are also not experts in this
    I have attached the schematic(in Eagle format, i can send it also in screenshots if necessary), but in short - the board is powered via micro usb (bottom left), and the sensor is connected on the GND and 5V of the USB port, just 10 mm from the micro USB (in fact it should be connected on another board at least 100 mm away, but the results are the same)
    I connect it via 10cm jumper wires (but soldering it is the same)
    There is also one ESP8266 which is sleeping while the sensor takes measurements (so no power spikes) (i still have to verify it isn;t somehow using the antenna -thus causing some interference..)
    i tried putting some capacitors directly on the sensor power supply pins (100nf + 1 uf + 100 uf), and also adding some chokes (33 uH, 150 uH) - nothing changed.
    Also since i incorrectly bound the ground of my board to the shield of the usb cable, i cut one usb cable and used just 5v and GND to power the board - it again appears (even used a USB cable with 2 ferrite beads)
    Since the sensor accepts voltages as low as 4.75V, i tried using an LDO (dropping <0.1v @ ~60ma)to stabilize the USB voltage to 4.8V and avoid some potential interference from the Wifi Module - again - no difference

    It only works well if i connect the GND of my board to Earth :)))
    or power via Laptop (which apparently is also Earthed)
  4. MaxHeadRoom


    Jul 18, 2013
    Very unusual for a Lap-Top to be earth grounded, what happens if ran in the portable mode, no power adapter?
  5. MrChips


    Oct 2, 2009
    Please submit a circuit diagram of your interface. Do not submit .zip files or .sch. Files should be in a recognized graphics format such as .jpg, .png etc.

    Are you using UART or I2C interface mode?
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Since For the most part I only have time on breaks at work I view posts on my iPad, which has no eagle editor. Jpg or bitmaps are better, plus many people are Leary of opening zip files.

    Your caps and beads should be way plenty to kill power line spikes, so I have nothing to suggest to you. Please do send the schematic and layout images, maybe something will be seen there.
  7. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Hi Guys,
    I must excuse my self for wasting your time!
    It turned out that apparently on some of my modules i had bad solder joints.
    Once i was able to reproduce the issue consistently i went and tried it on several other modules - some of them were working well some now.
    Then i decided to try and resolder the dozen TH points each module had and voila - the results have improved considerably!

    Maybe this was the first thing that i had to do, but i got really confused by the fact i was getting initially the issue only sporadically and once i started to consistently reproduce it i thought there is some other reason why adding additional earth connection would solve it.

    So maybe i just fell into some rookie trap and resoldering was the thing that i need to have done initially.

    Thank you all for your suggestions, and please accept my apologies!

    Regards, Vladimir
    ErnieM likes this.
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    No apologies as no time was wasted. Sometimes the best way to solve a problem is to talk it out with someone else.

    The trick is by explaining it you order your thoughts. I have dicsovered this method works even when I am speaking to my dog.
    RichardO likes this.
  9. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Aahhh unfortunately it is not over yet, but it is even more weird.
    I have connected 5 devices to one 5x USB Power Supply (40w BlitzWolf)
    One of them was having a bit fluctations, so i tried the trick with connecting the GND of the device to the Earth of the power plug
    - This device recovered - no fluctations
    - 2 other devices started fluctating
    Removed the Earth connection - now all of them seemed well.

    Then i disconnected one of them, based on a different base board for the ESP8266 - NodeMcu Devkit v1 (schematic)

    Then again two started to flucate
    Then i moved it to another USB Power supply (3x IKEA) (connected on the same power plug)
    Fluctation Stopped - all were working fine (even the ones on the different USB Charger)
    Removed it - Flucation started
    Plugged it again but moved it a bit farther (before - all of them where laying next to each other (should have made a photo))
    - Now the devices connected to the 5x charger work fine, but the Nodemcu (connected to a different USB Charger)- started to fluctate

    Even on one trial - i tried to switch the USB ports of two devices connected to the 5x USB Charger - and flucation started.

    Now i am really frustrated :(
    There is no sort of EMI shielding on the devices (except for the Wifi module, which claims to be also FCC/ CE certified)

    Here is the schematic of my device and the board layout. The power comes from the Micro USB on the bottom right
    The sensor is powered via an adapter board plugged in the headers above
    It uses 5V and GND, 3.3V is used for the I2C Pullups on the Adapter board (2kohm), and for i2c, the pins D5 D1 are used.
    I believe it can be a bit hard to track the traces on a picture
    But i would appreciate any sort of advice
  10. Sensacell


    Jun 19, 2012
    I have experienced terrible problems with USB powered devices- by assuming that a USB power supply was capable of driving the load.

    Check that the POWER is clean and solid before you do anything else, USB power supplies are NOT all the same.
    Check it with an oscilloscope while the thing is running.
  11. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Yeah, i noticed some peaks with the scope, yet i coudn't filter them successfully till now ... funny thing was that they were present also when powering via battery, but in this case i haven't experienced problems

    now i found this blog
    which is about a simple circuit to filter out noise from 5V line. i just bought the components, with two different ferrite beads, so i am going to give it a try
  12. Vladimir Savchenko

    Thread Starter New Member

    Oct 12, 2016
    Aahh now for real - it is SOLVED. After more than a week day and night fighting with this guy it turned out to be an EMI issue. Seems like what the spec said - that the sensor has no ESD protection, was actually meant to include also EMI, or i am messing the terms.

    Here is a picture of the sensor output, before i shielded it (left) and after i shileded it (right) with a small glitch (where i disconnected the shield from the board's GND)


    This is how it actually looks
    upload_2016-10-14_17-57-48.png upload_2016-10-14_17-59-8.png upload_2016-10-14_18-0-0.png

    now i suppose i will have to find a way to shield it nicely

    Thanks again for all the feedback!
    gniersma likes this.