text
stringlengths
83
79.5k
H: IEC vs. UL current rating I was doing a search on Digikey for some power entry connectors and noticed that many of the connectors are rated 10A by IEC standards and 15A by UL standards. Why is there such a large difference between the two standards, and if I plan on using this connector to draw potentially 15A from a North American wall socket, will I run into any trouble? Picture provided for reference (current ratings on the right): AI: Just because it was not tested to that standard does not mean it won't safely operate at that current. They may not bother testing above 10A, for example, because 10A is a lot of power at 230VAC. Or the allowable temperature rise may be more lenient under UL rules than IEC. If you're in North America you need to worry about UL and CSA standards. You shouldn't depend on a distributor's listing for important information like that. There are frequently errors. Look at the manufacturer's datasheet and make sure you understand it, and if there are any questions, contact the manufacturer. If the manufacturer is dubious, look at their test certifications and verify with the agency that they are still valid. In this case I don't see the 15A UL rating listed for that particular part number on the datasheet (it is for the 575). I might have missed it though.
H: Why are two stages used for an instrumentation amplifier? When we have a two-stage instrumentation amplifier, such as the following. Why do we need the first stage of the two Operational Amplifiers? Couldn't we just input V1 and V2 into the differential amplifier? AI: The 3 op-amp design has three main advantages over a single op-amp differential amplifier. The input impedance is much higher, since the inputs drive directly into an op-amp input rather than into a resistive divider. The gain can be set by changing a single resistor, so the critical parts can be easily integrated on to one chip (maximizing symmetry) with a single external resistor for setting the gain. In high gain configurations the common mode rejection is much better because the gain of the (highly symmetric) first stage effectively multiplies the common mode rejection of the (less symmetric) second stage. Note that in general it is better to use a specific instrumentation amplifier chip than to try to build it yourself out of separate parts. Having everything on one chip improves symmetry and hence common mode rejection.
H: Analog Bistable Memory I am looking for a device which I do not know exists. I would like to store the state of a number of analog switches, perhaps driven by a D Type Flip Flop. I'd like to drive the flip flop and set values with a momentary toggle switch. What I am looking for is a type of analog switch, which could store memory and survive power downs without relying on some sort of constant power source like a small battery. Basically a parallel accessed EEPROM with direct access to each of the bits through a single pin, or something that behaves in a similar fashion. Can anyone think of a solution to this problem? Does something like this exist? My research came up with bistable multivibrators, but I could not find information that indicates if those would survive a power down or not. Cost and size are of concern to the design, of course. AI: The easiest solution by far is going to be to use a microcontroller with built-in EEPROM and some analog switches. For example, you could use a micro with a hardware SPI interface and 16 MAX335 analog switches. There are many small micros you could use. Something that supports your digital supply and has on-board EEPROM would be simplest. You should also make sure it has a good reset circuit or provide an external one. When power is applied, or is interrupted, the micro resets, reads 16 bytes of data from the EEPROM and shifts it out to the serially controlled switches. You can also get crosspoint switches which may be easier to use, if that is your end goal.
H: What properties should I look for in a microcontroller if I just want to work with incoming 16 bit data? I am very new to picking microcontrollers for projects. I have a project in which I have 16-bit data coming in from an amplifier/ADC. Simply put, I would like the microcontroller (very low power and in dimensions in range of ~7mmSQ,STM32 based also preferable) to manage the 16-bit data coming in. Is there a specific property in microcontrollers that governs what resolution data it can manage? What is the name of that property? Also, is there a good website for understanding how to choose microcontrollers for projects? Any help appreciated! I realize the question is very vague but I am just starting out and would love to learn more about how to pick the right hardware any way I can. AI: You need at least 1 SPI port to transfer data to your Bluetooth chip. Many medium powered MPU's like the PIC32MX/MZ series have many SPI ports and a 16 bit data I/O port. Internally they are 32 bit MPU's. If you need a digital filter, say take the average of 4 or 8 samples to remove noise and send that to the Bluetooth chip, then the PIC series is fast enough and cheaper than high-end MPU's. Also a mid-level STM32 should be plenty. Avoid MPU's that have expensive peripherals such as a dram controller, video driver, USB ports, Ethernet abstract layer, timers, counters, capture logic, JTAG, loads of serial ports, including many SPI ports that you don't need. This greatly reduces the pin count and the package size. If you need remote control to change modes, as you mentioned, then a serial port is all you need. If you did not mind losing the fast 32 bit core and 16 bit port, then another SPI port for the ADC is all you need and the pin count goes way down. Write down what you really do need, including crucial "what if" functions. Pick a MPU family you already know well, then pick a MPU that has only what you need. At 500 samples per second any stripped-down 16 bit or 32 bit MPU will have time to do all your task with plenty to spare. Sorry but you will have to do the shopping based on your own research and our suggestions, as we do not do shopping here on EE.SE.
H: 8-layer PCB stackup question I'm designing a 8-layer PCB stack up. I have two choices as below: Layer STACKUP 1 Layer STACKUP 2 Question related ========================================================= 1 SIGNAL 1 SIGNAL 2 GROUND 2 GROUND 3 SIGNAL 3 SIGNAL / / / / / / / / / / 4 SIGNAL 4 SIGNAL 5 POWER 5 POWER / / / / / 6 SIGNAL X 6 SIGNAL / / / / / X 7 GROUND 7 GROUND X 8 SIGNAL 8 SIGNAL X The / / / / / means there is a relative wider distance (around 0.5mm). The difference of the two choice is the reference plane of L6, closer to PWR plane 5, or closer to GND plane 7. Because I have many power rails, I have to split the PWR plane. So, for continuous transimision impedance, I think may L6 goes closer to L7 will be better than go closer to PWR plane, right? AI: As far as I'm concerned, Stackup 2 is a no-go, because it's non-symmetric. The upper thick dielectric layer is 3rd from the top, but the bottom thick dielectric layer is 2nd from the bottom. This can cause warping of the finished boards, which will lead to further problems. So if these are your only two choices, you should choose stackup 1. Because I have many power rails, I have to split the PWR plane. So, for continuous transimision impedance, I think may L6 goes closer to L7 will be better than go closer to PWR plane, right? You don't want your controlled impedance traces to run across a split in the power plane if they're using that power plane for their return current. If you can arrange your splits to not pass under high speed traces, then you can use the power plane as the return for controlled impedance traces. If your data rates are not too high (say below 1 Gbps), you can probably get away with passing traces over splits, as long as you provide a capacitive path for the return currents to cross the split as well. This could be a capacitor connecting the two power nets, or capacitors from each of the power nets to ground, located as close as possible to where the trace crosses the split. Other strategies you might consider: Dedicate one or two layers to low-speed signals, so that these don't require controlled impedance. Two high speed layers (assuming not too high a speed) can share a reference plane if one is used for horizontal routes and the other for vertical (so that traces on the two layers don't run parallel each other for any appreciable distance). I've seen this mainly used to have routing on L1 and L2 with ground on L3. Whether this is viable or not also depends how dense the component placement is on the top layer. If you really need 5 controlled impedance routing layers, then you may in fact want to pay up for a 10 layer stackup.
H: Can 3 phase AC current be applied to a BLDC and vise versa? I am just wondering because the designs of a synchronous motor and BLDC are the same. Could you please explain the downsides of not using the designated current? AI: They are not the same. In BLDC machine, the stator winding is concentrated. Hence the stator waveform will be trapezoidal. Whereas in PMSM the stator winding is distributed winding. Hence the stator waveform is sinusoidal. For PMSM a suitable control is space vector modulation, whereas for BLDC the six step pulse switchig is more apropiate. The downside of using different control method is cogging output torque of the motor.
H: What makes same wattage led light bulb brighter than the other? I noticed that one 10 W LED light bulb was 800 lumens and the other 1000. Both were warm white, 4000K, 80 CRI. What exactly makes one brighter than the other? AI: The lumen is the unit for the total (and weighted) measure of visible light produced (see also luminous flux). In other words, a particular LED may be better at producing mid-band visible light compared to another. It may also be slightly higher in efficiency i.e. more input power (10 watts) is converted to light.
H: IMU axis rotation, calculate values with respect to Earth plane I'm building a project that uses an IMU (Inertial Measurement Unit). The project involves the device to be mounted inside a vehicle and I should provide the acceleration, angular velocity and Euler angles of the vehicle (and not the device). After a few reading I understand that I must rotate the 3D axis of acceleration from the device frame (reference frame) into the Earth frame. To do this I can use quaternion rotation as described here (SO Question). But what about angular velocity? Can the gyroscope axis rotations also be rotated using quaternions? And as I'm a bit confused, once I rotate the axes, I can calculate the Euler angles from the quaternions. Am I right? I have come across many algorithms that calculate the quaterions (Madwick's Algo). After the calculation of the quaternions can I use "SO question"'s approach to rotate the device frame into Earth frame? In brief: I need to get accelerometer, gyroscope, Euler angle data for the earth plane. I'm a bit confused and so this question is just to understand the best approach for this problem. AI: The IMU should have the same axes for the accelerometer, gyroscope and whatever else there is inside. Just look it up in the datasheet. My approach to this would be to first make sure that the axes of your IMU are alligned with the axes of your vehicle since the IMU can only measure the velocity, euler angles and so on of itself. To get the euler angles from your IMU you can use this: https://robotics.stackexchange.com/questions/4511/euler-angles-from-9dof-imu assuming your IMU has a Magnetometer. Otherwise there are many tutorials on how to get the roll, pitch and yaw angle from IMUs: https://engineering.stackexchange.com/questions/3348/calculating-pitch-yaw-and-roll-from-mag-acc-and-gyro-data After this, you already have the euler angles you need and you can rotate the vectors you want (acceleration and angular velocity) into the earth frame. This can be done with quaternions as you mentioned. For this there are also a lot of tutorials online. The madgwick paper where you got the algorithm from has a good explanation for this problem. So to clarify: You calculate the orientation of your reference frame relative to your world frame (Euler angles) with your IMU. Then you can rotate whatever vectors your IMU gives you (acceleration, angular velocity, ...) from your reference frame into the earth frame and use them (calculate trajectory, compensate gravity, calculate movement etc.)
H: Lightning protection for Antenna Connector I want to add lightning and ESD protection for the antenna used with my PCB (Wireless Gateway). The antennas that will be used with my PCB are Pole Mount Antenna. There are three different types of Antennas needed with my PCB: 4G LTE, GPS and LoRa Antennas. Currently, I am using SMA PCB Connector. I want to know how to connect shielding of these connectors. Should I connect it to the enclosure's shield or to the ground (for RF)? AI: ESD protection should not be needed as the receiver/transceiver modules should already have build-in ESD protection. Any ESD protection you add will influence the matching between Antenna and Module resulting in reduced sensitivity and/or transmitted output power. It is a much better approach to just make sure that the metal parts of the antennas cannot be touched, for example by using an antenna that sits inside a plastic housing. Then you don't need extra ESD protection and you can rely on the module's build in protection. Lightning protection: All you can do here is make sure that the mast / pole you're using is conductive and well earthed. Then also make sure the mast/pole is the highest point. But even then, if lightning strikes the mast / pole directly it is simply a matter of luck if your receiver modules will survive or not. A lightning strike can be so powerful that it can rip out the mains wiring from a wall. There is simply no way that you can reliably protect sensitive low power electronics from that. I would not connect the shielding of the connectors to the metal case. I would only connect the metal of the case to the supply ground. Connecting the RF side can interfere with the reception as it is a sensitive point so I would not do that.
H: Understanding the Maximum Speed that can be Transmitted over a Cable I am trying to source a FFC/FPC cable for USB3.0 (+5gbps). This brought me to the question of signal transmission. I'm somewhat of a beginner in this topic. I know that you should match impedance on your PCB with your connector/cable to minimize reflections. I was wondering how to tell how fast of a signal you can transmit over a wire. Specifically what kind of cable parameters affect transmission speed? Any help is appreciated. AI: The maximum frequency is mostly related to the frequency-dependent loss characteristics of the cable. Eventually you get to a frequency where you simply don't get enough signal at the other end to use. Resistive losses in the conductors (including skin effect) Dielectric losses in the insulating materials Radiation losses if the cable is not fully shielded All of these tend to increase with frequency. This is why we generally switch to other technologies at very high frequencies: waveguides for microwave radio equipment and optical fibers for high-speed data.
H: iv characteristic graph confusion I am trying to understand how a iv graph for a battery rated at 10V with internal resistance of 10 Ohms would look like. I was thinking it would just be a constant 10V for the graph, however, I am unsure how internal the internal resistance would impact the terminal voltage. AI: simulate this circuit – Schematic created using CircuitLab Figure 1. The 10 V battery can be modelled as an ideal 10 V source with a 10 Ω series resistance. With no load connected the output voltage will be 10 V. This is marked with an 'X' on the upper left of the VI graph. If we short circuit the battery - seldom a good idea with real batteries - we will have 10 V across R1 and \$ I = \frac {V}{R} = \frac {10}{10} = 1\ \text A \$. This also is marked. Now you should be able to fill in the rest of the points. Calculate the voltage drop across R1 at 0.2, 0.4, 0.6 and 0.8 A and plot the resulting terminal voltage on the chart.
H: FPC cable contacts. Bottom vs Top and Bottom I would like to design custom FPC cables as extensions of my flex pcb that will connect to this connector of another PCB. My question is about the Connector/Contact type. In the digikey page it mentions "Contacts, Top and Bottom" compared for example to this connector where it just says "Contacts, Top". My questions are: 1) what is the difference between the two types? 2) In designing the FPC cable for the first connector according to the datasheet (see image below) do I assume that the contact between the FPC cable and the connector happens in the top side or the bottom side of the connector? The reason for the question is that it will determine if the FPC cable will be designed in the top or bottom layer of the flex pcb. Related questions I found where Need help finding the right FFC connector and Manufacturing Custom FFC AI: The description is basically telling you which side the metallic contacts on the connector are located. Contacts Top - means that the pads on your FPC need to be facing towards the top of the connector Contacts Bottom - means the opposite, that the pads on the FPC face downwards Contacts Top, Bottom - means literally both, there are contacts on both sides, so you can connect either way up. In the case of the connector you are interested in (Datasheet), the terminals in the connector contact both the top and bottom sides of the FPC, which means that you can place the pads on your FPC on either side - it is up to you which one you choose.
H: Positive Diode clipping circuits Why is the clipped voltage constant in the positive half for the first half of the cycle? Isn't it supposed to act as a ideal diode during forward bias ie behave as a closed switch? AI: Well, no, this is not an example of an ideal diode. Real diodes have a forward voltage drop of approximately 0.7 V (for silicon). When the diode is forward biased, its low impedance (relative to the series resistor) keeps the output voltage at 0.7 V relative to the 0 V at the cathode.
H: What type of 4-pin 1mm-pitch clippy connector is this? I have recently bought a lidar sensor with a peculiar cable type. I cannot identify it, but it has some interesting characteristics. It has a pitch of 1mm, and each pin has at most a 0.5mm width. The cable itself is for UART, but I'm not sure if the connector was made for it. Here is a close up of the male end. AI: After a quick search, The cable type appears to be a GH1.25-4P connector
H: How to bias MOSFET for finding S-Parameter simulation? I wanted to use a BSIM4 model of NMOS in my circuit. I got the correct dc biasing point, certain VDS,VGS and IC. But I am having issues measuring S-parameter data for MOSFET amplifiers. I simulated circuits in BJT and it works fine. Is there any generic circuit for MOSFET? I am not sure where to put up the DC block and RF feed with proper biasing in MOSFET (NMOS)so that S-parameter data could be measured. I ended up with the circuit shown below, it has invalid data for S-paramters if measured. Any suggestion/correction in the circuitry will be very much helpful. I am getting the S21 (dB) is below, which is invalid: My bias points are VDS=0.5V, VGS=0.8V, IDS=45.48uA and supply VDD=1.2V. Hence I got RDS(which is R1)=15.39kohms. AI: The credit of the answer goes to @Bimpelrekkie. Adding an extra RF choke inductor solved the issue.
H: Problem with setting initial voltages in LT Spice I was trying to set an initial voltage for a capacitor I was modeling in LT Spice, and I tried using the command .ic V(Vc)=20000 (Vc is the node directly after the capacitor, with ground on the other side), but the result it gave me was like this: Circuit schematic: There is a AC square wave source, but this is the part being measured. I figured that it would be more of a consistent curve, but it looks like it just immediately jumps and then discharges as I think it should. Is there another way to give a capacitor an initial voltage? AI: If you look closely, there is an initial spike of whatever you imposed it to be, but then the voltage discharges quickly through D21-D23-D20-...-D1 to ground. The circuit is behaving normally, I'd say. BTW, you named the same node twice: Vout and Vc. In this case, LTspice will consider the last placed name. Else, for any circuit involving initial conditions, you can try adding .tran 10m uic to complement the .ic card. Or delete the .ic card and set ic=... next to C1's value, like this: 2n ic=20k (btw, those F do nothing, unless they are the first letter, when it means femto -- avoid units). This should work without uic, too.
H: Questions about prototyping a DMX Splitter Original schematics I want to make the following DMX Splitter: Credits by J. Mack, see Full article: DMX Splitter Changes Changes made by me (with help of Maple, Transistor and many others, thanks for that): Four instead of three output channels Power led Signal led 5 separate DC/AC converters Separate 220 ohm resistors per output Temperature fuse and varistor TVS diodes My circuit The circuit I came up with is: Because not all components are present in DIYLC I used some conventions: Light blue circles are header pins Black dots are terminal boxes There are 6 PCBs The bottom middle PCB is overlapping slightly. On the left bottom and right bottom PCB there are two black squares, these are broken off to fit the enclosure. The dark areas on the other two left PCBs are to make sure the fuses can be replaced if necessary (to have a gap to the fuse boxes) Questions I have a bunch of questions (hopefully I can ask them in one question since they are all related to the circuit). In the left bottom PCB there is a QuickBlow fuse, but in the original link it is a SlowBlow. I don't have these; will this be a problem? Would the HiLink HLK-PM01's have enough distance between each other? I'm putting everything in one enclosure. I know officially a double enclosure should be used, however, there is really no space for it. And I intend to put the AC220/240V signals UNDER the bottom PCB which will be screwed tightly, so there is no possible way to touch 220/240V. Is this 'acceptable'? I'm intending to use the device on stages with my music bands. The device will be under my keyboards stand, reasonably safe. The TVS types are 1.5KE18CA DO-201AD 1.5KE18 Bidirectional TVS diodes. Are these ok? I checked them, but I couldn't check the real usage. I tried to lay the wires as good as possible, although several overlap (some I can route a bit better not crossing an IC, but it cluttered up the picture more to use only straight lines. Is there anything I didn't think of (regarding safety/functionality?) [Transaction Screenshot] AI: In the left bottom PCB there is a QuickBlow fuse, but in the original link it is a SlowBlow. I don't have these; will this be a problem? That depends on the inrush current of the AC/DC adapters and the nature of any line faults your device might experience. Generally, as long as the inrush current isn't sufficient to pop the fuse every time you turn the device on, using a faster fuse than necessary will just mean you blow fuses more often/unnecessarily. Would the HiLink HLK-PM01's have enough distance between each other? This is a little dicey. You have mains voltage on perf board, which is going to be a challenge, and generally I just plain wouldn't recommend it. At the very least, you should remove as much of the unused copper around the AC connections as you can. Better would be to either use separate enclosed AC-DC converters for each port rather than PC mount, or use a single AC-DC converter and then use isolated DC-DC modules to power each port. Best of all would be to use an external DC wall wart and then a set of isolated DC-DC modules and avoid messing around with mains voltage entirely! That will be the smallest and probably cheapest solution, too. I'm putting everything in one enclosure. I know officially a double enclosure should be used, however, there is really no space for it. And I intend to put the AC220/240V signals UNDER the bottom PCB which will be screwed tightly, so there is no possible way to touch 220/240V. Is this 'acceptable'? I'm intending to use the device on stages with my music bands. The device will be under my keyboards stand, reasonably safe. If the case is non-metallic, then this is generally fine as long as everything is mechanically secure. If the case is metallic then it should be grounded via the ground pin on the power cord. The TVS types are 1.5KE18CA DO-201AD 1.5KE18 Bidirectional TVS diodes. Are these ok? I checked them, but I couldn't check the real usage. Those are 18V bidirectional TVS diodes, with a clamping voltage of 32V, so by the time they activate to clamp a fault it may be too late for your transceiver. RS485 requires that devices tolerate data line voltages of +12/-7V, so you should set your protection much closer than that. Also, TVS diodes will be much more beneficial with something to limit the current into/out of the device when they activate, generally a 50-100mA polyfuse on the data lines is used. Otherwise, a severe fault will just blow up the diodes before it blows up the transceiver.
H: Fast, cheap, wireless data transmission with Raspberry Pi I need some advice on a project. I want to wirelessly transmit packets of data from a Raspberry Pi to several microcontrollers (Arduino or other). The frequency must be at least 15 packets/s per slave device. I am not really sure about using wifi, as it is usually not very cheap and requires setting SSIDs and passwords manually. Another thing is range. I need around 30m reach. So far, from my research I have come to only these 2 solutions: If its the only solution, then wifi 433/ 2.4NRF - RF modules seems to be a nice solution, but I feel there is going to be huge technical problems and limitations To be honest, I am quite desperate. I can’t find any wireless solution for long, sustainable, reliable, fast transmision of data between master and slaves, simplex. The communication I want to establish is more of a radio transmision than transmitting commands to the slaves. If you have any recommendation, or can point me to a particular technology that solves this problem, I will be grateful. One packet contain array of 60 int8 plus short string. Slaves up to 10. AI: You can go for LORA but that's normally more expensive. 2.4NRF ... not sure if it can reach 30 meters (depending on obstacles/walls). Maybe with an external antenna. 433/800/900 MHz RF is mostly having a longer range, but a little more pricy (less than LORA). I only did tests with Arduino and nRF with quite high speed (I think 2.5 mbps) and got a reasonably accuracy with about 6 meters and a wall in between. If you need less speed, you can go (much) further than 6 meters. 60 bytes * 8 bits/byte * 15 packets * 10 slaves = 72 kbps. This is a reasonably low speed (even for RF). So you can use expect to get higher distances, but you have to do tests to be able to reach 30 meters (with obstacles?) with nrf24. I didn't know about the 1% restriction. Btw, wireless microphones use sub 1 GHz transmitters/receivers and that bandwidth is much higher.
H: What is a "universal bridge"? I recently came across this intriguing instrument from the 1970s(?): It's a "Universal Bridge" made by Wayne Kerr. It's not a type of device I've come across before and I'm curious what these are (were?) used for. AI: User Janka actually has told the essentials in a short form. Computerized measuring equipment weren't generally available in 1970, they started to appear after the microprocessors were common. Precision RLC and voltage measurements have been needed at least 150 years. The grandgrandfather of this is Wheatstone's resistance bridge. The idea in bridges isn't to measure directly, but by comparing to a reference and finding the ratio between the reference and the unknown value. When the object to be measured is far from ideal, for ex. a lossy inductor, quite complex solutions are needed. You have one. It finds at the same time the inductance and the loss resistance (or conductance) at certain operating frequency (audio range only to keep the stray capacitance and inductance out of the results). Or actually you find it. You turn the knobs until the meter is at zero position. You have "balanced the bridge". In the 1980's instrument's like this were computerized. The user only connected the part to be measured, listened a moment how the relays clicked instead of turning the manual switches and red the results from the display (R and L)
H: Connecting a 48 V battery to a grid tie inverter I am working on a grid tied wind system project. I am planning to use a battery in the system which will be the source to the grid-tie inverter. Also the battery will be used only as a source to the grid-tie inverter and will not be used for back-up. So, the connection is as follows: Wind generator (2 kW AC) ----> Rectifier/charge controller ----> 48 V, 5 kWh Battery ----> Grid-tie inverter ----> Grid Will a grid tie inverter be able to take input from a 48 V battery? Is this type of connection feasible? Any guidance is much appreciated. Thanks AI: 48V x 45A might yield 2kW output if the panel is rated for 2500~3000 W max. But if yours is 2kW max take 2/3 or these values. Solar Panels might be rated for best case Solar Power input which rarely occurs due to latitude, season, elevation angle and daily aiming error. Low V battery causes higher transistor current losses to boost to 120Vac and 2x more to 4x for same kW rating. e.g. 600Vbat @800V can be 98% efficient at 3kW out but only 94% efficient at 400V while 80V bat.will be much worse but unknown. It is far more cost effective and efficient to have DC current <10A which implies A much higher battery voltage. e.g. 2kw/10A=200V and 120Vrms is 340 Vpp or 170Vp so high Vbat runs in buck mode while low Vbat must boost and amplify voltage and this draws more driver current. The optimum Vbat is the one recommend by your choice of GTI and matching array of PV voltage. Battery LG Chem RESU 7H_R / 10H_R Voltage range 350 -450 V CC Max. current 10 A Communication RS485 In spite of others named in top 10 Consumer grade GTI’s I think the single phase 2 or 3 kW version is what I might choose for best MTTP and GTI effectiveness with smart monitor remote features . https://www.vpsolar.com/en/prodotto/huawei-sun2000l-2-3-3-68-4-4-6-5ktl/ You do not need a Hybrid GTI from battery since you do not want UPS features.
H: CD4017 with multiple LEDs Here I solved most of my doubts from this site.Thanks to you all and cos of that I come this far. 1 . I wanna cycle through the various color LEDs using clap . 2 . I use a switch to cycle through the effects of LED so I used another 4017 to switch the power supply through 555 and the output of the 555 is amplified using bc547. I hope so. I made the exact same connection. 8 and 13 to ground and 16 to +ve source. That's it. but LED randomly started glowing . If i apply ground to LED's ground it acts pretty normal but it automatically cycles through various pins. and each pins contains 3 LED in series . incl rainbow LED. I'm using 9v 6f22 battery. AI: You left the leds floating. An unconnected pin can float between voltages and may be able to conduct to ground, completing the circuit. Or you connected them to ground via your skin or the table or moisture, etc. This is why you should never leave something floating, connect it to a voltage source directly or with an appropriate load resistance.
H: Voltage of pin set to high impedance? Suppose a pin can be set to three modes, high (5V), low (0V), and high impedance (?V). What is the voltage associated with high impedance? I.e. if I stuck a probe on a pin set to high impedance, what voltage would I read? Does high impedance mean no current? If so, does that mean voltage measured would be 0 because of V=IR? If so, how would you differentiate high impedance and logic level low? AI: If you set a microcontroller or FPGA IO pin to high impedance, the voltage there will be determined by whatever other components you hook that pin. If you provide a pull-down resistor, the voltage will go low. If you provide a pull-up resistor, the voltage will go high. (It might also be possible to program the chip itself to provide a pull-up or pull-down resistor) If you don't connect anything that can set the voltage, then it could even float randomly up and down, respond to capacitive coupling from nearby objects (like your body), etc.
H: Command Solid State Relay using NPN transistor 2N2222 I'm trying to command a Solid State Relay with the HV1 pin, I can't connect it directly(HV1 to CH1) due to the fact that the impedance on that pin is too low and I only obtain 2.8V when connected. So, I'm trying to use an NPN transistor(Q1). However, being inexperienced with tranistors I'm not sure that my schematic is correct(probably not). Can you give me some hints on how to choose the resistor's value, or what should I change to make it work? Thank you! This question comes after this question (Bidirectional Logic Translator translates to 2.8V instead of ~5) (The "Switch" is actually the SSR) CH1 is the command pin of the SSR simulate this circuit – Schematic created using CircuitLab AI: Usually you control a relay by connecting the "coil" where the resistor is in your diagram. The transistor allows current through the coil when the command signal is on, and blocks current when the command signal is off. Also don't forget to put a current-limiting resistor before the base of the transistor. Like this: simulate this circuit – Schematic created using CircuitLab It should work the same way for an SSR. Addendum: The reverse "freewheeling diode" D1 is not required with an SSR. However it is required when using a mechanical relay. If you are using this circuit with a mechanical relay, connect the diode in reverse-parallel with the relay coil as shown.
H: How come consumer products aren't powered by power banks? I wonder why no commercial battery-powered consumer product is designed to be powered by power banks. All of the ones I know of have either built-in battery holders or internal LiPos with charger chips. How come they don't just provide a 3V/5V external power connector and supply a separate power bank (or let the user supply their own)? The circuit can become simpler too. Is it a result of some regulatory requirement or mere aesthetic consideration? AI: There are two ends of the spectrum to consider: low discharge and high discharge. For low discharge stuff (clocks, kitchen scales, smoke alarms), it does not make economic sense to use rechargeable batteries at all because they have high self-discharge; non-rechargeable ones can be used with a lifetime of several years. High discharge stuff is less common but tends to already have proprietary power packs - drills and other power tools. This probably could be standardised across manufacturers but they don't want to do this since it would eliminate their margins on extra battery packs. There has very recently evolved a middle range of Chinese-origin appliances that use 18650 rechargeable lithium batteries - mostly e-cigarettes and torches. Here the understanding is that you buy a bunch of commodity cells and use them across your appliances with a single wall charger, ie not putting any electronics in the cells. You can get an 18650-to-USB5V "powerbank" device too. And here's the 18650-using portable speaker you asked for. An important thing to understand is that connectors are often surprisingly expensive - that's why appliance battery holders are simplified to a piece of bent metal and a spring.
H: Stepper Motor acceleration profiles for short runs I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they all boil down to this: "Accelerate using some type of ramp, run at speed, then decelerate to stop" All good. Accelerating will get the load moving, and smooth deceleration will get the load to stop at the (hopefully) correct position. My issue is this. All of the reading I've done so far seem to have the assumption that the distance to travel will be enough to accommodate all three phases of travel. ie Accel, Coast at speed , Decel. I've not found much discussion on how to handle very short distance situations. For example, moving only two steps will not, can not possibly have enough distance to go through all three phases. step - step - done. While that particular example seems to be simple enough to solve, what are the best ways of determining if deceleration is required, and if so, when? At what point do I determine that some sort of deceleration profile will be needed to get the stepper to stop at the required position without overshooting. So after a whole bunch more looking, and reading and getting confused I decided on the simplest solution. I stayed with a trapezoidal/triangle profile. Essentially I determined the distance a constant acceleration ramp would use to get to speed. If the acceleration distance was greater than half of the total distance to travel, I accelerate for only half the total travel distance and not worry about getting to max speed. Because I decided to use a symmetrical approach, the decel part took care of itself. The equations I utilised are essentially the ones posted by Chuck, although the addition of different acceleration and deceleration rates he uses gives me food for thought. Many, many thanks to all who contributed. AI: Well, for short runs, it should be obvious that you can skip the coast phase. As for the others, it's pretty simple. Maintain constant acceleration until you are halfway to the target, then decelerate until you reach the target. However, there's a catch (there always is, isn't there?). If you have misjudged the distance to the target, and it is closer than you think, then accelerating to your (erroneous) half-way point will mean that you will not be able to stop when you reach the real target point.
H: Problem with 74hc595 voltage in Autodesk Circuits I am very, very new to electronics, so please be patient with me, as I may say something silly. I also hope the question is not too wide, and would like to thank you in advance for spending your time reading it. Anyway, here goes: I am attempting to use a 74HC595 shift register to control a seven-segment display with Arduino using only three pins. I have used Autodesk Circuits to test the circuit before I build it. You can see the breadboard and the schematic in here, as well as the program I'm running: Schematic The display is common cathode. Before I added the 100-ohm resistor to the display's common ground, the simulation would tell me that the shift register would break, as: a) The current going through the power pins was too high (70ish mA when a max of 50 mA could be used). b) The voltage to the DS, STCP, and SHCP pins was too high as well (5V, the max being 2.2V) Oddly enough (to me at least! it may be obvious to someone more experienced than I) this would happen only for digits 1, 4, and 7. All others would display fine without anything blowing up. Now, my questions are: a) Why is it not enough to add resistors to each of the anodes? b) Can the circuit work the same with just a large enough resistor on the common cathode? c) Why does Autodesk Circuits say that the clock / latch pins in the shift register can only take 2.2V? The register's data sheet seems to indicate it can take up to 6V digital signal. And why would it be alright for digits 1, 4, and 7? And finally, Checking some diagrams online, I can see variations of essentially the same thing, such as this one (with no resistor to the common cathode), or even one in a robotics site with just two 220 ohm resistors to the two common pins only. Are all three ways of doing it (segments only, common pins only, both) correct? How exactly do they differ? Thanks again! And sorry for the long rant. I just began learning. AI: Those 220 ohm segment resistors are too small. Make them larger, and you can do away with the 100ohm cathode resistor. The HC595 package has a 70mA total limitation on the current in the ground and VCC pins. Although 220ohm gives you 15(ish)mA per segment, which is OK per output pin, the total number of segments is too much. You need to use a minimum of 330 ohm segment resistors, to get to less than 10mA per pin to meet the 70mA abs max limitation in the datasheet, or 470 ohms per segment to meet the 50mA limitation the simulator wants. The 50mA is a better max, as the 70mA is an absolute max spec, not a recommended current level. Unfortunately the cathode resistor is doing more than what you want, as the changing total current through the display will alter its voltage drop, and hence the brightness of the other segments. Don't use one at all. BTW, that's not a schematic you linked to, it's a picture. If you want higher response to your questions, learn the difference, and post a schematic next time. You can generate a schematic with the button above the edit post box (the one with the diode, capacitor, pencil and resistor).
H: Altium: Create custom pad I've got this T shaped pad that I've made with 2 fill rectangles. How do I assign a designator to it? I've tried converting to a region and couldn't figure it out that way either. I'm using AD10. Thanks. AI: Add a pad (can be a small one) and assign an Designator to it (e.g.: 3). When that structure is added to the PCB, the whole area will be connected to "3". Note that this only works for regions or fills (you'll need to delete any non-fill/region objects which you may have used to create your region --otherwise the non-fill/region objects (e.g. lines) will block you from routing to your pad, as they are not assigned a net when placed onto your PCB). You could also add multiple pads and assign "3" to each of them to form your T.
H: Maximize efficiency and brightness of diff color, cheap, 5m 5630 SMD LED strip lighting I'm a science teacher and we are going to explore different design/effects of grow-light setups this year in class. I've gotten some great ideas for this project from reading from this stackexchange site, thanks! I also see problems I hadn't even considered, double-thanks :-) For cost and brightness and versatility purposes I'll be buying the ~$10/5m strips of 5630 SMD LED's. But, there are issues of efficiency (current-controlling resistors wasting power) and unrealized brightness needing to be address and also here. First, in the question exploring why there was such a huge loss of energy with LED's that are energy efficient, it was explained that the blue and white LED strips might be up to 80% efficient, but red LED strips be only 45% efficient. Now, it's not the LED's 'fault', as I understood that discussion, but the circuit design. The strips (regrettably) used a consistent circuit design, regardless of the forward voltage of the LED's being used. The blue and white LED's have a 3-3.6 forward voltage and with 3 in a series meaning they will need anywhere from 9 to 10.8 of those volts, but the red LED's have 2-2.2 Vf so will only need 6 to 6.6 of those Volts. And, if one is using a 12 V power supply, there's a lot of 'pressure' that needs to be reduced with resistance. And as I understand it, the resistors 'waste' that energy. SO... I'm wondering, if I can match my power supply more closely to the demands of what each 3-LED module needs and then adjust the resistance to what it needs to be, I could substantially increase the efficiency of the strips. (I know, it's crazy, but remember, I have many students who would be happy to solder resistors in parallel on these strips!!!--a learning opportunity.) What do you think about this idea? Lots of these sites where I buy don't give the Vf specs of the individual 5630 LED's so how could I find that out? Relating to that question, how ought I decide at what current to drive these LED's (so as to be able to calculate the total resistance each module will need)? The discussion about why an LED strip was using less power than expected got me wondering if I should be driving the strips at a higher voltage than they recommend, for example 14.5 Volts to get the hoped-for brightness as given in that discussion. I know heat sinks and LED life relate to this, I'd really like to hear people's thoughts and recommendations on this, too. For those people interested, from discussions w/plant people I've had at the U of MN about this project, I'm going to suggest to my students to start out with a 3:2:1 ratio of red:warm white:blue LED's in their initial designs of plant-grow systems (though that is the ratio of lumens so depending on the comments on the preceding questions, this may not be the ratio of lights, themselves). EDIT to include new questions from comments: Do I need the data sheet to determine what the highest light value I can drive the LED at and still have it last a long life? Or, can I driving it up until it reaches some rule-of-thumb temp. Also, It seems that the closer one can match the voltage of the power supply to the sum of the Vf of the LED's, the smaller the resistor and therefore the less power wasted. Is that true? What margin of error should one calculate for? (BTW yes, each of the modules has 3 LED's and 1 resistor in parallel.) AI: Firstly, to find the Vf for the LEDs your best bet is to find a similar component from a major supplier (RS, Farnell etc.). I've found a 5630 Red LED from RS components, whilst this isn't 100% accurate it will give a you a relatively close starting point. A lot of these strips call for a 12V supply because it's simple and the majority of people using these strips don't put as much thought in as you have. If you wanted to keep the same brightness of the strips as when they first arrive then it's a relatively simple operation. simulate this circuit – Schematic created using CircuitLab Your strips may have a different setup to this (1 resistor per LED, less LEDs in series etc.) but the principle remains the same. To keep the same 'brightness' then the same current will need to be flowing through each branch of LEDs. Now I've just used 100mA based on the datasheet of the 5630 red LED I linked. To calculate the current flowing through your LED branch you need to find the total resistance per branch. Using datasheets to get an estimated voltage drop of the LEDs you can calculate how much voltage is being dropped across the resistor(s) and use Ohms Law to solve for I. The downside is, for maximum efficiency you will need a different power supply for your red LED strip and your blue/white LED strip. This is the case if you want the LED strips to have the same brightness that they arrived with, if you want to match the brightness of the different LED strips this will be a little more difficult without the original datasheets. Using the datasheet I linked we can see that the luminous intensity of the red LED is typically 4.2cd, if we want to match this to a green LED with a luminous intensity of 2.8cd we need to look in the datasheet of the red LED and find two graphs. Forward Current vs Forward Voltage and Luminous Intensity vs Forward Current. Using our example value of green being 2.8cd, our 4.2cd red LEDs luminous intensity needs to be at 66% of its current value (2.8 is 66% of 4.2). In the graphs from the datasheet, we can now calculate the forward current required to have the red LEDs luminous intensity at 2.8cd and also the forward voltage. Now that we know what the forward voltage of the LED required for 2.8cd we can adjust our first schematic accordingly simulate this circuit I may have gone a little bit off track at some points and rambled a bit too much but hopefully I've given you some sort of help. Edit in response to questions in comments: All of the voltage that is dropped across the resistor is essentially wastage. The closer to the voltage source to the combined Vf of the LEDs, the smaller the resistor required and therefore less power wastage. I completely missed this earlier, but thinking now it's become obvious. If you power the LED strip with 12V. Using a multimeter, measure the voltage across the resistor in the LED chain. You can then subtract this measured value from your 12V supply and figure out the combined Vf of the 3 LEDs. Then just divide this value by 3 to get an approximate average Vf per LED. In order to determine the 'highest light value' you will need to know what the maximum forward current is which unfortunately is in the datasheet. From other 5630's I've looked at they seem to all be around 150mA maximum forward current, unfortunately this might be a case of "Try 100mA, did it die? Try 150mA, did it die?". It's likely the supplier drives them well below their maximum value. In terms of margin of error to calculate for. A batch of LEDs will have varying Vf values, this is why I suggested finding the combined Vf for 3 and taking an average. I doubt there will be significant differences between the LEDs branches. In order to play it safe however, I'd always pick the standard resistor value that's above what you calculate, for example 44.43R you would use a 47R resistor.
H: How does pulse width modulation use ground I have a big missunderstanding about how pwm (ground) works. Does input and output of a PWM (including step-down dc2dc) share the same ground ? If so how can i have an input in 12V 50% duty cycle (6V output) that use like 1Amp . Then 6V * 1A = 6W but the 12V input will use 0.5 Amp to have same power . How can there be common ground if on output i have 1A and input 0.5 Amp. I tried to search google to better understand ground in PWM but everywhere i look it talks about duty cycle and stuff like that. Can someone make me understand GROUND use in PWM ? (+including step-down regulators that use PWM i think). Thank you very much. AI: I see your dilemma. The buck output stage will look something like this: - For simplicity I'm using the example of a synchronous buck regulator - this is equivalent to both MOSFETs being a kind of high frequency change over switch feeding a low pass filter formed by the L and the C. With no load connected, do you see that the average current from the incoming supply HAS to be zero amps? This is important to grasp so take some time to ponder this. To help you understand, the inductor is recharged with current when the switch is connected to 12V and that current is discharged to a negative value when the switch conects to ground: - Blue is the switching voltage fed to the left of the inductor and green is the current waveform through the inductor. It has to be this way because there are no power dissipating components connected to the switching node. When the switch reconnects to the incoming 12 V, the current flow from the 12 V is negative i.e. energy is being returned to the 12 V source. That current reduces in magnitude rising through the zero ampere point and reaches a positive maximum. After this point, the supply is disconnected and zero current is taken from that supply. Current (in red below) restarts at a negative value and the process repeats: - Basically, the incoming supply current (red) has an average value of zero amps. As I said earlier, it MUST be this way because there are no power dissipating components that could force an average DC current from the incoming 12 V. It's worth noting at this point that the output voltage (for a 50:50 duty cycle) will be 6V with a slight amount of ripple voltage. The ripple is due to the L and the C forming an imperfect low pass filter. A low value could be typically 20 mVp-p superimposed on the DC output of 6V. In effect, the 50% switching process, the inductor and the capacitor behave like an ideal step-down transformer; 12 V is converted to 6 V and, with no load connected, zero average current is taken from the incoming supply. When you do connect a 6 ohm load, 1 A DC flows into that load (ignore the slight bit of ripple, minimized to trivial amounts through sensible component selection) so, what happens to the inductor current.... Clearly, 1 amp DC has to flow through that inductor to feed the 6 ohm load and that will mean an inductor current that looks like this: - The lower half of the picture shows the current taken from the 12 V supply - it has exactly the same current as the inductor when the switch connects it to the inductor but, for the other 50% of the time, that current is zero. Hence, the average current taken is 0.5 amps.
H: Distinguishing clock domains in designs I am finding it confusing in defining various clock domains in the design. I did search over the Internet but I didn’t get a complete clarity on this. In a certain FPGA (Actel ProASIC series) based design, I am generating three clocks – 48MHz, 24MHz, and 12MHz from an 8MHz crystal input using a PLL. Further, using one of these 3 clocks (48/24/12) I have to generate 8MHz, 4MHz, 2MHz, and 1MHz clock signals for using in a few of the logic modules. My assumption is that since 48MHz, 24MHz and 12MHz are generated from the same PLL and are having a constant phase relationship, I can consider them as part of a single clock domain. And I can use a common reset signal synchronized w.r.t. 48MHz for resetting the flip-flops clocked by 48MHz, 24MHz or 12MHz. Is the above assumption correct? For the generation of 8MHz, 4MHz, 2MHz and 1MHz clock signals I am using free running counters clocked at 48MHz (I could have used 24MHz also for this purpose, but 12MHz required fractional division to generate 8MHz out of it). I am confused whether the generated clocks 8, 4, 2, and 1MHz can be considered to be in the same clock domain as 48MHz. What should be the general rule in differentiating various clock domains? Can I use the above mentioned reset signal for resetting the flip-flops clocked using 8, 4, 2, and 1MHz? Or should I generate separate reset signals for this purpose? AI: First part of the answer: Clocks coming from the same oscillator and produced in an internal PLL have a known phase relation. The tools know this and do check that transfers from one of these clocks to another do not end in a timing violation. Make sure that you have all appropriate constraints in the design and check output of the timing reports. Second part of the answer: Don't do it this way. The best way is to use a single clock - 48 MHz in your case. All other clock domains can be replaced by your 48 MHz clock and a clock enable signal. For example, the 12 MHz domain is using a clock enable signal that is high in every fourth 48 MHz clock cycle. This saves a lot of trouble with clock domain crossings and even saves resources.
H: Implementing Texas Instruments WEBENCH solution for Buck converter into exsisting PCB design I have used TI WEBENCH solution for buck converter design. I entered my requirements: input voltage 12 - 15V, output voltage 5V at 1.5A. I have choose TPS563219 which gives me efficiency of 95% and nice BOM cost. The reason I am using WEBENCH tool is that I am not familiar with buck converter design and the tool gives me PCB design as an output, which is really great. My question is, how to implement that design into my existing PCB? This is example output: the PCB is much larger that the design requires. May I reduce it? I need to implement this design into another, bigger PCB. Should I just copy it and merge the ground polygons? for VOUT, should I just add traces going out of the VOUT polygon and use that trace for powering the system? Does VOUT in that case really need that big polygon? The back of the PCB, does it require that big ground polygon or it may be populated with other components/traces? Does VIN also require polygon or it may be connected more closely to the switcher VIN pin(but using thick enough trace, of course) Thanks! AI: Rather than using the PCB layout from WEBENCH I would follow the layout guidelines found in the datasheet, and to a lesser the extent the layout used by the evaluation module. To answer your questions: the PCB is much larger that the design requires. May I reduce it? Yes. I have no idea why TI show it so large. Generally you should aim to keep all of the traces as short as possible, but the power traces connecting the inductor and the the input and output caps must be quite wide, or, better still, use small polygons to connect the components. I need to implement this design into another, bigger PCB. Should I just copy it and merge the ground polygons? No. Don't copy it, you can design a better layout. Whether you should merge the ground polygon with your system ground is debatable. I would do that, because I always want the ground to be as good as possible. Others may disagree and prefer to keep the grounds separate and only connect at one point. This may make sense if you have some very sensitive analog circuitry on the board. for VOUT, should I just add traces going out of the VOUT polygon and use that trace for powering the system? Does VOUT in that case really need that big polygon? The VOUT polygon doesn't need to be that big, look at the layout in the datasheet. However, you should still make it a small polygon rather than using thick traces, in order to keep the impedance down. The back of the PCB, does it require that big ground polygon or it may be populated with other components/traces? The back of the PCB must have a solid ground plane which extends under the entire switching regulator circuit. You should not place any other components, or run any other traces underneath it. Not only would this break up the ground plane and reduce its effectiveness, but the large currents flowing in the regulator would induce noise into the other traces. Does VIN also require polygon or it may be connected more closely to the switcher VIN pin(but using thick enough trace, of course) It doesn't need to be as big as TI have shown, but you should still use a small polygon to connect these components together.
H: Which kind of regulator/battery setup should I use for 5 volt microcontroller and transmitter circuitry for optimum performance? I have a project which uses microcontrollers and a radio transmitter, both running at 5 V. The circuitry consumes less than 1 mA from the 5 V rail when idle, and 1 A when transmitting data using the radio transmitter. The transmission phases do not happen often, as the device spends most of the time in idle mode, usually transmitting only once every 24 hours for a few seconds (maximum 20 seconds). Now I'm designing a battery input for the circuitry and I cannot decide whether to use 11 V battery packs (LiPo) with switching regulators, or LiFe batteries instead where I can get a low regulating voltage difference between input and output for the regulator (output of 6 to 7 V) and use a linear regulator with those lower voltage batteries. Which of these setups gives more efficient results for regulation circuitry in this kind of use? switching regulator with 11 V input, dropping the voltage down to 5 V; or a linear regulator at (mostly) low current and maximum of 2 V voltage drop over it? One of the main interests in addition to the battery life, is the simplicity of most linear regulators versus switching regulators, which reduces time spent on designing the product and saves space from the board. Switching regulators can also cause some radiation that might interfere with other circuitry and they are also more expensive. AI: Interesting question because I can see the answer going either way, depending on environmental circumstances. Some aspects of the design which may not be immediately obvious... 1) Switchers are notoriously poor at a tiny fraction of their load - they may consume several mA internally, or they may lose regulation and deliver 7V below some value, say 1% of rated load (10mA in your case) without special care in design. 2) One answer could be a linear regulator during sleep, (even from 11V but there's nothing wrong with a 2S Li-Ion - nominally 7.4V max 8.4V) and the MPU has to wake up a switcher before transmitting. If the linear regulator only supplies a few mA, you can probably find a SOT-23 to do the job, or SOIC-8 at the largest, so I don't believe size is the issue 3) A linear regulator for 1A will need some heatsinking even for 20 seconds ... if there's a convenient chunk of metal, use it. Linear may be more reliable from its simplicity. But what happens if the TX gets stuck "on"? Running the battery flat is one thing, destroying the equipment is another... . 4) I would not, personally, change battery technology simply as a way of tuning supply voltages. If you need lower fire hazard, or greater charge/discharge cycles, or some characteristic of LiFePO4 that's a reason for using them - otherwise stick with commodity batteries for economics and simpler servicing. .
H: Altium: Change part designator from Letters to numbers I am creating a new component with several parts in Altium Designer. When I place the component in a schematic page, each part get a unique letter like (IC10A, IC10B, IC10C ... etc). How to change these letters to numbers, like (IC101, IC102, IC103 ...etc) AI: You can do this via Tools -> Board Level Annotate. You will need to select $ComponentPrefix$GlobalIndex in the "Annotate Options" screen. However, this is uncommon for Altium and "Copy room format" might behave erratically, so I wouldn't recommend it. You can always set custom designators for your physical components. To do this, you will need to compile your schematic (c->r) and in the bottom of your schematic you will then see the name of your compiled sheet, eg. U_IO1, U_IO2, ... Switch to one specific sheet and then double click the designator. This will give you the "Physical Component Properties" screen where you can assign a designator manually as well. Again, not really recommended.
H: Using a lipo charger AND discharger at the same time I'm looking to use a li-po in my project, I can find many battery charge modules, and many 5v boost modules, is it possible to use them both at the same time? I'm not sure how I'd wire that though, power in would go to the charger, then the chargers power out would connect to the battery, would I ten splice the battery to connect to the 5v boost module? AI: Generally this is a bad idea. You can work it that way but it can cause problems for the charger. The charger will think that the current being used by your boost module is going into the battery. This may result in the charger changing the supplied voltage. I can't think of any way you could get into a dangerous situation but depending upon the difference between the charge current and the system power draw it would be quite easy cause the whole system to brown out, prevent the battery from fully charging or create very long charge times. Generally if you have external power connected then you want to run your system from that source directly rather than the huge efficiency hit of stepping it down to battery voltage and then back up to 5V. Exactly how is best to do this depends upon the input voltage you have and the 5V boost module you are using. Some have external power inputs, some have a shutdown input. If the one you have doesn't have either of those then what happens if it's output pin is at 5.1V? Does it effectively turn off or would it connect 5V to the battery and damage things?
H: How to modify the current of a battery both higher and lower From what I've come to understand, a higher voltage source leads to a higher current from source to the destination. Example: On a 1.5V battery let's say I'm getting 50mA load from my device rated for 25mA to 100mA. Question: I can use a resistor to lower the current but how can I make the current higher? How can I figure out the limits of current for any given power source? AI: I'll assume you're talking in the most general terms. If that's what you want, you should always talk about a "voltage source" rather than a battery, since batteries have some specific characteristics which will get in the way of your question. So, what you seem to be referring to is a circuit like this simulate this circuit – Schematic created using CircuitLab Since this is an ideal circuit, the ammeter has no resistance, and drops no voltage when it measures the current. Real ammeters do have resistance, and do drop voltage, but these are kept as small as possible. Also, you'll note that I've tied the negative lead of the voltage source to ground. This not absolutely necessary, but is custormary when discussing the operation of a circuit. It gives a reference point, which makes discussions clearer. Now, the current is .05 amps, and the voltage is 1.5 volts. What is the resistance? That's simple (for simple resistors). $$V = iR$$ That is, voltage equals current times resistance. This can be rewritten as $$R = V/i = 1.5/.05 = 30$$ Another way to rewrite the relationship is $$i = V/R$$ and this addresses your question. There are only two variables affecting current, V and R. So if you want to increase current, you have 3 choices: 1) You can increase V. If you double the voltage, you'll double the current. 2) You can decrease R. If you halve the resistance, you'll double the current. 3) You can do both. And you can do the math.
H: Pspice simulation ERROR I am trying to simulate this Photoplethysmography circuit in Pspice.But I am getting the following errors: ERROR -- Convergence problem in transient analysis at Time = .193 Time step = 296.9E-15, minimum allowable step size = 1.000E-12 I am trying to give a sine input and expecting a sine output. Is it possible to create a noisy signal in pspice and see the output. How do i visualize the filters. Thank You very much Anupam AI: Well I can't help you with the PSice error message but I can point out problems: - Pin 3 of U1A is not dc biased to any voltage reference - it will be just floating and this will certainly cause "real-life issues You won't get a sinewave through the opto-isolator the way you are driving it - driving the LED with a sinewave will mean that the LED only conducts on the positive half cycle. R3 is in series with the power feed to U1A and this looks problematic No decouplers on the op-amp power supplies. U2A's power rail seems to be cut Some spice sims can allow noise and, if you want to add it to a sinewave, use two generators (one for noise and one for the sinewave) and put them in series i.e. they become additive. Some sims allow "real noise" signals to be inputted via something called a "user list".
H: Charging process of a battery I apologize if my question seems ordinary and silly. Unfortunately, I have not good electronic knowledge. but the question is as follow: assume we have a power source like solar panels that produce power P. in other hand we have two batteries namely B1 and B2 with terminal voltages V1 and V2 correspondingly. What is the charging current of B1 or B2 if I decide assign power P to each of them. Are they obtained by $$I_1 = P/V_1$$ and $$I_2 = P/V_2$$ If s, then can we conclude that $$Q_1 = I_1*T$$ is more or less than $$Q_2 = I_2*T$$ In other words can we conclude that in one scenario we obtain more charge than the other one??? AI: No, you can't assume that a given solar panel delivers constant power. The power that it delivers depends on both the amount of light it is receiving and the load that it is connected to. Under full illumination, a given solar panel will produce a certain maximum open-circuit voltage. It can also deliver a certain maximum current into a short circuit. Since power is voltage times current, the maximum power will fall somewhere in between. Connecting batteries of different voltages directly to the panel will put it at different points on its "operating curve". The one with the lower voltage will generally get more charge (amp-hours) — but not necessarily more energy (watt-hours). But your oversimplified calculation is not the right way to estimate the difference. You'll need to have specific data for the panel and the batteries in question. A Maximum Power Point Tracker (MPPT) circuit is specifically designed to adapt a solar panel to a battery, varying the battery voltage (and current) so that all of the power available from the panel from moment to moment can be used.
H: how does this power supply work? I was reading the datasheet for the LT1161, and dicovered the below construction in an example application toward the end of the document (Page 11). It appeared to be powering some Logic ICs. This clearly seems to be clamping the supply voltage to something the logic IC can handle, so how does this work, and how is it better than just using a zener with a resistor? simulate this circuit – Schematic created using CircuitLab Context, lower left, click to enlarge: AI: This is quite easy. Remember that BE voltage of a bjt is around 0.6V when active. The Zener has a 5.6V drop. So, the zener sets the base voltage of the transistor to be 5.6V, this makes the Emitter voltage 5V. As long as the Zener is active and the BJT is active, the emitter voltage will be nearly 5V(depending on tolerances). This is regardless of all other conditions. So, regardless of whatever else the circuit is doing, we have a stable voltage point of 5V. We just need to make sure the zener is active and BJT is active, which requires setting R1 low enough(mainly for the BJT). The reason why it is better than just the zener, is that it has very little output impedance. The zener would be R1, by itself. With the BJT, it is much lower and can drive much larger loads, depending only on the BJT's current carrying capacity/internal resistance. One can add a cap to the base and ground to reduce any fluctuation further stabilizing the emitter voltage. The cap would be smaller than using the same on the emitter to stabilize. So, such sources are good because they provide a cheap(time, cost, real estate, etc) way to produce a different rail voltage with a low internal resistance. If one just used the zener and resistor, and the circuit required a large amount of power for some event, it would be under supplied creating anomalous behavior.
H: What size MOSFET do i need to drive about 6A 12V load? Will small TSOP6 package do the job without overheating? What size MOSFET do i need to drive about 6A 12V load? Will small TSOP6 package do the job without overheating? I was thinking of using this one: http://www.tme.eu/en/details/irlts6342trpbf/smd-n-channel-transistors/infineon-irf/ to PWM leds drawing about 6A, says that it can handle 8.3A but I'm worried about heating. AI: Running the numbers: Power = I^2 x R. With a resistance of 0.022 ohms and 6 amps of load, you get 0.792 watts of power dissipation. At this point, you consult the datasheet to determine the junction to ambient temperature rise, in terms of degrees/watt. For this part, it's a maximum of 62.5 C/W. Multiply that by the power dissipation we found out above, and you get ~50C. So, you're looking at about a 50C rise, which puts your part in the 70C range. That's OK. It's probably fine. The only thing to watch out: at 70C, the current rating is not 8.3A, but 6.7A. So you don't have a lot of headroom. EDIT: As Brian Dohler correctly points out, you will be PWMing the MOSFET, which causes switching losses and will increase the temp above what I stated here. So you may need a heatsink. On those little packages, they are meant to be attached to a heavy PCB by a bottom pad (if you flip them over, they're shiny), which will act like a heatsink. As this pad is often inaccessible, you could consider mounting something to the plastic top of the chip. While the plastic is not a good thermal conductor, it beats nothing, and you don't need a lot of heatsinking in any case.
H: 3x3 LED grid using NPN transistors to switch (Arduino) I am trying to design a basic project to multiplex a 3x3 LED grid in a common anode arrangement. In order to avoid sinking (sourcing?) too much current from the digital I/O pins of the Arduino I would like to uses NPN transistors as a low-side switch for each column. I understand the case where I use a transistor to switch a single LED with the anode connected to Vs. However, I am having difficulty in designing the circuit for the multiplexed approach. As my circuit stands I can't understand how to to wire it to source current from Vs and using I/O to control the flow. Any pointers would be much appreciated. AI: To source from Vs or the positive supply (I'm assuming 5V), you could connect it to the GPIO, where a logic High would be the V+ of the microcontroller, or you could connect it to PNP transistors. The PNP base would then be connected to GPIO instead, like the npn transistors are.
H: How can I make connection on pcb (circuit board) holes without solder (for prototyping)? I have a Pro Micro board (very small -- see pic below) and it has connector holes in the printed circuit board. Best Non-Solder Connection (Easy and Removable) I'm wondering the best way to make non-solder connections for doing my prototype work. By best, I mean easily removable while maintaining solid electrical connection. Are there pre-made connectors for this type of connection? What Part Is Most Conductive / Best Electrical Connection? Also, how can I know I have a good connection? Is it the inside of the hole that has the conductive metal, outside of hole? Front / Back Separate Traces? And, are the front and back of the holes electrically connected normally or do they have separate traces normally? One Idea: Would It work Very Well? What if I had header pins pushed into a breadboard and then up through those holes? Then I connect my wire to the top of the header pin? Would it be a solid enough connection? Or would it not make enough electrical connection? ie - would header pins make connection inside of holes and would that be enough electrical connection? Edit -- I Wish They Made Banana Plugs That Fit This Wouldn't it be cool if you could use a banana plug type of connector. Then just plug in each one and put wire in hole and clamp it down? UPDATE 11-11-2017 Interesting that in the time since I've posted this someone came up with a solution similar to what I was thinking with banana plugs: Hammer Header Male - Solderless Raspberry Pi Connector It's really for use on a RPi Zero but it's the type of snap-on header I was interested in at the time. However, the installation is not easy so it may not be practical. Take a look at what you have to do to install it : https://learn.pimoroni.com/tutorial/sandyj/fitting-hammer-headers Probably easier to just solder on the header pins. Update 2 - Dec. 10, 2021 I just saw the following on Twitter & just thought I'd update it here. This is for 1mm holes. Someone replied and showed that there is now a product someone is releasing that attempts to solve this: AI: Use grabber test clips, which are basically like smaller alligator type clips. Though regular alligator/crocodile clips may work, depending on the size or how many side by side ones you need. I have some really mini ones. Yes, the pads should be plated on the inside as well as the top and bottom, electrically connecting them. No, just pushing a standard 0.1" header into the hole won't work. They are not offset holes, or push fit tight. They are generously loose. Some people have used rubber bands but that's not very secure.
H: Current draw of through hole LEDs and LED strips I'm confused about led current draw, my understanding of through hole LEDs was that whatever current is going through one, is going through the others. By that I mean if I had 3 1.5v 20mA LEDs I would only require a 4.5v supply with 20mA output. So the reason I'm confused is that I read my led strip requires .4A per meter... What does that even mean, do I need a whole amp for 2 meters now? My application is in actuality driving 1 meter strip of rgb LEDs. So what current output would I need per channel on an led driver chip? 400mA I suppose...? AI: You're totally right that you have the same current running through every LED when they're connected in series. Your confusion comes from not knowing how the typical LED strip is constructed. I have drawn one possible construction here: simulate this circuit – Schematic created using CircuitLab Each LED in the first column will draw I1 amperes, each LED in the second column will draw I2 amperes, etc. The longer your LED strip is, the more "columns" it will have. Thanks to Kirchhoff's current law, the individual currents will be added together to form I0 in my schematic. That's your total current. They could have constructed it as one long series-connected chain. For a LED strip with 200 white LEDs you would need to feed this with about 600 volts. This is completely unpractical, even if the amount of current is low.
H: PIC18F452 timer0 not accurate I am simulating a project on Proteus simulation software using this microcontroller. My issue is, I have made a 2 sec interrupt on timer0. But simulation is showing it as tooo fast (w.r.t simulation clock). I used the Mikroelectronica Timer calculator using these settings: The simulation schematic is as follows: I am using MikroC pro for PIC compiler. And yes, I have double-checked the Clock frequency in the compiler, of the quartz crystal and the MCU in proteus, all are 4 MHz. I have set the crystal as XT in the compiler as well. What could be the reason behind this inaccurate timer? The code I'm using is as shown below: int toggle1 = 0; int toggle2 = 0; int toggle3 = 0; int toggle4 = 0; void InitTimer0(){ T0CON = 0x84; TMR0H = 0x0B; TMR0L = 0xDC; TMR0IF_bit = 0; TMR0IE_bit = 1; } void Interrupt() { if (INT0IF_bit && INT0IE_bit) { INT0IF_bit = 0; if(toggle1 == 0){ LATC0_bit = 1; LATC2_bit = 0; toggle1 = 1; INTEDG0_bit = 1; // Interrupt on rising edge on RB0 } else{ LATC0_bit = 0; toggle1 = 0; INTEDG0_bit = 0; // Interrupt on falling edge on RB0 } } if (INT2IF_bit && INT2IE_bit) { INT2IF_bit = 0; if(toggle2 == 0){ LATC3_bit = 1; LATC2_bit = 0; toggle2 = 1; INTEDG2_bit = 1; // Interrupt on rising edge on RB0 } else{ LATC3_bit = 0; toggle2 = 0; INTEDG2_bit = 0; // Interrupt on falling edge on RB0 } } if (INT1IF_bit && INT1IE_bit) { INT1IF_bit = 0; if(toggle3 == 0){ LATC0_bit = 1; LATC2_bit = 0; toggle3 = 1; INTEDG1_bit = 1; // Interrupt on rising edge on RB0 } else{ TMR0IE_bit = 1; toggle3 = 0; INTEDG1_bit = 0; // Interrupt on falling edge on RB0 delay_ms(500); LATC0_bit = 0; } } if (TMR0IF_bit){ TMR0H = 0x0B; TMR0L = 0xDC; if(toggle1 == 0 && toggle3 == 0) LATC2_bit = 0; if(toggle4 == 0){ LATC4_bit = 1; toggle4 = 1; } else{ LATC4_bit = 0; toggle4 = 0; } } } void main() { ADCON1 = 0x07; // All digital I/O RBPU_bit = 0; TRISB = 0xFF; // Set PB0 as input TRISC = 0x00; // Set PortD as output PORTC = 0x00; // Starting value for PortD INTEDG0_bit = 0; // Interrupt on falling edge on RB0 INTEDG1_bit = 0; // Interrupt on falling edge on RB1 INTEDG2_bit = 0; // Interrupt on falling edge on RB2 INT0IF_bit = 0; // Clear INT0IF INT0IE_bit = 1; // turn OFF interrupt on INT0 INT1IF_bit = 0; // Clear INT1IF INT1IE_bit = 1; // turn OFF interrupt on INT1 INT2IF_bit = 0; // Clear INT2IF INT2IE_bit = 1; // turn OFF interrupt on INT2 InitTimer0(); GIE_bit = 1; // enable GIE while(1){} } AI: Probably because you're not clearing the Timer0 Interrupt Flag in your interrupt handler. You need to have a TMR0IF_bit = 0; otherwise your code will just stay stuck in the interrupt, repeating it over and over.
H: Replicating Lidar lite what emitter to use? So, I am not advocating or trying to copy or in any way infringe on the copyright that Lidar lite is based on. That being said I would like to use something like lidar lite for a distance sensing project (Basically an rc self driving). Now I haven't found any sensors that really are in my price range, less than 100 dollars, so I was thinking I could maybe home brew together something that is at least partially functional. But Lidar lite is no longer available and there isn't really a lot of info on how to do something like that. What research can I look into to make something like it. I have been experimenting with some ir emitters and receivers but haven't had any really good results. I also know that frequency modulation is a good idea since it will give the lidar a unique signature. But past that I am not really sure what to build. Is this way out of the realm of possibility or can it be done? My main question is what IR emitter to use in order to determine the distance of an object at least 40 metres away outside. AI: First, there is no worry about recreating a commercially available product if it is for your own use, and not part of a business enterprise. Furthermore, if Lidar Lite is no longer available the company clearly is not going to come after you, and there is no reason in the world not to use their ideas for your own enjoyment. There is no simple answer to your question. A laser is the obvious choice for the emitter, and a silicon photodiode for the receiver. However, the laser is favored primarily because it's relatively easy to produce a small beam. If you're willing to spend more effort on optics, an LED is certainly possible. Since you're obviously not very experienced, I'd recommend one of two approaches. At 40 meters, round trip for light is about 260 nsec. Call it 300 to give yourself some leeway. If you want to operate at longer ranges, assume a longer delay, but for now let's go with 300 nsec. A square wave at 3.3 MHz will have a 300 nsec period, so use half that frequency, or 1.65 MHz. What you want to do is exclusive OR the transmit and receive signals, and analyze the result. Alternatively, you can do what the commercial rangefinders do. Invert the receive signal and use it to drive the transmitter. The result (assuming you have adequate signal-to-noise) will be a square wave with period proportional to distance. Either approach will work, although you haven't specified your minimum range, and the second approach will not work well at close range due to the high frequencies involved. I suggest you read this Lidar Lite paper and pay attention to things like the bandpass filter they use. If you're going to be using your unit in sunlight, be aware that you need a very narrow filter to avoid your detector getting saturated. If you avoid the correlation technique Lidar light used you'll work at much lower frequencies although you'll need to be careful to get fine resolution. You haven't specified your requirements, but presumably at 40 meters you're not interested in very fine measurements. You clearly have a great deal of learning and experience waiting for you. Good luck.
H: Why does this UK mains plug have a gap going down the live pin? What is the purpose of the gap on the live pin of this plug? I've never seen this before and was why this gap was their since the plug is only for an alarm clock. The gap goes down the middle of the live pin to half way down the pin the pictures below show the plug. AI: The live pin has a gap because the part on the other side of the plastic forms the fuse clip. The gap will have no affect on the current-carrying capacity of the pin, but the two parts on either side of the gap form the fuse clip as your photo shows very nicely. Clever design.
H: How to make the AC current coming from the wall the backup for a battery powered circuit I want to design a circuit where its main power supply is a battery. I want this circuit to be connected also to AC current coming from the wall. Assume that the power supplies a light bulb where i can modify the intensity of the light. Now the battery has a maximum amount of power that it can deliver. I want to use the AC current as a backup for this battery when the bulb is trying to get more power than the battery can provide or when the battery dies out. Please keep in mind that the battery cannot in any way send power to the wall and the AC current cannot be allowed to send power to the light bulb without passing the previously mentioned conditions. I've googled this for a while but unfortunately all i could find was curcuits for a battery as a backup for when the AC current goes out completely. Thanks. AI: You don't give enough detail in your question about any 'smarts' the changeover system should employ, so I'm assuming that it's simply exhaustion of the battery causing its voltage to drop that should make the changeover. Consider the simple circuit below. Two power supplies have different voltages, and are connected by diodes. The higher voltage supply will feed the load, no current will be drawn from the lower voltage supply. Note that in this crude switch, the load voltage will be roughly 0.7v less than the serving supply. You don't give any detail of the currents to be used, so I'm going to leave the schematic with the default 1N4148's that are OK to 10s of mA. If you want 2A, then you'll need something like 1N540x diodes. simulate this circuit – Schematic created using CircuitLab Let's say you want to protect a 4 cell NimH battery from exhaustion, and you'd like to be supporting it at 1.1v per cell, so at 4.4v on the battery. Your wall power supply should drive a regulator with an output of 4.4v. At the nominal battery output of 4.8v, all the supply will come from the battery, and this will still be the case when the battery voltage has dropped to 4.5v on load. At 4.4v output, 50% of the supply will come from battery, and 50% from the wall. By the time the battery gets to 4.3v, all of the current will be supplied from the wall. Of course if one supply disappears totally, then the other supply will pick up. This is usually the wall supply going, with the backup battery picking up, the type of diagrams you've been finding in your search.
H: Solving 5 variables Karnaugh map - grouping I would like to ask about solving Karnaugh maps, especially grouping 5-variables map. I am not sure if I made this good way, so if you could, please let me know what is wrong. It seems to me everything is fine. Is there any good Karnaugh map solver which work with 5 variables as well? Here is the map: AI: This answer is correct ? Your answer is NOT correct; This is not the proper way to group a 5 variables K-map Lets first look why a K-map is not practical for functions with more than 4 variables The way the K-Map works is by grouping the numbers that their binary representation has a Hamming distance = 1 [Only 1 bit difference] In the image you posted This doesnt seem like the only way to arrange the values of inputs C,D,E since '011' is not next to '111'. We cant put all the values of a HD=1 of 3-bits on a line [1-D] Having 2-bits guarantees that you can arrange the values of the 2 inputs in a 1-D [Line] such that all the binary values are surrounded by all the other values of hamming distance = 1 bit, but more than 2 bits require a 2-D or more in order to make sure that all the binary values are surrounded by all the possible values of a hamming distance = 1 bit Thats why the way you are taking the groups is not correct You might want to check This PDF What is the correct answer? According to my Python script which uses Quine–McCluskey algorithm, the correct answer is What tools can i use to solve K-Map or to reduce a Boolean equation You can use my python script i provided above [Its a terrible code BUT works] You can use This tool to solve up to 8 variables K-Map You can use Logic Friday
H: TI Design Equation Syntax Question Have been reviewing the TI Designs – Precision: Verified Design - 1 MHz, Single-Supply, Photodiode Amplifier Reference Design. In one of the equations (See embedded graphic below), there is a syntax that I have not seen before: (R2||R3) It looks like the result is close to the modulus 13700 mod 280 (result 260) but when I work backwards, I get 1/(2*pi*1/1e6 * 274.3902) == 580.028Hz so it isnt the modulus. Does anyone know what specifically it is? AI: That means the Parallel combination of R2 and R3, or R2*R3/(R2+R3)
H: How to bias a diode clamp with a voltage divider? As you know a diode clamp is a circuit to protect sensitive circuits from excessive voltage. One approach to change clamping level is to use voltage dividers. most resources and textbooks represent a schematic like this: and in case that diode is silicon, they compute maximum output voltage this equation: $$ V_{out} = \frac{R_2}{R_1 + R_2}V_{dc} + 0.7\space(volts) $$ as I understand we are permitted to use such equation only if Rs is very large relative to R1 and R2. I tried to design diode clamp that limits output voltage up to 2.7 Volts. I used two approachs. first approach is this : and another one is this : Both approach have same result, but i want to know which one is more practical and reliable? AI: Let's start by analyzing your third circuit (the first is just a generalized concept, and the second makes no sense at all). R2 and R3 form a voltage divider. The output is (20 Ω)/(50 Ω) = 0.4 of the input. Since the input is 5 V, the output is 2 V. That's what the cathode of D1 will be at when D1 is not conducting. At this point, remember what Thevenin said and realize this is just a 2 V source with 12 Ω impedance. Let's say the forward drop of D1 is 700 mv. That means D1 starts to conduct when its anode, which is also Vout, is 2.7 V. If we make the simplifying assumption that the diode is a fixed 700 mV voltage source when on, then its anode looks like a 2.7 V 12 Ω source when Vout is 2.7 V or above. Any part of V1 above 2.7 V will be attenuated by the 5 kΩ and 12 Ω voltage divider, which has a gain of (12 Ω)/(5012 Ω) = 0.00239. For example, when V1 goes to 3.7 V, the part above 2.7 V will result in only 2.39 mV rise. Vin of 3.7 V therefore results in Vout of 2.704 V. So yes, this circuit can be considered a clamp, since it greatly attenuates voltages above a certain level. However, in most cases these circuit are not desirable. You are spending a lot of power to make the 2 V 12 Ω voltage source. The total current thru R2 and R3 even when not clamping is (5 V)/(50 Ω) = 100 mA. That is unacceptably large in many circumstances. R2 will dissipate 300 mW and R3 will dissipate 200 mW. That rules out ordinary 0805 resistors. R2 can't even be a "1/4 W" resistor, and that would be cutting it close for R3. Here is a better way to make a clamp using a similar concept: The basic difference is that the diode is replaced by a transistor. In this case, think of the transistor as a diode with gain. Current will flow thru the E-B junction like it did the diode before. However, for every one unit of current flowing out the base, there will be gain units of current flowing out the collector. The clamping current draining Vout is the total, but the voltage divider is only loaded with the much smaller base current. In this example, R2 and R3 are 10x higher. That means they require 10x less current from V1, but also that they have 10x more impedance. However, due to the gain of Q1, the apparent impedance at the emitter is gain+1 times lower than the impedance at the base. Therefore, the transistor only needs to have a gain of 9 for this to clamp the same as your circuit, but with 10x less V1 current. Small signal transistor gains can be over 100, so in reality the resistors can be increased further and still perform as well as your circuit, but with much less quiescent current. In a real circuit, I'd add a cap across R3. That makes the clamp even lower impedance for short term spikes.
H: LDO outputting low voltage. LDO or auxiliary components fault? I burned a circuit by applying reversed polarity voltage. I measured the LDO that is supplied with 5 V and should output 3.3 V, however it only outputs ~2 V. Now what can I deduce from that? I would expect the semiconductor LDO to not output anything after being burned, however it does. Could this mean that some of the auxiliary components (capacitors) are blown? LDO in question is a XC6201P332 (datasheet) AI: I measured the LDO that is supplied with 5V and should output 3.3V, however it only outputs ~2V. I have seen voltage regulators which produced a different (out-of-specification) voltage, after a reverse voltage input. Therefore based on experience, your ~2 V output could mean that the regulator has been damaged. I would expect the Semiconductor LDO to not output anything after being burned Electronics does not always "completely fail"; there are many partial failures which can also occur. Therefore I would not expect the same as you. Could this mean that some of the auxiliary components (capacitors) are blown? Capacitor damage is also possible, especially if there were any polarised capacitors (e.g. tantalum, which may even catch fire under reverse voltage conditions) on the regulator's input. You didn't supply a schematic (and ideally BOM or component ratings/types, if not on the schematic), so it is impossible to be more specific. Close-up photos of the relevant components may also be helpful, in case they show any signs of overheating. In summary: The regulator could have been partially damaged, which would fit with your result. Any other polarised device (e.g. capacitor) which was exposed to the reversed voltage, might also have been damaged.
H: What is the best way to receive unsolicited response from GSM SIM900 in PIC18 I am using PIC18F2520 and trying to communicate with GSM SIM900. I am using UART interrupt to receive data from the GSM. I am saving each byte in rxData. Now most of the commands ends with response OK. But there are few commands which does not respond with OK like when we receive sms notification from GSM, GSM send following notification +CMTI: "SM",2 Now this response doesn't have any OK. How to receive data in this case. In my application I need to check for the received sms. I am using following code: void rx_handler(void) { rxData[index] = ReadUSART(); if(<some condition>) //condition to check for sms notification { rxFlag = 1; //set flag to process it in main loop } index++; PIR1bits.RCIF==0; } I am getting confused on how to check for the sms notification. Till now for other commands, I was setting condition for OK but this doesnt have any OK response. Please help. AI: Thanks to @Bence Kaulics & @m.Alin. I have solved the issue by double checking the \r \n. Following is the code I used: volatile int flag = -1; volatile int sFlag = 0; volatile int uFlag = 0; void rx_handler(void) { rxData[index] = ReadUSART(); if(rxData[index]=='\n' && rxData[index-1]== '\r' ) { flag = flag + 1; if(flag == 1) { sFlag = 1; } } } index++; PIR1bits.RCIF==0; } I have used a flag = -1. So when I first got \r \n value of flag is 0. And again when I got \r \n that means we have detected a line end and this is what we are expecting so set sFlag = 1. When sFlag = 1 that means we have received the data and now we can process it.
H: Is there a VHDL (or Quartus2-specific) compiler directive for disregarding certain lines of code for synthesis? Is there a VHDL (or Quartus2-specific) compiler directive for disregarding certain lines of code for synthesis? I want to have certain signals going out for my simulation, but Quartus2 throws errors about insufficient numbers of IC pins, and besides it would be more correct to not have them in the synthesized design. AI: You can use the translate_on and translate_off compiler directives. Generally they are compiler specific and not a part of VHDL standard, but similar directives present in all major compilers. See also this SO question.
H: Can/Should DC-AC Inverter Be Used To Power Inductive Loads (AC Motor)? Trying to make an inverter (or buy), to power a 120VAC motor using a 12V lead acid battery. However, after many hours of searching it seems that inverters are not intended to operate on inductive loads such as multi-phase motors. Why is this the case? AI: ... after many hours of searching it seems that inverters are not intended to operate on inductive loads such as multi-phase motors. Why is this the case? It's not. Fortunately. While motors present some challenges compared to eg purely resistive loads, they are not especially difficult to drive and it is common to use inverters for this purpose where the use is warranted. The main application area is the variable speed operation of conventional mains operated induction motors - which are usually fixed speed devices when conventionally driven. Many AC motor driving inverters are available - either from AC mains - to DC bus - to AC out, or from low voltage DC - to HV DC - to AC out (less common). The main target is 3 phase induction motors as these are industry standard, low cost per power out compared to most alternatives and make good use of existing power supply infrastructure. Single phase versions exist (I have several) and many (but not all) 3 phase drives can be used for single phase motors. A 1 phase motor still needs a 2 phase drive as both leads need to be able to be driven above and below the sine wave midpoint (or a bipolar supply with high and low side switches is needed - which is essentially the same requirement). So, unless 1 phase motor is an essential requirement a 1 phase inverter is generally less attractive than providing a 3 phase inverter and motor. 3 phase motors "work properly" as induction motors whereas 1 phase induction motors are a compromise as there is no 'true' rotating magnetic field to follow and this must be provided by the motor design. A block diagram of a typical circuit is shown below. Input at left is here from fixed frequency mains AC, but could be DC or AC from an inverter. A suitable "high" voltage bus is formed at a voltage somewhat above the peak AC voltage to be supplied. About eg > 330 VDC for 230 VAC out and > 400 VDC for 3 phase 230 VAC. 3 pairs of electronic switches rebuild a PWM waveform which can be filtered to give (here 3 phase) sinewave at variable frequency. Motor connections shown for 3-phase (star connected) motor and single phase motor. Bus voltage can be lower for 1 phase and for delta-connected 3-phase than for star-connected 3-phase but does not have to be. ________________________________________________ Here is how PWM can be used to make one AC phase. The waveform at top of image shows a PWM waveform chopping a high voltage supply. Here bipolar supplies are shown with negative OR positive PWM relative to center ground BUT unipolar rail to rail PWM can be used to provide any voltage from one rail to the other. The lower waveform shows the resultant poorly filtered sinewave.
H: Identifying unknown transformer from a computer PSU I was recently using an old 375 watt PSU as a benchtop power supply and managed to break it trying to disable the short circuit/overvoltage/undervoltage protection. Meh. Anyway, naturally I took it apart and started desoldering the components. I pulled a transformer out that was mounted to the board with screws with 3 wires coming out and being soldered to the board elsewhere. The transformer had a sticker on it that reads on 2 lines "37-C6371104 ROHS HP OK/0706 SC REV.B" I did a quick google for the hyphenated number but didn't come up with anything. It was taped up with yellow tape and under the first layer was some thin copper foil wrapped around in a single layer, under that was the coils and iron core. There are 3 wires, blue, black, and white. It looks like the blue and white wire goes to one of the coils and the black wire goes to the other, which confuses me. I'm trying to identify the rating of it and I'm nervous to just hook it up to 120VAC and use a multimeter. If anyone could help me figure it out, that'd be awesome. I can take a picture of it if that would help. Hopefully someone can shed some light and thanks in advance! AI: Based on your description, chances are that it is a filter inductor to keep the high frequency switching noise from backing up into the power mains. Of course each winding has at least TWO ends, so there is a fourth "wire" somewhere. Perhaps one of the pins that was soldered to the PC board? Like virtually ALL switch-mode power-supplies (SMPS) the transformers and inductors are FULL CUSTOM parts designed and manufactured specifically for THAT model of power supply. You will not find any information on the inductors because they were never sold on the general market. They were OEM custom parts. ABSOLUTELY NOT RECOMMENDED to connect this to the power mains until you understand A LOT MORE about what it is and how it works.
H: What is this yellow thing on the board? I bought this board a while back: (source: seeedstudio.com) http://www.seeedstudio.com/wiki/GPRS_Shield_V1.0 I mistakenly connected positive and negative instead of each other and the yellowish thing near the power select on the board (477 j / 110 m 3) fired literally and fell off. When I correct it, it works fine. My questions are: What is that part name and use on the board? Is it some kind of fuse? Can I just replace it? Is it necessary? The board works fine without it. The firing keeps me thinking, is it safe to put it in the car? Is it possible that fires up again? AI: The component you're describing is a tantalum capacitor. Read more here. It works like a regular (e.g. electrolytic) cap, probably in this circuit its function is to make the power supplied to the device "cleaner", as the GPRS module may draw lots of current in short bursts, so the capacitor acts like a short-term power reservoir. The tantalum caps allow for much more capacitance per unit of volume than electrolytic ones, but they're notorious for their narrow voltage tolerances and a spectacular thermal failure mode, which you've witnessed. Basically if you abuse them they burst into flames, sometimes sending small pieces of flaming material into the air. It's much better for the board you if you replace it with a working one. As per the general safety question, the technology of tantalum caps is safe enough to put them in nearly all mobile phones nowadays (as phones are too small to allow for an electrolytic cap). But in the hobbyist setting there have been cases of exploding products due to poor circuit design. Most famously and Arduino GPRS or GPS Shield (the official, branded one) designs from a few years ago had a lot of exploding specimen.
H: Are there standard dimensions for probes? I have a probe card with cantilever probes, from a manufacturer that no longer exists. I need to know the lengths and vertical angles of the probes, and ideally the lengths of the tips. Since probes are very fragile, I would like to avoid measuring them myself and certainly destroying the tip. Are there any standard sizes for probes that I can reasonably assume apply to the ones I have? AI: Probe-card probes are not standard. They are custom made for the particular probe-card vendor. Furthermore, they are custom-assembled and typically custom-potted into an epoxy ring to tightly control their position and alignment. So even if you could get individual probe wires, they are not replaceable on a probe-card. There are SOME kinds of probe cards made with ceramic or metal "probes" that are soldered onto the card. That kind MAY be replacable, but proper positioning and alignment typically require very specialized equipment and skills. For those who don't know, probe cards are used to contact dice on a wafer for testing of individual integrated circuits while they are still on the wafer.
H: Why does the gain of a RC filter vary with input amplitude in LTspice? I recently design an OTA based filter, and simulate it with LTspice IV. I was surprised to see that the gain vary with frequency (of course) but also with the input amplitude of the signal. So I decided to simulate a basic RC filter to see how if the gain change with input amplitude, and the same thing happened. Here is the schematic, with a variable AC amplitude (0.1, 0.2, 0.5, 1) : And here is the plot : I don't understand, the frequency response of a filter characterized by a transfert function V(out)/V(in) should vary only with frequency, and not with V(in), isn't it? AI: If you measure V(V1) you will see that said node will also drop in amplitude, and of course remains constant over the frequency sweep being an ideal AC voltage source. Therefore the simulation is correct. The graph you've posted in the question is actually not the transfer function V(out)/V(in); it is just the absolute output amplitude. Unfortunately LtSpice does not explicitly say the units are dBV. To display the transfer function, you can e.g. measure V(out) and then right click the label (on top) in the graph. This opens a dialog that allows you to edit the line formula and color. You can than change it to: V(out)/V(V1) This should show the result you were expecting.
H: Audio playback design issues with WM8731 I am using WM8731 Audio Codec taking hints from the Audio Board PROTO with a 1 W Audio Power Amplifier LM4889 to drive a speaker from CUI INC: CDS-13138-SMT. The setup works but not as expected. I am using the recommended circuitry given in LM4889 Datasheet for high gain amplifier. My application requires a speaker to output frequencies in 17 to 20 KHz. But when I pass a wave audio of pure 19 KHz(from here) to it, the speaker outputs a frequency at around 9KHz and 15 KHz.(Why?) The playback is slow too.(I tried playing a song. It ran in slow motion)(can't understand Why?) (I am using Spectrum Analyzer. It shows the two peaks at 9 and 15). The whole setup is interfaced with Raspberry Pi through I2S. I don't have much experience with audio applications. Is my approach wrong? Am I using a wrong speaker for my application? Can anyone provide any alternative? What all can be improved in the design? I am sorry if I come across as a complete noob. Thank you. AI: This sounds like a software issue of the I2S bus on the Raspberry PI. In these cases I would be very tempted to break out the scope to probe the BCLK and DACLRC lines of the DAC board. The LRCLK signal should tell you the sampling frequency of the DAC. It could be the audio sounds like lower/higher pitch or distorted, because an incorrect sample frequency is used. Also make sure the BCLK is correct. You can verify that by looking at the bit depth of the DAC and the sample frequency. The product of these 2 should give you the BCLK frequency. It seems like the WM8731 is pretty flexible in the audio format it accepts. You should be able to send it 48kHz 16 or 24-bit I2S data without any issues. Make sure your RPi software is configured to output those exact settings to the DAC. Maybe the software is still configured to 44100Hz. I am not sure if this DAC supports that sample frequency (because it does not fit nicely between 8, 16, 24, 48, 96 kHz)
H: Making a LiPo battery charger from USB +5V supply My friend's drone battery charger is dead. I want a charger for battery, only problem is that I don't know how to do it. I tried to make one using voltage divider, but I don't know to to do all the calculations. Here are the specifications that I need: Input is USB(5v) and at the output I need 4.2V 400mA. The battery is LiPo 3.9v 390mAh 1.44w. I don't have any advanced transistors or voltage limiters at my disposal, and the closest electronics shop is pretty far away. I would order one from ebay, but it takes more then a month to get to me. So if any one can help me, I would be very thankful! Oh, and about that voltage divider, I can get 4.2V at output, but I don't know to to calculate current flow, so I get small current at output, and I'm having heat problems with R1. I think I used 10 Ohm for R1, and 52 Ohm for R2. AI: The charging requirements for a Lipo battery are pretty simple:- Current must be limited to the maximum rate specified for that battery, usually ~1C which is the same as the battery's capacity (390mA in your case). Voltage must be limited to a maximum of 4.2V per cell, by reducing the charging current when the voltage reaches 4.2V. You don't need a fancy charge controller to do this. Just limit the current with a resistor in series, and monitor the battery voltage during charging. Stop charging when it reaches 4.2V. This will get about 80% charge into the battery - enough to fly the drone. If you limit current to less than 1C then the battery will get more charge by the time it reaches 4.2V, but take longer to do so. WARNING: you must not let the battery voltage go above 4.2V, or it will explode and set fire to everything around it! This is why a lipo charge controller is mandatory. If you do it manually then you are the charge controller, and it is your fault if the battery explodes. So what resistor value do you need? During charging the battery voltage will raise from ~3.7V to 4.2V. The resistor must drop the difference between the battery voltage and the power supply voltage. So 5V - 3.7V = 1.3V, / 0.39A = 3.3&ohm;. As the voltage rises to 4.2V the current will reduce to 5V-4.2V = 0.8V, / 3.3&ohm; = 0.24A. But perhaps you only have a 10&ohm; resistor? In that case the charging current will vary from 130mA to 80mA, and the battery will take about 4 hours to charge. During this time you must regularly check the voltage to make sure it doesn't go above 4.2V - or the battery will explode! Now you see the advantage of using a proper lipo charge controller.
H: Is circuit elements' placement order in a series connection matters? I know the current is the same in a series branch. But does it make a difference, in the operation and purpose of the circuit, if elements arrangement order changed in a series connection? Say a circuit to filter out AC signal using an AC source with DC offset, a resistor and a capacitor. What difference there is if the arrangement of the elements is changed? In short words using an analogy: Does the current run like a human and it reacts to each element it sees first according to what the element orders it to do and it doesn't know what the future, upcoming circuits' elements ,holds for it? EDIT: First output using an arrangement: Second output using another arrangement: AI: I think the error is that you think you have a simple series circuit. This may have been true until you added the measurement device. Once you did that you created series-parallel circuits. simulate this circuit – Schematic created using CircuitLab Figure 1. (a) Series C and parallel R. (b) Series R and parallel C. Figure 1a should indicate a little more clearly that C1 is in series with the signal while R1 is in parallel with the load. Figure 1b is the converse. simulate this circuit Figure 2. In these cases the components are truly in series. It will make no difference to the output signal which order R and C are in. In the case shown in Figure 2 the effect on the output signal will be identical. Does the current run like a human and it reacts to each element it sees first according to what the element orders it to do and it doesn't know what the future, upcoming circuits' elements ,holds for it? You're starting to get into EM-wave theory here and it gets complex and not all that helpful in circuit analysis. Current is more like an incompressible fluid in a pipe being pumped around a circuit. All the water moves simultaneously at a rate determined by the circuit resistance. In the electrical circuit the current moves everywhere at speeds approaching the speed of light although the individual electrons move rather more slowly. In the water analogy the pressure is felt all around the circuit although a particular molecule of water may take minutes to travel around the circuit.
H: Is there a mistake in this microcontroller schematic? I was looking at the eagle schematic for a project and something caught my eye. Take a look at reset button on this schematic (From https://www.arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf): Why is there the VCC right in front of the Atmega328P? Doesn't this indicate that there will be a shortcircuit (VCC - GND) whenever the reset button is pressed? What makes more sense to me the same line connected to VCC via R2. This way power is dissipated through the resistor whenever the reset button is pressed. By why the other VCC? AI: Figure 1. The red circles (e.g., number 1) show connections between 'wires'. The green circle (number 2) shows wires crossing without connection. simulate this circuit – Schematic created using CircuitLab Other schematics including the built-in CircuitLab schematic editor use a semi-circular loop at non-connected crossing points. Figure 2. The CircuitLab standard. @Neil_UK adds, "you might add, that's why we hate the 4 way crossing as in the red (1), because dots don't always survive copying/transcription/ink blots." Figure 3. Wikipedia's Circuit diagram article gives further details on this matter. Figure 4. Meanwhile, over at Dummies.com we find another set ... The nice thing about standards is that you have so many to choose from. (Andrew S. Tanembaum).
H: Does the resistor divider value used in adjustable linear regulators matter? If so, to what extent I will use the adjustable LT3015 as an example. http://cds.linear.com/docs/en/datasheet/3015fb.pdf You can set the output voltage based on the equation Vout=-1.22(1+R2/R1) + R2*Iadj where Iadj is 30nA nominally. Now, the datasheet shows nominal R1 values for different output voltages. Most of these nominal R1 values are around 12K, giving us a resistor divider current of ~100uA. It also mentions that the R1 value should be less than 50K to help keep R2 value low enough so as to minimize errors from the adj pin current. My question is, is there a specific reason they chose the nominal R1 values to have a 100uA divider current? Is there anything stopping me from using much lower values, lets say in the hundreds of ohms? I understand that will increase the quiescent current(correct me if I'm wrong), but if I don't care about that, does it matter? Are there any pros and cons regarding transients or efficiency depending on what my resistor divider current is? In their table of output voltage resistor divider values, for -5V they have R1 as 12.1Kohm and R2 as 37.4Kohm. Why not R1 as 1Kohm and R2 as 3.09Kohm? Is this something I should contact LT about or is there an actual reasoning. Looking at other regulators, I don't think it specifies either. AI: A lower resistance will result in a higher wasted power which will require a higher wattage rating in the resistors. Too high a resistance and you may have issues with tolerance, and too high a resistance in parallel with the high Impedance input of the feedback pin can result in the resulting voltage being wrong. The input is often one side of an op amp or comparator block.
H: Making Solenoid valve work with Arduino and TIP120 transistor I am trying to turn off an on 12 solenoid valves using Arduino and TIP120 TO-220 Darlington Transistors NPN. I connected everything as I show in the diagram but my solenoid valve wont work since when its connected and I checked the voltage, it only shows 10.8 Volts, but when I check the voltage without the solenoid valve, it shows 11.98 volts. I am not an Electrical Engineer and have minimal knowledge in the field so sorry if this is a stupid question. I was wondering what causes this voltage drop that prevents solenoid valve from working. Also what is the role of the resistor here and am I using the correct one if its needed ? I will provide the links for all the parts in case if it is needed. TIP transistor Solenoid Valve AI: Your major problem is that Darlington transistors, such as the TIP120, are very sensitive but not very good when turned on. If you look at the data sheet, on page 2 you'll find Vce(sat), which is the voltage across the transistor when it is fully on. At 3 amps of current and 12 mA of base current, the voltage is 2 volts. Now, it's true that you have not specified your solenoid current, but it's also true that your base current will be no more than about 1 1/2 mA. Try measuring the on voltage across your base resistor, and you'll find it in the vicinity of 3 volts. So, the first thing you need to do is increase your solenoid voltage by about 2 volts in order to compensate for the voltage drop you know you'll get. The second thing is possibly to decrease your base resistor in order to increase base current. EDIT - A more complete circuit will look like simulate this circuit – Schematic created using CircuitLab It's true that a power MOSFET will produce less voltage drop, so you could stick with 12 volts, but there is a caveat. Arduino output voltages are not high enough to reliably drive the gate of a "regular" MOSFET. If you do decide to try this, you must be careful to get a "logic level gate" FET. If you don't, you may well find that the FET drops even more voltage than the TIP120, and it may vary wildly from unit to unit, with Murphy's Law dictating that you'll end up with one of the bad ones. Regardless of what you use as a switch, you MUST include the diode. If you don't, the transistor will die sooner or later. Also, you have never specified your solenoid current (I mentioned this before). If the current is more than (let's say) 1/2 amp, you'll need to provide a heat sink for your TIP120. Using the data sheet Vce(sat) numbers as an example, if the transistor is drawing 3 amps and dropping 2 volts, it will dissipate 2 x 3, or 6 watts, and without a heatsink it will self-destruct. The actual dissipation, of course, will depend on your current, as determined by the solenoid, and the voltage, which will depend in part on how hard you drive the base.
H: Can I convert to less AC volts to get more amps? I was wondering if I have (for example) an input of 12V and 100A DC, instead of going to, let's say 120V and 10A AC, if it could be converted into 100V for more amps. (I already know about loss so let's just assume this is a magical lossless system.) AI: Assuming no losses, yes. 120V x 10A is 1200W. This could be converted to 12V x 100A, or 24V x 50A, or any other similar combination. However, losses do enter into it, as do maximum current ratings, etc. Also, you can only use a transformer with AC. If you want to convert DC it becomes a more complicated problem.
H: How does a Capacitive ID / Signatures / Sensing system work? e.g. Google Bloks In the 'Google Bloks' project. A tangible programming experience is created by allowing children to place physical instruction blocks next to each other. The computer is able to read the sequence of instructions and turn it into a program to e.g. control a robot. It uses a capacitive sensing / capacitive ID system to detect whether an instruction card is a "GO FORWARD" or a "TURN LEFT" card (for example). Each instruction card contains no electronics. Each instruction card is somehow assigned a 'capacitive signature' Instruction cards are decoded via some capacitive sensor matrix Since there is no technical whitepaper. My question is how would this work in practice? How to design the sensing system for this? How would you create a capacitive signature for an instruction card? AI: So basically what I though. The baseboard has a cap sense pattern of 8 pads, and a center magnetic sensor (hall effect?). With 8 pads, the "capacitive signature" will be as simple as conductive paint at any binary representation of 8 bits. Boom, 255 pucks. The magnetic sensor is used for "complex" pucks. From the technology page of the project's website: Pucks are easy to create, for example by cutting paper, or 3D printing the form and then drawing the capacitive signature with conductive ink. This enables an infinite number of commands to be easily made on the fly by anyone. The Base Boards have their function specified by the puck placed on them. The Base Board has a capacitive sensor and magnetometer. The capacitive sensor reads the command expressed by the puck, and the magnetometer detects the state of the mechanical control by reading the magnet position.
H: What options do I have to combine and format 18 600Mbps ADC serial streams over QSFP+? The 18 serial streams are not encoded or scrambled. The idea is to multiplex them onto one or more encoded serial streams at higher rates for onwards transmission over optical fiber. AI: You could use a MAX3952 for serializing up to 16 inputs into a 10 Gbps stream. For 18 inputs you have to use 2 devices: - The equivalent deserializer is the MAX3950.
H: Characteristics of built-in Zener protection on FET gates A lot of SOT-23 FET gates have built-in back-to-back Zener diodes to source, presumably to protect against over-voltage. However, the datasheets typically say nothing about the characteristics of these diodes. The gate leakage current will be much higher in FET's that have this structure (compared to those that don't), but otherwise the datasheets are silent about it. One example: Diodes, Inc. p/n DMP10H4D2S-7. http://www.diodes.com/_files/datasheets/DMP10H4D2S.pdf I am designing a circuit where I am installing external back-to-back Zener diodes to protect the FET gate under certain conditions. But I am curious if I really need them or not. It seems to me that if I limit the current sufficiently, the built-in Zeners should protect the gate. If anybody has any thoughts on this topic, I would be very eager to hear them. I mean, the obvious thing to do is just add the external protection to be safe. But I still want to know if anyone has any insight on the built-in protection. AI: The zener protection on Mosfet gate is against ESD (electrostatic discharge) damage. In this case the Mosfet is tiny and you could damage it just touching the pin, without the Zener. Please note that specific datasheet says nothing about the ESD protection level, so I assume is not very strong. Unlikely is 2kV HBM, may be just 500V. Usually if the Zener is present the ESD resistance capability is reported on the datasheet; this specific datasheet is unusual on that. Most mosfets, specially the larger, have no Zener ESD protection. The absence is due to cost, a version with zener needs 1-2 masks more so the die is a bit more expensive (~15%). ESD pulse are low energy short pulse; but the gate oxide is thin: 500 to 1000 Å and damages are catastrophic. Without the Zener, the capability to sustain the ESD stress depends by thickness and area of the gate oxide. Logic level (Vgs-th ~ 1.5) are more sensible than standard gate (Vgs-th ~ 3) On big Mosfets the gate capacitance is able to handle the ESD pulse without damage. The Zener voltage is few volts more than the max rated Vgs. It protects the gate oxide but it will be destroyed itself by DC or long pulse overvoltage. The ESD Zener also introduce a current path between gate and source so the Igss leakage is orders of magnitude larger then the gate capacitance itself. Some reading: http://www.jedec.org/sites/default/files/IndustryCouncil_HBM_January2014_JEDECversionMay2014.pdf and one of the test methodology http://www.aecouncil.com/Documents/AEC_Q101-001A.pdf. Same than JESD22-A114
H: Undefined std_logic_vector size parameter in procedure I have written into a procedure the behavior of a simple SPI transaction that I use in my testbenches to make things easier to write and read. Is there a way to make this procedure as generic as possible by not mentioning the size of the vector data given as a parameter? Or maybe add a size parameter as an integer? Here's the procedure I'm using so far. For now I have one procedure declaration for each vector size I want to transfer. procedure spi_transfer_3B(data : std_logic_vector(23 downto 0)) is variable bitCnt : integer := data'length-1; begin spi_clk <= '0'; spi_mosi <= 'Z'; spi_ss <= '0'; wait until rising_edge(clk); for i in 2*data'length-1 downto 0 loop wait for SPI_CLK_PERIOD/2; spi_clk <= not spi_clk; if spi_clk = '0' then spi_mosi <= data(bitCnt); bitCnt := bitCnt -1; end if; end loop; spi_clk <= '0'; wait until rising_edge(clk); spi_ss <= '1'; spi_mosi <= 'Z'; end spi_transfer_3B; What do you think? AI: This seems to work. I was confused because not mentioning x downto x coded the vector LSB first instead of MSB first as intended in my first snippet of code. It is that easy. procedure spi_transfer(data : std_logic_vector) is variable bitCnt : integer := 0; begin spi_clk <= '0'; spi_mosi <= 'Z'; spi_ss <= '0'; wait until rising_edge(clk); for i in data'range loop wait for SPI_CLK_PERIOD/2; spi_clk <= '1'; spi_mosi <= data(i); wait for SPI_CLK_PERIOD/2; spi_clk <= '0'; end loop; spi_clk <= '0'; wait until rising_edge(clk); spi_ss <= '1'; spi_mosi <= 'Z'; end spi_transfer;
H: How do VHDL case statements scale when additional expressions are added? I am using a case statement in VHDL where the expression is a 12 bit bus address and the output is a 32 bit data bus. Here is my code: process (iAPB_BUS_IN.pclk) begin if rising_edge(iAPB_BUS_IN.pclk) then if (write_pulse = '1') then case bus_addr is when TX_CTRL => rd_data(31) <= tx_enable; rd_data(30) <= arb_suppress_mgmt; rd_data(29) <= arb_suppress_2022; rd_data(28 downto 0) <= (others => '0'); when TX_STATUS => rd_data(31 downto QUEUE_NUMBER) <= (others => '0'); rd_data(QUEUE_NUMBER -1 downto 0) <= tx_que_avalb; when RX_CTRL => rd_data(31) <= rx_enable; rd_data(30) <= rx_allow_tcp; rd_data(29 downto 0) <= (others => '0'); -------------------------------------------------- -- What happens if I add another expression below? -------------------------------------------------- when RX_CTRL2 => rd_data(31) <= rx_que; rd_data(30) <= rx_allow_udp; rd_data(29 downto 0) <= (others => '0'); end case; end if; end process; There are a few answers on here that give an example of synthesizing case statements, (like this one), but they do not give any detail about how many LUTs are used. I would like to know how to judge how many additional LUTs will be added if I add another when statement. AI: The only way is to try it and see, in the FPGA technology you need. A general answer would be "a few extra LUTs and FFs" (maybe tens) for each additional clause, but occasionally you stumble across a less-than-optimal synthesis tool behaviour that adds many more. There's no magic involved, a good synthesis tool will add about as many gates as you would by expanding boolean expressions, simplifying the Karnaugh maps and drawing out the logic by hand. Only, in seconds instead of hours... Since bus_addr is likely to be sparse (here, 4092 unused addresses) I strongly recommend a "when others" clause to define behaviour for unknown addresses. It can be as simple as when others => rd_data <= (others => '-'); i.e. don't cares, giving synthesis permission to do anything it wants, to optimise the logic size. Try (others => '0') for cleaner behaviour, and compare the resulting size. You can also simplify these case arms, for example to when RX_CTRL => rd_data <= (31 =>rx_enable, 30=> rx_allow_tcp, others => '0'); Shouldn't affect the logic generated at all.
H: Accelerometer gives wrong values for stationary axes I have a BMI160 IMU which gives a good reading for the axis parallel to gravity (1G or -1G), but a changing value of about 2G or -2G for the axes that should show 0G. This is true for all axes, I've tried rotating the IMU. I'm reading the IMU with an STM32F4 Discovery board via SPI. To my understanding, the IMU outputs data for the accelerometer in 2 bytes, with LSB being first. Inside these bytes, the bits are in MSB format. So a reading of 0111 0010 1111 1101 should be 64 882 in decimal (flipped to 1111 1101 0111 0010) and equate to about 19.23 m/s^2 or 1.96 G. I know the exact bits moving in the SPI data line, since I've read it with a logic analyzer to check. BMI160 settings: power mode is "normal", and ACC_CONF register is "0x2B": no undersampling, normal filter mode (3dB cutoff frequency), and a data rate of 800 Hz. I've also tried 100 Hz and 1600 Hz. Baud rate for SPI is 156,250 Hz, I've tried higher too (for example 1,250,000 Hz). I know the BMI160 works well, because I have a Bosch Application board and Development Desktop program, which output a nice running graph of good-looking data for all axes. I've also tried a different BMI160 and different STM32 board. I suspect the problem is somewhere in how I either initialize the board, or how I read the SPI, but where exactly? Datasheet for BMI160: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMI160-DS000-07.pdf AI: You are getting a value of 0xFD72 which works out as -654 not 64,882. In 2g range mode that works out as -39.9mg. About what I would expect. -- Additional information As noted in comments below, this is a 2's compliment signed number. That is the standard way of representing signed numbers in a computer or electronic system. Treat the most significant bit as indicating -32768 rather than +32768 and then add the other bits as normal e.g. 1000_0000 0000_0000 (0x8000) = -32768 1000_0000 0000_0001 (0x8001) = -32768 + 1 = -32767 1111_1111 1111_1111 (0xFFFF) = -32768 + 32767 = -1 You shouldn't need to do this conversion yourself, just tell the compiler that the value is a 16 bit signed value and it should understand it correctly (e.g. in c store it as an int16_t) With 16 bits you can represent any value between -32768 and +32767. In 2g range mode the senor you are using outputs a value of g/16384 giving a range of +/- 2g Also when dealing with binary numbers it is normal to use hexadecimal rather than writing the binary. It's quicker and far less error prone, since each character relates to 4 bits it's quick and easy to convert between binary and hex as needed.
H: Sensor to detect flip What would be an appropriate sensor to use with arduino lilypad to detect movement of card. The sensor will be attached to one side(top) of the card, when the card is flipped i.e when sensor faces down, then I should be able to detect it. Please help. The card would be held in hand just like a visiting card( a bit thick ). Imagine reading 1 side of card then we turn it other side to view more. So I must know if the user has turned over the card. AI: How about a tilt switch? It gives a true-or-false output only, which seems to do the trick unless of course the "card" you mean is very thin.
H: About CT secondary winding on toroidal transformer I am done primary winding today of my toroidal core. Attached photo of transformer below. 755 turn of 0.914 mm magnet wire. Core size before winding OD-100mm, ID-60mm, Ht-50mm (M4,CRGO). Sir when I test for secondary voltage I get 2.7 volt on 10 turn of magnet wire. why I get less volt per turn. Because before making the primary winding I done partial test on core, wind 10 turn for secondary, I get 3.2 volt. And I am winding center tap for this transformer of 35-0-35 using dual winding method (2 wire at same time, bifilar.) If I want lower voltage from same winding can it be done? e.g for 25-0-25? AI: But before primary winding I test core with sample winding with old transformer which have 12 volt secondary. With 12 V and a turns ratio of 37:20 you should expect about 6.5 V. You measured 6.66 V and this sounds OK. after actual wind full 755 turn on primary i test secondary voltage again with 20 turn this time I got 5.5 to 5.7 volt 755:20 with 5.6 volts on secondary implies a primary voltage of 211 volts. Maybe you thought you were feeding 240 V but you only have 210 V.
H: What is the exact purpose of this 2.2kOhm resistor in the circuit? My best guess is that it's there to drop the voltage down to 0V by the time the current reaches the negative terminal but I'm not sure if that's the case; and if it is, is it absolutely necessary to be there and why exactly? Also a side question: Why is the voltage dropped to 5V in the beginning of the circuit, wouldn't it work if it remained 9V? AI: What is the exact purpose of this 2.2 kOhm resistor in the circuit? [...] is it absolutely necessary to be there and why exactly? Its purpose is to form a voltage divider with LDR (photoresistor). The resistance of LDR varies with the light intensity. The resistor turns the variable resistance into a variable voltage, which is then compared to a reference voltage that you can control with the potentiometer. Yes, it's necessary in this circuit, and most other circuits using an LDR. Why is the voltage dropped to 5V in the beginning of the circuit, wouldn't it work if it remained 9V? You're right here. Due to the circuit's construction of only relying on the relative resistances, the circuit would work fine (even better) without the regulation. You would only have to change the resistor after the LED, because the output from the operational amplifier will be closer to 9 volts than 5 volts. One minor benefit of having a 5 volt regulation is that you will only get at most 5 volts out of the operational amplifier. This could be useful if you want to connect it straight to a digital input. Note that the μA741 amplifier chosen here is a pretty bad choice, but why it is so is another question.
H: Calculate voltage in a alternating voltage circuit Im trying to calculate the voltage through C2 in this circuit but i am unsure how to. e(t) = 0.3 sin(ωt + 18°)V , C1= 10μF , C2= 5μF , R = 5 Ohm , ω=3*10^3 rad/s This is what i got so far: frequency = 477.5 Hz I put 0.3 sin(ωt + 18) in my calculator and got that one period takes 0.1057s so t = 0.1057s then i put that in e(0.1057) = 0.3 sin(3000*0-1057 + 18) = -0.1263V I calculated Xc1 and Xc2 and got them to be: Xc1 = 33.32 ohm and Xc2 = 66.67 ohm. I then used these and calculated the impedance of R and C2 (4.9853ohm) and got the total resistance to be RT = 34.068 with 81.7 degrees. I then used that to calculate the voltage in Uc2 with the following equation: (4.9853/34.068)*-0.1263 = -0.018482V I did not get the correct answer though. I didnt know how to calculate this before i started so i gave it a shot, what ive done is probably completely wrong. All help would be appreciated. AI: I think the issue is with the parallel calculation of R and ZC2. I agree that ZC2 = 0-j66.667, but putting that in parallel with 5+j0 yields: Z2 = 1/(1/R+1/ZC2) = 4.972 - j0.3729 or 4.986 at an angle of -4.3 degrees From there, just multiply your input 0.3 @ 18 (radians?) by the impedance divider Z2 / ( ZC1 + Z2 ) I get 0.0439 at an angle of 77.32 degrees. Of course you still have to add back in the phase of 18 (by default such an equation would use radians - though 18 is an awful lot..., but degrees are usually specifically called out if used)
H: Why do we clock Buck Converters? Apologies if this has already been asked, but I couldn't easily find an answer. So - We all know the basic design of a buck converter: Closed-loop clocked PWM into a low-pass filter. But my question is... Is the clocking part of it necessary? Could someone make a buck converter by closing the switch when the output voltage meets a certain "low level" and then opening the switch when the output voltage hits a certain "high level"? So basically, an unclocked feedback loop with hysteresis to prevent ringing. AI: There are lots of hysteric or modified hysteric buck converters available. For example take a look at TI's DCAP constant-on time converters: TPS53355 Or a more conventional true hysteric buck converter: LM3485 Hysteric buck converters actually require some minimum ESR in the output caps for stability, so they tend not to work well with ceramic output capacitors. (Without some modification.) Also in a true hysteric converter (not as much with the COT approach) the switching frequency isn't constant. This can be a problem at light load when the switching frequency may get down into the audio band causing audible whine or noise. It may also cause interference with other circuitry at certain frequencies. Because of that it's also difficult to filter conducted noise.
H: Is it possible to capture a DVB-T mux's signal on VHS? What will happen if i tune a VHS VCR's analog tuner to a DVB-T mux's frequency, record the signal on a VHS tape, then use the RF out of the VCR to replay the captured signal into a DVB-T receiver box's RF input? Can i "tune" into the replayed mux and view the transmitted channels? (similarly how a Teletext signal is accessible when playing back a recorded analog broadcast) A DVB-T mux can have an overall bitrate of 20-25Mbit/s which is like 180MB/minute of data. A 4 hour VHS tape could hold 40GB worthwile of data if it's possible to encode data in the modulation of DVB-T. It's a wild idea but can't find anything about it online. AI: No, it won't work. A VHS recorder relies very heavily on specific characteristics of an NTSC (analog) signal, and processes the Y (luminance) and C (chrominance) signals quite a bit both before and after transferring them to the tape. Anything that doesn't match the characteristics of these signals very closely will be badly distorted if it gets recorded at all.
H: attiny85 clock precision I am using an attiny85 coupled to a mosfet and a water valve to water my plants at a regular interval. I want to water it every day. I programmed it to turn on every 24h, and today it is not on time. I expected a drift, but watering can occur 4 hours earlier or later, no problem. When should I expect there to be a problem in my setup? In other words, given that I use the internal clock of the attiny85 (which I run at 1MHz), what is the time bracket I can expect the water to turn on if I target 24h of delay between two waterings? Also, is it always going to be biased in the same way, i.e. is the bias systematic or random? AI: As always, start by reading the datasheet: 6.2.3 Calibrated Internal Oscillator By default, the Internal RC Oscillator provides an approximate 8.0 MHz clock. Though voltage and temperature dependent, this clock can be very accurately calibrated by the user. See “Calibrated Internal RC Oscillator Accuracy” on page 164 and “Internal Oscillator Speed” on page 192 for more details. ... During reset, hardware loads the pre-programmed calibration value into the OSCCAL Register and thereby automatically calibrates the RC Oscillator. The accuracy of this calibration is shown as Factory calibration in Table 21-2 on page 164. The referenced table: ------------------------------------------------------ | Method | Frequency | Vcc | Temp | Accuracy | ------------------------------------------------------ | Factory | 8.0MHz | 3V | 25°C | ±10% | ------------------------------------------------------ | User | 6-8MHz | 1.8V-5.5 | -40-85 | ±1% | ------------------------------------------------------ So the factory calibration may be off by as much as 10%, at 3V and 25°C. If your voltage and/or temperature is something else, there's no specified accuracy at all. You can calibrate the RC oscillator in your specific attiny to be 1% accurate at a fixed voltage and temperature (details, again, are in the datasheet). But honestly, if you need any sort of temporal accuracy, the easiest way is to just use a crystal as a clock source, assuming you can spare the I/O pins. The internal oscillator is nice for when you don't need the accuracy, or when you have large volumes and need the absolute lowest BOM cost. If you want to go the RC oscillator route, see Atmel RC oscillator calibration app note for more details. (Suggested in the comments by bigjosh - Thanks! Didn't know that one yet.)
H: Is there a good solution to connect Segger J-Link to a solderless breadboard? I am working on a project where I created different prototypes on different solderless breadboards. To program and debug the used MCU using SWD, I just use male jumper wires, from the j-link connector to the pins of the MCU on the breadboard. Now, I would like to cycle through the different iterations of the project, which are on different solderless breadboards. But every time I have to carefully reconnect the jumper wires from one breadboard to another. Is there any better solution to this? So I can faster and especially safer switch the J-Link connection between the different solderless breadboards. AI: I think this is exactly what you are looking for: http://www.technologicalarts.ca/shop/store/details/247/56/adapters/ribbon-cable/idc-ribbon-cable-to-breadboard-adapter,-20-pin.html
H: Use of schottky diode and tracking peaks of input signal with capacitors I am using this instructable to make a VU meter: http://www.instructables.com/id/Mini-Decibels-a-Simple-Volume-Meter-With-an-Electr/?ALLSTEPS I have two questions. What's the use of the Schottky diode 'D1'? The instructable says that the capacitor 'C5' is used to track the peaks of the input signal. What is the exact procedure of this tracking? Also, what would happen if this capacitor and the resistor R9 through which it discharges is eliminated from the circuit? AI: What's the use of the Schottky diode 'D1'? The first opamp amplifies the input signal by (-)100. Notice that the non-inverting input is held at half-supply and that the input signal is AC coupled by C3 and the output by C4. The output of the opamp should swing about the half-supply voltage. The second opamp is different. The non-inverting input is ground referenced. If the input signal (from C4) goes negative the output will go positive and the gain is \$ - \frac {R7}{R6} = \frac {22k}{10k} = -2.2 \$. If the input goes positive the output will try to go negative but D1 effectively reduces the gain to near zero. At this point we have a half-wave rectified version of the signal. Figure 1. (a) The AC 'music' signal. (b) Half-wave rectified signal (dashed) and peak-hold (solid). The instructable says that the capacitor 'C5' is used to track the peaks of the input signal. What is the exact procedure of this tracking? Very simple. The capacitor holds the signal level high to give time to read it on the display. D2 prevents it discharging back through the opamp when the opamp output goes low. This is the same as a half-wave rectified DC power supply. Also, what would happen if this capacitor and the resistor R9 through which it discharges is eliminated from the circuit? If both components are omitted the circuit would still work in a fashion but any transient peaks would be very brief and appear very faint on the LED bar meter. In a professional audio level meter this would be considered "a bad thing" as the engineer could miss peaks or transients that may exceed the maximum recording or broadcast level. If R9 were put back in without C5 there wouldn't be any significant change. C5 holds the peak but if R9 were omitted the capacitor would have no discharge path. The LED display would show the reading for the highest level in the audio so far and stay that way. The combination of C5 and R9 are set to hold long enough to see but short enough to follow the signal reasonably well. In this case the time constant is \$ \tau = RC = 10k \cdot 10u = 100~ms \$ - slow enough for the eye to read but fast enough to track the beat of the music. Rock on!
H: What situation does it make sense to mod a toaster oven instead of just buying a reflow oven? I have seen kits like this online http://whizoo.com/reflowoven to modify a toaster oven to use as a reflow oven, but they seem like a significant amount more work and lower quality than just buying a reflow oven like https://www.joyfay.com/catalog/product/view/id/51365/ Both seem to cost ~$200, but one involves a lot more work and risk. Why do people mod their own instead of buying them, just bragging rights or is there some aspect of customization or something I am missing? AI: The most common reason for modifying anything is that you already own it. It is just taking up space with no purpose. Your wife will kill you for modifying the one she is using. You found it a Garage Sale for little or nothing. If the 2 items are of comparable cost, their really would be no advantage to modifying something when you have to buy it new. I do this type of thing all of the time. One of the problems is that you hold onto everything that you ever had for repurposing in the future.
H: Does it matter which side I place the bulb in a circuit? For example, will it matter if the bulb is in this position: simulate this circuit – Schematic created using CircuitLab or this position? simulate this circuit Also, if it wouldn't work in either position, why? I mean, in the second, charged electrons are still being passed through the bulb, right? AI: As far as a simple circuit like this is concerned, there is no difference. The three components that make up the circuit (battery, bulb and switch) are all connected in series. This is of course a simple ideal case (which is perfectly OK in a pure circuit theory point of view), presumably in an hobby context. If we consider what this circuit is connected to outside its ideal world, it depends on the context. For example, if the battery were not a battery but a earth-grounded power supply and the bulb had a metallic enclosure also connected to earth-ground (safety ground). These external connection would matter in some cases. Anyway, as long as the circuit exactly represents what it shows (a real-world 9V battery, a light bulb and a switch), then what I said still stands. Note: my emphasis about when these circuits might not be equivalent is prompted by my impression that you are a newbie. Sometimes newbies post a circuit that don't represent exactly what's in it. Or sometimes also they think that the answer is easily applicable to "slightly" different situations, and this brings up safety concerns. For example: what I said could be applicable also if the battery were a household power outlet, but only in theory (the theory where the power outlet is seen as a simple AC voltage generator). In practice, in such cases there are safety issues to be considered which call for a deep understanding of what's the real environment "where the circuit lives". Another thing to notice is that the position of the switch may matter if you are engineering a product, then the physical size of the components and the routing of the actual wires used for the connections may dictate whether one of the circuit is better than the other, although electrically they will behave the same.
H: Why are power supply decoupling capacitors used on both supply rails in dual supply opamps? I have seen circuit diagram in analog devices application note which shows that both supply rails have a 1uF and 0.1uF capacitor for dual supply opamp but only the Vcc has them in a single supply opamp. Why are decoupling capacitors used on both supply rails in dual supply opamp? AI: The supply current for both supplies are different most of the time. Only if the output of the opamp with dual supply is at ground potential and the output current is zero both supply currents are (almost) equal. If the ouput jumps positive, there will be a short increase of the positive supply current and a decoupling capacitor is needed for positive supply. If the output jumps negative, the other decoupling capacitor is needed. If the output voltage of the opamp changes dynamically, both decoupling condensators are necessary. If there are no decoupling condensators, the opamp may oscillate in some cases. Decoupling capacitors are especially important for fast opamps. Both capacitors should have short connections to the supply terminals of the opamp and to ground.
H: Is there any tool that can create a logic circuit equivalent to some Verilog code? For the purpose of learning, I would like to know if there is any tool (free or commercial) that can synthesize some Verilog code and produce the equivalent logic circuit. Example : assign z = (a & b) | c; I am not interested how to see how it is implemented in a FPGA (which AFAIK is specific for each model and usually use LUT's and blocks interconnected together) but rather a logic circuit which is equivalent of some Verilog code. AI: Just about any FPGA/PLD tool should be able to do that. In the somewhat obsolete Xilinx ISE Project Navigator that I currently have open the first item under Synthesize is "View RTL schematic". Selecting this brings up a diagram of the created logic. Every synthesis tool I've used has had a similar option somewhere. As with any auto-generated schematic the results are never very neat but they are there.
H: How to calculate actual hfe for low voltage source? The datasheet for a transistor (said 2N2222) give us the hfe assuming a Vcc in the 30V range. For uses like Arduino projects, the Vcc is usually 5 V, and under that condition, the actual hfe is lower. Instead of hfe = 100, we get hfe = 12, like in this example (Ib = 4.1 mA, Ic = 49 mA in my tests): No problem here; otherwise, with a hfe = 100, the voltage drop across relay would be greater than Vcc, which is impossible. My question is how to calculate the actual hfe from the datasheet when application's Vcc (5 V in this case) is much lower than the Vcc used by the manufacturer (30 V)? AI: The problem here is not the low Vcc (which does affect hfe to some extent) but the fact that you want to saturate the transistor, i.e. turn it fully on, to switch on a relay. And one common definition of saturation is "the point where hfe is assumed to fall to 10". At which point, up to some current limit, Vce <= some voltage like 0.2V, leaving 4.8V across the relay coil. Look at the Vce(sat) specification (page 3 of the datasheet, linked in Lorenzo's answer) and notice the Ic and Ib values : For Ic=150mA, Ib=15mA. For Ic=500mA, Ib=50mA. In both cases, Ic/Ib = hFE = 10. So there's your answer. To a reasonable approximation, in this application (switching a load), independent of temperature, Vcc supply voltage, and transistor type hFE = 10.
H: SPI Read Problem I have done the following changes and also followed the sequence as explained, to read response from the Si4455. As mentioned in the datasheet w.r.t Fig(1) below, i.e. Make CS low send API command followed parameters depending on the command, once this transaction is over make CS high. I have written a functions which sends command as well as reads response bytes with the necessary changes. unsigned char GetResponse_CTS(unsigned char bytecount, unsigned char *pData) { cts_flag = 0; unsigned int errcnt; errcnt = RADIO_CTS_TIMEOUT; unsigned char cts_byte=0; unsigned char cts_check_cmd = 0x44; //CTS Command while(errcnt!=0) { MAP_SPICSEnable(GSPI_BASE); //Enable CS MAP_SPITransfer(GSPI_BASE,&cts_check_cmd,0,1,0); //Send CTS MAP_SPITransfer(GSPI_BASE,0,&cts_byte,1,0); //Get 0xFF if(cts_byte == 0xFF) { if(bytecount) //If need to further read response bytes { MAP_SPITransfer(GSPI_BASE,0,pData,bytecount,0); } MAP_SPICSDisable(GSPI_BASE); //Disable CS after reads break; } MAP_SPICSDisable(GSPI_BASE); //Disable CS after getting 0xFF errcnt--; } if(errcnt == 0) { while(1) { Message("CTS Time Out \r\n"); } } if(cts_byte == 0xFF) { cts_flag = 1; } return cts_byte; } //Poll CTS and return CTS response unsigned char PollCTS() { return GetResponse_CTS(0,0); } //Transfer a byte to Si4455 from CC3200 void SpiWriteByte(unsigned char byteToWrite) { MAP_SPITransfer(GSPI_BASE,&byteToWrite,0,1,0); } void SendCmds(unsigned char ByteCount, unsigned char* pData) { while(!cts_flag) { PollCTS(); } MAP_SPICSEnable(GSPI_BASE); MAP_SPITransfer(GSPI_BASE,pData,0,ByteCount,0); MAP_SPICSDisable(GSPI_BASE); cts_flag=0; } //Send commands and get response for Si4455 unsigned char SendCmdGetResp(unsigned char cmdByteCount, unsigned char *pCmdData, unsigned char respByteCount, unsigned char* pRespData) { SendCmds(cmdByteCount, pCmdData); return GetResponse_CTS(respByteCount, pRespData); } The below is the main function which sends a GET_INT_STATUS command i.e. 0x20 followed by 3 parameters. Then SendCmdGetResp,it sends the API command 0x20 followed by 3 parameters. Then it makes CS low and checks for CTS, if positive, it sends 8 dummy bytes to read the response bytes from Si4455. Once this transaction is over, the CS is pulled back high. void GetIntStatus(unsigned char PH_CLR_PEND,unsigned char MODEM_CLR_PEND, unsigned char CHIP_CLR_PEND) { radioCmd[0] = SI4455_CMD_ID_GET_INT_STATUS; //0x20 command radioCmd[1] = PH_CLR_PEND; //parambyte0 radioCmd[2] = MODEM_CLR_PEND; //parambyte1 radioCmd[3] = CHIP_CLR_PEND; //parambyte2 //SI4455_CMD_ARG_COUNT_GET_INT_STATUS = 4 (send 4 bytes) //SI4455_CMD_REPLY_COUNT_GET_INT_STATUS = 8 (read 8 response bytes) SendCmdGetResp(SI4455_CMD_ARG_COUNT_GET_INT_STATUS, radioCmd, SI4455_CMD_REPLY_COUNT_GET_INT_STATUS, radioCmd); Si4455Cmd.GET_INT_STATUS.INT_PEND = radioCmd[0]; Si4455Cmd.GET_INT_STATUS.INT_STATUS = radioCmd[1]; Si4455Cmd.GET_INT_STATUS.PH_PEND = radioCmd[2]; Si4455Cmd.GET_INT_STATUS.PH_STATUS = radioCmd[3]; Si4455Cmd.GET_INT_STATUS.MODEM_PEND = radioCmd[4]; Si4455Cmd.GET_INT_STATUS.MODEM_STATUS = radioCmd[5]; Si4455Cmd.GET_INT_STATUS.CHIP_PEND = radioCmd[6]; Si4455Cmd.GET_INT_STATUS.CHIP_STATUS = radioCmd[7]; } Even after doing the respective changes, I still receive the read response bytes as 0xFF. This time, I have read the explanation and and have carefully made the respective changes, yet the same response. Please, it would be of great help, if folks can check on my code and advise me if I have missed anything, I have cross check it and dont find anything wrong. Link to the SPITransfer function AI: You have various problems in your code structure but the most glaring one is the improper use of the select line of the SPI interface. This signal must start from a high at the start of the transaction and go low and stay low during the entire transaction after which it must go back high again. Your code is flipping the select on and off for every eight clocks of the transfer. This is very clearly depicted in the data sheet for the device.... Notice how the read process consists of a single SPI select transaction where the command byte is sent out and then immediately followed by a sequence of repetitive 8-bit reads until the CTS value changes from 0x00 to one with 0xFF. Immediately following the 0xFF value the next sequence of 0 -> N 8-bit values are clocked in as the read response value. Only after the final response byte is received is the SPI select line returned back high again.
H: How is correct to interface an MCU (Arduino)'s UART with this RS232 TTL device? I am trying to interface a bill acceptor which provides RS232 (TTL level) with the Arduino's UART. The manual of the bill acceptor provides the I/O circuit below. I have tried two ways to no avail. In the first way, I make the connection with the 2 x 1K resistor and 2n2222 transistor with a breadboard like this: The RS232 interface of the device has 4 wires: TX, RX, Download VCC (which I connect to Arduino's 5V - I also tried not connecting it, still a bit confused about this wire) and GND (which I connect to common GND with Arduino). I also tried the following to no avail: Upon starting up, even from the beginning when not connected with the Arduino, the device flashes in a way that it means its RS232 is not working (by checking with the trouble shooting part of the manual) Connecting like above also gives the same result. It's a bit weird to me that the guy who sold me this acceptor, after asking me to try so many ways (checking wires, re-check DIP switches etc.) finally told me that the RS232 interface of the acceptor has to be connected in order for it to work, which is kind of weird to me. I made the above attempts following his claim. Could anyone tell me where I went wrong? Or is it a defective unit? Many thanks! Dave AI: The first thing to do is to verify the polarity level of the signals. The pullups imply the idle level is high, which is normal for logic-level RS-232. However, the transistor in the first diagram inverts the signal, which implies the opposite. See what state the transmit lines are in when nothing is being sent. Also verify that the you are really using logic-level RS-232 on the microcontroller end. If there is a RS-232 converter chip in there, it won't work right. You want to connect the microcontroller UART lines to the bill acceptor UART lines directly, assuming the micro follows the usual convention of idle is logic high. Also, test each direction independently. Do something with the device that should cause it to send something, and watch its TX line on a scope. That will tell you polarity, baud rate, and the like. Then send it some bytes that should cause something visible to happen to test the other direction.
H: Eagle connections glitch I'm having trouble with connections in Eagle 7.6. I'm designing an LED board consisting over 300 UV and red LEDs. All of them connected in series of 3 + a 91ohm resistor and those series are connected in parallel. In schematic, everything looks fine, but once I've placed all of the components on the board, I began noticing some connection issues. Some connections appear that shouldn't be there (and yes, I triple checked the schematic). I've uploaded my whole project here. Some of the invalid (?) connections: R217-R104; R188-R75. How can I solve this problem? AI: Looking at your project, there actually is no error! In your schematic, the right terminals of each resistor is connected to GND. In the schematic, this is done by clean wires running down each column, and an additional, horizontal wire at the bottom. But that's not how airwires in the board editor work. Here, each terminal is directly connected to the next terminal of the same net. And this "additional connections" you see are the connections from one column to the next:
H: Crystal oscillator load capacitance, again There's a lot of seemingly conflicting information regarding how the load capacitance for a parallel resonant crystal is calculated. Faced with a lot of problems in recent years with non-oscillation and frequency inaccuracy, I'm asking the community's help to get to the bottom of the problem. How exactly should the values of external load capacitors be calculated? What's the reason if the oscillator completely fails to start with crystals from some vendor and only completely removing the external load capacitors help? Other vendors' crystals work fine and they advertise seemingly similar parameters (load capacitance, fundamental mode, parallel resonant). Are all integrated XTAL oscillators in, say, microcontrollers, always Pierce oscillators? Does it have any relevance on the issue? For reference, here's some information that I've found from the Web regarding the calculation of load capacitance. One IC vendor defines it like this: One crystal manufacturer defines it like this: Another website has this to show for an answer: The equation is C=2(CL)-(CP+CI) C = crystal capacitor value CL = load capacitance CP = parasitic capacitance (wires, socket, traces) CI = input capacitance (mcu itself) Quite many seem to think that the load capacitance is the value the crystal manufacturer recommends for the external capacitors. This, to me, seems completely incorrect. (But, as it turns out, might still work perfectly ok). One web page puts an emphasis on knowing the oscillator inverter's input and output capacitances and gives this answer: Is there a one true answer to the question? It all seems very frustrating to me. Why doesn't an oscillator start? Why does removing the external load capacitors make it start? How should the external capacitors' value be calculated? PS. Sorry I can't tell you exactly which ICs I'm working with. But I've seen this happen with quite a few during the years. AI: Is there a one true answer to the question? It all seems very frustrating to me. Why doesn't an oscillator start? A crystal oscillator will fail to start when the crystal and the capacitors attached either side do not fully produce a 180 degrees phase shift back to the input of the inverter inside the chip. The inverter produces effectively 180 degrees phase shift so, for oscillation to begin, the two capacitors and the crystal together must form an extra 180 degrees phase shift AND there must be an overall voltage gain greater than 1. Look at this response - it mimics a crystal and one capacitor but it doesn't quite reach 180 degrees: - V1 is the driving voltage source and R2 (100 ohms) represents the output impedance of the gate involved in the oscillator. Look carefully, the phase angle doesn't quite reach 180 degrees and this will mean NO OSCILLATION. The extra few degrees of phase shift come from the output capacitor on the invertor - the 100 ohms (or whatever the output impedance of the inverter has) AND this extra capacitance push the phase shift past 180 degrees and the oscillator will then oscillate. Here's a picture showing the effect of increasing input and output capacitance from 1 pF up to 20 pF: - The X axis is at 9.9 MHz FYI. As you can possibly see, only when capacitance is 10 pF or 20 pF does the circuit produce 180 degrees of phase shift. This means the oscillator will oscillate at the left hand point on each phase curve that the response crosses 180 degrees (parallel resonant point tuned by the external capacitance). So, you need capacitors to make this type of oscillator work and the manufacturer tells you what to use but, in my humble opinion, there are a lot of subtleties around that some manufacturers maybe either don't fully know or won't tell you. I'll also add that there appear to be very few web articles about what really is going on and the true importance of each capacitor. Why does removing the external load capacitors make it start? Maybe the self capacitance of the tracks and gate input capacitance are sufficient. It depends also on the Q of the crystal and is hard to speculate on. Maybe the inverter's slew rate is too slow?
H: How to save variables inside microcontrollers memory I am designing an application which include GSM SIM900 with PIC18F2520. The application includes basic calling and sms services. A user will press a button a call will be made to a defined number. This number can be changed via sms. So whenever the button is pressed again, the call will be made to the newly defined number. Currently I am using these variables for number: char callNumber1[10]; char callNumber2[10]; * * char callNumber5[10]; The problem I am facing is these variables works as expected. But when I turn off the power of MCU, the data stored in them are lost. I want the data to be remained as it is after the power off and can be used again after power on. How to save them in MCU's memory. Please provide any link where I can read about memory in MCU. Please help. AI: Whatever you declare as a variable in your code will be in the RAM of the PIC, and thus will disappear when you power it off. However, the PIC18F2580 has 256 bytes of EEPROM memory, which is non-volatile. You can store your phone numbers there each time they are modified, and load them at boot to your variables. To read and write a byte to a given address of the EEPROM, you have to use the EECON1, EECON2, EEDATL and EEADRL registers (see chapter 8 of the datasheet), for example: uint8_t read_eeprom(uint8_t addr) { EECON1 = 0; EEADRL = addr; EECON1bits.RD = 1; return EEDATL; } void write_eeprom(uint8_t addr, uint8_t value) { EECON1 = 0; EEADRL = addr; // address to write to EEDATL = value; // value to write EECON1bits.WREN = 1; // enable write EECON2 = 0x55; // write unlock sequence EECON2 = 0xAA; EECON1bits.WR = 1; // do the actual write EECON1bits.WREN = 0; // disable writing while (EECON1bits.WR != 0); // wait for the writing to complete EEIF = 0; // clear EEPROM interrupt flag } And then you can load your numbers with something like this: void load_number(const uint8_t start_addr, char* n, const int len) { for (uint8_t i = 0; i < n; i++) { n[i] = read_eeprom(start_addr + i); } } load_number(0, callNumber1, 10); load_number(10, callNumber2, 10); // etc. And same idea for saving. To note that this code is not using the EEPROM memory very efficiently, because storing ASCII digits in it wastes space. If you get constrained by the 256 bytes of EEPROM, you might for example store the numbers in BCD format, thus having two digits per byte. Unlike RAM, nonvolatile memories as EEPROM and Flash have a limited number of write cycles. Although this number is generally very high (1 million cycles for the PIC18F2580 EEPROM), it is good practice not to write to nonvolatile memory unless this is necessary, i.e, the data has actually been modified and has to be stored. If data has to be written periodically to a EEPROM or Flash memory, a wear-levelling algortithm might be helpful to evenly distribute the wear on the memory cells. This might be even more important with Flash-based nonvolatile memory, that often has less write cycles than EEPROM (e.g., the Flash memory of the PIC18F2580 has "only" 100k write cycles endurance).
H: How to design a passive filter from poles and zero of a transfer function? I am using octave/matlab to get the coefficient of numerator and denominator of a filter with filter command such as butter or cheby1. I just want to learn how do you convert this coeffecient to the value of passive components of Inductors and Capacitors? For example, a second order butterworth filter with cutoff frequency 1000 Hz sample at 3000 Hz with the following command gives the following b and a coefficients of numerator and denominator respectively, [b,a]=butter(2,0.667); b=0.46554, 0.93108, 0.46554 a=1, 0.62147, 0.24069 How can we transform this into the value of passive inductors and capacitors? AI: For a second-order network it is rather simple: Compare the coefficients of both transfer functions: (1) The generalized function with the factors a and b, resp. and (2) the function applicable to the chosen circuit configuration (involving L an C). Of course, both functions must have the same form (polynominal in numerator and denomonator). From this comparison, you get (at least) two equations for calculating the parts values.
H: Calculate total impedance in RLC circuit with L and C parallel I am trying to find the total impedance of this circuit but im not getting the right answer. According to my notes the total impedance is 1002 Ω, -86.6°. This is the method i tried: I got Xc = 111.1, -90° => 0-j111.1 Xl= 125, 90° => 0+j125 R = 60+j0 then from here ive tried multiple different methods. ive done ((Xc*Xl)/(Xc+Xl))+R. Just adding Xc+Xl+R then converting them back to polar form. Nothing i try give me the right answer. What am i doing wrong here? AI: According to my notes the total impedance is 1002 Ω, -86.6° Your notes are correct and I think the mistake you may have made is adding 60 ohm (resistive) to the 1000 ohms (reactive) to get 1060 ohms. You need to add them as squares then take the square root hence \$\sqrt{1000^2 + 60^2}\$ = 1001.8 ohms. The 1000 ohms is the reactive impedance of C in parallel with L. I'm presuming you know how to derive this because you appear to be making the right noises in your question i.e. the "(Xc*Xl)/(Xc+Xl)" bit is correct.
H: EEPROM Emulation driver does not work when Page Sizes are 2KB I am trying to implement EEPROM Emulation on an STM32F07x using the driver supplied by ST. Problem is on attempting to initialise the emulated flash, the driver fails and always returns NO_VALID_PAGE. I have changed the defines for the Page Size and the EEPROM start address to match the Reference Manual but it doesn't work. AI: There is a subtle bug in the eeprom.h file. The calculation of the PAGE1_BASE_ADDRESS is based on 1Kb value page rather than using the define which is supposed to accommodate different page sizes in the MCU's. Change the define #define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0400)) to: #define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE))
H: nodal analysis - CCCS controlled by current from same node From schematics we have: \$i_1=\frac{v_1-v_2}{3},i_2=\frac{v_1-v_3}{2},i_3=\frac{v_3}{6},i_x=\frac{v_2}{4}\$ for node 1: \$10 = i_1 + i_2\$ \$5v_1-2v_2-3v_3=60\$ EQ1 for node 2: \$4i_x + i_1 - i_x = 0\$ \$4v_1+5v_2=0\$ EQ2 for node 3: \$i_2 - i_3 - 4i_x = 0\$ \$6v_1 - 3v_2 -8v_3 = 0\$ EQ3 from three equations we get \$v = (\frac{400}{23},\frac{-320}{23},\frac{420}{23})\$ but correct solution is \$v = (80, -64, 156)\$ Where is problem? My guess is that controlling current \$i_x\$ and dependent source are connected to same node. AI: The algebra for equation 3 is the problem. It should reduce to: $$ 3V_1-6V_2-4 V_3=0 $$ That will give you the right answer
H: Power supply issues with many identical PCBs I've designed a PCB to run two stepper motors from an Atmega8. With my current implementation, I can however only run two of these PCBs at the same time. In this picture you can see the overall structure of the project. One PSU (5V, 10A) is supposed to run all modules. The Arduino talks to each Atmega via I2C and has it's own power supply over USB. (I left out the SDA/SCL lines to reduce the clutter) Each of the "duostepper"-modules mainly consists of an Atmega8 and two 28YBJ-48 stepper motors. There's also two ULN2003s and ports for two optical sensors, an AVR-programming port and the I2C/TWI-connection on there. To make it more compact, I designed a PCB to have all ports together. The schematic: This is the board layout. I'm using the I2C/TWI-port at the top to feed 5V/GND and then connect each PCB with the next one. There is no power jack on there. From my power supply I'm currently just using a breadboard to get 5V/GND to the first module and GND to the Arduino. One module runs very smooth. Even two run okay. Now I started to build up 6 modules and suddenly only one of the modules runs smoothly. All others are either are having trouble with their steppers. To me it looks as if the modules are not running in parallel but in series. However, I don't know what changes are required to fix this. Did I miss something crucial on the PCB? edit3: I've updated the schematic and the board. AI: I am surprised that this would work at all. There are open GND and (A)VCC pins that are required to be connected for the MCU to work correctly. Atmel has an appnote how to wire the power lines on their chips, you need 100nF for each VCC/GND pair close to the pins. AREF should be wired to an 100nF capacitor with its other pin connected to GND.
H: Why did the Intel bubble memory chips have a hexadecimal label on them? Such as in this image: I guess some sort of configuration, am I right? AI: Apparently, the hexadecimal digits indicate which minor loops should not be used, as per Vintage Bubble Memory.
H: How to perform transient analysis LC series in Multisim I,m trying to perform transient analysis of next circuit: In t=0 switch is opened. Initial condition Vc=0, IL=4A. But that doesn't work properly in Multisim (fig. above) Voltage across Inductor does not match estimated value. Multisim show 120V in t=0, rather than 0V. How to fix it? Link for Multisim Design (OneDrive): https://1drv.ms/u/s!ArJljGNjPhExtDGjTEqIZTgr4fCf AI: It turns out I measured voltage incorrectly. I assumed V(2) was Voltage across inductor, but it was voltage between left terminal of inductor and ground. Now I add new variable V(L1)-V(R1) and it fix everything. FYI: I did not need switch.
H: How can I build a micro USB hub? EDIT: @EugeneSh. I ment how can I build a hub Double edit: Sorry everyone, I mentioned how can I build a USB hub... I'm looking to build a very small USB Y splitter for my Nexus 7 2nd Gen so it has 2 USB ports. The reason why I'm not buying one from eBay (ect.) is because i don't want a cord and I want to build something like the "sugoi hub" mentioned below. I WAS going to buy a sugoi hub but those things are nowhere to be found! Anyways, do any of you guys have an easy wiring diagram for a (micro) USB 2.0 Y splitter? AI: All these y splitters are, are a usb hub ic, a few passives, and the usb ports. It is an active device, not just wires. Some all in one USB hubs like GL850G are used. You could get a cheap dollar hub with one of those, then modify it as you want.
H: How is NAND flash going to die when overheating If I have a NAND flash which is say 70°C rated, what is going to happen to that NAND flash when I heat it to 80°C or 100°C? I'm thinking of a scenario when the 70°C rated sample actually starts producing errors at 71°C and I'm not looking at a sample which will have no problems above 100°C. My current assumptions are that it can either the logic be corrupted (like in RAM and CPU) or the actual NAND bits can flip more often? I'm basically trying to figure out a high level testing methodology that can run from Linux. Thanks! AI: A few things I can think of. Chance for memory to be erased (poor data retention). In flash memory, charge stored in the insulating gate of a MOSFET acts as the memory element. Under high temperature this charge leaks more quickly. From ti paper: "with sufficient thermal activation, all bits could lose their charge". Also from the same paper, gate oxide damage. Trapped charges injected into the oxide due to the high temperature will build up. Over time this will add up create a voltage offset on the gate (making FET more leaky). This could create a situation where the FET is permanently on (unless the gate is driven sufficiently low) if enough charge builds up. Shorter lifespan in general. Heat causes a lot of processes to speed up exponentially: (Arrhenius law). Thermal expansion can cause peeling of metal vias from their respective layers or a host of other problems. Possible complete failure due to thermal runaway (unrecoverable). Higher leakage overall. More power burned. From pdf on leakage, in 65nm process: leakage at 0C is ~10x less than 40C, which is ~10x less than 100C. The circuit will run slower than expected, due to more collisions of free carriers.
H: Multithreading on AVR If I have an AVR micro controller and have an ISR coming up about every 100 micro seconds or so, can I change the stack pointer in the ISR and then fake multi threading? Psuedo code: uint8_t currentThread = 0; void* process0StackPointer = 0; uint8_t process0SREG = 0; void* process1StackPointer = 0; uint8_t process1SREG = 0; ISR(TIMER0_OCA_vect) { currentThread = !currentThread; if (currentThread == 0) { process0StackPointer = StackPointer; //Back up the stack pointer of the //"0" thread and the status register process0SREG = SREG; StackPointer = process1StackPointer } else { process1StackPointer = StackPointer; //Back up the stack pointer of the //"1" thread and the status register process1SREG = SREG; StackPointer = process0StackPointer } } Is this a plausible thing to do, or is there something that I am not seeing here? AI: To create an adequate multi-threading system, you need to do a 'context switch' see Wikipedia 'context switch' for an explanation. The code needs to make the 'context switch' be 'invisible' to each thread. Otherwise a thread will not be possible to restart reliably, destroying the value of doing it. To make an invisible context switch to any running thread all of its state needs to be saved. It isn't sufficient to just save the SREG (status register), and flip to another stack. It needs to save all registers that could possibly be in use. Clearly the obvious set is the entire AVR register file, 32 registers. They would need to be saved, and the register file for the thread about to be resumed loaded in such a way that everything will be restored to the same state at the point that thread was previously interrupted. Summary: yes an AVR multi-threaded system could be built using a timer, however, your code needs to save and restore a lot more state. As I said in my comment, an AVR running at its highest speed of 20MHz, needs one or more cycles to complete one instruction. It would take about 32 instructions, and hence 64 cycles to store all of the 32 registers into memory, and about 64 cycles more to load the registers for a different thread, plus a little bit more for IRS entry and exit. So, you should estimate about 140 cycles to create the most basic multi-threading context switch. That is 7µs at 20MHz clock. I'd suggest you keep the context switch well under 10% of the available CPU cycles so that it can actually get some useful work done. So have the interrupt less frequent than 70µs. A possible place to help you understand the scope of the issues is to look at an existing simple OS. Then you will understand all of the other pieces which are likely to be needed more quickly. For example something like FreeRTOS. This 'Arduino OS' forum page may help too. A lot of the context switch code will need to be in assembler because you can't reliably get at the registers from C. However, because the AVR's instruction set is relatively simple, that shouldn't be too hard. Each thread is usually represented by several different chunks of memory (RAM): 1. The register values 2. The stack Atmel's AVR don't have a lot of RAM, so one awkward part is allocating enough stack for the thread, without using so much memory that there isn't room for enough threads. The last little wrinkle that I remember is an exit from ISR (RETI) isn't exactly the same as a return from subroutine (RET), so you'll need to think that through too.
H: S21 parameters multiplication I have a two port system which consists of two subsystems. Is the multiplication of S21 parameters of the subsystems equal to that of the whole system? AI: It isn't that simple. There can also be an effect due to reflections back and forth between the input of L and the output of K. If L has no input reflections (\$S_{11}=0\$) or K has no reverse reflections (\$S_{22}=0\$), then your formula should work. (Edit: As I think about it some more, you'd also need to have a perfectly matched load on the output of L) But if that's not the case, you have to jump through more hoops. The usual approach is to transform the model to a different representation called "T parameters": $$T_{11}=\frac{1}{S_{21}}$$ $$T_{12}=-\frac{S_{22}}{S_{21}}$$ $$T_{21}=\frac{S_{11}}{S_{21}}$$ $$T_{22}=\frac{-(S_{11}S_{22}-S_{12}S_{21})}{S_{21}}$$ The T parameters can then be cascaded: $$T^{(KL)}=T^{(L)} T^{(K)}$$ And then the T parameters can be transformed back to S parameters: $$S_{11}=\frac{T_{21}}{T_{11}}$$ $$S_{12}=\frac{(T_{11}T_{22}-T_{12}T_{21})}{T_{11}}$$ $$S_{21}=\frac{1}{T_{11}}$$ $$S_{22}=-\frac{T_{12}}{T_{11}}$$