source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Does an ALU always do add and sub, but only returns one of the results? Pretty simple question. Does an ALU internally always do multiple operations like add, sub, div, mul, ... and you simply have to specify which result you want to return? I was told that it does that, but I wasn't able to find proof of that being correct. Though I found some graphics containing a multiplexer which from my understanding has basically one output and multiple inputs and by setting some special inputs you can pipe on input to the output. So that might be it, but I don't know enough about that to fully understand it. I'm specifically wondering about the 8085 architecture's ALU in case it is special, but I'd also like to know about other ALUs if there are different ones. <Q> Look up the age of the 8085. <S> It dates from the era when every part of a circuit was hand optimised, and hand layout with tape and razor blade was still common (though likely Intel was using CAD systems). <S> So it would have been designed to aggressively minimize the number of gates used. <S> And as Tom says, you can add and subtract using the same circuit with a little care - <S> so I think that gives you your answer. <S> From GBulmer's comment: Can you see a way to produce multiple results (for example add and subtract) simultaneously, and select the correct answer with the fewer gates (or transistors) than logic producing only one result? <S> Personally, I can't. <S> If you produce both answers, you need additional logic in the form of multiplexers to select the one you want. <S> Now I'm not going to run the experiment, but I suspect that if you write an ALU in VHDL, which follows this approach, a modern synthesis tool will spend a very long time (several seconds) and optimise it down to something close to the hand-optimised version. <S> To test this hypothesis, generate A+B, A-B, and a 2:1 multiplexer as separate modules, synthesise them separately and note resources. <S> Then roll them up into a single design and re-run synthesis (you may need to enable optimisations, "optimise for area" and "flatten hierarchy"). <S> The latter will be smaller : <S> how close it is to a hand-minimised version I don't know : the challenge is set if anyone wants to add another answer! <A> The 8085's ALU does only the operation you ask for, using a somewhat inscrutable collection of gates. <S> In particular, the 8085 (and all the other processors I've reverse engineered) perform subtraction using 2's complement addition. <S> That is, they invert the second argument and then perform addition on it. <S> It would be kind of strange to use separate circuits for addition and subtraction. <S> One exception is the 6502, which uses a multiplexer to select between AND, XOR, shift-right, OR, and SUM. <S> (Shift-left, subtract, and compare are done using SUM.) <S> For more than you wanted to know about the 8085 ALU, see my article . <S> Here's a diagram showing one bit of the 8085's ALU circuitry. <S> Note the multiplexer up front (i.e. at the bottom) that selects either argument X (for addition) or negated argument X (for subtraction). <S> The blobs of gates in the middle perform AND, OR, XOR or SUM based on the select_op1 <S> and select_op2 inputs. <S> Note that only one operation is performed. <A> There are different instructions in an 8085 instruction set for 8-bit adds and subtracts (and none for multiply- <S> it's a very primitive processor). <S> There is only one byte-wide result (plus some flags) for such operations. <S> If you are defining your own ALU you can certainly make it do whatever you like, within the resources of whatever is implementing it (an FPGA or whatever), but there is little need of such things in most small processors. <S> Offhand <S> I can't think of one that provides multiple answers at once (not counting say multiplies that have a wider result than the operands), however there are certainly ones that perform multiple operations- <S> such as the multiply-accumulate (a multiply of two numbers, followed by an add of the results to another register) operation that is often used in filter implementations. <A> I can't give you details on the 8085 architecture, but in general it does not make sense to have all functions implemented in parallel. <S> For example, take a simple ALU <S> that has ADD, SUB and NEG instructions only. <S> Also note that the subtraction A - B is nothing else than adding the negated value of B: <S> A - B = <S> A + (-B). <S> That means, addition and subtraction can be done in the same adder circuit, just by activating a negation logic in front of one of the inputs. <S> Next, the same negation logic can be used for the NEG instruction, by forcing A = 0. <S> In total, this ALU just needs one adder and one negation to fulfill all three operations, thus saving expensive space on the silicon die. <A> This is very implementation specific, but usually not correct. <S> An ALU subtract ( X - Y ) in a typical implementation is as follows:-Two's complement calculation performed on the second number ( Y ), giving ( -Y )-Addition of the the first number and the twos complement output ( X + ( - Y ) ) <S> Multiplication and Division are more complex, but fundamentally have some overlapping functionality, so many implementations will have one unit capable of doing either.
To answer your more general question, most of the early processors I've looked at (4004, 8008, 8085, Z-80, ARM1) do not use multiplexers to select the ALU operation, but perform only the desired operation. Some implementations will have a subtraction unit in addition to the main addition unit, but it is more common to have a single addition unit that is used for both addition and subtraction.
FCC regulations for induction furnace I was looking at getting an induction furnace for home/experimental use, and I just don't understand how these devices can operate within FCC limits. Dumping several kilowatts into an unshielded coil at frequencies in the hundreds of kilohertz seems like it would interfere with primary services in the area using those frequencies. Am I misunderstanding the operation of induction furnaces here or the FCC guidelines or both? Here is an example of the type of furnace I am looking at. <Q> The FCC does regulate induction heaters. <S> The main intent of an induction heater is to produce a magnetic field, not an electomagnetic field (radio wave). <S> Propagation of magnetic field and electromagnetic fields are a little different, and I will leave that discussion for another time. <S> So ideally, the electromagnetic part is contained within the enclosure of the induction heater's enclosure, while the magnetic field portion is, of course, outside of the enclosure (the heating coil which produces the magnetic field). <S> The means of creating the magnetic field (switching power supply) can of course create undesired electomagnetic emissions. <S> This is where manufacturers have to work more diligently to not cause interference. <S> See this page for lots of boring details on industrial heaters. <S> The main enforcement for induction heaters is through complaints by other people using the frequency spectrum. <S> At one time, a 200 KW 10 kHz induction heater, because of a poor installation, was effecting listeners of an AM radio station (1400 kHz) in St. Louis. <S> Listeners complained, induction was located by FCC, problems corrected, every body happy then. <A> Air cored coils aren't good antennas: <S> Why is an inductor not a good antenna? <S> In the EU regulations, if I remember rightly, the low point of testing was 250kHz; you could emit much more below that band without regulatory problems. <S> As the frequency gets lower, wavelength becomes very long, and everything that's not a long open length of wire becomes a bad antenna. <S> Small appliances are at risk in the MHz to GHz range because that corresponds to the length of board traces which might act as antennas. <A> You assume that there are other services that can be interfered with in the same frequency band. <S> Now what if there are none ? <S> That is where the FCC comes in. <S> They demand from manufacturers that their devices operate in a certain frequency band which is reserved for these type of applications ! <S> The FCC will also set limits on the allowed RF transmissions (spurious signals) outside that frequency band. <S> If everyone just used all frequencies without any regulations most of the frequency spectrum would be unusable. <S> So that is where the FCC (and ITU) come in, they regulate and assign frequency bands for certain applications to keep (almost) everyone happy. <S> Besides, to transmit such low frequencies ( <S> up to a couple 100 Kilohertz) <S> effectively you need very large antennas because the wavelength is also very large. <S> Since the coil in these heating/charging devices is small, very little signal "escapes" into the "ether".
The FCC has allotted frequency bands exclusively for industrial heating use. The regulations mainly are concerned with interference with other users in the frequency spectrum.
Capacitors -> Storing 500 Joules in a capacitor with a simple 9 volt battery I am a newbie to not only this forum, but electrical hobby(ing) also. I need 500 Joules within a few milliseconds from a capacitance. I plan to make this capacitance at "home". I plan on using a standard 9V (18KJ) battery to charge this up. What would be a suitible dielectic, and how would I go about doing this? [EDIT] I want all 500J in a few miliseconds at 200V <Q> You don't. <S> 500 J of energy at 9 volts implies a capacitance C such that$$C = \frac {2 E}{V^2} = \frac{1000}{81} = 12.3 \text{ <S> F}$$ Now, the formula for capacitance of two plates of area A and <S> separation d is$$C = <S> \frac{k\times \epsilon_0 <S> \times A}{d}$$ where $$\epsilon_0 = <S> 8.845\times <S> 10^{-12} <S> $$ <S> and k is the relative permittivty of the dielectric. <S> Assuming the spacing between plates is .01 inch (.000254 meters) which is a reasonable thickness for paper, and the relative permittivity of the dielectric is 2, this can be rearranged to give $$A =\frac{ C\times d}{k\times \epsilon_0} = \frac{12.3\times <S> 2.54\times 10^{-4}}{{2\times8.845\times 10^{-12} }} = <S> 1.76\times <S> 10 <S> ^8\text{ m}^2$$ or about 176 square kilometers. <S> This says that, for instance, if you were planning to use aluminum foil with a paper dielectric, you'd need about 300 square kilometers of foil (paper has a relative permittivity of about 2.3). <S> A 200-square-foot roll of aluminum foil (18.4 square meters) currently costs about 10 dollars. <S> This suggests that you will need to spend about 160 million dollars if you plan to buy your foil at the local supermarket. <S> You'll also need about 300 square kilometers of paper, but I'll leave the pricing of that up to you. <S> You might also give some thought to exactly how much this will weigh. <S> (Hint: you're looking at about 76 thousand cubic meters.) <S> You can, of course, use something thinner, like Saran wrap, which is about 1/20 the thickness I've specified. <S> This will cut your foil requirements by a factor of 20, but I'm not sure 8 million bucks for foil is what you'd call a practical number. <A> Energy stored in a capacitor: \$E = <S> C*\frac{V^2}{2}\$ <S> Rearranging to solve for the capacitance, \$C = 2*\frac{E}{V^2} = <S> \frac{2*500 J}{9* <S> 9 <S> V^2}\$ = <S> 12.3 Farads. <S> I Have never made a large capacitor before. <S> I assume it would be best to create an electrolytic one because of how high of a capacitance you want. <S> Or, you could just buy a super cap. <S> They aren't too expensive. <S> But creating one sounds fun too. <S> Cheers! <S> EDIT: <S> The speed at which you can discharge your capacitor will depend on how much current you can drain out of it. <S> This depends on the load (and the internal resistance of the capacitor itself). <S> The fastest (easy) way to discharge a cap would be to short circuit it. <S> I'm not sure if this is safe when dealing with large caps... <A> If you want it at 200V, then you will need 25,000uF of capacitor rated to more than 200V. <S> You will also need a boost or flyback converter to charger your capacitor up from the 9V source. <S> You can harvest small flyback converters from the flash circuit in disposable cameras, though they tend to be designed for 1.5V (AA battery) input and will charge up to about 350V. Bonus: you get a free 350V capacitor that holds about 7J in each disposable camera! <S> Solder a hundred of them to a big PCB, being careful to minimise stray inductance, and you have your 500J capacitor. <S> I think you grossly underestimate the costs and difficulty of DIYing this capacitor. <S> Note also that 500J at 200V is quite hazardous, i.e. it can easily kill you.
You will need a pretty big capacitor for this.
Resistor Mounted On Top of IC? Recently, I've been working to repair a broken 1980 "Arp Solus" synthesizer that I acquired from a friend. I have, however, found myself confronted by an unfamiliar arrangement: some kind of resistor fixed (glued? melted?) firmly to the top of a nearby IC. The IC beneath is a CA8036 General Purpose Transistor Array. The resistor is axial, matte black and cylindrical, with no notches or contours, and is labeled "1.87 kOhms", "+/- 3%", "KRLP IC", and "8047". In the schematic, it is drawn as a standard 1.87k resistor but is also marked "3% T.C." My initial though was that "T.C." stood for temperature coefficient, and the resistor was placed such that it would compensate for the changing behavior of the transistors as they began to heat up, perhaps keeping the oscillators in tune. But a 3% temperature coefficient would be 30,000 ppm/C which seems impossible. What kind of resistor is this? Why is it stuck to the IC? And to what does "3% T.C." actually refer? Thanks! Additional info if needed: Here's the link to the service manual , which includes the full schematic. The arrangement occurs twice in the circuit, one located in each of two voltage-controlled oscillators. Neither VCO is functioning. The synth has apparently undergone one other previous repair, somewhere between 15-20 years ago. <Q> It would appear to be a thermistor, for which a 3% temperature coefficient (usually referred to as "alpha" in the datasheet) is not unusual. <S> 1.8k is probably the resistance at 25C. <S> It's probably a temperature-feedback mechanism, either to protect the transistor array from overheating, or to correct the behaviour of the circuit with respect to the temperature dependence of the transistor array. <S> As BJTs get hotter, they conduct better. <S> Vishay intro to NTCs . <S> Yours may be positive or negative, who knows? <A> This is probably (as you initially suspected) <S> a temperature-sensitive resistor, or a thermistor. <S> These come in positive and negative temperature coefficients, and can indeed have coefficients in the 3% per degree C range. <S> Thermistors are not all that linear with temperature, and usually are specified with a curve and a "K" value, rather than a %TC number. <S> It could be a heater, but given the small size I suspect that it is a sensor instead. <S> [edit] Looking at the schematic <S> , it's not a heater. <S> It is doing temperature compensation of offset or control voltage, perhaps to keep the frequencies stable? <A> I have not looked at the schematic, but it's a temperature compensation thermistor for a log/antilog circuit. <S> The chip is a transistor array (I used them for instrumentation back in the old days), and the thermistor is supposed to be thermally coupled to the chip. <S> Below you'll see a typical schematic of such as circuit (taken from here ) with a ~0.3% thermistor. <S> (Much) more on log/antilog amplifiers can be found here and here including the math behind why the coefficient has to be around +3400ppm/K at room temperature. <S> The nearby dual op-amp (RC4558) is probably associated with this circuit. <S> Typically in a music synthesizer it would be used to create a VCO with an exponential response of frequency with respect to control voltage. <S> This is really old stuff (1970's maybe judging by the photo). <S> Not much goes wrong with it, fortunately, and most of what goes wrong should be easily fixed. <S> I'd suspect power supplies first, then the RC4558s. <S> Don't fool with the thermistor/CA3086 unnecessarily-- <S> they are probably the hardest parts to get. <A> Given the high values of the resistors around it, it is not being used as a heater, but rather as a sensor. <S> It appears to be temperature-compensating the log-to-linear converter, which is "upstream" from the actual VCO. <S> For example, take a look at the one built around Z11 and associated components on the upper right corner of the first schematic page. <A> Edit: <S> Having a look at the full schematic, it is apparent that it's not an active control, but appears to be working as a heater of some sort for the transistor array Z12. <S> I can't explain why it runs off of a control voltage!
It is most likely the heater for the temperature control (TC) being implemented by one of the spare transistors in that IC.
Driving a DC Motor without diodes As you know, H-bridge circuits are used in order to control DC motors. Switches S1-S4 are closed to turn the motor in one direction, S2-S3 are closed for another. But at the time of changing motor direction, when switches (transistors) are opened, Back EMF kicks in and makes the switches blow up. That's the reason of using diodes parallel to switches (See figure below). On the other hand, these diodes consume significant amount of power. I am currently trying to solve this problem, and make a "diodeless" H-bridge circuit work. I am using an mCU to control the motor with PWM signals. Is it possible to make a flawless timing for switches to not blow up? For example, on the schematic above, assume that the situation is as this: S1 and S4 are closed and motor turns in that direction. When I want to change the direction, I open S1-S4; and close S2-S3. By this, I have burnt the switches several times. Now, my idea here is to open S1, and close S3 for a while. By this, I think I'll be able to let the remaining current be absorbed (on the circuit S3-Motor-S4). Then, I open S4 and close S2, which reverses the direction of the motor. As I said above, I am not sure about that if it is possible with an mCU. Also, I would need to analyze the characteristics of the motor and switches in order to find the perfect timing for the algortihm. What do you think about this idea? Is there any method that you know or can suggest to overcome this power consumption issue? I have searched online but couldn't find anything. <Q> Well, what you're asking for has already been done for many years in a completely different field. <S> We call "Diodeless H-bridges" class AB push pull amplifiers. <S> You'll likely want some pretty fast transistors that have a low saturation voltage. <S> Bonus, the less switching you do the more efficient this method is! <S> Schematic below: simulate this circuit – Schematic created using CircuitLab <A> What are you talking about with diodes in parallel with the switches? <S> That is never done. <S> Anyway, what you are doing is called "Plug Reversing", and yes, you need heavy duty contactors to handle that. <S> The typical and inexpensive solution is to put NC contacts with a low ohm resistor around the armature itself. <S> When all of your 'switches' are open, the armature is shorted through the resistor, which acts to dynamically brake the motor to a stop. <S> Then use a time delay between enabling the forward/reverse switching. <S> For the record, inexpensive (probably less then the cost of your switches) DC Drives can handle this easily. <S> You would need a regenerative speed control. <A> When I want to change the direction, I open S1-S4; and close S2-S3. <S> By this, I have burnt the switches several times. <S> Now, my idea here is to open S1, and close S3 for a while. <S> By this, I think I'll be able to let the remaining current be absorbed (on the circuit S3-Motor-S4). <S> Then, I open S4 and close S2, which reverses the direction of the motor. <S> Probably the transistors burn because they can't turn off/on so quickly. <S> When you switch from S1-S4 to S2-S3, in a certain period of time <S> you have <S> S1,S2,S3,S4 that are half conductiong <S> each, the current passes trough pair S1/S2, S3/S4 directly from Vcc to GND and burns them, this is normal if you don't have a short dead time. <S> So first close S1/S4 then wait certain ammount of time then open S2/S3. <S> While in this dead time the diodes are conductiong, without diodes the back EMF will rise until the transitors or motor winding breaks down and game over. <S> With your proposal to have S3/S4 turned on is nothing else than creating a short circuit between Vcc and GND, so byebye transitors. <A> The power "waste" is low and unavoidable. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1 and 2. <S> Half-H-bridge (for clarity) with catch diodes. <S> In the Figure 1 we can see the switches are closed and current flows through the motor. <S> In Figure 2 we see that the switches have opened but due to the inductance of the motor current is still flowing. <S> The current will flow <S> no matter what else happens. <S> With the catch diodes in circuit current can be provided from the negative rail and fed out back onto the positive rail to be reabsorbed by the power supply. <S> There is no waste other than the unavoidable VI loss caused by the diode forward voltage drop. <S> simulate this circuit Figure 3. <S> Circulating current through Q3 and Q4. <S> Your idea to circulate current through Q3 and Q4 won't work. <S> One of them will be reverse biased - Q3 in this example. <A> The diodes are required. <S> Even wimpy old 1N4148s can handle more current (200mA) than those transistors (100mA). <S> Maybe you need a more capable H-bridge- <S> that one is suitable only for the tiniest of <S> motors- remember that motor current under startup conditions will be much higher than run current, and if you 'plug' the motor (reverse while it is spinning) <S> double that again. <S> If your diodes are getting hot then your motor is too big for that design of H-bridge.
The diodes are required to protect the switching devices.
Why would a designer choose to use two AND'ed input shift register such as the 74HC164? Today I came across the 74HC164 8-bit serial-in/parallel-out shift register . Reading its datasheet, I realized that it has two serial inputs, instead of one like other shift registers, such as the 74HC595 , that I'm familiar with. On top of that, the two inputs go through an AND gate, as in the picture below (figure 1 on the datasheet): The datasheet says: Data is entered serially through DSA or DSB and either input can be used as an active HIGH enable for data entry through the other input. That tells me that I can use one input to control whether the IC is taking data serially in or not. But a few questions remained: Why do the inputs go through the AND gate? Why not set one fixed pin as input and the other as input enable? I understand that this feature gives the engineer some flexibility to use either pin as the input and the other as enable, but I fail to see how that's useful in a concrete design scenario, as opposed as having a fixed pin for the input and another for the input enable. So, if this is not too broad a question to ask, what would be a concrete electronics design scenario in which an engineer would want to have this kind of two input shift register? I did google for an answer, but didn't get any meaningful results. <Q> The 1st scenario that comes to mind is capture/compare for 2 signals over 8 stages. <S> Such device can be used in a quadrature decoder, allowing the MCU to have 1/8 interrupt rate compared to a single AND gate. <S> At each clock pulse, a new comparison is made, after 8 pulses, you have your result. <S> With some extra logic, you can implement states where at least m comparisons out of n are 0 <S> (n<=8) <S> and so on. <S> There is already an input enable signal, the CP pin. <A> The one end of AND input just acts like a input enable for the input. <S> As you know,in AND gate,when two inputs are HIGH,then the output will be HIGH.You can consider the input pin like this <S> In some shift registers like 74HC595 there is a output enable pin. <S> These are designed for purpose. <S> In some case,you want to block the undesired input,In some cases,you may need to block the output,until you get the desired value or until the completion of the clock Now take of 74HC595,It can be used as Binary counter. <S> Under such situation,you want to shift 0000 0011 to the shift register. <S> At the same time,you should not notice the shift of the one's and zero's. <S> In such situation output enable. <S> The after completion of 8 clock cycles,the output enable is enabled. <S> Likewise in this 74HC164,you can connect multiple of chips in parallel with Input DSA.Now for controlling a specific register <S> ,the input DSB is given HIGH,so that it'll be in working state. <S> Consider the following diagram. <S> Sorry for the wired diagram. <S> In the case,like in the diagram,you can use only only one shift input from the micro-controller( some micro-controllers will have limited PWM's) and 3 control inputs. <S> This will be more or less resembles like SPI interface with more inputs connected and individual enable pins. <S> In this case,some controllers with less PWM or even 1 PWM can be easily controlled. <S> This always allows flexibility to us. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> Without the ANDed data inputs, the chip would use only 13 of its 14 pins, and one of the pins would have to be designated a NO CONNECT, which is wasteful and was a NO-NO for TTL MSI 40 yearts ago. <S> The logic/chip design team then had to figure out a way to use the 14th pin in the most cost effective way to get as much bang per buck out of the chip, and my guess is that they decided that ANDing two DATA inputs was the best way to do it. <A> The spec could just have listed one pin as input and the other one as enable , but since AND operation is commutative, it was decided to expose that implementation detail in the spec and label the pins <S> dsa and dsb to reflect that.
The initial intent was probably to have input and enable pins, which is easily implemented with an AND gate.
Can 3-phase FOC control be done without current measurement? Can a FOC control scheme be done using a rotary encoder to measure the position, speed and acceleration directly, or is measuring current necessary? FOC is a motor control scheme as described in links below: http://www.atmel.com/Images/doc32126.pdf http://www.eetimes.com/document.asp?doc_id=1279321 Quote from the second link: Field Oriented Control is one of the methods used in variable frequency drives or variable speed drives to control the torque (and thus the speed) of three-phase AC electric motors by controlling the current. With FOC, the torque and the flux can be controlled independently. FOC provides faster dynamic response than is required for applications like washing machines. There is no torque ripple and smoother, accurate motor control can be achieved at low and high speeds using FOC. <Q> You appear to have two questions. <S> Can <S> 3-phase FOC control be done without current measurement? <S> No; The point of field orientated control is to ... control the field in the electrical machine. <S> This relies on knowing what the field is Can a FOC control scheme be done using a rotary encoder to measure the position, speed and acceleration directly, or is measuring current necessary? <S> Well, Field orientated control relies on knowing where the rotor is so that correctly phase aligned currents can be synthesised. <S> A rotary encoder (resolver, analogue hall effect sensing etc...) can be used to measure the instantaneous position & thus derive speed and acceleration. <S> The existence of position sensing is to complement current sensing. <S> "sensorless" is a bit misleading. <A> Proper observer structure can give an estimate of phase currents. <S> But the observers would have to be open-loop, which makes them very sensitive to parameter variation (inductance, resistance, bus voltage, bEMF constant, ...) <S> But: No serious FOC motor drive is implemented without any kind of current sensor. <S> Phase currents can be reconstructed from the DC link current, which is an option. <S> There is always some torque ripple due to the switching nature of the motor drive and always somewhat unbalanced machine structure (e.g. phase inductances cannot be exactly the same). <S> It could be 1% or 20%. <S> High performance FOC or DB-DTFC (deadbeat direct torque and flux drives) can achieve the 1% but typically not less. <S> More on Current Sensing <S> The best results can be obtained with at least two phase current sensors and a resolver or encoder. <S> A lot of research has been done on "sensorless" control, which actually does not remove the current sensors but the position sensor. <S> The purpose of phase current sensors is not the machine control but also the motor drive protection. <S> A very popular option is to use closed-loop LEM current sensors or three-phase current shunts. <S> Both will give all three phase currents, which are needed to implement FOC. <A> I believe that you would need a secondary current control inner loop in the control scheme for any motor that has an outer speed or position control loop. <S> The major general-purpose VFD products on the market have current based control as the standard offering and encoder feedback as an optional feature. <S> Most research has been focused on improving performance with using inexpensive current based control methods rather than the more expensive encoder based methods. <S> You could search the literature to see if anyone has proposed a scheme using an encoder without current sensing.
Sensorless control would remove the need for a rotary encoder, although the workable schemes end up using voltage sensing so
Connecting / Soldering a Switch to Breadboard / PCB I'm pretty new to electronics and I have just found these toggle switches. But I can't figure out how the connectors on the bottom are called in the english language .. :) And also, is there a way to connect those to a standard breadboard (without soldering a wire to it)? And if you were to solder one on a PCB, how would you do it? Through-Hole? <Q> If you are a cheap-skate, you can grind off one side of the lugs leaving a 'pin' that can be thru-hole soldered. <A> Those are called terminals. <S> They are meant to be used with quick disconnect blade terminal connectors. <S> See the thin ones on the bottom right. <S> Alternatively you solder directly to them, by tinning, and sticking a wire to it with solder. <S> Switch with similar terminals, paired with quick disconnects: <S> They are not typically soldered directly to a pcb, as these types of switches are meant to be Panel mounted, not board mounted. <S> They will need a custom pcb mounting hole if you wanted to use a pcb, as they will not fit in a standard 0.1" round hole. <S> If you etch a pcb, or enlarge a hole, you could then solder them as you would any through hole part. <S> If you really don't want to solder to them, use a quick disconnect terminal plug, or you can use alligator or test clips. <S> Worst case, use wire wrap, but that may not be the most stable or secure connection. <A> That's a panel-mount switch. <S> Designed to be mounted through a hole on a panel, with wires soldered to the terminals. <A> That style of termination is often called a 'solder lug' and it is not intended to be used to solder the switch to a PCB. <S> The sort of toggle switch with PCB-suitable pins looks like this: <S> But if I had one of your switches and I wanted to plug it into a breadboard I would probably get some stiff solid-core wire and solder a short length onto each lug. <S> You probably could shoe-horn one of those onto a PCB if you designed the PCB with holes large enough to fit the lugs ... <A> What you're showing is a panel-mount switch with solder tabs. <S> You obviously can't plug this into a breadboard, because the tabs are way too big. <S> If you need to solder a similar switch to the PCB, you would look for part that is designed for PCB mounting, either through hole or surface mount. <S> Something like this: But even this switch will not go into the breadboard easily. <S> Soldering wires would be the best option. <A> They will not fit in a breadboard; if you want to use them with a breadboard, you should solder wires or perhaps header terminals if the pitch lines up. <S> Although not really intended for it, they could be placed directly in a PCB with the correct holes, but typically you would solder wires to the terminals, and then terminate the wires elsewhere or solder them directly to a board. <A> I call the connection points "terminals" or "solder lugs". <S> I think the only way to use a switch like this with a plastic breadboard is to solder #22 or #24 solid wires to the lugs, then insert the wires in the breadboard. <S> I would not use a switch like that in a PC board. <S> You can get the switches with "solder tails" that can be soldered into a PC board (but those solder tails are too big to fit in a breadboard).P <A> Those are wire terminals, and as you might guess from the name they are intended to connect to wires, not PCBs. <S> A bare conductor is inserted into the hole, then bent back so as to form a secure mechanical connection. <S> Then the wire is soldered, making an electrical connection. <S> The connecting lugs are so large that it's difficult to make a PCB layout that will work for them - the holes would be very large and very close to overlapping.
They are typically called solder lug terminals and are intended for wires to be soldered to them.
How to measure small currents using current to voltage converter? The battery voltage = 12 volts. In the first circuit The op amp works as a current to voltage converter and its output equation is: Vout = - I * R I choosed R to be 20 ohm so that each 50 mA will make -1 volt drop. I put 240 ohm across the 12v battery and I closed S1 switch to make sure that the current passing through it is 50 mA. Then, I opened S1 and Closed S2 and the output voltage of the op amp is -1 volt. The equation works well yet. In practice, I don't have a supply that can produce negative voltages, so I have to build a bias for the op amp which is in the second circuit. The positive input of the op amp is now 6 volts. When I close S2, I would expect the voltage to be 6 - 1 = 5 volts. but the result is 5.5 volts !! Why does that happen? and What modifications should I make to get correct results? can I add a buffer or something like that ? If I can not modify the circuit, What is the best way to measure small currents without using multimeter or ammeter? Thank you very much, <Q> Get a copy of LTSpice and simulate the circuit, you will learn a lot! <S> Please also let us know what where your reference point is. <S> Please label you resistors for easy reference. <S> What you have is an inverting Opamp circuit. <S> In the second case, the 20ohm and 240 ohm resistors make a voltage divider. <S> The Opamp will never drive to the negative rail (even so called rail to rail versions have a small voltage drop). <S> Putting a probe on an opamp input is NEVER a good idea, the impedances are just too high. <S> The output of the opamp should go to near the negative supply(perhaps even a volt or so depending on the type of opamp), or about -5V5 to the centre 'virtual earth' formed by the 51K resistors. <S> This is probably where your discrepancy lies. <S> Your voltmeter impedance might also be skewing with the 51K resistors. <S> Rather make a low impedance virtual earth using another opamp as a follower with the feedback resistor at zero ohms, and put a decoupling cap on that to smooth it. <S> Then retest. <S> When measuring currents, you would normally have largish resistors in series with the inputs with a shunt (< 1 Ohm) between the probes. <S> These circuits are all well described in the literature from any manufacturer. <A> As discussed in the comments, the problem is that the op-amp will adjust the output until the '-' input is the same as the '+' input which is held at 6 V. <S> That means there is only 6 V (12 V from battery - 6 V from R1/R3) across R4 now. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Non-inverting amplifier. <S> You may find the non-inverting amplifier easier to work with. <S> \$I_{in}\$ will produce \$100 \cdot <S> R1\$ volts to the '+' input. <S> \$V_{out} = 1 <S> + \frac {R_f}{R_i}\$. <S> Everything is positive with respect to ground. <A> I've tried LTspice <S> and I got the same results, <S> but I think I know the answer now: <S> If I put a 240 ohm resistor across 12 volts battery, The current will be 50 mA. <S> Now I need to measure that current (50 mA) without using a multimeter or ammeter. <S> If I used the "current to voltage" converter without biasing the opamp the equation number (1) will work (as shown in the picture below). <S> What I mean by "without biasing the opamp" is to ground the positive input. <S> Vout = <S> - I * R2 = - 50 <S> mA * 20 ohm = -1 volts. <S> The output voltage changed from 0 to -1 and that is what I need: Each 50mA produce voltage drop of 1 volt. <S> I can not do that practically because my supply is from 0 to 12. <S> and I can not get -1 volts <S> so I have to bias the op amp. <S> If want to bias the op amp the current (I) will be changed. <S> The new value of the current (I) will be as the following: <S> I new = <S> I old <S> * R1 / (R1 + R3) <S> The new current = 50 <S> mA * 0.5 <S> = 25 <S> mA. <S> Where the number 0.5 is the ratio of the resistors. <S> The new output voltage after biasing: <S> Vout = positive input voltage - <S> I <S> * R Vout = 6 - 25mA <S> * 20 ohm = 5.5 volts <S> That is the result that I get using simulators. <S> If I need that each 50 mA to drop the output voltage by 1 volt, I have to adjust the resistor R2 again as in the equation number (2). <S> I will multiply R2 by a correction factor as shown and the new value of R2 will be 40 ohm. <S> Now let's try it <S> :I have 50mA current flowing through 240 ohm resistor if I connected it across 12 volts battery. <S> I need to measure that current. <S> So, I will connect the resistor to the circuit, The current will change but R2 corrects it again. <S> and the output voltage will be 5 volts instead of 6 volts. <S> 1 voltage drop means 50 mA passing through the resistor. <S> I tried some values of resistors and equation (2) works. <S> but I still not sure if I can rely on it?
You just need an op-amp that can run to negative rail.
Does MOSFET switching gate drive current depend on supply voltage? I am using a 3-phase MOSFET driver to drive power MOSFETs for a motor controller. When I connect the circuit to a 24V supply (H-bridge supply) and enable the switching at 25 kHz, the driver gets warm. However, when I connect it to a 40V supply (for the final application) the MOSFET driver gets much warmer. Is the driving current supposed to increase with increased supply voltage? I am not sure because the gate-source voltage on the high-side MOSFETs is the same; the driver just needs to supply 40+Vgs to the gate instead of 24+Vgs to the gate. If the gate charge is the same, why would it take more current to drive it at a higher drain voltage? <Q> There is a small change in total gate charge with the FET's supply voltage. <S> It is not particularly large, because the difference in Gate-Drain capacitance when going from 24 V to 40 V is relatively small. <S> However, the gate drive current is generated in your IC from a linear regulator from the 40 V input. <S> Therefore with a constant gate drive, the IC will still dissipate more power at higher VIN. <S> There is an NXP <S> Three Phase Driver IC -- MC34937 which allows the gate drive power to be distinct from the FET bridge supply <S> -- you can use that to either 'move' some of the dissipation outside the IC, or supply it from a DC/DC converter which reduces the power dissipated considerably. <A> The miller effect depends on the gain. <S> (I interpreted your "supply voltage" as the voltage that is switched by the power MOSFETs to the load.) <S> Therefore, the "gate charge" increases with "supply voltage". <S> The "gate charge" from datasheets is specified for a specific Vds and Vgs. <S> It changes with actual operating Vds and Vgs. <S> (By the way, it is easy to see that the "gate charge" also depends on Vgs given Q = <S> C V for a given capacitance, so the "gate charge" also increases with "supply voltage of the gate driver"). <A> You are hard switching and there is nothing wrong with that <S> .It is the miller effect that makes the effective gate capacitance much greater than what you thought. <S> The modern mosfets have much more capacitance than the old ones .This <S> is the price of the lower on resistances that are available.
For a switch, the gain is proportional to Vds, which is approximately the "supply voltage".
Do all components obey Kirchhoff's Current Law? Kirchhoff's Current Law states that the net current through a node is always 0. AFAIK this derives from conservation of charge principle. My question is, is KCL applicable to any electrical component? For example is it applicable to transistors, integrated circuits, etc. My thought is that it should be applicable, because otherwise, the component would be accumulating charge over time, which I presume is not a stable or desirable (in general) condition. Another possibility would be that the component would be "leaking charge". For example, the component would be "throwing charge into air" etc. In this case, the component is not accumulating charge but charge is being moved out of the circuit. I guess this doesn't happen in general as well. So my question is, is Kirchhoff's Current Law is applicable to any circuit element? For example, if I add up the currents through pins of an integrated circuit at a given time by taking current directions into account, will I get 0 amperes? Similarly for any other circuit elements. Are there any cases where the net current is not 0 amperes? <Q> You are exactly right: due to the conservation of charge, which is a direct consequence of the gauge symmetry of electrodynamics and therefore an unbreakable (according to all current knowledge) law of nature, the sum of current over all possible paths summed over all time is always exactly zero. <S> In the case where the current doesn't go through discrete conductors, it's known as Gauss's Law . <S> This is usually a very good approximation, since any imbalance in charge tends to get balanced due to electric attraction. <S> Some components though, such as an electron gun , break this on purpose, and therefore from a circuit perspective explicitly break Kirchoff's law. <S> Of course if you account for the stream of electrons coming out, the current law holds again. <S> Now there's a small but important caveat here: the charge only has to be conserved in the end, not at each moment of time separately. <S> That means that if there's a component that stores <S> net charge <S> , the current can enter there, wait for some amount of time as a charge, and the exit only later. <S> However, no practical component stores appreciable net charge for any appreciable amount of time. <S> This is also true of capacitors and batteries: a capacitor stores an equal amount of positive and negative charge on its plates, whereas a battery has positively charged and negatively charged ions which flow (as electric current) to meet each other when the circuit is in operation. <S> In both cases, the net charge is zero at all times, and so the total charge is constant, and Kirchoff's current law still holds. <S> The same also holds for Flash memories , that is, the charge stored is balanced by a hole in the semiconductor. <S> However, as the The Photon points out in his answer, for components such as antennas, there may be a small but finite time delay between the current entering a component and exiting it. <S> Nonetheless, for all practical electronics purposes, for example a complicated IC as specifically mentioned by the OP, Kirchoff's current law holds exactly. <A> Kirchoff's circuit laws apply to circuits of lumped elements. <S> If your circuit contains distributed elements, such as transmission lines and antennas, you can't count on KCL applying absolutely. <S> For example, in a transient analysis current may flow into an antenna momentarily, without flowing out to any other circuit node, at least until 1/2 a cycle later. <S> If we were to do a full electromagnetic analysis of the situation, we could presumably identify a displacement current from the antenna to the surrounding ground and other circuit elements, but usually such an analysis is too complicated to be tractable. <A> Kirchoffs laws assume that we can divide our circuit into "components" where all charge enters and exits components through a pin and that components have no net charge. <S> This is only an approximation of reality. <S> All real-world components have capacitance to each other and the universe in general. <S> When voltages change this stray capacitance must be charged or discharged which means a net transfer of charge between components. <S> When components physically move the capacitance between them changes and a net charge movement is needed to keep the voltages the same. <S> Will that affect be measurable? <S> that very much depends on the speeds at which your circuit works and the size of your components.
For real life electronic components, Kirchoff's current law is exact to the accuracy that all the current flows through the devices pins.
Can I route between the copper pads I have a PCB layout as shown. My question is can I route the PCB between the copper pads? The purple colour is solder mask. From what I know solder mask is the green stuff on a PCB which covers the copper, determines where the copper is actually exposed. So once copper is removed on the board, it is coate with a solder mask which is then removed at certain places. Is it okay to route between these red copper balls? <Q> Looks like you have a 0.5mm-pitch BGA. <S> You may even have to use via-in-pad and 6 layers to get this to work. <S> Below is a suggested 6-layer layout from Lattice <S> that does not require via-in-pad. <A> With the solder mask as shown, you should not route between pads on the top layer. <S> The reason is that if the solder mask relief for a pad also exposes a track connected to a different net, then there's a high risk of the solder ball bridging between the pad and the track and causing a short circuit. <S> For a 1-mm pitch BGA it's usually possible (with a high quality pcb shop) to reduce the solder mask reliefs enough to allow routing at least one 4 or 5 mil track between pads. <S> As the comments and other answers have said, if this is a 0.5-mm-pitch BGA, you'll very likely need to use higher-cost processes, such as multi-layer board, narrow tracks, via-in-pad, etc. <S> to route into this device. <A> It all depends on your chosen design rules. <S> They will have a cheap set of rules, with large dimensions, that are easy to achieve. <S> They will also have a premium set of rules, with tighter dimensions that they will need to work harder to maintain (more careful alignment and control of etching conditions). <S> The thickness of copper can also affect these distances, thicker copper means more undercutting. <S> The last time I looked, 4 thou was expensive, 8 thou was easy. <S> YMMV. <S> Decide how much you want to spend on their process, and get the correct figures for minimum track and gap widths. <S> Then measure the distance between the pads and see whether the numbers add up. <S> Or put these figures into your layout program DRC (Design Rule Checker), route a track between the pads, and see whether it's allowed.
Your PCB manufacturer will have several sets of rules for the minimum width for your pads and tracks, and the minimum spacing between tracks and other features.
Detecting object passing through gateway Hoping this is the right place for this. Honestly not even sure what to call it. Essentially I need to find a way to detect an object flying through a physical portal/gateway/doorway. I do not care where the object goes through or direction just that it did. I'm looking to detect ping-pong ball. <Q> You can generate a line with a laser using optics . <S> You can focus that line on an array of photodetectors, and detect when the golf-ball-sized object breaks the plane. <S> There are many variants of that idea. <S> The geometry and opticsmight get a bit complicated to cover your whole space. <S> There are many variations. <A> You could use a series of infra-red LED's and IR phototransistors. <S> Industrial processes already use this idea, known as a Light Curtain . <S> Use the dark or opaque kind of LEDs and photo-transistors, as they will be less sensitive to visible light. <S> Place an LED pointing across the opening at a matched photo transistor. <S> Use a lens or piece of drinking straw to make each beam more-or-less linear. <S> Use many of these across the opening (half the width of the ball apart or less.) <S> Repeat on the other axis if you need X/Y coordinates. <S> (Much more work...) <S> Then energize all of the LED's. <S> This can be achieved with simple constant-current source(s). <S> Then it's just a matter of sampling or detecting changes in each phototransistor's output. <S> It could be done with discrete analog circuitry such as op-amps, however the more practical solution today would probably be a large microcontroller with many analog-to-digital inputs. <S> Sample each sensor very quickly, and compare this value with the last value (or an average value.) <S> If the difference is more than some threshold, sound an alarm. <A> I was first inclined to say "impossible", but I can think of a possible solution. <S> It's going to involve a lot of learning and probably a few tries to get it right. <S> You could use some high speed cameras (maybe these: https://www.ptgrey.com/grasshopper3-23-mp-mono-usb3-vision-sony-pregius-imx174-camera ). <S> They run up to 162 frames per second, so if your ball is moving at 10m/s, that's 6.2 cm per frame. <S> If you can mount the cameras such that their field of vision is at least 3 times that (19 cm), you could conceivably get this working. <S> You would probably want a clear border 20cm around the edges of the doorframe so that the ball cannot come too close to the cameras, otherwise they could miss it. <S> Maybe 1 camera would be sufficient; it depends on the geometry of the opening. <S> This is sounding very expensive, especially considering the computer(s) that would be connected to the cameras. <S> If you can tolerate a very big, long doorway with a comparatively narrow opening, you could make this project much easier by using lower speed cameras. <S> It might be more appropriate to call it a "tunnel" at that point though. <A> Caution. <S> This is an 'R&D' answer. <S> Figure 1. <S> Laser printer scanner. <S> Credit: Jeroen74 - Wikipedia . <S> The rotating prism sweeps the laser beam across the lens in a repeating pattern. <S> If you can intercept the returning wave you may be able to detect presence or absence of an object. <S> You may need a split-prism or half-silvered mirror to split the transmitted and returning beam. <S> Possible layout <S> Mount <S> the scanner overhead looking down on the centreline of the table. <S> Run prismatic reflective tape around the frame so that laser light will normally get reflected back. <S> Monitor reflected light level. <S> Trigger when beam is broken. <S> This is complex but could be a super project. <S> Take laser safety seriously. <S> Eye damage is permanent. <S> I have no idea what power levels are used in these devices. <S> If it is unsafe you could use the mechanism and a separate laser. <S> Search for 'DIY laser scanner'.
For example, Instead of a line laser, you could use splitters and mirrors to create a span of parallel rays fine enough to detect your object.
LED circuit with epoxy and (broken?) transistor I'm trying to repair this battery-powered LED bike light but do not really understand the circuit. Positive terminal middle left, negative bottom left. Momentary push switch at the top, transistor on the right, capacitor in the middle, 5 LED array at the bottom. The lights are not supposed to blink: just on/off. The switch works, as do the lights (when transistor is shorted). Capacitor seems to work. What is likely under the epoxy? Just water resistance for resistors or is it actually a chip? How does this design work? Is there a need for a capacitor in a battery-powered LED circuit? I believe the transistor is broken. My diode tester measures 800 ohms from both positive top to middle and positive bottom to middle but also 680 ohms negative top to middle and 1260 ohms negative top to bottom (others are infinite). From this I guess that it is PNP with middle being base. Does this sound correct? The part number is S8550 D 331. Only results are Alibaba without data sheets. Close match by name is SS8550 from Fairchild ( https://www.fairchildsemi.com/products/discretes/bipolar-transistors/small-signal-bjts/SS8550.html ). Dimensions are slightly off. Does this seem a reasonable replacement? Any clue on the differences between models, other than leg spread and ammo vs bulk packaging? <Q> The transistor is jellybean Chinese PNP transistor. <S> The specs (and even the pinout) vary somewhat from maker to maker- no JEDEC standardization here, but it's broadly similar to the Fairchild SS8550. <S> They seldom fail if not abused. <S> Anyway, the thing under the blob is an IC chip ( Chip-On-Board ), and chances are very good <S> that's where the problem lies (quite possibly in the wire bonds to the chip). <S> In which case, the unit is not economically repairable. <S> That construction technique is not particularly good (reliability-wise) for this kind of application but it is very cheap in high volume. <S> You could always hack in a mechanical switch (toggle or whatever) across the transistor and ignore the electronics. <S> I'd try to disconnect the chip itself - I find that the one I have slowly drains the 4 AA cells whilst allegedly off. <S> Or if you're ambitious beyond all reason, hack in a small microcontroller to drive the transistor. <A> It's a technique used a lot in high volume products, called "chip-on-board". <S> The chip will control the flashing of the LED and any other low-power modes you may have. <A> Quick Schematic based on that circuit. <S> Super simple. <S> The Capacitor is just for smoothing. <S> I'm assuming the epoxied Chip-On-Blob IC does some sort of PWM, even if it doesn't blink or flash, or dim. <S> Even if it doesn't, the cap doesn't hurt. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> You can test the transistor easily. <S> First find the emitter, using a multimeter's continuity tester. <S> That leaves you the base. <S> Desolder the base pin, and then, with a say 1k resistor, touch it to ground. <S> If the leds come on, the transistor is fine. <S> If not, then replace it with any common PNP transistor, it really doesn't matter. <S> Those LEDs, assuming common white 5mm, should only be drawing 100 to 200 mA max. <S> Even something like the super cheap 2n3906 should work.
It's mostly there to allow an almost free momentary switch and allow blink modes. It's probably a chip under the epoxy blob. There's not much chance of being able to replace or repair that. The pin that's connected to B+ will undoubtedly be the emitter.
Oscilloscope and main earth reference I have AC/DC 3/6/12V out universal adapter with two pins (without earth connector) and would like to use it for powering my arduino project and playing with oscilloscope. Knowing that my oscilloscope will make big bang if power supply is connected to main earth ground, I would like to test somehow if some of the AC 220V wires are connected to main earth ground.I know that my AC/DC is safe because of plug type but how to know that somewhere in the system main earth ground is not connected to phase or neutral. <Q> The ground of your oscilloscope will be connected to mains earth assuming you're using a socket that has an eart connection. <S> For safety, it should have this ! <S> If the mains adapter you're using to feed your arduino board has a main earth connection then the same will aply tho this adapter. <S> Most mains adapter however do not have a mains earth connection and these will be floating with respect to earth. <S> To safely measure mains voltage on a scope you need to use an isolated probe or measure through a transformer for isolation. <S> Some (battery operated) <S> portable scopes have an isolated ground and this in combination with appropriate high voltage <S> rated inputs is enough to measure mains directly. <S> But most bench scopes are unsuited for this. <S> I also highly recommend this video by Dave from the EEVBLOG ! <A> If you use your AC/DC adapter to power your arduino board, and use the oscilloscope just to look at signals on the board then there will be no issue with your oscilloscope blowing up. <S> The problem can arise if you use your oscilloscope to connect to the 220V AC voltage. <S> Then you can expect a big bang. <S> There are ways around this too, but it's safer not to do it! <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> Isolated power supply. <S> Earthed oscilloscope. <S> This simplified circuit shows that the low-voltage DC supply is electrically isolated from the mains. <S> You can safely connect either V+ or V- (but not both together) to the oscilloscope ground. <A> My old analog scope has a transformer to supply CRT and all analog circuits, I know beacause <S> I got a schematics with it. <S> So, whenever I need to measure like you, I do connect a mains plug that has the earth pin removed <S> , now I get a floating case and scope's ground. <S> It shall be noted that I use gloves and watch the other people if they move around the scope, since it can be lethaly dangerous, also it is advisable to know or measure a priori, the signal that will be connected to chasis with probe's croco clips, like ground, neutral, earth, not a live wire or +DC bus.
For both adapter cases it is safe to connect the arduino's ground to the scope's ground. The 3V/6V/12V power output from the adapter is not connected to ground in any way, it is isolated or "floating".
What exactly IS voltage and its difference to other measurements of electricity? I apologize if this is a stupid question, but I cannot find any answers online, so I feel I must ask here. I do not quite understand exactly what voltage is. I see on batteries, "X Volts", but I do not quite know what that means. I looked online and read sources on volts, amperes, and watts, and it has only confused me more. What exactly is voltage? If it isn't a measure of the electric current, then why is it used on batteries as a measure of their electric power? Why aren't amperes used? <Q> The technical definition of voltage is energy (joules) applied to charge (coulombs). <S> This energy allows the charges to flow through resistances and to energize inductances . <A> We often use a water analogy to explain electric circuits. <S> It's not very good <S> but it can help. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> The battery is like a pump that tries to generate constant pressure. <S> Symbol: <S> \$V\$ measured in volts . <S> The electrical current is like the water flowing around the circuit. <S> Symbol: <S> \$I\$ measured in amps . <S> The pump experiences resistance in the circuit. <S> This includes the pipes, the radiators, valves, etc., which all resist current flow. <S> Symbol: <S> \$R\$ measured in ohms, 'Ω'. <S> Effects <S> The higher the pump pressure (voltage), the more water will flow. <S> The higher the resistance the less water will flow. <S> If we double the resistance and keep the voltage the same only half teh current will flow. <S> The pressure (voltage) at the mid-point will be half that at the pump (battery). <S> You can work out the current in each circuit from Ohm's Law, \$V = <S> I \cdot R\$. <A> It's not really a force, not is it energy - but you can think of it as the 'force' or 'pressure' of the electricity. <S> What is it exactly ? <S> Nobody knows. <S> What we do know is that opposite charges attract and like charges repel. <S> Inside an atom the electrons (which each have 1 electron unit of negative charge) are attracted to the protons (which have 1 unit of positive charge). <S> Chemical reactions in the battery force electrons towards the negative terminal. <S> The electrons are still attracted to the protons, but they can't get back to them unless an external path is provided to the positive terminal. <S> The closer the electrons are to the protons in the atom, the more energy is required to remove them. <S> This is the potential energy per unit charge. <S> Current is the number of electrons that flow past a particular point in an electric circuit. <S> Power is voltage multiplied by current, which is the rate of energy transfer from one place (or form) to another. <S> Voltage by itself is not power, but words are often used ambiguously. <S> 120V AC is called mains 'power' because it provides power when current is drawn from it. <S> AC is short for Alternating Current, even though no current has to flow for an AC voltage to be present. <S> The power you can get out of a battery is determined by both its voltage and the maximum current that it can deliver. <S> But why only mark the battery with its voltage? <S> Higher voltage can force more current through a circuit, and most devices are designed to work at a particular voltage. <S> A battery with higher capacity <S> (Ampere-hours or Watt-hours) can run a device for longer, but higher voltage could blow it up.
Voltage is a measure of electromotive force (emf) or potential energy per unit charge.
How to connect IRF 630B N-Channel MOSFET on 220VAC? Here is datasheet: http://pdf.datasheetcatalog.com/datasheet/fairchild/IRF630B.pdf From my wall is 220 VAC, but from datasheet I think this MOSFET alow just 200VAC (I am not sure please check). Should I just connect drain and source to the AC wire? <Q> If you want to switch 220VAC then use a relay. <A> You can use a MOSFET to control an AC load as shown here: http://tahmidmc.blogspot.com/2012/11/controlling-ac-load-with-mosfet.html With this scheme, you cannot control an inductive load unless you come up with some way to deal with the inductive kickback. <S> You can also get rid of the rectifier by connecting 2 series MOSFETs as such: Source: http://forum.allaboutcircuits.com/blog/controlling-an-ac-load-with-a-mosfet.518/ <A> You don't (normally) switch mains with MOSFET. <S> You use a solid-state relay using a triac internally. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Solid state relay. <S> SSRs come in two flavours - zero-cross and non zero-cross. <S> Figure 2. <S> Dimming by phase control. <S> Your controller circuit will need to detect the zero-crossing point and trigger the triac after the required delay. <S> You are working with main voltages. <S> Keep these very separate from your low-voltage circuits. <S> Use good wiring practices.
Choose a triac to match your line voltage and the required current. You cannot use a MOSFET this way. For your dimming application you need non zero-cross so that you can switch on at any point in the cycle.
Designing a circuit with a bi-colored LED for indicating power vs. system ready I am working on a headless Raspberry Pi project. Being headless, I can't visually tell when the system is fully booted and ready to accept tasks. While a Pi doesn't take an inordinate about of time too boot, I am still looking at 30-seconds or so. What I would like to do is have a bi-colored LED (red-green) that would light up red when when power is applied to the system, but, when the system is ready, my task will pull a pin either high or low, as needed, to switch the LED to green. I do not have any components yet for this part of the project, so I am flexible if it is a two-lead red/green LED or a three-lead red/green LED. The coding part, I have down. What I could use help with is the circuit. <Q> Here's a third way. <S> Does not require that the green LED is powered by GPIO. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> EDIT: <S> I have updated the schematic above, so let's go through the changes in some more detail. <S> I'm assuming that you are building this and not designing a PCB, so I looked for a through-hole transistor. <S> There were not many good logic-level MOSFETs in TO-92 package, so I went for a BJT. <S> The 2N3904 recommended by Passerby would work, but I chose a <S> BC547 because it had a nicer datasheet. <S> The supply was changed from 3.3V to 5V because of the current issues mentioned below. <S> As a result, the resistor values have been increased. <S> Note that the resistors are different. <S> This is because red LEDs have a lower forward voltage than green LEDs. <S> You may need to tweak these values to get the brightness you desire. <A> simulate this circuit – Schematic created using CircuitLab <S> Don't forget to connect the 3.3V supply to the gate as required. <A> Here's one way: simulate this circuit – <S> Schematic created using CircuitLab A 2-lead LED circuit: <S> (you can use a DIP <S> 74HC00 <S> if you want to use a breadboard) simulate this circuit <A> simulate this circuit – Schematic created using CircuitLab Circuit 1, 2 and 3. <S> Circuits 1 and 2. <S> Two extra components. <S> Circuit 1 shunts the red LED current <S> so it's more wasteful of power. <S> Circuit 3 lights the red LED initially but when the GPIO turns on the forward voltage drop of the green LED is less than the forward voltage drop of D7 and <S> the red LED combined so the red turns off. <S> Only three components total! <S> @Passerby points out that the RPi GPIO won't drive this very well since the outputs are 3.3 V. Understanding Outputs documents that with the output drive strength set to 8 mA <S> the output voltage can be as high as 3.0 V with 10 mA source current <S> so, as far as I can see, it should work. <S> simulate this circuit Circuit 4. <S> High side transistor switch. <S> On Circuit 4 both LEDs are powered from 5V (or 3.3 V, if required). <S> Red LED lights on power on. <S> Green LED lights when GPIO enabled and pulled to ground. <S> Note that to switch this circuit with 5 V supply and <S> 3.3 V LED the GPIO would need to be tri-stated to turn the LED off. <A> And to add to the list, an approach using just the LEDs and two resistors: simulate this circuit – <S> Schematic created using CircuitLab <S> This one has the advantage of not wasting as much power shunting current away from the red LED. <S> The down side is that the GPIO pin would need to be at 0V during boot. <S> Thinking about it, that may not be the case. <A> Simplest circuit, nothing needed but <S> a Common Cathode 3 Pin Red/Green led (there are other colors and pin types as well fyi). <S> Instead of Red On, Green Ready <S> , It's Red On, (Red+Green = Yellow) <S> Ready. <S> As long as the GPIO is High-Impedence/Input or Low while booting, and you set it high when the system is ready. <S> simulate this circuit – <S> Schematic created using CircuitLab Resistors chosen for 6mA on either led which is plenty bright for an indicator (unless you want to light up the room). <S> Used 5V for the red power led, as using too much current on the 3.3V regulator is not a good idea.
If the IO pins are High-Z during boot, you could add a buffer in to the circuit with a pull down resistor - this would convert the High-Z to an output low.
Placing a mounting hole partially outside the board I have a board currently 50x30 mm. And I need to have 4 mounting holes on it. Bad news is that I don't have enough space to place them in regular way. Now I made the following thing: I placed four 3.2 mm holes with centers within the board edges but big part of the holes appears outside the board: (white circles are washers edges) If the manufacturer will be able to do this thing I'm sure that those holes can be used for mounting. Main reason for this question here is that I'm pretty in rush and if in the Monday morning I will find out that it's not possible I will lost one day for rerouting (and probably to expand the board which is not very good actually). As I don't want to lose a day I came here to have an advise: is it common that this kind of holes can be made? Or maybe there is anything else I'm not aware of? So if your advise will be to avoid this kind of holes I will have Sunday to make needed changes. What is you opinion? <Q> That's why you should always place the mounting holes before you place your components :) <S> The good news is that the manufacturer will not have any issues making these holes. <S> The only thing I'd suggest is to remove the plating. <A> I would suggest talking to your board vendor. <S> What you propose can certainly be made but different vendors may have different preffered ways of doing it. <S> Drilling it as a plated hole and then cutting would likely be the cheap and dirty but risks the plating getting ripped off and leaving an ugly mess. <S> Drilling non-plated holes <S> and then cutting means an extra drilling step which some cheap board vendors may not like. <S> Some vendors use milling as their default de-panelisation method, for others it may be an extra. <A> You could ask yourself whether you need mounting holes that big?Apart from the top left corner it looks like you could bring a smaller hole further into the board? <A> I would use a round file to slot the edges of the board. <S> This could be tedious if there were more than 30 boards.
Making it part of the board outline would be a good option if the board vendor intends to mill the board. That way, you'd have greater control over the shape of the holes. Drilling may also require bigger gaps to be left between the boards reducing the efficienty of panelisation. Another way to do this is to define the "mounting slots" on the PCB outline instead of drilling.
Charging AA Battery with DC Generator I am trying to recharge AA Battery (rechargeable, 1.2v, 1000mah) with DC Generator which outputs around 3v to 5v. The input for DC Generator is from another 1.5v rechargeable battery with a step up voltage booster. (Though I am not sure how much amps output i am getting from DC Generator,and I don't know how to calculate it.) After some googling I come to know I need to use voltage regulator to give some constant voltage to battery for recharge from DC Generator. How much voltage I need to give to battery for recharge and do I need to consider the amps? Also is that possible to get load and recharge the same battery simultaneously? I am just learning electronics myself. Some simple words to explain this without much formulas will help me to understand much quickly. Thanks! <Q> A battery is at least two cells, so what you want to do is charge a cell, not a battery. <S> You'll need a voltage higher than 1.2 volts to charge the cell, and you'll need to limit the current into the cell being charged in order to charge it safely. <S> You can find out the charge requirements by going to the manufacturer's website and reviewing their technical literature. <S> You could also go to battery university , an excellent site for learning about batteries and cells. <A> Charging battery: volts: <S> Need <S> more than 1.2V(as <S> your DC generator is giving 3-5 volts it would be good). <S> amps: <S> 100 mA would be nice.(can use upto 500 mA <S> it will charge faster but <S> it will heat-up <S> your battery also reduce the life of battery). <S> Also is that possible to get load and recharge the same battery simultaneously? <S> Yes, But it will be more energy consuming and costly. <S> Need to use voltage regulator L7803(it will prevent spike in voltage) and Diode to prevent back flow of current. <S> As DC generator is giving 3-5V. voltage regulator L7803 need at least 3.5V to give output of around 3V. <S> This won't affect your battery charging <S> but it will consume your volts and current. <S> To calculate volt/amps <S> multimeter would be nice: <A> I am assuming that your battery is a Nicd because of the low Amp hour rating. <S> The easiest way to charge it is with a constant current of around 100 mA for 12 hours. <S> That is not the only way to charge it, just the easiest. <S> If it is a NiMH battery, then you might need a more complicated charging system. <S> @Aadarsh's answer is not very good. <S> All power conversion systems waste some power, so if you move charge back and forth between two batteries, eventually both batteries will be discharged. <S> And one battery cannot be used to recharge itself.
You would not want to use a constant voltage to recharge this battery.
How to change the polarity of 0~5 volts get -5~+5 volts? I am doing a project using NI DAQ USB 6008 to control an speaker. The DAQ analogic ouput range is 0 to 5 volts and the output current drive is 5 mA. But to control the speaker I need a different range. For example, I need a range that goes from -5V to 5V to the audio amplifier which will be conected to the speaker. My audio amplifier has input impedance 30 K ohms and minimum frequency 10 Hz. I know that if my controller calculates a negative voltage output I can multiply this value to -1 (in the control algorithm) to the DAQ card send a value between 0~5V, and then I could change the polarity of this signal after the DAQ board output (implementing an circuit to change the polarity and using a digital output of the DAQ card as switcher). So, what I need is a circuit between the DAQ card and the audio amplifier to change the voltage polarity. I do not know if this is the best/simple way to solve this problem and how to I can do this circuit in a simple way. Any ideas? Thanks in advance <Q> This will remove any DC component from the signal. <S> If the Amp side of the capacitor is at "0V" then the voltage will appear to swing -2.5V to +2.5V. <S> I know that's not exactly what you asked for, but if your Amp has enough gain it should work. <S> If you really need -5V to +5V <S> then you will have to add an op-amp with a gain of 2. <S> The good thing is that most audio amps already have a capacitor in their input circuit so you probably don't even need to add the capacitor!. <S> If you need to add a capacitor then try a value of 100nF as a starting point. <A> simulate this circuit – Schematic created using CircuitLab <S> Add a capacitor in series. <S> It will block DC and your 5 V square-wave will become ±2.5 V squarewave. <S> Amplify by a factor of two <S> and you have your ±5 <S> V. <S> Cut-off frequency -3 dB point for a high-pass filter is given by $$f_c = \frac {1}{2 <S> \pi R C}$$ and rearranging for the unknown C <S> we get $$C = <S> \frac { <S> 1}{2 \pi R f_{c}} = \frac { <S> 1}{2 <S> \pi <S> \cdot 30k \cdot 10} <S> = 0.5 <S> µF$$ <S> Put a 1 µF or 10 µF capacitor in there <S> and you should be fine. <S> Links: High pass filter . <S> See the notes on the RC differentiator circuit to make sure you understand that this arrangement will slightly 'un-square' your waveform. <S> The effect can be reduced by lowering the cut-off frequency. <S> Also online calculator . <A> You need to first get a negative supply rail than use a properly biased op amp to get the voltage. <S> To get the negative supply rail you can use a separate power supply that supplies dual rail or use a voltage inverting switch-mode power supply to generate it from a positive supply rail.
All you need to do is connect your DAQ to the audio amp through a capacitor.
Make an electromagnet attract and repel I bought an electromagnet online hoping to make it attract and repel metals by changing the polarity of the voltage on it, but I ended up experiencing attraction all the time. Is there any way to make an electromagnet that attracts in one way and repels in another way? <Q> The electromagnet attracted everything magnetic because those other things weren't polarized with their own magnetic fields. <S> Two electromagnets, or the electromagnet with a permanent magnet would work. <A> A coil that is energized with alternating current will repel a conductive but not magnetic ring. <A> Reversing the polarity on an electro-magnet will reverse its poles but it will still be a magnet. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Reversing polarity on electromagnet reverses poles. <S> Thought experiment: if you had purchased a bar magnet and found that one end of it attracted metals, would you have expected the other end to repel? <S> simulate this circuit Figure 2. <S> Unlikes attract. <S> Likes repel. <A> It is possible to make an electromagnet repel a permanent magnet. <S> To accomplish this the electromagnet's current needs to induce a magnetic field "He" in the core which is stronger then the opposite field <S> Hm that the magnet is inducing on that same core. <S> If |He| <S> > |Hm| <S> then the core is magnetized by He-Hm, a net field whose polarity depends on the direction of the applied current. <S> Normally a pretty strong current is required to overcome Hm, making it appear that the magnet always attracts the core.
For a magnet to repulse something, that something needs to also be magnetized and the like poles of the two magnets aligned.
16/18 VAC to 5 VDC UPS I'm new here so please bear with me. I'm planning to replace my old central alarm system with a new raspberry pi, which takes 5 VDC input. My old central uses a separate 230 VAC to 16/18 VAC transformer and 12 Volts lead-acid battery as backup. I'd like to leverage, if possible, the transformer and the battery in order to build a UPS which would feed 5 VDC into the raspberry pi. Does it make sense to re-use these components? I'd like it to be energy efficient since it would run 24/7. If so, I'd appreciate any help on how to get started. Thanks,Juan <Q> This will give you a good 12V rail to work on. <S> About the 5V rail you can get one of those USB phone chargers for cars, and those should be able to cut it. <S> If you want to roll your own converter go with a LM2596-5.0 fixed buck chip. <S> As a backup plan, you can use a normal phone charger, a USB battery bank and a 5V supercap to power your Pi continuously. <A> You would need a high efficient buck converter - take wide input option as the battery charger can output voltages even more than 15V. There are plenty of them on ebay, or an automotive phone charger as suggested by <S> Maxthon Chan - make sure it is not a linear voltage regulator, but buck (step down) DC/DC converter. <A> That should be fine. <S> Float charge your battery from the existing charger / PSU. <S> Buy a 12 V in <S> , 5 V out 'buck converter' to drop the voltage to the RPi. <S> Go a bit high on the current specification - maybe 1200 mA - <S> so you can power peripherals, if required.
You should be able to keep the original batteries, charger and wall wart.
Desoldering an IC without damaging it I'm trying to make my own Arduino based board. I need to have at least 25 digital I/O and no less than 8 analog in pins. I decided on the Atmel ATMega2560 because of its large capacity for both of those. My problem is that I can't find a solid way to burn the Arduino bootloader onto it. From reading online, it seems it's either a hit or miss. So my solution is to buy a "fake" Arduino board that has the ATMega2560 onboard already, and then desolder it off and use it for my project. What method would be best for removing the IC without damaging it? Thanks! <Q> You are solving the wrong problem. <S> When you are building your own board, you need a sensible way to test and program the board, no matter what. <S> The best way to do so is to make the JTAG interface accessible on some pin header and use that for a boundary scan test after soldering the IC and initial programming afterwards. <A> [This started as a comment. <S> But then I ran out of room. ] <S> It's less risky than a desoldering job. <S> As you probably know, there is a tutorial . <S> Get a DIP version of the ATmega, breadboard it, and practice downloading the bootloader. <S> Burning an Arduino bootloader <S> worked for me dozens of times, for various Arduino models ( case in point ). <S> TL;DR <S> It's a useful skill to be able to desolder an IC. <S> But your approach to the bigger problem is completely wrong. <A> heat the back of the board on a hotplate, (or a with a propane torch) and push the chip gently with a stick until it comes free <S> you'll likely damage the board beyoned reuse this way, but it does ensure that the chip receives the minimum amount of heat required. <S> But really the best way is to put a ICSP header on your new board and use an AVR programmer (or FT2232 etc) to program a new chip, or find a vendor who sells programmed chips. <A> Chip Quik is a low temperature alloy especially designed for removal of SMD components. <S> A kit is available from Digi-Key for just under $15. <A> A common practice for desoldered chips is to throw them away. <S> Regard them as "unreliable". <S> Desoldering requires a lot of heat because all the pins are soldered at once. <S> This means that it will likely damage/degrade the chip. <S> You don't really want to troubleshoot such foreseeable issues. <S> It can suck a lot of hours for the cost of 1 chip (albeit a rather costly ATMEGA in this case). <S> I can imagine this cost of 1 chip vs hours debugging a faulty chip is a different trade-off for work and hobby. <S> But even for my hobby purposes I don't bother. <S> I rather spent my 1 hour on writing some code than messing about on some issue that only sucks time. <S> But for this case, there are better solutions. <S> Prepare your target board in such a way that you can always "in circuit program" the chip. <S> This is applicable for any target package these days, even if are programming a DIP chip in a socket. <S> It's so much easier to have an in circuit programming tool, so you don't have to reposition the chip dozens of times. <S> Additionally it may extend to an in-circuit debugger connection as well. <S> For ATMEGA you can use the ISP for this. <S> Alternatively (no space for ISP header) you could buy a ZIF socket for the QFP package you're using. <S> With this socket you could make up a programming jig that powers up the chip and breaks the ISP pins out to your programmer. <S> This requires no soldering and thus no thermal stress for the chip.
Burning an Arduino bootloader into a "virgin" Atmega is a fairly reliable procedure.
How can I adapt a 3-pin PC fan connector to a 4-pin connector? My computer's motherboard uses all four pin fan connectors with no support for speed controlling the older three pin fan connector. The problem is, all the PC fans that I have use a three pin connector. As fan as I know there are no premade solutions available, so I was thinking of building an adapter that sits in an unused drive bay. I can't seem to find much information on how the four pin fan connecter works. Apparently, it looks something like this: 12 V 0V Tachometer PWM The three pin header is numbered similarly: Vcc 0V Tachometer Could I simply use a logic level MOSFET to do the following? <Q> This solved my problem: Cited from 3pin to 4pin fan adapter(Chinese) <S> Explanation: <S> two fast-switch triodes (2N-2907 and 13003) utilize PWM control over 12v power. <S> diode protects the fan from voltage higher than 12v <S> 1K R gives a 12/1000=12mA ceiling to the current from 12v to ground, just in case 2N-2907 is damaged. <S> 0.5K R does the same thing for 13003, limiting the max current approximately to 2.5/500=5mA <S> All these stuffs are easy and cheap to buy, enjoy.. <A> if you want variable speed that's obviously not a suitable solution. <S> using the PWM signal (which is is probably only 0-3.3V) to switch a mosfet probably won't work well, and if it does work the fan will tend to stick on some harmonic of the PWM frequency instead of following the PWM ratio. <S> a better approach is is to use the PWM signal to control the set-point of a voltage regulator and use the regulator output to power the fan, thus controlling it speed. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> here I show the potentiometer on a typical adjustable lm2958 LM2956 buck converter module and then the same module with the potentiometer replaced with a PWM control circuit. <S> it works by the PWM controlling the discharge speed of C2 and <S> thus the bias given to feedback signal. <S> C1-R5 compensate for the low-pass formed by the presence of C2 <A> Most 3-pin fan controllers control the fan by varying a DC voltage across the fan. <S> This basically means that there is a PWM circuit (most likely) inside that controls a (discrete) buck regulator that brings the voltage down. <S> The fan stays on permanently and has a functional tacho output. <S> You CAN control a 3-pin fan with PWM on the power pins as well (but not as you have drawn - this is not how a P-MOSFET will work), but be prepared to sacrifice the tachometer function. <S> After all, if you cut power to the fan there is no way for the fan to pull down (it's an open collector/drain output) the tachometer pin. <S> Therefore you get the tacho signal interleaved with the PWM signal, resulting in a garbaged tacho output. <S> 4-pin fan controllers hand off the PWM signal to the fan itself, and these fan controllers supply an uncontrolled a 12VDC. <S> This is probably why they are not able to speed control your fan. <S> 3-pin fans will power up at 4-pin connectors, but only at full speed. <A> This should work correctly : source: <S> https://www.techpowerup.com/forums/threads/so-you-want-pwm-control-of-your-3-pin-fan.115752/ <S> 12V is permanently connected, ergo, you will have correct RPM readings. <S> You need a 5.1V Zener Diode, different value for resistor and positioning and uses a n-Mosfet. <A> This is rather old question, so I wanted to give a brief update for the folks stumbling upon it now. <S> Note, that this is not an answer per se, since it does not work for everybody, unlike other answers here. <S> While answering similar question , I've stumbled upon the notion of motherboard support for both 3-pin and 4-pin fans. <S> So, if you have one of the newest boards, before you start soldering any adapters go check BIOS settings <S> - it just might have everything you need already.
You can just plug it in, the connectors are designed to be compatible.the fan will only run at full speed, that may or may not be a problem.
Triac BTA316 does not turn off I had a look to other posts about Triac and I am pretty sure my problem was not in there. The goal of my system is to realized a controlled switch for home appliance. Then I designed a power supply system (non isolated) that supply energy to my microcontroler (STM32F030C8T6). It is all working fine. I would like to controlled a triac (NXP BTA316-800E) with one of the logical output of the STM, then I realized this circuit: NOTE: The earth symbol is a mistake, it is a 0V point of the circuit. As I would like to control every types of appliance I add a snubber circuit for inductive load. To turn on the applicance I set the STM32 output (logic 1 : 3.3V), and I clear this output to turn off the appliance (logic 0; 0V). This ouptput is a push pull type. My problem is : The appliance is always ON. I can see that logic levels are well applied (at the output of the STM32), however, here is what I get at the Triac gate, when output is 0: I guess the short 1.8V spikes keep the triac on, but I don't know why these spikes are present. Anyway, I tried to remove R2 and tied T1 gate to ground in order to be sure that no current is flowing through but the appliance is still on. Do you have any idea? Thank you very much. IMPORTANT: This circuit is dangerous (deadly) as you deal directly with main power. All care has to be taken to experiment. <Q> Test whether the triac is OK by leaving its gate floating. <S> It shouldn't conduct. <S> OT: be very careful if you really must have the power supply referenced to the line (as is on the picture). <S> Edit: the schematic is not wrong as others claim - it is possible to use line as reference, but one has to keep in mind that the moment the GND connects to neutral you got a short circuit. <S> And it is all too easy to happen in this setup. <S> For example, if you connect to grounded lab instrument (oscilloscope) you get a short. <S> I've been using similar setup in a project that measured noise on the power lines. <S> There you need it if you have non-isolated supply. <S> I knew the risks, but I still managed to burn the prototype, the programmer and my computer. <S> Also, don't let me start on the fireworks it caused.. <A> How about if you add Photo-Diac the output; MOC3021/3022 and trigger the triac with a diac. <S> The Photo Diac method never ceases to amaze me. <S> Works like a charm. <S> Technical explanation <S> :Triac works with AC and gate give voltage pulses to the controller. <S> Hence using Photo-Diac takes out every chance of blowing your controller apart, and i guess Gate voltage required to trigger the Triac <S> is more than 3.3V(Unsure about this one). <S> 3.3/220 <S> = 4.5mA ; so technically the gate current is sufficient. <S> Before trying the photo diac method; try using a lower-value resistance. <S> like 100ohm <A> I don't know if you have messed the schematics, but is completely wrong. <S> Line is earthed, the power supply comes just from neutral - impossible to work. <S> Probably the MCU output pin is already dead. <S> Keep in mind that triac has to be sensitive gate who works in 4 quadrants. <S> Read this app note carefuly: http://www.w-r-e.de/info/st_an392.pdf
You can put the control signal to high impedance state, this should kill the triac at the end of the period.
Why is the power consumption of electrical lamps specified in kWh/1000h? This is the box of a LED spot I just bought. I'm wondering why the power consumption is measured in kWh/1000h and not simply in Watts. Edit: The labeling standard can be found here . (Guide for the application of the commision regulation (EU) No. 874/2012 with regard to energy labelling of electrical lamps and luminaries). <Q> Anyone who has a clue about how physical units works will of course realize that kWh/1000h means "1000 watt-hours per 1000 hours" which can be shortened to just W . <S> But when it comes to lamps, the unit "W" is already used for the light output. <S> Light bulbs which use more energy-efficient technologies than the classical incandescent light bulb often state their light output in equivalency to an incandescent bulb with a specific power consumption. <S> Until 2010 you could often find LED light bulbs stating to be "equivalent to a 40W bulb". <S> So the consumer knows that if they want to replace an old 40W incandescent bulb with an equally bright LED bulb, they need to look for a 40W LED bulb. <S> A consumer buying an LED lamp with an input power of 40W might be surprised by how bright it is. <S> Also, the average consumer doesn't know much about how electricity works. <S> So from the point of view of the average consumer, the unit "Watt" means "light-intensity" and "kWh per hour" means "energy consumption". <S> A physicist will of course inject that the unit for visible light radiated by a source is " <S> Lumen" and "Watt" is the unit energy consumption should be measured in, so that's what should be printed on light bulb boxes. <S> But physicists aren't average consumers. <S> Using different units for each - even if both of them are misleading from a physicist's point of view - is what's the least misleading way to communicate it to the end-user. <A> The energy rating covers all types of electrical appliances including fridges, washing machines, etc. <S> In the case of a fridge the instantaneous current could be zero or full on depending on the thermostat. <S> It makes more sense to put the fridge into a 20°C room, power it up and read the kWh used in, say, 24 h and scale it up. <S> This gives a better idea of the average power consumed by the device. <S> I agree that this could be quoted as X watts average. <S> On the other hand if I know I pay €0.15 / kWh for electrical energy <S> it is a very simple calculation for a non-technical user to figure out the cost of running the appliance. <S> Mind your units: 'K' is kelvin. ' <S> k' is kilo. <S> ;^) <A> It allows you to do an easy comparison between different light bulbs, because it is a standardised way of presenting the power consumption of the item.
They know they need to pay for their electricity consumption in a unit called "kWh", so they want to know how much they need to pay when they run the device for x hours.
Why are my components unconnected in the middle of the breadboard? I have this breadboard: And I need my Integrated Circuit to be connected exactly like this (Don't pay any attention to the wires. Let's focus on the IC in the middle of the breadboard itself): However, when I connected the power, it didn't work. Then I found out that the IC was pushed up from the breadboard. I tried to push it down and it worked, but when I released my fingers, it stopped working again. That was like the legs of the IC was not long enough to be buried deeply into the breadboard. I had problems with not only the IC but the pushbutton as well. Did anybody face that kind of problem like me? Please show me the trick to bury the components deeper in the middle of the breadboard. Thank you. <Q> Normally, these breadboards are built exactly for what you're trying to do. <S> And normally, it works, because there aren't many different lengths of pins on ICs. <S> If more force doesn't help (i.e. your IC just can't be pushed in further), I'm afraid all you could try is use a IC socket; but to be honest, that would sound like a lot of trouble considering the job of holding and connecting your IC is exactly what you use your breadboard for. <S> Considering that you had problems with a button, too, I'd say that stranger things have happened than breadboards with varying build quality :( <A> If this is a brand new breadboard, it is possible that the contact tines (the contacts within the breadboard sockets) have a nominal opening that is smaller than the size of the IC pins; this will 'push' the IC back out of the breadboard sockets. <S> I have seen this (admittedly many years ago), and a piece of non-stranded wire judiciously used can open the contact a bit so <S> the breadboard will not push the IC back out. <S> Be careful so as not to actually damage the contact; just open it up a bit. <A> One of my breadboards acts this way. <S> I hated it and decided to sacrifice it to make This Breadboard Video . <S> Also, YES: longer leaded parts will fit into that breadboard. <S> You just need a better breadboard. <S> Spend eight bucks and get a new one. <S> Most breadboards don't exhibit the bad behavior you describe. <S> Cheers!
But you shouldn't need to purchase specific ICs to fit into a breadboard.
What does SMA Tee Adapter do? SMA tee connector is something like this: What does it do? Is it something like a power divider? <Q> It just provides straight connections. <S> If you know anything about RF then you should realize that it will only work properly for low frequencies. <S> At high frequencies the characteristic impedance is affected resulting in reflections and unwanted attenuation of your signal. <S> I would only use these to split or combine a signal up to 100 MHz or so and even that is pushing it. <A> <A> What does it do? <S> There are three ports <S> all connected together - ground is common and the middle pins are all common. <S> Is it something like a power divider? <S> No, it's a three port junction suitable for coaxial cable connections. <S> Power division is dependent on source and load impedances. <A> It's used to create a "bias Tee" , which allows DC power to be delivered to the output port of an up-stream device, such as an amplifier or photodetector, while the RF signal retains proper impedance matching from source to load. <S> That prevents creation of inter-symbol interference in a digital system, or standing waves on an analog transmission system. <S> The bias <S> Tee <S> has, on one port, an SMA low-pass filter with its other end connected to a power supply. <S> A second port of the Tee has an in-line blocking capacitor attached, the other end of which has a cable that delivers the signal downstream. <S> A cable attached to the third, unblocked port, delivers power upstream.
One good use of coaxial tee adapter is attachment of coaxial cable tuning stub or surge protection.
Replace SOT-23 (5 pin) package in production with wire I have found a hardware bug on a board design after many PCBs have been manufactured but not populated. I can fix the problem by removing a SOT-23 component and putting a wire across two of the pads. I have too many PCBs manufactured that manually installing a wire across the two pads of the removed component is not economical in time or money. How can this be fixed using an automated production method? Are there components available to fix this kind of problem, i.e. a package with just a wire between the two pins? Edit: The link in question is one of the SOT23-5 diagonals. One suggestion is to use a zero ohm resistor. These typically come in rectangular packages with rectangular leads. Would a pick-and-place machine handle resistors placed at 45 degrees to the pads? What would happen during reflow? Would the surface tension due to the incorrect alignment of the leads to pads cause the resistor to spin and detach from the intended pad? <Q> You can buy zero Ohm links in a SOT23 package. <S> Various connections are available, have a look at http://www.topline.tv/SOT_jumper.html <A> I've used a 0805 jumper for this exact purpose before. <S> Angle is pretty arbitrary to a pick and place. <S> It may take a little longer to place a component on a 45 than a right angle, but it can do it. <S> During reflow, it's not much different than if it were a normal set of 0805 pads, the jumper will center up between them. <S> It's not ideal for mass production, but it will work to get you through to a revision. <A> It would maintain a reverse bias blocking effect like a regulator should. <S> Different configurations exist, in single and dual or quad.
As an alternative to the better answer of a sot-23 zero-ohm link, depending on your needs, a sot-23 diode package or array may be better.
Are RF shields necessary? I see that some wireless devices like Bluetooth speakers don't use shields like this one but some do. My understanding of FCC Part 15 is that only modules need shields. So how come some devices use shields whilst others don't? Thanks <Q> In the United States the FCC (Federal Communications Commission) <S> Part 15 regulates unlicensed transmissions. <S> It doesn't matter whether you are using a "module", it is the unlicensed use of any transmission. <S> The FCC doesn't care HOW you comply with the regulations. <S> If a device complies with regulations without using a shield, so much the better. <S> Fair article regarding FCC Part 15 (Shield meaning here is a metal envelope or enclosure, not shield as used in Arduino definitions) <S> EDIT 1 : <S> EDIT 2 : <S> After seeing comment by DigitalNinja, I did further research. <S> Apparently the FCC does use the terminology "module" and "modular". <S> The following is extracted from : October 23, 2015 TRANSMITTER MODULE EQUIPMENT <S> AUTHORIZATION GUIDE : <S> One definition of modular is cited, among many other types of modular as, Single-modular transmitter is a self-contained physically delineated component that can demonstrate compliance independent of the host operating conditions, and complies with all eight requirements of the Section 15.212(a)(1) and summarized below. <S> Further quoting, and which complies with all eight requirements of § 15.212(a)(1). <S> Which includes as the first item : 1) <S> The radio elements must have the radio frequency circuitry shielded. <S> Physical components and tuning capacitor(s) may be located external to the shield, but must be on the module assembly; 2) <S> The module must have buffered modulation/data inputs to ensure that the device will comply with Part 15 requirements with any type of input signal; There are other sections of the same "Authorization Guide" that allow compliance with the FCC Guide without using shields. <S> Often regulations can conflict with themselves. <S> I can now see where the original OP, and the commentor DigitalNinja have concluded a shield is necessary, even though I read the FCC guide as not requiring a shield, or perhaps the definition of a "shield". <A> If a module is to be used for internal consumption a shield is not required as the product that your module is put down on will need to be tested. <S> Any Module that is sold as a stand alone item must be shielded to get FCC approval. <S> That is why you see a shield on brand name, certified modules. <S> I would be very wary of any that claimed to be FCC and other agency approved that did not have a shield. <A> The FCC defines a module for the purpose of pre -certification. <S> So a company can sell you a module that is already FCC certified and that saves you the costs and time of having to certify your own product. <S> You still have to certify the rest of the product but the wireless portion is taken care of. <S> And there are strict rules on how the module can be used on the system and if you violate that you would have to still certify the whole thing. <S> As Marla said, 1) a shield would be added if the product can't pass EMI testing without it 2) <S> a shield would be added to increase immunity from external EMI.
A device manufacturer might also use shielding to make their product more immune to interference from other electro-magnetic interference.
How long to program a FPGA - seconds, microseconds, less? How long does it take to load a new configuration on a FPGA? can a FPGA be re-programmed on the fly while a computer program with offloads to the FPGA is running? <Q> In my experience, it's usually one or two seconds <S> or at least 100's of milliseconds. <S> It depends on how big is the FPGA and what interface (serial, parallel, etc) you use to program it. <S> To know for sure, divide the length of the bit stream by the bit rate of the programming interface you want to use. <S> If you're programming from a computer host, add some time to account for the computer not devoting all its resources to filling the pipe from it to the FPGA. <A> can a FPGA be re-programmed on the fly while a computer program with offloads to the FPGA is running? <S> That is called partial reconfiguration , and is possible, under rare circumstances, namely, that you use the right tools (with pricey licenses), and partition your FPGA design accordingly, have made provisions that clocking the used parts runs on, and the moon phase is just right. <A> can a FPGA be re-programmed on the fly while a computer program with offloads to the FPGA is running? <S> This is an old question, but I'll quickly include the Active Serial programming method, where the FPGA loads its image from a flash memory, and then the flash memory can be re-programmed at runtime while the FPGA is up, and then the FPGA will pick up the new image on the next reset. <S> With this method, a new image can be loaded while the FPGA is currently running, and you can even have multiple images on the flash and choose between them if required.
The time remains relatively constant as FPGA technology improves because as the FPGAs get bigger, they also add new higher-speed programming interfaces.
12v on/off switch to toggle state of two circuits I have an existing latching button switch that controls a low power LED (no more than 1W) from a 12V power supply. I'd like to add an extra circuit to the same power source that is controlled by the same switch, the other circuit will consume more power (up to 80W). I'd like the on/off applications of the switch to cycle the on/off state of the two circuits as follows: Switch mode Circuit 1 Circuit 2Off Off OffOn ON OffOff Off OffOn Off ONOff Off OffOn ON ON(and repeat the cycle) I'm not clear what I am looking for to achieve this desired effect, is there something off the shelf that can be used to achieve this and wire to my existing switch? If not, what should I be searching for to breadboard up a suitable prototype? As an aside, I'm not 100% sure the switch can handle 80w throughput, which may be one consideration. <Q> There are other solutions, but they rapidly get more complicated. <S> If you want to dabble in a tiny amount of programming, that is probably the solution for you. <S> This dev kit is cheap, includes the programmer, and has access to enough pins for what you need. <S> You would need to add a connector, and have an external circuit with a couple mosfets, a couple diodes, and a couple relays. <S> Let us know whether this is a possibility for you, and I could draw it up in further detail. <S> http://www.mouser.com/ProductDetail/Texas-Instruments/EZ430-F2013/?qs=sGAEpiMZZMumoJNx8xCU5nFxmy%252b2zsQ4h%252bdVrWunAKI%3d <S> http://www.allaboutcircuits.com/textbook/digital/chpt-11/finite-state-machines/ <A> Maybe a impulse relay (step relay), forget the MCU it will drain the battery, old school, this: http://gfinder.findernet.com//assets/Series/408/S26EN.pdf <S> Unfortunately it has only 4 steps: both off, 1st, off, <S> 2nd, off. <S> No both on. <S> Perhaps you'll find something with 6 sequences. <S> Edit: 26.04 model you have: both off, both on, 1st, 2nd,... both off,... <S> 12VDC model <S> 20.24.9.012.4000 <S> http://gfinder.findernet.com//assets/Series/406/S20EN.pdf <A> The simplest method is a microcontroller, and a pair of relays. <S> The switch would just be a simple input to the microcontroller. <S> You can then use a simple state machine as you have posted to control the two relays.
I agree, a microcontroller would be the easiest, as you will need de-bouncing for your switch, and a state machine of some kind. If you wish to do it completely without SW, this is the process that you would have to go through to design a logic circuit to do it, where the clock would be replaced by a debounced version of your switch.
Is there a difference in the meaning of power and current amplifier terms? I understand the difference between voltage amplifier and power or current amplifier. For example in an audio amplifier there are usually three stages: two voltage amplifiers and a power amplifier at the last stage. Okay they call the first two amplifiers here voltage amplifiers since they increase/amplify the input voltages with driving very little current from the power supply. But at the last stage the current is amplified, hence the power. I understand that power is related with current's square but my question is about naming. Does "power amplifier" and "current amplifier" mean the same thing? Or power amplifier term is used when an amplifier amplifies both current and voltage; but "current amplifier" is only used when there is unity voltage gain with high current gain? <Q> If you ask 10 EEs this, you will probably get close to 10 answers. <S> This is not a well-defined convention, but is roughly outlined as you guessed. <S> A power amplifier will be able to provide more power than the previous stage. <S> A current amplifier will be able to provide more current than the previous stage. <S> If you need a definitive answer, I would say ask the person that you are involved with on this project. <S> The key is always to understand what the other person means, not necessarily what they say. <S> Basic communication theory. <S> :-) <A> I understand the difference between voltage amplifier and power or current amplifier. <S> For example in an audio amplifier there are usually three stages: two voltage amplifiers and a power amplifier at the last stage. <S> [...] <S> [emphasis mine, N.A] What you have described is the difference between signal amplifier and power amplifier. <S> The signal happens to be voltage and power happens to be current in this case. <S> Consider this. <S> There is no general definition of gain, or even units of measurement for gain. <S> The gain and its units are defined on case-by-case basis. <S> When you wish to drive coils in the speakers, you care about output current, while voltage is less important as long as you have enough compliance voltage. <S> The gain 1 of the current output power stage would be defined as I out /V in , and units would be [A/V]. <S> When you wish to drive piezos (for a different example), then you care about output voltage, while current takes the second seat. <S> The gain 1 of the voltage output power stage would be defined as V out /V in , and units would be [V/V]. <S> 1 <S> I'm assuming that the signal is voltage (perhaps provided by an upstream signal amplifier). <A> The output stage <S> you're discussing amplifies current only, but you're talking about the special case of a solid-state output stage, which is almost invariably a voltage-follower. <S> There are other topologies and other technologies. <S> For example, a typical valve output state amplifies both voltage and current. <A> You`ve got already so many answers - here is another one (very short): <S> According to my experience, very often there is simply a misunderstanding concerning the term "power amplifier". <S> In most cases, the purpose of such a stage is not to "amplify" power, but to PROVIDE a large amount of output power to the connected load. <S> For example, think of the popular push-pull stage (class-B operation). <S> Due to non-linear operation of the stage, we do not speak about the amplification factor of this stage. <S> The most important parameters are output power and efficiency.
The amplifier as a whole amplifies power.
Should I use two fuses for 220V mains? I'm designing a product that will be fed directly from 220V mains. The 220V goes into a PCB that has a high voltage section and a AC/DC converter module to generate low voltage to the microelectronics. When using 110V I always use a input fuse for overcurrent protection in one of the mains wire (Live or Neutral - whatever...). For 220V, since I have two 110V phases, should I use one fuse or two fuses (one in each phase) ? I think that using a single fuse should be suffice. However if one of the fuses blows and the other stays intact the board still have a hot main wire attached. Even if no current flows because the other phase is out, there's still possibility of electrical shock or worse... am I thinking right? <Q> simulate this circuit – <S> Schematic created using CircuitLab Figure 1 and 2. <S> In Figure 1 you need F1 to blow. <S> In Figure 2 you need F2 to blow. <S> As per the comments, if you don't have two fuses then you need the RCD / GFID to isolate the power. <S> If that doesn't work or isn't there you are depending on the upstream circuit-breaker / fuse which may have a relatively large rating and allow high fault current to flow for some time before tripping out. <A> I think the OP is talking about a device that is pluged into a socket, therefore it is fused with circuit braker or by fuse (double, each phase one)already. <S> If the case is metallic it has to be connected to the earth wire. <S> If there is a dielectric break to the case then the circuit braker will diconnect the socket. <S> The internal fuse of the device is just preventing a malfunctioning rise of current that would put on fire the device. <S> So the conclusion is - you don't need two fuses. <A> I think you're confused bud. <S> Most power generation systems are 3-phase. <S> Wall sockets use 3 pins because 1 is ground, 1 is neutral, and 1 is power (HOT). <S> You want your fuse to cut off the HOT line. <S> Your circuit breaker is configured to provide either 120VAC or 240VAC to the specific plug but it still provides it to the HOT and NEUTRAL lines, not an additional pin. <S> There is a good summary in a DIY stack exchange if you want to learn more about 3-phase and 120VAC vs. 240VAC. https://diy.stackexchange.com/questions/42043/whats-the-difference-between-three-phase-240-v-and-standard-household-240-v
If you really have a two-phase supply you need two fuses to protect in the event of a phase-chassis internal fault.
Why no octagonal IC packages? I wonder why octagonal IC packages in the LQFP times have never been a thing. In my opinion they would allow easier pcb routing, they take less space and weight for the same die size, shorter leads to the die compared to square packages as well. Pick and place machines wouldn't have a problem with them, and EDA software is fine with 45° routing anyway, so it seems like a logical thing to do. Yet I've never seen one. Any idea why? <Q> I don't think you'd get any advantage. <S> If you look at a square and an octagon with the same perimeter, the octagon does not look great. <S> On top of the that, you normally lose a bit of space at the corners (compare PLCC and TQFP packages) <S> so I think you'd lose a lot with double the corners. <A> I think it would make sense from a PCB designer point of view, however production wise <S> it is not the best idea. <S> Comparing a square and octagonal TQFP package with the same area, shows that the ammount of pins stays equal without any problems. <S> And surely, routing a PCB could be a lot easier with this! <S> So if the chip designer wants to make his chip as small as possible, this is not going to help... <S> The die inside the package would still be square to make production cost effective. <S> And of course, square dies are easily sawn by vertical and horizontal lines, whereas ocotagonal shapes need another cutting method... <A> Traditionally new packages are developed for better manufacturing yields or higher density. <S> So if there would be any advantage, it would have to be in that primarily. <S> I don't think that manufacturing yield is a reason.. still the same pin technology, pin pitch etc. <S> Density is pins/area -> so <S> a given package should have more pins on it to make sense. <S> If you consider a square and an octagon with the same overall width/height (e.g. the octagon fits inside the square), you could calculate the perimeter of both packages. <S> I assume the perimeter as a direct indicator of how many pins can fit on a package. <S> For a rectangle the perimeter is 2*w + 2*h. <S> For an octagon the perimeter is 8 times the length of a side. <S> The length of a side for an octagon is 0.4142*w. <S> (source: wikipedia ). <S> Substitute <S> x= <S> y=1cm, you get 4*1=4cm perimeter for a square and 8 <S> *0.4142 <S> *1=3.3136cm for an octagonal. <S> That's 17.16% loss in perimeter length, or 17.16% less pins on the same width/height package. <S> That makes sense, because you're basically "cutting a corner" 4 times. <S> So I can understand why these packages don't exist. <A> To add a new perspective consider this: modern day ICs often include a lot of digital circuitry. <S> This circuitry is described in a hardware description language which is converted via a toolchain into standard cells, which are connected by an autorouter. <S> These tools are designed for rectangular structures and the geometry is easier in those cases. <S> Also its easier to cut wafers into rectangular pieces, just think of PCBs they are also mostly rectangular. <S> Of course the chips are (mostly) bounded to the package, but still their geometry and relative size matters (differing angles and lengthes of bonding wires). <S> Additionally you should consider pins close to a vertex, their internal connection would be pretty close to each other (same for squared packages - you do not have pins close to the vertex) and by using an octagonal package, you would increase the relative part of the circumference blocked due to that issue. <S> In the end I guess they are more complicated to produce for various reasons and give the user little advantage.
But, to provide another viewpoint: The production of octagonal dies is less efficient than for square dies.
Are the same type of antennas used for receiving and transmitting? Short version:Is the same antenna type used for transmitting as is used for receiving if the frequency is the same? Long version:My garage door opener uses 433 MHz to receive signals from the remote control. The antenna it a wire, about 30 cm (one foot) long. The door opener transmits its status to a control device we have in the house. When transmitting it uses 868 Mhz. The antenna for transmitting is a wire about 8 cm (3 in) long. The control device we have in the house contains two antennas, both wires about 8 cm long. One I assume for receiving and one for transmitting. I assume I can replace the 30 cm wire in the door opener with a 433 MHz antenna like this ( http://www.ebay.co.uk/itm/New-SMA-Male-Crimp-RG174-GSM-GPRS-433MHz-Antenna-Sucker-Cable-3dbi-Magnetic-Base-/161525785843?hash=item259bafe4f3:g:fcoAAOSwuMFUkqWO ) and the receiver antenna in the indoor control device (which I'm anyway going to put in a custom case) with this ( http://www.ebay.co.uk/itm/868MHZ-915MHZ-GSM-3G-Sucker-Omnidirectional-High-gain-Antenna-7DBI-super-/201249960496?hash=item2edb6eb230:g:J3IAAOSwuMFUj-2c ). But what about the transmitter antennas? Are there custom transmitter antennas or can I buy a 433 MHz antenna and use that for transmitting at 433 MHz? <Q> Antennae are mostly symmetric in their receive and transmit behaviour, i.e. they will have the same gain and frequency response in each role. <S> The main place where the symmetry breaks down is power handling: an antenna designed for receiving needs to carry only a tiny quantity of power whereas a transmitting antenna, e.g. for a large radar or a long-range communication link, might be carrying kilowatts or even megawatts of instantaneous power. <S> Power is not an issue for garage door opener radios though ;) <S> However, I would not necessarily expect that replacing the existing wire-antennae with these new antennas will yield any improvement. <S> They may do, or they may be worse depending on how well their impedance is matched to radio circuits you're using them with; have a google for VSWR. <S> The relationship between the antenna you use and any ground plane below is probably more important than changing one cheap piece of wire for another slightly-less-cheap bit. <S> By all means experiment with those, but don't have high hopes for longer range. <A> Antennas both transmit and receive in the sense that they can do either. <S> I'd be careful to not just "splice" the antenna in and to actually use a proper connector (which you never mention, but I assume they exist because your products have them). <S> The only exception being antenna that have active devices in them that are not bi-directional (linear). <S> Those are fewer and farther between but do exist. <S> I suggest posting photos for confirmation. <A> The reason for replacing the antenna is more important. <S> Are you trying to get more range or is something wrong? <S> A reason to replace an antenna is to get better range. <S> When replacing the antenna, neither the transmitter nor the receiver is changed. <S> For the case of the transmitter the power sent does not change. <S> What the new antenna can do is focus the same amount of power into a more narrow beam, sending more power in a particular direction and less in another. <S> This is called directivity. <S> The same thing happens with the receiver as well. <S> An antenna with a greater directivity is able to receive a weaker signal compared to its less directive counter part. <S> One way directivity is represented is gain. <S> The gain is how much the signal is "amplified" so to speak, in the direction of greatest directivity if compared to a true omnidirectional antenna. <S> All of this was to say that the antennas that you have, lengths of wires, are called monopoles. <S> The gain of a monopole is roughly the same. <S> The antennas that you listed are also monopoles. <S> By relapsing a monopole, no matter how good looking, with another monopole the change won't be noticeable. <S> The other problem is impedance matching. <S> Antennas can't be just hooked up willy nilly. <S> The impedance of an antenna must match the impedance of the transceiver. <S> If you connect a 50 ohm antenna to a 75 ohm transceiver there will be problems. <S> Without knowing the impedance of the transceiver is important before hooking up the antenna. <S> One way to easily make a directional antenna is to place a parabolic reflector around it. <S> Cut out several cardboard sheets in the shape of the parabola. <S> Cut an antenna sized hole at the location "F". <S> Join all the pieces together on the corners. <S> Cover the curved surface with a metal substance. <S> Fine metal netting or aluminum foil should do it. <S> Slide the antenna through the hole "F" and fix it in place directing the signal toward the house.
Antennas can equally send and receive for the most part.
What small IC could give switchable I2C pullups? My goal is to replace a DPST on pullup resistors with something simple, cheap and very small that can be activated with the I2C bus voltage. I thought that this might be a common enough requirement that I would find a simple IC for this task, but after hours searching through datasheets I am not finding a solution as ideal as my gut suggests should exist. The question on how to Use GPIO for switchable Pullups of I2C has the basics of the thing I am trying to achieve on a very small PCB. I don't necessarily want to use a GPIO to turn the pullups on and off, my goal is flexibility of the design so the pullups could be turned on by a single jumper or a GPIO. simulate this circuit – Schematic created using CircuitLab Inspired by the Bus Pirate which does something similar using a CD4066BC, quad bilateral switch I found the TC7W66F, dual bilateral switch which vaguely fits my price and space goals but I imagined something similar to a SOT-23 package. The question mentioned above has an answer suggesting using FETs and I did find some dual FET packages with source already tied together that seemed like they might work but I'm primarily a software guy and have to admit not feeling 100% comfortable using something like this without further advice, or if it would require further components killing my space desires? <Q> BJT switching transistors tend to have less. <S> For example, these ones have Cob of only 3pF typically at 10V (it will be 2-3 times higher at low voltage, which they don't tell you and you're supposed to know) <S> but that's still pretty modest. <S> Add the pullup resistors to the collectors, the emitters to Vdd, and connect the bases to your /enable line <S> and you're done (one part plus the resistors, and the package is only 2.0 x 2.1mm). <S> Very cheap in volume, and not much worry about ESD. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> So why not MOSFETs? <S> They're lower resistance, right? <S> Well the saturated BJTs will drop 50~100mV most likely at the currents you'll be using them (compares well with 4066 switches), and compare the output capacitance of an FDS6312P MOSFET (Coss)- typically several hundred pF near 0V, which is nearly as high as the 400pF maximum for all devices on the bus itself. <A> One option is two P-Channel MOSFETS. <S> These can be connected as follows: simulate this circuit – <S> Schematic created using CircuitLab <S> Basically, if you use logic level MOSFETS you can feed the EN_n (not-enable) <S> signal with + <S> V volts to disable the pull-up resistors, and 0V to enable them. <S> When disabled the resistors will essentially not be there. <S> You will have body diodes from the I2C lines to V+, but those shouldn't cause any issue. <S> As @bitsmack points out, you could also add an optional pull-up resistor (R3) on the EN_n pin which would keep the MOSFETS disabled if the pin is left floating. <S> This would allow the input to be open drain - simply short to ground to enable, or leave floating to disable. <S> You can basically join the gates together and sources together making a very small essentially 4-pin package. <S> Even if you throw in the pull-up resistor as say an 0603, the whole circuit would probably be smaller than a 2x2pin 0.1" jumper. <A> Practical approach <S> All the breakout boards I'm plugging together are under my control [...] <S> Keep it simple. <S> Rip out the I2C pull-up resistors from every breakout board that you have. <S> Install pull-up resistors with reasonable values on the microcontroller board. <S> my basic desire is to be able to turn-on the PU where I want it with a single jumper <S> rather than 2 Trying to reduce the number of jumpers from 2 to one is lots of do beyond diminishing returns, if I may say so myself. <S> If a practical approach does not appeal You can do something along the lines of active constant-current pull-up circuit. <S> \$I=\cfrac{V_Z-0.65}{R_{307}}\$ \$R_{307}=R_{308}\$ <S> Any general-purpose small-signal PNP transistor would do. <A> How about just using an I2C bus accelerator with an enable, like the LTC4300A-1 <S> This can isolate parts of the bus, and is meant to do so. <S> The downside is that you need your pullups on both sides. <S> The upside is you wouldn't have to wonder!
I would suggest "prebiased" BJTs Dual MOSFETs tend to have a lot of Drain-Source capacitance which will affect the rise time of your I2C bus. It is possible to get very small (SOT23-6 or SOT23-5) packages which contain two P-Ch MOSFETS (e.g. this ) which can then be wired up as shown above - usually they are arranged in ways which make routing quite simple.
Why does a resistor reduce voltage if V=IR? I'm sure this is a very simple question, but I have been confused about this topic for a while now. According to Ohm's law, resistance varies directly with voltage. This means that if resistance increases voltage increases... But obviously that's not how it really works. If I add in a resistor to a circuit, the voltage decreases. I've heard that its because a resistor reduces current which in effect reduces voltage, however I don't understand how this lines up mathematically with what I said earlier. <Q> According to Ohm's law, resistance varies directly with voltage <S> You should read this the other way. <S> Voltage varies directly with current. <S> "R" is the constant of proportionality telling how much it varies. <S> If I add in a resistor to a circuit, the voltage decreases. <S> If you have a resistor in a circuit, with a current flowing through it, there will be a voltage dropped across the resistor (as given by Ohm's law). <S> If the resistor is in series with some other element, and they together are powered by a constant voltage source, then the voltage dropped across the resistor means there's less voltage available for the other circuit element. <S> It doesn't mean that the voltage of the source decreased. <A> That's not Ohm's law. <S> Ohm's law is R = V/I -- or the ratio of voltage to current is a constant. <A> I will emphasis on these points based on your question " <S> According to Ohm's law, resistance varies directly with voltage. <S> This means that if resistance increases voltage increases" Yes it is true ,i.e Voltage drop across a resistor increases,say if you connect a 1k and 10k resistor in series Voltage drop across 10k will be more when compared to 1k resistor. <S> Refer: <S> http://www.allaboutcircuits.com/textbook/direct-current/chpt-5/simple-series-circuits/ <S> " If I add in a resistor to a circuit, the voltage decreases." <S> but now across whole circuit i.e you may get less voltage at particular NODE <S> but it <S> but if you measure effective voltage it will be equal to the source(IDEAL condition) <S> Refer: <S> http://www.allaboutcircuits.com/textbook/direct-current/chpt-6/voltage-divider-circuits/ Last but not the least <S> "I've heard that its because a resistor reduces current which in effect reduces voltage" <S> What you've heard is wrong , resistor never reduces current it just limits current i.e <S> it slows the speed of electrons flowing in the circuit , and electric current as per wiki is <S> An electric current is a flow of electric charge ,so if you are slowing the electrons it doesn't mean you are reducing the current it simply means you are allowing limited no of electrons per second through resistor while remaining electrons are dissipated heat . <S> Hope this helps, <A> If you have a constant current source passing through a resistor, then, yes, increasing the value of the resistor will increase the voltage drop across it. <S> Ohm's Law gives the resistance as the ratio of the voltage and current, as R = V/I. None of these are necessarily constant, all three are variables. <S> In certain circumstances, you may be able to treat one or two of them as constant, or nearly so. <S> But Ohm's Law always gives the ratio. <S> Bear in mind you can measure the voltage at a resistor's terminals with a meter. <S> You can measure the current flowing through a resistor with a meter. <S> But the resistance, the inherent stuff going on inside the component that gives rise to the ratio, cannot be measured independently. <S> The resistance is defined as the ratio of terminal voltage to through current, you have to make both measurements and do a sum. <S> That is what a multimeter does when measuring resistance.
Absolutely No,adding resistor in a circuit drops the voltage across itself
What is the function of this transistor? There is a tutorial on multi-stage amplifiers. It doesn't explain every details. The first stage is the typical amplifier with stable bias, and the last stage is the push-pull amplifier. But there is also Q2 which is direct coupled in between. But what is the function of Q2 PNP transistor in the amplifier circuit below? Is that there just to invert the signal?: UPDATE!: A better version is below. Any one can explain Q2? <Q> The other answers are so incorrect. <S> Q2 is what is called VAS, or transimpedance stage; this is an age old idea used in many audio amplifiers today. <S> The purpose is to convert current to voltage; Q1 converts voltage to current, but audio amps are voltage amplifiers, so current has to be convert back to voltage, and then buffered. <S> Q1 also inverts the phase and Q2 puts it back to normal. <S> First schematics is wrong, because it has too much of a gain (10000 easily), <S> without negative feedback, that drops the gain to the normal values , <100. <S> EDIT: I thought a bit, and kinda understand where LvW is coming from. <S> First of all yes, you can consider it as a DC shifter (coupled with R2), as it moves Vcc at the collector down to ground level and amplifies, with inversion. <S> But that is not all. <S> Anyway, his explanation is not as wrong as it is incomplete <S> and it uses little too academical language. <S> Besides OP changed the question in a subtle which caused a lot of confusion. <S> I apologize if if was too harsh. <A> To User16307:Yesterday I already have tried to answer your question (role of Q2 and why pnp?) <S> , however some forum members heavily disagreed. <S> I understand that you feel confused now - <S> and, therefore, I think it is best for you to draw a picture of your own. <S> For this purpose, in the following I have listed some references, which may be helpful: 1) <S> R.C. Jaeger, Microelectronic Circuit Design: " Alternating npn with pnp transistors from stage-to-stage is common in dc-coupled designs " 2) Sedra and Smith, Fig. 7.43, 7.44, 7.49 <S> („ ..the pnp transistor provides the essential function of shifting the dc level .. <S> “.) <S> 3) <S> Univ. of Berkeley: (pages 5...7 ): <S> „ By using complementary devices, active level shifting can be combined with amplification “. <S> http://www-inst.eecs.berkeley.edu/~ee105/fa14/lectures/Lecture22-Multistage%20Amplifiers%282%29.pdf <S> 4) https://wiki.analog.com/university/courses/electronics/text/chapter-10 : <S> Fig. <S> 10.1.4 <S> („ By using complementary devices, active level shifting can be combined with amplification “) <S> 5) <S> Carleton Univ, Calif.: <S> Fig. <S> 12-11 <S> http://www.doe.carleton.ca/~rmason/Teaching/486-a.pdf 6) <S> Mass. Inst. of Tech. <S> http://ocw.mit.edu/resources/res-6-010-electronic-feedback-systems-spring-2013/textbook/MITRES_6-010S13_chap07.pdf <S> Fig. <S> 7-21(identical to Roberge: Operational Amplifiers, p.280) <S> 7) <S> Ferranti Semiconductor (March 1974), (picture given at the top). <A> Q2 is a PNP because Q1 is NPN. <S> The collector output of Q1 is at the +ve rail, so that's where the next transistor has to have its input. <S> A capacitor cannot be used to couple the signal, because it needs to amplify DC to get the bias conditions right, not just the AC of the signal.
Q2 has a large voltage gain, which is needed for increasing the small swing at Q1 collector up to the rail to rail swing needed for the output push-pull pair, that provide only current gain, but no voltage gain.
how does this circuit works I think I understand left side of the circuit. It is a 2 stages amplifier with positive feedback via C2 and R3, but it's still strange to see how Mk1 and R1 are connected. normally, shouldn't the resistor be connected on the top? and also, what does C3 really doing? R7 and C4 are used to limit the noise from the right side of the circuit to the left? isn't C4 too large? Will 10uf more than enough? The right side is very complex. I don't get it at all. it seems like a multivibrator circuit, but it just looks weird. any explanation? <Q> Could this be a clap-switch, you clap and the light toggles ? <S> Mk1 and R1: <S> Indeed microphone to ground and R1 to supply is more usual but that does not mean this does not work. <S> For the microphone it does not matter, it just needs a biasing voltage, which is has. <S> And it will modulate that biasing current with the incoming audio. <S> C3 looks to me like a low-pass filter in combination with R4 <S> Yes R7 and C4 are supply filtering for the microphone amplifier. <S> 10 uF or 47 uF, it will not make much difference. <S> The right side is indeed somethink "multi" but there are no capacitors inside the circuit itself. <S> C5 and C6 only couple the microphone amplifier to this circuit. <S> C5 and C6 are not part of the circuit itself. <S> So it's not multivibrator. <S> It's a flip-flop, it has two states: <S> Q3 conducts and Q4 does not or the reverse <S> : Q4 conducts and Q3 does not. <S> When Q4 conducts the LED lights up. <S> Switching between the two states is done through C5 and C6. <S> If the line to the microphone amplifier is pulled low, the flip-flop changes state. <A> Either Q3 or Q4 will be on. <S> Whichever is on will have a low collector voltage, which will cause the top of C5 or C6 to be low (via the 10k resistors from the collectors). <S> When Q2's collector makes a negative going transition, C5 or C6 will take the base of whichever transistor was on to a negative potential, causing that transistor to turn off and allowing the other to turn on. <S> Once one transistor turns off, the cross coupling resistors (R10 and R11) will keep the other one on. <S> So each time Q2 collector goes low, Q3 and Q4 swap over. <A> It doesn't matter <S> wheter you connect the microphone on the top or the bottom for it to work. <S> However, as it roughly behaves as a "capacitor", you get a low voltage on the signal pin when you connect the resistor as in your circuit, which might come in handy when it is not high pass filtered. <S> However, here it is high pass filtered by C1. <S> Then R4 and C3 form a low pass filter to the signal. <S> The circuit to the right is called a (sequential switching) <S> Bistable Multivibrator. <S> It is basically a circuit that toggles the output whenever a (negative) pulse is seen on the input. <S> You can find some information about bistable multivibrators (flipflops) here . <S> R7 is indeed pretty large. <S> However, for a stable power supply I would keep the capacitor C4 large enough. <S> Especially with a large resistor in the power supply path.
C4 is large but it just depends on what suppression you want at certain low frequencies.
How do i increase the input impedance of an inverting amplifier constructed using an op-amp? I learnt about bootstrapping a non-inverting amplifier to increase its input impedance. Is there any similar way to increase the input impedance of the inverting amplifier? <Q> Buffer then invert (two amplifiers). <S> The first amplifier (a bootstrapped follower) provides high input impedance, the second provides inversion or inverting gain. <S> If you feedback from an inverting amplifier to the input you will lower the input impedance. <S> In the extreme, this is what a transimpedance amplifier does- <S> the input is a virtual ground, so <S> (ideally) 0\$\Omega\$ input impedance. <S> but chances are that would not work too well <S> (it would have poor performance or oscillate) because of the multiple stages. <S> This kind of thing is done sometimes to actively drive shields (guards) to the common mode voltage on differential-input amplifiers. <A> You need to think about how the inverting amplifier operates in order to understand whether this is possible. <S> When the feedback loop is closed, the voltage at the inverting input is equal to that at the non-inverting input. <S> That means that you can consider the inverting-input node to be a zero-impedance point. <S> In addition to the above, the reason that you are able to bootstrap the non-inverting amplifier is that the amplifier output is in phase with the input. <S> Take the above information and figure out for yourself whether it is possible to use bootstrap techniques to increase the input impedance of an inverting amplifier. <A> It depends on the topology of the amplifier. <S> For a BJT inverting amplifier, adding a resistor at the emitter creates negative feedback on Vbe (reducing the gain, as expected with negative feedback) but the impedance seen into the base is multiplied by the beta of the transistor. <S> I.e. you put 1mA into the base, which causes beta * 1mA to flow through the emitter resistor, raising the voltage at the emitter as if you where injecting 1mA into a resistor of R = <S> beta <S> * Re: simulate this circuit – <S> Schematic created using CircuitLab <S> UPDATE : <S> Sorry, I just noticed in the title that you where referring to Op-Amp amplifiers. <S> At least this might help understanding feedback in general anyway.
You could also try to bootstrap some analog of the input voltage from the output of the inverting amplifier (invert it again, and reverse the gain)
How to safely discharge a lead-acid battery? How can I safely discharge a large lead-acid battery, like a car battery or UPS battery? I assume I use a thick copper cord (I have that in the form of washing machine electrical supply lines, about a 1/4" thick) and then put a resistor in line. The problems I see with this approach: How do I size the resistor so I am assured I am not discharging too fast and risking an explosion? My experience is that large resistors are sick-o expensive. How can I get an appropriate resistor without spending a lot of money? Can I use graphite rod? (I can potentially get those cheaply) If so, how do I size the rod correctly? How do I know when the battery is fully 100% discharged and completely safe? <Q> Hook it up to a 60W headlamp bulb, that will take 5A. Car batteries usually have a capacity of around 45 to 60 AHr, if you assume the battery is fully charged and in good condition then it should take around 10 hours to discharge it. <S> I think that answers your question. <A> What do you plan on doing with the battery? <S> If you completely discharge it, it will modify the electrodes and you will have to recondition it to get it back up and running. <S> If you really want to discharge it fully, get a large resistor. <S> Did you know a light bulb makes a great resistor? <S> You can use any material just as long as it will conduct reasonably and it won't heat up too much. <S> Or use a light bulb. <S> 40W lightbulb/ 12V <S> = 3A <A> It appears that you have some erroneous, preconceived ideas about discharging a battery. <S> Specifically, if you want to fully discharge a typical car battery (12V, 60 A hr), all you need is a 20 ohm, 10 W resistor (or equivalent), and connect it across the battery terminals. <S> Leave <S> it connected for about 4 days, and with a voltmeter verify that the voltage is zero. <S> Since the current is only (12/20 =) 0.6A, no "heavy" wire is needed to connect the resistor. <S> Since the power being discharged is only (12 x .6 <S> =) 7.2W, a 10W resistor should handle it with no problem. <S> Since it is drawing .6A <S> , it should take ( <S> 60/.6 =) 100 hours to discharge the battery. <S> The mentioned resistor should not cost more than $5 dollars. <S> Good luck! <A> The more bulbs in parallel, the faster the drain. <A> beware. <S> This solution is partially hazardous. <S> Do not breathe any developing gasses. <S> If unsure, resort to the other suggested solutions. <S> Take a plastic bucket, fill with water, put two pieces of scrap metal <S> (aluminium will do good) in it, wire them to the poles of the battery while taking care they do not touch each other .Iron <S> is ok, but the residue is a dirty mess. <S> Don't use copper as the outcome is toxic. <S> Then start pouring in some salt slowly until you have a sufficient reaction (gas production, but no excessive heat up). <S> Don't breathe this! <S> This is a cheap and high performance load with integrated cooling device. <S> This will stop working once a certain voltage depending on the scrap metal pieces used is reached. <S> After checking the voltage you can carefully connect the metal pieces under water. <S> Wear goggles when doing this. <S> Last hint <S> : do this outdoors only or you will blow up your house with the generated hydrogen.
But you should not fully discharge a lead-acid battery and leave it standing, you will permanently damage it. To drain your battery, light-bulbs are (usual) a cheap power resistor (since linearity is not of importance). Don't do this inside a building, near sources of ignition or delicate and expensive equipment.
Little confusion about dc motors So for whatever reason I'm having a little bit of a problem understanding why every dc motor explanation says the current switches after every segment in the armature. I mean the current is going to flow the same way since the power source isn't being reversed right? So when they say it switches after the break between segments is it because the armature is just at a different position in relation to the magnets or is the current really reversing? <Q> Consider a simple DC motor with one winding and two commutator segments. <S> When the armature rotates 180°, each segment contacts the brushes on the opposite side than it did at 0°, so current passes through the coil in the opposite direction. <S> Current in DC motor <S> Practical motors need at least 3 segments (and coils) to ensure startup from any position. <S> Larger motors may have many more commutator segments, but the commutator switching action is the same. <S> In the example below, all the coils on the upper side are getting current in one direction (relative to start and end of each winding), while those on the lower side get it in the opposite direction. <S> Each winding's polarity changes as the positive (or negative) brush goes from the segment connected to the start of the winding to the segment at the end of the winding. <A> There are several separate coils on the armature, each connected to a pair of commutator contacts. <S> As the coil currently receiving power comes in line with the stator poles, the brushes and commutator switch the power to the next coil, so it will be attracted to the stator poles. <S> The current is just switched to another coil, not reversed in the same coil. <A> When the brushes make a short between two segments the current in widning of attached at that segment recirculates - the coil of that segment is short circuited. <S> After the brush leaves that segment, the current begins to flow in the opposite direction as it was before. <S> So in few words: 1. <S> the current in segment flows CW, 2. <S> then the brush makes ashort circuit, the current is recirculating CW 3. <S> the brush leaves the SC, the current begins to flow in CCW direction
Power to the armature coils is reversed because the brushes and commutator act as a reversing switch.
Battery voltage select and ADC measurement (OpAmp + uC) I need to measure battery voltage which supplies my electronics. Vbat supplies buck-boost DC/DC converter then goes to uC and other ICs (3,3V).I want to use 3x2 goldpins in conjunction with OpAmp to select Vbat voltage range: U1 (3,6V Li-Ion) or U2 (7,2 2x Li-Ion) or U3 (12V Pb) which generate 0V to 3,3V on uC ADC input / OpAmp output. That is clear. Now I would like to feedback uC through GPIO some way that I will know which jumper / battery type has been selected (I need to know that in software).I imagine some additional OpAmps connected to R2/R2'/R2'' but I have no idea how to do it. I'll appreciate your help :) simulate this circuit – Schematic created using CircuitLab Edit 1: The device is used to measure water pH and conductivity. It needs temperature feedback for pH and conductivity ICs and communicates through GSM. It will be powered by batteries so it needs to be energy-saving. Most of time it sleeps and every 5 minutes it makes the measurements. GSM is turned on (GSM sleep or DC/DC sleep mode) only for daily report or when measurements are out of range.When it sleeps sub-ICs takes: 1mA (pH) + 0,4mA (conductivity) + 1mA (GSM sleep mode) or 1uA (GSM DC/DC power down quiescent current) + ??mA (PT1000 - not yet determined) + ??mA (uC - not yet determined but low). Battery's voltage ADC measurement is need to calculate battery percentage of capacity and time-to-live (based on past statistics), additionaly raw voltage display.For above I need OpAmp or voltage divider. Selecting battery type (input voltage) is mandatory to make calculations more detail. I dont want to do software computing and if-else to figure out if battery is 12V or 3.6V, because it is possible to plugin any battery combination which summed voltage is from 3V to 15V. Of course it is easy to determine from one voltage divider the battery type: 3.2-4.2V for one-pack Li-Ion, 6.4-8.4V for two-pack, and 10.8-12.6V.Just thinking out loud :) Getting back to merritum: I need to choose between OpAmp and voltage divider based on energy-saving. Voltage divider (mega ohms) will consume uA the same for OpAmp's quiescent current in shutdown mode.Im puzzled because at first I thought OpAmp will be more energy-saving.Whant do you think guys and gals? :) Edit 2: Accuracy and resolution. The ADC is from STM32F091 and it is 12bit so cutting off the noise lets assume it is 10bit.The worst case is Li-Ion battery which voltage ranges from 3.4V to 3.7V. That give 300mV delta. To represent the percentage I need 0,5% step so the resolution is 1.5mV per step. That is when using dedicated voltage divider. When using single voltage divider for all batteries types:The maximum battery voltage might be about 13V (for lead) so I need to scale it to 3.3V => div = 4. When using single Li-Ion I will get with this divider values from 925mV to 850mV so delta is 75mV. The needed resolution is 75mV/200 = 0.375mV. Step for 0V-3.3V 10bit is 3.2mV so 10 times too small. Even if I use all 12bit the step is too small - 0.8mV. I think I need dedicated voltage divider for battery type or again OpAmp?Whichever would be more energy-saving?? <Q> Since the jumpers have to be set manually, a simple solution might be to use a second jumper that indicates the selected gain to the microcontroller. <S> So the user have to set two jumpers to identical positions. <S> Or just use a rotary switch with two poles and three positions (e.g.: SS-10-23NPE ). <S> A completely different approach would be to implement a autoranging function, where the microcontroller selects the gain factor automatically. <S> Now it is possible to auto gain the input signal: <S> start with the lowest gain factor and work your way up just one step before saturation of the ADC input would occur. <S> If neccessary protect the ADC input from overvoltage: just add a clamping zehner or TVS diode (important: low leakage current!) <S> to the output of the amplifier. <A> Peak voltage to measure might be 13V and if you have a 10 bit ADC then you can arrange this, with a suitable resistor divider, to give ~13 mV per bit. <S> How much accuracy are you going to require when measuring the voltage - is not 13 mV enough? <S> Anyway, this is the simplest way of doing it <S> and you don't need to worry about what link you have selected. <A> Replace your mcu with a STM32F2 or F3 devices with builtin opamps. <S> Some are pin compatible and have internal PGA, you can remove most or all of the external Opamp and associated circuitryfrom the design. <S> ST have an appnotes where oversampling and noise yield an EXTRA two bits (i.e. effective 14 bits accuracy). <S> http://www.st.com/web/en/resource/technical/document/application_note/CD00211314.pdf <S> http://www.st.com/web/en/resource/technical/document/application_note/CD00004444.pdf <S> I've tested this and it works, especially in low impedance DC measurement. <S> The F373 device has 16 bit ADCs as well, but this would really be an overkill. <S> Also you may replace your opamp with a PGA MCP6S21/2/6/8 or MCP6S91/2/3. <S> You accuracy, calibration, testing ,PCB and manufacture will all be simpler and cost less. <S> Power consumption is minimal as you can clock the whole device at a very low speed (32KHz). <S> I would also put the whole device to sleep, or perhaps switch off the analog for long periods between measurements, depending on what else you need to do. <S> Conserving power this way is a challenge with external opamps. <S> For one-offs the Nucleo boards cost < $10 <S> , Discovery slightly more.
Just use a small analog switch that will be controlled by the microcontroller.
What is the difference in meaning of a voltage signal and current signal? This might sound like a crazy bad question. But I'm wondering even though current and voltage inevitability co-exist, why do we use the term for one concept(current or voltage)? If there is a signal out there somewhere, it is both current and voltage at the same time. But we name only one of its property. Is that about knowing one of them well? I mean lets say we have an amplifier and if we only set the amplifier with a "known voltage gain" we call it voltage amplifier and if we set it with a "known current gain" we call it current amplifier? Or is that because the nature of the input signal? Could you give an input signal example and explain why it is called a voltage or current signal? EDIT: My confusion didn't settle. Lets say we have a single stage amplifier. And it has an input and output. So when you look at such circuit and its input and output, what makes you to conclude it is amplifying a current input signal or a voltage input signal? What is the method to name the type of the input signal? Imagine it is increasing both. I still don't understand how to distinguish. EDIT2: imagine a typical common emitter stable biased single npn bjt transistor amplifier. such as: http://www.electronics-tutorials.ws/amplifier/amplifier9.gif?81223b . the base voltage in this case is "bias voltage + small signal voltage - emitter voltage". and the input current current is very low. now look at the output. output voltage increased. okay. but wait.. output current also increased and became "beta*Ibase". So now the input current increased and the input voltage also increased.. is this a current or voltage amplifier? and if it is X amplifier does that mean the input signal is X signal. (X is current or voltage) <Q> Consider a normal digital logic signal running between two CMOS chips on the same board. <S> That's a voltage signal. <S> Only the voltage is specified. <S> Not only is the current not specified, but it can vary hugely and isn't known by the designers of the transmitting chip since it depends on the load the receiver presents. <S> If the only receiver in the above example is a CMOS chip, then very little current will flow in steady state. <S> The load is almost purely capacitive, so current will flow in short blips when the logic level is changed. <S> If instead this signal drives a LED and resistor so as to light the LED when high, then the current will be very different from the previous case. <S> It will again be very different if the LED is wired between power and this signal (lit on logic low) instead of ground and this signal (lit on logic high). <S> Sometimes the signal value is encoded in the current, in which case the voltage ends up what it ends up. <S> A common example is the industrial 4-20 mA sensor standard. <S> The data is encoded by allowing from 4 to 20 mA to flow, but the voltage can vary over a range. <S> In fact, this is called the compliance range , with a larger range allowing for more flexible use of the device. <S> In this case, you can't look at the voltage to get the value being transmitted. <A> Picture two things: an electrical source, and a load that connects to the (two pins of) the source. <S> The relation between voltage, current, and the load is fixed by Ohms law: current = voltage / resistance. <S> Consequently, when the load is unknown, the source can choose between 'fixing' (setting, determining) <S> the voltage <S> OR fixing the current, but not both. <S> Hence when we want the source to convey information, it can do so either by its output voltage, OR by its output current. <S> And that is how we name the source. <A> Basically, a voltage signal can have any load across it and it will still output approximately the same voltage. <S> Conversely, a current signal regardless of load will give approximately the same current. <S> An example of a voltage signal would be a bench-top power supply. <S> You set it to a voltage and it tries to output as much current as necessary to maintain that voltage. <S> An example of a current signal would be something like an inductor with a collapsing magnetic field. <S> It results in a temporary pseudo constant current. <S> If you put a high resistance load across it, you'll get a very high voltage. <S> No signal is truly a voltage or current signal entirely. <S> We simply name them that way because certain signals are closer to an ideal current or ideal voltage source. <S> EDIT: <S> You'll know based on the input of the amplifier. <S> If the input is high impedance (a gate of a mosfet), then you're likely amplifying a voltage because a large current isn't meant to pass through a high impedance. <S> If the amplifier is setup with a low impedance input, then you're amplifying a current . <S> An example of this would be something like a current mirror/multiplier. <S> In this case, the input is the drain of mosfets or collector of bjts which is low impedance. <S> Something to note is that most amplifiers amplify voltage <S> so if you want to measure a current and amplify that, it's sometimes converted to a voltage through a resistor (or other means) and then amplified through an op-amp. <A> A signal is a means of communication. <S> You decide how you're going to communicate, and then you communicate using that method - whether it's by changing current, changing voltage, changing impedance, two tin cans and a bit of wet string, or whatever. <S> One end talks, and one end listens. <S> In order to communicate with voltage, you put enough current into the load to get the voltage you need. <S> In order to communicate with current, you put enough voltage into the load to get the current you need. <S> In order to communicate with impedance, your listener applies a voltage and looks at the current, or vice versa. <S> Why you would choose a particular signalling method is a matter of engineering judgement, looking at the benefits and disadvantages of each.
For a signal, generally one of voltage or current is what is being controlled, and the other is a bi-product that is dependent on the load.
What PWM frequency would give higher torque or RPM for a Brushless DC Motor We use brushless DC motors (three phase, star wound, 540 size)in RC car applications, these are controlled by electronic speed controllers (ESC's) which will obviously vary the voltage etc supplied to the motors. They use hall effect sensors on the phases.We can vary the motors timing on both the motor itself as well as in software in the ESC, we use a combination to acheive the desired power characteristics depending on track size, grip level etc.We can also set the 'drive frequency' which I believe is the PWM frequency.The available settings are 1KHz, 2KHz, 4KHz, 8KHz and 16KHz.Of those available settings, which should give more torque and which one should give higher rpm (if that's even correct) I understand that the answer is never quite that simple, but this is the only setting I don't properly understand..The following page gives info on the motors I use, there is a chart at the bottom and I'm interested in settings for the 4.5turn and 13.5 turn motors http://www.gforce-hobby.jp/products-en/G0005.html <Q> so there is no frequency. <S> At lower PWM ratios the frequency has an effect on motor efficiency and throttle linearity - the lower the frequency <S> the worse it gets. <S> PWM controls motor speed by switching the power on and off rapidly with a varying ratio, so the motor is getting getting a series of full power pulses. <S> At low PWM frequency this causes extra loss due to vibration and current surges, but the increased rms current and voltage at mid throttle causes the motor to produce more torque and rpm than it would with the equivalent DC voltage. <S> So you might think that it's more powerful, but that's only because the throttle response is non-linear. <S> In reality more power is lost due to the higher rms current heating up the windings more, and the vibration wasting energy in the gears etc. <S> On the down side, higher PWM frequency causes higher loss in the controller. <S> So you should choose a frequency high enough to make the motor run smoothly without making the controller get too hot. <S> Inductance is proportional to number of turns, so the 13.5T motor could get away with a lower PWM frequency than the 4.5T. <S> However if the controller can handle it I would just choose 16KHz for both. <A> The frequency is related to the motor coil inductance and associated resonant frequency, which can be further tuned if you have external caps stabilizing the motors. <S> What you have is essentially a LC tank circuit: <S> https://en.wikipedia.org/wiki/LC_circuit <S> It's not so much having the highest frequency, as matching the right frequency. <S> Speed (RPM) is related to load and applied voltage and calculated by a motors speed constant. <S> Torque is related to power so the more voltage for a higher duty cycle, the more power. <S> With a poorly matched frequency, your efficiency will drop and it will reduce your torque. <S> Also, some apply higher than spec'd voltage with shorter duty cycles to squeeze out excess speed without burning up the motors, but that is an application specific conversation. <S> This link here is a similar article with further details. <S> Calculate DC motor frequency <A> Neither torque or rpm will depend on PWM frequency. <S> Motors with high inductivity can work on lower frequency. <S> From industry: a big induction motor can run at 2kHz, default value for VFD are typicaly 4kHz, synchronous servo motor driver has a typical default frequency of 8kHz, while a very fast dynamic control uses 16kHz frequency. <S> As for your motor you should try to use lowest possible frequency, because the heat loss in ESC is minimal, but I'm afraid that small BLDC just needs the max. <S> PWM frequency, you should try it.
As PWM frequency is increased the motor's winding inductance begins to smooth out current flow, so the motor runs more efficiently due to lower rms current and torque ripple. PWM frequency has no effect on maximum torque and rpm, because at full power the PWM ratio is 100% (full on)
Optocouplers with non-inverting logic Here is the setup: I'm using the Arduino Mega's SPI functionality to send signals to multiple DACs. For digital isolation, I am considering the HCPL-2631 or the ACPL-064L. The problem with these two is that output signal is inverted. One solution is to feed the optocoupler's output signal through a set of inverters. Could I accomplish the same by inversing the input polarity of the optocoupler? Also, are there optocouplers with non-inverting logic that are suitable for digital isolation between an Arduino and a DAC? <Q> First, just do as Spero Pefhany suggested, and drive the input as an active-low device. <S> Second, drive the input as you consider normal, but use a pull-down rather than a pull-up output: simulate this circuit – <S> Schematic created using CircuitLab <S> In this case, a high input turns on the LED, which causes the phototransistor to turn on, pulling the output high. <S> A third approach involves Googling "non inverting optocoupler", and the first return I get links to this app note . <S> Note the circuit on page 4: an isolation circuit for use with SPI. <A> If you connect the LED in the opto from your output drive to Vcc (through a resistor, of course) the signal will not be inverted. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> For minimum power consumption and maximum optocoupler life it's better to have the opto spend more time with the LED de-energized <S> and there may be consequence as to what happens when power is removed from the the driving side, <S> so there are more factors at play than just logic inversion. <A> If you do not want to invert the logic for driving the LED, you have to use an optocoupler with a non-inverting output. <S> High-speed optocouplers have separate amplifiers and digital output logic, so there is no technical reason why they couldn't use buffer logic. <S> And indeed HP did this with the HCPL-2200 , which was cloned by Everlight , Toshiba , and Vishay <S> .Furthermore <S> , Toshiba has has a long list of non-inverting optocouplers: TLP555 / 715 / 2095 / 2105 / 2110 <S> / 2310 / 2355 / 2405 / 2710 / 2955 <S> (5 Mb/s), TLP2345 / 2745 <S> (10 Mb/s). <S> Additionally, (non-optical) digital isolators often are available with both inverting and non-inverting outputs.
Making a non-inverting optocoupler from a phototransistor is easy, and you can do it in several ways.
What is the cause of voltage drop across a resistor? We always assign a voltage drop to a resistor when a current goes through it in a closed circuit. I was wondering if this voltage drop is due to dissipated heat from the resistor or is there another reason? <Q> The heat dissipation and volt drop are related, but I would not describe the dissipation as the cause of the drop. <S> As electrons pass through a resistance, they lose energy as they interact with electrons in the conducting material. <S> As energy is given up to the material, it gains thermal energy so its temperature rises. <S> The moving electrons lose potential energy and hence there is a drop in voltage. <S> This is similar to a gas passing through a narrow pipe, losing pressure and causing heating by friction. <A> You can get a voltage drop across a capacitor and current can be flowing but no power will be dissipated <S> so no, your question.... <S> I was wondering if this voltage drop is due to dissipated heat from the resistor <S> Is incorrect. <S> Power is a by-product (for want of a better word) of current flow and voltage i.e. power = volts x amps = heat dissipation <S> but, this doesn't happen in a "reactive component" such as a capacitor or inductor. <S> Voltage is really hard to explain but can be defined as: - The voltage between two points is equal to the work done per unit of charge against a static electric field to move the charge between two points <S> This isn't an intuitive answer and I struggle with it a lot <S> but hopefully someone other than me will give a really good explanation of what voltage is. <A> The voltage drop times the current is the electrical power being dumped into the resistor. <S> This causes the resistor to heat up, not the other way around. <S> Heating <S> a resistor won't cause current thru it or voltage across it. <S> One way to think about that is <S> it's simply that way by definition of what a resistor is:   V = <S> A <S> * Ω where V is Volts, A Amps, and Ω Ohms. <S> Another way to think about it is that the voltage is the force required to squeeze the current thru the resistor. <S> Higher resistances resist current more, so require a larger force (more voltage) to make the same current pass thru. <S> To use the water analogy, a resistor is like a constriction in a pipe. <S> More flow thru the pipe means more pressure across the constriction. <S> Conversely, more pressure across the constriction means more flow thru it. <A> What is voltage? <S> If we drop right down to basic physics, we find that both Charge and Energy are quantities with a Conservation Law. <S> These Laws hold in both Classical and Quantum physics, in Newtonian and General Relativity. <S> So we can be safe in taking these as having some sort of fundamental existence. <S> Voltage OTOH is not mentioned at all. <S> Voltage only appears as a defined quantity that's handy to work with, as the potential energy of an electrical field. <S> Voltage is defined as the change of energy associated with the movement of a charge (to within a scaling factor and dimension depending on what units we are using for energy and charge and whether it's per charge or absolute). <S> So when we push some charge (a current flowing for some time) through a resistor, see a voltage across it, and see energy released as heat from the resistor <S> , it's not even appropriate to ask whether the heat causes the voltage or vice versa , the voltage is just a definition of what is happening with the charge movement. <S> If we have a conductor through which no energy is associated with the movement of charge, then there is no voltage drop across it (@Andy), and it's called a superconductor. <S> An analogy is height, potential energy for a gravitational field, change of which is the energy associated with moving a mass. <S> A superconductor is like an air table, where the mass can slide sideways without a change of potential energy. <S> Letting it drop against a frictional restraint generates heat in the 'frictor'. <S> The definition of voltage and the gravity analogy works for storage of energy in capacitors, inductors, height and velocity as well, but let's keep it simple for the moment with just finite or zero resistance. <A> I'll just leave it here as an illustration to the other answers: (The image is taken from here . <S> Some attribute it to Eberhard Sengpiel ). <A> You need to see this at an atomic level. <S> Current flows due to the flow of electrons (in the direction opposite to its flow). <S> Now electrons flow due to presence of valence electrons in the valence band. <S> i.e <S> they don't actually flow, but jump from one copper atom valence band to the next. <S> So consider two scenarios A copper wire across a battery(short circuit), and the potential difference across the battery terminals be 10 electrons(not the usual volt notation, simplifying the definition of voltage here). <S> So what happens is, these 10 electrons rush into the copper wire, onto the valence band of first 10 atoms, and push the previous one's to the next 10, this follows til they come out from the other end.(for current flow, <S> the electron that entered is not the one that comes out first). <S> this short produces a large current(10 electrons worth large). <S> add a resistor to the battery and wire, now what happens is that when reaching the resistor, those 10 electrons do not have enough conductive atoms to jump onto. <S> assuming 5 electrons get "trapped" due to lack of conductive electrons. <S> these 5 electrons cause the voltage drop across the resistor. <S> The heat dissipated is due to these trapped electrons jumping and colliding with the walls of the resistor.
The voltage drop is what resistors do when current flows thru them.
What does the value "Z" in the function table for this inverter stand for? I came across a simple hex inverter IC with the truth table having "z" as an output state for a low (L) input.So what does Z stand for here? Does it mean a toggle or partial state? The other variant of this IC which does not use open drain outputs has the usual Function table of an inverter. Function table(usual): Input|output L | H H | L Function table(with open drain): Input|output L | Z H | L The device description is as : "The device contains six independent inverters. These devices perform the Boolean function Y = A. The open-drain outputs require pull up resistors to perform correctly, and can be connected to other open-drain outputs to implement active-low wired-OR or active-high wired-AND functions" <Q> Interestingly, none of the other answers tell you the main purpose of this inverter. <S> They are all correct : this is a high impedance state. <S> And as you quote in the question, this device needs a pull-up resistor to work. <S> So why use a gate that needs an extra component? <S> Because it's a way of sharing signals, of connecting several signals (possibly in different locations) together, to share a common wire. <S> This has various purposes, including communication in both directions on a single wire, as in the I2C bus (which has a second wire for the clock). <S> Or allowing an unknown number of connections to the signal : you can always plug another one in, allowing hotplug connections. <S> Consider what happens if you connect 2 conventional logic signals together : if one drives "H" and the other drives "L", they fight each other, the actual voltage can be indeterminate, the stronger driver usually wins, and it's possible to burn the other one out... not good. <S> But connect 2 of these together (with the required pullup resistor) - if either or both is '0' <S> , the value is '0'. <S> If all outputs are 'Z', the value is 'H'. <S> That's it. <S> It's commonly called a "wired-OR" or sometimes a "wired-AND" configuration - <S> though if all the drivers are inverters as in your case, it's actually a wired-NOR structure. <S> Draw out the truth table to confirm this... <A> It represents a high impedance (Z) output state. <S> The output will (ideally) <S> neither sink nor source current, nor can it act as a voltage source. <A> An "open collector output" is just that - the output is a transistor collector pin. <S> NPN type, more specifically, with the emitter tied to ground. <S> So that collector only has two states: <S> Signal feeding <S> it's base <S> = off, transistor in cutoff, collector = <S> high impedance. <S> Signal feeding it's base = on, transistor saturated, collector = <S> ~Vss or Low. <S> So this is why the datasheet says "H" or "Z" for the other state - in that state, it will be high-impedance (a very high resistance, like 100MΩ) since the transistor is off. " <S> H" because typically, the whole point of open-drain outputs is to "pull up" this state to some logic high voltage. <S> Often, it is a different voltage than Vdd. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> In Brief Z mean " High Impedance State " In Deep, The inverter which you are seeing is tri-state inverter. <S> High - Output Goes to 5V or depends on VccLow <S> -0vHigh Impedance State- Consider as open circuit. <S> For Better understanding consider this image(This is not inverter for understanding <S> i added tri-state buffer which is also in same concept) <S> When Enable=0 it will be in High impedance state. <S> In this state whatever may be the input, the output won't reflect. <S> Because it becomes opened circuit, isolated from the supply. <S> Whenever Enable=1 (some times it will be in active low) <S> that time it will act as normal digital logic <A> Z stands for High impedance. <S> This means that,it's a open circuit. <S> In digital electronics,there are three forms of output and inputs 1.HIGH state 2.LOW state 3>HIGH IMPEDANCE state
Z = high impedance state.
What does "No Pin" mean in IC pinout? Logically i understand that 'No Pin' literally means that there is no physical pin but i would prefer to hear a conformation of this fact by those who has encountered such situation.The thing is should i make a hole in PCB for the pin marked as 'No Pin' or not?In my case it's pin# 5 for PXE30-12S3P3 http://us.tdk-lambda.com/ftp/Specs/pxe.pdf And does it has any drawbacks if i have a hole in PCB under the IC part with "No Pin"? <Q> In general, most companies will use an NC - for Non-connect. <S> But in this case, it looks like it really seems they do mean No Pin. <S> Looking at the data sheet, you see that there are two variants of the part, one that uses that pin 5 (Dual output) and one that doesn't (Single output). <S> Sometimes, you put in pins and remove them when a part mix up will be dangerous or damaging, but with the pinouts on this part, there probably would not be a big flame out. <S> Also, since it is a hybrid package, the reduction of one pin will save one millicent (yes that is a joke) which over a production run of millions of units will save manufacturing costs. <S> There is a little bit of an art to reading a datasheet, so it's not surprising this could be confusing. <S> Although from the table snipped from the datasheet, it's not at all clear why a single output device would have two outputs ... <S> (see pins 6 & 7) <A> I don't believe you need to place a pad for pin #5. <S> That pin is only populated on the device with the dual output. <S> You can find the recommended pad layout for this device on page #56 in the datasheet: http://us.tdk-lambda.com/ftp/appnotes/pxe30-xxSxx_datasheet.pdf <A> It's a through hole component that uses one of TDK-Lambda's 'standard' packages. <S> What I imagine is happening, is that they have other configurations where the 'no pin' is utilized and that they should have stated 'no connect'. <S> For assembly and manufacturing, I would recommend creating the through hole pad for the footprint, holes are generally free. <S> If make the hole and don't use it, no big deal. <S> If you exclude the hole and the pin exists, you have to snip it off before installation...
Not having a pin hole will prevent a dual output device from being loaded in that position. That being said, it can't hurt to place a pad regardless. Having a "No Pin" option allows the board to be designed to minimize part mix-ups during manufacturing, this is important since these packages look very similar and could easily be mixed up.
Is cache memory unnecessary in microcontrollers? Do we use cache memory in microcontrollers, if not, why not? If yes, what is its application in embedded systems or it is enough just to have RAM? <Q> Cache memory adds a level of latency unpredictability that may be unwanted. <S> A lot (most?) of microcontrollers are used in a realtime setting where you have to budget for worst-case timing. <S> It does not matter if your code is fast on average , if there is a chance that it won't meet the deadline in worst case . <S> Worst case would be that your code or data is not in the cache, and since you have to budget for it anyway, the cache just adds extra cost and complexity. <S> Some microcontrollers I have worked with has a small embedded SRAM that can be used as a "manual cache". <S> You put stuff there that must have a low latency, be it code or data. <S> Now, the term "microcontroller" is becoming more and more bloated. <S> Is the 8-core ARM processor in your phone a microcontroller? <S> If so, then yes, of course it should have a cache. <A> Above a certain speed, fast memory costs more per byte than slow memory (below that speed, making memory slower won't make it any cheaper). <S> If a system has a large amount of memory, having most of it be slow but then including a cache of fast memory and the logic to run it will be cheaper than making all of the memory fast. <S> If the system doesn't run very fast, however, memory which can keep up with the system won't cost more than slower memory, so there's no reason not to have <S> all the memory be fast enough to keep up with the system. <S> Many microcontrollers have a flash interface which can fetch multiple bytes at once into a buffer; while this might be viewed as a sort of cache, in many cases it won't be an addressable memory, since each bit of the buffer will only be able to take data from a single source [a bit line from the flash array]. <A> Having a level 1 cache is a trade-off between speed and cost. <S> For speed, the bigger you make memory, the the longer the path to the data gets. <S> That means that it'll take longer and longer (in terms of latency) the more memory you add. <S> At some point performance degrades due this latency, which is the point when adding a level 1 cache makes sense. <S> Cost is also a consideration, in that high-speed memory is more expensive than other types of memory. <S> Finally, an additional benefit is that caches can make the micro-controller oblivious to the kind of memory it is read from. <S> Micro-controllers have typically had small memories, and therefore they often have no level 1 cache. <S> In a sense their whole memory could be considered a level 1 cache! <S> However, many micro-controllers today are very capable and start crossing over into the micro-processor territory, with bigger memories and therefore also level-1 (and level-2) caches. <S> Having caches adds a rather significant toll on the programming side, since real-time behavior on cache-misses can be hard to predict. <S> Sometimes, this doesn't matter and/or can be worked around, but in the cases where it does there are a few options: <S> Use smaller micro controllers for specific sub-tasks in a larger system. <S> Use a chip that has embedded physical real-time units. <S> The first solution is quite attractive, as micro-controllers are cheap and capable. <S> However, communication between the controllers and the main (CPU) unit could become an issue. <S> This is why chips with embedded real-time capabilities can be a better solution. <S> As with all engineering, there are pros and cons for every solution. <S> Pick the right tool for the job!
If the system is fast but doesn't have much memory, the cost savings from making the bulk of the memory slow won't be sufficient to justify the cost of adding a cache.
Why are crystal oscillators used in clocks instead of RLC circuits? The timing of quartz clocks is regulated by a crystal oscillator . This crystal oscillator effectively forms an RLC circuit. If this is so, what properties does a crystal oscillator have that makes it advantageous over an RLC circuit? <Q> Crystal oscillators are much more accurate, they are small, have low temperature coefficients and low drift at a low cost. <A> A quartz crystal is a mechanical resonator with particularly stable properties. <S> Quartz is a very stable material -- <S> it doesn't 'age', or change much with temperature. <S> It is also possible to prepare quartz to be very pure and have consistent properties. <S> Quartz is also slightly piezoelectric -- an electric field causes a deflection, and a deflection generates an electric charge. <S> When cut correctly (with a specific orientation w.r.t the crystal axes) and mounted correctly, the mechanical properties (basically stiffness) are independent of temperature. <S> Contacts on the crystal mean that a mechanical vibration generates electrical charge, and when configured correctly (with an amplifier), the whole system can be made resonate at a stable frequency. <S> Electrically this can be modeled as a RLC network with similar properties. <S> The RLC values may be surprising -- typically fractions of a fF of capacitance and many henries of inductance. <A> While a quartz crystal can be modeled as an RLC circuit, that's not what it actually is. <A> The reason is accuracy. <S> For capacitors 2% is considered a very good tolerance. <S> I'm not sure about inductors <S> but I expect it's similar. <S> Resistors are better than capacitors or inductors but you can't build an oscilator with resistors alone. <S> To put these numbers in perspective: 1% is equivalent to 36 seconds per hour or 14 minutes and 24 seconds per day, which would be totally unacceptable accuracy for a clock. <A> From my experience, a crystal is added instead of replacing the RLC components of an oscillator. <S> The reason it is "added," is to give and maintain a given frequency more accurately than using the RLC components alone. <S> The reason a crystal provides more accuracy, is that it can be manufactured to "tighter" tolerances than the RLC components and its high Q electrical property.
The cut & dimensions of the crystal cause it to be resonant at a particular frequency and this can be much more accurately determined than a circuit made of discrete R's, L's & C's.
How to reduce tape hiss while recording a cassette tape with digital data as source I bought a few Maxell cassette tapes, a portable Sony cassette tapes recorder (with the possibility to record also from an external microphone: in my case, a jack connected to the PC) and - as already said - I have a male-to-male jack to connect the recorder to the line out of the PC. I tried to record something (a few FLACs on Audacity) after having set the volume loud enough but not so much that it would make the recording sound distorded and, while it seems that the audio is correctly recorded, I can hear a lot of tape hiss. By a lot, I mean quite a lot more than the one I can hear in old tapes I have at home. Are there any tricks (in Audacity or not) to reduce it? Thank you very much! <Q> Welcome to the 1970s! <S> First, make sure you've got Dolby noise reduction on, if it's available. <S> It boosts the treble when recording and turns it down on playback reducing the hiss and improving the S/N ratio. <S> If you don't have Dolby your best bet is to simulate it manually by increasing the treble during record, etc. <S> On my JVC tape deck I got good results by recording with Dolby and playback without. <S> Line out to mic in Re-reading <S> your question I suspect that you are feeding line output from your PC to mic input on your cassette recorder. <S> If that's the case then the problem should be easily solved. <S> You have experimented and found that by reducing the signal level from Audacity that you can avoid distortion on the mic input. <S> While this attenuates the signal <S> it leaves the noise from the sound card output unattenuated. <S> This means that your signal to noise ratio has decreased drastically. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Stereo line to mono mic attenuator. <S> We can fix this simply. <S> Send the signal out of the PC sound card at full volume. <S> This will restore the signal to noise ratio. <S> Then attenuate the signal and the noise between the PC and the mic input. <S> I would guess that the PC sound card will put out about 1 V p-p an that the mic input will be about 10 mV p-p. <S> How it works <S> Take the left channel: R1 and R3 form a voltage divider given by the rule <S> , \$output = input <S> \cdot \frac { <S> R3}{R1 + R3} <S> = <S> input <S> \cdot <S> \frac { <S> 100}{10000 + 100} = \frac {input}{100}\$ approx. <S> It's called a 100:1 voltage divider. <S> The right channel works the same. <S> How to make Find some suitable resistors. <S> Exact values isn't as important as the ratios between them. <S> Cost is about 20c. <S> Cut your 3.5 mm patch lead and identify the cores. <S> Connect up the ends of the wires as per the schematic. <S> If you don't have a soldering iron then use a screw terminal strip. <A> Does it record hiss (noise) if you have no signal from the PC or if you disconnect the PC end and short the contacts and record a 0 level? <S> It would be good to see if the PC is adding so much digital noise on that it is getting recorded. <S> Common mode noise due to digital circuitry may not be audible from the PC but may get coupled capacitively or through a ground loop and then amplified in the recording circuit. <S> The quality of consumer recorders has not improved after the 1980's and specifications are pretty loose. <S> You may also want to double check the levels (voltage) and inpedance matching between the PC and the recorder. <S> LINE OUT from the PC may be better suited to a LINE IN on the recorder. <S> If it only has a MIC IN then it may be too sensitive and you may have to atennuate and try and match the impedances. <A> while it seems that the audio is correctly recorded, I can hear a lot of tape hiss. <S> By a lot, I mean quite a lot more than the one I can hear in old tapes I have at home. <S> Pre-recorded music tapes are produced on high quality tape decks. <S> Your tape recorder is a budget consumer model which was only designed to record voice. <S> The main reasons for higher noise are:- <S> The MIC input is set to a low level to suit the low output of a microphone, so internal amplifier noise will be higher relative to the signal than a line input would be. <S> Tape bias is achieved using a permanent magnet. <S> This creates higher background noise than AC bias. <S> However it won't reduce noise produced inside the recorder. <S> To fix this you would have to seriously modify the recorder's internal circuit (eg. <S> bypass the microphone preamp, add a tape bias oscillator). <A> The hiss could be caused by a lot of factors. <S> first of all being a mic input feeded with a line input means that has an high amplification, coupled with a source with different impedance that a regular mic. <S> So as some other poster has noted an attenuator could improve the results. <S> Another factor is that some RF noise could interfere and be added to the recorded signal. <S> Thisrd is that if you are using a cheap cassette recorder could be intrinsecally noiser in record than in play. <S> It's easy to find secondhand cassette decks for separares hi fi at a low price and these have also normally Dolby noise reduction and a variable record level.
Reducing the Line output level with a resistor divider may reduce noise coming from the PC, particularly if you have to reduce the volume level to avoid overloading the recorder. Try attenuating by 100:1 and see how you get on.
Generate Power off of several motors at once So in working on a project, I am considering generating power using several small 12V motors (made for DIY toy cars, very cheap on amazon) or by using one bigger electric scooter motor (24V, 250W, generally expensive). I am wondering if I could generate the same amount of power from a few small motors as I could from the big motor in a similar amount of time? If so, could all of the small motors spin off of the same wheel (might move this to another question later...)? Thanks in advance! <Q> Other things being equal, one 100 watt motor will have better efficiency, lower friction, better everything really, than 10 off 10 watt motors. <S> Exactly the same goes for motors used as generators. <S> This is due to a larger motor having better geometry (tighter air-gap engineering) and better scaling (power handling and losses go up at different powers of the size). <S> One big motor will use fewer mounting screws than a handful of small ones as well. <S> One word of warning, don't use a car alternator if you want an efficient generator. <S> They are used in an application where spare power is 'free', cooling is plentiful, so are built small and cheap, at the cost of lousy efficiency. <A> Large motors/generators are more efficient than smaller ones. <S> These devices are made from large lengths of copper wires. <S> The smaller devices use thinner wires. <S> Thinner wires have more resistance to flow of electric current. <S> Therefore more power is lost as heat if resistance of the wire is high. <S> So it would pay off to use expensive but bigger motor. <S> Though a dc-motor works well as dc-generator, a purpose built generator would be more efficient. <S> There are consideration for required rpm to efficiently get output from the generator. <S> Getting output from a ac-motor would be more difficult. <A> I assume that all your proposed motors large and small are permanent magnet brushed DC .Having <S> them on one shaft is a good idea because then there wont be any complications in combining the outputs .The <S> The small motors need to spin faster so if wear rate is going to be an issue think big .The small motors could be connected in some sort of redundancy scheme which could be relevent in high reliability applications .The <S> faster spinning needs of the small motors <S> Vs <S> the slower rpm of the big motor means gearing ramifications .The <S> speed of your prime mover could influence your final choice.
multiple small motors will be fine .The efficiency of the large motor will be greater but not by a huge amount because really all the motors you are discussing are classified as small.
Why is USB type C connector hollow? If we look, for instance, at a Lightning cable, its connector is shaped like "—", with receptacle being "=". Apparently, this construction contributes to durability, to the ease of use, and lowers production costs. USB C, on the other hand, opted for a connector shaped like "=" and receptacle like "≡". This is more likely to break from pressure and more prone to accumulating dust. What is the reasoning behind this choice? <Q> USB micro-B is known for its high mate/demate cycle specification relative to the other USB connector types. <S> It achieves this by having the sprung contacts in the cable, rather than in the device. <S> This way, only the cable is subject to deformation, and can be replaced if it becomes unreliable. <S> The contacts in the device are fixed and so do not wear or deform as readily. <S> The type C connector is similar to the micro-B, and was presumably designed with the same principle in mind, because it is also rated for 10,000 cycles. <S> To have sprung contacts in the cable without any sort of shroud will mean that they protrude from the body of the connector. <S> The Apple Lightning connector's durability is discussed in US9004960 . <S> I could not find any mention of how many mate/demate cycles it is rated for, apart from "sometimes thousands". <S> This sounds like it might be less than 10,000. <S> It seems to be an established design principle for this sort of application. <A> They likely wanted a contiguous ground shield for the high speed data (most high speed buses do have shielding for alien cross talk). <S> Anything past that would be pure speculation. <A> All sources say "Improved EMI and RFI mitigation features" <S> but I'm sure it's the same reason every other power connector is shielded... <S> to stop the pins shorting out on metal objects unintentionally.
This could result in their catching on something and bending or breaking off. Note that the mini-DisplayPort connector (used for Intel's Thunderbolt in past iterations, now to be superseded by the USB type C connector) is designed along the same lines as USB type C.
Multiplexer with 5v select and 9v or more routing I need to route a 9v signal using a 5v or 3.3v microcontroller. Does anybody know of a multiplexer that supports this, or a circuit it could put in between the microcontroller and the multiplexer to make this happen. The multiplexers i have tried (TI cd4097b) will only route the signal up to the voltage of the select pins and not higher. <Q> I'm using the ADG1404 for such an application in one of my current designs. <S> When looking at the datasheet can you point out what tells you that a device is capable of that. <S> Knowing what to look for would be really helpful when picking the components i need for this project. <S> In the case of the 1404 it's in the headline features <S> Fully specified at +12 V, ±15 V, and ±5 V <S> No VL supply required <S> 3 V logic-compatible inputs <S> In my experiance at least with Analog Devices most of their parts with digital control inputs (switches, muxes, instrumentation amps, digipots etc) tend to have logic inputs with thresholds that make sense for modern logic even while the analog ranges are much wider. <S> It is also common to have seperate ground and negative supply pins to allow the logic to be referenced to ground while the analog signals passing through are bipolar. <S> The 4000 series is extremely old <S> so it's not so surprising that it doesn't have modern conviniances. <A> Use level shifters between your micro and the ABCD select pins. <S> You could use an open-collector transistor with pull-up resistor or a Darlington driver chip such as ULN2803A . <A> That's a good question. <S> I did a quick search, but my intuition tells me most (if not all) ICs are going to need to be supplied (at the VCC pin) with 9V in order to pass through a 9V signal . <S> In other words , the voltage that the IC can pass through shouldn't depend on the voltage of the select pins, but the supply voltage of the IC of the IC. <S> If your system can supply 9V to power the chip, then great. <S> After that, you'll need to boost your input signals or use a level shifter (3.3V or 5V -- <S> > 9V) to drive the inputs. <S> It's possible that some chips might be able to accept those low voltages as valid input signals. <S> You'll be able to find this information in a datasheet under the Electrical Specifications Electrical Specifications section. <S> You will be looking for the V(IH) rating. <S> V(IH) will give the lowest voltage that the chip will detect as a "HIGH" signal on the inputs.
Analog devices make some parts that can switch larger signal ranges than the logic levels of their control signals.
On/Off Circuit for my USB LED Its my very first question here and I am very new to circuits. I have an LED with USB connect port that turns On when connected to my PC. I want to make a circuit and turn it On/Off using some programming language like C#. I am a C# developer and want to use my skills with electronic hardware. I'll really appreciate your response and guidance on this. I am a beginner so need to understand from basic level that how I can achieve my goal. <Q> Welcome to EE.SE, <S> Ideally this question would include more research on your end. <S> A question going "I have this, I want this, help me" is usually considered much too broad and as such closed, since it sounds like "I have this issue, design my solution for me" and our time is usually quite expensive. <S> So that annoys us. <S> That said, your problem may be solvable purely in software, trying to get the PC to disable the USB port through calls to the over-current controller that can individually switch on and off ports when they use too much current. <S> That would be a non-EE solution that may be dependent on the exact motherboard. <S> It is definitely solvable by adding a chip and a transistor between your USB lamp and PC. <S> Start with looking at an FTDI FT232 chip, it creates a USB COM Port and you can use its D2XX drivers to directly control the hand-shaking pins on that port. <S> There is also another chip they make that creates an 8 bit parallel set of lines on a virtual COM Port that you can use to control 8 signals simultaneously. <S> All you need to do from there is: <S> simulate this circuit – <S> Schematic created using CircuitLab <S> The rest, is down to the research that you'll have to do yourself in place of what you'd normally have to do beforehand. <A> This is a question for https://stackoverflow.com/ . <S> You need to find out how to get the USB driver to turn off the power to the USB socket. <S> A quick look on stackoverflow gives different opinions. <S> If you cannot do it in software then you may have to build a circuit as suggested by @Asmyldof. <A> There are many ways to solve your problem. <S> Following are some suggested steps Obtain a USB to UART converter board or cable. <S> Obtain a simple micro controller board like a Tiva Launch Pad , Arduino or a PIC <S> Write your command from PC to the USB COM port <S> Access your command via the UART Serial Port from your micro Controller <S> Decode your command and switch on and off the LED on the TIVA <S> launch Pad USB to Serial Cable <S> References: <S> Embedded Systems - Shape <S> The World Arduino Serial Communication Olimex LTD USB-SERIAL-CABLE-F USB to TTL Serial Cable
Some say that it's not possible, some say it depends on the motherboard.
Circuit for solar panel I have done with a solar panel powered mobile charger. This is how it is now Solar Panel(5W,8V(max),0.59A(max)) -> 7806(5.4V normally) -> Female USB -> Mobile Since 78XX just reduces the voltage,takes so much time for my mobile to get charged, because of low current. Is there a way, something like Buck converter that would practically work for this case? Any reference would be helpful. <Q> With this circuit you think you will feed the USB with a max of 0.59A or 0.59 <S> *5.4W = just over 3 watts. <S> In fact you probably don't get that much since 7806 should regulate at 6V, so it is probably only being fed 6-7 volts and <S> not 8V. 8V is the highest voltage you will see from the cell and only with no load in bright sunlight. <S> Likewise the 0.59A rating is only achieved at zero volts, i.e. into a short circuit. <S> This is the way these panels are specified. <S> There is a published curve available from the manufacturer that plots Vols and current vs incident light. <S> The maximum voltage or current is only achieved at maximum incident light on the panel in noonday sun and at a voltage less than the maximum. <S> Check with a voltmeter and ammeter to see what is actually happening. <S> Additionally, the 7806 is dropping whatever the difference is between the output of the solar panel and 5.4V as heat. <S> You are likely overheating it and it will drop the current supply to avoid being destroyed. <S> if 7806 gets hot, try fitting a heatsink. <S> You can also try a small switching power supply from eBay, DX etc. <S> This is a ready made buck converter. <S> They are reasonably priced and will give 2-5 amps. <S> They are also much more efficient in this type of application, providing approx. <S> watts out = <S> approx 0.9 <S> * watts in provided they are operated within their specifications. <S> In this situation, a small car charger that fits into a cigarette lighter may work 6-8V you get <S> is probably not sufficient. <S> Use two panels in series <A> But to get the most energy possible, you would need a MPPT-Controller (Maximum Power Point Tracking). <A> We have linear regulators and Non-linear ones. <S> Linear Regulators like 78xx reduce voltage by converting excess voltage to heat, so they have very low efficiency at most 15% . <S> In other hand there are Non-Linear regulators or switching regulators like LM2575 series . <S> These regulators change voltage by switching techniques and have efficiency of at least 80% in most cases. <S> Then using a switching regulator when its pureness of harmonics is out of considerations, will improve your efficiency and deliver more power to you to charging your external device in this case.
Yes, a Buck converter could bring some improvements.
Elegant naming convention for pins with (many) multiple functions in gEDA I use gEDA suite for schematics and PCB layout and I sometimes need to create new components (i.e. symbols ) for gEDA library is rather generic. Not a problem to me. But with the advent of micro-controllers it's not uncommon to have pins with many alternate functions. In general pins are named against their functions, for instance SDA or SCL , RESET , Vcc , Vdd , you name it. But what do you do with pin names such as PC1 (PCINT13/ADC10/ICP1/SCLUSCK/XCK1) on the ATtiny1634? Not only do I find such names ugly and impractical but they also tend to inflate the symbol, turning it into a fat block instead of an elegant rectangle... (Golden Ratio anyone?) Moreover extremely long pin names also clutter the PCB layout: Now I want the symbol to carry all the alternate functions but hidden, preferably. Ideally in gEDA the pin name would look like pinlabel=PC1 . But how do you add the rest? I could only think of adding [hidden or not] pinlabel attributes. pinlabel This attribute labels a pin object. This attribute is primarily used by gnetlist to support hierarchical designs. This attribute must be attached to the pin and be left visible. Please make this attribute green (instead of the default attribute yellow). But gEDA documentation isn't clear; my question is: does it allow for multiple pinlabel occurrences ? <Q> As many stressed on that, hiding information (i.e. pin functions) is not advisable. <S> So far, so good, that was not the intent. <S> The goal is twofold: make pin names somewhat "shorter" while keeping the necessary datasheet information about pin features <S> prevent pin names from cluttering the PCB layout... <S> whenever one needs to check the correct wiring of a newly created symbol/footprint. <S> I still don't know if gEDA supports multiple pin labels <S> but I found out using comments <S> would just fit my requirements: <S> set pinlabel to the port name <S> only add a comment attribute to the pin with all the alternate functions of the pin. <S> Split port name and alternate features in pin label and comment: <S> Align pin label and comment vertically: <S> The space gain is not huge (though at least 6 characters across) <S> but the following does the trick: <S> all pin information is kept visible pin label is kept short for less PCB clutter with smart pin placement, the symbol can be shrunk. <S> PCB layout shows pin labels with port names only for less clutter, <S> more clarity: <S> Symbol went physical, lost weight: <S> Here's how the comment appears in the symbol definition file: <S> P 100 1900 400 1900 1 0 0{ T 450 1800 5 8 0 1 0 0 1 pintype=io T <S> 455 1895 9 8 1 1 0 0 1 pinlabel= <S> PC1 T <S> 305 1945 5 8 1 1 0 6 1 <S> pinnumber=16 <S> T 150 1750 5 8 0 1 0 <S> 0 1 <S> pinseq=14 <S> T 450 1775 9 8 1 1 0 0 1 comment= <S> PCINT13 <S> /ADC10/ICP1/SCL/USCK/XCK1} <S> You can later toggle between showing pin names or numbers in PCB for further checking the pin label/number assignment with D and/or N . <A> While I am not aware of any real and direct rules about this I tend to use the scheme of Naming the Port and Pin, such as you do. <S> Then, if they have alternate functionality that is interesting, such as SPI, ICSP, DA, AD, UART, etc I usually add a note that is as short as possible, but still gives enough detail to quickly find the configurations needed in the datasheet of the two most likely or prevalent ones. <S> For example, the PCINT functionality in an Atmel controller is utterly uninteresting when routing or hooking up in 9 out of 10 models, as all pins have that, and as such it makes no distinction to the design of the schematic. <S> Then if I have one of the very few Atmels with 2 or 3 pins without PCINT, I add that as a label to those pins "NO-PCI" for example, or if the block is large enough just "NO-PCINT". <S> Now, here comes in the fact that I can, in the design programs that I use for myself and customers, attach several properties to pins that need not be visible, but can be used for rule-checking. <S> So I prefer in those packages to add "NO-PCINT" or "PCINT" to a general property and set up a design rule for "Not Allowed: Signal('REAL-TIME-IMPORTANT') <S> WITH (PinType('NO-PCINT') <S> AND PinType('NO-INT')" or some such. <S> //EDIT <S> : <S> Addition: <S> To add, this rule does make it so that one part with one package gets a set of 1 footprint and several symbols. <S> All of " my software solutions" (costing Many-Cash(c) ) allow this to be done elegantly and without overhead. <S> But it does add clarity to the schematics over having to read off a list of a bazillion options. <S> One thing I vigorously hate when developing FW for someone else is having to read through a whole bunch of words to find the intention of a pin, whereas I will need the Datasheet and Port&Pin number anyway to figure out what to configure and how. <S> i.e. The system using a Tiny841 for analogue monitoring would have the ADC labels and most likely PWM labels on the symbol, whereas one controlling all kinds of digital functions would have all SPI and I2C options labelled. <S> There will of course always be exceptions, and probably all of them would show the program pins and the most likely UART pins. <A> The purpose of a schematic is to convey a circuit to the reader, with as much information as possible. <S> Your AtTiny example does that perfectly fine. <S> In fact, the firmware guys will thank you because now they don't have to go to the datasheet to know a pins alternate functions. <S> No one cares if you schematic symbols are "elegant rectangles. <S> " That's not the point of a schematic. <S> You should really hide pin names on PCB layouts. <S> All they do is clutter things up. <S> As a PCB designer, all you really care about at that point are nets. <S> Good EDA tools will have net names shown on traces and pins, scaled appropriately.
The idea I had in mind was to split pin names into separate pin attributes, of which I'd use pinlabel multiple times.
What are the essential properties of a PWM signal that can be captured with an oscilloscope? My question is regarding general guidelines when it comes to using oscilloscope captures in a professional-grade report to be presented to people working with signal processing, embedded systems, etc. Although there are a few obvious ones (i.e. cursors and labels), I was hoping to hear from the community about what kind of information do you think would be the most useful on an oscilloscope screen capture? The focus is on different characteristics of a PWM signal. To narrow down the question - I am looking to put together a small presentation (~ 15-20 slides including pictorial slides and bullet point info) that gives an overview of a PWM module on a specific uC. One of my main assets for facilitating this task is an oscilloscope. The purpose of this question was to ask fellow users for an advice regarding possible properties of a PWM signal that may be of interest to a professional embedded systems engineer evaluating a new board. <Q> You're thinking about this entirely backwards. <S> Think about what DATA you need to show to make the report, and THEN think about what you need to do to make the scope show that. <S> If the scope can't show it adequately, then export the data, bring it in to your own presentation package, and make your own graphics for the report. <A> An ideal PWM signal will have the following characteriestics, high time, low time, high voltage, low voltage. <S> If you have time and voltage markers to give these in numbers, then so much the better. <S> These can be illustrated using a cycle or two per screen. <S> A non-ideal PWM signal will further have limited or unequal slew rate on rising and falling edges, overshoot after rising and falling edges and ripple and droop on high and low regions. <S> These may need the voltage and time scales increasing to highlight just these parts of the waveform. <A> A 'professional' screen capture will show enough signal information so you could reconstruct the signal if necessary. <S> That includes time and amplitude. <S> Since older scopes have lower resolution, you may need to put less signals in one capture. <S> Newer scopes have many of measurements and you can clutter the capture with unnecessary information. <S> Capturing more than three or four periods of the signal is redundant. <S> If there is an error in the signal you will want to turn on the appropriate filtering to capture that. <S> If there is frequency content, include the FFT on a separate capture.
Your scope trace graticule needs to be annotated with at least seconds/div and volts/div.
How to increase number of micro-controller inputs? I have relatively little experience with electronics, but do have a basic understanding. I am attempting to build a measuring device, which will measure 100 points in 0.1 seconds. These will all produce a digital number which will need to be stored on a micro controller. If I were to use the raspberry pi model b, it only has 17 input GPIO pins. My question is that is there a relatively simple way of taking more inputs than the micro controller has pins? Currently the way I am looking at doing it is having an output which sends a number to choose which input to read, that sensor would then send its current value back to the micro controller. The disadvantage of this method is obviously that it takes up time. I want 100 inputs in the order of 10^-3 seconds and I assume that this has to be a fairly common feature of circuit design given most systems have a large numbers of sensors. So, is there an easy way of doing it? Is the way I have detailed above at all sensible? Is this a common problem, if so how is it normally overcome? <Q> If you want a large number of sensors to record simultaneuosly, then one way is to have sensors that can be strobed, record their own value internally, then be polled by the central controller at leisure later. <S> But that takes some degree of an intelligent sensor. <S> At the other end of the spectrum is a central controller with enough <S> I/O to record them all at once. <S> As you say, you will need very many pins. <S> An intermediate position is some sort of latchable storage, parallel to serial registers for instance, that can latch your sensors, and then be interrogated later by the controller. <S> Easiest to regard this as input width expansion for your controller. <S> How simultaneous is needed? <S> You could use a controller with DMA to execute a very fast poll. <A> The ST Micro VL6180X <S> you have identified as the sensor <S> doesn't work the way you might imagine. <S> First, as Steve G wrote, it only works upto 100mm, which may be a 'show-stopper'. <S> However, even if the maximum sensing distance of 100mm is not a problem, for example the robot is navigating through a tube, with the walls less than 100mm away, there is another issue. <S> The datasheet, "VL6180X Proximity and ambient <S> light sensing (ALS) module" says in 1.1 "Technical specification" on Note 5 "Assumes 10 Hz sampling rate," <S> So it only produces an answer 10 times/second, i.e. a measurement every 0.1 seconds. <S> That may sound fine, but there is more to it. <S> While the product page says "the VL6180X precisely measures the time the light takes to travel to the nearest object and reflect back to the sensor (Time-of-Flight). <S> " It is not measuring one photon, or one brief pulse of light. <S> Light travels at \$3\times10^8\$ metres/second. <S> So to to determine distance to 1mm, it'd have to work at time resolution around \$1mm/3\times10^{11}mm/ <S> second\$ <S> , i.e. \$3.3\times10^{-12}seconds\$. It doesn't work that way. <S> It generates many pulses, at varying times, with varying durations, and does some clever processing on many samples to derive a distance measurement. <S> AFAIK, it generates pulses for much of that 0.1 seconds. <S> Hence the stream of pulses from each active sensor may interfere with other active sensors in its neighbourhood. <S> Worst case, only one sensor can be active at any time, and it needs the entire 0.1 second to measure distance. <S> It's unlikely to be that bad, but it may be that the number of simultaneously active sensors is a small fraction of the 100 hundred total. <S> Summary: <S> the practical sample rate for all 100 sensors might be several seconds. <A> There are many ways in which this particular problem could be handled. <S> Since you are asking for "near-instantaneous" sampling of all 100 inputs, how about something like this: 1 main microcontroller <--> serial bus <-- <S> > <S> Raspberry Pi Qty 10 of 26-pin sub-microcontrollers --> 10-bit data bus --> main micro <S> Most microcontrollers have "interrupt" pins. <S> Clock them all from one clock source for best accuracy. <S> Then it's just a matter of having each of the ten send their data on the 10-bit bus to the main micro. <S> Can be done with timing, individual select pins, etc. <S> Once the main micro has all of the data, send this to the Rpi over serial. <A> If its inputs and timing you need go with an FPGA, some devices have 500 inputs. <S> The nice thing about an FPGA is you can build timers for each input, keep in mind there would be a big learning curve but a fun one if your up for it. <S> Would you rather spend time buying break out boards and wiring? <S> Or learning a new toolchain? <S> It's up to you. <S> https://www.arrow.com/en/research-and-events/articles/top-ten-dev-boards-of-2016
A faster way would be to use a beagle bone or other dev board. So if your 10 sub-micros are all programmed to "read" 10 inputs the moment an interrupt pin toggles, then wiring that interrupt line to each of the ten and toggling it will sample 100 inputs simultaneously.
Should I continue with daisy chaining? I've been daisy chaining power strips and it was no issue until my friend told me it's dangerous. I was using 2 monitors, fan, desktop,55inch TV, monitor speakers, and a phone charger. And he told me it could be more dangerous in the future as I will add more stereo speakers and amplifier. However, my dad on the other hand said it is a no issue at all as all my appliances are not demanding in power. Who should I listen to? <Q> Your dad is probably right, but to make sure you should add up the Watt or VA ratings of each device you have. <S> If the total is less than the rating of the wall socket (and power strips) <S> then you should be OK. <S> Some devices may be rated in VA or Watts, while others may only specify Amps. <S> To convert from one to the other use the formula Watts = <S> Volts x Amps, and its inverse Amps = <S> Watts / Volts. <S> Volts is the voltage of your mains (eg. <S> 115V or 230V). <S> If you have some higher power devices and others that are lower power, try to plug the higher power devices into the strip closest to the wall socket. <S> This will reduce voltage drop through the power strips. <S> Some power strips are not very well made and may have loose sockets which get hot at high current. <S> Obviously the fewer plugs and sockets the current has to go through, the less likely this is to be a problem. <A> Assuming the total load is not too much for the outlet in the first place, it would be much better to use a "star" arrangement rather than a "daisy chain" arrangement. <S> By "star" <S> , I mean this: Plug one of the outlet strips into the wall. <S> Then, plug all of the other strips into that first strip. <S> Then plug all of your appliances into those other strips. <S> If there are any outlets left over on the first strip, use them for your heaviest loads. <S> And each appliance draws power through exactly two or three plug connections, rather than possibly many more with the daisy-chain arrangement. <A> In addition to the answer by Bruce Abbott, there's an additional danger if you daisychain too many leads, particularly long ones. <S> If an appliance at the end of the chain shorts out, then the resistance of all the plugs, sockets and wires may mean that the fuse or breaker protecting the whole lot takes too long to trip. <S> By that time, something might have caught fire. <S> If the circuit isn't protected by a GFCI/RCD, then the delay could also lead to you being electrocuted.
The danger is that you could plug in enough devices to overload the wall socket. Only the first strip needs to handle the full power of all the loads together.
Should I have had a resistor before my transistor? I've recently started playing with an Arduino and learning about circuit's. I was trying to learn a bit about using some transistors as a switch and I think in the process I ended up ruining one of the pins on my Arduino. When set to HIGH the pin only outputs 0.5 now rather than the 4.6ish the rest of the pins do. The circuit I built involved two transistors. One to control a 12v fan via a PWM signal off the Arduino and another to act as a switch for turning on/off an ATX power supply which I used to provide power for the fan. Here's an approximation of the circuit. I'm not really sure how to properly diagram it. simulate this circuit – Schematic created using CircuitLab To try and explain a bit, The Arduino was powered via the USB connection to the computer. Pin 11 is setup as a PWM output to control the speed of the fan. Pin 12 is setup as a HIGH output to switch on an external ATX power supply when the Arduino board turns on. I use one of the 12v rails on the power supply to power the fan, and have it's ground connected to the Arduino's ground. Not shown in the diagram is a simply push button to increase the speed of the fan and a 7-segment led display showing a number representing the speed. I don't think these are related to my pin problem and I'm fairly certain it was all wired up correctly. After doing a little more research I think the main issue which caused my pin problems is I should have had a current limiting resistor in between the Arduino pin and the base of the transistor. Is conclusion accurate? Any additional comments/criticisms welcome. <Q> Yes, your conclusion is correct. <S> But first try with a 10 K resistor and then keep on reducing it by 1K. <S> For a more accurate value of the resistor, use this formula: $$ R_{base} \approx {h_{FE}} <S> \times \frac {V_{OH} - 0.7V} {I_{FAN}} <S> $$ <S> Where <S> h FE is the transistor's current gain, I FAN <S> the fan current as measured when connected to the 12VDC source and V OH the microcontroller's output high level voltage. <A> Yes, you should add a current limiting resistor in series with transistor base. <S> You can design that transistor as a switch. <S> Hope you know following parameters. <S> Ic - Required collector <S> current <S> Vcc - Intended <S> Collector Voltage Vin - Input voltage to transistor, ie arduino output voltage <S> Now you can design it as follows. <S> Ib = <S> Ic <S> /ß <S> (You can find ß or hFE from the transistor datasheet) <S> Rb = <S> (Vin – Vbe)/Ib (You can take Vbe as 0.7V ) <S> If you don't know the value of Ic, you can easily calculate it : <S> Ic = <S> (Vcc – Vce)/Rc <S> Try this link for more details : Design Transistor as a Switch <A> i am assuming the "COM" in the ATX power supply is also connected to GND and the system ground. <S> dunno what PS_ON means ("power supply ON") <S> but is it an open circuit meant to be left floating for "OFF" and connected to ground (or COM) for "ON"? <S> in both cases, assuming the emitters are connected to ground, you want some resistance between the digital output and the transistor base. <S> the \$V_{BE}\$ is only about 0.6v or 0.7v and the digital output is around 3 to 5 volts when high. <S> so something needs to drop that voltage. <S> what value of resistance? <S> what is the current gain (\$\beta\$) of the transistor? <S> how much collector current flows when it is "on" (in saturation) given the loads hooked up to them?
Just insert a 1K resistor in series with the base.
Industrializing a PIC micro-controller I want to replace some timers with a PIC16F887 micro-controller. The problem is that the input voltages to the I/Os is going to be 24V which is too much. For the output part I was thinking about using a relay module . I'm stuck on the input part. How can I use the 24V as a input to the micro-controller? The application is simple. When a input pin goes high the output will be enabled after a certain period of time (When 24V is received from the input the output will send 24V in other words). The time will be adjustable trough some push buttons. The times will be displayed on a LCD. This question is tied to a different question I asked from the forum before . A user recommended a similar cheap solution which is already made but I want to build one just for a personnel project . <Q> I don't know why you're using such a ancient PIC in a new project, but there is no reason it shouldn't work. <S> Scaling 24 V signals down to 5 V is as easy as a resistor divider. <S> Something like this should work: <S> The resistors attenuate 24 V to about 5 V. <S> The zener guarantees the voltage into the PIC is within what it can handle because stuff happens. <S> The zener will also clip negative spikes, but to one diode drop, which is right about where the PIC starts misbehaving. <S> If you are really worried about negative spikes, then you can put a Shottky diode across the zener just to clip negative voltages. <S> Or you can break up R2 into two resistors that attenuate a bit after the zener, and use a bit higher voltage zener to compensate. <S> There are lots more things you can do. <S> It depends on how much you want to protect against. <S> More protection will add complexity and cost, but robustness to ever less likely abuse. <S> Only you can decide what the right tradeoff is. <A> if you want to make something like a PLC out of PIC , i would advise you to look at similar designs done for arduino and nucleo. <S> Example 1: Ruggduino http://www.rugged-circuits.com/ruggeduino/ <S> This board has all input pins protected against over voltage up to 24v and current limited using series PTC resistors. <S> And multiple other features , it also open source so you can access the schematic and use it. <S> Example 2: <S> X-NUCLEO-PLC01A1 <S> This solution focus on using ICs especially for isolated interface for controllers , something like CLT01-38S4 and VNI8200XP. <S> take a look at this shield for industrial stm32nucleo board : http://www.st.com/web/catalog/tools/FM116/CL1620/SC1971/PF261969 <A> If the microcontroller is not able to drive the relay, then you may also need a transistor to increase the output current capability to drive it.
You can step down the input voltage of 24V to 5V/3.3V using a resistive divider and unity gain buffer.
Is it good to route PCB tracks under a heatsink? A heat sink is a piece of metal. If the solder mask on a PCB track is broken, it may be dangerous, right? Below is a small heatsink for TO220, seen from bottom. <Q> A heat sink is a piece of metal. <S> If the solder mask on a PCB track is broken, it may be dangerous, right? <S> If in doubt, use an insulating spacer: - For heatsinks like these: - I use small fibre washers like these over the solderable legs: - <A> A heat sink is a piece of metal. <S> While a heat sink is a piece of metal, it will affect the impedances of the traces below it, for ground and power traces, this won't be a problem. <S> But for signal traces the changed impedance may affect the outcome signal quality. <S> Outside the fact that signals are affected, mounting the heatsink directly on the PCB can cause increased wear on the PCB if the heatsink expands and contracts with a different rate than the PCB itself due to heating. <S> This problem can be migrated by using spacers. <A> You should give your heat sink a little spacing from the PCB. <S> In that case it cannot scratch your solder mask. <A> It is okay route PCB tracks under a heatsink. <S> Even if the heatsink is connected to VCC and the route is ground. <S> For 2 reasons: 1, soldering mask are very hard to scratch off.
If it is directly on the PCB I would route the traces on the other side of the PCB or around the footprint of the heatsink. I need to use a very sharp blade to go through the surface 3 times to reveal the copper, a very sharp blade; so it's very unlikely that your heatsink will do any damage to the mask; 2, heatsinks are not supposed to move around, so it is safe even under a ground route.
How to determine low and high threshold levels of a Schmitt Trigger for a known input? Imagine I have a pulse train input which goes into a Schmitt trigger for getting sharpened. Imagine the HIGH of the input pulse train is around 8V and LOW is around zero volt. So what should one select the lower and upper threshold voltages in this case? Does that depend on the desired HIGH output voltage? And what is the logic behind determining these threshold levels? I found this calculator which one needs to decide about the low and high tresholds: http://www.random-science-tools.com/electronics/schmitt-trigger-calculator.htm <Q> It's a judgement call. <S> The first thing you want to do is look at typical input waveforms. <S> The hysteresis offset needs to be at least the size of any temporary inversions in the signal. <S> For example, if the main signal was a 1 kHz ±8 V sine with 20 kHz 1 Vpp sine on top of it, then you would need at least 1 V hysteresis offset to not trigger on the 20 kHz component. <S> The main tradeoff is that wider hysteresis offset gives you more noise immunity, but also increases the chances you wont see a real signal that is a little out of spec. <S> Given no other information, start with the hysteresis levels at 1/3 and 2/3 of the input signal range. <S> You say your input is a "pulse train". <S> If the input is really pulses, then you may not need hysteresis at all. <S> Perhaps all you need is good gain about some convenient center point. <S> Hysteresis is good for two things: Immunity to some noise added to a larger binary signal, and dealing with arbitrarily slow slew rates. <S> "Pulse train" suggests you have neither problem. <A> In other words, a level which you are certain that your input signal will exceed on each pulse. <S> Similarly select a lower threshold above the low level of your signal. <S> The larger the hysteresis the more immune to noise your circuit will be. <S> If this is for a production job, make sure you take account of component tolerances when choosing the threshold levels. <S> You may also need to take into account the affect of timing skeu Note that t2 > t1 due to level difference. <S> Also note that the noise is ignored. <A> There is the simple, cheap, low effort approach to Schmidt trigger clean-up: Just run it into a CD4093 (use two sections if you don't want it inverted) and don't worry about setting the level at all (beyond setting the supply voltage.) <S> The trigger levels are not adjustable and vary with supply voltage. <S> This works often enough and inexpensively enough that it should always be considered, though it may occasionally be discarded in favor of a more complex solution. <S> I default to thinking of the CD4093 as they are the Schmidt trigger logic gate in my standard stock, but any suitable Schmidt trigger logic gate could be subbed.
Select an upper threshold which is below the minimum high level of your signal. The difference between the upper and lower level is the hysteresis.
Can I run a liquid-pump motor below its specified operating voltage range? The liquid-pump/motor is a miniature one from ebay with its operating voltage rated as "6-12V". Even at 6V (the minimum of that specified range), it's pumping liquid too fast for my requirement. Will there be any problem if I instead supply just 1 V or 2 V (assume long-term usage) so as to reduce the pumping power? If that is not the recommended approach to reduce the pump's motor speed, what other method should I use? I'd like to avoid using a different pump, because this one has dimensions just small enough for my application. <Q> N α K Eb/ɸ <S> Where <S> N = <S> Speed of Motor Eb= <S> Back <S> Emf <S> ɸ = flux per pole <S> From the above relationships the speed of DC Motor is directly proportional to Eb(Back emf) and inversely proportional to flux produced by field. <S> (General DC Motor -Dc shunt) <S> So by reducing the Input voltage obviously( Back Emf) will reduce the speed of the motor. <S> I am guessing there is no provision to control field. <S> If it is more current than specified level then adjust the voltage such that it should not take more than specified level. <S> More current cause to lead the winding temperature to predefined level so it will damage the motor <A> I don't know if you need variable speed or not, and if you are parts or design constrained, but you could look at PWM techniques to control the motor with the rated voltage. <S> Even though many applications of PWM use it as a way to alter speed (or brightness, or...) <S> in a controlled and accurate manner, it is also a very good way to maintain a fixed output that isn't necessarily symmetric with input voltage. <S> In this case we can make sure we run the motor at its happiest voltage, but alter the duty cycle so the RPMs are adequate for our needs. <A> yes dc motors accept lower than spec voltages <S> however the result may come some undesired effect as well, example: heat build up may occur thus resulting in added resistance in the motor causing it to lag or cease.
Before running the motor in low voltage continuously for long time, check for the current taking by the motor.
Timer sequence with delayed off and long trigger pulse Attached here below is the input and out put sequence that I am trying to achieve with a timing circuit. This looks like something that might be achieved with a few monostable 555 timers, but I am struggling with triggering on both sides of the input pulse. The input pulse could be inverted, but since I need to trigger on both sides (positive and negative edge), I'm still in the same situation. Any suggestions would be most appreciated.The supply voltage is 12 Volts. <Q> This circuit will generate a ~10usec negative-going trigger pulse on each side of an input pulse, which you can use to trigger your 555 monostable multivibrator: simulate this circuit – Schematic created using CircuitLab <S> It will operate directly from 12V, using 1/4 of a CD4077 ex-NOR gate. <S> The input pulse should be reasonably clean and (more importantly) have reasonably fast rise and fall times. <S> If that isn't true, square it up with a gate or two from the 4077 package or even a Schmitt trigger chip. <S> It works by delaying one of the input signals by the R1 C1 time constant, so the inputs to the exclusive-NOR gate are briefly different from each other on both the rising and the falling input edges. <S> Recalling the truth table for an ex-NOR gate, we can see that the result is that the output is high, with a brief negative-going pulse at each input edge: <A> As someone has already mentioned in a comment, this could easiest be done with a microcontroller, like a PIC16. <S> You would need to level-convert the input down to 5v (or 3.3v) and then use a couple of output transistors to convert back to 12V outputs if necessary. <S> But that has a lot of prerequisites; you need to be able to program and have a tool chain installed along with a programming device. <S> If you want to use discrete components, the following circuit should do what you want. <S> How it works. <S> 555's trigger on the negative edge. <S> So the top 555 with the 3 second delay will trigger at the end of the input TRIGGER pulse, extending it by 3 seconds (it's output OR'ed with the input TRIGGER) to create OUTPUT 1. <S> The 100 ns delay line is there to avoid any glitches on the output when switching from one input to the other of the OR gates. <S> This delay (which can probably be as low as 20 ns) could be a series of say four inverters, or a real delay chip like the DS1100 . <S> Because of the inverter, the middle 555 with a 1 second delay <S> triggers off the positive edge of the input. <S> It is then used to inhibit the output of the TRIGGER input for 1 second (using the inverter and AND on the output). <S> Then the bottom 555 with a 2 second delay extends the input TRIGGER by two seconds, like the first circuit, to create OUTPUT 2.. <S> I haven't shown the circuitry for the timing components of the 555's, these are readily available on the web. <S> I would level-convert the input down to 5v using a voltage divider so you can use standard logic gates like the 74HTC04 for the inverters, 74HCT32 for the ORs gates, and 74HCT08 for the AND gate, and then use two more inverters and transistors to convert back to 12V outputs if necessary. <S> If the input is noisy, you could use 74HCT14 instead of the 74HCT04 inverters. <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> Time delays using CD4093 Schmitt triggers. <S> OUT1 <S> When Trig goes high NAND1 goes low. <S> D1 discharges C1 immediately setting NAND2 high. <S> When Trig goes low NAND 1 goes high charging up C1 through R1. <S> After time-constant set by R1.C1 NAND 2 goes low. <S> OUT2 <S> Same principle of operation as OUT 1 but with a delay on the input to NAND3. <S> Any Schmitt trigger chip will do - inverter, NAND, NOR, etc.
You don't need to worry about whether you are triggering on the positive or negative edge of the input, since just adding an inverter as shown below will handle that for you.
220 AC to 220 DC Converter I am designing a circuit that will give me an adjustable 220DC voltage. The load is approximately 2kohms, so the maximum current that will flow is 100mA.And I have design restrictions, it needs to be small in size. I will probably use this schematics: simulate this circuit – Schematic created using CircuitLab I calculated the capacitor value from|$$V_{ripple} = \frac{I}{2fC}$$ I = load current (100mA)f = AC frequency (50Hz)Vrip=1V The question is; would this circuit work? And if it is working, how can I make it more safer? I will put fuse in the 220AC input and make an insulator box for it. But I am open to recommendations. Thanks, for reading and further help. Update: So as suggested I asked variacs to local stores and it turns out it is very expensive and big. But one of the store managers come with the idea to use dimmer switches(similar to this ) with 220-to-220 transformer(and cheap!). So new schematics looks like this; simulate this circuit <Q> So that the circuit being discussed can't be edited out from under this answer, here is what we are talking about: <S> There are so many things wrong here, it's hard to decide where to begin. <S> A 220 Vrms sine wave has peaks of 311 V. Minus a couple of diode drops, let's say you will get 310 V on C1. <S> "25W" is a nonsensical rating for a capacitor. <S> Try finding a 1 mF 350 V cap, and you will see how expensive those are. <S> " <S> 25W" makes no sense for the diodes in this context. <S> This shows you really don't understand Volts, Amps, and Watts. <S> 100 Ω for R1? <S> Really!? <S> Clearly you haven't even thought about doing the math. <S> (310 V) 2 /(100 Ω) <S> = <S> 960 W. R1 will basically be a 1 kW space heater. <S> That's about the size it would need to be to not blow up. <S> 220 VAC at 50 Hz sounds suspiciously like the power line. <S> If so, this circuit is quite dangerous. <S> The top side of R1 will be at dangerously high voltage and ground-referenced to other things in your house. <S> You can easily be killed by touching that node and something like a water faucet. <S> There are other less obvious ground points in your house, so it's nowhere near as obvious as avoiding faucets. <S> You show the bottom of R1 as ground, but that's just what you call it. <S> It might also be lethal, depending on how exactly the 220 VAC is wired, and which way around the plug is installed. <S> One or more diodes may even blow up if you try to connect your ground to real ground. <S> So how to fix this mess? <S> Frankly, someone with so little understanding of electronics and the dangers of high voltage shouldn't even be here. <S> Let someone else that actually understands these things design it and make it at least as safe as a 200+ V output allows. <S> There are ways a more skilled amateur could achieve what you want, but teaching all that is required just to understand the answer is beyond the scope of this Q&A site. <A> Sorry this is more of a negative answer to address the first update in your question. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> OP's dimmer driven variable power-supply. <S> To understand why this is slightly problematic we need to look at how dimmer control works. <S> Figure 2. <S> Triac phase-angle control. <S> C1 of Figure 1 stores the peak voltage out of the bridge rectifier. <S> We can see from Figure 2 that the peak voltage of the AC will be the same from 0° to 90°. <S> Only after 90° does the peak voltage start to reduce. <S> This may be good enough for your application. <S> Figure 3. <S> A HV linear DC supply. <S> Source <S> The variable high voltage power supply 0-300V . <S> (Not reviewed by me.) <S> The alternative is to use a high-voltage DC output switched-mode PSU. <S> Ripple calculation <S> The capacitor must supply current to the regulator for 1/2 cycle (10 ms for 50Hz). <S> The charge Q (coulombs) removed from the capacitor is <S> \$Q= <S> I \cdot t \$, where I is current and t is time. <S> Also \$ <S> Q = <S> C <S> \cdot <S> ΔV \$, where C is the capacitance and ΔV is the voltage drop as the current flows out. <S> So \$ <S> C <S> \cdot ΔV = <S> Q = <S> I \cdot <S> t \$ <S> Rearranging gives \$ C = \frac {I <S> \cdot t}{ΔV <S> } \$. <S> For your 0.1 A power supply, 50Hz, full-wave rectified, and a 1 V ripple specification the capacitor required is $$ C = <S> \frac {0.1 \cdot 0.01}{1} = 0.001 <S> F = 1000 \mu F $$ <S> This agrees with your calculation. <A> Your circuit is flawed in that instead of using R1 as an open-loop shunt voltage regulator, you should use a series pass regulator instead, sort of like this: <S> None of the values of the components have been fleshed out, but the topology is there. <S> R2 may be made active and servo the output voltage to where it needs to be without constant fiddling with the knob
Go buy a off the shelf adjustable power supply that goes up to the voltage you want.
Battery Pack Management: need to balance during discharge? I'm looking into the fault detection and monitoring subsystem of out unmanned vehicles (airborne and ground-based) batteries. We employ LiPo-battery packs of various configurations which are charged by cell-balancing chargers. Only properly charged and balanced battery packs are put to service. During operation, only the total pack voltage is monitored. I figured that monitoring the individual cell voltages and temperature will help us detect battery deteriation early in order to avoid catastrophic losses in-flight. I wonder, whether cell-balancing during discharge would do any good, or basically would only waste energy without much effect on battery health or reliability. Edit: We build our batteries ourselves from basic unprotected cells. Cells are not specifically matched as far as I know. However, we generally use cells of a single batch for one battery only. <Q> Because charge efficiency of the battery and control circuitry is not 100%, you're just going to end up wasting energy and adding cost for minimal returns. <S> You're much more likely to damage an unbalanced cell during recharge. <S> Generally it's bad practice to fully discharge lithium ion and polymer batteries as it results in shorter battery lifespan. <S> So assuming you're only running your batteries down to 50-80% depth of discharge (DoD), the risk of damaging an unbalanced battery is negligible. <S> To ensure quality of your packs, I would recommend putting them through an 80% discharge test as soon as they're ready. <S> Measure the voltage at that DoD to establish a baseline. <S> Anything below the normal average you'll know has a problem. <A> Kirchoff's Current Law ensures that all cells in the battery will lose the same amount of charge from active use. <S> As long as the cells were matched when assembling the pack, this means that the batteries will essentially remain as balanced during discharge as they were at the end of charging. <A> Don't balance during discharge. <S> It would only waste energy and it would do more harm then good. <S> I answered my own question about how balancing works and maybe it would also help you.
As long as your batteries have the same specifications and are properly balanced prior to use, then your risk of damaging one battery before another during discharge is pretty remote.
Boost converter for high side Mosfet I recently came across an article explaining how to drive a high side MOSFET using a "separate isolated power supply whose ground and the ground of the MOSFET-based circuit are isolated". However after reading this article I still do not completely understand the driver circuit and had a number of questions: Why is it necessary to use an isolated power supply rather than a non isolated power supply that will simply boost the gate voltage to able 12V higher then the voltage of the "main supply" in this case 12V higher than +24V with reference to ground? the isolated power supply shown in the figure is represented by a battery, how can I instead replace this with a boost converter? (should the input to the boost converter be +24V and ground, with the output negative connected to the source of Q1 and positive terminal where the positive terminal of the battery was) what effect does having the negative terminal of the isolate power supply connected to the source of Q1 have? is there an isolated boost converter that you can recommend given the small current required to drive the gate. if applied to a H-bridge will i need 2 seperate isolated boost converters (one for the left high side drive and one for the right high side drive?) The circuit suggested by the this article is below: <Q> An isolated supply makes things really easy. <S> You can easily get isolated DC-DC converters that will output 12V. By using an isolated DC-DC converter, you can treat the output just like the battery in your circuit. <S> There is less chance for interaction between your isolated drive and the rest of your circuit. <S> Starting at $3-4, it would probably be worth your time for a one-off or low volume solution. <S> This is why you do not " simply " connect a boost converter to do the job. <S> You could probably have the input 12V power supply be your source, and then have it run in a discontinuous mode. <S> Past that, you'd also need a current return path for the boost charging loop, which may be an issue if your load decreases significantly or is disconnected. <S> Even then, I'd probably start from a bootstrap topology and hack in the boost converter. <S> Your gate driver, when connected to the source of Q1 with an isolated supply, is setting the gate to source voltage directly. <S> It sets the gate-source voltage to either (Vsource + 12V) or (Vsource). <S> Otherwise, you need to know what the source voltage is in order to drive the gate safely. <S> If 36V is applied across your gate-source terminals, your MOSFET will probably be destroyed. <S> Digikey/Mouser/etc... has a wide assortment of isolated DC-DC converters that generate a fixed output voltage. <S> An "isolated" boost converter does not exist (because it would be called something else). <S> You're probably on your own if you want to make your boost converter idea work. <S> Yes. <A> If you use a boost converter to step the +24v supply up to +36v, then you don't necessarily need the isolated gnd. <S> The circuit you drew uses an isolated gnd to allow the 12v battery to see gnd near the +24v supply rail, leaving the pos. <S> battery terminal at ~+36v relative to your "main" (24v) ground. <S> Using a boost converter can give you the same +36v without needing to "trick" the supply into providing a higher potential. <S> EDIT: <S> Here's a (simplified) diagram of what I mean: <A> Why not just have a boost circuit that gives 30-something-V and use that? <S> One reason is that the 30V+ cannot be used to drive the gate of the MOSFET directly through a switch (a transistor), because the Vgs could be close to 30V+ which exceeds the ratings of most MOSFETs. <S> But that can be overcome with some simple voltage regulation. <S> With the configuration in the schematic, you need an isolated supply. <S> The top two candidates are probably flyback and push-pull. <S> The secondary winding of the transformer would provide the isolated supply and the ground of that would go to the source of the MOSFET. <S> Don't know how to answer this question. <S> It is part of the scheme. <S> Just about any boost circuit can be easily used as flyback with primary side regulation just by replacing the inductor with a transformer. <S> This method is more flexible with the voltage levels as compare to the next. <S> Another method would be push-pull if the system has a convenient source voltage that can be matched to a convenient off-the-shelf push-pull transformer of certain winding ratio to give what is needed. <S> (Check out TI SN6501 for example). <S> For 2 seperate isolated converter, just parallel two transformers' primaries to the same converter circuit (with the proper component values). <S> The regulation is not critical and the suggestions above are using primary side regulation anyway. <S> And if your application already has a switching regulator, it may be easy to piggy back off of that. <S> By the way, what is given in the schematic may not (or may) be the optimal way for your application (which I don't know). <S> For example, you mentioned H-bridge, which means you want to control the switching delay of the high and low side switches.
It is not difficult to get off-the-shelf power inductors with two equal isolated windings which can be used as the flyback transformer. Voltage regulation of your gate driver supply is a significant concern, as you would probably need something like a zener diode to limit the maximum voltage.
Is it possible to use a MOSFET for Li-ion reverse polarity protection when protecting a charger? I've made a simple charger out of 4 TP4056 modules and 4 18650 sockets. These modules have overcharge, undercharge and overcurrent protection included, but I also want to know how simple it would be to make it also reverse-polarity protected since that condition is much more likely as the above 3 combined, given that I'll swap batteries often and am bound to be mistaken once in a while. I'll also likely build some chargers for other people for their needs and this could be a nice feature. Could I just use the MOSFET trick to make reverse polarity protection for the charger or is there something I'm missing? <Q> The p-mosfet trick won't work as both sides supply voltage. <S> A further improvement would be to use a microcontroller to check the battery status before turning on a MOSFET, but at that point it is getting stupidly complex. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> If you were to add the battery in backwards, the diode would protect the charger IC from the bulk of the current while the fuse would disconnect the battery. <S> Don't use a 1N4148, (they are low current signal diodes), I forgot to remove the name. <S> A >2A schottky diode would be ideal. <S> EDIT: <S> The latching circuit previously mentioned would look like this: simulate this circuit <S> When initially given power, R1 pulls the gate of the MOSFET close to the source, keeping the mosfet from turning on. <S> Once a lithium cell to be charged is added, current from the cell flows trough R2 to the base of Q1, turning it on. <S> Q1 then pulls the gate of the MOSFET low turning it on. <S> If the battery is connected backwards Q1 never turns on and the MOSFET never conducts. <S> D1 is there to protect the base of Q1 from the negative voltage of the battery. <S> The problem is that even after removing the cell the MOSFET stays on, allowing Q1 to stay on and keep pulling the gate low in a positive feedback loop. <S> Now that I think of it, the latching circuit would work after all : If the MOSFET is on when adding a cell the wrong way, the charger IC goes into short circuit protection which causes the charger output voltage to fall below the threshold voltage of the MOSFET switching it off, and interrupting current flow. <A> I tested it with a 30V/1.1A RUEF110 <S> (thanks mkeith) <S> PTC fuse, and it does the trick, the tp4056 <S> does not even get hot . <S> By the way im using a random diode i found. <S> Sometimes the cheapest and the most simple solution is the best! <S> Only drawback - it will take a few seconds after the short for the ptc to recover though. <S> Thank you for the simple solution, i have worked a lot with tp4056 and have blown my diy tp4056 parralel 10A chargers with reverse polarity on the battery ends. <S> I thought of using a mosfet but my solution came to same problems as jms-s. <S> So forget the mosfet idea. <A> I have successfully done this on several projects so far. <S> I found this video at hackaday , which explains very nicely how it works.
You could use a latching circuit (P-mosfet + npn bjt) but it would only work for the first battery you charge, unless you power cycle the circuit every time you change the battery. The cheapest and easiest method would be to use a diode and a fuse as protection. Jms's solution works.
Is a screw or push-in terminal better for vibrating environment? I need to decide what connector to use on my PCB to connect low power wires. Among the available options on Farnell/Mouser etc. The price and size are almost similar. I wonder if using a screw terminal or a push-in terminal would be better for a vibrating environment? <Q> Some of the electricians where I work still prefer the hand-tightened screw terminal but some of our machine builders have switched to cage-clamp, where possible, to eliminate problems with terminals vibrating loose during road transportation. <S> Cage-clamp terminals are made by many companies. <S> Figure 1. <S> Wago cage-clamp terminals . <S> Some of the terminals require a 'just right' screwdriver to release the cage properly. <S> (Some screw terminals require the right tool too.) <S> Figure 2. <S> Cage clamp and wire showing excellent contact area. <S> (Photos used previously in my answer to another question .) <A> For most cases, your most vibration-secure (won't easily lose contact), after taking already-mentioned strain-relief & vibration-damping steps, will be one of the "latching" plug-in types, like the ATX & IDE power connectors inside a desktop/server computer case (and most connectors in automobiles as well). <S> The (external to the circuit contacts) latch keeps the connection pins from "backing out" under most any strain that doesn't break the latch. <S> EDIT: <S> For clarification, I mean something like this: or this: images credit molex.com, http://www.molex.com/molex/products/group?key=wire_to_board_connectors&channel=PRODUCTS&langPref=english <A> For high frequency, I would recommend push in. <S> You cannot secure the screw terminals with vibra-tite, loctite, etc. <S> so they could very possibly shake loose. <S> For high impact (like an off road vehicle), I would say either is safe but to Eugene's point, secure the wires so they do not add strain to the termination. <S> I would also mount the system on rubber pads/washers to minimize vibrations that might be damage sensitive components like crystals and oscillators.
Push-in or 'cage-clamp' terminals have been around for several decades now and are a reliable solution for connections in general and vibration-proof contacts in particular.
Why is analog "voltmeter sensitivity" is defined as ohm/Volt? What is the motivation to define a sensitivity of an analog voltmeter as ohm per voltage? <Q> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> DC voltmeter with range selector switch. <S> A simple DC voltmeter with range selector switches is shown in Figure 1. <S> The meter movement will read full scale at 0.25 V and has a resistance of 5 kΩ. Adding 15 kΩ in series with the coil will convert the meter to 1 V full scale and the resistance will be 20 kΩ. For each successive range we need to increase the resistance proportionally at 20 kΩ per volt (difference per range select). <S> Digital meters tend to have fixed input impedance. <S> Typically this is 10 MΩ and can be ignored in most applications where high accuracy is not required. <S> Figure 2. <S> AVO 8 multimeter. <S> Photo by Zureks on Wikipedia . <S> There are circuit schematics and some history for the AVO (amps, volts, ohms) <S> meters on Richard's Radios and these are quite instructive and show some very clever circuits to maximise the utility of these instruments. <A> Because the meter movement has a full scale deflection at some specified current. <S> A series resistor is used to turn it into a voltage measuring device. <S> The value of this resistor will be V(for full scale) / I(full scale). <S> So the impedance of the meter will be 1/(I full scale) ohms per volt (FSD). <A> From this wiki page The sensitivity of such a meter can be expressed as "ohms per volt", the number of ohms resistance in the meter circuit divided by the full scale measured value. <S> For example, a meter with a sensitivity of 1000 ohms per volt would draw 1 milliampere at full scale voltage; if the full scale was 200 volts, the resistance at the instrument's terminals would be 200,000 ohms and at full scale the meter would draw 1 milliampere from the circuit under test. <S> For multi-range instruments, the input resistance varies as the instrument is switched to different ranges.
The Ω/V figure is taken into consideration to figure out how much the meter is loading / affecting the circuit being measured.
Is resisting DC motor bad for it? If I keep the shaft of a DC motor in place while it is running does this harm it in any way? Is it bad for it at all? <Q> In general, yes, because the stall current for a motor can greatly exceed the rated current, and exceed the continuous current rating of the motor's windings, brushes and commutator, and burn out the motor. <S> In some motors it won't instantly kill the motor but heat it - the motor will survive short overloads but can't dissipate the heat from a continuous overload. <S> If you've been making heavy cuts with a saw or a drill it's often good practice to run the motor unloaded for a minute afterwards so the built-in fan blows cool air through it. <S> This excessive current under heavy load is a necessary consequence of keeping the winding resistance down to keep the motor's efficiency high under normal (high speed) operation. <S> Cheap motors tend to have incomplete data but for a reasonably complete specification see this datasheet and note (the first column) <S> "Maximum continuous current" 6A. (The nominal rating for 100% duty cycle) <S> "Starting current" 105A. (This is also the stall current). <S> Typical motors like the Mabuchi RS550 are designed for lower efficiency so the stall current may only be 6-10x <S> the rated current (here 83A vs 10.8A <S> at max efficiency, max continuous current is not specified). <S> In neither case should you mistake the stall current for the rated current : the RS550 surely cannot survive 83A at 9.6V (about 800W) for very long! <S> However, in your case (a motorized fader) <S> the motor is small, low powered, probably has quite a high winding resistance and low efficiency, and may be able to survive a fairly prolonged stall. <S> This is a deliberate design choice to limit its stall torque rather than injure a sound engineer's fingers! <S> Alternatively its drive current may be deliberately limited. <S> Over and above that, its controller apparently detects its drive current to detect stall or manual override, and cuts off the power before any damage can be done. <S> It is completely safe to stall this motor by hand. <A> It'll probably just get a bit warmer. <S> The BLDC driver will probably detect the lack of rotation and give up, and then retry starting a few times. <S> If it's a sensorless motor+driver, that might cause additional issues because the startup sequence is open-loop and will fail in interesting ways. <S> Google for "locked rotor" (which is what you are doing to it) and you'll find that different controllers have different ways of dealing with that. <A> Depends... <S> It depends on the motor and its designed application, how long, any additional cooling. <S> If the motor was designed for a stall case situation it maybe able to sink the stall current indefinitely. <S> However... this isn't usually the case and what is typical is tolerance to a stall situation for a finite period of time. <S> I have a 5kW BLAC machine that has a continuous rating of 500W <S> but it does burn out within 30 seconds if it is in stall.
If it's a high-torque device like a traction motor then it may overheat or it may overheat the BLDC driver. If it's a low power motor like in a computer fan, then probably no issue at all.
Looking for right component in my simple diagram I am not electical engineer therefore stumbled upon this simple issue. In need to activate a 120VAC 1HP motor from sprinkler timer that has 4 individual channels providing 24VAC up to 400mA voltage each. When each individual channel being activated in sequence it needs to energize the motor as well. I used 1A 30V diode for each channel to prevent current backflow. To activate the motor I thought using relay but most of them at coil have input 24VAC 110mA or below. If I apply 350mA it will burn out the relay coil. Please see my diagram. Would appreciate if you can give me simple and working design to my application along parts that I can use. Thank you for your help!!! simulate this circuit – Schematic created using CircuitLab <Q> The controller output can provide UP TO 400 mA, but any load will only take the current it requires. <S> The controller does not force 400 mA through the load. <S> You can safely use any relay with a 24 volt coil, providing the relay coil draws less than 400 mA. <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> The proper way but requires four 24 V AC relays. <S> simulate this circuit Figure 1. <S> Single DC relay option. <S> Your diode idea could work but you'll have to use a DC relay. <S> Half-wave rectified AC will give \$ V_{OUT} = <S> \sqrt {2} <S> \cdot <S> V_{RMS}\$ and so for your 24 V you will get about 16 V when the diode drop is taken into account. <S> 16 V relays are rare so you can: <S> Use a 12 V relay with a series resistor of 1/3 of the coil value. <S> Use a 24 V relay and add some capacitance in parallel with the coil to hold voltage up between half-cycles. <A> With an AC output on the controller it is probably using a reed relay or similar (eg not solid state) <S> so you probably don't have to protect it with the diode, but if you include the diode in the design remember that it's 24VRMS <S> so the peak is around +-33.5V, and it could also be subject to high voltages from the relay when it's de-energized, so a 30V diode might frazzat the first time you try it. <S> I would suggest a 24VAC relay with the lowest coil current possible, with a capacitor across the coil(maybe around 10uF, but really depends on the relay. <S> Non-polar), driven directly from the controller.
To keep the de-energizing voltage down you can add a capacitor across the relay coil, or if you go with the diode and DC relays a reverse biased diode across the relay to short out the de-energizing voltage spike.
Suggestion for a lack of light warning unit when in motion I would like to build a small device that warns me, with sound and or a 'dash' lamp, that my headlight is off if the motorbike is moving. My challenge is it is under warranty, so I cannot in any way modify or attach to existing wiring. The unit must strictly only connect to the bike by something like silicone glue or Velcro. I first though of an accelerometer in combination with an Arduino or something, but now I've wondering if a simply unit could be made with some kind of pendant switch, as I only need to detect some acceleration, not the magnitude of it. The unit would be smallish, with a light sensor on one end, and a bright LED array on the front, to provide an iota of emergency visibility if the rider doesn't hear or see the warning for some reason. The main gist of my question is, once the light detector and alarm is built, how do I enable it only when in motion? BTW, the main use of this is for when a motorcyclist forgets to switch on his headlight during the day. It's quite easy to notice that it's off at night. <Q> Use a dynamo to power your circuit. <S> This is how old bike lights used to work before batteries became more popular. <S> This way motion detection is passive and all you need to do is have a buzzer sound when a light sensor reports darkness. <S> You can still buy small clip-on bike dynamos cheaply and you can just modify one of those into a single device that has the buzzer and light sensor built in. <S> http://www.ebay.co.uk/itm/BICYCLE-BIKE-DYNAMO-LIGHTS-SET-HEAD-REAR-LIGHT-Cycle-Power-Retro-Classic-/262145176729?hash=item3d0911f499:g:DqoAAOSw~CRTpzDo <S> These devices simply have a shaft with a friction wheel on one end that presses against the tyre and spins powering a small generator. <S> Simple and effective. <A> Use a bike speedometer magnet and reed switch to detect motion. <S> Feed the signal into some logic to detect pulses and light LED if headlamp photosensor is not detecting light. <S> You need to shade the photosensor from daylight (if you want lights on during the day). <S> The whole idea seems a bit complicated. <S> I have pondered similar questions as I can't easily see the tail light on my bike. <S> One idea I had was to run a fibre-optic strand from each light to a 'console' on the handlebars <S> so I could tell if each lamp is on. <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> The main problem will be building a thru-beam light sensor. <S> I suspect you'll need some lenses or purchase a ready-made unit, but here goes. <S> R1 and D1 are the light source and positioned on one side of the wheel. <S> Q1 and R2 are the light detector and positioned on the other side of the wheel. <S> A few CMOS inverters (use all six on a chip if the others are spare) drive the charge pump C1, D2, D3 and C2. <S> When the left side of C1 is driven low, the right side will follow. <S> D2 prevents it going negative. <S> When the left side is driven high the right side will follow and charge will be transferred via D3 to C2. <S> When voltage builds up on C2 Q2 will turn on lighting the LED. <S> If the headlamp is switched on the LDR will shunt the base voltage for Q2 and the LED will be turned off. <S> This is an 'out-of-my-head' circuit. <S> You would need to play around with the LDR / R4 combination to get the right response in daylight. <S> Frequency calculations <S> These may be useful to somebody. <S> I don't know much about motorbikes but <S> lets say we have a 600 mm diameter wheel and five cast spokes. <S> \$Circ = <S> \pi \cdot <S> d = <S> \pi \cdot 0.6 = 1.8 m\$ approx. <S> per revolution. <S> 108 kph = 30 <S> m/s and would rotate our wheel \$ <S> \frac {30}{1.8} <S> = 16.6 revs/s\$. <S> With 5 spokes that would be 83 Hz signal if we detected each spoke. <A> An interesting option is what is used for bike velocity meters : a small magnet attached to the bike while (on a wheel wire usually) and a hall effect sensor attached to the fork. <S> Then each time the wheel completes a turn, the magnet passes in front of the sensor and is registered as a pulse from the sensor. <A> Take the LDR and stick it to the front of the headlamp facing in with clear silicone or hotmelt glue and use self adhesive hook and loop fastener to mount the rest of the birs nearby in a waterproof box. <S> The LDR will goes to high resistance when the lights are on and if the vehicle is moved it will buzz only if the LDR is dark. <S> It will also works as a ULTRA cheap anti theft alarm. <S> simulate this circuit – <S> Schematic created using CircuitLab
Use a motion sensing trembler switch and a light dependant resistor (or more elaborate sensor) drive a buzzer, power from a PP3 9V transistor battery for a long time if you drive with the light ON and the buzzer only sounds occasionally when you get on the bike. Spoke motion detector with LDR sensor for headlight.
Why does a relay have a minimum applicable load? I am trying to find relays for my application and I read a data sheet which looks fine but specifies Minimum applicable load: 10mV 10µA In my circuit, it is expected that the relay closes but no voltage and current is applied. You can think of it as 2 relays in series where one is open and one is closed, so there is no current. This sounds like something I'd do since I was at school. Why would a relay require a minimum voltage and current on the load side? Is it allowed to operate that relay under my conditions or not? What could possibly break in a relay if I don't respect this requirement? What does "minimum applicable load" mean? When and how do I need to consider this value? <Q> The primary reason that almost all relays have a minimum load requirement is that the mechanical action of closing coupled with an actual current flow are required to 'whet' the contact and break through a layer of oxidation that invariably builds up. <S> That is one reason that small signal relays generally use expensive contact alloys which resist oxidation, but as the phone company found out decades ago, even pure gold contacts can have issues in a high humidity environment. <S> While oxidation doesn't affect the gold contacts, repeated cycles of moist/dry air would deposit an insulating layer. <A> Mercury wetted (reed) <S> relays are used where you cannot guarantee minimum load currents. <S> These have a film of mercury on the contacts that will make contact even with no current as it forms a liquid junction. <S> Generally the contact resistance will be slightly higher than the best gold contact resistance. <S> The switching lifetimes may be much higher that other types. <S> The load currents are generally lower as they are only usually needed for small signals. <S> The longevity of a dry contact will not appreciably change even if no current flows but age and lack of load current will slowly increase the low current contact resistance as mentioned by others. <S> This means that marginal low current signals will suffer higher than specified contact resistance until such time that an adequate current has been switched. <S> EDIT: It is also possible for the thin oxide layer that forms on the relay contacts to cause the low current resistance to increase and remain high until reasonable load currents have been switched that will 'burn' it away. <A> Relay will work at any load (below maximum of course). <S> However if you use less than minimum permissible load, it may fail before it should (less switching operations). <S> The reason for this being after time some corrosion can get on the contact. <S> Minimal current is measured/calculated to be able to break through contact corrosion and it also slows down the corrosion process itself. <S> You can use the relay with less current, but if you are using it in a device that needs high reliability or you can't change the relay if it fails, it's not a good idea. <A> If the current you're switching is below 10uA, you may find that the relay still conducts a significant current even in open state, due to internal capacitance. <S> In a similar way, an open relay can easily pick up 10mV from EMI, so if your actual signal is that small, the relay may still seem to pass it through. <S> Of course, such phenomena depend on the frequency of the signals you're switching and your environment, which the datasheet stresses out: <S> Minimum applicable load is reference value. <S> Please perform the confirmation with actual load before production, since reference value may change according to switching frequencies, environmental conditions and expected contact resistance... <S> So your relay will work just fine even if the signal you're switching is not actually present. <S> Your signal must simply be above the threshold when it's there.
The relay may not work as expected below the minimum load. In your case where the live loads are of a respectable value almost any dry relay type will work reliably.
New led lights flickering in shop I have replaced several light fixtures with LED in my company. The 400 watt hi-bays I replaced with 95 watt LED. They work great.I replaced a set of office lights that were track halogen with 7 watt LED pot lights. They work great..... until. The problem. We have a large turret punch press and the ram operates with a large servo motor. With every single stroke of the press the lights flicker. So if the press stroke is 100 hits per minute or only 50 hits per minute the lights will flicker accordingly. These are the only lights affected. Is it possible to add in capacitors or a 1:1 transformer? My electrician has no answers. Power into the building is 600v and the press has its own transformer 600-480. The light circuit is 120v. The LED lamps are GU10. Brand is LUXWAYBGU07LEX 480LM, 120V, 60HZ, 7W, 40D, 45mA 3000K, CR190, 24314, DIMMABLE. Thank you in advance for any solutions or ideas <Q> It sounds like the ram is momentarily dragging down the voltage on the 120V circuit your dimmable LEDs are on, causing them to dim. <S> Powering the affected lights through a power conditioning UPS (uninterruptable power supply), similar to the popular APC units most of our computers/servers are plugged into, should fix this problem at a fairly low cost. <S> Alternatively, you could build your own AC->DC->AC converter with a large capacitor (or small battery) buffering the DC section, to accomplish the same end. <S> This option could be less expensive and/or could give better performance/longevity if you have the desire to try it. <A> The best way to quantify something like this is with a power quality meter, which I would expect an industrial electrician to have access to. <S> Failing that, and assuming the lights are on the same circuit (or at least the same transformer) in shop and office, you could randomly try different types and brands of bulbs for the office and see if it helps. <S> @Robherc's suggestion of a UPS might cost more, but could also provide emergency lighting in the office if the power fails. <S> GU10 bulbs have little room for extra capacitance, and the 'dimmable' feature probably means they're intentionally sensitive to line voltage <S> (you're dimming them when the line voltage dips). <A> These power outages are very short .Maybe <S> if your lamps had a bit more DC bus capacitance you would be not having any problems .Many <S> HID led lamps feature a meanwell driver as a selling point which I thought would be something they would want to hide .Re <S> engineering the HID LED lamp driver circuit would solve this but it may not be practical because there are lots of lamps in very high places .A <S> sensible approach would be a constant voltage transformer .The ones that I have seen work on the ferroresonant principle. <S> Like a normal transformer you must get your volts ( <S> 120) right <S> and you must get your frequency right (60 Hz I suppose )
The fact the shop lights work fine but the office lights flicker may mean that the particular lamps used in the office are more intolerant of dips in the line.
Is program code copied to SRAM from flash on microcontroller? On PC, program executable is read from hard disk, and loaded into RAM to execute it. On microcontroller, program is stored on flash. Is it loaded into SRAM when microcontroller starts up? If yes, then STM32F103 document says, flash is 64KiB, SRAM is 20KiB. Program doesn't fit into SRAM. (Same for other microcontrollers as well). If you will say that not all flash content is loaded into SRAM, what purpose does the remaining data on flash serve to? All operations are done on SRAM already in program codes. <Q> This is true of the STM32F103 range. <S> Most microcontrollers are capable of executing the program from RAM, but only relatively specialised programs actually do this. <S> For this reason, most microcontrollers have far more flash than RAM. <S> There are some microcontrollers that have lots of RAM and little or even no flash. <S> It may even be possible to get an STM32 like this. <S> These parts rely on storing the program off-chip in a physically small and cheap serial flash chip such as a Micron MT25Q. <S> True microprocessors (where the RAM and flash is in separate IC's, such as the ARM 7 and similar parts) <S> can and often do copy the program from flash into RAM and execute it from RAM. <S> The main reason for this is that RAM is usually much faster to access compared to flash, so the program will run faster. <S> Fast processors often run the Linux operating system which usually works this way. <S> It also gives Linux the ability to store the program in other types of storage memory, such as SD cards and serial interface flash (serial flash). <S> Linux can be made to execute the program directly from flash (it is termed Execute-in-place) <S> but this usually suffers a performance penalty. <A> It depends. <S> Some FLASH memories are XIP (eXecute In Place), namely the NOR ones, as they are word-addressable. <S> Some are not, such as NAND FLASH. <S> Programs running directly from FLASH (or any other ROM) have to be written/compiled into a so-called "ROMable" image. <S> The main difference of such a program from the one running from RAM, that it has first "relocate" all of it's variables into RAM and initialize them, because it can't change them in the read-only memory. <S> But sometimes the program is happily copied to RAM and running from there. <S> If there is not enough RAM to fit the whole FLASH, a multi-level bootloaders are used. <S> First the L0 bootloader is loaded into RAM, executing some low-level initializations and then loading the L1 bootloader, sometimes overwriting itself. <S> It can be the final binary instead of L1 of course. <S> But it can go up levels as well. <S> this way the code which is not needed anymore is just not kept in RAM, reducing it's usage. <S> So the extra FLASH memory can be used to store different binaries loaded one by one. <S> Or just store some extra data the program can access in the run-time (just like the hard drive in a computer). <A> Coping a program to memory before executing is a function of the operating system. <S> On MCUs, you usually just run the program from the FLASH. <S> There are notable exceptions, such as boot loaders, but generally, you run from FLASH. <S> Even on a PC or something with an OS, you could run a program from a disk and not memory, but you need to think back to the days of the tape drive when IO was slow. <A> Most microcontrollers use Harvard Architecture, which has separate program and data memory areas. <S> With this arrangement, the processor cannot execute code from RAM, as the RAM is strictly data memory. <S> The FLASH memory holds the program code, and the processor fetches instructions directly from FLASH.
Most 8, 16 and 32 bit microcontrollers execute the program directly from flash.
DC Motor consuming too much current I'm trying to use an H-bridge, which is connected to a wall power supply, to power a DC motor. The motor was originally powered by a 12V battery pack in a toy. Now my motor is consuming too much current (2.5 A instead of 1A) (the theoretical maximum current of the power supply is 2A) the motor even started smoking :( Why is the motor consuming too much current? It should only take what it needs from the power supply right ? thanks for your help, there was an overvoltage :(, I destroyed my motor.... The motor worked with 5v and I fed them with 12v <Q> So without any more information this is what I would suggest to check. <S> Check <S> the voltage on the motor leads while it is in the toy as well as your current application. <S> Make sure the motor can spin freely. <S> If something is binding up the motor or a magnet inside has come lose it can create a very large load on the motor which will drastically increase its current consumption. <S> It should spin without any clicking or grinding. <S> Some questions: <S> Can you see a model number or any identifying marks on the motor, you may be able to look up a datasheet to confirm the voltage it needs. <S> In your new system, is the motor under load or spinning freely? <S> As I said earlier, the more stress you put on the motor the more current it will draw. <A> Reduce the load on the motor. <S> As an experiment, disconnect the load from the motor altogether, allowing the motor to free run. <S> If it still takes too much current you need a motor with a higher torque constant (Kt in Nm/amp) and that means a lower speed constant <S> (Kv in rad/s/volt or RPM/volt). <S> Either rewind the current motor with more turns, or get a more suitable one. <S> If the motor is suitable, reduce the torque load on it. <S> If you want to reduce the current by 2.5:1, increase the gearing by 2.5:1 - or 3:1 to be on the safe side. <S> That will of course reduce the speed of the output shaft - you can increase the drive voltage to restore the speed, as long as you stay within the motor's ratings (or close to them, if you can accept a shorter life). <A> Any smoke from a motor indicates damage. <S> To test how badly the motor is damaged, run the motor from the original power supply without any load connected. <S> If there is smoke or the current is high, the motor is too damaged to be useful. <S> If there is no smoke and normal no-load current, the motor may have some useful life left if it is not overheated again. <S> If you can verify that it is a brushed motor, you can test it with any 12-volt battery. <S> You can also use the battery to test the motor with the new load to determine if it is suitable. <S> If it is a brushless motor, it needs an electronic speed controller (ESC) for a brushless motor. <S> It will not work with a variable-voltage DC controller. <S> The output of an ESC for a brushless motor is like AC power.
The motor is supplying too much torque and thus drawing too much current. Just because something has a 12v battery doesn't mean that the motor runs on 12v, there could be some voltage regulator hidden away.
Automotive: how to safely connect the car's power grid to the input of an intelligent switch? I have an intelligent switch. Let's take this one as an example - it's the one I'm plan on using, unless I find a better one. What I need to do is drive it by the voltage from the car's power grid. There are two complications here: I'd like to get 3.5-5 volts at the input of the switch, but I have no other voltage source to clamp the input to with a diode. Whatever schematic you suggest must withstand voltage pulses up to at least 60V (better yet - 100), and keep in mind the pulses may have reverse polarity as well. What are the simplest solutions you can think of? I've been thinking along the lines of a high-resistance voltage divider + a suppressor diode or a Zener diode. But I have no idea if it will work, let alone - work reliably. Please keep in mind I'm not an electrical engineer, and don't beat me up if I ask how your solution works. <Q> Are you looking for something like this? <S> Signal can come from any 12V(nominal, unregulated) circuit in the vehicle. <S> The zener diodes (marked 16v) protect by grounding overvolate spike & "freewheeling" negV transients while the regular/switching diodes block negV transients from your switch/load. <S> The 10K and 5K5 resistors form a (5.5/15.5) voltage divider to drive your input pin. <A> simulate this circuit – Schematic created using CircuitLab Figure 1. <S> Half-supply divider. <S> R1 and R2 provide a potential divider with the junction being half supply. <S> This will vary between 6 to 7 volts on battery or alternator. <S> This is well below the 10 V maximum input of the BTS117. <S> C1 forms a filter to stabilise the voltage and absorb any transients. <S> Current, I, through R1 and R2 is given by \$I = \frac {V}{R} = \frac {12}{20,000} = 0.6 mA\$. Figure 2. <S> Extract from BTS117 datasheet . <S> Normal operation <S> : The datasheet shows that normal 'on' current on the input is typically 30 µA. <S> This is 1/20th of the current through R1 so the voltage on C1 won't drop dramatically. <S> Current limit operation : If the device goes into current limit this is signalled on the control-pin (rather cleverly) by increasing the input current to 120 µA. <S> This is 1/5th of the 600 µA <S> passing through R1 so the voltage on C1 will drop by about a fifth. <S> It will still be above the 'on' threshold. <S> Thermal shutdown <S> : If the device goes into thermal shutdown the input current will increase to 2200 µA (2.2 mA). <S> The most R1 can supply will be about 1 - 1.2 mA <S> so I'm not clear what will happen at this point. <S> Update: <S> R1 - C1 will have a time constant given by \$\tau = R \cdot C\$. <S> I've increased C1 to 10 µF so that the time constant becomes \$ \tau = <S> 10~kΩ\cdot 10~µF <S> = 100~ms\$. <S> That should be plenty for typical transients. <S> Seeing as you have raised the point about internal resistance, I've added C2 to bypass any really high frequency noise that gets through. <A> Something like an off-the-self voltage regulator like this one can produce 5v with an input anywhere from 8-45v, however it may start to get a little toasty at 45v. <S> In order to protect the regulator from the harsh transient voltages present you should use a TVS(Transient voltage suppression) diode. <S> Putting it simply they are like a zenzer diode with a fast reaction time. <S> Example of such a diode
Vpos can also come from any 12V(nominal) circuit capable of powering your load. They come in bidirectional types so if the voltage spikes to high or low they will turn on.
Erasing Flash with X-rays to remove security bits Scenario: A chip is read/write protected by programming a security bit in its onboard flash memory. Normally this would mean it cannot be re-written. Would a dose of X-rays be capable of erasing the flash to the extent the part could be reprogrammed? So, a number of questions. a) How much X-ray flux is required? b) Are such X-ray sources easily available? c) Would the X-ray flux cause permanent damage to the chip? d) Has this been done by anyone? <Q> Floating gate flash is susceptible to X-ray, but you risk damaging the onboard charge pump if you subject the device to sufficient energy to <S> guarantee erasure of all bits (the only way to guarantee that you have erased the security bits). <S> It is possible to erase memory cells at certain energy levels that will not significantly damage the cells, but the exact level is not really known and varies with process and <S> unfortunately that energy level is what fries the onboard programming charge pump. <S> Floating gate device memory cells are particularly sensitive to energy levels in the < 9keV range; see this and this application notes from Spansion (originally from AMD). <S> It is possible to make X-ray sources in this range, but probably not cheaply, and this risks damaging the memory cells such that they are not recoverable. <S> I have had ordinary post-solder X-ray (tungsten source, very little energy below 40keV) flip bits from programmed to de-programmed, but it is somewhat rare. <S> That same source, when turned up to around 140keV, fried the charge pump and <S> some of the flash memory cells in a power sequencer (flash based programme). <S> if you successsfully get the device de-programmed <S> and just what energy level for a given part is very unlikely to be known. <S> The erase event is quite simple (according to research available in IEEEXplore): The floating gate is programmed by tunneling electrons across the tunnel oxide between the control and floating gates. <S> X-ray is simply high energy photons that produce electron-hole pairs on the floating gate - as electrons have a higher energy level than holes, more electrons than holes migrate, resulting in a net loss of electrons on the floating gate when the event ends and recombination takes place; whether this is sufficient to de-programme the cell is device dependent. <A> a) Probably depends on the chip. <S> b) Probably not. <S> c) <S> Probably, if the dose was high enough. <S> See (a) d) <S> Probably, if only for academic purposes. <S> But either way, frequently the lock bits only prevent you reading/writing the contents of the flash, but don't stop you issuing an erase command. <S> So you instruct the chip to erase itself and in the process it erases the lock bits. <S> This isn't a security issue as the chip has been erased so the content of the flash which is being protected from read back is gone. <S> Probably worth exploring that option before resorting to ionising radiation. <S> This is probably worth reading. <S> It's a report by Spansion on the impact of X-rays on their Flash devices. <S> That report also points to an IEEE Journal Paper [1] which if you have access to (e.g. at a Uni) might be worth reading. <S> If you don't have access, it basically gives some figures for things like the approximate total dose that would cause failure in different sorts of commercial devices. <S> For microcontrollers it quotes a dose of anywhere from 15 to 70 kRads <S> is likely to cause failure. <S> Flash memory is quoted as anywhere between 5 and 15kRads. <S> That essentially answers (c). <S> [1] Blish, R.C.; Li, S.X.; Lehtonen, D., "Filter optimization for X-ray inspection of surface-mounted ICs," in Device and Materials Reliability, IEEE Transactions on , vol.2, no.4, pp.102-106, Dec 2002 <A> Any such bulk exposure to X-rays would erase the entire chip, and could possibly cause damage (see some old usenet threads, of which I was a participant). <S> It was suggested early on by Intel to bulk erase EPROM chips in non-windowed packages <S> but I don't think it was used much, if at all. <S> That is not the method typically used.
The short answer is that yes, flash can be deprogrammed by X-ray, but with no guarantee of the operation of the device
Using Super Capacitors with solar cells and batteries to help save my dogs I am looking to make a dog feeding mechanism that will operate regardless of power outages. The main point of this query initially is to figure out how to work with the materials I have (or can get) to store enough power to run a small Arduino or two for a non-predetermined amount of time. I have a small collapsible solar pack that is 5v 8 watts, made for slow charging phones and stuff camping. I have started experimenting with Super Capacitors and currently have 6, 2.7v 500F Samwah (MH47765) caps. I also have a rather large supply of 18650 Li-Ion batteries. I am having a problem understanding how to balance charge my supercaps. I am also unsure how to approach power distribution between each segment. I have a small converter that takes 0.9v-5v and outputs 5v at approx 96% efficiency(claimed). I have the necessary parts for a lm2596 5v switching voltage regulator circuit. I may have pre-assembled ones out of china as well as enough to make 7 or 8 more. Would it be prudent to regulate the voltage or the solar cells to the caps with the small 5v buck converter or better to do that after the caps? if I use the lm2596 it seems like it would be just as good to use the arduino's onboard voltage regulator? The Diodes have have from the lm2596 are 5amp Schottky diodes; are they appropriate for balancing purposes? The idea of charging two 2.7v caps in series to 5v and then when full, perhaps use a relay to switch to another pair maybe another pair after that. This would maximize power harvesting from the sun. Then once two pairs had charged I could use a relay to put two pairs into a series at 10v making the use of the onboard or lm2596 voltage regulators work, possibly utilizing extra energy to charge some of the li-ion batteries as well? The system would need to be able to run a real time clock, or could be simplified to work with the sunrise and set. It would need to trigger the feeding mechanism twice a day. So I should have lots of "extra" stored power to pour back into Li-Ion batteries. The problems: I live on an island (Guam) and we get very bad storms and typhoons. The power system on the island is antiquated (WWII Diesel)and we suffer from rolling blackouts frequently and prolonged outages during stormy periods. I goal is to ensure food is provided to two 95lbs (44 Kilograms?) German Shepherds. I have to travel off island for medical and if a bad storm hits the pet sitters may not be able to get to them. This doesn't talk about the feeding mechanism side of this but I figured one step at a time. I am happy to add this for those who are curious or if anyone thinks it may affect the approach so far, but I am trying (and failing) to keep this shortish. Any ideas, creative alternatives, or any help understanding my options would be very much appreciated! <Q> You are going at this backwards. <S> Always, always, always start by defining your requirements. <S> Only then can you move on to considering solutions. <S> In this case, you need to first build a prototype dog feeding station. <S> Only then can you get a feel for how much power/energy you'll need. <S> With a mechanism in hand, you can measure how much current the station draws (this establishes power requirements), and how long the motors run . <S> From this you can determine how much energy you need. <S> Remember to specify a worst-case power outage duration - if you size the system for 2 days but the grid is down for a week, your pups will not be happy. <S> You'll want to run the feeder while you are home, anyways, in order to monitor it for reliability. <S> After all, you don't want to find out that there's a weakness in the system by coming home to hungry dogs. <S> Only now can you start looking at candidates for energy storage. <S> I suspect (very strongly indeed) that student is correct, and supercaps are not the way to go - they simply don't store enough energy to run motors for any length of time. <S> I'd also cast a jaundiced eye on solar power for your backup. <S> If you are absent when a storm blows through, and the sitters can't reach your place, how will you depend on the solar cells not taking damage during the blow? <S> Frankly, I'd be inclined to start out assuming a biggish battery backup charged from the power grid <S> would be the default position for your needs. <A> Simplicity is your answer. <S> Use the solar cells to charge the baterries directly. <S> Simple charging will suffice. <S> Use constant current at 0.1C for 12h. <S> For the consumption, RTC is not gonna be a problem when compared to the motor that you will have to use. <S> Anyway, even small batteries should support weeks of operation. <A> The initial intention of mine was to leave a comment, but I'm rookie <S> so... be gentle. <S> I agree with @whatroughbeast. <S> I just want to add a note. <S> What ever power storage you'll use. <S> If you're going to use PV be aware of a problem. <S> The problem: The sunlight energy varies during the day and between days. <S> So the energy we sink from the cell can not be calculated. <S> If for example we design a switching power supply to charge the battery with a constant of some mA for example, we may reach a point (and we will), that the available energy from the PV will not be enough to produce this amount of mA. <S> Now consider that all the power supplies have feedback to regulate voltage. <S> And what the feedback does? <S> When the output is less than the requested, the produced error is bigger and so the signal is maximized. <S> It's like when you need more speed, you press the gas pedal more. <S> This approach may be good for a lot of situations, but is not for solar panels. <S> If you try to sink more current (more than the available based on the sunlight) from the panel the voltage will drop and the resulting sinking power will be far less. <S> The solution: A system called MPPT (Maximum power point tracking) system. <S> The whole idea behind this system is very simple. <S> Sink as much power as you can from the panel :-) <S> How it works? <S> Consider the next circuit (This circuit is just for reference, is not a working system) <S> The controller performs the following algo: <S> This way the amount of energy flow to the battery/Capacitor will be at the maximum all the time ;) <S> Of course you can use a solution like this from ST
Do not use supercaps, my experience is that they are evil, but with that aside, there is no need for them. With a nod to your idea of using supercaps, you can use motors which run at 5 volts. Buck-boost converter can be used to create the right charge voltage.
Single-supply op-amp behavior with 0V input I am confused by how op-amps work. I have a single-supply op-amp: the power rails are +5V and ground. The circuit in the image says the op-amp is an LM741 but it's actually the op-amp built into the Cypress PSoC 4200M chip ( data sheet ). My understanding is that op-amps generally cannot output a voltage that is too close to the power rail. Therefore I expect that if I configure the op-amp as a voltage follower and tie the positive input to ground, I should get something greater than 0V from the output. Looking at the data sheet, I think that, assuming I set the power to low and my load is minimal (it's an ADC), the output should range from 0.1V to VDDA (5V) - 0.1V = 4.9V. Does that look correct? The reason I'm confused about this is when I simulate the circuit in CircuitLab (with the LM741) and run the DC sweep simulation, I see the LM741 outputting the full range of voltages from 0V all the way up to 5V. It seems to be behaving as an "ideal" op-amp. But what's the point in choosing the op-amp model in the simulator and entering all the parameters if it's not going to simulate correctly? Am I doing something wrong or does CL just not simulate op-amps correctly or do I not understand how op-amps work? simulate this circuit – Schematic created using CircuitLab <Q> You are basically right, except for the choice of 741 to use over the 0-5 V range. <S> The 741 requires some headroom against both supplies. <S> For 0-5 V operation, a CMOS "rail to rail" opamp is a much better choice. <S> Once of the Microchip MCPxxxx series is likely a good fit. <S> The voltage gain is basically 1, but the output impedance can be orders of magnitude lower than the input, making this a useful trick in some circumstances. <S> As to why the simulator doesn't act like a real part, it's not a real part. <S> Apparently that restriction on opamp behavior was not coded into that simulator. <S> Simulators are only as good as the people who wrote them and the users that drive them. <S> Go hook up a real opamp and gain some real world intuition about how these things behave. <A> Your understanding of op-amps is fundamentally correct, and as Olin notes, an output with no load may very well drive close to the rails, but many parts will struggle even at no load. <S> What you may not understand is the models used for simulation, and these vary considerably in detail and accuracy. <S> This application note explains why most op-amp models are continuous time and why earlier models may not accurately show the limitations of the output. <S> It also goes into some detail on how these models have evolved to bring greater accuracy to simulations. <S> Most interestingly, the model itself has no real relationship to the part in terms of the actual circuitry used, as the model is only representative of the behaviour of the part ; these models rarely model start-up response (if ever) which can catch the unwary. <S> (Chopper stabilised device outputs can be interesting for the first few milliseconds). <S> Understanding the limitations of simulation tools is critical in engineering, and only a thorough understanding of the parts being simulated (op-amps in this case) will save you from serious circuit mistakes. <S> The simulation is to help you understand the typical performance of <S> a given part in a given configuration to help avoid many problems; you still need to understand the device fundamentals. <S> I have seen models (TVS devices in that case) that did not reflect reality and caused quite a lot of embarrassment when the box was subjected to lightning tests, because the designer had blindly believed the simulation. <A> In your diagram, your op amp is effectively given a +/- <S> 2.5V rail, and its positive input referenced to ground would be -1.5V. <S> I havent taken a look at the lm741 data sheet, but having 1 volt of headroom from the rails doesnt seem too surprising so I would expect the output of this circuit to track the input pretty well. <S> That being said, an op-amps headroom will decrease with a higher current draw, so if you were to put a larger load from the output to the virtual ground, you should notice issues if your input is too close to either rail. <S> If you were to actually tie your input down to either of the rails (rather than 1V DC) and pull a couple mA from the output, you should definitely see that the output will not be at the rail. <S> If this is not the case, you simply have a bad model. <S> Keep in mind that the LM741 was one of the oldest and most fundamental op amps ever designed, so I wouldnt be surprised if it is being modelled as an ideal op amp.
The circuit you show (other than, again, poor choice of opamp) is valid and is common enough to have its own name of "voltage follower".
Regulate 9VDC@7A PSU output down to 3 to 7.5 vdc at a 1Hz sine wave rate First post here. What would be a simple way to take the output of a switching 9vdc 7Amp PSU and produce a slow 1Hz sine type wave DC voltage that varies between 3vdc minimum and 7.5vdc maximum? Is this even possible? This will be used to do a final brush seating on small Hobby DC Motors that have been repaired or rebuilt. They will draw between 1-5amps depending on voltage applied and the current state of the brush seating. I'm trying to make this more automatic instead of doing the adjusting manually like I am doing it now. I have hobby level electronics skills, and already have several TIP122's, 2N3055's or LM338's if they would help. <Q> The easiest way to do this would be with a microcontroller. <S> You can easily create a lookup table that has whatever waveform you like (such as your offset sinusoidal waveform). <S> Just output it to a DAC periodically, 'rinse and repeat'. <S> For example, if you output a new voltage every millisecond you'd need a 1000 element table (or 250 if you use the symmetry of the sine wave). <S> Vo = <S> \$\text 5.25 + 2.25 V \sin(2\pi t) \$ <S> The maximum rate of change is the derivative of voltage with respect to time at \$n2\pi\$, which is 14mV/ms, so that would be the maximum step between DAC updates, which is about 8-bit accuracy. <S> Total cost < $10 plus the output amplifer- for which something like a $22 OPA541 (possibly overkill, but for a one-off perfectly justifiable) should work. <S> Set it up for appropriate gain and you're all set. <A> It is true that using microcontroller is fairly simple, but the same can be done with two op-amps and small RC network around it. <S> See this application note . <S> But, what both DAC and the op-amps can't do is to provide 5A output. <S> For that you will need amplifier. <S> Reasonably simple approach might be class B amplifier, if you do not care about distortion (the motor has large induction, so I don't think it will have any effect). <S> Make sure you will use fast Shottky diodes to cover for voltage spikes from the motor. <S> Search for 'H bridge' design considerations to see how to use them <A> Here's a very simple solution if you are happy with sort-of curvy triangle waves. <S> I suggest the OPA541 connected as a voltage follower as the output amplifier- <S> it will drive close enough to the positive rail while sourcing 5A. <S> There are cheaper solutions, but none are all that easy. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> This is just a standard astable multivibrator circuit with the voltage picked off the capacitor (must go into a high impedance load). <S> The capacitor can be an electrolytic. <S> R4 and R5 determine the 7.5V high level and R3 (through D1) determines the 3V low level. <S> R1 is used to roughly equalize the rising and falling times, and R1/R1/C1 determine the overall time. <S> If you increased the power supply to 10-12V <S> you could use the other half of the LM358 with a MOSFET voltage follower as the output amplifier (diode across the motor), but the power dissipation would be pretty brutal at 5A. <S> Using 12V for the op-amps and 9V for the power would work nicely and you could use a cheap logic-level N-channel power MOSFET and the other half of the LM358 rather than the expensive OPA541.
One fairly painless approach would be to use a MCP4725 12-bit DAC chip (inexpensive boards are available) with a small Arduino. The best would be H bridge, but this is maybe too difficult for hobbyist.
Why can't masters talk to each other in a I2C bus? I came across an I2C article which lead me to a question. Specifically this part is creating some confusion: "Also, unlike SPI, I2C can support a multi-master system, allowing more than one master to communicate with all devices on the bus ( although the master devices can’t talk to each other over the bus and must take turns using the bus lines)" Sparkfun Why can't masters talk to each other in a I2C bus if you supposedly have an unique address bit for each of the devices connected to it? <Q> A master starts a transaction by outputting the clock signal and the slave address. <S> A slave starts a transaction when it detects a clock signal and its own slave address. <S> Only one device can control the clock. <S> Therefore, an I²C transaction always must be between a master and a slave. <S> It is possible for multiple devices to talk to each other while initiating transactions on their own, but this requires that they stay in slave mode while idle and listening, and switching to master mode only when they want to start a transaction. <A> Only one master can be active at once - <S> this means that a master can only talk to slaves and slaves can appropriately reply. <S> If a slave were formerly a master then you could say there was a form of master-master communication. <S> You can't have two masters without some form of "understanding" between the two. <S> But it is down to the protocol - you could make an argument for a system that contained devices that were all capable of being masters and you could devise your scheme such that a master communique to a slave could contain a "bit" that indicated that the slave should "take over" being master. <S> That slave could then reply like a master (to the former master) and so on and so forth. <S> This would pretty much look like master-master communication <S> but, if you really examined things, it would still be master-slave comms. <A> An I2C Master does not have an address, only slaves have addresses. <S> All of the transactions on an I2C bus are pushed from or pulled to the master under the master's control. <S> However there is nothing to stop you from programming your masters to be 'dual-mode' devices and switch between master mode and slave mode on the fly. <S> Perhaps you could set up a system where all of the devices on you I2C bus default to being slaves (with addresses), but when one of them wants to initiate communication it switches to master mode & grabs control of the bus.
To have a multi-master scenario, there has to be relinquishment of master status by one device and acceptance of master status by another device.
Is it possible to eliminate output ripple of SMPS's by using two parallel SMPS's to produce outphase outputs to each other? simulate this circuit – Schematic created using CircuitLab Obviously it can not be that way. But why? Imagine one converter with a phase detector of its switching frequency, outputs a flag when the phase is 180° and other one synchronises its own oscillator to output an outphase ripple to other. Then it will be like below: Green one is the output sum of two AC ripples and the common DC. What are the reasons why this can not be done? <Q> Is it possible to eliminate output ripple of SMPS's by using two parallel SMPS's to produce outphase outputs to each other? <S> No. <S> However, some switching power supplies are multi-phase, which means they have multiple power trains in parallel inside. <S> This is usually done to increase the output current capability, but the phases are also usually run evenly staggered over a cycle to reduce ripple. <S> Eliminating ripple using two supplies would require each to having exactly the opposite ripple of the other, and then these two exactly averaging. <S> It should be obvious that's never going to happen. <S> Other than specifying absolutely 0 ripple, the main fault in your thought process is that the ripple of switching power supplies is unlikely to be something that is symmetric per half waveform. <S> Your diagram shows sine, for which this would work, but the ripple out of switching power supplies is more spiky than that. <S> Or, it can be a trapezoid output with fairly sharp rise, then slower decay, or sometimes a slow rise with fast decay. <S> Changes in the load will also affect the amplitude and shape of the ripple. <S> These kinds of waveforms 180° out of phase don't average to a flat line. <A> An n-phase switcher can eliminate all harmonics up to the (n-1)th. <S> Obviously in practice component mismatches and offsets cause some of this to be imperfect, but in practice very significant (10-20 dB) reduction is possible, and the peak-peak ripple at the output can be reduced, or equivalently, the output capacitance reduced for the same amount of ripple. <A> Some SMPS ICs have sync inputs/outputs. <S> With this type, it is possible to run multiple ICs in polyphase. <S> This increases the ripple frequency and decreases the ripple amplitude, making it easier to filter. <S> It might be easier simply to use a single polyphase controller to handle multiple switches. <S> Free running SMPS ICs without sync <S> I/ <S> O would not be easy, and may be impossible, to synchronise into a nice polyphase. <A> The voltage ripple on the output is the integral of current in the output capacitor(s). <S> If we assume the load draws a constant current then for the ripple voltage to be zero <S> the current delivered from the switch mode converter(s) must also be constant. <S> If the ripple current from the switchers was a nice clean sinusiod at the switching frequency then what you propose would be possible. <S> Instead as the name suggests it's a waveform resulting from switching, sometimes the current may be zero <S> (bucks running in "continuous mode" do deliver current all the time, boosts, flybacks and converters running in discontinous mode don't) <S> and when current is being delivered it's not quite at a constant rate <S> (how close to constant it is depends on the value of the inductor). <S> The exact shape of the waveform will depend on many factors including supply voltage and load current. <S> Having said that while your method won't completely eliminate ripple it will significantly reduce it. <S> We call this a "polyphase" converter and it can be done with any number of phases from 2 upwards. <S> For now lets assume that the waveforms from all the converters are time-shifted copies of each other and are periodic at the switching frequency (these are approximatations of relality but good enough for now). <S> We can view any periodic waveform as a series of sinusiods at harmmonics of the switching frequency. <S> If we have n perfectly matched phases then we eliminate any harmonics that are not a multiple of n. <S> In general lower harmonics tend to be larger than higher ones for most waveforms and on top of this the output capacitor is acting as an integrator which means high frequency ripple currents have much less impact on ripple voltage than low frequency ones. <S> This is done in practice, for example <S> http://www.linear.com/docs/4166 describes a converter IC that is designed to drive two phases directly and provides functionality for syncronising multiple chips to build converters with up to 12 phases.
While you can't eliminate all the ripple, you can eliminate all components at the fundamental switching frequency by using a dual-phase switcher.
What am i missing for this to work? (Zener Diode) Since the zener breakdown voltage is set to 5v, i actually thought that the voltage would be 0, since it goes directly to ground, I just wanted to try a "simple overvoltage protection". How is it that the voltage is 5v instead of 0? Without the diode, the voltage is around 22 volt or so. Can anyone explain why this is and maybe give a few examples on how to fix it? (This is my first time working with Zener Diodes) Thanks! <Q> You seem to be confusing the Zener action with a 'crowbar' circuit. <S> A Zener will limit the voltage whereas a crowbar circuit will short out the supply in the event of an over-voltage. <S> The crowbar short can usually only be removed by cycling the power. <S> The Zener diode will start to conduct in the reverse direction when the voltage across it reaches about 5 V. <S> From then on very small increases in voltage will cause it to pass an exponentially greater current. <S> At the same time the voltage will increase slightly above 5 V. <S> The problem with your arrangement is that if the regulator can pass, say 1 A, before going into limiting then your Zener has to handle all that power. <S> \$P <S> = <S> V \cdot <S> I = <S> 5 <S> \cdot 1 <S> = 5~W\$. <S> It will get hot. <S> Crowbar circuit simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Crowbar circuit. <S> This is a basic crowbar circuit. <S> When the supply voltage rises above 4.7 V the Zener starts to conduct. <S> When the voltage across R1 gets high enough SCR1 will be triggered and pretty-well short out the supply. <S> The thyristor has to pass all the current (1 A in our example above) <S> but this time the voltage across the device is only about 0.5 V so <S> \$P = <S> V <S> \cdot <S> I = 0.5 <S> \cdot <S> 1 = 0.5~W\$. <S> Cool! <S> The thyristor will stay on until the current though it is reduced to zero by interrupting the supply. <S> History lesson: the term crowbar protection comes from the railway third-rail electrification. <S> If the lineman saw a problem and needed an emergency isolation of the track power supply he would throw his crowbar to short the third rail to one of the running rails and trip out the breaker. <A> You said yourself, the zener breakdown voltage is 5 V. <S> That means it's going to clamp the reverse voltage across it to 5 V. <S> I can't imagine why you would think it should clamp it to 0. <S> If you want a voltage clamped to 0, put a wire across it. <S> The schematic is too small to easily read, but it appears you put the zener on the output of a linear regulator. <S> If the regulator is trying to put out less than 5 V, then the zener won't conduct, and it might as well not have been there. <S> If the regulator is trying to put out more than 5 V, then the zener and regulator will be fighting each other. <S> If the zener can handle whatever current the regulator can provide, then the voltage will be limited to 5 V, but both the zener and regulator will get hot. <S> Unfortunately, the maximum current is not defined, so you will have difficulty predicting exactly what will happen. <S> It's not clear what your purpose is in adding the zener to the output. <S> There are better ways to guarantee the output voltage won't exceed some value. <A> Others answered your question, let me just add that you can do this with trisils, also known as thyristor surge protection devices. <S> It behaves like the crowbar device explained by @transistor, but in single package. <S> It is essentially voltage controlled triac without gate. <S> It will give you voltage close to zero when it opens, which if I understand is what you wanted from your design. <A> The Zener diode is doing exactly what it is supposed to do - <S> it prevents the voltage across itself from rising above its rated voltage. <S> Above the rated voltage, the Zener current will increase rapidly of very small increases in voltage, as the Zener attempts to hold the voltage to its rated voltage. <S> If the power source can only supply a small current, the Zener will maintain its rated voltage. <S> With a more powerful voltage source, the Zener (or the voltage source) may be destroyed as the zener draws excessive current. <A> Zener diode has following characteristics <S> It will act as open circuit when voltage across its is less than clamping voltage Vz (5V in your case) <S> If voltage across its is greater than Vz, it will clamp voltage to Vz (5V in your case) <S> Red encircled point is point where you are operating your zener diode. <S> Since voltage across diode > <S> Vz, Output = 5v ( zener diode clamping voltage )
If you apply a slowly increasing voltage across a Zener diode, the diode will only pass an extremely small current, until you apprach the rated voltage, when the current will start to increase.
Power supply filter choke failure - how and why? Trying to repair a non-working Fiber to Ethernet Converter . When connected to power, the unit made a hissing/sizzling/scratching sound and the all LEDs glowed dimly. I isolated a small surface-mount choke on the input power side, filtering 12VDC input from wall-wart to input of main 3.3V voltage regulator. (Schematic below.) Removed this choke and replaced with a straight wire shunt. The unit powers up and works perfectly. I don't have an inductance meter, but the choke measures about 0.1 Ohms, so it's not burnt out. The voltage regulator is a LM2591HVT-3.3 (a 150kHz Buck switching regulator). I see a clear 150kHz signal at the input after replacing the choke with shunt. Before replacing, there was a very noisy signal at this point, almost impossible to see with my scope. Three questions:1) What actually failed inside this choke? Why does it "sizzle" when powered?2) What possibly caused this failure? 3) Is it OK to replace this choke with a shunt? What problems may arise from this modification? Output of power circuitry is now stable at ~3.4VDC and unit powers up normally. Thanks! Schematic: simulate this circuit – Schematic created using CircuitLab <Q> Quite likely, the choke isn't broken. <S> It is normal for chokes to act as speakers, especially under high momentary current (think of transformer hum on loaded transformers). <S> So your choke got noisy, because there are irregular current peaks across it. <S> You observed the irregularities on your scope. <S> The most likely reason for erratic voltage at the choke (causing erratic current) is instability of the regulator. <S> The idea of a switch-mode buck regulator is to draw current spikes at a high voltage and provide continuous current at low voltage. <S> In your design, the current spikes should be delivered from C1/C2, and the capacitors should get smoothly recharged through the choke. <S> If C1/C2 fail to source the required current, the input voltage of the regulator breaks down, up to the point where the regulator stops working. <S> If you replace the coil by a shunt, you lower the impedance if the external power supply, so the output filter cap can substitute C1/C2, at the cost of high-frequency components on the supply cable, so the modified device is likely to violate EMI regulations. <S> The proper fix in that case is to replace the input caps by new, proper low-ESR (important!) caps. <S> To check the health of those caps, a capacitance measurement is insufficient; you need an impedance or ESR test. <A> There are many options. <S> First of all, as said in the comments it's possible <S> it wasn't the choke, but the caps that have gone bad. <S> The choke is there to get out the buck converter's switching noise spikes, so that: The adapter isn't overstrained (adapters are cheap and designed on the edge of well) <S> To conform to EMI/EMC standards. <S> The second may not be an issue for you, the adapter will probably filter that out before it gets to the AC and possibly it will not couple from the DC wire onto anything else. <S> If it was the choke its inductance may have increased due to a mechanical default in the core. <S> But you should also make sure the caps aren't dry by looking at the ripple if you put in a small extra resistance in the supply path. <S> Or just replace them anyway with a couple fresh ones. <A> I'm not sure about the questions 1 and 2. <S> About Q3, in general yes, you can replace choke with the shunt. <S> The choke is there to filter out voltage spikes that occur when you plug the unit/turn on the switch. <S> It is recommended to use choke here, so C1 and C2 don't get (large) voltage spikes. <S> You can put in a random choke with inductance of few 100uH.
The external supply can not source the required current spike, because of the coil impedance at high frequencies. It's possible it was the choke after all.
Do I need a galvanically isolated step-down DC-DC converter to power my digital electronic from a battery pack that powers also the electrical motor? I have a battery pack with lithium ion cells. The battery pack has a maximal voltage of 84V (it goes from 84V to ~50V -> depending about the current state of charge). I use this battery pack to power all sort of things (lights, horns, MCU(BMS), inverter - that then gives power to the eletrical motor...). The inverter draws about 60A of current continuously from a battery pack when the motor is rotating. For my concept to work I must have different DC voltages on a single PCB: 12 VDC (for lights and horns) 5 VDC (for some sensors...) 3.3 VDC (for MCU, operational amplifiers...) The idea is to use some sort of step-down converters on the PCB to convert from 84V to 12VDC and to convert from 84V to 5VDC. And then to use a LDO to give me 3.3V from 5V. The 12VDC must have a power of ~40W, and the 5VDC must have a power of ~10W. The question is regarding if the step-down converter should have galvanic isolation (like a flyback) so that I can have different grounds for high voltage and low voltage? Or is OK to use a "normal" buck regulator? I think that for 12VDC that supplies the horns and lights is not so necessary to have different grounds as for 5VDC that supplies most of the electronic ? Any suggestion? <Q> Nothing in your description requires the derived voltages to be isolated from the battery ground. <S> Not isolating them will be easier, and it will be easier to get higher efficiency. <S> Tie all the grounds together. <A> The inverter draws about 60A of current continuously from a battery pack when the motor is rotating Not a small amount of current and, if you don't get your grounding sorted out correctly you might find tens of amps trying to flow through the wrong ground return wires and hurting your MCU. <S> Therefore there is a case for providing galvanic isolation to your sensors (5V) and <S> MCU (3V3) supplies because, although your MCU may need to connect to ground at the motor controller, having isolation in a potential ground return path could save you lots of heartache and dollars. <A> using it can make the system design much easier. <S> In a high power system with both voltage and current significantly higher than in a normal logic system you can develop voltage drop on the wiring both DC and transiant. <S> The transiant volt drops can be especially nasty since while you can easilly reduce the resistance of wires by making them fatter <S> it's very hard to reduce the inductance. <S> That is ok if the high and low voltage parts of the system don't interconnect at all or if they meet in exactly one place <S> but it becomes problematic if their grounds are interconnected in more than one place. <S> The voltage drops on the power grounds can then cause voltage differences in the signal grounds. <S> If those voltage differences get too big <S> it can cause misbehaviour and/or damage. <S> I assume your MCU will be connected to the motor controller. <S> If it is and if the motor controller doesn't have galvanica isolation between it's control and power sides then you have already "spent" your single connection between signal and power grounds. <S> So you should use an isolated converter in your circuit. <S> On the other hand if the motor controllers control input is galvanically isolated then you can get away without isolation in your circuit.
It depends, if you are careful you can often go without galvanic isolation but
Where are these 50Hz noises from? Circuit structure: An AC to DC power converter MeanWell 220V to 5V . The output is 5V. The power grid runs at 50Hz. We build DC-DC converters(Power Module) with multiple orders of Low pass filters to provide different DC voltages needed for our main circuit: +5V, +15V, -15V Main circuit uses the voltages generated above. It provides control signals to its target and reads feedback signals. It connects with target through 2.54 mm dupont wires, which are around 0.3 meters long. It will adjust control signals according to the feedback signals. The target device has purely differential receiver and shall not be influenced by common-mode noises. Problem: The whole circuit runs normally at our companies lab. The circuit is not connected with earth. When used in some Lab with many devices(scopes, signal generators and etc.), it does not function well any more. The feedback signal looks like following, which is 50Hz noise. When the circuit ground is connected with earth, the 50Hz noise will be reduced greatly. It starts to work. There are still 50Hz noises which do not exist when in my Lab and it harms the device performance. Questions Where are the 50Hz noises from? Why the noises are reduced when connecting the circuit with earth? How to remove the 50Hz noise totally? <Q> You say the target has a differential receiver, but you don't say if the "main circuit", which is receiving the feedback signal from the target, uses a differential receiver, or what the signalling levels of the feedback signal are. <S> Even assuming a differential circuit, any real differential receiver has a limited common-mode range, which you could easily be exceeding. <S> Connecting your system ground to earth ground likely reduces the common-mode 50Hz noise to a level that your receiver can tolerate. <S> Switching power supplies such as the one you show generally will have a capacitor bridging across the gap between the primary (mains) and secondary (output) side (commonly referred to as a "Y" cap). <S> Its function is to reduce interference generated by the power supply switching circuits. <S> Because of this capacitor, and the parasitic capacitance between the primary and secondary of the transformer itself, the output of the power supply can have a very large (>100V) <S> AC voltage with respect to earth ground superimposed on it. <S> This AC signal has a relatively high source impedance, because the capacitor is relatively small, and thus has a high reactance at the mains frequency. <S> Because of this high impedance, it is not a safety hazard (unless the capacitor shorts, which is why specially rated capacitors are used for this function), but if you have a high impedance signalling circuit, this can overwhelm it. <S> When you test in your lab, if both the main circuit and the target are floating with respect to earth ground, then everything is riding this AC component together, and there is no problem. <S> When you take it to the real world, if the target device has a connection to earth ground (even a small capacitive connection), now you have a large potential difference between the main circuit and the target, and the problem occurs. <S> By also connecting your main circuit to earth ground, you greatly reduce the potential difference between the main circuit and the target, so your receiver is able to function. <S> You also don't give much information about the distance between the main circuit and the target device, the type of cabling used, and so on. <S> The more information you provide, the better the answer you're likely to get. <A> The 50Hz noise is mains hum. <S> Any time you pick up noise at the same frequency as your mains hum, assume it's from the mains (once, maybe twice in a lifetime it'll be a wrong assumption, but every other time it's right) <S> Pretty much the only way to get rid of picked-up noise (mains hum, emi/rfi, whatever) is to ground it out. <S> From your updated question post, it looks like the noise is appearing on a (possibly long) wire carrying a non-differential signal & coming as data feedback from a (mains powered?) <S> "slave" device. <S> Either the hum is originating from within the "slave" device due to some power supply noise to it (likely due to poor wiring & other noisy devices on same circuit), or it is being picked up by the wire as EMI/RFI. <S> If it is being picked up as EMI/RFI (some part of it almost surely is), then switching to differential signalling could "fix it." <S> If it is coming from the "slave" device somehow, then there may be a need to add some 50Hz filtering &/or grounding in that device, to eliminate the noise before it gets onto the data line. <A> According to travel websites and Wikipedia, China uses 50Hz power. <S> Any alternating current gives off electro-magnetic radiation with the same frequency. <S> This is a likely source of the noise. <S> If you test any circuit in the same way, you are likely to find the same noise. <S> Try this before looking for other solutions.
As others have said, the 50Hz is almost certainly mains-related.
Why there is no decoupling capacitors in analog IC Here is a CMOS two stage amplifier. As you can see there is no decoupling capacitor at all. Also I don't see decoupling capacitors that are used in CMOS integrated circuits. Could you explain why? Thank you for help. <Q> Decoupling capacitors are used in digital circuits to suppress the high-frequency noise generated on the supply line (Vcc or Vdd) as a result of the rapid switching inside the chip. <S> The signals that are switching are usually square waves, which generate a lot of harmonics. <S> These capacitors fulfill dual roles -- they provide a little energy reserve to suppress voltage spikes inside an IC, and they help suppress any voltage spikes on the supply line outisde the chip from getting in. <S> Analog circuitry, on the other hand, usually doesn't switch as fast as digital IC's do, and even when it does, the signals usually aren't square waves so they don't have as many harmonics. <S> Still, it is recommended to put decoupling IC's on all analog chips like op-amps. <S> They are especially needed for analog devices that have a poor power supply rejection ratio (PSSR) to avoid power supply fluctuations from affecting the output. <S> In either case, decoupling caps are almost never found inside the IC's; as others have pointed out, they are usually separate components placed next to a chip between the power and ground pins. <S> Values of 100 nf (0.1 µF) and 10 nf (0.01 µF) are often used. <A> As many people could and have pointed out, capacitors are large. <S> If left outside the chip, it makes IC design easier to manage. <S> This means we need them outside the IC. <S> It does not mean, however, that we need a capacitor package on the surface. <S> By keeping them outside the package we have allowed for the layout specialists to get creative. <S> The layout specialists will sometimes create layers with a given surface area, distance between them, material, etc. <S> in order to create a capacitance between them. <S> You can then use the internal layers as a capacitor. <S> This means that by keeping them on the outside of the IC we can give designers more flexibility. <S> They can choose to place the caps next to the part, a little further away, on the opposite side of the board, as internal layers (whatever gives us better results). <S> This is a good thing in the ever shrinking HDI world. <A> Very large cap are placed outside of the chip, however, it is usually good practice when you do the IC layout, to use any spare area, and fill it with decoupling cap, sometime the designer will have those cap already in the schematic but not necessarily, this will help with not only the performance of the amp/block but also with other process requirement like metal/poly density. <S> It is also not unusual in RF part, to see the design term specify a minimum decoupling cap to be inserted - as many said this has a cost in term of area, that actually lead to creation of MOM cap which can be layout over circuitry.
Decoupling caps are required to not only make your circuit behave more reliably, but also to reduce emissions to enable it to pass FCC certification.
How to measure servo potentiometer What's a reliable method of getting a clean measurement of the potentiometer in a hobby servo? I've modified a servo for directly polling its position by soldering a wire onto its potentiometer's center lead, as described here . I then wired this lead to an Arduino's ADC pin, but I'm finding the readings to be extremely noisy even when the servo isn't moving. I tried using a moving average to smooth the signal, but even that results in jittery value. Is this just the nature of a servo's potentiometer, so is there a better way to wire to clean the measurements? Edit: By "noisy", I mean even when the servo wasn't moving, the ADC measurement taken by the Arduino could vary by ±50 units between readings. <Q> What is connected to the other two leads of the pot? <S> The linked page is vague about how that's handled. <S> If it's power and ground, how clean is the power in question - if it's the same power that's being supplied to the motor, it may be a bit filthy when the motor is running, anyway. <S> If you were "following" that vague page and the center pin is the only thing you connected - well, there's your problem - give it clean power and ground and things will get much better. <S> Try some capacitance (aka, a low pass filter) between the ends of the pot on the one hand, and between your signal input pin and ground on the other. <A> There should be no noticeable noise whatsoever on the potentiometer wiper if it never gets disturbed. <S> The noise is coming either from the power supply of the arduino, the digital logic of the arduino itself, other components on the same power supply or the environment: is the motor of the servo being operated? <S> Brushed motors are infamous for the electrical noise they spew out. <S> Is the pot connected with long wires to the arduino? <S> They could pick up interference from the environment, such as 50/60Hz mains hum. <S> is the aref pin connected to anything? <S> What are the ADC settings? <S> What are you powering your circuit with? <S> Some power supplies are very noisy, especially cheap switching mode ones. <A> Also you may have to look at common grounding point resistance. <S> A cheap servo may have very little designed dead zone and can generate motor drive pulses continuously even if the set point is not disturbed, this will cause current spikes (possibly random or alternating polarity) in the common ground. <S> To test this solder (rather than use flimsy press fit servo terminals) <S> a robust wire from your controller ground plane to the ground point on the servo PCB. <S> Then consider stopping the servo chatter by sampling the voltage just before you send a servo control pulse. <S> Most servos go idle if the control pulses disappear and there will be almost no current drawn by the servo control IC. <S> Consider a differential measurement. <S> If the ADC has a awesome vRef but the servo is using the internal pot voltage as the reference <S> you may be measuring random servo reference voltage movement that is irrelevant to the servo but a huge uncorrelated gain error on your reading. <S> Place another sense connection to the top of the POT (assuming the tail is grounded) and calculate the position based on the relative values measured. <S> Lastly you could try shielded cable for the sense connection if you have some high currents in the vicinity. <S> The screen if robust could double as your heavy ground conductor. <S> Always remember ground loops though <S> in this case you can say they should be constrained as your two ground conductors are only feeding one isolated device from one controller and the heavy gauge wire will form part of the measurement path anyway.
If you have access to an oscillosope, look at the signal from the wiper (center pin), and at the supply (across the end pins of the pot.) A bad reference will ruin measurements, while clocking the ADC too fast may cause spurious readings.
Powering and operating dual electric linear actuators I am in the process of building a height-adjusting desk. I am pretty good with computers (I'm a programmer), but I never learned much in the way of electrical engineering. I recently purchased two Eco-Worthy brand linear actuators. They each have an 18-inch stroke and a 320 lbs. static load bearing capability. They just have two wires, the positive and the negative wires. They are supposed to operated at 12 volts with a 1 amp minimum and 3 amp maximum. I intend to operate them both at the same time in the same direction. So what I am unsure of is primarily the power source. My understanding is that I would still use a 12 volt power supply to power both at the same time. But will I need it to have a 3 amp output or more than that? Will the amperage be reduced as it is divided among devices? Am I misunderstanding how this should work? Also, if I get a momentary rocker switch will I wire both together and then to the switch? Should I get a relay to run this through? Any recommendations on how I hookup the A/C power to it? Since it won't have any plug inputs. Here is a link to the info about the actuators I purchased. Any help in figuring out the electrical setup is welcome. <Q> The amount of current drawn will depend on how much force is pushing against each strut. <S> If you only need to operate one strut at once, then a 3A supply will probably do. <S> You could, in the simplest case, wire them directly in parallel. <S> However, it is unlikely that they will move synchronously unless they are directly bolted together, e.g. if there's one at each end of the desk they may become misaligned and jam or break the desk. <S> So probably you want a separate switch for each strut so that they can be controlled individually. <S> You will also need some means of reversing the polarity in order to change the direction of travel. <S> The usual means is a DPDT switch or relay; you can google up a schematic pretty easily. <S> If you buy switches rated for at least 3A (one strut) or 6A (both struts) <S> then those switches can directly control the motor current. <S> More likely is that you might buy smaller/cheaper switches which actuate the coils of large (10A) relays, which are responsible for enabling and reversing the power. <S> Edit: you might want to look into building your desk so that it has a single central strut to perform the lifting work, supported by stabilising arms/scissors/whatever at each side of the desk. <S> That way, there are no alignment issues and no need to synchronise two struts. <S> If your lifting geometry results in more than 150kg load on the single strut, you could probably put the two right next to each other and they would be mechanically synced and provide up to 300kg of support together. <A> Each device must meet specification; if you have 10 of these in parallel then you would need a 12V source capable of providing 3x10 Amps, or 30 Amps. <S> "Unit can be controlled with a double pole, double throw switch or with the built-in position sensor and optional linear actuator programmable controller. <S> " <S> Regarding the programmable controller inside, good luck getting the specifications to communicate with it as this isn't easy in my experience <S> but you can contact the vendor <S> and they should provide them to you. <S> Some things to think about, are what happens when it gets to the end of its extension? <A> [Character limit on comments is frustrating, so here's a full Answer.] <S> @RobertHana <S> , I don't think there's a programmable controller inside. <S> I think the optional controller they're referring to this: http://www.eco-worthy.com/catalog/worthy-single-axis-complete-electronics-tracker-controller-p-323.html <S> As to what happens at the end of travel, they claim it has a built-in limit switch. <S> Not clear exactly how this works given <S> there's only two wires and you presumably reverse the polarity to reverse the direction. <S> Dunno... <S> @WilliamBrodie-Tyrell, my first reaction was the same re the struts getting out of synch. <S> FWIW, the adjustable desks at my office have one motor mounted in the center driving a shaft that runs across the back to the side pillars. <S> The web page says: Unit can be controlled with a double pole, double throw switch or with the built-in position sensor and optional linear actuator programmable controller. <S> (Emphasis added.) <S> The odd thing is that I can't see anything in the pictures or the text that suggests the existence of a connection for a position sensor, or a description of how the sensor works. <S> I doubt that it would have any sort of fancy absolute position encoder, but even a single pulse per revolution of the jack screw would be useful. <S> @pthurmond, is it possible that there are more than two wires in that cable, or is there any evidence of any other electrical connection on the device? <S> I don't know what sort of programming you do, but if you wanted to get into embedded stuff, you could do a nice little project with an Arduino or something like that to look at the output of the position sensor and control the motors accordingly to keep the two in sync. <S> That's assuming there really is some sort of position encoder, that is.
This way only one motor is required and the struts are mechanically locked in sync. They could have a diode arrangement so that when the switch opens at one end of travel the motor stops, but reversing the polarity bypasses the switch and allows it to come off the stop. It looks like you can control it with just a DPDT switch. You want to buy a switching power supply with a 12V output capable of at least 6A if you want to be able to operate both struts at the same time under full load. If one is under more load, it will move a little slower.
Car battery capacity in colder countries The capacity of the battery is affected when the temperature drops, particularly Lead-acid batteries. So how in cold countries this situation is solved. In this PDF about automotive batteries at low temperature, they have mentioned the specific gravity of the electrolyte is affected when the temperature dips proportionaly the charge as well. This also observed from the graph. And also is there is any possibility, I have load of 2 amps apart from starter will it function when the battery capacity is reduced to certain low percentage(eg. 50%) at the time of temperature drops. <Q> "The capacity of the battery is affected when the temperature drops" <S> That is incorrect <S> , it is not the capacity (amount of energy stored) <S> that gets lower at lower temperatures. <S> It is the internal resistance of the battery which increases and this lowers <S> the current capability of the lead-acid battery. <S> So you will be able to draw less current (and power) from the battery at low temperatures. <S> The amount of energy stored does not change. <S> If a lead-acid car battery is in good condition it will still be able to start a car even under cold conditions. <S> A workaround could also be to turn on the lights of the car before starting, now a current will flow warming up the battery and increasing it's current capability. <S> Of course you should only do this when you are sure that the battery has enough stored energy. <A> So how in cold countries this situation is solved. <S> It helps to keep the car in a garage, particularly one that is attached to the house. <S> In cold places, outlets for engine heaters are often installed in front of parking spaces at motels and apartment buildings. <S> I have occasionally taken the battery out of my car and warmed it with hot water in the kitchen sink. <S> Many people have a battery charger. <S> I have occasionally assembled a charger by connecting a rectifier to a big variable transformer. <S> In cold places most people keep jumper cables in their car so that they can get assistance from any willing person who has a running car. <A> The standard method of measuring the capacity of a battery is to use a variable load that draw a constant current from the battery. <S> For some small battery and current you can use a regulated power supply in series with battery and connect them to a load, to draw a constant current from the battery.
It helps to install an electric heater to keep the engine warm or to warm it up before attempting to start the car.
Short circuit when probing live ATX power supply primary section with voltmeter I was probing around an old ATX PSU to inspect voltage levels in the primary section. The first 15 minutes went smooth (bridge rectifier inputs, big caps, Power IC Vcc, etc..) but as soon as I probed the solder pads of the large coil circled in red in the picture, a short happened with the usual bang, sparks and smoke. First question: what is that large coil (Hi-Pot) connected to the primary side? Is it part of the EMI reduction circuit? Second (probably stupid) question: my DMM has 10Mohm input impedance when used as voltmeter. How can I cause a short like that if I am careful to ensure that meter probes do not touch one another and that I do not short any PCB tracks with the probe tip? I am extremely careful when I work on energised circuits, so I am rather annoyed by what happened as I may make the same mistake again if I do not understand exactly what I did wrong. A last question related to general safety: is there any difference between using a 1:1 (230VAC -> 230VAC) isolation transformer vs connecting the appliance to be probed directly into the mains using a lead without the earth wire (or with such earth pin isolated/disconnected)? Thanks to the community for your precious help. <Q> I'm not sure what the big inductor is for. <S> It doesn't look like part of an EMI filter to me, since that would typically be a common mode choke with four leads, and this apparently has only two. <S> (That's probably a common mode choke on the circuit board next to the the torroidal inductor, labeled FL3, with the white bobbin and the ferrite core.) <S> It's also rather large for that. <S> My guess (and it's only that) is that it may be part of a power factor correction circuit. <S> BTW, "HI POT" is short for "high potential", and generally just means that it has passed an insulation breakdown test. <S> I don't have any really great theories about the short, except to say that, especially if you're running on 230VAC mains, the peak voltages in such circuits can be quite high, especially in circuits with big inductors. <S> So it's possible that you didn't even make true metal-to-metal contact but simply decreased the air gap just enough to cause an arc. <S> Re the isolation transformer, YES, there is a difference! <S> Please use the isolation transformer! <S> Disconnecting the safety ground lead on the equipment under test doesn't remove the potential between the hot circuit and earth ground, so you are still exposed to danger. <S> Even with a well-insulated, floating DMM, you can still have an accident. <S> Sometimes engineers will float the ground on oscilloscopes so that they can probe line-side circuits, but this is still dangerous. <S> An isolation transformer is the only reasonably safe way to work on these things. <A> Amanda, and welcome to the site. <S> Assuming your power supply looks something like this , your coil is the primary input inductor, shown at upper left in the schematic. <S> Now, what happened? <S> Having been in similar situations a few times, I'd guess that you got distracted. <S> You were holding both probes to the board, looked away at your meter, and BANG!. <S> When you twisted your head your body followed, your grip on the probes shifted and you did, in fact, short out the probes. <S> This put something like line voltage across your poor little coil, and it went to that Great Junkyard In The Sky. <S> Very sad. <S> Of course, that sort of excitement is (deep down) <S> what draws a lot of us to messing around with electronics. <S> Please excuse FakeMoustache's response. <S> He was just a bit appalled that you're putting yourself at risk by poking around in mains-connected circuitry without knowing much about what you're doing, and he's right <S> - it's dangerous. <S> You can take various precautions, but sooner or later you'll get something dramatic happening. <S> Actually, you got off lightly. <S> Very early in my career I lost a perfectly good pair of wire cutters when I tried to cut a live power cable. <S> No shock involved, but the cutter edges were toast. <A> There is a reasonably-good chance that in fact, your meter's internal insulation failed and arced-over internally. <S> If so, it's probably part of a boost supply that generates a nominal 400 Vdc. <S> But that's only a Wild-Assed-Guess (WAG). <S> Regardless, many inexpensive DMMs are NOT constructed as they should be and do not have adequate clearance and creepage distances internally. <S> They may work properly to their rated voltage but they simply can't withstand any sort of transient spikes. <S> Interestingly enough, old-school analog meters <S> ARE properly constructed internally and will often withstand many times their rated voltage without suffering insulation failure. <S> I'm talking about the old Simpson 260 or Avo meters from years gone by. <S> Part of that construction is because those meters were used to troubleshoot tube-type equipment with plate voltages of 250 to 450 Vdc or higher. <S> It was not uncommon to see plate voltages well in excess of 1KV in transmitters. <S> Add to that <S> the peak voltage swing that occurs with AM modulation - that 1KV plate supply swings up to almost 2KV peak. <S> Those old meters could (and did) withstand those voltage levels with no problems. <S> Modern DMMs made by reputable manufacturers such as Fluke are built to deal with those kinds of voltage levels. <S> However, many of the inexpensive DMMs that come out of Asian factories are not. <S> There are documented cases readily found with Internet searches of injuries caused by those inexpensive meters being used on 480 Vac power systems. <A> Please see Benchtop circuit breaker where I address some of the questions you raise concerning isolating transformer. <S> simulate this circuit – <S> Schematic created using CircuitLab Figure 1. <S> Benchtop mains power supply - modified for 230 / 115 V operation. <S> For working on switched-mode PSUs risk can be reduced by using a centre-tapped transformer to give 115 V where the PSU is so rated. <S> A last question related to general safety: is there any difference between using a 1:1 (230VAC -> 230VAC) isolation transformer vs connecting the appliance to be probed directly into the mains using a lead without the earth wire (or with such earth pin <S> isolated/disconnected)? <S> The danger with disconnecting the earth wire is that the case and heatsinks may go live due to poor insulation somewhere. <S> Another concern may be that the secondary is earth-referenced and that may go live-ish too.
I honestly don't know what that off-board inductor is used for but my guess is that it's part of the Power Factor Correction circuit. Since these present much larger areas and 3D shapes they may be touched accidentally.
Would you prefer a voltmeter or a scope when measuring average voltage precisely? As far as I understood the DC setting of a voltmeter or a multimeter is measuring the average value of a periodic voltage signal(not rms but the average value). On the other hand, an oscilloscope as well in DC coupling mode also measures the average value of the signal. Which one in general measures more precise? Why? <Q> Scopes are designed to plot waveforms so you can see what the wave-shape looks like. <S> While modern scopes have the ability to do a lot of other things with the data gathered from the ADCs they are not designed as precision measurement devices. <S> The downside of a basic multimeter is you typically don't have control over the averaging length. <S> If the averaging length is too short compared to the waveform you are measuring then your result won't be an accurate represention of the long term average (and your display will jump around). <S> If it's too long then the reading on your meter will take an annoyingly long time to settle. <S> The more accuracy you need the longer the averaging period you need. <S> Looking at <S> Why do DMMs have so low update/refresh rates? <S> it seems that ordinary multimeters make about 4 readings per second. <S> High end bench meters often have settings available to adjust the averaging behaviour. <A> It depends what's important to you about the signal. <S> There are two issues, accuracy, bandwidth and waveform shape. <S> There are four issues ... <S> If you want <1% accuracy, you need a suitable meter. <S> If you can tolerate >1% error, a 'scope may do. <S> However, a meter averages over a certain period, which may or may not be specified in its documentation. <S> You may assume it will always handle mains frequency ripple, but is unlikely to go slower than 1 second (users like quick response) and faster than audio (unless it's a specialist meter). <S> The meter on your bench may or may not be suitable. <S> A cheap meter will always give you average, which may be OK for your applciation (average current through an electrochemical cell for instance), or no great accuracy required. <S> A more expensive meter may well have true RMS reading (if it has, it will say so), which is better for the heating effect of a current for instance. <S> While a scope will not have the accuracy of a meter, a modern digital scope will generally allow you to specify a time gate, and do measurements within that. <S> That will allow you to cope with very low frequencies and still make averaged measurements. <S> Generally they have the bandwidth for audio measurements and then some. <S> The nice thing about a digital scope is that you can often dump measurements to a PC. <S> Once there, you can make whatever analysis you want of the signal, within its limited accuracy. <A> I would trust a DMM more than a scope for accurate DC measurements. <S> The other answers here already have good technical information, so here's a practical demonstration using VirtualBench: DC Measurements: <S> DSO vs DMM <S> (YouTube link) <S> The test signal is a 100 kHz square wave with a small DC offset from the function generator. <S> The signal is being measured by both the oscilloscope and the DMM. <S> The scope measures both the signal's mean and RMS (as defined by IEEE 181-2011), and the mean is within 2-5% of the DMM's measurement, hinting at how the DMM measures DC Volts on periodic signals. <S> Changing the duty cycle of the square wave changes the mean, and both the scope and DMM reflect that, but the scope still has some error in the single-digit percents. <S> Even enabling averaging on the scope doesn't improve its accuracy much.
There are three issues, accuracy, bandwidth, waveform shape and whether you have access to a suitable instrument.
What is the difference between high precision resistors and current sense resistors Actually, I am trying to build a current monitor for a wireless sensor network. I am going to use a current sense resistor as the current will pass through the resistor. By measuring the value of the voltage, the current value can be calculated. My application is very sensitive as the current that will be measured is in the range of mA, 30 mA maximum. When it came to buying the resistors I got confused. I found a type of resistor called "precision resistor" that has a very small error, and another one called "current sense resistor". Here is a picture of a current sense resistor: So my questions are: What is the difference between these two types current sense and precision resistors? How does this current sense resistor differ from the ones we normally use, such as as these 5.6k Ohm, 5% resistors? <Q> Resistors are resistors. <S> They only see the current thru them and the voltage across them. <S> However, specific models can be targeted to specific applications. <S> What you show as a current sense resistor looks like it's designed to dissipate significant power. <S> However, it would work for lots of purposes within its power and voltage limits. <S> Current sense resistors tend to: Be run with little voltage across them. <S> Be fairly accurate, since being used for measurement. <S> Drift little due to temperature. <S> Have low values. <S> Sometimes have 4 leads so that you can use a Kelvin connection. <S> Two leads carry the current, then the voltage is measured across the two other leads. <S> This keeps the voltage drop due to current in the leads off the measurement. <A> There is no absolute difference between the two. <S> Current sense resistors are generally low-value, high-power resistors. <S> They are intended to develop a small voltage for a given current, so they are low in value. <S> When used in power supplies they may well carry significant current and dissipate significant power, so they tend to be high-power units. <S> For many applications they are not used to measure current with high precision, but this is not guaranteed. <S> Precision resistors are simply resistors which have stable, well-defined resistance. <S> The existence of non-zero temperature coefficients means that, for a similar size a very high precision resistor will be limited to lower power than a non-precision resistor, although this does not apply for precisions of 1 % or less. <S> Your picture of a current sense resistor shows a unit which (if you look at it closely) has 1 % precision. <S> The other picture shows resistors with 5% precision (the gold band at left), so they are lower-precision than the current-sense resistor which you show. <S> In your case, you need to measure 30 mA. <S> What voltage are you willing to drop across the resistor at this current? <S> Let's assume that you want 0.1 volts. <S> Then the resistor should have a value of $$R = \frac{V}{i} = \frac{0.1}{0.03} <S> = <S> 3.33 \text{ ohns} $$ and at maximum power it will dissipate $$P = <S> i^2 R = <S> (.03)^2 <S> \times <S> 3.33 = 3\text{ mW} <S> $$ <S> As a result, if 0.1 volts is acceptable, you can use a standard 1/10 watt, 1% resistor. <A> Normal resistor, precision resistor, and current sensing resistor, they are all resistors, but they are all different. <S> Current sensing resistor has higher accurate value when giving in a load because heat will alter the resistance of a resistor, even a precision resistor, but not a current sensing resistor. <A> That current sense resistor is possible to mount on a cooling surface (PCB or heatsink) <S> so it does not overheat. <S> If this is needed is entirely up to your application. <S> The power loss in the resistor will be: P = I^2 <S> * R <S> Some current sense resistors also has two more terminals to be able to measure the voltage over the resistor even more accurately. <S> These usually connects directly at the middle of the resistor. <A> A high precision resistor, refers to the accuracy used by the manufacturer to produce the resistor. <S> For example, a manufacturer tries to make 100 ohm resistors, but the variability of the process makes resistors that are between 99 and 101 ohms, then he has 100 ohms with +/- <S> 1% tolerance. <S> A current sense resistor , refers to a "special type" of resistor used for a particular application . <S> There is no reason why you could not have any of the four possible combinations: 1)low precision regular; 2)low precision current sense; 3)high precision regular; 4)high precision current sense. <S> You can also have any of these with a "low temp coefficient. <S> " It's all a matter of more or less cost.
Precision resistor has high accurate value than normal resistor.