text
stringlengths
83
79.5k
H: Quad Band GSM PCB Antenna I am making a GSM + GPS Board, and we don't want to put an external antenna on top of it via any sort of connection. Primariliy to reduce the cost. I've seen a VTS system with an onboard antenna which gives good enough signal even when the unit is in the basement or indoors. Now i am not getting any sample reference or guides to work on it. Anyone can point me a guide / pdf / page where these things are xplained ? We dont want to purchase an antenna we want to have an antenna on our PCB board itself. Here's a Picture of the Antenna AI: I hope you realize that antenna design is a very large and complex subject ! It might look like just a strip of conductive material (and actually it is :) ) but there's more to it than that. If you want the best performance (and you do since you want the product to operate in a basement) then you will need a "proper" antenna. If your antenna is not "proper" you might suffer from: less transmission power because of impedance mismatch less receiver sensitivity because of impedance mismatch the antenna's radiation pattern might not be what you want I don't think that just making a certain shape using the copper on a standard PCB will result in a very good antenna. For sure it will work but it will not be optimal. I would advise you to look into ready-made antennas that can be mounted on a PCB, here's an example. Note how it has a complexly shaped conductive area ! Also look at the datasheet, all information is there and it is guaranteed by the manufacturer. You cannot get that when you just make "some antenna" on your PCB by yourself (unless you are an antenna expert of course).
H: Measure resistance value between all nodes in a 3x3 resistor grid I have a Schematic like that: (except the power supply is an Arduino Uno with a voltage divider to measure resistance between any pair of ABC and 123, except C3 of course) How can I get the resistance between all nodes (the resistance of every single resistor) in the grid, when I only measure between ABC and 123? All resistors are unknown. AI: Normally you'd do it by setting up the equations and solving for the unknowns. But in this case it's impossible. The two resistors in the top left are in series, and there's no measurement point between them. That means that you can only get the combined resistance of the pair, with no way to separate it into its component resistances.
H: Hand crank battery charging circuit build I'm using a 12V dc motor as our generator for a hand crank power generation system. We've tested our motor without a load we thankfully can generate a maximum of 9V. Our project requires us to generate enough power to charge a phone for a 2min call. We're almost done, but I'm somewhat struggling with the circuit. I'm using two LED's one to indicate we are charging the batteries when cranking the generator, and the other to indcate the batteries are discharging. Our input mechanical power that we've calculated would be at least 3.5W(assuming low efficiency), we're using four NiMH rechargeable batteries that is 0.8Ah at 1.2V, they will be connected in series so that the voltage would be 4.8V acceptable for the phone charger. Here is our initial circuit schematic: I'm assuming the input voltage from the generator when connected to the batteries as the load, has to be in the range or maximum of 4.8V. The resistors will dissipate some power for the LEDs(20mA at 3V) Using a blocking diode to block any reverse current. My concern of this circuit is that when I crank the generator both LEDs will function, and the batteries are being charged, how can I change this so that only LED1 is functional and the batteries are being charged? And when we strop cranking the batteries will light up LED2 and power the load, and the motor I think, should we use switches? While charging/discharging? Our load will be a phone battery, and we will use this charger to connect to it: This is an introduction class project, it's quite simple. But while reviewing the circuit realized some mistakes... EDIT : Final circuit, after help. simulate this circuit – Schematic created using CircuitLab AI: First, you really, really need to check how well your generator works when under load. As brhans pointed out, you've got your battery connected wrong. Fixing this and adding a MOSFET will produce simulate this circuit – Schematic created using CircuitLab M1 is a p-type MOSFET, and when the generator output is zero the FET will be turned on. When the generator is charging the battery, the gate of the FET is high, and the FET is turned off. D4 compensates for the voltage drop in D2, and keeps the FET gate voltage from going the wrong way.
H: Why does electrical charge concentrate at sharp points? Think of a metal object with one side round and the other side sharp. And we charge the metal either negatively or positively. Why is charge more concentrated at the sharp point? Why Don't electrons repel each other stronger at sharp point? So that they go away from the sharp point? AI: Here is the mathematical way of understanding: Now I'll try to explain it logically: Consider a room full of people who don't want to see one another or be close to. If the room is symmetric (consider circle), they will try to keep uniform distance so that everyone is as far from one another as possible. Now add a narrow lane to the room so that only a line of people can be formed there. People will notice that if they go into the lane, they will have fewer people close to them (only 2, one in front and one in back) as compared to when they were in the circular room. This is a better configuration for those people. However this will lead to increased number of people per unit space in that lane and a person looking from far will notice that even though they want to get away from one another, they have crammed up in same place.
H: Harvesting energy from an electromagnetic generator I have designed a simple circuit that harvests energy that is generated from an electromagnetic generator. I would like to know tips I could use to improve efficiency and minimize the losses I may have by using this design. I have drawn the circuit for more clarity. Please note the MOSFETs act like a diode bridge. This circuit has been tested and it works. I am interested in improving the efficiency including any other options that may even be costly. P.S. The following are requested information as per comments. The voltages peaks generated from the harvester has about 7V Pk-Pk. This depends on speed. I have mentioned the average. The purpose of the Zener diode is only to protect the BQ25505 from receiving beyond 5.5V. That is the maximum input voltage of the BQ IC. High spikes of 6V are reduced because of the capacitors charging effect. We have tested this and its true. Currently I want to more efficiently harvest the energy bursts coming off the harvester, with lowest dropout voltage. AI: Your MOSFET bridge will waste less voltage than diodes like you intended. You need enough Volts to drive the gates like george herold stated in comment. In fact at low input volts you will be worse off than diodes because the parasitic diode in all normal powermos is poor in terms of voltage drop and recovery. If you place shottkeys across the DS of each FET you will secure better performance at low voltages. Once you have done this there is still room for improvement. The voltage on C2 is more steady than the voltage on C1. This voltage could be employed for running a gate drive circuit for the FETs. I have done a circuit with 4 Shottkeys and no pchannels, just keeping the 2 N-channels. This could work better for you than what you have.
H: Switching negative voltage I need a way to switch a -5V voltage supply to the Flexiforce sensor below. The circuit I am using is this: I looked into using a 74HC4066, but it does not allow switching negative voltage. It can only switch between GND and VCC. I need to find an IC that has multiple switches and can switch negative voltage. If not, how could I incorporate a transistor circuit to solve this? AI: I am trying to hook up multiple of these sensors to one analog input on my Arduino, and would like to switch them on and off by controlling the -5V signal input (-1V in the picture) using a switch mechanism. For good signal quality, it's probably a good idea to use the op-amp to drive the micro's ADC. The circuit shown can be converted to a summing amplifier, with each of the sensors connected to the inverting input of the op-amp. To do this circuit without needing a negative supply, connect the bottom of the sensor to ground instead of -1 V and connect the non-inverting input of the op-amp to a mid-voltage, like 2.5 V from a resistor divider. Your 0 point will be shifted, which you'll subtract in software. To switch them out of the circuit, you could ground each sensor through its own transistor and only enable one transistor at a time. You could also use the 74HC4066 on the lines going into the summing amp, but that's a more complicated circuit.
H: Signal and power integrity - 4 layer board Let's assume that we need to design Mixed signal PCB with 2 fast integrated circuits(tr_min = 1ns) operating at different voltage levels(3.3V and 4V). There are however other voltage levels on the PCB(5V, 12V) with low speed signals. Design must be done one 4 layer(i.e. sig-gnd-pwr-sig). What voltage level should be used on PWR plane? If i.e. PWR=3.3V then would return current path of the 4V high speed IC on bottom layer be GND or 3.3V PWR? I think it would be GND plane. So if we keep PDN in mind what Rolf says then 6 layer would be more appropriate(i.e. sig-gnd-pwr-gnd-pwr-sig). According to Olin, we could remove PWR plane and used one GND plane as a return path for each and every signal on PCB. Therefore my stackup would be(sig - local gnd/sig - gnd - sig). I see some contradiction on those two approaches. For further discussion, if some PDN tool is used to keep impedance below some value from i.e. 0-180MHz where should decoupling capacitors be located? There are plenty of them, more than 60-70, so it's impossible to locate all of them near and around LQFP case. Is it OK to spread rest all over the board? What are your thoughts? AI: Have a ground plane. You don't need a power plane. You do need a low impedance power supply at each IC, which means stitching as many decoupling caps as required, per supply, per IC, close enough to the ICs, directly between power and ground. Power planes are great when you have a single plane, lots of ICs using it, and want to spread out the decoupling caps. It's a total waste of a layer if those don't apply. With multiple rails, any attempt to put all the power distribution on a single layer, that you then hopefully call the power plane, will result in silly polygons that are simply wide tracks. It's much easier to route and to nail with decoupling if you simply treat it all as tracks, on the most appropriate layer, from the start. All the return currents will flow in the ground plane. Keep the ground plane as a plane, do not cut it into a lace curtain to route other tracks on that layer (that can happen when there isn't an organised way to route tracks, and the last track or two has to cut through the ground plane) There is a technique called Manhattan routing, which will allow you to organise point to point or mesh routing on just two layers, without tripping yourself up. Choose an east-west layer, and a north-south layer. Hop between them using vias. While you lay the board out, resist the temptation to put a sneaky track running EW on the NS layer, and vice versa, you will regret it later when you need to cross tracks. That gives you the spare 4th layer for signal routing the signals that wouldn't fit on the Manhattan layers.
H: "Inverse problem" for resistor network: finding applied voltages to produce desired currents I am working with a large network of resistors. Here I will illustrate my question with a scaled-down version (5 resistors). The current flow through the each of the 5 resistors is fully determined by the potentials at each of 6 nodes, or 5 nodes if I ground one. simulate this circuit – Schematic created using CircuitLab I would like to specify a set of currents \$[i_1, i_2, i_3, i_4, i_5]\$ and calculate the required voltages \$[v_1, v_2, v_3, v_4, v_5]\$ which generate these currents. Since I have five independent node voltages, I can find a combination of voltages that generates any desired combination of five currents - I am comfortable with this part. I am interested in the case where I want to generate a set of currents \$[i_1 ... i_5]\$, but I can only set some of the node voltages, say \$v_1, v_4,\$ and \$v_5\$. The other voltages (i.e., \$v_2\$ and \$v_3\$) are determined by the applied voltages and the arrangement of resistors. Since I now only have three independent voltage sources, I can't generate any arbitrary combination of five currents - only a subset will be possible. I have three questions: (1) How can I determine whether my desired combination of currents is possible? (2) If this combination of currents is possible, how do I calculate the combination of voltages I need to apply to \$v_1, v_4, v_5\$? (3) If the combination of currents is not possible, what is the closest I can get, perhaps in a least-squares sense (or some other relevant measure)? AI: You have a system of 5 equations such as: $$i_1 = \frac1R(V_1-V_2)$$ You can also determine the voltages that you cannot control from nodal analysis in terms of only the voltages that you can control and the resistances. Upon substitution of these equations into the system, you will have only three independent variables. From here, use your favorite linear system solver (or do it by hand) to see if 1) a solution exists and 2) what such a solution is. For question 3: you will want to use your favorite optimization package (or by hand) and define your objective function as the error (you mentioned least squares). Then solve the optimization problem for minimum error.
H: How bad is it to places vias under a QFN thermal pad? I'm working on a PCB which has to be very small. There is a QFN IC which has a big thermal pad, although it doesn't really need to dissipate that much heat. So to save some space, I came up with the idea of reducing the footprint of the thermal pad so that I can place some vias and traces in there. It would be covered by solder resist so it doesn't sound unreasonable to believe that this might be okay. However, if it were such a good idea, everyone would be doing it, and I'm wondering how bad it is. I've seen this similar question but it's not exactly the same thing. For example: The traces are 0.2 mm (7.87 mil) wide, the via diameter is 0.7 mm and the drill is 0.3 mm. AI: I would not go with this. Small designs will not necessarily heat up that much, but running an exposes pad so close to your traces is risky. Depending on volume, you will get some boards where part of that trace is exposed, or the via mask is scraped off. The wear and tear on the board depending on use case might expose something, or maybe that part does heat up a slight amount and over time causes unexpected behavior. Overall it is just not good design practice. Use another layer.
H: Total power periodic voltage develops in a resistor What's the total power this voltage develops in a resistor of 2 ohms? What I got: total power is $$S=UI$$ where U and I are both effective and calculated as a square root of a sum of squares of effective values. Is effective value for a zero harmonic 2 or a square root of 2? Similar question, what happens when this voltage is superimposed with u1(t)=2V? Is the amplitude of every harmonic increased, or only the one of the zero harmonic? Any mistakes? 13/4 is what I get. AI: Seperate all the harmonics into individual sinewaves. Calculate power in the resistor (i.e. V^2/R) for each. Add all the powers up. Job done. Alternatively take all the individual RMS voltages from each sinewave and add them up like this Total RMS = \$\sqrt{A^2 + B^2 + C^2 + etc}\$. Then divide that by 2 ohms and you get the same value as I first mentioned. If you add 2V DC to the signal still treat like an example of superimposition - it does not affect any harmonics or the power dissipated by the harmonics. Is effective value for a zero harmonic 2 or a square root of 2? It's 2V not sqrt(2)
H: 74HC76 integrated really use Vcc pin? I'm building a simple ring counter with two jk flip-flop. I'm using 74HC76 integrated that contains two jk. This is the integrated pinout: This is my schematic (very basic): simulate this circuit – Schematic created using CircuitLab To build a working circuit it's necessary that you connect pin 5 to Vcc (5V) and pin 13 to GND. But... The problem is that in the circuit that I'm observing on my desk the ring counter only works when pin 5 (Vcc) is unwired. It means that if I wire pin 5 to Vcc I got always 10 output. Is that possible? If no what's the matter of my circuit? I've tried all: I've substituted the integrated -> same problem I've checked another time pin connection -> same problem I've changed wires -> same problem EDIT: I initialize the first jk with 1 using a button and preset and clear pin. AI: Without a resistor in series with each LED is is likely that the corresponding Q output is being dragged down to a voltage that is not high enough to be recognized as a legitimate high level by the following J input.
H: How do I reuse part of a schematic in multiple projects in KiCad? I would like to re-use parts of a schematic, say a microcontroller or a voltage regulator, in multiple KiCad projects. Is it possible to copy and paste blocks between eeschema windows or can this be accomplished by another means? AI: You can create hierarchical sheet and place there reusable part/circuit/module, create interface pins via hierarchical pin in sheet. But project resides in own directory you need copy schema file with hierarchical sheet. When you include in project you place hierarchical label to connect reusable part into project circuit. Such a sheet may be even reused more times in one project and multi-unit parts are allocated correctly. Note: Because referencing is maintained in file the file must be copied when used in second project. It's feature.
H: Splitting mains power into multiple relay-switched circuits Summary Introduction My goal is to split a 1-gang mains power extension lead into three, have my Raspberry Pi plugged into one of the outputs, and have the Pi able to switch the other two outputs using relays. Background I want to use my Raspberry Pi to switch on and off two mains-powered appliances using solid-state relays. I've found this useful video which demonstrates the concept on a mains-powered lamp. The video suggests cutting the lamp's power cord and wiring that up to the relay, but I don't want to cut the cords for my appliances. I am, though, happy to use an extension lead and cut that instead. However, I don't want to have to buy and cut an extension lead for each appliance; nor do I want to have to plug three things (the two appliances and the Pi) into my wall socket individually, for neatness' sake. So I thought maybe I can make a 3-gang extension cord and have the Pi run off one output and attach the relays to the other two. The Plan My idea is to get myself a nice long 1-gang extension chord and two spare extension chord sockets, so I'd have something like this (please excuse my crude illustrations!): I would then cut the extension cord say 3m from the plug end and cut two more times to give myself two pieces of headless chord, like so: Now I can wire those loose bits of cord into the spare sockets. Furthermore, I could cut those cords again to insert the relays, giving me this: The final piece of the plan would be to join all those loose ends in a junction box. The Question Sorry it's taken so long to get here, but here is the question (well, two actually): Is this plan feasible? And if so, what's the best (i.e., safest) way of connecting those loose ends? I thought of using a junction box and I've Googled endlessly but can't seem to find anything that takes one input and allows multiple outputs. The closest thing I can see is this but I think the cord might be too thick for it. Also, I'm a little concerned that shoving three wires under one screw in the terminal block of a junction box might be insecure and lead to them coming loose. Any advice and suggestions are most welcome! AI: There are multi-way connectors for connecting several wires together. If the wires aren't too thick, you should be able to get two into each end of a suitable terminal block strip (perhaps a 15A one). Alternatively, Wago do a range of connectors for joining anything up to 5 wires at a time. Make sure the whole lot is in a suitable insulated box. I don't know if the solid state relays you're using provide adequate isolation between the mains and the drive circuit. If not, act as if anything on the Raspberry Pi could be live when powered up.
H: Calculate with Demorgan Find \$\overline Y\$. I have got to \$(\overline A+ B)\cdot(\overline C+D) + (E \cdot \overline F)\$. I want to make sure I've got it right. Any help is appreciated. EDIT: \$(\overline A+ \overline B)\cdot(\overline C +D) + (E \cdot \overline F)\$. AI: $$Y = AB + C \overline D (\overline E + F (G \overline H + 1))$$ $$Y = AB + C \overline D (\overline E + F)$$ $$\overline Y = \overline{ AB + C \overline D (\overline E + F)}$$ Take DeMorgan's. $$\overline Y = \overline {AB} \bullet \overline {C \overline D (\overline E + F )}$$ Take DeMorgan's. $$\overline Y = (\overline A + \overline B) \bullet (\overline C + \overline{\overline D} + \overline {(\overline E + F )})$$ $$\overline Y = (\overline A + \overline B) \bullet (\overline C + D + \overline {(\overline E + F )})$$ One last time. $$\overline Y = (\overline A + \overline B) \bullet (\overline C + D + (\overline {\overline E} \bullet \overline F ))$$ $$\overline Y = (\overline A + \overline B) \bullet (\overline C + D + ( E \bullet \overline F ))$$
H: Does a switch schematic symbol have a conventional "polarity"? I'm studying Rudy Severns eBook Snubber Circuits for Power Electronics; great read by the way. In it he has the following figure, notice the phrase in the caption "including voltage and polarity conventions": Should I take this to mean that there is a conventional orientation for the "opening" and "hinge", so to speak, of the switch symbol in a schematic? At least in a DC context where current would only be flowing the one direction? I hadn't encountered that before and kind of have my doubts, but my engineering mind would like a convention that leads to a one-and-only-one right way to orient a symbol that otherwise has a degree of freedom to it. AI: No a switch doesn't normally have polarity, but when you implement a switch with semiconductors you have to worry whether they are one-quadrant, two-quadrant or four-quadrant, depending on what the rest of your circuit requires/imposes in terms of current and voltage. For example a BJT is good a 1st quadrant (or 3rd quadrant) switch and a diode as a 2nd quadrant (or 4th quadrant) switch. A MOSFET is good as two-quadrant switch if well chosen (body diode considerations). A good presentation of that topic is in Erickson's course.
H: Inverter using Wien Oscillator Here is Wien Oscillator circuit: Amplitude of oscillations, Vout, is about 10V. If I put step up transformer on output with appropriate primary/secondary ratio, I can get 220V AC voltage, and it would be some basic DC to AC inverter, right? But because of small output current of LM741, it can't be used to power bulb for example? AI: This is very impractical. 1) The sinusoidal signal generated is not efficient for power generation -- because it uses a linear amplifier to convert the supply power to the sinusoid. 2) A light bulb would be perfectly happy with a square wave, and this can be generated much more efficiently.
H: Input impedance of lossless transmission line I'm having trouble understanding the following formulas (highlighted) and their corresponding solutions. I first added up the impedance of transmission lines and found \$Z_{in}\$, but it seems to be wrong. Any explanation will be appreciated. AI: I'll try to help. Firstly, consider this: the line on the right side has a load of Zl and a length 3(Wavelength)/4. So you get the value of tan(βl1)=tan(3π2)→∞, Now, consider the formula given. Taking out tan(βl) term as common from both the numerator and denominator, you get the equation as $$Z_{(l)}= Z_o{(Z_lcot(bl)+jZ_o)/(Z_ocot(bl)+jZ_l)}$$ Now note that as tan goes to infinity, cot goes to zero... Hence, Z(l) results in (Zo)^2/Zl. Hence , you can now find Z(l). Further, this Z(l) acts as the load for the second transmission line(l2). Similarly, you get the required answer.
H: Why is there a resistor in this reverse-polarity-protection circuit? I was looking at the recommended reference implementation for a particular integrated circuit (the TI SN65HVS880, data sheet here). It runs off of a 24 volt power supply. The circuit diagram looks like this (taken from page 17 of the data sheet, red added, with V24 being the IC's 24-volt power input): I am assuming everything between the 24 V power supply and the IC itself is protection circuitry and the BYM10-1000 diode is for reverse polarity protection. But I do not understand the purpose of the 56 ohm resistor (highlighted in red). Why is the resistor there? Is it necessary? A few further notes: The resistor must be rated to 1 amp or less (looking up the data sheets for "MELF" resistors, that's as high as they go) and the diode there is only rated to 1 amp. There was no further explanation of this circuit provided. AI: I'm betting on this as the reason: In an industrial environment you will want the design to be somewhat ruggedized, and that's what this circuit does. It protects the input from Reverse-voltage (via BYM10-1000) Overvoltage (via 56\$\Omega\$ and Z2SMB36) High-voltage transients (via 56\$\Omega\$ and 2.2\$\mu\$F)
H: Hey I am using 2 4N35 Optocoupler from Visha can I replace them with a single ILD615 from Vishay? I went through both datasheets and i think it should work. Basically I am asking if the dual channel version of 4N35 is the 8 dip ILD615. Thanks. edit: I have added the picture. my circuit is like the link. when vin is postive i need GPIO at Vout to be 1 (High) and otherwise Vout 0 (Low) AI: This is one possible way of using opto-coupler: This is PC817 and lacks a base connection. Most likely you also don't need it. This circuit will generate a HIGH Output when there is a HIGH Input. In this case, you can use ILD615 if you need a dual channel. Connections will be similar. You don't to worry about base connection. Compare the two images and you will know how to connect everything.
H: How to use solar panels in a electric go kart? I am entering a electric go kart competition. Below are the electrical specification of my go kart. 1hp DC Motor. Normal batteries used in motor bikes (48 volts in total) And solar panels And i am totally new to this field So i wanted to ask what will be the rating of solar panels i should use that could charge my batteries fast and can also run the motor directly (cant exceed 48 volts or 2hp). I am totally new to this so it will be very helpful if you can provide me with some resource to study about these. AI: 1hp DC Motor. Normal batteries used in motor bikes (48 volts in total) And solar panels 1 HP ~= 760 Watts input at 100% motor efficiency Controller losses and motor losses mean you'll need more input than that to get 1 HP out - or will get under 1 HP for 760 Watts input. Typical Solar crystalline silicon solar panels give about 15% at the system level - somewhat more for the best 'normal ones'. Back contact Si PV cells may give a bit over 20%. The best you can get money-no-object may give 30%. Cost is very large. At 15% overall efficiency you get about 150 Watts per square meter in full sun at noon with panel correctly aligned to sun. Less anywhere in China (smog all over) and up to about 20% more in some unusual locations. Say 150W max at noon. If you want to run your vehicle directly from the panels and at 1 HP = 760 Watts IN you need 760W / (150 W/m^2) ~= 5 square metres of panels. eg 2.6m x 2.6m - square or 3.7m x 1.9m - 2:1 or 4.6m x 1.5m - 3:1 Rather large in any format. If you want double the power you need double the area.
H: How to choose wire size for an air conditioner? There is a difference between my calculations and what electricians say. Am I missing something? If I need to install a 3 horsepower air conditioner. Electricians always choose wires that are more than 4 sq mm. They say that air conditioners consume high current. My calculations tell me that I can use 1.5 sq mm only. Am I right? 3 horsepower = 2237.1 watt I = Power / voltage = 2237.1 / 220 = 10.16 Amps According to the following table, I will choose 1.5 sq mm. http://www.elsewedyelectric.com/BE/ImageFiles/SubProducts/Pdf/Single%20Core%20Cables%20with%20Solid%20or%20Stranded%20Copper%20Conductors%20&%20PVC%20Insulated%20450-750%20V.pdf So, Why does electricians choose that thick cables? AI: You do not indicate so I wonder if you have considered the cable run length. Why would you like a thinner cable, if it is to save cost then the length is likely subtantial and therefore more of a reason to use thicker conductors. Also the electricians are aware that compressor devices have very large inrush currents that are supported by thicker cables. EDIT: I found this mentioned in an Off grid guide by JayCar. Australian Standard AS4509.2 states a surge factor of 7x the continuous power should be used for electric motors, water pumps, fridges, air conditioner, and washing machines. A surge factor of 3x should be used for kitchen appliances and other electronics equipment, and surge factor of 1x for resistive loads. Another more interesting document on Cold Load Pickup Issues also shows similar inrush current figures. Similar tests were conducted with on a ¼ HP refrigerator motor. The test results showed an average inrush current of 15 amperes and a maximum of 18 amperes. The average inrush was 7.5 times the steady state run current of 2 amperes. It took 483 milliseconds to reach the steady state condition. The test after a 25 cycle interruption produced lower inrush current and shorter times to reach steady state, 6 – 17 amperes and with 217 milliseconds to reach steady state. Also tested was a 3 ton air conditioner. The momentary interruption test and the cold load pickup test showed an average inrush current of 90 amperes which lasted for 117 milliseconds. The inrush current was 7.26 times the steady state run current of 12.4 amperes. The steady state value was reached in 267 milliseconds.
H: How to detirmine if I need a gate driver for MOSFET or not? I want to design a BLDC motor controller and I am still collecting some info about the components that I will use, of course main components will be MCU and MOSFETs. I have seen some designs that use gate driver and some doesn't and I really don't know when exactly I would need them and when it would be safe not to use them I want some guide lines to determine exactly whether or not to use them ! AI: You are likely using MOSFETs as hard-switches i.e. like relay contacts and the main thing to watch out for when driving the gates is the gate to source capacitance. It might be as high as 10nF and your driver might only be able to supply 30 mA (say). This means that the rate of change of voltage applied to the gate is highly limited by both the gate capacitance and the lack of driving current to inject charge into the gate capacitor. I = \$C\dfrac{dv}{dt}\$ i.e. how quickly does the gate voltage rise for a given injection of I So dv/dt =30mA/10nF = 3 million volts per second. This may sound quite high but, considering that you might need 10V to fully turn on the mosfet, you'll need to wait 3.33 us. Given that rise times and fall times ought not to be a significant proportion of the period of any PWM waveform (maybe 5% maximum) you find that the maximum PWM frequency ought not to be greater than (say) 7.5 kHz. Rephrasing, 7.5 kHz has a period of 133.33 us and no more than one-twentieth of the time should be taken up in the device switching on and off thus, the time for switching on and off is limited to 6.67 us. So if you need fast switching look into the MOSFET data sheet and do some calcs - you might find that a 1 amp driver is the only way to get certain applications to work efficiently.
H: Line Level to Mic Pad Working Randomly With Phones I'm trying to build my own headphones to mic pad. I want to connect the input of the pad to a phone's headphones conector and the output of the pad to a second phone's mic connector. Both phones feature a TRRS 3.5mm audio jack (4 contacts, CTIA standard). Here's the circuit: C1 +Line level in --||----R1----+-- +Mic level output + | | +----R2----+ | Ground (input)----+--------------- Ground (output) I found the schematics in this page I've measured the headphones output signal in a couple of phones. Each brand seems to have different amplitudes, almost nobody follows line level standard. I measured amplitudes ranging from 500mV to 1.8V peak to peak. I've chosen R1=20K, R2 = 1K, so the output amplitude of my pad should be 1/21 the input (23mV to 85mV). This pad works fine when plugged to any device that only has a mic input. But with phones it's a bit more complicated. Phones already have a built-in mic, and there is some mechanism in place to detect whether or not an external mic has been plugged to the audio jack (e.g. a handsfree). So with phones and tablets, this very same pad works only sometimes: when it works, the pad is detected as an external mic, and it displays the "headset+mic" icon in the status bar; when not working, the phone switches to the built-in mic, and the "headset with no mic" icon is displayed in the status bar (as if only a TRS connector were plugged in). It looks like a random issue, and I don't know why, because I used exactly the same phones and tablets for my tests. My pad is well soldered btw. And now here comes the odd thing. If I add a 1V DC offset to the pad output then it works always. No random malfunction any more. Could it be that the unbiased pad output signal (which is centered around 0V) is detected as "ground" by the phone and it switches to external mic? Or is it a bad choice of resistor values? UPDATE: it could be the case that my voltage bias circuit is providing aditional impedance and that makes it work. I'll play with a potentiometer in R2 and see what happens. AI: Looks like R2 needs to be higher. The Android specs call for minimum of 1K from mic to ground. Your 1K resistor is right at the limit. An example is given for a microphone with a 5K DC resistance. So, use a larger R2, and proportionally larger R1. (R2=5K, R1=100K)
H: Ultra Sonic coverage angle problem in Cylinder I have 2.5 meter long height, 5cm radius cylinder. This cylinder can be used as a trashcan and I want to install an Ultra Sonic Ranger like SRF05 to see how much space left in it. Cylinder has long height compared to radius and SRF sensor will be installed on the top of cylinder. And I read these sensors have a coverage angle of 15degrees. Would it be possible if sensor's beam angle produce a false distance by hitting Cylinder walls before actually reaching the bottom of the object? I mean Cylinder is really slender and I'm worried about the surface around since SRF sends beam in a 15degree circular angle instead of linear straight line. More about Ultrasonics: http://www.sensorsmag.com/sensors/acoustic-ultrasound/choosing-ultrasonic-sensor-proximity-or-distance-measurement-838 It would be great if it could detect in a straight line. AI: If the beam hits the wall at an angle of 15 degrees or less, it will reflect, also at 15 degrees, i.e. continue in approximately the same direction. If the beam hits imperfections in the wall, a fraction may be reflected upwards and result in a low intensity return. If it hits the contents, you hope for a larger intensity return. So: Discriminate between small returns and larger ones. Note however that a large return from the bottom of the tube will be attenuated, so the discrimination threshold must reduce as depth increases, i.e. reduce as the travel time increases. Polish the walls of the pipe!
H: How to stretch ON time of a pulse train when keeping the periods unchanged? I'm receiving varying frequency pulse train with very short ON time and I want to convert these to pulses with longer ON time but without changing the pulse periods. On time is now around 100us. Pulse period varies between 1000us and 2500us. The flipflop halves the frequency and skips one rising edge which I dont want in this case. How can I achieve this Duty cycle doesn't have to be fixed just the frequency of the pulses should remain the same. AI: You want something called a one shot. Basically, you ignore everything except rising edges of your input signal. You copy the rising edge to the output, but make up your own falling edge. A one shot is a timing component that does exactly that. You can set one up so that when a rising edge comes along, it starts a timed pulse. Since your pulses vary from 1 to 2.5 ms, 500 µs is the optimal time for guaranteeing the longest minimum level time. Without prediction or delay, you can't make a square wave output.
H: optocoupler output protection I've got this circuit. The target generates an identical PWM signal to control the intensity of 3 LEDS. But I would like to protect the output of these optocouplers with this TVS: I'm not sure if using the TVS SMBJ78Ca is the best option: https://www.fairchildsemi.com/datasheets/SM/SMBJ100A.pdf Max Vce [ACPL-271-500E] = 80V The design schematic is only to distribute the PWM intensity signal to three different LES drivers. The PWM outputs only control de intensity pin of a LED driver tps92551 [Pin3 DIM]. Best regards. The design schematic is only to distribute the PWM intensity signal to three different LES drivers. The PWM outputs only control de intensity pin of a LED driver tps92551 [Pin3 DIM]. Best regards. AI: The outputs from the opto device (C and E) are effectively a BJT collector and emitter. It will not produce any voltage to drive the LEDs therefore the LEDs will not activate. This means the TVS on each is pointless: - Here's how you interface the output: - You need a power supply on the transistor side and a resistor to current limit the transistor. An LED can be inserted in series with the resistor.
H: Term for errors that are constant for a measurement In my measurements, I am encountering errors that remain constant over a measurement but change from one measurement to another. The errors specifically are amplitude and phase errors resulting from different electronic components in a telecommunication chain. Are these errors called static errors or systematic errors in literature? I looked at their definitions but couldn't relate them to my case. Any suggestions on this would be appreciated. AI: When I carry out measurements for say 30minutes, the errors remain constant and affect different signals in the same way. But if say I repeat the measurements the next day or so, the errors change. So I am trying to figure out in which category of errors in literature they fit into. May be static, but not sure! This sounds like a temperature (thermal) hysteresis measurement error - they are a big deal in voltage references (used inside measurement equipment) and can give annoyingly different results from one day to the next. The other type of problem it might be is due to aging - if you are testing a relatively new device, it will age and the aging gives a bigger error in (say) the first thousand hours but then starts to settle time. So there are two "subtle" mechanisms known but this assumes that your measurement equipment is from a reputable supplier, has a valid calibration certificate and is not damaged in a way that could affect accuracy. Useful and short document from Linear Tech on this problem
H: PID to generate different order Systems I am looking at an old exam question and I am wondering giving a certain G(s) how can I choose the points of the zeros in a PID Controller to have a second order response for small values of K and a first order response for large values of K. So far I have found the transfer function but I am unsure how to determine the zeros. If anyone could even provide an explanation I would be very grateful! For a) finding the transfer function I get From here I can see that if K is small I will get a second order response, and if K is large I can see where I would get the first order response. What I do not understand is how do I find the Zeroes (a and b) for the PID to give the desired response? Edit: I apologize, both K and k are the same I will fix that. In the question for small K the system should have a second order response to a step input and a first order response for large values of K. AI: CLTF is: $$\small \frac{Y(s)}{R(s)}=\frac{K(s+a)(s+b)}{s^3+(2+K)s^2+(2+K(a+b))s+abK}$$ To produce a 1st order TF, we would like \$\small (s+a)(s+b)\$ to cancel two of the roots in the denominator. Exact cancellation is not normally attainable, so let's go for approximate. Thus, write the 'ideal' denominator as \$\small(s+a)(s+b)(s+c)\$, and find the value of \$\small c\$ that approximates this denominator when \$\small K\$ is large. Expanding \$\small(s+a)(s+b)(s+c)\$ and comparing denominators: \$\small s^3+(a+b+c)s^2+(ab+bc+ca)s+abc\: \approx\: s^3+(2+K)s^2+(2+K(a+b))s+abK\$ Comparing constant terms, \$\small abc=abK\$, hence \$\small c\rightarrow K\$, and substituting: \$\small s^3+(a+b+c)s^2+(ab+bc+ca)s+abc\: \approx\: s^3+(a+b+K)s^2+(ab+K(a+b))s+abK\$ Now, let \$\small K\$ become large, so that: \$\small [(a+b)+K]\approx [2+K]\$ and \$\small [ab+K(a+b)]\approx [2+K(a+b)]\$ Hence we have the denominator:\$\small\ (s^2+(a+b)s+ab)(s+K)\$, and the required 1st order CLTF is: $$\small \frac{Y(s)}{R(s)}\approx \frac{K}{s+K}$$ To illustrate, consider \$\small a=1\$; \$\small b=1\$; \$\small K=100\$. The CLTF is: $$\small \frac{Y(s)}{R(s)}= \frac{100(s^2+2s+1)}{s^3+102s^2+202s+100}$$ It can be seen that \$\small (s^2+2s+1)\$ is an approximate factor of \$\small (s^3+102s^2+202s+100)\$ [it's an exact factor of \$\small (s^3+102s^2+201s+100)\$], giving the 1st order CLTF: $$\small\frac{Y(s)}{R(s)}\approx\frac{100}{s+100}$$ Analysis for small \$\small K\$ can proceed similarly.
H: push/pull extending rod Will start off by saying I know very little about electrical engineering :/ so I basically need to make some sort of push/pull extending rod it Doesn't have to be particularly strong, just needs to sort of hold the weight of an apple the only problem is it needs to use a 12v power supply, iv'e looked everywhere and can't find a single reference as to where to either buy or try and attempt to make such a thing. it needs to extend/detract about the length of an iphone 6 (sorry about the weird measurements, it was a rushed job) if anyone could point me in the right direction or offer a little bit of advice it would be greatly appreciated AI: You can try making a rack and pinion mechanism. Consider the image given below: I am suggesting this because most of the parts are readily available in hobby robotics store. Buy a toothed rack and stick it to a wooden strip. Use whatever length you want. Do it on both sides as shown. You will need three spur gears which will make the rack move back and forth. Two gears will be mounted on dead shafts (use a motor if not able to find dead shaft). One gear will be mounted on a DC motor. That's it. Your push/pull extending rod is ready. Note: Double sided rack and three gears have been used to bring stability to the structure. Make sure rack is hanging a little on both sides while operating so ensure a smooth operation.
H: Slow clk output (Spartan-6) I have a design which looks like this: -controller --Module1 ---SubModule1.1 ---SubModule1.2 ----SubModule1.2.1 --Module2 ---SubModule2.1 ---SubModule2.2 ---SubModule2.3 ---SubModule2.4 --Module3 ---SubModule3.1 ---SubModule3.2 ---SubModule3.3 So I got a top-level module called controller which inherits 3 Modules. Each Module is connected to a FIFO as a Buffer. So the output of Module1 is connected to the Input of FIFO1 and the output of FIFO1 is connected to the input of Module2 and so on. Now here's my problem. If I run Place & Route with Xilinx ISE it gives me ---------------------------------------------------------------------------------------------------------- Constraint | Check | Worst Case | Best Case | Timing | Timing | | Slack | Achievable | Errors | Score ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net clk | SETUP | N/A| 9.055ns| N/A| 0 _IBUF_BUFG | HOLD | 0.411ns| | 0| 0 ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net clk | SETUP | N/A| 18.826ns| N/A| 5804 _IBUF | HOLD | 0.131ns| | 0| 0 ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net Ins | SETUP | N/A| 8.537ns| N/A| 0 t_part1/Inst_A2Precalc/state[2]_GND_274_o | HOLD | 1.534ns| | 0| 0 _Mux_639_o | | | | | ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net Ins | SETUP | N/A| 7.946ns| N/A| 0 t_part1/Inst_A2Precalc/state[2]_GND_306_o | HOLD | 1.890ns| | 0| 0 _Mux_703_o | | | | | ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net Ins | SETUP | N/A| 7.966ns| N/A| 0 t_part1/Inst_A2Precalc/state[2]_GND_338_o | HOLD | 2.224ns| | 0| 0 _Mux_767_o | | | | | ---------------------------------------------------------------------------------------------------------- Autotimespec constraint for clock net Ins | SETUP | N/A| 8.252ns| N/A| 0 t_part1/Inst_A2Precalc/state[2]_GND_370_o | HOLD | 1.950ns| | 0| 0 _Mux_831_o | | | | | ---------------------------------------------------------------------------------------------------------- So clk_IBUF has a Best Case Achievable of 18.826ns which is too slow for my case. Does this mean that the clk needs 18.826 to reach all clocked parts? And how could I possible improve this? And can I somehow look up what exactly causes this? AI: Does this mean that the clk needs 18.826 to reach all clocked parts? It actually means, that the maximum delay of the combinational path between two FFs driven by that clock (or back to the same FF) is 18.826 ns. This delay is the sum of the clock-output time of the source FF, the delay of the combinational logic, and the setup-time of the destination FF. And can I somehow look up what exactly causes this? After P&R the ISE toolchain runs the static timing analyzer. In this report, you will find the path which actually causes the high delay. If the report is almost empty, then you must specify a clock constraint with the desired clock frequency in a UCF file, which must be added to your project. An example clock constraint would be: NET "clk" TNM_NET = "clk_grp"; TIMESPEC "TS_clk_grp" = PERIOD "clk_grp" 100 MHz HIGH 50% And how could I possible improve this? As you already buffered the data-path using FIFOs, take a look at the control path. A common problem with a chain of FIFOs is, that the last FIFO can stall the entire pipeline when it is full. Same applies to the first one, when it is empty. If the FIFO control signals are not buffered by FFs, then this typically leads to long signal path going through all FIFOs in between. Thus, a lot of LUT stages and routing delay causes a long critical path.
H: How do you calculate Byte Offset? I am confused by the concept of byte offset. In my textbook the examples always show the word aligned byte offset as being two bits but doesn't really explain how they arrive at that value. It says they are word aligned so the offset is 2 bits. This doesn't really make sense to me because I thought words were 32 bits so wouldn't the offset have to be larger than just 2? Branching off of this, what exactly is the difference between word addressable and byte addressable and how do I calculate their respective offsets? I have a problem that I am trying to work through that deals with all of these things. I am trying to calculate the tag, set, block offset and byte offset for a direct mapped cache. The data is 32 bits long. The cache is byte addressable and each access returns a single byte. Each line in the cache holds 16 bytes. Here is what I have so far: I think there are zero set bits because its direct mapped. I think byte offset is also zero because it returns 1 byte and \$log_2 1=0\$. I think block offset is 4 because each block is 16 bytes and \$log_2 (16) = 4\$ So In this case I think I would have [tag = 28 bits][index = 0 bits][block offset = 4 bits][byte offset = 0 bits] but I'm not sure. Am I on the right track?? Thank you!! AI: To understand the difference between byte- and word-addressable, understand that a byte is always 8 bits, while a word may differ from system to system. Take, for example, an 8-bit system with 2 byte words. The instruction size is one word, but the bandwidth of the system is only 1/2 word. The system must be byte addressable so that it can load the instruction 1-byte at a time. It cannot be word addressable because it cannot handle a full word of data at a time. In this system, the byte offset would only be 1 bit, to choose between the first or second byte in the word. I would like to help with the cache addressing but it's been a while and those are very detail oriented calculations. Best of luck!
H: Copying Firmware I have a PIC chip with a firmware. I have another identical microprocessor, but it's empty. I need to copy the firmware from the programmed PIC to the empty one. I don't have the original code. The microprocessor is the PIC12f629. Is this possible ? How could I do it ? Thanks , Liam AI: If the code does not have the protection fuses set, you can hook up your PICKit and "Read" the data off the device with the PICKit programming utility. If you get all 0x00s or all 0xffs, that is a bad sign. You can save the result to a .hex file or whatever you choose. Now just burn that onto your new chip-- that should work, though I've never done it.
H: Variable power supply I am trying to make A 220 ac to 0-30 dc Using this schematic I connected it on the bread board three times but every time I get only a 1.25 V from the regulator but when I change my potentiometer nothing happens Here is the breadboard AI: The LM317 will give out 1.25 V when ADJ is connected to GND. Since you have this voltage that implies that somehow you have a permanent GND connection to ADJ. Simon B may be on the right track. Both the green and white wires, which seem to be involved with the pot, are connected to negative. Check that you haven't connected the white wire to the black instead of the pot wiper. (If you disconnect the black wire from the pot the voltage out should increase.)
H: Converting constant voltage to a pulse Im trying to do research for something I can't even name. Basically it goes like this: It's kind of like a multi-vibrator, but I need it to give a short pulse on the output, while input is a constant voltage. Maybe some of you know some circuits, that would be capable of such task. AI: You are looking for a one-shot or monostable. Your diagrams should look like this. simulate this circuit – Schematic created using CircuitLab
H: Circuits made using evolutionary algorithims (Solved) Let me preface this by saying I am by no means an electrical engineer. I am looking for an article that I saw some time back and wondering if there has been further research on the subject. From what I understand a team of engineers created a circuit board by using algorithms based on theories of how neuronal connections in the brain form. Essentially the board made its own connections through the path of least resistance. Basically the circuits that offered the least resistance and the best connection (don't know if that's redundant) were made stronger, and those that were less efficient "died off". I know for a fact many new articles were written on it but as far as searching for more literature on it I am at a loss. While this is close it's not exactly what I am talking about. They didn't "model" it on anything, they actually let it grow the connections itself. Sorry in advance if this makes almost no sense, like I said I'm not an engineer. EDIT: This is the exact article I was looking for. I understand the way I phrased this made it hard to understand but not being versed in electronics by any means made it hard for me to articulate what I was trying to say. So please stop saying "Has nothing to do with PCBs", "You made no sense". That is exactly why I put in the original question disclaimers about what I was asking. Hope you guys enjoy the article. AI: People have been messing with this for a long time. Some amateur work Some university research, oft retold like an epic tale These are both based on genetic algorithms, which is passingly similar to neural networks. This may have caused some confusion.
H: Controlling a servo with Attiny85 OCR1B I currently have a project where I need to control a servo using OCR1B. I already figured out how to use one with Timer0, but I can't use that for this project though. So, my questions are: - How do I set the PWM frequency to 50Hz(for the servo)? - How do I change the Duty Cycle to set the servo position? Also my system clock is 1MHz. Thanks for answering! AI: 50Hz is once every 20 milliseconds, and you can have an almost arbitrary resolution of pulse width by using very simple logic to service a GPIO pin to go logic HIGH or logic LOW to send the pulse. You can even do a whole bunch of other tasks before the pin finally needs to change state. You are trying to get a hardware timer to run as low as 50Hz, when usually people want those timers and PWM pulses to be hundreds of hertz, even tens of kilohertz. Just use the pin as a digital logic pin, and use some simple timing and logic to set the pin high and low as required to send the pulses. Lets say you want the pulse to be 1 millisecond in length (1000 microseconds), during a 20 millisecond interval. Lets say you set up a timer (doesn't matter which) to overflow and increment a global static variable called something like "TICK_COUNT" and has a known frequency. From this you can estimate the elapsed time during operation, and definitely during short intervals like in the order of 20ms. You could even reset this count variable at the end of each 20ms cycle. in your program's main control loop, you will just check the current count value (and convert to microseconds if you can) against the intended pulse length (call this the "setPoint", and convert from microseconds to however many TICK_COUNT this needs to be). Start with the pin set to HIGH. Once currentCount >= setPoint, let the pin LOW. Have another piece of logic which does nothing now until currentCount >= CYCLE_END which is however many ticks are needed to be ~= 20 milliseconds. Then you restart all the logic states, and begin this whole cycle again. Whatever program logic you have that needs to change the servo's setpoint, just write to the setPoint global variable, and the servo control logic will handle it. I think I may have gone into too much detail, but I hope all this helps.
H: Problem with resistance,electric circuit etc. etc. In which way a resistance is to be connected with a bulb labelled 120W-60V when it is connected with 220V DC source so that maximum illumination with proper security is maintained? What is the necessary amount of resistance needed? If I connect it in parallel connection then proper security is maintained but not maximum illumination.On the contrary, series connection cause damage to the bulb though high illumination is obtained. Is there a way to verify and analyse mathematically? Am I right? If yes then how will I calculate the resistance? AI: A 120W 60V normal incandescent bulb behave like a resistor. So it requires 2A to operate (120W = 60V * 2A). To make this work from 220V you need to drop 160V (220V-60V) across a series resistor. To get this voltage drop you need a resistor of 80 Ohms (160V/2A) - BUT this resistor will need to be capable of dissipating 320W (160V * 2A) simulate this circuit – Schematic created using CircuitLab A possible way to do this is to wire 4 of these bulbs in series (each would be slightly dimmer than optimal).
H: Create a beeper when a battery voltage goes down to specific number I have a 6 X 2V (400Ah) batteries in the office and I use usual DC to AC inverter to run our computers. One problem that we have is there is no way to know how soon our batteries are going to die. I got usual volt meter, but I need to monitor that all the time. What can I do to make a beep when a battery volts goes below 11.5? I think it is very simple thing but I don't know what it is called or how to make it. AI: Here is a circuit I made some time back and it was very useful. The Zener value can be roughly between 7v and 10v. The 555 IC acts as a comparator and turns on the output at pin 3 (OUTPUT) when pin 2(TRIGGER) is less than 1/3 Vcc. Adjust the Potentiometer(R1) so that the output is turned on at 11.5 volt. simulate this circuit – Schematic created using CircuitLab A quick search returned a few circuits that may be better. I had originally built my circuit based on the second link. http://www.aaroncake.net/circuits/lowvolt.asp http://www.homemade-circuits.com/2013/05/simple-low-battery-indicator-circuit.html For the second one, you can replace the LED with a buzzer. For all circuits, select a buzzer that works when directly connected to a voltage (ie: make sure it is not a simple piezo disk or speaker).
H: BJT transistors AND gate I am trying to build a simple AND gate using 2 2N2222 transistors and the +5V source from an Arduino board. At first I tried the circuit without the R1 and R2 resistors but the output was 1 when B was 1 (second input) and 0 otherwise, regardless of A. After adding R1 and R2, if only B is 1 and A is 0 then the LED is dimly lit and if both inputs are 1 then the LED is brightly lit. Can I make it such that only when both inputs are true the LED is lit and off otherwise? I also measured the current between R2 and Q2 and I'm not quite sure how to interpret the readings or what they mean. With the ampmeter on the scale 2m, with A = 1 the display reads .406 (which I presume means 0.4 mA?) and with the scale 20m, with A = 0, the display reads 2.23 (2.23 mA?) and with A = 1 the display reads 0.43 (which means 0.43 mA?). Am I reading the values correctly off the ampmeter and why does the current through B change if A is connected orn ot? AI: Your basic circuit is a shot in the right direction BUT it would only work properly if you would use NMOS transistors insteat of bipolar ones. The problem with NPNs here is that if Q1 is off but you're switching Q2 on, Q2 will behave as a diode pulling the voltage across R3 and D1 up. So D1 starts to light up (a bit). When you also switch on Q1 then more current can flow and Q2 will operate in saturation, the LED will light up more. If you can, try using NMOSFETs, two 2n7000 would to the trick I guess. It can also be done with NPNs but then you would need to build a NAND first and then invert it's output OR (even simpler) connect the LED in series with R2 in the schematic from this tutorial. Place LED in series with R2: Done :-)
H: Help with using monostable one-shot multivibrator? Above is the schematic I simulate in LTSpice. The input signal is a 8V pulse train with 100us ON time and 2250us period. The signal is fed as an input to the timer 555(NE555 in LTSPice). I'm trying to stretch ON time to around 600us. So according to math R1 = 560 ohm and C1 = 1uF for this ON time. But when I simulate in LTSpice whatever the R C combination is the output is the same: goes on with input's falling edges and goes off with input's rising edges. Am I doing something wrong here? AI: A typical one-shot mono stable triggers if only the input is as such i.e. HIGH-LOW-HIGH Hence the monostable triggers on falling edge of the input. If you invert your input signal you will get desired output. Here's a example input-output waveform from NE555 Datasheet. T = 1.1 RC So 560 ohm and 1uF cap will give you 616 uS on time.
H: Can timer2 control the pin "oc0" in ATmega32a? On a board the input of a PWM controlled device is tied to the pin oc0 of an ATmega32A and it's not changeable (it's a PCB). Timer0 is busy and can't produce PWM to the oc0 pin. But timer2 is free. The problem is that Timer2 can only put a PWM wave on pin oc2! The microcontroller is ATmega32A (TQFP). Can Timer2 produce it's PWM on oc0 pin? If it can, then how? Please revise the close votes, it's clear what I am asking now. AI: The OC0 pin hardware of the ATMega32 is closely tied into the timer 0. Likewise the OC2 pin is closely tied into the timer 2. Both the OC0 and OC2 pins are dedicated to specific package pins. I.e the ATMega32 MCU does not have special function peripheral pin routing like some other MCUs have. If you do not want to re-wire your board then I can think of one possible software solution. You could use the timer 2 to produce the PWM timing but then setup timer 2 to generate an interrupt at the appropriate times. Then in the interrupt service routine you could use software to toggle the port pin that OC0 would normally connect to. It is a kludge solution if it can be made to work. The PWM speed would have to be limited too. So I would really recommend that you make the necessary re-wire and move on to the next issue.
H: Opto-coupler output I am using this circuit for mains detection: The output fluctuates a little but capacitor and resistor values ensure that Output is logic HIGH when 220V mains is present. Once mains is not available, I get a logic LOW. This circuit has a quick rise and slow fall response. This allows quick detection when mains is connected. However detection of mains removal takes around 100-150ms due to discharging capacitor. I want opposite results. I want to know quickly when there is a power failure. Here is an image showing current output and desired output curves: Even if my logic gets inverted (High when 220V is absent and LOW when 220V is present), I have no issues. I can program accordingly. Decreasing discharge resistor will not work as it will discharge the capacitor too fast and I will get a pulsating output when mains is present. AI: Before you do anything, you have to fix the circuit driving the LED. At the peak of the 220 VAC sine, there is 311 V on the left end of R29. Figure about 2 V for the LED, so 1.6 mA thru the resistor and LED. That's good enough for many opto couplers, although I haven't looked up this one in particular. However, the problem is during the negative half-cycle. The LED will be reverse biased way way beyond it's spec. Again, I haven't looked up your opto, but most likely the maximum LED reverse voltage is around 5 V. If you haven't broken the opto yet, you will shortly. One way to fix this is to put a ordinary diode in reverse across the LED, although that will double the dissipation in R29. At roughly 220 Vrms across R29, it will dissipate 1/4 Watt. It really should be a "1/2 Watt" or more resistor, or implemented with two 1/4 W resistors in series. Now to the problem you asked about. The solution is to loose the filter. I'd also use a stiffer pulldown or pullup resistor. Many microcontrollers have internal pullups as options on at least some of their pins. The simplest is then to connect the opto output between a pin with internal pullup and ground. No other parts are needed. The digital input will now be pulsed at the line frequency. This is easy to deal with in firmware, and I have done that a number of times. With the raw input showing you when the positive half of the power cycle is occurring, the rest is up to policy in the firmware. One of many ways to do what you want is to create a internal signal that tells you as quickly as possible whether power is present. Whenever the opto output is activated, you set a timer to a little longer than the normal off time of the opto. During the on time, the timer will be effectively held at this value, and it will count down during the off time. AC input is present whenever the timer is not 0. From the AC-present signal, you can easily make a delayed start signal via low pass filtering, a deliberate timer, etc.
H: A DC micro-voltmeter Basically I will be calibrating circuits to a high degree of precision. Keeping it minimalistic, I figure all I needed for that are resistor networks, voltmeters and a few high precision voltage references. Like I said it has to be very high precision, so I figure the voltage differences would be in the microvolt range. I've looked at different options from expensive high precision lab voltmeters to oscilloscope preamps (I suppose it could be adapted as a preamp for a voltmeter?). They are all so expensive. Since my circuits have to work both with AC and DC signals, we could simplify everything by only calibrating against DC signals. So noise becomes a lot less of a problem, since it's DC. So now I figure, just get a Low Noise Instrumentation Amplifier (or preamp) that will amplify by a fixed factor of 1000, to bring the microvolt to millivolt range, which my multimeter can then measure. Is there any problem with this whole approach? If you have really good schematic designs for an Instrumentation LNA, can you guys share it with me? AI: Here are the pitfalls as I see them: - The connection between two dissimilar metals is called a thermocouple and this can produce a voltage of several micro volts per degree centigrade. This is why thermocouple amplifiers use cold junction compensation and they are rigorous about this. Getting an accuracy below 0.1 degC is almost unfeasible. Note that I said accuracy and not resolution. The best DC spec op-amp I use (and I do use some pretty good ones) has an offset voltage of typically 5uV. This represents an error in your measurement system and there's very little you can do about it except perform very exact calibrations quite often. There is also a temperature related drift with this offset too so a stable environment is important Amplifier bias currents can play havoc with DC voltage measurements if the source (the thing to be measured) has a significant output resistance. For instance a strain-gauge bridge as a resistance of typically 350 ohms in a lot of applications and, if you choose an amplifier (or op-amp) that has a bias or offset current of 10 nA you get an offset error voltage of 3.5 uV. Clearly for measuring sources that have a much higher resistance you have to choose amplifiers with much lower bias currents. So, my advice is look at what is available and set your requirements to be achievable. I'm not going to give you diagrams because they have IP value and this is a free advice site.
H: Best way to multiplex button lines on existing circuit I have a target device that has push buttons that when pressed send a constant 3.3v signal to the MCU button input GPIO's until released. Externally from a different device (perhaps a Raspberry Pi) I would like to stimulate the MCU button input GPIO's while still permitting the original buttons to work. Is it safe to just connect a 3.3v pin I control to the same MCU button line as the button? AI: EDIT: Now that you have added information in the comments that they aren't even actually buttons, more is needed, because you also want to not destroy the other IC. You need to be 100% clear and 100% accurate in your problem description or we will not be able, or not want, to help you. Original Solution (not applicable anymore, but leaving for posterity, so to speak): The dashed block is inside your own controller, it's a toggle switch letting you choose between +3.3V out or 0V out. It has a series resistance, effectively, which will heat up. Now if it's really 5mW, or actually capable of 100mW for a sustained time, we don't know. But if it happens to be 'weak' and only 5mW, you will blow up the IO port on your own processor when it wants to output 0V and you push the button. Because the button is very strong. (Often less than 0.1Ohm contact resistance). So you need to make sure that can't happen. The easiest is like this: simulate this circuit – Schematic created using CircuitLab Now in the same scenario, the 3.3V difference between your output and the button's forced 3.3V will fall mostly (rounded off you can say all of it) across the external 5.1k Resistor, because it's waaaaaaaaay larger than any other resistance in the system. That means that at most only: I = V / R = 3.3V / 5100 Ohm = 0.00065A = 0.65mA Will be flowing. Just about any device that is available to you, if not all, will be able to source and sink 2mA or more on a GPIO pin without any damage. It's usual these days to be more than 10mA and a Datasheet of the device or processor will usually tell you how much it is. So no damage. The new solution: You now need to protect both chips. You could do that by adding a resistor for both, but that won't work too well, because either one is the boss, or they divide the voltage across those resistors, effectively creating a three level voltage, observe: simulate this circuit If SW1 is on, and SW2 is on (i.e. connected to 3.3V), both chips agree and the line voltage will be 3.3V, all is fine, assuming the GPIO input is high impedance, which it very likely is. If they are both off (connected to 0V), they agree again, and the voltage will be 0V. Fine! The risk is, when no button is pushed but your device sends a signal, which is a likely scenario, or possibly the other way around, that one is on and the other off. The line voltage will become exactly half the VCC. That's not what you want and a very bad situation. Half VCC is in fact the worst possible situation you can have, because many logic level chips will get the input into an 'undetermined' state, where the electronics inside the chip might even start to oscillate, or just start consuming a lot of power for nothing. Bad. So you need to chuck in a couple of diodes to create an OR port: simulate this circuit Here when one of the switches is high and the other not, the diode for the one that's on will conduct, but the diode in the path of the one that is off will block any excess current going into that chip's output. Of course, that means you can't pull down the line actively any more, and when both are trying to set 0V, the GPIO Input will float for a while before leakages determine high or low. This is also bad. So you need a resistor pulling that line down, to make it go low in that case. Now you've basically made a small diode OR port. I used the BAT54 in the example, because they are Schottky diodes with a very low forward voltage at low currents, so they waste nearly nothing, but you could also use 1N4148 for a 3.3V or 5V logic level system, as they take only about 0.6V in this setup and that's still okay. With a 1.8V system, just warning you for the future, you may be much better off getting an actual OR port, since taking away 0.6V of 1.8V will put it way too close to the dangerous middle voltage. Even taking off only 0.3V might be close to a guaranteed limit in those low, low voltage ranges.
H: At the microscopic level, what exactly forces us into the "dark silicon" (i.e., the mismatch between transistor scaling and voltage scaling) problem? I've read that if you fix the TDP of a chip, you cannot use all of the transistors simultaneously any longer. This leads me to believe that each transistor requires the same power as in previous nodes even though they are smaller; i.e., we cannot use less power to switch a smaller transistor on or off. Why is this the case? What happens at the transistor scale that causes this phenomenon where we require a fixed power level for switching at the transistor gate (even as the transistor becomes smaller)? AI: I'm going to start my answer by going back to what I was taught at Uni - basically how each of the parameters of the transistor scale - an approach called "Constant Electric Field Scaling". Lets say we have a transistor, and want to scale it's length \$L\$ and width \$W\$ by, \$\alpha\$ (both are scaled to keep the aspect ratio the same). \$\alpha\$ Could be \$2\$, \$4\$, \$1.23\$, anything really. What happens? The material isn't changing, so to avoid breakdown, we want to keep the electric field across the transistor the same. $$E=\frac{V_{ds}}{L}=\frac{V_{ds}'}{(L/\alpha)} \Rightarrow V_{ds}'=\frac{V_{ds}}{\alpha}$$ The drain-source voltage of the transistor must scale - hence voltages go down. You can also say the same for the threshold voltage of the transistor (\$V_t\$) and the gate-source voltage, (\$V_{gs}\$). Again, for the electric fields to remain the same strength, specifically that across the gate oxide. \$E=\frac{V}{m}\$ so: $$T_{ox}'=\frac{T_{ox}}{\alpha}$$ So the gate get's thinner! This in turn changes the capacitance of the oxide: $$\begin{align} C_{ox}&=\epsilon \frac{WL}{T_{ox}} \\ C_{ox}'&=C_{ox}\times\frac{\alpha}{\alpha^2}=\frac{C_{ox}}{\alpha}\\ \end{align} $$ Why does the capacitance matter? Well, we can approximate the saturation current \$I_{d(sat)}\$. We can say: $$I_{d(sat)}\approx(\frac{V_{sat}C_{ox}}{L})(V_{gs}-V_t)$$ This means we can reasonably assume that: $$I_{d(sat)}'=I_{d(sat)}\frac{\alpha}{\alpha}\frac{1}{\alpha}=\frac{I_{d(sat)}}{\alpha}$$ I'm not going to go into it, but you can also work out that frequency \$f'=\alpha f\$, hence things can speed up as we scale down. Now, the dissipated power of each transistor can be approximated as: $$P=IV=I_d V_{ds}$$ So as the transistor scales: $$P'=I_{d(sat)}'\times V_{ds}'=\frac{I_{d(sat)}}{\alpha}\times \frac{V_{ds}}{\alpha} = \frac{P}{\alpha^2}$$ Notice how the power dissipation has gone down by the square of \$\alpha\$! So the power density \$U=P/A\$, will remain constant: $$U'=U\frac{\alpha^2}{\alpha^2}=U$$ This all looks great, it means we can keep scaling, and increase the number of transistors for the same amount of power, whilst getting faster and faster. Or does it? The thing is, there is another important consideration. In order to interact with the outside world, and for noise immunity, we can't keep reducing the voltage of the process - notice how in the above, all of the electric fields are kept the same by scaling the voltages. In practice this isn't done directly - the voltages are being scaled much slower than the size of the transistors. If they weren't, then by now CPUs would probably be running at 0.1V logic instead of 0.65V or so. The slightest amount of noise either on signals or power rails would be catastrophic. In practice, two different scale factors are used, one for size (\$\alpha\$) and one for voltages (\$\kappa\$). The scaling is something like this: $$ \begin{array}{c|c} Dimension & Scale Factor \\ \hline L, W, T_{ox} & 1/\alpha\\ A & 1/\alpha^2\\ V_{ds}, V_{gs} & 1/\kappa\\ E_{ds}, E_{ox} & \alpha/\kappa\\ C_{ds}, C_{ox} & 1/\alpha\\ I_{d(sat)} & 1/\kappa\\ P & 1/\kappa^2\\ U & \alpha^2/\kappa^2\\ f & \alpha\\ \end{array} $$ From this we can see that because of the two different scale factors, the power density, \$U\$, will go up if \$\alpha\$ is scaled faster than \$\kappa\$ is, which is what is happening in practice. Furthermore, this is a very simplified overview. It holds quite well if you have very large transistors, but as they get smaller and smaller, it doesn't hold as well as you might hope. Notice how two key factors \$T_{ox}\$ and \$L\$ get smaller? Well basically this means the barrier between the channel and gate is getting smaller and smaller, as is the distance between drain and source. The gate oxide thickness is now getting so thin, you can comfortably measure it in number of atoms thick! The distance between drain and source getting smaller also means the electric field between drain and source when the transistor is off starts to interact with the barrier created by the electric field of the gate. Both of these factors mean that the amount of leakage in the transistor - unwanted currents flowing from drain to source, or drain to gate, increase. If leakages go up, power dissipation goes up (and at some point the transistors stop working properly). This leakage is not factored in to the above derivations.
H: How can I power mutiple infrared LEDs through a single Arduino Uno pin? I'm doing this project where I control an RC car using infrared. Everything is perfect with 1 IR LED connected to a 220ohm resistor. I'm worried about the range of the signal so I'm thinking of using multiple IR LEDs (let's say 4 to 6 LEDs) to emit the signal. My problem is achieving this while controlling them through a single pin. For testing, I tried connecting 2 normal red LED in series through a 220ohm resistor and both of them became dimmer. The LEDs need to be bright. On hand now I have the IRF520 transistor. Will it work? I bought my IR LEDs online, while it doesn't say its part number it comes with this description: IR transmitter Emitted color: infrared Lens: 5mm, water clear 940nm wavelength Forward current: 50mA Forward voltage: 1-1.4V AI: Typical Collector Follower setup. simulate this circuit – Schematic created using CircuitLab Size the R1-R3 for your leds and current, choose a transistor that can handle that current. A common 2N3904 or 2n2222 type transistor would do for a few leds no problem. Edit: The IRF520 N Channel Power Mosfet is overkill for this but as the saying goes, there's no kill like overkill (Yes). Based on the LED specs you provided, you can skip multiple resistors per 3 leds. (Sized for 40 mA instead of 50mA). Add more in parallel as the other circuit. simulate this circuit
H: Why do motors buzz when are applied PWM? Why do motors (DC) make a buzz sound when a low duty cycle PWM is applied to them? Once I applied a 10% duty cycle PWM to a gear motor and it didn't move. just made a buzz sound. What does a low duty cycle do to a motor that makes it buzz? AI: When you drive a motor with a PWM signal, you are basically just turning it off and on very rapidly. If the motor is moving while this is happening, it's inertia (along with the winding inductance) smooth out the PWM signal such that the speed of the motor is proportional to the average time the motor is on. If you use a very low duty cycle, it means that the motor is turned on for only a very small amount of time each cycle. If the average power supplied to the motor is too small to overcome the friction and any load on the motor shaft, the motor will stall. In the case of PWM it will be turned on, stall, then be turned off, over and over again, which essentially makes it vibrate at the PWM frequency. If this frequency is nicely within the audible range for humans (anywhere from ~20Hz to ~20kHz), you will hear this vibration as a buzzing sound. The rotor vibrates in the magnetic field which is being turned on and off. You turn it on, it tries to rotate but can only move a small way before you turn the field off again, and which point it will stop moving again. It vibrates back and fourth. This may move any air around it, but also moves the whole motor - Newton's law: every action has an equal and opposite reaction! As the whole motor vibrates, the air around the motor will vibrate with it, making sound! Try putting the motor on a hollow box, this will amplify the vibrations of the stator and the sound will get louder. Conversely, press it on to something like a piece of rubber and that will damp the vibrations - it gets quieter.
H: How to make a boost converter circuit I've seen multiple different explanations on boost converter circuits, these two specifically explaining in very intimate detail how they work, and on how to calculate certain values: How to design a boost converter? And how to specify the inductor and capacitor values? Understanding Boost Converter the basic layout of a boost converter looks like this: simulate this circuit – Schematic created using CircuitLab In this example, the 1 volt input would be increased to a higher voltage across the resistor, which would be the load in this case. Problem: I need to switch a 5 volt current on the high side with an NPN switch (for many reasons this is the only switch layout available, no other layout will work as desired), so I need 7 volts to the gate to switch it, however only 5 volts are available. For this I need a boost converter that will convert 5 volts to 7 volts to be able to switch the switch But, I'm not sure how to calculate any of the values. For example, the solutions in the links I provided use the switching time of the switch, how can I find that? What size inductor and capacitor would I need? Also as an aside, the thing labelled "L" on the diagram, the inductor, what is it's purpose? AI: The simplest solution would be to use a small, integrated boost IC. For example here is one from TI, but there are lots of other choices from other vendors as well (The component value choices are clearly explained in the datasheet): TPS61046 However, you mention you need 2V above your 5V rail to switch your FET. Are you sure that you will be able to turn the FET fully on with 2V VGS? Most FETs have a threshold voltage in the 2V region meaning they are just starting to conduct there. You may want to switch the gate with 5V Vgs or a 10V boosted supply. If you don't need the FET to be on continuously, and you have a defined minimum off time you may be able to use a bootstrap circuit to generate the gate drive voltage. Without knowing more about what you are doing it's impossible to say if a that would work or not. You might start another thread with more details if you don't know how to make a bootstrap work. Finally, the purpose of the inductor is energy storage. When the switch is on the current in the inductor ramps up according to V=L*di/dt. The output voltage is held up by the output cap and the diode isolates the output from the switch. The energy stored is 1/2*L*I^2. Then when the switch turns off the inductor ramps down, though at this point the voltage across the inductor is in the opposite direction and equal to Vout-Vin. So the inductor provides energy to the output during the off time, allowing the output voltage to rise above the input voltage.
H: A question on transforming a non-inverting comparator to an inverting one? Here is the schematics for the question: I was using the LM311 as a non-inverting comparator without problem. It works fine and here is the output below: But if I use it as an inverting comparator, I get the following output below. As you see the output pulses have distorted tips. I circled one of them with orange color. Is my transformation of the non-inverting comparator to an inverting comparator just by swapping inputs correct? How can I fix those non-flat corners? AI: I suspect that this has something to do with the feedback loop (connected through R5 and R10). Your non-inverting comparator looks like: simulate this circuit – Schematic created using CircuitLab and your inverting comparator looks like simulate this circuit In the non-inverting comparator, you have positive feedback: when input > bias, the output swings high, which makes the input even higher! That way, the output voltage stays where it is. However, in the inverting comparator, you have a negative feedback loop: when the output goes high, it drags the input voltage a little bit lower, which makes the comparator turn back off. This is the "ringing" that you see. All you need to do (as I mentioned in the comments) is take out this feedback - a comparator doesn't need it. This should remove your overshoot.
H: Does CMOS J/K trigger need pull-up resistor I want to use J/K trigger and I was told that usually IC outputs need pull-up resistor, but if I understand it correctly the following J/K trigger is based on CMOS: TI J/K trigger And it seems to me that CMOS is capable of making both low and high signal, so there is no need for pull-up resistor, right? AI: There is no need for a pull-up or pull-down resistor on CMOS outputs (unless they are open-drain). Inputs should always have a pull-up, pull-down or be connected a valid logic level (another output or a supply rail, usually).
H: PCB plane cuts for audio paths in mixed-signal device I am working with the TLV320AIC3204 32-bit audio codec. The codec has three inputs and two outputs. While I was designing my own test PCB, I noticed on TI's evaluation board (on page 33) that they have cuts in the copper on all the planes which separate some of the inputs and outputs. It seems they have IN1/IN2 separated from IN3 by a plane cut and then the HP/Line-out outputs cut off as well. For example, the third layer looks like this: I'm curious what the purpose of these cuts for the audio paths? I've never seen any documentation discussing the cuts between audio paths/channels across all of the planes, only ones between digital and analog ground planes, which some suggest those aren't even needed. I don't really understand it since all the audio channels are using the same analog ground plane. AI: The mic area is probably isolated that way because it can have a very high output/input impedance, making it extremely sensitive to voltage noise. It looks like it has to traverse the whole circuit board (from edge to middle) without any buffering... this would make it extremely succeptible to both digital signals and audio crosstalk. Additionally the headphone out can feed a relatively low impedance, so this could cause voltage noise across the ground plane. (ground bounce, ground loop) This isolation scheme keeps this at bay by keeping both unwanted voltages and unwanted currents out of sensitive areas. As you point out, it may not be necessary depending on what you're doing and how you're doing it, but the dev board designer felt it was the best way to go for the demo.
H: Circuit on a breadboard is not working properly I have built the following circuit but it doesn't seem to work properly! The sound from the speaker should be maintained until the power is cut off but it is only maintained as long as the reed switch is ON. I have tried to built it again and again based on different equivalent circuits but it doesn't work! What is the problem? The original schematics is the following: simulate this circuit – Schematic created using CircuitLab The equivalent schematic and the circuit I built on the breadboard are the following: simulate this circuit AI: TL/DR : the circuit seems to be working as intended. I think you misunderstood the (bad) explanation on the linked page: Diode D2 which is linked with the switch S2 begin its conduction and offers power supply the transistor T1 and T2, which is in the waking state and as a result sound comes from the speaker attached to it. But in this instance a high frequency tone comes out which is a sign that there is some intruder present around the locker. The sound that came from the speaker can only be stopped by cut off the power supply. "... switch S2 ... offers power supply the transistor T1..." actually S2 provides base current to T1, the "power supply" is permanently connected to T2 and other components. That being so, it's easier to understand "stopped by cut off the power supply" to mean, stopped by cutting off T1's base current - i.e. releasing the switch. There would need to be some other arrangement to supply T1 base current, perhaps driven from the oscillation, or a separate latch also triggered from the switch, for the buzzer to continue until power was removed.
H: Can you connect in series 2 unequally charged batteries? So I have 4 batteries. 2 of them are charged (about 70%) and 2 about 10%. I have a flashlight (which uses 2 batteries in series) which I would like to power at small current and voltage because the light produced is too powerful. Would combining a charged battery and discharged battery be a good idea? If not, what can I do? I thought of placing a piece of iron where the discharged battery would be so it conducts the current from the first one. Would that work? Note that they are single use batteries. Thanks in advance! AI: This sounds like a bad idea. Besides the fact that it says not to do this on the battery package, here is the reason: simulate this circuit – Schematic created using CircuitLab As you can see, the batteries that are used have a lower cell voltage, but also a higher internal resistance. They aren't contributing much to the power delivery, and they will dissipate quite a lot in heat! This will eventually rupture the battery. Your bypass might work if the circuit is capable of using a lower voltage, and the batteries you use are capable of delivering a higher current to compensate for the reduced voltage.
H: Qucs How to add 10uF Polarised Capacitor I'm new to this site. I have a small experiment. I did trying to make a circuit from a schema that needs 10uF Polarised Capacitor in the schema. I use Qucs (Quite Universal Circuit Simulator) qucs.sourceforge.net as the tool. But I couldn't find the Polarised Capacitor there. Does anyone know where is it ?, xD. Hehe sorry I barely learn about E-Engineering. Thanks before AI: To transform the component symbol in a polarized capacitor, once you put it in the scheme: you double-click to open the properties window. There are three options: C to the value of capacitor, V for initial voltage and Symbol to select between neutral and polar. The polar version: Note: version 0.0.18 of Qucs
H: Add a timer LM555C on Qucs Does anyone know how to add a timer on Qucs ? The component's navigation bar doesn't help at all, It confuses me, I can't find a timer. I wondering, perhaps It could be added through library. In this case, I need to add LM555C timer on my circuit. AI: There is no model for that component. What you can do is to model it as explained here.
H: Programming ARM Option Bytes using Assembly Directives So, having a look at the datasheet for a specific ARM controller, we find the address space to be mapped out as follows: There are number of ways to accomplish this, one of which is through an auto-generated file that has the following (condensed) contents: ; Option byte organization ;------------------------- ; Address [31:24] [23:16] [15:8] [7:0] ; 0x1FF80000 - nRDP - RDP (0xFF5500AA) ; 0x1FF80004 - nUSER - USER (0xFF870078) ; 0x1FF80008 nWRP1 nWRP0 WRP1 WRP0 (0xFFFF0000) ; 0x1FF8000C nWRP3 nWRP2 WRP3 WRP2 (0xFFFF0000) FLASH_OPT EQU 1 RDP EQU 0xAA nRDP EQU RDP:EOR:0xFF WRP00 EQU 0x00 WRP01 EQU 0x00 WRP02 EQU 0x00 WRP03 EQU 0x00 nWRP00 EQU WRP00:EOR:0xFF nWRP01 EQU WRP01:EOR:0xFF nWRP02 EQU WRP02:EOR:0xFF nWRP03 EQU WRP03:EOR:0xFF USER EQU 0x78 nUSER EQU USER:EOR:0xFF IF FLASH_OPT <> 0 AREA |.ARM.__AT_0x1FF80000|, CODE, READONLY DCB RDP, 0x00, nRDP, 0xFF DCB USER, 0x00, nUSER, 0xFF DCB WRP00, WRP01, nWRP00, nWRP01 DCB WRP02, WRP03, nWRP02, nWRP03 ENDIF It appears as if this file is simply giving a nicely configurable way to set these option bytes, but how is it being done? I did a bit of research and it turns out that the AREA directive tells the assembler to generate a new area, in this case a code area that will be read only. Further, the DCB directive allocates memory, in this case 16 bytes, and initializes them with the respective values given. My question, then, is where is the specification regarding this newly allocated memory block's location? Namely, how does the value of this 16 byte block get written to the appropriate registers (0x1FF80000, etc) ? The only mention of this address is given by the |.ARM.__AT_0x1FF80000| argument passed to AREA. However, this first argument is only the name of this new area according to the documentation. Or maybe the better question is: How can we specify where an AREA will be stored in memory? AI: The ARM linker automatically places sections prefixed with __at in the specified address. In C code, you would specify the section using the section attribute, like this: // place flash_key in a section called .ARM.__at_0x8000 long flash_key __attribute__((section(".ARM.__at_0x8000"))); You can control the behaviour by passing --autoat or --noautoat to the linker. See Placement of a key in flash memory with an __at section from the ARM Linker User Guide for more details.
H: Not able to perform operations based on the data received to MCU through UART? I have been trying to do a simple operation based on the data byte received by the MCU(pic18F) from the PC terminal through UART. The operation is turning ON an LED depending on the content of the received data byte. So here is the code for the logic: char data = 0; unsigned char UARTReadByte() { while(!PIR1bits.RCIF); //Wait until the receive buffer is full return RCREG; //Return received byte } void main() { TRISAbits.TRISA1 = 0 UARTInit(); //Initialize UART LCDInit(); //Initialize LCD while(1) { data = UARTReadByte(); //The received data from the virtual terminal (UART) is stored in another variable char Write_Command(0x80); Write_data(data); //Display the received data on the LCD if(data==1) //check if the data is 1, if 1 turn ON the LED PORTAbits.RA0 = 1; } } The received number is displayed on the LCD, however the LED is not turning ON. I presume the MCU is not able to check and validate the received byte due to issues in the data format. Can anyone help me with solving this problem. Thank you all in advance. AI: If you are sending an ASCII character "1", then your if statement should be if(data == '1') as you have it, you are comparing the received character to the hex value 0x01 but the ASCII character '1' is 0x31.
H: Does a MicroControllers resistance change with computation? Does the load resistance of a micro-controller change based on particular programs or instructions that it is currently running? Does adding in extra functionality of the device also have an effect on the resistance, such as Timers, ADC, Interrupt Service Routines etc? For a follow up question, I see in a lot of the electrical characteristic sections of uC datasheets that higher frequency requires more current from the supply source. What is the actual cause of that? Shouldn't the overall current draw be unaffected by the clock speed? That is to say, on average, if I've got a program that spends half the time executing x instruction and the other half of the time executing y instruction, speeding that process up doesn't change the relative proportions of time spent in the different states. From the datasheets I've seen, it's not a 1-1 relationship, so doubling the speed won't double the current draw. So is it correct to assume that it's got to do with switching losses in the digital gates? AI: You can't really think about a microcontroller in terms of resistance. It's built with transistors, and these do not behave like resistors. Generally, most microcontrollers (and most highly-integrated digital logic) are CMOS devices. This means that all of the logic gates inside are built out of complementary pairs of N-channel and P-channel MOSFET transistors. One characteristic of CMOS logic is that it consumes the most power when switching. This is because the transistor gates look like capacitors, and these capacitors have to be charged up whenever the logic level is changed. At idle, little power is drawn. The power consumed during switching is called dynamic power. The general formula for CMOS dynamic power consumption is P = C * V^2 * f. So the power consumed is proportional to the capacitance of the traces and transistor gates, the frequency, and the square of the voltage. Now, this is not the complete story - there will also be some leakage current that makes its way through the transistors. The leakage current increases with higher supply voltage, and it increases as the transistors get shrunk down on newer processes. Any component inside of the chip that switches will consume power. So yes, any peripherals that are enabled will increase power consumption. Different processor instructions will consume different amounts of power as they will activate different logic. Even the data being processed can have an effect on power consumption. This is why it is possible in some cases to recover cryptographic keys by looking at the power consumption during computation.
H: Atmel Studio 7.0 update loop Atmel Studio started asking me this morning to repair itself: After 15 minutes, the repair is done: Running the application, it shows again the first image: I've done this loop three times, so far. How can I exit this loop? I use Windows 8.1. AI: uninstalling and reinstalling worked.
H: Smartest way to charge 18650 batteries when they are used in series I'm wondering how I could/should charge the 18650 batteries used in the following circuit. I want to charge them via USB in a power bank case like this. But I probably won't be able to use the existing charging circuit because I'm using the batteries in series to get more voltage. simulate this circuit – Schematic created using CircuitLab AI: Use a boost converter to make the higher voltage. This also allows you to control how much current is getting dumped onto the batteries. These kind of batteries need to be carefully monitored while charging and discharging if you want to get full capacity and long lifetime. A microcontroller directly controlling the switch of the boost converter is probably the electrically simplest way to achieve that. There should also be a way to measure the voltage of each cell separately, and optional current shunts around each cell. The micro watches the voltage of each cell, and performs cell balancing by enabling the current shunts across any cells above the average voltage, then shut down charging altogether when the cells reach the maximum safe voltage. The micro can control the charging current since it is controlling the switch of the boost converter. It can either measure the current and perform control that adjusts the PWM duty cycle to get the desired current, or it can compute the current open loop by knowing the voltages and the inductance.
H: Getting a stable value from sensor? I am working with Omron Pressure sensor D6F-PH . When i try to read the pressure value i am unable to get a stable value. I tried averaging but even that doesn't help. Could somebody suggest me a trick/ techniques to help in my situation. AI: The first thing to do is look carefully at the electronics around the sensor, particularly its power feed. Make sure the ground is solid and well connected back to where the measurement is being done, and that the supply is clean. I'd put maybe two ferrite chip inductors in series with the supply, and 20 µF or so to ground after each. That should smooth out ripples from switching noise and the like. If the supply voltage is not well regulated, then use a bit higher unregulated supply voltage, add the ferrite chip inductors and caps, but have that feed into a LDO which then feeds the transducer. Once you have the electrical side clean, the rest is firmware. You said you "averaged" the values, which implies a naive box filter. Sample the signal as fast as your micro can handle, then apply maybe two poles of   FILT <-- FILT + FF(NEW - FILT) Each of these is the digital equivalent of a R-C low pass filter. Figure out what step response you really need, and adjust the filters accordingly. This has been discussed many times here before. For example, I go into detail on such filters at https://electronics.stackexchange.com/a/30384/4512.
H: error with VHDL CODE FOR FFT I have a VHDL code for implementing FFT using butterfly. Its 4 input and 8 output. There are 2 VHDL files one for fft package and the other for the architechture, inside the fft pachage the butterfly is defined using procedure. If I compile both the fft package and the architecture they show no errors. I am trying to change the procedure to function inside the fft package code but when I change it to function and compile the fft package code, it shows no errors. However if I compile the architecture file again it shows errors near the butterfly! Is there something wrong with my transforming from procedure to function? The code that works with procedure is as follows: (fft package code) library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; package fft_package is TYPE complex IS ARRAY(0 TO 1) OF INTEGER; CONSTANT w0 : complex := (1, 0); --Pre-computed constants CONSTANT w1 : complex := (0, -1); --Pre-computed constants PROCEDURE butterfly ( X1 : in complex; X2 : in complex; W : in complex; Y1 : out complex; Y2 : out complex ); END fft_package; package body fft_package is PROCEDURE butterfly (X1 : in complex; X2 : in complex; W : in complex; Y1 : out complex; Y2 : out complex) IS BEGIN -- G1 = X1 + W*X2 Y1(0) := X1(0) + ((W(0)*X2(0)) - W(1)*X2(1)); -- G1 real Y1(1) := X1(1) + ((W(0)*X2(1)) + W(1)*X2(0)); -- G1 imaginary -- G2 = X1 - W*X2 Y2(0) := X1(0) - ((W(0)*X2(0)) - W(1)*X2(1)); -- G2 real Y2(1) := X1(1) - ((W(0)*X2(1)) + W(1)*X2(0)); -- G2 imaginary END butterfly; end fft_package; (architecture code) entity fft_block is Port ( X1 : in STD_LOGIC_VECTOR (7 downto 0); X2 : in STD_LOGIC_VECTOR (7 downto 0); X3 : in STD_LOGIC_VECTOR (7 downto 0); X4 : in STD_LOGIC_VECTOR (7 downto 0); CLOCK : in STD_LOGIC; aY1_R, aY1_I : out STD_LOGIC_VECTOR (7 downto 0); aY2_R, aY2_I : out STD_LOGIC_VECTOR (7 downto 0); aY3_R, aY3_I : out STD_LOGIC_VECTOR (7 downto 0); aY4_R, aY4_I : out STD_LOGIC_VECTOR (7 downto 0)); end fft_block; architecture Behavioral of fft_block is begin process (CLOCK) VARIABLE g0_1, g0_2, g0_3, g0_4 : complex; VARIABLE g1_1, g1_2, g1_3, g1_4 : complex; VARIABLE g2_1, g2_2, g2_3, g2_4 : complex; begin if CLOCK='1' and CLOCK'event then g0_1(0) := CONV_INTEGER(X1); g0_1(1) := 0; g0_2(0) := CONV_INTEGER(X3); g0_2(1) := 0; g0_3(0) := CONV_INTEGER(X2); g0_3(1) := 0; g0_4(0) := CONV_INTEGER(X4); g0_4(1) := 0; --G1 butterfly(g0_1, g0_2, w0, g1_1, g1_2); butterfly(g0_3, g0_4, w0, g1_3, g1_4); --G2 butterfly(g1_1, g1_3, w0, g2_1, g2_3); butterfly(g1_2, g1_4, w1, g2_2, g2_4); end if; -- Outputs aY1_R <= std_logic_vector(to_signed(g2_1(0),aY1_R'length)); aY1_I <= std_logic_vector(to_signed(g2_1(1),aY1_R'length)); aY2_R <= std_logic_vector(to_signed(g2_2(0),aY1_R'length)); aY2_I <= std_logic_vector(to_signed(g2_2(1),aY1_R'length)); aY3_R <= std_logic_vector(to_signed(g2_3(0),aY1_R'length)); aY3_I <= std_logic_vector(to_signed(g2_3(1),aY1_R'length)); aY4_R <= std_logic_vector(to_signed(g2_4(0),aY1_R'length)); aY4_I <= std_logic_vector(to_signed(g2_4(1),aY1_R'length)); end process; end Behavioral; the previeous code works well but when i change the procedure and uses the function inside the package i get the error here is my code for the fft package using function: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; package fft_package is TYPE complex IS ARRAY(0 TO 1) OF INTEGER; CONSTANT w0 : complex := (1, 0); --Pre-computed constants CONSTANT w1 : complex := (0, -1); --Pre-computed constants function butterfly(X1, X2 , W : complex )return complex; END fft_package; package body fft_package is function butterfly ( X1, X2 , W : complex )return complex is VARIABLE Y1, Y2 : complex; BEGIN -- G1 = X1 + W*X2 G1:Y1(0) := X1(0) + ((W(0)*X2(0)) - W(1)*X2(1)); -- G1 real Y1(1) := X1(1) + ((W(0)*X2(1)) + W(1)*X2(0)); -- G1 imaginary -- G2 = X1 - W*X2 Y2(0) := X1(0) - ((W(0)*X2(0)) - W(1)*X2(1)); -- G2 real Y2(1) := X1(1) - ((W(0)*X2(1)) + W(1)*X2(0)); -- G2 imaginary return Y1; return Y2; END butterfly; end fft_package; Does anybody know why I get errors when I compile the architecture file after changing the procedure to function inside the fft package? I got the same four errors and all are near butterfly! Why? As mentioned in the comments below [the answer from Martin] I got no errors with the previous code when compiling it. But, the testbench is not created as I mentioned in the comments. AI: Your synthesis / simulation tool seems not to automatically recompile all dependent VHDL files after you manually recompiled the changed VHDL package. Thus, errors are reported only after you manually recompiled the "architecture file". You have not shown us the concrete error message, but you cannot simply replace a procedure by a function. A procedure can have several output parameters (keyword out) and the procedure call makes up (a whole) concurrent or sequential statement like in your example: butterfly(g0_1, g0_2, w0, g1_1, g1_2); -- sequential statement in your example A function can have only input parameters and the return value is the only "output". The function call can be part of an expression. For example you can assign the function result to a variable: g1_1 := butterfly_y1(g0_1, g0_2, w0); -- function which calculates Y1 g1_2 := butterfly_y2(g0_1, g0_2, w0); -- function which calculates Y2 I have splitted up your procedure here into two functions, one which calculates the Y1 part and another for Y2. Another option would be use to use a record of signals for the result of the function as Brian pointed out. EDIT splitted butterfly functions: function butterfly_y1 ( X1, X2 , W : complex )return complex is VARIABLE Y1 : complex; BEGIN -- G1 = X1 + W*X2 Y1(0) := X1(0) + ((W(0)*X2(0)) - W(1)*X2(1)); -- G1 real Y1(1) := X1(1) + ((W(0)*X2(1)) + W(1)*X2(0)); -- G1 imaginary return Y1; END butterfly_y1; function butterfly_y2 ( X1, X2 , W : complex )return complex is VARIABLE Y2 : complex; BEGIN -- G2 = X1 - W*X2 Y2(0) := X1(0) - ((W(0)*X2(0)) - W(1)*X2(1)); -- G2 real Y2(1) := X1(1) - ((W(0)*X2(1)) + W(1)*X2(0)); -- G2 imaginary return Y2; END butterfly_y2;
H: Why this simple DC Motor + PWM circuit is not working? I have the following circuit to adjust the speed of a DC motor based on PWM signal (Arduino, 5V) applied to the base of a BJT transistor, but it's not working. The motor doesn't move but I do hear a faint of buzzing sound from the inside. The PWM is working just fine, I tested it out with an LED + current limiting resistor. The motor works OK when I make a short between transistor's collector and emitter. Anybody knows what's the problem with the circuit? How can I fix this? EDIT: Q1 is an NPN BC547 transistor. PWM signal comes from a 5V pin of an Arduino board. Please check the 9V motor's spec here. AI: One way to understand a transistor when it is used as a switch is to assume that when the transistor is fully "on" the voltage between its emitter and base is 0.6V. If you look at your system, when the Arduino sets the PWM pin to 5V. the voltage between the base and the emitter is 0.6V. Thus the voltage across the motor is 5-0.6=4.4V. I don't know what's the specs of your motor, but 4.4V seems too small. Using your components, there is a way to obtain almost 9V across your motor. See the following schematics : simulate this circuit – Schematic created using CircuitLab Here you can see that when your transistor is conducting, the motor would see almost 9V and may run faster than just "buzzing".
H: Decreasing the resistance in the input circuit of a transistor and its effect on the output current and voltage With reference to this circuit: Question: When the resistance \$R\$ is decreased, how does the lamp's brightness and the voltmeter's reading change? My answer: The input resistance of a transistor circuit is given as \$r = (\frac{\Delta V_{BE}}{\Delta I_{B}})\$. So when R decreases, \$r\$ decreases, and hence \$\Delta I_B\$ increases (as they are inversely proportional from the equation). From the output characteristics, an increase in \$I_B\$ leads to an increase in \$I_C\$ and therefore the current in the lamp increases; leading to it getting brighter. As \$I_C\$ gets higher, voltage in the output circuit increases and the voltmeter has a higher reading as compared to its initial value. Answer given: Even though my notion that the brightness and the voltmeter increases is right, my reasoning is quite wrong. How does the circuit become "more forward biased" when \$R\$ is decreased? And why is it that \$I_B\$ decreases while \$I_C\$ increases. Why aren't both of them increasing? And if possible, could you say why my concepts are wrong? AI: I will divide the answer into two parts: 1) (r=(ΔVBEΔIB)) is the formula for dynamic resistance when the input is A.C. Here you should apply the KVL. (Vbb – IB Rb = 0.7). Thus, decreasing the value of R will increase (Ib). And if the transistor is in active region, Ic will be proportional to Ib and hence the bulb will glow brighter. 2) If you keep on decreasing the value of R, transistor will enter into saturation. I am guessing the book means to say saturation by using the term more forward biased. Because in saturation, (VCE) = 0.2V.
H: Conversion of RS232 to USB Can anybody explain how FT232R or CP2102 or some Serial to USB converter and it magically appears as COM port on PC? I would appreciate a detailed explanation on how the conversion happens. Some basics on USB protocol also. I have thoroughly read the datasheet. Couldn't comprehend it. AI: There is no magic and if there was it is on the PC side not in the actual chip. When a USB device is connected to a host it enumerates, it communicates to the PC ID numbers and requests power and endpoints. Endpoints are how USB communicates, data is moved from device endpoint to host endpoint and back. All the USB protocol guarantees is this endpoint to endpoint flow of data. When the host receives the ID numbers it loads drivers for the device. If anything else it's these drivers that have the magic. It is up to them to interpret the data coming into the endpoints and place data to go out of the endpoints. The actual implementation is proprietary but there are some opens source USB to serial device code you can read.
H: Should the output of logic gate have pull-up or pull-down resistor I am a bit confused whether my chosen AND gate should have pull-up or pull-down resistor on the outputs, as I don't see any sentence containing words like pull-up/down or sink or source ... but as far as I understand then TTL IC's usually need pull-up/down resistor on the output. When I am looking at the schematics then I would say it is capable of making both high and low, as there are transistors connecting the output to both Vcc and Vdd. Here's the datasheet: triple input AND. I am also using NOR gate which states that it is totem pole output: Diodes Incorporated and part number: 74AHCT1G02W5-7 (sorry, not enough reputation to post more than 1 link :D). Am I right that it is capable of making both low and high output, but the high means it is only 3.5V as there are voltage drops across transistor junctions so I would have to use pull-up resistor on the output so it would be 5V. Schematic snippet I have at the moment: Some additional explanation is also much appreciated so I would have the know-how for the future how to read out the necessary info from the datasheet. AI: An open-collector or open-drain output would always need a pull-up resistor to get a defined voltage level. But you are not using such an output. TTL outputs have defined voltage levels for both low and high signals, but the high level can be as low as 2.4 V (depending on how much current the output must supply). This is no problem for TTL inputs (which interpret any voltage above 2 V as high), but can be a problem for other logic families. CMOS outputs go up to almost the supply voltage, and go down to almost ground level (because they do no use bipolar transistors but MOSFETs). Therefore, CMOS inputs are quite strict (typically, low-level signals must be below 30 % of VCC, and high-level signals, above 70 %). If you want to connect a TTL output to a CMOS input, you need a pull-up resistor to raise the high level signal. (Connecting a CMOS output to a TTL input works just fine.) (In the datasheets, the guaranteed output levels are specified as VOL and VOH, and the required input levels as VIL and VIH. An output and an input match if \$V_{OL} \leq V_{IL}\$ and \$V_{OH} \geq V_{IH}\$.) LS is a TTL family; HCT is a CMOS family that has TTL-compatible inputs. So in your case, you do not need a pull-up resistor to get a correct voltage level. There might be other reasons to use pull-up/-down resistors, for example, to get a defined signal when the chips are still in reset and do not drive their outputs either way.
H: What causes the voltage drop in a realistic voltage source when the load current increases? The realistic(practical) voltage source is modeled as an ideal voltage source plus a series resistor R in the above figure. In an ideal voltage source whatever the current load is the voltage would remain the same. Apparently in a practical voltage source when the load current increases the imaginary series resistor will cause a higher voltage drop. I think the wire resistance between the source and the load is not the issue here, since we are talking about the voltage change accross the power-supply terminals. My question is then: What is this series resistor in a power-supply? What causes it to exist? Is that the change in Thevenin equivalent resistor? AI: Real power supplies come in all sorts of varieties, so the details of the source resistance vary. Common to all power supplies is the fact that they have internal conductors. These conductors (internal wiring) will act to drop voltage with current. This wiring will create a "real" series resistance. Batteries have another effect. Current is produced by electrochemical reactions, and these reactions only occur so fast. In a lead-acid battery, for instance, sulfuric acid reacts with the lead/lead oxide terminals, and once the sulfuric acid has reacted new acid must take its place, and this takes time. As a result, the maximum current is limited by the geometry of the battery plates and this shows up as drop in voltage as current increases. This is modeled as a series resistor, although there is no physical unit which causes the voltage drop. A good power supply these days will sense the output voltage, and adjust the voltage of the internal source to compensate for internal voltage drops, and for slowly changing loads will approximate an ideal voltage source quite closely.
H: Can I use IRFZ44N to ground the ground of 7805? I have been trying to use IRFZ44 as low side switch to ground the ground terminal of an optional 7805 that I wish to use whenever I want. For this I have connected the drain terminal to to circuit ground and the source to 7805 ground. The 7805 Vin is already connected to 12V. The MOSFET was turning on and off when the voltage regulator 7805 wasnt in the circuit. But after inserting it what I observed that when the MOSFET is turning On, the source voltage remains 0V, while the drain voltage attains a stable 9V! At the same time the 7805 isnt getting the circuit ground. Cannot understand why is this happening. Any help is appreciated. Thanks in advance! AI: If you are trying to disable the 7805 by disconnecting its ground connection with the FET, it likely won't work. The 7805 is not designed or guaranteed to be off when its GND is open.
H: In microcontroller (AVR), the interrupt vector take address $0000 to $003A so the program is start after that address? I'm studying microcontroller using Atmel 8-bit microcontroller datasheet, According to the datasheet, there's 3 types of internal memory in microcontroller Flash memory = program memory SRAM: 32 general purpose register as well as I/O register is located here EEPROM So, when program counter (PC) fetchs instruction, it will fetch from flash memory where the program (instructions) is stored, starting from $0000 but then when I read interrupt chapter (ATmega 2560) , it says that interrupt vectors is stored at $0000 to $003A in program memory then does it mean when the microcontroller starts, PC will go through the interrupt vector list first and then instructions later? Moreover, the interrupt is enabled by instruction which come after $003A so when the PC start from $0000 to $003A, microcontroller do nothing because at that time, intteruption haven't enabled yet? I'm currently use two datasheet, Atmel ATmega 2560 and ATmega 16A AI: The first vector in the interrupt vector table (located at 0x0000) is the "Reset Vector". This is the first program memory address which is read by the CPU on power up1. The location in memory is usually filled with a JMP or RJMP instruction where the jump address is the start of your program. If the reset vector is not correctly programmed (e.g. with an RJMP instruction or whatever), the CPU will simply keep counting along executing instructions as they appear - e.g. executing other interrupt vectors if there. If there are any other interrupt routines programmed into the vector table, these would all be executed in turn regardless of whether it's interrupt source was enabled or disabled. When using something like avr-gcc, it is aware of the interrupt vector table and its structure, and will make sure that the reset vector points to the start of your program. In this case, the start of the program is actually not your main() function, but a load of stuff the compiler adds to initialise variables and whatnot. But after all of the initialisation stuff, your main() function would be called. As an example, this is the disassembled vector table for one of my programs: 0: 0c 94 72 00 jmp 0xe4 ; 0xe4 <__ctors_end> 4: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> 8: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> c: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> 10: 0c 94 4f 03 jmp 0x69e ; 0x69e <__vector_4> 14: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> 18: 0c 94 ef 03 jmp 0x7de ; 0x7de <__vector_6> 1c: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> ... 6c: 0c 94 8f 00 jmp 0x11e ; 0x11e <__bad_interrupt> Notice how avr-gcc adds a jump at address 0x0000 to what it calls __ctors_end which is basically a memory address after the end of the vector table where it's initialisation stuff starts. All unused vectors jump to something called __bad_interrupt - located at the destination of that jump is basically another jump instruction back to 0x0000 such that any occurrence of an unhandled interrupt resets the processor. 1. Some AVRs have a bootloader space and can be programmed to have the interrupt vector table at a different address than 0x0000, but the same still applies.
H: please help identify the temperature sensor on this PCB The PCB is the wireless (outside) sender unit for an inside/outside thermometer. I want to create a temperature probe from this PCB so that I can measure a temperature in a very specific place. I need help identifying the temperature sensor component on the PCB. I have had no luck pinning it down with freeze spray. Maybe it's the pair of transistors? (you can view the images at high resolution by doing right-click > view image) Following on from the accepted answer (thanks!), I tried moving the component out into a probe. Temperature agrees with my current wired solution. AI: The following 4 principles of temperature sensors are most common: thermistor, thermocouple, resistive temperature detector (RTD), silicon bandgap. Thermocouple and RTD. Not visible on the photos. In addition, they are rarely found in consumer goods that measure around human temperature range. Thermocouples and RTDs require signal conditioning and excitation circuitry, which increases cost. prediction: Unlikely Silicon bandgap temperature sensors are found in consumer goods sometimes. They are packaged like transistors or ICs. They may be embedded inside microcontrollers or ASICs. prediction: Plausible Thermistor produce a strong signal and don't require much signal conditioning. It's a cost-effective way of measuring temperature in the human range. These are used in consumer goods. prediction: Plausible Hit with chill spray, see what happens.
H: Understanding current, voltage and resistance I'm still trying to wrap my head around current, voltage and resistance, and slowly I have the feeling that I start to get some things. Hence, I would like to describe my understanding so far and ask whether it's correct so far. Current, voltage and resistance First of all, inside of a circuit there's a stream of electrons. While technically they go from the negative to the positive end, we usually consider it to be the other way round. Now since it's a stream, we can count how many electrons pass an arbitrary point in the circuit in a specific amount of time. This is what is called current, and it's measured in Ampere. So: 1A is so and so many electrons per time frame. Something has to make the electrons move. The force that makes them move is the voltage, and it's measured in Volt. Finally, there is resistance, and it's measured in Ohm. While voltage "drives" electrons, resistance slows them down. We have: 1V is the force needed to move 1A over a resistance of 1 Ohm. If we increase the voltage, we get a higher current; and if we increase the resistance, we get a lower current. If we multiply current and voltage, we get the actual power, which is measured in Watt. Is this correct so far? Short circuits Now, if we have a 9V battery, and we connect both of its poles directly using a wire, there is almost no resistance. Using Ohm's law, we get a very high current due to the extremely low resistance. This results in a huge amount of energy moved in a very short time, hence the wire and the battery heat up, and this is what we call a short circuit. Adding an LED Now let's make an LED brighten up. Since an LED is a diode, electrons can only flow through it in one direction. So let's connect the LED's anode and cathode to the battery's poles, and see what is going to happen. The LED causes a voltage drop of, let's say 2.5V, and is able to handle a maximum of 20 mA. Now if we connect it directly to the battery, yes, well, what is going to happen? I know that we should add a resistor, and I even know how to calculate it, but I can not explain why this is, or to put it another way round: What would happen if we did not add a resistor. Let me explain this: I know that if we have a 9V battery, and the LED drops 2.5V, there still need 6.5V to be dropped. Since the LED handles 20 mA, and current is everywhere the same in a circuit, we need to calculate: 6.5 / 0.02 = 325 Hence, we need a resistance with 325 Ohm. Since the resistor now drops 6.5V voltage, overall we drop 6.5V + 2.5V = 9V which is exactly the potential of the battery. Also, it doesn't matter whether we put the resistor before or behind the LED into the circuit, as all that counts is the drop overall. So everything is fine. Open questions But what happens if we do not add the resistor? In this case I have some questions that I am not able to answer: The LED drops 2.5V, but the battery's potential is 9V. What about the "missing" 6.5V? Where are they? What happens to them? What happens to the battery, and what to the LED? If we do not add a resistor, I guess the current will be way too high for the LED, so I guess we will have a short circuit, but now with an additional blowing LED, right? What is the actual current in the circuit? AI: But what happens if we do not add the resistor? ... The LED drops 2.5V, but the battery's potential is 9V. What about the "missing" 6.5V? If you have a battery and LED with no current-limiting resistor, then you basically have the same scenario as when you just connect a wire across the two battery leads, but now with only 6.5 V instead of 9 V. Basically, in this scenario you can no longer neglect the internal resistance of the battery or the forward resistance of the LED (and possibly the resistance of the wire) if you want to determine the actual current. A very large current is produced. What happens to the battery, and what to the LED? Like in the short-circuited battery case, the battery heats up. If the LED is only rated for 20 mA, and you put 100 mA or 1 A through it like you might in this situation, then very quickly the light-emitting diode becomes a smoke-emitting diode (at least momentarily) and then it usually becomes an open circuit. What is the actual current in the circuit? As I mentioned above, you need to consider the internal resistance of the battery and the equivalent resistance of the LED, and maybe the wire resistance. From these you can estimate the actual current. You probably can't calculate it exactly because the numbers depend on temperature, which will be rapidly changing as the circuit heats up and then cools down after the LED pops.
H: Why is processing power and memory in smartcards so limited? Why is it that common smartcards like the SLE5528 are almost always limited to <16K of available memory, and a very slow 8 bit processor? What is the limiting factor that makes it technologically/economically infeasible to raise these limits? EDIT: Maybe I should give some more background on why I'm asking this question. For a customer at work we had to integrate a smartcard module which basically acted as a keystore (similar to the ones you can use in high-level programming libraries like PKCS11). We were constantly hitting the limits of this device (can't store more than a few keys, can't store any key larger than 1k, have to wait at least 5 seconds before fetching the key list, etc.). The only person at our supplier's end I could reach was a vendor that gave me the "That's the way smartcards work" answer. It's not like there is no real market for storing RSA keys of size >4K on a card. I'd love to know the real reason behind this. AI: Why is it that common smartcards like the SLE5528 are almost always limited to <16K of available memory, and a very slow 8 bit processor? What is the limiting factor that makes it technologically/economically infeasible to raise these limits? It's the extra price caused by the security features that drive up the price. Technically you can't compare the non volatile memory of smart-cards with normal flash or eeprom memory. For example it is possible to open up normal flash memory, bond wires onto the die and read out the memory content. With smart-cards this should not be possible (or more realistically: It should be so complicated and expensive that it's not worth it). The same is true for the CPU. Smart-card CPUs have a ton of built-in security features that aren't required for normal CPUs at all. They should for example not leak any information on the code that they execute by the amount of current they draw, or leak anything by RF radiation. That said, all these side-channel blindings have a price not only in the manufacturing cost but also in computational performance. It's just more important to be secure than to be fast. That said, smart-cards with more memory are available. You can buy them with more than 100kb memory. They are expensive though. The recommendation in the comments to change the keys from RSA to ECC is a very good one. The key size of ECC compared with RSA at the same level of security is much smaller. So you get more out of your limited non volatile memory. ECC is also likely to be faster.
H: Problem with using switches in Proteus I don't understand why, when I am using an SPST switch with these logic gates, the circuit doesn't output voltage and I have to use that logic gates? AI: I'm not sure I understand your question - however... The 7404 is a bipolar TTL part. TTL inputs source current, and will appear as a logic High if not connected. They must be connected to ground, either directly, or through a low value resistor, to be seen as a logic Low, so you should connect your switch between the input pin and ground. Also, a TTL output can sink much more current than it can source, so it is best to connect your LEDs and the required series resistor between the output pin and the positive supply rather than between the output pin and ground. You must have a resistor in series with the LED to limit the current through the LED - 300 - 400 ohms would do. Your circuit should be something like: simulate this circuit – Schematic created using CircuitLab R1 is optional, but recommended. I don't know Proteus, but it is likely that you have to connect the 7404's Vcc pin to a +5 volt power source, and connect its ground pin to the circuit ground, in order for the simulation to work.
H: Why are there high active and low active signals in a timing diagram? I always see such signals (colored in the image) in a timing diagram. Now I've figured out that they're called: low-activ and for me an OR-gate high-active for me an AND-gate signals. But why isn't it all drawn as high-active signals (so that the blue area is visualized like the red one)!? What's the reason for that diversity ? AI: The graph directly represents the voltage that you apply to the pin. If it were flipped, it would be confusing because it would no longer be a graph of the voltage on the pin. If you mean to say "why are some signals active low", that is a more complicated question and has many possible answers. Sometimes it is more convenient to have a signal as active low, such as a reset signal that will rise as the power supply comes up. This might give you the opportunity to put a resistor and capacitor on the pin making a reset delay circuit. Other times, it may be an "open collector" type signal that can have many devices tied to it, creating a NOR function, or even just allowing a very simple to implement shared signal. A third possibility is a combination signal such as a read/write direction pin in a bus, where in one state it is read and the other state it is write. That is often represented as \$R/\overline{W}\$.
H: Is memory bandwidth advertised for DRAM (like 12800 MB/s for PC-12800) ever achievable? Memory bandwidth for DRAM like DDR3-1600 / PC-12800 is a function (product) of memory frequency (1600 MHz) and memory bus characteristics (width and number of channels). But memory also has timings (for example, 11-11-11, measured in cycles). So is it true that the value of memory bandwidth (12800 MB/s) is unreachable unless timings for that memory equal 0 (zero), that is unreal? AI: Well, you're never going to get that exactly. That's the theoretical max bandwidth. However, you can get pretty close. DRAM is set up so that rather large blocks can be read out sequentially with no wait states. Well, you might need some wait states to set it up and a few to move to the next block, but within the block it will transfer at the full rate. Generally your CPU will read or write a whole cache line at once anyway, not just a couple of words. This is a tradeoff between sequential access and completely random access, but it usually works well because a good portion of memory reads and writes are sequential.
H: nichrome wire not heating up So today I was working on a DIY project, that involves me heating up a nichrome wire, and for some reason the nichrome wire is not heating up. I am using a 38 gauge wire, I calculated that I would only need 0.33 AMPS to heat up the wire, using 10inch of nichrome, 12V voltage source, as well as I have read 0.4 amp in my circuit. My circuit consists of the same nichrome wire, measured to be 31 ohms, and a 330 ohm resistor in series; so using current divider, I calculated 0.36 current should be going through the nichrome, but instead the resistor heats up and the nichrome is cold,any idea were I missed up. I can provide photo of my circuit if needed. AI: $$V=IR$$ If your Nichrome wire is \$31\Omega\$, and you apply \$12\mathrm{V}\$, then you will have a current of \$387\mathrm{mA}\$ flowing through the wire. If instead you place a \$330\Omega\$ resistor in series, you now have a resistance of \$330+31=361\Omega\$. So doing the calculation again, you now have only \$33.2\mathrm{mA}\$ flowing through the circuit. The vast majority of the voltage is now dropped over the resistor. $$P=IV=I^2R$$ You have \$33.2\mathrm{mA}\$ flowing through your circuit, so the Nichrome wire is dissipating \$P=I^2R=33.2^2 \times 31= 34.2\mathrm{mW}\$. On the other hand, the resistor is dissipating \$P=I^2R=33.2^2 \times 330= 364\mathrm{mW}\$. Basically 10 times as much. So the question really is, why do you have the resistor? If you instead place the resistor in parallel with the Nichrome wire, it would do nothing useful. The Nichrome branch of the circuit will still show \$387\mathrm{mA}\$ flowing. You will also have \$36\mathrm{mA}\$ flowing through the parallel branch of the resistor, but this wouldn't change the amount of heat generated in the Nichrome - for all intensive purposes the resistor is essentially a separate circuit sharing the same supply. It seems that the issue is your supply cannot deliver enough power. The voltage of the supply is basically dropping away meaning that you are only getting \$\approx 160\mathrm{mA}\$ through the wire, less than half of what you need. Noting the square in the Power formula, this means that the power dissipated by the Nichrome is less than 20% of what it would be if the voltage had not dropped away. Try to find a supply which can deliver more power.
H: Music Controlled LEDs I know there are tons of examples of music driven LED circuits out there, but they mainly control just one LED or one string of them. I want to make a circuit that will control quite a few LEDs, with each LED at a different range of frequencies. To do this, I am planning on making an array of band pass filters. Each filter would drive a different LED (or string, or something else)... through a BJT perhaps? Here is a quick sketch of what I am thinking. I might add in a high and low pass filter in the end, but I'll decide that later. Anyway, would this work? I am wondering if you have advice for me, or maybe some different tricks that could reduce the complexity of this project. Are there certain things to watch out for, such as my source not being able to supply enough power to my filters, ect? Thanks in advance! I really appreciate any help! AI: You're on the right track but there are a couple of problems. You'll find your bandpass filters are too wide because the 'Q' is low. This would, for example, cause a loud note of any frequency to get through all the filters and trigger all the comparitors. Speaking of comparitors, you have the non-inverting input connected to common. What do you think will happen if the inverting input goes even 0.1 mV below the non-inverting input? You may get a better result if you improve the filters, rectify the signal and, somehow, vary the intensity of the LEDs to match the intensity of the sound. Edit: A completely different approach is to do a fast fourier transform (FFT) of the signal with a micro and get the intensity of each band with the transform. I've never done it but there's a good animation of how FFT works on https://en.wikipedia.org/wiki/Fourier_transform. Your original idea is worth pursuing to gain experience with analog electronics - very hands on and no code. The FFT approach is great if you want to work in software and minimise the hardware design.
H: Shift left by custom number I have a 5*7 dot matrix in my FPGA, and I need to "walk" a dot. The data is 35 bits long, and only one bit should be 1 (visible). The upper-right dot is (0;0), the lower-left is data[34]. The problem is that I can't figure out how I should shift a '1' to the specified position. reg [34:0] data; reg [ 2:0] x, y; always @ (posedge clk16M) begin if (rst) begin x <= 3'b0; y <= 3'b0; data <= 35'b1; end .. calculate x and y .. end always @ (*) begin data <= 35'b1 << (x * 3'd7 + y); end It doesn't move the dot, however, x and y's value are fine. They change when they should. AI: always @ (*) begin data <= 35'b1 << (x * 3'd7 + y); end I think you may have an integer overflow issue. I would try changing 3'd7 to 6'd7 to make sure the calculations happen with wide enough values. (i'm not positive what the verilog rules are with regards operation sizes in complex expressions like this) I would also get rid of the "data <= 35'b1;" in the first always block. You should only set each signal in one always block.
H: Trouble solving for voltage gain I've trying to determine the voltage gain of this circuit (a small signal model of a MOSFET and a few resistors), but I'm having trouble getting enough equations to substitute. I see that ro and Rs are a voltage divider, so ... $$V_{in} = V_1 + (V_{out} + g_m*V_1*r_o)\frac{R_s}{R_s + r_o}$$ $$\longrightarrow V_{out} = \frac{V_{in} - V_1(1 + gm*r_o\frac{R_s}{R_s + r_o})}{\frac{R_s}{R_s + r_o}}$$ But from here, I need V1 in terms of vin or vice versa and i'm not sure how to go about that. I'm also interested if somebody has a more "clever" solution to determine vout/vin. simulate this circuit – Schematic created using CircuitLab For the curious, this is how I got to this schematic: simulate this circuit AI: From the history of comments the original schematic was updated. Rs and Rd are now in series because we're in small signal mode so that ground symbol doesn't matter. Then Rs+Rd is || to ro. Should be super simple from there. $$Vout-V_{1-} = -gmV_1*(Rs+Rd||ro) $$ $$\frac{Vout-V_{1-}}{ro} = I_{ro} $$ $$gmV1 + I_{ro} = I_{Rs} $$ $$ I_{Rs}*Rs = V_{1-} $$ Should be enough to solve it?
H: calculate clock cycle of ripple Carry and lookahead adder How would you find the number of clock cycles it takes to produce sum, the carry out, and overflow flag using ripple carry or lookahead adder. Can someone please explain me how would we go on finding the clock cycles, thanks in advance. AI: Ripple carry and carry lookahead adders are combinatorial circuits - they do not hold state and they are not clocked. So counting clock cycles is meaningless, unless perhaps you are talking about some sort of a pipelined implementation. Generally the whole point of using something like a carry lookahead adder is that the addition operation will be completed within a single clock cycle. With registers feeding the inputs and capturing the outputs, the question becomes one of what's the fastest clock at which the adder will work. To calculate this, all you have to do is find the worst-case propagation delay along the worst-case critical path and factor in the setup time and clock to output delay of the registers. Note that it is also possible to treat an adder (or any other combinatorial logic for that matter) as a multicycle path. This means that the input will be held constant for N clock cycles, and the output will be captured on the last clock cycle. This allows the clock to run faster than the logic, at the expense of adding wait states. This is inferior to pipelining as in a pipelined setup, you can get a new result every clock cycle with a latency of one clock cycle per pipeline stage. However, it can be difficult to pipeline certain logic functions and pipelining does require inserting extra registers which will consume more area, power, etc.
H: How can I view USB traffic on an oscilloscope? I'm trying to examine the communication of a USB mouse with an oscilloscope (PicoScope 3204). When I connect the scope's ground to one of the two data signal lines (Data+ or Data-) the mouse shuts down. The mouse is the 1995 Microsoft Home device, so it must be using USB 1.1, not some fancy high-speed version. I also tried the same on a USB memory stick and experienced the same problem. Is there an simple circuit I can build to overcome this problem? I'm aware there are sophisticated USB test fixtures for this purpose, but I'm trying this as a demonstration/experiment, so I'm looking for a minimal home-brew solution. AI: Don't ground the data lines. They are above ground. Beyond Logic says USB uses a differential transmission pair for data. This is encoded using NRZI and is bit stuffed to ensure adequate transitions in the data stream. On low and full speed devices, a differential ‘1’ is transmitted by pulling D+ over 2.8V with a 15K ohm resistor pulled to ground and D- under 0.3V with a 1.5K ohm resistor pulled to 3.6V. A differential ‘0’ on the other hand is a D- greater than 2.8V and a D+ less than 0.3V with the same appropriate pull down/up resistors. You need to connect scope ground to USB ground. Otherwise you're killing one of the signals and the differential receiver will not detect the required phase reversal. With scope connected to ground a single channel scope can monitor either D+ or D-. A dual channel scope can monitor both and you should see the phase inversion when data is transmitted.
H: Why do the 9V batteries immediately deplete on connecting to this circuit? My son put together this railroad flasher circuit on a breadboard. He (and I) tried 3 brand-new 9V batteries. On connecting them to the circuit, the batteries immediately deplete/discharge (terminal voltage before connecting is ~9V, and after connecting to this circuit, is ~6V). I've checked the breadboard wiring several times to see if it matches the circuit, and I could find nothing wrong. Only thing which I am unsure about is the electrolytic capacitor that is a 10uF one, rated at 50VDC. Could that be the problem ? The resistance values are all as per circuit (1/4W ones), and the LEDs are connected correctly. Anything wrong with the circuit ? Edit: Note that there was indeed a "short". Correct that, but still no fun, no railroad lights. Breadboard wiring picture - Edit#2: Thanks for highlighting several mistakes. Here's a Fritzing breadboard view. Hopefully right this time. AI: Your breadboard circuit has pins 2, 4, 6, 8, and red LED all connected together. I can't see if Cap +ve is connected to the orange wire. If it is then that's merrily in the circuit too. I think you don't realise that the edge strips (top and bottom of your photo) run the full length of the breadboard. Normally we use one on each side for ground and the other for V+ as these are used in multiple places on a typical circuit. Note that the 555 pins are numbered anti-clockwise from pin 1. Pin 2 is beside 1 and not across from it.
H: Why am I getting only 1.5V across the two terminals of the Load even though the Input voltage is 12V? I have asked this question previously: Why this pair of IGBT's died silently? Some of those genius people advised me for not playing with high voltages, so I am here with another question with low voltages. Please take a look at the circuit diagram below: simulate this circuit – Schematic created using CircuitLab Here is the Arduino code for turning ON and OFF the transistors to create an AC like signal. int Phase1TransistorA = 3; int Phase1TransistorB = 5; int Phase2TransistorA = 6; int Phase2TransistorB = 9; int t = 50; //frequency int p = 7; // pulse width float GateDischargeTime = 0.000090f; void setup() { pinMode(Phase1TransistorA, OUTPUT); pinMode(Phase1TransistorB, OUTPUT); pinMode(Phase2TransistorA, OUTPUT); pinMode(Phase2TransistorB, OUTPUT); } void loop() { for (int i = 1; i <= p - 1; i++) { digitalWrite(Phase1TransistorA, HIGH); digitalWrite(Phase2TransistorB, HIGH); delay(1000 / (4 * t * p * (256 - i))); digitalWrite(Phase1TransistorA, LOW); digitalWrite(Phase2TransistorB, LOW); delay((1000 / (4 * t * p)) - (1000 / (4 * t * p * (256 - i)))); } for (int i = p - 1; i >= 1; i--) { digitalWrite(Phase1TransistorA, HIGH); digitalWrite(Phase2TransistorB, HIGH); delay(1000 / (4 * t * p * i)); digitalWrite(Phase1TransistorA, LOW); digitalWrite(Phase2TransistorB, LOW); delay((1000 / (4 * t * p)) - (1000 / (4 * t * p * i))); } delay(GateDischargeTime); for (int i = 1; i <= p - 1; i++) { digitalWrite(Phase2TransistorA, HIGH); digitalWrite(Phase1TransistorB, HIGH); delay(1000 / (4 * t * p * (256 - i))); digitalWrite(Phase2TransistorA, LOW); digitalWrite(Phase1TransistorB, LOW); delay((1000 / (4 * t * p)) - (1000 / (4 * t * p * (256 - i)))); } for (int i = p - 1; i >= 1; i--) { digitalWrite(Phase2TransistorA, HIGH); digitalWrite(Phase1TransistorB, HIGH); delay(1000 / (4 * t * p * i)); digitalWrite(Phase2TransistorA, LOW); digitalWrite(Phase1TransistorB, LOW); delay((1000 / (4 * t * p)) - (1000 / (4 * t * p * i))); } delay(GateDischargeTime); } When I power up my Arduino and the Transformer, I thought, I should get LED strip working. But it doesn't. So, I checked the voltage across the two terminals of LED strip & I surprisingly got 1.5V instead of 12V. But just after the Rectifier circuit, I always get 12V. Then why am I not getting the required voltage across the two terminals of load?? AI: Q1 and Q3 are emitter followers - this means that the likely voltage coming from the emitter to the load is going to be the Arduino's GPIO logic level minus about 0.6 volts. You won't get 12 volts because those transistors are not configured to work as "switches". Try PNP transistors and a level translator: - Here's a typical example of a H bridge using this idea: - This one drives a motor as load and uses quite powerful transistors but it's scalable to lower power needs. Note that the lower transistors (NPN) are driven directly from logic levels. As an aside, you appear to have a 6V tapping on your secondary and this will produce a peak voltage of about 8.5 volts and, after rectification the DC voltage will be more like 7V and not 12V.
H: reduce sensitivity of digital input I have a battery (3v coin cell) powered device with a digital input to a microcontroller. There is a pull down on the input of 10k. It is connected to a switch outdoors which, when off, could have a resistance of 5k when its raining. The 5k resistance is enough for the microcontroller to think the switch is on. How can I reduce the sensitivity of the input without reducing the pull down resistor. I could make it 1k but then if it rains it would mean it always pulls 0.5 mA which depletes the battery in about 2 weeks. Is there a way to make the input less sensitive without reducing the pulldown resistor? AI: (1) You could move the threshold point nearer to the +ve rail so that a 5k input to positive resistance is not seen as a high level. An easy way to do this would be to use a comparator to set the trigger level. The comparator MUST be able to accommodate Vin = +ve rail in its specification. So eg 5k up and 10k down = 3V x 5/(5+10) = 2V in with a 3V system. You can make the system ratiometric so that both the comparator reference divider and the switch are both fed from the battery voltage so that as the battery voltage falls the ratio between trigger point and measured input is the same. Standby current worst case above at 3V is 3V/(5k+10k)= 0.2 mA. That is better than 0.5 mA but still too high. The pull down could be altered to say 47K so that when switch leakage is 5K the in voltage is 47k/(5k+ 47k) = 90% of supply. Setting the threshold at say 95% of supply allows correct switching. Switch on resistance then needs to be < 2.47k which should be easily met. (2) The microcontroller could poll the switch at a rate fast enough to ensure switch presses are not missed - say 100 mS period or less. A pull down could be applied only just before reading. Between polls the pin can be allowed to be pulled high by the switch with perhaps an external 100k pullup as well. Or a capacitor could be added to the pin and used to measure R_switch by setting the pint to output, driving the port pin low, setting it to input and measuring how long it takes to rise again.
H: How can I find whether RF transmitter and receiver are not in range? Suppose I have a device A with RF transmitter and device B with RF receiver with range 10 meters. Is there a way a A gets notified when B is out of range? Do we have to keep checking from A at regular interval that B is accepting signals or not? AI: If you just have a transmitter at one end and a receiver at the other, there is no way for the transmitter to know that the receiver is out of range (or turned off). You would need two-way communication between the points for the originator to know that the recipient received the transmission.
H: Why doesn't current flow through the common part of a circuit? I'm reading a book on computing that has a couple of introductory chapters on electronics. The author imagines a situation in which you and your next door neighbor set up a bidirectional telegraph to communicate with each other at night via Morse code: And then you and your neighbor realize that a common part of the circuit can be shared to reduce wire costs: Where I get confused is how the author analyzes the circuit when one or both switches are closed. The author depicts the closing of the switch at battery 1 like so: He says that no electricity flows in the other part of the circuit because there’s no place for the electrons to go to complete a circuit. My question is, why can't electrons also flow from the negative terminal in battery 2, through the right bulb, and into the positive terminal of battery 1? He also analyzes the situation when both switches are closed: The author states (with absolutely no explanation) that "No current flows through the common part of the circuit." OK, but why? Why doesn't current flow form the negative terminal of battery 1, through the right bulb, and into the positive terminal of battery 1. And why doesn't current flow form the negative terminal of battery 2, through the left bulb, and back to the positive terminal of battery 2? AI: why can't electrons also flow from the negative terminal in battery 2, through the right bulb, and into the positive terminal of battery 1? Because the only way to get to the negative terminal of battery 2 is to come from the body of the battery, and the only way to get there is from the positive terminal of the battery. And the only way to get there is through the switch in the friend's house, which is open so no current can flow through it. Batteries don't create electrons from nothing. They "pump" them from one terminal to the other via a chemical reaction, causing current to flow (through the battery) from a low potential to a high potential. Current only flows in complete circuit means the current has to flow through the battery just as much as it has to flow through every other circuit element. As an aside, it's also why it's silly to say that current always flows from high potential to low --- the battery is a trivial example of when it's the other way around. And it's also silly to say that all current is a flow of electrons in the opposite direction from conventional current --- the battery is a trivial and everyday example of when ionic currents should be considered.
H: How to chose a diode for breadboarding? I use Rasperry Pi / Arduino as power source (5V,3.3V) and for input/output (GPIO, Arduino headers). I reached a point when I realized, that what's in my mind needs diodes. I'm building a morse transmitter/reciever trainer, and there will be two options to drive a piezo: 1. when the program outputs morse code, 2. when I press a button and the signal is going to the Piezo and to a GPIO input. The two lines needs to have diodes so when one line is working it can't get through the other I read that Raspberry 5V current is about 200-300mA. Here I read the Arduino 5V current is about 400 mA. In the shop there are plenty possibilities. I found one, BAV21. I can't make much out from it's page, but they wrote two data: 200V and 600mA. My logic is: 200V bigger than 5V, 600mA is bigger than 400mA. It should be OK. Is it good for what I mean to do? Is it too low, too much? Is there more suiting diode? How to chose a diode for breadboarding? UPDATE 1: This is what I have in mind. This is only using the Raspberry Pi. I wrote a program in Java ME 8, which can recieve (GPIO 17) and send (GPIO 22) morse signal. simulate this circuit – Schematic created using CircuitLab The best would be if I could drive the piezo from the 5V with the GPIO22. How could I do that? With an NPN transistor perhaps? (Another thread about part of this circuit is going on here.) AI: That one will work. Alternatives are 1N4148, 1N914, 1N4001 (or 400x). Your application is for low frequency, and the differences between diodes won't have much impact on your system. You are correct that choosing one with a higher voltage and current rating is appropriate. Note that if you can't obtain one, using an NPN transistor will usually work -- connect the base to the emitter, and use that as the anode ('+'), and use the collector as the cathode.
H: Is this protection circuit designed properly? I designed this protection circuit to avoid reverse polarity and over-voltage. Here is the circuit: simulate this circuit – Schematic created using CircuitLab Is the circuit designed correctly? Specifications: conditions: $$-20<V_{in}<20$$ requirements: $$ \text{if }\ 0< V_{in} <15 \qquad \text{then }\ V_{out}\approx V_{in} \\ \text{if }\ 15< V_{in} <20 \qquad \text{then }\ V_{out}=15 \ \text{and } \color{Red}{LED } \text{ will light.}\ \\ \text{if }\ -20< V_{in} <0 \qquad \text{then }\ V_{out}=0 \ \text{and } \color{Yellow}{LED } \text{ will light.}\ $$ AI: What you didn't see is that with 20V applied minus the volt drop of the 1N5819 (leaving maybe 19.3 volts), there will be 19.3 volts applied across two series zeners that don't want a terminal voltage greater than 16.6 volts. This will equal smoke. The other thing is the an LED might have a forward volt drop of 1.5 volts before it starts glowing and, with below 14.5 volts (plus the forward volt drop of the 1N5819) applied at the input your red LED won't light. You should also put a bleed resistor across the yellow LED to prevent it getting reverse biased when off - check its spec - it probably has a max reverse voltage under 10V - you can't 100% relay in the 1N4007 for doing this. EDIT SECTION You could use the LTC4367 - 100V Overvoltage, Undervoltage and Reverse Supply Protection Controller. It's programmable with resistors to set at which point the over-voltage circuit begins. Here's a typical 24v example: - If you don't want to use this at least look at the depth of the specifications regarding what happens when O-V and U-V kick-in. There isn't a biblical amount to write down or consider but there's a lot more than you have done so far. By the way, it's unreasonable to expect the output to be 15V with inputs that range from 15V to 20V - there will be a volt drop BUT, if you are prepared to attach a buck boost regulator to the output of the above chip then you should be in business and you could get 15V out with the input at 10V.
H: Will this battery pack for an LED strip need a resistor? I want to use a small battery pack to power a strip of LEDs from Radioshack. They didn't have the power supply but list the requirements as 12VDC/1.5A. I know 8 AA batteries will provide 12 volts but I'm less certain how they will react to the 1.5 amp draw. We put 8 new alkaline batteries into a battery holder and did a quick non-solder test and the strip did light up nicely but the battery pack started to get warm even though we only had it connected for less than a minute or so. The plan is to solder a 9-volt type connector to the strip so it will be easy to connect/disconnect the battery pack instead of some type of switch. I know that I can add a current-limiting resistor inline with the wiring but I'm not sure what value to use. The strip looks like it has built in resistors so I'm at a loss as to what size resistor to try. The project is really just a short-term way to decorate a french horn for a school concert. My 15-year-old daughter can just connect the pack when the performance starts and then disconnect it when it is over. My concern is I don't want her to have the battery pack overheat during the performance. I don't care about how long the batteries last, this is a one-time use. Maybe another way to ask this is, what is causing the battery pack to heat up, the LED strip drawing excessive current or some other reason? I'm not trying to use rechargable batteries or build a charging circuit, just simply light up the instrument during a concert but safely. [EDIT] We did a test using the battery pack and after 30 minutes we couldn't detect any noticable dimming and the battery pack was still around 90-92 degrees F, tested with an IR thermometer. I told her she can just leave the pack in her lap and if it gets too hot to unhook the connector or remove a battery. She plans on taking an extra set of batteries with her as replacements for when the first set run down. My guess is that we previously had shorted the battery pack accidently which caused the temp to spike but now that the wiring has been connected properly we are seeing more typical behavior heat-wise. AI: I do not expect that LED strip to draw 1.5 A, more like 60 x 20 mA = 1.2 A. Still, that is a large current to draw from AA batteries. But good Alkaline type batteries will be able to handle that current. Most Alkaline AAs are around 2000mAh so they should last about 1.5 hours. As the batteries deplete the brightness will be lower of course. As long as the batteries are not too hot to hold in your hand then I would not worry. Make sure you do NOT isolate them thermally (put them in a small box for example) but make sure that the heat can escape. You do not need a dropper resistor, there are resistors already on the LED strip and that can handle 12V which is exactly what you get from 8 x 1.5 V AA.
H: How to measure voltage of a track lighting fixture? My house has track lighting that takes MR16 halogen bulbs. I would like to measure the voltage being put out by the fixture using a multimeter. I removed one bulb, set my multimeter to V-DC and inserted each probe into each hole of the fixture where the bulb would go. Nothing happens on the multimeter. Am I simply not making contact or am I doing something more fundamentally wrong? AI: Most MR16 tracks are powered by transformers. Since there is no benefit in rectifying the AC the manufacturers don't bother. Be aware that the transformer will have some internal resistance and should be designed so that when all the bulbs are in the voltage will be correct. i.e., When unloaded the transformer voltage will be higher than the full-load voltage. simulate this circuit – Schematic created using CircuitLab Equivalent circuit for MR16 lighting rack. The effect of this is that if you remove a bulb the voltage will rise a little. If one lamp fails the others then run hotter and will probably also fail sooner than rated life.
H: can I use any OP AMP as buffer I am still studing OP-AMPS and I was playing around with voltage follower/buffer configuration, the very basic diagram connecting the inverting input to the output directly and put some voltage on the non-inverting input I supplied the op-amp with 11.1 volts what I have notice that it was working as expected with TL092 and LM741, the output voltage was following the input voltage but when I tried LM393 or LM339 it didn't work as expected actually the output voltage totally became irrelevant for example if I apply 5 volts on the input, the output measures .9 volts or something around that value if I apply vcc on the input I get just 1.308 volts can someone explain why is this happening? AI: As TEMLIB pointed out, a comparator is not an op-amp, even if it happens to be drawn as a triangle with with 2 inputs and one output. A typical design for a comparator is an open drain comparator, which can be modeled like this: simulate this circuit – Schematic created using CircuitLab Here, OA1 is an ideal op-amp. If you connect Vout to V-, you won't get a voltage follower. Additionally, even if you stick to the world of "true op-amps", there are some restrictions on what op-amps you can use and how you use it. For example, some op-amps are not unity gain stable. Since a voltage follower has by definition a gain of one, trying to build a voltage follower with one of these will always be unstable, and you won't get the desired voltage follower behavior. You could start with an advertised unity gain stable op-amp and drive it unstable by what you connect the output to and what input waveform you give to the op-amp. It is also possible to do the reverse and add components to stabilize an unstable configuration. There's a wide variety of literature available online on op amp stability.
H: Part identification in this dimmer switch The dimmer in question is a 3 poll LEVITION 600 watt 120VAC 60HZ dimmer. The three red boxes in the picture below are what I'm questioning. What are those three pieces (and what do they do). Here are some more pictures of the dimmer switch. This is how the circuit fits in with the contacts and switch. Here is the switch front (for anybody that wants to see it) I have read What are the extra components in this dimmer for?, and it did not help me. AI: The three pin device is a triac. It turns on the power going out to the bulb for only a fraction of the full AC sine wave. This particular triac is discussed here. The little flat 2 lead device is an surface mount chip capacitor. The capacitor forms the capacitor half of an RC circuit that controls the when the triac turns on during the AC wave and thus how much power gets out to the bulb. The resistor half of the RC circuit is the the black strip. A slider makes contact at different places along this strip when you move the switch paddle up and down. The coil is an inductor. This helps to suppress the electrical noise generated by the triac switching. Here is a circuit similar to yours with some explanation on how it works... http://www.electronics-lab.com/project/400va-ac-light-dimmer/
H: add a second antenna My application requires to connect through Bluetooth reliably. I have an issue is that the receiver is not always in line of sight and when not, I experiment connection drop. I would like to have 2 antennas in 2 different direction. The chipset is CSR 8635. Is that even possible to have dual antenna? AI: No. That chip (like most) only uses a single antenna. If you added a 2nd antenna and somehow combined their signals (in the RF domain), you might improve performance in a specific direction, but you are also going to get nulls where the 2 antennas both pick up a signal and the phases are such that they cancel. You'd really need a 2nd RF amplifier & demodulator. Alternatively just use 2 of those CSR 8635 ?
H: Questions About Schematic I am working on a color organ and want to use a design similar to this. I understand the gist of the schematic, but I have a few questions about it and how it works. First: I understand that it is trying to tell me how to hook up my input audio signal, but I don't understand what it is telling me. Second: This is describing a potentiometer connection, right? If so, do you know why having a potentiometer here is advantageous over having a static voltage divider? Third: The active band pass filter used is slightly different than the band pass filters I see on google, so what does the resistor that is highlighted do? Fourth: I want to increase the number of band pass filters so I can control more LEDs at different frequencies. To do this, I believe I would have to have a higher Q value and smaller band widths per filter, correct? How do I increase the Q of my filter so it is a smaller band pass? Fifth: What is the point of this bit of circuit? Can't the op amp output go straight to the transistor? Finally: They don't have transistor models marked. Since they are powering lots of LEDs, would you suggest a power transistor? Or maybe a darlington pair for better control? Thanks in advance for your help! I really appreciate it! EDIT: Quick followup question: Should I assume the VCC in the red squared part of the schematic is 12V as well? AI: First: it's saying the audio input should be a 3-pin (stereo) jack, probably 3.5mm. However, they've connected two of the pins together, so you might as well use a mono (2-pin) jack. "JACKPTH" is probably their name for a plated-through-hole jack, i.e. one with pins that goes through the PCB instead of being surface-mount. Second: R24, R25 and R26 are effectively volume controls for each of the three channels. They allow you to adjust the sensitivity of the circuit to deal with different incoming sound levels in each band. Say if you have very bass-heavy sound, you might want to turn down one of the pots so that you don't just get the bass LEDs lit constantly while the treble ones never come on or vice-versa. Third: Consider the R1/R7 junction as the input to the bandpass filter, and consider the input of the filter as seen by R1. You've got a voltage divider formed by R1 and the parallel combination of R7 and the capacitors. Without R7, that voltage divider would form an RC low-pass filter but with R7 present, the bottom leg of the divider is largely real (dominated by R7). Stated alternatively, R7 makes the input impedance of the bandpass filter be mostly-real. That means that the only filtering effect you get is as-designed and not from the interaction between the filter block and the output impedance of the block that supplies it (R1 and R24). The Google schematic you post has a very different input arrangement to the bandpass, which is not purely capacitive. Fourth: You need a narrower band for each filter, yes. I would suggest googling up the formulae for a chosen bandpass filter topology and plugging in the values (of centre frequency and Q) that you want, and deriving component values from that. And do some experimenting in a circuit simulator. Fifth: D1+C11 is an envelope detector. It produces a signal that tracks the average volume of the output of the bandpass filter, with all the audio-frequency signal removed. I am surprised by the lack of a base resistor though! Finally: two chains of LEDs drawing 10mA to maybe 50mA is not a heavy load. I would go with BC548 or anything similar. Doesn't really matter as long as you don't exceed the max collector current of the device. Note the resistors in series with the LEDs have interesting values, which will depend upon the specific models of LEDs chosen, i.e. their intended operating current and their forward voltage. Vcc: seems reasonable to me.
H: How much current will I get from the 5V rail of a Teensy 3.2 powered over USB? The microcontroller in question is a Teensy 3.2. My understanding is that the most current that you can get from a standard computer USB port is ~180mA; how much of that will current devices attached to the Teensy's Vin (+5V in the case of USB power) receive? AI: A USB port can supply at least 100 mA without USB enumeration, and 500 mA or more after successful enumeration. Most PCs (and laptops) don't actually restrict the current in either mode, and you can often draw more than 500 mA, but that is not recommended (or guaranteed).
H: How long will my circuit run normally if its battery level reduces? I am using a 3.7V battery for my circuit. What will happen when the battery level reduces to 3V, 2.5V, etc? Won't some of my components stop working at these low voltages? AI: Some may, some may not, it depends on what components are in use. You usually design a circuit so that it can operate over the range of voltages that the chosen battery or supply will deliver. Most ICs will specify a minimum voltage at which they will work in their data sheet. However, beware, even when an individual IC is 'working', some of its parameters, so current drive, bandwidth etc, may be less at a lower rail voltage than the typicals you hoped for. Your system design has to allow for the lower performance at extremes of voltage. If you have a circuit that works only over a small range of voltage, power it from a regulator that can accept the voltage variation from the battery. A switch mode regulator will make best use of the energy in the battery.
H: A question on making a simple split power supply I'm planning to make a variable split power supply from a 9V DC adapter. So far I found two easy approaches. One is with a 555 timer here: Making dual power supply from single for opamp? And the other is just with two resistors and capacitors here: What are the ways to make a dual power supply from a single voltage source? I have two questions: 1-) If I want to make a variable split supply between 5V to 12V which is controlled with a poti, can I use the same circuits without changing any component values? 2-) How reliable and regulated 9V DC adapters in general? I mean should I use a voltage regulator between the 9V adapter and the splitting circuitry? AI: I'm planning to make a variable split power supply from a 9V DC adapter. You are going to be disappointed if you expect more than a few mA from the negative supply and also you will need a buck-boost regulator if you want to create 5V to 12V rail from a single 9V adapter. Same is true for creating -5V to -12V - you need a much more rigorous approach than either a 555 negative voltage generator or a couple of resistors and capacitors. How reliable and regulated 9V DC adapters in general? You can get very reliable ones and can can ones that are really crappy. Best rule here is do some research and pick a reputable supplier.
H: Is it possible to program the Teensy3.0/3.1/3.2 in C? I need to program my Teensy3.2 (hasn't arrived yet) in C. Looking at the Teensy pinouts page, the last board for which pinouts for C language are given is the Teensy++ 2.0. Is it still possible to program the Teensy3.2 in C? If so, what are it's pins called in C? Thanks! evamvid AI: Basically the teensy board is a Cortex M4 from Freescale (MK20 family). So you can download the Freescale toolchain and create a project totally in C for the MCU inside the Teensy. But you need to create a JTAG connection between a debugger and the MCU if you want to debug/program it.
H: Is it safe to use ESP8266 with 3.7V? I am using an ESP8266 WiFi module in a circuit. The battery is 3.7V. Is it safe to give the ESP8266 (3.3V) directly without a voltage regulator? AI: Also note that that battery is 3.7 V nominal voltage. Fully charged it will probably be 4.2 V. Way too much for the ESP8266. Conclusion: you need a voltage regulator. Look for a buck boost regulator like this: - Or this: - Or this: - Or this: - Or this: - Or try googling "low power buck boost 3.3 volts 150mA" yourself EDIT SECTION A really small device is this (3 mm x 3 mm package): -
H: What does SWITCH pin do on a microSD connector? I'm trying to connect a microSD card connector to my project (Molex 502774) and am slightly confused by the extra pins (nails?) provided. One of them is marked DETECT NAIL and the other one is SWITCH NAIL. As I understand the DETECT NAIL is for detecting when the card is inside - it is shorted to ground when card is inserted and should be connected to an input with a pull-up resistor. But what is the SWITCH NAIL for? Does it have anything to do with card hot-swapping? AI: Looking at the drawing, I would guess that DETECT and SWITCH are the two terminals of the switch which detects the presence of an SD-card. This allows for more flexibility in circuit design