text
stringlengths
83
79.5k
H: How do I get a chinese nRF51822 development kit running examples with an ST-link, Keil uVision? I've been working at this for days with not much information out there to assist me in fixing my issues, so I figured I'd make a post here. I'm using a cheap chinese nRF51822 module and motherboard that I bought on AliExpress, and programming it in Keil uVision5 with an ST-link (or other non-JLink SWD device). How do I get the official Nordic Semiconductor examples to work and have the device show up on bluetooth? AI: I'd advise you constult the 'BLE examples' section in the SDK documentation to choose an appropriate example based, then follow these steps. I've chosen the Heart Rate Sensor example to run through here. With the Keil pack installer, ensure you have the appropriate devices, drivers and example packs installed. In the Pack installer, choose an example that uses the 'S110' soft device, and corresponds to an example you've found in the SDK. Choose the 'PCA100028' version. Click 'Copy' to create a local copy of the project. It should open by default once you choose a location. Once open, select the 'flash_softdevice' target from the dropdown. Change the target options to use the appropriate programmer in the correct mode. Change the flash download options to do a full chip erase. (You may also need to change the programming algorithm to 'nRF51xxx External Connection Board' for it to program without error.) Confirm the options then flash the soft device to the board (You shouldn't need to compile anything at this point). Change the target from the drop-down menu back to the example: e.g. 'nrf51422_xxac_s110' (The chip name is wrong, but it will still run fine since the nRF51822 supports the s110 soft device) Set up the st-link debugger as you did before, except leave the programming algorithm as the 'nrf51xxx', and ensure it's only set to 'Erase Sectors' with the 'Reset and Run' active. Compile the project and load program onto the board. At this point, if you have the module attached to the motherboard, you should see One active LED and one flashing LED. The flashing LED indicates the device is ready for connection. You can connect to the device using the nRF mobile apps. Feel free to add comments if you stumble across this and find problems of your own!
H: What's the actual difference between edge sensitive and level sensitive interrupts Currently I'm working on a C8051F120 MCU where external interrupts can be defined in two ways: Edge sensitive (falling) Level sensitive (low-level) In level-sensitive interrupts as soon as the MCU detects a low level at the external pin it will execute the ISR which is the same as detecting a falling edge. I know I'm wrong as both can't be the same. Hence I'm asking this question: what's the actual difference between the two, in their detection procedure or in the execution of the ISR? AI: Its exactlly what is says. If edge interrupt is set, the ISR will only get fired on falling/rising edge of a pulse. While if level sensitive interrupt (as you say) is set the ISR will get fired everytime there is a low-level/high-level signal on the corresponding pin. In short, edge interrupt gets fired only on changing edges, while level interrupts gets fired as long as the pulse is low or high. So if you have low-level interrupt set, MCU will keep executing the ISR as long as the pin is low.
H: General rule for current flow in op amps? I'm a first year student doing elec eng. and I'm wondering about the direction of current in an op amp (Where the current flows from to where it is going). I'm wondering this so I can use KCL to find an expression for Vout, but I usually end up getting the directions wrong. This is an example of the type of amp I'm asked to detail about in my exams. Is there a rule about the way the current flows depending of the feed back etc? Thank you for your help! David AI: You can reasonably assume that currents can flow from an input (Va in your diagram) and from the op-amp output (Vo in your diagram). This means you can assume current does not flow into the two op-amp inputs and these can be regarded as high impedances. Additionally, you can assume the op-amp open-loop gain is very high and the impact of this is that for an output voltage that is reasonable (i.e. somewhere within the bounds of the power supply rails), the difference between V1 and V2 is zero volts. All the above assumes that there is an overall negative feedback that keeps the output in the linear region i.e. within the bounds of the power rails. If the overall feedback is zero or positive then the output will likely be end-stopped against one of the power rails and there may well be currents taken by the inputs AND, you can no-longer assume V1 = V2.
H: BLDC max speed KV or Hz? So from what I've understood, the KV rating for a motor gives us the rotor speed based on the voltage applied at the phase of the motor. Having looked a bit deeper in ESC / inverters, I've come up with the conclusion that it's rather the frequency of phase commuting that sets the motor's speed. But I guess there is some electromagnetic force (lorentz / laplace?) that defines the force exerted on a body knowing the voltage flowing through it. What I'm thinking is that the frequency commuting defines speed, but the current/volts going through each coil defines the maximum force/acceleration the rotor can be pulled with. And since commuting is done one zero-crossing of the floating phase, this max acceleration (thus time it gets to do the zero-xing) limits the commuting freq. Could anyone help me to figure this out ? AI: You need to consider both frequency and Kv in driving a BLDC motor, and motor drivers differ in how they take this into account. So, both points are correct. The rotational speed is directly related to the commutation frequency and the pole count. And Kv * rotational speed gives you the back-EMF. If you define the motor speed by generating a fixed frequency, then as JonRB says, you must supply enough voltage to overcome the sum of: V1 = Kv * actual motor speed V2 = IR loss from the motor resistance and the torque required to overcome friction and load resistance V3 = IR loss from the torque required to accelerate the rotor + load if actual speed falls short of driving frequency. Just as Kv = Speed / Voltage. the torque constant Ki = Torque / Current. In SI units, Ki is simply 1/Kv : non-SI users have to remember a funny conversion number (which I've forgotten) as well as which of oz, lbs, feet, inches it refers to, or look it up in a textbook. So, given Kv, you can compute Ki, and therefore V2 and V3 for both components of motor current I. Driving a BLDC from a fixed frequency, V3 is critical : if the frequency is too high or the supply voltage too low, the motor simply won't start, so it's normal to ramp the frequency up until the desired speed is reached. Then if the driving voltage is fixed, and higher than V1 + V2 combined, the motor will run, but inefficiently, i.e. waste power at steady state (at constant speed V3 = 0) so for efficient operation you need to reduce driving voltage to V1 + V2 (usually via PWM). This can get complicated, so most controllers operate as in Bruce's answer : motor speed is controlled by voltage, with the BLDC sensing either the phase of the back-EMF, or motor position separately via hall-effect sensors or rotary encoders, and controlling the commutation frequency to suit the actual speed.
H: Difference between capacitor start and capacitor run Induction motors? All though in both types of Induction Motors, capacitor does the job of phase shifting to produce the rotating magnetic field, their working principle is the same. Then whats the point in disconnecting the capacitor by centrifugal switch for capacitor start, and not disconnecting for the capacitor run motors. I mean is either of the Induction Motor designated for particular power rating, plus i read somewhere that capacitor start Induction Motor has high starting torque. Also when i browsed the internet found this piece of info that capacitor run motor has improved p.f. due to start capacitor, so isn`t it always advantageous to have capacitor permanently to improve motor efficiency. AI: A Capacitor Start Motor not only switches out the capacitor when up to speed, but also switches out the starting winding which is in series with the start capacitor. Capacitor Start motors have very high starting torque for a single phase AC motor. The same is true for a capacitor start / capacitor run motor WITH a centrifugal switch. In this case, the run capacitor is a different value and just provides some additional phase lag especially to help the motor maintain speed under load, and improve the power factor. A Capacitor start/run motor without a centrifugal switch has a lower starting torque, but good performance under load, and again, an improved power factor.
H: Is it a photodiode or a phototransistor? I have been working on a circuit which involves a photosensitive element soldered on a PCB. I am confused whether it is a photodiode or a phototransistor. Is there any means by which I can figure out whether its a photodiode or phototransistor without desoldering it? It is a two terminal device. Picture of device: AI: There are a few ways you can do this: Connect a voltmeter across the leads and shine a bright light or a laser pointer on it. If the voltmeter reads a voltage (not just noise) then it is probably a photodiode. Connect a diode tester across the leads. While this isn't ideal as they are in-circuit, it may still work. If your diode tester doesn't read anything, swap the leads around. If you still don't see a reading, then it's probably a phototransistor. If the board has some sort of amplifier (an op-amp, most likely) connected close to these devices, they're probably photodiodes. Otherwise they could be phototransistors, which are just switches and wouldn't need amplification. Do the PCB designators show a "D" or a "Q"? "D" is for diode, "Q" is for transistor In order to get a more accurate reading (particularly with the diode test) it would be best to desolder one leg of the device (to take it out of the circuit) before measuring. However, it looks like there is some sort of gunk holding it to the board so you may need to remove that first. Obviously a better view of the (entire) board and part numbers would be very helpful in this case.
H: PCB manufactoring-There shouldn't be bottom silkscreen selected? I use Eagle to create gerber files . When i am trying to check my zip gerber, in 4pcb.com i get this message : There shouldn't be a bottom silkscreen selected. If bottom silkscreen is required, adjust the design specifications entered below. Well, our board has printed values in its top and its bottom, and its 2 layers board. I dont understand why they say that something is wrong with our bottom silkscreen file. Here is the gerber file job : top copper: top,pads,vias,dimensions. bottom copper:bottom,pads,vias bottom silkscreen: bplace,bnames,bvalues, top silkscreen: tplace,tnames,tvalues, top solder mask: tstop bottom solder mask: bstop drill: drills,holes Maybe i dont understand something basic here, but is this right ? our board is 2 layers board,has components on both side of it, and also values and names on both sides. What this error message means? is there any tool to check how the board would look like when ready,so i can know its ok ? thanks! AI: When you're selecting your specs, make sure you change the default "Silkscreen Sides" from "Top Side" to "Both Sides" Otherwise when it sees a gerber file for "Bottom Silkscreen" it'll say "But you told me to only include the Top Silkscreen!" and give you the error you mention.
H: Step-down converter and ceramic minimum ESR capacitor I'm building a step-down converter, based on the TI TPS5450, which provides a reference design and various considerations on the capacitor. Even on the minimum ESR required. But when states "The minimum ESR of the output capacitor should also be considered. For good phase margin, the ESR zero when the ESR is at a minimum should not be too far above the internal compensation poles at 24 kHz and 54 kHz." And talks about this zero in other parts of the datasheet. How can I find this zero introduce with the C and the ESR? I did something like this: $$ Resr = \frac{1}{(2*\pi*f_z*Co)} $$ where the Co is the output capacitor, f_z the target zero freqeuncy which should be not so far over the indicated pole frequency. The problem is that I will need a ceramic capacitor, because the regulator will work in a high vacuum condition, and the polarized ones like tantalium can have problems. But when searching for a ceramic capacitor, it is not stated the information about the ESR, but only the dielectric type (for example the X5R). AI: You can assume the ESR of the ceramic capacitor is \$0\Omega\$ in that frequency range and add a series resistor to put the zero right where you want it. Usually a fraction of an ohm up to an ohm or two will do it. Here, for comparison, from an AVX paper, is the ESR of a 4.7uF ceramic capacitor vs. a tantalum. As you can see, \$0\Omega\$ is a pretty good approximation for the ceramic part when you want total ESR to make it look more like a tantalum part. Edit: Note that the very high capacitance X5R MLCC caps you have in mind typically have a horrible voltage coefficient. The stated capacitance is achieved at a bias of 500mV, which is probably lower than you are using. For the same zero frequency your ESR must be higher by the capacitance ratio so if your '220uF' cap is only 80uF at temperature extreme and 5V bias you might need to have more like 150m\$\Omega\$ series resistance to maintain the same stability as the 330uF tantalum cap in the eval board. You should be able to find these specs for the Samsung parts.. the above graph is from an NIC guide.
H: Load Resistor for high amp low voltage testing I want to simulate a signal of 15V / 30A through a device. I will use it to ensure that a series of prototypes are capable of switching at this current. $$ P = 15 \times 30 = 450W $$ $$ R = \frac{15}{30} = 0.5 \Omega $$ To be on the safe side, (wire, etc., resistance), I intend to use three 1 ohm 225W resistors in parallel. I have a power supply where the current can be limited, so will set the limit to 30A. simulate this circuit – Schematic created using CircuitLab It seems really straight forward as above but I wanted to make sure I hadn't overlooked something as I have not done this before. Can anyone tell me if the above looks ok? AI: Assuming your Device Under Test (or DUT) and total wiring are sufficiently lossless this might work well enough. Your basic maths steps are all in order, the power dissipation in the resistors should be fine if they are all within 25% of each other in value, which you can usually assume if they are the same type. If it says a margin on it, like 5%, you can use that to check for certainty. If your DUT, however is very lossless when "turned on", limiting the current through the supply at 30A will not prevent a higher peak from going through. Your supply has capacitors on its output, so if at 30A your device is supposed to waste near enough to 0V (supposed to, versus what it ends up being is of course a factor in this), it will very shortly dump the full 15V with maximum current through your DUT. Whether that is a microsecond or a milisecond is down to your lab supply, but you should then assume a peak current of: \$I = \frac{V}{R} = \frac{15V}{0.3333...Ohm} =~ 45A \$ during that time, until the capacitors are empty (EDIT: Not empty, of course, but settled to the new voltage of 10V needed for 30A) and the regulation of the power supply balances out at 30A. The resistors will not mind this at all, firstly because they are very large, bulky, 225W things, so even 45A continuous would be fine (if they are within 1% in value, at 225W things can quickly escalate into poof). But also because of their mass they can easily handle very short spikes a bit above their handling capability, as long as you then settle below their maximum power. Whether your device will like it: That only you know.
H: Ultrasonic transducer for fish finder - TD02002 I am looking to construct an MCU based ultrasonic fish finder. I have found a potential component that is a transducer called the TD02002 which can be found here: http://www.chinaultrasound.com/index.php/200khz-ultrasonic-transducer-for-depth-measurement/ Unfortunately, try as I might, I haven't found any data sheets on how it might be used http://www.chinaultrasound.com/index.php/200khz-ultrasonic-transducer-for-for-depth-measurement/ It has a phono type plug on its cabling. I am at a loss on how to drive it. Does anyone have any source materials or circuits for building fish finders? Ive performed an evenings worth of Google searches but come up dry. Update: The supplier sent me a datasheet ... but I am still lost on how to drive it: Datasheet AI: I haven't done any fish finders, I've played with ultra sonics. (I don't know what frequency they use for fish finders, but maybe one of the manufactures spec sheet will tell you.) Anyway, you want to first hit it with a big voltage pulse. Maybe one or two cycles at it's resonant frequency. (most new signal generators will have a burst mode that you can use.) This sends out a sound pulse in the water. Then you are going to use the same transducer as a detector... looking for the reflected wave. An opamp will probably help here, but to start you should be able to just plug it into a 'scope input. Now you've got to do some math... look up the speed of sound in water. Figure out how long it will take for the pulse to bounce off something and come back. You want this time to be much longer than the burst that made the sound pulse... 'cause your transducer (and any amp) has to recover from the large drive signal. I'm not sure a bucket will be deep enough. Maybe you can launch the wave's horizontally in a bath tub and put a board down into the water to reflect the wave.
H: Fan cools solder down too quickly So I'm just starting to get into soldering, and being a noob, I got the most el cheapo solder kit you could possibly get. Now the problem is that the soldering iron isn't very hot. So with lead-free solder, it takes some convincing and pressing the solder onto the iron for a few seconds before the solder melts. This is fine if I don't have my fan (regular desk fan) on - I could solder quite normally. However, the fumes smell horrible, and apparently they are bad for you. But when I turn my fan on, the solder won't melt. Or it would melt after 2 minutes with me pressing down the soldering iron and overheating everything on the board, but instantly freeze as long as it it's not directly in touch with the soldering iron. I even got solder wire stuck firmly onto a circuit board because it froze so quickly. It seems like the fan is cooling down the solder, which is strange since it's not a super powerful fan or anything. Is there a way to prevent this? Or do I need to get one of those special fume extractor fans? AI: No, you don't need a special extractor. And there is a way to work around the cooling effect of the fan. It's called a decent soldering iron, and you need one desperately. This is not due to the specific problem which led you to post, although that's bad enough. It's taking a long time to melt your solder, and during this whole time your parts are getting heated. This is very bad for your parts. You can easily kill ICs by doing this. Bite the bullet and get a decent iron. It's also possible (but you don't mention it) that your cheap kit gave you solder which is too thick. For general electronic soldering, .050 solder is about as thick as you should have, and .025 dia solder is much better.
H: Reverse breakdown voltage setting for the diodes in a solar cell model in SPICE I want to simulate the reverse breakdown behavior of a two diode model solar cell in SPICE. The diodes configurations without considering the breakdown voltage are as below: .model diode d( Is=1.5e-10, xti=3) .model diode2 d(Is=1.77e-6, n=2, xti=3) With the given diodes configurations, I can simulate all characteristics before the breakdown voltage point. By adding the breakdown voltage point to the diode model, I cannot see the curve in forward bias anymore and it does not work properly. .model diode d( Is=1.5e-10, xti=3, vrev=15, BV=15) .model diode2 d(Is=1.77e-6, n=2, xti=3, vrev=15, BV=15) In short, when I add the code for reverse breakdown voltage point, my diode does not work properly in forward bias! Please help me with this problem. AI: From LTWiki: There are two types of diodes available. One is a conduction region-wise linear model that yields a computationally light weight representation of an idealized diode. ... This idealized model is used if any of Ron, Roff, Vfwd, Vrev or Rrev is specified in the model. So when you included the VREV parameter, you changed your model to use the piecewise linear diode model instead of the usual nonlinear model. Your other parameters (IS, XTI, and BV) are ignored and the piecewise linear model parameters that you didn't specify take their default values.. This could make a substantial change to the operating behavior of the diodes in your model.
H: How to calculte mosfet capacitors (Cgs Cds Cdg) knowing the charges Q I need to use the best model for the MOSFET in my circuit I'm simulation on PSIM, the MOSFET is Si4108-TI-GE3. But I am not given the parasitic capacitance values (Cgs Cds Cdg), I am only given this: I think I should use Q=CU, but I don't see how to use Q=CU for Cds since I only have Total gate charge and I don't know if that is the drain-source charge. How do I calculate the necessary parasitic capacitance values? AI: Read the data sheet: - Ciss is gate-source capacitance. You should be able to work out the other two.
H: How to make 20 LED's light up one at a time and remain on, and then power off one at a time? I’m looking to see if there is a circuit I can build that would light up a row of about 20 LED’s one at a time after pressing a button, and keep those LED constantly on once there were activated. Finally, when pressing a button again, they all power off one at a time in the same order? AI: Have a look at a chip family called "shift registers". For example, a TPIC6595 will drive up 8 LEDs. You simply cascade multiple shift registers to drive more LEDs. Have a look at that chip, then modify your question with what you have learned. We will help you get to where you want to be but you have to do the work yourself.
H: Why does measuring the voltage drop across a thing not simply measure the battery voltage? Imagine a trivial circuit with battery and one resistor. To measure the "voltage drop" across the resistor, we stick a voltmeter in parallel with it. However, this means the voltmeter is also directly electrically connected to the terminals of the battery. Therefore, why doesn't it simply measure the battery voltage, regardless of the resistor? I hypothesized that the answer is because some of the available voltage/pressure/force/power/energy/magic/whatever-it-is from the battery is being drained through the resistor, it will not be passing through the voltmeter and will therefore not be measured by it, but this still doesn't fit, because that means the voltmeter is not measuring the voltage drop; it's measuring the voltage that wasn't dropped. If the battery supplies 5 V and voltmeter reads 4 V, how is 4 V possibly the voltage drop of the resistor, when the available voltage has actually dropped by 1 V and I still seem to have a non-dropped 4 V to play with? I guess I really do not understand what the voltage drop is supposed to mean. I don't know why the resistor is dropping voltage at all, when it is supposed to resist current. I'm so lost. AI: [I'm ignoring non-ideal behavior since that doesn't seem to be what you're interested in.] Your assumption is wrong. Measuring the voltage drop across the resistor does measure the battery voltage. The battery voltage and the resistor voltage are the same in your circuit. The general rules are: Components in parallel share the same voltage Components in series share the same current Ideally, adding or removing the resistor doesn't change the voltmeter's measurement at all. The battery, the resistor, and the meter are all in parallel, so they all share the same voltage. If the battery voltage is 5 V, then the resistor voltage and the meter voltage must also be 5 V. Voltage is basically a measurement of potential energy due to an electric force field. If you go around the circuit in a loop, you end up back at the same potential, which means you lose whatever energy you gained along the way. (Gravity also works this way.) When you move from negative to positive through a battery, you gain energy. When you move through a resistor, you lose energy. If a battery and a resistor are in parallel and you move around that loop, the energy gained in the battery will equal the energy lost in the resistor. In other words, their voltages are the same! This principle is called Kirchhoff's Voltage Law. More formally, it says that the sum of the voltages around a closed loop must equal zero. Resistance describes a relationship between the voltage across the resistor and the current through it. So resistors do "resist" the flow of current, but the way they do that is by dissipating energy. It's similar to the way that friction resists the movement of an object. Now as others have pointed out, in real life a battery is not an ideal voltage source. The voltage of a real battery changes depending on how much current is being drawn and how much charge is left. So in real life, adding a resistor can change the battery voltage. But the battery voltage and the resistor voltage will still be (almost) equal. (The parasitic resistance of the wires is normally very small.) Hopefully this has clarified things. Please feel free to post follow-up questions if you're still confused.
H: How can I maximize the source impedance of the Arduino Due's ADC? I know that the ADC on the Arduino Due has a clock speed from 1 MHz to 20 MHz. This is given by the data sheet: I want to lower f_ADC to maximize source impedance: I want to slow down the ADC as much as possible is to obtain the maximum source impedance. However, according to this post, Arduino sets the ADC clock to 125 KHz. How is this possible, if the data sheet says that the minimum is 1 MHz? Finally, if I utilize the Arduino backend C++ code to slow down the ADC, then can I extrapolate that the source impedance will reach MΩ values?) AI: The maximum recommended source impedance for this MCU is 10K ohms. This takes into account sampling time and leakage of the I/O pins. However, you could easily add an op-amp voltage follower and get extremely high input resistance. The one I linked has typical 1pA maximum 30pA leakage over temperature and reasonable 3mV offset voltage, but may others are available. That particular part would cause <0.1% error over the entire temperature range with 300M\$\Omega\$ source resistance! (Typically at room temperature 5G\$\Omega\$ for 0.1% error).
H: Determine supply voltage for LED from current limiting resistor Everyone knows how to calculate the resistance of a current limiting resistor for a LED but is it possible to go the other way? (aka determine the supply voltage from the resistor's value) I ask this because I am working on re-purposing ink jet printer parts for low cost 3D printers to be built in developing countries. Ink jet printers used to use stepper motors but recently have started using DC motors with optical quadrature encoders. In order to use the e-waste one must find the voltage at which the quadrature encoders are supposed to operate at. While the forward voltage of the LED isn't known, is it possible to determine a ballpark idea of what voltage should be used to power the LED in the quadrature encoder? AI: Sorry, but no. Attempting to drive an LED with a constant voltage is a great way to kill an LED. The coefficient of forward voltage with temperature is negative, which means that, driven by a constant voltage, if the LED starts to get warm it will start to draw more current, which will increase the power dissipated by the LED, which will cause the forward voltage to drop even more, etc to disaster. You are better off assuming an LED forward voltage of about 2 volts, then provide a convenient voltage/resistor combination to provide ~ 1 mA, then measure Vf. Then reduce the resistance so as to produce a series of currents in the 1-10 mA range, and at each current setting check the encoder for proper operation.
H: Cursor (waveform) reading not the same with transcript window I have run a simulation of a Verilog code testbench. I ran it in ModelSim, but why the reading I got from just using the cursor on the waveform is different from the one in transcript window. While in the cursor, the WDIG_OUT values is offset 1 step backwards, making the 111 wDIG_OUT to match with 2181 rANALOG_IN. (just like in the case of "a" here). I cannot proceed to self-checking because there is an offset. Please help. AI: That looks correct. The values in the transcript window are the signal levels 'leading in' to the clock edge. This constitutes an ideal setup time. With the cursor positioned directly on a clock edge, the values to the left side will be the 'inputs' and the values to the right side will be the 'outputs'. This represents an ideal propagation delay of zero, setup time of one clock period, and hold time of zero. You will have to delay the input by the propagation delay of the logic (in this case one clock cycle) if you have to directly compare it with the registered output.
H: Combining two different voltages into one regulated voltage at higher amperage The Commodore 64 user port has a +5V supply at 100mA and a 9VAC supply also at 100mA. I need about 150mA from the port at 3.3 volts. Is there a way I can use both supplies to get the amperage I need? Can I rectify the 9VAC to DC and regulate it down to 3.3V, then regulate the 5V down as well with a second regulator and connect the two regulators in parallel? Does that work like it might with battery cells? Or is there a better way? AI: You don't need both supplies. 9V at 100mA is 0.9 watts. You need 3.3V at 150mA or .495 watts. A switching supply that converts the 9V to 3.3V will certainly be efficient enough to give you the 150mA that you need. Look at the TPS62130 from TI for example: http://www.ti.com/lit/ds/symlink/tps62132.pdf There are countless other options from TI, Linear Tech, ON Semi, Maxim, Intersil, etc.
H: Is this PCB burned, and is it correct? Okay, so I am a newbie with technology and was wondering if, when soldering, I accidentally burned this PCB and so far, does it match the schematic for the thing I am making? Also, if it is burned, can anyone advise on how to fix it? Thanks, all advice is appreciated, :D! AI: You burned and delaminated the solder rings from the some holes in the pcb. All that does is make that hole useless. Luckily, you have a ton of other holes available. Practice soldering, and don't keep your iron on the solder rings/pcb for longer than needed. As for if the circuit matches the schematic, you will find it to be almost improbable that anyone can tell from just a set of pictures like that.
H: Different voltages and amp draw This is probably a basic electronics question, but I'm a self-taught hobbyist and I can't seem to find a direct answer to this. I have a host device that I want to connect to that supplies 100mA at 5V. The module I'm connecting runs on 3.3V and peaks at 200mA. I will have a voltage regulator and level shifters in between. My question is, does running at 3.3V make any difference with the amp draw on the host? Or is it 200mA no matter what the voltage, meaning I will need an external supply. Is there a general principle I can follow in the future? AI: Your power supply can generate $P = I(A) x E(V) = 0.1A x 5V = 0.5 W. Now there are two ways to lower the voltage. A linear regulator or a switching regulator. In the case of the linear regulator, the input current (at 5V) is the same as the output current (at 3.3V) - except for a couple of mA needed for the linear regulator to work. So, at the output you have 0.1A at 3.3V, or 0.33W. The difference (0.5W - 0.33W = 0.17W) makes the regulator heat up. The switching regulator maintains the same power (not current) - except for a little power needed internally. So we calculator 0.5W at the input, then at the output we have 0.5W too (minus about 10% loss -> about 0.45W). So, the maximum current at the output is 0.45W/3.3V = 0.136A. If the 200mA peaks are really narrow, a capacitor might save your life... (preferably at the input where the current is lower)
H: Can (or should) two voltage regulators be connected in a parallel configuration. I have two 5 volt voltage regulators that I would like to connect to a 9 volt source in a parallel configuration. Is this advisable, problematic, or even commonly done? I have tested this configuration and noticed that one of the regulators gets hotter than the other. Why is this? AI: Production regulators have tolerances - in the order of a couple of percentage points (most are 3 or 5%). So, a 5V regulator might be giving 5.15V (5+3%) and the other one 5.00V. If you parallel them, the one providing the load is the highest one. The lower still thinks that the voltage is too high and waits for it to drop. Until the highest regulator gives up (its protection circuitry kicks in), it will provide all the current (and heat up). I used an extreme example of difference in voltage between two regulators. In practice they vary less. On the other hand, just a couple of mV (millivolts) is sufficient to unbalance the load carried by each So, putting two regulators in parallel is not a good idea. There are circuits on the 'net which connect an external transistor to boost the output of a single regulator. It's slightly tricky because, unless you calculate a couple of resistors really well, the protection circuit won't work well. And connecting an extra transistor usually means the voltage drop across the regulator has to be at least 0.7V more.
H: How do you implement wifi with a front-end chip? I was looking around for a solution to hook up an application with an MCU to a wifi network. I'm basically looking for a chip that can talk to my MCU via an interface like I2C or SPI and is able to connect to a wifi network so that I can do some IP traffic. I'm okay with putting my own antenna and the necessary RLC stuff on the PCB. I've found a bunch of really expensive modules which didn't seem very interesting (and were basically a lot bigger than I expected) and I've found the max2831 which looks like it might be good enough for the job. However the data sheet doesn't contain too much detail about how to actually use the chip, ie. how to send commands to it, what kind of commands there, etc. The manufacturer says that this is just a "WLAN front-end solution", so I'm getting the impression that this chip isn't what I'm looking for, or at least isn't what I expected. I googled around but didn't find any information about how to actually use this chip to connect to a wifi network and send/receive data. Could anybody please shed some light on what exactly a "WLAN front-end" means and how to use it to implement the ability to connect to a wifi network? AI: Short answer: you combine it with a backend :-) The MAX2831 you mention is a transceiver and that is all it does. As the manufacturer says, its a "frontend". What you miss is the "backend". Guess which part is even more complicated ? ;-) The frontend contains only the radios needed to send (TX) and receive (RX) ! It does NOT generate the WiFi signal, I mean, in principle (ignoring some details) you could also use it to send and receive Bluetooth or Zigbee signals (which will need to be generated by a backend IC). In other words, what is also needed is the modem. The modem is the backend and it takes care of the Wifi protocol, what frequency must be used (it controls the frontend besides sending and receiving the data) sets the bitrate etc, etc... Indeed as pcj50 suggests, you're far better of with a complete module. Also, this will be cheaper as there are special components required to build a complete working Wifi module and these components might not be that easy to acquire and/or very expensive (as you would probably buy 1 instead of 1000). Another thing is that on the software side the ESP8266 will be far easier, anything else (not a module I mean) and you might have to write your own drivers to talk to the backend. Ouch.
H: Load switch correctly wiring I need to use this load switch http://www.semicon.toshiba.co.jp/info/docget.jsp?type=datasheet&lang=en&pid=TCK106G . This load switch will be controlled by an MCU. Since at startup MCU have floating pins(I suppose in every MCU), I want to ask if, to ensure that load switch will be always off until MCU decide to power it on, I should pull down CONTROL pin. AI: The datasheet covers two different types of chips. The TCK106G and TCK107G are active-high switches and include (see page 5) an internal mega-ohm sized pull-down resistor. This means that even if the control input is floating the switch will be held in the off position. However, this pull-down resistance is very high and you would be wise to add an external 10K-100K resistor as any noise or interference could overwhelm it and cause the switch to trigger unexpectedly. If you are using the alternate TCK108G (active low variant) then you will need to fit an external pull-up resistor. You are correct that most microcontroller ports are floated during startup, but you should carefully check the datasheet for your device as this is not always universal.
H: Troubleshooting PCB of an ATX power supply? Im new to PCBs, know the basics of electronics and testing of individual components. I have a PCB (of an ATX supply) that is not working when I power it, so I thought of testing each components like resistors, transistors, diodes, capacitors etc. Since all these components are in-circuit together, is it possible to test them with a multimeter without removing them from the PCB, as I am doubtful whether the other in-circuit components should affect the meter reading? I could not find a direct answer on the net, that is why I ask here. My browsing ended up with partial answers that, first you need to desolder each component completely and test individually, or desolder all legs except one being back on board and then test them, wouldn't that a be a tedious process. I have read that the order best to be followed for PCB testing goes like visual inspection of blown or cracked components or broken PCB tracks, inspection for heated components when powered, replacing ICs and running the PCB for a check for faulty ICs. I would like to know the correct order and how to test basic PCB components whether in-circuit or not, if in-circuit do I have to power up the PCB. Saw few costly devices are available for PCB troubleshooting on markets, can't we do this at home with our cheap multimeters? Well while working with electronics I felt the need for a DC bench power supply, and that is when I found on the net to convert an ATX to DC power supply, so thought of repairing my old one. Therefore I to need to get the ATX power supply working first. My real problem with the ATX supply having a 20 pin motherboard connector is that, when I connect it to the supply and jump PS_ON#(Green) and COM(Black) pins, the fan doesn`t turn nor I get a voltage reading across other pins (except a 5V reading across COM and 5VSB pins). How should I start to troubleshoot my device and make it working. AI: The order and method to debug and root cause the failure depends on the individuals experience and skills. A multimeter is capable of assisting a root cause analysis process to a great extend, but depending on the complexity of the circuit you need other tools too. I am assuming that you have the electrical schematic diagram, PCB Layout and part placement drawing for the circuit. For starter the following follow might work. Power up the PCB and check if the initial power supply stage is functioning and supplying the necessary power to the next stage. Provide the necessary signal inputs check if the inputs are received by the subsequent stage and processed Check to see which of the outputs are active At this point you will have dig deeper, it is difficult to advise with much knowledge of the circuit. Edit: Now that we know that your circuit board is an ATX power supply the simplest debugging suggestion is to check if the 5VSB (Stand by supply) is active. With the multimeter check if you have 5V on this line. Below are to images to help you. As far as I understand if you pull down the PS_ON (Green wire) the PWR_OK line will go high. This is a indication your power supply is good. Below is power supply timing sequence from Intel specification. Also attach some notes about PS_ON and PWR_OK Your may find the reference below helpful too. Be Safe, Be careful, and Good Luck References: Dangers of Old ATX Power Supplies? Using PWR_OK to Activate an ATX Power Supply Automatically ATX (Advanced Technology eXtended) How to Convert a Computer ATX Power Supply to a Lab Power Supply Standard ATX power supply ATX power supply specification question ATX power supply design guide
H: Problem with IAP I'm using LPC1788 IAP to write to Flash and I'm a little confused on what's going on. I'm trying to write 8 bytes of data to Flash memory with 2 tehniques: 1) With one which is logical to me and it doesn't work for(i=0; i<8; i++) { iap_copy_to_flash(&serial_no[i], OFFSET_SERIAL+i, 1); } 2) With one which is not logical to me and it works iap_copy_to_flash((BYTE*)serial_no, OFFSET_SERIAL, 8); OFFSET SERIAL is 0x00040000 and serial_no[8] is array of BYTES Why first won't work and second works? I'm only getting problem when writing array to Flash sector, when writing BYTE, WORD, DWORD variables everything is okay. Here is iap_copy_to_flash function http://pastebin.com/gNBkVWef and copy_ram_to_flash function http://pastebin.com/uVptXD2D. I will be very thankful if someone explains to me what is wrong with my thinking. Thanks. AI: Look in the documentation for those IAP functions. LPC17xx does not allow byte writes to flash, and I am not sure whether DWORD writes are alowed either. The flash memory itself is wider than one byte (actually 64 bits IIRC) - so you cannot write a single byte without touching others.
H: Eagle will not finish auto routing? Using Eagle for mac, I am trying to autoroute the board. I have set the trace width to 8. He start the process and it takes him about 2 minutes, than he stops at some point and show the next percentage (see the image ). Why it stops on 84%? I could see other people on 97% , but why is that? How can I fix that in the most fastest and simplest way? AI: Something that is inherently difficult can't be made easy. A few tips to get better results, most are in the comments too: place the components carefully. look at what the autorouter has produced, especially at the places where he had to take weird roues, or could not route at all, and think of a better way to arrange your components. Another way to approach this is to vieuw the ratsnet lines, imagine they are all elastic wires pulling at the components, and imagine where that would draw each component. BTW placing includes rotating and mirroring to the other side (if you want to allow that). route the 'obvious' traces by hand, save your PCB, and then start the autorouter. you can route a trace whith the rest of the traces in mind, an autorouter is stupid and looks at one trace at a time. Even when I use the autorouter, I often first route the power and ground traces (and other high-current or noise-sensitive traces, if any) myself. That is a good moment to check the placement of your decoupling capacitors! use a finer routing grid (as always, this is a trade-off: a finer grid has more routing opportunities, but also takes more time to autoroute) use smaller via's, finer traces, smaller distances, more layers. but check with your PCB manufacturer! use a bigger PCB so there is more room between the components for traces. play with the autorouters settings, especially the cost of via's and the preferred direction on each layer. My experience (in hand routing) is that strictly keeping to (for instance) horizontal on the top and vertical on the bottom often gives better results in the end than making that shortcut to a nearby pad in the 'other' direction. (You can make such shortcuts after full routing to clean up the design.) route yourself. even if you don't use the result, it will give you a better feeling for what the issues of routing are. (One of my sons (then 12y old) played routing with the concenration that he otherwise reserved for video games.)
H: Can I create paths to two external GPS antennae but use only one I am making a PCB for a SIM968 GSM/GPS device. Printing PCBs in my country is expensive. I am making this PCB for two different purposes. One is to work in an open environment where there is enough GNSS satellite signal is evident. In this case size has to be minimal and I wish to solder the GNSS antenna on to the PCB and let the signals flow in to the RF in of the SIM968 GPS engine. In the second scenario, I wish to connect an external active GNSS antenna because of the harsh environment problem. At this time there will be no PCB GNSS antenna soldered to the PCB. In both situations, I will only have one antenna connected to the SIM968 at a time. Therefore there will surely be no out of the phase cancellation or reduction of signal strength due to signals from both antennae. However I wish to divide my 50 Ohm characteristic impedance line into two to accommodate space to fix both antennae. I made my self more clear through the image below. I do not want to accommodate another antenna switching IC. Please be kind enough to let me know if this approach is flawed. I would so much appreciate your design views and any other information I should keep in my mind while I am designing the PCB. All PCB paths to antennae will of 50 ohm characteristic impedance. AI: If I understand correctly you want to make one PCB to fit both scenarios. I would do this with a 0 ohm resistor, connecting to either one or the other antenna. Maybe there is already a coupling capacitor in the trace to the antenne then you could use this. To minimize the impact on the 50 ohm impedance of the transmission line maybe you could place not 2 but 3 solder pads for the 0 ohm resistor or the capacitor. Then depending on which 2 (of the 3 pads) the component is soldered, antenna 1 or antenna 2 is connected.
H: When untied inputs are necessary, what is the technology to use for an OR gate? What is the best technology to implement for an OR gate when there will be an open input? I would prefer a common IC. I wired a quadruple 2 input positive OR gate, HD74LS32P. I have a PWM signal coming in the 1A input. The 1B input will have another PWM signal coming in when it is powered on. But there may be the case when it is not powered on. Unfortunately for me, when powered off, the signal line 1B becomes high and thus the output 1Y is high. I need 1B to be low when the 1B device is powered off. I read on this site that I should tie the unused pins to something, and can implement that. AI: You can tie the input to ground, directly or through a jumper (jumper is useful if you want to change something later). Tying an input of an 'OR' gate to logic '1' would not make much sense since the output would always be high, but if you want to do that, it's good practice to use a series resistor of about 1K with LSTTL (practice from TTL days). If you are using LSTTL or TTL, leaving an input open will result in a logic '1' but it can also pick up noise. If you use HC or other CMOS logic families you should always tie all unused inputs either high or low, on all gates (even unused ones- this is good practice with TTL/LSTTL but essential with CMOS).
H: Help identifying those parts SG7 / EA336L / M71A / 8246 / K333CD? Could someone tell me what is those parts are used for? I tried googling on them but with no results Attached is the picture on their borad, it's a podometer AI: The part labeled K333CD seems to be a low frequency oscillator / quarz. My guess would be it is a watch crystal running at 32.768 kHz. The component labeled EA336L could be a linear regulator (3.3V output). The part labeled SG7 is probably a small EEPROM. That part labeled 8246 seems to be a bit harder to crack. Maybe by knowing what/where that bluetooth-module comes from, or be really reverse engineering the board and check what it actually connects to, you could get an idea where you actually should look. Of course, this is just logical deduction based on my experience, and you should definately investigate further (by measuring and researching) to confirm my statements.
H: Value of Drain Current in BSIM3v3 in triode region Here the value of drain current has been given as per the BSIM3v3 MOSFET model, but is there any reference where it has been shown how this value was calculated and what is the meaning of the symbols such as IDSAT0? AI: You can find a more extensive description of the BSIM3v3 model in this document. There are some formulas for Idsat in this document but I do not know if they can be used with the formula in your question. In my opinion unless you're a modeling engineer there isn't much need to understand such a model in detail. Also, there are other models like MOS Model 9, 10 and 11 by NXP (they inherited that from Philips) and BSIM4. The EKV model is also an interesting one :-) In general, for manual calculation you want a simple 1st order model as is described in most textbooks. So I find it a bit strange to grab a formula from BSIM3v3 but not explain the variables used in that formula.
H: Calculate a voltage angle offset for a 3-Phase utility meter I'm trying to analyze and write a program around some data that I was given. The data is a collection of readings from 3 Phase smart meters of an electrical utility. One value in the data that I can not for the life of me understand is something called a "Voltage Angle Offset" or VAO. Here is what a few records of data look like for each of the phases: Volts Amps Angle Power Factor VAO 124,121,220 23.3,45.3,20.4 0,180,270 353,356,270 7,4,90 122,122,213 9.3,8.9,9.1 0,180,270 44,280,15 44,80,15 121,121,210 27,21.9,13.1 0,180,270 18,25,273 18,25,87 122,122,212 7.9,7.7,9.7 0,180,270 52,299,310 52,61,50 124,125,216 13.1,11.6,12.9 0,180,270 303,246,270 57,114,90 123,123,214 9.4,11,13.9 0,180,270 126,34,86 126,34,86 122,122,212 12.7,21.8,24.2 0,180,270 23,298,356 23,62,4 122,121,206 36.8,50.7,38 0,180,270 125,36,46 125,36,46 I can't figure out how one would calculate the VAO given the other bits of information. I'm not an electrical engineer by any meaning of the word (a computer programmer, actually), so perhaps I'm interpreting the data completely wrong. Any insight? AI: VAO is the angle by which the power factor (expressed as an angle) is away from zero degrees relative to its phase regardless of whether it is leading or lagging. ie 0 degrees and 360 degrees are the same angle = resistive. VAO is either PF if PF is < 180 so PF - VAO = 0 360 - PF if PF > 180 so PF + VAO = 360 Clear as mud! :-) - don't worry - it's one of those Doh! things. Stare at what I've written, look at the figures and tables and suddenly it will go 'boing' and be completely obvious. Impossible to "unsee" once seen - like eg Old hag turns into beautiful girl illusion, or theatre curtains fold other way or ...)
H: Is there a standard for maximum torque that should be used to fasten PCBs to an enclosure? I am looking for a standard or guideline which describes how much torque should be used to fasten a PCB to an enclosure using different types of fasteners. For example, we use M3 hex nuts in a system. There are ~25 people doing assembly. We do not want everyone to guess how tight the nut should be turned. We would rather give an appropriate tool to everyone and make sure each PCB is fastened the same way. AI: It depends most on what and how you are fastening. Many different materials will have different properties. For example, the compressive strength of FR4 material is at least 460MPa, or 460N/mm^2. That number is one you want to stay well clear of, especially if you have multi-layer boards (since you don't know the exact specs of the prepreg your fab uses). So let's say "definitely don't go over 100N/mm^2". Now here's the rub. That's the compression strength, but it does mean you have to have proper rings to prevent extra warping forces when the nut is tightened and even then some warping may still happen if tightened too far. Then how that translates to a Nm reading depends on: The surface area of the rings you use: Smallest surface determines the maximum number of downward Newtons. The threading on the bolt; It's neatness and the number of threads per unit length. Doubtless there's conversion charts for that on the internet for certain types of screws, but I couldn't find them just now (though I did only spend about 1 minute searching, since that's also what it took to get the compression strength of FR4). All that said, I do think the tiny surface area of the threads on your screws, unless you use 13.9 grade metal, maybe, will be the weakest link in your system. The cheap DIY store screws will definitely break before up to 8 layers of PCB. So will, as I know from experience, RVS A2 screws. That is, I did once split a 4 layer board with an M4 screw and two washers, but the RVS A2 one broke on hand-tightening, then I took out a military grade 13.9 one and needed a power wrench to tighten it enough to crack open. But if you want to stay super safe, get the data of a brass spacer in the thread size you use and then apply the maximum allowable torque for that, even if you use harder types of fasteners, a metalised PCB hole will certainly survive quite well. Brass spacers are relatively weak compared to FR4 compression strengths and usually with brass spacers you can still tighten stuff well enough to mount PCBs and such.
H: Which circuit is better for low-noise, high-precision light sensing? Circuit #1: Circuit #2 (R is small, and Vout is amplified using the same op amp in the above circuit, which is not included in the image below): My voltmeter (an ADC) has a low input impedance (10k Ohms). AI: The first one (transimpedance amplifier) will have a much better high frequency response. If you want to reduce the high frequency response you can add a parallel capacitor across the feedback resistor. The second will have frequency response limited by the photodiode capacitance. Here is a TI application note on calculating noise in a transimpedance amplifier. In the second case, you'll have an amplifier with voltage and current noise spectra and Johnson-Nyquist noise in the resistor. There is also shot noise in the photodiode.
H: Impedance matching routes in Eagle board I am making my second board using Eagle CAD. I have different components with a set of different sizes. I set the minimum width for lines to be x. That way, the autorouter creates EVERY line in that width. The problem is that other components are wider, so I think I'd need to somehow widen the lines on the connections to that component (or probably not, the highest frequency in my circuit is of 16 MHz). How may I do that? AI: Your wavelength at 16 MHz is 18.75 meters. Unless the traces are very long, you shouldn't have impedance matching problems (rule of thumb is wavelength/10)
H: Which GND pin do I use on a DAQ? I'm trying to use an absolute shaft encoder with an NI MyDAQ. I'm powering the encoder using the 5VDC pin on the DAQ. Does the ground pin--AGND vs. DGND--I connect the shaft encoder to matter? I started with the DGND since I was powering the encoder with DC, but my angle reading steadily "floated" down. For example, I would initially read a angle max of "-170" and an angle "min" of -130. However, the two extremes would then begin to float down to -171 and -131, -172 and -132, -173 and -133, and so on. I switched over to AGND, but I experienced the same phenomenon. I realize my problem is independent of ground pins, but I'd like to know which GND pin is the correct pin for my application or if it truly doesn't matter. AI: DGND and AGND are both ok grounds to use. Depending on MyDaq breakout box configuration they are most likely coupled together internally and there is no harm tying them together under most set ups. The difference is there to avoid mixing signals with different noise sensitivity by splitting up their current return paths. Digital signals are noisy and the voltage they generate across small impedance in the ground return path can couple into sensitive analog signals sharing the same ground. In more complex set ups, for instance where you are using your Daq to measure voltage levels as well as control digital logic, you would need to think about your ground wiring to make sure everything operates with minimal noise and error. Otherwise please review your manual since they will have application suggestions and typical wiring diagrams.
H: DC Motor: Difference between E and k? I'm studying for an exam, and have come across a question I don't. really understand The question gives us a back-emf constant and asks for a rated back-emf. Now I know that the back-emf constant is k, but the rated back-emf confused me at first. When the lecture went through the questions, what he said confused me. The lecturer says that the rated back-emf is E? I don't understand how the back-emf can be both E and k at the same time. What exactly is the difference between E and k? I think the main question I am asking is what exactly is this question asking me to do? Here is the question: A DC machine has a back-emf constant of 0.24 V/(rad/s) and a resistance of 0.5 ohms. It is operating from a 12V DC power supply. At its rated speed of 400 rpm, calculate its rated back-emf (that is, the back-emf at rated speed). AI: There are two key constants with respect to electrical machines 1) \$K_e\$ The BackEMF constant. Units in Volts/rpm (volts/rads ...) -> what voltage will be generated at the terminals if the rotor is spinning. 2) \$K_t\$ The Torque constant. Units in Nm/A - What torque will be generated if current is injected into the stator (there is a 3rd... \$K_v\$, velocity constant, the reciprocal of \$K_e\$, rpm/Volts) - what speed the rotor could spin at for a given applied voltage In theory \$K_t\$ = \$K_e\$. In practice, \$K_t\$ < \$K_e\$ as \$K_t\$ is taken at rated current & corresponds to Iron saturation. So the question: A DC machine has a back-emf constant of 0.24 V/(rad/s) and a resistance of 0.5 ohms. It is operating from a 12V DC power supply. At its rated speed of 400 rpm, calculate its rated back-emf (that is, the back-emf at rated speed). We thus know \$K_e\$ = 0.24V/rad/s We also know the rpm = 400rpm convert rpm to rad/s: \$ \omega = \frac{rpm * 2 * \pi}{60} = 41.8879rad/s \$ There is one more step to get the rated terminal voltage, but I will leave that
H: Name of the Samsung Galaxy end of charger This is probably a weird question to ask but I am looking for the end "jack" of the Samsung Galaxy S3, S4 etc charger name. Is not the USB side of the cable, is the actual bit which goes inside the phone. I looked online with various names and I cannot find the name for it. I know the headphones side is called "jack" but not the charger bit apparently. Anyone willing to help me please? Thank you. AI: I think this has everything to do with electronic design because you can't spec a part if you don't know what to call it. I believe the part you are looking for is a Female Micro B USB connector, which apparently are pretty cheap. :EDIT: I re-read your question and I'm not entirely clear on what aspect of the charging cable you're talking about. The Samsung charger uses a base, which is the 110VAC to a Type A Female USB connector. The cable has a Type A Male USB connector on one end and a Male Micro B USB connector on the other end. Here's a link to the USB connector sizes, too.
H: Does a coiled wire have a higher resistance than straight wire? If you take a straight piece of wire that is insulated and coil it around a non ferrous object like piece of wood would the resistance change? AI: The simple answer is no. Winding wire on a non-ferrous form will not change its resistance. Of course, it all depends on the details. If the wire is uninsulated, and the form is conductive (copper, silver, gold, platinum, etc) the form will short out the wire turns and reduce the total resistance. Or were you thinking of insulated wire? You didn't say. Ah, you say, but it is insulated. To be precise, it's insulated with enamel, and called magnet wire. Well, now it gets tricky. Let's assume your reference point is a straight wire suspended between two contacts in still air. As you run current through the wire, it will heat up, even if only slightly, and for most wire materials the resistance will change. If the wire is now wound around a form of some material, the form will change the rate at which power is dissipated to the environment, and thus the resistance. A thermal insulator, such as foam, will increase the temperature of the wire. A good thermal conductor, such as silver, will tend to reduce the temperature changes, and even this effect depends on the physical details of the form to determine the long-term temperature effects. Size and shape will matter, and the result can, in principle, go either way.
H: Alternative to ZIF socket and alligator clips As we know ZIF socket holds ICs and enables us to add or remove easily. Is there anything for axial elements such as resistor or diodes for holding them without bending those elements? The problem of ZIF is bending the element The problem of alligator clips is that the clip is not tight to PCB and it is messy. My purpose is to test an axial element by a circuit without damaging the pins of it. AI: Most alligator clips have a hole at the end opposite the grabber part, often used for soldering a wire onto. However you could use that to mount the alligator clips so they stick off one end of a PCB, like this:
H: Why do we short the input when calculating the output impedance? I believe the title says everything about the question. My issue has to to do with the following: Consider a two-port given by: $$V_1 = Z_{11}I_1 + Z_{12}I_2$$ $$V_2 = Z_{21}I_1 + Z_{22}I_2$$ Cleary by the equations above, one would expect that the measurement of the \$Z_{ij}\$ parameters to be performed while keeping one port at a time in open loop configuration to guarantee \$I = 0\$ for the "unwanted" current. However this seems not to be the case, as can be seen for instance in the derivation of the of the output resistance of a simple CE amplifier where the input is shorted to determine the output resistance. What am I missing here? AI: The two test configurations tell you two different things. If you short the input, you're testing the output impedance of the circuit as it is normally used. This is because you typically drive the circuit with a (relatively) low impedance source. If you open the input, you get the \$Z_{22}\$ as defined in circuit theory as a characteristic of the circuit itself (without effects from any driving circuit). The first option is often more practically useful.
H: Capacitor connected directly with battery This may be a dumb/begginer question, but I'm having trouble to understand what exactly happens when we connect a real capacitor directly with a battery. In my understanding, theoretically, when an uncharged capacitor is connected directly to a battery of, let's say, 9 volts, instantly the capacitor will be charged and its voltage will also become 9V. This will happen because there is no resistance between the capacitor and the battery, so the variation of current by time will be infinite. Obviously, this is true when talking about ideal components and non-realistic circuits. I thought that doing it in real life would cause sparks, damaged components, explosions, or whatever. However, I saw some videos and people usually do connect batteries directly with capacitors. Also, the current that flows from the battery to the capacitor is somehow of low magnitude, since it takes some considerable time to make the capacitor have the same voltage as the battery. I would like to know why this happens, thanks. This is an example of the circuit I talked about: AI: Both the battery and the capacitor have an internal resistance. Your capacitor looks a bit like this on the inside: simulate this circuit – Schematic created using CircuitLab Of course, I don't know your capacitor, so I don't know the exact internal resistance, but 3Ohm will be a close enough approximation. The same happens in your battery, so in fact you are doing this: simulate this circuit So now for a tiny amount of time the current will be maximum, but it is only about 0.9A Of course when you put a capacitor onto a battery like that, you will not make great contact, so there will be some extra resistance there as well, so it might even be 0.7A. The reason it now takes time, is that when the capacitor charges, the voltage across the resistors decreases, so the current decreases as well, so the voltage on the capacitor will increase more slowly, and so on and so on, so it will actually approach the battery voltage slower and slower. The larger the resistors or the capacitors the more time it will take. The moment it is at 67% can be calculated by R * C. So in the example that is: t(67%) = R * C = 10 * 220u = 2.2ms. But if the capacitor is 22000uF (= 22mF) then the RC-time, as it is called, will be 220ms, or 0.22s for it to charge with a total resistance of 10Ohm. But with a capacitor that size it might also have a slightly higher resistance, so that'll make it even slower. And then it's only at 67%. The next 30% will take much more time. EDIT: Note; increased the 9V-bat resistance as per Nick's comment.
H: Altium: the shortcut key +/- don't move me to the next layers I have created multiple layers from the stack layer manager. Also created vias from layer 1 to 2, and 1 to 3. When I clicked okay, the layer image didn't get updated, meaning it didnt add the vias I created (not sure if this is normal). My guess is that because the vias weren't created, altium can't move me to the next layers. But then again, I have the default vias between layer 1 and last layer. Which brings us back to the main question, why is my shortcut keys not working? AI: Probably because you are using a laptop, it happened to me, it only works with the numerical pad. There are some workarounds, have a look at this thread: Altium keyboard shortcuts issues
H: Eagle Change Isolation of all Polygons I drew my pcb in eagle with polygons' isolation is set to 0(default) but I need to change it to 0.35mm. I have lots of polygons, doing it manually is too hard. Is there a way to change all polygon's isolation? AI: I personally do not know a way of globally changing polygon's isolation but a method I would use to make it quicker is to type in the command bar: 'Change isolate '0.35mm'' and then you can easily click on each polygon and it is much quicker than manually right clicking and changing properties. I have just found out that the isolate parameter is only applicable to polygons. So to do it more quickly you can 'group' your entire PCB board and using the same command as above (or going through the tool bar menu) right-click and select change group - this will apply the change to all of your polygons without having to click many times!
H: Thevenin equivalent in a nonlinear circuit Is it possible to use the Thevenin equivalent of a voltage divider driving an emitter follower? simulate this circuit – Schematic created using CircuitLab In general, when is it safe to use the Thevenin equivalent of a source if it is connected to nonlinear components? Common exercises always imply a resistor as the load. AI: Yes, it is possible to use the Thevenin equivalent of a voltage divider driving an emitter follower. The subcircuit you are replacing by a Thevenin Equivalent is a linear circuit (just the part consisting of 15V constant voltage source and the voltage divider; you are not replacing any of the non-linear part). Therfore using the Thevenin Equivalent for the subcircuit is not only an approximation, it is completely equivalent and perfectly ok. It doesn't matter that that subcircuit is connected to a non-linear subcircuit. If you would put both implentations of the linear subcircuit each in a black box, there'd be no way to distingiush them from outside; not even by connecting an external non-linear circuit like your emitter follower. That's why it is called Thevenin Equivalent and not Thevenin Approximation. What you can not do (in general) is to replace the non-linear subcircuit (right part with transistor) by a Thevenin Equivalent. There isn't a definition of a Thevenin Equivalent for a non-linear circuit.
H: How to calculate the voltage across the load of this circuit I have this rechargeable night lamp which I built it using the circuit which I got it over the internet.There is no problem with the night lamp but I just wanted study the working of the circuit but I am not able to calculate the parameter like voltage. can Anyone help me out with this. i just want to know how to calculate the voltage 'V' in the cicruit. AI: EDIT: Your circuit has a dangerous flaw. The peak voltage of a 220VAC source is over 300V, far higher than the rating of the capacitor in your circuit. I would remove this device from your wall outlet immediately and not trust schematics you find on the internet. Capacitors exhibit a property called reactance. It's measured in Ohms (\$\Omega\$), so it's mathematically equivalent to resistance. In an AC circuit, a capacitor "looks like" a resistor that varies with frequency. The faster the AC frequency, the lower the reactance of the capacitor. At 0Hz, or DC, the reactance is infinite, which is exactly what you'd expect if you put a capacitor in series with a DC voltage source. The equation for the reactance of a capacitor is: $$X_{cap}=\frac{1}{2*\pi*f*C}$$ For the circuit you presented, the reactance would be: $$X_{cap}=\frac{1}{2*\pi*50*1uF}=3183\Omega$$ Now that we have the reactance of the capacitor, it can be modeled as a resistor in the circuit. Applying Ohm's Law, we can solve for current: $$I=\frac{V}{R}=\frac{V}{X_{cap}}=\frac{220}{3183}=69mA$$ Note that the relevant value here is current, not voltage. This type of circuit, known as a capacitive power supply, acts as a current source, not a voltage source. That means the voltage downstream of the capacitor will vary as needed to maintain approximately 69mA. For your circuit, the voltage will change based on whether the switch is closed or open (the LEDs on or off). It will also change based on the charge state of the battery. 69mA will always be shared between the battery and the LEDs (or the just the battery if the switch is open). If you want to think of this circuit in a more general form, replace the battery and LEDs with a 1\$\Omega\$ resistor. Now we can use Ohm's Law again to calculate the voltage across that resistor with 69mA going through it. The voltage would be 69mV. A few things to note: Since you have no smoothing capacitor downstream of the rectifier, the current will be AC. The calculation of 69mA is actually the average current of the rectified sinusoidal waveform. It will peak between zero Amps and \$\frac{220V*\sqrt{2}}{3183\Omega}\$ Amps. 69mA is the ideal supply current assuming there is no load resistance or line losses. The battery and LEDs have internal resistance which sum with the capacitor's reactance when applying Ohm's Law. For example, if the total resistance of the load was 100\$\Omega\$, the calculation would be \$I=\frac{220}{3183+100}=67mA\$ instead of 69mA. The large resistor across the capacitor can be ignored for these calculations. It exists to safely discharge the capacitor when the circuit is unplugged from the wall outlet. While the circuit is plugged in, it has a negligible effect.
H: Long 24V DC cable not working We have a really weird issue which we just cannot get our head around. In high level: We have a unit which contains some electronics, we can access it with 4 cables 2 for power and 2 for communications. The power is 24V DC and communications is RS485. We could not establish communication using a 10m test lead, it has been noticed that when we moved the cable the device functioned sometimes. The conclusion we drew was that the cable was broken somewhere. The cable was cut shorter to around 1m long and worked like a charm. Fixing: We tried to use two other long cables as we still needed to be sure that the system works with the required cable length. It did not work. This is when we started to do some more testing and try to rule out the possible faults: Correct length power and comms cable works fine with test apparatus Short power and comms cable works fine for our actual apparatus Short power and long com works fine for our actual apparatus Long power short comms does not work with out actual apparatus Long power and long comms does not work with our actual apparatus We have concluded that the issue is with the power cable. The only variable that seems to have an effect is length of the power cable. We have experimented with three different long cables of different qualities, none of which have any effect. We have one of the electronic components(comms and power as well) as a spare unit which we have tested with the same long cable and it does work. In the unit it self which we are trying to fix we have a power converter (in 18-75V out 24V) which we have no spares for. We have called the manufacturer and asked if they have encountered anything similar but they said they have not. We have hooked up a multimeter to check the current draw, at short cable we get 0.6A while at long cable we pretty much have nothing. There is a really small voltage drop at the end of the cable. The power supply we use is 24-28V 15A we have set the power supply to around 25.6V at the end of the cable we had 25.4V. Currently we cannot access to any electronic as they are in an enclosure, we could open it up but we would like to avoid that if we can solve the issue without it. In short, how could the length of the power cable effect the current draw from the system, why it would not draw anything when the cable hits a certain length? Thank you in advance for any ideas you may share to help solve this problem. AI: One issue I have had in a similar situation (An underwater electronics pod on a few tens of meters of cable with power and RS485 control wiring), the fault was due to the voltage drop in the ground connection.... Essentially the IR losses in the supply negative connection (actually the cable screen) were sufficient that the control signals from the head were outside the RS485 common mode range of +12,-7V. Going to an isolated RS485 port at one end fixed it. One other gotcha with DC/DC bricks like that buck/boost you have is that they sometimes misbehave if the supply is insufficiently stiff on startup, try adding a fairly large electrolytic across the DC/DCs input to stiffen the supply.
H: I2C-to-SPI bridge and SD card I am using a PIC18F25k80 microprocessor, which is communicating by using I2C protocol with peripheral ICs. After collecting the data from the ICs I want to store them in an SD card. However for the SD card I need to transfer the data by using an SPI protocol, since it cannot operate with a low data transfer protocol. For that reason I put an I2c-to-SPI bridge (SC18IS602BIPW) on the bus. By writing the address of the interface bridge, followed by a 0 (control bit / write), on the I2C bus you can communicate with it. After the address a predefined function needs to follow (the functions are explained inside the datasheet) and then a series of data, which can be 0-200 bytes long. The data is stored in a buffer inside the interface bridge chip and then are automatically sent over SPI to a device. The predefined function determined the chip select bit and thus, the device with which the bridge is communicating. I want to initialise a file system on the SD card, so that I can create files where my data is going to be stored. How can I use the function inside the FSIO.h in order to do that. Do I need to send the functions over the bus to the SD card and if yes how can I do that? Interface Bridge datasheet: http://www.nxp.com/documents/data_sheet/SC18IS602B.pdf AI: You will struggle to make this system work. An SD card offers a block-structured file system, which requires writes of full blocks of at least 512 bytes. Your bridge only supports 200-byte blocks. Also the slow speed of I²C will give you trouble. Transferring 512 bytes over the 400 kbit/s I²C link will take approximately 10 ms. Finally, you will need to write a software driver layer to drive the SD card through the bridge. This will take a lot of effort. I notice the PPC18F2580 has an SPI interface. You should use the SPI interface to talk to the SD card and use the I²C interface to talk to the sensors. There should not be a need for the bridge.
H: AC circuit with unusually placed transformer Here's the circuit: simulate this circuit – Schematic created using CircuitLab $$I=2.25,0° mA$$ What's the $$n=N1/N2$$ of the transformer so that on R3 most power is dissipated. Power? U1? What I don't know is what to do with the transformer. When it's in parallel I know. I just need help with that, else I think I would manage. AI: What I don't know is what to do with the transformer. When it's in parallel I know. I just need help with that, else I think I would manage. It's called an "auto transformer. It obeys the usual rules for an ideal transformer Call the voltage at the right hand end of R2 "Vin" Short: Vin is divided between N1 & N2 in the ratio of their turns (as in any transformer) so - \$ Vout = \dfrac{N2}{N1+N2} \$ Longer: $$ Vn2 = Vn1 \times N2/N1 \tag1 $$ So $$ Vn1 = Vn2 \times N1/N2 \tag2 $$ By inspection $$ Vin = Vn1 + Vn2 \tag3 $$ So $$ Vn1 = Vin - Vn2 ... \tag4 $$ From 2 & 4 $$ Vn2 \times N1/N2 = Vin - Vn2 $$ $$ Vn2 \times (N1/N2 +1 ) = Vin $$ $$ Vn2 = \dfrac{Vin}{N1/N2 + 1} $$ $$ Vn2 = \dfrac{Vin}{(N1 + N2) / N2} $$ $$ Vn2 = \dfrac{Vin \times N2}{N1 + N2} $$ i.e., MUCH more simply, Vin is divided across N1 and N2 in the ratio of their turns. Example If N1:N2 = 1:9 Vout is 90% of Vin. If N1:N2 = 9:1 Vout is 10% of Vin. Wikipedia - autotransformer Autotransformer basics Autotransformers Many examples
H: Current flow through resistor and insufficient source In a simple circuit consists of a source and resistor, according to Ohm's law, if 10V is applied to a 10 ohm resistor, the current flow through the circuit will be 1A. But what if the source in this circuit has a max output of 0.5A? What happens in that case? AI: Then you won't get 10V across the resistor, you would get 0.5 * 10 = 5V across this resistor, by V=IR. The resistance is fixed but you have varied the current so the across voltage changes. The other 5V will be across the current limiting element.
H: Fresh IMX6 IC booting I have new custom development board ready for IMX6 which is similar design of Sabre board. But, I would like to know whether the new IC ( MCIMX6Q5EY10AD ) is having u-boot or not. AI: U-boot is not on the processor. You need to build it and copy to the SD CARD. Have a look at this post for detailed instructions. https://community.freescale.com/docs/DOC-95015
H: Best solution for compact wiring on stripboard When transferring a circuit from breadboard to stripboard, I often struggle to manage the wiring; often it starts looking like an overgrown garden; the components inevitably start disappearing under the wires. Not to mention the wires disappearing under each other, making mistakes near impossible to trace. But I want to keep the board as small as possible. What kind of wires should be (or could be, or are most often) used for low voltage, low current circuits? Up til now I've used the same wire as with the breadboard, (single strand) as I find it easy to work with since it retains its shape and I can route it round components. However, it's quite thick so doesn't lend itself to compact boards. See pic below: I searched on Google and decided that this looked like the neatest (or at least most manageable) stripboard circuit out of the results: What kind of wiring is that? I can't find any cable like it for sale. (At least not single core, but I don't fancy spending hours taking the outer sheath off ethernet cables or the like.) (I assume they're multi-strand.) The closest I can find is 30awg hook-up wire, but the outer diameter of that doesn't seem much less than what I use for breadboards. Advice would be great. Thanks AI: Wire wrapping with a proper tool is actually a great technique for building one-off circuits with lots of DIL ICs on. It's easier if you use sockets: http://www.jameco.com/1/3/dip-wire-wrap-ic-sockets although it adds to the cost. It can be less time-consuming than soldering thousands of joints by hand, too. http://makezine.com/2009/07/27/lost-knowledge-wire-wrapping/
H: Rotating a motor according to calculated output I have 13 photodiodes. Positive connection from battery is connected to the positive end of each photodiode. The position of photodiodes is as shown below: o o o o o o o o o o o o o I would like to connect a motor to the output of these photodiodes. Now when I throw infrared light on some photo diodes, they will give me 9V output as I have connected 9V battery, others will give 0 as output. Suppose I throw light on it as below: (generated number 1) o o 1 o 1 o o 1 o 1 o o 1 I want the motor to complete 15 iterations, stop there for 2 seconds and again complete 15 iterations in reverse direction Suppose I throw light on it as below: (generated number 2) 1 1 1 o 1 1 1 1 1 o 1 1 1 I want the motor to complete 30 iterations, stop there for 2 seconds and again complete 30 iterations in reverse direction Suppose I throw light on it as below: (generated number 3) 1 1 1 o 1 1 1 1 o 1 1 1 1 I want the motor to complete 45 iterations, stop there for 2 seconds and again complete 45 iterations in reverse direction And similarly... Can somebody just give me an idea of how can I accomplish the above mentioned task? and also what materials I would need? AI: You are going to need a microcontroller, with a large number of general purpose I/O pins. It could be done with discrete logic ICs, but it would be VERY complicated. You will need a motor controller to drive the motor (H-Bridge) You will need some way to detect each rotation of the motor so that your microcontroller can count the rotations. This could be mechanical (given the low number of turns) or you could use a photodiode, a light, and a reflective spot on the motor shaft. As mentioned in pjc50's answer, the photodiodes alone won't give you a clean on/off so you'll need some additional circuitry. Lighting just the photodiodes needed for a particular number might be kind of difficult. It might work better if you can put a cardboard cutout over the detectors and shine a larger light over the whole area. Use a 1 shaped cutout, shine the light, 15 rotations.
H: RC circuit with lossy capacitor This circuit simulate this circuit – Schematic created using CircuitLab can be regarded as an RC series circuit with a lossy capacitor. The time expression for \$V_C(t)\$ with \$R_2 \to \infty \$ is available here and it is \$V_C(t) = V_0 (1 - e^{-t/\tau})\$. I would like to obtain the same expression, but in this situation. \$ V_0 \$ is the DC voltage generator; the switch is closed for \$t \geq 0\$ and \$V_C (t = 0) = 0\$ (capacitor initially discharged). I can write $$\frac{V_0 - V_C (t)}{R_1} = I(t)$$ $$\frac{V_0}{R_1} - \frac{1}{R_1 C} \frac{dQ(t)}{dt} = I(t)$$ which is the current across \$R_1\$ and so the total corrent entering \$ C // R_2 \$. \$V_C (t)\$ is variable during the capacitor charge. The fact is that here \$I(t)\$ is not simply \$dQ(t) / dt\$, because not all the charge exiting from \$R_1\$ goes through the capacitor: part of it flows across \$R_2\$ and this amount of "leaked" charge changes (raises) with time. So, how can this be taken into account? Are there any hints to obtain a differential equation for the charge or the current of the capacitor? AI: The simplest way to analyze this circuit is to take V0, R1 and R2 as a group and find their Thévenin equivalent, with a different voltage and a new, single value of resistance. Then you can analyze it in the same way as the case with R2 = ∞.
H: VHDL: couldn't implement registers for assignments on this clock edge I'm getting the following errors: Error (10822): HDL error at pwm.vhd(15): couldn't implement registers for assignments on this clock edge Error (10822): HDL error at pwm.vhd(18): couldn't implement registers for assignments on this clock edge Obviously the problem is the two rising edges that both change 'output'. How could I fix this problem? code: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.std_logic_unsigned.all; entity PWM is port ( button1, button2 : in STD_LOGIC; output : inout STD_LOGIC_VECTOR(7 downto 0) := "00000000" ); end PWM; architecture behavioral of PWM is begin process (button1, button2) begin if rising_edge(button1) then output <= output + 1; end if; if rising_edge(button2) then output <= output - 1; end if; end process; end behavioral; AI: The circuit you describe is a register with two input clocks, which doesn't really exist. There are DDR registers, but that is not what you described. Futhermore, clocks are very special in a FPGA, and must be used with special care. A button is not a clock. Although it is possible to use normal signal as a clock, it is not recommended. What you need is a real clock to drive your circuit, every board has one! Then, you need to detect the rising edges of your button according to that clock domain: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; --use ieee.std_logic_unsigned.all; Do not use with numeric_std entity PWM is port( clk : in STD_LOGIC; button1, button2 : in STD_LOGIC; output : out STD_LOGIC_VECTOR(7 downto 0) ); end entity PWM; architecture behavioral of PWM is signal button1_r : std_logic_vector(2 downto 0); signal button2_r : std_logic_vector(2 downto 0); signal output_i : unsigned(7 downto 0) := (others => '0'); begin process(clk) begin if rising_edge(clk) then -- Shift the value of button in button_r -- The LSB is unused and is there solely for metastability button1_r <= button1_r(button1_r'left-1 downto 0) & button1; button2_r <= button2_r(button2_r'left-1 downto 0) & button2; if button1_r(button1_r'left downto button1_r'left-1) = "01" then -- Button1 rising output_i <= output_i + 1; elsif button2_r(button2_r'left downto button2_r'left-1) = "01" then -- Button2 rising output_i <= output_i - 1; end if; end if; end process; output <= std_logic_vector(output_i); end architecture behavioral; Several things to note: The output is controlled by a single clock The output is an out, not an inout. inout is a tristate buffer, which you don't need. We use an internal signal to represent the output, and assign the output to it Whenever an asynchronous signal (like your button) to a clock is used in that clock domain, metastability is a problem. I suggest you read on it, but it is solved by using two registers in row, the output of the first register (button1_r(0)) must not be used. Finally, physical buttons needs debouncing. As you push on it, the electrical connection goes on and off multiple times while the physical switch reaches its final position. Thus, it's likely that multiple rising edges of the buttons will be detected when you push it, incrementing the counter more than once.
H: 9V wallwart powering a fan via Raspberry Pi I have a fan rated at 12V, 0.14A, 12/0.14 = 85 Ohms (taken from an old PC case) and a wallwart that outputs 9V, 1A. I have connected the fan directly to the wallwart and it works fine. Now I'd like to connect them to the Raspberry Pi so I can turn the fan on and off using a simple script. The problem is that I've never done something like this (the electronics part), while I know some theory from school I've never applied it. So I decided that the 2N3053 transistor would be a fit choice for what I need (\$I_c = 0.7\text{A} > 0.14\$A of my fan and \$V_{ce} = 40\text{V} > 9\text{V}\$ of my wallwart) and then I proceeded with calculating the resistance I need to saturate this transistor: $$I_b = I_c/h_{\text{fe}}$$ $$I_b = 0.14\text{A}/50 = 0.0028\text{A}$$ $$R_b = \frac{3.3\text{V}}{3 \times 0.0028\text{A}} = 39.28\Omega$$ simulate this circuit – Schematic created using CircuitLab Is this OK? Would this work? If not, then please explain keeping in mind that I'm a beginner with these things. AI: I take it that you've used the multiplier factor of 3 over minimum hFE to ensure saturation. You seem to be missing the Vbe voltage, and to have slipped a decimal place, but the approach is valid. The base resistor would be: R = \$\frac{(V_{GPIO} - V_{BE})}{3\cdot 2.8mA}\$ Assuming the output voltage is 3V with that load, and Vbe is 0.7V R~= 270\$\Omega\$ The Rpi has programmable output current capability of up to 16mA but I've not easily found the specification of minimum output voltage at 8mA source current. Assuming it's in the 3V range, your circuit should work fine as is, with a 270 ohm base resistor. It might be a good idea to put a reverse-biased diode across the fan to deal with any inductance the motor windings have. Edit: Here is a typical fan controller chip (inside your 12V fan) output section: When your transistor turns off the energy stored in the inductance of the motor windings causes the voltage on the outputs to rise until the zener diodes conduct turning the transistors partially on, causing the chip to heat and wasting power. If you put a diode across the fan then more of the current will be used in the coils providing torque for the fan motor and resulting in less stress on the controller chip.
H: How do you convert a changing input (square wave) into a single high signal? I am designing a circuit which will output a square waveform for a specific duration of time (t) but I need to be able to read the square waveform using a processor so would like to turn the changing square waveform into a single high pulse for time (t). The frequency of the waveform could be too high for the processor to read directly so I am looking for a method to convert it to a single high pulse (with duration t). I first thought about using a small capacitor which would be charged up during the rise of the square waveform and then be discharged through the low part of the waveform but I am unsure if this would work and what value the capacitor would need to be. Ideally I need way which does not use ICs (simple discrete components only would be best). Any ideas? Dan AI: You need a retriggerable one-shot, like the 74HC423 The first rising edge will make the output high, and each subsequent rising edge will keep it high. The output will not go low until there is a time period between rising edges that exceed the output pulse width. In the world of logic chips, one-shots aren't the greatest of ideas, and are considered to be cheats in many cases, but here it seems to make OK sense.
H: What should be the size/package of Bob Smith Termination resistor? We have run into a layout issue where the size/package of the 75R resistor used for Bob Smith termination on unused Ethernet pins is in question. The current package of this resistor is 1206 and we want to reduce it to 0603 size. Can this be done? As far as I know or can think of, it can be done without any problems. But just want a confirmation. Some brief justification would also be helpful. Thanks. AI: Micrel uses 0603 on its demo boards, for example, see KSZ8463ML/RL Eval Board documentation. In mass dense products, such as mainboards, 0402 is normal way.
H: Monitoring voltage state without interfering I have a CO2 laser cutter, and I am designing as circuit to turn on some outlets whenever the laser is firing. The laser is turned on by a 5V logic connection to the high voltage power supply. If I can intercept this signal, I can tell when the laser is on. But how can I check whether or not that line is HIGH or LOW using an Arduino without interfering with the circuit on the laser cutter? I thought of two ways, but I have a problem with both. 1) Simply connect the signal wire to one of my Arduino's digital I/O pins. Problem: the Arduino is operated on a PSU seperate from the laser cutter, so the ground pins would not be the same. 2) Use an optoisolator that reads when the line is high. Pros: the Arduino and the laser cutter don't have to have the same ground. Cons: I would have to run the signal line throught a 1k ohm resistor and into the optoisolator. This would add resistance to the signal line AND prevent bidirectional signals. So, in conclusion, how does one check the voltage state of a signal line without interfering with the signal line? AI: Cons: I would have to run the signal line throught a 1k ohm resistor and into the optoisolator. This would add resistance to the signal line AND prevent bidirectional signals. This is not correct. Tee off the 5 V control line and place the current limiting resistor in the tee, not in the main line. simulate this circuit – Schematic created using CircuitLab The 5 V control signal will have to be able to source enough current to drive the LED, or you will have to buffer it.
H: Audio hack: replacing electret mic with phone audio output I'd like to feed a module with audio output from a phone's jack instead of the mic the board cames with. As I said the board is designed to operate with an electret mic with the following specs: Sensitivity -38dB Load Impedance 2.2K Operating Voltage 3V The schematics: The mic produces a signal that is 20mV peak-to-peak, centered around 1.5V, but anything in the [0.5V,2.5V] range should do according to the manufacturer. I want to take out the mic and instead connect a phone's audio jack to the module. I have two questions: Are audio jack signals standard? What would be a normal signal coming out from an standard smartphone? Assuming an average phone, what would be the minimum required circuit able to convert (most likely attenuate?) the audio jack output to the above mentioned levels? Thanks. AI: Line level output (.9Vpp) is standard (https://en.wikipedia.org/wiki/Line_level), but I have found that the output level on phones can vary across manufacturers. Line level is probably your best starting point though. A voltage divider (2 resistors) would attenuate the level coming from the phone if you need it - though you also have the volume control buttons on the phone to contend with. Another item you need to consider is the DC bias voltage coming from your module. From the schematic, it looks like a 2 pin ECM was connected. In this case, the DC bias is on the Mic + line, with the AC voltage coming back to the module from the transducer. Since you're replacing the ECM with a phone output, you should be sure to remove the DC component from that Mic + line. Depending on where the ADC is internally in your module, removing Rx might not help (you should measure to double check). If not, you may need to add a series capacitor to the Mic + line for DC blocking.
H: Driving 3ft (long) ribbon cable from an IC I've run into a problem with one of the designs recently. I need to drive several GPIO pins over a long-ish ribbon cable. I have used a buffer chip between my micro and the ribbon (SN74Abt162244) which is also a level shifter from 3.3V to 5V. Everything worked well until I connected the ribbon. One by one the outputs of the buffer chip started to give up. The buffer should be able to give 12 mA so I am wondering if maybe ribbon capacitance was a bit too much and overloaded the outputs. Maybe there is an IC capable of driving such a long ribbon? Any suggestions are very welcome. AI: You should get a scope on the lines to see what is going on when the cable is connected. If the drivers are "giving up" as you say there is a very good possibility that they are being fried by under voltage or over voltage spikes due to reflections coming back down the cable. The scope can help to identify if this is happening. Voltage spikes that go over the driver VCC by much more than 0.3V or lower the the driver GND by -0.3V can cause latchup or permanent damage to the driver. If the driver is experiencing latchup you may be able to turn off all power and let the board sit over night. It may work again after the trapped charge in the chip that kept the stray PNPN junction in the chip biased has a chance to bleed away. One of the simplest solutions to this problem is to place small value resistors in series with the output pins of the driver. Select the resistor size such that the resistor value plus the output impedance of the driver begins to match the cable characteristic impedance. You may want to also look at selecting a driver/level translator chip built with a slower process technology to slow down the rise and fall times of the driver outputs. This will go a long way toward helping to reduce the amount of potential +/- overshoot seen in the cable.
H: ADC specs: fpbw - infinite resistor noise? I'm trying to compute Johnson resistance noise in a simple resistor circuit. However, since all frequencies contribute equally, I am getting an answer of infinity. It then dawned upon me that the Arduino ADC probably detect frequencies larger than some cut off given by something called the full power bandwidth. Does anyone know this spec for the Due? AI: It is not the full power bandwidth spec you are looking for but is related to the settling time of the sample and hold. Page 244 of the ATmega328 data sheet (assuming you have a 328) shows that the input of the ADC can be represented by the source resistance together with internal sampling switch resistance (1..100K) and the 14pF sampling cap. This will give a single pole filter that will limit the bandwidth and avoid all frequencies up to infinity contributing to the total noise.
H: How to program via ICSP when chip is in-circuit with interfering chips? My Circuit is: USBTinyISP <-usi/icsp-> ATTiny85 <-usi/i2c-> MCP4725. That is, the USI pins used to program the t85 are also used for i2c in the final circuit. When I try to flash-program the t85 in-circuit, it fails. If I disconnect the 4725's SDA line during programming, it works. I assume that the 4725 is confusedly pulling SDA low to ACK I2C packets and thus interfering with the shared MOSI line during programming. But if so, then my ICSP isn't truly In-Circuit :(. That is, if the circuit was permanent then I couldn't program the MCU except by removing it. Yet I see many circuits with ICSP headers on them that presumably work. How do circumvent logical interference from the circuit when I program via ICSP? The only solution I can think of is to use a microcontroller with dedicated ICSP pins. But is there some other common-practice solution to this problem? AI: Add a suitable resistor between any external circuit that drives an ICSP pin and the AT chip. The resistor must be high enough that the ISP circuit can override the the external circuit, yet low enough that the external circuit can still drive the AT fast enough. You could start with 1k. An ICSP capability is a combined property of the target chip, the programmer, and the target circuit.
H: DC motor as rotational speed sensor? Will spinning a small DC motor work effectively as a rotational speed sensor (by producing voltage)? I'm trying to measure the rotation of a shaft (driven by a trackball) on a shoestring budget. I came up with the idea of using a small DC motor I have on hand to generate a rotational speed based voltage. I came across information on resolvers, however I don't particularly care about the position of the shaft, just the speed and direction. I'm planning on placing diodes on each terminal of the DC motor to direct the output to 2 different input pins on an ADC (depending on spin direction) and connect the correct terminal to ground. Depending on the output voltage, I'll also plan on either putting in place a voltage divider or do some zenier diode clipping to prevent voltage spikes. Is there anything I'm overlooking? It all sounds correct in theory to me, but damnit Jim, I'm a programmer, not an electrical engineer! I'd rather not fry a microcontroller. AI: Well, you can - in principle - but.... Any regular brushed DC motor can be used as a tachometer. The problem is that the tachometer really does work (more or less) like a motor in reverse. So, if the no-load speed of a DC motor is 1000 rpm with 5 volts applied, when used as a tachometer the output voltage will be about 5 volts at 1000 rpm. As you might guess, you're not likely to find a motor which will give you useful output voltages when driven by a trackball. Very low-speed motors usually have a gear train between the motor and the output shaft, and this is essentially impossible to drive backwards. I'd recommend you make your own optical encoder if you're really on a tight budget. You make a disk out of some thin material (heavy paper might do), punch a bunch if holes around the rim, and attach it to your shaft. Now get a photointerrupter and set it up to look through the holes. Actually, this is probably the way the trackball works. If you've got a few bucks, make life easier on yourself and buy a ready-made encoder. Try Digikey for examples of either.
H: PIC18F25K80 and WiFi I want to send information over wifi from my PIC to PC. I need some basic tutorials or guides on this topic. I have searched online but there is no tutorial that starts from the basic. Can anyone guide me in the right direction. AI: The fastest and probably simplest solution would be to use something like the RN171 WiFly module (or RN131) (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en558370). You'd hook it up using either the PIC's UART or SPI interface. It also uses simple ASCII commands to setup and perform WiFi operations. Microchip provides all the firmware and documentation needed on their website. I've used the RN171 and it's pretty easy to use.
H: adapter replacement for 12V 0.5A Can I use a 12V DC 1.0A adapter in place of a 12V DC 0.5A adapter for my piano keyboard? The keyboard comes with a 12V DC 0.5A adapter but it is lost. I found a 12V 1.0A and wanted to know if it can be used. I don't want to use this adapter if it might harm the electronics. AI: Usually, yes. There are a couple of things that you need to look out for. 1) Does the connector match up? Both the size and polarity matter here. 2) Is your new power adapter a SMPS unit or just a plain-old iron-core unit? The difference is that the SMPS version has a regulated output whereas the iron-core unit will often have an output voltage that is significantly higher than the nameplate rating when used at lower than full output current. You can usually tell them apart just from the size and weight. A iron-core power adapter weighs 4 or 5 times as much as the newer SMPS version.
H: Is there an online "table" or something for choosing MOSFET's? I am planning to buy some MOSFETs for testing and playing around, to decide if I would use one instead of a BC338 transistor (see my intended application below). My "filtering algorithm" would be: Small package (TO-92 preferrably); Small power dissipation (less heat = more light!); Saturated below 5V at the gate; Small price!; P channel (allows for common ground between Arduino and Led module); Not overengineered (my max current is not expected to go above 1A); Containing the proverbial "L suffix", meaning Logic-friendly; I have been looking for a good candidate using "arduino led mosfet" search words, and tried some big-supplier sites (Mouser, Futurlec, DigiKey), but couldn't find a comparative table of Mosfet families, or even a "one place" to search for candidates to a given application, based on "layman readable" numeric parameters. Also, if you could give me two or three part numbers that would be suitable for my application (see below), I would be glad! Intended Application: Use an Arduino GPIO (5V) to switch a module of 18 red leds running at 6V. The leds are wired in nine parallel groups, where each group has two leds and one 330 ohm resistor in series. The led brightness is quite sensitive to voltage drop, so a low "ON" resistance is welcome (preferrably below 10 ohm). AI: Don't be shy about spec'ing your own part from a distributor's website. It's not as hard as you'd think, once you learn which parameters are important in which situations. Based on the information you've provided, I'll guide you through selecting a usable MOSFET on Digikey. Note that I am not validating your schematic design in any way, since you didn't provide one. One thing that stood out to me in your description was the LED supply voltage (6V) and the FET's gate voltage (5V). Make sure you fully understand how to interface a P-Channel MOSFET before you make this circuit. You will have to do more than just connect an Arduino pin directly to the gate. Anyway, on to Digikey: 1. Search for "MOSFET" and click on the "In Stock" checkbox. 2. Choose "FETs - Single" under Discrete Semiconductor Products. 3. We want to whittle-down the 16,000+ options as much as possible, but without limiting ourselves. First, select the two "P-Channel" options under the FET Type filter, since we want a P-Channel FET. 4. Select all of the "Logic Level Gate" variations under the FET Feature filter. 5. Digi-Reel, Tape & Box, and Tape & Reel are codenames for "minimum order is, like, a million". So select everything in the Packaging filter except those three. 6. You said the power supply is 6V, so you shouldn't need to filter under the Drain to Source Voltage (Vdss). There should be a large amount of FETs left. At this point I'd sort by price and start looking at what the least expensive components are like. The main parameter that's left is current. Forget about what Digikey is reporting under "Current - Continuous Drain". Those numbers are usually unrealistic values advertised by the manufacturer. You shouldn't expect to push that much current through the FET unless you've specifically designed it for that purpose (i.e., thermal considerations). Instead, let's approach it another way by picking a FET based on its Rds(on). Let's assume something in a small package will have a thermal resistance of about 100 degrees C/W. That means for every Watt of power, it will increase 100 degrees C. Actually, 100 degrees rise in temperature is probably a good design point. That leaves a little bit of room before the typical maximum silicon temperature of 150C. So we want to pick a FET that will dissipate no more than 1W at the 1A you specified: $$P=I^{2}R$$ Rearranging and solving for R: $$R=\frac{P}{I^{2}}=\frac{1W}{1^{2}A}=1\Omega$$ Now we can start from the top of the price-sorted list and look for FETs that have 1\$\Omega\$ or less Rds(on). At this point, any one you choose will do fine. Just read the datasheet first to avoid surprises later! By no means is this a comprehensive method for choosing a FET for all circumstances. But for the simple application you're doing, this method is good enough.
H: 8-bit Serial I/O Parallel I/O Bi-Directional Shift Register I am looking for a register that has as stated Serial In Parallel Out and Parallel In Serial Out modes and bi-directional shift functionality all in one IC. I want to use it with Arduino. Does something like this exist? AI: Sure. The 74HC/HCT194 is, as far as I can tell, exactly what you're looking for.
H: Switching high voltage battery from series configuration to parallel configuration for charging I have a question regarding switching batteries from series to parallel to charge them. I have 36 modules of 1Sx11P Li-ion batteries connected in series. During normal operation they drive a car with a high efficiency motor, and are recharged via solar panels and two max power point trackers. However, when the car is not running off of solar power or is parked in the garage I would like a way to charge the vehicle with a battery charger or power supply with a cable that could plug into the car. I have been reading some descriptions about people doing similar things for beefy RC airplane batteries by connecting them in parallel and charging many more than the battery charger could originally charge. Here is an image from this website:http://www.rchelicopterfun.com/parallel-lipo-charging.html Or other configurations like on this picture The advantages of parallel charging would be very big for me as it would regulate a lot of the cells voltages without the need for external balancing circuitry, though I do have that available when the car is in serial hookup. The batteries aren't all that accessible in the car either, so plugging in two different harnesses isn't really option for this idea. What I want to know is, is their a way I can implement a circuit that can flip back and forth between series and parallel for the batteries that could handle the high voltage and large currents I would be dealing with? Do you have any recommendations on how many batteries I should look into having in parallel while charging? I would appreciate some insight as this is a little out of my typical realm of electronics. AI: This is the universal conundrum of parallel vs. serial connection of cells/batteries, for both discharge, & re-charge. There are pros & cons for each scenario - efficiency/losses (P=I^2.R), safety (Lithium is an unforgiving mistress), convenience / accessibility, longevity, equalisation. RC hobbyists trade convenience with a willingness to disconnect packs from their gear, and then connect them to a charger, which gives them flexibility to arrange cells in whatever series or parallel arrangement makes best sense for each discharge & recharge phase of their play-flow (work-flow - geddit? ;). As you say, your application doesn't facilitate this physical flexibility - the cells aren't easily accessible, nor is changing harnesses. You could engineer a complicated switching scheme with either relays or mosfets, to allow you to reconfigure the array for discharge & recharge, but that's a lot of work, a lot of cost, and extra copper/mosfet losses. If it were me, I'd suck it up & go for a Li-Po recharge solution that supports the number of series strings with cell/pack-balancing capability (which of course is critical in series configurations). That may mean you need to take your power source & use a switching boost voltage regulator to get the voltage you need (i.e. more than the number of series cells * 4.2V) to achieve this, and then a charger to match. If you really want to stick with hobbyist-level chargers like the one in your photo that can handle a handful of cells in series, then one approach I can think of is to power each of those rechargers via isolated DC-to-DC converters (in turn powered from your solar/MPPT supply, or bulk mains-powered PSU) - that lets each charger handle a handful of cells in series, and provides the isolation needed between each charger as the string voltage escalates along the string. Here's some examples of the kind of DCDC modules I mean. One challenge of this approach is how to control each of those rechargers electronically (instead of humanely) whilst maintaining the isolation needed between them, but that's a separate question :).
H: Searching for a programmable microcontroller (USB & LED dimming) My apologies for the lack of given information or my knowledge in this subject. I haven't done much electronic-related before (I know how to use basic IC's such as the 555's, 4017's, etc), but I've never worked with any microcontrollers before. I'm basically searching for a (cheap/well-priced) programmable microcontroller which can connect to a computer through USB and be controlled via a Visual Basic (preferably) application and control the brightness of at least 7 different LEDs at the same time. I have no idea where to go looking for one that'd suit my needs, nor do I know what specifications it needs (other than what I've said). As for programming it, I'm unsure of what I'd need to install the program onto it (some sort of device?), but any programming language is fine - I've been writing software for over 3 years, it shouldn't be a problem. I'd also rather do it this way than buy a cheap Arduino clone so I can learn from this and have a project to do (despite not knowing much, electronics is a hobby of mine). I should probably also mention that I've been searching around for over 2 hours now, but not come across anything conclusive. Any responses would be greatly appreciated, thank you :) AI: Arduino IS based on a microcontroller (by atmel) and is basically a breakout board for such microcontroller plus some friendly way to upload a program to it. It's programmable in c++ so it's quite easy and, as @Michael said, the community is huge. You can use the program on a bare chip without the board if you provide the proper connections, parts etc... That said i'm a PIC user and i don't really like the bulkiness of arduino (both in terms of price, physical space and memory occupied by the bootloader) and the way its community works. BUT if you want to program a pic or an avr you need an external not-so-cheap programmer (search for pickit2 or avr dragon...way more than an arduino) and a proper c compiler. Then remember that usb access comes at a price (i.e. writing a program to use it but then you need a way to program the chip in the first place!). Arduino has everything you need to start FAST and such a program would be nearly trivial with all the libraries, a thing i wouldn't dare to say for a "from scratch" project like yours. Then again, if you want to learn bare embedded programming just grab a micro, buy or build a programmer, download the tools and start by blinking a LED then build from that. I'd advocate for PICs but really it doesn't matter. AVRs have nice open source tools while PICs are slightly cheaper. You'll find hundreds, thousands of discussions on which is best and why they're wrong :P
H: Output Radio Circuit Board to Speaker I have a AM/FM radio board I found and am trying get playing through a small speaker. The other components were missing so I don't know how this connects to the rest of the system which had a CD player, tape deck and the like. The board has a single set of input wires pictured below. The on board chip is a Toshiba TA8167N which I have found runs on 3 volts and have managed to power. Now I am trying to figure out what is required to connect to the speaker. As there is only a single out for L and R which connect to the 'R-Out' and 'L-Out' pins on the chip I'm not sure how to complete the circuit. From reading around it looks like I need an 'R-Ret' and 'L-Ret' respectively to complete it but there is no wiring for this available. I think SL connects to the Stereo LED but I can't follow the MO or MU to the chip as the connections sit under the tuning wheel. EDIT: PCB picture added. AI: The Toshiba TA8167N has single-ended outputs -- the return for both L and R outputs is the GND pin of the chip (pin 9). Is pin 9 connected to the "-" pin of the connector you showed? Tuner chips like these are rarely connected directly to a speaker. More typically, the tuner chip output pin is connected through a 4.7 uF capacitor (as shown on p. 8 of the TA8167N datasheet) to a "volume knob" connected to an audio amplifier such as the Texas Instruments LM386N-4, as shown on p. 6 of the LM386N-4 datasheet. The LM386N-4 and many other audio amplifiers are also single-ended -- the return is the GND pin of the chip. You'll need 2 such audio amplifiers (or a "dual amplifier"), one to amplify the L signal and the other to amplify the R signal. (Could you show a photo of the entire PCB? Perhaps your PCB already includes a volume knob and perhaps even an amplifier).
H: PNP or NPN Transistor for this schematic? I am quite new to electronics and hoping to build a voltage regulator using the schematic below. I will be using a 7806 regulator and a 7.4 Lipo battery (yes, the schematic is probably a little overkill for 6V regulation but never mind that). The transistor required is a TIP2955 which is a PNP transistor. A website I came across says this about PNP transistors: Only when there is no current at the base will it turn on. And to ensure that no current enters the base, the base must be grounded (connected to ground). If any current goes into the base of a PNP transistor at all, the transistor will not conduct across from emitter to collector. The schematic shows the PNP's base connected to positive, not ground. Will this schematic work and how? I'm rather confused as the preceding description seems to imply that it won't. (source: zen.co.uk) AI: That quote is just wrong. That circuit is correct, but not for your application as it will require about 8V minimum input to give 6V at the output. It works by supplementing the output current of the 78xx (7806 for 6V) regulator if the regulator takes significant current (about 600mA) with additional current through the PNP transistor. Your Lipo batteries will not have a constant output voltage, they will probably vary between 8.4V when fully charged down to about 6V or even less when discharged. What do you need the 6V for? How much current do you need? What is the acceptable voltage range for the load?
H: FTDI disappears when powering circuit with it. I'm trying to us the ESP8266 wifi board and when I power it over the 3.3v out on the FTDI the entire usb disappears from ubuntu. as soon as I take the power away it shows back up again. What could cause the /dev/ttyUSB to disappear when using the power from the FTDI? AI: The 3.3V regulator on a ft232 is not that strong. 50 mA or so at best. The ESP is very power hungry compared to it. You need a better regulator. This is to say, the regulator on the FTDI is being overloaded, and the whole thing is losing power, essentially brown outs. The FTDI runs off the 3.3v internally, so when the regulator starts failing to regulate due to being overloaded, the internal circuitry cuts out.
H: Finding the system function of a digital filter I am studying for exams and I need help with a question I came across in a textbook. Given a digital filter $$y_n = a(x_{n-1} + x_{n+1}) + bx_n$$ find the system function of this filter and the location of its poles and zeroes. This is what I have done to find the system function: $$Y(z) = a(X(z)z^{-1} + X(z)z) + bX(z)$$ $$H(z) = Y(z)/X(x)$$ so $$H(z) = a(z^{-1} + z) + b$$ Because the denominator is one, the pole should be at the origin, but how do I find the zeroes? And is my solution for the system function correct? Help is much appreciated, thanks. AI: Actually, the denominator is not one. Think about the term \$z^{-1} = \frac{1}{z}\$. Given this we have to re-interpret \$H(z)\$: $$H(z) = a \left(\frac{1}{z} + z\right) + b = a \left(\frac{1 + z^2}{z}\right) + b\frac{z}{z}$$ Now that all these terms have a common denominator we have found a well formed transfer function: $$H(z) = \frac{az^2 + bz + a}{z}$$ From here we can find the poles by setting the denominator equal to zero, we see quickly that the pole is at the origin (\$z=0\$). (B.T.W. a denominator of 1 does not mean that there is a pole at the origin, it means that there are no poles!) To find the zeros we set the numerator equal to zero and solve for \$z\$. $$az^2 +bz +a = 0$$ Using the quadratic equation gives the zeros as: $$z_{1,2}= \frac{-b \pm \sqrt{b^2 - 4a^2}}{2a}$$
H: Easiest way to connect two pins when an output is off? I'm planning to build a switch that turns off the power supply to my Raspberry Pi when an integrated circuit (ATtiny 85) output pin is low. The power supply (Adafruit PowerBoost 1000C) goes off when the EN pin is connected directly to the ground. I've been trying to use an NPN transistor inverter circuit to do this, but I haven't had much luck. I can use the transistor (without inverter) to turn the power off when its base goes high (connecting the EN to collector and ground to emitter), and I can use the transistor inverter to turn on/off an LED when base goes low/high, but the inverter circuit actually turns power on when base is low, power off with base high (like the transistor circuit WITHOUT an inverter). It may be that there's an internal pull-up resistor in the PowerBoost that's somehow interfering. I'd like to be able to connect the ground to EN when my IC output is low so I can save batteries and put the ATtiny in sleep mode. The Pi will be off far more than it will be on. How can I get this to work? I tried a PNP transistor but seemed to have the same problem. I'd prefer not to use a relay because I don't have a low enough voltage one. I've got lots of semiconductors, though. AI: If i understand the question, you could do it like this. simulate this circuit – Schematic created using CircuitLab Although this seems somewhat redundant to me, as this is essentially how the ATiny works internally. A more elegant solution would seem to be connecting them together directly, like in the following diagram. The use of a discrete transistor is sometimes required, but only if it needs to sink more than the capacity of the controller, and it looks like it's only overpowering a pull-up resistor, piece of cake. simulate this circuit Note that this will only work if the 2 circuits are at the same ground potential, which can usually be achieved by connecting the grounds directly together. You should also take into consideration that the 2 circuits may be running on different logic voltages, so to avoid problems there you should be setting the pin on the ATiny to a hi-z state (in arduino, "input" mode) to avoid mucking with the other circuit.
H: Measuring AC voltage (0.333vac max) using a 10 bit ADC on Atmel ATMEGA328 new to this so please be kind. want to measure AC current in domestic supplies using an atmel ATMEGA328P chip wit the best resolution possible I need to use the split core current transformer sensors I have which output 0.333vac for the sensed current they are rated to - http://www.magnelab.com/wp-content/uploads/2015/03/AC-Split-Core-Current-Sensor-SCT-0400_specsheet.pdf I have a regulated 3.3v supply which runs the chip and the internal analogue reference is 1.1v. I have tried creating a potential divider using the 3.3v supply and 100k and 560k resistors to give 0.5v and then connecting the ground of the CT to the 0.5v point and the output of the CT to the ADC (with 1.1v analogue reference). My problems are the resistors seem to have stopped working (am i using bad values?) the samples are inconsistent, at the moment i am taking 100 consecutive samples using a for loop in the AVR code and then calculating RMS voltage by subtracting the 0.5v bias and doing standard rms calculation... should i be sampling at a particular frequency and if so does anyone know how i go about controlling this on the chip I'm using. Kind regards, James. simulate this circuit – Schematic created using CircuitLab AI: The values of the resistors are fine, but I would suggest you use two 100k resistors to maintain the voltage around the center of the range. It's safer... And put in a resistor in series with the output of the transformer. Be sure to check if your transformer has no leakage resistance/current. The center point shouldn't change DC voltage connecting the input. Try to take, say 100 measurements in one cycle of the AC (20ms if 50 Hz, and 16.67ms if 60 Hz), and calculate the RMS then. (So sample at 1/5 ms - or 1/6 ms). If you don't, the output will never be stable. Ideally you should measure several/many cycles, so as to lessen the chance of noise interference. Take the mean of the measurements to determine what the center point voltage is. Edit: They certainly did not burn out because of the 5V source! The power dissipated in both resistors is E^2/R, or 25/660000 = 0.037 milliW. They shouldn't even noticeably warm up. Even the smallest (even SMD) resistor should handle that without complaint. If they really burned out, then I would suspect a serious problem in your transformer. Personally, I would feel safer connecting the transformer to ground (instead of the divisor), and 'shifting' the voltage to the ADC range with an OPAMP. If something happens, the OPAMP will burn and not your processor. On the precision front - I would not worry too much about getting the last bit out of the ADC. If you're doing 100 measurements, and repeat it over several cycles, you are artificially improving your precision too. I'd be more worried to have input voltage well in range - for safety. And put an R (say a couple of kOhms) in series for more protection. Something like this:
H: What are the effects of powering AC devices from a square wave? I've been playing around with some ideas about building my own inverting power supply, to power AC devices from a car battery. I've heard of designs that just feed a square wave into a transformer to get the mains voltage output, but I've also heard vague claims about how you shouldn't do that. In what ways can powering devices engineered to run off a sine wave with a square wave impact their functioning? AI: AC-mains appliances are engineered to present a certain impedance (load) for the specific 50/60Hz mains frequency. Feeding them a square wave of the same (fundamental) frequency is - mathematically provably - the same thing as feeding them not just a sine wave of 50/60Hz, but super-imposed on that also a 150/180Hz at 1/3 the amplitude, and a 250/350Hz sine wave at 1/5th the amplitude, and a 350/420Hz sine wave at 1/7th the amplitude (i.e. all the odd harmonics at decreasing amplitudes) and so on, in theory up to infinite frequency, but in practise with domestic wiring the losses & impedances in mains distribution networks & appliances, they peter out at kHz or maybe 10s of kHz (for a 50/60Hz fundamental). These higher frequencies are the result of the high rise-time & fall-time of a square wave. For some appliances this doesn't matter so much - like resistive loads (e.g. heater elements). For inductive loads (e.g. motors) or some capacitive loads, that typically means a significant proportion of the energy you're hoping to deliver into the appliance won't actually be used for 'work', but will instead be dissipated as heat, because the inductive/capacitive load is tuned for 50/60Hz, not the higher frequencies. So, depending on the specifics of the appliance, powering them from a "square-wave inverter" might work ok, might not, or might even damage it permanently, it all depends on the specifics of the appliance. Even low power switch-mode power supplies that in one respect would be more impervious to this kind of treatment, actually aren't, and will in fact deliver poorer (noisier) DC to their electronic circuits, hence gadgets "play up". The short story is, the DC-to-AC inverter industry for the last few decades has gone through a maturation process of inverter designs to overcome this severe shortcoming of square-wave inverters, first with 'modified sine wave' (a misnomer, actually a 'modified square wave' where there's an off-period on either side of the 'zero crossing'; and then on to "pure sine wave" inverters, which also aren't really sine waves. Some filtering with inductors & capacitors can also help to slow down the fast transitions of square-wave, but because of the low frequencies involved, they're large components & therefore expensive. Modern 'sine wave' inverters create a bi-polar wave via a modulated PWM at a much higher frequency (say, a few kHz or even 10s of kHz), which can be filtered out to achieve something more resembling a sine-wave (at least under load).
H: sim800 restarts on battery but works fine on power supply I am using SIM800L with PIC18F66J94 , but issue is that SIM800L keeps on restarting when powered by battery but works fine when powered by power supply . I have changed some battery to verify the issue but still sim800l restarts on battery . AI: You haven't posted any details about the battery you're trying to use, but it's either insufficient decoupling-caps on your Vcc rail to ground, or (probably more likely if you're using an off-the-shelf SIM800 module) a battery that's just too small in capacity - or more accurately - too high an internal resistance, for the load you're drawing. GSM/GPRS radios have very high current draw in short sharp pulses of 1 amp or even 2 amps. Your battery's capacity & resultant internal resistance (check its spec sheet) and your power regulation/distribution system need to be able to supply this load without the supply voltage buckling under that load during those current spikes, because that's what's likely resetting your MCU. Start with getting a 'scope on your Vbatt rail & Vcc rail if they're separated by a regulator, and reviewing your Vcc decoupling regime, and if that seems to be OK or adding some bulk capacitance (e.g. not just 100n ceramics, but also one or a few 10uF tantalum or electrolytic) doesn't help, then get either a bigger capacity battery, or dive deeper into your battery specs to choose one that has low enough internal resistance at your desired capacity/size.
H: how to measure RBG values of a color using phototransistor I am developing a circuit which can measure RGB values of a given color. I have used LED to transmit light and reflected light is filtered by 3 R, G, B filter papers. Earlier I used LDR and found that the accuracy of the result was low even though I managed to minimize background light. I want an accuracy about 1%. Can I use photo-transistors or photo-diodes? If so how can I use them increasing the accuracy? AI: The visible light spectrum ranges from 380 nm (blue) to 700 nm (red). The human eye has three types of cones: one is most sensitive to wavelengths around 450 nm, and is called S (for short-wavelength) or blue; the second is most sensitive to wavelengths around 540 nm, and is called M (for medium-wavelength) or green; and the third is most sensitive to wavelengths around 570 nm, and is called L (for long-wavelength) or red, although it is actually most sensitive to yellowish-green rather than red. I don't think it makes much difference whether you use a photo-diode or photo-transistor, since they are made up of the same material (silicon). The more important hing to do is get an accurate plot of the sensor you are using, re its response to various visible light frequencies. A typical photo-diode response, although sensitive to visible light, has its peak response in the middle of the near-infrared region (900 nm), and is not at all flat in the visible spectrum (eight times more sensitive to red than blue): It is possible to get photo-diodes that more closely mimic the human eye response. One such diode is the BPW21R. It's response is broader than the overall human eye response, but it peaks at the same place (approximately 550 nm). You need to find what wavelengths your R, G, and B filter papers are passing, and then match them up against the color response plot corresponding to your photo-diode or transistor. Then you can normalize the outputs (either by boosting or attenuating the signal) of each of the three filters to match human eye response.
H: This circuit has floating nodes in LT Spice? This is the circuit I'm working on. This circuit probably doesn't work as intended to begin with, but that's not the point. LT Spice keeps complaining that it doesn't have a reference to ground. I get an error that says "This circuit has floating nodes." I found this but that didn't solve my problem. It would be one thing to just connect a ground somewhere, but that will ruin the validity of my circuit. The voltage source defined as MAINS in this circuit is just that...a simulation of the mains. It is a 60Hz sine wave with an amplitude of 120V. If I add a ground to it, I won't get the negative part of my wave! The resistor connected to the voltage source is there to prevent another error being thrown about having inductors in parallel with the voltage source. How can I keep this circuit equivalent to the real world so that I can simulate without losing half my wave from my MAINS voltage source? AI: In LTSpice, every node needs a path to GND. Just tack a GND node to both your primary and secondary side (drawn in CircuitLab for simplicity): simulate this circuit – Schematic created using CircuitLab
H: Parameterizing diode value in SPICE I have a bunch of diodes of the same type on a schematic in LTSpice. How do I parameterize the diode's type (Value) so that I can change it in one place and it would change it for them all? The .PARAM statement doesn't seem to be supporting literals, so I cannot use something like .PARAM DiodeValue=NSPW500BS AI: There is a workaround using the .SUBCKT dot command. Here is an example circuit: And here is the output: In short you should create a subcircuit with two terminals whose only internal component is the diode you want. The SPICE code: .subckt MyDiode A K D A K 1N4148 .ends defines a subcircuit called MyDiode with two terminals named A and K (these names are local to the subcircuit definition). .ends ends the definition. The code inbetween is regular SPICE code which says that a diode D is placed between (local) nodes A and K and that diode has a 1N4148 SPICE model. The .lib standard.dio is required to load the models (1N4148) used inside the subcircuit. If the models of the diodes you want to use are not in the standard LTspice part libraries you must put the complete path in the .lib directive (see LTspice guide for details). Note that you have to change the default attributes of the diodes you usually place on the schematic, as shown in this image: Note that the Prefix must be changed from D to X (to tell LTspice the part is a subcircuit and not a standard diode) and the Value attribute must be the name of the subcircuit (here MyDiode). From now on, if you want to change the "implementation" of MyDiode parts, it is sufficient to change the subcircuit definition, as you can see in the image below, where I changed it to use an 1N4007 model:
H: What is the wiring for a pull-down resistor on the Or gate? Is this wiring and resistor the best choice as a pull-down resistor? Is it necessary to put the pull-down resistor(s) on all inputs and outputs? I put a 10K Ohm resistor connected to the chip ground. The IC is a HD74LS32P, and it is a positive OR gate. I connected two inputs to the other end of the resistor. With power to the chip, the multimeter reads: Vcc to ground is 4.92V A2, V=1.02 B2, V=1.03 Y2, V=0.74 I have a PWM driving device, and when that is powered and set to the lowest setting: A2, V=0 B2, V=0 Y2, V=0.17 When the PWM is set to max value: A2, V=4.3 B2, V=4.3 Y2, V=0.42 AI: The pulldown resistors that you are using is on the high side for one LSTTL pin and probably beyond acceptable when used to pull down two pins at once (see explanation at end). A lower value of resistor should be used. However - this does not properly explain the problems that you are seeing. THe following procedures will help you establish whether the IC is working OK. Once you know that the IC works OK you can go on to see what happens with PWM drive. A troubleshooting template: As well as addressing your questions and showing you how to find what is wrong, the following serves as a troubleshooting template for finding what is wrong with simple circuits. It takes a step by step approach that "must" work if followed*. All inputs or outputs that are not relevant to the immediate tests are disconnected. The power supply voltage is checked at the power supply (NOT on its leads). The power supply to the IC is checked ON the IC pins. A meter polarity and lead-connection sanity check is carried out. This can sometimes avoid major disasters - such as plugging a meter into mains AC with one test lead plugged into the 10A DC socket. Or not. (Ask me how I know :-) ). (After enough decades you are allowed a certain %age of stupid actions - and with time learn to usually not take up your allotment). Basic test conditions are set up, and then measurements are made ON the IC pins to ensure that the conditions appear on the pins. This avoids things like broken wires, misconnected wires, bad breadboard and other connections and fault conditions which load signals so they are not what is expected. Results of the applied inputs are checked AT THE IC pins. Input sets and outputs are worked through logically. *The above USUALLY works. It is not in fact 100% foolproof. Murphy says that nothing is ever 100% certain, and knowing this is an essential part of understanding things. In the sequence above, no mention was made of eg grounding or terminating unused inputs in the 3 other OR gates in the IC. In a TTL IC this is usually not going to cause problems as TTL has implicit input pullup action. With some ICs, failure to terminate all unused inputs in a defined and proper manner may lead to failure of other IC sections to function properly, or at all. Occasionally it can lead to magic smoke and a dead IC and occasionally to dead other things as well. In this case. hard connecting all unused inputs to Vcc OR to ground would do no harm and is good practice. In this case it is not liable to affect the results. What you are doing is essentially correct but the result is confusing either because PWM duty cycle max is very low. This needs to be checked. or Vcc is not applied correctly to pin 14 or IC is dead or One of the wires running to off-stage where we cannot see does not connect to what you and we think Here is a quick sanity check Not as long as it may seem at first glance. This is (if I have not had a brain fade) a classic bullet proof troubleshooting sequence that assumes nothing. It "must" work [tm]. When I mention measuring AT a pin, put meter probe ON THE PIN on the IC. When I say to connect eg Vcc to a pin it is OK to do this via the breadboard sockets as the next step checks that it has happened. Disconnect wire to pin 4 (PWM input) - not needed or wanted for these test. Set voltmeter to 20V range. (10V to 40V OK) If using a typical DMM with plug in leads, ensure black lead is in COM (common)and red lead is in correct socket for measuring volts. Measure power supply voltage AT power supply terminals - NOT on connected wires. About 5V from what you say. Measure voltage between IC pin 14 (Vcc) and IC pin 7 (Ground) with probes ON ic pins (not on wires.) Red lead to pin 14, black lead to pin 7. This avoids being fooled by wrong feed, bad wires, bad breadboard contact, Murphy. Should be about +5V with pin 14 more positive than pin 7. If not, remedy. V = 0 = bad connection. V < say 4.8V = find out why. Reverse meter leads - red to pin 7, black to pin 14. Measure volts. Should read -5V (negative 5). ENSURE meter shows a -ve sign in this mode. If it shows -% in the prior test and +5 here the power supply is reversed. It happens. Connect wire from pin 4 to ground. Confirm that pin 4 AT IC to pin 7 = 0 V. Confirm that pin 5 AT IC to pin 7 = 0 V. (You say you have joined pins 4 & 5, and the photo suggests that you have. This ensures that the voltage is the same on both pins.) Measure pin 6 to pin 7 - should be <1V. Report value. Disconnect ground wire to pin 4. Connect wire from pin 4 to Vcc (eg to level on pin 14) Confirm that pin 4 AT IC to pin 7 =~ 5 V. Confirm that pin 5 AT IC to pin 7 =~ 5 V. If not, find out why. DISCONNECT the wire currently going to pin 6 (wherever it goes) Measure pin 6 to pin 7 IF you have done all the above correctly, then V pin 6 wrt pin 7 = high = >= 2.4V. Probably about 3.5V. See 74LS32 data sheet for levels. Report IF pin 6 is not "high in the above step then IC is dead or You did not follow instructions above correctly or IC is dead IF pin 6 IS high, reconnect wire to pin 6 that was connected above. If pin 6 falls to under 1 V (or ever under say 2.3V) then there is an "illegal " load on the other end of the wire that you did not tell us about. Report back. Is it necessary to put the pull-down resistor(s) on all inputs and outputs? For ICs that do not have internal pullup or pulldown 'resistors', Pull downs (or pull ups as appropriate) are needed on all input pins that you wish to be low (high for pullups) when they are not being driven. If a driver is ALWAYS connected a pulldown is not needed. Normal "push pull" or totem-pole outputs that actively drive high and low do not need pullups or pulldowns. Open drain or open collector outputs (no active high drive) need something to drive them high when they should be high. This is often a pullup BUT depends on the circuit design. In the case of LSTTL ("Low Power Schottky") ICs the inputs have internal pullUP resistors. These are nominally 20k - so two inputs joined effectively have a 10k pullup. If you pull 2 pins down with 10K you can expect > 2.5 V on the input due to these resistors. Vinhi min is 2V and Vinlomax is -.8V (see data sheet). To get 0.8V max with 5V Vcc and one pin you need about 4k pulldown - so 2K for 2 pins together - so a 1K is probably safe. If you are driving these pins with PWM you may not need a pulldown at all. Deciding that is the next stage after this.
H: How can I scan a One-Wire (1-Wire) bus for all connected devices and list their IDs I have written a One-Wire (1-Wire, OW) controller in VHDL for FPGA designs. Currently I use a USB-OW adapter from Dallas/Maxim on my PC to get the sensors' IDs. I would like to scan the bus directly from the FPGA and collect all IDs on that bus. How can I do this? It should be possible, because the shipped software from the USB adapter can list all devices on the bus. Enumerating all devices is to slow, because OW has very long IDs. I used this technique on I²C, because there are only 127 addresses to scan :). AI: Maxim has an application note titled 1-Wire Search Algorithm: The strategy is too involved to accurately describe here, but the basic principle is based on: 1-Wire is an open drain bus: multiple devices can pull the bus to GND simultaneously. 0s are encoded as long low pulses, 1s as short low pulses (by actually not pulling the bus low). If multiple devices write the same bit to the bus, that bit appears on the bus. If any device writes a 0 to the bus, a 0 appears. as reply to the 1-Wire Search ROM command, all (selected) devices will, bit by bit, first write their own ID bit \$A_i\$, followed by the inverted ID bit \$\bar{A_i}\$. Then the master writes a bit \$S_i\$, which will select the devices for the next bits. Based on these properties, the master can detect whether no selected devices are present: both \$A_i = 1\$ and \$\bar{A_i} = 1\$. devices with a 0 as ID bit are present: \$A_i = 0\$ devices with a 1 as ID bit are present: \$\bar{A_i} = 0\$ This way you can see which bits are still available in your search space, and you progress down that binary tree.
H: Power supply PCB I made a PCB board (my first one) recently and I ran into some issues with it while troubleshooting. The PCB board is connected to an Arduino and draws 5V and the 3.3V supply from it. Also, the board and the Arduino shares a common ground. Since I need + and - 3.3V and 15V on the board, I used a 5-15V converter (After I get the + and - 15V I divide it to + and -3.3 V). When I assembled the board I ran into a problem which I need help troubleshooting. If I ground the +3.3V terminal and just use the -3.3V, I get -3.3V at both the ICs and vice versa. However, If both +3.3 and -3.3 V are present on the board, the ICs get +1.5V and around -0.92 V. I really do not understand what's going on. Would a buffer fix the problem? AI: You will not achieve a stable regulated voltage with a resistive divider. Instead, you should use a 3.3V regulator at that end. You don't mention current, efficiency or budget requirements, so I'll just suggest a DC/DC Converter like this V7803-500. You can use two of these regulators to achieve +/- 3.3V from a single 15V rail.
H: Peltier circuit design for TEC I'm designing a TEC circuit with a Peltier element, LM35 as the sensor and Arduino uno as the controller. I simulated it with Proteus and to my knowledge it was working, I suppose. But when I tried to replicate the circuit on a bread board with the components, I had problems with PWM. Can you guys please have a look at my circuit and advise for any changes/improvements needed. Thanks. AI: Looks potentially OK. Transistor drive may be too low. Place a reverse polarity diode across fan so it can freewheel during PWM off. Fan needs to be DC brush motor and not brushless (BLDCM) for PWM control. . You should say what "problems with PWM" mean. What is desired Peltier current. See other answers here re driving Peltiers. Olin has things to say about it :-). Better diagram copy is needed. I assume diagram is available at better resolution and has been munted by downsizing. Imgur allows files of any sensibly desired size. Assume 5A Peltier current. Assume 5V Arduino. TIP122 datasheet here Beta (current gain) is 1000 min at 3A. Use 1000 for now. Vbemax (from datasheet) = 2.5V (!) At say 5A Peltier current Ib = 5A/1000 = 5mA. Max Ib is about (Vcc - Vbe_darl)/Ib = (5-2.5)/1k = 2.5 mA = too low. That's wity worst case Beta (at 3A) and worst case Vbe and you can HOPE real device may be better BUT you must always design to worst case. Making Rb say 220 Ohms or 33 Ohms may help. Please advise correct figures for assumed value above.
H: VHDL code works well in ModelSim and strange behavior in Altera FPGA I'm trying to understand a strange (for me) behavior of a simple VHDL code. I have realized a stupid code that works well in ModelSim and doesn't work in a real FPGA (Altera MAX 10). Library IEEE; use IEEE.std_logic_1164.all; entity test is port( CLOCK_50: in std_logic; SGN_IN: in std_logic; RESET: in std_logic; SGN_OUT: out std_logic ); end test; architecture beha of test is type state is (ST0, ST1); signal NEXT_STATE, PRESENT_STATE: state := ST0; signal Y: std_logic := '0'; begin listen: process(SGN_IN) is begin case PRESENT_STATE is when ST0 => NEXT_STATE <= ST1; Y <= '0'; when ST1 => NEXT_STATE <= ST0; Y <= '1'; end case; end process listen; state_output: process(CLOCK_50) begin if(rising_edge(CLOCK_50)) then if(RESET = '1') then PRESENT_STATE <= ST0; SGN_OUT <= '0'; else PRESENT_STATE <= NEXT_STATE; SGN_OUT <= Y; end if; end if; end process state_output; end architecture beha; In simulation, the process 'listen' is triggered every time 'SGN_IN' changes. The trigger changes 'NEXT_STATE' and the output 'Y'. If 'SGN_IN' is idle the process is never executed and the output doesn't change. In FPGA the process 'listen' is executed independently of the 'SGN_IN' signal and the output signal 'SGN_OUT'changes at a frequency equal to \$F_{clk\_50}/2\$ (half the frequency clock). Could you, please, explain me the reasons of this behavior? And why in the simulation everything works well? Thank you AI: There are several problems in your code: 1) PRESENT_STATE is not in the sensitivity list of process listen. It should be, otherwise the simulation gives you other results as in hardware. 2) SGN_IN is not an input of your FSM. There is no transition that depends on this signal. Listing signals in the sensitivity list does not promote them to inputs. This list is just for simulators and ignored by synthesis tools. 3) Because you are using SGN_IN in the sensitivity list it seams to work correctly in simulation, but this is just the luck of 2 errors resulting in the correct simulation result :). Your FSM would also transition if SGN_IN is changed to X or L, because the signal changed, but I assume you want to check for 1-0/0-1 transitions, am I right? listen: process(PRESENT_STATE, SGN_IN) is begin NEXT_STATE <= PRESENT_STATE; Y <= '0'; case PRESENT_STATE is when ST0 => if (SGN_IN = '1') then NEXT_STATE <= ST1; end if; when ST1 => Y <= '1'; if (SGN_IN = '0') then NEXT_STATE <= ST0; end if; end case; end process listen;
H: What is the maximum Power that Smartphones charge with? 2400mAh? I have seen chargers rated at up to 2400mA, so I wonder, whats the max that Smartphones will accept while charging? I ask because I want to buy a charger that is able to supply the absolute max my phone requires. My phone for example is Samsung S4 mini. I assume its not much above 2400mA and constantly decreases while charging? or for example does anyone know how much the Powerbanks by Anker pull maximally? Also I just bought a charger with 3 USB plugs and it says: maximum current per Slot: 2.400mA, but 3.400 Ah batteries are common. So I wonder, why did they limit one port to 2400 mA - is that a common limit of li-ion and li-po batteries? AI: The upper limit on what current a phone MIGHT accept is the limits set on battery charge rate by the battery manufacturer. The upper limit for LiPo or LiIon batteries is usually C/1 = 1 mA of charge current per mAh of battery capacity. A very few battery manufacturers allow higher charging rates but this is rare enough that it can be ignored. So - a phone charger will usually limit charge rate to either C/1 (eg 2400 mA for a 2400 mAh battery) OR whatever lower limit a charger may set. Your S4 Mini may have a battery of about 1300 mA capacity. If so, the maximum rate will probably be 1300 mA. When charging from 'flat' a charger usually charges at C/1 until the battery voltage reaches 4.2V, then charges at a fixed 4.2V until the current falls (under battery chemistry control) to typically C/4. The actual "terminating rate" varies with design. C/2 cutoff gets slightly less capacity but much longer cycle life. C/10 cutoff get about 100% capacity at the expense of reduced cycle life. Most smartphones have under 2000 mAh battery capacity so a 2400 mA max charging port is fine. Tablets may have much larger batteries. An iPad typically has 10,000 mAh or more of battery capacity. To charge a 10,000 mAh battery at the 10,000 mA the battery would accept takes special care and design and most chargers will not provide this level of charge.
H: What is the effect of current noise in this op amp circuit? I have modeled a non-ideal op amp as an ideal op amp with a noise current I_n flowing between its inputs: In this circuit, I have also modeled a non-ideal voltage source as an ideal voltage source plus a non-zero source impedance R1. Finally, R2,R3 are the only real resistors in this circuit, and control the feedback of the op amp. As an exercise in op amp noise, I will compute the theoretical rms value of noise of this circuit, and compare it to experimental values, so I HAVE to get this calculation right (please assume that the above circuit is correct, I have omitted some details in order to ask this question.). Now here is the question: what is the rms value of the noise in V_out due to the presence of I_n in this circuit? I argue that, since I_n will flow towards lower voltage, it will run into R_2, and draw current from R1, causing an error of I_n * (R2 + R1) * gain. However, according p.4 of this document (section header is "CURRENT NOISE"): http://www.ti.com/lit/an/sboa060/sboa060.pdf, the noise should be I_n * R3. Perhaps, along with your answer, could you demonstrate why I am wrong and this document is right? AI: Assume V= 0 for now. Since the op-amp is ideal (other than noise), the inputs are always at the same potential (due to the the output voltage changing and through presumed negative feedback). If you have a current I_n then, in order for the inputs to be at the same potential, a current must be flowing through R3 equal to I_n. The resistors R1 + R2 across the inputs do not have any effect since the voltage across them is always zero (if R1 and R2 were both shorts you'd have a 0/0 situation). However, the way you have drawn this circuit (floating V) no current can possibly flow through R3 because you don't have a ground anywhere. So no matter how high the output voltage gets, no current flows. With an ideal op-amp and ideal parts this creates another paradox.
H: Altium: How can I dim the layers I'm not currently using? The routes on all layers are fully bright. I want to dim the ones on the layers not currently used. I don't mean dimming ALL routes (even on the layer I'm currently on) except the one segment I'm selecting. AI: Shift-S will dim all but the current layer (Single Layer Mode). Repeat to get back. One of the most useful keyboard shortcuts in the PCB editor.
H: Arduino cloning a IR signal I have an issue here concerning Infrared and arduino, i have been disassembling various receivers and took out the IR sensor from them, but i have hard time to read any data from them. this is my third attempt to take out a receiver from an older satellite receiver, basically what happens is nothing when i try to point any remote controll to the IR sensor, have tried various schemes but none of them is working. would love to have some input if i do something wrong, do i need resistors or anything between the out signal and the digital input on the arduino boards or anything else? Digital 38KHz IR Receiver, the entire IR sensor is black and seems to be encapsulated with a black molded box. i have tried atleast 3 different arduino boards, all share the same issue on all 3 different IR sensors i tried AI: If you salvage an IR receiver from existing equipment, make sure you determine what the pinout is. They have 3 pins, and all permutations of ground, power and output seem to exist. Instead of guessing you might want to buy a receiver of a known type so you can find a datasheet, they should be < $1. My favourite yellybean is tsop34838, but the US seems to prefer other types. Also make sure you know the operating voltage. 5V types won't work well belove 4.5V or so. I don't know whether 3.3V-only types exist, 3-5V types do exist (I prefer those). The output of such receivers is an open-collector, the types I know have a weak internal pullup. If you connect the receiver correctly and put a LED + 100 Ohm resistor (LED in the correct direction) from power to output, you should get the LED to light light up when you point a suitable IR source at the receiver. Note that the above pinout is for a receiver I happen to use, yours may or may not be the same.
H: Cable Connector Identification I recently bought Belkin Ultimate Surge Protector for protecting my modem, router and PC. I have a broadband connection from Cable provider (through modem via coaxial cable). Now I wish to connect modem via Belkin Surge protector. The above connector is used to connect to my modem. Now I wish to connect this cable to my Belkin Surge protector. Which comes with the following connectors: I don't know name of any connectors. Please help me to find out the names so that I can buy appropriate converters for that. AI: Since my comments could arguably just as well be an answer: Ignacio Vazquez-Adams is correct that the modem connector is an F connector. The connectors on the surge protector are the old British Belling-Lee TV aerial connectors, as found in Europe. The surge protector is clearly identified as being meant for connection to a television, not a cable modem. The Belling-Lee connector is not used in the USA, for good reason: it does not have controlled impedance, so it is arguably not particularly suitable even for its typical application. It can reasonably be used for radios, but at the higher transmission frequencies used for television signals, reflections from the connector are a problem. Thus, the F connector is often used where this matters to the application, such as for cable and satellite TV. The presence of the Belling-Lee connector on the surge protector suggests that it probably also does not have controlled impedance, and its RF characteristics are likely poor in general. You can try connecting the modem to it, but the latter will probably not work as it should (if at all) if you do so. If I were you, I would not bother with surge protection for the cable modem. Buried cables are not as subject to lightning strikes as antennas, although admittedly the surge protector will have little chance of doing anything other than exploding anyway if your TV antenna is struck by lightning. If some terrible event befalls your cable modem because of a surge on the line, it is not the end of the world. The cable company will have worse problems to deal with in this situation than having to send you a new modem.
H: What does PWM width control in brushless motors? For servos PWM controls angular rotation - for example 1ms width means 0 degrees and 2ms means 180 degrees (it is PWM width is proportional to angular rotation). I am not sure what PWM width influence in brushless motors. Of course when I set PWM width to higher value motor runs faster, but is PWM width proportional to thrust, RPM, power or maybe something else? AI: For servomotors, the angular position setpoint is contained in the width of the PWM pulses, but there is no direct action on the motor: a servomotor is in reality a complete control system, with its own angular position sensors and control loops. PWM is convenient given that very often no controller is actually in the servomotor, but if there was one any other digital communication could do. For brushless motors, PWM is not used a communications means, but actually as a technique to modulate the voltage sent to the brushless motor based on a single DC bus. The voltage applied is proportional to the duty cycle of the PWM, or timeON/period. You can safely assume a DC brushless behaves like a DC brushed motor, although inside it is actually an AC synchronous machine with "electronic brushes" (the phases are switched depending on the rotor position, sensed by hall effect sensors usually). Often, they are sold without the switching controller - but both of them are equivalent to DC brushed motors. In brushed DC motors, the voltage applied to the motor is applied across the winding, and its resistance determines how much current it draws from the supply. Current is proportional to the torque provided by the motor. Then, if that torque (called stall torque) is above the torque applied by the load (friction or whatnot), the rotor will spin up and according to Faraday's law of induction, a voltage that is called "back electromotive force" will counteract the voltage applied. This back emf is proportional to the speed of the rotor, therefore there will come a point when the voltage across the winding resistor, and therefore the current, will decrease to a point where load torque and motor torque will be balanced. That's the operating point of the motor. (note: the equivalent model includes an inductor, ignored here) As mentioned above, a brushless motor behaves the same way, therefore the voltage applied acts on the torque and the speed of the motor at the same time, in the following way: If the load torque is very low compared to the stall torque (when rpm=0), then you can assume voltage is approximately proportional to speed since the operating point will be at the very bottom of these torque-speed curves.
H: Which of the following is most limiting factor for data transmission rate? Which of the following is most limiting factor for data transmission rate? Attenuation distortion Phase delay Signal distortion Bandwidth I think its phase delay, but I am not sure. Can someone please explain a bit? Note: This is not my homework and being a CS grad I don't know details of physical communication. AI: First of all, your question is certainly unclear. But it's still important stuff and valuable information for a lot of visitors (at least I'd imagine), so I'm going to answer it. The answer is: It utterly and completely depends on what you're talking about. But I can tell you about some tricks to get a feeling for what we mean by data transmission and how the various factors you're talking about come into it. How to think about transmission media Transmission media can be anything from an electrical conductor to vacuum. All you have to do to get a good feel for what might happen is simply: follow the waves! Start at your transmitter, try to think of how your waveforms look when they exit the transmitter and how the transmission medium and everything around it interacts with it. This goes a very long way in correctly modeling in your head - and eventually in your calculations - where the theoretical limits are going to be. Also ALWAYS think of information on a transmission line as energy. Information requires, at its core, a minimum amount of energy to be transmitted. You'll be surprised how close theoretical limits and actual practical energy requirements are. More power on either end of your transmission line always means more potential information transfer. So if we apply this to a couple of common transmission line topologies, we can immediately see what effects are dominant. Example 1: Antennae An antenna uses nothing as its transmission medium. If we regard two antennae at a distance much larger than the wavelength of the carrier, the transmission medium can essentially be regarded as two very, very loosely coupled sides of a transformer. Loosely coupled because we have geometrical attenuation by design. Your transmitter transmits its power (=information) in all directions, but your receiving antenna is not in all those directions. At least not generally. This is effectively attenuation - and quite a lot. This loss scales as the square of the distance, and you're not going to use antennae for short distances. There's wires for short distances. Antennae are dominated by medium attenuation. This is even more so for antennae in terrestrial applications, where air, buildings and such things cause even stronger attenuation, as well as reflections and such. Example 2: Conductors A conductor solves this problem quite nicely. You're constraining your information waves to a very well-defined channel. They can't get out, so no geometrical attenuation. Well... sort of. Electromagnetic waves in air or vacuum move perfectly; they are not impeded or modified along the way. In a conductor, or any other material for that matter, they get modified constantly. Like light waves through optical media, electrons have a certain speed through conductors which is frequency dependent. This causes the rainbow effects (chromatic abberation) in lenses, and this causes the gradual 'smoothing out' of sharply defined electrical signals as your information flows through the wire. Higher frequencies are damped and phase shifted more than low frequencies. Also, geometry still matters. If your transmission line has discrete sections that are of the order of the wavelength of your information, it will form an antenna and radiate off some energy. If there are sharp corners, those corners will reflect off some of your wave and either attenuate (through destructive interference) or distort your wave. Example 3: Optical media In fiber optics, we kind of combine the best of both worlds of conductors and antennae. On the one hand, we get the constrainment (and thus good long-distance performance) of conductors, on the other we get the much better transmission properties of glass versus copper. In glass fiber optics, the medium no longer constrains our transmission speed. Yes, there are some constraints on e.g. the bandwidth of light that glass is transparent to, as well as the index of refraction limiting some aspects of the transmission line, but it's all far from our current engineering limits. It's the transceiver technology that really limits us here. The laser and photodiode receiver technology is simply not fast enough to get close to the THz regime of the carrier frequency in fiber optics. So here the answer is: None of the above. Or maybe, if you want to be picky: the bandwidth of the transmitter/receiver. Conclusion This doesn't quite answer your question. It's an unanswerable question. But I hope the examples give you some footing on how to approach a proposition like this. I've also deliberately given an example that defies your classification. (footnote: I'm extremely tired, so please forgive me for spelling mistakes and such)
H: Good way to switch AC/DC (Rectifier) in welder I am building a homemade welder out of microwave oven transformers. I would like to have ideally an on off switch and then an AC/DC switch or just having one switch would work too. AC 120V 60Hz comes in through the wall, gets transformed to high current lower voltage and the leads from that go to a bridge rectifier and that's the output (a little simplified). I'd like a way to bypass the rectifier using a switch setup so that I could do AC and DC welding. I can't use a polarity like switch with the high current cause the switch will probably burn up or weld together. AI: I'd guess your best bet is a starter contactor for an automobile. You can get 100 amp units for less than 20 bucks, and you might do a lot better at a junkyard. They typically aren't rated for continuous duty, but I'll bet your welder isn't either. You can get away with this because you aren't attempting to activate or deactivate the switch while current is flowing, and there isn't much voltage across your bridge. You'd need to make a little 12 volt supply for the coil, but that shouldn't be too hard.
H: VHDL using flow control vs minimization I am currently designing a mips microcontroller for a class. I am now working on the control unit for the microprocessor and I am wondering if I should use minimization vs using flow control (if, case). Is minimization (ex : using karnaugh) really good performance wise when using vhdl or should I just keep it easy to expand, modify with flow control? AI: Are you referring to simulation or synthesis performance? Simulation computational complexity is controlled by subprograms being dynamically elaborated plus simulation overhead, all expressions use operators (subprograms) or basic operations (also functions). You'll also find the more abstract (control flow) a design model can be described the faster it will simulate. The amount of work to minimize so is related to the number of concurrent control bits being evaluated times the number of elaborated assignments. The entire idea of synthesis is to avoid having to do minimization and mapping yourself. Come up with a couple of equivalent test cases and time them - the resulting logic will be the same. As far as expressing code in minimized terms try this: library ieee; use ieee.std_logic_1164.all; entity s381 is port ( signal A,B: in std_logic_vector (3 downto 0); signal S: in std_logic_vector (2 downto 0); signal CIN: in std_logic; signal SUM: out std_logic_vector (3 downto 0); signal P: out std_logic; signal G: out std_logic; signal ZERO: out std_logic ) ; end entity; architecture behave of s381 is signal SEL: std_logic_vector (4 downto 0); signal CY_EN: std_logic; signal C: std_logic_vector (3 downto 0); signal E: std_logic_vector (3 downto 0); signal LC: std_logic_vector (3 downto 0); signal F: std_logic_vector (3 downto 0); begin SEL(0) <= not S(0) nand not S(1); SEL(1) <= not S(1) nand not S(2); SEL(2) <= not S(0) nand S(1); SEL(3) <= not (S(0) and S(1) and not S(2)); SEL(4) <= (not S(0) and S(2)) nor (not S(1) and S(2)); CY_EN <= (not S(0) nand not S(1)) and not S(2); C(0) <= not ( (not A(0) and not B(0) and SEL(2) and SEL(1)) or ( SEL(0) and SEL(2) and SEL(3) and not B(0) and A(0)) or ( SEL(1) and SEL(3) and B(0) and not A(0)) ); E(0) <= not ( (not A(0) and not B(0) and SEL(0) and SEL(3) and SEL(4)) or ( SEL(1) and SEL(2) and not B(0) and A(0)) or ( SEL(1) and SEL(2) and B(0) and not A(0)) or ( SEL(0) and SEL(3) and B(0) and A(0)) ); LC(0) <= CIN nand CY_EN; C(1) <= not ( (not A(1) and not B(1) and SEL(2) and SEL(1)) or ( SEL(0) and SEL(2) and SEL(3) and not B(1) and A(1)) or ( SEL(1) and SEL(3) and B(1) and not A(1)) ); E(1) <= not ( (not A(1) and not B(1) and SEL(0) and SEL(3) and SEL(4)) or ( SEL(1) and SEL(2) and not B(1) and A(1)) or ( SEL(1) and SEL(2) and B(1) and not A(1)) or ( SEL(0) and SEL(3) and B(1) and A(1)) ); LC(1) <= not ((CIN and C(0) and CY_EN) or (C(0) and E(0) and CY_EN)); C(2) <= not ( (not A(2) and not B(2) and SEL(2) and SEL(1)) or ( SEL(0) and SEL(2) and SEL(3) and not B(2) and A(2)) or ( SEL(1) and SEL(3) and B(2) and not A(2)) ); E(2) <= not ( (not A(2) and not B(2) and SEL(0) and SEL(3) and SEL(4)) or ( SEL(1) and SEL(2) and not B(2) and A(2)) or ( SEL(1) and SEL(2) and B(2) and not A(2)) or ( SEL(0) and SEL(3) and B(2) and A(2)) ); LC(2) <= not ( (CIN and C(0) and C(1) and CY_EN) or (C(0) and C(1) and E(0) and CY_EN) or (C(1) and E(1) and CY_EN) ); C(3) <= not ( (not A(3) and not B(3) and SEL(2) and SEL(1)) or ( SEL(0) and SEL(2) and SEL(3) and not B(3) and A(3)) or ( SEL(1) and SEL(3) and B(3) and not A(3)) ); E(3) <= not ( (not A(3) and not B(3) and SEL(0) and SEL(3) and SEL(4)) or ( SEL(1) and SEL(2) and not B(3) and A(3)) or ( SEL(1) and SEL(2) and B(3) and not A(3)) or ( SEL(0) and SEL(3) and B(3) and A(3)) ); LC(3) <= not ( (CIN and C(0) and C(1) and C(2) and CY_EN) or (C(0) and C(1) and C(2) and E(0) and CY_EN) or (C(1) and C(2) and E(1) and CY_EN) or (C(2) and E(2) and CY_EN) ); F <= LC xor E; P <= C(0) and C(1) and C(2) and C(3); G <= ( (C(0) and C(1) and C(2) and C(3) and E(0)) or (C(1) and C(2) and C(3) and E(1)) or (C(2) and C(3) and E(2)) or (C(3) and E(3)) ); SUM <= F; ZERO <= not (F(3) or F(2) or F(1) or F(0)); end architecture; It can't be maintained without resorting to other documentation showing what operations S defines and why there are particular intermediary terms. From the LRM, IEEE Std 1076-2008, 1.2 Purpose: The VHDL language was defined for use in the design and documentation of electronics systems. How much documentation is inherent in the above VHDL code? Compare the above minimized description to a control flow expression (VHDL code for an 74-series ALU (the 74LS381 chip)) library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- s2 s1 s0 operation -------------------------- -- L L L clear -- L L H B minus A -- L H L A minus B -- L H H A plus B -- H L L A xor B -- H L H A + B -- H H L AB -- H H H PRESET entity IC74381 is port( a: in std_logic_vector (3 downto 0); b: in std_logic_vector (3 downto 0); s: in std_logic_vector (2 downto 0); f: out std_logic_vector (3 downto 0) ); end IC74381; architecture arch of IC74381 is signal BminusA,AminusB,AplusB,AxorB,AandB,AB: std_logic_vector(3 downto 0); signal au,bv0,bv1,bv2,bv3: unsigned(3 downto 0); signal p0,p1,p2,p3,prod: unsigned(7 downto 0); begin BminusA <= std_logic_vector(signed(b)-signed(a)); AminusB <= std_logic_vector(signed(a)-signed(b)); AplusB <= std_logic_vector(signed(a)+signed(b)); AxorB <= a xor b; AandB <= a and b; au <=unsigned(a); bv0 <=(others=>b(0)); bv1 <=(others=>b(1)); bv2 <=(others=>b(2)); bv3 <=(others=>b(3)); p0 <="0000" & (bv0 and au); p1 <="000"&(bv1 and au) & "0"; p2 <="00" & (bv2 and au) & "00"; p3 <="0" & (bv3 and au) & "000"; prod<=((p0+p1)+(p2+p3)); AB<=std_logic_vector(prod(3 downto 0)); f <= "0000" when s="000" else BminusA when s="001" else AminusB when s="010" else AplusB when s="011" else AxorB when s="100" else AandB when s="101" else AB when s="110" else "1111"; end arch; (And I'd personally have replaced BminusA, etc. with the expressions on the right hand side of their assignments in the assignment to f. Finding an equivalent was fortuitous, around 20 years separate their authorship.) Without validating both I'd expect they both can produced the same complexity logic following synthesis. The amount of grunt work synthesis tools perform isn't the controlling factor in EDA today. In addition to design and documentation verification is increasingly more important (also from the LRM, same paragraph): It is revised to incorporate capabilities that improve the language’s usefulness for its intended purpose as well as extend it to address design verification methodologies that have developed in industry. Now ask yourself from which of the two above forms can the person stuck doing verification more easily determine what the expected result should be? You might notice there are two errors in the second example. The distinction being there is almost sufficient information to fix it from the design description. What's missing is a more complete description of the 8 operations: -- eight function ALU -- S(0) S(1) S(2) -- 0 0 0 CLEAR -- 1 0 0 B MINUS A -- 0 1 0 A MINUS B -- 1 1 0 A PLUS B -- 0 0 1 A XOR B -- 1 0 1 A OR B -- 0 1 1 A AND B -- 1 1 1 PRESET A hardware description is about more than just the logic. The minimized expression version was done in a time when synthesizing arithmetic functions cost more in licensing costs. CPU performance and memory sizes made the distinction in time (expressed in the value added) increasingly less significant. We tended to document better for ASIC targets than is generally done for FPGAs, you could look it up in the design specification, plus their were data books of datasheets with schematics.
H: Using multiple current sense resistors in parallel to handle a high current measurement with cheaper resistors I am measuring the current going to a motor using current sense resistors; however, in order to get a resistor that can handle the proper power, the price goes up way too much. My question is, can I use multiple lower power rated resistors in parallel to measure the same current value? In other words if I need 10W single resistor, I would break that up into five 2W resistors in parallel with the same value. They would all have to be the same resistance value/tolerance and the power margin would need to overcome the tolerance of the resistance. Seems mathematically fine, but wanted to see if there are any gotchas here? AI: You should be fine if you are careful about the physical layout. In theory, five equal value 2 watt resistors in parallel will be able to dissipate 10 watts However, if the resistors are physically close to each other, each one could heat up the others so that their temperature could exceed a safe value even if the total dissipation does not exceed 10 watts. I would consult the data sheet for these resistors to see what the mounting requirements are especially as to how close to heat sources they can be.
H: Shift registers, understanding parallel-in serial-out I have the 74hc597 parallel-in serial-out (PISO) shift register. The datasheet can be found here. I have a general idea about how serial-in shift registers (SIPO) work, but I'm having trouble understanding PISO and what a couple of pins do or how they work. I have a few (very basic) questions about this table in particular: Questions: 1) The shift register is clearly described as a 'parallel-in serial-out' (PISO) shift register, so why is there a 'serial data input' pin? 2) Which clock input (shift register or storage register) is used for controlling the serial output? I am guessing 'shift register clock input' is used because you are shifting out one bit at a time from the parallel data stored, right? 3) What is 'parallel load' input? Is this used for reading all the parallel inputs? Is it some type of latch pin, similar to SIPO shift registers? Here is my summary of how I think PISO shift registers work, please tell me if it's wrong: -When the 'parallel load input' is set to LOW, all the inputs enter the register -Then when the 'storage register clock' pulses, the data is saved into the storage register. -Then during each 'shift register clock' pulse, the bits are outputted one by one Thanks for your help. AI: Refer to the datasheet (better if you provide a link to the datasheet you're consulting in your question, but from the colors I assume it's NXP). This particular shift register has an input latch as well as the PISO shift register. Some (eg. 74HC165) don't have the input latch. In answer to your questions: 1) When you are shifting the shift register, something will get shifted into the serial input. That pin allows you to choose to shift in logic '0', '1', or perhaps cycle the contents around, or whatever else you choose. 2) Rising edge on SHTP clocks the shift register. 3) Rising edge on STCP loads the input latches from the inputs. Note a low level on /PL loads the shift register from the input latches. If /PL is low, then a rising edge on STCP loads the shift registers from the inputs. /MR resets the shift register (not the input latches) and it is considered 'invalid' to have /MR and /PL active at the same time.
H: Thermal power dissipation for a diode with heatsink I have a circuit that has a diode that needs to support 3A through it. The supply is at 7.2V and is therefore ~22W. I have currently selected a schottky diode show here. Key specs are it can support up to 5A, has thermal resistance junction to case of 12K/W, and a max junction temp of 150C. The heatsink I plan on using has a thermal resistance of about 3C/W. I am trying to do some thermal calculations to make sure the device can support my usecase. I am using an online calculator such as this one and input the specs from above. Two things I have questions on: The units are in K/W. Looking online, it seems people treat C/W and K/W the same, and I am not sure why as they are different units; however if you convert the K to C values, you will get all negative values. Once again more confusion. What do I use for power here? Using 22W (system power) gives ridiculous results and states that the heat sink will not work, so I am assuming that I use the max forward voltage at max current (~.36V) times the current I plan on running it at (3A) and take .36 * 3 = 1.8W. This then was input to the calculator showing a junction temp lower than what the diode is spec'd to (i.e. I can use it). Am I correct using this power? AI: Temperature differences in Degrees C and K are the same. Using K for differences helps keep it straight that we are talking about differences such as rise above ambient, and not the actual temperature. You use the power dissipated in the diode to calculate the temperature rise- Vf multiplied by the current, just as you conjectured.
H: PCB design few questions Quick couple of questions, I am designing my first PCB and want to have a few boards prototyped with OSH Park. For a board I will be manually soldering components to, will I need to include a tCream layer or is this for automated soldering only? And, do hobbyists generally make the surface mount pads a little larger than the components data sheet specifies, to help with soldering? Are there any other tips/tricks a first timer might like to know to make life easier? And, for milled slots, i.e. two holes for a USB receptacle to mount to the board, do I need to include a note for these or is the data on the 'holes' layer sufficient? Thanks in advance AI: OSH Park have some guidelines which answer your 'cream layer' question. The answer is no, you only include layers that they will use for manufacture. I have always found Laen at OSH Park is extremely helpful and supportive, so I recommend you email if you have any concerns. As for cutouts, it depends a little on how you are making the slot. I have used overlapping drill holes (not allowed at many PCB manufacturers, but OSH Park did it). Otherwise I have put slots on an outline layer. OSH Park have extensive help under Support, for example creating slots is explained here. For any devices which have pads under the package, I do extend them beyond the package boundary. Otherwise it is difficult to solder. In general I don't make pads larger, but I often use Sparkfun libraries (at least for packages and footprints) which are pretty good.
H: How to clean up a noisy signal? I'm controlling a 4-pin PWM PC fan from a PIC16F684 with the fan speed driven from an ADC reading of a proximity sensor. This all works ok. I wasn't originally planning to use the tachometer output from the fan, but as it's available I been monitoring it with my 'scope just to see that my mapping between proximity and fan speed is working. Now, what I've noticed is that when the PWM is running the fan at 100%, the tach signal (which is an open drain pulled up via a 10K resistor) is nice and clean: However, when I run at less than 100%, it's noisy: Zooming in on that noise: I'm guessing it's being affected by the PWM signal but I would like to understand why and how so that I could clean it up if necessary in future. Really I'm interested in what you should do when you see noise like this, how you find the cause and how you "fix" it. The scope manages to trigger ok so I'm wondering if I just feed it to the external interrupt pin on the PIC (RA2), which is a Schmitt Trigger input with CMOS levels, then I won't "see" the noise and I could e.g. echo a clean signal out of another pin to fade an LED or something. So can someone explain in general terms how to go about recognising and correcting noisy signals? Or if that's too broad maybe just this particular problem? Also if there's anything wrong with my circuit it would be nice to know too. In the schematic below, the signal I'm displaying is the TACH input at the left of the circuit: UPDATE After helpful suggestions from both @MichaelKaras and @techydude, I've ruled out Q2 as the source of any problem by removing it from the circuit completely and grounding the fan directly. No significant effect on the noise. So I then coded the external interrupt on RA2 to echo a "cleaned" signal out of a spare pin (RA1 in this case), which helped a lot but was still flickering due to false interrupts. (So I'd set the interrupt to trap rising edge then switched to falling edge when triggered and vice versa, setting/resetting RA1 accordingly). But, after also adding a 100nF capacitor across R3 (as part of @techydude's suggestion), I now get a much more stable output. The screenshot below is the TACH signal after cleaning via the Schmitt Triggered RA2 input and re-output on RA1: AI: About your schematic: Everything seems fine, you can increase the R2 to 10k or even 100k, the capacitance of the MOST is so small, the FAN will have much more spinning inertia than the turn off delay in the MOST, probably even with 1M. That way the location of your 100R is irrelevant and while on you don't waste any mA's. If you never hold de uC in reset it's technically not even required at all, since your uC will actively pull it high or low. For the PWM signal, you could see if the datasheet allows an external pull-up to 12V, though I doubt it will make much of a difference either way. About the noise: EDIT: I misread your plot for kHz, which is stupid if you think of it, where it's Hz. Some of my story will change a little (such as the talk about needing MHz for digital work), but the general idea remains. I will leave the entire post as-is, but for a 100Hz signal with 30kHz noise, in stead of 100kHz with >5MHz noise (also didn't really make sense, did it?), you might increase the resistors that interact with capacitors by a factor of 10, and also increase the capacitors by a factor of 50 to 100. That'll get you a factor 1000 lower filtering frequency in all the examples. But it's also okay to just increase the capacitors by a factor of 10 to 20, for sharper edges or faster response on your signal of interest, since 30kHz is very far from 100Hz. So consider this post as written for high frequencies and scale down the ideas, making them much easier to implement too! (Especially the digital rejection in 3.) End of Edit Since you make such a nice use-case for working through methods of noise reduction, I'll try to make one that applies to your situation. To anyone reading, be aware: This is only about noise on a digital signal In a digital signal you can make an assumption that there's only two voltages you are interested in "on" and "off". Anything in between is pointless and belongs to noise or wrong. In an analogue signal, you need to know about every voltage level and you need to do some actual filtering with loads of C's, L's, etc. A problem in your signal is that the negative noise spikes on the high level and the positive noise spikes in the low level come very close to each other, so a simple standard trigger, even with adjustable level cannot absolutely guarantee you that you will never get confused. Your options: Change the Bias Change the Voltage Levels Add "slow" Hysteresis Filter out the Noise 1. Change the Bias: The positive has very low negative spikes, that's because your pull-up cannot win from the noise. The easiest thing you can try is decreasing that resistance. There is a risk this will just increase the spikes on the off signal as well, so that may not always work. But it is very possible that it will give you some head-room between the spikes to set a simple hysteresis. 2. Change the Voltage Levels You can easily, if the fan allows it, change the Tacho to a higher voltage level and add an intermediate state: simulate this circuit – Schematic created using CircuitLab Now there might just be enough space between the high and low spikes to make sure the MOST is always on, even when there's negative spikes and always off, even if there's positive spikes. It may take some diodes, zeners, or resistors to get the set-point in the new situation, but if the spikes on the negative signal stay what they are, they shouldn't be triggering the MOSFET, as long as you don't replace it with one that has a gate-threshold below 2V. 3. Add "slow" Hysteresis: This is a trick that's commonly used when you know a spiky noise signal is of at least an order of magnitude larger than the signal you are interested in. It will delay the signal a little, so it cannot be used in situations where the exact moment of a on/off change is important. But for a signal where you only want to know the shape or frequency of it, this is a very robust method. It basically starts to trigger when there's a voltage crossing the threshold, but only completes that action when it stays there. There are many ways to build one. You can do it in the controller (which is easiest in component count): You can trigger on a flank, then sample some more values at enough speed to see the high between noise spikes, but not confuse about missing a whole period of low. Then you make a predefined judgement based on the knowledge of your signal and noise. For example, if you could sample at 10MHz, you could capture 50 samples and be certain that a 100kHz highest frequency will not be ignored if you go with majority rule. I.e.: at least 25 need to be low for it to actually be low. Your spikes are only very thin and the most time it is the original signal, so that could work, but the number of a majority can be adjusted. This will work with 1MHz and 6 or 7 samples as well, but it'll be less of an actual majority, so there may be some risks again there. 1MHz at the least should be feasible with most modern day uCs. You can also do it externally: But it's already MUCH more complicated than adding a simple filter, especially when you look at the result with a uC with some hysteresis in its input already. But it's fun to think about, so let's: simulate this circuit U1 is any suitable Op-Amp or Comperator. Comperators are better switchers, often with better swing, but for sub-MHz an OpAmp with decent rail/rail swing will easily do. While this type of hysteresis can be built with at least one resistor less, this one is easier to explain and as such easier to modify. First imagine it without the capacitor: First, see that the resistor divider is influenced by the output of U1, it will pull it a bit lower of higher through the 20kOhm apparent resistance. Let's say on the positive input of U1 is a voltage of 1.1V rounded down when its output is 0, and 3.9V rounded up when its output is 5V. If the steady-state start-up Tacho Input is high, U1's output will be low, due to the inverting nature of the input to the Tacho. So the negative input will be, again due to the extra pull-up resistor, about 2.3V. Since the positive input is only 1.1V the input needs to drop to below 2.2V to make the negative input see a voltage lower and make the output flip over. When the output flips over, the negative input will see 3.6V (because at this instant the input signal is 2.2V, the output of U1 is 5V, so their middle, made by the 10k resistors is about 3.6V), but the positive input will have flipped from 1.1V to 3.9V, so the negative is still below the positive input and the output will stay 5V. If the signal now quickly "aborts" and flips back up, the output of U1 will quickly go back again, but then the spike has already had to drop below 2.2V, so that's better than nothing. If the signal goes further down to 0, the stable situation will only become stronger, the negative input will drop to 2.5V (since we assume the FAN's tacho to be strong enough of a pull-down) and the positive will rest at about 3.9V. Now the signal needs to raise above 2.7V for the output to flip the other way. Very likely 95% of your spikes will get ignored already. Adding the capacitor: With the capacitor, the incoming signal needs to supply enough energy for enough time to charge or discharge the capacitor. In effect that is already an R-C filter. Any spike that quickly dips and then recovers will not be able to discharge the capacitor. The value of C of course depends on the source signal and the noise signal. I have ball-parked 510pF for a 100kHz source signal vs 1us spike duration at most, but I didn't really do much maths, it's just a R-C-time based gut feeling that this might be close to what will work. 4. Filter out the Noise This is a bit like just filtering an analogue signal. You can use a simple R-C network, like discussed in the previous section: simulate this circuit Since the noise spikes are at or less than 1us, they cannot make a very significant change in the voltage on the capacitor, since its R-C-time is 5us. This means that the energy in the spikes is flattened out down to an average. Since you see high tops and low dips on the spikes it's even possible the averages will be very close to 0V and 5V, but that can only be said with either better pictures, or just an experiment. Since you feed it to a uC pin, the R-C-time will probably be enough to see it as high or low. This will give a small distortion due to the slower charging than discharging, caused by the pull-up resistor. Some tweaking of values may yield a result in which that is negligible. If that's not enough you could add some more components, but you're very quickly overdoing it when your dominant noise is at least 10 times "faster" than your signal. You could add a 4.7uH inductor in series with the resistor to smooth out some more high-frequency flanks, maybe even 10uH. But to be honest, in the case of "feeding it to a uC" the only reason to experiment with L's in a signal of your kind is to find a balance in which the R is large, C is small and L just helps smoothing out some flanks, so that R2/R1 will be small enough to ignore the difference in rise and fall time. such as an R1 of 33k, C of 150pF and an L in series with R1 of 56uH. Or maybe a ferrite bead in stead of the inductor, depends a bit on the sharpness of your spikes. But already over-thinking it, I would say.