text
stringlengths
83
79.5k
H: Soldering flat audio cable I was wondering if someone knows if it is unusually hard to do soldering on a flat headphones cable. I am sorry, I don't know how one is called, which is why I could not even find a replacement or any videos or how-tos. It's for Sony MDR-ZX600 headphones with a 3.5mm TRRS jack. The jack is slightly bent, and I have to use a M-F adapter and flex the cable to get them to work. I've never had to deal with a flat cable like that and don't want to completely break it by trying to solder a new jack to it. Has anyone dealt with this type of cable and is it as easy to deal with as most low-end round audio cables? I was only able to fix no so fancy XLR mic connectors and inexpensive speaker systems with ripped out cables, etc. Thanks in advance. AI: Yes, it is rather hard to solder to those cables. They are designed for ease of manufacture (using expensive tooling) and flexibility for the user. But those properties make them rather difficult for hand-soldering. You could probably do it if you have extraordinary patience and excellent soldering skills.
H: Where should I place the series termination resistor for AVSBus? I'm dealing with a AVSBus interface (like SPI, there are CLK/MOSI/MISO signals). The CLK may run up to 25MHz, so we'd like to add series resistors on the board, as a back up if we need to tune the SI later. My question is, where should we put these series resistors? Close to transmitters or receivers? And, should we use series or parallel termination method? Why? Thanks for the feedback. AI: You can add a series resistor at the sending end of the clock in order to control reflections but, you do need to route the PCB track at an impedance that somewhat matches the series resistor. Or, you can use a parallel resistor at the receiving end: - Given that a driver may not be able to supply enough current for (say) a 50 ohm termination, a lot of folk opt for the series arrangement. There is a further option - see picture (d) below: - It works by dealing with the high frequency content of the clock pulses (i.e. the harmonics) and terminating them correctly. This means that "C" can be quite low (maybe 100 pF or less) and DC conditions are unaffected. At 25 MHz, you might be interested in ensuring that the 7th harmonic is properly catered for i.e. up to 175 MHz. At this frequency, the wavelength is about 1.7 metres and usually, engineers say that if track lengths are less than one tenth the wavelength, then terminators can be avoided. This means tracks can be upto 17 cm long however, electrical signals travel at about 0.6 the speed of light so, this lowers that track length to about 10 cm.
H: What mean circle with letter on scheme? I have connected circles, but I dont know what is this exactly and do I need them on a PCB? thanks for feedback. AI: The connection between (A) and (B) is a current shunt. The amplifier DA1 senses the voltage difference between (A) and (B) to measure how much current is coming out (or going in) to the battery GB1. That shunt could be a special trace on the circuit board. Or it could be a piece of wire as @Brian Drummond suggests. You cannot successfully copy this circuit without some knowledge of the resistance value of that shunt. That information is not shown in this schematic diagram.
H: Resistor near point-of-contact for better ESD-protection? This question is about ESD-protection while installing/removing components (RAM, SSDs, etc.) inside a PC. When grounding the GND of an USB-port to earth or to my wrist strap (as advised earlier) the moment-of-contact would be the moment i plug the USB-cable (which is attached to my wrist strap somehow) into the USB-port. So, the USB-port is the point-of-contact where an ESD-event (due to a potential-difference) could happen at the moment-of-contact. In theory, is the USB-port better protected when the resistor is nearby? (Maybe far fetched question, but i'm wondering on which end of my self-made cable i should place a resistor.) AI: There is no difference in having the resistor by the USB plug or by the wrist strap - it's in series, so the location has no bearing on things. The "moment of contact" is the moment when the path between your wrist and the USB socket is made. That could either be when you have the strap attached and plug it in, or put the wrist strap on when it's already plugged in. Either way it's via the resistor. The only "improvement" in the location of the resistor would be to have it inside the laptop. That way, if you happen to be touching the metal shield of the USB connector with your finger as you plug it in, the resistor would still be in the path. That's the only time the resistor in your cable would possibly be ineffectual.
H: convert 20V .4A to 12V .4A I am very inexperienced in electronics, so far I have just done real simple stuff with an arduino. I have a Nema17 (driven through a L293D) stepper motor which has a rated voltage of 12V and current of 0.4A. Now, my understanding of current and voltage is that the current solely depends on the voltage of the power supply and resistance of the motor. Therefore the motor draws a certain amount for a specific voltage. Now, when I connect my power supply to my circuit I only get to 0.4A or anywhere near that by setting to voltage to about 20V which exceeds the 12V rated voltage of the motor. Am I simply understanding this in a wrong way or do I somehow need to convert the voltage to 12V without the current being affected? AI: Welcome to Stack Exchange! One thing you'll discover as you grow in your electronics powers is that very few things in life are truly linear. In high school, we teach kids Ohm's law: $$V=IR$$ And that if you change the voltage while holding the resistance constant, you'll get a linear increase in current. If you actually sit down and do this in a lab, you'll notice that as you increase the voltage, the power being dissipated in the resistor causes it to heat up, and a hot resistor has a different resistance than a cold resistor. You may have also noticed that there is often a limit on the current that a power supply can sink (as suggested by @Andy_aka). An Arduino, for example, may only be able to sink/source 40mA of current. So even if you have a 5V pin with a 10 Ohm resistor, you might expect 100mA of current, but would only observe the 40 mA cap your Arduino can supply. In this case, the true voltage that would be coming out of the arduino would be $V = IR$ or, 400 mV. Finally, if your stepper motor has any mechanical resistance, this will increase the amount of power (P = IV) needed to rotate. Perhaps your stepper motor is trying to move something with a lot of mass?
H: Multiple feedback low-pass filter design I'm trying to design second order multiple feedback low-pass filter with cut-off frequency at 1500 Hz and Chebyshev approximation. Transfer function for this scheme is defined as: Where: And condition for real values of resistors: However using Matlab and cheby1 function I get extremely high values of coefficients and as a result high values of resistors and capacitors. hertz = 1500; % passband in hertz rad_s = hertz*2*pi; % convert to rad/s order = 2; ripple = 3; % dB [b, a] = cheby1(order, ripple, rad_s, 's'); % Extract coefficients for computing sheme values a1 = a(2); b1 = a(3); H0 = -b(3); fprintf('Coefficients:\n\ta1=%d\n\tb1=%d\n\tH0=%d\r\n', a1, b1, H0); % Condition for capacitors KCmin = (4*b1*(1-H0))/(a1^2); fprintf('Capacitors condition:\n\tC2 / C1 >= %d\r\n', KCmin); % Choose satisfying capasitors C2 = 10^(-3); % F C1 = 10^(-12); % F fprintf('Chosen capacitors:\n\tC1=%d\n\tC2=%d\n\tCk=%d\r\n', C1, C2, C2/C1); R2 = (a1*C2 - sqrt((a1^2)*(C2^2) - 4*C1*C2*b1*(1-H0))) / (2*hertz*C1*C2); R1 = -R2 / H0; R3 = b1 / ((hertz^2)*C1*C2*R2); fprintf('Resistors:\n\t%d\n\t%d\n\t%d\n', R1, R2, R3); And output is: Coefficients: a1=6.078036e+03 b1=6.288448e+07 H0=-4.451880e+07 Capacitors condition: C2 / C1 >= 3.031241e+08 Chosen capacitors: C1=1.000000e-12 C2=1.000000e-03 Ck=1000000000 Resistors: 7.518520e+03 3.347155e+11 8.349974e+04 Also I noticed that whatever ripple I chose condition C2/C1 was always of 10^8 order. What am I doing wrong? UPDATE I believe I know what the problem is: given equations are in normalized form and I need coefficients for normalized form too. However MATLAB gives coefficients which are totally ready to be used. Therefore as I understand I have to remove w from the equations but it has not helped me in some reason. Also I found normalized coefficients in my textbook: The last column is normalized coefficients for 2d order 3dB Chebyshev filter. But I can't understand where from I have to take H0. AI: I am afraid that your transfer function is not correct. Cancel the wp² and the wp in the denominator - and the results will be OK. Your error can be verified very easily: All three expressions in the denominator must have the unit "1" - and this is not the case with your function. The correct equations are like this: 1/wp²=R2R3C1C2; 1/(wp*Qp)=(R2+R3+R2R3/R1)C1. Update: The above two equations result from a comparison between the (corrected !) transfer function of YOUR specific circuit and the general second-order transfer function: H(s)=Ao/[1+s/(wpQp)+s²/wp²] For Chebyshev (3 dB ripple) the pole data are: Qp=1.30656 and the normalized pole frequency is wp/wo=0.8409 (wo=cut-off).
H: What determines the orientation of a coupling/blocking capacitor in an amplifier circuit? "In analog circuits, a coupling capacitor is used to connect two circuits such that only the AC signal from the first circuit can pass through to the next while DC is blocked. This technique helps to isolate the DC bias settings of the two coupled circuits. Capacitive coupling is also known as AC coupling and the capacitor used for the purpose is also known as a DC-blocking capacitor." Here is an example of use of it: Below another example from a question on this website: And here is an example from an electronics text book: What determines the orientation of the coupling capacitors here? Is that the Vcc voltage? But if so, the last example does not follow the first two. Which one is correct and why? edit: Below a polarized cap is used with an AC signal. There is no DC level. As you see the voltage across the cap is alternating from +7V to arounf -7V? Is this acceptable? AI: Depends on the DC level of both sides: If one side is higher then (+) terminal should be connected to that point. Let's examine this on the example circuits shown in your question: 1) At point A, DC level is 0V. At point B, DC level is \$V_B = 12 \cdot 10/91 = 1.32VDC\$, so (+) terminal of the cap should be connected to B. 2) At the point on the left side (i.e. input side), there is no DC level shown, so we'll suppose it 0V. At the point on the right side, DC level is \$V_x=24\cdot 10/20 = 12VDC\$, so (+) terminal should be connected to the junction of R2 and R4. 3) The coupling cap at the input is not an electrolytic. So there's no polarity. Likewise, output coupling cap is not an electrolytic as well. But if it was an electrolytic, since the DC level at the output (i.e. at the junction of RC and output transistor's collector) is non-zero then (+) terminal should have been connected to that point. hth.
H: How do I solve this network of diodes? Here is the assignment: The assignment is to calculate various values across the circuit. Here are the important values: \$R=3.3k\Omega\$ \$ U_1 = U_2 = 4 V\$ The diodes are ideal with the following current voltage relation: Here is my thought process what I tried and where I failed: I am assuming all diodes are on because there is nothing directly blocking them, like an air valve. Lets say I want to calculate \$I_5\$. I know \$I_5\$ is half of \$I_2\$ and is equal to \$I_6\$ and \$I_7\$. The resistance should be \$2R\$ and the Voltage should be because the diodes are in parallel \$4V- 1.4V = 2.6 V \$ But then it all stops making sense after I try to calculate it, something must be wrong with my approach. Here are my questions: How do I go about this circuit,how do I split up this circuit in to the correct Kirchhoff meshes ? Can you give me a hint or a direction how I would go about solving this ? Update: here is the marked solution: AI: In principle all combinations have to be checked, however often a few simplification can be made by inspecting the circuit. The diode with the voltage U6 across it will always be on. There is no possibility to bring the anode below 0.7V. The cathode of the diode with U7 is off because there is a resistor between the cathode and ground. If it was on there would be a voltage drop across the resistor reducing the voltage across the diode. This voltage is 0.7V minus the voltage drop across the resistor. However, below 0.7V it would turn off. The diode with U3 across it is on. It has 8V at the anode, the remaining 7.3V split equally across the resistors. We can verify that the diode with U7 is still off. The currents are a result of the applied voltages, they are not needed for anything.
H: What exactly is a short circuit? In my book there is no explanation of the phrase short circuit but at many places the author has used it. I had googled it. Some explain it as the flow of charge along a high potential difference while others explain it as the flow of charge along a low resistance path. What exactly is a short circuit? An explanation along with a diagram would be very helpful. AI: In simple and practical terms, a short circuit is an unwanted or unintentional path that current can take which bypasses the routes you actually want it to take. This is normally a low resistance path between two points of differing potential. For instance: simulate this circuit – Schematic created using CircuitLab In the left simple LED circuit, just over 6 mA is flowing round the circuit. Create a short circuit, represented by a very low resistance (no wire is a perfect 0 Ω conductor) and 5000 A wants to try to flow through it. That's bad news for the battery. The battery could well explode. What is certain, though, the internal resistance of the battery will limit the current that can exist and a large voltage drop will be seen at the terminals of the battery causing the whole circuit to stop functioning.
H: Load Cell has abnormal wire coloring pulled a load cell from a small scale that I bought from amazon. I read online about how to use a INA125P to amplify the signal from the load cell, but when i examined the load cell i pulled from the scale, I found the wire coloring did not match that of the tutorials I read. I even found some lists that show wiring colors by manufacturer and all of them seem to at least have a green wire, whereas my wires are red, white, yellow and blue. Here is a picture of my load cell. I've tried Googling the text on the cell as seen in this picture, with no luck. Perhaps an understanding of how a load cell works on a more fundamental level could allow me to reverse engineer the wiring with a multimeter. Or is there some other way of determining the wiring of this load cell? AI: All a load cell is, is a collection of resistors that change resistance when they are flexed (flex sensors). You get different numbers of flex sensors in different models. The most common is 2 sensors, which it looks like yours are. That's two wires per sensor. It looks easy enough to work out which wires connect to which sensor - you just need to experiment to work out which way round those wires connect. You use it as part of a Wheatstone Bridge - that is, along with two more resistors: So one wire from the compression (or "top") load cell goes to the positive of the excitation supply, and one wire from the tension (or "bottom") load cell goes to the negative (or ground) of the excitation supply. The other two wires join together and form the middle node of that branch - the "positive" output of the bridge. The "negative" output is the mid point of your two reference resistors, and it's the difference between these two voltages that you are interested in. Your job now is to work out which way around the two wires from each sensor go. Don't be afraid to experiment. If you get it right it will work. If you get it wrong one of these will happen: Your readings will be backwards (you have both pairs of wires backwards) You won't get any readings (or hardly any) - you have one pair correct and the other pair backwards.
H: Transistor Switch with >0 OFF voltage I am new to electronics so I apologize in advance for incorrect terminology. I have an existing circuit which can be powered with either 13.4v or 14.4v. What I would like to do is treat that voltage difference as a binary switch, where the 13.4v power is OFF and the 14.4v power is ON. So basically I want to build a circuit that can have an input voltage of 13.4v or 14.4v which would equate to an output of 0v or 14.4v respectively. I have found and looked into MOSFET transistors as they seem to be the most reasonable way to achieve this but I can't find one that has a gate-source threshold voltage high enough. As in, I can find a 14v Vgs MOSFET but the Vgsth is always too low, usually 6,7 volts. I need the OFF output voltage to be 0v. This is leading me to think this might not be the correct approach. EDIT: I also want to include that the maximum current draw on the circuit could reach 8 amps but on average should be closer to .5/1 amps. Can I achieve the circuit I described above with just one MOSFET? Or is what I'm even trying to do reasonable/possible? Thanks for your time. AI: ThePhoton has it right in comments. You need a comparator to make this sort of comparison reliably. What you want is something like simulate this circuit – Schematic created using CircuitLab This will give you zero output until the input gets above (nominally) 13.9 volts, which is halfway between 13.4 and 14.4. Since parts have tolerances, particularly the zener diode on the left, the 200 ohm pot can be used to adjust for component variation. The 1Mohm/1kohm combination is not necessarily important, particularly if your inputs really are the two values you've described. However, they are a good idea, and provide about 15 mV of snap action (hysteresis) if the input just happens to be near the trigger voltage. There are lots of comparators available, although you'll have to make sure you get one which can handle 15 volt supplies (not all can nowadays), and if you want to go with an oldie but goodie you can get an LM311 or LF311. Or you can use 1/4 of an LM339. Both are pretty cheap. This works as follows: For any input above about 6.2 volts, the + input will be around 6.2 volts. The input is divided by about a factor of 2.2 (depends on the pot setting) and for voltages less than 13.9 volts the - input will be less than the + input, so the comparator output will be high. This will keep the MOSFET turned off. Note that that'a a p-type, and almost anything will work in this application. Also note, though, the MOSFETs do have some leakage current, typically in the area of 1 mA or a bit less, so the MOSFET will not be "completely" off. If you're driving a high-impedance load you'll need to be careful of this. When the input gets above 13.9 volts or so (again, this will depend on the pot setting) the - input will become higher than the + input, the comparator output will go low, and the MOSFET will turn on. EDIT - Also note that 200 ohms for R3 will work well as long as you use 1% resistors, which are dirt cheap these days. If you elect to go even cheaper and use 5% or (God help us) 10% units, you will probably have to use a larger pot - 500 ohms ought to work.
H: What happens with the voltage and amperage when we have multiple batteries in either series or parallel? Let's assume that I have 4 pieces of 9v batteries and some simple load like an LED. If it helps, you can assume there is no load at all. Question 1 - What voltage and amperage can I expect on the output when I have a simple series circuit? plus minus plus minus plus minus plus minus +---(9v-battery)---(9v-battery)---(9v-battery)---(9v-battery)---+ | | +----------------------(load)---------------(V?)-----(Amp?)-----+ Question 2 - What voltage and amperage can I expect on the output when I have a parallel circuit? plus minus +--------(9v-battery)--------+ | | | plus minus | +--------(9v-battery)--------+ | | | plus minus | +--------(9v-battery)--------+ | | | plus minus | +--------(9v-battery)--------+ | | | | +---(load)---(V?)---(Amp?)---+ I am quite inexperienced in this area and even though I know the difference between series and parallel circuits, I don't know what to expect when I have multiple battery sources. I believe that in one of these cases I should expect the batteries to last longer and in the other case I should expect the voltage (and therefore perhaps the amperage as well) to increase. Could you please explain to me what happens with the voltage, the amperage and the overall battery life in each case? Thank you! UPDATE: I found out that my Google search regarding this topic has been slightly incorrect and that's why I didn't get the answers I was looking for. I updated my Google search with better terms and I found these articles which were very helpful: Connecting Batteries in Series or Parallel Battery Bank Tutorial - Series and Parallel Thank you all for your answers and comments on this issue! I promise the next time to do better research before posting questions here. AI: With the batteries in series, the total voltage is the sum of the individual battery voltages (a 9 volt battery is made up of six 1.5 volt cells in series). The current capacity is the same as for one battery, as all of the current has to flow through all the batteries With the batteries in parallel, the voltage is the same as for a single battery, but the current capacity will be four times that of a single battery as each battery is supplying part of the total current.
H: N channel depletion FET vs P channel enhancement Operation As the title implies I am confused about the electrical characteristics of N channel depletion FETs vs P channel enhancement mode fets. Won't both of these devices act similarly as they both have negative threshold voltages? Thanks! AI: Although both have negative threshold, the operation is still opposite. For N-channel, the gate voltage must be above the threshold voltage to allow conduction through the channel. For P-channel, the gate voltage must be below the threshold voltage to allow conduction.
H: How can I use an Indian 2.1 speaker in United States? I purchased a 2.1 (2 speakers , 1 sub-woofer) Creative Inspire audio system in India a few years back. I loved the sound quality so much that I brought it all the way to United States, forgetting that the line voltage required to drive the speaker is 220V while US power supply is 110V. When plugged to US power line, the audio system is producing sound almost inaudible to human ears! Do I need a step-up transformer or something similar to make it work in US? AI: You have two possibilities. It is just barely possible that your speakers have a voltage select switch which will allow you to run on 110. Maybe. Check where the power line enters your speakers, and you might get lucky. Probably not, though. In that case, yes, you'll need to get a 110 to 220 transformer, which will be pricey, although you don't need much power. A good place to start is Amazon - search for "step up power transformer".
H: Why is there a capacitor in the feedback path of a comparator, why is there a resistor on the input? I am interested in charging a supercapacitor from a solar panel. I saw a circuit on this page by David Johnson. He doesn't let you copy the circuit, but the gist of it is this: simulate this circuit – Schematic created using CircuitLab I understand most of this. The op-amp is acting as a comparator for V+ through a voltage divider, so that when V+ is 2.654V it will reach the comparator threshold of 1.2V (the LM385 is a 1.2V reference). (2.654 * 61.9) / (75 + 61.9) = 1.2 When the input voltage exceeds 2.654V the op-amp will turn on the MOSFET which will conduct R5 to V-, thus shunting the input voltage to stop it exceeding 2.654V (by much). (The super-capacitor in this case is a 2.7V one). I have two questions: What is C1 for? I presume stability of the op-amp, but am not sure. What is R2 for? That doesn't seem to be doing much. It isn't acting as a voltage divider, and the op-amp input is already high-impedance. I am guessing it is something to do with circuit stability, but am not sure. What is to stop you connecting the voltage reference directly to the non-inverting input of the op-amp? Why choose 10k and not some other value? AI: It's explained in Negative feedback capacitor in Op-Amp comparator circuit. R2 and C1 decrease the high-frequency gain of the comparator, so it won't rapidly flip between V+ and V- when the input is near the threshold. Edit: I've looked at the circuit some more, and I think a comparator is the wrong way to think about it. In steady state, it won't be fully on or off, but in the middle. The transistor will be partially turned on to hold the supercapacitor voltage around 2.654V. It's only if the voltage is significantly too high or low that it will act as a comparator. In more detail, it's an op amp integrator acting as a voltage regulator. It integrates the error signal (difference between the capacitor voltage and the reference voltage). If the capacitor voltage is too high, the integrator will slowly turn on the transistor, pulling the voltage back down. It should reach a level where the error is zero and stabilize. If the voltage is too low, the integrator output drops, gradually turning the transistor off. For your original question, R2*C1 controls how fast the integrator will change; without R2 it wouldn't integrate and would act as a simple comparator.
H: Question about Thermocouple to digital convert output I have a MAX31855 Cold-Junction Compensated Thermocouple-to-Digital Converter. I have a question displaying the outputs on a LCD module. The FPGA board has a built into LCD module, so there is not much do to other than to tell it what to display for a given input. My trouble is figuring out what the input of the MAX31855 is going to be. I am reading the table, and it says the data comes in as a 14 bit SIGNED value. I understand signed notation, zero MSB is positive, 1 MSB is negative. What I don't understand is that the Digital Output is 0000 0001 1001 00 (100 in decimal) for the temperature in Celsius is 25+. If I was trying to figure out a one to one relation, binary number [x] refers to temperature [y], how would I go about doing that? Here is the datasheet, table 4 on page 10 is what I am referring to. https://cdn-shop.adafruit.com/datasheets/MAX31855.pdf AI: 14-Bit, 0.25°C Resolution Divide by 4.
H: Resistor symbol in a schematic with zero value I can't figure out the purpose of the 0Ohm resistor in bellow schematic. It's crystal oscillator configuration and why the designer have included a resistor there with 0ohms ? Any idea ? AI: So that a resistor can be added to prevent overdriving the crystal. You will probably see it included in the data sheet as an option.
H: Construct an 32 X 8 RAM using 4 of 16 X4 RAM chips Note1: I know that the 16 X 4 memory contains 4 output lines. there is also a 4-bit input to construct the 16 WORDS. Note2: The problem arises as the RAM 32 X 8 contains 8 output lines and 5-bit input. But i want to use 4 of RAM 16 X 4. Question: What can i do about my design to get the RAM 32 X 8 with correct input and output lines. AI: You double the number of addresses by using the high order address bit to generate a chip select (If you also have a chip select line then use logic gates to combine it with the address line). You double the number of bits by putting two chips in parallel. Same address and control lines to both of them but different data lines. simulate this circuit – Schematic created using CircuitLab
H: neutralize charge in series capacitors I have a simple circuit as in the picture below. My question is why the negative charge -Q at the bottom plate of C1 moves and neutralizes with the positive charge +Q at the top plate of C2? AI: The area inside the green circle is electrically isolated from the rest of the circuit so there is always the same amount of charge inside the circle. What charge flows into the top of C1, the same amount flows out of the bottom of C1 and into the top of C2, the same amount flows out of the bottom of C2, this is how capacitors work (or at-least a very good approximation) Why does it move? Electric potential pushes it.. See also: Kirchoff's loop law
H: Different types of LiPo batteries While picking up LiPo battery for my project, I've seen that there are two different types: small and inexpensive one, like this one here that can be charged with a simple circuit like this one. And there are big ones like this one here that require special expensive charger like this. Why is it like this, if the internal chemistry workings are the same? Why do they need special chargers when the unit cell has the same nominal voltage? AI: Batteries first: The cheap battery is a single small low current cell. Its rated nominal charge/discharge rate is 0.2C (it's 400mAh so that's 80mA). You'd be looking at about 5 (400mAh/80mA) hours to fully charge at the nominal current. It is designed to be used in applications where it discharges at that sort of rate as well. The expensive battery has a far higher capacity and multiple cells. They also have significantly higher rated currents. They are rated at 20-30C rates, that means applications where the battery is drained in a couple of minutes not the 5 hours of the cheap cell. So very different batteries for very different applications. One is for keeping a low power device running for multiple hours. The other could do that but is designed for something that takes a lot of power very quickly. On to the chargers: The small simple cell/charger will charge a single cell at a fixed (fairly low) rate regardless of what that rate that cell can take. The more complex system can cope with multiple cells (up to 6) at multiple different rates. That is adding a lot of extra complexity which means extra components and cost. It also includes a housing and user controls, the mechanical parts and then assembly and testing probably cost as much if not more than the actual charger electronics inside it. And since it's being sold as a product rather than a bare component has to be tested to verify it meets various regulatory requirements. That adds further development cost that needs to be made up somewhere. For 2.5 times the price you get something with well over twice the functionality.
H: LM7805CV output voltage drop to 2.5v after connecting load I've made a simple linear power supply for micro-controller with a transformer and LM7805CV as seen in the picture. LM7805CV input voltage is 35V and output without load is 5V but after connecting a minimum load like an LED with 1K resistor output voltage drop to 2.5V. I've checked regulator input voltage and it's steady without any change but regulator input-output voltage increase to 32V which I think is the main reason for dropping voltage. Transformer = 2x24V Center Tapped AI: 35V is the Absolute Maximum the device can cope with and should not be considered an operating voltage. The recommended max input for the 7805 is actually 25V (https://www.sparkfun.com/datasheets/Components/LM7805.pdf) and even that is going to generate a lot of heat compared to an input of say 8 to 10V. At 35V in the 7805 will generate 4mA x 30V = 120 mW of heat which I would not expect to heat up enough to trigger the thermal shutdown even with no heat sink but maybe... You can greatly reduce the heat generated in the regulator by reducing the input voltage (minimum input is about 2 or 3V above the output voltage). You should still use a good heat sink if you want to draw more than a few mA. It's normally recommended that the caps are connected close to the regulator to ensure stability. Not usually a problem with +ve regulators but maybe it's oscillating.
H: I am getting question marks on serial while trying to read SD card I am using SPI and I'm trying to initialize and read a SDHC card. In the terminal, all I get back are question marks scrolling across the screen. Normally, I would think this is a baud rate issue but I have tried different baud rates and verified the the baud in the code matches the baud rate of the modem. My question is why am I getting question marks "?" in place of alphanumeric characters as expected. The question was answered and resolved. The issue was due to the terminal not interpreting HEX because the setting was set to interpret ASCII. I changed the terminal settings to HEX and all is good. AI: It sounds like your terminal is set to only display the standard set of ascii characters from decimal 32 through to decimal 127: - And, if a character outside this range comes along, a question mark (ascii 63d) replaces it. A simple reason could be that every byte recieved has its MSB set. You need to find a way of showing all characters like this: -
H: How to Write to SD Card at high rate? I have just started working on interfacing Nordic semiconductor's nrf52 with SD card using SDK 12.0. I have to write to SD card at a rate of 84 packets per second and each packet consists of 20 bytes. I am using fat file system which uses SPI protocol for writing to SD card. I am sampling the ADC at 1 ksps (12 bit resolution)and storing these samples in SD card.Here I am writing to SD card based on GPIO interrupt For each write operation I am using following steps: 1)open directory 2)open file 3)write bytes to file 4)close the file. While writing continuously I am facing following issues : 1) Code gets restarted automatically after writing some kb's into SD card. 2) I am wring only in one file. Still additional files are generated in SD card. 3) while writing to file somewhere in the middle I am getting massage as Unable to open or create file: ank.TXT. I am using 8 GB SD card for this operation. IAR version 7.4 and SDK 12.0. Does any one has any idea why I am getting these issues? I have attached my code at this link have to write to SD card whole data at longer duration without restarting the code. AI: OK. I take back my earlier comment. You do have an electronics issue. What you failed to mention in your question but is visible in the link you have now provided is that when you get multiple files the names are gibberish, they are the result of file system corruption rather than something actively creating files. This is happening because you are not supplying sufficient power to the SD card. When you perform a write the current draw of the card jumps up rapidly, if the power supply is insufficient this causes the voltage supplied to the card to dip temporarily causing the write to fail and corrupting the file system. This shows up as random gibberish files/directories being created or sometimes the entire card becoming unusable and requiring a reformat. Check your wiring and verify the SD card is getting a good solid 3.3V supply with low impedance connections from the socket to the power supply. Adding extra capacitance to ground right on the power pin of the SD socket will also help.
H: How to build a FSK modulator and demodulator? I want to build a FSK modulator and demodulator, the center frequency is 4.234MHz +-175kHz, FL is 3.951MHz, FH is 4.516MHz, mean data rate will be 564.48kbit/s. After searching the web, I found that FSK modulator can be build with DDS or PLL, demodulator can be build with PLL or complete software(DSP). Honestly, that's all the information I got. Do you have better recommendation on how to build this kind of FSK modulator and demodulator? Thank you! AI: Some thoughts but certainly not a full design: - The modulator is a lot simpler than the demodulator. For each data bit, the number of oscillation cycles is as follows: - Bit = high, number of clock cycles is 4.516 MHz divided by 564.48 k = 8.0 cycles Bit = low, number of clock cycles is 3.951 MHz divided by 564.48 k = 7.0 cycles So, for the modulator, you need two clock frequencies that are chosen depending on what logical level the data bit is. The clock frequencies should be phase synchronous in that when the last clock is despatched and the bit changes, the lower clock immediately starts at a transition from low to high. This is important but not hard to achieve. For the demodulator there is more dificulty due to the counts of cycles being very close. So I would be tempted to use a much higher-speed counter that can be used to measure the period of each received pulse. A PLL could be used - it might be possible but with only 7 or 8 clock cycles to distinguish between logical 0 or 1, it might be a bit tricky for a beginner. Having said that, a PLL could be used to obtain the average of the two FSK frequencies - you then have a centralized reference frequency that can be used with appropriate logic circuits to decode a 0 or 1. This only works if the two frequencies produced are phase synchronous as previously described. However, the data to be sent should be scrambled so that there are no long periods where the data rests in one logical state or the other. As for performance in the presense of noise, the lack of cycles for each bit means there could be some problems.
H: how is it possible that an inverter absorb reactive power It's always said that reactive power is interpreted as magnetic field in motors (or transformers) it can also be the electric field in capacitor, but where does an inverter "store" that reactive energy? AI: There's not a physical stock of reactive energy, but the control imposes a phase shift between voltage and current, which means a power factor lower than 1.
H: Conductive Adhesives? I'm helping with a kid's Maker's project. We need to attach some LED's to some coin cell batteries for part of a holiday project. Are there any conductive adhesives we can use for this? Durability is not a factor, since the life of the project will be no longer than the life of the coin cell charge. AI: Short Answer: Tuck Tape. I prefer Tape that holds like a Bulldog in any temperature but allows the LED to be removed with a little effort. Since my LED's have smooth lead frames the gap between is 2.05mm which would fit a 2.0mm thick coin cell loosely or a 2.5mm thick cell with perfect contact tension and not excessive stress on whisker gold bondwire. Therefore I recommend CR2025 cells and TUCK TAPE ( made in Montreal) used in construction industry for holding anything 1000x times its own weight. Since the ESR of Energizer and Panasonic CR2025's are perfectly matched to 5mm LEDs it limits the current to 20mA typically, thus Red and Yellow drop from 3.3Vopen to 2.2Vload. Blue and White having a threshold 1V higher than Red,Yellow will cause them to last long but draw much less current but if you have LEDs with 16~30Cd@20mA , but operating at 5~10mA, it is still very bright. All my LEDs range from 10Cd to 30Cd in many colours. I don't make any profit on these custom parts any more as I am retired from that, but if you want them in 250~500 pc/bag, just ask. Compare your specs with 16Cd min. Most tapes use elastic glue which gradually releases, unlike TUCK tape, which only needs 5 to 10mm wide strip to hold both DMM leads and the LED leads in photo above for a White LED 15 ohm ESR thus I can estimate the current to be 5mA which if you derate the CR2025 to 100mAh yields 20h but of course as current drops with voltage, will glow for months or a year after 20h. Thus Red Yellow will draw the right amount of current. White are better suited to CR123A which far greater capacity and only $1 ea online, albeit bigger.
H: Is there any dynamic antenna for varying frequencies in 1 GHz to 10 GHz? I want to use an antenna for my project and want to use it in the frequency domain: 1GHz to 10 GHz. Is it possible to use a single antenna with dynamic input range? I read about reconfigurable antenna's but couldn't find anything concrete on it. AI: So, you can of course have something like a monopole antenna in a telescopic way, that you attach some motor to that changes the length – but to be honest, that'd be a bit awkward. I'd recommend using something in between 2 and 5 separate antennas that all cover their share of the spectrum – for example, the first one could cover 1.0 – 1.6 GHz, the second 1.6 – 3.4 GHz, the next one 3.4 – 5.8 GHz, and the next one 5.8 – 10.6 GHz. That way, the relative bandwidth, ie $$\frac{f_{max}-f_{min}}{f_{center}}$$ would be roughly constant 0.5 for all antennas, and thus, you wouldn't need to build ultra-wideband antennas. It's mathematically hard to build an antenna where this relative bandwidth gets large, but with self-complementary antennas like the Vivaldi antenna (if you need some directional gain) or self-complementary spiral antennas, one can achieve amazin bandwidths. Note that saying "I need an antenna that covers 1 to 10 GHz" does sound a little unwise. It's extremely hard to build circuitry that works at 10 GHz the same way it works on 1 GHz, and antennas also typically serve a certain purpose. You don't even mention that – but it very much defines the types of antennas that are feasible for any given application. You might want to sit down and more exactly define your system's overall capabilities / requirements and then come back to ask more well-defined questions about your antenna. In other words: the way you ask this question reflects a lack of understanding of RF principles, and thus, I doubt you have a system that would actually make use of 1 GHz to 10 GHz.
H: Circuit and condition My son is trying to solve contest tasks in physics. Among the questions, I found the following one Let me translate. Find measurements of current meters within the circuit, shown on the picture. Resistance of current meters to be considered as much lower than resistance of the resistors. Power source is 12 V, resistors from left to right: 1 Ohm, 2 Ohm, 2 Ohm. I have some knowledge about electronics and circuit design, but this task astonished me. In my option: it is not correct to connect current meters this way, and current meters are having extremely low resistance, at the same time this their resistance is defined; if I would consider this circuit, as any stupid circuit can be built by the human, saying that "consider resistance of current meters to be much lower that resistance of resistors" does not help, and to calculate circuit current meters' resistances are required. Do I miss anything? Edit: following conversation and answers I redrawn the circuit - here it is AI: The description is basically saying to consider the current meters ideal. Ideal current meters don't drop any voltage, so appear to have 0 Ω resistance. Real meters don't, of course, which can alter the measurement. They are trying to make it easy for you by telling you it's OK to ignore the non-ideal resistance of the current meters. Basically, proceed as if the current meters are ideal, meaning they look like dead shorts to the circuit.
H: LTC3780 Test load for adjusting current limit I use the LTC3780 for my variable power supply, it can handle 1-30VDC and 7A output. In order to be able to view my current limit adjustments, i thought to create a momentary test load by using a 4.7 Ohm 50W resistor. Do you think this is safe? If not what other options do i have? Thanks AI: Check the current. The maximum current thru the resistor is (30 V)/(4.7 Ω) = 6.4 A. Since your supply can source 7 A, there should be no problem here. Check the power. The dissipation is (30 V)2/(4.7 Ω) = 191 W. Oops, that's too much for a 50 W resistor. So no, this is not "safe", if you mean safe is sticking to all the worst case limits.
H: Speed and position controle of a BLDC motor at the same time I want to know if it is physically possible for a BLDC motor to be controlled in speed and position at the same time. Let me clarify : while the rotor is spinning (speed control), is it possible to rotate the stator backward or forward (position control). I don't know if I made myself clear enough... AI: It is possible to control the position of a spinning BLDC or any other type of motor while it is turning. The motor shaft position could only be controlled relative to another spinning shaft. In order to make position corrections, it would be necessary to momentarily increase or decrease the motor speed by a small amount. The average speed would need to match the average speed of the reference shaft. With a BLDC motor, the rotor could maintain synchronism with the stator field rotation and maintain a fixed angular relationship with the stator field. The stator could be turned forward or backward to accomplish position corrections.
H: short protection for LED strip i'm building a white LED strip to mount above my kitchen counter. there is really nothing fancy about it: it's a 1.7m of 5V LED strip that i soldered an USB plug and mounted an on-wire switch to turn it on/off.it will be powered by an old iphone power adapter (hence the USB plug) and it draws a total of 130mA. my only worry is that being mounted in the kitchen opens up the possibility for water to get accidently spilled on it. is there a way i can build a short protection for it? AI: Phone chargers are short-circuit protected - they are typically limited to 1A, and will shut off entirely when shorted - so that may be enough protection for you. You could add a lower-current fuse as additional protection. Or just waterproof the connections.
H: Why current gain of common emitter transistor changes with the change of transistor I was reading a book on basic electronic engineering and there it said that if we replace a transistor with a new one and even if we keep all other parameters same for both transistors then also the current gain is likely to change. But I couldn't justify why should gain change if we keep all parameters same. Thanx AI: The gain depends on manufacturing characteristics such as the thickness of the base and the doping level. These won't be exactly the same from one batch to another (or even one transistor to another), so the gain will vary.
H: Are they connected in parallel? The question was to find the equivalent resistance between A and B. The correct answer is R. I too arrived at R by considering the ends of the lowest two wires equi-potent because the lowest wire has 0 resistance (and so according to V=IR, V comes out to be 0) and redrawing the circuit by taking the equi-potent points as a single point. But then when i was again inspecting the circuit, it seemed to me that the lowest two wires are connected in parallel which would make the equivalent resistance across their ends 0 since r1=rr'/(r+r') and thus the equivalent resistance between A and B comes out to be R/2. I think this is certainly not the case since the correct answer is R. So are the lowest two wires connected in parallel(which is probably not the case and if not then why? Edit: I would like to know how to proceed if the bottom wire also has a resistor of resistance R. I am unable to simplify the circuit for this. AI: Two resistances are connected in parallel if their positives are connected together and negatives are connected together. In your problem here the first and third wire are connected in parallel as well as the 2nd and third wire as shown in this sketch.
H: What is the use of a capacitor between Vdd and Vss (or Vcc and Vee)? I'm trying to make my STM32 communicate VIA Can. Therefore I'm making use of the CAN transceiver MCP 2551. In many circuits I've seen a 100 nF between Ground and Vdd. What is the reason for that? Here an example: AI: It's called a decoupling or power supply bypass capacitor. It's used to reject noise from the supply pins of an IC.
H: DC supply voltage in op amps and instrumentation amplifiers My question is very simple, i dont have much experience with electronics, and i am developing a project where i will use some operational amplifiers (TL081) and 1 instrumentation amplifier (INA118). I'll need the TL081 to build voltage followers, and a Voltage-Controlled Current Source (Mirrored Modified Howland): Source: http://iopscience.iop.org/article/10.1088/1742-6596/407/1/012030/pdf The INA118 amplifies the input voltage from the two electrodes placed on the body. Similar to this project. In these cases, do I need to use a DC supply voltage in my ICs TL081 and INA118? I was looking at projects that use applications similar to mine, and I did not see any comments about it. Thanks! AI: Yes, you will need to provide power supplies to any op-amp or in-amp in your circuit if you want them to act like op-amps and in-amps. You can see in the datasheet (INA118 shown) this is specified in the "recommended operating conditions" table: Most of the other specifications in the datasheet are only valid if you are operating the chip according to the recommended operating conditions.
H: Overlapping clock and data edges in multiple state machine designs I have a general question about multiple state machine logic designs. Think of a system having multiple finite state machines with a single clock and rising edged flip flops. These machines share some of their input and output data. So the outputs of some machines can be the inputs of other machines. My question is, since all the machines use the same clock and rising edge, wouldn't there be a confusion at the rising edges where also the input data changes? To explain in figures: This figure below shows a convenient data and clock time diagram.(bottom signal is clock, top signal is input data) There is no change in the input signal at the rising edge of the clock. But here the input data has a falling edge at the rising edge of the clock. This seems problematic to me: And the thing is, in a multiple state machine system with single clock every transition of a bit happens at the same time all over the design. So for me, unless I come up with a method the edges of data and clock always overlaps. I want to know if there are methods to avoid this(like shifting the phase of clock for every machine etc.). Or maybe this isn't a problem at all, and I am missing something here? If so I would also want to learn why I'm thinking wrongly. AI: In practice where a single clock is properly distributed around the design the output signals can be considered to arrive after the clock that created them. The clock has to cause the actual transition of a flop output and then the signal has to propagate through several layers of logic before it reaches the next flop. These delays are much larger than the small errors in clock timing.
H: RS485 (MAX489) biasing I am making an RS485 client device. The prototype is able to transmit and receive from a Modbus server successfully, using 2-wire (half duplex) mode. Full duplex operation is planned, but I haven't tried it yet. Does the MAX489 require any pull up/down biasing resistors? I can find no mention in their docs about this, nor specifics about 'fail safe' biasing. Actually, it does sort of mention there is a pull-up for an open network condition. Does this suffice, or is a pull-down also needed? AI: The datasheet says on the first page: The receiver input has a fail-safe feature that guarantees a logic-high output if the input is open circuit. (Please note that "input" means both differential input pins.) Table 2 shows the same. So you don't need the biasing resistor for this receiver if you do not have termination resistors. If any other receivers on the bus do not have this feature, or if you have termination resistors (which force a zero differential voltage if no transmitter is driving the bus), the bus still needs biasing. There are receivers that guarantee a high level when the differential voltage is zero; those would not need biasing in any case. The MAX489 is not one of those. On a receiver without fail-safe feature, you would use two resistors: a pull-up resistor to force the non-inverting input high, and a pull-down resistor to force the inverting input down. Due to the differential receiver, this would be interpreted as a high level; a differential receiver would not work with a single pull resistor, because the other input would be floating, or still at the same level. If the fail-safe feature is implemented with resistors, then the specified behaviour would imply that there are two resistors, one on each pin. But the datasheet does not mention any pull-up/-down resistors; how the fail-safe feature is actually implemented does not matter to you.
H: SMD capacitor package size and high frequency performance I am designing a circuit with a Spartan6 FPGA and the documentation for the FPGA specifies 4.7uF (0805) and 0.47uF (0402) capacitors for decoupling. As I really do not want to solder 0402 capacitors if I can avoid that, I would like to use 0805 or 1210 size capacitors for this. Would their performance at high frequencies be different from those that have smaller packages? The max in/out frequency is ~300MHz AI: Yes, it makes a difference. A larger package will generally have a higher parasitic inductance, leading to a lower self-resonant frequency and higher impedance at high frequencies: (image source: electronicdesign.com) For an 0.1 uF capacitor at 0402 size, the resonant frequency is typically in the 10-20 MHz range.
H: BC337 transistor appears to be in active mode, but has too small Vbe I've stumbled onto something that I don't understand. I've wired up a phase shift oscillator using a BC337 transistor (datasheet here). According to the datasheet, \$V_{BE(on)}=1.2\ V\$ However, using my multimeter (and after doing the theoretical calculations), I have found that my \$V_{BE}\$ is about 0.6V, which should apparently force the transistor into cutoff. Here is my circuit: simulate this circuit – Schematic created using CircuitLab The oscillator is functioning, producing a slightly distorted sine wave of about 1.5 V peak-to-peak and at about 560 Hz. I measured \$I_E\$ to be around 7 mA, but couldn't measure \$I_B\$ without my multimeter ruining the output of the circuit. As far as I know, this output should indicate that the transistor is in active mode, but if \$V_{BE}\$ is that small, shouldn't it be in cutoff? AI: The value in the datasheet is a maximum value, so any value lower than 1.2 V is within the specified limits. Furthermore, it is specified with 300 mA collector current, where your circuit is requires only about 1 mA collector current, so it's not suprising that you measure Vbe well below the 1.2 V value. In fact, there's a typical curve provided: That shows that around 0.6 V is expected when the collector current is this low.
H: PIC18 MCU Relay Issue I am having some strange issues with a PIC microcontroller (PIC18F45K22) driving a SainSmart 2 Channel Relay board (http://www.sainsmart.com/arduino-pro-mini.html). After a bit of troubleshooting I have been able to isolate the issue. Whenever I have a load connected to the relay (a solenoid in an electric door strike) and I transition from a logic low output to a logic high output, the program counter seems to jump to a random location in the code. I have found this by running my PICKit3 without any break points. Whenever this transition happens the code will randomly break (sometimes at Program Counter 0x0, other times at random locations.) Disconnecting the load from the relay (with no program changes) consistently eliminates the issue. I have swapped microcontrollers and channels on the relay board (even driven by a different pin from the PIC) with no change. The output pin from the microcontroller is connected directly to the IN1 pin of the board. JD-VCC jumper is in place, powered by the same power supply as the PIC. Setup: TRISDbits.TRISD1 = 0; ANSELDbits.ANSD1 = 1; LATDbits.LATD1 = 1; Macros used to control relay: #define Relay_1ON() do { LATDbits.LATD1 = 0; } while(0) #define Relay_1OFF() do { LATDbits.LATD1 = 1; } while(0) I have an almost identical setup in another project with no issues, so I am at a bit of a loss. Any thoughts? AI: When you go to the logic high state, does this correspond to the contacts opening? If so, you might be drawing an arc because of the inductive load, which will generate broadband RF. You might be able to suppress this by putting a series RC snubber across the contacts. Is your solenoid driven by AC or DC?
H: Do 74HCxx chips require a linear voltage generator? Recently I've read a book that says it's absolutely necessary to use a linear voltage regulator like LM7805 in circuits that use any of 74HCxx chips (CMOS logical gates). I thought that this advice is kind of odd (LM7805 requires 9V instead of 5V I most frequently use, 4V are used just to heat an air) and decided to re-check. I didn't find this requirement in any of 74HCxx specs, at least in specs from Texas Instruments which made chips I use. This requirement is also not mentioned in Wikipedia or any other source. All circuits I tried work just fine without LM7805, with only 100 uF capacitor as a filter. So I'm thinking, maybe this advice is outdated (the book was published in 2010) or maybe author just needed an excuse to give an example of linear voltage generator usage? In your opinion is LM7805 required to use 74HCxx? Do you use it in your circuits? AI: There is no requirement that would require a linear regulator for 74HCx. You should read the family spec to assure yourself. Read section 5 on the voltage ratings. In particular look at Figure 16 which shows the family VCC relationship. If you are using 74HC devices then they are rated for operation from 2 - 6 V ....but if you are using 74HCT then the device is only rated for 5 V +/-10% ....many do confuse this. The 74HCT devices can be mixed with 74LS TTL devices, while the 74HC are not guaranteed to interoperate with the same fanouts when mixed. If you are mixing 74LS and 74HCT devices, you may have difficulties meeting the +/-5% VCC tolerance of the 74LS devices (ripple from switching regulators) but should have no problems for 74HC devices.
H: Replacing an FT2232 chip with a custom microcontroller? I want to make a circuit board having the capability of configuring (not sure if this is the correct term, but burning a VHDL design (svf, pof file generated by Quartus)) into Altera CPLDs and FPGAs from my computer. I know a couple of ways of doing this. I can use an Altera USB Blaster cable and directly burn the file using Quartus. Another thing I've seen often is generating an pof/svf file from Quartus, and using urJTAG to program the chip via an FT2232 USB-to-JTAG bridge. I have a few questions here, Are these the standard ways of configuring Altera chips? Is there any other popular approach? Is it practical to make my own USB-to-JTAG bridge on an 8051 (or better) microcontroller chip and successfully configure the Altera chip by a short pyusb script? Do you recommend approach (2) for any reason besides a good engineering exercise? (too broad for the answer, but any help appreciated) As a side note, is there any active IRC channel / forum where such ideas are extensively discussed? Also, what's the best place to look for relevant resources for this project? AI: Are these the standard ways of configuring Altera chips? Is there any other popular approach? Well, at least they're popular. You of course don't have to use an FTDI chip to do JTAG – there's in fact loads and loads of microcontroller eval boards that have JTAG based on a firmware that runs on a microcontroller that "talks" USB. Many FPGAs have the capability to autonomously load their configuration from a specific kind of Flash / EEPROM. It's very common to have a microcontroller attached to the same memory chip, and program the configuration memory through the microcontroller, and then reset the FPGA, triggering the autonomous loading. Another option, if your FPGA supports that, is that instead of the memory chip, the FPGA talks directly to a microcontroller. This version is found very often in embedded devices, where there's one "main" controller anyway. Is it practical to make my own USB-to-JTAG bridge on an 8051 (or better) microcontroller chip and successfully configure the Altera chip by a short pyusb script? Sure. Why not? You'd typically not use pyusb but write a driver for eg. OpenOCD or similar, but yes, that's commonly done. JTAG isn't an overly complex electrical standard. There's in fact a lot of open designs that do USB-to-JTAG without an FTDI chip; mostly from memory and the OpenOCD docs: USBPROG 5.0 opendous-jtag Olimex ARM-JTAG-COOCOX The nice thing about these designs is that they directly work with openOCD (thus, you already get working software that can load images over JTAG if OpenOCD supports your target). There's really dozens more out there! Typically, FPGA and CPLD datasheets also specify quite well how bitstream loading has to happen, so it's far from impossible to write your own driver. I think it's important to clear up one common misunderstanding: JTAG is just an electrical specification and a logical specification on the level of "debug taps" and "shift registers". How to do something specific on a specific device (in your case, Altera programmable logic) is up to whatever drives the JTAG interface. Thus, having JTAG is like "having RS-232": Sure, you can now connect multiple computers (devices under test), but that doesn't mean you can already exchange sensible information with those (debug those). That is higher level logic unspecified by RS-232 (JTAG). Do you recommend approach (2) for any reason besides a good engineering exercise? Yes, I recommend it because it's often done in the industry – not that often through JTAG, but simply by implementing the configuration loading interface in microcontroller/CPU software. For example, the Ettus software radio peripherals of the USRP1 generation (ten years old by now) load the FPGA image through a Cypress FX2, which is a 8051-based microcontroller with a USB2 interface, into the configuration memory of the FPGA, from where the FPGA loads it.The USRP B200, B210, B200mini etc don't even have any configuration memory – the image is directly loaded through the firmware running on the Cypress FX3 (ARM A9 with USB3) into the FPGA from USB. The firmware itself is loaded over USB - the only bit of configuration on the device itself is a bootloader that allows the FX3 to load the firmware through USB. All their schematics are available online, as well as the firmware and FPGA logic. If I had to build my own adapter: I'd probably just use a Raspberry Pi as JTAG dongle, just for the ease of purchase.
H: How to find and overcome run-time RAM corruption in a Microcontrollers? How can I find and overcome any RAM corruption in a Microcontroller (ARM Cortex M0) during run-time? For example what if two or three locations are corrupted, say 0x2E 0x2F,0x30. How can I still let the system run by overcoming or ignoring this corruption. AI: You need to pick the right MCU which has the features you need. Here's an example of Cortex M0 chip which has both EDAC (correction of single-bit errors) and Scrub (periodical refresh of memory contents which prevents error accumulation). If you don't have error correction hardware features, the best you can do is periodic check of memory content which wasn't expected to change and a reboot if a change was detected.
H: SIM900 schematic verification I am designing a SIM900 schematic so before going further I thought of verifying the schematic first. I will using SIM900 with PIC18F2520. So to power the SIM900 and Microcontroller, I am using LM7805 for MCU and LM2576 for SIM900. Following is the circuit: LM2576 o/p 4.1v is for SIM900 & LM7805 o/p 5v is for MCU SIM900 Circuit: Explanation: PWRKEY: PWRKEY is connected with a push button which when pressed will connect this pin to ground, in order to start the power on scenario of module. UART: TX RX lines are connected to RX TX of the MCU. NRESET: connected to a push button to reset the module. VRTC: I am not using any RTC function so just connected a 4.7uF cap. NET & STATUS: Connected led's to these pins to show the status and network of the module. Apart from the above schematic, is there any recommended circuit which I am missing in the circuit.? Do I need a voltage level shifter between TX RX of SIM900 and TX RX of MCU.? I initially used a breakout board of SIM900 and tested it with the MCU, it was working fine without any external circuitry for voltage level shifter. Is there anything which I am missing in the circuit. Any suggestions would be very helpful. Breakout board: AI: SIM900 Serial interface runs on 2.8 V logic levels, PIC runs on 5 V so you are definitely need level shifting. You did not provide a link to that break-out board but I am sure that there must be some level conversion circuit on that. From application note. Please note that the UART level is 2.8V, if the level is not matching, a level shift circuit is needed.
H: Setting up SPI with sam4s16c I started programmer for Software and have a professional background with large software projects in c++ and QT. Now I changed the company and also have to write some low level hardware code and i have some starting trouble, messing around with tones of datasheets. I am new to hardware programming in general and don't know much about tools or how can i help myself. My plan is to start communication with a Sam4s16c (on a SAM4SXplained board) to a L6470 motor via SPI. My problem is that the SPI setup gives me headache and will not work. Measuring the CS/SS (pin31A) an oscilloscope will only show high voltage (~3,2V) but no valid clock (I should see an "up and down" here, or not?). I am not sure what is a good value for the baudrate divider (and what it means in general) After a lot of reading i heard i have to "configure" the pins correctly, i tried this with this lines gpio_configure_pin(SPI_NPCS1_PA31_GPIO, SPI_NPCS1_PA31_FLAGS); gpio_set_pin_high(SPI_NPCS1_PA31_GPIO); My code so far. #include "asf.h" #include "stdio_serial.h" #include "conf_board.h" #include "conf_clock.h" #include "conf_spi_example.h" #ifdef __cplusplus extern "C" { #endif /* Chip select. */ #define SPI_CHIP_SEL 0 #define SPI_CHIP_PCS spi_get_pcs(SPI_CHIP_SEL) /* Clock polarity. */ #define SPI_CLK_POLARITY 1 /* Clock phase. */ #define SPI_CLK_PHASE 1 /* Delay before SPCK. */ //#define SPI_DLYBS 0x40 #define SPI_DLYBS 0xFF /* Delay between consecutive transfers. */ #define SPI_DLYBCT 0x10 /* SPI clock setting (Hz). */ static uint32_t gs_ul_spi_clock = 1000000; volatile uint32_t g_ul_ms_ticks = 0; void SysTick_Handler(void) { g_ul_ms_ticks++; } static void mdelay(uint32_t ul_dly_ticks) { uint32_t ul_cur_ticks; ul_cur_ticks = g_ul_ms_ticks; while ((g_ul_ms_ticks - ul_cur_ticks) < ul_dly_ticks); } /** * \brief Initialize SPI as master. */ static void spi_master_initialize(void) { //Assign I/O lines to peripheral #define SPI_MISO_IOPIN IOPORT_CREATE_PIN(PIOA, PIO_PA12_IDX) #define SPI_MOSI_IOPIN IOPORT_CREATE_PIN(PIOA, PIO_PA13_IDX) #define SPI_SPCK_IOPIN IOPORT_CREATE_PIN(PIOA, PIO_PA14_IDX) #define SPI_NPCS1_IOPIN IOPORT_CREATE_PIN(PIOA, PIO_PA31_IDX) ioport_set_pin_mode(SPI_MISO_IOPIN, PIO_PERIPH_A); ioport_disable_pin(SPI_MISO_IOPIN); ioport_set_pin_mode(SPI_MOSI_IOPIN, PIO_PERIPH_A); ioport_disable_pin(SPI_MOSI_IOPIN); ioport_set_pin_mode(SPI_SPCK_IOPIN, PIO_PERIPH_A); ioport_disable_pin(SPI_SPCK_IOPIN); ioport_set_pin_mode(SPI_NPCS1_IOPIN, PIO_PERIPH_A); ioport_disable_pin(SPI_NPCS1_IOPIN); /* Configure an SPI peripheral. */ spi_enable_clock(SPI_MASTER_BASE); spi_disable(SPI_MASTER_BASE); spi_reset(SPI_MASTER_BASE); spi_set_lastxfer(SPI_MASTER_BASE); spi_set_master_mode(SPI_MASTER_BASE); spi_disable_mode_fault_detect(SPI_MASTER_BASE); spi_set_peripheral_chip_select_value(SPI_MASTER_BASE, spi_get_pcs(SPI_CHIP_PCS)); spi_set_fixed_peripheral_select(SPI_MASTER_BASE); spi_set_delay_between_chip_select(SPI_MASTER_BASE, 0); // Set the Chip Select register spi_set_transfer_delay(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_DLYBS, SPI_DLYBCT); int16_t baudrate = spi_calc_baudrate_div(96000, sysclk_get_cpu_hz()); spi_set_baudrate_div(SPI_MASTER_BASE, SPI_CHIP_SEL, 8); //sysclk_get_cpu_hz() / gs_ul_spi_clock); spi_set_bits_per_transfer(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CSR_BITS_8_BIT); //spi_configure_cs_behavior(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CS_RISE_NO_TX); spi_set_clock_polarity(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CLK_POLARITY); spi_set_clock_phase(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CLK_PHASE); spi_enable(SPI_MASTER_BASE); mdelay(100); } static void spi_master_write(uint16_t value) { spi_write(SPI_MASTER_BASE, value, SPI_CHIP_SEL, 0); while ((spi_read_status(SPI) & SPI_SR_RDRF) == 0);/* Wait transfer done. */ } static spi_status_t spi_master_read(uint16_t* data) { uint8_t uc_pcs; spi_status_t returnValue = spi_read(SPI_MASTER_BASE, data, &uc_pcs); return returnValue; } static void ledHello(void) { for (int i=0; i < 6; ++i) { LED_Toggle(LED0_GPIO); LED_Toggle(LED1_GPIO); mdelay(150); } mdelay(150); for (int i=0; i < 5; ++i) { LED_Toggle(LED0_GPIO); mdelay(150); } for (int i=0; i < 5; ++i) { LED_Toggle(LED1_GPIO); mdelay(150); } // Both LEDs stay permanent on } int main(void) { board_init(); sysclk_init(); NVIC_DisableIRQ(SPI_IRQn); NVIC_ClearPendingIRQ(SPI_IRQn); NVIC_SetPriority(SPI_IRQn, 0); NVIC_EnableIRQ(SPI_IRQn); // [main_step_systick_init] if (SysTick_Config(sysclk_get_cpu_hz() / 1000)) { // Systick configuration error while (1); } ledHello(); // Code here toggles leds on board /* Configure SPI as master, set up SPI clock. */ spi_master_initialize(); // activate the SPI of the micro controller of the L6470 via SPI spi_master_write(0x18); // SetParam(Config) spi_master_write(0x16); spi_master_write(0x10); mdelay(100); while (1) { spi_master_write(0x38); // GetParam(Config) static uint16_t data; spi_master_read(data); spi_master_read(data); } } #ifdef __cplusplus } #endif At the moment i try to setup the spi clock / output correctly. Did i miss something? AI: You're missing the GPIO setup. You MUST NOT assign the GPIO function but you need to tell the pin which alternate function it actually has. This will be something along the lines: #define SPI_SO_PIN PIN_PC28B_SPI_MISO #define SPI_SO_MUX MUX_PC28B_SPI_MISO #define SPI_SI_PIN PIN_PC29B_SPI_MOSI #define SPI_SI_MUX MUX_PC29B_SPI_MOSI #define SPI_SCK_PIN PIN_PC30B_SPI_SCK #define SPI_SCK_MUX MUX_PC30B_SPI_SCK #define SPI_CS0_PIN PIN_PC31B_SPI_NPCS0 #define SPI_CS0_MUX MUX_PC31B_SPI_NPCS0 #define ioport_set_pin_peripheral_mode(pin, mode) \ do {\ ioport_set_pin_mode(pin, mode);\ ioport_disable_pin(pin);\ } while (0) ioport_set_pin_peripheral_mode(SPI_SCK_PIN, SPI_SCK_MUX); ioport_set_pin_peripheral_mode(SPI_SO_PIN, SPI_SO_MUX); ioport_set_pin_peripheral_mode(SPI_SI_PIN, SPI_SI_MUX); ioport_set_pin_peripheral_mode(SPI_CS0_PIN, SPI_CS0_MUX); Atmel has a pretty good example repository. Start Atmel Studio, select new example project, select your controller or board and load something related to the component you're implementing (SPI in your case). Then follow "main" until you get to the point you're interested in. From there on it's usually easy going. If a pin won't move for whatever reason, the best guess is that you have your GPIO (or alternate ping configuration) setup wrong. It seems the SAM4S is a little different from the SAM4L. If you take a look at the supplied SPI example from the ASF, you will see the init sequence (function board_init() in SPI_EXAMPLE1\src\ASF\sam\boards\sam4s_ek\init.c) as: /* Configure an SPI peripheral. */ spi_enable_clock(SPI_MASTER_BASE); spi_disable(SPI_MASTER_BASE); spi_reset(SPI_MASTER_BASE); spi_set_lastxfer(SPI_MASTER_BASE); spi_set_master_mode(SPI_MASTER_BASE); spi_disable_mode_fault_detect(SPI_MASTER_BASE); spi_set_peripheral_chip_select_value(SPI_MASTER_BASE, SPI_CHIP_PCS); spi_set_clock_polarity(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CLK_POLARITY); spi_set_clock_phase(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CLK_PHASE); spi_set_bits_per_transfer(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_CSR_BITS_8_BIT); spi_set_baudrate_div(SPI_MASTER_BASE, SPI_CHIP_SEL, (sysclk_get_peripheral_hz()/ gs_ul_spi_clock)); spi_set_transfer_delay(SPI_MASTER_BASE, SPI_CHIP_SEL, SPI_DLYBS, SPI_DLYBCT); spi_enable(SPI_MASTER_BASE); gpio_configure_pin(SPI_MISO_GPIO, SPI_MISO_FLAGS); gpio_configure_pin(SPI_MOSI_GPIO, SPI_MOSI_FLAGS); gpio_configure_pin(SPI_SPCK_GPIO, SPI_SPCK_FLAGS); gpio_configure_pin(SPI_NPCS0_GPIO, SPI_NPCS0_FLAGS); To actually talk to a device you will need to select that device (this is what spi_set_peripheral_chip_select_value does, it also includes logic if you have a DEMUX on board that's why it uses the spi_get_pcs macro). Since SPI_CHIP_SEL is 0, you will talk to whatever device is connected to CS0. If you want to talk to a device on a different chip select line, you will need to modify these values and your GPIO setup accordingly. Your first task is to get the chip select line low. Unless this is done, you will never receive any data from the slave because it thinks that you're not talking to him but to some other device on the same SPI bus.
H: Is electrical energy wasted when a device is fully charged? Many a times I leave the laptop connected to the charger with the switch on for the entire day. When it becomes fully charged does it still consume electrical energy? AI: Yes, some energy will still be consumed. Assuming the laptop is switched off (not in sleep mode) and the battery is fully charged, it will consume very little energy (a few Watt perhaps). When in sleep mode, the laptop keeps the RAM powered so it will consume somewhat more power. But do not neglect the power adapter (many call this the charger but it is not, the charging circuit is inside the laptop). If the power adapter is of good quality it will also consume very little energy. You can easily check what is taking significant power as this power is converted into heat. So an inefficient power adapter will get warm or even hot when you charge the laptop. When the laptop is off the power adapter should not feel warm (allow it some time to cool down after charging though).
H: Winding method of a toroid core I find some text about the winding of a toroid core as below: But what's the math and physics behind these? BTW: Can someone suggest some good books about the design of an inductor/transformer not only in theory but also about "how to make them by hand". AI: These winding instructions give you a single-layer inductor that minimizes parasitic effects of capacitance. The (B) version suffers from capacitance from one turn to its neighbours. The (C) version minimizes neighbour-capacitance but suffers from capacitance from end-to-end. The (A) version compromises between (B) & (C). Minimizing capacitance increases self-resonant frequency (important where the inductor is used in wide-bandwidth circuits). For toroids used in high-Q tuned circuits, core relative permeability is often quite low (perhaps a factor of ten higher than air). So not every turn is linked to all other turns as it would for high-permeability cores. Although the rule where inductance is proportional to turns^2 is often applied, turns couple more tightly when bunched together, and couple less tightly when spread. In circuit simulators, the coupling factor (k) is certainly less than one, and is often less than 0.5 for low-permeability cores. The math is not worth the effort. Besides, tolerance on toroid core permeability is notoriously poor.
H: Trace inductance I'm trying to understand why the ground plane in PCB is preferred to be as wide as possible. Mathematically the self-inductance in a free space conductor has a relationship as shown in the uploaded picture: But I want to understand the physical analysis of how is the increase of width will reduce the self-inductance? AI: When two small wires are bifilar wound around a magnetic core, they exhibit the same inductance as one single wire. The emphasis in the first sentance is "small" meaning that any flux produced by one of the small wires is perfectly coupled to the 2nd wire. In effect, each wire (in the pair) acquires an inductance that is twice the inductance of a single wire and, when there are two inductors are in parallel, the net inductance IS the same as if a single wire were used. The magnetic core helps achieve flux coupling between those two wires in this little thought experiment. Now, remove the core and coupling is not the same; current flowing in one wire (despite being closely wound with the other) does not 100% couple to that other wire and, as you spread the gap between those two wires, coupling gets even smaller and ultimately, the inductance of the pair starts to look like L/2. It's the same effect with a wide copper conductor - the current is largely spread evenly across the width but flux generated by a part of the current along one edge does not 100% couple with the flux generated by a similar part of current flowing along the other edge. So progressively coupling starts to reduce as the copper conductor gets wider and you start to move away from L to L/2. The limit of L/2 does not take into account frequencies where the applied signal wavelength starts to be significant in terms of track thickness of course. That creates a whole bunch of other things to consider!
H: Texas Instruments Schmitt Trigger inputs Hi I want to use the TPIC6C595 in some project. Because my application needs to be very noise insensitive I am wondering whether the shift register uses Schmitt Trigger inputs for G, SRCK, RCK, CLR, SER IN. But after looking at the datasheet I could not find any information about that. How Texas Instruments marks the type of inputs? AI: It doesn't use schmitt trigger inputs on those pins. Look at the recommended input levels, they are fairly normal for some logic gates without schmitt trigger inputs. VIH High-level input voltage 0.85 VCC minimum VIL Low-level input voltage 0.15 VCC maximum I also would suspect that if it did use schmitt trigger inputs it would mention this on page one of the data sheet. There would also be some mention of the input hysterisis voltage limits.
H: Rising-edge or Falling edge Counter When designing an arbitrary count sequence synchronous counter using kanuagh maps and either JK or D flip flops, does it matter whether the flip flops are rising-edge or falling-edge triggered? AI: It doesn't matter Assume you are designing a 1-Bit up counter Count_Pos Such that each positive clock cycle it will add 1 to whatever stored in its count register. And another identical counter Count_Neg that will add 1 to whatever stored in its count register each negative clock cycle Both of these counters do have a combinatorial circuit part and a sequential circuit part; Such that at positive or negative edge the sequential part captures the combinatorial part output and stores it. When you are doing a Boolean minimization using K-map you are talking about minimizing the combinatorial part of the circuit that is doing the addition operation not the part that is storing the output of this operation. For an example these are two synthesized 1-bit up counter i`ve used Yosys to synthesize them module Count_Pos(RST,CLK,OUT); input RST,CLK; output reg OUT; always @ (posedge CLK) begin if(RST) OUT<=0; else OUT<=OUT+1; end endmodule // COUNTER The circuit after synthesis And the other module is module Count_Neg(RST,CLK,OUT); input RST,CLK; output reg OUT; always @ (negedge CLK) begin if(RST) OUT<=0; else OUT<=OUT+1; end endmodule // COUNTER You can see that the synthesis tool replaces the positive edge triggered D-Flip flop [_DFF_P_] with a negative edge triggered one [_DFF_N_] while keeping the same combinatorial circuit part [Which is a simple NOR gate] So whenever designing a counter or any other state machine. You are using K-map to minimize the combinational part of the circuit.
H: Electrical engineering beginners book This maybe the wrong forum to be asking such a broad question but I'm looking for an EE book that was referenced by a friend years ago. The whole book looks as though it were scanned copies of a notebook. It provided the fundamentals of electrical circuits along with what looked like hand written notes in it. I know, extremely broad but he mentioned that a lot of EE individuals loved it. AI: I'm pretty sure I owned those years ago. I picked them up from Radio Shack back in the 80's. If I remember correctly, they were written by Forrest Mims. I did a quick search and all I could find that might be a newer version was this.
H: What are effects of attaching more antennas to Wi-Fi router via RP-SMA splitter Theoretically and practically speaking what are effects if in typical Wi-Fi router attach more than one antenna per output using something like RP-SMA Splitter and or extension cable ? In my case, Asus AC66U 802.11ac Dual-Band; 2 chips(bgn, an + ac) connected to each 3 antennas. MIMO: 3x3:3 AI: At best it probably won't help and at worst it will degrade your signal if they are setup like in the picture. Imagine an incoming transmission coming in parallel to the line the two antennas create. The signal is picked up by the first antenna then travels some short distance where it is picked up by the second antenna. That signal will now combine at the splitter out of phase and likely cause destructive interference. I cant say for certain but I'm assuming the two or three typically attached to these routers are designed at the system level not to interfere with each other. Some systems I have seen use a coupler with antennas pointed in different directions but share a receiver. With this approach you'd need to find the radiating pattern of your antennas and used short coax to arrange them so only one picks up a signal for a given transmitter/receiver geometry. As Evan pointed out a hybrid coupler would be used. The application in the link is for sharing one antenna but covers the basics
H: Why does the ADC require 3 wires instead of 2? I'm very confused about ADC. I do apologize if these questions sound silly. I use ATMEGA328P for ADC. Why is the negative terminal required for ADC to take measurements, if the ADC pin is already negative by itself? Why does the ADC only take measurements when resistance is present between the ground and the ADC input pin? If I remove the 1k resistor, then measurements no longer work, why doesn't ADC pick this up, unless a resistor is present? If I take the VCC and GND wire between my fingers in separate hands, and let the ADC wire 'float', I get a wave: (no photo-cell, just bare wires, GND in my left hand VCC in my right hand and ADC input floating in the air) What is this wave representing? If I don't hold the VCC and GND, then the ADCH is just showing random output, so the wave doesn't occur by itself. My vref is set to AREF of 4v. If I connect the ADC to an aluminium jar, I see what appears to be square wave, is that possible that I'm picking up some kind of signal from random device, like for example wifi chip? or not without op-amp? AI: The photocell and 1K form a voltage divider, creating a voltage depending on the light. You'll get 5V * 1K / (R+1K) as the voltage on A0. With just the photocell, A0 will be pulled up to 5V so that's no use. With the wires loose, you're picking up stray AC signals - the wires act as an antenna.
H: AND gate, red wires logisim I have these and gates. When I disconnect one of the red wires from its corresponding gate, the other goes green. But if they're both connected it goes red. From what I've read in the documentation, this means this carries an error value, but I don't see how that could be the case here. I'm just working with this as a subcircuit, so I know the exact values going in that cause a problem - which is, if get or set = 1, these two AND gates turn red. Any suggestions for debugging? AI: Something (that isn't in your picture) is either connecting those two wires together, or is connecting them to another output. Disconnect it.
H: why does this conditional logic work? I'm toying with outputs for an LCD on my FPGA. When I press the button, I want it to display the number 6. Instead, it is displaying 6 constantly, unless I press reset button, at which point the entire screen goes blank, which it should. module LCD(CLOCK_50,LCD_DATA,LCD_RW,LCD_RS,LCD_EN,BUTTON); input [2:0] BUTTON; wire button; wire button2; assign button2 = ~BUTTON[2]; assign button = ~BUTTON[0]; input CLOCK_50; output LCD_RS, LCD_RW, LCD_EN; output [7:0] LCD_DATA; reg [7:0] D; reg [1:0] Op, En; ////module clk_div_10(clk,reset,clk_out); clk_div_10 clk(CLOCK_50,,clock); wire clock; FPGA_2_LCD DUT1(clock,LCD_RS,LCD_RW,LCD_EN,LCD_DATA, ,D,Op,En,button2); always @(posedge clock or posedge button) if (button == 1) begin D <= 8'b00110110; En <= 1'b1; Op <= 1'b1; end endmodule AI: always @(posedge clock or posedge button) if (button == 1) begin D <= 8'b00110110; En <= 1'b1; Op <= 1'b1; end Let me be your FPGA. Allow me to explain what hardware I have been told to have. Ok, so we are powering on, lets power-on reset all of our registers. Lets see now, ok, we have a clocked always block here, that means I have some flip-flops. Ooo, I also have an asynchronous reset called button which is active high, what does the always block tell me to do under this reset condition. Because I have been told what to do at reset, I'll do this during power-on reset as well - hmm, it says to set D to 54, great I'll do that. Now I am have finished powering on and come out of reset, lets start running. Ok, so a clock edge comes, what do I do with the register? Ok, reset (button) is not asserted. Hmm, it seems the person wants me to retain my value. Great sorted. Now button is high. What do I do? Ok, I'll reset my register to 54 again. Woop, done. Now the user pushed my global reset. Time to fully reconfigure. All outputs to HIGH-Z! Arrrrrg. I've gone blank. What do I do? Yay, they've released my global reset button. Time to load my memory again. ... And back to the beginning. TL;DR; You may notice a pattern here? Never does the value of D get set to anything other than 54. A hint for next time, in all seriousness. FPGA tools like Quartus which you will be using for your DE0 board have RTL netlist viewers. Once you synthesize your design, you can load the netlist to see a graphical representation of what hardware has been inferred. This will quickly give you an idea of what is going on.
H: Operating two wireless cars simultaniously This is my first "serious" electronic project, so I apologize if my question is silly. I tried to follow this tutorial to construct a remotely controlled car. Moreover, I wanted to make two cars. Each one operated by its remote control (to make fun with both my boys). I thought that this is what address pins are standing for, so I connected differently the address pins (1-8) of each pair of ht12e-ht12d chips. However, only one car can be operated at a time. If I turn on both transmiters, this causes a collision (I speculate) and nothing works. Currently, both cars are operated by the radio trasmitter/reciever of the same frequency (433MHz). From my search, I found that if I use 433Mhz for one car and 315Mhz for the other, no collision should occur. I'll use this solution if I do not find something better. My question is why different pinout of address pins doesn't solve the problem. This is what these pins are for (or they are not?). AI: No such thing as a silly question. The addressing on the encoder-decoder pair ensures that data is not received by a decoder with a different address from the encoder. A typical application for this would be a "secure" garage door opener where you program the door opener and remote to have the same address. This will not prevent RF interference from messing up the reception of one or both receivers if you use two transmitters on the same frequency simultaneously. Unfortunately the solution is to split the two radio channels onto different frequencies.
H: Rectifier voltage drop under load I have a bridge rectifier that is converting 240v AC into approx 358V DC The rectifier is smoothed by 2 X 10,000uf capacitors Under full load, I am drawing 3000 watts on the DC side but for some reason the voltage drops down to 280V DC yet the AC side stays at 240 My question is why is my voltage dropping so much? The DC cables are 300 feet long #10 awg wire but the voltage measures the same at both ends +/- 1% so its not lost in the cable. I also checked that all the connectors are tight and making proper contact. Nothing is getting hot either.. The meter I am using the measure with is a "Circuit test DCL-320" Here are the components I am using: https://www.digikey.ca/product-detail/en/crydom-co/M5060SB400/CC1656-ND/752672 2 X https://www.digikey.ca/product-detail/en/rubycon/400LSU10000MNB90X151/1189-1911-ND/3927506 Thanks for any assistance John AI: 358Vac pk No load x 0.707 = 253Vac rms if it is a sine. 3000W at 240V @ 12.6A @ ~20 Ohms linear load The engine on the generator is capable of sustaining a continuous 3kw load. This is where people make false assumptions. This only applies to linear loads and a bridge cap is a short circuit of about 0.1 to 1 Ohm not 20 Ohms. It all comes down to impedance ratio of load/source. For a linear PFC it needs to be a high R Load/Source ratio. Batteries and caps are very low impedance with pulsed current. Solution : Active PFC.
H: understanding constant current source circuit The circuit is a constant current circuit which charges the capacitor C1. The C1 is periodically discharged through a resistor which is not shown in the image. During discharging, the constant current circuit is isolated (through a mux, not shown in figure). Here is my understanding. The capacitor C1 is assumed to be discharged in the beginning.Also, Q1 is assumed to be off. The negative terminal of opamp now sees 10 V at it hence, the output of opamp goes to 0V. This turns on Q1. So, the current through C1 is through R1, which is 240 uA. My present question is why i am unable to find the ramping voltage across C1? It is tied to 5 V from the point at t = 0. Edit: able to see the ramp. But, unable to understand how it stops at 5 V? Added image of current and voltage across BJT(Green) AI: Set the capacitor's initial condition to 0 volts by changing it to "333m IC=0". Details on initializing capacitors in Spice here or in this question. You'll then see the ramp. By default, capacitors and inductors are set to their steady-state value at t=0. You can check the box "Skip the solution of the initial operating bias point" in the Transient dialog to disable this, which will also cause the capacitor to start at 0 and the ramp to be displayed. (Equivalently, use the directive ".tran .001 uic") Edit: I've removed my answer for the second question because Tom's is better.
H: How to connect Aref (Avcc and Agnd) and where to place the bypass capacitor? This is my schematic: Should I connect a capacitor between the PIN 32 and GND Pin or AGND Pin? From the AVR Hardware Design Application Note: 2.2. Analog Supply The AVR devices that have a built-in ADC which have a separate analog supply voltage pin, A V CC . This separate voltage supply ensures that the analog circuits are less prone to the digital noise originating from the switching of the digital circuits. To improve the accuracy of the ADC, the analog supply voltage must be decoupled separately, similar to the digital supply voltage. AREF must also be decoupled. The typical value for the capacitor is 100nF. If a separate analog ground (AGND) is present, the analog ground should be separated from the digital ground so that the analog and digital grounds are only connected at a single point (at the power supply GND). Grounds are all same. Right? So does it make a difference if it is decoupled with analog one or the digital one? NOTE : It doesn't need an critical ADC application but I would want to use ADC later. Application doesn't need precise or accurate ADC since it is more sort of learning project but it would be helpful if solutions or suggestions provided are for making it perfect. AI: To answer your specific question, you want the decoupling capacitor between AREF and AGND. The underlying idea is that you separate the analog power/ground from the digital power/ground, so digital transients and interference don't show up in the ADC. As the datasheet says, you connect the analog ground and digital ground together only at the power supply. Theoretically grounds are all the same, but in practice, the wires/traces have some impedance so different parts of the ground trace won't have exactly the same voltage. By using separate wires for the analog and digital ground (a star ground), the decoupling capacitors will filter out most of the digital transients before they can get to the analog side. This article (Staying Well Grounded, H. Zumbahle, Analog Dialogue Jun 2012, V46) provides more detail.
H: Initializaiton of Hitatchi LCD Trying to set up the initialization of the HD44780. Is this bad practice to have done it like this? Or is it going to try and send all those lines to LCD_DATA at once? enter code here always LCD_RW = 1'b0; initial begin LCD_RS <= 1'b0; #15; //delay 15ms until set function LCD_DATA <= 8'b001101xx; //set 8 bit function #4.2; LCD_DATA <= 8'b00001100; //turn lcd on, with cursor off and not blinking #0.04; LCD_DATA <= 8'b00000001; //clear display #1.53; LCD_DATA <= 8'b00000010; //Entry Mode Set, Cursor moves right and output does not shift #0.04; end AI: That won't work. Delays aren't synthesizable; they only work in simulation. You will need to implement this as clocked logic -- probably some sort of state machine.
H: 16MHz Crystal trace length I can't length match the traces from my microcontroller to its 16MHz crystal. The trace length difference is quite different, as you can see. Would this be a problem? AI: For a crystal connected to the internal oscillator of an IC, like you have, you don't need to match the track lengths. Keep the tracks as short as possible and keep the tracks on one layer over a ground plane if possible. The latter reduces interference into the oscillator circuit and reduces the interference from the oscillator onto other circuitry. What you have looks good.
H: Circuit to switch power between Battery and main Source for BLE Module I am power a Bluetooth module (referenced as BLE) operating at 3.3v. The module has a microcontroller inside and we want to keep the RTC working all time for scheduling, which means in case if the main power source goes down, the module will keep running on the battery. As you can notice in this overall design, two sources to the left (mainly voltage from source and the Battery Cell c2032. The two are fed into a circuit that selects the battery in case of power absence. I would like to inquire if there is any suggested circuit for that to switch immediately in order to to keep the timer working. Waiting for your suggestions. Thank you. AI: Dual-supply is a very common problem, and thus, you might simply have a look at the circuitry that selects power sources on commercial devices to get inspiration. Note that microcontrollers with RTC often have a separate V_bat pin that allows a buffer coin cell to be used to run the RTC when main power is down. I recommend checking that you don't have that prior to considering working on a power switch. You can usually build such power selection circuitry out of a few discrete semiconductors and resistors – however, considering you sound like you're designing for manufacture, it's probably easier AND more cost-efficient to use a specialized IC for that. Every major IC manufacturer (TI, ST, Maxim, NXP/Qualcomm, Linear, ON Semi, …) has a "power management" category. What I've used is an LTC4412 – the datasheet has good example application circuits. I don't know if it's for 3.3V, but you should check the datasheet to learn what kind of device you're looking for. You'd probably want the LTC4411, which includes the switch in the IC itself, and is about USD1.90 in quantities of 100. Note that you'll definitely need to know whether you're running off battery or grid power in your software – a coin cell really has not that much energy, and you'd want to avoid doing too much communication in order to make it last as long as possible.
H: While discussing eigen functions of LTI system, why we ignore the natural frequency term in response? Consider the LTI system, a series RL circuit (initially at rest). If we define voltage as input and current as output, whatever be the forcing function, output contains a component \$ e^{-Rt/{L}}\$ corresponding to the particular system. http://www.intmath.com/differential-equations/5-rl-circuits.php We also know \$ e^{st}\$ is an eigen function of LTI system which means if we apply an input of \$ e^{st}\$, a scaled version H(s)* \$ e^{st}\$ will appear as output. Output contains only the frequency corresponding to input (forcing function). Hence we hear statements like 'Linear systems do not introduce new frequencies(harmonics)'. Isn't the first case and second argument contradictory? How can we explain the absence of natural frequency(\$ e^{-Rt/{L}}\$) term in latter case? Also how can we impose initial conditions at t= \$-\infty\$ for these everlasting inputs of kind \$ e^{st}\$? Note: A similar situation arises for LC circuit analysis, where output contains a terms corresponding to natural frequency \$ \omega_0\$. AI: The eigenvalues are the roots of the characteristic equation, so \$s\$ needs a value in your first \$e^{st}\$. Generally, if \$s=-\sigma_1\pm j\omega _1\$, is a complex conjugate pair, then the corresponding eigenvalues will be \$e^{-\sigma_1 t}(cos(\omega _1 t)\pm jsin(\omega_1 t))\$, and \$\omega _1\$ will be the natural frequency. In your second \$e^{st}\$, \$s=j\omega\$ represent a forcing sinusoid at an arbitrary frequency, \$\omega\$. If there are no complex or imaginary eigenvalues, there is no natural frequency, just 1st order real exponential terms.
H: Can I use a Class D amplifier as a summing amplifier? Context: I'm creating a mono, battery powered speaker. I'd like to sum the left and right channels of a stereo input signal into a mono output signal, which I feed into a Class-D Mono Audio Amplifier to drive the speaker. The stereo-to-mono solution I've decided on is to create a summing amplifier with unity gain, and I'd like to keep my circuit simple by using the Class D amp in place of the op amp. Will this work? Or do Class D amplifiers work too fundamentally differently from a regular op amp? simulate this circuit – Schematic created using CircuitLab EDIT: Here's my revised circuit diagram, based on what I learned from the answers below. I've opted not to DC-decouple for the moment, but I haven't yet tested this. simulate this circuit AI: Technically, yes, but you're doing it wrong :) Assuming your class D amplifier is an operational amplifier, that is, practically no current flowing into the inputs, and output is a (high) multiple of the difference between the + and - input. The fact that it's a class D amplifier doesn't really matter here – idealized, after the output filter stages, it should work as such an amplifier after all, within its bandwidth. A small thing you've got to realize: you might not have overly linear phase in your amp's bode plot – especially towards the higher end of its bandwidth. So, there might be instability for signals that are very high in frequency – make sure your input signals are already properly band-limited. Note that for most signal applications, 200 Ω does sound a little low as resistance between the two inputs. But that completely depends on what you drive the amplifier with. Also note that audio amplifiers are typically not operational in the sense that their inputs are not designed to be high-Z (zero current flowing into the amp), but properly terminated to achieve high power transfer into the amplifier to avoid noise/oscillations. Furthermore, you'll find that, at least logically, audio amplifiers typically already have the feedback that you've drawn – that's how they do reliable gain, after all. So, even the second aspect of op-amps, namely the "very high gain" isn't properly going to work out: after all, a typical amplifier has maybe a gain of 10V/V to 50V/V – that's far less than a typical opamp itself has, and that will limit how well your summing amplifier works. So, as FakeMoustache said: not like this. Just sum up the inputs with two larger resistors. You can even DC-decouple them with caps, if you like (the classical RC highpass formulas apply).
H: Best design choice: linear regulator or switch converter I need to power a Thermoelectric module with 10A maximum load current. I'm designing a card with a minimal design in order to change the current or the voltage across the load, given a standard voltage source. I just need a minimal regulation of the load, which is, just be able to decrease the power of the thermoelectric module from 100% to maybe 80-90%. Thus I was thinking to control the module by voltage, since precise regulation is not needed and voltage control is usually much easier than current control. I am choosing among a linear voltage or a switching regulator solution. The point is that the output voltage should be absolutely flat, with Maximum 5% ripple. A potentiometer should be used to "regulate" the power of the system. That's why to start with I was looking into linear voltage regulators. The point is that, to be on the safe side, I would require at least a 15V max output voltage and 20A output current model. Thus I was thinking in designing several regulators in parallel, but I am aware that this is a bad idea. How could I design a safe parallel regulator circuit? If the linear regulator is a bad idea, is there any off-the-shelf step down switching regulator which does not require any external components (no coils or caps) more than a few resistors? As said I'm not concerned about the accuracy of the system but just about reliability, design robustness and cost. AI: Your ripple requirement isn't that hard – what's more problematic is that your output voltage * output current = 300 W! That's quite a lot. You would not want to burn a couple of volts at 20A over a linear regulator (which, by the way, makes no sense – that will convert the energy that you don't put inot your thermoelectric module to thermal energy, which is kind of what you wanted to regulate in the first place....). Linear regulators simply work by having an "adjusting" internal resistance that simply drops the voltage difference that's between your in- and output and converts that to heat. So, if the in-output difference is just 2V, at 20A, your linear regulator would dissipate 2 V * 20 A = 40 W of power. That's a terrible thing to cool. If the linear regulator is a bad idea, is there any off-the-shelf step down switching regulator which does not require any external components (no coils or caps) more than a few resistors? Terminology: When talking about regulators, it's not perfectly sure whether you're only referring to the thing that regulates the currents flowing, or mean the complete system including all the necessary energy-storage components. Usually, we'd use the former meaning. For the other thing (controller + switch + power storage (coil)), we'd say supply, or at least module. You can of course buy readily made power supplies. Every laptop has one, and they even exist for the currents you need. Getting one that is adjustable might be a little harder, but you might want to think about just using PWM on the output to reduce the average power going into your module. Of course, that'll technically absolutely break the "5% ripple" requirement (PWM is actually 100% ripple, if you want to consider it that way), but I'm not sure where that requirement came from in the first place. Maybe you'd want to also specify the acceptable/unacceptable frequencies for deviations from the intended current/voltage point, and explain why you'd need so strict regulatory limits for something as slow as a thermal element. **Update:* nope, not PWM then, according to your comment :) You can also buy adjustable 300W supplies – but these tend to be a little more costly. Regarding modules: The module we're talking about will most probably be sold as "open|closed frame power supply".
H: resistor value in wheatstone bridge I have a resistance based sensor which gives the resistance change when the strain/force is applied. How to measure the unknown resistance change using the Wheatstone bridge circuit.? I mean what are the important things we have to keep in mind while selecting the resistor value. The initial resistance of the sensor is not the same. it always give the creep resistance value while no force is applied or under the constant load/Force/strain. AI: A Wheatstone bridge is used to measure tiny changes in R using a fixed V which gives a fairly constant I. When R changes 50%, I is no longer constant. So this bridge is no longer linear or balanced with a wide spread. This "Wheatstone bridge" does not pass the criteria of a small change so it is not linear as Wheatstone intended when balanced. Normally Rg changes are small in such a bridge which makes this configuration useful. A more complex ratiometric bridge is needed to make it more linear, if that is what is desired. F(x)= Vout = aRg + b This is probably what you want for Force or Displacement for a = gain which will be -ve and b = offset But since Force is inverse to R what is the actual transfer function you want? positive V for Inverse R or something else? I would suggest something else like 1/R gain with null offset adjust around 1.5 to 2Mohms. try to get a 10:1 linear range to 100:1 but null adjust will be a problem for an "autozero design solution." 1st Define your specs for Forces vs R and then tolerance or error budget for component variance, temperature, aging etc. Below is a "Wheatstone Bridge" Note the formula when Rg changes is not linear. Change 2M or use INA gain control iwth Pot refereence for 0 force R. to get 0 to 5V for linear 0 to Smax. for Strain in mm or cm. Note the hysteresis on R is much larger than you think. The datasheet shows a mean of 2M not a peak. So I expect there is large variance from sample to sample for gain and offset of mean.
H: Sending a radio wave from one micro-controller to another I have two ATMEGA328P's. I would like to be able to send a radio wave (no data/sound/modulation, nothing, just the carrier wave) from one micro-controller and get the other micro-controller to pick it up using ADC. So far I've been able to pick up random EMP emission with my receiver ATMEGA328P (by connecting a long wire into the ADC input). I can clearly see a unique ~6sec pattern being generated by one of the devices at my home, then it goes silent for ~5seconds and then the pattern repeats again. Seems like it's coming from the fridge or maybe neighbors, because pattern disappears as I move further away from the kitchen. So my 'antenna' is picking 'something' up. Now I want to be able to simply generate some kind of EMP emission, that could be picked up with my receiver, but this is where I'm stuck. I don't seem to understand how can I 'send' the wave out from the transmitter. If I simply connect the crystal (16mhz) to the ground and VCC and connect another wire (antenna) to the crystals GND pin, but nothing happens as my setup is wrong. I see that other crystals used in radio tutorials have 4 pins, one of them is antenna, so I believe I need to wire 2 pinned crystal differently? As far as I understood, this is how the transmitter should work: Crystal is used to generate sine wave, which in return causes the polarity on the wire/antenna to toggle, which in return produces EMP emission in the frequency of 16Mhz (in my case), this signal then get amplified. Is this correct? My questions are: -Crystal value/pin count - Can I use a two pinned 16Mhz crystal to generate a 16Mhz SIN wave and will I be able to pick it up with the other ATMEGA's ADC? ( I don't want to read/process the signal, I just want to be able to read it with ADC and detect it's presence ) -Antenna - I have a WIFI antenna, as far as I understood, I won't be able to use it to pick up 16Mhz frequency since it works in Ghz range, correct? How would I find out the requirements to make an antenna that would pick up this frequency (16Mhz)? -Signal - If I'm sending a 16Mhz sin wave and my micro-controller is running at 8Mhz, it means that I won't be able to see the 'detailed sine wave', but it would appear as solid 'high' in the listener, correct? PS: Is there a different term for 'radio wave transmission'? because all the tutorials I come across are AM/FM radio related, while I simply want to generate a 'carrier wave' that can be picked up by another controller. Thank you for your time! AI: Can I use a two pinned 16Mhz crystal to generate a 16Mhz SIN wave? No. A "two-pin" crystal is a passive device and cannot generate anything. But a crystal can be used in an oscillator circuit to generate an RF (Radio-Frequency) signal. You can also use a "4-pin" crystal OSCLLATOR which has the crystal AND the oscillator built into the same package. Note also that generating an RF transmission at 16 MHz is illegal in most of the planet, so you will be breaking the law and quite possibly interfering with important communication channels officially assigned to others. You cannot transmit RF signals anywhere you please Will I be able to pick it up with the other ATMEGA's ADC? Probably not. As yu have already demonstrated, there is lots of RF junk floating around in the air and without some way of discriminating WHICH RF signal your want to listen to, whatever you are sending will be buried in noise and interference. This is why you need a RECEIVER. A receiver will discriminate ("tune") between all the RF that is floating around out there. All receivers must have the ability to tune which signal they want to receive and reject everything else. RF communication would be impossible without this most critical part. Can I use a WiFi antenna for 16 MHz? No. Antennas are also "tuned" for different frequencies (wavelengths). A WiFi antenna is practially useless at 16MHz. How would I find out the requirements to make an antenna that would pick up this frequency (16Mhz)? There are many resources on the internet how to construct antennas for any given frequency. Especially Radio Amateurs ("Hams") who make their own transmitters, receives, antennas, etc. But, as already mentioned, you cannot legally transmit on 16 MHz. So you should select a legal frequency before worrying about antennas. If I'm sending a 16Mhz sin wave and my micro-controller is running at 8Mhz, it means that I won't be able to see the 'detailed sine wave', but it would appear as solid 'high' in the listener, correct? Correct. That is why nobody uses that method. Detecting the direct carrier wave with a microcontroller is completely impractical and unnecessary. As already mentioned, you need a RECEIVER to properly detect the carrier wave and produce a signal that can be used by your microcontroller. Is there a different term for 'radio wave transmission'? Yes, it is "RF" which stands for Radio Frequency. If you use the term "radio" by itself, you will find the more popular meaning of entertainment broadcasting. It is admirable that you are experimenting with transmitting and receiving RF. However you should study more about it before trying this experiment. Especially you should research which frequencies are legal and safe for you to use in your country. In most parts of the world there are certain frequency bands that are legal to experiment with or use without any licensing, etc. Read about the "ISM Bands" ISM is Industrial Scientific and Medical. Depending on which country you are in there are several of these bands which you can safely and legally use for experiments like yours. Ref: https://en.wikipedia.org/wiki/ISM_band Your experiment is essentially impossible until you start using a RECEIVER circuit to properly discriminate ("tune") the signal of interest, and reject all others. Designing and building RF circuits is rather an advanced technique that requires special skills, knowledge and equipment. Many people who do already have these special skills, knowledge and equipment chose to simply buy ready-made (and tuned and tested) transmitter and receiver modules so that they can make use of RF communication without messing around with RF. There are very inexpensive products that will do exactly what your experiment is trying to do. And on legal frequencies. For example there are matched transmitter and receiver circuit boards which sell for less than US$5 already assembled and tested, and in many cases even with free shipping to wherever you are. It is very hard to make a case for "rolling your own" transmitter and receiver when you can buy them for less than the cost of the parts. For example, currently, there are several vendors of this matched pair of 433MHz transmitter and receiver for US$ 0.74 with free shipping.
H: SPI clock source - master or slave I was working on the SPI protocol and have some few questions regarding the SPI clock. I know that master always initiates the clock to start the communication. Does the slave use this SPI clock generated by master or does it synchronize its own SPI clock with the SPI clock generated by master for further transmission and reception of data? The slave can be a chip or a microcontroller. AI: The master is responsible for generating the clock that both the master and the slave use to shift data. The slave only drives its data-out pin.
H: How to get rid of voltage spikes in this supply voltage switcher circuit? In my mainboard there are two main supply. One is 12V and other one is 5V. 5V is always ON but there is a risk of 12V crashing and disappearing. So, I want something like this, when presence of 12V main supply always has to be 12V but when it is gone main supply must be 5V which is always ON. The crudial thing here is main supply must never be below 4.8V. I used to get this done by this simple structure: simulate this circuit – Schematic created using CircuitLab But my client does not want that. Diodes get hot and there is a certain voltage drop. So I thought of this soltion: It is doing its job but it can not prevent this annoying spikes: You see, when both rising and falling of 12V, it leads a spike and it causes to voltage drop below 5V. I want to understand why does it happen? And is there any circuit that can do the job with high efficiency? AI: Your output voltage is dipping because the power PFET is shorting the output node to the 12V supply that is at a lower voltage. Your threshold for turning on the PFET is much lower than 5V, effectively less than 1V. I went ahead and remade your schematic in LTSpice: The first question you should ask is "When does the NPN turn on?", which is practically immediately. There's a couple reasons for this: Your NPN, a 2N3055, is a big, power NPN (15 A!!). You need maybe 1-3mA at most to turn on the PFET with the R3-R4 resistor divider. Because Q1 is so large, it really doesn't take much to turn it on a little bit. LTSpice has that transistor turning on at about 0.27V, which is probably less than you assumed. I think you have your R1 and R2 values backwards. Even assuming a target VBE of 0.6V, your NPN would be on when the 12V rail was at 0.73V. The other way around, and it turns on at 3.43V or so (but probably lower). Taking those things into account, we can see the voltages of the 12V rail (red), the NPN VBE (green), and the MOSFET gate voltage (blue). We can see the MOSFET turns on almost instantly. For more fun, here's a look at the DC sweep of V2 (the 12V supply) when V1 (the 5V supply) is held at 5.0V: The current through D1 and M1 spikes to 27A, but really that's just what the diode model is limiting it to - the diode would probably blow up if the 12V supply was really an ideal source. The diode is only rated for about 1A. I'll admit, I'm not very fond of this topology, and I would probably look for a power management IC, or maybe some "ideal" diode ICs to handle the switching in a controlled manner. A comparator would be another solution. Keeping the 5V rail from back-feeding the 12V rail will be a bit tricky. To tweak this topology, swap the 2N3055 for a 2N3904. Adjust the R1/R2 ratio to turn on Q1 when the 12V rail is above 5V. I'm pretty sure you don't need R4. The problem you will run into is that the behavior will be fairly sensitive to device variation (bad for products).
H: Voltmeter vu-meter dynamo To start, I have no experience with electronics except what I've been googling the past week. What I'm having issues with is finding a way to make a voltmeter that functions like an led vu-meter would. What I'm making is a gear driven dynamo and I want to make a visual representation to show the user that a faster spin produces more voltage by using LED's as user feedback. It is not important that it is accurate just that a faster spin makes more lights come on. How can I make a volt-meter show that a dynamo is producing more voltage? additional note: The intention is to make the dynamo the only source of power as well as what is being metered. AI: Check out the LM3914/LM3915. There are a few tutorials on how to use them. You'll have to reduce the output voltage to between 0V and 5V -- you can probably just use a voltage divider to achieve this. https://learn.sparkfun.com/tutorials/dotbar-display-driver-hookup-guide http://tronixstuff.com/2013/12/09/tutorial-lm3915-logarithmic-dotbar-display-driver-ic/
H: Constructing a 4-way multiplexer composed of 2-way multiplexers I've constructed a schematic of a 2-way multiplexer, and also have made a 4-way one (and have a good idea of how to make 8, 16, etc. ones). However, my 4-way isn't a composition of 2-way multiplexers, and my goal is to make it as "composed" (for lack of better terminology; I know there's a word, but a brain fart has fogged my memory :)) as possible. How (if possible) can I build a 4-way (and thus 8, 16, etc.) multiplexer out of 2-way multiplexers? AI: simulate this circuit – Schematic created using CircuitLab
H: What are these boxes mounted inline on each of the 3 phase wires of a high voltage power line in Miami? They were only on this run and not any of the lines in the area. And what is the function of the flat u-shaped guards in front of each? AI: It's a fault circuit indicator. Specifically, it's the Sentient MM3 model which monitors the current through the conductor it's attached to. It also draws its power from the magnetic field resulting from the current passing through the line. It logs and can wirelessly transmit the data it gathers which helps the local electric utility in quickly pinpointing problems -- ideally in advance of the problem becoming an actual outage. For example, an intermittent fault could indicate a sagging tree branch hitting the line when the wind blows. The little metal circle thing is an arc shield from the same company. It's intended to save the sensor (which is not inexpensive) from a traveling arc, as from a lightning strike down the line. And no, I have nothing to do with that company but have some experience in the utility industry.
H: Motor in a parallel circuit slowing down, how can I speed it up? I have a simple circuit, with 5x 3v/20ma LED's in parallel (each with a 330 resister in front of them) and a dc motor (rated 6v to 24v) also in parallel, all running off a 9v battery. The problem is the motor is slowing down thanks to the LED's. I would have thought that with having everything being in parallel the motor would not be slowing down, but it is. What is happening here? Why is it slowing down? Is it to do with the voltage, or the current (amps)? Can I speed the motor up using a transistor, or is there something else I can use to speed it up? Thank you! AI: The battery has an internal resistance. This means that if it has to supply more current (by adding leds in parallel) it will supply less voltage so the motor slows down. Use a bigger battery or several in parallel.
H: Implementing a simple 1/s integration in PSCAD while it only offers 1/sT So I'm doing some modelling in a power systems simulation software (PSCAD) I'm using the integrator block in that software. Now unlike SIMULINK PSCAD doesn't offer a \$ 1 \over s \$ block but offers a \$1 \over s*T\$ block where \$ T \$ is the time constant. I just want a simple integration operation done, i.e: When I input $$ A*sin(100t) $$ I want to get $$ -(A/100)*cos(100t) $$ What should I set the time constant \$ T \$ to get this basic result? AI: \$\frac{1}{sT}\$ is just the same as \$\frac{1}{s}\frac{1}{T}\$ So set T = 1 or use it to set the gain of your integrator
H: How does AVRDUDE communicate with the programmer? I'm trying to understand exactly how AVRDUDE communicate with the AVR Programmer, for example USBtiny or Arduino itself as a programmer, to send the firmware to the microcontroller. As a motivation to my question, suppose that I want to build an USB In-System Programmer for an AVR microcontroller from scratch. So, using another microcontroller, I build an ISP that can load code to the AVR. Now, what if I want to use AVRDUDE to send to my ISP some code to load into my microcontroller? What kind of protocol will AVRDUDE use to send the code via USB, so I could read it correctly and generate the correct SPI to program the AVR? How the people who created USBtiny, for example, knew (or specified) the protocol avrdude would use to send the data to USBtiny, so they could interpret it correctly? Any help is appreciated! Thanks! AI: This is more belongs to stackoverflow and this is more related to the device drivers. However, Nowadays USB device drivers are written in ring3 instead of ring0. In English they are user mode drivers. Any modern operating system exposes interface level functionality of USB stack to the user mode by API. And there are libraries like libusb , winusb to access them in user mode, so in theory, you only need to study how to use a library like libusb. So the AVR dude, with enough permissions , it can access it's endpoints and write and read from them. So that's how it works. And from the avrdude source, this is the file which defines the how to communicate with my programmer, ( sorry I'm using usbasp ). http://svn.savannah.nongnu.org/viewvc/trunk/avrdude/usbasp.c?root=avrdude&view=markup You can see that it's using libusb if on Linux. void usbasp_initpgm(PROGRAMMER * pgm) { strcpy(pgm->type, "usbasp"); /* * mandatory functions */ pgm->initialize = usbasp_initialize; pgm->display = usbasp_display; pgm->enable = usbasp_enable; pgm->disable = usbasp_disable; pgm->program_enable = usbasp_spi_program_enable; pgm->chip_erase = usbasp_spi_chip_erase; pgm->cmd = usbasp_spi_cmd; pgm->open = usbasp_open; pgm->close = usbasp_close; pgm->read_byte = avr_read_byte_default; pgm->write_byte = avr_write_byte_default; /* * optional functions */ pgm->paged_write = usbasp_spi_paged_write; pgm->paged_load = usbasp_spi_paged_load; pgm->setup = usbasp_setup; pgm->teardown = usbasp_teardown; pgm->set_sck_period = usbasp_spi_set_sck_period; } You can see that each programmer supported by avrdude have to support those functions, so you can understand this abstraction and how the usbasp.c file convert them into programmer specific. I encourage you to read the source code of your programmer. Good luck. FYI: For your programmer usbtiny, the source is here:
H: limit LED current only with transistor and base resistor I'm bit exciting about my new plan here, my goal is to make a small and simple 5W LED driver with Arduino. I know about current limiting resistor in series with led or in emitter pin of transistor, but just curious, can i driving LED with only transistor and base resistor to limit current going from collector to emitter? simulate this circuit – Schematic created using CircuitLab thanks AI: Short answer, no. You need to either have a resistor in series with the LED (easy), or design the driving transistor to deliver a constant current (harder). Long answer, well yes, if you want to go to that trouble. If you use a large base resistor (I'd expect to see more like 10k/100k rather than 250 ohms) then a limited base current, multiplied by the hFE of the transistor, should give you a constant collector current. BUT hFE is not a well specified parameter. If you buy a cooking grade transistor, there might be a 6:1 spread of hFE. If you buy binned versions, so a -A or -B versions, then you might get down to 2:1 variation. Unfortunately, hFE varies with temperature, collector voltage, and base current as well. Given that LEDs have quite a wide current operating range, a LED that's happy with 10mA can still look fairly bright at 1mA. If you select a resistor for each transistor to get your target current, then you could get reasonable subjective performance. You're trading selection time and consistency for ease of build.
H: Very low temperature (-25C) on ds18b20 precision I'm busy building a multi-probe temperature sensor and log system using a couple of ds18b20 probes on a Raspberry Pi. They will be monitoring freezer temperatures that should be between -23°C and -18°C. I'm a little concerned about the precision of the probes though as the datasheets only give the precision between the -10°C to +85°C Range (±0.5°C). There's an error curve on page 18 here, and another almost identical one on page 20 here. Both of them however start a 0°C and only go up. As I'll be operating outside of this range, how/where can I find the expected accuracy? The freezers that the probes will be monitoring are used for storing human tissue, and I'll need this before I can put forward a tender/proposal. Any Ideas? AI: The error is guaranteed to be within +/-2 degrees C over the useful range. That (and only that) is what you can depend on. If that's not accurate enough, use another sensor or adjust the reading with individual per-sensor calibration (not usually a good way to go if you have any option at all because giving up interchangeability means you can't just replace parts in the field). An advantage of this type of sensor is that the error guarantee of this mixed-signal digital-output part pretty much includes the entire system error. Using analog sensors such as an RTD would require signal conditioning and the evaluation of the total system accuracy will involve a bunch of engineering calculations. The sensor error of a Class A Pt-RTD is about +/-0.2 degrees C at your target temperature. If +/-2 degrees C is good enough (probably you just need to guarantee the maximum storage temperature) then maybe it's an acceptable sensor, though it makes sense that the energy cost of maintaining a given maximum temperature with error +/-2 degrees C will be ~3% higher than if you can measure the temperature to within +/-0.5 degrees C (assuming Newtonian heat transfer and average Ta of 25 degrees C).
H: Electro-static potential of a capacitor during a transient? How would I calculate the electro-static potential for this simple circuit during the transient (during the time the capacitor charges)? Do I just use Ohm's law? simulate this circuit – Schematic created using CircuitLab My thought process was as follows: We know when the capacitor is charged it will have a "charge" of 1V * 1μF (Psi aka. Q) So we have a current (I) of the value Psi / Δt during the transient I = e / R → e = I * R (e is the potential, aka. voltage, of the capacitor and R is the resistance of the conductor) I wrote down my full thought-process here: http://circuits.icidasset.com/circuits/01-basics/002-capacitor Does this seem correct, or is there a better way? AI: The capacitor charges like this: - The exact formula is: - \$V_C = V_S(1-e^{-t/RC})\$
H: Are my calculations for flyback diode/s corret? I have looked up some existing questions and did my own calculations for my own problem. I am switching a relay with a BJT transistor and would like to protect the transistor from voltage spike on relay coil, after the transistor stops conducting. Circuit: I decided to connect two diodes in parallel with my relay. A schottky and a zener diode. First I determined/checked up the relay datasheet. My relay has nominal coil voltage of 5V (this is what I will be using for switching my relay minus the Vce voltage drop) and 35mA coil current (I used 40mA in my calculations). I then searched for a BJT. I found one with Vce_max equal to 40V and Vcb_max equal to 60V. Maximum power dissipation is 200mW. Next I picked a schottky diode with Vf_max equal to 0.3V, repetitive reverse peak voltage 30V and Iforward 1A and a zener diode with 2V Vz @ 5mA Iz. I looked at the graph in the datasheet which shows current/voltage curve and at the coil current which is 40mA voltage drop across zener diode is 2.7V. In my opinion these chosen elements are okay, can anyone confirm this? The circuit is not meant to switch relay with high frequency. It's meant for opening/closing garage doors. From the diodes I have chosen is my assumption correct that voltage drop across coil will be around 3V (sum of both voltages of zener and schottky) after the transistor stops conducting and coil starts to discharge through diodes? Thanks in advance. AI: There is no reason to use a Schottky in this circuit- the extra few hundred mV will actually help, and if you use a Zener you want it to result in the maximum voltage the transistor can safely handle. Below are three possible circuits, of which the first is adequate for your purposes. D1 can be a 1N400x or 1N4148, it only needs to be rated for the supply voltage (+5) and to handle the relay coil current (tens of mA) for a short time. The zener (+ series diode drop, if there is one) has to be less than the voltage rating of the transistor, but it might have to be even less depending on the SOA (safe operating area) of the transistor. The first circuit is not as hard on the transistor and any modern jellybean part (don't try an RF transistor even if the ratings look like they might be okay) will work fine. simulate this circuit – Schematic created using CircuitLab The two circuits to the right will give you a bit more life from the relay because the contacts will open more quickly (less arcing) but probably not necessary for your application. D2 is necessary because the Zener diode will conduct happily in the forward direction- it breaks down in the reverse direction. The circuit with D7 involves one less part, and is similar if there is a bypass cap nearby.
H: How to step down analog sensor signal voltage using voltage divider I am trying to work out how to use a voltage divider to step down the signals from an analog sensor, powered by a standalone XBee. The XBee provides 3.3V power to the sensor, which has 3.3-5.5V operating voltage. The output voltage of the sensor is 0-3.0V. This info is taken from the sensor datasheet. I'm using an XBee Pro S3B. The S3B ADCs have a configurable reference voltage of either 2.5V or 1.25V. So I need to step down the 3V output signal from the sensor to 2.5V for the ADC using a voltage divider circuit (any alternative ideas are more than welcome). However I'm finding that only tiny voltages are being sent to the ADC pin when everything is hooked up as shown below. When I disconnect the sensor from the VD circuit and test with straight 3.3V VDC, I get ~2.7V out as expected. So it seems connecting to the sensor is the problem. Here's my setup. The resistors are 10Ω and 51Ω. The sensor shown is a resistive soil moisture sensor for illustration's sake, but I'm using this capacitive sensor instead. Does anybody have ideas on how I can get a correctly stepped-down voltage out of this sensor? Thanks! AI: When you select resistors for use in a voltage divider there are a couple of things you need to take into account. In your case it is the output impedance of the sensor, roughly speaking how much current it can supply without messing up the output voltage, and the input impedance of the ADC. The input impedance of a ADC will be very high, usually it is the input to a comparator. This means that you can use large value resistors. The total resistance for the voltage divider, as a rule of thumb should be at least 10 times the output impedance of the sensor. The values suggested by @Jasen 10k and 51k are reasonable.
H: How are two atomic clocks synchronized? I want to synchronize two atomic clocks at the same location to the same time... then let them run independently of each other (then I'd move them apart). Is there some standard procedure to accomplish this? Do standard atomic clocks come with inputs/outputs to accomplish this task? EDIT: I haven't purchased the clocks yet. AI: An "atomic clock" comprises two major subsystems: a precision oscillator controlled by a feedback mechanism that's based on some quantum-mechanical phenomenon, and a digital counter/display subsystem that shows how many cycles of the oscillator have occurred so far. The relative oscillator phase in multiple units can be measured; there are papers at NIST, and this article is worth a read for more general knowledge. The counter mechanism can be reset at any time, and if you have two clocks, you can reset their counters from the same reference pulse. It's really entirely up to you how and when you reset your counters. However, in some cases, it makes sense to just allow the counters to free-run, and instead sample and record their values at certain times, then compute the frequency and phase errors from those recordings. The computed values are then used to "correct" future readings from the clocks. This is the approach used with the atomic clocks used in GPS, for example. It sounds as if you have a vague idea for a project, but that you haven't really given it a lot of thought or research yet. There are both professional and hobbyist websites devoted to the topic of precision chronometry — you might want to seek them out and do some reading to get an idea of what some of the practical issues are with respect to this topic.
H: Chip Identification - Electronic sound toy I just bought this toy called fridgezoo. It's a small plastic animal that you put in the fridge. It has a light sensor and a button. As soon as there is light, it plays a sound, and when you press the button it plays another sound. I figured that it may be possible to hack this thing by dumping memory, identify and replace sound content and flash it back onto the device. There is only a single SOIC-14 chip inside the device, labelled with NY4P065614 P55101F There is not much else on the board, just some passives. The chip must contain everything (Storage, amplifier, analog part for light sensor) as there is no other chip on the board. The thing works with 3 LR44 batteries (so 4.5V). Do you know how to source some more information about that chip? What kind of interface (if any) would one expect from such a chip? JTAG? Thank you AI: No, you won't be able to do any of that. It's an OTP (one-time programmable) part that stores 65 seconds of voice, and it has already been programmed. The programming interface will likely be some kind of simple serial interface that is fairly unique to the device- not JTAG.
H: Cleaning Up a 5V Line Pulling 1 Amp I have been working on a project that utilizes a 10MHz Oscillator and 28V input power. At the start of my project, I used a DC/DC converter which took my 28V line and moved it to a 5V line. I then used this line to power my Oscillator. After hooking this up to my scope, I saw that the noise really affects my signal after the Oscillator, its only slightly noticeable, but the part this plugs into expects a very accurate 10MHz line.. . In my original design I had my ground of the 5V grounded up with the 28V line, but I was told that I should not do this, and instead have a small local ground to the oscillator. Additionally I was told that I should keep the wires as close to each other as possible to reduce some more noise. I redesigned, and it worked, but very minimally did it change the amount of noise. I was told that using filters is the way to go, but everwhere I look I can't really see what exactly I'm looking for or what I should be doing exactly. Here is my schematic at the moment: With the imoportant aspects of this project: DC/DC Converter: XP Power JCM2024S05 Variable Input, Output 5V, 4A Max draw output Oscillator : Abracon LLC AOCTQ5-X-10.000MHZ-I3-SW 5V input, 10MHz Out, Pulls 5W Could anyone point me towards a nice source on the subject or some nice tips/pointers/help on my specific problem? Anything would be so much appreciated. AI: The simplest thing to do to start with is to add some smoothing caps on the 5V line - a 10uF ceramic and something like a 47uF tantalum would help to keep some of the lower frequency ripple under control. If you can adjust the voltage of your DC-DC, one option would be to increase the voltage to say 5.3V, and then use a low noise 5V LDO (e.g. TPS7A85) which will help to clean up any switching noise. Setting the DC-DC voltage to just greater than the drop-out voltage of the LDO will help to keep losses and heat generation to a minimum. Additionally you can look at splitting your supply regions up using feed-through capacitors. These act like L-C filters and have great noise rejection. By placing one between the main power supply rail and sensitive components, you can isolate some of the noise in the system. Finally for sensitive components, you can add more than one ceramic cap close to the power pins. If you use a series of values in parallel, such as 0.1uF + 10nF + 1nF, with the smallest value closest to the power pins, you will increase the effectiveness of the filtering over a larger range of frequencies. As an example, we are working on a 12-channel 370MSPS ADC board with ultra low jitter clocks. As it stands that board has 12 amplifiers, 6 ADC ICs and a clock generator. Each one has local power planes, separated from the main power planes using feed-through capacitors to isolate noise. We have ended up with 43 power regions, supplied by 12 LDOs which are in turn supplied by 7 DC-DC regulators. On that board there are over 600 capacitors alone! The one thing we have done on this board is to not split up the ground planes. There is a nice application note (I'll see if I can find the link) which explains how actually splitting up the ground plane can cause more issues than it solves from a noise perspective. The key thing is to keep an eye on the placement of components - for example keeping noisy things like switching regulators away from sensitive analogue circuitry. By keeping an eye on when the current return paths will be, you can keep noise contained even on one single ground plane.
H: How can I combine two antennas that carry different frequencies? I have two antennas: antenna 1 carries CATV signals channels 2-29 which I believe use carrier frequencies from around 55.25MHz up to 253.25MHz antenna 2 carries OTA HDTV signals on UHF channels 21-49 which I believe use carrier frequencies from around 513.25MHz up to 579.25MHz Other than using an antenna switch how can I combine these into 1 input? I've tried using a basic antenna splitter/combiner but the tuner has a hard time picking up many of the channels. Why does that not work? I assume its because there is unwanted signal beyond each of those spectrums that creeps into the signals from the other antenna? Is there equipment to cleanly filter out the unwanted bands and recombine the ones I want? AI: The device you want is a Diplexer. They are designed for doing exactly what you're trying to do. In fact, more than a few of the diplexers I've seen are actually for CATV in the first place, although I'm not sure if there's much choice of the frequency bands.
H: Etching using Sodium Persulfate, Is my photosensitive board too old? I am trying to etch my first PCB ever, I have used the inkjet transparency method to expose my photosensitive Bungard board and developed it using Sodium Peroxide. This part of the process seems to have gone well, I can see the traces clearly on the board in a darker shade. Because the printer I used didn't put a thick enough layer of ink on the transparencysheet there are some 'specks' in the pads and traces here and there, this is something I can fix later. However, if you look at a photo of the board, there seems to appear some kind of grid, and the etching takes really long. I have been waiting (with short periods of agitating the board in the solution) for more than two hours now. I am keeping the solution at a temperature of 40 degrees celcius using an aquarium heater with built-in thermostat. The boards are quite old, I have bought them 2,5 years ago but the photosensitive side has not been exposed to light, as I kept the boards facing eachother in storage. Does this look like I am using boards that are too old? Or am I doing something else wrong (I know there are methods that are faster/more efficient, but this method should at least produce some better results as far as I know). Edit after Dwayne Reid's answer After tripling my exposure time to 15 minutes instead of 5 (I have a rather weak UV CCFL setup) and using two inkjet transparencies instead of one for better opacity I had better results. When developing dark purple/brown-ish clouds rose from the board (in the solution), this did not happen previously. I did however make the developer solution twice as strong as need be (in error), so the board came out wrong in the end. But definitely an improvement over the previous batch! Maybe this can also be caused by the fact that I am using really old boards (2,5 years old), as Leon Heller stated in the comments. The etching went alot faster this time, you could clearly see blue clouds rising from the board. The board ended up looking like this: After making my developer solution a little bit stronger, agitating the board with a brush while developing and heated up the etching solution to somewhere round 50 degrees celcius (just added a load of boiling water the the bain marie) I got even better results, still not great, but a lot better nonetheless. I think the grainy traces are caused by using bad inkjet ink/transparencies, so that will be the next improvement, but that is out of the scope of this question. AI: It's really hard to tell from your photo, but you may have a problem with either not enough exposure time or not enough time is the developer solution. Cover most of the PCB with an opaque material and examine the copper at one corner. See if all of the exposed photo resist has been removed. You can tell by gently scraping the copper - there should be only copper in that clear area. If there is still a coating on the copper, you need to go back and fix whatever problem you are having. It's kind of hard to offer advice. Generally speaking, you need to make sure that you have enough expose time. We used something called an "Exposure Calculator", which is a test transparency with 5 or 7 identical patterns on it. Each pattern has a different grade of neutral density filter covering it - this reduces the amount of light that gets to the PCB. You would expose your PCB for double the normal time, then develop and etch the board. Whichever pattern gives you the best results tells you the multiplier factor that you would apply to your test exposure time value. The multiplier factor ranges from 0.125 to 1.0. The other variable is develop time. This is a trial and error process but the develop time range is fairly wide - you only have to be close, not exact.
H: what does DC Com mean? I have a international Power Sources Model PUP110-40-S power supply, I think its somewhat generic, that provides +/-12VDC,+/-5VDC. The unit has failed, and I am attempting to replace it with an ATX PC power supply. There is a diagram, on the bottom of the Power supply that tells you the voltages on each pin. 2 pins say DC Com. I don't understand what that means. I can tell you Pin 1, Pin6, which are both labeled DC Com, are not internally wired as common. I'm not sure if I should jumper them together or what. AI: Those are the ground pins. Even process of elimination leads you there. All have a listed voltage except pin 8 which is N.C. (not connected). It's feasible that the ±12V and ±5V supplies are generated from separate isolated supplies without the grounds being internally connected. You could check the other side of the connector to see if they're connected on that side. But, either way, jumpering them together should not be an issue. I base that on the fact that they didn't label them as separate nets.
H: Setting up KCL equations for non-ideal op amps I don't understand how to set up the KCL equations for this. It seems as if it would be \$\frac{-v_d - V}{R} + \frac{-v_d}{R} + Q = 0 \$ and \$-Q + \frac{V_{out}-Av_d}{R_o} = 0\$, where \$Q\$ would be some relationship between \$-v_d \$ and \$V_{out}\$, but I don't understand exactly the connection. I think I'm not understanding why I can name the node between \$R\$ and \$R_i\$ "\$-v_d\$". Wouldn't that make the other one \$+v_d\$. I'm self learning this, so as clear as possible an explanation would be helpful. AI: \$v_d\$ is the voltage difference between the non-inverting and inverting terminals. By definition, it's also the voltage across \$R_i\$. Looking at the non-inverting terminal's node, you have three currents: The usual current through \$R\$ The leakage current through \$R_i\$ The feedback current from the output I find it's sometimes easier to use KCL if I use more variables than I need. Here's how I'd do the non-inverting terminal: $$\frac {v_{out}} {R} + \frac {v_{out} - V} {R_i} + \frac {v_{out} - Av_d} {R_o} = 0$$ We know that \$v_d\$ is \$V - v_{out}\$, but it's easier to think through if I do that step separately: $$v_d = V - v_{out}$$ $$\frac {v_{out}} {R} + \frac {v_{out} - V} {R_i} + \frac {v_{out} - A(V - v_{out})} {R_o} = 0$$ Now we can factor out the voltages and get an equation for \$v_{out}\$ vs. \$V\$: $$v_{out}\big( \frac 1 R + \frac 1 {R_i} + \frac {1 + A} {R_o}\big) - V\big( \frac 1 {R_i} + \frac A {R_o}\big) = 0$$ $$\frac {v_{out}} {V} = \frac {\frac 1 {R_i} + \frac A {R_o}} {\frac 1 R + \frac 1 {R_i} + \frac {1 + A} {R_o}}$$ $$\frac {v_{out}} {V} = \frac {R_o + R_iA} {\frac {R_oR_i} {R} + R_i + R_o + R_iA}$$ If \$R_o\$ is zero (or very small), you're left with: $$\frac {v_{out}} {V} \approx \frac {R_iA} {R_i(A+1)} \approx \frac A {A+1}$$ which means the output voltage is less than the input, but gets closer when \$A\$ is large. This shows the effect of a finite gain -- if the output and input voltages were exactly equal, there'd be no difference to amplify, so the output voltage has to be slightly less than the input. If \$R_i\$ is infinite (or very large), some of the terms can be ignored, and you're left with: $$\frac {v_{out}} {V} \approx \frac {A} {A + 1 + \frac {R_o} {R}}$$ which has the same finite gain effect, but also includes the effect of the \$R_o/R\$ voltage divider, which further reduces the output. The output still gets closer to ideal when the gain is large. If neither \$R_i\$ nor \$R_o\$ can be ignored, but \$A\$ is very large, the terms with \$A\$ dominate, and you're left with: $$\frac {v_{out}} {V} \approx \frac {R_iA} {R_iA} \approx 1$$ The moral of this story is that a high gain makes all of your problems disappear, at least at DC. That's why op amps have DC gains as high as a hundred thousand (100 dB) or more. The combination of a high gain and negative feedback is a powerful one, and is common throughout analog electronics and control systems.
H: 12-bit DAC Output to +/-10v Signal Suppose we want a +/-10v control signal, where 0x0 (to the DAC) = -10v and 0xFFF = +10v. Firstly, how do we alter the signal so that we can have a negative voltage, dependant on the DAC input? Secondly, how can we scale the signal so that it fits within the -10 to +10 range? AI: a straightforward solution would be to use an opamp configured as a difference amplifier. There's plenty of good material on the web about it. Here's one: http://www.electronics-tutorials.ws/opamp/opamp_5.html Let's say your DAC outputs 0V to 2.048V for code 0x000 to code 0xFFF (fairly common) and you want a swing of +/-10 Volts. So the gain you want is 20 Volts / 2.048V = 9.77 The circuit is below. So you just need R3 that many times bigger than R1. The trick is to reference once side of the input to the "halfway point" of your DAC output range. So here, I'm referencing it to 1.024V. This way, the amplifier sees a difference (V_R2 - V_R1) on its inputs of -1.024V at code 0x000, and +1.024V at code 0xFFF. Then the opamp applies the gain of 9.77 to that difference and, voila, you get your -10V to +10V output swing. For the voltage reference, just do a search on Mouser or Digikey. You will find a ton out there that put out nice "binary" values like 1.024V and 2.048V. The difference amp configuration is super useful. I hope that helps, -Vince
H: How to convert current obtained from CT to precise voltage applied as input to ADC? My aim is to convert current obtained from CT to precise voltage that can be applied as input to ADC. As shown in the diagram , a conductor carries current of up to 63 A passes through the Current Transformer(CT) .The CT CT 1273-A1-RC has turns ratio as 1:2500 and current range of 0 to 100A . I have made one simple circuit in which there is shunt resistor in parallel and a diode in series with CT. The current passing through CT is from power distribution unit i.e. used in server rooms. So it is ac current . $$I_s=(I_p)/2500$$ I_s=(63/2500)=0.0252. My requirement is minimum-maximum voltage at the input of ADC should be in the range from 0 to 3.3 V . So for shunt\burden resistor R_shunt= 3.3/0.0252=50 ohm, Problem I am facing is how to obtain precise voltage (DC value) and also is there any need of additional circuitry in the circuit should be made so that it can be applied as input to the internal A to D converter of STM32L011x3 and display on seven segment display .So can anybody help me regarding it? NOTE: I have done few calculation please see 1,2,3 for the selection of components. Can anyone crosscheck the values and tell me whether am I going right or wrong? AI: Do not use an inline diode to rectify a CT output, you will never be able to calibrate it, and it is non-linear. Use an op-amp rectifier. There are endless examples in application notes and on the web. Never put anything other than the burden resistor and clipping zeners on the output of the CT. For those interested in in more detail, this may be helpful. The burden on a Current transformer is critical to it providing accurate output. The burden is calculated to provide a defined VA load, and it is the current and not the output voltage that is the most accurate reflection of the input current value. Raising the voltage produced on the output of a CT reduces it's accuracy. Adding diodes in series provides a VA offset that reduces the overall accuracy and linearity and would never be done in instrument grade measurements. Typically even low grade installations look for better than 1% CT accuracy, and many need 0.3% class measurements. Adding another reference for operation of a precision rectifier (though it's a dual supply op amp) from TI that talks through how the diode Vf is compensated. These type of op amp rectifiers work down to just a few mV of AC input signal. Update: added the feedback document for the OP as a design stepthrough.
H: What do the values on the back of an encoder mean? I have an encoder (at first I thought it was a potentiometer!) and on the back it has B1 03 (separated). Research thus far has shown that an encoder can have anywhere from 100 to 6000 steps. I imagine those numbers are related to that value, but I do not know how it reads. Do they have meaning? (This came with my Arduino) AI: If you have the datasheet for the exact manufacturer of the part, they may have meaning. Often a given encoder maker will have one (sometimes two) standard number(s) of steps for a given model. If it's a typical shafted mechanical panel encoder, it likely has more like 12-24 steps (full steps with both phases changing) and an equal number of mechanical detents. You can count the detents easily by hand if you attach a knob with pointer. The exact number is usually unimportant since the point is simply to get relative change, however if you use an encoder with far too few steps with firmware that expects more the user may have a sub-optimal experience.
H: Is it theoretically possible to be killed with coin cell batteries? Other than the obvious eating them, is it possible to squeeze enough electricity out of a coin cell battery to cause harm? Maybe using a boost converter with a large capacitor? Or maybe using a bunch of them in series? AI: A CR2032 holds about 2400 useful Joules of energy. Operating entirely within specification, it can supply \$200\:\mu\textrm{A}\$. If applied subcutaneously, \$10\:\mu\textrm{A}\$ can be sufficient to cause fibrillation. So if you could apply the battery directly near the heart and underneath the skin, I suppose it could directly kill someone without any additional circuitry. From an editorial in Anesthesia & Analgesia, June 2010, Volume 110, Number 6, International Anesthesia Research Society, pp 1517-1518, "Electrical Safety in the Operating Room: Dry Versus Wet," by Steven J. Barker, PhD, MD, and D. John Doyle, MD, PhD, FRCPC, the following quote is found: Microshock refers to very small currents (as little as \$10–50\:\mu\textrm{A}\$) and applies only to the electrically susceptible patient, such as an individual who has an internal conduit that is in direct contact with the heart. This conduit can be a pacing wire or a saline-filled central venous or pulmonary artery catheter. In the electrically susceptible patient, even minute amounts of current (\$10\:\mu\textrm{A}\$) may cause ventricular fibrillation. (The above information was pointed out in a comment here by Russell McMahon and is a substantial improvement over citing a Wiki page.) I've read that death can be caused with as little as 50 Joules. But I think 100 Joules is a more certain estimate. Lethality (with AC, anyway) is pretty common even at \$200\:\textrm{V}\$. So if I had to make an educated guess, I'd probably guess that using a Sanyo OS-CON Aluminum-Polymer (way too expensive and you'd need lots of them) or aluminum capacitor (such as Vishay BCcomponents' Aluminum Electrolytics), with \$200\:\textrm{V}\$ and 100 Joules would be sufficient. This suggests a value of \$5\:\textrm{mF}\$. However, it would take a while to achieve. Assume you can design a circuit that is, overall, 50% efficient in charging this capacitor from a single CR2032 while staying fully within specs and drawing just \$200\:\mu\textrm{A}\$ from it. Then on first blush it would take 10000 seconds or about \$2\:\frac{3}{4}\$ hours to charge it up for one such use if you could sustain \$200\:\mu\textrm{A}\$ throughout the process. But the CR2032 is only capable of sustaining about \$600\: \frac{\mu\textrm{J}}{\textrm{s}}\$ of power. So really, I think this would take closer to four days to achieve. (And that doesn't account for capacitor leakage. With the Vishay capacitor mentioned above, leakage power may be below charging power near the end, but it probably will add a fair bit more time to the process.) So the answer is probably "technically, yes" but rather unlikely as it would be quite odd to open someone up in order to stick a button battery across some tissues inside their body near the heart (read: very low probability) and it is similarly unusual to find a circuit designed to charge up a large, low ESR capacitor from a battery supplying just \$600\:\mu\textrm{W}\$ continuous and requiring almost a week to charge up (read: low probability.) Of course, now that someone is thinking this way, I am sure such a circuit will be promptly designed and then sold as pet rocks to millions of happy consumers, making this a significant problem in the wild. ;)
H: Many-pins & still-simple IC, how to prototype with it? I'm building my second project, it will use TI TVP5146 video decoder, which has 80-pins, and TI Tiva C. What prototyping accessories will I need? I think it can be clearly stated what such many-pins & still-simple IC needs. I must avoid re-ordering because of very low budget. Please, help me resolve this without blind orders. Will I need large breadboard, or PCB-like board? The project has to handle multiple video inputs: SCART, composite, S-Video. How to connect those cables to the prototyping-board, how to resolve input pin's different roles depending on cable being used? I could need some prototyping-board just for the cables? Maybe it can be predicted what commonly used registers and capacitors will be needed, or maybe there's a source to find some reference on this? AI: The usual way of breadboarding with this sort of part, other than simply completing a design and building it is to start with an evaluation board. This can also serve as an example of how to apply the part since the manufacturer is usually motivated to show off the part in a good light, so it will be surrounded by the required parts and deployed in such a way to allow it to perform at close to datasheet numbers. There will also be a PCB layout and you can learn from the specifications of that (number of layers, ground and power planes used etc.). For more complex chips they may supply software that will allow you to change registers etc. without coding. In this case, the evaluation board is the TVP5146EVM, and it costs $450 or so, with free (U.S.) shipping direct from TI. The BOM includes more than 150 parts, so this seems like a decent price to me if you have a serious application. I don't see Gerbers for the board, but the software and schematic are provided. It does require a PC with a parallel printer port since there is no micro on the EVM. The final sentence in the above paragraph should give you some pause- this part is more than 13 years old, which is fairly long in the tooth for a video part.
H: How do you create a variable load on something like a wind turbine? Looking over how wind turbine controllers work, it looks like they use something called "Maximum power point tracking", or "MPPT". As I understand it, that involves changing the load on the wind turbine to extract more or less energy, and thus control the speed. I'm presuming that you could also use that to electrically brake your wind turbine. How would you control the load from a microcontroller? AI: First you need something that you can dump power into. Useful sinks are a battery bank that can accept charge, or a grid tie inverter to push power into the grid. If you simply want to brake the turbine, then a bank of heaters will dump power, but you don't get anything back! Of course a battery bank can get fully charged, and then you may want to dump power into heaters anyway. Then you put an inverter between the turbine and the load (or the battery charger or grid tie inverter is programmable), program the inverter output so that it will deliver X amount of power to the load. The MPPT algorithm adjusts the programming so that X is maximised. If you simply want to brake the turbine, MPPT may not be appropriate, and you'd alter the inverter programming until the turbine speed was what you wanted.
H: Some Problems in a power amplifier circuit with THS3091 Recently, I designed a power amplifier circuit with THS3091. The schematic diagram and PCB of the circuit are just the same as the layout example of the datasheet of THS3091 in page 39. But some values of the resistance are not available in my lab. So the modified circuit is this: THS3091 schematic diagram When I tested the circuit, there are some problems: The frequency of the input signal is 100 kHz. I tested the output signal with the spectrum analyzer. But there are some strange frequencies, such as 0 and -100 kHz. And the value of power at -100 kHz is the same as the value at 100 kHz. What are the strange frequencies mean? The circuit is designed with dual power supply. And the current value of the source is 14 mA, 17 mA with no input signal. If the input signal connected to the circuit, when I increase the peak voltage of the signal slowly, the current value of the source will increase within a certain range, then decrease gradually. However, at last, the current value is smaller than 14 mA, 17 mA, which is strange. I wonder why the current value changes like this. THS3091 is a current feedback amplifier.How to calculate the gain of this kind of circuit? When I increase the peak voltage of the signal slowly, the output signal will distort. And the harmonic will also change, for example, the second harmonic is larger than the third harmonic firstly, then the third harmonic is larger than the second harmonic. Is there any rule? AI: 1) Then you're obviously not used to using a spectrum analyzer. On a SA 0 Hz is DC so that means you have a DC offset or biasing voltage at the output. You can ignore the peak at -100 kHz, it is a result of how the SA cannot distinguish between negative and positive frequencies with your signal. Which is to be expected. Read this article for an explanation about negative frequencies. 2) This is very likely related to the operation of the output stage of the opamp. A class AB stage might exhibit this behavior. 3) Same as with the normal voltage feedback amplifier. The inputs are low-impedance and the opamp will try to make current flowing through the inputs zero. So in your schematic the gain is determined by R3 and R4. 4) I advise you to also look at the signal using an oscilloscope, when the signal distorts the peaks of the sine wave are "cut off" (clipping). Some other non-linear behavior might occur as well. Such distorted sinewaves contain higher order harmonics. It depends on the shape of the wave what the relative power of the harmonics will be relative to the fundamental (the 100 kHz in this case). The Fourier transformation describes and explains this.
H: Series Wound DC motor Runaway when going downhill I understand that Series Wound DC motors are used in traction applications like golf carts . and that these motor suffer an effect called runaway ( if no load is applied the motor increase its speed until something breaks) I have a scenario in my head that i cannot answer : if the golf cart is descending down a hill and no brake is applied , would the motor be in the danger zone of being unloaded and over-accelerate if power is applied to it ? AI: In your scenario, there is a load. The motor is connected to the drive train, so there is always some kind of load. It is doubtful that anything would cause the motor itself to be in danger of damage. Running into a tree or something else at the bottom of the hill will certainly damage the cart, and probably the driver, but doubtfully the motor. Pure series wound motors do suffer from potentially destructive speeds with no load on the output shaft, but that is due to the fact that with no load, as the motor accelerates, the current through the windings, both armature and field will drop. As the field current drops, so does the field magnetic strength, which could possibly allow the motor to accelerate to dangerous speeds. The advantage of series wound motors is that when there is a very high load, the field strength increases, which allows the motor to generate more torque, which is necessary on traction motors to get things going.
H: Cheapest dummy load? 450w, 15V, 30A, only for a few seconds What is the cheapest and simplest way to dummy load 450w, 15V, 30A, only for a few seconds? I would like to measure the max output capability of an MPPT charger controller, basically as a "all losses included" way of measuring actual solar panel maximum power capability. The theoretical maximum output is 440w. In reality, the solar panels probably won't output more than 350-400w on the sunniest day. The controller has a load-side shunt, allowing me to measure current easily. I'm planning to use a MOSFET to short-circuit the load-side through a dummy load. The resistance needs to be very low to allow 30A to flow at 14.4V. I've considered using a ceramic heater, but they are typically dimensioned to have a resistance that restricts current to their dissipation-capability under continuous load, to prevent overheating. I could buy a heater dimensioned at 500w, but it would probably take up a lot of space. Since it only needs to operate for a few seconds, the concern is different. AI: Why not use the appropriate resistor? Some heavy duty wirewound like this: You will certainly need to put several in parallel/series to handle all the power, but note that they can be overloaded for a short time without damage. See datasheet. For example, for Tyco THS series (which is available in a wide range of values, from 10 to 75W): So, if, for example, the pulse lasts for 5 second, you can handle 5 times the power. So you just need a 90W resistor. Take two 1ohm 50W resistor in parallel (THS501R0J), you're done. 3,86 € each at mouser. Can't be cheaper. However, you'll need a hell of a MOSFET to switch that much current. And the MOSFET will itself dissipate a lot and probably need a heatsink. I would rather use a relay, as RoyC suggested.
H: Connecting 12V fan to LM317 DIY PSU circuit I am working on a simple adjustable DIY power supply using an LM317 voltage regulator. J1 in the image below represents the transformer rated at 18VA, which rectified produces about 25V DC. The output range should reach roughly 12V, 1A. Interestingly, I've found a 12V DC fan/heatsink ripped out of an old Nvidia 9400GT to cool down the LM317. I am considering one of two ways of connecting it to my circuit. The first option is to connect it across the last large filter cap C2, with J2 and J3 representing V+ and GND connections of the fan respectively. 1) Am I correct in saying that the first option would be essentially placing it in parallel with filter cap and the voltage regulator and therefore would place it permanently at 25V, whereas the second option would drop my voltage input to the regulator by 12V, and the fan would only be at 12V? 2) What are the advantages to choosing the second option over the first? Edit: Based on the suggestions of @AndyAka and @DoxyLover it seems that placing the fan in parallel with the filter caps is truly undesirable given the input voltage to the fan, whilst the placing it in series also causes more problems. 3) Would it then be advisable to use an additional 317 to regulate the voltage input to the fan in such a configuration? AI: It's a bad circuit that you are trying to fix. Use a smaller DC voltage to feed the LM317 then it won't get anywhere near as hot. Currently, with 25 volts in and 12 volts out, the LM317 is "dropping" 13 volts and, if the load is (say) 0.5 amps, that's a power loss in the LM317 of 6.5 watts and it will get even higher under heavier loading conditions. So, my advice is choose a more suitable transformer with an output AC voltage of about 12 V. Then you will probably have enough spare power capability to run the fan from a regulated 12 volts provided by another LM317.
H: Low domestic voltage inefficiency cost Since lower voltage means proportionally higher current for a given power, and higher current means more impedance, presumably having a lower voltage at the outlet means transmission power losses are greater than if a used a higher voltage. How much more energy is lost per year due to the USA using 110V than if it used Europe's 220V? What is the dollar cost? Assume the USA consumes 5 billion MWh per year, and 1 MWh costs $US0.20 to produce so total current (no pun intended) cost is $US1B p.a. AI: Only the final leg of wiring to the house is 110V and compared to the transmission losses upstream the cost is minimal. The decision to use the lower voltage of 110V was driven by safety. I am well aware that 110V can be lethal but a compromise had to be made somewhere. Given the low cost of electricity in the USA I would say that the decision is a good one.
H: Neutron Single Event Upset (NSEU) how its effect is mitigated in electronics in space vehicles? Since in the outer space the NSEU will be more common than in the earth, how the electronics in space vehicle is tacking the issue. I feel a solution will be existing for some decades but on google I got some information about single bit error corrections only. It does not mention any prevalent techniques. AI: There are several aspects. Neutrons (or high energy radiations) can wear materials by moving atoms or making transmutations... and the electronics may eventually fail permanently. There can be also transitory perturbation where the effect is merely that some electric charges are displaced making a glitch in circuits. There are a few mitigation techniques: Redundancy. Several devices doing the same thing. Sometimes only one is powered to save energy : "cold redundancy". (as a comparison, in aeronautics, there is also redundancy for safety, but all systems are powered : "hot redundancy" for a faster reaction time and because power constraints are less strict) Specialty technology. For semiconductors, some techniques are less sensitive to aggression : Things as SOI, "sillicon on saffire" are better because the volume of material where a particle can have an effect on the circuit is smaller. There are many other techniques, I'm not an expert. Nowadays there is a trend to limit the use of funky materials to save money : More redundancy, more fault tolerance instead of unobtainium components. Error Detection and Correction and triplication techniques. By using error correction codes (hamming, Reed-Solomon...) you can be able to detect and correct errors in memory areas, registers.. By triplicating your design and using voters, you can be tolerant to a single upset somewhere. System design. Be able to automatically reset and restart your computer without compromising the mission. Independence of functions. Self monitoring... Finally, there are statistics. The radiation flux is different in aeronautics, low earth orbit, deep space probes and probes getting close to the sun. You get failure probabilities, FMEA analysis, and over-design enough to get an acceptable probability of failure.
H: Open Collector/Drain vs Push pull Given the situation where an LED is being used for a status indicator or similar, not toggling quickly. Which is the best configuration for the IO pin, push pull or open drain? As I see it either will work, and I don't see any benefits to one configuration over the other. U1 in the following is just representative, not a specific microcontroller. simulate this circuit – Schematic created using CircuitLab AI: If U1 is also running from 5 V in your example, then it doesn't matter at all. Either way there will be no current thru the LED when the output is not actively pulling low. It won't matter that it is actively driving high or just open. There are two cases where it might make a difference: Not the same power voltage. Open drain outputs can be made to tolerate a higher voltage than the supply voltage without too much burden. For example, you might have a microcontroller running from 3.3 V, but want the LED power to come from a 5 V supply. If the open drain can tolerate at least 5 V when off, then you can connect things just like you show. A push-pull output will have some sort of anti-static protection, which usually means a diode from the pin to the positive supply. Generally chips don't like any current thru these diodes during normal operation. The LED example with 3.3 V and 5 V is not the best to illustrate this, since 1.7 V across the LED and resistor will cause very little current to flow. However, consider maybe a 6 V supply, or driving a small solenoid or something. When the pin is also a digital input. Digital inputs are usually intended to be held solidly high or low. In between levels can cause excessive currents to flow, and can even cause oscillations internally. This can be a problem if the open drain driver is off, internally connected to a digital input, and the external circuit allows the voltage to float.