text
stringlengths
83
79.5k
H: Series or parallel fan connection So I wish to wire a project that uses three 12 V fans but I don't know if I should get a power supply with 12 V or 36 V. AI: Use 12V and wire the fans in parallel. If you use a 36V power supply and wire the fans in series, the voltage might not be shared equally. This could even cause the fans to burn out. In parallel, they will all get 12V.
H: Voltage regulators in series I'm trying to figure out if my power distribution setup is hurting my circuitry. Below is a picture of the setup for one device: The power supply is a wall adapter rated for 6VDC/900mA output. The middle item is a special power hub I created from two pins of each USB plug and it is powered from the wall adapter through an LM2940 regulator with the 10uF cap on the input and the 22uF cap on the output. I then connect various USB to C+ plugs to power other circuits off the same hub (hence the right-most box in the diagram). Power to those circuits is passed through its own LM2940 regulator as well. Some circuits contain a max232 chip for interfacing the circuit with a PC but when I test the circuits in my setup, my baud rate must be very limited, and I'm thinking with two LM2940 regulators in series, I'm not getting enough voltage or current to the max232 and I feel my only way(s) out could be to ditch the hub and power each circuit from its own wall wart or use a wall wart that can deliver higher current. any ideas? AI: No, this won't work. The LM2940 requires a minimum input voltage of 6.25V for a 5V output. So, your wall wart is not providing a high enough voltage. Furthermore, you can't connect the output of one LM2940-5 to the input of another LM2940-5. You need an ac/dc power supply that provides at least 6.25V. The inputs of both of the LM2940s should be connected to this power supply.
H: My RT8272 buck dc converter fried in my test charging circuit for arduino I'm building a circuit to power an arduino and later a stepper motor from a 3A 24V DC source. The DC power source is a switching power supply, much like those used in notebooks. I'll need after powering off the circuit, 3-4 seconds of charge in the arduino for selective powering down the stepper driver. So I built this part of the circuit for testing an electrolytic capacitor as a backup energy for this power down sequence after switching off the circuit. Arduino is not connected yet for safety, only the DC-DC converter, so no load in the test so far. I'm using a 3.300uF 50V electrolytic capacitor, but I can get one of 10.000uF if needed. I'll probably need no more than 100mA of charge in the Arduino + Stepper driver to perform this selective shutdown later. I'm using a RT8272 based DC-DC buck Driver, as this one over ebay. RT8272 Dc Buck Converter I switched-on this small circuit on and it worked, charged the capacitor in maybe 4-5 seconds and, with no load connected, only the RT8272 DC buck converter, and I got 5V on the Vout of the converter. I then switched off the circuit and even with no load, the capacitor slowly discharged (probably the DC converter drew a bit of current, keeping the 5V in the Vout as the capacitor discharged), until the capacitor gets lower than 5V. I only kept two multimeters measuring the voltages on the capacitor and on the VOUT of the Converter (5V). But when I turned on the switch on again, allowing the power supply to recharge the capacitor and supply the DC converter (the capacitor was at 3V, not fully discharged) the DC Converter fried... Capacitor is still working, power supply also is still working normally. The stepper motor and high current part of the stepper driver are powered by a 24V line that is not in the same path of the capacitor. So the capacitor is needed just for 5V Arduino and 5V for keeping the stepper driver on for a while after it’s high current part get’s shut down. It won’t have to power the motor. But this circuit is not connected yet, just what the diagram shows so far. What did I do wrong so far? How could I improve this initial circuit to prevent this from happening again? Could the DC-DC Buck converter had such an increase of current when I switched back on the Power supply, to fry it, even with no load attached to it so far? Thanks a lot for reading! AI: If you are using a buck converter, your input voltage must always exceed your output voltage. As your cap discharges, the voltage will drop and the current will rise to meet the demand. The datasheet for your Buck shows no information for input voltages lower then 4.75v, therefore any behavior when supplied a lower voltage may not be consistent, nor what you expect. It's possible that you killed the chip when you browned it out by continuing to pull current until the cap has nothing left to give. For your next test, I might look to use the EN pin to disable the buck once the voltage has dropped to a critical level.
H: Fatal Error Audio equalization simulation LTSpice I'm doing a 3s audio.wav simulation on LTSpice with the following circuit (3 band pass filters and amplifiers): In this example it's boosting the bass and attenuating the highs. It loads the first second really fast and then it start to take a longer time: When done amplifying the highs it gets stuck in 2s of the simulation. The error I get is Fatal Error: Analysis: Time step too small; time = xxxxx,timestep=1.25e-15: trouble with u3:qx-instance q:u3:1. Or sometimes it's U6 that fails. How can I solve this? Thanks in advance! AI: When I had some issues like yours I just put this directives: .options gmin=1e-10 abstol=1e-10 method=gear It will change the toleration standards for your simulation, but not so much that will affect your result.
H: PCB Panelization Impact What is the impact on a PCB design if it is panelized? I received a message from a PCB manufacturer: In your order, the quantity of boards is large and the boards are quite small. Can we panelize the boards for easier handling? If no, will cost an extra $32USD additional While I wouldn't mind saving $32, I'm also worried the panelization will leave ragged marks on the PCB edges. Is that the case? AI: Panelization helps your PCB cost, and it also helps assembly if your board is small. You have a couple of options for panelization. If your board is square or rectangular, it can be scribed with with a V-groove and broken apart to singulate it after assembly. The board will have a smooth, straight edge. If your board has an irregular shape, it will be shaped by routing, so it will be attached to the main panel by small gaps (tabs) in the routed-out slots. After assembly, the board is singulated by cutting the tabs with shears / diagonal cutters. This leaves behind a nub. You can request the assembly house to clean this up if it's a problem.
H: Thermal resistance Junction - Maximum Power dissipation I want to understand the real meaning of the parameter 'Thermal Resistance Junction to Air (°C/W) to calculate the power dissipation. So for example if the value of this parameter is 250°C/W, should I take this value as a constant if my ambient temperature is 50°C and then calculate my power dissipation with Pd= (Tj(max)-Ta)/R(°C/W)? Or I have to determine the Thermal Resistance Junction to air as a variable parameter and calculate it considering the ambient temperature and for my case with 50°C (Ambiant temperature). I thank you for your help. AI: Yes you should take that Thermal Resistance as a constant, it is a property of how a chip or device is packaged (how well the package can transfer heat) and if that heat transfer is "helped" in any way for example by using a heatsink. If your ambient temperature is 50°C and you allow the junction in your device to reach for example 90°C then that means there's a 90°C - 50°C = 40°C temperature difference. For a thermal resistance of 250°C/W that means 40°C / 250°C * 1 Watt = 0.16 Watt can be dissipated. Dissipate more and the junction in your device will become hotter than 90°C (assuming the ambient temperature is 50°C).
H: M.2 PCIe x2 and SATA connections and key/notch with SATA/PCIe x4 SSDs For my current project I am adding an M.2 slot for additional storage. Even though SATA data throughput is more than sufficient I would like to support both SATA and PCIe based SSDs, as I dont know what will be more/less available and affordable in future. M.2 Keys The M.2 connectors use keying notches in different positions, depending on the provided interfaces. Each key position is identified by a letter. Key B: SATA + PCIe x2 (+ others) Key M: SATA + PCIe x4 A quick search for M.2 SSDs on amazon showed that most NVMe/PCIe based SSDs use Key M, while SATA SSDs use a combined Key B and M. Therefore, for maximum compatibility, I need to use Key M. Available System Interfaces My system has one SATA and 2 PCIe lanes that may be connected to the M.2 receptacle, what is the requirement for Key B. I am missing 2 PCIe lanes for key M. Plan I plan to use the M key for maximum mechanical compatibility and would like to provide one SATA and 2 PCIe-Lanes on the M.2 connector. Questions Do all NVMe/PCIe based SSDs work with 2 instead of 4 PCIe lanes? Is there a requirement on which PCIe lanes need to be used in this case? How may the two PCIe lanes that are not used be terminated? AI: A card that has B and M notches is generally SATA, although it could be NVMe x 2 if the CONFIGx pins are set to that mode. An M-notch card as a practical matter is strictly NVMe, and can be x1, x2 or x4. There’s no issue with leaving PCIe lanes unconnected. The root complex will sense which ones are and power down the ones that aren’t. The PCIe lane width negotiation starts from the max number of lanes and works its way down. Lane counts are always a power of 2. So a x4 M.2 card would be lanes 3-2-1-0. x2 would be lanes 1-0. x1 would be lane 0. PCIe / NVMe can work over 1, 2 or 4 lanes. So if the host only has 1 lane, you can use that to connect an M.2 card.
H: What is the Voltage on a tablet's battery when it is turned off Basically I tried to find out what's wrong with my broken tablet, so I used a multimeter to measure the voltage at the battery pins on the tablet's board and it was 0.1 roughly, and the transistors had some voltage on them, but the device was not booting. So the obvious reaction was to cut out the old 2x3.7V in series battery and try to use a normal 9v battery(through the battery protection). The screen what reacting this time but the OS was not, and the voltage on ports was half of that of the battery. So the question is why there was only 0.1V at the beginning. Maybe the 2x3.7V battery was not charged enough? Also if the battery used was 9v,it could activate the screen but not some other components? AI: Those 3.7 V batteries need to have a voltage between 2.5 V and 4.5 V per cell, if they're outside that range then consider them to be damaged. Some cells might survive a short time below 2.5 V. But 0.1 V means that they're dead. 9 V might be on the edge of what a device that is supposed to work on 2 Lithium based cells in series can handle. Chances are that a 9 V battery is unable to deliver enough current to start the tablet. So the tablet will attempt to start but as soon as it switches on any part which consumes a lot of current (for example the backlight) the voltage will drop (due to the high internal resistance of a 9 V battery) and the device will reset.
H: Can analogue Hall sensors be used in BLDC for static angle measurement? Everything I have read on using Hall sensors with BLDC motors appears to use latching hall sensors which provide repeatable latching angles as the magnetic fields change at specific angles. I am wondering if an analogue hall sensor can be used to provide intermediate angles for static angle measurements are ever used? And if not then why? AI: It appears I have answered my own question in the affirmative by finding the paper: Position Estimation and Control of Compact BLDC Motors Based on Analog Linear Hall Effect Sensors which all though specific to pancake styled motors I'm sure is adaptable to traditional radial flux motors. Also found information on analogue hall sensors being used in commercial motors in FAULHABER application note 162 Analog Hall Sensors
H: Why are core losses mechanical and not electrical in an AC power flow diagram? The power flow diagram of a generator (a) and a motor (b) are shown. But why are core losses mechanical losses? AI: The synchronous motor/generator has two power ports, a mechanical power port at the shaft and electrical power port at the motor/generator terminals. Because mechanical losses and magnetic losses (core and stray losses) are (approximately) proportional to the motor’s rotational speed, they are often taken together and referred to as rotational losses. Rotational losses are mechanical in nature and are thus subtracted from the mechanical power. That's why the core and stray losses are shown before the conversion from the mechanical domain to the electrical domain. So, stray losses and core losses are not mechanical power losses, but they are subtracted from the mechanical input power (port). The mechanical power losses themselves are subtracted as well. This subtraction is shown by the down pointing wide arrows. Literature: http://electricalacademia.com/synchronous-machines/synchronous-motor-generator-efficiency-losses/ https://www.motioncontroltips.com/faq-what-are-rotational-losses-in-dc-motors/
H: I2C in STM32F103 longer data I am trying to use PCA9539 as an IOexpander for my project. I have a STM32F103 connected to PCA9539 via I2C. The problem I have is to write into PCA9539. Based on the datasheet I should to send (1) address (2) command byte (3 and 4) data bytes via I2C. When I check the I2C bus lines with oscilloscope, I see the micro only sends 2 bytes after address byte. i.e. the last byte wont be send. The PCA9539 sends the ACK. I use atollic and stm32cubeMX Here is my code: HAL_GPIO_WritePin(GPIOF,I2C2_RST_Pin,'1'); unsigned char I2C_2_buffer[8]; I2C_2_buffer[0]=0x00; //command byte I2C_2_buffer[1]=0x50; I2C_2_buffer[2]=0x55; I2C_2_buffer[3]=0x00; /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ HAL_Delay(4000); HAL_GPIO_TogglePin(GPIOD,LED0_Pin); HAL_I2C_Master_Transmit(&hi2c2,0x76<<1,I2C_2_buffer,4,1000); HAL_Delay(1000); } ....... ....... ....... ....... ....... ....... static void MX_I2C2_Init(void) { /* USER CODE BEGIN I2C2_Init 0 */ /* USER CODE END I2C2_Init 0 */ /* USER CODE BEGIN I2C2_Init 1 */ /* USER CODE END I2C2_Init 1 */ hi2c2.Instance = I2C2; hi2c2.Init.ClockSpeed = 100000; hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2; hi2c2.Init.OwnAddress1 = 0; hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; hi2c2.Init.OwnAddress2 = 0; hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; if (HAL_I2C_Init(&hi2c2) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN I2C2_Init 2 */ /* USER CODE END I2C2_Init 2 */ } AI: You are trying to write to an input data register. That makes not sense and the chip may consider this as invalid write operation. Try writing to the registers that have defined write operations.
H: Driver circuit calculations I am attempting to built this circuit here: It is used by an LED manufacturer to provide pulses to a high-power LED. In my case, I'm using an ARDUINO to provide the TTL signal. I haven't sourced the other parts yet as I'm trying to understand the system first. I'm a bit confused as to how to calculate the current through the LED. I assume I can change it by varying the resistance (R) and the LED voltage source (V-LED) but I'm not sure what the relationship is, I was wondering if it was dependent on the drain-source current? I've been reading up on MOSFETs/drivers but I don't know how/if it relates to the current through my LED. AI: The circuit assumes that the FET driver is chosen such that it drives the MOSFET's gate so as to turn on the MOSFET "completely". In other words, it's source-drain voltage drop and resistance (RDson) will be so low relative to other things in the circuit as to be negligible. Therefore you can just treat it as a short-circuit for analysis in most cases. Once the forward voltage drop across the diode (any diode) exceeds a certain amount, current will start to flow. Once this happens the voltage drop increases if current increases, but the voltage drop levels out and so does not change very much with current. So the simplest approximation is to assume a constant voltage drop (listed in the LED datasheet somewhere). \$V_{LED}\$ is poorly named since it is not the voltage drop across the LED so I will henceforth call it \$V_{supply}\$ instead. I will then called \$V_{LED}\$ the voltage drop across the LED. In your circuit, you will apply a \${Vsupply}\$ that is higher than \$V_{LED}\$ so the LED actually conducts current. Since we approximate that \$V_{LED}\$ is a constant when conducting, we don't need to consider about how the amount of current being conducted affects \$V_{LED}\$. We just assume it's the \$V_{LED}\$ in the datasheet. So that means that the leftover voltage remaining in the circuit is: \$ V_{supply} - V_{LED}\$ Where is this voltage made up? Obviously across the only other thing left in the circuit: the resistor (we assumed that the NMOSFET is fully on and negligible voltage drop and resistance so we just treat it as a perfect, ideal closed switch). That means that \$ V_{resistor} = V_{supply} - V_{LED}\$ What's the current in the resistor? It's: \$ I_{resistor} = \frac{V_{resistor}} {R} = \frac{(V_{supply} - V_{LED})} {R}\$ The resistor and LED are in series so that means \$ I_{LED} = I_{resistor} = \frac{(V_{supply} - V_{LED})}{R} \$ This is just a wordy way of doing Kirchoff's voltage law around the circuit.
H: Arduino RGB spectrum problem Over the last few days I've been working on an anode RGB LED in Arduino, I've tried getting it to do an RGB spectrum but all I would get is just the colors from red to green, then it would get stuck on white and cyan, I believe that the red LED in the RGB Anode turns on and off, as the combination of green and blue is cyan and the three of them result white if they're equal which in this case I guess they are (not entirely sure). Thing is the RGB Anode doesn't display all colors, I made it so the level of voltage given to the RGB anode is increased with a loop function and decreased once reached 255 with a decreasing function, here's the code: int redPin = 11; int greenPin = 10; int bluePin = 9; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { redFuncInc(1); delay(100); greenFuncInc(1); delay(150); blueFuncInc(1); delay(200); // calling decreasing methods redFuncDec(255); delay(10); greenFuncDec(255); delay(15); blueFuncDec(255); delay(20); } // Increasing from rainbow spectrum void redFuncInc(int red){ for (int i = 1; i<=255; i +=1){ analogWrite(redPin, i); delay(10); } } void greenFuncInc(int green){ for (int z = 1; z<=255; z +=1){ analogWrite(greenPin, z); delay(20); } } void blueFuncInc(int blue){ for (int u = 1; u<=255; u +=1){ analogWrite(bluePin, u); delay(30); } } // Decreasing from rainbow spectrum void redFuncDec(int red){ for (int y = 255; y <=255; y -=1){ analogWrite(redPin, y); delay(10); } } void greenFuncDec(int green){ for (int x = 255; x <=255; x -=1){ analogWrite(greenPin, x); delay(10); } } void blueFuncDec(int blue){ for (int g = 255; g <=255; g -=1){ analogWrite(bluePin, g); delay(10); } } Thanks for your help, please don't mind my English... AI: (1) None of your Inc / Dec functions use the argument that is passed to them. Not sure if that was intentional, but it's noteworthy. (2) Your Dec functions have a nonsensical termination condition in their loops. Instead of <=255 surely these should have >=0? (3) The way you wrote your loop it's basically going to do the following sequence (after you fix (2) that is): #000000 // BLACK #010000 ... #FF0000 // RED #FF0100 ... #FFFF00 // YELLOW #FFFF01 ... #FFFFFF // WHITE #FEFFFF ... #00FFFF // CYAN #00FEFF ... #0000FF // BLUE #0000FE ... #000000 // BLACK Not sure that's what you intended, but there you have it. (4) Don't say z += 1 and z -= 1 in your for loops, say z++ and z--. People who read code will raise their eyebrows at the prior.
H: JK flip flop PRESET and CLEAR function I understand that Preset and Clear inputs are asynchronous inputs which means whenever Clock signal is low one of them can immediately set the output to 1 (Preset) or to 0 (Clear) (assuming they are active high inputs). But I wonder what happens when one of those inputs has been set to 1 when Clock was 0 and then Clock goes 1. Does J and K ovewrite Preset/Clear or they have to be released to let J and K affect the output? AI: If Preset and Clear are asynchronous, they will be effective regardless of the state of the clock. If you set "Clear" active, the flip-flop will be cleared immediately regardless of the state of the clock, and will remain clear if the clock changes while Clear is held active. A synchronous Set or Clear will only set or clear the flip-flop on an appropriate clock edge.
H: Rotary encoder sensor Is there a way to get reading from rotary encoder without microcotroller? just simple circuit that count and increment, like op amp or 555 timer or logic gate . anything that u can help me . AI: Is there a way to get readings from rotary encoder without micro controller? Yes BUT, the encoder DOES NOT COUNT it only provides arc position counts. For example the optical type encoder you show might produce anything from 128 to 1000 pulses per revolution on two channels (A and B). Assuming you want an up/down counter that tracks the angular change pulses in the encoder (and you show an optical encoder), all you need are TTL or CMOS counters. You need logic to perform: Pulse production derived from the leading edge of the sensor output channels. The encoder signals are a quadrature output where the phase relationship tells you the direction. Something like this: This circuit can do x1, and x4 (I leave you to discover what this means for quadrature encoders) and produces a clock and Up/Down signal to drive a counter chain of however many digits you need. This schematic does have an error (from the comments) and is onoly shown as an example of what might be done. The newer device (LS7184) does x1, x2 and x4, but is pin compatible to this older chip design. A counter chain to hold your required count resolution. Search for counters using the 74LS192BCD counter to see examples. You would need one counter chip per digit of resolution required. A BCD to 7 segment LED driver and the associated LED digits. Search for 74LS47 BCD decoders for examples of a display digit. You'd need one chip and one 7 segment common anode LED display digit. It's a lot of work!!! I'd suggest that you gain/learn absolutely nothing by building a solution like this. Your time would be much better spent using a small MCU such as the ATTiny85 or an Arduino Nano (ATMega328) to do the encoder interface and the up down counting. You can get either of these for under $3 online. you can also buy an 8 digit display module based on the MAX7219 that provides the display driving and 7 segment LED modules for under $2. This is a serial display and does not do counting (that is done in the MCU). The skills you gain implementing this sort of solution with an MCU will definitely help you in the future. Learn to code!!
H: How do I program an ItsyBitsy 32u4? How do I load code onto a ItsyBitsy 32u4 without using the graphcial Arduino IDE? I've looked for "ItsyBitsy 32u4 programmer" and ItsyBitsy 32u4 bootloader". AI: You could use the AVRDUDE software from command line. See e.g. https://learn.adafruit.com/atmega32u4-breakout/using-with-avrdude
H: Is it possible to help accelerate a starting motor externally? I have a rather small motor and a matching energy source. When the motor starts, it needs a (short) amount of time to 'rev up', to accelerate at its max speed. Is there any cause for this other than mechanical inertia and friction? Would, say, a pullcord attached wound in the rotation's direction, pulled as the motor start, serve to bypass this delay? Please explain it like I'm five (but good at googling terminology). AI: This delay is due to inertia, not to friction. A spinning motor has rotational kinetic energy, which is equal to \$0.5\omega^2 I\$, where \$I\$ is the moment of inertia of the motor, and \$\omega\$ is its angular speed. To make a motor spin, you have to supply this energy. The rate at which you can supply energy is limited. All motors and power sources have some limit to the power, that is the rate of change of energy, that they can produce. This means that for any given motor and power source, there's a lower limit to the time it takes to spin up to a given speed. If you can increase the rate at which you supply energy to the motor, by using a pull-cord wrapped round the shaft for instance, then you can reduce the time it takes for the motor to get up to speed. There may be other more convenient ways to increase the power. If the limitation is the power supply, then using an energy store like a capacitor to temporarily deliver more power can help. If the limitation is the continuous thermal rating of the motor, then it's usually OK to overload the motor briefly at startup and rely on its thermal mass to limit the temperature rise. If the limitation is the maximum rated current (or the stall current at the rated voltage) of the motor, then it's a bad idea to supply more current, as it could risk demagnetising the field magnets.
H: How to upgrade StdPeriph drivers for STM32F103 project I have an old project which is built on using "StdPeriph drivers" for STM32F103 MCU and Keil environment. It uses various drivers for gpio, adc, can, dac, dma, i2c, spi, tim, uart etc. As these drivers are obsolete now so I want to move to new available ones. But I don't know how much work will be involved in migrating to new drivers let us say CubeMX. I have heard that CubeMX are not as efficient as was expected of them. Since my application is not very time critical so i think i can live with it so long as my new project-code would be maintainable and scale-able. I want my project to be easily maintainable and scale-able so that's why I am considering to upgrade to these newly available libraries as well as TrueStudio. But I don't know how much bigger the task will be time-wise and difficulty-level-wise. I have to hire some engineer for this task. How can I quantify this task? AI: If it ain't broke, don't fix it. The StdPeriph drivers work very well on existing STM32 MCUs, and these are going stay around for a while, as long as ST renews its 10 years longevity promise every year. The register interface of an STM32F1 that'd be manufactured in 2029 will be exactly the same as that of one built in 2007. You have the drivers in source code form, you should have every right to use it (but IANAL), so you don't have to worry about not being able to get it in the future. Not being developed further by ST means that they won't break it either. On the other hand, the STM32Cube libraries had some incompatible changes in their 5 years of lifetime so far. Maintainability Changing an existing software to use a completely different library would almost certainly increase complexity and decrease maintainablity and stability. There'd be wrapper calls more or less compatible with the StdPeriph interface, the less compatible edge cases causing lots of headaches. There'd be workarounds for passing STM32CubeF1 data structures (so-called handles) around. Scalability You are already aware of the fact that STM32Cube has severe performance problems, so introducing it would be rather counterproductive when scalability is an issue. StdPeriph drivers exist for the STM32F4 family, which would be the next logical step up from STM32F1. There are no StdPeriph drivers for the F7 and H7 family, but some peripherals are compatible, others differ only in register layout and some additional functionality, so porting existing drivers would not be a big issue. Perhaps surprisingly, StdPeriph should work on the STM32MP1 series, because the Cortex-M4 part of the processor is compatible with the STM32F446, for which an StdPeriph driver exists.
H: Does USB power delivery support arbitrary voltages? I'm looking for a USB power delivery power adapter to charge my Canon EOS RP camera via its USB-C port. Canon sells its own adapter for insane prices, and the Canon adapter is apparently nothing but a USB power delivery adapter, so according to my logic, a cheaper adapter should work. One adapter (90 W) I'm looking at says in the specs: 5-18 V / 5 A, 19-20 V / 4,5 A Another adapter (65 W) I'm looking at says in the specs: 5 V / 3 A, 9 V / 3 A, 12 V / 3 A, 20 V / 3,25 A The adapter with only 5V, 9V, 12V and 20V is significantly cheaper. According to Wikipedia, USB power delivery supports 5V, 9V, 12V, 15V and 20V in its different versions. Wikipedia doesn't say anything about adjustable voltage. The cheaper adapter entirely lacks 15V. Because of the adjustable voltage, the 5-18V, 19-20V adapter seems like a better purchase. But, does USB power delivery actually support freely adjustable voltage? Or is the freely adjustable voltage of the more expensive adapter just a marketing trick? The higher power of the first adapter doesn't matter to me as charging a feeble 7.4V 1040mAh battery doesn't require that much power. Edit: A report on the 'net says: Just incase anybody was wondering... I got the official Canon PD-E1 USB-C adapter (it's included with the battery grip) and the output listed on it is 5V/3A and 9V/3A. ...so I guess the 65W adapter should work. AI: Ok, actually reading the Wikipedia a second time answered my question: The USB Power Delivery specification revision 3.0 defines a programmable power supply protocol that allows granular control over VBUS power in 20 mV steps to facilitate constant current or constant voltage charging. Revision 3.0 also adds extended configuration messages, fast role swap, and deprecates the BFSK protocol. So, apparently the adjustable voltage power supply supports USB power delivery version 3.0 whereas the cheaper power supplies support only older versions of USB power delivery. I think for future-proofing my purchase, I will select the adjustable voltage power supply. There may be some need for using the PSU with future devices that expect revision 3.0 support.
H: Three terminal LED pilot. What's the matter? Long story short, I've purchased a 24VDC LED pilot and I've got a 12VDC pilot with three terminals instead. I was wondering what are each one of those three terminals for, the terminals have standard names (X0, X1, X2) but in the case there are additional names written (C, S, T respectively). All the google searches I've done lead to me to electronic LED flashers but I don't think this is what I'm looking for. The LED has no serial number I could use to check it out. This is the symbol printed in the case: EDIT1: I've asked the manufacturer for documentation and they've sent me the datasheet, this LED has lamp test function and the additional terminal serves to connect to a lamp test circuit (whatever it is). AI: Industrial control panels often have a lamp test feature to check that all lamps are functional. This is less important nowadays with the switchover to LEDs which have a much longer lifespan than incandescent bulbs. One of the problems to be dealt with is prevention of backfeeds from the test circuit. For example, if the lamp is connected in parallel with a relay then some means of preventing the relay from being energised during lamp test must be employed. On DC lamps a couple of diodes can usually provide a solution. It appears that in your product the diodes have been included in the indicator housing. Nice! simulate this circuit – Schematic created using CircuitLab Figure 1. Likely internal indicator circuit and sample external circuit including test switch. I expect that you should find internal diodes to prevent backfeed from the test circuit into the control circuits and vice versa. I would also be quite confident that SIG and TEST terminals could be swapped without a problem.
H: Normally closed mosfet circuit I'm designing a battery charging circuit for a portable device. Conceptually it looks lik so: simulate this circuit – Schematic created using CircuitLab As a safety function, the circuit can be interrupted by the transistor, thus interrupting the battery charging process. What leads me to write this post is that I need a transistor design that is normally closed (battery is normally charging). However, if a problem is detected, an MCU would send a control signal to it in order to open the circuit and stop the charging process. My questions in conclusion are: What kind of transistor should I use? A depletion P-Channel Mosfet? If so, how would the circuit look like? Could this be accomplished with a normal P-Channel Mosfet (normally open unless activated) with some additional circuitry? Thank you very much for your time and help! AI: You were almost there! You can indeed use a PMOS keeping in mind the ratings (regarding VDS and IDS). It should be oriented like you drew it: the body diode is reversed biased. To turn on the PMOS, you need a lower voltage than Vcc on the gate of M2. This is achieved by adding resistor R1 (and R2) and a N-channel mosfet M1 which pulls the gate of M2 to the right VGS voltage when M1 is turned on by the uP. R3 ensures M1 is turned off by default and therefore M2 is also turned off by default, unless the microprocessor turns the Control signal high. In case of Vcc being lower than 15V, you can leave out R2. In case of Vcc higher than that, you should take care the VGS of M2 doesn't exceed -20 V (which applies for most mosfets, check the datasheet of your selected PMOS). R1 and R2 should make a voltage divider such that M2 is decently turned on (which is typically quite a bit higher than VGS(th)!) So, in that case recalculate the values of R1 and R2 in that case. EDIT I initially understood the mosfet M2 should be turned off when the Control signal was logic low. It has to be the otherway around. By default / when the Control Signal is 0V, M3 is not conducting and therefore the current through R4 turns on Q1. Q1 one pulls the gate of M2 low and therefore turns on M2. When a logic high signal is applied as Control Signal, mosfet M3 shorts the base of Q1 to ground. Q1 stops conduction and M2 turns off. simulate this circuit – Schematic created using CircuitLab
H: What does the multimeter dial do internally? Everyone who has ever handled a multimeter is familiar with these dials. The position of the dial indicates the maximum range of the quantity that can be measured. But why are we required to adjust the maximum range ourselves? What happens internally in the multimeter when the dial is adjusted, say, from 20V to 200V? If we have the dial on 20V, and the voltage measured is 50V, why can't the meter provide a measurement? I don't have much knowledge on the internal workings of a multimeter, but I understand that voltage is measured by letting an infinitesimal amount of current through the meter and measuring the magnetic field (something along these lines). But why can't the meters adjust their range themselves? EDIT: I know there are autoranging meters, but I'm interested in knowing why others have to be adjusted manually. AI: This image (source) ought to tell you all you need to know about how it works. There are wiper contacts on the dial, shown at the bottom, that mate with pads on the meter's PCB. These pads are connected to different taps of a voltage divider to divide the voltage, or to pass current through a current shunt. Internally, the meter can only measure voltages from, say, -0.2V to +0.2V. The range switch changes the voltage divider to prescale the input voltage to be within that range, and on most meters will also send a signal to the LCD to tell it where to put the decimal point. As for why you have to do it yourself instead of the meter doing it for you: Nothing more and nothing less than price. A meter that auto-ranges is more expensive than one that doesn't due to the need for additional hardware to detect when it's over-range and perform the switching.
H: Why less protection on a GPIO RS485 board compared to an UART RS485 board? When I search for RS485 board (to be used for my Arduino to control DMX512), I find mostly two types: GPIO / TTL based (which I want to use), like TTL RS485, which mainly has a MAX485 and some resistors/capacitors. This one works with DMX512. UART based, like UART RS485, which has also thermal/polyfuses and TVS protection. This one I don't want to use because I want to use UART for other purposes. Would it be useful to recreate the GPIO based version, with additional polyfused/TVS circuitry? I cannot find a GPIO/TTL based version with more protection, why is this? (note I will only use RS485 (DMX) output, not input). AI: They are both RS485 tranceivers, just different. There is no "why" we can answer why these are like they are. There are applications that require different TTL interfaces and sometimes different level of protection is needed on the RS485 side. They might still use the same RS485 tranceiver chip at the core.
H: Which is a better conductor, a very thick rubber wire or a very thin copper wire? I read somewhere that very thick wires are generally better conductors than very thin ones. Is this true? If yes, then would a very thick rubber wire be a better conductor than a very thin copper wire? Edit: By rubber wire, I mean a wire made entirely of rubber, not a copper wire insulated with rubber. This is purely a theoretical question. AI: The thin copper wire. Copper has a much higher conductivity than rubber. The equation of relevance here is as follows: $$R = \frac{l}{σA},$$ where \$R\$ is total resistance, \$l\$ is the length of the wire, \$A\$ is the wire's cross-sectional area (a measure of how thick it is), and \$σ\$ is a quantity called electrical conductivity, which is a property of the material in use. As you can see here, thicker wires have lower resistance, but also higher-conductivity materials have lower resistance. Copper has a conductivity of about 6·107 S/m, while rubber has a conductivity of about 10-14 S/m, a difference of 21 orders of magnitude, so to have the same resistance, a rubber wire would have to have 6000000000000000000000 times the cross-sectional area of the copper one. That's six sextillion times the area, or 77.5 billion times the diameter. Conductivity values given above are sourced from this wiki article. The rubber used for this is hard rubber, the type used for things like hockey pucks. Yes, there are other more conductive rubbers, and they would not need as large a wire to equal the conductivity of a copper one, but it would still be a very big one. Many of the more conductive rubbers are actually composite materials with carbon or other additives added to enhance conductivity.
H: Need a non-volatile memory IC with near unlimited read/write operations capability I need a memory solution which is going to be used to keep track of an accumulated count on a micro-controller based project. By accumulated count, I mean to say that the micro-controller uses this memory location to keep count of the occurrence of an event. The count needs to be preserved during power outages, hence the need for NON-VOLATILE memory. Also the occurrence of the count increment event is frequent hence there will be a lot of writes to the memory hence my hesitation to use EEPROM. The preferred communication interface will be I2C, but other alternatives are welcome. Off the top of my head, I envision an SRAM low-power volatile memory IC with the option of being powered by a backup battery like a coin cell on power-downs. AI: Three non-volatile memory types match your needs, in order of available size: Wear leveled EEPROM/FLASH. Battery backup SRAM. FRAM. In terms of cost, FRAM is best. All you need is inside the chip, including backup capacitors to complete writing. However available sizes are low. Battery backup SRAM is large and costly in materials. Wear leveled EEPROM requires firmware to handle the wear leveling.
H: Magnetic induction with varying rpm: Dealing with excess energy I would like to get some advice regarding the following scenario: I want to build a cheap, small generator for an energy harvesting application. There are magnets on a rotating shaft and off-the-shelf inductor(s) are positioned (fixed) near this shaft. After the inductors the voltage is rectified and then a power management IC takes over (boost/buck, storage). At 1000 rpm the system should provide enough power (~10 mW) for the circuit behind it. But the rpm can vary between 1000 and 20000. Once the rpm are higher than 1000 there is excess energy. Therefore I have a find a way to deal with this excess energy. Either get rid of the excess energy or maybe prevent the generation in the frist place. Using multiple inductors and switch them on/off depending on the rpm was an idea. But this would take quite some effort with rpm detection and circuitry, depending on how many inductors I would use. So I am looking for easier solutions. A mechanical solution to increase the gap between the inductors and magnets is not possible, bc both are fixed in place and there is not much room at all. Zener diodes could be a thing, but dissipating the energy as heat may not be the most suitable way, bc the thermal conductivity of surrounding materials is not good. Do you guys have any ideas how to deal with this issue? AI: This is an interesting question and probably has a good solution available once you supply all the information that is relevant that you know but that, so far, we don't. SO - this is a brief interim answer based on what you have told us. If you add more detail and explanation the answer can be improved. Otherwise, this is about as good an answer as you can reasonably expect with the level of detail provided. (Others MAY give you an even better answer but you have no right at this stage to expect it :-) ). ______________________________ If power available is approx linear with rpm then the energy excess is modest. 10 mW x 20,000/1000 = 200 mW. In most situations 200 mW wiould not be hard to dissipate with modest temperature rise. Also, the alternator need not dissipate all the power that it CAN generate. Just because it CAN produce 200 mW does not mean that it MUST. If you MUST limit energy, and it's not obvious why you need to, a voltage regulator will let the alternator produce voltage BUT only dissipate Valt x Iload. In most alternators Voc_RPM_max is several times V_rpm_useful_min BUT not eg 20 x as high. eg an alternator may make 5V at desired load but 20V at full RPM. So using a voltage regulator and only drawing what you need till only increase power by 4 x(in this example) P_load = I_load x 5V. P_alt = 20 V x I_load Tell us more!
H: Mosfet Gate Resistor I am building a high power ZVS induction heater. I originally used this famous design. It worked like a charm when I used a 48v 31A power supply. But I want an upgrade. I recently got a few of these FCH072N60F 600v 52A power mosfets. They have a low Rds on, fast switching and low gate charge. All of which are needed for a good ZVS driver. However, I recently got myself a 96v 30A power supply. I simply replaced the IRFP250N mosfets with the beefier FCH072N60F mosfets. I then realized that at double the voltage, my mosfets would burn out. The 470Ω 2w resistors were for the 48v version. Could I simply double the resistance of these resistors or is it not that simple? AI: (96V - 12V) across 470 ohms is 180mA through your zeners. That is 12V * 180mA = 2.16W dissipated in the zeners. I don't know what zeners you have but that's probably near the zener's limit so you probably do want to increase the resistors. Your resistors are also dissipating power so they also will heat up more unless you increase resistance. About Four times more due to the voltage doubling if you leave the resistance unchanged.
H: Are Verilog if blocks executed sequentially or concurrently? I'm learning Verilog with some background in VHDL and C. I would like to know if Verilog if blocks are executed concurrently or not, and if this is IDE- or vendor-dependent. For example, are the following always equivalent or never equivalent, or sometimes equivalent, depending on something I'm not aware of? always @ (posedge clk) begin if (x == 1'b1) begin // do something end // possibly other code if (y == 1'b1) begin // do something else end // possibly other code end versus always @ (posedge clk) begin if (y == 1'b1) begin // do something else end // possibly other code if (x == 1'b1) begin // do something end // possibly other code end The if blocks and the "// possibly other code" chunks of code always execute sequentially, correct? My understanding is that the two blocks above should never be the same in Verilog because the line-by-line sequence is different. I've read that "statements in procedural blocks are executed sequentially", implying that the code should be synthesized to execute in hardware line-by-line. However it is unclear to me if the blocks themselves are processed sequentially, and simulating with just one behavioral simulator doesn't address the question of how universal Verilog synthesis is supposed to be. AI: Sequentially. Statements within an always block are evaluated sequentially, doesn't matter if blocking or non blocking assignments are used - nonblocking assignments are simply deferred assignments, a subsequent nonblocking assignment to the same reg in the same always block will override the first. Same goes for if statements, you can define a "default" value with a blocking or nonblocking statement, then override it later in the same always block. Last assignment in the block wins. Note that when I say "evaluated sequentially", this does not mean the lines are evaluated in hardware one at a time. If there are no data dependencies, they will effectively be evaluated in parallel, and then the ordering will determine the precedence. Each if statement condition gets converted to an enable signal, and this signal can then drive mux selects, enables, etc. The ordering simply determines which enable signal takes precedence. The code examples that you have are perfectly valid synthesizable code. They may or may not be equivalent depending on how x and y are assigned (for example, if the values are changed with blocking statements in the same always block) or if the same regs are assigned in different sections of the code (the last assignment wins, no matter if blocking or nonblocking assignments are used). Recently, I have taken to putting my reset code in an if statement at the bottom of sequential always blocks so I can preferentially reset what needs to be reset without extra dependencies on the reset signal (gating) that occur when you put the whole block in an if (rst) else block.
H: Is space division multiplexing really multiplexing? I don't know much about electronics, but happened upon the Wikipedia article for Multiplexing, which defined it as: a method by which multiple analog or digital signals are combined into one signal over a shared medium Shortly after are listed different types of multiplexing, among them Space-division multiplexing: the use of separate point-to-point electrical conductors for each transmitted channel An example given was a stereo audio cable. But it seems to me that if you have seperate physical streams of data (conductors in this case)- you haven't really 'multiplexed' your streams- there are still two seperate streams of data on two seperate physical conductors. It might just be terminology, but I'm curious if there's something fundamental I'm missing. AI: Space Division Multiplexing sounds like snake-oil, but it's worth treating it as a topic for study, as there are costs and benefits when applying it. It's defined as pushing several independent channels of data over a shared medium. That encompasses both the 'is it really doing something?' of parallel wires, and the very clever 'how do they do that?' of MIMO, multiple input multiple output radio transmission. If you have multiple well-isolated coaxial cables, then you would be right to insist that this was in fact a totally obvious way to move signals, and that there are in fact multiple physical channels available, one signal per channel. If the channels are not well isolated however, say four unscreened twisted pairs in a common jacket (ethernet), then you need to start thinking about crosstalk between them. This may need some channel coding to protect against errors induced between the channels. This is insignificant at 10Mbit/s, but needed at 1Gbit/s. The extreme of channels not well isolated from each other is the airspace between a transmitter (Tx) and a receiver (Rx). You would be forgiven for thinking that even if you had several Tx antennae and several for Rx, you would still only have one usable channel between Tx and Rx. If the antennae are far enough apart, a quarter wavelength is sufficient, and if they are in a multipath environment, then each sees a different transmission path. Sometimes it's slightly different, sometimes it's very different, depending on where the filing cabinets and buildings are along the RF path. Consider our ethernet example, and the transmission space between the sockets. Each of the four physical channels mostly guides the EM waves along a diff pair of wires, this is what distiguishes the four channels. But it's only mostly, the four channels are not totally separate. Similarly, each RF path is influenced by the different arrangement of filing cabinets and buildings that each RF spatial channel sees. Now these spatial channels cannot be accessed as easily as the four channels in an ethernet cable, they are not distinguishable enough for that. However, they can be accessed by beamforming, matrixing several logical channels of data with various phase shifts and weights to all the available antennae at the Tx, and then inverse matrixing them at the Rx. This is the magic of MIMO. With 4 antennae at each end, it's often possible to get 3x as much data as you could with a single antenna if the multipath is interesting enough, and usually 2x as much.
H: Switching 10 contacts with one switch I am looking for a way to switch 10 contacts but without having to switch these tiny contacts one after another. So basically one movement, 10 contacts open/close. I saw this little switch: But there I have to swtich them all. Unfortunately I didn't find anything useful in the Internet. The LEDs on the schematic are there to check if the connections are good from connector to sockert and back. I want to check each socket(10) with this 10 LEDs. Is this possible with a Multiplexer (can you put current throught a Multiplexer?) I am grateful for any kind of help. King regards AI: There are many solutions. When you define cost and user interface, the choices get smaller...and smaller. When they go to 0, you change your specs'. There are binary analog MUX and mechanical rotary MUX switches if you search harder. Try here or here. You might even consider a pot' controlled current with a transistor. But learn to start with a functional and interface spec'. Better specs' mean a better design with more choices.
H: Razer Laptop Power MOSFET replacement I have a failed power mosfet on my board which is PSMN3R0-30 https://assets.nexperia.com/documents/data-sheet/PSMN3R0-30YL.pdf It has low Rds (on) = 3 mΩ It is common for these to fail in these laptops (poor design) and would like to know if I can replace it with a more suitable mosfet. I have been looking at many datasheets for other mosfets (30v, 100A) but I just can't figure out what one would work in its place. Maybe these? https://docs-emea.rs-online.com/webdocs/1579/0900766b815790d7.pdf https://docs-emea.rs-online.com/webdocs/1560/0900766b81560cf4.pdf I can buy the PSMN3R0-30 but not from the UK so shipping is expensive. Thank you AI: A Google search reveals that they fail because they overheat. The Rds is very low, so that is unlikely to be the problem (assuming that it is fully turned on). It could be that the Vgs is too low and it isn't fully turning on. Or, it is used in a PWM circuit and it is switching too slowly. You would need to scope a working circuit to diagnose the marginal design issue. I would not recommend attempting to substitute a different part without a diagnosis, you could make it worse. You might consider attempting to heatsink it better, but space is tight in laptops and it is unlikely to have enough space. You could also block airflow and make it worse.
H: Does "1KV" on this disc capacitor mean 1 kiloVolt? One of my power supplies died. Investigation turned out that this capacitor is broken. "102" means 1nF, but does "1 KV" mean 1 kiloVolt or is that some sort of tolerance code? I've tried several "capacitor code calculators" but none of them mentions "KV" (only K, which is indeed a tolerance code). AI: Yes, it means 1kV (DC) rating.
H: 1500-6000V linear regulator (noise eater) Is there any known approaches to regulate HV in the range of 1500-6000V in order to eat noise? Low-side regulation is a possibility. The idea is to get ~100V higher voltage than needed, and then regulate it down with a linear regulator in order to achieve lower ripple noise. Supply current is 100µA-6mA, so this 100V regulation delta will dissipate not too much power. AI: From my comments, with credit to @Sean and TimWescott (Since they have not yet answered). If you only want to knock the peak voltage down by ~100V, there is no need for a super high voltage regulation system. Typical modern linear regulators really only require a "reference" for ground since they often sink far less then 1mA. Look for low "Quiescent Current" regulators often designed for low power. To create a virtual ground reference you could do it two ways: Use a resistor voltage divider with an RC filter to create a short term steady ground based on the input voltage. This is ideal if you have good long term voltage stability from something like a SMPS and you want to reduce ripple. As Tom noted, you can use a stack up of Zener diodes to create a known ground potential, but you create a risk of over voltage if your incoming supply has a large variation, also there will be some noise from the Zener diodes, but probably still cleaner then option 1. NOTE: Values in schematic are only for reference, they need adjusting based on your voltages, currents and regulator of choice. For the regulator, check out the TL783 or LR8N8, both are good for 450V. simulate this circuit – Schematic created using CircuitLab simulate this circuit
H: Switching between battery and external power sources with reverse polarity protection In my design, I will use AA batteries to power the electronics board. As a requirement, also it should accept the power from external power supply (12V) - The board should automatically switch from battery to external source. - The board should have reverse polarity protection for both battery and external source. I found this solution from Maxim Integrated.. FET switch can reduce the drop to less than 0.1V instead of diode. My Question: The FET (FDN340P) and diode (1N4001) work as reverse polarity protection for board? AI: The board should have reverse polarity protection for both battery and external source... My Question: The FET (FDN340P) and diode (1N4001) work as reverse polarity protection for board? No. In this circuit the MAX6326 is powered directly from the external source. Absolute maximum input voltage rating is -0.3V to +6V, so reverse polarity will kill it. And you require the circuit to accept 12V, which will also kill it. There is no simple solution to this problem. Reverse battery protection is also iffy. If the battery is connected in reverse with external power off then the FET's internal body diode will stop the reverse voltage from getting to the output. However if external power is then applied the FET will turn on for at least 100ms until the MAX6326 comes out of reset. During this time a very large current will flow from the external power supply into the battery. The components will probably survive this momentary surge current, but the high stress could reduce reliability. Given the problems with this circuit you will have to look for other solutions that don't involve a MAX6326. The simplest is to just use a Schottky diode in place of Q1. If you choose a high current Schottky the voltage drop could be less than 0.3V. If this is too much then just add another cell to the battery to make 4.5V, then a standard silicon diode will do the job.
H: My Buck-Boost Converter Circuit Isn't Working I am currently working on a heated glove project using a Buck-Boost converter to adjust the temperature of the glove. I'm using the LTC3112EDHD#TRPBF QFN Buck-Boost IC to control the Buck-Boost functionality. I just finished soldering my test PCB, and my Buck-Boost Converter IC isn't outputting a voltage. My multi-meter is reading a voltage output of 0V. I've included my schematic design below. The PCB layout is exactly the same as the schematic. Some of the ports on the IC are controlled by a micro-controller. I honestly do not know what could be the issue with this circuit. My two guesses are that either some of the passive components got damaged during soldering (which I doubt. I confirm the resistors work properly, but can not confirm the capacitors functionality due to my multi-meters limitations), the Buck-Boost IC isn't solder correctly, or my design layout is incorrect. Any help would be greatly appreciated. Edit: I've added the PCB layout of the schematic. It may be hard to see due to all of the connections, but I've included it as a reference. AI: Your DC-DC won't work at all without at least one of the feedback transistors being turned on. When they are turned on the VCE(sat) is directly in series with your feedback voltage. While VCE(sat) will likely only be a few mV in this case it still has an impact on the accuracy of you V(out) You should be extra careful that the transistors used in the feedback loop are extremely low leakage and not too high an Hfe. You don't seem to specificity the part number in your schematic so I can't check. The CE leakage current when these transistors are off (no Base current) is typically higher than that quoted for the CBO leakage specified in the datasheet. The feedback resistors indicate that the feedback current is very small at only about 5uA. With only one of the three feedback switches on, it means you are dealing with 2x the leakage current. If you are NOT driving the transistor bases, then the CE leakage will be approximately Hfe*I(CBO). With high Hfe devices this can be troublesome. You should ensure that the drive point for your base resistors is always driven by a logic zero or one, this ensures that the base is terminated to close to ground when turned off. You might find this answer helpful. Update: Now you have added the feedback switching transistor data it is clear that they are unsuitable for this task. They are power devices with a max I(CBO) of 1uA so even when off will impact the feedback loop. If you can find something in the same package layout, then you are looking for characteristics similar to these ONSemi small signal devices, NST3904DP6T5G. With I(CEX) of only 50nA these are a much better choice, and you can find transistors with I(CEX) down to 10nA. I(CEX) is the CE current with the base open circuit so is a much better indicator of leakage performance than I(CBO). Ideally IMO the best choice choice for a switched feedback loop would be a small signal Depletion mode N-Channel FET switching from the output.
H: High Side Switching Inductive Load with MOSFET I am attempting to make a PCB that high-side switches an inductive load (water pump) that draws 4.6A peak. The switching scheme will not include any PWM, just basic on/off functionality. My concern is clamping the voltage spikes from the load during turn-off. I want to avoid going into avalanche mode on the MOSFET to ensure maximum reliability as the board will be operating in temperatures of 80-90 C ambient. The MOSFET I am considering is here and I am looking at this gate driver. My current circuit idea is shown below: simulate this circuit – Schematic created using CircuitLab D2 will conduct below the maximum Vds of the MOSFET, during switch off of the load where the source voltage will go negative. I am less confident in the behavior of D1. My intention with D1 is to conduct during shut off of the load, so that Vgs does not exceed the maximum allowable. My uncertainty stems from the gate driver - how will it behave in this scenario? AI: L1 should have a freewheel diode across it .Any fast diode will work .It is not good to allow negative backswing on the fragile highside driver chip .The freewheel diode also ensures that M1 will not see much more than 12VDC .
H: VHDL: is there a way to create an entity into which constants can be passed? Lets say we want to create a generic t flip flop counter, the structure of this kind of counter is perfectly repetitive, and you can synthesize one with arbitrary length just using a for generate however the bound for that for and the length of the output is internal to the file, a constant, is there a way to sort of passing an argument when creating a component so as to define the length of the counter when creating the component instead of in the file? here is the code of the counter i made library IEEE; use IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all; entity counterTst is port( enable: in STD_LOGIC; clk: in STD_LOGIC; rst: in STD_LOGIC; output: out STD_LOGIC_VECTOR(3 downto 0) ); end counterTst; architecture rtl of counterTst is constant COUNTER_LEN: integer := 4; component t_ff is port( rst: in STD_LOGIC; clk: in STD_LOGIC; inp: in STD_LOGIC; t: out STD_LOGIC ); end component t_ff; signal tin: STD_LOGIC_VECTOR(COUNTER_LEN-2 downto 0); signal tout: STD_LOGIC_VECTOR(COUNTER_LEN-1 downto 0); begin T_CHAIN_GEN: for i in 0 to COUNTER_LEN-1 generate START_POS: if i = 0 generate FF0: t_ff port map(rst, clk, enable, tout(0)); end generate START_POS; POS_1: if i = 1 generate tin(0) <= tout(0) and enable; FF1: t_ff port map(rst, clk, tin(0), tout(1)); end generate POS_2; POS_N: if i > 1 generate tin(i-1) <= tout(i-1) and tin(i-2); FFX: t_ff port map(rst, clk, tin(i-1), tout(i)); end generate POS_N; end generate T_CHAIN_GEN; output <= tout; end rtl; AI: Yes, it is called a 'generic': I could show an example here, but there are plenty of example on the WWW once you know what to look for: https://www.nandland.com/vhdl/examples/example-generic.html
H: Use of Power Pins in ICs This question might seem very basic, but it will help me a lot if someone can answer it from the basics! I have just finished my first year at college and there was a course on digital design, where we studied the fundamentals of digital systems and also implemented various circuits using ICs in the lab. When we saw the IC in class, we just focussed on the circuit inside the IC - how everything is connected and what logic gates/ FFs are used. But while implementing circuits in lab, I saw that there were 2 power pins also, on each IC. Why do they need power pins? Like, all that is present in the IC is a few logic gates (even FFs are logic gates at a very fundamental level) right? Logic gates do not require power when we have to use them right? AI: Why do they need power pins? Like, all that is present in the IC is a few logic gates (even FFs are logic gates at a very fundamental level) right? simulate this circuit – Schematic created using CircuitLab Figure 1. Equivalent circuit for the simplified output stage of a CMOS logic gate. As shown in the switch version the output is pulled high. All the other transistors in the gate will also require power connections. They need power pins because the digital logic needs to supply power from the positive rail to create a logic 1 or sink power to the ground rail to create a logic zero. Logic gates do not require power when we have to use them right? Without power connections there could be no pull high or pull low. Logic gates do not source or sink electrical current from nowhere. It has to come from and return to the supply.
H: Why don't motors coupled to gearboxes spike up significantly? A 5,5KW motor is rated 11,40A for the delta connection at 400V. This motor is coupled to a gearbox that reduces it's speed from 1440rpm to around 121rpm. On the gearbox shaft is a sprocket and chain which reduces the speed even further. According to what I know, during starting a motor will rise to about 4-7 times its rated current for certain seconds. So I was expecting this value to be above 44A, which turned out not to be the case. In fact, the current wasn't even double it's rated value. Now here's the question: why didn't this value rise up as much as I expected? Since there's no back emf when the rotor is stationary, the current drawn by the motor should have been significantly higher. I'm struggling to understand why it wasn't. NB: the motor is running direct on line, no soft starters are involved. AI: Your expectations are wrong. The "4-7 times" statement is what is known as a "rule of thumb", used for rough estimation. It doesn't mean that every motor ever built draws a minimum of 4× its rated current at start-up. In your situation, it would seem that the motor is able to spin up fairly quickly, limiting the time duration of the current "spike". Plus, the inductance of the windings limits the rise time of any spike. Your meter may also have a limited response time. Together, these effects limit the height of the spike to what you see.
H: Op Amp integrator (square to triangle) not always start working correctly I created an Op Amp integrator with LM358 to convert square wave to triangle wave as shown below. simulate this circuit – Schematic created using CircuitLab Though the circuit sometimes works as I expected, but sometimes when I restart my signal generator square wave output, the output will be exceed voltage rail. (The yellow one is the output of signal generator and the blue one is the output pin of the Op Amp, both 1V/div ) I am 90 percent sure that this problem raised because my generator not outputting perfect waveform on the beginning and the waveform take some time to become stable. And this will make the integral result go to voltage rail and cannot be integrated back. However, I am not sure how to solve this and make the circuit more stable and always start working. I hope this can be bettered because latter I want to connect it to a 555 timer and the timer, just like my function generator, not start working perfectly as I observed on the scope days ago. Thanks for any suggestion. Thanks to vangelo's suggestion, I changed the cap to a 224 one. And then the circuit works a lot of better that I turned on and off the signal generator ten times and all of them works well. However, I found I can still repeat my problem by screw the R3 to a low resistance. (Originally the connected side measures about 5kOhm and now I turned it to about 2kOhm) And here I finally captured how the circuit go out of control. (Same scope configuration as the above and before this experiment I checked probe again and it's OK) The screenshot was taken by one shot but what happening, if in Auto mode of scope, I can notice triangle wave after turning signal output on in several seconds or frames maybe. And in that way it is after my generator works stable state that the circuits go wrong... Also, I found another problem is when the signal was turned off, the output of Op Amp is about 3.6V but not 2.5V, I believe this is caused by offset voltage and offset current. Should I compensate it in this application and how? AI: The condition for integration using differential equations are; Ic =C dV/dt where dV = output Vpp in dt ramp time for 1/2 triangle time Thus if you wanted to integrate a 1Vp 1kHz square wave into a 5Vpp Triangle ( using a RRIO OA ) dV/dt = 10V/ms from 5V for each half cycle of 0.5ms Ic= 100 uA = Vin/R = 1Vp /10k (Pot max) thus C = Ic* dt /dV = 10 nF [uA*ms/V] Whereas you show 10uF which is far too big as pots only have a 300:1 range and 10 Ohms is too high a current to drive with 10uF @ 1kHz. Always use specs and 1st principles when in doubt. Ic=CdV/dt For a better design with included sig Gen. Use a Schmitt Trigger Astable that buffers the Triangle wave to constant amplitude.
H: Can I use 1 transistor to switch on and off 3 loads? I am running an ESP32 microcontroller with a Co2 sensor, a real time clock (RTC), and an SD card reader. I will be putting the microcontroller into deep sleep and waking it every hour. I want to switch off the power to the aforementioned components before the microcontroller goes into deep sleep and turn the components back on after the microcontroller wakes up. Can I use 1 BJT npn transistor to switch off power to all three components? I was also thinking of using three transistors with a common base signal... i.e. using just one GPIO pin to control three transistors. Thanks AI: As long as you don't ever need to turn one of them on while another remains off, this will work. However, be aware that the 2N2222 has a saturation voltage that may be high enough to cause problems if you want to interface these with un-switched devices. Because of that saturation voltage, "ground" for your switched devices will be about 100~300mV higher than your circuit ground, and this will be reflected in their output voltages and may cause problems if they get an input voltage of circuit ground (which to them is negative). Also note that your 2N2222 will dissipate a significant amount of power if your switched peripherals draw too much current. Given what those peripherals are, it's unlikely that this will be a problem, but it's good to be aware of that anyway. To overcome both of these problems, the following circuit can be used instead: simulate this circuit – Schematic created using CircuitLab The use of a FET instead of a BJT eliminates the problem of saturation voltage, as FETs act like (low-value) resistors when turned on. Switching the high side instead of the low side ensures that the switched components still share a ground with all the other things in the circuit, too. Note: make sure that M1 is a logic-level FET. Some FETs require substantial drive voltages that you don't have available, but logic-level FETs work on just 5V logic. Note 2: Since it's a PFET, the logic will be inverted. Apply 5V to its gate to turn off the devices, and apply 0V to turn them on. Note 3: 3.3V is not enough to turn it fully off, so if you use 3.3V signals you should use a simple gate drive circuit. You may want a gate drive anyway, to help it turn on and off quickly and reliably without demanding too much current from the MCU's output.
H: Complementary transistor pair with a bipolar transistor and a MOSFET I own a set of Soviet IN-14 Nixie tubes and I would like to use them to make a vintage clock. I found this example schematic of a "Nixie clock": I don't understand what is the purpose of using a MOSFET in the second stage of this quasi-"Darlington pair" (as opposed to a second bipolar transistor in a normal Darlington pair) here: Is there a particular name for this configuration? As a secondary question, I also would like to know why a diode was used in place of a resistor in this configuration? AI: This is what's called a gate drive circuit, or gate driver. The BC558 aids in pulling charge out of the IRF840's gate, acting as a current amplifier to turn the FET off faster. The circuit designer apparently decided that the turn-on time wasn't as much of a concern, so a 1N4148 diode is used to pass the un-amplified current straight from the PIC's output. The term gate driver is a generic term, referring to any circuit that aids a signal in charging and/or discharging the gate of a FET or IGBT. I don't think the particular instance in the circuit above has any more specific name.
H: How Qi charger reads data from receiver I saw a guy making Qi receiver module with ATTiny13A: Qi wireless power receiver from scratch. In his circuit, secondary shorted through capacitors to ground to send data. My question is how transmitter side (base) reads this data? AI: When the output is loaded, the power draw to the transmitter increases because of coupling between the coils. The resulting current/voltage fluctuation is monitored, demodulated and read as data. The data flow is only possible from (power) receiver to transmitter. You can find a lot more information in this application note from NXP/Freescale entitled Demodulating Communication Signals of Qi-Compliant Low-Power Wireless Charger Using MC56F8006 DSC,
H: What misconception about telephone circuits are they trying to address? I'm reading a book called "Telephony" published in 1905 (Miller,Mcmeen). The book starts with this quote: To properly understand the manner in which sound is transmitted from one end of an electric circuit to the other, it will be necessary to entirely get rid of a popular idea, and to fix clearly in mind, that the sound produced at one end of a circuit actually travels over that circuit, in order to be heard at the other end.That is erroneous; in reality the actual sound produced at one end of the circuit, travels no farther than it would if the telephone apparatus were not present. What actually take palce instead may be described as follows: The sound energy produced in the presence of the telephone apparatus is transformed by the apparatus in electric energy, which, traveling to the distant end of the line, is again retransformed by the distant apparatus into sound energy. I don't understand the point. What is the misconception they're trying to address? AI: At least as I read it, he states the misconception fairly clearly: the sound produced at one end of a circuit actually travels over that circuit, in order to be heard at the other end. His point is that the sound at one end of the circuit is converted to electrical signals by the microphone, then that resulting electricity travels through the circuit, and at the other end, sound is produced based on those electrical signals. Yes, to most of us today, that probably seems pretty obvious--but in 1905 it wasn't nearly as widely understood. It appears that a fair number of people originally thought of the phone system as a more elaborate version of the old "telephone" kids made with a string between two tin cans. That, of course, is not accurate at all.
H: Different colors for Power Transmission Towers I have observed that some areas have some power transmission towers painted in Red and white colors. But, more often, transmission towers are unpainted. An illustration of what I mean by this, Left: red and white tower, right 'regular' tower If I am right, radio/cell-phone towers are usually painted red and white, but the example in this picture is clearly not a radio tower. So, what is the significance of a transmission tower being painted in such colors? AI: In the US, the FAA requires high-visibility markings on any tower that rises at least 200 feet above the "established terrain" (and near airports, the 200 foot requirement may be reduced). The ICAO sets similar requirements, so I'd expect roughly similar requirements in most other countries as well (though it wouldn't be surprising if some details vary). Power transmission towers are typically around 180 feet tall, so this doesn't usually arise with them--but it can when (for example) the tower is at the top of a hill or ridge that's steep enough that the ridge itself contributes to the rise above the "established terrain". Some towers are also somewhat taller than others, and with the typical height at 180 feet or so, one doesn't have to be drastically taller than others to hit the FAA requirements--the difference in height may be small enough that it's not immediately apparent. Reference FAA Advisory Circular 70/7460-1L
H: Why polling works rather than interrupts I have several devices like for example connecting with ESP8266. I have tried to use the SPI with it with STM32F4. First I have tried to work with SPI interrupts, the result of the communication is not stable, sometimes the communication works between both, sometimes it doesn't. When I switched to Polling mode of STM32F4, and let EPS8266 work with interrupts, everything is stable then. My question, why sometimes is polling works rather than interrupts ? Is it timing issue ? AI: Almost certain that it is some type of software error. A correctly crafted interrupt implementation should provide operational behavior similar to polling. It is hard to guess what the nature of the error from the over simplistic explanation that you provided. There may very well be a timing or synchronization issue that you are overlooking operating in the interrupt mode. One first good approach for debug is to use a digital oscilloscope or logic analyzer to probe and capture the SPI bus waveforms and see if, at time of failure, there is any aberration in the SPI_CLK to SPI_MISO and SPI_MOSI signal lines. Also check the SPI_CS signal line for proper framing and timing.
H: Minimum Current(not for switching) On a Relay? I'm trying to understand how the pictured device works. It's a Sonoff WiFi controlled electrical relay. I was told that it is designed to control mains voltage only, and cannot be used to control a 5v dc current. This doesn't make any sense to me, because I'm under the impression that the relay which ultimately controls the current works by simply completing and breaking a circuit using an electromagnet to move the switch. If so, this would mean that the current may practically be as low as I want, as long as it's below the maximum voltage and amperage rating for the relay. Am I correct in my belief that a device like this can be used to control a 5v dc current without modification, or do I need something specifically designed for lower voltages? If I need something different, then what do I need, and why? AI: Looking at the specs printed on top of your relay it seems like it has a DC rating on it. So the relay alone is probably fine for switching DC. Note that relays have different ratings for DC because there is no zero crossing in the current to extinguish any arcing. This can cause extra wear on the contacts or even cause them to weld shut if used outside the DC rating. There's also often a minimum current required to keep the contacts wetted and break through any oxide layer that may form. Switching currents below that can cause high resistance contact unless the relay is rated for "dry" contact operation. It's possible that for your device there are other reasons why it will only work with AC mains voltage. It may be that they use some of the AC voltage to feed other parts of the circuit (even though you have USB power) or there may be some type of safety function built in that only works with AC. There's no way to tell without knowing the details of the design.
H: Using a low-voltage switch in a high voltage circuit I have an application that requires switching a circuit between the following two configurations. Circuit Lab is infuriating as it does not allow you to draw diagonal wires, so I used arrows instead. They are not connected in the middle. simulate this circuit – Schematic created using CircuitLab I have thought about using a DPDT NO NO switch to swap between the states but the switch is only rated for 12 volts dc, and I want my circuit to be operable up to 170 volts. Because the resistors will absorb almost 100% of the voltage drop (assuming the resistance of the switch is negligible), I am assuming that I will not have power or current-rated problems considering that the whole setup will be shipped with a 1/4W power rating. The problem I will likely encounter has to do with potential breakdown of the switch from arcing and the like. I would not hesitate to insert a SPST switch in series with two large resistors at any voltage, as the voltage drop across it would be almost nothing. However, in my setup the DPDT switch would have the full 170v potential across the two poles. If I use a small switch in this configuration, would I be safe or would my switch arc/breakdown across the poles? AI: The voltage rating of a switch is precisely about what how much of an arc it can break while it opens, and how much voltage it can withstand when open. Your switch must be rated for the maximum voltage that may appear across it. This is true of any single pole of a switch, so it doesn't matter whether the switches you are using are SPST or DPDT. In principle, the pole-to-pole isolation could have a different rating than the contacts, but I've never heard of that being done for ordinary switches. Another place the voltage rating matters is the isolation between the contacts and the case and handle/button. In your case, the maximum voltage appears to be 2/3 of the voltage applied to the ends of the circuit, or 114 V, since R1, R2 & R3 operate as a voltage divider, but I'd want to choose a switch that can handle the full voltage in case something goes wrong elsewhere in the circuit. (Presumably your "R"s are actually loads more complex than a resistor on a circuit board, and so there's more opportunity for failures such as short circuits across any given R, increasing the voltage applied to the switch.) There's another complication: switches have different ratings for DC and AC. If you apply DC, a switch with an inadequate DC rating is not guaranteed to successfully break the arc, even though it will withstand the voltage while open. High voltage DC switches are a somewhat unusual item (though becoming more relevant in this day of e.g. solar power systems). Apparently there might be electronic strategies to be able to use an only-AC-rated switch with DC.
H: Do high and low side labels on bidirectional logic level converters matter? Logic level converters like this one from Sparkfun have high side and low side labels on them. Now i have an application where I think I need to shift logic levels but the high side and the low side are likely to swap at some point due to changes in battery voltage over time. This is intended for a battery powered project with an expected runtime of a year where an ATTiny85 that can natively work between 2.6V and 6V and is directly connected to the battery will be talking to an ESP that is behind a 3.3V regulator because it can not handle more than +-0.5V deviation from 3.3v on any of the pins. The ESP (regulator) will brownout much earlier but that is OK. I started reading the BSS138's Datasheet and could not find any mention for or against swapping sides. So I built a very minimalistic simulation of the circuit. According to the simulation the source-drain is passed in either direction in "normal" operation while sticking to the high and low side labels. Further simulations swapping the high/low sides and even having them the same voltage did seem to work. Is there any downside to swapping the high/low sides with a logic level converter based on a BSS138? Thank you Dave for your answer. Now I see that the sides do matter and swapping them would lead to failure. Here is the sideswapped state with both sides pulled high which would lead to failure: The left side is pulled down to 4.1V (should be 5V) and the right side is pulled up to 3.8V (should be 3V) potentially destroying the ESP, definitely destroying the ESP if the battery was at 6V and connected to the converter's low side! AI: Yes, they matter. See that body diode on the MOSFET? It must be reverse-biased when both signal lines are being pulled high. Otherwise, the HV side is trying to pull the LV side higher than the LV supply voltage. If that wasn't a problem, you wouldn't need the level shifter in the first place. If you can find a MOSFET that doesn't have its substrate internally shorted to the source pin (i.e., it is brought out to a fourth pin), then you can do what you want. Connect the substrate to ground (the most negative point in your circuit), and then you can use the source and drain terminals interchangeably.
H: How can I make it so that customers who buy my arm based product can easily update the firmware? I'm building an arm-based (stm32F7) hardware device which will have a USB port. I would like to be able to update the firmware and distribute it such that customers with my device can easily install new firmware without having to install an IDE or do anything complex. I am writing a computer side program that communicates over USB serial, so I would like this to also function as an update utility. AI: STM32 has a bootloader built in called Device Firmware Update. There are a couple of app notes that detail its operation. AN3156 explains the protocol, and AN2606 details the operation and hardware considerations. ST provides a PC tool that users could use to update firmware, alternatively a DLL that could be built into a PC application.
H: Microcontroller core voltage Can someone provide me some explanation or clarity regarding the three internal voltage regulators that this Microcontroller has mentioned in chapter 40, page 1227. From what I read, I think that we are not providing the core voltage (1.2V) to the micro directly. We are providing 3.3 to 5V and we place an NPN outside to get the 1.2V which is then fed to the Micro pins. is this correct? How does this work? If this is true, then the Micro Vcc is 5V only, right? And how by placing a NPN transistor and giving 5V to its collector, we get 1.2V at the emitter? How does the transistor do this? AI: You'd be better off reading the datasheet instead of the user guide, but: We are providing 3.3 to 5V and we place an NPN outside to get the 1.2V which is then fed to the Micro pins. is this correct? Yes; the internal regulator generates 1.2V for the core. The fact that these 1.2V are available externally is mostly so that you can (have to) connect decoupling/stabilizing capacitors, which can't be integrated into a silicon die. How does this work? Linear regulator. Just like you can buy an LDO chip, that LDO can also be integrated into a microcontroller silicon chip. If this is true, then the Micro Vcc is 5V only, right? No. How do you come to that conclusion? The datasheet clearly lists all the 3.3V supplies you need. And how by placing a NPN transistor and giving 5V to its collector, we get 1.2V at the emitter? How does the transistor do this? That's basically the question of "how do I build a linear regulator with a NPN transistor". There's simply a device measuring the voltage at the emitter; if it's lower than it should be, the base voltage of the transistor is increased, if it's too high it's decreased, so that the differential resistance of the collector-emitter junction is "just right", so that the current draw leads to exactly the voltage drop across that junction that leads to the correct output voltage. You can imagine (it's not going to be a full opamp inside the chip, but the principles apply) it working like: simulate this circuit – Schematic created using CircuitLab As a matter of fact, the Base-Emitter voltage of a standard NPN is usually pretty fixed (~0.7 V) for all relevant current draws, so that there needn't be a specific sense pin to sense the emitter voltage, if one can sense the base voltage relative to ground.
H: Liquid / water level detection safely using AC voltage - Industrial circuit explanation I am planning on working on a project to build a controller which will be used to detect the levels of water treatment chemical tanks and display them on a bar graph. then switch off the dosing pumps once the chemical tank level reaches completely low. There are plenty of circuit diagrams on the internet to simply achieve that using DC voltages and op-amps. But applying DC voltages are not reliable and may cause electro-metal plating and the electrodes to dissolve. Then I came to know that LM1830 is designed to overcome that issue. Well, I'm curious about that and wanted to know really how this is done in industrial circuits. So I removed a Chinese industrial level control relay and grabbed their design as follows. (Please note that I have erased the brand name and model as it may go against the manufacturer's design rules.) Now my questions are, Why is the AC output directly after the transformer, is shorted with a capacitor, without that capacitor wouldn't the E3 probe deliver the AC voltage? Here probe E3 supplies the voltage to the liquid and E1 & E2 receives it back. But the M7 diode in the receiving circuitry limits the current in one direction only. So the current through the liquid still remains DC. Is it correct? The transformer appears to be 230/24 step down. So this amount of voltage applied to the liquid, isn't it potentially dangerous. As the higher the voltage is, its easier to dissolve the electrodes. Is this mechanism technically safe to use in drinking water tanks? AI: You have quite a few questions. No the cap across the transformer secondary does not short it, maybe it reduces some higher frequency transients from external sources or from the diodes switching. Pretty sure it will work about the same without it. The current through the probes is AC (ignoring a brief bit when first turned on) so long as the series capacitors on pickup probes E1/E2 are not damaged. On the positive half cycle the current goes through the M7 diode (and electrolytic cap etc.), on the negative half cycle it goes through the 56K resistor. 24VAC is generally regarded as safe and there is series impedance. Some electrolytic action may take place during the half cycles, but it's probably not that important. Keep in mind that some water is quite high in resitivity so a higher voltage allows more reasonable impedances to be used in the detection circuit for a given probe design. This question is beyond the scope of this forum, I think. I have a commercial cappuccino machine that uses a similar method to monitor the water tank, so it was approved in Italy. The probe metal(s) would have to be safe for potable water contact, at least.
H: Abuse TS339 comparator channel as a voltage multiplier I have multiple free channels of a TS339 amplifier remaining and would like to use one of them to multiply voltages like this: simulate this circuit – Schematic created using CircuitLab Now it's a common rule that you should never use OpAmps as comparators or vice-versa, but I'm wondering whether there's any fundamental issues that prevent me from doing so here. I need a bandwidth of 400 kHz and a gain of 5 (as visible in the circuit). The comparator's output is open-drain and it's CMOS-based, but I assume it can operate in its linear region just as well? The output load will be less than 100kOhms, with no capacitive load. AI: I presume the output is intended to be connected to the R2/R4 node in your schematic (Edit: It has been corrected). No, you should not do this, as it will not be stable (it will oscillate). Using an op-amp as a comparator is sometimes justified (where the input type allows it, and where precision or other factors outweigh performance), but it is rare that you can use a comparator successfully as an op-amp because of the lack of compensation. There is no access to the internal nodes to allow you to stabilize the amplifier with compensation network(s). There is only one exception that I am aware of, and that is the ancient bipolar cousin of the chip you are using, the LM339, which can be compensated by adding a BFC (big fat capacitor) to the output. Something like 10uF, if memory serves. You end up with a rather crummy op-amp but perhaps usable in some circumstances.
H: LED glows slightly during soldering I recently soldered a number of white LEDs to a PCB using a Weller "standard" soldering station. I noticed some LEDs were glowing slightly during soldering. The PCB was placed on an ESD mat, but I doubt that this had an influence. Is that a thermal or electrical effect? I suspect the former, because I am quite sure the metal iron tip is grounded. AI: It is probably a small electric current from the tip of the soldering iron. Some irons have a grounded tip, others may not. In both cases, it is possible to have some voltage at the tip. You can try to test for this with a multimeter set to AC volts from the metal body of the soldering iron to the LED, but a meter might not have enough sensitivity at about 10kΩ impedance. A better tool would be an oscilloscope with 10MΩ impedance. The iron may need to be "on" for accurate results. For some reason, the electrical outlet in my old kitchen had about 69vAC on the ground, but only at a very tiny current, perhaps 20µA, which a meter would barely detect. This was tiny, but it was enough to "light" LED's for no apparent reason when touched with the iron. Note this made it unsafe to solder more sensitive components, such as digital IC's. I had a suspicion this was related to an old refrigerator. It had a propensity for shocking you slightly if bumped with a wet arm. Unplugged it and sure enough, the leaked voltage at the nearby outlet disappeared.
H: How to work out this implementation of chua's diode? The author of a book claims that this is the implementation of Chua's diode by [Kennedy, 1992], although I cannot find this article. My question here is, how does this circuit work? For me, the diagram is a terrible mess. Note: The circuit shown misses a connection: pin 5 of the (second) opamp should be connected to the input of the device. This is pointed out in a comment. The voltage-current graph of Chua's diode should look like the graph below. Here are my attempts in making sense of the circuit above: It looks as if the two opamps are divided into two groups. Each group has identical configuration but different resistor value. The output potential of an opamp is linear, but cannot surpass its input voltage: in this case 9+9=18 volts. It appears that, due to different resistor values, one opamp reaches this limit before this other: this is where the slope of the line suddenly changes in the graph below. But what will happen if both opamps reaches this limit? I cannot figure this out - How can I work out the voltage-current graph from the circuit diagram? AI: You can consider each opamp in isolation. Each opamp can be seen as a negative impedance converter within its linear region. Consider the first one, lets apply 1V and see what current we get... With 1V on pin 3 the opamp will (within its linear region) act to drive pin 2 to 1V, which will mean there is 1V across the 3.3k resistor R6, causing 1/3.3 mA to flow in that resistor. The opamp output will be whatever it needs to be to get 1/3.3mA to flow in R5, which then (because the left hand ends of R4, R5 are at the same potential) causes the same current to flow in R4, making the apparent resistance -3.3k. The second stage has essentially the same behaviour within its linear region but clearly appears as -2.2k, these are both classical negative impedance converters of the standard design. You now have two resistances, they are in parallel, so you know what to do. Now clearly the first opamp is the one that is going to crash into the supply rail first, at which point it is going to look pretty much like R4 connected to a fixed voltage (And so will exhibit positive incremental resistance from that point) nothing hard about this. Note that there is a trap if you actually try to build this thing, many (especially bipolar) opamps have a pair of back to back junctions across the input, they are net well behaved in saturation with respect to input currents, check the datasheets of the opamps most carefully. Why the sudden interest around here in these (rather theoretical) constructs, there are real negative resistance diodes (Tunnel, Gunn) but these are not they.
H: Is it possible to program a RFID tag like a microcontroller? I am working on an RFID project. I want to be able to send specific messages between the reader and the tag or maybe perform my own protocols on it. Is there a type of tag that I can provide some sort of firmware for? (be able to program it like a microcontroller) Or do I have to design my own layout for this purpose? AI: It depends on the tag. Some tags are programmable in some restricted sense that is defined by the manufacturer, using a kind of scripting language that allows certain operations to be performed and data to be stored locally on the tag. But, "like a microcontroller", implying that you have full access to the "bare metal" hardware? No.
H: USB Type-C wires I have a USB type-C rapid charger 5V/3A, want to use that for one of my projects but there's 8 wires and i can't tell which is which to get 5V out of it! sorry for the blurry image, couldn't get the camera to zoom properly. there's 2 orange, 2 red, white, yellow, green and shield wire. How can i can i get 5V from this wires? which is positive, which is negative? AI: It'll be the braided shield and the thickest red cable, but: You'll be a bit disappointed in the current you'll be able to draw. The USB-C specification allows for chargers to deliver high currents, but only to devices that speak the USB-PD profile. That's a complex protocol, and just cutting off the wires will not do it. See this answer that discusses what you'd need to do to convince a USB-C charger to deliver 20 V. By the USB standard, your charger mustn't deliver more than a couple hundred milliamperes to a "dumb" device that doesn't negotiate a higher current; most chargers will deliver solidly more, but you won't be close to the maximum charging current, if you don't talk USB PD to the charger. In older USB2 devices, Qualcomm QC is the most popular protocol to negotiate a high current draw; basically the same applies for QC as for USB PD.
H: Is a 4p4c rj22 plug physically compatable with a 6p6c jack? cant seem to find any decent panel mount rj22 jacks but rj12 looks pretty close, and I cant help but wonder if it will fit. AI: An RJ-22 plug will fit into a RJ-11 or RJ-12 socket but the RJ-22 plug is much more narrow than the RJ-11 /RJ-12 plugs. This will lead to an unreliable connection because the wire pins in the socket will be bent as the plug is twisted sideways. As a person who works with these connectors regularly, I would assume that a RJ-12 socket would be used only for a RJ-11 or RJ-12 plug and never plug a RJ-22 plug into it. In other words, I think that using a RJ-12 socket for a RJ-22 plug is a really bad idea.
H: How does a capacitor affect the flow of the current? I understand that the capacitor is like a secondary DC source when it's almost fully charged. What I don't understand is the way it behaves in a circuit. It discharges itself when it's full or when it is the only DC source in a closed circuit? Consider this slow-speed oscillation example:- The Programmable Unijunction Transistor (PUT) and the capacitor are connected in parallel, thereby the voltage is the same for both of them. But I don't see why the PUT depends on the capacitor. Even if the capacitor acquired the entire current till it gets full, wouldn't the electrons go from the DC to the PUT directly? AI: There are two things going on, which is no doubt part of what is confusing you. The PUT stays off until some threshold voltage between it's anode and cathode is reached. Then it turns on and it stays on until the current through it drops below some threshold. So the PUT is a 2-state device. A capacitor tries to hold its voltage, and the bigger the capacitor, the better it does. The rate of change of voltage on the capacitor is equal to the current into or out of it, divided by the capacitance. So here's what happens in that circuit. I'll start with the PUT off (not conducting current) and the capacitor discharged. The capacitor charges up, through the 470\$\mathrm{k}\Omega\$ resistor. No current flows through the PUT, because it's off. So, no current flows through the LED, either. Because the current through the capacitor is small, its voltage grows, but slowly. Eventually, the capacitor reaches the threshold voltage to turn on the PUT. It turns on. This creates essentially a short circuit from the capacitor to the LED*, and the LED emits light. The PUT and LED in series discharge the capacitor. There's lots of current, so the capacitor voltage falls off quickly. Because the voltage is falling, the current through the PUT falls. Eventually, the PUT turns off. Now the PUT is off and the capacitor is discharged, and the process starts over again. * Which is pretty hard on the LED -- it would be better to put a resistor in series with the poor thing. This circuit was probably originally designed for an incandescent lamp, which would have little trouble with being used this way. But I digress.
H: Is there a good way to test your schematic before buying the parts and building it? I'm trying to design a BMS that can handle 12 cells, be powered either with a isolated dc-dc converter or the batteries themselves and uses active balancing, but I'm not sure if my design will work: AI: No there is not, computers will not be able to do the jobs of electrical engineers for a long time, if ever. The best bet is to simulate the parts of the circuit that are most complex in a spice package. I would test the DC to DC in a spice package. If your really unsure, I would test only one of the DC to DC converters before building many of them. Most schematic designers also have Design Rule Check (DRC) packages that you can check voltage compatibility, input/output compatibility, ect. to help the designer spot mistakes. This also takes a lot of time to setup. A few other basic tips: Read the datasheet through for all new parts that don't have history (ie the circuits that are new to you) Check each part for bypass caps Check the pinout for all connectors and make sure they match the cables. Check every pin voltage. Make sure there is enough current/power for all the parts Check programming interface pinouts
H: Forward Error Correction over Unidirectional Serial Link I’m designing a master-slave, one way RS-485 over plastic fiber optic physical link layer network using low power PIC MCU. While I expect the link layer to be very reliable, nothing is ever perfect. Since the network is unidirectional to keep costs down, I’m thinking some form of Forward Error Correcting code is in order. The data packet content is simple: Slave address (one byte) Opcode (one byte) Operands (four bytes) So just six bytes of application data passing from Raspberry Pi transmitter UART at up to 56K baud -> plastic fiber optic transmitter -> PFO cable up to 20 meters -> PFO receiver -> PIC12LF1822 MCU UART as RS-485 slave node. I could just use a CRC to detect errors but since the link is one way, there’s no way to NAK a bad packet for retransmission. This seems like a good use case for forward error correction but I have no experience with FEC. What algorithm or other things should be considered, given I need as close to 100% reliability as possible. Preferably an FEC algorithm that can be implemented in C code on a PIC MCU. AI: You will never, ever get the probability of an error occurring down to zero. Moreover, in this sort of link, the errors that you do stand to get are going to interrupt one or more entire packets. It's a much better idea to design your protocol with some sort of reliable error detection (i.e., a CRC, with a length of your choice), and with an information content in the messages so that the receiver is robust to missed messages -- basically, so it can get itself into the correct state even after missing one or more messages. In the extreme, you just continually send the receiver an entire frame that contains every bit of its desired state, all the time. "Commands" just consist of changing the receivers desired state in the transmitter, and waiting for that entire frame to be transmitted. If that causes speed problems, then set up a scheme where the transmitter fills any dead time in the link with the desired receiver state, but will interrupt with new commands. If that's just not going to work, then you either need a two-way link, or you need to accept that every once in a while your system will start misbehaving, and a human being will have to reset it.
H: What is the purpose of these diodes? What is the purpose of these didoes? I couldn't find it because I don't know it's name. Thank you. simulate this circuit – Schematic created using CircuitLab AI: On the left is a full-bridge fully-controlled thyristor rectifier. With that circuit it's possible to turn DC into AC if the outer DC voltage is ever higher than the rectified AC voltage. The current flow is reversed then. D1 stops this reversed current from the DC connector. In addition, D2 and D1 function as a crowbar for reversed polarity on the DC connector. There is no real reason to have D1, though, because the ability to turn DC into AC relies on firing the thyristors in the correct pattern. One could simply forbid the control logic to use that pattern.
H: Colpitts oscillator : having trouble while respecting Barkhausen criterion, is this criterion insufficient there? I'm trying to simulate a Colpitts oscillator. I've determined transfer function of the low-pass filter of this circuit: I reached this expression: \$H(j\omega)=\frac{1}{1-LC_2\omega^2+jR_3\omega(C_2+C_1-LC_1C_2\omega^2)}\$ I've plotted the Bode diagram with Python of the pi low-pass filter: With: \$C_1=C_2=470pF\$ \$L=100µH\$ \$R_3=220\$ Phase plot: Gain plot: The red dot indicates the frequency (\$f_0\$) which shifts the input signal phase by 180deg: \$f_0=\frac{1}{2\pi}\sqrt{\frac{C_1+C_2}{LC_1C_2}}\$ \$f_0\$ is supposed to be the oscillation frequency, because it makes with the inverting amplifier a \$2\pi\$ total phase shift including the filter. I get with the values given: \$|H(j\omega_0)|=1\$ \$arg(j\omega_0)=-\pi\$ I choose to use \$R2=R1=1k\Omega\$ Then the Op amp transfer function is (inverting amplifier): \$T(j\omega)=\frac{-R_2}{R_1}=-1\$ Then comes Barkhausen criterion: \$|T(j\omega)*H(j\omega_0)|=1\$ \$arg(T(j\omega)*H(j\omega_0))=0 [2\pi]\$ From my point of view, the criterion is respected. However, this simulation fails and I don't get why. It seems like feedback is too weak but gain is supposed to be 1, just enough to sustain oscillations. I've read on this page that Barkhausen is a necessary but not sufficient condition to get oscillations. Is there a condition I'm missing there? UPDATE: TimWescott's answer - first point - helped me a lot. By including R1 in my calculations, I now get this transfer function: \$H(j\omega)\frac{1}{1 + \frac{R_3}{R_1} - L\omega^2(C_2+C_1\frac{R_3}{R_1})+j(\frac{L\omega}{R_1} - R_3C_1C_2\omega^2(L\omega-\frac{1}{C_e \omega}))}\$ With \$C_e=\frac{C_1C_2}{C_1+C_2}\$ The \$f_0\$ frequency (which produces the 180° phase shift) is now: \$f_0=\frac{1}{2\pi}\sqrt{\frac{1}{R_1R_3C_1C_2}+\frac{1}{LC_e}}\$ It's worth to notice the dependance of \$f_0\$ upon \$R_1,R_2\$ - which wasn't the case before taking in account \$R_1\$. This result contradicts many formulas given in articles about this oscillator - like this one. However, it seems to work, at least in Falstad sim. With the same values that the ones given above - and \$R_1=1k\Omega\$: \$|H(j\omega_0)|=0.412\$ Thus \$|T(j\omega_0)|=\frac{1}{|H(j\omega_0)|}=2.42\$ So, with \$R_3=1k\Omega, R_2\geqslant2.42k\Omega\$ which is precisely the value that sustains oscillations (according to Falstad). Also, according to my calculations: \$f_0=1.092MHz\$ which is the frequency displayed by Falstad. This is not equal to \$\frac{1}{2\pi}\sqrt{\frac{C_1+C_2}{LC_1C_2}}=1.038MHz\$. Either there's a problem with Falstad (I will give SPICE sim a try soon) or the frequency given in the article (and many others about this circuit) is - slightly in this example - wrong. However, the gap expands when \$C_1\$ and \$C_2\$ values are decreased. AI: First, your filter is loaded by both R3, which you appear to have taken into account, and by R1, which you appear to have neglected. R1 matters because the inverting node of the op-amp should be around 0V, at least if you're running at 10kHz or less for the 741. This means that R1 appears to the filter as if it were grounded. Second, you want to design your oscillator with an excess of gain in the amplifying circuit, and design it so that as the amplitude of oscillation increases, the amplifier gain goes down. This can be as simple as a clipping circuit, and gets more elaborate from there. Third, the LM741 probably cannot drive a 220\$\Omega\$ resistor on its output -- 2200\$\Omega\$ is probably better. Yes, a transistorized Collpitts may work with impedance levels of 220\$\Omega\$, but you'd need a beefier op-amp to do that.
H: How to make an electrical connection to thin gold plating? Hello fellow engineers. I am trying to make an electrical connection with some gold plating. The gold plating is shaped like a rectangle, with dimensions of 3mm x 1.5mm x 0.1μm thick. Here is what the part looks like, it's quite small. My procedure is: Tin some 24 gauge stranded copper wire Apply flux to the gold pad Attempt to solder the wire to the pad Every time I try to solder (using standard solder: 63% tin, 37% lead solder wire, flux core, 0.6mm diameter. the solder I used), I end up with a failed connection within one second of solder flow. What I mean by this is, all the gold seems to disappear, and I am left with an extra-tinned wire. I think what happens is the gold is absorbed into the solder, as Wikipedia states here. I am wondering, how do you suggest I make a reliable electrical connection to this part? Edit 1 Per comments: - Tip: Metcal STTC-144, with a MX-PS5200 PSU. I am not sure what temperature the tip is at during soldering. - Substrate: from the product description that the substrate is Si, with 0.3μm of SiO2, then 0.01μm of Cr, then 0.1μm of Au. AI: Gold dissolves in tin. There is an indium solder called "TIX". It requires a strong flux, "TIX flux". You can get it on Amazon.
H: Help with thevenins voltage Have to find the power developing on the 7k resistor (I*U). Calculated (hopefully correct) Rthevenin to be 12k//4k which would be 3k. Circuit simulator shows that the current through the resistor should be 3mA but i can't figure out how to get to that number with the voltages provided, seeming as i would need my Uthevenin to be 30 volts for that to work (afaik). What am i missing? AI: Let's start with the original (pre-modification) schematic, as I gather it from your schematic, and then show the transformation. I'm doing this just to make sure that I understand what you say you did: simulate this circuit – Schematic created using CircuitLab If I missed something, let me know. At this point, it's helpful to redraw things: simulate this circuit All I did in the above-left case was to add a ground reference. You can do this to exactly one node, only. But you are free to choose any one node. I chose the one you see. In the above-right case, all I did was move things around a little bit. You should be able to see what I did and agree that the choices I made are legitimate. We are now in a position to combine some resistors and voltage sources and greatly simplify the schematic: simulate this circuit At this point, you should have a very easy time working out the current in \$R_4\$.
H: servo control using a microcontroller and separate power supplies I'm trying to get a very basic servo control circuit to work using an Arduino and can't figure out where I'm going wrong. I've got separate 5V power supplies for the microcontroller and the servo, grounds are connected (through the microcontroller) and decoupling capacitors in place. Schematic: Breadboard: Code running on Arduino: #include <Servo.h> Servo servo; void setup() { servo.attach(10); } void loop() { servo.write(135); delay(500); servo.write(45); delay(500); } I've tried: Two different Servos, both "standard" servos rated for 4.8-6V. One servo is the HobbyTech YM-2765, it just clicks and doesn't move as though underpowered. Another servo, the 3001HB, will work for up to a few minutes and then get "stuck", pushing it slightly will resume the movement. Two different Arduinos Different values for decoupling capacitors - 1000uF, the standard 470uF I see recommend in many places, with or without the small 100nF capacitor. Powering both servo and arduino from the same power supply. Different 5V power supplies - both the wall and 2 different 5V USB "power bricks" designed for mobile phone charging. Wall power supply rated for 1.8A, power bricks are rated for 1A, 2.1A, or 2.4A, I am using a hacked/cut open USB cable to supply power. Different servo movement code running on the Arduino (more time to move). Would really appreciate any tips on troubleshooting or what I could be doing wrong! Thanks. AI: As far as I can tell your circuit and code are correct, so the most likely culprit is bad power. The YM-2765 is a high power servo that could draw over 2A when moving. The 3001HB is a standard power servo that probably draws 1A or less. It's possible that your power supplies are not up the job. Many cheap USB power supplies cannot deliver their rated load, or can't do it for an extended period of time. When a USB power supply overloads it usually goes into current limiting, which drops the voltage to stop current increasing until the overload is removed. Some have 'fold-back' current limiting that greatly reduces the current, so if the servo ever stalls it won't get enough current to start moving again. For testing I suggest replacing the servo power supply with a 4 cell AA alkaline or NiMH battery. 'Hobby' servos are generally designed to work from this power source when used in radio control models. If that still fails then look at your wiring. If you are using a breadboard, replace it with a proper servo socket and soldered connections.
H: Wiring USB 2.0 to USB C Receptacle I have a keyboard that uses a USB 2.0 cable to connect to the computer. I would like to remove the current USB 2.0 cable and replace it with a USB C receptacle. The goal is to be able to connect the keyboard to the desktop with a male to male cable (USB C to USB A or C). My problem is that I cannot find any material discussing the wiring of a USB C receptacle to a USB 2.0 pin out. In the USB C spec (Section 3.5.2) it illustrates how to wire a USB 2.0 cable with a USB C plug and a USB A plug. Does wiring a USB C receptacle differ from wiring a USB C plug? In other words, can I connect the S/GND/D+/D-/V pin out from my keyboard to a USB C receptacle following Table 3-13 in the spec? Please let me know if I need to clarify further! I am usually on the software side of things. EDIT USB 2.0 pin out from keyboard to USB C female receptacle pics AI: If you are fitting an old style USB 2.0 device with new Type-C connector, here is the answer However, Type-C to Type-C cables are thick, stiff, expensive, and may fall off from a device that is a subject of frequent moving by user. There is a reason why keyboards and mice have non-detachable cables. To use Type-C host ports, you will be much better off if you replace your Type-A plug on your existing flexible cable with Type-C plug. The plug has to have 5.1k pull-down resistor on one of CC pins. Most DIY Type-C plugs offer pre-fabricated pads for this, like in the pictures below:
H: LTspice: Including Time Derivative of a Node Voltage in Initial Condition I am trying to simulate an RLC circuit with the initial condition that V1(0)=2 and V1'(0)=0. I used D(V(V1))=0 in my spice directive, but I don't think the condition on time derivative has actually been implemented.(D(V(V1)) is negative instead of zero at t=0) Are there any suggestions on how I should modify my initial condition? Thanks in advance for any advice! Edits: At t = 0, d(V(V1))/dt = 0, I(C1) = 0, hence I(L1)= -I(R) = -0.5A. But the I(L1) in the plot still starts at 0, whereas I(C1) = -0.5A. I tried various values of I(L1) in the initial condition and the result remains the same. AI: I'm not entirely sure about your question. But I think you are having trouble specifying the initial condition for the first derivative of \$V_1\$. If so, I don't know of a method of doing that with LTspice. However, you are able to specify the initial conditions for any voltage node and for the current in any inductor. And that's how I'd approach this. You know that \$V_{1_{t=0}}=2\:\text{V}\$. You also know that \$\frac{\text{d}}{\text{d}\,t}\:V_{1_{t=0}}=0\:\frac{\text{V}}{\text{s}}\$. Given this last bit, you know that the instantaneous current in \$C_1\$ must, by definition, also be zero. You can easily calculate the current in \$R_1\$, given \$V_{1_{t=0}}=2\:\text{V}\$. Therefore, you know the initial current in \$L_1\$. (You must easily see what I'm suggesting here.) So this means you can specify this initial current in \$L_1\$ using the ".ic I(L1)=??" card. Yes? Try it out.
H: How to find Gate charge I want to drive a 650V 21A SiC mosfet at 100kHZ. Would this mosfet driver be able to drive the mosfet? How can I find Gate charge of the mentioned mosfet gate driver? The mosfet I am planning to use is SCT3120ALHR. Please suggest if this driver will be able to drive the mosfet. If not, then please do suggest what other driver and mosfet can I use in place of these. I will do simulations of the components. AI: How can I find Gate charge of the mentioned mosfet gate driver? You won't. The gate charge is a characteristic of the device you are driving. To turn it on you must transfer that charge to the gate, to turn it off you must remove that charge. How fast you want to do this (your switching frequency) will determine the current that will flow. The peak current will be driven by the gate resistance Based upon your system needs, you can then design an appropriate gatedrive. As to whether your shortlisted driver will work... Yes BUT how well depends on your switching frequency and the peak current you want to hit the MOSFET with SCT3120ALHR Gate charge: 38nC for an 18V swing on-die gate resistance: 18R NCP51705 Peak current 6A An NCP51705 driving an SCT3120ALHR will need a minimum output drive capability of: 1A for an 18V swing. ✔ The design case is 100kHz. The NCP51705 can switch at 500kHz ✔ At 500kHz the needed power to be sourced is: 68mW ✔ This driver chip appears to have the capability to transfer the needed charge at the required rate
H: LTSpice: simulate transient voltage and current in RL-circuit My goal is to calculate transient current and voltage in a following circuit: Also, immediately after the switch is closed, initial current is 0 and then it exponentially increases until the value reaches the value defined by the steady state. Mesh analysis gives 5mA for the mesh which contains an inductor and 1.75 mA for the other mesh. LTSpice transient analysis confirms these values. Next step is to define the voltage and the time constant. For the simple circuit (voltage source - resistance - inductance in series) the voltage (immediately after closing the switch) is equal to the source voltage. Since this is the complex circuit, the Thévenin equivalent must be found. Here is the resulting circuit: Now the voltage across the inductor immediately after closing the switch is equal to 90 V. Time constant tau = L/R = 0.36/18k (s). However, LTSpice shows that the voltage across the inductor is something below 60 V: What is wrong with my assumptions and calculations? AI: You should not use the startup option. Do measure the voltage source V1 with this "startup" option and plot/see what happens to the voltage of the voltage source. Use initial conditions instead, like .ic i(L1)=0.
H: Comparing MAX3232 vs MAX232 for line length Which parameter in the datasheets of the line drivers MAX3232 and MAX232 can tell about the maximum length of the line for their correct operation if all else is same for the two circuits, that is baud rate = 115200, Vdd = 5 V, same UTP cable used. AI: 100 ohm twisted pair is a poor match for rs232 drivers (which are about 1000 ohms) , the main limitation is the drivers capability to charge and discharge the line. In my experience on long runs the main problem is dielectric absorbtion during the idle time causing the start bit to be distorted, this can be mitigated somewhat by fitting a diode at the receiver end to limit the negative voltage So what you want most is low output impedance. voltage levels are less important. Here the max3232's 35mA short-circuit current beats the max232's 10mA soundly.
H: Custom bootloader passing control to application code in STM32 I am trying to understand that if for STM32F405 MCU a custom bootloader is used on the MCU then each of the two projects for the custom bootloader and the application code will have their own 'startup.s" files. What I understand is that both of the two binaries, ie the bootloader and the application code, they both reside at different locations in the flash. Now when the custom bootloader will exit and return the control then the control should pass-on to the startup code of the application code. But I don't know how it actually happens. Does the two binary programs resides at contiguous locations so that after the bootloader finishes the next instruction is that of the startup code? Or they are at different locations and somehow the start address of startup of application code is saved as jump address at the end of the bootloader binary? Will it make a difference in the way it is actually implemented if I use Keil or GCC compiler? AI: The compiled image of an STM32 application begins with a vector table, in which the first word contains the initial stack pointer value, the next one has the address of the first instruction. The bootloader must obviously know the address the application is loaded at (how could it load it otherwise?), so it can look at the first two words of the image it had just flashed. You must take the layout of the flash sectors into account when deciding the start address of the application. If parts of the bootloader and the application end up in the same flash sector, then the bootloader won't be able to reflash the app. The designers of this MCU had arranged a few shorter sectors at the beginning of the flash exactly for this purpose. You might want to reserve 32k for the bootloader, and place the application at 0x08008000 for example, it's up to you (and the complexity of the bootloader). Will it make a difference in the way it is actually implemented if I use Keil or GCC compiler? The only difference would be in the linker configuration files, which tell the linker where to load the application. The GNU linker takes it from a linker script (*.ld), Keil calls it scatter file. They have the same purpose, but different syntax. You should adjust the linker script/scatter file of the bootloader too, limiting the amount of flash available to it.
H: Why does this potentiometer in an op-amp feedback path cause noise when adjusted? I have placed a dual-gang 100k potentiometer in the feedback path of two op-amps that work as a Sallen-Key filters. This controls gain but also the Q factor of the filter (somewhat demonstrated on wikipedia. However, when I move the knob, it makes some rubbish noise. The noise is demonstrated in this youtube video. The schematic of the filters is shown below. The Q factor pot is RV3A and RV3B. The minimum Q is set by R7 and R10. The power supply for the op-amps is from a boosted 9V battery up to 18 V with an LM27313 regulator. I'm really not sure what is causing this noise or how I could go about preventing it. My only thought is having the pot in the feedback loop is not a good idea, but there is no other way of controlling the Q factor. How could I alleviate this noise? Edit: I accepted @Catalyst's answer since it was the most technically correct. I appreciate all of the suggestions on how to fix it. I simulated some tests on placing capacitors in parallel with the potentiometer but they really messed with the frequency response. What did fix the circuit was by placing it in an enclosure. Using an aluminium enclosure linked all of the pots strongly to ground which seems to have generally improved noise performance hugely. Here is a link to the a new video demonstrating a lack of noise. The audio is recorded in exactly the same manner as before. I don't fully understand why a better ground fixed the travel noise but I'm certainly glad it did. AI: The noise is caused by minute mechanical vibrations of the pot wipers on the rings (the latter are the resistive material.) Since neither the wiper nor the ring material are atomically smooth where they touch, rubbing the wiper on the ring produces slight vibrations. Some of that vibration is perpendicular to the contact patch between wiper and ring. The resistance of the wiper/ring contact varies with the normal force. This transient/AC variation of the contact resistance is what you're hearing. How to fix it is (IMHO should be) a separate question. And non-trivial because adding caps across any pot terminals will change the filter characteristics.
H: Where does STM32CubeMX generate AF GPIO initialization? i was wondering where does CubeMX (when you export it to an IDE such as Atollic) generate GPIO initialization for alternate functions such as Timer capture pins, UART pin ect. (we are talking about HAL drivers) I've noticed it's not initialized in GPIO_Init nor the specific initialization function used. I want to set pull up on an AF pin without having to import the project again. So where is it? AI: Nevermind i'm blind, it's in stm32f1xx_hal_msp.c file.
H: Need Help To Identify Attached SMD Component I am trying to fix a RS485 circuit. There is 3-pin protection components on both A and B pins. The component is connected serially to the line and mid pin is grounded. There is no label on the component. The resistance is nearly 0 ohm and the component is short circuit by defult. Could you please help to identify this component? AI: It quite likely is one of the NFE series of Murata. Looking at the size, I guess NFE61PT 2706(6816). The chip "EMIFIL" NFE61PT is a T-type circuit EMI suppression filter. Bad quality image from the datasheet reveals the low DC resistance you're measuring between input and output. Therefore, I think it's quite likely the component is not broken.
H: What is Mikrobus purpose? I'm new to embedded systems. I have MPLAB Xpress Evaluation Board. I see that the board has MikroBUS connectors. Going through the internet, I couldn't understand what is the purpose of the MikroBUS? Which functionality does it allow? What is the way to connect to it? AI: The specification is here. It simply provides a standard set of interfaces that make it easy to plug together various kinds of evaluation modules in order to prototype a system.
H: Use a TVS device to protect meter from live capacitors, workable or not? I've been working on a LCR/Impedence meter and want to protect my inputs from possible damage if I forget to discharge a large cap. I know I've seen various types of diodes and relays used for that purpose. But from what I've read and experienced, the larger diodes can cause degradation and relays would be a pain in the ass. Then I remembered using a TVS array from TI(TPD2E2U06-Q1) to protect my usb signal lines on a prior project. With a minimum break down voltage of 6.5VDC and a stand off voltage of 5.5VDC, I thought it would be perfect. It has what looks like a 0Db insertion loss out past 100Mhz(I'll be using a max of 500Khz, and more likely 100Khz and below). The line capacitance is only 15pF, I'll have more than this in parasitics. This thing is mostly being built to deal with small impedances/resistances, miliohms and the like(I have a VNA that can handle larger stuff/higher testing signals) and a 5.5VDC cutoff will be plenty for this. I will also be putting two of them in parallel. Now the question, did I interpret the data sheet correctly? Meaning will it protect my inputs(my front end AD630's are powered at +/- 12VDC, so they are safe until 13VDC) from a live cap and not greatly effect the measurements? If it comes down to it, I don't care if these things act like popcorn, at $.60, they are a LOT cheaper than my AD630s... Here is another question, would adding a 2 or 5 watt resister in the TVS's ground leg help out here? If They AI: Those are ESD protection diodes. They can't absorb a large amount of energy, so it depends on how much energy you have stored in your caps and what the series impedance from the cap to the TVS diode is. A big electrolytic charged to a high enough voltage would probably cause the TVS diode to short, then blow open followed by blowing your input stage.
H: Why is the air gap between the stator and rotor on a motor kept as small as it is? Between the stator windings and rotor is a small air gap. What would happen if this gap were larger than it is? Surely the magnetic field set up by energizing the stator windings would still cut the rotor and induce an emf across it. So what effect does this air gap have on the performance of the motor? AI: Air has a much higher reluctance (the magnetic equivalent of resistance) than the magnetic materials used in the motor. The smaller the air gap is, the lower that reluctance, and thus the higher the magnetic flux (which is the magnetic analog of current), allowing the motor to work more efficiently and at a higher power. Smaller air gaps also minimize leakage flux, which means more of the flux that is produced actually does something, rather than just going through the air and doing nothing to help the motor work.
H: How to substitute this pickle switch with a software controlled switch? I'm working as a research assistant. We have three high frame rate cameras that currently save the recorded video when the pickle switch (purple cord) is manually pressed. I want to replace this purple pickle switch cable with a microcontroller that can automatically send a trigger signal to the cameras when receiving a signal from a Linux machine. I tried searching google for "software pickle switch" and there were too many extraneous results. How should I go about doing this? I'm also confused about the actual circuit that is created between these 3 BNC connectors and the pickle switch. I'm told by another research assistant that the pickle switch grounds the BNC cables. Is that correct? What would the actual circuit look like if drawn on a schematic? Edit: Here is what I think the circuit is actually like. I measured the resistance of the BNC pickle connector and it short circuits when the button is pressed. AI: I've never heard of a "pickle switch" but they seem to be a simple pushbutton on a cable. Figure 1. A pickle switch from AbelCine. To prove my theory: Disconnect the "pickle switch". Test for continuity with a multimeter on Ω range. Record resistance with button released. Record resistance with button pressed. simulate this circuit – Schematic created using CircuitLab Figure 2. Likely result. If it works out to be as shown in Figure 2 then you can replace it with a relay contact. The coil of your relay will be driven by the Linux machine. The simplest solution may be a USB relay module but you'll need to check for suitable Linux drivers.
H: Half Bridge Low Side Mosfet vs. Flyback Diode I intend to use this high side switch in a PWM application with a brushed 12V motor drawing 8A steady state max: https://www.nxp.com/docs/en/data-sheet/MC33981.pdf The switch allows for a half bridge configuration, where an external low side MOSFET is placed across the load as show in the diagram below: The document states the following: I do not understand why decreased power dissipation is desirable in this application, other than for thermal reasons. Using a diode, the energy stored in the inductive load would be dissipated more quickly when the high side is removed. I'm not sure how having residual current flowing through the inductor before the next on cycle of the PWM would affect the system, but I assumed it was not desirable. So why, in this case, would a mosfet be a desirable substitute? AI: In a switching converter this is desirable because it means that it lets the current in the inductor never fall to zero which lets you run in continuous mode instead of discontinuous mode which produces less ripple and noise (I think...it's something like that). In a motor this is desirable because you don't throw away all the energy put into building up the magnetic field at the end of every PWM cycle only to use more energy to build it back up again the next PWM cycle. It's a bit like constantly stopping and accelerating your car for no reason to maintain an average speed. It wastes gas. It's more efficient just to go at a constant speed in between the two extremes because you're not throwing away energy.
H: Switch LED with Solid state relay (PhotoMOS) The SSR is a PhotoMOS AQY211EHAX rated to drive 1 amp. I seem to be shorting the output side of the SSR. Is a pull down resistor normally required on the output side or am I missing something fundamental? AI: You still need a current limiting resistor on the LED. There is nothing limiting this current through the LED and so the output appears to be shorted.
H: PIC12F675 ADC not working properly I wrote a code that takes an analog input from a potentiometer and controls the frequency of a clock pulse. So, the idea is to increase the frequency when I increase the pot and decrease the frequency when I decrease the pot. It should change at a constant rate. The problem: When I change the pot, the frequency changes, but not in a constant rate. For example, when I increase the pot, the frequency may decrease and if I increase the pot more, it may increase again. And so on. Here are some examples of when I keep ONLY INCREASING the pot: The Config: #pragma config FOSC = INTRCCLK #pragma config WDTE = OFF #pragma config PWRTE = OFF #pragma config MCLRE = OFF #pragma config BOREN = ON #pragma config CP = OFF #pragma config CPD = OFF The Code: #include <xc.h> #include "config.h" #define _XTAL_FREQ 4000000 void delay(unsigned char freq){ for(int i = 0; i < (int)freq; i++){ __delay_ms(1); } } void dClock(unsigned char freq){ GPIO1 = 1; delay(freq); GPIO1 = 0; delay(freq); } void InitADC(){ ANSEL = 0x11; ADCON0 = 0b00000001; CMCON = 0x7; VRCON = 0; } unsigned char GetADCValue(){ ADCON0 = 0b00000011; while(GO_nDONE); return ADRESL; } void main(void) { TRISIO0 = 1; //analog input TRISIO1 = 0; //output TRISIO2 = 0; TRISIO3 = 1; //mode TRISIO5 = 1; //pulse_button char pressed = 0; GPIO1 = 0; InitADC(); while(1){ if(GPIO3 == 0){ GPIO2 = 1; unsigned char freq = GetADCValue(); dClock(freq); } else{ GPIO2 = 0; if(GPIO5 == 1 && pressed == 0){ GPIO1 = 1; __delay_ms(500); GPIO1 = 0; pressed = 1; } else if(GPIO5 == 0 && pressed == 1){ pressed = 0; } } } return; } Other than that, everything works fine. Could someone help me with that? Thank you. AI: The ADC is only returning the least significant bits with return ADRESL;. So, if the pot was in such position the returned ADC value was 0b011, "increasing the pot" will return 0b000 as next step. You should either return ADRESH; or set ADCON0 = 0b**1**0000001; or change freq to an unsigned int and return (ADRESH<8) & ADRESL
H: Trying to find value of two capacitors using resonant frequencies in three conditions, but wrong formula is derived I was trying to find capacitance of two capacitors in the following way. Connect each capacitor individually to a same inductor and find resonant frequency in each case. Connect the same capacitors in series , to the same inductor and find the resonant frequency. Then calculate the capacitance using following way we have \$f_{1} = \frac{1}{2 \pi \sqrt{L c_{1}}}\$ , \$f_{2} = \frac{1}{2 \pi \sqrt{L c_{2}}}\$, \$f_{3} = \frac{1}{2 \pi \sqrt{\frac{L \left(c_{1} + c_{2}\right)}{c_{1} c_{2}}}}\$ Solving these equations, we get \$\left\{ L : \frac{1}{4 \pi^{2} f_{3} \sqrt{f_{1}^{2} + f_{2}^{2}}}, \ c_{1} : \frac{f_{3} \sqrt{f_{1}^{2} + f_{2}^{2}}}{f_{1}^{2}}, \ c_{2} : \frac{f_{3} \sqrt{f_{1}^{2} + f_{2}^{2}}}{f_{2}^{2}}\right\}\$ I tried to substitute the values for f1, f2 & f3 ( f1 = 2500, f2 = 2030, f3 = 3200 ) . Interestingly , I got a result which is numerically correct , but with a difference of \$1e^{-6}\$. That is, instead of micro farad, I get values in farad, Also, instead of millihenry, I get value in nanohenry I was trying to figure out why this difference in occurred . The completed IPython notebook can be found at https://gist.github.com/harish2704/5fe08c80c96307973a11f724a218950d it will be a great help if someone can help me AI: The formula for the series capacitors should be C1 * C2 / (C1 + C2). You have it upside down.
H: How does one position control a voice coil actuator? I am looking at trying to position control a voice coil actuator (something like these). On the end of the voice coil actuator will be a small load (let's just imagine a 10 oz cube), screwed onto the end of the shaft. Here is where I come from. When position controlling a spring-return solenoid with a feedback sensor, it's relatively simple: to move the solenoid out to position X, you control the power based on the feedback signal's value. The more power you input, the further out the shaft moves. I am wondering, how does one actually conduct position control on a voice coil actuator? In other words, to hold the shaft static at position X, does it require a constant voltage/current? Or, can you remove the input voltage/current, and have the shaft not move? AI: I am wondering, how does one actually conduct position control on a voice coil actuator? In other words, to hold the shaft static at position X, does it require a constant voltage/current? A constant voltage or current will hold the shaft at a constant position provided the load, angle, and temperature don't change. To control in that fashion is generally called "open loop" and can work well enough for some applications. For precise position control some form of position feedback is required to adjust the output so that the position error is reduced. There is no feedback built into the units in your link. Or, can you remove the input voltage/current, and have the shaft not move? There is no mention of a shaft brake on the datasheet either. The brake, if supplied, would require additional wiring as you couldn't expect the brake to release on low voltage operation (for a small movement). Response to comment: If a brake were to be included, what would be the brake's technical name? I'd be looking for "holding brake" or similar. Would it be a linear magnetic brake? No. Linear magnetic brakes apply a decelerating force proportional to the velocity of a conductive plate through a slot in a magnet. At zero velocity the have no holding force. You'll need a mechanical holding brake. Also, to interpret what you're saying in the 2nd half of your post... If the brake were added, it would prevent motion at low voltages because the power input to the VCA would have to be enough to generate a magnetic field that could overcome the magnetic field from a brake Let's say we had a 12 V actuator with a 12 V brake. The brake requires some voltage - say 8 V - to release it fully. If the brake is sharing the actuator wires then the actuator won't move well or at all until the voltage reaches 8 V.
H: Re-soldering SMD with SMD rework station I recently purchased a clone 858D SMD rework station and would like to get familiar with de-soldering and re-soldering SMD chips. I was able to de-solder fine, but when trying to re-solder I can't seem to get all the legs to solder onto the PCB. My question is, what could be the cause of this? Here's the steps I took before re-soldering: Added flux to the pads on the PCB Cleaned up/added solder to the pads Add a bit of solder to the legs of the SMD chip One big thing I noticed is that before re-soldering, the chip didn't sit flat at all on the pads. This was the PCB before soldering: The outcome after soldering: AI: You need to get the PCB up to temperature evenly enough that the solder melts all the way around -- if you don't get all the solder melted all at once, then the solid stuff will always hold the chip up and it'll never work. For a hot-air station, this means either getting a tip that blows hot air evenly over all of the chip, or playing the tip in an oval around the chip, with some extra attention to the board side (because the board will wick away heat). It can help a lot to take a piece of tin can and bend a 'U' or 'L' shaped piece that surrounds the chip and sort of holds the hot air in the vicinity of the chip. An alternative with any sort of package that has legs sticking out like that is to clean the PCB off until the pads are just tinned. Then tack the chip down in two corners, and solder it on leg by leg. If it's too fine a pitch to do that, just get everything soldered, even if you get solder bridges -- then go back and clean off the solder bridges with solder wick. The more magnification you can get when you're doing this, the better.
H: LDO vs Switching Voltage Regulator for Drone Application I have been designing a drone flight controller and currently have been using LDOs to regulate the voltage to 5V. As I have started to use higher voltage batteries the LDOs have started to overheat. I know that switching regulators are so much more efficient which is definitely a plus with battery-operated devices, but heat is not my only concern when considering which power supply to use. When the drone's motors are on, the voltage supply becomes very noisy, and I have RF ICs on the board that are incredibly sensitive to power supply noise. Would a switching regulator be better for this application, or would it generally perform worse? TLDR: When comparing LDOs and switching voltage regulators, which are generally the better performing option in terms of output voltage noise when considering an already noisy power supply? AI: When comparing LDO's and Switching Voltage Regulators, which are generally the better performing option in terms of output voltage noise when considering an already noisy power supply. As you have probably found searching internet, a LDO has generally less ripple/noise/EMI than a SMPS. heat is not my only concern when considering which power supply You could distribute the heat using resistors in front of the LDO. Adding capacitors to form RC filters help to filter "an already noisy power supply" at the same time. For example: You can also preceed the circuit above with a SMPS to gain better efficiency. You probably don't need the RC filters. When the drone's motors are on, the voltage supply becomes very noisy But addressing the cause of the problem rather than patching the effect of the problem would be a better approach.
H: Designing an effective power supply for embedded products I'm currently designing several embedded microcontroller products to be powered from a wall outlet. I plan to use wall-wart power supplies to give an input of approximately 5-9V DC but I want the input of my device to work at up to 30V just for the sake of compatibility and ease of use. The output of this power supply circuit should be 3.3V at about 500 mA maximum. I also want reverse voltage protection in case a user plugs in a barrel jack with center-negative terminals. Below is my design. I used a PTC fuse to prevent short circuit/over-current issues, and a P-channel MOSFET to prevent reverse polarity from reaching the switching regulator. The Zener diode allows for high input voltages to not fry the MOSFET. My main questions are: Will this switching regulator work with the P-channel MOSFET protecting the Vin pin? Are any of my part choices obviously bad? Are there any obvious mistakes that will prevent this from working? Note: Some of these parts are found on LCSC just because of their low price & integration with the PCB service I use, in case you can't find the mfg. part number anywhere. EDIT: I have modified my design to prevent inrush current above approximately 15-25A. AI: The polarity protection works correctly as explained in Mosfet in reverse polarity protection. The rest is the Typical Applications given by Microchip in the MCP16301/H datasheet. So, I don't see any issues there. I don't know if you have considered the inrush current when applying 30V while C2 initially forms a short: it should not exceed max Pulsed Body-Diode Current the body diode can handle nor the max Pulsed Drain Current which happen to be -27 A. The PTC has a minimum resistance of 0.400 Ω plus the ESR of C2 plus the contact resistance of J2 plus the "resistance" of Q2's body diode or slow turned on channel probably limit the inrush current, but you'd better simulate and/or measure it. EDIT 1 The body diode is always conducting, so the slow turning on of Q2 due to R3 or an additional capacitor across Q2's gate-source (= across D2) will not limit the inrush current. You'd better use a 1 ohm resistor. Together with the known minimum resistance of the PTC, the current is limited to 30V/1.4 Ω = 21.4 A. At 30V in, 3.3V & 600 mA out, 80% efficiency, Iin = 83 mA, so losses in 1 ohm = 6.8 mW. At 12V in, 3.3V & 600 mA out, 80% efficiency, Iin = 206 mA, so losses in 1 ohm = 43 mW. Note: A NTC will work, but don't forget it doesn't help much anymore when it's hot. So, the count to 10 before turning on a device after turning it off applies. EDIT 2 Adding another PMOS back-to-back would be a solution as well. However, tying the drains together would lead to the following initial condition: simulate this circuit – Schematic created using CircuitLab The voltages across C3 and across C2 are initially 0V. I drew this short (only) for C3 to show what happens in the circuit above. The gate voltages for both PMOS are therefore 0V initially as well. So, the both PMOS will be turned on from the beginning and still yield a huge inrush current. Note that connecting C2 in between the two PMOS won't help: the body diode of M2 will have the same effect as D2. Better is tying the sources together: simulate this circuit Again, the voltages across C3 and across C2 are initially 0V. Any higher voltage than 0V on the source of M2 will make its body diode being reversed biased, so an initially shorted C3 will have no effect on C2 & D1 & R1. Because the body diode of M1 is forward biased and C2 is initially 0V, the gate voltage will initially be equal to the power supply voltage, keeping both PMOS closed. C2 is slowly charging through the body diode of M1 and R1 and will turn on both PMOS slowly that way, limiting the inrush current. The turn on time is determined by R1 & C1 and the threshold voltage of the mosfets.
H: I2S to PDM Conversion We are looking to use the TLV320AIC3111 audio codec to process some sound data that we are receiving from MP34DT05-A microphone. We then look to transmit the data wirelessly over BLE using the BlueNRG-1 BLE Module. We've already worked on the BlueNRG-1 and have managed to transmit PDM data input over BLE. But the TLV320AIC3111 supports only I2S, Left-Justified, Right-Justified, DSP, and TDM Audio Interfaces according to the datasheet given above. I'd like to know if anyone knows of any way to convert I2S to PDM, or maybe a similar BLE module that supports I2S input. We'd prefer the first option though as we've already got the BLE figured out. AI: It doesn’t seem like there’s a way to use a PDM mic with that TI audio codec. Analog would work though. Likewise, the BlueNRG expects PDM, but the TI codec only makes PCM (I2S). So the TI part seems to be a poor fit either way. The Cypress (formerly Broadcom) BLE solutions seem to support I2S.
H: Power Amplifier Modification I am trying to build this amplifier. Looking at the diagram, am pretty sure how it works, but is there a way I can modify this variable resistor with some fixed ones? AI: Your variable resister is for setting up the idle current in the main powermosfet bank .More resistance means more gate source volts meaning more current .Mosfets are very spready so a fixed resister would not be good for a population of amplifiers,hence the variable resister .Once you have set the idle current you could use a fixed resister of the same value as the variable one .This fixed value would be good for your amp with your fets but probably not for somebody else .Fixed resisters are more reliable than pots .If you had to replace the expensive fets your resister value would probably change .
H: Triac power dissipation I'm driving a high power load with the BTA440Z (datasheet): line voltage is Vac = 230 AC, load power is P = 1.33 kW, thus load current is ~ I = 5.8 A. If i swap the load with another that draws P = 2.33 kW, then I becomes ~ 10 A; in this condition the triac overheats and it doesn't un-latch due to thermal runaway. To properly size the heatsink, I need to know how much power the triac is dissipating, and I realized that in the datasheet there is no such thing as an equivalent to what in a MOSFET would be "Rds on", and that I don't actually know how to find such a parameter. The circuit is as follows, taken from this datasheet, without the snubber network: Initially R1 was 680 ohm, because i thought that it could work anyway and less current would pass through the opto; but i subsequently dropped it to 360 ohm because i figured that more current through the gate would make for a wider channel between the main terminals: is this assumption correct? Does this current also contribute to the power dissipated on the triac? Based on what i read, what i know, (electronics-tutorials.ws, link 1 and link 2, and the Wikipedia page about Triacs), and the following image, my guess is this: for the most part, the power dissipated by the triac is given by the current to the load I, times the triac on-state voltage VT. Is this correct? Please note that without a zero-cross detector, my microcontroller won't turn off the opto after the triac has been fired into conduction, so assume the opto is always on. AI: The resistor value does not noticeably affect the power dissipation. It only conducts briefly at the beginning of each cycle until the current is sufficient to trigger the gate. Using an excessively high value causes RFI from the switching too far from the zero crossing and can contribute to having some DC content in the output (important if the load has a transformer). The latter effect is due to asymmetrical triac trigger current in quadrant I vs. III. Usually you can directly read the typical power dissipation from the triac datasheet. In your case, the datasheet you linked above contains the following graph: Your conduction angle is 180° in this case. You should aim to keep the triac junction well below the absolute maximum value at maximum ambient temperature for decent reliability. Personally, I don't like to see the junction temperature much exceed about 100°C under any conditions. If it's losing gate control it's way, way above that (and any triacs exposed to that abuse should be replaced with new parts).
H: Correct Initialization Routine for LCD Panel (HX8357D) I have acquired a color 320x480 TFT LCD display based on a HX8357D driver. It is an Adafruit 3.5" Touchpanel display. I would like to use it for one of my projects based on Rust. Currently, there are no drivers out there for Rust and therefore I plan to pull one together by altering existing drivers to work (likely target is the st7735-lcd-rs driver). One of the things that I will need for this is the correct initialization sequence. I have looked at the datasheet for the display (datasheet) and struggled to find a good definitive list of necessary commands to properly initialize the display. Is this just a poorly written datasheet or am I just looking in the wrong place? There are some drivers out there for the display such as the Linux Kernel (Which is driver variant agnostic and looks a bit dated, so not sure if it is valid for the D variant) and AdaFruit's own library (see line 183 where it defines the initd array. I consider this to be the most authoritative source for the init routine sans the datasheet which is the subject of this post). These could of course provide me with the necessary routine. However, I would like to find this information from the datasheet. It is very likely that I just do not know how to parse these datasheets as this is the first time I have tried to do this type of thing. How do I get this information from the datasheet? Thanks for any pointers. AI: LCD modules like that nearly never actually specify the initialisation vector in the datasheet, in part because the silicon vendor and the LCD vendor are not the same company. At best you can usually get the module vendor to give you some example code to base your routine on, but how to control the details like say gamma curves and such is pretty much a case of suck it and see... In reality however most of those driver chips (like the text mode ones) are pretty similar in terms of configuration, but you need to pay a little attention because usually not everything the chip is capable of is actually hooked up.
H: Why are all my yellow 2V/20mA LEDs burning out with 330k Ohm resistor? I have a very basic circuit on a breadboard using an Arduino's 5V+Gnd to power a few LEDs. All the LEDs are from Sparkfun and rated at 2V/20mA, coming in Red, Green, and Yellow. I'm using 330 Ohm resistors but I also have much higher resistors like 10k and 330k Ohm for testing this issue. Only one LED is being connected at a time using the individual lanes. Nothing is connected to the power and ground rails on the breadboard. Red, green, and even my white LEDs work great, but so far 5 yellow LEDs in a row have immediately burned. I double-checked wiring, moved wires and LEDs, and went all the up to a 330,000 Ohm resistor, but no luck with the yellows. Is this likely a bad batch of yellow or am I missing a key component? EDIT: Here is the full board (the wires are complex because this will be an electronics puzzle in a game): And here is with the other wires removed to show what's actually connected: AI: Those resistors aren't doing anything at all. All the pins in a row are connected together.
H: Why different SOCs have different CPU power voltages for given frequency? Recently, I studied dvfs tables for 3 SOCs: exynos8890(LITTLE cluster), exynos7880, snapdragon 625. Here is the result: octave source code The point is, that different SOCs with pretty same manufacturing process (14nm), same CPU architecture (arm53), but different manufactures, and consumer grade have different voltage at given frequency. It's clear, that reducing CPU power voltage, one can reduce dynamic consumption, but still, Does reducing CPU power voltage has any drawbacks on overall CPU power consumption? Also, why exynos8890 has peak voltage at 1.6GHz, but not at MAX frequency? AI: There are two kinds of power losses in a chip: static (leakage) dynamic (switching) Voltage scaling reduces both power losses as a square of the voltage so the benefit of reduced voltage is substantial, especially for a mobile device where battery life is king. There is a trade off however. Generally, a lower voltage results in a longer switching time for MOS logic, so it requires reducing the clock rate too. This has an upside in that it reduces dynamic power as a linear function of clock rate. (The power relationship between voltage, frequency, and capacitance is W=V^2 * f * C, where C is the sum of capacitance on driven signals.) Now, why the differences at the same process node? Different designers will use different strategies to meet timing in their parts. One such strategy is to use low-threshold (low-Vt) transistors in certain critical paths. This comes at a price however: increased leakage power. So even within the same company (Samsung in this case) and on the same process, you will see differences. Some parts are optimized for performance, others for power. A performance-oriented part that uses low-Vt paths more generously will use more power at a given frequency and voltage, but will be ultimately faster at a given voltage. The reason for the odd dip for Exynos 8890 may just be that’s the power profiles they were able to test.
H: TSOP34838 noise in dark areas I'm using a TSOP34838 IR reciever on an ATMEGA MCU, However, I see a problem in dark areas... If I put my finger in front of the receiever, it starts spewing out garbage, even worse when the room is completely dark (intended use case is a custombuilt rgb controller, so.. darkness is kinda needed to see the rgb). Powered via a wallwart, and more than enough (1k uF) caps on the power rail. Issue dissapears when I connect for example my oscilloscope's grounding lead to the circuit... Therefore is quite undebuggable.. does anyone have any ideas in what I could try? AI: IR receivers work by measuring the leakage current on a photodiode with a high-gain amplifier. Because of the high impedances involved, they can pick up electrical noise from nearby sources - like your finger for example. There are shielded versions of IR sensors which help with this issue. Otherwise, just know to keep your finger away... Also, some light sources can interfere with IR sensors, such as high-frequency fluorescent light ballasts. A light filter can reduce this. More: why does it stop when the scope is connected? Your wall-wart DC supply has a 'floating' output that is probably injecting hum on your setup due to leakage from the line to the ungrounded secondary. (If it's a really cheap wall-wart it can be quite a lot.) This is normal and not (usually) hazardous, but it can cause problems with sensitive circuits like this. In this case the sensor is picking up that floating-ground hum as a difference between itself and your somewhat-grounded body. With the scope attached the power supply secondary is no longer floating, and the hum is shunted away to ground. So with both sides grounded, the difference disappears, and along with it, the sensor misbehavior. Try this: Touch the board's ground and bring your finger to the sensor. I predict that the problem won't happen then, either. Why? Your body will be at roughly the same potential as that leaky wall-wart ground, no noise will couple to the sensor. What's this noise then? Try this: Measure it with your scope with the probe ground connected to earth and the board itself ungrounded. That is, have the low-voltage side floating. You will see the floating ground hum / leakage that typically looks like spikes at twice the line frequency. It can be surprisingly large - 60V in some cases, and it may depend on which way you have the wall-wart plugged in. But because it's a weak AC path it's very low current so it's not dangerous. Where does it come from? The noise is AC coupling from the primary to the secondary, through the transformer that isolates the two domains. And if you’re really unlucky, besides line-frequency noise there may be some switching noise riding on it too, which might be in the bandpass range of the sensor (e.g., 38KHz.) Finally, why it’s worse in the dark: the sensor AGC function is maxed out so it will be at high gain, making it more sensitive to noise.
H: Assigning a 16 bit number to two bytes of a buffer Currently I have this out buffer that I am assigning values to like this: char out_buffer[OUT_DATA_SIZE]; … out_buffer[7] = 0xD0; out_buffer[6] = imu_union_ACC_Y.byte_data[1] out_buffer[5] = imu_union_ACC_Y.byte_data[0]; out_buffer[4] = imu_union_ACC_X.byte_data[1]; out_buffer[3] = imu_union_ACC_X.byte_data[0]; out_buffer[2] = imu_union_ACC_Z.byte_data[1]; out_buffer[1] = imu_union_ACC_Z.byte_data[0]; out_buffer[0] = 0xC0; I would like to assign a int16_t value to two of the bytes. The variable name is a_y_filtered. So essentially instead of sending out x,y and z. I'd like to send x, y, and y filtered. AI: Using a union was sufficient for my purposes. out_buffer[7] = 0xD0; out_buffer[6] = a_x_filtered.byte_data[1]; out_buffer[5] = a_x_filtered.byte_data[0]; out_buffer[4] = imu_union_ACC_X.byte_data[1]; out_buffer[3] = imu_union_ACC_X.byte_data[0]; out_buffer[2] = imu_union_ACC_Z.byte_data[1]; out_buffer[1] = imu_union_ACC_Z.byte_data[0]; out_buffer[0] = 0xC0; Here's the union structure: typedef union { uint8_t byte_data[2]; int16_t g_x; }imu_union_t; And this is how i declared it: imu_union_t a_x_filtered; imu_union_t a_y_filtered; imu_union_t a_z_filtered;
H: What is the benefit of a mosfet gate drive which is constantly biased instead of driving to ground? I recently came across a circuit with a drive signal which never went to ground, and instead always kept the MOSFET biased. What it the reason/benefit of doing this? I've drawn an example like the circuit I saw, where the PWM signal would go from +5 to 0V meaning the gate voltage would either be +5 or +2.5V. This is shown in the below waveform. simulate this circuit – Schematic created using CircuitLab AI: If you never wanted the load current to go to zero this would be a good way to do it, a little odd because generally mosfets should be in the on or off state, not in between as they dissipate a lot of power. A circuit like this might be useful for a hit and hold on solenoid or something like that. If you want to use this circuit, make sure you check the power dissipation in the mosfet. FYI, holding alt and selecting the mosfet (or any part) which will give you power in lt spice.
H: How can I trickle charge NiMH batteries as part of an IOT controller? I have built an IOT motor controller board that's powered by 4 AA NiMH batteries in series. I want to use a solar panel to trickle charge the batteries, but the voltage slowly decreases even when the ESP12F WiFi module is sleeping and there's full sunlight on a 5v 200mA or 6v 150mA panel. Why am I never seeing an increase in voltage? AI: You are not seeing an increase in your battery voltage for two reasons: The solar cell is NOT providing its full current/voltage capability, so your perception of 'full sunlight' is wrong. Test your solar panel on it's own and use a light meter to get some idea of the span of capability the panel has. Your ESP12F IS NOT asleep, it's just in a lower power mode. See here: You should be aiming to be in at least Modem-Sleep mode, and even at this, you will have limited runtime for dark periods if your IOT device is expected to be always on/ready. For your solar battery charge schema you absolutely must have at least a voltage threshold sensor. As commented in another answer this could be as simple as a TL431 and transistor. Since you might have to dissipate all the power from the solar panel the TL431 on its own won't do. This type of wasteful charger is ok, but means you can never fully charge the batteries since you have to make voltage compromises. However it's cheap so may be all you need. For example if you used this Duracell AA NiMH you can see the problems with a voltage only controlled charger: To charge the batteries (nominal 1.4V, so 5.6V pack) at maximum rate you need a peak voltage of about 6.4V ...above you panel capability. This assumes active charge current control and would add complexity and cost to your project. To charge the batteries with a voltage only control, you have to set the voltage to no more than the expected terminal voltage (and this varies with temperature too). In this case a reasonable choice would be 1.35V (5.4V pack). At 5.4V pack voltage you will get a proximately 80% charge on the batteries. At this voltage the batteries will never overcharge, and even though the charge current reduces to just a few mA for a long time this IS NOT trickle charging. Trickle charging by definition is continuing to charge the battery AFTER it is fully charged. In this case since we are not fully charging the battery there is no problem with low current charging. With a simple charger like this you have to dissipate most of the energy from the solar cell when the voltage limit is reached. In this case if the panel current limit is 200mA then you need to dissipate about 1.2W. I'd suggest a circuit such as this: simulate this circuit – Schematic created using CircuitLab
H: Why we see a spark when we connect a plug into an already switched "ON" socket? Why we see a spark when we connect a plug into an already switched "ON" socket? But I've also noticed that this isn't the case always, ie. sometimes when connecting a plug into a socket which is already "ON" it doesn't spark, while sometimes it does. This question has been in my mind for some time, I've experienced it a few times in the past, but when I encountered the same situation today it reminded me of this old question in my head and hence I asked. Any help is highly appreciated. AI: Air can actually be made conductive with high enough voltage, which turns it into a plasma (which can conduct a lot more current than air). For this process to happen the air needs to reach a breakdown point, which occurs when a voltage and\or distance limit is reached. As you can see in the graph below the distance is fairly short as 120V or 220V will be on the mm scale. Source: https://www.researchgate.net/publication/234058061_The_threat_caused_by_fires_under_high_voltage_lines/figures?lo=1 The sparking of AC receptacles happens when the air gap 'breakdown' reached, the air starts to conduct and you see the plasma (which always happens to some extent when plugging devices\loads that are 'on' in because there is always air between the plug and socket until they make contact, and the distance decreases while plugging, you may not see it every time) If the device/load is off, you won't see a spark, so plug in\unplug devices while off (and it will be easier on the plugs, as a small amount of weilding occurs if 'hot plugging'). The sparking effect is also more likely to be seen when unplugging (while devices are on) for several reasons, one is the gap is short so breakdown always occurs. The other is that motors and other inductance in devices can also create a voltage while the device is being unplugged. It's also possible that static could have accumulated in a device before plugging and this could create a spark while off, similarly to rubbing your feet on the floor and touching something metal.
H: What is this triple-transistor arrangement called? For an old Fuji 2DI200D-100 power transistor module, it uses three transistors internally for each half-bridge: The circuit in question doesn't connect to the middle bases at all, just B1 and B2, so this (dual) triplet is being used solely as two big transistors. Is this called a "triple Darlington pair?" "Darlington triple?" Or is there some other name for this arrangement? AI: They're called high current triplets. I don't propose to cover high current followers in any great detail, because they are already explained in various other articles and projects on the ESP website. High current versions are typically used in the output stages of power amplifiers, and can be simple complementary Darlington pairs, Sziklai pairs or in some cases a triple (three devices in cascade), and using various mixtures of NPN and PNP transistors. There are many combinations, and it is hard to provide the detailed analysis that each deserves in a short article. Instead, I will show some of the common variations, purely for interest's sake. If you want to know more, you will need to perform your own analysis because the choice of transistors determines how well each version will work in any given configuration. The selection of devices depends on the application, frequency range, voltage and current, and given the number of transistor types available, the number of combinations is truly vast. In the drawings below, resistors between individual transistor base-emitter junctions are not shown. For high-current triples, Q2 could have an emitter-base resistor of around 220 ohms, and Q3 might use 22 ohms, but these values need to be determined by the application and to suit the devices and intended purpose. Higher resistances can increase the turn-off time, and lower values draw more current. This is part of the design process, and each case will be different. Source: https://sound-au.com/articles/followers.html (section 11)
H: Digital Logic Design - Sequential Circuits The circuit diagram below is in a stable state because of the two inverters. Why and how did it reach a stable state? AI: If you accept that a logic level can be only 0 and 1 it is clear that the circuit must be in one of the two states, because there are no other (stable) states for it to be in. If you relax this assumption there can be, depending on the transfer characteristic of the inverters, more stable states, for instance all nodes at 1/2. In practice, an inverter will likely amplify, and that 1/2 state will be amplified towards one of the two stable states. (In theory it could still be at 1/2 forever, this is called a meta-stable state, and it is a real problem in some circumstances.) How did the circuit arrive at one of the two states? If the inverters amplify, all states above 1/2 will quickly be amplified to 1, and below 1/2 to 0. In practice there will be more circuitry around your 'memory cell', which can force the cell to one of the states.