How to set up smartphones and PCs. Informational portal
  • home
  • Windows 10
  • Making our own USB sound card with galvanic isolation. Galvanic isolation of the USB interface

Making our own USB sound card with galvanic isolation. Galvanic isolation of the USB interface

It all started as usual, I decided to do something different from doing nothing from the excess of free time. Then I remembered that my friends were complaining about my microphone in the discord, some kind of digital interference was heard, and if I started copying files on my computer, then in general. Buy a normal sound card? This is not about us.

Who is interested I ask under the cat.

Choosing a codec chip


In general, I'm not a fan of making electronics from just about anything, even for myself, especially from Chinese components with Ali, so the first thing we do is go to digikey and look for something. The first thought was to take a full-fledged codec chip and connect it to STM32, and only from him USB... In principle, it is not difficult, but at some point I realized that I didn’t want to bother so much and decided to find something “all in one”. Google persistently issued CM108 from C-Media Electronics, manufacturer based in Taiwan. Well, okay, so be it

The codec requires itself EEPROM, and even offers a specific analogue from STMicroelectronics M93C46-WMN6TP I quickly found it on the same digikey (Integrated Circuits (ICs)> Memory). Just in case, I connected its power supply through the filter so that it would not bring us anything bad to the power supply of the codec.

Also quartz, etc. I am a fan of making everything smaller and more compact, then I put the series ABM3(ABM3-12.000MHZ-B2-T) 5 on 3.2 mm (don't put the same giant HC-49)

Audio connectors


Then we are looking for the headphone and microphone connectors themselves. I personally prefer CUI for audio and simple household power connectors 5.5 , I always put them, of course, search on digikey (Connectors, Interconnects> Barrel - Audio Connectors).

In my case, I already had a component ready in the library under SJ2-3574A-SMT since I have already used it before, it would be possible to choose multi-colored (in CUI there is), but I did not want to (I do it for myself, somehow I will figure it out).

Usually capacitors are placed in series ( 0.47uF or 1uF, can 4.7uF), it can be tantalum or ceramic, but it is best to use film. In the reference circuit in the datasheet they offer 470uF, which is too much, we choose 0.47uF(if you need very low bass, then you can 1uF). Film capacitors are available in SMD cases, which is very convenient, I put ECP-U1C474MA5 in the case 1206 .

Power supply galvanic isolation

And now the fun part

CM108 has 2 modes, 100mA and 500mA, of course, I chose fatter, so that in a big way, 500mA * 5V = 2.5W, a little with a margin, we need to find a solution somewhere on 3W, set the parameters (in the Power Supplies section - Board Mount> DC DC Converters) and see what is cheaper, also remembering to weed out manufacturers that you do not really trust. The choice fell on CC3-0505SF-E from TDK(although I really wanted to put from murata!). It costs a lot, 11 bucks, but it can't be helped.

After that, I put a filter, not forgetting about the capacitors 0.01uF and 0.001uF to weed out any high frequency heresy tk. it even crawls through electroplating. Yet 100uF electrolyte, it will definitely not be superfluous.

Interface decoupling


Power decoupling is good, but it doesn't hurt to untie it yourself USB interface. In the Digital Isolators section (Isolators> Digital Isolators) you can find a suitable one, I chose ADUM4160 from Analog Devices.

Do not forget to tighten DATA P on USB interface to 3.3V since this tells the host (PC) that a device has been plugged into the port and it would be necessary to start working with it, in an amicable way, this brace should be inside the microcircuit, but for some reason it is not there.

Well, the little things

Myself USB connector of course from Molex, you can also from TE or Wurth... Or look at others, but I think that it is better to choose such connectors from these three, the rest are good, but in a different way.

I also decided that if so much money was spent on clean food, then everything must be done well to the end, and the decoupling of digital and analog ground is no exception. Moreover, instead of the usual jumper on the board, I put a filter BLM15(when wiring the board, it is better to move the separation of the ground closer to the main ground, i.e. to GND the output of our isolator for power supply, there the digital and analog ground should diverge)

Conclusion

Well, that's all, I spread the board in 4 layers of a standard class, after preparation for production it will cost about 130 rubles. Also, 4 layers are better in terms of the fact that it is better to make polygons of power, land and digital land as full-fledged polygons, in an amicable way, each power supply has its own layer, but I have power and digital land on one.

It took about an hour and a half from the idea to the complete layout. The board came out in size 22 on 66 mm.

Honestly, while I was writing the article, I already didn't want to order a fee (well, as always), so let it be at least an article.

P.S. I often kill time like this by spreading various projects, from simple wireless chargers to wiring processors and ... I lose interest in most cases (and because it's free, no need to spend money on components). If you are interested in such articles, you can offer your ideas for the next projects

P.P.S. Due to the fact that the board did not order and did not check, errors are possible.

  1. Is there a galvanic isolation from the USB port?

    USB oscilloscopes are not galvanically isolated from the USB port. Portable and desktop also have no decoupling from the USB port when connected to a computer. The reason for this is that the data transfer rate between the device and the computer is 240 Mbps. Such a speed cannot be “unleashed” by a transformer. Optical isolation at this speed will be very expensive. However, USB devices simply need to be ground isolated when measuring devices connected to the mains. There are several approaches for this.

    1. Use a laptop (netbook). It does not have a ground contact at all, and the pulsed power supply unit is galvanically isolated.
    2. Use a computer that is powered by an unplugged UPS.
    3. Use a separate device for galvanic isolation of USB devices. It provides a maximum speed of 12 Mbps, but since USB oscilloscopes are backward compatible with USB 1.1, they will work at this speed, although the signal refresh rate on the screen will be several frames per second.
  2. What is the maximum level of the measured signal?

    The passport value of the maximum signal level applied to the input during measurement is 35V. when using an attenuator in 1X mode, do not measure a signal whose peak oscillation exceeds 35V. If you suspect that the signal being measured has a larger peak value, then switch the attenuator to the 10X position. 35V is the nameplate peak value that includes both the DC component and AC oscillations with a frequency of less than 10KHz. For example, if the DC component is 20V and the AC component has an amplitude of 60V, then the oscillation will occur from -10V to 50V. Peak: 50V. In this case, use the 10X mode on the probe attenuator.

  3. What is the protection at the entrance?

    A protective diode is installed at the input. The manufacturer's engineers said that if the contact of the probe "ground" is connected to "ground" (the concept of "ground" is relative, often means "common wire"), then the device should work without problems and even if the maximum limit is exceeded even 2 times. However, this is not the nominal operating mode of the oscilloscope and in the event of a breakdown of the device it is not a warranty case.

  4. From what value is the noise level calculated?

    The absolute noise value differs at different V / div value settings and is calculated from full scale. For example, with a value of 5 V / div and a specified noise level of 3%, the maximum absolute noise value is: 5 V * 8 divisions * 3% = 40 * 0.03 = 1.2V. Exceeding this level is a device defect. Any noise level less than this value is normal operation of the device. From our practice of testing devices, most have a noise level of about 1.5%, but some actually have noise closer to 3%.

  5. How many significant bits are there really in the ADC?

    The 2090,2150,2250 devices use an 8-bit ADC. At low frequencies, the number of significant bits is close to 8. As the frequency increases, the number of significant bits decreases smoothly. At the highest frequencies, it is over 6 bits. The manufacturer does not provide exact frequency values ​​and dependence graphs.

  6. What if the LED does not light up when plugging the device into USB?

    First, check if the computer is turned on, if the USB port is working (connect a known working device to it, for example, a flash drive). Install the correct oscilloscope drivers. Without drivers, the oscilloscope may not initialize and the LED will not turn on. Try doing this all on a different computer. If all else fails, chances are high that the oscilloscope is faulty. This usually occurs due to exceeding the maximum permissible level of the measured signal or violation of the operating conditions.

  7. What is the USB baud rate?

    The manufacturer uses the CY68013A chip, which in theory can deliver up to 480Mbps, but the actual transfer rate between the device and the computer is 240Mbps.

  8. Can the oscilloscope be used with USB 1.1?

    Yes, you can, but very difficult due to the very low transmission speed (12Mbps).

  9. Clicks are heard from the device when switching V / div. This is fine?

    Yes. The oscilloscope uses quality relays to switch signals. They create these sounds.

  10. Where can I see the device in open form?

    The DSP-2150 model is shown here: http://www.artem.ru/cgi-bin/photo?c=l&cid=115 We do not have photos of other models.

  11. In the documentation and on the website, the buffer size is indicated as 10-32 or 10-64K. What is the actual size of the buffer?

    The total buffer size is 64K. In dual-channel mode, the buffer size per channel is from 10K to 32K. In single-channel mode from 10K to 64K. The buffer size can be selected in the program. Not all buffer sizes are available at certain sample rate settings.

  12. How is signal interpolation used? Why is it needed?

    The following is only true for the DSO-2150 model. For other models, the values ​​of buffers, speeds and boundaries of the beginning of the use of interpolation may be different.

    Explanation from the manufacturer:

    For values ​​less than 10μs per division, data interpolation (sinX) / X is used.

    Further, our reasoning (their correctness is not guaranteed):

    There is only one buffer size available at this speed - 10,000 samples. There are 10 bars on the screen. We get:
    10 μs / div * 10 div = 100 μs full screen
    10,000 samples / 100 μs = 100,000,000 samples / 1 sec
    those. at 10μs / division the rate will be 100MS / s.
    If we set the next smaller division (4 μs), then the required measurement speed increases by 2.5 times. To fill the screen with 10,000 measurements in the allotted period, a speed of 250MS / s is required, and the DSO 2150 oscilloscope gives a maximum of 150Ms / s. What to do? Interpolate! Those. for DSO-2150 at 4 μs / division and less, it really does not have time to measure all 10,000 values, but measures how much it can and transmits data, and the software draws on them using sin (x) / x or another selected interpolation mode.
    Attention! Using the sin (x) / x interpolation mode heavily loads the processor and slows down the display of information in the program.

  13. Where is it better to connect the oscilloscope directly to a computer or to an external USB switch?

    The manufacturer recommends connecting the oscilloscope directly to the computer using both plugs. In our practice, connecting to an external USB switch does not affect the signal quality, but it helps to reduce the current load on the computer ports.
    Our conclusion: you can connect to both the computer and the switch.

  14. Does the device continue to measure while transmitting data?

    No. The oscilloscope works in sequence. First, it fills the buffer with the measured data, then transfers the received data via USB. No measurements are taken during transmission and the trigger can be skipped.

  15. What is the maximum sampling rate?

    For the DSO-2150 device, it is 150 MHz. This frequency is only achievable in single channel mode. When using both channels, the maximum frequency is 75MHz per channel. Likewise for other models.

Other questions

  1. What are the advantages of buying from us?
    • We understand what we are selling;
    • We have official DIRECT deliveries from China;
    • We have a connection with the engineers of the manufacturer, and we can refer your questions to them;
    • We have good prices;
    • We ship goods all over Russia;
    • We give a guarantee up to 3 years;
    • We have translated the documentation for you;
    • You can return the device to us within 14 days after receiving if it does not fit you.
  2. Are Hantek, Voltcraft, Darkwire, Protek, Acetech the same thing?

    Yes. The real manufacturer is QINGDAO Hantek Elelctronic Co. (http://www.hantek.com.cn) in Qingdao, where one of the major industrial centers of the PRC is located. They allow some vendors to re-label their products with the vendor's own trademarks.

How to choose a model?

First of all, you need to decide what frequency signals you are going to work with.

There are three main parameters: analog bandwidth, sample rate, and real-time bandwidth.

The analog bandwidth and sampling rate are specified in the passport data.

Real-time bandwidth is calculated as the sampling rate divided by 2.5.

Mathematically, it should be divided by 2, but this is a borderline value for ideal conditions and an ideal filter, which should not be particularly expected.

The sampling rate is the same as the number of samples (samples) per second.

Digital oscilloscopes, in theory, can operate in real time and in equivalent sampling mode.

Real-time sampling allows you to accurately shape even a single signal. A repeating signal is considered as a set of single signals. Real-time bandwidth plays an important role in this mode.

Suppose you have a 50MHz signal and an oscilloscope with an analog bandwidth of 400MHz and a sampling rate of 100MHz., Alas, it will not be able to reproduce the signal qualitatively, since 100MHz / 2.5 is less than 50MHz. Those. the real-time bandwidth is less than the frequency of the measured signal, therefore, for the real-time measurement mode, the analog bandwidth must be at least equal to the frequency of the measured signal, and the sampling frequency must be at least 2.5 times the frequency of the measured signal. However, if a signal with a frequency of 50 MHz is considered at a sampling rate of 100 MHz, then there will be only two measurements for one period, which may not be enough for you, i.e. the more times the sampling frequency exceeds the signal frequency, the more accurately the waveform of the observed signal is displayed.

DSO 2090,2150,2250 models operate in real time.

In Equivalent Sampling mode, the oscilloscope takes multiple samples of a repetitive signal, each time receiving a signal value with a different offset from the trigger. In fact, many points are measured in different signals and the exact waveform is reconstructed from them - this is a kind of successive approximation method. Obviously, this method only works for a precise and repetitive signal. In this mode, the analog bandwidth plays the main role, the sampling rate is not so important.

Suppose you have a repeating 200MHz signal and an oscilloscope with 200MHz analog bandwidth and 100MHz sampling rate in equivalent time sampling mode. You will get a good display of the waveform as the analogue bandwidth will skip the waveform and the waveform will be recovered from multiple measurements at different points from the trigger detection.

DSO 2090,2150,2250 models do not have equivalent sampling. Model supporting this mode: DSO-5200A.

Some cookies are required for secure log-ins but others are optional for functional activities. Our data collection is used to improve our products and services. We recommend you accept our cookies to ensure you’re receiving the best performance and functionality our site can provide. For additional information you may view the. Read more about our.

The cookies we use can be categorized as follows:

Strictly Necessary Cookies: These are cookies that are required for the operation of analog.com or specific functionality offered. They either serve the sole purpose of carrying out network transmissions or are strictly necessary to provide an online service explicitly requested by you. Analytics / Performance Cookies: These cookies allow us to carry out web analytics or other forms of audience measuring such as recognizing and counting the number of visitors and seeing how visitors move around our website. This helps us to improve the way the website works, for example, by ensuring that users are easily finding what they are looking for. Functionality Cookies: These cookies are used to recognize you when you return to our website. This enables us to personalize our content for you, greet you by name and remember your preferences (for example, your choice of language or region). Loss of the information in these cookies may make our services less functional, but would not prevent the website from working. Targeting / Profiling Cookies: These cookies record your visit to our website and / or your use of the services, the pages you have visited and the links you have followed. We will use this information to make the website and the advertising displayed on it more relevant to your interests. We may also share this information with third parties for this purpose.

Why is this necessary?

A peculiarity of the USB standard is that peripheral devices have a common ground with the USB host and are electrically connected to the “dirty ground” of a pulsed power supply unit and, accordingly, the entire PC.
If your computer is not grounded correctly (you need a separate valid third ground wire in the European socket), then in addition to noise and interference, you can get a "phase" of the mains voltage and a potential of approx. 110V with all that it implies.

The USB isolator eliminates ground loops, electrically disconnects dirty ground, reduces interference and noise, and protects both PCs and external equipment from damage. This is especially useful when working with PC-based measuring instruments (USB oscilloscopes, logic analyzers, etc.) or in industrial environments and is a must in medical equipment.

In our audio application, it will also be useful to galvanically isolate the PC and the external USB DAC.
Industrial USB isolators cost $ 200… $ 400. I suggest you save a little and get a new experience!

How does the ADuM4160 work?

Analog Devices manufactures a series of digital USB isolators using the patented iCoupler technology.

Fragment is excluded. Our magazine exists on donations from readers. The full version of this article is available only


--
Thank you for the attention!

Sprint Layout 6.0 board(sent by Eugene Red, edited by Igor Datagor):
🕗 15/07/13 ⚖️ 31.6 Kb ⇣ 211 Hello reader! My name is Igor, I'm 45, I'm a Siberian and an avid amateur electronics engineer. I have invented, created and maintain this wonderful site since 2006.
For more than 10 years, our magazine has existed solely at my expense.

Good! The freebie is over. If you want files and useful articles - help me!

--
Thank you for the attention!
Igor Kotov, editor-in-chief of the "Datagor" magazine

Datasheet on ADUM4160

  • Computer hardware,
  • Electronics for beginners,
  • Energy and batteries
  • There is such a thing in electronics as galvanic isolation. Its classic definition is the transfer of energy or a signal between electrical circuits without electrical contact. If you are a beginner, then this wording will seem very general and even mysterious. If you have engineering experience or just remember physics well, then most likely you have already thought about transformers and optocouplers.

    The article under the cut is devoted to various methods of galvanic isolation digital signals... We will tell you why it is needed at all and how manufacturers implement an isolation barrier “inside” modern microcircuits.

    Speech, as already mentioned, will focus on the isolation of digital signals. Further in the text, under the galvanic isolation we mean the transmission of an information signal between two independent electrical circuits.

    Why is it needed

    There are three main tasks that can be solved by decoupling a digital signal.

    The first thing that comes to mind is protection against high voltages. Indeed, providing galvanic isolation is a safety requirement for most electrical appliances.

    Let the microcontroller, which naturally has a small supply voltage, sets the control signals for a power transistor or other high voltage device. This is more than a common task. If there is no isolation between the driver, which increases the control signal in terms of power and voltage, and the control device, then the microcontroller runs the risk of simply burning out. In addition, I / O devices are usually connected to control circuits, which means that a person pressing the "turn on" button can easily close the circuit and get a blow of several hundred volts.

    So, the galvanic isolation of the signal serves to protect people and technology.

    No less popular is the use of microcircuits with an isolation barrier for interfacing electrical circuits with different supply voltages. Everything is simple here: there is no "electrical connection" between the circuits, therefore the signal, the logical levels of the information signal at the input and output of the microcircuit will correspond to the power supply on the "input" and "output" circuits, respectively.

    Galvanic isolation is also used to improve the immunity of systems. One of the main sources of interference in radio electronic equipment is the so-called common wire, often this is the body of the device. When transmitting information without galvanic isolation, the common wire provides the total potential of the transmitter and receiver necessary for transmitting the information signal. Since the common wire usually serves as one of the power poles, connecting various electronic devices to it, especially power ones, leads to short-term impulse noise. They are eliminated by replacing the "electrical connection" with an isolation barrier connection.

    How does it work

    Traditionally, galvanic isolation is based on two elements - transformers and optocouplers. If we omit the details, then the former are used for analog signals, and the latter for digital signals. We are considering only the second case, so it makes sense to remind the reader of who the optocoupler is.

    To transmit a signal without electrical contact, a pair of a light emitter (most often an LED) and a photodetector is used. The electrical signal at the input is converted into "light pulses", passes through the light-transmitting layer, is received by the photodetector and converted back into an electrical signal.

    Optocoupler is very popular and has been the only digital signal decoupling technology for several decades. However, with the development of the semiconductor industry, with the integration of everything and everyone, microcircuits have appeared that implement an isolation barrier at the expense of other, more modern technologies.

    Digital isolators are microcircuits that provide one or more isolated channels, each of which "overtakes" the optocoupler in terms of speed and accuracy of signal transmission, in terms of immunity to interference and, most often, in terms of cost per channel.

    The isolation barrier of digital isolators is manufactured using various technologies. Famous company Analog Devices in digital isolators ADUM uses a pulse transformer as a barrier. Inside the microcircuit case there are two crystals and a pulse transformer made separately on a polyimide film. The transmitter crystal generates two short pulses on the front of the information signal, and one pulse on the decay of the information signal. A pulse transformer allows, with a small delay, to receive pulses on the transmitter crystal, through which the reverse conversion is performed.

    The described technology is successfully used in the implementation of galvanic isolation, in many respects surpasses optocouplers, but has a number of disadvantages associated with the transformer's sensitivity to interference and the risk of distortion when working with short input pulses.

    A much higher level of immunity to interference is provided in microcircuits, where an isolation barrier is implemented on capacitors. The use of capacitors eliminates the DC coupling between the transmitter and the receiver, which is equivalent to galvanic isolation in signal circuits.


    If the last sentence excites you ..

    If you feel a burning desire to scream that there can be no galvanic isolation on the capacitors, then I recommend visiting threads like this. When your rage subsides, notice that all of this controversy dates back to 2006. As you know, we will not return there, as in 2007. And insulators with a capacitive barrier have been produced for a long time, are used and work perfectly.

    The advantages of capacitive decoupling are high energy efficiency, small dimensions and resistance to external magnetic fields. This allows you to create inexpensive integrated isolators with high reliability rates. They are produced by two companies - Texas Instruments and Silicon Labs... These firms use different technologies for creating the channel, but in both cases silicon dioxide is used as a dielectric. This material has a high dielectric strength and has been used in the manufacture of microcircuits for several decades. As a result, SiO2 is easily integrated into a crystal, and a dielectric layer several micrometers thick is sufficient to provide an insulation voltage of several kilovolts.

    On one (Texas Instruments) or both (Silicon Labs) crystals, which are located in the digital isolator case, there are capacitor pads. The crystals are connected through these pads, so the information signal travels from the receiver to the transmitter through the isolation barrier.

    Although Texas Instruments and Silicon Labs use very similar on-chip capacitive barrier integration technologies, they use completely different principles for transmitting the information signal.

    Each isolated channel at Texas Instruments is a relatively complex circuit.

    Let's consider its “lower half”. The information signal is fed to RC-circuits, from which short pulses are taken along the front and back of the input signal, and the signal is restored by these pulses. This way of passing the capacitive barrier is not suitable for slowly varying (low frequency) signals. The manufacturer solves this problem by duplicating channels - the "lower half" of the circuit is a high-frequency channel and is intended for signals from 100 Kbps.

    Signals with a frequency below 100 Kbps are processed on the "upper half" of the circuit. The input signal undergoes preliminary PWM modulation with a high clock frequency, the modulated signal is applied to the isolation barrier, the signal is reconstructed using pulses from the RC circuits and further demodulated.
    The decision circuit at the output of the isolated channel "decides" from which "half" the signal should be applied to the output of the microcircuit.

    As seen in the Texas Instruments isolator channel diagram, both the low frequency and high frequency channels use differential signal transmission. Let me remind the reader of its essence.

    Differential transmission is a simple and effective way to protect against common mode noise. The input signal on the side of the transmitter is "split" into two signals V + and V- inverse to each other, which are affected by common-mode interference of different nature in the same way. The receiver subtracts the signals, and as a result, the interference Vsp is eliminated.

    Differential transmission is also used in digital isolators from Silicon Labs. These microcircuits have a simpler and more reliable structure. To pass through the capacitive barrier, the input signal is subjected to high-frequency OOK (On-Off Keying) modulation. In other words, a "one" of the information signal is encoded by the presence of a high-frequency signal, and a "zero" - by the absence of a high-frequency signal. The modulated signal passes through a pair of capacitors without distortion and is recovered at the transmitter side.

    Silicon Labs digital isolators outperform ADUMs in most key performance areas. ICs from TI provide about the same quality of work as Silicon Labs, but in some cases they are inferior in signal transmission accuracy.

    Where does it work

    I would like to add a few words about which microcircuits use an isolation barrier.
    The first are digital isolators. They represent several isolated digital channels combined in one housing. Microcircuits are available with various configurations of input and output unidirectional channels, isolators with bidirectional channels (used for decoupling bus interfaces), isolators with a built-in DC / DC controller for power isolation.

    Top related articles