text
stringlengths
83
79.5k
H: Question about magnetic circuits In the below page, I have two questions: How can a magnetic circuit not consume energy? How does the stored magnetic energy return to the circuit? Source: OBJECTIVE ELECTRICAL TECHNOLOGY For the Students of UPSC (Engg. Services); IAS (Engg. Group); B.Sc. Engg.; Diploma and Other Competitive Courses. (Over 3500 Objective Questions with Hints) V.K. MEHTA, ROHIT MEHTA S. CHAND & COMPANY LTD. ISBN : 81-219-2097-3, 2010 AI: How can a magnetic circuit not consume energy? If you spin up a frictionless flywheel to 1,000 RPM (or whatever), you only put in the kinetic energy to get the flywheel in motion at 1,000 RPM. That kinetic energy is now stored in the flywheel and can be used some time later. Other than friction losses, it will continue to spin and hold that energy with no further energy or power input. It's a similar story for an inductor or a capacitor. How does the stored magnetic energy return to the circuit? To keep the energy stored you must force current into the inductor and then short it out. When you disconnect the "short" to something more resistive, the energy stored starts to heat the resistor i.e. it returns to another circuit.
H: LF353 for 12-0V square wave from arduino I have built the following circuit with an LF353N op amp and expecting 0-12V outputs from it. I have built it on a breadboard but the output is always around +12V except the when the (+) input is floating, at that time it is around 6V. What I am doing wrong? Is the LF353 can not work from a single supply? My project would be to create 1Khz 12V square wave with an arduino thats why I would like to built it. Thank you! AI: Common-mode input voltage range is down to 4V with a 0/12V supply according to the datasheet. You are operating one input at 0V/5V and the other at 2.5V. Only one of those voltages is within the common mode voltage range. The output won't swing all the way to 0V or +12 either (more like 1.5V/10.5V typically with a 10K load), but set that aside for now. It would be easiest to use a different op-amp - one that is either rail-to-rail input or "single supply". You may also want rail-to-rail output. Depending on the internal workings of the op-amp you might be able to get away with changing the bias from +2.5V to about +4.6V and allowing the input to go outside the CM voltage range. If that doesn't work, you can add two more resistors and change the 0/5V to 4.2V/5V and leave the bias at +4.6V, which will work with your current op-amp (though the output voltage swing won't be 0/12V)
H: STM32-based USB microphone produces hiss I'm building a USB microphone based on STM32F407 discovery board, it captures audio but produces quiet but noticeable hiss with its spectrum shown below: I'm using oversampling to get additional 2 bits of resolution but the issue is present without oversampling as well (I just used DMA to write ADC samples directly into the USB output buffer to test this). Here's my current implementation: DMA settings: hdma_adc1.Instance = DMA2_Stream0; hdma_adc1.Init.Channel = DMA_CHANNEL_0; hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY; hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE; hdma_adc1.Init.MemInc = DMA_MINC_ENABLE; hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; hdma_adc1.Init.Mode = DMA_CIRCULAR; hdma_adc1.Init.Priority = DMA_PRIORITY_LOW; hdma_adc1.Init.FIFOMode = DMA_FIFOMODE_DISABLE; ADC settings: hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.ScanConvMode = DISABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING; hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T8_TRGO; // runs at 768 kHz for 14 bit @ 48 kHz // SYSCLK = 96 MHz, TIM8 ARR = 125 - 1 hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DMAContinuousRequests = ENABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; ADC read and oversampling functions: void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) { USBD_AUDIO_HandleTypeDef *haudio = hUsbDeviceFS.pClassData; int16_t *buf_part = haudio->in_buffer + (AUDIO_IN_PACKET / 2) * haudio->in_buffer_half; // get USB mic buffer pointer /* Oversample for +2 bits and remove mic amplifier offset */ for (uint16_t i = 0; i < (AUDIO_IN_PACKET / 2); i++) { int32_t avg_value = 0; for (uint16_t j = 0; j < ADC_BUF_SIZE; j++) { avg_value += adc_buffer[ADC_BUF_SIZE * i + j]; } buf_part[i] = (avg_value / 4) - 6826; } } void ADC_to_MIC(void) { HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buffer, ADC_BUF_SIZE * (AUDIO_IN_PACKET / 2)); } Data IN request handler: static uint8_t USBD_AUDIO_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum) { USBD_AUDIO_HandleTypeDef *haudio; haudio = (USBD_AUDIO_HandleTypeDef*) pdev->pClassData; if (epnum == (AUDIO_IN_EP & 0x7F)) { haudio->in_buffer_half = !haudio->in_buffer_half; uint16_t prev = (AUDIO_IN_PACKET / 2) * !haudio->in_buffer_half; /* double inversion serves as initialization to 1 or 0 */ ADC_to_MIC(); USBD_LL_FlushEP (pdev, AUDIO_IN_EP); USBD_LL_Transmit (pdev, AUDIO_IN_EP, (uint8_t*)(haudio->in_buffer + prev), AUDIO_IN_PACKET); } return (uint8_t)USBD_OK; } What may cause the hiss to appear? I've ruled out hardware issues by reading the ADC into the I2S DAC, there was just a bit of white noise, no hiss at all. Also when I connect ADC input to ground, hiss persists, so I think that the issue is somewhere in the USB part. 1 kHz peak on the spectrum and its harmonics suggest me that the ADC may be out of sync with DataIn host requests because they happen exactly at 1 kHz rate in the full-speed mode but I don't see how to solve this problem. AI: You are just expecting too much from your setup. The 1 kHz peaks are the USB data transfers that happens at a rate of 1 kHz. So that is not "hiss", as hiss would be noise. The STM32F4 Discovery board is a kit to explore and make prototypes, not highly optimized suppressing getting USB bus periodic transactions getting coupled into ADC conversions. Whenever there are periodic packet transactions at 1kHz, also the board power consumption has periodic increases at a rate of 1kHz. Currents flowing in the board at 1 kHz will couple everywhere unless the whole system is carefully designed. So that is what is causing the peak at 1kHz, and it also shows that there are both odd (3, 5, 7 kHz etc) and even (2, 4, 6 kHz etc) harmonics, and as the peak at 4 kHz is larger than nearby peaks, it might tell something about the length of the burst or some other periodic thing happening at 250us rate. It also does not help a bit when the mic amplifier dangles from the Discovery board with 15 cm long jumper wires, instead of having at least some sort of audio cable with at least some kind of shield.
H: No mention of eMMC random performance in datasheets Any particular reason why none of the eMMC manufacturers mention random read or random write performance in datasheets ? Only performance mentioned in datasheets is for sequential workloads. AI: None? I opened two random eMMC datasheets and they both do mention it. First : Random read/write 4866/1542 IOPS Second : Random read/write e.g. 2500/200 IOPS
H: What is the lowest level of CPU programming above transistors? In my CS program, my professor has claimed that NAND gates are the most basic gate to engineer, and so every other gate and higher-level circuits found in CPUs are made from NAND gates (no source found). I'm skeptical of this claim, as it seems prohibitively slow, and I would expect that many optimizations can be made by avoiding such restrictions. My question, then, is: what is the lowest level of programming a standard general-purpose CPU, above physical wires and transistors? My uninformed research has led me to a few possible resolutions. In section 1.3.2 of Fundamentals of Layout Design for Electronic Circuits (pp. 24), the following passage occurs: Considering the physical design of digital circuits, standard elements with an immutable internal structure are stored as cells in a library. These cells, such as logic gates and memories, provide standard functions and their layouts have already been produced. This communicates to me that not just NAND gates, but all logic gates and further functions such as latches, adders, flip-flops, and others, are implemented directly at the transistor level and the next step up is combining these optimized cells. I was satisfied with this answer until I was notified that VLSI chips are sometimes programmed at the gate level, which tells me the next layer is the standard logic gates, though still not just NAND. I've also found mentions of CMOS logic and its capabilities, but lack the expertise to parse an answer to my question from it. Ideally, I'm looking for some definitive list of what functions are directly implemented at the transistor level, and what the next level of abstraction for designing a general-purpose CPU is. I suspect the list is complicated and differs by company and model, but any clarification for a curious layman would help. AI: In my CS program, my professor has claimed that NAND gates are the most basic gate to engineer, and so every other gate and higher-level circuits found in CPUs are made from NAND gates “Yeah? Well, you know, that's just like, uh, your opinion, man.” - The Dude Your professor is … not correct, on several levels. Let's unpack this. NAND gates are the most basic gate to engineer No, they're not. That would be the NOT gate. NAND and NOR are comparably complex, each needing at least two transistors using a pull-up (in CMOS, each type takes four.) so every other gate and higher-level circuits found in CPUs are made from NAND gates The identical claim can be made for NOR, as it is equally complex as NAND and can implement the same palette of functions through application of DeMorgan's Theorem. So the prof's claims are neither true in theory, nor in practice as we'll see below. The prof may be quite surprised to learn that a very important early CPU built using a single gate type (and quite possibly, the only one of such construction, ever) exists in the Apollo Guidance Computer (AGC). This machine's logic was built entirely from just one IC: a dual 3-input (positive-logic) NOR. Not a NAND in sight, nor (pun intended) in flight. More here: http://www.righto.com/2019/09/a-computer-built-from-nor-gates-inside.html And their rationale for choosing that IC: https://www.ibiblio.org/apollo/hrst/archive/1716.pdf. In the most general sense, if you have just two things: inversion, and any kind of Turing-complete base 2-input function, you have the ability to make any kind of logic of any complexity. DeMorgan’s Theorem tells us so. NOR and NAND by themselves satisfy this, as well AND+NOT and OR+NOT. Choose one, or a combination, they all work. Do people still make things out of a single type of gate, be it NAND or NOR? Not so much. Gate arrays or sea-of-gates are extreme examples of this idea, and yes these can be based exclusively on a single inverting logic type like NAND or NOR. Gate arrays have limits, inefficiencies and costs; and as a consequence aren’t so popular anymore. They've been largely supplanted by microcontrollers, CPLDs, FPGAs and of course ASICs. For the hierarchy of chip structures (that is, levels of abstraction), we have as you stated transistors and interconnect wires as the the lowest level. What's the abstraction level above that, then? We’ll get to that, I promise. In the salad days of chip design (think of Jack Kilby, Robert Noyce), the answer was… not much. Transistors and interconnect were laid out polygon-by-polygon and layer-by-layer, by hand (first in rubylith, then later by physical CAD software), to capture the design and create a mask set. This practice originated in bipolar and persisted well into the development of MOS technology. With the publication of their 1978 paper (and later their book based on it), Carver Mead and Lynn Conway changed all that with their structured methodology based on MOS. Among other ideas, they introduced the concept of standard cells, a set of pre-defined functional primitives that can be re-used from chip to chip, and just as importantly, from process to process. Soon, this set of functions came to be offered as a standard cell libraries by the process vendors, characterized on their target process for guaranteed performance. Because the fab vendor guarantees the cells' performance, using the standard cell library flow provides a ‘clean handoff’ from the designer to the foundry that was all but impossible to achieve using the polygons-in-rubylith methods of the 1960s and 70s. (Tip o’ the hat to those early pioneers that did it; the effort needed to make even the simpler chips of the time was huge.) This philosophy of design and re-use, enabled by Mead and Conway's structured design and the standard cell libraries to support it, is what kicked chip design into high gear in the 1980s. Mead and Conway’s book Introduction to VLSI Systems is still available, and although it focuses on NMOS it is still relevant today. Back to the present, and your question. With contemporary CMOS design, besides the base and complex gates, you see more use of transmission gates to construct logic. It could be said for CMOS that gate primitives, transmission gates and sequential storage are the basic logic-level pieces above individual transistors and wires. Gate primitives will include NAND, NOR and NOT, as well as efficient transistor-level implementations of more-complex elements like XOR/XNOR, AOI (AND-OR-INVERT), multiplexers and arithmetic. Transmission gates, buffers, latches and flops round out the rest of the low-level library. The AOI / OAI gates deserve special mention. These structures are very efficient in CMOS, requiring at minimum only 6 transistors. They are very handy for rendering sum-of-product or product-of-sum logic. Bigger ‘regular’ functional units like RAMs and ROMs are also offered, being designed from the transistor level and characterized as blocks. These are usually handled as parameterized macros that are auto-generated based on user inputs (depth, width, # of ports, etc.) More about standard cell libraries here: https://www.eng.biu.ac.il/temanad/files/2017/02/Lecture-4-Standard-Cell-Libraries.pdf Do people still 'push polygons'? Sure. Critical-path blocks benefit from transistor-level hand-tweaked design to achieve higher performance, greater density or lower power. Mixed-signal blocks may also be done at least partially by hand. You can think of these as 'custom' cells that a designer may re-use from project to project, but nevertheless will also be characterized for a specific process as add-ons to the standard library. Aside from those hand-made edge cases, chips are built using synthesis based on the standard cell library, with the designer’s main work being architecture, logic design and synthesis, as well as partitioning and placement - all to achieve the target performance using the least possible die area and at acceptable power. In short, and at long last, in modern chip design the standard cell library is the next level of abstraction above transistors and wires that most designers interact with to create chips. What's the next layer above the standard cell library to 'program' the CPU? Depends on the CPU. There might be PLAs (Programmable Logic Arrays), microcode ROMs or some other mapping structures that would be mask-programmed by rearranging only one or two contact layers. Such blocks allow making changes / fixing bugs without doing an entire base-layer tapeout. They can shorten schedule and reduce prototyping cost, at the expense of increased area compared to synthesized logic.
H: Why do my FQP30N06L MOSFETs keep dying after being powered up only a few times? I am having an issue with my circuit. Specifically, with the FQP30N06L MOSFETs failing after only a couple of runs (a run being powering the circuit). I'm using a 24V DC power supply and originally had a 3V Arduino running the program, but I switched it to a 5V in the hopes that this would solve the issue (it did not). Each MOSFET is connected to a KVLA105-5P 1" x 4" heater element, that's supposed to turn off once it reaches a set temperature. What tends to happen is either it won't stop or it won't heat up at all (I've had both happen a number of times, right now it's not heating up). I checked the pins on the Arduino and they're behaving normally (high when heating, low otherwise). If it's heating but not stopping, the voltage across the heater is around 24V and if it's not heating at all, the voltage is zero. It does not get hot in either scenario. I've replaced the MOSFETs a dozen times at this point and it always solves the problem, but I don't understand why they keep failing. Why do they keep failing? I've updated the schematic as well as added images of the board. In the original schematic I had the gate grounded and the source hooked up to the Arduino. This configuration did not work as in there was no measurable difference between having the transistor or removing it entirely. Troubleshooting-wise I've replaced the 3.3V Arduino with a 5V one and added a level shifter (the screen runs on 3.3V logic), I've tried switching the power supply (have used both a wall connection via power jack and a standard external DC power supply) from 12V to 24V. I have tried adding each component one at a time and everything worked until I moved it to the system (I was testing using a different set of heaters but even when I move it back to those it no longer works) Right now, it is not heating at all and both of the leads to the heater are measuring 24V. [ AI: What is the purpose of R7 and R5? I think they are causing your problem. MOSFETs will dissipate more energy if they are only partially turned on. And the amount they are turned on/off is determined by the gate-source voltage. By placing resistors between the source and ground you make it harder for your gate signal to fully turn on the MOSFET. Current that flows through the MOSFET will lift the voltage of the source and thus decrease V_GS. The smaller V_GS will cause the MOSFET to dissipate more heat and can lead to failure of the device. Usually this is the way you use a MOSFET: simulate this circuit – Schematic created using CircuitLab
H: Gate Driver Circuit Question I read the PoE PD Schematic Review Guidelines, and there is a gate driver circuit I don't understand how that works. Can someone tell me how to work? 1.) On the page 22, the dotted boxes are the gate drives, I never use that kind of driver before, so I have no idea how to work. 2.) What's the function of R31 and C31? AI: An active-clamped forward (ACF) lend itself well to self-driven synchronous rectification in the secondary side. By self-driven, I mean you can use the transformer output voltage to directly drive the MOSFETs gates. Contrary to what a classical 3-winding forward brings, the drive voltage with an ACF is available as long as the primary side is magnetized and thus provides adequate bias to the output MOSFETs. However, as you know, the raw output voltage of the forward - the voltage at the secondary winding - depends on the input voltage and transformer turns ratio. Therefore, depending on the input-output parameters, it may appears that the voltage delivered by the transformer exceeds the maximum gate-source voltage of the selected MOSFET. It is usually 20 V but depending on the selected type, it may vary. If you apply too high a \$V_{GS}\$ voltage to a MOSFET or drive it too close to its maximum rating, you reduce its operating life time and if spikes superimpose on the driving voltage already high, there is no margin and you may destroy the part. For this reason, you need a clamp on the drive voltage if the turns ratio or the input voltage are too high. The proposed clamped in the TI AN is shown below: The transistor is wired in a simple linear regulator whose output voltage is simply that of the Zener (biased by \$R_{29}\$) minus the \$V_{be}\$ drop. Nothing fancy here and the secret lies in selecting the right transistor capable of delivering enough current to ensure clean transitions. \$D_{14}\$ is there to protect \$Q_5\$ against reverse bias. So when the node 9 of the transformer goes high, \$Q_5\$ drives the MOSFET with a voltage of roughly 12-0.65 = 11.3 V. It works in a similar way when the transformer polarity reverses and activates the controlled free-wheel transistor \$Q_6\$ which receives the same drive voltage as with \$Q_5\$. However, because this a heavy CCM operation, you cannot afford to have shoot-through currents and \$Q_6\$ must be quickly turned off via \$Q_7\$. To quickly evacuate the minority carriers when the bipolar conducts, you can install a network such as \$R_{31}C_{31}\$, this is a classic in bipolar drive. What you want is a bit of negative voltage at turn off on the bipolar base which will accelerate the evacuation of the minority carriers, effectively turning off the bipolar transistor. What is important is the time constant matching: \$R_{31}C_{31}\approx t_s\$ in which \$t_s\$ represents the storage time of the transistor - if I remember well my course on bipolar transistors which is probably under a heap of dust now :-)
H: Controlling low voltage circuit with wall outlet power I'm basically looking for a reverse relay: I want to switch around 5V with wall outlet power (230V 50Hz in my country). When wall power goes out, the low-voltage circuit should open. I don't have space to use a phone charger / wall wart, and I'd like to avoid anything involving just a diode + resistor which would heat up and waste energy. Do these kind of relays exist? I previously thought this kind of thing could be accomplished easily but now that I'm looking, I can't find anything. AI: I'm basically looking for a reverse relay. No. You're looking for a relay. You just need one with a 230 V AC coil. simulate this circuit – Schematic created using CircuitLab Figure 1. The relay contact will open when mains power is lost. Don't omit the fuse.
H: What does "mode-free" mean, in the context of coaxial connectors? I've seen a number of coaxial connectors claimed to be rated for "mode-free operation up to (whatever) GHz"--but after much searching, I can't seem to find any definition of "mode-free". (source) (source) What does "mode-free" mean in this context? AI: EM energy can travel through a waveguide in different modes, i.e. different ways for the electrical and magnetic standing waves to fit inside of the confining cavity. Normally propagation in coax is in the TEM00 fundamental mode, which means that there are no standing waves perpendicular to the direction of propagation. However, if the wavelength used is small enough compared to the diameter of the coax or connector, other modes will also be able to propagate. This is generally a bad thing, since the different modes will have different propagation velocities, leading to intersymbol interference and loss. Arguably a better term would be "single-mode" instead of "mode-free", but I guess people in the coax world aren't used to thinking of TEM00 as a mode at all. In any case, the mode-free limit is the frequency below which an insignificant amount of energy couples into the higher modes, so they don't cause any trouble.
H: hex value is treated as decimal value This is from Mazidi's book on microcontroller. As we can see we are aiming to add these two values 17H and 28H in HEX and want to get their sum in BCD, definitely their sum is 3F and which should be 0110 0011, then how the book says "the result should have been 0100 0101? moreover 17+28=45, as if we are taking these as decimal value, rather it should be 17H+28H=3FH=0110 0011 in BCD.This is what we want. then why all these ? AI: That's what BCD is: basically treating hex as decimal. You take the number, write it in decimal, then stick H on the end and read it as hex. So the decimal number 45 (hex 2D) in BCD is 45H (decimal 69) and the decimal number 17 (hex 11) in BCD is 17H (decimal 23). You can also think of it as a way of storing decimal digits. We store each decimal digit separately in binary. We don't convert the whole number to binary, only each digit. So 1234 -> 1 2 3 4 -> 0001 0010 0011 0100, not 0000 0100 1001 0010 which is how that number would be stored in binary. If you want to do math on numbers in this format, you have to do decimal math. Computers can only do binary math, so we have to simulate it. Because each digit is binary, binary math works just fine on the individual digits. But as soon as one digit carries over into the next, we have a problem, because binary math will let the digits go up to 15 before carrying. We can fix that by adding 6 to any digit which goes higher than 9. 6 is how much you have to add to turn 10 (decimal) into 10H (hex). This basically converts any decimal carry into a hex carry. For example if you get 11 (decimal) in a digit, you can add 6 to turn it into 17 (decimal) which is 11H (hex) which is what you want it to be so it carries into the next hex digit.
H: Resistor and potentiometer values to obtain 1.25-12V variable with an LM317 I want to make a variable power supply up to 12V. For that I want to select resistor and adjust potentiometer values. I have calculated below values from this website.https://circuitdigest.com/calculators/lm317-resistor-voltage-calculator R2 is a 10K poteantiometer and R1 is 1000. When I put these values in above farmula, I am get 12V Vout. Are these values okay? I have seen many tutorials where potentiometer R2 is 2k and R1 is 220. AI: The problem with using those values is that you are not inherently meeting the minimum current draw from the LM317 so it will tend to go out of regulation (higher than expected output voltage) with a light (or no) load. At maximum input-output differential (40V) the datasheet typical value is 3.5mA and the maximum is given as 10mA. So to be completely safe R1 should be less than 125 ohms. In practice you can usually get away with 240 or 220 ohms with modern LM317s, especially with lower input voltages, and that is what many designs use, but you should recognize that it's rolling the dice slightly. One way to go would be to use a 2K pot rather than a 10K, and then your R1 would be closer to 240 ohms. You could also add a current sink to the output to draw (say) 5mA, but that's a bit of extra complexity. For example: simulate this circuit – Schematic created using CircuitLab The diode is used as a crude reference (you could also use a voltage divider if the 12V rail is regulated). It will draw a constant current of about 5mA for any output voltage above about 650mV, easily handling the 1.25V minimum from the LM317. Using too high resistances will also affect the stability since the adj terminal bias current is not perfectly constant, as Bimpelrekkie points out.
H: What is ORing and why is it named ORing? I read some documents like the PoE application, it used ORing to protect the reverse input current. I would like to know what ORing is. I googled it, but I cannot find the answer. It seems like a diode or something the datasheet uses diode to protect, but I am not sure what this is. AI: OR is a logical function - the output is high when either input is high. ORing is simply a way of saying perform the logical OR of a set of signals. In the context of power supplies, when ORing is used, the output (the device) is powered by whichever supply typically has the highest voltage. A simple power OR gate can be made by diodes in series with each supply, which prevent power from the higher voltage supply backflowing into the lower voltage supply.
H: Battery charging from USB and max current I'm designing a wearable device, which is powered by a lipo battery. It can consume up to 100 mA, with 2A short peaks. The battery needs 360mA for charging. Charging IC with power path is used. And it is meant to be charged with a standard USB (micro-B or C). It will be a kind of mass-product device, that will be used by lots of people in unpredictable environments and with unknown USB power sources. In any case, it is supposed to be safe and stable. Do I need to detect port abilities for current limiting? For example with special USB interfacing ICs, like PTN5150A or FUSB303, MAX14637? Or can I just limit the input current on my charger IC to 0.9A/0.5A (USB 3.0/2.0 mode)? What is the best solution here? I don't want to blow up somebody's USB adapter, but I don't want to over-engineer the whole system too. AI: Do I need to detect port abilities for current limiting? You need to tell the charger you need > 150 mA, like any good device would. That takes a single resistor! For example with special USB interfacing ICs, like PTN5150A or FUSB303, MAX14637? You'll want one of these, no matter what: Or can I just limit the input current on my charger IC to 0.9A/0.5A (USB 3.0/2.0 mode)? Detecting that will require some logic glue anyways. Realistically, 360 mA charging current is very little, so I doubt you'll be able to blow up anything with that.
H: What is the purpose of the D4 diode between base and emitter of PNP transistor? I am having problem with understanding the purpose of the Q7 transistor. . The anode of the D4 diode is connected to the base and cathode - to the emitter which makes Veb = -0.7V. This will always make the PNP transistor be on the OFF mode no matter what the base voltage is. It seems that if I remove Q7 transistor nothing will be affected and the rest of the circuit will work just same. However, it is not. When I remove it the whole circuit stops working properly. Could anyone explain to me what I am missing here. Thank you AI: Summary: The postive pulses via the two parts of D4 drive the FET gate on. In the absence of positive drive Q7 & R31 drive the FET gate off. The transistor provides far more current drive than a pull-down resistor would, and so ensures far faster turn off, and draws minimal current when positive drive pulses are applied. FET turn on: When a positive pulse is applied Q7 is turned off as its base is driven to about -0.6V relative to its emitter. The FET is driven on by the postive pulse via D4. FET turn off: When the positive pulse is removed (either open circuit or grounded) then Q7 emitter is at V_gate and it's base is pulled to close to ground via R31. V_r31 will be about (Vgate- Vbe_Q7)/R31 or for VGate = say about 11V early on, (11-0.6)/10k or about 1 mA. For a BC856 the beta (current gain) at 100 mA colletor current is about 100 so the ~= 1 mA base drive will drive it into saturation. Vce can drop to about 0.1 - 0.2 V with adequate base drive BUT as the base drive is provided by Vcb it will probably end up at around Vce = 0.5V ultimately and at somewhere under 1V reasonably rapidly. The IRFZ44V MOSFET has a Vgs_on of 2V min & 4V max, so the under 1V Vbe level achieved by Q7 is enough to turn and hold it off. IRFZ44V has a gate charge of 65 nano-Coulomb max so at 100 mA discharge it will be discharged in about 700 ns. However, discharge rate will drop as Vgate drops providing less V_R31 andf so less base current so turnoff time will probably be in the order of 1 microsecond. Decreasing R31 will increase gate capacitance discharge time up to the capacity of Q7. A BC807-40 would give usually faster gate switching times (if needed) due to higher beta and higher current rating. D5 acts to damp gate oscillations by clamping negative Vgs ringing excursions. It should be mounted physically as close to the FET g-s leads as possible. If inductive loads are being switched an extremely useful addition is a reverse biased Vgs connected zener (in parallel with D5 and also close to the FET g s leads physically) with a zener voltage rating slightly above Vgate-drive_max. The zener serves to clamp Miller capacitance coupled drain spikes from the inductive load and greatly improves the survival of the FET.
H: Reverse Battery Protection using P-Channel MOSFET I read the TI document on page 5, according to this figure, when the GS of MOSFET from negative to positive the P MOSFET turned off, but why the Vout voltage will drop to minus. AI: What looks to be happening is that the Gate-Source capacitance of the PMOS is not discharged immediately. We can see that the Vgs curve has not settled yet when the input voltage crosses zero. So the Vgs > 0 for a short time after the input voltage has become begative. Realize that any MOSFET has a certain Gate-Source capacitance. This Cgs capacitance needs to be discharged to turn the PMOS off. This discharing is not immediate as there are two resistors limiting the discharging current. That means that the input voltage can already be negative while the PMOS is not switched off yet. The PMOS will then just conduct the negative input voltage to the output until Cgs has been discharged and Vgs becomes zero turning the PMOS off. If you want to understand this better I suggest using a circuit simulator (for example: LTSpice) to simulate this effect.
H: PoE system with Active Clamp Forward Does anyone know if choose the Active clamp forward as the topology in PoE system, according to this figure which from TI Design document, What's the function of C39. I do not understand why need to put the capacitor in there, is this DC block capacitor? can someone explain it to me? AI: Because you drive a P-channel, you need a negative bias to turn it on when the source is ground-referenced. The diode clamps on the positive excursion and, via the capacitor, shifts the 12-V drive voltage below ground, effectively turning the P-channel on. See the below waveform: The best is to run small sims like in the above to test particular sections of this converter. You can freely use one of the 60+ SIMPLIS templates that I posted here as they work with the demo version. If you want to read more on the ACF, I published this article in How2Power in 2019 and it covers loop compensation.
H: -25mV output from op-amp with 0V input I have this simple op-amp circuit used to amplify the voltage drop across an unknown resistor with a value between ~0 and ~20 ohms. The circuit works close to expected, but there is an offset - when I short RSENSE_A+ and RSENSE_A- with a "zero ohm" calibration shunt, I see 0V at TP13 but roughly -25mV at TP7. RSENSE_A- is connected to ground, so in essence I am shorting U6 pin 3 directly to ground. Using a calibrated resistance box I have obtained the values below at TP7. (note this version of the circuit has a 4.2 ohm resistor in position R9, so the current flowing through the sample is actually 48.4mA). As you can see there is significant (20-150mV) divergence in results between calculated and actual. What am I missing here? Is this a limitation of the op-amp I've chosen? If it is, which parameter is causing this and how should I be selecting for it in future? Thanks! AI: This is a combination of a few factors. Input offset voltage: typ. 0.3 mV, max 3 mV1. With a closed loop gain of 5, this can explain up 15 mV of error, positive or negative. Input bias current: typ. 100 nA, max 500 nA. The output impedance of the circuit being measured is low (because the resistor under test connects to what appears to be a power rail). In the worst case, it has a very low output impedance, in series with a zero-ohm R4, so the non-inverting input sees an impedance of almost 0 ohms. Meanwhile, the inverting input sees an impedance of 120k || 30k = 24k. Multiplying this by the worst-case input bias current of 500 nA contributes up to another 12 mV of input offset voltage, or up to 60 mV of output offset. Because the op-amp has a PNP input stage, it will source, rather than sink up to 500 nA via its input pins, which means that the up-to-60 mV of output offset will likely be negative in this case, as the output needs to go negative in order to balance the input voltages. One quick and dirty way to fix this is to ensure that the impedance seen by the non-inverting input is also 24k. Ultimately, the RC4580 is an audio op-amp, and is designed with different design goals in mind than yours. It is designed for extremely low harmonic distortion, but doesn't feature things you want here, like low input bias current, low offset, or offset nulling features. You'll want to consider selecting an op amp that offers low offsets or a means of nulling the offset, as well as a low input bias current. JFET or FET-based inputs will provide this, especially at frequencies near DC (at higher frequencies, the reactive currents flowing into the input capacitance will start to see imbalanced impedances again). Another concern I see here is the ground mismatch between the negative terminal of the resistor and the ground used in the op-amp feedback circuit. This could also contribute to an offset voltage, especially if the layout is poor, or other large currents flow through either the GND or V_CCS- nets. 1 This figure is listed in the datasheet as a conditional value only valid when Rs < 10k. The impedance of your feedback network is large, it could be even worse, but is not documented.
H: Are any op amp configurations better for noise? Considering the fact that the noise is always modeled as a voltage source on the positive input, is there any configuration where you get lower noise gain than signal gain? EDIT: Found answer AI: Generally, when you have any input signal with a given SNR, the SNR will only deteriorate when you pass it through any active or passive circuitry such as amplifier stages. However, when the signal occupies a limited portion of time or spectrum, you can use filters (digital or analog) to cut away the unused portions. Still, when defining the signal's SNR only for its spectral and temporal domain, there is no way to increase this SNR. One can only attempt to deteriorate the native SNR by as little as possible (which equates to a Noise Figure of 0 dB). The closest you can come to this (using op amps) is with a non-inverting amplifier, because it allows you to use no input resistor and small feedback resistors, without loading the signal source.
H: What do I find material to understand which electronic components are needed for a microcontroller? I'm interested in designing a PCB for a keyboard, and I can't seem to find materials on learning what components are needed for the board (resistors, capacitors, diodes etc). I understand basic electronics, but in terms of a microcontroller which require what resistor, how many is needed, I can't find it. Googling "PCB designs" only give me details about best practices etc what I need to learn but not the electronic design of it. Can someone direct me to sources or give me an answer on how do I figure this out? Thanks! AI: For starters, I think you are approaching this wrong. You don't design a circuit by asking "Where should I put resistors? Where should I put capacitors?" That's like cooking by asking "Where should I put flour? Where should I put eggs? Where should I put sardines?" Rather, there is something you want to do, and resistors and capacitors are how you can do that thing. If you want to make a cake, you look up how to make a cake - and it will tell you what to do with the flour and the eggs, and it will not even mention sardines, because cakes shouldn't have sardines. Depending on the microcontroller, you might need some components just to make it power up. These should be described in its datasheet. If it's complicated enough, they'll probably even give you an example schematic to make it simpler. The microcontroller company does want you to be able to use their microcontrollers. If you don't know about datasheets - now you do. Ever reputable manufacturer releases datasheets for all its products, containing all the information they hope you could possibly need. (Sometimes you can't get the datasheet without being a big company and signing an NDA. In that case, don't buy that part.) Even things like resistors have datasheets, although you rarely need to refer to them. If they give you an example schematic (or "reference design") and the design works for you, it's generally fine to just copy it. Even professional designers do copy these designs when suitable. If it's not suitable for your needs, like if it has the wrong power supply voltage, you can change it - it's an example, not a law. But you will have to understand what you're changing. Note that datasheets are often written for people who know what they're looking for, so you may find it hard to find the relevant information. If we knew which microcontroller you wanted to use we could help you find it. The rest of the circuit is entirely up to you. Let's say the microcontroller wants 3.3 volts and you want to power your keyboard from 5 volts USB. How can you get 3.3 volts? It's entirely up to you! The microcontroller datasheet won't help you with that. The microcontroller company has nothing to do with your power supply. Lots of people have done it before, though, because lots of chips want 3.3 volts and lots of people want to power them from USB. You should be able to find some suggestions by Googling it or asking here. And you want it to read keyboard buttons, presumably. The microcontroller will have "digital inputs" - wire connections where your program can detect whether there is a voltage on the wire or not. You have to design the circuit that puts voltage on the input when the key is pressed, and not when it's not pressed. And you might want NumLock and CapsLock LEDs (who uses ScrollLock?). The microcontroller will have "digital outputs" - wire connections where your program can tell it to either output a voltage or not. You have to design the circuit that makes the LEDs light up when the microcontroller outputs a voltage, and not when it doesn't. And wait, you have 100 keyboard buttons but you only have 20 connections to the microcontroller. Can you make that work without buying a really big microcontroller? Have people done that before? (spoiler: they have) The point is, this stuff doesn't actually have anything to do with the microcontroller - it's a completely separate part of the circuit. You, as the circuit designer, have to take all these different bits of circuit, that you get from different places, and combine them into one big circuit that makes a keyboard. There's no one information source that will tell you everything you want to do. There are pieces you have to put together yourself. If you're stuck, you can always ask here, but remember that Stack Exchange is intended for specific questions and you have to try to solve your own problem first. "How do I make a keyboard?" is too broad. "How do I convert 5V power to 3.3V power?" is okay (and someone's probably asked it before so you should search first). "How can I detect whether a button is pressed, from a microcontroller?" is okay (and someone's probably asked it before so you should search first). "Why won't my microcontroller turn on?" is okay. When asking why something didn't work for you, make sure to provide as much relevant information as you can, and always include a schematic. "What is the best microcontroller?" is not allowed because it's a "shopping question". Answers to "shopping questions" easily become obsolete over time. "How many digital outputs does this microcontroller have?" is technically allowed, but if it's written in the datasheet, it'll get downvoted and not answered because you should've looked in the datasheet. Spoiler: it's in the datasheet. "I don't understand this part of the datasheet. What does it mean?" is absolutely okay. "This information should be in the datasheet but it isn't, where can I find it?" is also okay. There is a help section with information about what things you can ask about (electronics design is one of them, including keyboards) and what kinds of questions are not allowed (such as shopping questions).
H: ATmega32U4 I/O Pin Alternate Functions I am using an ATmega32U4 as a master with 2 slave ADCs (AD7739), ADC1 and ADC2. The two ADCs are identical. The SS, SCLK, MOSI, and MISO for ADC1 correspond to ports PORTB0,1,2, and 3 respectively, according to their SPI alternate functions described in the datasheet. Now, when I add ADC2, I want to collect its output data. Can I have another distinct set of SS, SCLK, MOSI, and MISO on the general I/O ports of PORTB7, PORTB6, PORTC7, and PORTC6 respectively? In other words, do the ports PORTB7, PORTB6, PORTC7, and PORTC6 also have the alternate functionality to behave as SS, SCLK, MOSI, or MISO? AI: No, there is not a hardware mapping to PORTC and there is only one hardware SPI module in the ATmega32U4. If you look at Figure 17-1 in the datasheet you can see the SPI module is quite complicated, and there isn't a mux to connect it to other pins. So, your two options are to use the chip select lines on your ADCs (if they have them) and read them sequentially with shared data and clock lines, or to bit-bang the SPI protocol on different ports. Even if you had two SPI modules, the first option would be more or less equivalent as the ATmega32U4 doesn't have a DMA handler. Of course the best option, unless you absolutely can't change microcontroller, is to get a good modern microcontroller which will have more SPI modules, more mux options, be faster and more efficient, and probably cheaper. Something like the STM32 series or ATSAM series would be ideal, and will not constrain you to the out dated world of expensive 8-bit microcontrollers.
H: Why does lowering VDD increases the delay for digital circuits? I've preparing for Physical Design Interview and came across couple of explanations that deduce that the delay of logical gates will increase once we reduce VDD. what is the reason? my intuition sends me to the famous equation Q=CV. supposing Q is still constant, if V is reduced then C will go up, thus increasing the RC delay. is this the right explanation? AI: Most of these circuits are CMOS, particularly if they support a wide range of supply voltages. In a MOSFET, the higher the difference between the gate and source voltages, the higher the current that transistor will pass. When you reduce VDD, the drive voltages on the gates are reduced, and the amount of current they pass is reduced. CMOS loads are largely capacitive, so the amount of current you deliver directly affects the rate at which that node can change voltage...hence, the circuit is slowed down. Most circuits in ICs have several layers of combinational logic between state elements, so the slowdown compounds with each layer.
H: Are there commercial split +/-5V DC power supplies? I have a custom amplifier board that works with some scientific equipment. There is a molex-type connector on the PCB that requires +5V, -5V, and ground (3 pins). When I try to search for a +/- split power supply, I can find lots of do-it-yourself instructions for how to create the split supply, but no ready-made commercial product that I can just plug in. (Not expecting my specific connector, but screw terminals or banana jacks or something... Are there commercial products to supply split +/-5V and I'm just using the wrong search terms? If not, is there some reason, given how common this need is for analog components? AI: There are many many ±5V supplies. Look on Digikey or Mouser under DC DC converters, choose your search terms to be two output, look for packages that are SIP. If you're looking for a bench top supply and dual benchtop supply will probably work for your application. This is a good way I've used in the past to obtain -5V, the same converter (in a different configuration ) can generate +5V. Generating negative voltage rail using P7805 DC-DC converter
H: Is the dipping in VCC caused by inrush current of charging 1 uF and 0.1 uF capacitors? I'm powering MSP430FR5994 microcontroller from a power supply using a 2.2 V regulator. This regulator can source up to 200 mA. When MSP430 turns on, it starts to charge a 1 uF and 0.1 uF by driving two pins high. The 0.1 uF is a bypass capacitor of ADXL362 accelerometer. By monitoring VCC, I noticed that VCC dips multiple times to 1.4 V till eventually stays at 2.2 V. These dips in VCC cause the system to reboot because MSP40 low operating voltage is 1.8 V. My question is: Does charging the 1 uF and powering ADXL362 cause these dips, due to inrush current? If yes, how do I deal with inrush current? I'm a computer scientist with a limited background in electronics. I appreciate any help and explanation to overcome this issue. Here is my schematic: AI: The purpose of the 1uF is unclear as a "time keeper". (pump and decay?) The 25 ohm MSP internal driver will see the low ESR of the cap when discharged the current surge is limited by the lack of a series R. Adding one will limit this charge surge Is = 2.2V/ (25+R). Whenever the supply sags that is because a load impedance is near as low as the source. So one lowers the source impedance with more current limit or raises the impedance of the switched load Question was: Does charging the 1 uF and powering ADXL362 cause these dips, due to inrush current? If yes, how do I deal with inrush current? Answer: Inrush is a tradeoff during charge for ripple or sag during discharge but without a detailed schematic as built, this description can describe many different design problems like a weak battery.
H: Should I call these pins or ports? I recently designed and built this DC-DC converter module for a college project: The PCB has these pins/ports: While preparing a datasheet for my project, I called them pins because they are male header pins. After thinking about it for a while, I'm not actually sure whether I should call these pins or ports. These pins/ports are used so that a microcontroller can measure the output voltage and current of the PSU with the help of an ADC and also enable/disable the PSU. Should I call them ports because they are used to pass signals to an external device or pins because they are male header pins? I've tried googling this, but I've only found the definitions of pins and ports of a microcontroller. AI: They are pins. A group of pins is a port.
H: What are the factors that led to the digital revolution? Historically, the electronic circuits used for communications and processing were analog. Now digital electronic circuits are widely used in communications and computers. What factors drove this revolution from analog to digital? AI: A few major developments that led to the digital revolution: Shannon's publications in switching circuits and information theory is the theoretical framework of digital electronics and digital communications. In his Master's work, A symbolic analysis of relay and switching circuits (in 1936), he showed that Boolean logic could be applied to Switching circuits. In his publication in The Bell System Technical Journal in 1948, A Mathematical Theory of Communication, Shannon showed that communications can be done digitally with no loss of information subject to certain conditions which he derived and proved. Shannon also worked on Cryptography, the backbone of cybersecurity. Complementary metal–oxide–semiconductor (CMOS) logic was developed by Chih-Tang Sah and Frank Wanlass at Fairchild Semiconductor in 1963 (Source: https://www.computerhistory.org/siliconengine/complementary-mos-circuit-configuration-is-invented/). CMOS had lower power consumption. By the mid-1970s, digital system designers eager to create higher-performance devices were frustrated by having to use off-the-shelf large-scale-integration logic. It stymied their efforts to make chips sufficiently compact or cost-effective to turn their very large-scale visions into timely realities. In 1978, a landmark book titled Introduction to VLSI Systems changed all of that. Co-authored by Mead, the Gordon and Betty E. Moore professor of computer science and electrical engineering at the California Institute of Technology, and Conway, research fellow and manager of the VLSI system design area at the Xerox Palo Alto Research Center, the book provided the structure for a new integrated system design culture that made VLSI design both feasible and practical. Introduction to VLSI Systems resulted from work done by Mead and Conway while they were part of the Silicon Structures Project, a cooperative effort between Xerox and Caltech. Mead was known for his ideas on simplified custom-circuit design, which most semiconductor manufacturers viewed with great skepticism but were finding increasing support from computer and systems firms interested in affordable, high-performance devices tailored to their needs. Conway had established herself at IBM's research headquarters as an innovator in the design of architectures for ultrahigh-performance computers. She invented scalable VLSI design rules for silicon that triggered Mead and Conway's success in simplifying the interface between the design and fabrication of complex chips. The structured VLSI design methodology that they presented, the Mead-Conway concept, helped bring about a fundamental reassessment of how to put ICs together. Source: In 2002 Mead and Conway were inducted in the Electronics Design Hall of Fame in recognition of their pioneering work in VLSI chip design methods. This is what the entry said about their work. Intel introduced the first commercial microprocessor, the 4-bit Intel 4004, in 1971. This was followed by other microprocessors. Computer-aided VLSI design, coupled with the ingenuity and creativity of modern digital designers and computer/communication system architects is the reason behind all the modern digital marvels of today. Factors that drove the digital revolution, and continue to drive it today: Error-correcting capability using digital logic. Low cost of manufacturing digital devices. Digital electronics has noise immunity. See: Why is an analog circuit more susceptible to noise than a digital one? Ease of digital design and verification using Hardware Description and Verification Languages and High-Level Synthesis tools. Information compression algorithms are used on digital data to enable efficient storage and digital communication. Cryptographic techniques for information security are used in digital communication to provide confidentiality, integrity and authentication. Programmability: Digital devices such as processors and microcontrollers are programmable, which allows them to perform different functions by writing software.
H: Ringing in inductively coupled coils My circuit consists of two inductively coupled inductors. A 40 kHz 600 mV sine voltage is applied to the primary inductor. The induced voltage in the secondary inductor shows some ringing in the area of its own resonant frequency (1 MHz). A capacitor with 180 pF placed in parallel to the secondary inductor gets rid of most of the ringing. The voltage is measured with an active differential probe. What exactely is causing this ringing? And how does the capacitor help to get rid of it? I see that the capacitor lowers the resonant frequency of the secondary circuit. But I don't exactely understand how it reduces the ringing. Impedance of the primary inductor: Impedance of the secondary inductor: Impedance of the secondary inductor with 180 pF in parallel: Voltage across the secondary inductor without capacitor: Voltage across the secondary inductor with 180 pF parallel: Schematic: Spectrum of signal source: AI: All inductors have distributed capacitance. So ringing is "logical". If you put another capacitor across, you increase this capacity and lower the frequency of ringing which can dissapear a little or be more amplified ... It is also a mean for measuring distributed capacitance, but there is another mean which is called a Q-meter.Be careful that the behavior of coupled tuned circuits is a little more complicated than that. Please note also that the overall distortion in the frequency you use with Keysight Technologies 33500B generator (which use digital technology !) is about at -50 db. If you are "tuned" on one of these frequencies, you can "amplify" these and then see "garbage" ... So, filtering directly at output of generator would be necessary but probably difficult. Here is a picture to illustrate what happens when you use coupled tuned inductors. It is an ac analysis at about "resonance frequency". Quality self (Q factor) are not really "good" ...
H: Gate drive transformer troubleshoot Recently I've been working on a half-bridge solid state tesla coil project. After doing some research, I came across a lot of universal tesla coil driver schematics, and I've realised that a lot of the schematics use a gate drive transformer instead of a traditional driver ic. From my understanding, a gate drive transformer has better galvanic isolation and eliminates the need for a bootstrap IC. So I've decided to try out this method of driving the gate. This is what I come up with. The toroid for the gate driver transformer is taken from a boost converter board. It works at 500khz, so I hope this ferrite core has higher permeability. The working frequency is 170kHz. The supply voltage for the tc4420 is 12v, the capacitor is a poly film capacitor 1uf and the resistor is a 5ohm 2-watt resistor. The problem is when I used a multimeter to check the output voltage on the secondary the multimeter shows very little voltage reading (mv) and the 5ohm resistor gets bloody hot, and after removing the capacitor and the resistor directly hooking the transformer to the driver ic there is around 9v on the secondary side. I know that a multimeter is not a suitable instrument used to measure the value but currently I don't own an oscilloscope. Hopefully, I can overcome this problem or I might just stick with the traditional driver ic method. Thank you. AI: Hot resistor means high RMS current .Your driver transformer could be driven into saturation .Remember the Volt microsecond rating of the transformer .170 KHz drives it about 3 times as hard as 500KHz .Nore turns will help ,so would a larger core or a pulse transformer with a better volt mircosecond rating .
H: What do schematic symbols (R, C) marked "SHORT" mean? What does it mean when a resistor or capacitor is marked "SHORT" instead of being given a value in a schematic? At first this seemed clear to me: it must mean a 0-ohm resistor, something I'm familiar with, although I'm used to seeing them drawn with a value of "0R" or similar. But then I saw this in the same schematic: This I don't understand. My best guess is that it might denote an optional component, where the PCB should have pads for a capacitor (or whatever), but that the pads should be shorted with a cuttable trace or 0-ohm resistor or something. Is that right? The schematic I'm looking at is the reference design for the output I/V stage for the ES9028Q2M DAC (p. 40): AI: The schematics allow some features like DC blocking or 2-pole low pass filter, but if they are not used then some of these components can't be left out because signal goes through them, so they need to be bypassed with a short. Which effectively means, a piece of wire for a through-hole component, or maybe a 0 ohm resistor for SMD component. So in the DC block section, the capacitor needs to be replaced with a short circuit, and to not use the second lowpass filter in the LP filter section, the resistor needs to be shorted out, and the unused capacitor left open (not populated).
H: Not sure about the way to compute the voltage across a DC motor driven by a NPN BJT Long story short, I wanted to make my own H-bridge but I was out of p-channel MOSFETS so I tried to design one with BJTs instead, but before doing just that I simply wanted to try to run an average 3-6V DC motor with a NPN transistor with the following circuit (actual circuit on the left and the equivalent circuit on the right) : It's just your average BJT power interface, nothing too much out of the ordinary around here. I know that one can compute the base resistor as such : R1=(V1-Vbe)*Hfe/Ic, which is useful as it's common knowledge that, for a DC motor, the consumed current is proportional to the motor's torque and that the motor's speed is proportional to the voltage across it. Thus, varrying the resistor value allows us to change the motor's maximum torque, which is great. But here is the thing, how can one compute the voltage across the motor without measuring its speed and by assuming there is a known torque applied to the motor ? I simply do not understand how it's done. With my quite limited knowledge of BJTs I have only measured voltage across resistive loads so far by simply making use of Ohm's law since I am able to calculate the collector current but in this case I must say that I have no idea as to how it's done, I can only make the assumption that the voltage across the motor will be between V1 and the CE saturation voltage but that's about it. I made some research on the topic but I can only seem to stumble across arduino tutorials not even mentioning the issue. And before you ask, no I do not have the datasheet of the motor (I just want to understand the principle) and yes I know using a MOSFET in this speed-related case would be easier to implement as one can simply compute the motor's voltage with the help of the Rdson internal resistance, but again I want to understand this for education purposes only. Any help would be gladly appreciated. AI: how can one compute the voltage across the motor without measuring its speed and by assuming there is a known torque applied to the motor ? In your circuit you can't. However if you know the motor's torque constant (Kt) you can calculate the current required to produce the 'known' torque. If the transistor can deliver more than that (ie. it is in saturation) then the motor will get the full supply voltage (less saturation voltage of the transistor). If the transistor cannot deliver the required current the motor will slow down and its voltage will drop until it stalls. If the load torque is not constant but increases with speed then as the motor slows down a point may be reached where the current is sufficient to produce that torque. For example a propeller's torque is proportional to the square of speed, so if you know what the current is at one voltage you can calculate what the voltage will be at a different current. On the other hand, a load whose torque reduces at higher speed will prevent the motor from starting if it doesn't get enough current, but race up to a higher speed if the current is sufficient to start it. As the motor speeds up its voltage increases, making it speed up even more until it reaches full voltage or the torque load increases to stabilize the speed. This makes your circuit a poor method of determining motor voltage. It may work OK for fans or fixed propellers which have a strongly positive torque to rpm relationship, but not for other things like compressors or traction motors.
H: Stereo Headphone Cabling (TRS) - Why 4 pads on L loudspeaker and 4 cables? The R(ight) loudspeaker on my AKG-K99 headphones stopped working. I bought a replacement (x2) 'mini' loudspeaker. After soldered the replacement the sound was "weird". No problem. I predicted that. Different loudspeakers, different sound! For that reason I already had the second sp-39 loudspeaker. So I went to solder the second replacement. But after I opened the L(eft) AKG loudspeaker, to my surprise I saw more pads than the R(ight)! BUT I have three problems. To my surprise the cables are four instead of three. To my knowledge: 1 = common ground [Gold color ] 2 = positive (L channel) [Red color ] 3 = positive (R channel) [Red color ] (end of TRS story) Problem #1 4 = WTF? (What's The Fing?) [Green color] I made some continuity test's. (I de-soldered the monacor / replacement before testing - more for that later) Problem #2. Continuity partners (check picture for numbers: ): 1 [green] + 2 [gold] (!), 3 [red] + 4 [red] (!!). How's that possible? Problem #3. Continuity partners mini jack (TRS) vs cables (factory soldering) 1 [Sleeve] with Green AND gold (!). 2 [Ring] with BOTH reds (!!), 3 [Tip] with Green AND Gold (!!!). Also to my surprise #2 Monacor has 4 tabs probably to cover the 'host' situation L. I was expecting 2 pads per loudspeaker but I have 4. I have some lack of knowledge here. How to solder the monacor as host (L) and as client (R)? This is my soldering (weird sound - more loud, but adjusting the balance is not helpful) Problem #4: In monacor ALL pads have continuity (!!!!). Similar threads - but for some reason didn't help. Sorry. Headphone wire color coding Fixing headphone jack AI: #1 of 3: You get confusing results just because you assumed the pinout wrong. Since you have a multimeter, you can just measure which goes where instead of assuming which goes where. #2 of 3: There is again no problem. If you look at the picture, you will see that pads you marked 3 and 4 are connected together by the printed circuit board on the speaker. Therefore, it is expected to measure direct connection between pads you marked 3 and 4. #3 of 3: There are three wires so there would be one wire for each of the T, R, and S connection. As each of those wires are connected to a speaker, a continuity test will show continuity between all of them. #4 of 3 (you said 3 but asked 4): I think you must stop measuring with continuity testing because it will tell you everything has so low resistance it keeps beeping for continuity. It's the wrong tool. Use resistance measurement as it is the correct mode for measuring to distinguish between wires and speaker coils. So, from what I decipher the TRS cord goes to LEFT speaker first, which connects all wires, and from there, two wires go to RIGHT speaker. It would be a good assumption that since only gold and red goes to the right speaker, they are ground sleeve and ring, and since gold and green goes to left speaker only, they are ground sleeve and tip. I'd say TRS are green, red, gold. That is why gold and red are looped through on the left speaker to go to the right speaker. If you used continuity test mode, it will also say that a speaker has continuity, not only wires. That's why you measure continuity between green and gold, while you should measure about 32 ohms. The two red wires are supposed to be connected together, that't the link from cable to right speaker, so it should measure 0 ohms. That's why the gold ground wire also goes to both speakers. If you did not measure continuity between red and gold, it might indicate that either the red or gold wire between left and right speakers is broken and has no continuity, so changing the speaker elements won't fix the wire. Most likely the speaker elements are fine and the wire between is broken. Unless you seriously overloaded the right speaker so it actually is the speaker that's damaged. I hope this helps.
H: Will a 250V fuse work fine in a 1000V multimeter? I busted my multimeter due to improper use (see Why would a multimeter give an unexpected current reading?) and so decided to change the fuse. Annoyingly I can’t seem to find a 15A 1000V 6.3mm x 32mm fuse, and the closest thing I can find is a 15A 250VAC fuse. I was going to go ahead and assume yes, since I’m only ever going to test DC voltages around 24V or below (but you never know, I may use it to test up to 230VAC in future), but I thought I’d check with the experts before happening upon another silly mistake. The multimeter is an Owon OW18E. Also, curiously, the rating on the front says 20A. Also, is it likely that a 1000V 15A 6.3mm x 32mm fuse can be purchased in the UK? I've checked all the usuals in the UK (Farnell, RS, etc), but the highest rated seems to be 250V at 15A. Alternatively, I found a 600V at 10A, but so far nothing near 1000V 15A. AI: Yes but ONLY on the condition that you don't use your multimeter above the fuse rating of 250V. The problem is that a fuse may arc instead of blowing at a voltage higher than its rating so the protection you're counting on will not be there. I strongly recommend that if you do this you clearly label the meter with a "250V LIMIT" warning so that you don't forget or someone else who uses the meter is aware.
H: How to make a main switch toggle between two sockets (or bulbs) Is it possible to simply (without relay) make a main switch toggle between two sockets or bulbs such that both of them are never ON or OFF at the same time? I need to control two 12 and 9 volt DC adaptors connected to same device. Is there such a switch that I can buy from a hardware store? If yes, what is it called? AI: If I understand this question right, you're trying to switch the supply voltage for the DC fan with a switch. I've posted two possible options. The first uses a DPDT switch to switch in either the 9V or 12V supply to the fan (shown as a resistor here). The second uses a SPDT switch, but loses any isolation the two DC adapters may have. simulate this circuit – Schematic created using CircuitLab If you instead need to stick with switching the AC connections, you can buy a three-way switch from any hardware store. This switch is similar to the SPDT circuit shown above. It switches a hot line between two other poles, in your case the 9V and 12V adapter, shown as R1 and R2 below. If you need an 'off' switch as well, you can add another standard switch in series. simulate this circuit
H: Is the current on a motor's nameplate its no-load current, full load current, or locked rotor current? Say a motor has 1.49A on its nameplate. Is this its full-load current, no-load current or something else? AI: I would expect the nameplate to give the rated load current at rated voltage. The no-load current may be as low as 10 to 20% of this and the locked rotor more than 500% of this rating. That you can verify using a DMM ohm meter on the coils to compute this current and report back in your question based on V/DCR. The results also depend on the type of motor and winding configuration for the torque profile in an induction motor. Some have more excitation current to flatten the torque curve.
H: Make microphone less sensitive I bought a pack of 5 MAX4466 microphones on amazon, and would need to use them to detect when a plate is hit by a bullet. There are 4 plates, each one with a microphone glued to the back. The bullet speed and the speed of sound are very similar, thus the microphone needs to be very tollerant to loud noises. Ideally, the one attached to the plate saturates the output, while the others hearing just the noise of the gun keep a lower value. Unfortunately these mics saturate even with a handclap and even adjusting the gain did not bring any good result. I also tried other models, but they all have the same problem, they are not designed for noises that loud. Is there a way (for example attaching a potentiometer parallel to the mic?) that allows me to decrease the sensitivity of the microphone? AI: Frankly, I doubt it. You may be able to adjust the gain, but when you're looking at a shockwave, it will probably challenge the physical limits of travel of the electret diaphragm. Since you're attaching it to the plate directly, you might consider trying out some piezo sensors. You can probably find some with a range that would differentiate between a hit and a shockwave. If it was me, I'd be tempted to experiment with ceramic caps to use their microphonic variation to detect impacts.
H: Does electric resistance of an iron-cored electromagnet depend upon the size and type of the core? I know that the resistance of an electromagnet depends upon the nature, length, and diameter of the wire. Is it also depend upon the size and nature of the iron core on which the wire is wrapped? AI: The resistance would be the same, but the inductance would increase. The current will be the same if you're driving it with DC, but would probably decrease slightly if you're driving it with AC.
H: Why are arcs so hazardous compared to standard current flow? I know that electric arcs are dangerous as they can start fires, cause explosions, melted insulation, etc. and they are generally undesirable. However, I am a bit confused as to why. Arcs generate heat, but shouldn't normal current flow also generate heat? Is the specific heat of plasma air, is it low enough to get extremely hot under normal current flow, which then quickly heats up the surroundings? I am referring to simple arcs that are a few amps, not arc faults that go to hundreds (probably more) of amps. AI: Arcs generate heat, but shouldn't normal current flow also generate heat? The whole point about normal current flow is that it is through a medium called a conductor i.e. a copper wire and, the resistance of the copper wire is extremely small. This means that the heat generated (\$I^2\cdot R\$) is also quite small because the resistance is low. Arcs usually and commonly occur through air and generate a lot of heat because the current x voltage of an air arc (also equal to power) is very high. Alternatively, you can say the equivalent resistance of air is very, very high compared to copper.
H: Use Tx port on SDR for an LO? Designing a receiver for an experiment. The receiver will be in remote location and I will be deploying multiple in the field so have a cost-effective, self-contained system is a priority (is it ever not?). I have an SDR I want to use that is ruggedized/weather proof and has an embedded linux OS, but its upper frequency limit is 6 GHz. I plan to look at frequencies in the 6-9 GHz range and thus have some additional front end RF components ahead of the SDR's antenna port. One thing of note is the SDR will have a Tx port that will be unused. Instead of sourcing an LO from a company like Wenzel, which can be expensive, could I feasibly just use this Tx as my LO? Any drawbacks to this idea? AI: Instead of sourcing an LO from a company like Wenzel, which can be expensive, could I feasibly just use this Tx as my LO? Any drawbacks to this idea? I regularly recommend that to customers of one of my clients, and it works. It definitely has the advantage that you have one clock source, so there's no mutual drift of frequencies, no reference oscillator phase noise adding up, and so on. Now, it depends on what your external RF frontend needs as LO, but generally, you should be able to generate an LO that just mixes 6 to 9 GHz down to, say, 2 to 5 GHz by generating a 4 GHz tone, for example. Two things that are advisable: Since SDRs are not necessarily extremely clean in output spectrum, it's often necessary to add a bandpass filter to make sure you don't get harmonics and subharmonics as well as synthesizer spurs around your LO. That BPF doesn't need to be very narrow, though! Make a sketch of the spectrums of your signal of interest, the RX LO + harmonics, and the TX LO plus its harmonics (doesn't have to be based on actual harmonic power, just to know the frequencies). Try mixing the harmonics with each other and add their difference and sum frequencies to the same diagram. Make sure you don't put intermodulation products unnecessarily close to your signal of interest (of course, the whole point is to put one specific intermodulation product at exactly the center of your band of interest, i.e. mix down with the sum of SDR RX LO and frontend LO). Sometimes a little change in both LOs can put spurs out of your band – for free, without any other effort.
H: Is there any reason to use the LM317 in place of the better and more recent LM338? This more recent version of the LM317 is fantastic, and while it happened some of my LM317s "fried" somehow, LM338s never betrayed me. Reading the datasheets, I don't find any advantage to use the LM317 vs the LM338 voltage regulator (but I may have missed something). Since the prices of these parts are comparable, why does the LM317 continue to enjoy such a popularity? AI: The LM317 (TO-220 package) is a fraction of the price and is more thoroughly stocked and multiple-sourced so there is a very strong incentive to use it where it is appropriate. For example, right now there are no TO-220 package LM338 parts available from Digikey (only the Pb version is available from factory order) and the noPb version is marked not for new designs). There are thousands of TO-220 LM317 available made by ST, ON and TI. The TO-3 versions are more expensive than an entire power supply (for either part). I'd also be pretty confident that the LM317 will still be available from one or more first-tier suppliers in 5 years at a reasonable price, the LM338 not so much. Linear supplies are an ever-shrinking market, and the remaining legacy linear supplies don't tend to use monolithic regulators at all. At least the LM317 is useful in low-current circuits. But the LM1117 semi-LDO and equivalents are more popular these days. Both the parts you mention are more than 40 years old, so comparing which is newer than the other doesn't seem very useful.
H: What does High-Impedance mean in digital systems? I'm currently messing with the Microchip 23LC1024 SPI RAM chip, and trying to read the datasheet to understand how to work with it. I'm not an electronics engineer or something like that, I'm a software developer, so I don't quite understand everything that's written or sketched in the datasheet. I see in the figures the "High-Impedance" written above the SO line. What does it mean? AI: 'High Impedance' in this context means that the SO (chip data out) line is not being driven by the chip. This is represented in the diagram as a line at mid-level. In reality the SO pin is floating; the actual signal state is undefined and can't be counted on as a valid logic level. Good system design will ordinarily resolve this by adding a pull-up or pull-down to the SO line, so that it will not be floating when it's undriven. If it's a pull-up the SPI host will see the incoming SO 'high-impedance' time as all 1's on its MISO/DIN pin. For the example read command shown, with a pull-up on SO (host MISO/DIN) you will see the raw sequence FF FF FF FF, followed by the data bytes. The host SPI controller might be programmed ignore these bytes (e.g., with a 'read latency' setting), or they can be discarded by software. Why do they do this? It allows multiple SPI devices can share the same host MOSI and MISO pins, each one being selected by its own CSn pin from the host. In a multi-chip SPI system, only the device activated by its CSn pin will drive the host MISO line, the other unselected devices will remain in high impedance. A quick SPI nomenclature note: MISO/DIN = Master In, Slave Out. Connects to device SO MOSI/DOUT = Master Out, Slave In. Connects to device SI
H: Adapting a 12V Dell power supply to a Lenovo PC - very naive questions I bought on Amazon a chinese power supply for my Dell Latitude. It plugs into a 12V socket on my car and feeds 19.5V to the PC. So far, so good. Now I want to feed another computer, a Lenovo thinkpad with a completely different socket: I am thinking to cut the relevant cables and put at their places 2-wires plugs+sockets, so that I can swap the plugs depending on the PC that I am using: I have cut the cable on the power supply and here comes the surprise: there are three wires in it. I assume that there is a ground wire, but I wonder what its purpose is, as the 12V plug gets into the cigarette lighter of my car, which has no ground. MY QUESTIONS: which of the three wires is the ground? (I reckon it's the red, because it is thinner than the white and the black) can I safely wire just the white and the black in the plugs+sockets that I have bought, or must I buy 3-wires plugs+sockets AI: We do not know which wire is which so you have to measure it yourself. And connecting only the supply and return wire would most likely make the laptop to be unaware of how powerful power supply is connected and it will not charge at all. There are three wires because there is supply wire, return wire, which supply the power, and the third wire is some kind of manufacturer specific ID or communication wire to let the laptop know how much power is available from the power supply. The ID/communication wire can be specific and proprietary to laptop manufacturer so most likely they are not compatible and connecting ID wire may even damage something. Basically what you are trying to do is not possible without finding a web page how to adapt a certain watt charger to certain laptop brand or reverse engineering how the original power supplies work. So in short, power supplies are usually not be compatible with different brands.
H: Average inductor current in Buck converter In steady state operation the average capacitor current in a buck converter is zero, which means that the rippling part of the inductor current charges and discharges the capacitor, while the "DC" part of the inductor current is the load current. I am not sure how this "DC" component is equal to average inductor current. How do I find the mathematical relationship between load current of a buck converter and average inductor current? How do I relate load current (which in itself does not depend on inductor/inductor current) to the average value of the inductor current? Edit: I get that steady-state operation implies zero capacitor current (average). KCL at the output would yield Io = IL_AVG. But by evaluating the average value of the inductor current waveform, I couldn't find any way to equate the output current (Vo/Ro) to Average Inductor current (Ipeak/2). The output current does not depend on either the value of inductor or inductor current ripple. How then would you relate the average inductor current to load current? AI: I am not sure how this "DC" component is equal to average inductor current. First, "DC component" is an exact synonym for "signal average". The latter term is the time-domain math explanation (you integrate the signal over time and divide by the interval). The former is the frequency-domain math explanation (you take the Fourier transform of all the components, then divide by the interval -- but the "DC component" is the zero-frequency component, which is the integral of the signal over time). The only place that the charge from the inductor can go is into the output capacitor or the load. If the average current in the inductor doesn't match the average current into the load, then the excess goes into (or comes out of) the capacitor. Capacitors integrate current into voltage -- so if the net current of the capacitor isn't zero then its voltage will change. That'll change the current from the inductor and change the current into the load. Let the inductor current be \$i_L\$, and the output current be \$i_O\$. Then, by Kirkoff's current law, the capacitor current has to be \$i_C = i_L - i_O\$. If the average capacitor current is anything but zero, then the capacitor voltage will continually climb or decrease. Since the capacitor current is the difference between the inductor current and the output current, if the average capacitor current is zero, then the average inductor current must equal the average output current. So, just by the fact that the output voltage is steady and there's a cap there, the inductor average current has to match the load current.
H: How does this circuit generate a high frequency signal? I am new to electronics. I am watching this video. At 5:37, you can see the first half of the circuit generate a high frequency signal. How do an op-amp, 9 VDC, and a few resistors generate a high frequency signal? AI: It's called a relaxation oscillator: - Wiki has a full explanation but, if in doubt, read this from TI entitled Relaxation oscillator circuit. There is also this page from Circuit digest should you need it. And also this page from Analogzoo.
H: stm32 nucleo 3.3V usage This is probably an easy question. When using an STM32 Nucleo powered by a 5V power supply, can I use its 3V3 pin to supply 50mA? Or do I need to use for instance a 3V3 linear regulator attached to my 5V power supply. Thank you. AI: The NUCLEO-G031K8 dev board uses a LD39050PU33R regulator to provide 3.3V rail from other high voltage sources (USB 5V for example): You can use the onboard 3.3V rail to power other devices but make sure not to cross 500mA limit of the regulator. Here's the NUCLEO-G031K8 schematic for reference.
H: Why does this hand tool have this component? I was fixing a corded electric handheld grinder (110Vac) the other day and there was something inside that I cannot explain. The live and neutral supply into the grinder from the cord runs through a metal ring like component and are both wrapped around it twice. Why is this done? I will upload an image of it later on when I can, as it is on my phone and I have no Wi-Fi at present. EDIT: ADDED IMAGE AI: Not wishing to jump the gun, that sounds like a ferrite ring that’s there to minimise the amount of radio-frequency interference that’s sent back into the AC supply.
H: Can I simply adjust the output power of these laser diodes to meet my specifications? If so, then what are the consequences of doing such a thing? I need a CW laser diode, with an integrated photodiode, with wavelength around 800nm and power 1-1.5mW. Although I didn't find anything that exactly matching my specifications, I did find this from Thorlabs and this from Roithner Lasertechnik. Unlike some of the other laser diodes I browsed through, these only specify a maximum power (of 10mW and 5mW, respectively), rather than a typical power, so this seems to imply that I can adjust the output power (in this case, to 1-1.5mW). Am I correct here? If so, then what are the consequences of doing such a thing (is any aspect of the laser diode and/or beam quality degraded in any way by this)? AI: Laser diodes have what is called a threshold current which is the current through the diode at which it starts to lase. With your thorlabs diode, the typical threshold is 25mA (The catalogue uses this term rather than the datasheet. https://www.thorlabs.com/catalogpages/V21/1234.PDF) With your diode running at 2V 25mA you'd be delivering 50mW to the diode and it would start to lase, after that a parameter called slope efficiency comes into effect which in your sheet is typically 0.5mW/mA. To get 1.5mW out you'd need to drive around 28mA into the diode. Thorlabs don't seem to indicate what level of optical power output they define as lasing though so you might be well over 1.5mW by the time you reach that point. Since you've got a bit of spread with regards to threshold current and slope efficiency you might have a hard time locking to 1.5mW without an external power meter and calibration of the diode driver. Edit: It looks like the diode has an integrated photodiode which you could use as part of a closed control loop for controlling power. Which was probably your plan. This isn't the best datasheet, to be honest, I would expect to see some LIV curves here that describe the diode a bit better. I'm not an optical engineer but I don't expect an impact on beam quality based on how much power you supply the diode. Additonally, note that this diode can put you into Class 3B territory which is why you need to make sure that if you use this diode or a diode capable of driving >5mW that you build your design so it is not capable of driving enough current to exceed the safe limit, attenuate the laser, or use a laser that is impossible to drive beyond the limit.
H: Transfer function : Determination I have the below circuit, here, I have Is and Va are measurable quantities. Rc1..Rc4 and Rbd are unknown variables for which I intend to derive transfer function. I have flexibility of adding additional resistances or switches in the circuit to get the equations. I am not sure how to go about it. I am thinking of adding the switches S1,S2 and Sx, and resistance R1 to generate 5 equations for switch combinations S1,S2,Sx[000,100,010,101,011] AI: Your effort to compensate the skin contact resistances is useless. The current source pushes the certain AC current through the tissue, no matter is the contact resistance =0 or more. The resistance between the driver probes must only be smaller than some specified maximum. The current spreads like tissues allow and you get some current density vector field and scalar potential field. Your BIP-BIN probes sample that potential field at two points. What they get doesn't at all depend on contact resistances of BIP-BIN probes as long as those resistances are below megaohms. That's because the BIP-BIN inputs have Zin=gigaohms. The system uses the typical four wire measurement principle. Normally it's used to prevent the measuring wire resistance to affect the result, but contact resistance is taken into the account as well. Using AC doesn't change the idea. Read this: https://www.allaboutcircuits.com/textbook/experiments/chpt-3/4-wire-resistance-measurement/ Your system should use 4 different contact probes (needles?) on the skin to be sure the voltage is measured from tissue, not from the current feeding probe. The probe placement geometry must be always the same for consistent results (=same geometric formation, same distances). I guess that the interface IC can tell that there's overload i.e. too high resistance connected to the drive outputs. Too low contact resistance-that's non-existent. Zero ohms is optimal. If it happens that you are trying to find the contact resistance to extract some extra information - like is the test object nervous - is a different thing. For example lie detection uses that idea.
H: Counter potentiometer's varying linearity on a microcontroller I have a sliding potentiometer and whilst its a linear one, it is not completely linear. I wanted to know if there was a way to filter out the linearity variance using mathematical operators on a microcontroller. AI: Well, what you're asking for is called calibration: so calibrate! Run your potentiometer to know positions, measure the observed resistance, probably in the shape of a voltage at an ADC (ideally, with exactly the microcontroller and circuitry you're using in the actual measurements). Do that in fine enough steps that give you a table to map (some observed) resistances to corresponding positions. Save the table in your microcontroller's code. That's it: From there on, it's just measuring a resistance, looking its neighbors in that table up, and interpolating between them to find the best estimate for position. Considering the locally linear nature of resistance, that interpolation is probably just a linear function. If the relationship between distance and what your ADC measures is significantly non-linear in nature, of course you'll have to adjust your interpolation algorithm (or, at least, you could do better than linear interpolation).
H: How to source/name a 20 pin 19 position usb 3.0 connector I am trying to find the male end of the connectors found on many modern computer motherboards which are used to connect USB 3.0 from a case to the motherboard. These have 2 rows of 10 positions (so 20 positions) but with only 19 pins (corner one missing). The plastic walls around the set of 19 pins are keyed too. Searching on the TE website and digikey and others pretty much always gives either 20 pin connectors with all pins present, or 19 pins but the pins offset from each other. I can find many such connectors on stores like Amazon, alibaba, ebay, etc, but we need a higher volume from a reputable distributer like digikey. We also have high enough volume that we can't just modify existing ones we find on eBay via simply snipping the pin. Is there a terminology issue? A term I often find is "19 pin 20 pin" and "idc", but they aren't giving me anything close to a specific part with a part number from te connectivity or digikey or mouser or similar. AI: Amphenol has, for example, the G823J201240BHR (Mouser, Digikey). Mouser has 2,000 in stock as of today, or 11 week lead time. "Box header for USB 3.0 internal connector, straight type" (Image removed to respect Amphenol copyright terms. See datasheet.) No affiliation with any of the above mentioned firms.
H: How to define a throttle profile for PWM driven DC motor on a power wheels I am building an arduino to output PWM to a simple low side MOSFET motor driver that's powering two DC motors on a power wheels Corvette. I will have a throttle input signal between 0 and 100%, but I believe the output PWM needs to be more complex to account for starting torque and minimum voltage for the motor. Do most drive profiles start with a short pulse of 100% power to break the starting torque before pulling back to match the throttle percentage? Where can I find more information on how to define a throttle profile? AI: It depends on how fancy you want to get. It's common in industrial usage (and model trains) to pulse the voltage to a motor (or the current, depending on what your driver controls). The explanation gets complicated when you're PWM-ing a motor. Normally when you drive a motor with PWM, you're driving it fast enough so that the motor smooths the current. This is a good thing, because it makes for efficient operation. To break friction, you need to pulse the drive to the motor such that the motor generates enough torque to break the friction, and for long enough so that the motor can actually move significantly. Done right, you'll hear a buzz and see your mechanism advance at an almost arbitrarily slow crawl. Slower motion will give you a slower buzz; if you allow control down that slow, really slow motion will result in a ticking sound. For a fixed intensity and on-time, you'll find that for each pulse, the motor advances by some minimum amount -- so you can't move the motor by an arbitrarily small amount. This is just a feature of driving a mechanism with friction and one you have to live with. The fix isn't found in the electronics or the control rule -- it's found in the mechanical construction of the motor and mechanism. For your application, you'll probably be fine -- the amount the car will move with each "tick" will be imperceptible, so the motion will appear smooth to you. Determining the intensity and duration of the pulse is either done with a whole lot of calculation, followed by experimentation to make sure that you were right, or just starting out with experimentation. Since you don't have control over the mechanical design, I suggest just starting with experimentation. Find the amount of drive that'll just barely start the motor moving -- then double it, to account for wear, tear, and changing temperatures. Then find the pulse duration that gives you acceptable low-speed behavior. I throttle such drives by starting out varying the period of the "slow buzz" -- remember that you're keeping a fixed on time, so you vary the off time to get different speeds. Once your throttle is at the height of your pulse (i.e. 25% throttle for a 25% pulse), then just drive the motor "normally" from there to 100% throttle. Then stop messing with it, because this is something that you can get lost in for weeks trying to chase some optimum that only you can see (I've been there, done that -- write "you can't make a silk purse out of a sow's ear" on the wall, and figure that once you're in the neighborhood of "good", chasing "best" is just a waste of time).
H: Doubt about 50 ohm impedance calculation I am developing a 4-layer FR-4 board containing a GNSS receiver (L1 + L2). RF tracks must have an impedance of 50 ohms. The board contains two inner layers of GND and a ground plane around the RF track: To decide the thickness of the RF track, I used an online calculator: https://www.changpuak.ch/electronics/Coplanar_Waveguide_Calculator.php I considered "Substrate Thickness H [mm]" as the distance between the top layer (which contains the track) and the closest inner layer (GND), ie the prepreg. I considered the dielectric constant to be 4.300. But on this other site, the result is a little different: https://spok.ca/index.php/resources/tools/99-cpwcalc On other sites, the calculation is even different. Some take into account several other aspects. My question is, did I calculate correctly? Should I use 0.402 mm or 0.384 mm thickness? My layer configuration (provided by the manufacturer of my PCBs): thank you so much I used trace widths that result in 50 Ohms. On each site, the trace width that results approximately 50 Ohms is different. If you use the same width on different sites, the resulting impedance will be different. If you look, the impedance at both sites is approximately 50 Ohm. But the trace width that results from this is different.I don't understand which of the trace widths actually makes 50 Ohms. AI: There's not a lot of difference (a couple percent between the two results) when the same trace widths are specified. 49.9 vs. 48.7 ohms. The accuracy is given as ~10% on the first calculator and unspecified on the other. Different calculators may use different formulas, with different accuracy and different ranges of applicability. Some use the formulas in IPC-2141A standard and some use the (apparently significantly more accurate) Wheeler's equations from Wadell's Transmission Line Design Handbook. As there is a large range in er for FR-4 (and manufacturing tolerance in the trace widths), there's not too much point in calculating things to high accuracy when using low grade substrate.
H: Is something wrong with this series of assignments? I am trying to cause a series of LEDs to grow steadily brighter over the course of about 30 seconds using an FPGA. However, my code is currently causing them to blink steadily for that duration. Running a Vivado simulation, I've found where the problem is occurring. The code in question is: logic [32:0] intro_count = 33'd0; logic [32:0] BRIGHTNESS = 33'd0; always_ff @(posedge clk) begin intro_count <= intro_count +1; BRIGHTNESS <= (intro_count * 33'd64)/33'd6150000000; end Rather than counting up slowly as it is intended to, the BRIGHTNESS value is flipping from 0 to 1 and back again. Is something wrong with this assignment? AI: You're working with 33 bit values, which can hold a maximum value of 233 - 1 = 8589934591. You're dividing by 6150000000. Therefore the largest possible quotient you can ever get is 1 (since the divisor is more than half the largest representable value). You probably expected the intermediate calculation to automatically promote to a higher bit size to arrive at the desired result, but this is not the case. One option could be to reduce the "fraction" (multiplier and divisor) so as not to overflow. Or you can explicitly promote the intermediate to a higher width, but this is less elegant and it's not guaranteed the synthesis will optimize it in the best way. Is the exact value 6150000000 crucial? You could get much simpler synthesis with a "nicer" number, like a power of 2 or sum of small number of powers of 2. You could also just run a counter, and increment the brightness when the counter reaches 6150000000. This requires an additional register but that's not likely to be an issue, and this is by far the more common approach I see when simple bit shifting doesn't do the job.
H: STM32 SPI Register Write My original function had multiple 8-bit writes (wdata variable) and value inside the same array. This was transmitted by SPI master to a register. Now l'm porting to a new project that needs 32-bit address on the slave. Original: void register_write(uint8_t value) { /* Initialize array */ uint8_t wdata[5]; /* Write command */ wdata[0] = 0x2F; /* Register address */ wdata[1] = 0x45; wdata[2] = 0x81; wdata[3] = 0x23; /* Data written to register */ wdata[4] = value; HAL_SPI_Transmit(&hspi2, wdata, 5, HAL_MAX_DELAY); } Is this the correct way to modify my register write function for 32-bit address and keep my 8-bit value in the same array? I'm trying to avoid having 2 different HAL_SPI_Transmit for the register address and value. Modified: void register_write(uint8_t value) { /* Initialize array */ uint32_t wdata[2]; /* Write command */ wdata[0] = 0x2F458123; /* Data written to register */ wdata[1] = value; HAL_SPI_Transmit(&hspi2, wdata, 2, HAL_MAX_DELAY); } AI: No, those two pieces of code are not even remotely similar. And no, you don't need two HAL_SPI_Write commands if you do it properly. The first code sends 5 bytes from an array of 5 bytes. The other code has an array of two 32-bit integers, or 8 bytes, but sends only two bytes out which must be invalid. The conversion of 8-bit data to 32-bit data is also done incorrectly, as this is a little-endian system. The latter code would send out <0x23, 0x81, 0x45, 0x25, data> which is also incorrect from your original code.
H: dc offset removal I want to manipulate dc offset of a signal. By using a RC filter, I can delete the dc offset when the cap is charged but there is some problem like frequency issue and long time constant. Any circuit suggestion would be appreciated. Thanks in advance. AI: If your incoming signal has a known, constant DC offset, it can be removed or controlled by using a differential amplifier and changing the (-) input with an added voltage (simulate it here): You could also AC couple the signal. As you noted, the problem with AC coupling is that the AC-coupled signal could have a very long time constant. There's another issue as well: a running DC imbalance in your signal will add an offset to the resulting output. To deal with both issues, what you can do is detect the positive and negative peaks of the signal and use that to compute the midpoint, then feed that back to cancel the offset. Here's an analog-approach example using peak detectors (simulate it here) If your system is ultimately digitizing the input, you could use this path to calculate the midpoint (your battery DC voltage) then feed that back to the front-end using a DAC to cancel the offset and allow you to pull out the AC signal.
H: What type of connector does this flow-meter use? I bought the following flow sensor: https://www.adafruit.com/product/828 It generates pulses for each revolution. Now I connected it to Arduino via Dupont connectors. I want to make a proper PCB for my project. Please help me find the connector type. AI: It looks like a JST SM connector to me. https://cdn-shop.adafruit.com/datasheets/JSTSM.pdf
H: Reduce coil whine in LED driver I have designed a PCB to control RGB LEDs at various intensities using the PWM input to an ALW8808WT-7 driver from an STM32RCT MCU. The 33 uH inductors in my prototype board let off an awful whine while the LEDs are running. Is there a way to design around this for my next board? I have attached a picture of the schematic for reference. AI: The conversion frequency of all these chips is way above the audible range; so on the face of it you should not get any audio whine. Well there are ways that you still can. Check the coil for saturation, remember that the chip peak current is much more than the LED current, a bigger coil should be better. Also put a scope on the switching node. You may not see a nice even square wave at the switching frequency. Instability often occurs at audio frequency. Also check on the scope for subharmonic oscillations which plauge these basic chips.
H: UC3907DW which pins are the two batteries? I have a project and want to power it from smart phone power banks. Now 2.1 ampere at 5 volt is not enough to power a motor. I want to combine multiple power banks (4) to provide enough current and voltage to the motor. My issue is, most discussions warn against linking up the power banks directly. UC3907DW is a microchip, which distributes the current it draws across multiple devices. Now, I have seen the documentation fro this microchip; found here: https://www.ti.com/lit/ds/symlink/uc3907.pdf?ts=1626506550271&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FUC3907 It does not clearly explain which four pins are required for the two batteries and which two pins are the output. Can someone help? Any other information is also appreciated. Thank you AI: It does not clearly explain which four pins are required for the two batteries and which two pins are the output. Because it isn't used like that, you need one per power source. See the diagram on page 6. You need to create a shared current sense bus as well as power buses.
H: PMOS Saturation Condition we know for nmos works in active region, we must have Vgs-Vth>0 and Vds>Vgs-Vth. For PMOS can I write like this | Vgs|-|Vth|>0 , |Vds|>|Vgs|-|Vth|. Please correct me if I am wrong AI: You are wrong. The terms \$V_{\text{gs}} \$ and \$V_{\text{ds}} \$ are polarity sensitive, so you cannot just take the absolute values. The requirements for a PMOS-transistor to be in saturation mode are $$V_{\text{gs}} \leq V_{\text{to}} \: \: \text{and} \: \:V_{\text{ds}} \leq V_{\text{gs}}-V_{\text{to}}$$ where \$V_{\text{to}} \$ is the threshold voltage for the transistor (which typically is \$-1\text{V} \$ for a PMOS-transistor).
H: How can I manufacture an integrated circuit after prototyping with an FPGA? I don't want to build the integrated circuit myself, I want to send the schematics to an IC factory to build my design and ship it back to me. Is that possible? I have finished prototyping on the FPGA. So my question is, is there such a thing as sending your IC design to a manufacturer to build it for you? AI: Sure, but unlike making a PCB this is not a simple thing to do. First, you don't simply send over your HDL. Fabs require geometry, in GDS format. So that means you have to convert your HDL using some sort of HDL to GDS flow. Not only that, you need to conform to the fab process design rules. You'll most likely want to use standard cell logic, and for this you'll need to get your hands on a process development kit (PDK) that's compatible with the process. But that's just for the logic gates, you'll also likely need to get RAM IP (usually in the form of a RAM generator), PLLs, IO components, etc. Depending on the process, licensing all of this can be expensive. And you'll also have to wire up all of the clock and power connections as well. And you'll want to simulate as much as possible to try to prevent mistakes, and add extra debug logic such as internal JTAG chains so you can test the design. And you'll have to get it packaged, including doing things like placing bond pads on the die that get connected to the package pins.
H: How to utilize USB-Type-C connector as a normal connector? I designed two custom PCB boards with one acting as my main Sensor Board and having a Controller (ESP32) interfacing all the sensors and peripherals. The other board is a programmer board that houses a CP2102 circuitry for converting USB protocol into UART for programming the ESP32 chipset using Automatic bootloader. The two boards are supposed to be connected through USB type C connectors. Both boards have a female USB-C connector on them and hence I have a male-to-male USB-C cable for connecting the boards. I have 5 connections that need to be connected from Programmer Board to Main Board namely: RXD TXD RTS DTR GND Below is the schematic for both the boards. The issue is that I am getting continuity for RXD, TXD and GND between the two boards but the RTS and DTR pins are not showing any continuity. Did I miss something with respect to circuit design? Was there some standard practice I should have followed? Please guide me? Or this is some cable issue? AI: The problem you face is that USB-C cables are not wired 1:1 as you have assumed. Furthermore not all USB-C cables are made equal. This is one of the many reasons why you should not use standardised connectors for non-standard purposes. Firstly you need to be sure that it is a full-featured USB-C cable, one which is intended for use with USB3.x and so includes the superspeed (SS) wires - i.e. is not a legacy USB 2.0 only cable (as mentioned by @Justme). Secondly, once you have a USB3.x compatible cable, things will still not work as you desire. For the SS lines, the USB-C cable routes them in cross-over configuration - Tx1+ to Rx1+, Tx1- to Rx1- and so on. This means your DTR and RTS lines don't actually connect through in the way you think they do. The DTR line from the "main board" connector is on TX1+ (A2) and TX2+ (B2), which maps to the unconnected RX1+ (B11) and RX2+ (A11) pins on the "programmer", hence no connectivity. The RTS line from the "main board" is on RX1- (B10) and RX2- (A10), which connect through to TX1- (A3) and TX2- (B3) on the "programmer". Again no connection is made.
H: Why won't this mechanical relay close NO contacts I am trying to close the normally open (NO) mechanical relay contacts using the circuit below. . The mechanical relay is Panasonic Relay. I notice that when I give the high command for my GPIO I do see the LED turn-on and I hear a very soft click coming from the relay. Much quieter than I am used to but if I test the resistance across the NO relay contacts there is no connection. On the transistor I read approximately 0.78V on pin 1, 0V on pin2, and 0.026V on pin 3. I read 4.95V on A2 of the relay and 3.14V on the GPIO. Does anyone know what may be the issue? Also is there any polarity in the A1 and A2 contacts? If so I have not considered this.. The transistor I used transistor datasheet AI: Read the table in the data sheet: - You are using an 18 volt relay and you are expecting it to work at 5 volts: -
H: Estimation of single photon signal from photomultiplier tube data I am trying to estimate the peak of a single photon signal in the oscilloscope by looking at the datasheet of the PMT (I am using Hamamatsu H7195 but the picture below is just for illustrative purposes). I started with the luminous of the Anode and estimate the flux(in lumen) using this. But I am stuck after that. Other data available are the impedance is 50\$\Omega\$, and the single-photon signal has a width around 1ns (estimated from Hamamatsu's HPD datasheet). Could anyone give me some hint on how to estimate from the data available here? Or it is just impossible to do that by looking at the datasheet? AI: I started with the luminous of the Anode and estimate the flux(in lumen) using this. You are making this much harder then you need to. Your datasheet gives you the radiant sensitivity in amps per watt, which gives you how many amps of current you get per watt of optical power. Knowing your wavelength, you can calculate how much energy each photon has and then convert that into amps of current per photon. Finally, once you know how many amps each photon (per second) gives you, you can multiply that times 50 ohms and divide by your rise time to get the approximate peak voltage. Note that I say approximate because the peak voltage depends on the shape of your pulse (which is almost certainly not symmetric for a PMT), while the sensitivity in that datasheet is only the "typical" value, and for PMTs that can vary by an order of magnitude or more between devices. So at best you're going to get the peak value within a factor of maybe 3 or 4. When you buy a tube from Hamamatsu, usually it comes with measurements for that specific tube, from which you can more precisely calculate the expected amplitude.
H: Can the FTDI232RL USB-to-serial device be programmed for 2 start bits? I'm a hobbyist. I ran across a peculiar TTL-level UART, the 74LVC8153 (PDF). I'd like to connect one or more of these to a laptop using a USB-to-serial device, and the most widely used USB-to-serial seems to be the FTDI232. Difficulty...the 74LVC8153 part requires peculiar framing: 2 start bits (low, high), 7 data bits, and 1 stop bit. The data and stop bits are fine, but "two start bits" is a different story. I've looked at the data sheets I could find for the FTDI232, its device drivers, traditional Linux/MacOS terminal drivers, the stty command, etc. There seems to be no direct support for 2 start bits anywhere. Does this kill the idea or is there some way around it? For example I found this FTDI232 trick for setting nonstandard baud rates, but nothing about framing. Or is there some other USB-to-serial device that supports more framing alternatives, or a sort of "raw mode" where I could just send it bits that control the transmit line? AI: No, the FTDI FT232RL, nor any other UART to my knowledge, can be set to the framing mode required by your chip. However, it is not a hardware framing selection problem, but a software data encoding problem which is easily solved. After all, the datasheet does mention that the chip is compatible with UART serial data format. It just does not mention an example how to do it. Since you need to break the transmitted parallel data output byte into two nybbles and send them as two bytes that also contain the address bits and the extra start bit as standard UART data bytes anyway, you can simply use standard 8N1 framing and send the second start bit for the chip as data bit that is always 1.
H: Understanding sawtooth wave harmonics I've been playing synthesizers for a while and I'm trying to understand their math and electronics better. The sawtooth is one of the three common waveforms on most subtractive synths. The waves are generated by one or more VCOs and are modulated through LFOs and other sources, and we finally use some filters to remove certain frequencies and get the desired sound. I more or less understand the way these filters work, however what I don't understand is how does a sawtooth wave come to have any harmonic content at all? They way I see it, there is nothing there to be filtered except for the wave's fundamental frequency. I'm assuming the answer to this depends on how the wave is built. If it's built additively by summing up different sinusoids then I can see how the different "frequencies" are present. However, per my understanding, we normally don't build an "analog" waveform like this, we rather slowly charge up a capacitor and then discharge it to get a ramp-like wave. Now I know that this shape can also be mathematically "approximated" as a summation of sine waves through a fourier transform, and the transform is applicable regardless of how the wave is built, but I don't see how the possibility of such a decomposition results in those harmonics "actually", not mathematically, being present in the wave; they were simply not there to begin with. So the question is, how it is that there are different harmonics in a sawtooth that we can filter with filters later? Don't hesitate to correct my understanding of how the sawtooth is built in the first place and please explain the electronics as simply as possible, I've never been really good in this stuff. Update: I think what I find most confusing or counter-intuitive is that the harmonics suggested by the fouriers series for the sawtooth function actually exist and are not just a mathematical abstraction. AI: They way I see it, there is nothing there to be filtered except for the wave's fundamental frequency. If that was the case, you would only have a cosine with the fundamental frequency. Any periodic signal that's not just a cosine is composed of a sum of them. I'm assuming the answer to this depends on how the wave is built. No! The spectrum of a signal is property of the signal, no matter how you constructed that signal: same signal, same harmonics. Don't hesitate to correct my understanding of how the sawtooth is built in the first place It doesn't matter how it's built - a sawtooth has exactly the harmonics every sawtooth has :) Thing is relatively straightforward: "harmonics" are harmonic oscillations (that means cosines) that are at multiples of the fundamental frequency. What you are looking to understand is the Fourier series; I was about to write a short introduction here, but realized my phone's swipe keyboard suggests you'll be happier with one of the thousands of introductions to Fourier series, Fourier analysis and the Fourier transform that you can find. Start in Wikipedia!
H: Does a windmill generator spin faster or slower if no power is being tapped from it? Title says it all. I can imagine it spinning faster because the energy that would be driving the generator isn't being tapped. But I could also imagine a scenario where a safety mechanism might prevent if from turning at full speed while the generator is disconnected. AI: A small fixed-pitch windmill will rotate fastest when there’s no load. However, larger wind turbines have variable pitch blades that are adjusted so as to extract the maximum amount of energy for a given wind speed. On windy days the limiting factor is that the blade tips need to be kept subsonic (at around 20-30rpm for large turbines) otherwise the noise level increases significantly.
H: FPGA streaming data I want to know how to stream data from my PC to my FPGA and from FPGA back to my PC. I have a cmod A7 artix 35-t Xilinx FPGA. I have read some responses online but a lot seems to be quite high level and there are no sure details. I have heard, using ethernet protocol to send the data packets, USB, DMA's. Has anyone had any prior experience with implementing streaming of data back and forth from the FPGA and PC? Also would this be possible to implement in VHDL? If so, what would be the procedure? AI: The Artix device on that board doesn’t offer any PHY options, so whatever scheme you choose will have to connect your PC using some kind of support bridge. One reasonable choice would be a USB to FIFO interface like the FTDI FT600. You could also consider an eMMC or SDIO bridge, which will be more complex due to their protocols. SPI is also possible, assuming you have a suitable bridge. You could also consider a UTMI+ or ULPI bridge to USB. Unfortunately there’s not enough on that Artix to much more than that with a modern PC. The XA35T does have a version with a PCIe hard core and PHYs pinned out, but not on the Digilent CMOD.
H: Three different dimensions shown in package drawing, what do they mean? I have an IC that uses this package from analog devices: https://www.analog.com/media/en/package-pcb-resources/package/pkg_pdf/lfcspcp/cp_8_5.pdf. Most of the dimensions are shown in three numbers: I can't find any information on what this means, I suppose there is a max/min value, but then what the third one would mean and in what order they are? AI: It is indicating tolerance. From the top down MAX, nominal, MIN
H: Can I control a PWM Fan with only a potentiometer? If not, what else component do I need to control the fan? I ordered the parts and is still yet to arrive and am a newbie in electronics. I want to know if this is doable. Components I ordered: 5k, 10k, 20k potentiometer, different types resistor (220, 1k, 10k, 100k). Thanks! AI: Well, a PWM fan is controlled by PWM - i.e. a rectangular signal that varies in the time it's "high". You can't make a rectangular signal (or any time-varying signal, really) from a DC voltage with just resistors/potentiometers. So, no. This is not giving you what you need. You can, however, use the potentiometer to control a circuit that includes some active element that generates such a rectangular signal. Now happens something very rare: I recommend a 555 IC: You can use one of the CMOS 555 variants¹ to generate a rectangular wave with variable duty cycle. The LMC555 datasheet shows such a circuit: You'd replace RA+RB with your potentiometer (attach the Disch pin to the potentiometer's wiper). The Datasheet on page 10 explains the duty cycle you'll get from adjusting your potentiometer. ¹ not an NE555 but a TLC555 or LMC555. If the datasheet doesn't say "CMOS" on the first page, wrong component. It's not that you can't build this with a NE555, it's just more annoying, because of higher voltage rail headroom needs and leakage currents, and stupidly high current draw.
H: Is it possible to use a diode in combination with a N-channel MOSFET? I am new to MOSFETs and I could use some help! I want to turn a DC motor on and off using a N-channel MOSFET. I was trying some things out and I found that this works: The motor turns on and off very quickly. The circuit that I want to build is actually a bit more complex and I would like to use a diode like this: Now the motor turns on quickly, but it takes a few seconds before it is turned off. Could anyone explain why this happens? Thanks a lot! AI: It happens because there is a diode in the circuit you built. Connected like that, the diode only allows the MCU to turn the FET on, but then the diode will prevent turning the FET off. So it turns off only slowly due to leakage currents. So while it is possible to put a diode like that, why would you do it as it makes very little sense to do so.
H: Communication between Controller and LED panels I want to control multiple LED panels that have each a chap ATTiny on them which controls some WS2812 LEDs. There's a Master controller with an ESP8266 that is meant to send commands to the individual panels like Panel1: color=red. Which would be the best solution to let the MCUs talk to each other? What i thought about: SPI: I wouldn't use it, since I'd need a CC/CS line to every Panel I2C: Better, Bus system looks good but the cheapest ATTinys don't support it Serial: Not a Bus system Some Bus system like CAN would be ideal, however this isn't supported on the smaller ATTinys and cost is an issue here. AI: As commenters suggest, you should be looking into serial protocols. The ATTINYs can support pretty much any protocol, so you want to pick one that will best fit your needs. You could use a one-way protocol by assigning an address to each node (a ATTINY with LEDs), connecting them all to a common serial bus, and then sending packets like "Hey, address #4, switch to RED" from the controller. Each node would ignore any packets not sent to its address. If these nodes are going to be far apart, then getting the signal to travel reliably is likely going to be one of your challenges. If you are willing to add more hardware, then RS485 (and related current loop systems) are a time proven way to reliably move data over long wires and the hardware can be very cheap. For example, these adapters cost less than $2 each. If the nodes are not going to be too far apart and you do not want to add extra hardware, then I'd recommend using the chip's USART to read rs232 style serial data at a relatively low speed - the slower the more realizable. Connect the TX pin on the controller to a wire, and then connect that wire to the RX pins on all the nodes. You must also connect all the grounds together. If the nodes are all going to be in a row, then you can get slightly more complicated and daisy chain the nodes so that each one's RX pin is connected to the TX pin of the next one all the way back to the controller. This can effectively extend the maximum total length the data can travel. Of course there also also many, many other ways to do this and the best one is really the best one for your particular situation so hard to pick without knowing more details and requirements.
H: Solder SMD on through hole Can I just solder an SMD part directly on the through holes of the PCB? The pitch of SMD matches the pitch of the through holes. AI: For DIY project, no problem. If you manufactured a large quantity then you'd have to care about having a low number of defects which means taking care of all the details. But for one-off DIY projects, yolo. Unless there's something you're not saying, like the SMD part is a power transistor or LDO that needs a copper plane for heat sinking, stuff like that.
H: Electronic circuit troubleshooting resin - is it normal? I have just started my first electronics troubleshooting project of trying to fix our family's toaster. One of the first things I learned was that capacitors tend to be commonly faulty parts of a circuit and so by visually inspecting the board you can assess a little bit of whether or not one of them is causing the issue. Pictures of the board: From what I saw the capacitors looked fine, no swelling or weird ooze coming out of them but there are a few resin-like blobs close to some of the capacitors and I'm unsure why they are there. Were they meant to keep the capacitors stuck in a certain position? Is there even a purpose for them? Are they a sign of deterioration, like an overheated board for example? AI: The capacitors are glued to the circuit board to keep them steadily in place so their conductors don't get worn out due to mechanical stresses, like shocks and vibration. That's normal. The capacitors also look just fine, so you can't visually check if they are OK or faulty.
H: Loss-free resistor model Can someone use a simple explanation to tell me what a loss-free resistor model is? I googled it but it is hard to understand. When I study power factor correction circuits, I see some papers use this model to analyze it. There are my questions: What is the loss-free resistor model? Why do we need to use this model to model the PFC? A resistor will cause a power loss, why is it called a loss-free resistor? AI: The loss-free resistor or LFR is a concept which lets you model a lossless energy transfer between a source and a receptor. This model is featuring a resistance which models the energy absorption and a current source which models the lossless transfer to a load. This is called loss-free because all the power absorbed by the resistor is transmitted to the load. The model is shown below: It has been popularized by Bob Erickson and Dragan Maksimovic in their book Fundamentals of Power Electronics to model discontinuous-mode-operated power converters. To model a PFC output power stage, you can resort to this model as the input resistance is emulated by the control law and 100% of the absorbed power goes to the output. I personally prefer to implement a simpler approach where you write a large-signal equation describing how the power is transmitted to the load. This current depends on the adopted control law (how the duty ratio or \$t_{on}\$ is generated) and you linearize the source to obtain a small-signal model: This picture is excerpted from my last book on transfer functions. It illustrates a simplified means to model a PFC and determine its control-to-output transfer function.
H: Building a matrix audio mixer I'd like to build a 4 in, 4 out, 9 V powered audio matrix mixer. Basically it's a mixer where each input has a knob to control the amount sent to each output, effectively forming a routing matrix, like this one. But that one is a passive mixer, very simple but subject to massive signal loss. My goal is to make something that doesn't dampen the signal - it's ok if the signal is a bit dirty. So far, my plan is to build something like this and replicate it 4 times. Being rather new to analog electronics, I'd like some advices. This is based on a op-amp summing amplifier. Here are my (maybe silly) questions: First, is it as simple as putting 4 of those in parallel, sharing their inputs? Or do I have to add something so one bus won't crosstalk with the others? If I get it right, R1/R2 controls the gain applied to each signal in the final mix. So if I want to sum the signals, R1 = R2 right ? Is it ok to have R1 > R2 so pushing the volume knob all the way up will boost the signal? If only the ratio between R1 and R2 matters, how should I choose the values R1 and R2 ? Same question goes for the potentiometer's resistance - how should I choose its value? I guess there are a lot of things missing here. Any suggestion for a beginner? AI: Generally correct. More below. R1 > R2 will increase gain. Correct. See below. You'll need a split-rail power supply. General comments: You are loading a 100k pot with a 10k load to virtual ground. That will load the pot significantly and may affect the "feel" of the volume control linearity. (The pots will be logarithmic.) I would be inclined to use 10k pots and 100k for R1 and R2. The problem with my point above is that you will now have four 10k pots loading each input channel. The four in parallel will have a combined input impedance of 2.5k. I would be inclined to add a unity gain buffer on each input. This should then be capable of driving four potentiometers without difficulty. If there is any likelihood of DC bias on the output then add in a DC blocking capacitor. OK, so how will you handle signals below 0 V? This can be done using a split rail supply (which you haven't got) or by creating a mid-rail "ground" reference. Figure 1. A mid-rail "ground" reference. Image source: CircuitDiagram.net. In this scheme the two 100k resistors on the bottom right have 4.5 V at their junction. This is stabilised by the 2.2 μF capacitor to ground (so that the reference doesn't jump around when you whack the strings hard!). The 4.5 V reference is then fed to the op-amps' non-inverting inputs. Note that since the op-amp chain is now biased to 4.5 V that decoupling capacitors have to be added to each of the inputs and to the mixer output to block the DC.
H: Are there two sorts of *geometry* of JFET? In some schematics of JFET, we see in the geometry that the source and drains are perpendicular to the position of the gate. Example : https://en.wikipedia.org/wiki/JFET In some schematics of JFET, we see in the geometry that the source and drains are parallel to the position of the gate. Example : https://www.electronics-tutorials.ws/transistor/tran_5.html Are there two sorts of geometry of JFET? Also, some schematic (as the first one) schow one gate. Some schematic (as the second one) show two gates: the channel is taken in sandwich. Are there two additional geometries for this point? AI: The first sketch shows the principle of a JFET (in a way that is easy to analyze mathematically). The general concept (in any JFET) is that the depth of the conduction region (between S and D) gets reduced as gate bias increases (becomes more negative). The 2nd sketch is how a JFET is actually constructed, although most JFETs don't have a gate underneath the device also. In addition the depletion region doesn't have the 'wobbles' shown.
H: AC converter with MOSFETs For this AC-AC converter circuit: and these VGS signals: I would like to know how the current flows through the circuit when the FET1 is OFF. These are the output signals - VDS1 and VDS2: It shows that when FET1 is OFF, FET2 is ON. It can't go D2, D3, back source, because the circuit is open. If FET1 is OFF, how does the current get back to the AC source? AI: When FET1 is off current does not get back to the AC source. Instead FET2 will be turned on and the current that is flowing in the inductor continues to flow until the magnetic field subsides. It flows though FET2 and the diodes around it then back to the bottom of the inductor. It is basically a buck converter with bridge rectifiers around the FETs so it can operate from AC.
H: How to choose a transistor for PWRKEY on SIM808 design? I am using a 3.3V digital output signal from a microcontroller. The design documentation suggests using this circuit. How do I determine the transistor that I need? AI: An ordinary general-purpose switch such as an NPN transistor or n-FET can work. 2N3904 or similar for the NPN; 2N7001 or similar for the FET. Using this kind of open-collector/open-drain device avoids two issues: GPIO I/O voltage vs. the SIM800H VBAT pull-up voltage Host power state vs. the SIM800H power state If you don't use a transistor, you'll need to carefully consider these issues in your design to ensure that there will be no leakage currents in any of the power states (including VBAT being not present.)
H: Why is this thermocouple amplifier with analog output circuit not working? I am trying to assemble a circuit based on this datasheet: The schematic I derived from the circuit is: This was made into a PCB footprint The readings I am getting from this circuit are much too low though. I am using GPIO2 on an esp-wroom-32ue the analog readings have 12bit resolution and therefore span 0-4096 for voltage 0-3.3V. The circuit is designed to produce 0V at 0C and 4V at 400C. But when I submerse the k thermocouple in near boiling water I only read an analog value of around 12. I am expecting to read a voltage of about 1V here this corresponds to 1V*(4096/3.3) = 1241 analog reading. At room temperature I am reading a 0 analog value at an ambient temp of 27C. A few observations I wanted to mention: During assembly I installed IC202 (LT1025A) in the improper orientation and this may have damaged the IC. I have reoriented the IC since this error. I noticed that when I read the voltage across the 246K resistor I am getting just above 1K, I believe this to be because of the adjacent capacitor but am not sure if this is a problem. The circuit does respond to extreme changes in temperature within several seconds. edit: It was mentioned that the impedance provided by the voltage divider circuit on the ltc1049 was providing negatively affecting the reading. I did remove R203 and 204 and am seeing somewhat better results. Does anyone know why having the 330 and 510 ohm resistors as my voltage divider was a bad choice for this circuit? AI: That particular micro-power op-amp has a typical short-circuit output current in the 400uA range with a 5V single supply, so you are overloading the output stage with the low value divider values you are using. You should not come anywhere close to that value- output swing is characterized for loads of 10K and 100K so somewhere between those two (for the divider in parallel with the feedback resistor) would be good. Edit: Relevant curve from datasheet. Note that one should not come anywhere near to the typical values since parts vary from unit-to-unit and with temperature, and short-circuit current capability is not a good indication of what loading is acceptable under optimal conditions: Based on this, I don't think drawing much more than 100-150uA is safe. As an aside, there are many color codes for thermocouples, and red(+)/blue(-) is correct for the Chinese product you are using (as well as British standard). There are better and cheaper zero drift op-amps that you might want to substitute, or you could change the divider. I believe that the module you are using already includes a divider so a simple series resistor R203 may suffice with R204 open. Alternately, change the feedback resistor ratio around the op-amp and avoid the external divider entirely. Note that IC202 is supposed to be measuring the temperature at the two junctions formed where the Chromel and Alumel wires connect to copper, and any temperature differences between those will result in (likely varying) errors in your reading. Edit: You want the three points shown with arrows below to be at the same temperature as each other (the T/C points would be the two points where the copper terminal strip and lug contacts the thermocouple wire). Everything in the green circle should be thermally isolated from other heat sources on your board and otherwise. Any errors in the temperature measurement are directly reflected in the reading. The LT1025A produces an analog output that is a rough linear approximation of the specified thermocouple output near room temperature, and to do so it needs to be at the relevant temperature.
H: PWM output power I was learning about PWM circuits and something confused me: If you have 1V going into a 1 ohm load for 1 hour we would get: 1V * 1A * 1 Hour = 1 Watt Hour If you have 1V going into a 1 ohm load for 30 minutes we would get: 1V * 1A * .5 Hours = .5 Watt Hours What if we had 1V at 50% duty cycle going into a 1 ohm load for 1 hour? My intuition tells me it should be equal to running the 1V at 100% duty cycle for .5 hours and at 0% for .5 hours: 1V * 1A * .5 Hours + 0V * 0A * .5 Hours = .5 Watt Hours However, another way to look at it would be: .5V * .5A * 1 Hour = .25 Watt Hours Which is correct? AI: The average voltage indeed is 0.5V in your example, however power is proportional to the square of voltage, so you cannot simply use the average of the voltage and the resistance (energy is the integral of power over the period). The concept of RMS (root-mean-square) voltage takes care of this situation. The RMS voltage of the 50% PWM'd 1V is 0.707V. So the 0.5Wh is correct. The difference becomes ever more evident as the duty cycle drops. For example, a 100V pulse at 1% duty cycle has an average voltage of 1V, however the power into a 1 ohm load is 10kW during the on-time and thus the average power is 100W, not 1W.
H: capacitive leakage current The question and answer is: Why didn't he use the secondary voltage? I mean it should be a = Is / Ip = 5 / 2000 = 1 / 400 secondary voltage = 115 * 400 = 46 MV Thus, leakage current = 46 MV / 10.6 MΩ = 4.33 A Source: OBJECTIVE ELECTRICAL TECHNOLOGY For the Students of UPSC (Engg. Services); IAS (Engg. Group); B.Sc. Engg.; Diploma and Other Competitive Courses. (Over 3500 Objective Questions with Hints) V.K. MEHTA, ROHIT MEHTA S. CHAND & COMPANY LTD. ISBN : 81-219-2097-3, 2010 AI: We're talking about a CT here and, CTs have a burden resistor on the output that limits the secondary voltage to a few volts. You have calculated 46 MV and that is a ridiculous voltage to have on a CT output. The whole point of this exercise is thinking about the capacitance from the 115 kV line to neutral (0 volts) and calculating the current that flows through 250 pF. It has nothing to do with the CT's primary voltage (much less than a small fraction of a volt) nor anything to do with the output secondary voltage (a few volts maximum).
H: Help solving circuit with Mesh Analysis and Current Source I've been for some hours trying to solve this thing with Mesh Analysis but I don't seem to be able to understand how to do it! Could anyone please explain how I can do this? Disclaimer: I've never been told about Supermeshes or to "invent" a voltage V across the source - I found out about them a hour ago or so (still didn't help, as I remain confused...). What I was told was that the number of mesh equations I needed were Branches-Current_Sources-(Nodes-1) = B-C-(N-1)=5-1-(3-1)=2 mesh equations. The one with the source on it would have 10 A flowing. I have a resolution of this, but the mesh has the opposite direction to the current source. I'd say that wouldn't matter. I didn't look at the resolution until I finished my attempt - in which I put the direction with the current source direction. That gives me about 6 A on both mesh currents, and that's wrong, according with the resolution and with LTspice, which are both giving the same values (1st mesh, +-1.25 A; 2nd mesh, +-4.4 A; +- depending on your mesh direction). But I don't get why I must put the direction opposite to the current source! This is really confusing, I've no idea what I'm doing wrong on this. This is probably really easy, but I don't get there xD. Any help would be appreciated! Circuit: My resolution (meshes clockwise, except the 3rd one, which goes with the current source): $$\left[ {\begin{array}{*{20}{c}}6&{ - 4}\\{ - 4}&8\end{array}} \right]\left[ \begin{array}{l}{I_{11}}\\{I_{22}}\end{array} \right] = \left[ \begin{array}{l}10\\10 \times 3 = 30\end{array} \right]$$ That gives: $${I_{11}} = 6.25\;A$$ $${I_{22}} = 6.88\;A$$ My teacher has -30 V in the last matrix (3rd mesh opposite to the current source direction), which results in -1.25 A and -4.4 A, which is correct... Not sure what I did wrong. Already looked at this various times and I don't find the mistake. Note: the resolution starts with the matrix. We don't write equations, since we were told to just go for the matrices which seems to be faster than being writing the equations and get to the matrices anyways. If needed, I can write the equations and get to the matrices. AI: There's a schematic editor available to you, here. You should probably use it. It numbers the parts. simulate this circuit – Schematic created using CircuitLab $$\begin{align*} 0\:\text{V} - R_1\cdot I_A + 10\:\text{V}-R_3\cdot\left(I_A-I_B\right) &= 0\:\text{V}\\\\ 0\:\text{V} -R_3\cdot\left(I_B-I_A\right) - R_2\cdot I_B - R_4\cdot\left(I_B-I_C\right) &= 0\:\text{V}\\\\ I_C&=-10\:\text{A} \end{align*}$$ (Note that \$I_C\$ is negative because the current source is opposite to my choice of direction for \$I_C\$.) Therefore: $$\begin{align*} - \left(R_1+R_3\right)\cdot I_A +R_3\cdot I_B &= -10\:\text{V}\\\\ R_3\cdot I_A - \left(R_2+R_3+R_4\right)\cdot I_B &= R_4\cdot 10\:\text{A} \end{align*}$$ So the matrix is easy: $$\left[\begin{smallmatrix} -6 & 4\\4 & -8 \end{smallmatrix}\right] \left[\begin{smallmatrix}I_A\\I_B\end{smallmatrix}\right]=\left[\begin{smallmatrix}-10\\30\end{smallmatrix}\right]$$ From which I do get \$I_A=-\frac54\:\text{A}\$ and \$I_B=-\frac{35}8\:\text{A}\$. I don't know if that's just a coincidence in my choice of clockwise currents for \$I_A\$ and \$I_B\$ with respect to your reference, though. Since those currents are both negative, it just means that my choice of direction is opposed to the circulation direction of conventional current. Here's the final result: simulate this circuit (Which I hope matches up with your LTspice results.)
H: How is the feedback separated in the block diagram given below? How is the feedback separated in step 3 ? I can understand step 1 and 2 but not step 3. AI: Try this: - Hopefully that should be clear.
H: Write EEPROM while flashing firmware in MCU am using a STM32L0x2 device, Arm Cortex M0 core. My goal it's to flash a default value in a EEPROM page during the firmware's flash. Long story short: I want that when flashing the .elf in the MCU (I am using STM32CubeProgrammer) a specific EEPROM's page it's written with the data i want. My boss said there should be a specific #pragma but i wans't able to find anything on the manual. Thanks. AI: Easy method, very portable. Store the defaults in a normal const structure, on bootup check if the eeprom is written, if not, write it. By default the memory will read FF, so a blank check is easy. Drawback: extra code. Advantage: you can keep contents during firmware update, if you want to. Toolchain method, highly integrated. Change the linker file to give the EERPOM it's own section. Put a const structure in a file called eeprom.c, at put eeprom.o in this new section. Drawback: keeping contents on firmware upgrade is difficult. Advantage: you learn about linker files. There is no pragma to use, ST's are not AVR's.
H: Verilog non-blocking assignments Consider the following Verilog snippet: module mod1 ( input clk, input [1:0] a, input [1:0] b, output reg [3:0] c); always @ ( posedge clk) begin c <= {c, &a, |b}; c[0] <= ^c[3:2]; end endmodule In my textbook it says A group of blocking assignments are evaluated in the order they appear in the code, whilst a group of nonblocking assignments are evaluated concurrently, before any of the statements on the left hand sides are updated. So what does that mean here? Suppose c = 1100, a = 11 and b = 01 at the beginning. The first statement will read as c = 0011 and the second as c[0] = 0 because the c in the second statement is 1100 since the assignments only take effect after the clock cycle if I understood the textbook correctly. But what is c in the end? Is it 1100 because of the last statement, or is it 0010? Please also explain why. AI: Both statements assign a value to c[0], so even with nonblocking assignment, it is the last statement that prevails. This means that |b in the first statement is discarded, and the result will be 0010. The first three bits come from the first statement, and the last bit comes from the second statement, all updated simultaneously. It could be written as a single, less confusing statement: c <= {c[1:0], &a, ^c[3:2]};
H: Is it possible make capacitors discharge like batteries do? This question is regarding the possibility of use of capacitors as batteries. One impediment in this is that the capacitor quickly discharges unevenly. But here's how a typical lithium ion battery discharges. Is it possible to regulate the discharge of capacitor so that it discharges more evenly? Would there by any energy loss? Let's say we have a capacitor which has 100 kJ of energy stored in it. I have a device to run which needs constant voltage and current. Is there a way I can use this capacitor to power the device so that the energy is released constantly? Is there a way to achieve this by adding external circuits which can do this? AI: Sure, you could put a switchmode DC-DC converter1 between the capacitor and the load. It would provide constant output voltage until the capacitor voltage drops too low to operate it. Obviously, you'd want the converter to be as efficient as possible. The capacitor will discharge at constant power, which means that the current will increase as the voltage drops. 1 Buck, boost or buck-boost, depending on the range of capacitor voltage relative to the output voltage.
H: Capacitor banks with opposite polarities How can the polarities be opposite? Source: Distribution Switchgear Professor A.T. Johns ISBN (10 digit) 0 85296 107 3 ISBN (13 digit) 978-0-85296-107-0 AI: This is about AC distribution, so you can think of one wire as the neutral with 0V, and then the other wire is the phase wire which alternates between positive and negative. If you plug in a capacitor to say 230VAC mains, and disconnect it at the moment of positive peak voltage, the capacitor stays charged to the +325VDC positive voltage. If you disconnect it at the moment of negative peak voltage, the capacitor stays charged to the -325VDC negative voltage. So if you connect the capacitors now together, there is 650VDC voltage difference which will double the inrush current compared to say other being discharged to 0V and other having the full positive or negative 325VDC.
H: Gap between electrical connectors Just wondered what the smallest gap between two soldered connections on a electronic item can be. The item is running at 24VDC and the series of 6x is running at 30 amperes. How much gap can we get away with between the two connectors? The inspection document released has stated that we can multimeter the connectors and as long as they don't touch we are ok, but this seems odd to me. AI: That is called "minimum electrical clearance" and depends on altitude, coating, etc. Purely as an example, leads and terminations on bare board from sea level to 3050m at 16-30V require 0.25mm spacing per IPC-2221 (2017).
H: CS8406 Audio Interface (I2S->I2C) I'm attempting to interface a MEMS Microphone with an ESP32 through a CS8406. I am aware that the ESP32 has a well-documented I2S hardware interface however for my project I cannot use it. (It's going to connect to a smartwatch I developed in which only I2C and UART are broken out, also the I2S pins are being used to write data to a display from the 70s..... it ate a lot of other pins as well, but very worth it!) The protocol I'm using to transport the Audio data is I2C. I have had a hard time finding anything other than the datasheet on this chip and I want to know if anyone has ever used it with its built-in I2C protocol. I've attempted to make the connections according to the datasheet in Cirrus Logic CS8406 Here are my questions: Is this a reasonable workaround or are there other methods? Has anyone used this chip, and if so could you offer any advice? Thanks! Here is my schematic AI: The design will not work, there is just so many incompatibilities all over it. The microphone does not output I2S but PDM. The mic PDM output is connected to I2S input of CS8406, so it is incompatible. The CS8406 is basically a I2S-to-SPDIF converter, or digital audio interface transmitter. The CS8406 is controlled by I2C interface, it cannot transfer audio via I2C interface. the CS8406 TXP pin is the digital audio output which uses the SPDIF protocol, yet it goes to a transistor which drives a speaker as if it were analog audio.
H: PWM controller for a servo coil (flow valve) I am designing a PWM controller for a butterfly type flow valve operated by a servo. I have some information for the servo like input signal range (0-100mA), servo coil resistance (75 Ohm) and inductance (150mH). I am thinking of a simple architecture as per picture below. I have a few questions to address: At what frequency should I drive the servo. What are the means to determine best frequency at which you have better control? I set servo voltage source to 7.5V (75 Ohm * 100mA). I do realize that impedance of the coil will depend on frequency (PWM DC). What approach should I use to set the servo voltage. I assume it needs to be at a voltage such that control current doesn't exceed 100mA at 100% PWM duty cycle? How to pick an appropriate fly-back diode? How to decrease current ripple at the servo coil. Right now my simulation shows 20mA current ripple. Is this appropriate? Any other considerations or issues I need to think about? AI: Take something like \$f_{PWM}\geq 10\dfrac{R}{2\pi L}\$ , at least 1kHz for your solenoid. Actually you should implement a PI current controller with current sense feedback, the supply voltage shall be quite higher - use standard available voltages (12V),15V, 24V, 48V. Any fast switching diode, you can use schottky. By further increasing PWM frequency. Your application doesn't need flat curve, rather it would be even beneficial to superimpose yet another low frequency signal to spoil this flatness - see: dithering for servo valves. For a "simple quasi" dither function, you could use a variable PWM frequency link Current PI controller. Dither. Intelligent MOSFET switches (highside and lowside), some of them can provide low frequency PWM output with current sense and overcurrent protection - an easy way to interface your MCU with all features needed to make a SC/Overtemperature protected current controller. EDIT: I have drawn a high side P-MOSFET switch with a current sense (3.3 ohm) shunt, RC filter 15k/68n and a rail to rail opamp (I have just picked one, available in LT Spice). At PWM period of 300us (3.3 kHz) and duty time of 200us I get something like 100mA output and 5% dither. You could implement a variable PWM frequency according to the link, so that dither remains cca. 5% on the whole range. The current sense is an option. The PMOS driver is suitable for absolute maximum voltage of 20V, it's fast switching, no need to worry on MCU startup GPIO impedance.
H: Latching circuit with ATtiny85 I would like to know if this circuit will work if i power up an Arduino (via PWR) I am suign this circuit as latching circuit and i do not know how to simulate it since i am new to electronics. Thanks in advance. AI: This isn't really a latching circuit, as it seems like you are going to "latch" the Load pin in software on Attiny85. As BSS84 are really a small transistor with very low gate charge, you don't really need a BJT to control it. You can directly drive it from ATTiny85, just invert your software logic and you'll be fine. And make sure that your Arduino won't consume more than 130mA what BSS84 can handle (or pick another MOSFET with higher allowed current). PS: I'm not sure what's BEMFA pin are for, but probably a better design would be to use a sleep mode of Arduino when it's not needed and wake it up from interrupt. If you can move the BEMFA pin to it, you can avoid having extra MCU & other parts that way.
H: Why a low pass filter across relay contacts instead of a high pass filter? I have found a snubber, it is a low pass filter. It doesn't make sense to have a low pass filter across the contact. I would consider transients such as arcing to be high frequency; therefore, a high pass filter across relay makes sense in order to avoid arcing across contact. Higher frequency signals can pass through the snubber. Can anyone tell me why there is a low pass filter across relay contacts? AI: The snubber provides a lossy path for the inductor flyback. It's essentially a high-pass filter that shunts the flyback spike past the opening switch back to the power supply, dissipating some of that energy in the resistor, as heat. The snubber can also be placed across the coil so the spike energy is shunted locally at the coil, although this wastes AC power when the coil is energized. The RC values chosen are a compromise between catching enough of the spike to prevent arcing as the switch opens, and dissipating power while switch is open (for an AC line frequency of up to 62Hz.) The optimum values depend on the coil and the voltage in use. In this case they've settled on a maximum flyback pulse voltage of 1200V with this specific coil.
H: DIY: emulate button-press on garage door remote I have a 3-button / 3-door garage door remote powered by a 3V CR2032 battery. I would like to use it in a DIY project where, by connecting it to a 3V circuit, I hope to programatically open/close the garage door. With the battery in the remote, I've already been able to emulate a button press by appropriately closing the circuit. The circuit is closed by bringing together a positive ⊥ and negative ⊤ component on the board (polarity identified by a voltage meter). There are 6 of these (2 per door, connecting either or across works). For the next step, I tried removing the battery and stuffing the battery compartment with copper tape to close the circuit. Then I tried closing the circuit as before, this time providing power directly (via the same battery I removed from the compartment). However, this did not work. Is there a reason this wouldn't work? I would appreciate any advice and apologies in advance if I explained poorly; happy to follow up with additional details. Thanks in advance! AI: we see here that the ⊤ is connected to battery negative. (that little gold circle in the middle and all the other vias under the cell's negative terminal testify to this) connecting 3V to the battery positive terminal and 0V to the ⊤ and the connecitn the ⊥ to 0V should cause the appropriate signal to be sent.
H: Measure a circuit (small system current consumption using power source I am powering a chip (CY8CKIT-143A). It is a BLE module + micro-controller. I am using it to transmit the data of a thermistor. I am using a DC power supply (Agilent E3644A). I am powering the system with 3 Volts. Can I use the current reading on the screen as an accurate measurement of how much the system is pulling? Is this a true measurement of required power for the system or do I need to measure across certain pins on the chip? AI: This isn't going to give you very meaningful information as it is likely averaging and rounding the actual current, ignoring any transients that are common to microcontrollers with radios. I highly recommend Nordic's Power Profiler 2 - it's on the pricey side ($99 right now) but comes with few software you can use to log power down to the nanoamp range
H: What is this Digilent Analog Discovery device doing in this experiment? I'm a novice to electronics, and I was wondering if someone would clarify an experiment I just witnessed. A photodiode was set up to receive some signal. This signal is then read by a transimpedance amplifier. Finally, the signal is then “sampled” by a Digilent Analog Discovery. What is the purpose of using this Digilent Analog Discovery (that is, what is meant by it being used for "sampling", in this context)? This device seems to be a kind of portable, compact, all-in-one electronics bench-top device; and, in this case, it seems to me (I could be wrong) that it is doing the job of an oscilloscope. Furthermore, this device seems to be quite expensive, so why would someone use it instead of just making a cheap circuit themselves? Is it difficult/impractical/expensive to build a substitute circuit to do this job yourself, or is it probably just out of convenience for the experiment? In a production device, would engineers still include the Digilent Analog Discovery (I seem to doubt this), or would they just making their own custom board/part (since it seems that it would be much cheaper, and technically optimised to whatever their device is). I would greatly appreciate it if people would please explain what's going on here. AI: what is meant by it being used for "sampling", ... in this case, it seems to me (I could be wrong) that it is doing the job of an oscilloscope Sampling = making voltage readings. In this case the job probably could be performed by an oscilloscope. The Analog Discovery is not just an voltage sampling device. It also has a 2 channel arbitrary waveform generator as well as digital I/O lines. And all of these are fully programmable so you can coordinate their use with each other to create custom measuring instruments. And don't forget the programmable voltage supplies. A classic example is the impedance analyzer. You apply a specific frequency sine wave input into a device and measure the output amplitude and phase shift. Then you repeat this for several different frequencies. This requires coordination between a function generator and your voltage sampling device. And then you need to process the data and display the results in a Bode plot.
H: What is the purpose of a diode connected to the pins of a motor? I am new to electronics. I am watching this video. At 4:03, you can see a diode that connects the two pins of the motor: What role does the diode play? AI: This is called a Flyback Diode. Motors tend to have a large inductance. Once current gets going in an inductor it doesn't want to stop. If you try to stop it anyway by cutting off the current path the voltage will spike to a very high level and probably damage something (the mosfet in this case). The diode gives the current somewhere to go. It routes it back to the other side of the inductor and allows the current to flow in a loop until it dies down due resistive losses. The diode is sometimes also called a Freewheeling Diode for this reason.
H: BJT(NPN) has a VBE higher than 0.7v I am confused about this datasheet for a transistor I am using. From my understanding, most transistors have a VBE of about 0.7v but the max on this one is 1.2v which I thought would destroy most transistors. Does VBE(ON) represent something different than VBE? AI: Look at datasheet figure 5. It's typically 0.7 at 10mA of collector current, but if there is need to drive more collector current, you need more base current, and then the Vbe voltage is higher. And due to manufacturing tolerances, the datasheet guarantees, that when there is 300mA of collector current, the Vbe will never be higher than 1.2V. Typically, it will be about 0.85V according to figure 5.
H: How to measure the temperature of a surface using an Arduino? I'd like to measure the surface temperature of of a metal surface, to see how much that metal surface is heating up. I'm trying to recreate The EngineGuard. The EngineGuard uses a 10mm washer, that is somehow capable of reading temperature. I've done a bit of reading, and there are things like the LM35, but they seem to measure ambient temperature. Could you attach an LM35 to a metal washer somehow to measure the temperature of the metal washer? Is it as simple as putting some thermal paste between the washer and the LM35? If I used thermal paste to mount an LM35, how would I know which "side" if the LM35 is doing the measurement? I've seen these washer type devices referred to as "Ring lug thermistor" so maybe the question is, "How do I make a ring lug thermistor"? If we abstract the problem a little bit, is there a way to mount a temperature sensor to a surface to measure the temperature of that surface? In the use case I am looking at, we only care if the temperature changes more than 5°C, so super high resolution is not that important. The temperature range is 20°C to 130°C. The ambient temperature will be 10 - 30°C, so hopefully insulation from the ambient temperature could be controlled by some shrink wrap? I mention the LM35 because it seems popular, but if a thermocouple or other thermistor is more appropriate, please let me know. AI: Ring lug thermistors start from about $4. e.g., https://www.digikey.com.au/product-detail/en/vishay-beyschlag-draloric-bc-components/NTCALUG01A103FL/BC2892-ND/4896929 Not sure DIY would be a good option as bonding the thermistor to the lug while maintaining a thermal connection that could be reliably calibrated would be a challenge. If you are keen on the DIY maybe you could mount a 3D printer thermistor into a suitable lug with thermal paste and careful crimping. As you say, covering with Kapton tape or other insulation might be sufficient to reduce the ambient temperature impacting your reading.
H: Reusing PCB Components What are some good methods when considering designing an automated system which can efficiently recycle PCB’s to extract copper and the components from the PCB which can then be reused and recycled? AI: Recovering for re-use (as repair parts, or for refurbishment and use in new PCBs) is inherently very labor intensive. I've seen some cottage industry smartphone breakers who recover clean and sort parts for sale in markets and online, some of the work literally done in alley ways. Most parts have no value, and some sub-assemblies such as mainboards are more valuable intact than dismembered, so it's not something that can easily be automated- it requires knowledge as well as labor to extract the value. You can also hack off things that contain small amounts of precious metals such as gold fingers or connectors and attempt to recover (eg. chemically) the valuable elements. Again, labor and knowledge intensive particularly with a mixed input stream. Modern PCBs for consumer products contain very little in the way of precious metals (what looks like gold is probably just a thin layer a fraction of a nanometer thin on top of a layer of cheap nickel) so you'd have to process a lot of material to get a bit of recovered metal. That may be prohibitively expensive in places with strict (and strictly enforced) environmental laws (and insufficient subsidies to counteract the costs).
H: TP4056 for Li ion deep discharge I am using li ion single cell in one of the application where device will be in sleep mode when is not in use. Life time of which is nearly 30 days. Cell I am using is Li-ion, 18650 package, 2600mah and comes with "1s 3.7v 2a Li Ion Bms Pcm 18650 Battery Protection Board Pcb". For charging I am using TP4056. It is set to charge battery at 500mA. My concern is if because of some reasons cell goes below its rated and fall into deep discharge, would TP4056 be able to charge it again up to usable voltage ? Is it should be happening ? Any other ways to prevent this situation ? AI: The point of having battery protection is to prevent the battery from reaching a "deep discharge" state in the first place. The battery protection will disconnect the battery when the battery voltage gets too low (usually 2.7 V). For good battery life, you should not let the battery voltage drop this low. Re-charge the battery when the voltage is below 3.6 V. Even if the cell ends up having a low voltage that is no issue for the TP4056 as it will go into "trickle charge" mode. It will do this when the battery voltage is below 2.9 V, then battery is trickle charged until the battery voltage is high enough for normal charging to start. So: deep charge should not happen due to battery protection the TP4056 will work even with a deeply discharged cell.
H: Desoldering capacitors - some get damaged and others don't I was practicing desoldering components with a desoldering heat gun (Quick 861DW) of some boards I salvaged from a broken Sony Bravia HD-Ready monitor. I applied 400C air flow and used some flux on the pads of the SMD capacitors. On the first board I practiced with, they all came off nicely without discoloration or anything (in some the plastic did get a bit burnt,) but on a second board I tried with (using the same procedure,) they all started to inflate before the solder melting point and being able to detach them. Why would that be? Would it be because of the substrate board material? The capacitors seem to be the same type. Here are some photos of the first board and capacitors that came out well: Here are photos of the second board and capacitors, they are turned as I had to twist them to release the air pressure before they exploded: After that I tried with another different board and again they were all removed without problems. AI: It is likely three things: 400°C is very hot. I've had 370°C de-laminate boards before. If you can get away with using a lower temperature, do it. Hot-air desoldering can take longer than other means; be patient. The exact formulation of solder used. There are many types, and some melt at a significantly higher temperature than others. Generally, the higher the temperature, the stronger the joint. Less "thermal relief" on the second board. When desoldering components mounted directly to a solid plane of copper (copper "pour"), the entire area must be heated before the solder will melt, because the copper conducts heat away from the solder joint faster than it is applied. For this reason, thermal reliefs [were] used to ease this issue. These are simply several small connections from the copper plane to the component pad(s), which electrically conduct well, but allow the pad to thermally conduct worse, allowing easier soldering/desoldering. In the early days of surface-mount components, everything had thermal reliefs. But as switch-mode power supplies became the norm (and so too the need for very low-ESR capacitors) and also high-performance in small volume (exacerbating thermal issues), it has become common to directly tie component pads to large areas of copper - either for electrical (low parasitics) or thermal (heat-sinking) reasons. In any case, lack of thermal reliefs make rework more challenging. (It doesn't matter for assembly, as the whole board is reflow-soldered at once.) To mitigate these, you can touch each solder joint with an iron and "contaminate" them via a number of special low-temperature solders specifically designed for rework. These can be found which melt at ~200°C. This makes it easy to remove stubborn parts, even those using very high melting point solders. Down-side is, now you've contaminated those joints with a very soft metal, which will have to be removed and cleaned thoroughly if being resoldered. You can also use a "hot-plate" or "heat-bed" to pre-heat the entire board to some lower temperature (say 200°C) prior to removing individual components. This makes it much easier, but you do have to take care not to melt any plastic bits.
H: Envelope detector followed by a low pass filter What are the advantages of adding an RC low pass filter after an envelope detector? I am asking this because I often notice (in multiple studies) that this type of circuit logic (in the figure below) is used for information demodulation by first using a high-pass filter, then an envelope detector, and further a low pass filter, but I am wondering why. The envelope detector already works as a low pass filter by filtering the high-frequency inputs and giving an envelope of the input signal as output. I can imagine using the low pass filter to further diminishing high-frequency noise, but then again, why not use a bandpass filter before enveloping the signal? AI: The filters before and after the demodulator (the envelope detector) do different things. The filter before the detector is there to make sure that you are detecting the correct carrier frequency. It typically has a band pass filter rather than just a high pass filter as your example shows. Here is a modulated carrier signal: That is a 16kHz carrier modulated with a 10Hz signal. You would use a band pass filter centered around 16kHz to pick the carrier out of noise. After passing it through a detector, you have a signal that looks like this: You can see that there's still some of the carrier there (the tops of the waves are fuzzy) and that the signal is slightly distorted (the bottoms are squared off.) A band pass filter after the demodulator cleans up the remains of the carrier and reduces the distortion: That's not optimal, but it is better than without the filter. Those photos are from some experiments I made a few months ago for a gadget I ended up not building. The bandpass filter before the detector selects the carrier. The bandpass filter after the detector selects the "information" signal - whatever was modulated on the carrier. If you know the content of the noise and interference, you may be able to simplify the bandpass before the detector to just a high pass or just a low pass filter. If you know the content of the signal, you may be able to simplify the filter after the detector to just a low pass filter - or even omit it entirely.