text
stringlengths
83
79.5k
H: Using a mixed technology, SMD and THT components in one PCB I want change design from Through-hole technology to SMD design. Some components have no SMD version, for example some transistors in TO-92 package, and Power Mosfets, which available in DPAK SMD package, but since it requires a heat-sink, there is no much benefits of using SMD Mosfets with heat-sinks(DPAK heat-sinks have amost the same size as regular heat-sinks). For example, I can change all the ICs, resistors and caps to SMD versions, but there still remain Power Mosfets and TO-92 transistors in THT version. Is there any disadvantages of using mixed technology, when use SMD components with some Thru-hole components mixed in one PCB, except more complexity and thus extra cost? In terms of reliability? The quantity is small, 10-20 pcs, not mass production. All components in one side. AI: Generally your cheapest costs will be if all the parts are SMT and populated on a single side. Even if the parts cost somewhat more, the overall cost and handling may be worth it. If you can eliminate the heat sink by using copper area you may be able to save money and improve quality by eliminating assembly steps (for example, where an assembler could forget to put thermal grease on a part or insufficiently tighten a screw). In smaller quantities (depending on where they are made too) it often makes sense to populate any through-hole parts manually after all the SMT parts are mounted. These days often parts are only available in SMT, or the SMT parts are better than equivalent through-hole parts because of superior heat transfer through a thermal pad, say, but more often the SMT equivalents are inferior in mechanical robustness (especially things like connectors and switches), heat dissipation or some other characteristic. For substituting things such as your TO-92 transistors, for example MMBT4401 is similar to 2N4401 but good for much less power dissipation. I would be very surprised if you cannot find a close equivalent or (more likely) a superior part for the TO-92 transistors. Edit: You have mentioned a few part numbers in the below comment- 2N3904 and J310 JFET for example. There are no exact equivalents because the power dissipation and package is different, but MMBT3904 is likely the same die as the 2N3904 so it is very similar. MMBFJ310 is very similar to the J310 with small differences (eg. capacitance). In general, a capable engineer should review all substitutions including these ones, as well as any layout changes. The 27N3LH5 power MOSFET is a more complex design question that would best involve looking at the entire application, but at a minimum would require estimating the power dissipation. In general you should review MOSFET part numbers from time to time as they are still improving and older parts are being obsoleted relatively frequently. Since the part you have has a rather high Rds(on) of 20m\$\Omega\$ you might be able to substitute a newer SMT part and greatly reduce the power dissipation and reduce the part cost. To do this does require at least the same knowledge and calculations as it took to originally design the circuit.
H: How to use common mode choke inductors? (differential vs common mode) I have yet to undestrand exactly how to use common mode chokes inductors, according to the datasheet they have 2 operation modes like in the picture common mode and differential mode, however im afraid i dont understand the datasheet itself As you can see, the inductor has 4 terminals, each pair its made of isolated wiring, and theres is a ferrite inside the windings to make sure it complies with its datasheet inductance however 1) what is the intended use for common mode? (what kind of aplications) 2) what is the intended use for differential mode? AI: Chokes are used to suppress noise, i.e. to prevent noise and other EMI both from entering and going out of some piece of equipment. What is usually referred to as common mode noise or as differential mode noise are simply two modes in which noise can be coupled conductively (i.e. through wires) into the piece of equipment. This document explains in more detail the issue. Essentially common mode (CM) noise is an unwanted signal which couples into both line conductors in the same direction, whereas differential noise is coupled into a single conductor. For simplicity I'm talking about noise coupled into mains line here, where common mode chokes are frequently used, but the same problem arises whenever some wire comes out of an apparatus, for example the leads of a multimeter, an oscilloscope probe or even the USB cable connecting an external HD to the PC. Common mode chokes usually have two separate windings which are each put in series with each line conductor. These two windings are wound on the same ferromagnetic core in a way that exploits the different path that power line current and CMN currents take in the circuit. Therefore the choke presents very little impedance to the power line current, whereas common mode noise currents see each winding as much higher impedances, and this attenuates the amplitude of the noise. Another interesting document is this application note about line filters in switching power supplies.
H: transistor command short circuit In the circuit below (schematic diagram), the command from a microcontroller allow to send the 5V to the output through two transistors command Q1 and Q2. simulate this circuit – Schematic created using CircuitLab My question is: what happen if the transistor Q1 is short circuit, the output can be energized even if the command from the microcontroller is off ? AI: So lets assume you have a proper working circuit like below, where putting positive voltage at the signal input will turn Q1 on, which will pull Q2 to ground, turning Q2 on (means output is on). simulate this circuit – Schematic created using CircuitLab In this case, it does not matter if the signal is positive, or Q1 is shorted. If Q1 is shorted, Q2 is still pulled to ground, and the output will still be on. So to answer your question, if Q1 is shorted, the output will always be on, regardless of the signal input. If Q1 is working properly, the output will be on/off as the signal is on/off.
H: How to calculate rise time of linear regulator Given a standard LDO with no soft start, that provides power to a bunch of decoupling capacitors, and a single chip. How do you calculate the rise time of the output rail ahead of time? Is it based on the time constant of the Rds of the internal FET into the decoupling capacitors and somehow minus the current draw of the part? I don't really see the Rds spec'd in the datasheets I've looked at. AI: One reasonable guess would be to multiply the decoupling capacitance times the output voltage and divide by the output current limit. In most cases the current limit will probably be high enough that you can ignore the load current. Expect it to be on the optimistic side if the load capacitance is very low and it thus predicts rise times in microseconds or less.
H: Anything bad to place a via on a pad? Once I mistakenly placed a via on 0603 pad and didn't have any problem on soldering. I am routing another board now and I could save some space by placing some vias (0.3mm) on a 0603 pad. I wonder if it is a used technique or is it a bad practice? Would it cause PCB or PCBA production, or performance problem? The via connections are low frequency (max 1.2 kHz) and related connections looks like this. AI: The industry term for this is via in pad. It's not a problem when you hand-solder components. It can cause problems during automated SMT assembly. Solder, which was applied to the pad as a solder paste, can drain through the via and there will be an insufficient amount of solder to hold the part. (Image came from this blog entry, which talks about the same issue.) There are methods in which the via in the pad is filled with solder or epoxy. That is done prior to SMT assembly. That adds to cost of assembly, so the benefits from the via-in-pad need to justify that. Related older thread: Vias directly on SMD pads article: Via-in-pad guidelines for PCBs
H: What's the purpose of the diode in this selectable supply voltage circuit part I'm looking at the power supply part of the schematic of SparkFun's Pro Micro Arduino board, which has a jumper to enable or disable a voltage regulator to select between running the board at 3.3V or 5V: I have two questions about D2: What is its function in the circuit? Where can I read up on the motivation for adding it to the circuit? What would happen without it, and is it needed if I always want to run the board at 3.3V, i.e. if I omit the jumper? What kind of diode would I use if I build this board myself? AI: The schematic has a note right on it: So the fuse and diode are intended for protection (overcurrent and reverse voltage respectively), as others have correctly noted. Note also that the diode drops about 0.65V or about half of the 1.7V that is required to get from 5V to 3.3V. At the maximum 500mA out, the power dissipation in the regulator will thus be split between the diode and the regulator at about 325mW each. That might be significant in allowing more current or higher ambient temperature, depending on what package that Sparkfun used. If you build the circuit yourself, the diode is optional if you don't want the protection and are okay with the increased power dissipation. If you use a diode, a reasonable type to choose would be rated at 1A and 200V or more. Very common and cheap- a 1N4004 (1A/400V) would be a popular through-hole part.
H: Detecting electrons as they tunnel through the band gap of a P-N junction As a learning exercise I'd like to try creating a random number generator using reverse-biased BJTs. As I understand it, if the emitter is saturated in reverse bias, occasionally electrons will tunnel through the band gap to the base pin. Can this be done with common BJTs or are special parts required? What sort of amplification will be required to actually detect this tunneling? I.e. at what voltage will the signal be on the base pin when an electron tunnels through? AI: It's easily done. Reverse-biasing the emitter-base junction of an NPN transistor is well-known as a cheap and fairly good noise generator. See http://holdenc.altervista.org/avalanche/ as an example, but if you Google reverse bias noise generator you'll get lots of hits. And the problem is not so much amplifying the random electrons as it is reducing the number to a level where counting single electrons is possible. Actually, this isn't done. Instead, the standard approach is to AC-couple the noise voltage and look for zero crossings of the detected signal.
H: Atmega328 fast PWM (mode 7) of timer 0 not working as expected I am blinking an LED on PORTB5 using timer 0 in mode 7. The time between blinks is computed as $$ \frac{(\text{OCROA}+1) \times \text{prescaler} \times \text{timerCount}}{\text{FCPU}} $$ \$FCPU=16MHz\$. With \$OCROA=124\$, \$prescaler=1024\$, and \$timerCount=125\$, the time turns out to be \$1 \space second\$ and this works as expected. But with \$OCROA=16\$, \$prescaler=1\$, and \$timerCount=2956793\$, I would expect the time to be \$~3.14 \space seconds\$, but I am getting something around \$12 \space seconds\$. Code that works as expected: #include <avr/interrupt.h> #include <stdint.h> volatile uint32_t timerCount = 0; ISR(TIMER0_COMPA_vect) { ++timerCount; } int main(void) { DDRB |= 1 << DDB5; TIMSK0 |= 1 << OCIE0A; TCCR0A |= 1 << WGM00 | 1 << WGM01; TCCR0B |= 1 << WGM02; OCR0A = 124; sei(); TCCR0B |= 1 << CS02 | 1 << CS00; while(1) { if(timerCount >= 125) { PORTB ^= 1 << PORTB5; timerCount = 0; } } return 0; } Code that does not work as expected: #include <avr/interrupt.h> #include <stdint.h> volatile uint32_t timerCount = 0; ISR(TIMER0_COMPA_vect) { ++timerCount; } int main(void) { DDRB |= 1 << DDB5; TIMSK0 |= 1 << OCIE0A; TCCR0A |= 1 << WGM00 | 1 << WGM01; TCCR0B |= 1 << WGM02; OCR0A = 16; sei(); TCCR0B |= 1 << CS00; while(1) { if(timerCount >= 2956793) { PORTB ^= 1 << PORTB5; timerCount = 0; } } return 0; } What could be the issue with the latter? AI: In your second setting the timer is incrementing once for every clock cycle (prescaler is 1), but it only counts to 16. The AVR executes one instruction per clock cycle (except for branches) so there are less than 16 instructions available between each PWM interrupt. The execution time of the ISR is longer than this (it may be variable as well) and that is causing your code to periodically miss interrupts, extending the apparent time it is taking to count to your target value. To fix the problem you need to either use the prescaler and count to a higher value, or if you can't do that (if you are using the hardware PWM generator), look at using OCR1B with a longer count to generate the interrupts instead. Also you should disable interrupts when you clear timerCount because this is a 32-bit value that requires multiple instructions to update on an 8-bit platform.
H: Thèvenin equivalent circuit I calculated the Thèvenin equivalent circuit of a given circuit in two ways. I know that one is correct and the other is not (because I saw the result on my book), but I can't figure out why the other is wrong. This is the starting circuit: simulate this circuit – Schematic created using CircuitLab First way : \$V_{eq}=V_1\cdot\frac{2R}{2R+2R}=\frac{V_1}{2}\$. (this gives the right solution). \$R_{eq}=2R||2R=R\$ simulate this circuit Second way: I see the starting circuit as this: simulate this circuit That is with an infinite resistance in place of the open circuit. Now, I get: \$V_{eq}=V_1+V_1\cdot\frac{2R}{2R+2R}=...=V_1\cdot\frac{3}{2}\$ \$R_{eq}=(R+2R)||2R=...=\frac{6}{5}\$ So,the equivalent Thèvenin circuit now is: simulate this circuit Where am I wrong with the second method? EDIT: When I calculate \$V_{eq}\$ with the 2nd method, I get this circuit: simulate this circuit And here it's true that: \$V_{eq}=V_1\cdot\frac{2R}{2R+2R}=\frac{V_1}{2}\$ but it's also true that, with KVL: \$V_{eq}=V_1+V_1\cdot\frac{2R}{2R+2R}=...=V_1\cdot\frac{3}{2}\$. Where am I wrong with this last one? AI: You're not combining series and parallel resistors correctly. To use the voltage divider equation with your second circuit, you first need to combine \$R\$ and \$R_2\$ in parallel with \$2R\$: $$\frac{1}{R_{parallel}} = \frac 1 {2R} + \frac 1 {R + R_2}$$ $$\frac 1 {R_{parallel}} = \frac 1 {2R} + \frac 1 {R + \infty} = \frac 1 {2R} + 0 = \frac 1 {2R}$$ $$R_{parallel} = 2R$$ The voltage between the \$2R\$ resistors is then: $$V_{mid} = V_1 \frac{2R}{2R + 2R} = \frac {V_1} 2$$ which is what you got for the first circuit. I'm not sure why you didn't include the \$R\$ resistor in your Thevenin resistance. Normally in this kind of problem you want to end up with only one equivalent resistor.
H: What is causing this level shift in my wave? Excuse the quality, sorry; RED is GATE of Q2. YELLOW is GATE of Q4. 5V INPUT AT ALL STAGES What are possible reasons that my H-bridge has a little 'bump' at the turn-off of the high-side? It's reflected on the Vin(bridge) too; Circuit: (also here ) I've added a new shiny ceramic capacitor to the Vbridge and GND connection, but no dice. Could it be that having a ground common to my H-bridge ground is bad? Or perhaps the capacitor is refusing to discharge beneath 6V~ for a more obscure reason? EDIT: It's driving a 15-20mH load, but the bump is present with no-load and resistive loads on the order of 1000R, 100R, 10R. EDIT2: Also, I've noticed that if I put in above 17V to the bridge, the power supply I'm using just shuts itself down and I have to restart the circuit. EDIT3: Here's a bunch of images of measurements I made. Q2 DRAIN to GND Q2 SOURCE to GND Q1 SOURCE to GND Q1 and Q2 GATE to GND (10V) NEW WAVES 5V H-BRIDGE OUTPUT 10V OUTPUT Q2 Gate/12V AI: It's fairly straightforward. When Q2 is turned off, Q4 is already off. As a result, the output, LVCoilA, is left at an intermediate voltage. This is probably determined by a combination of the two MOSFETs' off current, combined with the capacitances of each MOSFET, producing a sort of voltage divider. If you look simultaneously at Q2 gate and LVCoilA, you'll see that the gate is set to the bootstrap driver's reference, which is LVCoilA, about 6 volts in this case. Since LVColA is also Q2's source, Q2 is turned off. When Q4 is turned on, you'll see LVCoilA, as well as Q2's gate, get pulled down to ground. As for the noise on the voltage bus, in order to make much sense of it, you must simultaneously display (for instance) Q2's gate and +12. As it stands, the two traces differ by x5 on the timebase, and there is no obvious way to be sure which +12 transients occur with which gate events.
H: RL voltage across inductor differential equation I have a simple RL circuit such as the one shown below and I want to derive the differential equation relating the input and output voltages. I want to take the output voltage as the one across the inductor. So far I have done the following but I'm not sure whether I'm making a mistake or not, since I haven't been able to find a similar process in a couple books and internet. I want to do this as an exercise for finding Fourier Transform of output. I know the differential equation starts out like this: $$ V_{in}(t) = L\frac{di}{dt} + Ri $$ From which I know that the current \$i\$ is $$ \frac{V_{out}(t) - V_{in}(t)}{R} $$ I replace this, and get $$ V_{in}(t) = \frac{L}{R}\left(\frac{dV_{out}}{dt} - \frac{dV_{in}}{dt}\right) + V_{out}(t) - V_{in}(t) $$ Is this correct? All that would remain would be to replace $$V_{in} = e^{jwt}$$ and $$V_{out} = H(w)e^{jwt}$$ and simplify, getting $$ H(w) = \frac{2+\frac{L}{R}jw}{1+\frac{L}{R}jw} $$ I believe I made a mistake somewhere since this result looks kind of weird. Also: is this a high pass or low pass filter? How do I figure this out from looking at the equation? And how do I find the cut off frequency? AI: You got the second relation wrong: \$ i(t) = \dfrac{v_{in}(t)-v_{out}(t)}{R} \$ substituting in the first equation you get: \$ v_{in}(t) = \dfrac{L}{R}\left(\dfrac{dv_{in}}{dt} - \dfrac{dv_{out}}{dt}\right) + v_{in}(t) - v_{out}(t) \$ Thus \$v_{in}\$ cancels out in both members. Rearranging you get: \$ \dfrac{L}{R}\dfrac{dv_{out}}{dt} + v_{out} = \dfrac{L}{R} \dfrac{dv_{in}}{dt} \$ Hence: \$ \dfrac{L}{R} \cdot j\omega V_{out} + V_{out} = \dfrac{L}{R} \cdot j\omega V_{in} \$ \$ H(\omega) = \dfrac{V_{out}}{V_{in}} = \dfrac{ \dfrac{L}{R} j\omega } { 1 + \dfrac{L}{R} j\omega } \$ This is coeherent with the standard s-domain approach for determining the transfer function of the system \$W(s)\$. In fact if you replace the inductor with its s-domain equivalent \$sL\$ and apply the voltage divider formula in the s-domain you get: \$ V_{out}(s) = V_{in}(s) \dfrac{Ls}{R+Ls} \qquad \Leftrightarrow \qquad W(s) = \dfrac{V_{out}(s)}{V_{in}(s)} = \dfrac{Ls}{R+Ls} = \dfrac{\dfrac{L}{R}s}{1+\dfrac{L}{R}s} \$ and since \$ H(\omega)=W(j\omega)=\dfrac{ \dfrac{L}{R} j\omega } { 1 + \dfrac{L}{R} j\omega } \$ you can see that the two methods give the same result.
H: Why both voltage and mAh are mentioned in batteries? If battery is a voltage source then why current is mentioned ? The current depends on the resistance in the circuit right? Then how can a battery give mAh as well as voltage? AI: mAh is a measure of battery capacity, not instantaneous current. A 1000mAh battery can theoretically sustain a draw of 1000mA for one hour before it runs out. Broadly speaking, that means it could also sustain a draw of 500mA for two hours, or 2000mA for half an hour, but in reality battery capacity varies somewhat depending on how much current you draw; lead acid batteries, for instance, have significantly more capacity if discharged slowly. The product of a battery's mAh rating and its voltage gives a rough approximation of power capacity (in watt hours) - rough, because a battery's voltage will also vary during the discharge cycle.
H: DC Op-Amp Output at an unexpected voltage? For some reason Op-Amps are impossible for me. I'm experimenting with them a little bit. I have the following circuit... simulate this circuit – Schematic created using CircuitLab This is the circuit I have on my breadboard. I was just trying to see the "infinite gain" I would expect from this configuration. The inverting input is around 4.5v, while the non-inverting input is at ground. I should be achieving my maximum potential (Limited by the power rail.) I.E. around 9V at the output, but I'm recieving .6v? AI: You've connected your inputs backwards. A higher voltage on the non-inverting input produces a more positive output. You put the higher voltage on the inverting input, so the op amp output goes as low as it can. In this case, that's close to ground.
H: How to use HX711 module with PIC microcontroller? I'm trying to use the HX711 to capture the weight of a load cell using the PIC18F4520 microcontroller. According to the datasheet (http://www.dfrobot.com/image/data/SEN0160/hx711_english.pdf) if I put the clock pin (PD_SCK) at GND, the module will activate its internal clock, so simply read what leaving the DOUT pin. Is this right? If this are correct, I have to connect this output to an analog port? (Sorry my english) AI: The datasheet pg.1 says On-chip oscillator requiring no external component with optional external crystal. So apparently it can function driven from the PIC clock, or with it's own clock. On page 2, it says PD_SCK is for Power down control (high active) and serial clock input. So this is incorrect, as XI is for Crystal I/O or external clock input, 0: use on-chip oscillator. So XI LOW forces it to use it's own oscillator; PD_SCK HIGH forces it into power-down mode. Page 4 explains how to use internal or external clock, and the timing and speeds available. If you choose to let the HX711 use it's own internal clock, then it will spit out either 10 or 80 samples per second, depending on whether the RATE pin is low or high. If it is happily spitting out 80 samples per second, and the PIC starts looking at that data somewhere in the middle, then it's going to be tough figuring out which bit is being looked at and where the next sample starts. It can be done but would require some elaborate analysis of the incoming data bits. It would probably be advantageous to run a PIC output pin to PD_SCK and a PIC input pin to DOUT, forget the self-clock, and "bit-bang" responses whenever the PIC code runs. By "bit-bang" I mean write some PIC code that gets each bit, one at a time. Here is some pseudo-code: is DOUT low? If so, continue, else exit. (send 1 clock pulse to the HX711: LOW, HIGH, LOW, read the single data bit output into a 24-bit PIC integer, rotate the integer one bit, either direction, doesn't matter) do this exactly 24 times. send 1 clock pulse. DOUT should now be high. If it is not, an error occurred. (If you want to keep the gain at 128 for the next sample, do nothing. If you want to switch the HX711 to Channel B input with gain of 32, send 1 clock. If you want to switch to Channel A input with gain of 64, send 1 more clock.) The timing requirements would still apply; meaning that if the HX711 is set to spit out 80 samples per second, you won't be able to read them in time from a PIC running at 32kHz. The PIC must be fast enough to read a sample before the next one comes in. That shouldn't be a problem if using a fast PIC and the 10 samples/sec setting.
H: LC tank circuit feeding on op-amp, no oscillation? Based on what I learned during this experiment I've built the following circuit using an op-amp configured as a buffer... simulate this circuit – Schematic created using CircuitLab The inductance of the coil is unknown. I have found no way to measure the inductance of the coil on my oscilliscope in Henrys without some form of a wave generator...which I don't have. My multi-meter registers .1v-.2v on the capacitor, and .1v on the coil. It remains constant. Shouldn't I be getting some form of oscillation in voltage when probing either the coil or the capacitor? From my understanding I'm creating an LC-Tank Circuit and supplying the current the Tank Circuit needs to continue stable oscillation which it lost due to resistance. AI: In your circuit you are using the tank as the load on the op-amp buffer circuit. The op-amp is trying to produce 4.5 V, but its output is short-circuited by the inductor. To generate oscillations in a linear circuit, you need to meet the Barkhausen criterion: A feedback mechanism with loop gain equal to unity Phase shift through the loop equal to a multiple of 2\$\pi\$ radians. The usual way to use a tank circuit to set the frequency of an oscillator is to put it in the feedback loop where it can cause the Barkhausen criterion to be met at (or very near) its resonance frequency. In your circuit, the tank is not involved in feedback, so it can have no influence on oscillation. A relatively similar circuit that can oscillate is shown here: (source) Notes: R1 prevents the op-amp output being short-circuited at DC. The tank forms a divider with R1 so that positive feedback is very low except when the tank is at resonance.
H: Measuring the inductance of a coil? I have a hand-wound coil I'm using in an LC Tank circuit. Using my multi-meter, I found out that the coil is drawing .6mA at 9v. Using Ohm's Law... $$R = V/I$$ $$R = 9/.0006$$ $$R = 15kΩ$$ Is there a way to calculate the inductance of my coil from the DC resistance? AI: An ideal coil has an inductance \$L = mew \times turn\text_density^2 \times Area \$. The resistance of your coil is \$R = \rho \times \frac{length\text_wire}{cross\text_section\text_area\text_of\text_wire}\$. This can be simplified to \$R = constant\times length\text_wire\$ Naturally the if the coil has a greater turn_density or area, then the length of wire would be longer, so they do go up together, but the inductance is highly dependent on the geometry of the coil, so you are probably better off trying to calculate the inductance with the equation. For instance if you increased the length of the coil while keeping the same density and area, the resistance would go up, but the inductance would not. So they cannot be related
H: What is the maximum physical current that can pass through a standard USB cable? I am looking at hi-jacking an USB cable to supply to supply > 2.1A to the target. What is the physical current limitations of a standard USB cable? AI: In July 2012, the USB Promoters Group announced the USB Power Delivery ("PD") specification, an extension that makes use of certified "PD aware" USB cables with standard USB type A and B connectors to deliver up to 2A @ 5v. In addition to the type A and B cables, the power delivery option will also be part of the new USB-C standard with the reversible connector (like Apple Lightning). So theoretically you would need to get hold of one of these special PD cables to safely pass 2.1A. Before this, the maximum you could send over a standard USB cable for battery charging was 1.5A @ 5v (and devices not being charged were limited to 100 mA or 500 mA). The gotcha is I can't find any of these PD-aware cables available for sale. Standard USB cables use really small wires. Most use 28/28 gauge, meaning 28 gauge for data and 28 gauge for power, because they are designed to handle only 500 mA. 28 gauge is tiny. Better cables use 28 gauge for data and 24 gauge for power (which is still pretty small). You can search for these using "USB 28/24" in Amazon (without the quotes of course). The same article linked to above claims USB cables with 24 gauge wires can handle 2A, even though that's above the official USB spec of 1.5A. Although come to think of it, I believe a lot of tablets can draw up to 2A when charging. 24 gauge cable has a resistance of 0.0257 Ω/foot, while the resistance of 28 gauge cable is a little over 2.5 times as much. So 2A through a 24 gauge 6-foot cable will drop the voltage 0.3v. Not great, but okay. The same current through a 28 gauge 6-foot cable will drop the voltage 0.77v -- not good. So it looks like you are probably safe to use a standard USB cable, as long as it is not too long and uses 24 gauge or larger wires.
H: Why is inductor completely canceling out current? I used this calculator to determine that my hand-turned inductor has an inductance of approx. .5 uH. simulate this circuit – Schematic created using CircuitLab When I measure this circuit on a multi-meter every node on the circuit is measured in mV. How is this possible? When I use Ohm's Law to get the inductor's resistance it is measured it is measured in thousandths of an ohm. Why aren't I getting around 9v with a realistic voltage level? AI: "I'm tempted to say that I'm not pulling any current" That is your error. When you measure the voltage, your system is in steady state, where the inductance does not count, only the ohmic resistance of your coil, which is very low. A 9V battery has a rather high internal resistance, so you in effect have a voltage divider, and you are measuring the voltage over the leg of the divider that has a very low resistance => you emasure a very low voltage.
H: How to design, build and test synchronous sequential circuits using D-Flip Flops? I want to design, build and test synchronous sequential circuits by using D-Flip Flops. I know how to analyze state diagrams but I don't now how to obtain a state diagram using just outputs. P.S. : This is a school project for my logic lab class. I don't want a full answer but any help would be appreciated. I really couldn't understand how to start. Thanks in advance. Use D flip-flops to design the circuit specified by the state diagram of following figure. The output of the circuit is Zi , that is the output of the circuit. (Black dots represent binary 1) AI: You want to generate this sequence right? For that start with truth table. 000 --> 00111 001 --> 00101 010 --> 10000 011 --> 11011 100 --> 00001 101 --> 10100 110 --> 11100 111 --> 11111 First you make 3 bit synchronous counter using D flip-flop. Use counter outputs as input variable for logic circuit to get respective output combination. First draw 3 variable (outputs of counter) K-map for Z1. Find boolean equation for the same. Repeat this for Z2, Z3, Z4 and Z5. If you need more clarification let me know.
H: Avoiding confusion between no input and a zero in binary? Suppose I'm transmitting data through FM where 0 is 2Hz and 1 is 4Hz. The transmitter is transmitting 2Hz when there is no input. If I fed the recieved binary to a UART port of a microcontroller, how would the microcontroller differentiate between no data and 0? This becomes relevant when transmitting ASCII characters for instance. Suppose the following string: 01000110 01101111 01101111 01100010 01100001 01110010 Because I've added spaces, we could translate this to: Foobar But to a machine the string would look like this: 010001100110111101101111011000100110000101110010 How would you create those "spaces" so you don't get ASCII characters messed up when you're receiving binary? AI: If you feed something to a UART port of a microprocessor you must follow the UART communication protocol if you want the microprocessor to understand what you are feeding it. You need to embed each ASCI character into a UART package that contains a start bit, a stop bit and possibly a parity bit, a lot more information is available on the UART Wikipedia page. When you're not sending the bus is idle and it is kept in a logically high state. When you're starting the transmission of a package the first bit is always logically low. This is the start bit. Then follows eight data bits and then a stop bit which is logically high. The microprocessor knows when the next bit is arriving since it knows the bus speed that you have configured. Therefore, it is possible to transmit for example two zeroes next to each other. Both the microprocessor and the unit transmitting to the microprocessor needs to be configured with the same transmission speed, parity and number of stop bits.
H: Capacitor in parallel with battery for high current output I have a long-term application with very low quiescent current and infrequent pulses. I've spec'ed high capacity, low pulse current batteries that will give me the lifetime I need, and I want to charge a capacitor to handle the infrequent high current (regulated) loads. Can I put the cap directly in parallel with my batteries? Will the voltage drop from the current pulse have a negative effect on the battery? Or would I have to regulate before as well as after the cap? AI: Even "directly in parallel with the batteries" isn't really directly in parallel with the batteries, thanks to wiring resistances. The capacitor should have the closest and most direct connection to the load, then this pair should be connected to the battery via wiring which gives you some control of the current drawn from the battery. Find the maximum recommended current (Imax) from the battery, probably from its datasheet. Calculate the voltage drop (dV = dQ/C) across the capacitor under load, where dQ = (Iload-Imax) * pulse width - or more conservatively, Iload * pulse width. Calculate the resistance R = dV/Imax you need in the connection to the battery. This resistance limits the current from the battery to Imax when the capacitor voltage dips by dV. And ensure the battery wiring (including any fuse) has at least that resistance. If dV and thus R are too high to make this all work, increase capacitance C and try again.
H: LM324 Pre-Amp For Mic (to PC) Not Working I don't have much experience in circuit assembling or designing but I wanted to create a pre-amp for my microphone(Philips SBC MD110 Dynamic Microphone which I directly connect to my PC) to boost the signal levels. So I created one by refering this 2 mins video https://www.youtube.com/watch?v=1wbgbbbILc0 So this is the circuit diagram(screenshot from video): This is the circuit I actually made from the above diagram: This is the underside of the board: That's it. But its not working. When I connect the output of amp to pc's mic socket, all I can hear is a noise and nothing else. The Vcc (~5V) is reaching the Vcc-pin of opamp IC as my multimeter shows that. Also I've used the 1st opamp of the IC (+ve input is 3rd pin, -ve input is second pin and Output is from 1st pin). What I am doing wrong here? AI: Possible assembly errors aside, at timecode 0:36 the guy tries to calculate the circuits gain, and comes up with 500 (which would be ~54dBV). Given that a dynamic mics voltage range is round about 40mV (Possible peaks to 80mV or more) this should ring some alarm bells: \$500 \cdot \pm 40mV = \pm20V\$. Not possible with the present supply voltages from 0 to 5V. So what we need here is a much lower gain. Assuming some useful gain within the soundcard itself and to avoid clipping of the opamp near the rails, amplifying +-40mV to 1V seems like a much better idea, which leads to a gain of 25 amounting to ~2k resistor instead of 39k. For extra fun you can replace it by a 10k pot and play with it. In the end where that guy shows the final assembly, I can also nowhere find any negative feedback, so either its on the back, or just a wire (making this a voltage follower then). What to learn from it? Don't just blindly build some youtube videos circuit without understanding it, especially from a video with 0 comments and not even 200 views... At least try to understand it by doing some simulation, e.g. in ltspice. It takes 10 minutes and gives you valuable information, in this case it could also give you the information that the frequency response of this circuit is nowhere near hifi ;)
H: Functionality of Accelerometers Is it possible to do a speedo meter with an accelerometer ? I am working with Arduino hardware. AI: TL;DR Basically, no, for most situations. Since acceleration is the derivative of velocity, integrating the output of an accelerometer should give you the velocity, however there are several flaws in that ointment(sic). Firstly, if you remember your calculus, integration leaves an arbitrary constant so you must know the initial velocity in order to determine a new velocity. To put it another way, an object moving at constant velocity has no acceleration. Secondly, the MEMS accelerometers used in typical consumer accelerometers have a lot of offset and drift. The offset gets integrated as well, and thus tends to increase without bound over time. Other errors such as hysteresis and scale errors will also affect the calculation results. Thirdly, the accelerometer will respond to the 1g force of gravity. From the accelerometer's point of view, an accelerometer sitting on the table appears to be accelerating Edit: UPward at around 10m/s^2. Even if you attempt to ignore that axis, g can creep into the other axes. An object in free fall will appear to have no acceleration- whether it's falling towards the ground, in orbit or somewhere off in space. For normal applications, that means that the orientation of the accelerometer must be known to high accuracy- an error of only a degree or two will cause a large error in the velocity estimation in seconds. So, an inexpensive accelerometer is only useful in a very limited subset of velocity estimation applications- 'dead reckoning' is not very useful with low-cost accelerometers. However, if the accelerometer signal could be somehow combined with some kind of accurate but slow measurement of position (eg. GNSS such as GPS or GLONASS) then you could have a fast-responding estimate of velocity that does not drift. This can be done with an algorithm that takes into account the errors of the two measurements and weights them appropriately (typically with a Kalman filter). It is possible to use very accurate accelerometers in combination with accurate and very expensive gyros to determine velocity and position fairly well for relatively short periods of time. This is useful in case you wanted to deliver something, say an important 'package' of some kind, to the folks on a distant part of the earth very quickly (minutes) and could not depend on an absolute position measurement (say viewing a bright star or GNSS) for the entire trip (you probably know the initial position). The combination of accelerometers and gyros is called an IMU (inertial measurement unit). When combined with GNSS they're called something like GNSS-aided inertial navigation systems).
H: How is VHDL used? I'm new to hobby electronics/robotics and am trying to understand the use case for VHDL. The syntax is easy enough to understand, but I'm not seeing the "forest through the trees" on a few items. For one, I'm trying to ascertain exactly what components of a digital system can be represented in VHDL. Can it be used for describing the behavior of CPUs? MCUs? PCBs? System-on-a-chip-type components? Second, does VHDL compile to anything? Since it's describing hardware behavior, I'd imagine the answer would be no, but then my next question is: so then what happens to VHDL? Is there some kind of magic machine that takes VHDL as input and spits out chips & circuitry that accurately reflects the hardware modeled by the VHDL? AI: VHDL is used in ASIC and FPGA development, as is Verilog. Pretty much all commercial chip design is done in one of those two. There's not so much a magic machine as a pipeline of large expensive pieces of software. The flow looks like this: humans write VHDL, then simulate in a program such as Modelsim to validate design. this is converted to a gate level netlist, which is usually also in Verilog but replaces all logic expressions by instantiations of logic gates (AND/OR/NOT/D-type flipflop). This is vaguely similar to a software compiler outputting machine code. another round of software does place and route, assigning those gates to locations on a chip. At this point it becomes possible to calculate timing and power consumption. additional bits of hardware are substituted in for things that aren't made out of logic gates (memories, analog subcomponents) For ASIC, finally the gates are converted into a sort of vector graphics format called GDSII, which is sent to the factory.
H: e13007f npn transistor datasheet reading for turn on time I am reading datasheet for e13007. You can get it here: http://www.datasheet-pdf.com/datasheetdownload.php?id=520587 (click on "Download PDF for PC") In "Electrical Characteristics" section under turn on time it says 1.6 us (max value). Now in the figure 4.(on page 2), I cant read this of the graph! Curvers are for tr and td. I know that tr+td=turn_on_time. Reading the graph (for Ic=5A) I get 555us for turn on time. What am I doing wrong? Or what is turn on time for Ic=5A (one from the table or one from the graph or something else) ? AI: Looks like a typo- here is the curve from the similar part number FJPF13007 And your datasheet: You may find it useful to refer to the datasheet of the original manufacturer- it was Motorola, spun off some years ago as ON Semi.
H: Who is responsible for Electrical shocks, high current or high voltage? An electrical shock may cause burns, or it may leave no visible mark on the skin. In either case, an electrical current or voltage passing through the body can cause internal damage, cardiac arrest or other injury. Under certain circumstances, even a small amount of electricity can be fatal. With that being said, what do you think is responsible for electical shoks, high voltage or hight current, or both at the same time? AI: The risk of shock depend on several points ... To start a voltage (in volts) becomes dangerous to humans from 50V in a dry environment, 25V for a wet environment. Regarding the electric current in Amperes risks are higher: 1 A Heart Failure 50/75 mA threshold irreversible cardiac fibrillation 30 mA respiratory paralysis threshold beyond 500 ms 10 mA threshold not release, muscle contraction 0.5 mA Threshold very low sensation So having a low voltage does not mean you're safe because you have to know the current through the human body in case of impact.
H: Component selection - difference between 4027 and 4027N flip flops I am building a simple circuit that will use a J-K flip flop to enable me to use a momentary switch as a toggle. The circuit diagram states that a 4027N should be used. My local supplier has a 4027 in stock. This is a really basic question I'm sure, but is this the same thing? What does that trailing N in the name mean? AI: The alternative will be fine. The trailing letters tend to be manufacturer specific, usually identifying the package (e.g. SOIC, DIP, etc.) or other properties like being lead free, or industrial/automotive/military temperature ranges, etc. An example is the NXP version of the 4027. They have two: HEF4027BP HEF4027BT For them, the 'P' one is the DIP package and the 'T' one is the SOIC package. But according to one of their other datasheets (granted for a different part), they use 'N' to signify a DIP package in America. This is probably where the 'N' comes from in that schematic.
H: Atmega2560 Usart Interrupt problem When I send any data from serial port, RX pins are flashing but ISR is not running. Here is my code. #include <avr/io.h> #include <string.h> #include <avr/interrupt.h> #include <util/delay.h> #define F_CPU 16000000 volatile int NUMBER_OF_RECEIVED_BYTES = 0; ISR(USART0_RX_vect) { NUMBER_OF_RECEIVED_BYTES++; } int main(void) { #define USART_BAUDRATE 9600 #define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) UBRR0H = (uint8_t)(UBRR_VALUE>>8); UBRR0L = (uint8_t)UBRR_VALUE; UCSR0B |= (1 << RXEN0) | (1 << TXEN0) | (1 << RXCIE0); UCSR0C |= (1<<UCSZ01)|(1<<UCSZ00); while (NUMBER_OF_RECEIVED_BYTES == 0); DDRB |= (1 << DDB7); sei(); while (1) { PORTB ^= (1 << PB7); _delay_ms(999); } } AI: In your code: You increment the NUMBER_OF_RECEIVED_BYTES only in your ISR. You have a loop before sei();, waiting for NUMBER_OF_RECEIVED_BYTES not to be 0 . So your loop will be infinite, because the global interrupts are disabled and your ISR won't be called to increment your variable. See: while (NUMBER_OF_RECEIVED_BYTES == 0); // <---- infinite since interrupts are disabled DDRB |= (1 << DDB7); sei(); //<-------- thus, this line is never reached, interrupts won't be enabled I do not know what is the purpose of this loop: while (NUMBER_OF_RECEIVED_BYTES == 0);, but you should enable interrupts before it starts.
H: Norton equivalent current I calculated the Norton equivalent circuit of a given circuit and I found the result is the same as my book provide, except for the sign. Here is the circuit: simulate this circuit – Schematic created using CircuitLab So the circuit I've to analyse to calculate the Norton current is this: simulate this circuit Doing a KCL at the node 1: \$i_N=-\frac{Av_d}{R}\$ Now, my book says that it's \$i_N=+\frac{Av_d}{R}\$, in fact it draws the current \$i_N\$ in the opposite direction. My question is: why? AI: This is just a matter of references*. When you start to tackle the problem you short circuit your port and draw a reference for the Norton current. It's just like saying "this is what positive Norton current is to me". After solving the circuit you get a result that is negative? No problem: it just means that the current is actually flowing in the opposite way, i.e. out of node 1. Your answer and your book's are just the same: the book says that output current is positive, and gets a positive current that is then going out, while you say that input current is positive, and get a negative current that is then going out. Note that an answer giving only the current would be incomplete: if I told you that the current flowing in the controlled source is 1A you should ask me: is it going from plus to minus or vice versa? You can think of an analogy in kinematics: the first thing you do before solving a problem is choosing a reference system*. If you don't choose it and tell your teacher that the ball speed is 10m/s he should yell at you. *I believe that's the correct English word, please comment if it's not.
H: Tools used to manufacture entire digital systems I am new to electronics and am trying to wrap my head around the various tools used for producing various digital components. My understanding of HDL languages like VHDL and Verilog is that they describe the behavior of chips/ICs and are ultimately used to fabricate FPGAs and ASICs. My understanding of tools like Eagle CAD is that they are used for designing circuits like PCBs, motherboards, etc. So, say I am using a breadboard to design a circuit. Once I am satisfied with the way the breadboard is wired, I would then use Eagle CAD to model a PCB using the same wiring as my breadboard prototype, and Eagle CAD produces a file. I then hand that file to a PCB manufacturer, and they produce a nice, sleek PCB for me. My first concern is this: are my assertions above correct? Is my understanding of these tools spot on, and if not, can someone please rectify or clarify anything for me? Assuming I'm more or less correct: What tools are used to design entire systems? Say I have a device that has: An custom ASIC chip/processor Flash memory chips EEPROM memory Peripherals (LEDs, servos, etc.) All of these connected via "motherboard"/PCB I'd imagine HDL tools would be used to design the ASIC, and something like Eagle CAD would be used to produce the motherboard/PCB connecting everything, but what about the memory chips and peripherals? And are there any tools that design all of the above? I ask because, ultimately, the entire system has to be integrated into a single PCB. That means a single manufacturer/assembler is ultimately responsible for putting all the parts together. So what I'm really getting at is: what types of files/specs are handed to a manufacturer to produce/assemble an entire system like the one above? AI: are my assertions above correct? Everything you have written above that line is correct. This is a multipart question. At the very top system level, you will find surprisingly heavy use of Word and Visio to produce a series of block diagrams. The different specialisations will then be handed off to different teams using individual tools. Designing a whole new product out of new parts in one go with no prototypes is a risky endeavour. Generally you'd do it in stages: sort the custom ASIC out before finalising the motherboards. RAM is highly structured and I think the tools for this may be proprietary things that just emit GDSII. Individual RAM cells can be simulated in SPICE. The final question depends slightly on what you're making, but last time I did it I sent: a PCB stackup: set of Gerber files with list of drill holes and thickness/finish (ENIG, soldermask colour, etc) a placement list (autogenerated from the PCB software, used for pick-and-place) a Bill of Materials (BOM) which is a spreadsheet of parts by part designator a test plan for checking the PCBs (Word document with pictures) software binaries to be preloaded into the microcontroller (Microchip BIN format) assembly diagrams for how to put the PCB in the case, fit buttons etc. Injection moulded casework was designed in Solidworks and commissioned seperately. If you need things which can't be reflow soldered that involves extra explaining.
H: Circuit providing output? What does it mean for a circuit to provide an output power of say 1000W? Is "circuit providing power" referring to the battery supplying energy to the external circuit, or is it referring to the power of the components? In general I'm just finding the terminology used in electricity a bit confusing. EDIT: What does "circuit provide an output power" mean? AI: When someone says a circuit provides an output power they are referring to the amount of power that is delievered to the load and can be used to do work or processing. When someone says a circuit dissipates a given amount of power they typically mean that amount of power is converted to waste heat in the course of processing and cannot be used by other circuits.
H: What are these displays called? I now searched the web for about an hour and just can't figure out how these displays are called or where to buy them. A lot of airports use them for the departure table. They seem to be just LED-Displays with a really strange dot layout. Does anybody have an idea how these displays or these dot alignments are called? (source: thehindu.com) AI: This is a really interesting Google challenge. I think it may be LCD - see this patent (EP 0146285 A2): http://www.google.co.uk/patents/EP0146285A2?cl=en This one has what looks like a very similar pixel arrangement: http://www.google.co.uk/patents/US5497171 And here is a brochure where they're described as 'mosaic modules': http://www.drpmgmt.com/files/LCD.pdf Somewhat ironically, given the earlier answer which has now been deleted, these appear to be made by Solari, though they're absolutely NOT what people generically refer to as a 'Solari Display'.
H: Is it possible to "crack" an ASIC? Could someone break an ASIC? If an ASIC is a fully customized, app-specific CPU, is possible to reverse engineer it? I'd imagine the answer in general is no, since to me the only way to do this would be to keep firing inputs at the ASIC and see what it outputs. And if you don't have clear documentation as to what the ASIC expects as valid input, and what its various outputs imply, the ASIC is essentially a mysterious black box. Are there advanced methods, tools, etc. that can be used to "crack" an ASIC? AI: It is quite possible to reverse engineer an ASIC and there really isn't much you can do about it. Basically the main way you do it is physically by removing each layer of the ASIC and using a specialized computer program to recover the schematic. It is very difficult to understand all the functions of the ASIC and you can obfuscate it in various ways but there isn't anything you can really do to prevent it. Randomly sending inputs and seeing what would happen would not be very fruitful (although it can be done effectively in limited circumstances, such as Compaq's reverse engineering of IBM's BIOS chip). One of the leading companies that does this type work is called Chipworks. Reverse engineering a chip is one of the main ways a company can tell (and get evidence) that a competitor has violated their patented IP.
H: Best way to sync LED's to light NES figures on a wall clock? Advice & Ideas needed... Working on a project - a custom wall clock with perler bead NES sprites in the place of the numbers. The figures are mounted to a wood board with cutouts underneath, and during each hour an LED will turn on and light up the NES figure for that hour, and an audio file will play some sound effects/theme music from that particular NES game. Time, Budget, Experience Time is not a factor $50 - $100 if possible. I already have a bunch of components (resistors, caps, LEDs, wire, etc.) laying around. I don't have any chips or an arduino. I'm an engineer, just not electrical. Mech Eng + lots of math. I did take a couple EE classes in college but that was...a couple...years ago. I'm comfortable with circuits, wiring breadboards, sizing capacitors and resistors, etc. I've built several computers (thanks, Newegg). I'm pretty certian that once pointed in the right direction and with a little advice I can figure it out and build the circuits. My problem is knowing where to start. Controlling the LED's My main issue is trying to figure out the best way to sync LED's to a clock. For example, if Mario is at the 3 o'clock spot, then at 3pm the light behind Mario will turn on and stay lit for one hour. Then at 4pm the light behind Mario will turn off and the light behind another figure at the 4 o'clock position (Link) will turn on. The lights will cycle through 12 figures, then restart. From what I've been researching the last couple weeks, there are lots of options: 555 timer (don't thing this will work with time periods required) 555 timer with decade counter 555 timer, decade counter + 32.768 Hz crystal (can I run a clock off this too?) cascading decade counters with 555 timer arduino board and write code for program raspberrypi (probably overkill) others? Playing Audio I want to play a short clip of the theme music for each game at the top of each hour. For example, at 4pm when Link lights up, the overworld theme from Legend of Zelda will play for a minute, then stop. This is where I'm least familiar with my options. I've looked at stuff like: WTV020SD with arduino taking apart an old mp3 player and setting in to play in a loop various audio chips and boards Battery life will likely be a problem with the mp3 player route. If I go the arduino route I could probably program the LED's and get an mp3/audio board and control that too, right? TLDR Need to sync 12 LED's to a clock/timer so one LED will stay lit for 1 hour and then turn off for the next 11 hours while the next LED lights up. Repeat. Need to play an audio file once at the beginning of each hour. I've looked through the googles, here, sparkfun, buildcircuit, instructables, mdfly, and several other sites. Haven't seen anything that addresses this, or if I did I didn't recognize it. My apologies if this is covered somewhere else already. EDIT I found this: Sequential circuit with more than 10 LEDs which talks about using 2 x 4017's to get a bunch of LED's going, and also SIPO shift registers. Seems like it would work, but again, the length of time required makes me think the 555 timer won't work. Am I right on that? Still leaves the issue of controlling the audio... AI: An Arduino or other microcontroller with enough gpio will work for the lights. Add the mp3 module and a real time clock ic and you can do everything you want fairly simple.
H: How to determine the end of data received by USART? I am receiving some strings from UART in AVR. Strings are chaotic, not deterministic. It also includes new line \n and carriage return \r characters that's why I couldn't find a solution including checking bytes if they are \n or \r. So is there a way to determine the end of the data? EDIT: For more details about the data I receive. I am acquiring some strings from my web server and they are commands to be used such as "weather+check\r\n". Another one is, for example, "time\r\nNew York+Check\r\n\r\". I simply want to get these strings and assign to a char array. But to do this I need to know when data ends so that I can go out of the While loop that I use to fill the array. AI: Without some sort of defined protocol, there is no sure way to determinate the end of a string, except for it being terminated by a carriage return ('\r') and/or linefeed ('\n') character. You want to try something like this: #define BUF_LEN 100 char buf [BUF_LEN]; unsigned short i; i = 0; while (1) { char ch; ch = getChar(); if (ch != '\n') // ignore lf's { if (ch != '\r') { if (i < BUF_LEN-2) { buf[i++] = ch; buf[i] = '\0'; } } else { break; // string now in buf, terminated w/ '\0' } } } Some strings don't have line feeds ('\n') so I just generally ignore them and treat carriage returns ('\r') as an end of string. This code allocates a buffer buf which is 100 characters long. If that is not enough, then increase the number in the #define. Of course the buffer could have been allocated on the heap, but a lot of small microcontrollers don't have enough RAM for a useful heap. I'm using a routine called getChar to get the character, one by one. Change that to whatever you have available. The routine is very simple, it just gets characters and stores them in a buffer until a carriage return is found. Then it breaks out of the loop with the string in the buffer, terminated by a 0 ('\0') without any '\r' or '\n' in it.
H: How to figure out reason for last reset on MSP430? There are a number of possible causes for a microcontroller to reset itself, for example: brown-out or power-out watchdog timer reset initiated from software (to programmatically enter bootloader, etc) I'm wondering if there is a way to figure out, when a microcontroller starts up, what was the reason for the last reset - perhaps using some kind of flags that survive reset. In particular I'm on the MSP430F5xxx series. The use case is to avoid a cycle where some part of the self-test routine (for example) causes a glitch on the power rail, and then the micro resets itself and runs the self test again, repeat (until it succeeds). AI: You can get the reset source from checking the system reset interrupt vector (SYSRSTIV), there is a good description on the TI wiki (Handling MSP430 System Reset Events).
H: Can I replace a 1N4148 diode with a 1N4007? My PC game controller broke and since I have some old PS1 controllers I was thinking about converting one to PC. After some googling I found all I need is a parallel port plug and some 1N4148 diodes. But I live in a small town in the mountains and is not easy for me to get new components, I was wondering if the 1N4007 diodes I have could replace the 1N4148. Reference: http://pinouts.ru/Game/playstation_9_pinout.shtml AI: The 1N4007 is physically bigger and designed for higher current and voltage loads than the 1N4148, but in this case it should be a suitable replacement.
H: faster extend 8-bit mask to 16-bit for MCU Using an 8-bit flag register, the goal is to generate a 16-bit mask for manipulating a 2-byte settings register where adjacent pairs of bits control a channel, e.g. writing 0x2 (0b10) for channel 2 would be to take 0x04 (0b00000100) from the flag register and generate 0x0030 (0b0000000000110000) to be ANDed with a constant setting mask 0xAAAA (0b1010101010101010), resulting in 0x0020 (0b0000000000100000). The equivalent digital logic "circuit" to generate the mask would look like this: One seemingly straightforward way of implementing this in software is to shift one bit out for every two in (i.e. serial approach), paying attention to endianness. In CPU12 assembly (big endian): LDX #2 ;counter: 2 bytes L1 LDY #4 ;counter: 4 bits LDAA flag ;get flag register L2 LSRA ;shift lsb into carry PSHC ;copy carry (ccr) LSRB ;shift carry into msb PULC ;paste carry LSRB ;shift carry again DBNE Y,L2 ;loops 4 times PSHB ;store half-result (1 byte) DBNE X,L1 ;loops 2 times PULD ;retrieve resulting mask (2 bytes) (1) Is there a faster algorithm for this procedure without resorting to wiring up 24 MCU pins as illustrated, or a lookup table; e.g. one that is able to process multiple bits concurrently? (2) Is there a name for this procedure? AI: I believe what you are looking for are Morton numbers of x with x. Various ways for computing Morton numbers: Bit Twiddling hacks Specializing the binary magic numbers method for 8-bit input and 16 bit output (C-style code): uint16_t x; // set lower 8 bits of x for input x = (x | (x << 4)) & 0x0f0f; x = (x | (x << 2)) & 0x3333; x = (x | (x << 1)) & 0x5555; uint16_t res = x | (x << 1); // could also store result in place This handles any combination of input bits. Ex.: if x = 0x5 (0b101), then res = 0x33 (0b110011)
H: How to check output after FPGA Implementation? I have 10 numbers saved in RAM. I sorted it using Verilog code and saved output in another RAM. I did simulation and it was doing correct sorting. I synthesized it and generate bit file. Now i want to see whether it performing logically fine after FPGA Implementation or not.But i am confused how will i get output sorted data after FPGA implementation. Please suggest me how will I get output data after FPGA implementation so that i can check it manually and sure that my CODE is right with FPGA too. Thanks AI: There are several possibilities: You can use ChipScope. That's an on-chip logic anaslyzer, which is synthesized into your design. You can implement (or use) a FPGA to PC communication like UART to write numbers and read results. You can implement a testcase in hardware (like your testbench) that enlights a LED if the testcase is passed. ...
H: Is it safe to use optoisolator for a longer period? I have the following optoisolator PC817. It is a 4-Pin Phototransistor Optoisolator. My idea is basically to control electrical appliances in my home. The power supply in my country is 230V 50Hz. I specifically want to control tube lights in my room. The control of 5V comes from an AVR microcontroller. My circuit connections are shown in the picture. Hoping that my connections are correct, my question: is it safe to run them with optoisolator for a prolonged duration. And also how reliable are they? I also want some suggestions on additional safety precautions. AI: The circuitdiagram has some very basic problems: left side: There is no series resistor for the LED to limit the current. right side: I don't see an power source. And if there were any: the max. voltage between C and E of the PC817 is allowed to be 35V. Don't be tempted to switch 230V with the transistor of the optoisolator. You must use something like a triac or thyristor to do the high voltage switching.
H: DDR2 data rate and data bus confusion I've been reading about DDR2 memory for the past few days and have got confused with some of the terms involved. I am mainly confused with discrete memory (single DDR2 memory IC) rather than DIMM module which consists of many such discrete ICs. I understand that double data rate means the data is clocked on both rising and falling edges of the clock signal. So, for example, if a 16-bit wide bus DDR2 memory IC is interfaced to a microcontroller (with built-in memory controller) at a clock speed of 200MHz (i.e. clock output from the memory controller to DDR2 is 200MHz), how would one calculate the data rate? As per my understanding, 16-bit bus has 16 data lines, and two data bits are transferred per clock cycle for one data line (for double data rate), meaning effective data rate would be: [No. of data lines (16, bits) x Data bits transferred per data line per clock cycle (2, bits) x Clock rate (200, MHz)] / 8 = 800 MB/s. (Of course, I am talking of theoretical calculations only.) Have I got it wrong? I would really appreciate it if someone could please clear my confusions. Thank you. AI: You have it right. This is the "raw" or "peak" transfer rate that you get within a single burst of data. The actual long-term throughput will be somewhat less because of the overhead associated with starting and stopping bursts. However, if the memory controller is smart about interleaving operations on different "banks" within the memory chip, it is possible to get sustained throughput that's very close to the peak value. With multi-chip memory modules, you simply multiply the numbers for a single chip by the number of chips, since they simply operate in parallel.
H: Timing diagram of circuit involving switch debouncing I have a push button switch (single-pole double throw) connected to a latch as follows: I was thinking about the timing diagram of the circuit above (above image is the default state of the circuit when the switch hasn't been pressed down). Would this timing diagram sufficiently describe the output given the signals below? I would just like clarification of my diagram before I implement this circuit on a breadboard as an example of switch debouncing. P is basically Q. AI: Your diagram is mostly right. The only minor thing I'd look into is whether the switch is break-before-make or not. It probably is, and that's what you want. In that case, the previously low input will go high a little before the new one goes low. If this is not the case, then you can get some of the bouncing coming thru on one of the transitions.
H: Opto-coupler base connection speed influence I am using a 4N25 opto-coupler for 5kHz to 10kHz application. In some datasheets the turn on and turn off times are mentioned to be 3us. I am wondering if this opto-coupler is suitable for my circuit's frequency. Doesn't it much distort the output which is supposed to turn on gate of a power Mosfet? In a SE question, in the accepted answer, it is mentioned that connecting base to emitter via a resistor such as 220k or 470k can increase speed of switching. Does it mean that t_on and t_off decrease by connection via R_BE ? and how much can I expect to improve speed by that? AI: No it's rather unsuitable. The 2us given on the datasheet is with a load of 100\$\Omega\$- which is a totally unrealistic load when used in a simple circuit. If you allow a CTR of 10% (half the minimum when brand new) and put 10mA through the LED, you'll have 1mA at the phototransistor. A load of 10K would be reasonable, so delays will be in the tens of microseconds. See this datasheet. It's not quite as bad as being proportional to the load resistance, but well in that direction, so the 100 ohms condition on the datasheet could, at best, lead to a bad conclusion. You could put a complex circuit around the phototransistor and get down to the datasheet numbers (which are not ouright lies, just misleading) and the base resistor you suggest will further reduce the numbers somewhat (at the expense of CTR, so a simple circuit does not benefit). I suggest you use a logic-output optoisolator such as the 6N137 or similar. They use a photodiode internally with a sensitive and fast circuit, which is a much more suitable method for high speed. Optoisolators with phototransistor (or photodarlington) output generally should be avoided where speed is of much importance.
H: Measure human voice for ambient noise level I need to develop an ambient noise level to measure the loduness in an office. Sometimes during the day people raise their voice more than they should and a lot of confusion is created. So this device should be installed somewhere, like on the table or on the roof, and it should light up an LED when the noise is too high. I thought of doing it in this way: -Connect the electret to a band-pass filter to isolate only the human voice, which has to be analyzed -Connect the output of the filter to an operational amplifier (is a x100 amp enought?) -Connect the output of the amplifier to a microcontroller (like arduino) and read the voice level. Should that work? I am expecting to read a value from 0 to 1024 from the microcontroller, is that possible? Thank you very much! AI: The spectrum of the human speaking voice lies roughly in the band between 300 and 3000 Hz, so to make sure your widget responds primarily to that band you'll need a bandpass filter somewhere downstream from the electret mic, as you noted. After that, instead of anything digital, I'd simply use a 555 in monostable mode with its TRIGGER input AC coupled to the filtered audio source and the gain of the audio source set so that when someone in the room spoke too loudly it'd trigger the 555. Using a pot to vary the output level of the audio source would allow the trigger amplitude to be set by having someone at the limit of the detection range talk loudly while the pot was being adjusted by someone else, the correct setting being found when the LED lighted. Then when the LED lighted, it'd stay ON for the length of time determined by the time constant of the 555's external RC, then turn OFF and stay off until the next time somebody yelled, starting the cycle anew. Alternatively, the trigger level of a voltage comparator could be adjusted, as shown below, by changing the ratio of the resistors in the reference divider, R3R4, which could just as easily be a pot to make the adjustment easy in situ. Here's the schematic: V2, V3, and V4 simulate a flat electret output from 300Hz to 3kHz, with a 6dB spike at 1350Hz reperesenting the loud sound signal into the electret. C3, R6, R5, R8, and C5 comprise a crude bandpass filter to provide some selectivity at the - input of U3, an opamp being used as a voltage comparator with its switch point determined by R3 and R4. In operation, when the signal on U3- goes higher than the reference voltage on U3+, U3's output will go low, triggering U1 and generating a pulse with a width of about 1.1R1C1 and an amplitude of about 11 volts into R7 and the LED. here's the plot: You can see the output of the 555 going high and lasting for about 1 second when the small perturbation on U3- causes it to generate a low-going trigger for the 555. Finally, here are the files you'll need to run the LTspice simulation if you want to. Download both files into the same folder and then left click on the .asc file to bring up the schematic editor. Schematic 555
H: Events in FreeRTOS 7.1.1 I'm looking for method how to inform one task in firmware about change somewhere else (Using FreeRTOS 7.1.1). I need to receive information about changes, but I wouldn't want check value in cycle - something like interrupts, but coming internal. For example (in C-like pseudocode) void task1(int change1) { int value1 = change1; } void task2(int change2) { int value2 = change2; } void task3(int change3) { int value3 = change3; } void taskCheck() { doSomething(); } And when any value in any task is changed, taskCheck() is activated. I thought about queues, but I prefered to ask first if there is no better solution. P.S. There is no Event Bits and Event Group in FreeRTOS 7.1.1 AI: You can use a semaphore to signal an event. If the event is generic to taskCheck and there is no data associated with the event then you might do it something like this. void task1(int change1) { int value1 = change1; xSemaphoreGive(the_semaphore); } void task2(int change2) { int value2 = change2; xSemaphoreGive(the_semaphore); } void task3(int change3) { int value3 = change3; xSemaphoreGive(the_semaphore); } void taskCheck() { xSemaphoreTake(the_semaphore, WAIT_FOREVER); doSomething(); } If the_semaphore is a counting semaphore then multiple events could stack up while taskCheck handles them one at a time. But if the events are specific or contain data then you probably want to use a queue instead of a semaphore. Read about FreeRTOS queues and semaphores here.
H: Impedance Matching a switching Circuit I'm trying to mathematically model a Class E amplifier in the hopes of deriving a relationship between the input and output (Transfer Function). One particular difficulty i'm facing is impedance matching the load to the rest of the circuit. The regular procedure would be to obtain the thevenin equivalent at the load, and the load impedance would simply be the complex conjugate of this. However in this circuit we have a switch with an inductor before it. Therefore the thevenin equivalent would vary between the ON and OFF states of the switch. Question: How would you determine the thevenin equivalent, in the presence of a switching circuit? I just need a starting point. How do you normally proceed in such cases? simulate this circuit – Schematic created using CircuitLab AI: You would normally deal with this as a State Space Averaged Model. By the State Space Averaging method you write the state space equations for i) switch open; ii) switch closed; and then average those with the duty ratio of the switch as weighting variable. Then you can proceed to develop AC and DC models. Here's a reference. Or here (from slide 57).
H: What type of wire should I use to connect my buttons/sensors from 3 feet away? So I've got a little prototype using some buttons and pressure sensors plugged right into the breadboard. My next step is that I actually put the buttons and sensors where I want them, but they're going to be about 3 feet away from the breadboard. Should I just use standard 22 AWG hookup wire cut to length? AI: Adding a length of wire to each device will increase their resistance, but generally no more than 20 ohms or so depending on the gauge of the wire. For a button using the internal pullup the overall resistance must be less than \${{20\text{k}\Omega⋅0.3}\over{0.7}} \approx 8.5\text{k}\Omega\$ or so in order to reliably register a low. Adding 6 feet of wire (3 feet towards, 3 feet back) is unlikely to cause the resistance to increase that much. The pressure sensor is a variable resistance device however, and as such may require recalibration when connected to the wires if the actual value is used rather than just using it for presence sensing. Also note that longer wires pick up RF more easily, so you should consider twisting the pairs connected to the device (or using twisted-pair wire in the first place) and using ferrite beads/toroids and/or common-mode chokes to suppress the disturbance caused by the RF, especially in an electrically noisy environment..
H: What does 'W/DIO' mean when used for MOSFET descriptions? For example on Farnell: VISHAY SILICONIX SIHP18N50C-E3 MOSFET,N CH,W DIO,500V,18A,TO220AB I've googled it in various forms but all it returns is other listings for MOSFETs with that in the title. I also checked through a load of data sheets but couldn't see what it was referring to. Thanks AI: That appears to be a description that Farnell generated. The description for that part at Digikey, for example, is just "MOSFET N-CH 500V 18A TO220", and at Mouser it's "MOSFET 560V 18A 223W 270mohm @ 10V". I can only speculate about what Farnell intended, but maybe they meant "with diode". This is kind of a silly thing to add to the description, because this part doesn't have any integrated diode except for the body diode that all MOSFETs have between drain and source. The part's datasheet does contain some characteristic specs for the properties of the body diode, which might make it useful in some applications where you're actually going to use the body diode to carry current. It might make sense to describe a MOSFET as "with diode" if it had, for example, an integrated ESD protection diode between gate and source.
H: Alternatives to Arduino for controlling LED's and Audio files? Simple Alternatives to Arduino Has anyone used these different boards? If so, what did you use them for and why? Which are appropriate for controlling LED's and playing audio files? I'm looking for something basic and cheap that can be permanantly installed in a project. Alternatives: TI LaunchPad MSP430 PICAXE Tinyduino Ardweeny AVR Butterfly Build your own - AVR chip (ATMega328) + programmer & 6-pin header Other suggestions? Project Requirements Need: Play different audio files at specific times (every hour and half hour). The audio files would be set, play automatically, and never change. Light up/flash LEDs based on a timed loop. One section of LEDs are lit for 1 hour, then those turn off and a different section of LEDs light up for an hour. Sections would cycle through every 12 hours Don't Need: wired interent connection wireless internet bluetooth IR remotes sensors Background Info I know there are lots of clones and different versions. I have zero direct experience with any of them. Arduino seems like what you would use to build and test prototypes, then use it to design and test something esle. I'm looking for something fairly simple that I use once and then permanently put in a project. I don't need (or want to pay for) all the bells and whistles. Edit: Link to previous question describing project as suggested Best way to sync LED's to light NES figures on a wall clock? AI: As Passerby said, any of them will work for sure for blinking LEDs. If you decide to go the MSP430 route, make sure you pick the variant that can do the math required (for example, if you want to do some fancy filters on your audio, get one capable of floating point math...). MSP430 is fairly easy to program, and the Code Composer IDE is Eclipse-based, and relatively bug-free. I would add an STM32 Discovery board to your list of possibilities. They have ARM cores, run at higher frequencies (if you want to do more math, or something), and are relatively inexpensive ($12-$20 for a fully functional board with a built-in programmer). It might be a bit of an overkill for the application, but it leaves some possibilities open as well. You can develop code for these boards in Eclipse using a plug-in - it works well (I've been using these for a few months). There are lots of code examples available (by STM) for peripherals and functionalities you might be interested in.
H: Eagle software: Different grounds in the same circuit I'm designing an Arduino shield to manage the control signal that reaches 4 CCFL inverters. As part of the circuit design, I've decided to use optocouplers to isolate the Arduino's microcontroller from the rest of the circuit. If I'm right, in order to get the proper galvanic isolation I need to separate on one hand the Arduino's GND and on the other hand the power supply's AGND which feeds the part of the circuit (through 7806) aimed to generate that specific control signal. Am using Eagle CAD software and I've used different GND symbols to separate the different grounds coexisting in my circuit, but when switching to PCB design all of them seem to be together joined in the same net. These situation makes me wonder several questions: • Am I right when I'm trying to separate grounds in order to get galvanic isolation?. • I've found this post that seems to talk about a similar question: How do I facilitate keeping multiple grounds, (i.e. AGND, DGND, etc...) separated in the layout when using Eagle? but I'm not sure if the solution proposed really fixes my problem, because if I understood correctly they end up joining GNDs in one point to have a global ground reference. • If I am right, which is the best way to manage different GNDs in the same circuit in Eagle schematic design? Here it is the schematic I'm working on: Thanks for your help! AI: Your assumption in the second bullet point is correct: that answer does not apply to your situation. The linked question is discussing separate but electrically equal analog and digital ground planes, which is a technique used to reduce electrical noise, not to provide galvanic isolation. To answer your more general question, you should either use multiple different symbols (you may be able to rename the net for the 'gnd' symbol in Eagle to create different nets; it's a while since I used Eagle), or use named nets for your separate grounds. Your schematic as shown won't work as intended, however. The isolated side of your optoisolators is powered from a power supply that's (presumably) referenced to the ground of the Arduino side of the circuit. If you want each of the four circuits to be isolated from each other as well as from the Arduino, you will need a separate power supply for each, and four grounds (plus the Arduino's ground). If you only want to have isolation between the CCFL and Arduino sections of the circuit, you will need a single isolated power supply for the CCFL side - and a single ground in addition to the Arduino's ground. In every case, remember that you can only use power supplies and signals referenced to the same ground as that part of your circuit.
H: Regarding the forces created in magnetic field This is a homework question of type multiple choices , question and 5 choices are given below. And a screenshot of the set up is given below. These are the things I know Forces are acting all the four sides of the frame due to the magnetic field and the current I could take the value of current by using Ohms law, and the value of it is 4A. Therefore I can calculate the force acting on side AB. I found the direction of force acting on AB as the perpendicular direction to which the magnetic field is directed, and I calculate the magnitude of it which is shown below So these are the things that I found in this question. The correct answer fot this question is 2. But how it can be? Initially I choose the answer 5 which is incorrect. why I am wrong here? what's going on this set-up to decrease it's weight?I can't figure out why my answer is wrong , so that's why I ask this question here in this great website. AI: Because of the orientation of the symbol of the battery... ..we can tell that the current is flowing from A to B... Using the right hand rule, this means that force on the wire is down... If the force on the wire is down, the the corresponding force on the magnet must be up - counteracting gravity and lifting it and making it look lighter to the scale. So that should explain why you ended up with the wrong sign. The current in the wire is... current = voltage / resistance current = 40 volts / 10 ohms current = 4 amps The force on the wire is... force = current * length * magnetic field force = (4 amps) * (5 cm) * (1 tesla) force = 200mN (millinewtons) While a scale measures force (newtons), it displays grams (units of mass). It makes the conversion by assuming that the scale is on earth and the mass is bring accelerated by gravity. force = mass * acceleration The acceleration of gravity is the gravitational constant, usually written as "g" and has a value of approximately 6.673×10−11 Newtons ( meters / kilograms)^2. If you put a 1 gram weight on a scale and the display reads "1 gram", that means that there is a force pushing down on the top of the scale of... F = (1 gram) * g F = 9.807 mN (millinewtons) In the experiment above, the current in the wire created a force of 200 millinewtons. To find the weight that a scale would read when a force of 200 millinewtons is applied to it... force = mass * acceleration mass = force / acceleration mass = (200 millinewtons) / (g) mass = 20.39 grams (Because of the configuration of the experiment, this force would be up and therefore subtracted from the initial reading on the scale.) The scale in the picture does not have a decimal point, so they probably expect you to round that 20.39 grams to 20 grams, but I think this is not a great answer since the scale could be different by 21 grams if the initial weight had been rounded down for display. For example, if the magnet initially weighed 30.5 grams, the scale would round that up and show 31 grams on the display. If you then turned on the switch, the upward force created by the magnetic field would make the magnet seem to weigh 30.5-20.39 = 10.11. The scale would round the 10.11 down to 10. In this case, the reading of the electronic balance would have decreased by 31-10 = 21 grams, which is not one of the choices given. You should ask for your money back! :)
H: How many clock cycles does a RISC/CISC instruction take to execute? According to Digital Design and Computer Architecture by Harris and Harris, there are several ways to implement a MIPS processor, including the following: The single-cycle microarchitecture executes an entire instruction in one cycle. (...) The multicycle microarchitecture executes instructions in a series of shorter cycles. (...) The pipelined microarchitecture applies pipelining to the single-cycle microarchitecture. Architectures are often classified as either RISC or CISC. From RISC vs. CISC: RISC processors only use simple instructions that can be executed within one clock cycle. Since MIPS is RISC architecture, I am a litte confused by the above definitions and wonder if there isn't some sort of contradiction between them. More specifically: If a RISC instruction can be split into shorter cycles (Fetch, Decode, ...), how can we say that it only takes one clock cycle to execute the whole instruction? Doesn't it take one clock cycle to execute each of the steps? Does it really take one clock cycle to execute one RISC instruction? What happens, for example, if a cache miss occurs and the processor has to wait for slow DRAM? Shouldn't this prolong the execution of the instruction by quite a bit? What exactly is one instruction cycle? Is it the time that it takes for one instruction to finish (i.e. one/multiple clock cycles)? How long does one CISC instruction take in clock/instruction cycles? AI: The practical definitions of RISC and CISC are so muddied and blurred now they are almost meaningless. Now it is best to think of them as more about "philosophy", in the sense that a CISC architecture has a richer instruction set with more powerful individual instructions (e.g. DIV and the like) while a RISC instruction set is bare bones and fast, and leaves it to the compiler to implement complex operations. Even purportedly CISC instruction sets (like x86) are translated into internal instructions in both Intel and AMD chips and implemented more like RISC processors. To answer your questions: The original academic RISC processors (and I think maybe the very first commercial versions) did indeed execute one instruction per cycle, including fetch and decode. This was possible because the datapaths were super clean because the operations of each stage were simple and well defined. (the tradeoff here is only very simple instructions can be implemented this way). Once it hit the real world things got blurred. Things like pipelining and superscalar architecture make a simple RISC/CISC dichotomy impossible. The original RISC chips attempted to execute one instruction per cycle and they could if the data was available in the register file. Of course if the processor had to go to DRAM it would take a (lot) longer. RISC is about "attempting" to execute an instruction per cycle. One instruction cycle is the time it takes between fetches. In depends enormously on the instruction and the instruction set architecture. Even in a CISC architecture some instructions could execute very quickly (like a shift left or right for example). Some executed very slowly (10s of cycles or more). The VAX architecture (probably the pinnacle of the CISC philosophy) had instructions that were really complex. Incidentally, a CISC architecture is usually easier to program in assembly than a RISC architecture because it is almost like a high-level language!
H: How does the Bias Drive in TI ADS1299 help in noise reduction? I'm bit of a noob in electronics so please pardon me if this question is too basic. I would like to clearly understand how the signal from the bias drive electrode can help in noise reduction, reducing baseline drift and other artifacts. As a user puts it in this forum page "This BIAS drive signal drives the patient with an inverted common-mode signal that can help reduce noise and 50/60Hz interference." I'm not able to understand the above statement on how the inverted common-mode signal can help in noise reduction. If some can explain the intricacies behind this concept, that would be great! AI: The body acts as an antenna for 50Hz or 60Hz radiation. This can mess up low level signals and make it difficult to read out the ECG information. A bias drive (also called Driven Right Leg) takes a copy of the 50Hz or 60Hz radiation and drives the leg with a scaled, inverted version, effectively canceling it out. So, with a bias drive, the 50Hz or 60Hz interference appears both on signal and common, so you take the difference and it is canceled.
H: For a 'customized' arduino consuming less energy making use of Attiny85 vs PCB Fabrication? Currently I am working on a prototype project where I try to move a servo (6V) according to the level of light that is recognized by a photodiode making use of the ISR function. A torch light is used as the source of light. First, I have built this project successfully making use of an arduino uno. After that in order to reduce the energy consumption I have made an Arduino on a breadboard making use of an atmega328 microcontroller adding sleep function using the jeeLib library. It worked well. Now I want to go to the next step with this project to design the prototype into a functional tool/device. I was planning to customize an arduino and solder the servo (6V), photodiode etc. I have researched to on this topic and read carefully the following link (How to go from newbie to manufactured?) and learned that creating a customized arduino might emerge to be an exhausting task; especially for a newbie to electronics like me. At the same I am wondering whether there is a way to skip going through a PCB Fabrication. Now I came to learn that I might use an attiny 85 using a perfboard that can be used to program a servo and ISR function as well. Attiny 85 also consumes less energy. Given the fact that I 'only' need to control a servo (6V) depending on the voltage going through a photodiode I do think that an attiny85 microcontroller might be a decent way to realize my project with less effort. I am aware of the little EEPROM and Flash size. However as already once in a discussion ( My Atmega328 seems to be overkill, what should I use instead?) apparently not all program that work with arduino uno will work with attiny 85. Can you tell me whether there is a way for me to skip working with a pcb manufacturer to finalize my project? Is using an attiny 85 microcontroller a good alternative for my project? AI: An attiny will be fine for a single servo and adc sensor with the Arduino firmware. The things an attiny can't do that an atmega can has to do mostly with code space and amount of timers or interrupts. Your project is very small and not affected by this limitation. As for developing a custom Arduino pcb, it's not that complicated. An Arduino is essentially just a breakout board for the microcontroller, with a regulator and usb to serial circuit attached, neither which are 100% required to be on board. Look at various bare bones Arduino which are no more than the microcontroller and a few passives.
H: AC alternative for DC diode short-circuit protection I have two sensors (represented in the schematic below by a switch) connected to a light. If one of the sensors trips, I would like the light to switch on. The sensors and light are directly on AC, and there is where my problem is. In the DC alternative (on the right), I would put diodes behind my switches to prevent a short circuit when two switches are on at the same time. But on AC, diodes won't work. So how do I prevent a short circuit when two switches are on at the same time in an AC setup like on the left? Cheers, Dolf. AI: If the switches are directly in parallel as shown in the left drawing, there is no problem of a short circuit, as both switches are connecting the same two points together. If the switches were supplied by separate power sources, there would be a problem. That could be solved by having one switch operate a relay, with the relay's contacts in parallel with the second switch.
H: Can I use an analogue switch with separate circuits? I am planning on using 74HCT4066N analogue switch (datasheet) to trigger button presses on two separate gamepads at the same time. The circuit I plan looks something like this: Can I use this analogue switch to control completely separate circuits? The problem, I suspect, is that these circuits each run off a separate ground, so I can't know what their voltage might end up being relative to the AA battery's ground. Is this a problem? If I can't use this type of analogue switch for this purpose, then what should I be using to press both buttons at the same time? Thanks, Allen EDIT: Here is the circuit updated with DrFriedParts's suggestion of connecting the grounds... Please let me know if I got anything wrong here... AI: You need a common reference... Your suspicion is correct, but you can fix it... just connect all the grounds together. You may actually not need that complicated of a circuit. If you test the buttons in the controller(s), you will likely find that one side of the button-switch is already connected to ground. So all you have to do is short out the other side to ground and you are done. Make sure that you are not driving the button when you do not intend to "press" it as this will create electrical contention and damage your output circuit. In summary... Connect the three grounds. Determine if the controller buttons are grounded. Connect your analog switch (or microcontroller GPIO output through a big resistor) to the other side of the button. Ensure that you are switching from High-Z (GPIO in "input" mode) to Output Low (ground).
H: How many 115ah wet lead acid batteries are safe to charge in the same space? We are using about 10 115ah wet lead acid batteries to provide electricity for our business in the field. At night, we charge them all in the same space. The space does have a bit of airflow, but it's not like we are leaving a window open. Is charging this many batteries together in close proximity safe? I am asking due to the gases that are given off by them all while charging. Thank you for your help! AI: Is it an enclosed space? Of what size? How much is "a bit of airflow?" Is there a vent or two? How big? Lead-acid cells give off hydrogen gas when charging, which can be very explosive and even dangerous to breathe. Is there anything nearby which could spark and ignite it? (Light switch, faulty wire, sparks from grinder, etc.) They also get warm, so need some convective airflow to stay cool. Excessive heat shortens their usable service life greatly. Essentially, if these are all crammed into a tiny space with no ventilation, then it's asking for trouble. Like this: https://www.youtube.com/watch?v=d_TnsHu2u4c
H: Protecting I2C bus with diodes I'm trying to add some protection to an I2C bus, and keep getting an unexpected result. simulate this circuit – Schematic created using CircuitLab In principle, I'd expect this to clamp the signal (which I simulate with a sine wave and a small resistor) to between -0.6 to 5.6V. In the simulation, this looks good, but in reality (using LSM115JE3 diodes), the bus signal cannot reach above 3.6V -- which coincidentally is \$5V - (2 \times 0.7V)\$. Any idea what might cause such an effect? AI: Looking at the datasheet datasheet, it seems like those diodes can have a significant reverse current -- up to several milliamps at 5V if they're warm. They also have a nontrival junction capacitance, on the order of 100 pF. The main question is whether this is an AC problem or a DC problem. If the DC level is correctly pulled up to 5V but the rise times are too slow during transmission, try using stiffer pull-ups, no more than 1000 ohms. (You do have pull-up resistors, right? You need pull-ups for I2C.) If the DC level is stuck at 3.6V, try measuring the diode current with a multimeter to make sure they're not broken. You could also try removing the 100 ohm resistor.
H: Current, Voltage, and Power Sensing for 115 V AC Circuits I am trying to sense voltage, current, and power with an Arduino (Due) for monitoring and diagnostic applications. To get reasonably good input (better than Kill-A-Watt), I have designed an AC sensing front-end for the Arduino. As this is my first design, I ask the community to have a look and to tell me if the whole thing makes any sense and if it would work. If the whole thing makes sense and works, I will put it on my blog so other people can use the idea. So here is how the attached schematic works: For voltage. TR1 isolates the device from AC and decreases voltage to 6.3 V RMS. This is divided by R7 and R8 and the signal is buffered by IC2A, shifted by R2 and R1 and fed to the Sample and Hold amplifier SMP04, and then to the ADC. For current, I use the LEM LTSR15-NP Hall effect transducer. Signal is again divided (maybe there is no need), buffered, and shifted and send to the S&H IC. For power I use the analog multiplier AD835 whose output goes to the S&H IC. The S&H signal is going to be generated by the Arduino. Version 2: Thanks for solving my bugs. Here is my second attempt: Version 3: In version 2 I fixed the current handling as taught and then did something stupid with the voltage signal processing circuit. This is now version 3 where I have followed the advice of Techdude: AI: Bunch of problems here. You can't operate the LTSR15-NP like that - its 0V supply pin needs to be @ Ground potential to power its internals properly. Its output Vout is already at its Vref for 0-current, 2.5V +/-0.025V, so there's no need to do any shifting here. So IC1A & its C2/R5/R6 is not needed*. LTSR15-NP also provides its Vref as an output, and you'd be well advised to use that as your system-wide Vref, all the way into the Arduino's Vref input pin. Let that be your reference voltage, because this is better than using the default 5V 'Vcc' suppy rail as your reference for analog measurements (because it changes, you'll get poor accuracy & even crappier long term repeatability). The LTSR15-NP's Vout should therefore be voltage-divided 2:1 (e.g. R3=R4=10k) so that 0-amps = 1.25V, & full scale +ve = 2.5V, & full scale -ve = 0V. IC2A is not acting as a buffer, merely as a level shifter to get your "0-volt crossing point" to be at half-Vcc. Again I'd instead use LTSR15-NP's Vref output into this level-shifter [edit:] through a 2:1 Vdivider, another pair of 10k, so that the 0-volt AC crossing point will be at 1.25V. Then i'd reuse the IC1A as an actual buffer in voltage-follower arrangement. Then redo your R7/R8 calculations so that 150Vac (assuming you're on a 110/120Vac mains system) on TR1 primary results in no more than [edit:] 2.5Vpp, preferably a bit less. Then put some Schottky diodes on the R7/R8 divider node (before the Vfollower op-amp input) up to Vcc & down to Ground (i.e. both normally reverse-biased) to clamp spikes. Also, you're only interested in 50/60Hz, so you'll want to filter out higher frequencies as much as possible (sampling theory, Nyquist etc), otherwise that noise (inherent in AC power distribution) is not only going to affect your measurements directly, but the noise above your sampling freq. will also fold back into your sampling frequency range of interest. Add caps on those two voltage-divider nodes with appropriately calculated RC timeconstants to start rolling off at, say, 100-200Hz. Do your resistor power calculations here! Put 100nF (0.1uF) ceramic caps ('decoupling caps') across the power supply pins of all your chips [edit: and on the LTSR15-NP's Vref output]. I'm guessing (hoping) that IEC mains connector symbol is just a place-holder for your external wiring that puts the load in series with this, otherwise you'll only be measing the current/power of your own TR1 :). Also, "as an exercise for the student", it might be interesting to do the V & I multiplication yourself in Arduino code, & compare it to the AD835's output :) And all the applicable warnings for working with mains voltages apply - this is really dangerous stuff. If you've not done it before seek out help from someone who does. I'd strongly recommend working on this during the development phase with an Earth Leakage Circuit Breaker between you and the mains wall socket. Add a fuse. Always insulate all mains wiring so human contact is impossible or at least unlikely.
H: How to position adjacent transformers so they don't interfere? Using a couple of 240V mains step down transformers, undecided whether to use E/I laminated or toroidal, one 22VA the other 7VA. How to mount them in the case, so that they're not affected by each others magnetic fields? This is unless I can find one ready made with separate secondaries of 22-0-22 and 7-0-7. AI: Toroids have very little magnetic leakage, so if you can find two of those, that would be ideal. There are many toroidal transformers for sale on eBay, give that a try. E-I laminants are pretty good also. Is this for a high-end audio amplifier? Magnetic flux dissipates inverse-square with distance, so even a few inches is good enough for most applications. If you can put them on opposite sides, even better. :)
H: Verilog Assignment I'm designing a Fahrenheit to Celsius converter using algorithmic state machines. I'm trying to get the following code to run, but all I get for output is 0. module FtoC(clk, F_input, C_output); input clk; input [8:0]F_input; output [6:0]C_output; reg [6:0] C_output = 0; reg [1:0] state =0; reg [8:0] A, R; always @ (posedge clk) case (state) 0: begin state <= 1; C_output <= 0; A <= F_input; R <= 0; end 1: begin state <=2; R <= ({(A - 32), 2'b00} + A); end 2: if (R>9) begin R <= R - 9; C_output <= C_output + 1; end // else state <= 0; endcase endmodule AI: First of all, you need to include your testbench, since it is just as important as your design, especially when things are not working as expected. Secondly, the R <= ({(A - 32), 2'b00} + A); line is wrong. Like alex.forencich already pointed out, you want (A-32)*5 = 5A-160, but are actually doing (A-32)*4+A = 5A-128, which is not the same. Instead, R <= ({A, 2'b00} + A) - 160; should work. For simple simulations, you can use the online simulator edaplayground.com. Here's a snapshot of your code (using edaplayground) with the correction and a testbench, showing the correct output value of C = 37 when the input is F = 100:
H: Output charger indications its a small question ...i got on my cell charger the indications as follow: input:100-240 V 50-60 Hz output: 5 V DC 1 A.... the question is what does the 1 A mean? i am new to circuits and etc..when plugging the cell then the current is created by the cell's total resistance and stuff so what does mean the 1 A mean in the charger indication? AI: It can imply a few things. The 5V output will be guaranteed to be within tolerance (maybe +/-10%) when drawing a current of 1A from the device. That's about all that can be said without disecting the circuit in detail. For instance, at lower (or no-load) currents the 5V output might rise a bit to 6V or even higher. I would imagine this would be the case for a cell-phone charger. Another example is the AC adapter for my yamaha piano - it says 12V on the side but off-load it's closer to 18V. You also might be able to extract a little more than 1A as well but the voltage will probably be dropping towards 4 volts. As I said before it's not guaranteed to mean much unless connected to the load it is intended.
H: Electrical spark generator I need a spark between two pins with 5mm gap. And I use this circuit: Things changeable: the characteristics of the transformer (ratio, coil windings, coil gap and ...). The type of the MOSFET. How to change these in a way that spark can heat the air between two pins up to 363°C? (minimum alcohol combustion temperature) I think the question is now clear and narrow. and I don't think it still deserves downvotes. AI: It appears you are attempting to ignite a fuel-air mixture in an enclosed space using an electrical spark. I wonder if there is an existing solution....... The schematic you made is a classic engine ignition circuit, but as you discovered it takes a fair bit of energy. We want our potato cannon to be portable so a bigger battery isn't practical. A much simpler solution is a piezo barbecue lighter. Push button -> spark at other end. No batteries required, you can get one for $10 anywhere that sells / services large gas barbecues.
H: PCB design for automotive fusebox? I am currently in the process of designing an automotive (motorsport related) fuse-box as a side project to my studies. I've not had much luck searching for fuse holders (20 position) however while searching I came across fuse holders for printed circuit boards. I'm wondering whether a PCB design would be out of the norm for a fuse-box? The advantage I see is that I can have it custom to the size I'd ideally want. Though I'm not to sure whether the same PCB can be used to house the relays (micro). I'd like to have one PCB which houses the relays, fuses and regulators my existing design AI: The problem with PCBs in this application is two fold: 1) protecting the board from moisture (copper oxidises in the present of moisture) and 2) The current carrying capacity of the copper traces on the PCB. The copper layer on most PCBs is very thin and won't carry many amps of current. You could make the traces wider but almost certainly you'd have to either lay down copper wire on top of the traces and cover them in solder, or add a layer of solder onto the tracers all over to add thickness to enable the copper to carry the current. Your best approach is to use fuse holders which have holes to mount them onto a flat surface and have screw fixings or solder tags for wires to be attached. The moisture problem can be dealt with, using potting compound to keep out any moisture, but first off you need to deal with the problem of the copper layer on the PCB not being able to handle the current.
H: Diode in parallel with resistor SE, I've used the SE:EE forum search and several search engines internet and haven't found a single question similar to mine. But I don't think that it's that complicated, I'm just having a hard time grasping what's going on. The output from pin 1 is a square wave signal with a peak of 14V. The Scope picture shows the reading at pin 5. Why is there a diode parallel to the resistor? What does it do? If I'm putting a square wave through this circuit, why is it coming back as saw tooth? I'm having a hard time visualizing when the diode opens, what happens to the rest of the circuit and why I'm getting the output at pin 5. AI: The diode is there to discharge the capacitor quickly. If the output of U3A is high the diode is reversed polarized, so you can ignore it then. Then C7 gets charged via R22 with a time constant of 4 ms. That means it takes about 20 ms to charge completely. If the output of U3A is low the diode conducts and discharges C7 very quickly, which you can see as the sharp falling edge on the scope.
H: Charging two batteries with one solar panel I have two batteries connected in series. However, I'm using it to separately get +12V supply and -12V supply. I have a 24V rated solar panel, and was wondering if it's possible to charge the two batteries while in operation. Would it be possible to to connect the two terminals of the solar panel to +12V and -12V terminals? Does it not matter if I'm using a common ground from the terminals? AI: You can charge two batteries together, you can charge them either in series or in parallel. Looks to me you'll be charging them in series because that's the way they'll be connected. But I'd suggest you use a proper charger circuit to do it. You haven't said what kind of batteries they are and that matters as to how they should be charged. The simplest charger I ever saw was a resistor connected to a NiCd battery! All that did was limit the current flowing into the battery so it charged up slowly. But not recommended! You need a way to detect when the battery is full and stop charging it (as overcharging damages the battery). The other issue you have got is your 24 volt panel. It will may only produce 24 volts when in maximum bright sunshine. If you've got a charger circuit that will use some volts, which generally means the output of the charger is going to be less than 24 volts, which means it probably won't be able to charge the battery fully. (As the battery charges up, typically the voltage increases. You've got 2x 12 volt battery, for a single battery (lead acid type), the terminal voltage can go up up higher than 12V, 12.5, 12.8, and the charger voltage will go up as higher as 13.8V in order to charge it. So chances are you are are not going to be able to charge a 24V battery (2x12v) fully with a 24 volt panel and a charging circuit, unless you start using sophisticated chargers, DC converters which can step up the voltage. And you might want to stick a diode in series with the panel and what it's feeding power to (the charger, the batteries), as you may find (depends on the panel) in low levels of sunlight, the batteries discharging back through the panel and draining them. Particularly true if you leave the batteries permanently connected to the panel. Look around for 24Volt solar charge controllers, see whether something like that might be suitable.
H: Solar Panel Charging with Arduino I built a solar panel charge controller from instructables with an easy to read schematic and for some reason my battery charges up to a certain point and then loses charge again. That leads me to ask a couple of questions given that i am very new to this. My Setup: 10W solar panel, 12v7A Lead Acid Battery, Arduino Nano and all components from above schematic except for the load at this point. More details on solar panel specs: Solar Panel 10W • Vmax P = 17.2V • Imax P = 0.57A • Voc = 21.6V • Isc = 0.83A • 396x348x25mm Before I connect my solar panel my panel's voltage sits around 20volts (with volt meter) but straight after I connect it to the circuit, the voltage drops. Is this because there is now current and that reduces the voltage? At a certain point (around 12.4 volts) my battery stops charging and actually starts losing voltage. Could this be because the current supplied from the solar panel is not enough to charge the battery? If not, any other ideas? Does it make sense that the Arduino, solar panel, batteries and output voltage ground are all connected together? At what voltage would I actually charge my batteries when in bulk charging mode (99% pwm)? Does it have to be more than the current voltage of the battery and by what margin? Thank you very much for the assistance and please bear with me, I am new to this. AI: It's common for a voltage source to drop in voltage when current is drawn. This is down to the source resistance inside the voltage source. When you measure the output voltage of the panel without it connected, then you a measuring the voltage of the panel without any current passing through its internal source resistance. When current flows, it passes through that source resitance and there is a voltage drop across it, so the output voltage now drops. How much the voltage drops when under load depends on how much current you are trying to draw and the internal source resistance of the panel. a) It could be natural and a function of the solar panel itself. b) You could be drawing too much current from the panel and the voltage drops greatly. Battery discharging: it could be that the battery is pushing power back into the panel. You can stop this by putting in series a suitable diode. You'd have to measure voltages and currents to work out what it is going on, measure the battery voltage with the panel disconnected at this point. An ammeter in series will tell you which way the current is flowing and hence which voltage is greater than the other and this will help you work out what is going on. Answer: Yes. I can't answer, I don't actually know what's defined by 'bulk charging'.
H: Creating an Integrated Circuit Component in Altium I am new to PCB designing and I am new to Altium. I want to make a schematic, PCB design and simulate a RF circuit involving a GPS receiver front end IC MAX2769. Altium library does not have this IC. I can create the component in library and also its layout for PCB. But for Signal Integrity simulation purposes I need to define what's inside of this IC package. How do I do that? Maxim does not provide a simulation model for this IC. Do I need to define all the individual components inside the IC package or is there any other way? I am in real need of support right now. Thank you very much. IC internal circuit is as below. AI: You will need to get the info from Maxim or use another IC if you really want to go that way. Yet I do not see how you will benefit from this. The only use-case for Altium's signal integrity part (which I have used in the past) is for transmission lines to determine proper signal termination. If you want to simulate the RF part, I guess you're probably better off with a different simulation tool.
H: Finding the gain with a photodiode How would I go about finding the gain of this circuit? Here's a link to the datasheet. Using our test apparatus to create a PWM on the diode, I get 1.16V out of pin 1. I can provide more information if needed. Thanks, Luke AI: The BP104 has a light sensitive area of 7.5 sq mm. If you look in the data sheet, an irradiance of 1mW per sq cm produces a current of about 33uA. The light power hitting the 7.5 sq mm can be calculated as simply: - Irradiance = 1mW per 100 sq mm therefore power hitting sensitive area (7.5 sq mm) is 75uW. So now we have 75uW producing 33uA into the TIA (trans impedance amplifier). The gain of the TIA at low to medium frequencies (ignoring the effect of C4) is 5.1Mohms. Therefore the gain of the circuit (volts out to light power in) = 5.1M * 33uA / 75uW = 2.244 volts per micro watt and this assumes the incident light is at 950nm or thereabouts. I'll also add that because the op-amp is a FET input type, the resistor R13 is not needed. Why is it there because it cannot possibly hope to counteract any leakage bias currents in the device.
H: Live switching AC loads with TRIACs or SSR I have been designing a system whose purpose is to provide high reliability to a set of outlets (8), it takes to inputs of diffrent phases mains current, now the purpose of the system is that if the input we currently are using dies (Goes permanently to 0v) we would switch to the second one without or with minimal power loss to the outlets (enough to maintain the device running), now electrical engineering is not my area of expertise (at least at this level) and i cant figure out how to do this, i have tought about using a TRIAC with a zero-cross circuit but i can't know how the outputs will be affected and if it will serve the purpose, could anyone give me an idea about if im going about this the right way or if there is a better way to do this. AI: If you really have to design it yourself (and not recommended), one approach you can use is relays, that would be safer and easier to get right. But relays will take a little time to switch so the output of the device when switching over will drop, now if the mains devices connected to it are things like laptops where they have power supplies with a fair amount of capacitance or batteries involved, these will tolerate a momentary loss of mains power for perhaps 100 miliseconds. If your output devices can't tolerate a momentary loss of power then don't go down this route. You need a sensor (or two) to detect the loss of mains input power, you can do this with a 240 volt relay (coil energised by 240 volts) and the relay contacts triggering a little circuit to give a logic level input into a microcontroller. So as the mains power fails you get a change in logic level to the microcontroller which you can detect in software and trigger the relays to switch power to the other mains input. Triacs: will give a faster switch over time and better in applications where the devices being powered can't tolerate a momentary loss of power, but triacs need more sophisticated circuitry to drive them: you have to apply pulses to the gate connection. And preferably those pulses need to be synchronised to the mains waveform when the signal crosses through zero (called zero voltage switching) so as to reduce the amount of radio frequency interference generated. It's all getting a bit messy. SSR - think you mean SCR - silicon controlled rectifier. These devices are only unidirectional, so not suitable in your application. If you can buy something off-the-shelf, I'd recommend that.
H: Current flow on Load (A) simulate this circuit – Schematic created using CircuitLab From my analysis, and applying circuit theory, I find that Load(A) will have current flowing equal to 0.1Amps due to the PS, and the induced V1&V2 cancel out, without the use of a diode. However, there cannot be any induced-current from the induced-voltage source correct? They cancel out before that happens? AI: This cannot be analysed because you have an anomaly where the two induced voltages (net effect zero volts) is placed across a voltage source of 10 volts. This will cause infinite current to flow and makes it non-analysable. Even if the two induced voltages were additive or anything that resulted in a net voltage other than 10V it produces infinite current. With a voltage source (as shown) across a 100 ohm resistor, this part of the circuit can be taken in isolation and the current will be 0.2 amps.
H: Three-phase Y and Delta Configurations Polarities Please take a moment to look at the three-phase Y and Delta configurations pictures below (The pictures are screenshots taken from the “All About Circuits” online book). The first picture (Y configuration) shows the neutral node with negative polarities for all phases and the outside nodes with positive polarities for all phases. The second picture (Delta configuration) shows opposing polarities between the consecutive phases (plus, minus, plus, minus, plus minus clockwise rotation). My questions revolve around the phase polarities as follows: 1) On the Y configuration, you can see that the author of the drawings labeled the neutral node with negative polarities for all phases. Given that AC voltage constantly changes polarities, why is he deliberately labeling the node with a fixed minus sing? The same goes for the outside nodes, why is he labeling them with fixed plus sings when those polarities are also constantly changing? 2) The other reason why all minuses and all plusses don’t make sense in my head has to do with phase shift. If all phases on a three-phase power are spaced 120 degrees apart from each other, there should be no way for all phases to have the same polarity at all times correct? In other words, it should be impossible for all phases to always be positive or always be negative. At one point in time or another, some will be positive and some will be negative correct? Anyway, I am pretty sure that I am totally missing the point of what the diagrams are trying to convey so I was hoping someone could help me get a clue. Thank you. AI: This has more to do with the windings inside the generators and connecting them correctly. Connect \$U_2\$, \$V_2\$ and \$W_2\$ together as a neutral. You get a 3-phase Wye connected generator. Connect \$W_2\$ to \$U_1\$, \$U_2\$ to \$V_1\$ and \$V_2\$ to \$W_1\$. You get a 3-phase Delta connected generator. Wired incorrectly and we do not get 3-phase generators. For the delta: If you do vector addition, you get: $$120∠0°V + 120∠-120°V + 120∠120°V = 0V$$ No current will flow in the delta winding because there is no potential. But reverse any phase and you get: $$120∠0°V + 120∠-120°V + 120∠-120°V = 240∠-60°V$$ Large voltage applied to small impedance of windings would mean large currents, creating an expensive fuse. Nothing to do with question but indirectly dealing with the misconception of the question. The concept of polarities in ac circuits. Some circuits put directions on currents or polarities on devices even though these reverse. It's primarily done to enable illustration for solutions. We do not know the context of the circuit without looking at where it came from. It's either that or we put bidirectional arrows on everything, which might add to confusion. Worse case they are right 50% of the time.
H: What is the relation between Op-Amp input current and input impedance? How should I interpret these specs? They can't both be correct all the time, right? Looking at for example the CA3140 opamp. the Zin (input impedance) is 1.5T Ohm, yet the input current is 10pA. Solving this for voltage (Ohm's law, 1,5e12 * 10e-12) gives 15 volt, so at that input voltage, both these specs are correct. But what happens when you give the opamp 100mV at its input? Do I calculate the input current according to the Zin or do I assume that it's 10pA? Assuming the opamp draws 10pA, the input impedance is now R = U / I = 0,1 / 10e-12 = 1e10 Ohm instead of 1.5e12. AI: Input resistance (1.5T\$\Omega\$ typical) is the change in input current for change in input voltage \$R_{in}\$ = \$\frac {\Delta V_{in}}{\Delta I_{in}}\$ It is not clear whether this figure is intended to apply to differential input voltage or to common mode voltage or both. Input current (10pA typical) is the current flowing into or out of the input pin. If the input was an ideal current source, the input current would be constant so the input impedance would be infinite. You can model the input (at DC) as a 1.5T ohm resistor to the other input (probably, given the disposition of the input protection diodes) and two +/-10pA current sources, one connected to each input. Some op-amps (the ancient CA3140 is not one of them) have a rather high input resistance when the two inputs are close to each other in voltage but nonlinear networks across the inputs that turns into k-ohms if you apply more than a diode drop differentially. Not a problem in normal op-amp applications, but problematic if you're using it in applications where it might saturate (precision comparator, some precision rectifier circuits etc.).
H: Using 1000x WS2811 leds and 5v 60amp Power supply. When do I need to re-inject power? I've been reading a lot about the WS2811 LEDs and how to properly set them up. I've purchased a few thousand of them off of Ebay for various projects because they're so easy to use. So far I've only used a series of 100. I've seen a lot about the need to re-inject power at certain points throughout the series. Most of these use-cases were using power supplies with low amps. Forgive me if this is a horribly naive question but if I have a 5v 60 amp power supply will I still need to re-inject to account for a voltage drop or will the higher amperage help maintain voltage? EDIT: Most of what I've read says re-injection will be required every 60 LEDs or so. I'm at 300 and I'm not seeing any noticeable difference at the end of the series? AI: Voltage droop is a result of cable resistance over large runs. Resistance adds up the longer and thinner the cable. And as your current load increases, the voltage you see at one end of the cable will decrease. Basic ohms law. In this case you will see the leds down the line look dimmer and dimmer until they stop lighting up at all. You reinject power every few meters because you want to bypass the resistance of the cable to offer a path of lower resistance and keep the leds looking even. Keep in mind the 60 leds or so statement is for basic 12V strips, not the smart 5V strips. Reinject power as you see fit (turn all the leds to full brightness white and eyeball it)
H: How to know exact Decoupling Capacitor values for supply voltages? When designing circuits using various components such as IC's a lot of the time the data sheets give you an example schematic where they will usually give you some values for decoupling Capacitors. I usually see a 0.1 uF cap in parallel with a 10 uF cap on the supply rail. Sometimes I see other variants where they have several 0.1 uF caps in parallel. How are they determining these values? AI: Short answer: They start with the standard (0.1 uF in parallel with 10 uF) and if they still have supply bounce issues they start experimenting until it works. Longer answer: The exact value of the decoupling capacitor isn't critical, typically, unless you already know something about the frequency components of the noise you expect to see. Typically, the smaller the capacitor, the higher the self-resonance frequency (the frequency at which the device stops acting like a capacitor and starts acting like an inductor due to internal phase shift). That is why datasheets typically show multiple devices in parallel. The 10 uF is to bypass lower frequencies while the smaller capacitor is effective at higher frequencies (and less effective at lower frequencies because it is smaller). When you bringing up a new chip on a test board, the product engineers where I work typically use a standard decoupling of 0.1 uF in parallel with 10 uF as you say. If that is good enough, then great, they're done. If there are still supply bounce issues then they will experiment (analysis and simulation is not super helpful here) until they get the noise under control. They do this by adding smaller caps very close to the chip or sometimes, like you saw, parallel 0.1 uF caps. This works because different 0.1 uF caps are different distances from the chip so they interact with the supply bounce in different ways (and at different frequencies).
H: Use of RC circuit in amplifier output stage I have to use a LM384 amp circuit (shown below) for a school project and need to explain how it works. I've read the datasheet (http://www.ti.com/lit/ds/symlink/lm384.pdf) and thus have a guess about some components but others remain a mystery. Vin potentiometer is only a voltage divider to adjust input voltage .1uF capacitor (above) is a decoupling capacitor to avoid noise in the power supply 5uF capacitor has the same purpose RC branch + 500uF capacitor : That is the question. I don't really get the purpose of this. Is the 500uF capacitor combined with 8 Ohm load just making a high pass filter with a cutting frequency of 1/(2*piRC) = 40 Hz ? Then what would be the point of this parallel RC branch? Any help appreciated, thanks a lot! AI: Let's look at the two things that you are asking about. 1) think about how the amplifier works. Many amplifiers use a bipolar power supply so that they can produce both positive and negative waveforms at the output. Your amplifier uses only a single positive power supply rail. So now think about what DC voltage is present at the output pin of the amplifier chip. Then think about why a large capacitor is needed in that spot. 2) That series RC network from the amplifier output to ground is called a "Zobel Network". Look it in Google.
H: The purpose of voltage-dividers in op-amp feedback? simulate this circuit – Schematic created using CircuitLab So, here we have a typical op-amp with negative feedback. The non-inverting input is at virtual-ground, and if the input is higher or lower than ground, the voltage is inverted, and fed back into the non-inverting input through the voltage divider until the non-inverting input is equal to the inverting input. But why do we need the voltage divider? The gain of the amplifier is essentially unlimited, so we're not really helping "cut-down" the output voltage to apply to our inputs incrementally. In fact, it seems that the voltage divider is actually dentrimental to the op-amps task. While it doesn't really help us tame the gain of the output, it does effectively (if slightly) reduce the input voltage. Thus, our inverting input has to be very specific, and equal to the dampened non-inverting terminal's input. For example, let's say that I want to make sure that the non-inverting input is at 5V. If I use a 1KΩ resistor at R2, use a 100Ω resistor at R1, and the input signal is 3V the input signal after R1's dampening will be around 2.75V. What are the resistors for? AI: There are a couple things that need to go with looking at how opamps work with negative feedback. Very high input impedance, so essentially no current flow into the terminals. The opamp will do all that it can do ensure that the inverting and non inverting terminals are at the same voltage. (V+ - V- = 0) Consider the following. simulate this circuit – Schematic created using CircuitLab This does not have any feedback. We have 1V on the non inverting terminal and the inverting terminal is grounded. The opamp, will do everything it can to make sure that the terminals are at the same potential. So the opamp is going to increase its voltage in the hopes that the negative terminal will balance out, so that the difference between the two terminals is zero. But, because there is no feedback, the opamp's "efforts" are in vain and the output just increases until you reach the limit of the opamp. It's trying, but nothing it does can bring the terminal voltages to be the same. simulate this circuit In this case, the opamp has feedback. So as the output voltage changes, the voltage at negative terminal changes. When a balance is found, the opamp maintains that voltage. If the input changes, the opamp will then find what the new balance is. All because it wants to make sure that the voltage at the terminals is 0V. (V+ - V- = 0) This is all great, but what if want gain ? Right now, the output will change so that it matches the input, and for a buffer, that's great but its not useful if you have a low voltage signal that you want to boost up to something more readable. And this is where feedback resistors come into play. simulate this circuit Remember the rules ? Opamp will do everything it can to make sure the inverting and non inverting terminals are the same. Let's see what happens now. We have a 1V signal. If the opamp outputs 1V, then the voltage seen at the inverting terminal is only 0.5V. But the opamp is not "happy" at this because it want's the difference to be 0. So it increases the voltage. When the opamp increases the voltage to 2V, then the inverting terminal sees 1V. The opamp is happy. So we fed in 1V, and we got 2V outs, this is a gain of 2. So feedback resistors are used to attenuate the voltage at at the inverting terminal from the output to trick the output terminal to produce a larger voltage.
H: Zener diode minimum and maximum current Why is the Iz max given before Iz min in this zener diode catalog? If you look at the list of diodes at the bottom, you can see that the maximum test current is given first. Is there something particular or it's just provided this way? AI: Test currents relate to impedances stated to the right of these figures. For instance, for the 1N5221 there are two test currents listed and these are 20 mA and 0.25 mA and these relate to the maximum dynamic impedances stated in columns to the right (30 ohms and 1200 ohms). Nothing perculiar about this at all. Those test currents ARE NOT \$I_{ZMAX}\$ or \$I_{ZMIN}\$. The test currents are \$I_{ZT1}\$ and \$I_{ZT2}\$: -
H: list of general purpose smd transistors, diodes and mosfets I want to start with building up a little stock of smd components. But i'm not sure where to start. Is there a list of general purpose smd Transistors, Diodes and (mos)fets? Thnx in advance AI: Also check out Seeedstudio's Open Parts Library: http://www.seeedstudio.com/wiki/Open_parts_library
H: What is the best way to serve AC power to a 12v - 5v DC regulator with 1Amp current? What transformer should I use to supply AC voltage in a circuit which is using 7812 and 7805 - Positive Voltage Regulators. I need approximately 1Amp current. What is the best way to minimize the physical volume of the supply? I shall be using an Arduino board from the 5v supply. Most importantly I need low physical volume of the transformer or related circuit to supply the AC voltage. AI: Given the specifications you've presented, you need a transformer with dual secondaries: one at 14 to 16 volts center-tapped for the 5 volt supply, and one with about 24 volts center-tapped for the 12 volt supply. You have not specified the 12 volt current you need. You cannot use a single secondary winding for both voltages. The rectified and filtered raw DC for the 12 volts must be a minimum of about 15 volts, to allow 3 volts across the 7812. This same 15 volts, when applied to the 7805, will dissipate 10 watts in the 7805 when supplying 1 amp, and I don't think you know how to build a proper heat sink to handle this. To find a transformer, go to the web sites of suppliers such as Allied Electronics, Digikey or Newark, and use their search functions. Specifically, look at Power Transformers, and make sure you have specified both the correct input voltage range and frequency. You appear to be in India, so you need 230V @ 50 Hz. As for transformer size, you take what you get. Transformer manufacturers are very tightly constrained by the magnetic properties of the core materials available, and if they could produce a smaller transformer for a given level of performance they would. After all, smaller is cheaper, so they could sell for less than their competitors and thereby sell more units, making a greater profit. I very strongly suspect that you don't want to do this at all. What will give you better results, and cost less in the long run, is to buy a switching power supply with both 5 volt and 12 volt outputs. Not only will it be cheaper, it will be smaller.
H: Using just one output of a J-K flip-flop If I am using a J-K flip-flop, but only need one of the outputs, what should I do with the other? Leave it disconnected, or tie it high/low (via a resistor?) Why? AI: If it is an output, simply leave it unconnected. If you try to connect it to a power rail directly, it will just short out the supply when the flip flop output is driving to the opposite rail. If you connect via a resistor, it will just waste power - there will be a voltage drop across the resistor when the output is opposite from the resistor's bias supply rail.
H: 7-segment blue LED display at 3.3V I'm driving a blue 7-segment LED display with a TI CD4026BE on a 3.3V circuit. I cannot find any data sheet for the display part. It has a common cathode pin layout and it's marked FJ5161AB on the side and D5611 A/B on the bottom. At first I tried putting some conservative resistor values, but then I noticed that the formula would give a Vf (LED drop) pretty close to Vcc. So I tried connecting the LEDs directly to the chip's outputs (3.28V) and the current consumption is 0.67mA per LED. I know that blue LEDs can drop up to 3.3V. Is this current value low enough that I can get away with no series resistors? Here's a couple pictures: AI: A reasonable guess would be that you'll be fine if the LEDs appear bright enough to you. 4000-series CMOS is capable of very little current with a 3.3V supply, so the output transistors are acting like current sources/sinks. Typical is only 1mA at 5V supply. Of course if you're using 74HC4000 series rather than the datasheet you linked, the situation would be a bit different.
H: Why does POT cause current to divert? I have a pretty basic question. I put this little thing together but I don't understand why the POT is causing this result. When powered, if the POT isn't fully open. LED 1 is bright and LED 2 is dim. When POT is fully open LED 2 becomes VERY bright and LED 1 dims slightly. Shouldn't they have equal brightness if the POT is fully open? My guess is that it's happening because that they are splitting the current. AI: Almost certainly, the two LEDs are not perfectly matched. For the same current (and brightness) level, LED1 has a greater voltage drop than LED2. Additionally, you are using confusing terms - what you call "open" on the pot is actually what everybody else calls "shorted", that is the resistance is almost zero. Just for illustration purposes, let's say that LED1 will operate well at 2 volts, while LED2 will shine at 1.5 volts. So, at first most of the current is flowing through LED1, and it produces 2 volts. At the same time, LED 2 is being driven by LED1's 2 volts through the pot, to the nominal 1.5 volts. The pot is in the high-resistance position, so not a lot of current gets to LED 2. As a result, LED1 is bright and LED2 is dim. Now turn the pot to what you call "open", which is the low-resistance setting. Now LED2 is hogging most of the current, since it operates at 1.5 volts, and this is not really enough to light up LED1. The result is that LED2 is bright and LED1 is dim. If the two LEDs were identical, when the pot was set to "open", the two LEDs would be of equal brightness. But they're not.
H: How can the SparkFun Lipo USB charger power other devices at the same time as charging? How is this SparkFun charger capable of charging a LiPo at the same time as powering other devices? The Set up would look like this: This is what the schematic looks like. Basically, my confusion is that the MCP73831 needs to provide current to the battery to charge it, but if you look at the schematic, the VBAT output of the chip is directly connected to the SYS_OUT and BATT_IN headers. This is confusing because it means that the chip is technically providing current to BOTH the device connected to SYS_OUT and the battery? Isn't this a bad thing? Why would I want to provide current to my output device with a LiPo charging profile? Couldn't this ruin things? Also, doesn't it take away from the battery being charged? AI: The 100/500mA maximum that the MCP73831 will provide can be used by the battery, or the load, or both sharing it, which means @ the 500mA setting & if your load is operating at its maximum ~300mA, there'll only be ~200mA available to charge your battery, so it'll take longer to charge. This arrangement is only appropriate to power electronics that can operate between 4.2V (LiPo fully charged) to around 3.0V (LiPo dead flat), and within the 100/500mA charge current capability. So the load will get whatever voltage is determined by the LiPo's state of charge. The load could potentially draw more than 500mA, in which case up to 500mA is coming from the 73831, and the rest from the LiPo. This isn't necessarily a bad thing, it all depends on what the 'load' is, and it can be a valid design decision. If you're powering, for example, an AVR8 MCU (e.g. ATmega328p, to choose the most common example, but many others are similar), this is fine, although the 'Safe Operating Area' (search for 'Speed Grades' in the '328 datasheet) for that chip won't let you reliably operate down to that low of a Vcc at the usual 16MHz, you'll need to set the pre-scaler to operate the CPU (F_CPU) at 8 or 10 MHz (with the normal 16MHz crystal). Lastly, if you're being powered from USB, keep in mind that some computer USB ports are truly designed to USB spec, and will only let you draw 100mA without enumerating onto the USB bus (which neither that chip nor the SparkFun PCB do, you need an entire USB-capable MCU to do that), although most smartphone/etc chargers will happily let you draw 500mA or more without enumeration.
H: How should I wire up ground when using an ATX power supply to power an Arduino and several LED strips which in return are controlled by the Arduino? Forgive me if this seems like a basic question but I want to make sure I wire these things up correctly. Currently, I have several LED strips that I am controlling with an Arduino and they are powered by a separate 5v DC power adapter. In that case I have tied in the ground for the DC power adapter to the ground on the Arduino board. The Arduino board itself is then powered by the USB on my computer. Now, I've decided to upgrade my setup to leverage an ATX power supply. The Arduino will be powered by the 5v stb & ground pins on the 24 pin molex connector and the LED strips will be powered from the 5v & ground pins on the 4 pin molex connectors. The LED strips are programmable via the DIO pins on the Arduino board and I plan to wire the Power On pin from the 24 pin molex connector to one of the Arduino's analog pins so I can use the Arduino to turn the supply fully on to power the strips. Now my question, sorry for being so long winded. Do I need to run a ground wire between each LED strip back to the Arduino? Since this is all from one supply it will be the same ground so it seems like it would be redundant and not needed. Below is a quick sketch of how I think things should be wired up. If I needed the additional ground wire I was going to run it from each 4-pin molex connector back to the ground pin on the Arduino. AI: Since you are using the same power supply for both, the Arduino and the LEDs, you do not need to connect the ground pins -- as long as ground is connected internally. As you have recognized this would be redundant and unnecessary and could even lead to further problems (there would be several ground loops). So I think connecting the Arduino to ground just one time will be fine.
H: Difference between single and dual rail op-amp I don't understand why some op-amps are specified as being dual rail, and others as single rail. Since (AFAIK) none have a ground pin, there is no difference between connecting the positive supply to +10v / the negative supply to -10v, or the positive supply to +20v and the negative supply to ground. Either way, the difference is 20v! AI: From a purely theoretical POV an opamp is nothing more than a (extremely large-gain) differential amplifier, i.e. an amplifier whose output is an amplified replica of the difference between its two inputs. The problem with this view, usually found in introductory material/courses on opamps, is that it doesn't take into consideration how power is to be provided to the opamp. Input and output voltages are simply referred to ground, without showing how the component is supposed to know where the ground is (almost as if it were psychic)! Of course you know that opamps have two power supply terminals, but neither one is labeled "ground", so how the opamp is supposed to know where ground level is? Well, it doesn't know! It simply assumes it is half-way between its two power supplies. That's why you power them up with a symmetric supply. If you didn't you wouldn't get 0V between output and ground when your inputs are shorted together (0 V differential input, and I'm neglecting common mode input to simplify things). The reason for this design choice is twofold: opamps are meant to be used also as DC coupled amplifiers, therefore to amplify a differential signal, which can have either polarity, the output must be able to go negative, and for this to be possible you need a negative supply also. For a single-supply DC coupled amplifier it is difficult to reach a 0V output level without special circuitry. Older opamps or opamps not meant to be "rail-to-rail" cannot force their output too near the rails, when the negative supply is grounded the output cannot reach 0V (usually the best you can have is 1V above ground, or there about). Rail-to-rail opamps are designed with more sophisticated circuitry that can bring the output very near the rails (tens of millivolts, maybe less) so they can bring the output really near 0V when used with a single supply, especially if designed to be operated in single-supply mode. As an aside, although theoretically it is possible to power an opamp with two different positive supplies (e.g. 5V and 25V), because the "difference is 20V", the problem is the other parts of the external circuit. If in such a setup you put a voltage of 0V across one input and ground, actually you are providing a -5V voltage relative to the "lower" 5V supply, which usually means frying something inside the opamp!
H: I didn't tin my solder bit...now what? In my haste to get soldering with my new iron (first time soldering in more than a decade...) I completely forgot to tin my bit. Subsequently I've managed to part-tin it, but it's a bit of a mess. Other than buying a new bit for the iron, do I have any other options? AI: It depends on whether the untinned tip coating is just covered with a layer of crud, like flux residue, or is now all oxidized. If the former, you can probably carefully clean it off (with the iron cold, of course), then power it up and tin it properly. If the latter, this is a unrecoverable error and the part of the tip you didn't tin is now useless.
H: How does a negative feedback amplifier reach steady state? I tried to simulate a negative feedback non-inverting op-amp, and got incorrect results. I ran the following time-stepping code in python: A = 100000 #open-loop gain B = 0.75 #the feedback factor V_out = 0 #initial output of op-amp is zero V_in = 2 #input voltage of 5V (DC) for t in range(1000): feedback = B*V_out V_out = A*(V_in - feedback) if V_out > 10: #saturation V_out = 10 #hits rails at 10V elif V_out < -10: #saturation V_out = -10 #hits rails at -10V But this model doesn't behave like a practical op-amp. V_out saturates at -10V, and feedback goes to 7.5V, and not 2V, thus violating the second summing point constraint. Why is this happening? NOTE: I've used the standard general feedback model for reference. AI: Your first tick of time "t" produces an end-stopped output voltage at plus or minus 10V. It doesn't matter which because your next iteration will also produce an end-stopped output voltage of opposite polarity then you are back to the start again and you'll just produce end-stopped voltages each tick of time "t". If you don't get alternate end-stops of plus then minus 10V then your code is wrong. But, of course alternate end stops of 10V isn't how an op-amp works so you then have to look at what has gone wrong and build a small integrator into the code so that it more closely represents an op-amp. You have no mechanism for producing a value that can converge on 0V and that is your basic problem.
H: Overvoltage protection for RS485 inputs I am using an Analog Devices ADM483E RS485-chip to build a device with RS485-capability. Datasheet here: http://www.analog.com/media/en/technical-documentation/data-sheets/ADM483E.pdf . The finished apparatus is supplied with 24V DC, and now I'm looking to design it so that it isn't destroyed if a technician accidentally connects the supply 24V +/- to the RS485 inputs (which are connected to the RS485 input/outputs on the ADM483E). The ADM483E is specified for +/- 14V applied to the RS485 inputs/output. It would be perfectly adequate for the apparatus to simply short-circuit the power supply in order to protect itself. The power supply is 24V DC and I can arrange for it to have a fuse of 2A. I can't use reverse biased diodes to ground, since -5V is perfectly acceptable RS485 signal level. I've considered using transient suppression diodes, but the typical ones are only rated for 1-2 joules of transient energy, and I haven't found any 2A fuses that will reliably break at such low energy. Do I have to build my own crowbar device, or is there some best practice for what I'm trying to do? AI: Rather than the brute-force method which is fraught with challenges & compromise, I'd put a couple of PTC resistors (aka polyfuse) in series with the 2 RS485 lines, & probably place them the last thing before they reach the connector to go off-board. PTCs aka polyfuses have a near-zero resistance normally, but when you exceed their hold current & approach their trip current, they go fairly high resistance, and stay that way until the 'fault current' is removed. So if you apply 24V to the 485 pair, current will go through your termination resistor (120 ohms?) & fairly quickly put them into trip. For RS485, depending on what source & line & termination resistors & impedance you've got, something around 50-100mA 'hold' current should be adequate for them to stay low-resistance at normal operating conditions. PTC/polyfuse examples: http://www.littelfuse.com/products/resettable-ptcs/radial-leaded.aspx
H: What is the Voltage output of this Unity gain amplifier? This Unity gain op amp has a ac supply in line with the resistor to the positive terminal of the op amp. What is the formula to obtain the output voltage? My challenge is the additional resistor otherwise if it wasn't there then I know that Vin = Vout AI: Ignacio nailed it. The current into the opamp is virtually zero. So then the corresponding IR drop across resistor is also virtually zero. Sorry, we have some unhappy downvoters in here.
H: 600 watts regulated DC for 3 seconds In my area, due to frequent storms, there are frequently short mains power cuts lasting a second or two at most. While the shorter several-millisecond outages don't usually cause issues, the longer momentary outages frequently cause my computer to shut off, resulting in filesystem corruption and other issues. I want some type of system capable of providing around 600 watts for 2-3 seconds, just enough to hold the system over until mains power resumes. Ideally, this device would be small enough to fit inside my computer case. The various UPSes available online are all either (a) really expensive or (b) not capable of providing the wattage I need. Besides, I don't need the hours or minutes one of those provides, just a few seconds. I have considered just putting some supercapacitors between the power rails, but I think that could cause problems when starting up (the PSU would have to charge the capacitors, so the voltage would take much longer to reach the required supply voltage), during these momentary outages (not sure I want to be backfeeding power to the PSU, but I don't want to have to connect every line coming out of it), when shutting down (since they would continue supplying voltage), and during service (since things could potentially still be energized even after the PSU is unplugged). I have some ideas for how to solve some of these issues, but not all of them at once, and I am not sure this is the best way to solve this problem. What is the best way to solve this problem? AI: The BEST way to solve this problem is to get an AC mains UPS (uninterruptible power supply) that is able to supply AC power to your computer during momentary power outages. You can get UPS units that can supply 650VA which should work nicely for your application that are less than $100. The beauty of these units is that you simply plug your computer into the UPS and then the UPS plugs into the AC mains. I would strongly encourage you to stop thinking you can kludge together some type of home hack solution on the DC side of the supply. You will certainly spend at least as much in parts and the solution will be a hack at best -- if you know what you are doing when you built it.
H: What is the mechanism for capacitor explosion? Capacitors (electrolytics, specifically) explode if you put reverse voltage or excessive voltage to them. How does this happen? Aren't electrolytics just two metal films with a seperator and doused in some electrolyte? What is the mechanism behind this explosion? AI: The electrolyte in an aluminum electrolytic capacitor is conductive, but a thin layer of aluminum oxide on the anode acts as a dielectric. Applying more than about 1.6V of reverse voltage strips the dielectric of its oxygen atoms causing the capacitor to become a near short circuit. Current flowing through the capacitor generates heat which eventually boils the electrolyte. The electrolyte vapor then expands, in time rupturing the case of the capacitor.
H: Looking for datasheet for Alpha 21264C Not too long back I did some reading on the Alpha CPU architecture and (probably out of a burst of nostalgic stupidity) procured a couple; there's only an issue - the ones I have are the 21264 C variant, that features an LGA pad-out rather than a PGA setup due to the increased clock speed. The initial Alpha 21264 datasheet I've tracked down, but I can't seem to find any references anywhere as to the 21264C variant's datasheets, which would contain the prerequisite pinouts and mechanical specs for me to do anything with these devices. Because Compaq offed the whole Alpha architecture, there doesn't appear to be a reliable manufacturer source anywhere on these devices. Not that I have any game-changing ideas for these things, but it'd be kinda neat to do something with them other than have them gather dust or buy a complete OEM system for them. Or, if nothing else, learn about them for learning's sake. Anyone have any clues as to where I could find the particular datasheet? AI: Does this help? This Wikipedia article points to EV68DC being an a.k.a. of the C variant. This led me to the 21264/EV68DC Microprocessor Hardware Reference Manual.
H: Reliable way to transport data over 1-2 km distance I am looking for some way to transport data (around 3000Kbps) omnidirectional. Transmitter should not weight more than 300 grams but receiver can be much heavier. The range I am trying to achieve is 1-2km line of sight. Is there any reliable hardware to fulfill this role? AI: WiFi will do this quite easily. It's the only consumer wireless data system that gets you a few Mbps. With a directional antenna on one end and a regular wifi device on the other, you should get a link at at about 2 km. I have tried this, with a 22 dBi antenna on one side of a valley, and my laptop on the other side, about 2 km apart. Set the WiFi devices to use the lowest speed, 5 Mbps mode, so they don't continuously try to move up to higher speeds, then fail and move down again. If one end is flying, you will need to aim the base station antenna... this could be automated with a GPS at both ends.
H: How to test/flash many modules? Suppose I have several hundred pieces of the same module to test and flash, and the connectors themselves have wire holes in them like below. What's a good way to make the connection without soldering? AI: Pogo pins and a custom test jig. Sparkfun has a tutorial on how they do it for their modules, I recommend doing something similar.
H: 16 segment LED sparkfun resistor help I am quite new to this and am struggling to read through the data sheets of the Sparkfun 16 segment display, datasheet here. I have managed to get all of the LEDs wired up through a LED driver, with 7v input and all pulling through a single resistor of 220 ohm. As the short segments are one LED and the long ones are two, as soon as I switch on any of the short segments all the other ones are short circuited and switch off. Despite my best efforts I am unable to come up with a good solution to this, can anyone help? --- Extra Information --- LED Driver is the TLC5916IN datasheet here The drivers are set up in a breadboard inside the pins of the LED display, so at the moment they are directly connected through the breadboard. If they need to be moved to accomodate extra resistors then that can be done, would just rather not if possible. AI: Excerpts from the display and driver data sheets, below, indicate that Vf for a 2 LED segment with 20mA through it can be as high as 7.6 volts, and for a 1 LED segment (a "dot"), with the same current running through it, 3.8 volts. That means that your LED supply should be in the vicinity of 8 volts in order to have enough headroom to compensate for the drivers' Vce(sat), and should be able to source at least 320mA (16 segments X 0.02A) in order to light up all the segments at once without dimming. The curve for Rset shows that for currents of 20mA into each of the driver's output sinks, Rset should be in the vicinity of 1000 ohms. In order to make your widget work properly, then, you'll need to increase the LED supply voltage as well as Rset. Note, however, that the LED supply voltage will exceed the driver's Vcc spec, so you'll need to make sure that Vcc is within its specified limits.
H: Identifying windings of a single phase induction motor How can I identify the main and auxiliary windings of a single phase induction motor which has only three terminals (1.Red, 2. Yellow & 3. Black) out of the device? How to connect capacitor and power supply to it? AI: Tricky solution: Measure the winding resistances. Auxiliary windings are often thinner and therefore have a higher resistance (even if it's just a little bit higher). Once you know which terminals are used for each of the two windings, you can connect them to the power supply and the capacitor as shown in the following picture: The picture was taken from the book "R. Fischer: Elektrische Maschinen, 15.Auflage, Hanser Verlag München" Cleaner solution Apply a (small) DC voltage step to a test circuit, consisting of a resistor and one of the windings in serial combination. Capture the current with an oscilloscope. Measure the time constant of the system and calculate the inductance L of the winding. Repeat this process for the second winding. The winding with the higher inductance value should be the main winding.
H: Connect kindle 3 serial port to epson printer's 8 pin mini-din serial port? I have a kindle 3 with a broken screen and an old EPSON stylus 1520. The kindle has a serial port with TX, RX, GND and 1.8v VCC (source). The printer has a mac compatible 8 pin Mini-DIN port. Would it be possible to connect the kindle to the printer? I saw some pinouts for 8 pin mini DINs, and some of the pins were labeled something like "handshake", so I guess it's not as easy as connecting TX<->RX, RX<->TX. I don't have a computer with a parallel port to connect to the printer. I haven't done this kind of thing before, so any advise and/or links is appreciated. I haven't found any material on how to connect them together, perhaps I'm missing the right keywords, or it can't be done. Edit: I have a computer with an round 4 pin port with an S next to it, that I think is for S-video, which uses the same physical port as ADB. Could I connect the printer's serial port to that one? I guess the S-video can't speak RS-232? AI: Not without level shifting. The Kindle's serial port uses TTL serial at 1.8V, whereas the printer's serial port uses RS232 serial (i.e, ±12V). Attempting to connect them together directly is likely, at a minimum, to destroy the serial pins on the Kindle's SoC. The Kindle's internal serial port is primarily intended for debugging. It's probably best to leave it alone here; if you want to connect the Kindle to an external serial device, a better approach will be to use its USB port in host mode with an external USB/serial adapter. The 8-pin serial adapter on the printer side is standard RS232 serial using an unusual connector. If you search around, you should be able to find adapters from this connector to standard DB9. (You may have some trouble finding them, as the computers that used these have been obsolete since the late 90s, but there are undoubtedly some still sitting in a warehouse somewhere.) In re. edit: A 4 pin Mini-DIN port is most likely either S-Video or ADB, as you have identified. Neither one would be usable as a serial port.
H: Schmitt Trigger Functionality Not Working, Questions I'm trying to build a Schmitt trigger like the one described here: http://pcbheaven.com/drcalculus/index.php?calc=st_nonsym_sp However, it isn't working as expected, and I'm thinking it may be due to a number of reasons, only a few of which I have a suspicion of. It would be a great help if someone could advise me on how to properly build a Schmitt Trigger because I'm quite new to this and don't have much experience. I used a LM358 op-amp from TI, which I'm thinking might not work because I'm not sure if it's a two-rail op-amp. I don't know exactly why a two-rail op-amp is necessary, but a couple of videos I have watched mentioned that it was necessary. The resistors I used have relatively small values. In the PCBHeaven link I posted above, R1 = 1kOhm, R2=10kOhms, and the feedback resistor was 10kOhms as well. I don't know why this matters, but might it have something to do with saturation of the op-amp? I really don't know. I'm more frustrated because I see certain videos floating around online such as this one: https://www.youtube.com/watch?v=-JW1fv2O73A and the circuit set up seems pretty much exactly the same as mine, save for the larger resistor values and the different op-amp. I know that the Schmitt Trigger is supposed to output either a high or low logic level when the thresholds are passed, however I'm not observing this. For example, if I supply the op-amp with 5V and also make V+ 5 volts, I observe the following results: When input voltage = 5V, output voltage = 2.85V When input voltage = 0V, output voltage = 3.91V When input voltage = 3.3V, output voltage = 3.91V Which are extremely confusing results, especially since none of those values are near 0V as I would expect to represent a logic low. I become more confused when I directly test the functionality of the op-amp by comparing the negative and positive terminals, and the op-amp correctly produces a logic high when the positive terminal > negative terminal, and produces a logic low when negative terminal > positive terminal. If anyone has any idea or suggestions for where I went wrong, or have general advice for building a Schmitt Trigger, please let me know! AI: Just plug those resistor values into the calculator you linked in your question and look what happens: - The thresholds are switching between about 4.2 volts and 4.6 volts - that's the first thing - your input needs to be able to cross those boundaries for your circuit to switch. Next, take a look at the LM358 data sheet and you'll see that input voltages are only valid between 0V and 3.5V (on a 5V supply) - don't expect this to do what you want when the input is above 3.5 volts. Next take a look on the d-sheet to see what the output can do on a 5V rail, The d-sheet implies the highest output voltage that it can muster is typically 2V below the positive rail i.e. 3V. My estimation is that your circuit is kind of working but maybe with the invalid 5V input in scenario 1, you get a weird inversion thing going on (it happens a lot on op-amps). Welcome to the imperfect world of real op-amps!! Try lowering thresholds to around 2V and 2.5V and see what happens when the input rises above 2.6V - I'd expect the output to swing down to 0V. When the input drops below 1.9V, I'd expect to see the output swing above 3V.
H: Can an IR transmitter be focused? Can a transmitting IR LED (or an array of such devices) be focused into a finite area rather than allowed to spread out? I think this is how laser tag systems are implemented but I am not sure and I want to try this myself. If they can be focused, what what device can accomplish that? A lens? A waveguide of sorts? Thanks for any tips! AI: The easy way to do this is to purchase an IR led with a narrow viewing angle. (This way you don't have to build weird contraptions to focus the IR light.) Look at the data sheets for the IR leds. Smaller viewing angle will mean a more focused IR beam. You'll be looking for charts like this to compare the viewing angles and relative intensities: Good Luck!