source stringlengths 620 29.3k | target stringlengths 12 1.24k |
|---|---|
Current limiter for NiMH battery charger I am trying to learn about electronics by making my own MCU controlled battery charger for standard AA 1.2V NiMH and NiCd batteries. The supply voltage is 5V from a USB battery pack. I did a lot of reading on http://batteryuniversity.com/ , as well as studying Energizer and Panasonic battery charging guides. I now have a very crude working prototype which controls the current input into the battery by stepping down my 5V down by burning some energy through a transistor and a diode. I have expermentaly found the amount of voltage step down required for 700mA into the battery, but this is highly variable depending on my power supply (which is highly annoying). Now that I have the proof-of-concept working, I'd like to do the power circuit right. Controlling the voltage can obviously be achieved better with a switching voltage regulator, except that I am not really looking to hold the voltage constant. What I really need is constant current (let's say 700mA), and the voltage can vary as needed. I have no idea how to build this kind of circuit. Are there "current regulators" that I can buy just like voltage regulators? Is this something I can build by measuring the voltage drop on a sense current resistor? I am looking for suggestions on how to solve this problem cheaply, as well as any relevant reading material. Thanks! <Q> You may be looking for something more like a battery charger IC rather than a buck regulator IC. <S> Basically a buck regulator that better understands current limit mode, which also includes charge termination and other battery protections in the same IC. <S> However, these are generally meant to operate standalone, <S> so they might not give you the opportunity to program your own MCU code. <S> Still, you can learn what features you might want to aim for in your own circuit by checking out what such a solution typically offers, and why they are important. <S> For example: http://para.maximintegrated.com/results.mvp?fam=batt_chrg&168=NiCd|NiMH <A> There are probably better circuits, but this one's interesting and easy to understand. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> If you take a 5V regulator, and put a fixed resistor across its output, then it will supply exactly enough current (100 mA) to put 5V across the resistor. <S> Anywhere in series with that circuit the current will be 100 mA also. <S> The resistor "Your Load" is supposed to represent your battery. <S> An obvious disadvantage is that you need enough voltage to keep the 7805 in regulation, but the principle is sound. <S> You can use a 3V regulator, for example. <S> Or an adjustable one. <S> This may aid in understanding some of the other current regulating circuits. <A> This will initially convert the input voltage via a boost circuit to above 5 volts and then use a buck regulator to convert to about 4 volts. <S> The added complication is that the buck regulator has to operate as a constant current source. <S> However, there are plenty of circuits that will do this and, standard buck voltage regulators can be easily made into current sources. <S> I'd look at what Linear Tech have to offer - they have great search engines for their parts and always provide app circuits on data sheets. <S> 1 hour from now you should have what you want. <S> If, on the other hand your input voltage is steady at 5 volts then a buck regulator is all you need. <S> The op has edited the question and now the battery voltage is somewhat less than the 4 volts specified. <S> However, a buck reg is still the best choice and LT are a good candidate for finding a suitable part. <A> You can do it with a linear regulator, but just barely. <S> Use an LM317. <S> Connect your +5 to the input. <S> Connect the output to a (nominally) 1.78 ohm resistor, minimum 1 watt, and 2 watts or more is better. <S> Connect the other end of the resistor to the control input of the LM317 and to the high side of the battery. <S> Connect the low end of the battery to ground. <S> When charging, the LM317 will maintain the voltage across the resistor at 1.25 volts, and give you 700 mA. <S> In operation, the battery will show a maximum of ~1.6 volts, the current limit resistor will drop 1.25 volts, and the regulator requires a minimum of ~2.2 volts to operate correctly (see Dropout Voltage on the data sheet). <S> So the voltage in needs to be a minimum of 5.05 volts. <S> And I do believe that counts as "just barely". <S> If you actually want a little margin, cut back the charge current to 500 mA. <S> This will be slightly easier on the regulator and give you about 0.1 volts margin. <S> That's still "just barely", but a little less so. <S> An LM317AHVT in TO220 package will cost you $.75 from Digikey. <S> Make sure you get a small heat sink. <S> A Linear Technology LT317AT has a dropout voltage a couple of tenths of a volt lower, and would be a better choice. <S> It's available from Digikey for about $4.00.
| If you need to provide circa 4 volts to the battery and have an input voltage that ranges from 2 volts to 5 volts then you need a buck-boost converter.
|
Do I need biasing resistors on the +/- lines for RS485? I know I should have a terminating resistor on RS 485. Do I need biasing resistors on the +/- lines of an RS485 differential signal? <Q> Not having bias resistors means that you could have false received data. <S> Typically you'd have one resistor from A to +5 and another resistor from B to GND and a third resistor from A to B. <S> The values are chosen so that the voltage level such that the logic level is defined (200mV or greater) and the desired differential termination resistance is presented. <A> The biasing resistors are meant to put the differential bus voltage into a defined state, even when the bus is not actively driven or is in a fail state. <S> In RS485 application notes, the fail states are described as something like open circuit short circuit idle bus <S> (well, this is not really a fail state) <S> However, most RS485 transceivers already have built in functionality to address this. <S> For example one of the features in the data sheet from the SN65HVD485E from TI states "Bus-Open-Failsafe Receiver". <A> Not normally. <S> Maybe you've seen circuits that do put biasing resistors on? <S> Were the signals somehow ac coupled either via a transformer or maybe capacitors? <S> If so then bias resistors will be needed. <S> I've seen terminator resistors split into two resistors, one for each wire and these might give the impression they are biasing resistors but more likely they are trying to terminate the normal signal AND provide common mode termination.
| If you need to have a guaranteed level when no transmitter is enabled then you need biasing resistors (assuming a receiver that does not have a built-in offset, as some Maxim parts have).
|
Circuit for a DC motor with 2 microswitches reversing direction So here is what I am trying to do... have a DC motor wired to an on/off switch and 2 microswitches. Each switch will reverse the direction of the motor, so one switch tells the motor to go forward, the other tells the motor to go reverse. My goal is to have a track where the motor will pull a platform in one direction, then when it gets to the end of the track it will hit the switch and then cause it to go the other way down the track. And I would also like to include an on/off switch for the whole circuit. I am just curious to know what the best circuit for this will be. My initial thought is to use a DPDT switch but not exactly sure how to get that working, or what the proper circuit layout is for it. This is the schematic for my basic idea, but (correct me if I'm wrong) the motor will only go in the forward/reverse direction if the switch is continuously pressed. <Q> You will need a memory element such as a relay to hold the current direction of the motor. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> The motor M1 drives to the "left" when the top terminal is positive and to the right when the top terminal is negative. <S> Suppose the relay is dropped out. <S> The top terminal is positive, SW2 and SW3 are in the positions shown. <S> When the motor reaches the left limit, SW2 is actuated, energizing the relay. <S> The motor immediately reverses, but the top contact has pulled in, keeping the relay energized through D2. <S> The motor operates until SW3 is actuated, which interrupts current to the relay (D3 catches the flyback voltage). <S> The relay drops out, releasing the hold contact and it remains dropped out, and we're back where we started. <S> Interrupt V1 to switch everything off (and it will always drive to the left when power is applied). <S> Interrupt only the current to M1 and the memory of the previous direction will be maintained as long as V1 is applied (which means continuous draw if the relay is energized). <S> A solid-state solution could use a single CMOS gate package (eg. 1/2 a CD4011B) and a MOSFET H-bridge to drive the motor: simulate this circuit <A> Setup so each side can reverse the direction. <S> DPDT switches on each side. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> I know this post is 6 year old <S> but, I hope this helps you in some way or at <S> very least helps others who see it and need it? <S> The circuit is actually very simple but hard to explain. <S> Using a 3PDT <S> (Triple Pole Double Throw) relay, <S> Wire <S> the first two poles as if it were a DPDT reversing relay. <S> Connect Positive Power to the relay coil. <S> The negative of the coil goes to the N.O. (Normally Open) of first LS (Limit Switch). <S> The negative of the coil also goes to the COM (Common) of the 3PDT's third pole. <S> Connect Negative Power to both the COMs of the LSs. <S> Connect N.C. (Normally Closed) of the second LS to the N.O. of the 3PDT's third pole. <S> This can also be done with a DPDT and a SPDT relay. <S> Adding this per @Transistor . <S> I hope it works. <S> Circuitlab wants me to pay to use and save. <S> So I don't use it. <S> I also don't use it because It has very limited parts as in no triple pole double throw relays. <S> But since I added the DPDT and SPDT option I thought why not. <S> So here it is. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> A DPDT switch is what you want, because if the two microswitches don't act together perfectly, you will have a short circuit and a fire. <S> The DPDT layout is just like you have there. <S> Imagine <S> you glued the two switches together side by side. <S> The DPDT is made just like that. <A> This is a minimal reversing circuit. <S> It doesn't start on it's own, you have to push a limit switch. <S> It doesn't have interlocks or a stop button, but it can all be added to it. <S> The interlocks are specially important, because if both relays are on, it would be a short circuit. <S> The circuit uses 2 relays, 2 limit switches, and a dc motor. <S> As illustrated, the relays have to be dc, same coil voltage as the motor, but the bottom can be separated and fed from a different voltage. <A> This can be solved using Sphero's very ingenious circuit or as you said, using Arduino. <S> In case, your motion doesn't have much parameters like speed regulation, occasional calibration or any other, Arduino might be overkill. <S> Middle ground can be reached using a Bi-stable multivibrator using timer <S> IC viz 555. <S> In this you can have certain parameter setting like sensitivity of input switches or debouncing. <S> But again, all depends on hardware cost target of the specific project. <S> In of the similar project, I am going to use bare-bones DPDT relay circuit. <A> use a dpdt switch with "center off", there are six terminals 1-6 1 and 2 connect to power, also run a jumper from 1 to 6 and another from 2 to 5 forming an "X". <S> 3 and 4 is the connection to the motor so run a lead from those two to the motor... <S> you need the center off type switch to prevent shorting out and blowing a fuse. <S> A dpdt relay has no center off so one position will blow a fuse and the other will run the motor don't use a relay unless you design a special circuit with a delay or something to prevent shorting out. <S> Sketch it out and you can see how simple it is. <S> Mc master-Carr has that switch. <A> I am going to add this one because someone mentioned bistable relays. <S> If anyone wants to make it really easy on themselves for just a few more dollars, you can use this module. <S> The relay is self latching and only needs a negative trigger. <S> V+ Connect positive voltage <S> S1 <S> Set1 is your negative voltage from Limit Switch 1 R1 Reset1 <S> is your negative voltage from Limit Switch 2 SX SetX positive voltage SY SetY negative voltage RX ResetX negative voltage <S> RY ResetY positive voltage CX CommonX Wire to motor CY CommonY Wire <S> to motor <S> The commons on the Limit Switches go to negative <S> You may have to reverse the motor <S> so do it before you put in place, to avoid platform collision. <S> Damage will occur.
| Here a DPDT relay and two microswitches are used. The switch will not reverse the motor if the set and reset are going to the wrong switches.
|
NPN BJT Relay Circuit will not turn off I'm applying a 3.3V signal with my Raspberry Pi to the base of an NPN transistor to activate a SPDT 6V relay ( relay data sheet , model G2R-1-S-DC6(S)). The relay pickup/dropoff voltage is 4.4/0.9V. The transistor activates the circuit like it should when the signal is applied, but it does not turn off when the signal is removed. The relay coil resistance is 68.7 ohms, as shown in the simulation. The 161 ohm resistor was added to dissipate some power because the transistor is rated for 600 mW. When adding the emitter resistance, I calculated that it needed to be under 40.7 ohms. I used a 33 ohm because that is what I had on hand. The 24Vdc supply is used here because it is what is available in the system. I am using a 2N2222 transistor from Radio Shack with a Beta=200. The 3.3V ground and 24V ground were tied together when the circuit was constructed. I've experimented with adding a resistor from base to ground; I tried this with 10k, 33k, and 100k resistances. I have tried a diode in parallel with the relay pointing up. I used a new transistor every time I tried a new circuit to ensure the transistor was not burned up from the previous test. I also tried multiple different combinations of Rb and Rc with the same result. The strange part is, when experimenting with Rc values, the Beta calculated from test measurements ranged from 50-500, which is very odd. In all trials, the current through the relay was as calculated in the simulation; it did not change upon application and after removal of the signal. I saw another post where someone used a small capacitor in parallel with Rb to sweep voltage off the base emitter, we also tried this but it didn't work ( link - it is the third diagram from the top). Any advice will be will be greatly appreciated. <Q> Add a fly-back diode. <S> When switching the current off, a coil will reduce the voltage until something starts to conduct so it can continue to let the current flow, as long as it has magnetic energy inside. <S> Sadly, the conductive path is provided by your transistor -- after it was fried. <S> That negative pulse can reach thousands of volts. <S> Seriously! <A> It is oriented so that it does not conduct when the relay is being powered on. <S> When the relay switches off, the diode provides a safe path for the flyback current from the coil, until that eventually dissipates due to the forward drop of the diode and the resistance of the coil. <S> The rest of your circuit also has problems. <S> Having both a emitter and base resistor makes no sense. <S> Since you have way more voltage available than necessary, I'd use the transistor in current sink configuration. <S> Connect the base directly to the digital output, and put the appropriate resistor between the emitter and ground for the relay current. <S> Now the relay will always see that current when on, regardless of the supply voltage. <S> Higher than necessary supply voltage will cause more dissipation in the transitor, so a resitor in series with the relay does make sense. <A> Additionally to the aforementioned suggestions, your design doesn't provide enough current for the coil. <S> Your description shows Ic=65,71mA , according with the specifications of your relay the coil needs 87mA in DC mode for the SPDT at 6V . <S> You needs 20mA more. <S> If the relays are not driven with the current according the manufacturer specifications often they works erratically. <S> I recommend you to use a Darlinton transistor configuration to drive your relays. <S> It is the usual way to do this ( for example using the ULN2803A ICs to drive several relays).The Darlington can switch more current than with the collector-emitter design.
| The relay won't turn off anymore because the first time you tried to turn it off, the flyback voltage generated by the relay coil blew out the transistor so that it is now permanently shorted between collector and emitter. The common way to deal with this is to put a diode accross the relay coil in reverse.
|
What does the "phase margin" parameter of an opamp imply? I was reading datasheet of MCP6072 . I saw a parameter namely "phase margin" (table 1-2, page 4). As far as I know, "phase margin" is a control engineering term, and implies the phase difference between input and output when the gain is unity. I don't understand the meaning of this term in opamp terminology. The typical phase margin of this opamp is given to be 57 o . That what does it mean? <Q> The phase margin PM is a measure for the stability of a system with feedback. <S> And, thus, it also applies to operational amplifiers. <S> The PM is defined for the LOOP GAIN of the system - that means: open the loop at a suitable node and measure/simulate the gain and the phase around the complete loop. <S> Then ,the PM is the DIFFERENCE between the measured phase and -360 deg (that means: The "distance" to the oscillation condition, positive feedback) at the frequency which gives unity loop gain. <S> Without taking the phase inversion at the inverting input into account, the PM is the "distance" to -180 deg. <S> Now, for an opamp the most critical situation arises for 100% feedback (unity gain operation). <S> In this case, the feedback factor is unity and the Loop gain is identical to the open-loop gain Ao of the opamp. <S> Normally, only this condition is used to specify the PM in the opamp´s data sheet. <S> Summary: <S> The PM as given for an opamp is the DIFFERENCE between the opamp´s phase shift and -180 deg at the unity-gain frequency. <A> An op-amp is a "control system" and the phase margin is defined as the difference from -180 degrees of the phase of the open-loop transfer function when the magnitude is unity. <S> This allows you to predict the stability and response of the system when you close the loop with a given amount of feedback. <S> An op-amp is typically compensated with a dominant pole, so the transfer function is approximately Ao/(1+s/ <S> wo) <S> where wo is the dominant pole frequency and Ao is the DC gain- <S> This implies a phase margin of 90 degrees. <S> In practice, the Ft of the transistors causes additional phase shift and the dominant pole is set so that the 0dB crossover occurs with reasonable phase margin. <A> 90 deg is theoretical ideal, 0 is <S> NG , 45 deg will have some overshoot, 60 deg is practical solution. <S> Phase margin shows tradeoff between rise time and overshoot. <A> Op-amps are used with feedback, this makes it possible for them to oscillate, which is bad unless you are designing an oscillator! <S> The phase margin basically states how stable the op-amp is, i.e. phase angle distance from the point of oscillation, in the worst-case configuration of unity gain. <S> The addition of stray input & output capacitance, but especially load capacitance, can cause a phase shift that reduces the stability margin. <S> Typically a small resistor is added to the output to compensate for a "large" capacitive load, but this of course reduces the effective gain. <S> Input capacitance is usually less of a problem, but it too can be compensated. <S> Many op-amps are internally compensated for typical usage conditions, but not all are.
| Phase Margin is the amount of phase shift margin at unity gain which could cause instability or Oscillation.
|
Cheaper FPGA for fixed designs? FPGA are, I reckon, (relatively) expensive because they can be reconfigured many times. If I were to make a design work on an FPGA, and decide to build several (though not many) of them on a custom board using the same code; is there another type of chip that would be cheaper, which I assume I would configure serially once and for all? In a nutshell, I am looking for the equivalent of EPROM compared to EEPROM for configurable gate array chips. <Q> There isn't really any technology that competes with FPGAs by trading off field-programmability vs cost. <S> There are ways to lower the cost of your FPGA, though: <S> Use the slowest speed-grade part your design can work with. <S> Use the smallest gate-count part you can comfortably fit your design into <S> (but it is wise in most cases to retain some unused resources to allow for future upgrades, and to avoid absurdly long synthesis times) <S> Buy as many at a time as you can of a given FPGA part number. <S> IC prices can go way down as volume goes up. <S> If you have more than one project going, consider using the same FPGA in both to increase the volume you're purchasing of that part. <S> If your purchasing volume is more than maybe 20 pieces at a time or 100 FPGA's per year, contact the FPGA manufacturer directly and negotiate the price. <S> Don't just accept the list price from a distributor. <A> The problem with your premise is that FPGAs are completely volatile* already . <S> There is no special manufacturing step used to create FLASH/EEPROM, the "program" is stored directly in the Look-Up Tables (LUTs) where it is needed to perform your arbitrary logic. <S> The LUTs consist of small SRAM arrays that are programmed, as well as some switch routing. <S> I know that at least Altera has a program where you can "hardcopy" your FPGA design, but this is a custom manufactured device, not something you can program in the field. <S> Now CPLDs have non-volatile memory, but you'll be unlikely to find an OTP (One Time Programmable) variant of a modern CPLD that already has an EEPROM/FLASH variant because it's not saving the manufacturer any (or enough) money. <S> They already have a working chip with an IC process that has FLASH capability, and there probably isn't enough demand to justify the costs of a different memory element. <S> That being said, there are definitely OTP CPLDs and PALs, but these are generally older parts when EPROM (UV erasable) was more common. <S> *most of them... <S> I know there are some with non-volatile memory in them, but the core is still the same. <A> Actel (now Microsemi) has both antifuse- <S> and Flash-based FPGAs. <S> (Antifuse: one-time programmable, Flash: programmable many times. <S> Actel's Flash-based FPGAs directly incorporates Flash instead of SRAM.) <S> Moreover, the same EDA software package is used for both types, meaning the same final design can be programmed to both antifuse- and Flash-based FPGAs. <S> This is how I see it can be done:1. <S> Choose an antifuse-based FPGA as target, according to your requirements.2. <S> Design by temporarily targeting an equivalent Flash-based FPGA.3. <S> During the design-debug process, the reprogrammability of the Flash-based FPGA can be very indispensable.4. <S> Once the design is final, migrate it to the target antifuse-based FPGA. <A> decide to build several (though not many) <S> 'Several' doesn't get you to the economies of scale that make it worth the effort. <S> And even if hundreds of thousands of people want several each, they will still want the device to perform different tasks, which means a level of programmability. <S> If you want something programmable (even once only) then it will have a large quantity of routing inside it (much more routing than logic in modern devices). <S> The routing is what you are paying for, the way you configure it (ie OTP or volatile) is (to my understanding) a second-order cost influence. <S> Look at how microcontrollers have developed - program storage in flash (ie in-the-field reprogrammable) was once deemed to be purely the preserve of the product-development process and then OTP and mask-ROM devices were used in production. <S> Now even very cost-sensitive consumer products and automotive controllers use flash micros routinely.
| FPGAs are expensive because they're large (silicon-wise), require expensive, leading edge processes, have high pin counts, are low volume, and have a massive design software suite that they are subsidizing.
|
Ground loop when measuring in process pH I have been experiencing a very difficult to solve ground loop problem with my pH measuring system. My basic setup is a standard pH electrode running through an op-amp to an ADC which communicates through I2C to a Raspberry Pi. Calibration of the probe proceeds as expected and testing various liquids in glasses works perfectly. The purpose of the pH meter is to measure the pH of a fish tank. When placed in the process fluid I get very strange reading (sometimes ph of < 1 or > 14). The calibration of the probe also quickly becomes altered. If I have the probe suspended in the process fluid and scoop the probe out with a cup the reading returns to the expected value as soon as the cup breaks the water. I assume this is a ground loop issue. I have shut off and removed all heaters and pumps however this does not fix the issue. I have noted that plugging and unplugging a monitor into the HDMI port of the Raspberry Pi changes my reading significantly, although it is still wrong either way. The Pi is being powered from a standard cell phone charger. Do I need to attempt to fully isolate my signal or are there other potential suspects causing the ground loop? I am using a Ti LMC6001 Op-amp. My circuit is taken from the datasheet http://www.ti.com/lit/ds/symlink/lmc6001.pdf The only changes are some resistor value changes to change the scaling of the voltage. Update: Instead of using the raspberry pi I hooked the ADC (communicating over i2c) up to an arduino I had laying around. The problem I described has disappeared. Any ideas on why? Update2: The problem seems to be at least partially solved. I mocked up a quick power supply with an old wall wart and a 5v linear regulator. Using that to power the raspberry pi directly to the 5v bus gives me very stable readings for in and out of process fluid. Use of the HDMI port reintroduces the problem but it is not needed. <Q> This sounds like a combination of problems, probably including grounding. <S> The main issue sounds like common mode pickup is turning into differential mode signal. <S> The strategy for dealing with small differential and high impedance signals superimposed on large common mode noise needs to be thought out carefully and considered at every step of the design. <S> This is not something you add on later to fix the problem. <S> It would help to see a diagram of your system and proper specs for the pH probe, including the expected signal level and its impedance. <S> In general, you probably want to treat the probe as producing a balanced differential signal, then have something with very good common mode rejection receive that. <S> Minimizing common mode pickup, like by using shielded cable, will also be important. <S> However, shielding without proper balanced signals could do more harm than good. <A> The water becomes an antenna to radiated common mode electric fields. <S> This requires shielding , or guarding and CM choke around twisted pair sensor leads or shielded twisted pair. <S> Try the ground 1st. <S> If sensor also has ground connection, this may reduce interference from SMPS and stray 60/50Hz. <A> This is probably related to the power supplies you are using for the Raspberry Pi vs. the Arduino. <S> Try connecting the "earth" to the ground on your circuit. <S> You may also be able to get it to work by swapping around the two-pin power supply. <S> The reason is that (on switching power supplies) there's usually a 'Y' capacitor from one of the power pins to the minus output terminal on the power supply (to conduct all the hash from the switching back into the power source). <S> If you have the "hot" terminal connected through a capacitor to the minus output, it will float at mains potential relative to earth. <S> pH probes are relatively high level (hundreds of mV), but very high impedance, so a bit of current due to capacitive reactance can wreak havoc. <S> If my answer is correct, this is not a "ground loop" (two or more grounds), but rather a lack of grounding.
| Grounding the CPU also helps. Flipping the input power pins, and/or earthing the minus output terminal fixes that.
|
Can be lead-acid battery charged using NiMH or NiCd charger? I would like to check total capacity of 64Ah lead "car battery" ^ by fully charging it and currently I have only older intelligent charger ( Robbe Power Peak 8467 ). It directly supports charging modes for NiMH and NiCd batteries (not naming Li-Po mode) and I plan to: Discharge the battery. (already done) Switch to mode for charging NiCd batteries. Set charging current to 2 A. Start charging and wait until finished. :) I am not sure whether NiCd mode is more suitable than NiMH mode for the task. Or should I forget the entire idea of using such a charger? <Q> It's the part where you "wait until finished" that the problem arises. <S> The charge termination schemes (when to automatically stop charging) will be different. <S> For lead-acid, probably switching from current-limit mode to voltage-limit mode at some maximum safe charging voltage. <S> For NiCd/NiMH, watching the voltage for where it goes "over the hill" from increasing to decreasing, <S> and/or the temperature rises quickly. <S> Plus some other safety features, such as timeout, over/under-voltage, over/under-temperature, etc. <S> If you put the wrong chemistry on the charger it may never see what it's looking for to cease charging, because the battery behaves differently (voltage graphed over time has a different pattern). <S> It could keep charging literally until the battery explodes. <S> If you understand what the battery requires, and what the charger does, you might be able to use it anyway, to the extent you can manually observe and terminate charging as appropriate. <S> You're risking destroying the battery, but in some cases getting a partial charge right now is more valuable than a longer lifespan later. <S> Your stated goal is measuring the capacity of the battery, rather than, say, getting enough charge back into your car battery so you can start the car and drive it around to finish recharging. <S> If all you wanted to do was get "some" charge into the battery, considering you already know it's discharged, you could probably let it charge from your 2A source for "a while" and disconnect it manually after some time considerably less than (64A-hr/2A)=32hr, say 8-12 hours, watching with a voltmeter that the voltage doesn't exceed the maximum safe voltage and disconnecting early if it does. <S> For your purposes of getting the battery fully charged and discharging to measure capacity, you'd want a proper charge termination scheme, which you don't have. <A> No. <S> The technique for charging lead-acid is entirely different from NiCd or NiMH. <S> See http://pdf.wholesalesolar.com/battery-folder/charging_instruction_2011_2.pdf and http://www.jaycar.co.nz/images_uploaded/nicads.pdf for an idea of the differences. <S> So, no. <A> The charger you linked to is capable of charging LiPo cells. <S> The charging profile for LiPos is very similar to that for lead acid batteries with the exception of the charge termination and finished voltage levels. <S> If you set your charger to 3 cell LiPo the termination voltage will be 4.2 x 3 <S> = 12.6V. <S> Cutting the charge at this voltage will be too early to achieve full capacity. <S> 13.8V would probably be ideal. <S> Anyhow you will have a limited risk of overcharging with the LiPo setup. <S> Some links that might be of use: <S> http://batteryuniversity.com/learn/article/charging_the_lead_acid_battery <S> http://batteryuniversity.com/learn/article/how_to_measure_state_of_charge
| You might be able to use the NiCd charger to put charging current into the battery.
|
Given an Op Amp where the output voltage is fed back into the negative terminal, why is the gain one? Apparently, the gain of this Op Amp is one, but I can't see how I could figure that out. Can someone help? <Q> The gain of the op amp is very high, typically 100k to 1M or more. <S> The gain of the circuit in this case is very close to 1. <S> For now, let's imagine a nice ideal opamp with 0 offset voltage, infinite gain, etc. <S> Think of what would happen if the gain weren't 1. <S> Let's say you drive Vin to 3.0 V. <S> The opamp will then drive Vout to also be 3.0 V. <S> Now imagine what would happen if it didn't. <S> Let's say the opamp only drove Vout to 2.9 V. <S> That means the positive input of the opamp is 3.0 V and the negative input 2.9 V, for a total differential input signal of 100 mV. Multiply that by the gain of the opamp, and that's what it will try to drive its output to. <S> Obviously it will try to drive Vout as high as it can in this case. <S> However, eventually Vout gets to 3.0 V, the differential input to the opamp is then 0 <S> and it no longer tries to drive Vout high. <S> If Vout went a tiny bit higher, the differential input to the opamp would be a little negative, which would make it try to pull Vout low. <S> Put another way, the opamp will try to pull Vout down if it is above Vin, and up if it is below Vin. <S> Eventually, assuming nothing is externally holding Vout fixed, Vout converges to be the same as Vin. <S> Added: <S> This can be described mathematically quite easily too. <S> What a opamp does is basically: Vo = <S> G(Vp - Vn) <S> Where Vp is the voltage at the positive input, Vn the voltage at the negative input, Vo the output voltage, and G the gain of the opamp. <S> As I said above, G is usually a large number, like 100k to 1M or more. <S> From how the circuit is wired, we get: Vn = <S> Vo <S> Vp = <S> Vin <S> Substituting these into the first equation, we get: Vo = <S> G(Vin - Vo) <S> Solving for Vo as a function of Vin yields: Vo = <S> (G / (1 + G)) <S> Vin Note that G / (1 + G) is basically 1 for large values of G. <A> Actually your premise is not quite correct. <S> The overall gain is not 1, it's \$ \frac{1}{1 <S> + \frac{1}{G}}\$, where G is the gain of the op-amp. <S> If G is very high, such as for a precision op-amp near DC, then the gain is very close to 1. <S> But an LM324 (say) at 30kHz has a gain of only about 40, so the gain is closer to 0.975. <S> \$V_{OUT} = <S> G (V_{IN+} <S> - V_{IN-})\$, so if \$V_{IN-}\$ = \$V_{OUT}\$ <S> then \$V_{OUT} (\frac{1}{G} +1) = <S> V_{IN+}\$, and \$\frac{V_{OUT}}{V_{IN}} = <S> \frac{1}{1 <S> + \frac{1}{G}}\$ <A> Apply the basic rules of Op-Amps with negative feedback: <S> The op amp will try to match the voltage at the input terminals by adjusting the output voltage. <S> Assume Vin+ = <S> Vin- (from the basic operation of an Op-Amp) <S> Vin- is tied directly to Vout, thus Vout= <S> Vin-=Vin+ <S> Define gain as G = <S> Vout/ <S> Vin+ = 1 <A> but I can't see how I could figure that out. <S> Can someone help? <S> Step by step assuming an ideal op-amp with negative feedback present: (1) <S> \$V_+ = <S> V_{in}\$ by inspection <S> (2) \$V_- = V_{out}\$ by inspection (3) <S> \$V_- = <S> V_+ \$ <S> due to negative feedback and 'infinite' op-amp gain <S> Thus $$V_{out} = <S> V_{in}$$ <S> Now, the above assumes you're aware that \$V_- = <S> V_+ \$ for an ideal op-amp with negative feedback. <S> If you're not aware of this, below is the justification. <S> Assume <S> the op-amp has finite voltage gain \$A\$ $$V_{out} = <S> A(V_+ - V_-)$$ <S> Now, connect the output of the op-amp to the inverting input with some attenuation \$b\$ <S> $$ <S> V_- = <S> bV_{out}$$ Substitute into the previous equation $$V_{out} = <S> A(V_+ - bV_{out})$$ <S> Gather terms and simplify $$V_{out} (1 + Ab) = <S> AV_+$$ <S> Solve for \$V_{out}\$ <S> $$V_{out} = <S> \frac{A}{1 <S> + Ab}V_+$$ <S> Which implies $$V_- = <S> \frac{Ab}{1 + <S> Ab}V_+ $$ Now <S> , take the limit as the gain \$A\$ goes to infinity $$\lim_{A \rightarrow \infty}V_- = <S> \lim_{A <S> \rightarrow <S> \infty}\frac{Ab}{1 <S> + Ab}V_+ = <S> V_+ <S> $$ <S> Thus, for an ideal op-amp (infinite gain) with negative feedback, we have the fundamental result $$V_- = <S> V_+ $$ <A> Negative Feedback can take a little bit of understanding. <S> Consider this diagram: - simulate this circuit – Schematic created using CircuitLab <S> From left to right we have: - A pot that sets the demand An error amp that tries to drive the motor so that the error is zero A motor (driven by the error amp) <S> - it drives the spindle on the "feedback" pot A feedback pot that reports its position (via the wiper) to the error amp <S> If the error amp had low gain <S> (output = difference between +input & -input), by the time the motor had moved the spindle in the right direction a bit, the output of the error amp might only be a volt and the motor would stall. <S> This tells you that half a job has been done and the two pots are nearly at the same point - if the demand pot was set at 7V, the feedback pot will have moved to either 6V or 8V before the motor stalled. <S> However, if the error amp gain were increased ten times, the error would reduce by ten-fold. <S> Keep on increasing the error amp gain and you should be able to see that the error gets proportionally smaller. <S> Error amp gain of a million or so and the error is so small <S> it's barely worth considering. <S> This is a unity gain <S> op-amp in all but name.
| Even if G is only 100k, then the overall gain of this circuit is 0.99999, which is 1 for the vast majority of practical purposes.
|
Shorts in parallel - out of curiosity Normally a current would take a simpler route, hence why a resistor in parallel with a short gets no share in current. Again two equal resistors in parallel get equal share in current. These questions just crossed my mind: What happens when you have two shorts in parallel? Do they get equal share as well? Again, what happens when I place an inductor in parallel with a short? Would the inductor become a short (eventually)? You know how inductor behave under DC. What others have to say? <Q> A short is never actually a true short. <S> It's a very low resistance. <S> So even if you made two "shorts" one could be 0.25 Ohms and the other could be 0.001 <S> Ohms. <S> Depending on the circuit, they're both shorts, but they could act very differently depending upon the amount of current coming from the circuit. <S> The difference in this case would make the 0.001 Ohms a much better path for current. <S> Consequently, hardly any current would go through the 0.25 ohm short. <S> In summary, it's likely too difficult to try and control two shorts to act in a balanced manner. <S> If you are, you're not thinking of them as a short but rather as a current/low-resistance path. <S> The inductor would act like it's equivalent series resistance (ESR) once the current stabilizes to a steady state. <A> There's no such thing as a mathematically perfect short. <S> Usually there is some DC resistance, so it's the same as two resistors in parallel, after it settles down. <S> \$I_{R1} = <S> I_T(\frac{R2}{R1+R2})\$ \$I_{R2} = <S> I_T(\frac{R1}{R1+R2})\$ <S> If there is no resistance (superconductors) <S> the current is shared based on the inductance. <S> \$I_{L1} = <S> I_T(\frac{L2}{L1+L2})\$ <S> \$I_{L2} = I_T(\frac{L1}{L1+L2})\$ <A> A short circuit has resistance, just very much lower than a resistor. <S> If you have two short circuits than the current will share between them based upon their resistance values. <S> The same applies to the inductor which, in the real world, will have a dc resistance value. <A> In theortical ideal circuits, every distribution of currents, giving right sum would be correct solution: (0.5 0.5), (0.0 1.0), or even (2.0 −1.0) where one current flows in opposite direction. <S> (Under solution I mean mathematic solution on circuit model) <S> You should not bother about it, because for remaining circuit these have no sense absolutely. <S> Current through short will be sum of inductor current and external current, obviously. <S> But you cannot get these results in practice. <S> In normal conditions these answers have no practival sense absolutely, because every conductor have non-zero resistance. <S> (Good answers on convetional conductors are already there) <S> More closer are superconductors -- you can connect two superconductors in parallel of course. <S> But superconductors not true shorts too, they have nonzero inductance. <S> So they act more like two inductors in parallel. <S> Simply, they take current proportional to reciprocal inductance plus constant circulating current. <S> Look for SQUID magnetometer if you interested.
| Ideal shorted inductor will keep its current constant (which was at moment of short).
|
Is there a way to join metal to plastic? The plastic I would like to use is Polycarbonate, which will melt if you try to solder metal to it. If you can't weld the two, is there another way in which you can join metal to plastic? Ideally, I would like to build the circuit board into the polycarbonate itself. <Q> You should consider building your circuit on a thin (flexible) polyimide substrate, and then either gluing or heat-staking that circuit to your polycarbonate case. <S> Flex circuits are as easy to design as regular rigid PCBs (although there are a few more design rules), and there are many manufacturers that can produce them for you. <A> Two options. <S> One easier to reproduce than the other. <S> The first is inlaying, which comes in two forms of application. <S> First you mill or cut out a channel. <S> You can use a standard bit or an inlay or keyhole type bit to privde better grasp. <S> Then you can 1, cold form a conductor into the channel (read: hammer it in) or 2, hot form it (pour molten metal). <S> Heck, get a lot of low temp solder (lower than the burning/melting point of your plastic, and a heat gun. <S> The other is copper tape. <S> You just cut and tape it to the plastic. <S> If you want to get fancy, you use copper sheets in a mill/plotter. <S> You can get them with glue umm, glued on, or without, and use your own spray adhesive. <S> Either can be done by hand or machine. <S> It really depends on how complex your circuit is. <S> Invest in some kapton tape (high heat resistance) to protect the plastic while soldering on it, use the least wattage iron needed, and practice your ninja soldering. <A> I know this topic is 5 years old now <S> but I want to share something. <S> My keyboard was spilled some juice and CTRL and <S> Caps Lock keys were not working. <S> I tried to fix it but some traces on the plastic shield was burnt therefore blocking the electronic contact between the main PCB and the keys. <S> What I did think to do was creating a bridge over burnt traces to get the contact back. <S> I tried directly soldering it but since plastic doesn't really matches with solder, it didn't catch it <S> and I wasted some of solder during that process. <S> I even tried silicon but it didn't work as expected. <S> So while I was searching something useful in my tool box, I saw staplers and that crazy idea popped in my head! <S> I can use this stapler pins to create electronic contact so I can solder the cable which I'm going to use it for the bridge directly to the stapler pin! <S> I stapled one across the health trace and other one near CTRL and CAPS Lock traces. <S> I solder a normal thin wire to these two stapler pins and voila, it came back to life. <S> If you are having the same problem, feel free to comment down. <S> I'll see it in less than 24 hours since I'm actively searching for answers on stackoverflow!
| Depending on your needs, conductive glue or ink might work as well.
|
What happens if I connect two lead acid batteries in series, one fully charged and one half charged? I am interested in several things: What happens right when I connect them? How does this behavior affect the batteries, both short term and long term? <Q> Short-term, this isn't a problem. <S> You'll end up with ~24V powering the load. <S> Long-term, this is a bad idea. <S> Once the half-charged battery gets drained, the full-charged battery will now be at half charge and will start running the drained battery in the reverse direction. <S> Lead-acid batteries hate to be deep-discharged. <S> The lead plates will corrode and you'll lose capacity on them permanently if not destroy the battery entirely. <S> To prevent the second battery from running backwards or even being deep-discharged, make sure you balance the batteries before connecting them in series and running them to the load. <S> A poor man's semi-decent attempt to balance them would be to just put both batteries in parallel for a long time to transfer some charge from the full battery to the half-charged one. <S> Another option is to always monitor the half-charged battery to make sure that you never deep discharge it. <S> You'll have problems charging it as well though. <S> Upon charging, you'll likely end up over-charging the full battery which is just as destructive, but in a different physical mechanism. <A> Right when you connect them, current starts to flow through both batteries and the bulb. <S> Nothing out of the ordinary happens. <S> This is very similar to having a bad cell in a battery. <S> The real problem you will have is charging them when connected in series. <S> You can't use a constant-voltage charger because it assumes the same voltage across each cell, and a constant-current charger will overcharge the half-full battery before the other one is fully charged. <A> Best thing is to charge the weak battery before using it, so the stronger one doesn't charge it in reverse. <S> Otherwise, you can put them in parallel for double the ampacity at 12 volts, and usea voltage doubler to drive your 24v load. <S> Note: leaving lead-acid in a low charge condition for a long time is one of the worstthings you can do to it, as the plates will sulfate and develop a high internal resistance. <S> I live off-the-grid myself and have replaced several batteries for this reason.
| The half-charged battery will be depleted first and its voltage will fall.
|
How is a current controlled voltage source different from a resistor? A current controlled voltage source produces a voltage that is linearly proportional to a current. A resistor has the same behavior. And the gain for a CCVS is measured in ohms, which is the same unit that measures a resistor. So what is the difference between them? Is a resistor just a kind of CCVS (and I guess also a VCCS) and if so, how does it differ from an ideal CCVS? <Q> A nice graphic answering one half of the question <S> I don't remember the source of this, since I have stored on my HD <A> A resistor is a passive component. <A> A resistor produces a voltage that is linearly proportional to the current that flows into it . <S> Moreover the polarity of the voltage is fixed too, you can't have current flowing in a resistor from A to B and have \$V_B <S> > <S> V_A\$. <S> A CCVS can be controlled by any current in the network, possibly the one that flows through it <S> but again, this time you get the freedom to choose the voltage polarity. <A> The following two ideal circuit elements have identical terminal characteristics and are thus indistinguishable: simulate this circuit – <S> Schematic created using CircuitLab <S> Thus, if the controlling variable of a CCVS is the current through the CCVS, the CCVS is indistinguishable from a resistor where the gain of the CCVS is the resistance. <S> If the controlling variable of a CCVS is the current through another circuit element, the gain is the transresistance . <A> A circuit that is called voltage "SOURCE" must be able to deliver the output to any connected load - otherwise it is not really a "source". <S> Hence, it must have a very small source resistance <S> (ideal: zero). <S> This is the main feature of an active CCVS. <A> A resistor controls current in same branch. <S> The dependent sources show interdependence of different branches. <S> i.e <S> current through one branch controls voltage through some other branch or current through one branch controls current through some other branch. <S> So, dependent sources can be generalized as the concept of resistance but they are not same as resistance.
| A current controlled voltage source is an active component i.e. the voltage will remain proportional to the current controlling it regardless of what else is connected to the source (ideally).
|
Solar Panel used in Conjunction with a DC to DC Step Up Good morning all,I am trying to put a little project together where I used a 1 watt, 6v solar panel in conjunction with a 0.9V - 5V to 5V DC to DC boost converter. I hooked up the solar panel to a multimeter and tested it in dim lighting and it was outputting about 3.5V and 130mA. 3.3V is well within the tolerance for the boost converter so I hooked it up to the boost converter. I took a volt reading at the connection point and now the voltage dropped to about 0.2V. I have tried this with multiple panels and regardless of the no load voltage, it seems to drop to about 0.2V. The boost converter also has a USB output and when I plug it in to my phone, nothing happens. I have confirmed the boost converter works because when I attach the dc inputs to a 1.5V alkaline, the system powers up. What do you guys think the issue is? Do I need to input a stable voltage/current? I have linked the products below:Boost converter: http://www.ebay.com.au/itm/DC-DC-USB-0-9v-5v-to-5vdc-Boost-Step-up-Power-Supply-Module-Mini-PFM-Control-DA-/151285075110?pt=AU_B_I_Electrical_Test_Equipment&hash=item23394b0ca6&_uhb=1 Solar panel: http://www.ebay.com.au/itm/351022647345?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649 <Q> I'm assuming that you tested the panel voltage into an open circuit (just test leads across the panel) and the panel current into a short circuit (again, just test leads across the panel). <S> When you put your ammeter across the panel, it acts as a short circuit. <S> So the panel is putting out 130ma at almost no voltage! <S> As soon as you connected the regulator to the panel, it drew enough current to pull the voltage below what it could handle. <S> Look at it this way: a 1W 6V panel will put out 1/6 amps (167ma) at 6V in full sunlight. <S> There's no way it's going to put out anywhere near that in dim light. <A> Are you trying this inside? <S> Those panels just can't produce any usable power indoors under normal incandescent or fluorescent light. <S> In general, a solar panel will output most of it <S> 's rated voltage until the light output becomes quite dim (sometimes to as low as 10% or ideal). <S> However, current starts to drop immediately as light brightness drops from full sunlight. <S> So if your 6 volt panel was only producing 3.3 volts, his would suggest that you were under very low light conditions. <S> I am very surprised that you measured any current. <S> Under load I am willing to bet there is no current in that low light condition. <S> Go outside on a very bright and sunny day and try again - it should work! <S> Solar panels just don't work inside. <S> Although they will work at less then 100% through a window facing the sun! <S> Let us know if you succeed. <S> Good luck! <S> Edit: <S> I just looked at the solar panel you bought. <S> It has a low current. <S> If you get this to work, it will take a long time to charge your phone. <S> I would recommend putting two or three of hem in parallel and the. <S> You would get a reasonable charging current. <A> I used a 1 watt, 6v solar panel <S> According to the linked page, the open circuit voltage is 6V and short circuit current is 0.183A. A first order model, under full sunlight , is then a 6V voltage source in series with a \$\frac{6V}{0.183A} = 32.8 \Omega\$ resistor. <S> tested it in dim lighting and it was outputting about 3.5V and 130mA <S> That doesn't compute. <S> \$0.13A\$ <S> through a \$32.8 \Omega\$ resistor is 4.26V <S> so, under full sunlight , the output voltage should be \$6V <S> - 4.26V = 1.74V\$ and, with dim light, much less.
| This is not a valid test.
|
Maximum length of variable and function names? I'm not sure whether this is a property of the compiler or something standard to C. I've heard of limits on the number of characters long a variable or function can be (e.g. 25characters). I'm not there yet, but just saw a decently long function and began to think about it. Is there a limit I should know about? <Q> IIRC, most C compilers have a limit of 255 characters for an identifier. <S> You usually find all the information you need in the compiler's manual. <S> In your case it's the MPLAB XC8 C Compiler User <S> ’s <S> Guide : <S> 3.4.4.3 <S> HOW LONG CAN I MAKE MY VARIABLE AND MACRO <S> NAMES? <S> The C Standard indicates that a only a specific number of initial characters in an identifier are significant, but it does not actually state what this number is and it varies from compiler to compiler. <S> For XC8, the first 255 characters are significant, but this can be reduced using the -Noption; see Section 4.8.8 “-N: Identifier Length”. <S> The fewer characters there are in your variable names, the more portable your code. <S> Using the -Noption allows the compiler to check that your identifiers conform to a specific length. <S> This option affects variable and function names, as well as preprocessor macro names. <S> If two identifiers only differ in the non-significant part of the name, they are considered to represent the same object, which will almost certainly lead to code failure. <S> Note that it's not a good practice to have long identifier names. <S> It makes your code harder to read & understand. <A> Any limitation to the length of the identifiers is implementation-dependent, but the first 31 characters should be significant in a conforming implementation. <S> To make that clear, it's okay to allow 4000-character identifiers, but have Pseudopseudohypoparathyroidism_1 (silently, involuntarily) refer to the same variable as Pseudopseudohypoparathyroidism_2. <A> There are standards, but it's better to check the compiler's manual. <S> Long variable names are a good idea if they are descriptive. <S> Something like "USER_prepare_new_user_log()" tells you the function is part of the "USER" file/subsystem and the rest is descriptive and easy to read. <S> Some people use things like Camel Case <S> but I prefer underscores for readability.
| It is compiler dependent, see the compiler's manual. For GCC it says the name can be "arbitrarily long", so no limit.
|
How to calculate power supply for 100x loads @ 3V 700mA I'm currently designing a setup using 100x loads that requires a 3V 700mA supply ea.The loads are connected in parallel with the main power supply. I'm a bit doubting about my power supply dimension and I don't think I'm calculating this right... But, it should be something like 3V 70A? Is that right? The thing is that 70A is a bit scary and I don't really want to play with such big current. I would like to have an opinion. <Q> = 70A. <S> Power is not that scary - 70A <S> at 3V is just 210 Watts. <S> Some large PC (and server) power supplies are able to deliver such currents. <S> However you should split your power supply to few power supplies. <S> Easiest way to built such power supply will be traditional transformer. <S> Transformer price is determined by power, not current. <S> You can use transformer with few 7A windings (split to 10 circuits), use separate rectifiers at every block. <S> That will reduce short-circuit current and significantly improve fire safety. <S> You should use fuses at all outputs or split whole power to 10-25 blocks with separate fuses, because 70A will melt thin wires when they will be accidently shorted or damaged. <S> You can build cheap unregulated power supply like this: <S> Unregulated means that voltage may vary/drop under diffrent load conditions. <S> Peltier cells not require very stable voltage <S> and you can stay with unregulated supply. <S> Fuses are required at every transformer secondary. <A> 70A is correct , but not too scary. <S> 10kA can be scary. <S> Thats what your household can supply near a substation worst case , with a screw driver short circuit. <S> Vaporized copper melted on my glasses , did that when I not too carefully used a screwdriver to pry off a staple for 120Vac line that I was relocating near a fuse panel. <S> The latest CPU uses more than this too. <S> Consider using a few magnetic breakers, busbars and welders cable for distribution, if it needs to be flexible.. <S> What's the startup current 500A? <S> ;) <S> Off the top of my head, a Murata 70A 3V supply should be around $1~2/Watt but a 500W $50 PC x4 = <S> $200 will supply 20A each on the 3.3V rail. <S> With some shopping with might get some old 15A units free and I'll let U figure how to drop 0.3 V with 0.2A <S> (1.5Ohm) <S> using nichrome wire from some old toaster for free using short strips for each feed wire. <S> But I suspect your boss can sign a PO for $250. <S> Stay cool. <S> use Ohm's Law , use fault protection and make it look like a million dollar test jig with LED's. <A> How about this option, which will allow switching hot/cold direction and also allow you to use more economical PSU, wiring and H-Bridge. <S> Wire the units up in 25 sets of 4. <S> Each set would have 4 elements in series, and then you wire the 25 sets in parallel. <S> Or you could do it the other way around -- 4 sets of 25. <S> Each set of 25 wired in parallel, with the 4 sets in series. <S> I think the first arrangement might be better as it's easier to troubleshoot a dud element. <S> This will allow you to use 12V at only about 17A, which is well within the range of an inexpensive PC power supply. <S> For 17A you can use wire intended for house electrical wiring. <S> And the FETS you need to H-bridge the whole thing can be much more modest too. <S> Finally, if you're not sure that 12V exactly is the right voltage <S> , you can instead get readily-available generic "12V" PSUs that have trimming adjustments that allow going up or down a little from the nominal voltage.
| Your calculation is correct - 0.7A x 100
|
Is my phone battery better / more capacitative than my laptop battery? When we go out and look for phones, the first thing I do I always look at the battery capacity, usually 2000 mAh, 3000, up to 10000 mAh for a (external?) battery. Looking at laptop batteries, they are much much larger and have only afraction of what the most massive batteries for phones have. My laptop battery has, for example, 5000 mAh, probably not much higher than 15-20V, if I get four 10,000 mAh phone batteries I get the same voltage range in serial connection and still those 10,000 mAh, or not? (or maybe 40,000 mAh). Yet I will save space. Is it a wise choice to construct such a battery for my laptop? Is my logic correct? <Q> Until recently, all lithium laptop batteries were made up of cylindrical lithium-ion cells. <S> Now, many designs are using a lithium polymer (pouch) type battery in laptops. <S> This is allowing the thinner laptop designs. <S> The properties of the cylindrical and the polymer cells are almost the same. <S> The advantage of the soft pouch construction allows the same capacity battery fit into a smaller space, due to not having air voids between the cylindrical cells. <S> It is also important to note that many after market phone battery capacities are pulled from a data sheet that was printed in a Fantasy Land where everyone rides unicorns. <A> You can't compare different voltage battery capacities in mAh. <S> You have to calculate watt hour capacity (real energy). <S> $$Wh = <S> Ah \cdot V$$ <S> For 2000mAh 3.7V phone battery (example) <S> - capacity is: $$2000 \cdot 3.7 = 7400mWh = <S> 7.4Wh$$ <S> For 11.1V 2000mAh battery it will be $$11.1 \cdot <S> 2000 = 22200mWh <S> = <S> 22.2Wh$$ <S> So energy is different, but constant current capacity are the same. <S> In reasonable quality devices battery technology is the same, allows the same energy density per mass or size. <S> Some laptop batteries have complicated circuits built in, and you typically pay more per 1 <S> Wh. <S> Watch <S> EEVblog <S> #140 - Battery Capacity Tutorial for more information. <S> There is an explanation why Ah unit is used more than Wh. <A> Both batteries use the same (or comparable) battery chemistry, but the laptop battery has a much higher voltage (11.1V <S> to 16.8V vs. 3.7V), and has both protection and charging technology built-in rather than in the main device itself. <S> These lead to a discrepancy in both capacity in Ah and in overall energy density, and is one of the main reasons why capacity in <S> Wh is more accurate (since Wh describes how much energy the battery actually contains rather than how much current can be drawn from it over time). <S> So to answer your question, while it may be possible to construct a laptop battery from discrete components, it is almost never practical to do so, and perhaps just a little unwise. <A> A genuine battery for my phone costs £10 and is 1.2Ah @ <S> 3.7V, for my laptop £23 and 4.8Ah <S> @ <S> 10.8V. <S> Making a laptop from the phone batteries would require x4 for capacity and x3 for voltage, costing £120 instead. <S> I don't see a particular gain there. <S> If you're lucky, they may not explode.
| When you buy battery - you pay for energy capacity, not mAh. You may be able to source cheaper batteries which claim higher capacity.
|
USB3 with fewer wires USB3 offer a much faster bandwidth than USB2 but, technically, at the price of more wires that results in a thicker cable.USB3 is build with 9 wires, 4 are standard USB2 and 5 are the USB3 serial (2 differential transmit, 2 differential receive and one GND). In an effort to make a thin & flexible cable, would it be possible to make a 5 wire cable, just with the USB3 wires? Assuming that both sides of the cable are USB3? <Q> I could not find any information regarding initial synchronization for USB3. <S> The best idea I could come up with is insulating the UTP pair from the old USB and trying it out. <S> So I covered the two center data pins on my USB3 hard drive cable with some kapton tape and plugged it in. <S> The computer negotiates with the drive fine. <S> No longer initial sync than normal. <S> It is likely that a 6 wire USB3 cable would work. <S> 4 for LVDS pairs and Power and Ground. <S> However, most cables have a separate ground for each LVDS pair. <S> This is to give return current paths other than the pair. <S> This is helpful for signal integrity, just like how return current actually flows in the ground plane under LVDS pairs, not in the other pair, on a PCB. <S> So you are actually loosing only 2 of 10 wires. <A> The nine wires used in a USB 3.0 cable are shown below. <S> 1 <S> VBUS <S> Power2 <S> D− USB 2.0 differential <S> pair3 <S> D+4 <S> GND Ground for power return5 <S> StdA_SSRX− <S> / StdB_SSTX− SuperSpeed transmitter differential pair6 <S> StdA_SSRX+ <S> / <S> StdB_SSTX+7 <S> GND_DRAIN Ground for signal return8 <S> StdA_SSTX− / StdB_SSRX− SuperSpeed receiver differential pair9 <S> StdA_SSTX+ / <S> StdB_SSRX+ <S> Leads 1 through 4 are used for USB 2.0 connections. <S> Leads <S> 5 through 9 were added for USB 3.0. <S> VBUS and GND are power wires, and can be used to power a device, supplying either 100 mA or 500 mA at 5V. Note <S> that GND_DRAIN is not the same as GND. <S> The two differential pairs are each wrapped with a ground shield, and GND_DRAIN is connected to this shield. <S> GND_DRAIN is not internally connected to GND inside the cable. <S> I assume that GND_DRAIN is connected externally to GND only at one end of the cable to avoid ground loops. <S> The differential pairs are outputs from one end, and inputs to the other, therefore the dual labels. <S> According to this article under the heading Bus Speed, the transmitter first tries to detect the termination of the differential pair on the receiver side. <S> If none is found, then the host drops back to USB 2.0 and uses the D-/D+ pair for communication. <S> From this I assume you might be able to get by without <S> the D-/D+ leads 2 and 3. <S> If you are acting as a host, you must supply 5v on the VBUS line. <S> If you are a device, you can ignore this line if you are self-powered. <S> So as a minimum, you might be able to get by with the six leads 4-9. <A> I bought a USB 3.0 extension cable and check whether D+/D- can be ignored by 3.0. <S> Extension cable works good with 3.0 and 2.0. <S> I cut D+/D- 2.0 data line from the USB 3.0 cable. <S> there was no USB 3.0 connection. <S> no 2.0 of course. <S> I re-bind <S> D+/D- 2.0 line <S> , connection OK. <S> From my experiment, I think D+/D- cannot be ignored even for 3.0.I test this with USB 3.0 memory and USB 3.0 hub. <S> Both case no connection without D+/D-. <A> The report from Doojin is wrong, something else was not right. <S> There is no reason for USB3.0 not to work if D+/D- wires are cut off. <S> I just did the same experiment, and a USB3 pen drive works just fine. <S> The USB3 connect protocol is as follows: <S> USB3 device gets plugged in. <S> Rx channel gets terminated with 45 Ohms to ground, but D+ is not pulled up yet. <S> The USB3 host sends a positive pulse on both Tx lines, and watches for RC response. <S> The host does this periodically at about 100ms intervals. <S> If USB3 termination is present, the line charge timing is defined by Rsense and 0.1uF decoupling cap, which is connected to ground via the Rx termination. <S> The special circuitry in host transmitter detects this, see section 6.11 of USB3.1 specifications, Figure 6-36. <S> Then the host starts Polling. <S> LFPS signaling, following by a handshake from device, and link training protocol begins. <S> USB 3.0 communication gets established. <S> NOTE: <S> The D+/D- are not involved. <S> If USB3 Rx termination is not present, the line charge is much faster since it is determined only by bulk cable capacitance. <S> The host detects this and does not proceed with Polling. <S> LFPS and USB3 connection is not established. <S> If the above USB3 connection handshake fails, only then the device tries to connect as USB2 device, by pulling D+ high. <S> If D+/- are not present, no USB connection will be established. <S> Conclusion: <S> However, does the elimination of 10% of overall wires (measured as overall AWG) really saves anything in mechanical stiffness of cables?
| yes, it is possible to remove D+/D- twisted pair of wires, and have the USB3 link working.
|
Oscilloscope gear and ESD The answer might be obvious, but I am curious, how well are oscilloscopes and probes usually protected against ESD? I noticed that oscilloscope probes are usually shipped in esd-protected bags. On the one hand it's just easy to always use these bags for all electronics equipment but on the other it could add up to the cost. <Q> A grounded 15pF probe should be low risk if the unit is grounded but your finger needs a string to remind you to wear a wrist strap. <S> (1M to gnd) <S> But if you are lucky to have a 500MHz Tektronix differential FET probe, those FETs are rated for 25V < 1pF and technicians hate engineers who bring in broken probes for repair. <S> You can blow those looking sideways unless you practise safe Test Engineering EOS awareness. <S> e.g. Always shake hands or touch someone before handing them a board handled by the ground , V+ rails <A> The oscilloscope and probe are protected fairly well against ESD however the object you are connecting them too may not be. <S> You should always observe proper ESD safety when using any measurement equipment because what you are measuring may be static sensitive. <A> You may take a look at " Best Practices High Performance Oscilloscopes " document from Tektronix or similar document from other manufacturer. <S> Oscilloscope manual should also contain comprehensive information, probably including ESD protection capabilities. <S> Document <S> I mentioned says: CAUTION. <S> ESD is a concern when handling any electronic equipment. <S> A cable that is left unconnected on a bench can develop a very large static charge that can damage the instrument. <S> To avoid this source of damage, use the following techniques to prevent electrostatic discharge into the instrument: <S> Discharge the static voltage from your body by wearing a grounded antistatic wrist strap when you connect and disconnect cables and adapters. <S> Your oscilloscope provides a convenient front-panel connection for this purpose. <S> Discharge the static charge from any cable before you connect it to the oscilloscope or device under test by momentarily grounding the center conductor of the cable, or by connecting a 50 ohm termination to one end, prior to attaching the cable to the instrument. <S> Sentence about unconnected cable should explain why probes are delivered in ESD protection bags. <S> This is "better safe than sorry", but in some ESD-friendly environments/laboratories/workshops care about ESD is very important.
| All Tektronix oscilloscopes and probes are designed with robust ESD protection; however, large discharges of static electricity applied to the signal inputs may damage the equipment.
|
PIC12 DAC has no output I have a PIC12F1571 (datasheet here: http://ww1.microchip.com/downloads/en/DeviceDoc/40001723b.pdf ) that I have programmed to read an analog input, do some processing on the value read and then ouput a related value on the onchip DAC. For testing, I have hooked up a potentiometer to the analog input and I can see in the MPLAB debugger that the correct value is being read by the PIC (ADRESH/ADRESL are set appropriately by the ADC). I have also verified that the DAC bits are being set properly in DACCON0 and DACCON1 registers- in the debugger I can see that the DAC is getting set to the right output, but there is no voltage on the output pin. I have double checked the direction of my TRISA register for the appropriate pins, made sure that the alternate pin function register has no conflicts and that everything else is disabled. Code is below. I have set up the PIC so that RA4 - pin 3 (Analog Channel 3) is being used as the ADC input and RA0 - pin 7 is being used as the DAC output. #if defined(__XC) #include <xc.h> /* XC8 General Include File */#endif#include <stdio.h>#include <stdlib.h>#include <pic12f1571.h>#define SYS_FREQ 500000L//#define FCY SYS_FREQ/4//Set up using the Memory View (Window -> PIC Memory Views -> Configuration Bits// CONFIG1#pragma config FOSC = INTOSC // (ECH, External Clock, High Power Mode (4-32 MHz); device clock supplied to CLKIN pin)#pragma config WDTE = OFF // Watchdog Timer Enable (WDT enabled)#pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled)#pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR)#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)#pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset enabled)#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)// CONFIG2#pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off)#pragma config PLLEN = OFF // PLL Enable (4x PLL disabled)#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset)#pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.)#pragma config LPBOREN = OFF // Low Power Brown-out Reset enable bit (LPBOR is disabled)#pragma config LVP = OFF // Low-Voltage Programming Enable (Low-voltage programming enabled)void setup(void){ /* Configure Interrupts * INTCON - Interrupt Control Register: * Set GIE (Global Interrupt Enable) * Set PEIE (Peripheral Interrupt Enable bit (for ADC interrupts) * Set TMR0IE (Timer0 Overflow Interrupt Enable bit) * * PEI1 - Peripheral Interrupt Enable Register: * Set ADIE (ADC Interrupt Enable bit) */ INTCON = 0xE0; PIE1 = 0x40; PIE2 = 0x00; PIE3 = 0x00;/* Configure PORTA for the following: * * Configure TRISA for Port A Direction Control * only have 1 input pin - RA4 * 1 output pin - RA0 (for DAC1) * * Configure ODCONA for Open-drain Control * PORTA configured as standard push-pull * * Configure SLRCONA for Slew Rate Control * Slew rate is unlimited * * Configure INLVLA for Input Threshold Control * Doesn't need to be set since all input is analog * * Configure ANSEL registers for ADC operation on AN3 (RA4/pin 3) */ TRISA = 0x10; ODCONA = 0x00; SLRCONA = 0x00; INLVLA = 0x00; ANSELA = 0x10; /* Configure TIMER0 * * In OPTION_REG: * Select Internal instruction clock * Select no prescaler on the timer * * */ OPTION_REG = 0x84; /* Configure ADC * * Set ADCON0 to the following: * CHS set to analog channel AN3 = 00011 (RA4/pin 3) * ADON set to ADC enabled = 1 * * Set ADCON1 to the following: * ADFM set to left justified = 0 (so that we can get away with reading a * single byte for our converted value) * ADCS Conversion clock source set to Fosc/8 = 001 * ADPREF set to Vdd reference = 00 * * Set ADCON2 to trigger on Timer0 overflow * ADCON2:TRIGSEL = 0011 */ ADCON0 = 0x0D; ADCON1 = 0x10; ADCON2 = 0x30; /* Configure up DAC * Set DACCON0 register: * DACEN set to DAC enabled = 1 * DACOE set to voltage level output = 1 * DACPSS<1:0> is set to Vdd = 00 * * DACCON1 register contains the DACR bits (i.e. the output value) * */ DACCON0 = 0xA0; DACCON1 = 0x00; // Set APFCON register to APFCON = 0xFF;}void interrupt isr(void){ if(TMR0IF) { TMR0IF = 0; /* Clear TIMER0 Overflow Interrupt Flag*/ //ADC will automatically start converting now // ++counter; } if(ADIF) { /* Clear ADC Completion Interrupt Flag */ ADIF = 0; DACCON1 = ADRESH >> 3; }}int main(int argc, char** argv) { setup(); while(1); return (EXIT_SUCCESS);} What am I missing? This should be easy... <Q> This is because the RA0 pin is also used for ICSPDAT, so there was a conflict <S> and I'm guessing <S> the compiler/IDE decided not to actually output anything - I had checked that it wasn't just a pull down in the PICKit3 programmer by disconnecting the wire. <S> Programmed the PIC in regular mode and the DAC outputs just fine - although if the PICKit3 is left connected to the DAC output pin, the max voltage is 1/3 of Vdd. <S> This makes sense as well. <S> In the end, its user error. <A> It doesn't look like you're telling your ADC to do a conversion, even though you've enabled the module. <S> On the PIC18F I use, I have to specifically write a 1 to the GO/~DONE bit of ADCON0 to tell it that I want it to convert something. <S> When it's done, it will raise the interrupt. <S> It doesn't convert without you first requesting it, which looking at your code you never do -- you just wait forever. <S> Glancing at the datasheet, this one looks like it works the same as the chip I use. <A> If you talk about DAC, I will show you a following code. <S> But I think that you are confusing ADC with DAC. <S> It works exactly with my own pic12f1572. <S> int <S> main(void){ <S> OSCCON = 0b01111000; // for example,16 MHz ANSELA = 0b00000000 <S> ; // all pins to digital PORTA = 0b00000000; // <S> all port bits off TRISA = 0b00001000 <S> ; // all pins to outputs except RA3 (MCLR) ADCON0 = 0b01111000; // use DAC DACCON0= 0b10100000 <S> ; // <S> DAC enable, VDD as reference DACCON1= 0b00011111; // for example,32 as output = VDD} <A> I am using the pic12F1572 to provide a DAC but found if I put a scope on the output the correct answer was seen but if I connected to a load much less than 100k the output was nonlinear or zero. <S> I checked the datasheet and it implied that this was relay only intended for generating reference voltages to be used within the chip. <S> My solution was to put a small FET <S> Op Amp on the output as a driver and all is fine.
| I think the code worked all along - the problem was that the DAC would not actually output anything when the PIC was programmed for debug mode. Definitely an issue with programming the PIC in debug mode.
|
2 momentary switches, controlling 4 outputs in sequence using latching type relays I am interested in building a solenoid controller using latching type relays(containing 2 coils and DPDT). The relays are controlled using two momentary switches. The action I am looking to get is by pressing switch (SW1) I can have #1/4 solenoids activate, and by pressing SW1 again #2/4 solenoids activate while #1/4 deactivates. Pressing SW1 will activate each solenoid individually 1-4 in sequence till #4 is reached. SW2 will reverse the sequence direction from #4 to #1. Each press of either switch will control only one action respective to its purpose. Is this possible? <Q> I'd consider using a binary up-down counter like this . <S> Decode the two least significant outputs with a 2-4 line decoder and then use 4x MOSFETs for driving the solenoids. <S> Forget about latching relays - this is a more reliable solution I would say. <A> If you want to use latching relays, the microcontroller could also generate output pulses (eg 50ms) to trigger the 8 coils, and power dissipation could thus be minimized. <S> It could be accomplished with logic packages but it would be rather tedious compared to a few lines of code. <A> If you want to use both poles of each relay for driving solenoids, the answer is no. <S> In general terms, the problem is that the coil drive from the switches must have information about the current state of the system, and that can only be determined (pretty much by definition) by accessing one or more of the relay contacts.
| The simplest way is to use a small microcontroller such as a 82-cent PIC16F1503 to debounce the switches and hold the current state in EEPROM, if necessary.
|
How do we charge a small 12V battery from a large 12V battery bank In a youth organization that I am part of we are building a traveling stand alone system, which will be put up on various fairs and music festivals. On one of the festivals there is a wish that we can charge 12V car batteries for people, that they can in turn use for playing music in their camps. We will have a 1050Ah 12V battery bank. It is actually much bigger than what we wanted, but we got it extremely cheap from a bankrupt company. We will have smth like 1500W solar panels. How should we go about charging other peoples batteries? I guess I should look for a 12V to 12V charge controller? But does that even exist? I know that there are 12V to 12V solar chargers, but I am not sure how they work from just one battery to another. I guess a 12V battery to 12V battery should be able to lift the voltage. <Q> To charge a lead acid battery you need more than 12V. <S> Any charger would be a combination of a DC-DC boost converter and some circuitry to control the charge current. <S> Probably the easiest off-the-shelf solution which you could piece together in a hardware store would be a DC to AC inverter coupled with any standard lead acid charger. <S> It wouldn't be as efficient as a DC-DC converter charger, but would be a lot less specialised. <S> There can be issues with cheap modified square wave inverters and some devices - I'm not sure if that would be an issue here. <S> There is devices which will do what you want. <S> (I've never had any dealings with them, they were just the first result when I googled "DC DC lead acid charger". <S> Finally, you could build something yourself. <S> DC DC boost converters are fairly ubiquitous and a lead acid battery charging IC like the <S> uc3906 <S> is available in a DIP form factor and has a fairly low part count requirement. <S> It would require some design work and knowledge of electronics though, so if you're looking for something as simple and rugged as possible this isn't the ideal approach. <A> I do 12V battery to 120V inverter ops for outdoor festivals all the time. <S> You really ought to use a pure sine-wave inverter to power up chargers, especially for power tools, because modified sine-wave inverters (most all the cheap ones) produce a waveform that heats up the transformers in the chargers so that power is wasted and they may even burn out. <S> There are inexpensive pure sine-wave inverters available these days, so you won't have to pay an arm and a leg for a medium-power one that's suitable for this application. <S> But if you're planning to use and inverter to power any mechanical appliances (those that have motors), you'll need to buy an inverter with a continuous power rating about 10 times the rating of your appliance because they draw huge surge currents when the motor first starts up. <A> The easiest solution might be in a few steps, if you have any money left. <S> 1) Buy a charge controller for the 1500 watt solar panels so that they can re-charge the large lead acid battery that you have. <S> I hope that the solar panel voltage matches that battery voltage <S> and then you can just connect it to the charge controller. <S> You can get a reliable charge controller off of e-bay for $10-20. <S> While you are charging peoples lead acid batteries, the solar panels are keeping your batteries nicely charged. <S> It is always a good idea to keep your lead acid batteries as fully charged as you can. <S> 2) Buy the biggest wattage 12 volt AC inverter that you can afford (wihtin reason that is not too big for your battery bank). <S> You attach the inverter to the huge 12 volt battery bank that you have <S> and then you can plug in any devices to the inverter and charge your devices including ipods, lapops and other batteries. <S> You can find these at any automotive store or in the automotive department of target or Walmart. <S> 4) Have fun. <A> If I were you, I would not make my life to complicated , and I would juts buy any charging module that includes a Dc To DC buck converter from Ebay or Aliexpress. <S> Like the one from the link below. <S> This one is less than $5, including shipping. <S> I have use many of these kind of modules with great results. <S> See aliexpress.com
| 3) Buy a 12 volt lead acid battery charger that you would also plug into the inverter and use it to charge the various smaller lead acid batteries that you want to charge. This company seem to have a whole range of them.
|
Calculate the maximum current of zero ohm resistors According to Ohm's Law, if the resistance is zero, the power dissipated by a resistor is unmeaning. $$P_d = R \times I^2$$ $$I = \sqrt{ \frac {P_d}{R} }$$ Can one calculate the resistance given that power is defined? Only by knowing power, how can one calculate the maximum current of a zero-Ohm resistor? I'm a bit confused as I've seen there is zero-Ohm resistors with specified power in the market. <Q> Unfortunately there is no such thing as a true zero ohm resistor (outside of superconductors). <S> Zero ohm resistors available on the market (often called 0R link or jumper) will specify a maximum resistance. <S> This datasheet is for a range of 0402 surface mount resistors, and specifies that 0R jumper resistors have a resistance of less than 0.05 ohms. <S> It also specifies a maximum power dissipation of 1/16W. <S> This implies that (worst case) the maximum current you can safely pass through the part is:$$\sqrt{ \frac {P_d}{R} } = <S> I$$ <S> Which comes out to around 1.1A, for such a small part it sounds reasonable. <S> You must bear in mind however that for such low resistances, tracks/wires and solder blobs will have a big impact on this value. <S> If you need a lower resistance and/or more current capacity, parallel the resistors up. <S> EDIT: <S> So for a true zero ohm resistor, no power would be dissipated, allowing infinite current. <S> If your interested in the theoretical side, then I suggest you read some Wikipedia articles on superconductors where the resistance truly is zero. <S> Things get a bit weird. <A> The power rating (and the tolerance) of a so-called 0\$\Omega\$ resistor is sort of vestigial- <S> it comes from the series of resistors that the jumper resembles. <S> The actual current rating does not necessarily represent the same power dissipation as a similar resistor (the limit may be something like current density rather than power dissipation). <S> For example, the Rohm MCR03ERTJ000 is part of the MCR03 series rated at 100mW, but the jumper version is 50m\$\Omega\$ maximum and rated at 1A max , <S> so only 50mW. <S> So, it is not valid or safe in general to calculate the current rating <S> , you should look it up in the data or contact the manufacturer, especially if high peak currents will occur, or your jumper could act as a fuse. <A> If resistance is zero, power is also zero. <S> It's as simple as that. <S> The maximum current of a real "zero ohm" resistor will be listed in the data sheet.
| From a theoretical point of view, as the resistance decreases the power dissipation tends towards zero.
|
DIY NFC boosting antenna for a mobile device I am very new to this. I'm a dentist trying to improve client flow in a busy office. I would like to develop a cheap proof of concept for an NFC enabled client tracking system using a hacked mobile phone. My idea is to develop a system where I place passive NFC tags on the door frames of my office. As a client walks into the room, the cell phone reads the NFC tag and sends a message via Wi-Fi to a computer which collects the data. Since NFC only works at short distances, I would like to make an external antenna that would extend the range of the cell phone (Samsung Galaxy 4) and allow it to read tags at a distance of about 30-60 cm. The size/shape of the antenna is not a concern at this point, but practically speaking the largest dipole antenna I would consider is 200 cm. (I'm not completely sure what a dipole antenna is but I read this and it sounded important :) I know RFID is better at these distances but it's also more expensive and I'd like to keep the cost to the absolute minimum. The same goes for the mobile device. This may be possible with more specialized equipment but the cost and ubiquity of mobile phones make it the preferred reader (also makes programming the tags easier). My questions are: Is this feasible? How would the antennas be designed? Shape - planar circular vs cylindrical vs dipole; Size - 22.11 meters long What is the best way to connect to the native NFC antenna pins? <Q> When I first read your question I assumed the following: <S> You are trying to track your clients' movements using your clients' smartphones <S> Your clients would have to install an app on their smartphones in order to enable this <S> Then I saw the discussion about hacking the smartphones to change their antennas. <S> This would imply that you would be providing the phones and giving them to the clients. <S> Hacking a cellphone to make it read NFC at a greater distance, would IMHO be quite a difficult task. <S> As has been pointed out, NFC is specifically designed to limit distance (for privacy and security considerations, I believe). <S> Unless I'm missing something... <S> if your scheme requires giving them something to carry with them in the clinic, you might just as well give them RFID tags, and place RFID readers in the doorways. <S> On the other hand, if you want to use the clients' cellphones with a downloaded app, as another poster suggested, Bluetooth low energy beacons might be a better approach, as BLE is designed to be readable at a greater distance. <A> You want a magnetic loop antenna. <S> A wire loop around the doorframe with a tuning capacitor on the left and cellphone on the right. <S> Borrow a grid dip meter from your local ham radio club and adjust the capacitor to resonate at 13.56 MHz. <S> The cellphone must be slightly within the loop. <S> This will boost your signal to a range of a few meters if set up correctly. <S> Again a ham radio expert can set this up in half hour including coffee. <S> Use the biggest loop you can and tune it with a capacitor. <S> Aluminium duct <S> tape works well and carefully overlap the ends just the right amount to form the tuned capacitor. <A> The main problem is not concerned with the size or type of antenna, but with the physical operation of NFC. <S> Being Near Field Communication, in order to achieve proper coupling requires that the devices are at most 10 cm apart [source] . <S> As you can read in the link (spoiler: lots of math!), the limitations are due to the wavelength of the signal, and the antenna size is only a consequence of that. <S> Can you request the patients to actively "scan" the tags when entering? <A> It is specifically designed as a very short range protocol. <S> Your use case sounds like it might work with Bluetooth Low-Energy, though. <S> For example, Apple's iBeacon uses BLE tags as "breadcrumbs" to mark specific locations. <S> You should be able to implement something similar, even if you don't want to buy into the iDevice ecosystem. <A> As the other people say, the NFC is designed for short distances in order to keep the user safe of other device not desired. <S> If I were you, I use a Bluetooth Low Energy, that will filter devices depending of the RSSI. <S> You can use any kind of Beacon, (for example iBeacon) <S> Pros of BLE:-They can be programmable for example <S> TI CC2540/41 for your need.-The devices are <S> small and cheap.-The batteries give you enough battery for more of 6 months.-I <S> Suggest you any ble or beacon from aliexpress. <S> Aliexpress ibeacons/ble -More <S> difficult of programing <S> but you can filter with the distance to customer's phone.
| As others have pointed out, the physics of NFC are against you. You can make a similar booster for the tag.
|
Is It Safe To Apply 24V Across a 12V Motor? I am trying to determine if it is safe to apply 24V across a 12V rated motor. I am working on a robot that weighs approximately 150lb and has a friction intensive drive system. I believe the motors are drawing >60A as my motor controller is giving an error. If I switch to 24V would the current being drawn be cut in half? Here is the spec sheet of the motor: http://files.andymark.com/CIM-motor-curve.pdf Thank you for your help EDIT: Also would it be possible to use two relays per motor instead of a motor controller to allow for the motor to draw higher currents? <Q> Ok, a couple of things: It's pretty much never a good idea to surpass <S> recommended brushed DC motor voltage ratings, as doing so will definitely damage <S> /overheat your motor leading to safety issues. <S> If you need to increase your power/torque, the way to do that is to add another motor controller/motor and in your code set them to be equal/inverse. <S> I've worked with that motor before, and it definitely should not be drawing >60 amps, even 40 amps is alot. <S> Try using a multi-meter to test current, or put in a 40amp fuse in series with your motor wiring. <S> What motor controller are you using? <S> Considering you're using a CIM <S> I assume it's FIRST <S> (Talon, Victor, Jaguar, etc). <S> If you motor was drawing over the maximum current you would not get an "error," rather it would simply stop working. <S> I recommend revisiting your wiring diagram. <S> Additionally, these motors draw a lot of current, make sure your power supply can handle them. <S> I would love to hear more about your project <S> so I could better understand your issue. <A> If you re-wind <S> the coils for the higher voltage (twice the turns), then yes, you would see lower current draw for the same load. <S> But if you simply apply higher voltage to the existing motor, it will simply force more current through it, not less. <A> In general, you shouldn't apply more than the rated voltage to a DC motor. <S> First, it will not cut the current in half. <S> But it won't, as the other answers said, <S> double the current either. <S> In a DC motor, current is proportional to torque and speed is proportional to voltage. <S> So doubling the voltage will double the speed. <S> If your load is something like a fan or a pump where torque increases with speed, then your current will increase. <S> If the load has constant torque as the speed increases, then your current will stay the same. <S> If your load is constant power as the speed increases, then your current will actually decrease as the speed goes up. <S> So without more information, it is difficult to tell you how increasing voltage (and therefore speed) will affect current. <S> Now, all that is assuming you don't have a control. <S> Assuming your control is rated for at least 24 V AND assuming that you dial the speed back down to your original speed using the control, then the current draw of the control (that is, the input current to the control) <S> will decrease. <S> But the current that the control outputs to the motor will stay the same (for the same reason I mentioned above - current <S> is proportional to torque). <S> This will not fix your problem. <S> Your problem seems to be simply that your motor can't provide enough torque for your load. <S> This could mean that you need to add a gearbox to get more torque (assuming you are okay with less speed) or that you need to find a bigger motor (assuming you can't sacrifice speed). <A> You might find these two blogs to be helpful: Controlling Motors With The Talon <S> SRX and FIRST Robotics (FRC) <S> Motor Modeling <S> They show you how to model/simulate a CIM motor and the Talon SRX controller. <S> You can see how the voltage, current, and mechanical loads all interact. <S> You can see the impact of gearing and multiple motors. <A> Motors may be damaged if any of the following occur (may not be a completely exhaustive list) <S> Any part of the motor reaches a higher temperature than it can tolerate. <S> The temperature differential between different parts of the motor causes parts to expand or contract out of relative tolerance. <S> Any part of the motor is subjected to mechanical forces beyond what it can handle. <S> The magnets in the motor are subjected to stronger magnetic fields than they can handle. <S> In general, DC motor ratings are based upon whichever of the above would cause failure first under "normal" operating conditions. <S> If for a particular motor one knows which of the above factors was responsible for limiting the specified operating voltage, and knows that particular factor won't apply for some reason (e.g. the limiting factor was #1 but the motor will be operating at an ambient temperature of 4C, and will be operated for short enough intervals that it won't overheat) it may be possible to use the motor at a higher voltage without damage. <S> It's important to note, however, that even if one could ensure that the factor which had been limiting the voltage wouldn't be a problem, that would only raise the allowable voltage to the point where the next factor would come into play. <S> A motor which is designed for 12V is unlikely to have insulation which is rated for 12,000V even if one could otherwise drive the motor with very short 12,000V pulses without exceeding any of its other ratings. <S> If the motor's insulation can handle it, driving the motor at 24V half the time and shorting it half the time, switching between the two operations fast enough that the inductance of the motor keeps the current fairly stable, would draw about half as much "average" current from the supply <S> was would driving the motor at 12 volts, and the stress to parts of the motor other than the insulation would be similar to those resulting from 12-volt operation. <S> Some motors would work just fine under such conditions, but others may not. <S> A motor manufacturer should be able to offer guidance as to whether a higher-voltage pulse drive should be usable on any particular device.
| Insulating parts of the motor have higher voltage across them than they can tolerate.
|
Simple way to turn on/off 230V line power by a simple PC? Reopen reviewers: the question didn't ask for a specific product, the question asked for, how to do it. A specific product name may or may not inserted into an upvoted/accepted answer. I had never asked a spam seed intentionally, please don't misinterpret the essential part of the question. What I can: A home PC with a linux, and I can program it on need. I can buy cheap chinese things from ebay. I can solder and do basic electronic tasks. What I can't: I won't create printed circuits for a such simple task. What I want to reach: I want a solution (probably some hw+sw combo), which enabled me to turn on/off the 230V line power of another device by a PC. I prefered a wired solution against wireless because of stability, but wireless can be also ok. What to do? <Q> From what you have said, it sounds like you want a USB mains relay, This will allow you to switch a mains supply on and off from your computer, make sure the relay on the board you buy is rated to your countries mains power format (240V/110V etc..). <S> Such devices can be easily found on ebay or other such sites. <S> Here is an example:- http://www.ebay.co.uk/itm/New-1-Pcs-USB-Relay-1-Channel-Programmable-Computer-Control-For-Smart-Home-5V-/201072772365 <A> You only need to control a single digital signal, which can then cause a relay to be turned on or not. <S> However, ordinary PCs don't come with digital outputs you can get at directly. <S> You can either use a different type of PC or connect a small microcontroller to one of the ports the PC does have. <S> You'd then send commands to the micro, which would set a digital output accordingly, which would control a relay. <S> The common port of a PC that is simplest to connect a micro to is a serial line, or COM port. <S> You need something that converts the RS-232 levels and polarity of the COM port to the UART signals of the micro. <S> Fortunately, there are chips that do just that, such as the common MAX232 or one of its many derivatives. <S> From there it's trivial to write firmware in the micro that interprets bytes sent to it and sets a digital output either high or low. <S> That's more complicated in software and firmware, but the hardware interface is actually easier. <S> USB can also provide power for the micro directly. <S> Since you only want a single digital output, there are some possible cheats, like interpreting one of the RS-232 control lines directly by circuitry that drives a relay. <S> That may sound simple and easy at first, but I don't recommend it. <A> As long as the relay circuit just need a digital signal, this is not complicated to do. <S> Most usb to rs232 allows you to set their dtr or rts line to either high or low. <S> Most of the programming languages nowadays should allow you to manipulate the rts and dtr by just setting a boolean value - With this you dont need a microcontroller. <S> Depending on the levels those rts dtr give (some cheapo usb to rs232 gives 0 to 5v swing - take note, dont confuse them with usb to ttl converters - while some will give you the ideal 10 to -10v swing). <S> I will still use an optocoupler and compute the series resistor and then add a reverse diode protection, better safe than sorry.
| If the PC doesn't have a COM port, you can use a USB to RS-232 converter, or you could have the micro talk to the PC natively over USB.
|
Controlling an Op-amp gain using an MCU && || DAC? I'm building a circuit that will generate various wave forms. The output from the circuit is fed to a summing amplified where positive or negative dc offset is being added. This signal should be attenuated or amplified according to what's written in code (this means no pots.). The control elements I currently have are the MCU with a few free GPIOs and a free channel on a bi-polar 14bit DAC. The solution should take in account the fact this design should be of high quality, so I am not sure using an LED+LDR combo or something like that is really an option as the control should be tight and repeatable. <Q> You can certainly use a digital pot. <S> You might also try a variable gain amplifier -- or maybe a switched capacitor circuit controlling a resistance value in a feedback path to change the gain by changing the switched cap clock frequency. <A> Why would a digital potentiometer, controlled over I2C or SPI, not be accceptable? <S> MCP4552 is only a buck in singles; there are various higher-resolution/performance parts at slightly higher cost, too. <S> The other option is to do everything in the digital domain, and only go to DAC once you need to realize the final, summed, signal. <S> If you need to mix multiple signal generators, and can't just use a single DSP for that for some reason, you can still use a digital link (SPI, I2S, etc) to transport the signal. <A> Here's an idea that you might be able to achieve with a fast PWM signal (circa 10 MHz) - use it and fast analogue switches to gate the signal on and off - a 50% mark-space ratio applied at 10MHz to the signal will half its amplitude and different mark-space ratios will change its amplitude pro rata. <S> You'll need an output filter to recover the "modified" baseband signal. <A> Analog Devices, for instance, makes a wide range of products, with 1 MHz being easily achieved. <S> See http://www.analog.com/en/special-linear-functions/analog-multipliersdividers/products/index.html
| Or, you can go the obvious route, and use an analog multiplier, with your DAC channel as the control voltage.
|
What are the implications of a ROMLESS device? I was looking through the microcontrollers area of Digikey and I noticed a device that i'm interested in although there is the description of "ROMLESS" in the program memory type. http://www.digikey.com/product-search/en/integrated-circuits-ics/embedded-microcontrollers/2556109?k=LPC4330 What I take away from that is that there is no flash memory internal to the chip but since it is Read-Only memory, I question that. Maybe this mean that it needs an external EEPROM to boot the program from? So I'm not entirely sure so here I am asking: 1) What does this exactly mean and 2) How would this change a design? <Q> Actually, it's a bit of a misnomer; there is <S> some on-chip ROM containing boot code and a small one-time-programmable (OTP) ROM for the application to use (serial numbers, configuration data, encryption keys, etc.) <S> But there's no on-chip nonvolatile memory for application code <S> (it seems they wanted to use the chip area to support more SRAM instead), which means that you need to supply some other external memory (flash, SD, hard drive, etc.) <S> to hold the application code and data. <S> If the external device supports random addressing, you can execute code directly from it; otherwise, you can copy code into the on-chip SRAM and execute it from there. <A> It generally means that the device has no on-board non-volatile storage for user code. <S> This means that the firmware must either 1) be executed directly from an external parallel device, or 2) be read into on-board RAM from an external parallel or serial device before being executed there. <A> I have used LPC4330. <S> It does have a boot ROM but no internal Flash. <S> It can execute code either from the internal SRAM or from a Quad SPI Flash. <S> SRAM is faster, of course, and it has multiple channels which allow both internal cores (M3 and M0) to fetch instructions and data simultaneously. <S> If you put code/data for both cores in different SRAM blocks, they won't interfere with each other. <S> Executing code (or fetching data) from QSPI is of course slower, although the tiny cache memory does help... especially, random access is quite slow since the address has to be loaded across SPI. <S> But you can get a huge capacity at a low cost. <S> You're supposed to place critical code and data in SRAM, and use QSPI for non performance critical stuff, like graphic data for your LCD if you have one, for example. <S> The boot ROM will execute your code from QSPI, and the runtime includes a loader which will load code/data into SRAM according to the assignments in your linker script. <S> And... if you want to use your own code to flash the SPI Flash chip... like write your own firmware updater instead of using the debug probe, then this code and all the libraries it uses has to run from SRAM. <A> Check this out: https://youtu.be/0DmzxUM-9v0?t=269 <S> Here ROMless microcontroller are used - I suspect, is due to its advantage of persistent content being less likely to be corrupted by radiation.
| You can't execute code from Flash while the flash chip is in program mode.
|
Can I power a 5V USB hub using 5.33V DC or should I use 7V with a 7805 voltage regulator? I'm basically loading up enough batteries to run a USB hub and a webcam. The USB hub is rated at 5 volts. Right now I've connected 8 batteries ( these batteries , if relevant)in series and in parallel to output 5.3 volts. Will the extra .3 volts cause problems for the USB hub? The 7805 voltage regulator requires a minimum of 7 volts to output a steady 5 volts, so I was wondering if I should increase the battery voltage and do it that way? (I've been trying to avoid this because I figured there would be significant power loss, is that so?) The application is a little 6 volt car/robot with a webcam/raspberry pi/wifi USB. I realize that the hub will probably draw more amperage than my 8 batteries can currently support, so I plan on stacking more batteries if necessary. Also, I'm thinking of powering the USB hub/raspberry pi by separate battery packs. Is there any reason to connect the grounds to each other since they are on separate circuits? <Q> The USB specification is +5V, ±10%, which means that anything from +4.50V to +5.50V will be fine, including your +5.33V battery pack. <A> There are many solutions for 5V output. <S> USB can typically take at least 5.25V, which means that 5.3V is pushing it perhaps too far for some very sensitive devices. <S> However, you don't need a 7805 for getting to 5V stable. <S> There are many LDO regulators with 0.5A - 1.5A current ability that have much lower drop-out. <S> A LF50AB for example can go from 5.3V to 5.0V <S> up to 500 mA (which is the max draw on a standard USB 2.0 port.) <S> Another option is, as has been suggested, a switching converter of some sort. <S> These are more efficient than linear regulators in many cases, although when going from 5.3V to 5.0V with a linear regulator, you're already a 94% efficiency, which is great in that case. <S> A particular regulator I like because it's cheap and reasonably high current and efficiency is the Murata OKI 78SR. <S> It takes 7-35 Volts in, and outputs 5.0V up to 1.5A, with the same pinout as a 7805, but uniformly high efficiency. <S> Finally, batteries are typically higher voltage than indicated when fresh, and lower voltage than indicated when depleted. <S> Thus, using linear regulators is often not the right choice. <S> Putting all the batteries parallel and using a boost converter is also often acceptable -- and for Lithium chemistries, easier to charge correctly. <S> If your batteries start above the target voltage and end below the target voltage, you will need a buck/boost, SEPIC, or similar converter that can work with the input being both above, and below, the input voltage. <S> Pololu has some ready-made ones, although they are not terribly high-current rated, and these topologies are often less efficient than buck-only or boost-only. <A> The proper solution for 5V power is a Lithium cell with a boost converter for most power density. <S> Instead of rolling your own, I would look at a pack made to charge USB devices. <S> This will give you a run time more space efficient than a group of eneloops. <S> If anything on the separate systems talk with each other, you generally need to use a common ground. <S> Otherwise, they don't have a common reference. <S> This, combined with your run time, will give you a battery capacity. <S> That is much cheaper than continually purchasing larger packs, as you find you don't have enough.
| Putting all the batteries in series and using a switching buck regulator (as suggested above) is a good way to get around this. If you have the hub and all devices, you would be a good idea to sacrifice a usb extension cable to break the 5V line and measure current from of your entire setup.
|
Boost or buck regulator for battery life? I want to make a wireless sensor node that will run at about 2.5v. I am trying to decide between running 3 alkaline batteries in series with a buck converter or in parallel with a boost converter. I guess if both converters have the same efficiency, let's say 88%, they would run just as long as each other? The current required for this project should be <200mA <Q> In general, and all other things being more-or-less equal, I 2 R losses are going to be the chief cost of efficiency in a power converter. <S> Therefore, it would be a goal to keep currents as low as possible. <S> This would imply that the overall system efficiency will be better with a buck converter than with a boost converter. <S> The average currents in the batteries, coil and the switching element will all be lower. <A> With a booster you might still be able to get it to work down close to 0.5 volts. <S> If the 3 in series all dropped to about 0 9 volts you'd probably be bust. <S> So it's a booster for my choice but choose your chip carefully. <S> Also, you need to consider that all three batteries need to be of equal charge or there'll be other losses. <S> Not so in series. <S> Extra info on battery ESR that should be taken into account - the effective series resistance of a "typical" alkaline battery is about 0.3 ohms (see Energizer PDF file ). <S> For a series configuration, the ESR will be about 0.9 ohms and for 3 equally "charged" parallel batteries, the ESR is 0.1 ohms. <A> I make this sort of thing for a living. <S> Presumably your sensor will spend most of its time asleep, only waking up to take a reading or send data periodically. <S> In that case a linear regulator might be a better option. <S> For example, a TPS78225 would give you 2.5V @ <S> 150mA. <S> Keep in mind spikes in current demand <S> can be met by caps and inductors. <S> This device has a 0.5uA quiescent current, so if you device spends most of its life asleep you should be able to get down to the single digit <S> uA range. <S> Rather than using 3 cells consider using either 4 (2x2) or perhaps a different chemistry <S> (lithium will give you 3.6V per cell). <S> Obviously you need to minimise the voltage drop for the LDO. <S> This method will likely be much more efficient than any switching system if your idle current is very low. <S> You could even do a hybrid solution where you use an LDO for the microcontroller and switching regulator that is powered up only when needed. <A> Correct, but efficiency varies with load, so they would have to have the same efficiency profile over your operating range.
| Also, some controllers/converters have light load efficiency modes that can make a big difference for battery life if your sensor doesn't draw much current or if it has a sleep or energy saving mode.
|
Why shouldn't I brute force PWM? So I've been playing with an ATtiny45, and it occurs to me that I could probably brute force PWM by prescaling a timer to sysclock/64, then running ISR code that manually switches the outputs on or off depending on global variables set elsewhere in code or via IO. At max sysclock speed of 20MHz I oughta get decent resolution, and I'll get to use all my IO pins as PWMs instead of the two the chip provides, so the big question is...why not? Other than using up a lot of sysclock cycles, I don't really see disadvantages...could someone give me some? <Q> The three disadvantages are Power Consumption, tying up a Timer, and interrupting other code. <S> If you don't care about low power modes, and have no need for the timer, and have no critical code that can't withstand a few clock cycles to service the interrupt, there is no disadvantage. <S> Some projects are fairly simple, and don't take up a tenth of the power of the microcontroller, so don't let anyone tell you you are doing it wrong by taking advantage of the timers like that. <S> Software PWM is fine if it fits your needs. <A> I've just recently been playing with a lot of PWM switching power supply stuff, and you're right, there are perfectly valid reasons to "bit bang" pulse width modulated signals. <S> But one of the chief failings of this method is when you need immediate feedback control of the generated duty cycle. <S> Even with a 20 MHz onboard clock, the cycle time is 50 nanoseconds. <S> Computationally, you would have to acquire the signal being monitored, subtract it from the reference level, and then resume generation of the duty cycle. <S> This will create "jitter" where the duty cycle is inconsistent. <S> Using an onboard DAC isn't out of the question, but it eats up cycles. <S> To trim down on this, you could add an external DAC, but then you have committed maybe 8 or 12 pins from the microcontroller to the external DAC for a quick reading (depending on how much resolution you want). <S> Then you have to worry about additional signal propagation delay through switching components. <S> If what you want is rapid feedback control, it's hard to beat an independent duty cycle IC. <S> The delay of the on board error amplifier is so small that you're more worried about the gain changing at high frequencies. <S> Signal propagation through switching is still the same risk, of course, and has to be designed around. <S> It is also worth pointing out that a lot of PWM IC packages have shutdown features and dead time control inputs that can do really nifty things when coupled with a microcontroller, all on an 8 or 16 pin package. <S> You can actually get the frequency up pretty high if you use a lower prescaler. <S> The duty cycle you get will show quantization error, but that may not even be a big deal depending on what you're doing and how high you take the resolution; but then again, higher resolution comes at the cost of lower frequency. <S> If you don't require instant feedback control, and your application can handle some jitter, then bit-banging may be the way to go. <A> The point of having hardware devices on the chip is to free up the processor for other tasks. <S> If you use PWM hardware then you can simultaneously do other microcontroller tasks. <S> Now I think you've picked up on this bit because you are asking about using an ISR instead of running <S> a for/while loop brute force counter <S> but again it is the same answer. <S> If we don't change the width of the pulse why would we want to interrupt our other tasks unnecessarily? <A> You can easily do what you say <S> - I've done it a few times. <S> It's more useful if you want to change your PWM at predictable times; you can do this by counting the number of PWM cycles, and you'd need a timer to do that anyway. <S> However, there is a tradeoff between the resolution of the PWM / # of outputs vs the amount of free processor time. <S> You will reach a point where you don't have enough free CPU to make it work. <S> I recommend hooking a scope up to a free pin, and then setting that pin high at the beginning of the ISR and low at the end. <S> This will let you see the proportion of the time your routine is using. <A> With this nice and simple technique you can have a lot of SoftPWM channels without a big CPU overhead. <A> Personally I've found the timer PWMs are faster and consistent (in full 256 range, if you don't need such resolution, software["brute-force"] can be faster) , and when I've needed more than 2 <S> I tried soft PWMing alongside the hard PWMs <S> and it wan't very smooth <S> so I opted to do all PWM in software <S> and it turned out great. <S> The only thing is when doing and intermediary calculations/processing/interrupts that take a bit of time, the soft PWM stalls and can be very noticeable.
| Software PWM does not have to very CPU intensive if done in a right way, like using Binary Code Modulation . It's pretty much up to you to decide if the bit bang method can support your needs.
|
Can I use both I2C and SPI at same time with PIC16F1503 Im new to Microchip microcontrollers and I'm looking for very low cost device with I2C and SPI. I want to connect one I2C (ADC) and one SPI device (LCD). I found this very low cost device: However it looks like I2C and SPI share same hardware. Question: Can I use hardware I2C and SPI in one circuit? <Q> Yes, you can use this part to drive both a IIC bus and a SPI bus in the same circuit. <S> However, you can't (reasonably) use the single MSSP module of this device to drive both busses. <S> SPI is a very easy protocol to implement when you are the master, which it appears you are. <S> Since the master owns the clock, there is no problem if your SPI code gets interrupted and arbitrary delays inserted thereby. <S> Take a look at how SPI works. <S> It really is very simple and easy to implement directly in firmware. <S> You could of course do the IIC in firmware and let the MSSP manage the SPI bus. <S> I have written both, and SPI is easier to do in firmware than IIC, so I'd let the MSSP take care of IIC. <S> IIC isn't hard, but it is a little more tricky to do robustly. <A> I agree with @Olin's post. <S> At the same time, there's another point of view on which I 2 C or SPI to implement in software and which in hardware. <S> I 2 C bus has a lower top speed than SPI. <S> Typical I 2 C bus has a max data rate of 400 kbps <S> **. <S> Typical SPI can easily run at 4 Mbps. <S> Some applications require high speed transfer over SPI. <S> For example: SD cards, radio comms. <S> A bit-banged SPI would be too slow. <S> As a result, the SPI would have to be implemented with hardware MSSP, and the slower I 2 <S> C would be implemented in software. <S> Sometimes the speed is not important. <S> For example, a bus slave generates data slowly, so the bus speed is not the limiting factor. <S> ** <S> There are high speed versions of I2C, but they are note very common at the moment of writing. <A> Although in the paragraph you emphasized, they use the word and : <S> The MSSP module can operate in one of two modes: <S> Serial Peripheral Interface (SPI) Inter-Integrated Circuit (I2C™) <S> Datasheet , page 164. <S> But you can software implement the I2C protocol on other pins. <S> However: You can normally mix I2C and SPI on the same pins. <S> I2C only does something between START and STOP. <S> According to http://www.i2cchip.com/mix_spi_i2c.html Also check this: I2C and SPI ,if they share same connection , is there confilict or not
| My recommended solution is to use the MSSP to do IIC and do the SPI by firmware bit-banging of separate I/O pins.
|
Using ultrasonic sensors to measure distances to multiple objects I'm doing a project which using ultrasonic sensors to measure the distances to objects. As far as I know the sensor can only measure the distance of the closest object to it. Is it right? And in case there are multiple objects, can the ultrasonic sensor be able to detect distances to those? <Q> Typically ultrasonic sensors are designed to only return the distance to the first object. <S> They send a pulse out, then time until that pulse comes back from a reflection, and that is the result. <S> They ignore any remaining returns from other reflections. <S> It may be possible to modify or design your own ultrasonic sensor that pays attention to the other reflections as well, giving multiple outputs from multiple objects, but unless you control the environment carefully it can be very complicated to do well. <A> Unltrasonic sensors have a cone in which they measure. <S> The aperture is usually specified in the data sheet and quite wide. <S> Within this cone, the closest object will give the "sensor reading", although objects on the bounds of the cone might not be recognized correctly. <S> So for getting a good idea of e.g. a robots surroundings, laser sensors mounted on a servo might be better. <S> You can sweep the surroundings in well-defined steps with this thing. <A> There are some sensors with an analog envelope output. <S> Which enables you to detect all the reflections detected by the receiver. <S> And of course you can allways just use a transmitter and receiver without additional electronics, so that you deal with the raw signals, and then extract from it whatever you want.
| But the answer to your question is no, unmodified ultrasonic sensors do not perform multiple object detection.
|
Powering peripherals from a microcontroller (ATmega328P) I am wondering if it is possible or even safe to power peripherals like sensors or bluetooth modules from the ATmega328P by setting pins of the microcontroller (uC) to high given that the peripherals are within the current sourcing capabilities and voltage limits of the pins. I'm asking this because it seems more convenient to enter power-down mode on the uC and control the high/low of the switches in software before and after this mode to turn on or off the peripherals. I'm probably missing something and I'd like some clarification on the above. <Q> Changes in current consumption can also cause ripple at the output pins because of the uC's output resistance. <S> Your peripheral is likely to have power decoupling and filter capacitors. <S> Charging them at the first moment will cause inrush current that can be outside current limits acceptable for your uC. <S> It may either cause the capacitors to take a long time to charge at each power-up or damage your uC. <S> Anyway, it's better to have a proper power key (an external MOSFET, for example) than to power anything from the uC output except the case when the specific uC output is designed to be used as a power source. <A> Microcontroller should not have problems when you drain current from its pins below limits. <S> But you have to keep in mind voltage drop across MCU's output driver. <S> It may cause voltage to be lower than expected (see Fig 35-23,24, note also, they give typical , not min-max values). <S> See if your perpherial accepts wide enough voltage range while operating. <S> If you need voltage regulation for peripherial when it is better to get regulator with dedicated enable pin, rather than powering it from MCU. <S> Also internal driver resistance may cause interference through power line. <S> You may need filtering capacitor. <S> Then, you should check if MCU outputs tolerant to capactive or short-circuit loads (quick look in datasheet gives me nothing). <S> E. g. <S> it is common to power LEDS, but very uncommon to power IC's of any sort. <A> It may be okay, but there are a couple of gotchas. <S> First, you want to make sure that there is not excessive voltage drop at the maximum peak current that the device draws (and maximum ambient temperature and minimum supply voltage). <S> Some things, like your Bluetooth module example, may draw current in bursts that far exceed the average current, and the voltage must not dip excessively during those peaks. <S> For Bluetooth, those will likely easily exceed the capacity of a port pin. <S> Secondly, it's generally a really bad idea to run an unprotected port pin outside of an enclosure due to lack of substantial ESD protection, short circuit protection, protection against external voltages being applied and so on. <S> So, that would tend to rule out external sensors unless you add some circuitry to protect the micro against damage and upsets. <S> If you want to run (say) a temperature or humidity sensor that draws a few hundred uA from a port pin, and can verify that the voltage drop of the pin is not excessive (and that the lack of a bypass capacitor is not a problem) then it may be a good way to measure the local PCB temperature or humidity and allow zero-power shutdown of the sensor when it is not being used. <S> Otherwise, it's quite easy to add a hefty high-side switching using a tiny multi-ampere p-channel MOSFET that can control the power, and to add a TVS for transients and a polyfuse and or other short circuit protection. <S> For high reliability applications, it may be best to derive the supply that goes off-board from a separate regulator so you're not giving the outside world any kind of a window into what powers the microcontroller. <A> It's perfectly fine to do this as long as the peripheral consumes less than the rated current of the output pin. <S> Typically I'd avoid any draw more than 20mA for the atmega328p. <S> While there will be some voltage drop, the CMOS design of the atmega328p uses mosfets internally for the I/O, and the voltage drop will be minimal as long as you don't draw too much current. <S> If you need more current, use an external mosfet. <S> As long as you are under the individual (per I/O) limits of the chip, the total (all <S> I/O added together) limits of the chip, and within the operating parameters of the peripheral you're powering, you will be fine. <A> If you are in doubt, use a MOSFET. <S> If you don't want to shop online, radio$hack generally has one or two of them. <S> They are really great; I've used them for driving servos. <S> And they are pretty inexpensive. <S> Basically they are special transistors where the arduino can act as the gate and allow a larger current/voltage source to supply the power. <S> The arduino merely can cut it off, like opening a circuit or closing it.
| If you source much current from the uC, it's likely for its output voltage to drop below what's acceptable for your peripheral.
|
Is the rated speed of an induction motor the synchronous speed? E.g, if a motor is rated at 50Hz, 400V, 22A, 8.29kW, and 1460 rpm, does this means that the motor should be operated from a source voltage of 50Hz, and this corresponds to a synchronous speed of the motor of 1460 rpm? The reason I ask is because an example question and answer I have seen says the following: Q: Estimate the number of poles the motor described above has A: formula for synchronous speed is n=120f/p closest synchronous speed for given rotor is 1500rpm 1500=120*50/p p=4 I'm guessing the reason they rounded 1460 to 1500 is because the number of poles must be an integer. So when you see a motor with a speed rating in rpm, what does this value actually mean? And how does this relate to the synchronous speed (like it has in my example question)? Thanks! <Q> An induction motor never spins at synchronous speed. <S> A motor spinning at constant speed must be producing enough accelerating torque to overcome the decelerating torque of the load. <S> Since an induction motor must slip to provide torque, the full-load speed will always be less than synchronous speed. <S> Even an un-loaded motor with nothing on the shaft still has a decelerating torque, due to the friction of the bearings and so on. <S> Therefore, we have: <S> Rated speed is the speed of the motor at rated output (shaft) power. <S> No-load speed is the speed of the motor with no load on the shaft. <S> Note the motor bearings still impose a nominal load due to friction. <S> Synchronous speed is the speed the motor would spin at if it had absolutely zero load (frictionless bearings and no other losses of any kind.) <S> Related: <S> What does the speed of regulation mean? <S> For reference, here is a typical motor characteristic graph. <S> Note synchronous speed of 3,000 RPM, no-load speed also about 3,000 RPM, and full load speed 2,932 RPM. <A> What you are looking here at is an asynchronous (induction) motor. <S> The difference to a synchronous is in the fact that the rotor is usually just a (sqirrel) cage and some iron. <S> For a synchronous motor the rotor has either a magnet or has geometrically strongly defined(salient) poles and pole gaps. <S> Sometimes it has both! <S> Now why is one synchronous and the other asynchronous? <S> The synchronous motor has a constant excitation in the rotor (or has a constant difference between inductances). <S> Therefore the field rotates in synchronicity with the rotor. <S> $$f_{rotor}=0$$ <S> The asynchrnous motor on the other side has an induced field in the rotor that is dependent on the speed of rotation.$$f_{rotor}>0$$ <S> The rotational speed is calculated from the difference of the stator and rotor flux frequencies. <S> Why is the speed 1460? <S> The stable part of the torque/rotational speed charachteristic for a asynchronous motor is near the synchronous speed. <S> If you want to find the number of poles round it to the nearest synchronous rotational speed and calculate it normally. <S> In some special working regimes this won't be true as the asynchronous motor could operate at for example 900 rotations if you make some adjustments. <S> In your case however it will have p=4 . <S> Read the wikipedia articles, or google <S> asynchrnous and synchronous motors. <A> In Induction motor , synchronous speed(Ns) is just a number that can be calculated in defined formula :Ns=120*f(frequency of supplied Voltage)/Pole. <S> This value will be slightly less than the synchronous speed of the motor due to the decrease in speed from adding the load. <S> The nameplate shown indicates a rated speed of 1460 RPM for this 4-pole, 50 Hz motor. <S> Synchronous Speeed is 1500 RPM.
| But The motor's Rated Operating Speed will be given in RPM, (revolutions per minute) and is the speed the motor will rotate when producing its rated horsepower and supplied its rated voltage.
|
Is there a popular small signal PFET equivalent to NFETs 2N7000 or BS170? Some days ago I was considering using a small signal P-Channel MOSFET in a design of mine, but could not find a suitable part. The specs I was looking for were something like the following: \$I_D = -500mA\$ (continuous drain current) \$V_{GS} = -5V\$ (gate-source voltage, for \$5V\$ logic level) \$V_{DS} = -12V\$ (drain-source voltage) I was expecting to find a popular P-Channel counterpart of N-Channel 2N7000 or BS170 in a TO-92 package, that may be in everybody's bins, just like BJT NPN/PNP pairs BC547/557 and BC337/327, but could not find it. I could just find vendor specific P-Channels in SMD packages. Is there a popular counterpart for 2N7000 or BS170? If not, why not? <Q> That is called a complementary transistor. <S> BS250 is complementary to 2N7000. <S> Check <S> this list for PFETs with the characteristics you want. <S> However I don't know what popular transistors you'll find there. <A> BSS84 . <S> The 2N7000 is not good for 500mA, so you're not really looking for the equivalent ( <S> and you'll probably be pushed out of a TO-92 package into a TO-220 such as the IRLIB9343PBF <S> if you insist on through-hole). <S> Again, if you are willing to use SOT-23, you can get a part that meets all your other requirements for less than 1/10 the price... <S> for example the AO3403 , which is almost magic- 30V, 2.6A, and it turns on quite well (200m\$ \Omega\$) with only 2.5V. Only problem it that it is SOT-23. <A> Consider the design to be sustainable, 2N7002 usually is used to control signals. <S> You can use BSS84 as equivalent but pmos usually is used as power switch. <S> that's why people rarely can find 2N7002's equivalent. <S> They just use 2n7002 to turn on a PMOS power load switch.
| ZVP3306A is not too bad a choice as a complimentary part to the 2N7000, rather cheaper (~30%) than the BS250, but it is still more than six times more expensive than the surface mount SOT-23
|
How do I "cap" a wire so it doesn't short or electrocute someone? I'm repurposing a PSU that I recently replaced. I'm using it in a project that needs high current supplied. I don't need all the wires (as you could imagine), but I don't know how to seal them off safely. I was thinking about trimming them shorter and then adding a bit of electrical tape over the end and doing a little bit of shrink wrap to hold that in place. Is this a good idea? I generally like to stay away from electrical tape, but I can't see any alternatives, and the shrink tubing would hold it in place. Ideally, I would desolder the wires from the PSU, but I'd rather not mess around with it and all the warnings about capacitors. How should I do this? <Q> I would cut the wires to a convenient length, and then use shrink tube over the ends. <S> If you cut 1" of shrink tube, and cover 1/2" of the wire (leaving 1/2" of empty tube), it would offer a lot of protection. <S> The empty section of the tube would neck down nicely... <S> RJR had a good idea: if you bend over the last cm of wire before heatshrinking the end, and put the heatshrink over the doubled-up wire, then the swelling at the end will keep the heatshrink tubing from slipping. <S> Is this PSU from a desktop computer? <S> If so, no need to worry about shocking somebody with the output. <S> All the voltages are too low. <S> Do be safe with the incoming AC wires, through! <A> I've found that using some wire nuts with some electrical tape is your best bet. <S> Here's a full tutorial. <S> http://www.ehow.com/how_6217563_cap-off-electrical-hot-wire.html <A> A good way to seal open wires is also hot glue.
| You could also use a shrink tube and put some hot glue into the open end.
|
Why do PCBs always have an even number of layers? Looking at many online PCB fabs, when spec'ing out a board and uploading your gerbers, often you select how many Layers your board should have. Invariably, the options are always multiples of two. Why is that expected? While if you have three layers, throwing a ground plane in isn't a big deal, but what is the reasoning behind always sticking to even numbers? <Q> the asymmetrical stack-up will tend to lead to excessive warp and twist, particularly after soldering. <S> The stack-ups are made from cores with copper on each side, separated by pre-preg insulator, so they naturally come on pairs. <S> It's better to add another routing layer or ground plane than to use odd layers. <S> Edit: As Brian and others have pointed out, single-layer boards are an exception. <S> Presumably because the foil layer is on the outside of a relatively thick laminate core they do not seem to show so much tendency to warp (though I've had problems with large paper-based phenolic boards after wave soldering). <S> Single layer boards are used in huge quantity for such things as power supplies (where the component density is low and dominated by the large components and clearances required) and disposable consumer goods (where punched boards are de rigueur to meet the price point). <A> Many boards have only one layer, so a odd number. <S> These are usually very high volume boards where every last penny of production cost matters. <S> These boards are usually made from a phenolic and are punched using a custom die, instead of drilled and routed. <S> The board behind the dashboard of my last car was like this, for example. <A> One could conceive using an insulator on the bottom layer and this is possible but there is little advantage as plated thru holes would be impossible. <S> 3 layer boards are rare but also possible using a 2xboard, one prepreg and one copper layer all laminated <S> The another exception is a single sided board. <S> So it is not true that all boards are even sided, single-sided is the best for all consumer goods if possible. <S> , not to sacrifice performance or EMC. <S> TVs often use single sided boards with shielded modules. <S> Isn't that odd? <S> In fact there is very little no cost advantage to even or odd. <S> Least copper is cheapest. <S> In volume it is weight of copper that counts or total copper surface area <S> x layers <S> x oz. <S> There are many process options in multilayer boards that has little to do with number of layers and more to do with features. <S> So the question has a false assumption. <S> In fact any number of layers is possible and fewer is cheaper. <S> For the best resolution in holes, thruhole feature etching can be <S> <0.05mm whereas clad etching is worse due to flow of acid on the surface only. <S> Then final stackup is controlled by gap in each layer and finished thickness by using various prepreg lamination options. <S> Old school fabricators used only double sided boards. <S> Hence even layers. <S> modern fab houses just etch copper only and add lam to make up the stack and then do plating of holes. <S> BLind or buried vias add cost significantly with multiple press and plating operations. <S> So answer is true. <S> , it no longer matters if even or odd ... <S> there are extra costs for excessive holes, excessive drill sizes, excessive milling, blind or buried vias and controlled impedance and extra for polyamide and premium for Rogers Teflon substrates. <S> I am reminded by my old friend Amit @Sierra that when dealing with 2 or 3 mm tracks and holes, to think of Even layers for sequential processing of laminates to improve yields so a N layer board with interleaved pwr/gnd planes and outside signal planes should be grouped in even numbers if there are many blind interconnects between internal layers. <S> This improves DFM greatly. <S> E.g.
| It's possible to make multilayer boards with odd numbers of layers, but they are non-standard, there is no cost savings and there is another issue-
|
Relationship between frequency and power I'm an electrical apprentice, just studying electrotechnology. I know this doesn't really have anything to do with my trade and that I don't need to understand, but I'm curious as to how a change in frequency will affect power, or if it affects power at all, or if I'm on the wrong track completely. What does a change in frequency do to current, etc.? <Q> To keep it very simple, if you have a 1000 watt heater intended to operate on 120 V 60 Hz power, it will produce the same heat at 50 Hz or 400 Hz, provided the voltage remains at 120 V. <S> When you get into motors, transformers, and other non-resistive loads, the power may vary with frequency. <A> It can certainly affect power. <S> Many lossy components will have losses that increase with frequency (hysteresis losses, skin and proximity effects). <S> It really depends on the load, and the frequency range you are considering. <S> If you have specific examples we can comment further. <A> In terms of power frequency, the core excitation current reduces for increasing f <S> so turns are adjusted to yield capacity whatever core steel is chosen, typically 1.5T to 2T. <S> Slightly less core mass in kW/kg with rising f for power transmission. <S> In terms of eddy current losses , they increase with f for same power density slightly. <S> Partial Discharge seems to be more affected by dv/dt excitation which is derived from V and f and insulation quality and contamination from voids or particles in solids and liquids. <S> For long haul DC is best. <S> There is no advantage to use 50 or 60Hz power systems in general but specific components <S> may have preference. <S> But Aircraft prefer much higher f, for lower mass generators.
| Reactive elements will take more or less (reactive) power with changes in frequency.
|
Minimal USB-SIE code example for PIC16F1454 and question about windows driver Im new to PIC microcontrollers. Im looking for minimal USB-SIE (Serial Interface Engine) code example for PIC16F1454. I was browsing Microchip forum, but there are examples with so many details... Questions: Where I can find send and receive byte example with schematic? Do I need to install Windows driver for USB-SIE, or it will work natively? <Q> The only difference between the PIC16F1454 and PIC16F1459 is that the former has no analog components. <S> Even though the Microchip MLA for looks daunting, you don't need most of it. <S> If you want work from the Microchip MLA for say the Mouse Demo or custom <S> HID you only need to do a few things. <S> Select LPCUSBDK_16F1459 as your configuration. <S> This will tell the compiler to use the configuration files in */low_count_usb_development_kit/pic16f1459/.. . <S> Select the chip as the 16F1454 under project properties. <S> There are a few uses of the ADC, which will prevent you from compiling for the 1454. <S> You do not need them so you can use search to get rid of any use of them in the PIC16F1459 files. <S> If you don't have an external oscillator you need to adjust the configuration settings in Source Files/app/system_config/... <S> /pic16f1459 <S> /system.c to use the internal oscillator. <S> All you need to do is define USE_INTERNAL_OSC. <S> Also, you need to put a line somewhere to set ACTCON = 0x90. <S> This allows active clock tuning with clock synchronization done via the SOF signal from the USB host. <S> Disclaimer : This is the quick and dirty way. <S> One should make their own configuration and copy paste the file contents of the other header files as needed. <S> For the custom HID and others the MLA contains source code for writing your own USB driver. <S> It is common to have to write (or at least compile) <S> your own drivers natively. <A> I think CDC (communications device class) is the acronym you mean, rather than SIE. <S> USB-CDC is a standard way of emulating a serial port over USB. <S> See this stackoverflow question and this page from Microsoft for what is required in the way of windows drivers - essentially just an .ini file. <A> If you are serious about this, buy Jan Axelson's Complete USB. <S> If you just want usb for your project, use a FTDI chip. <S> Or, get one of the microchip USB demo kits. <S> Any particular reason for choosing the 16 series? <S> I would say the pic18/24/32 will have better support and help. <S> What windows sees is entirely based on your supporting code.
| As for the driver, you shouldn't need to any USB driver for standard devices like a USB mouse/keyboard.
|
Can't send a signal to a NOR chip I'm a beginner and have the following circuit: http://123d.circuits.io/circuits/201729-pulse The left LED turns on when you plugin the battery, I'm expecting when I press the switch for the right LED to turn on, and the left LED to turn off. The left LED should turn off as there will be input into pin 2 of the 74HC02 chip. Pin 1 is the output Pin 2 & 3 are inputs to the NOR gate. Any ideas where I'm going wrong? <Q> Always grounded - regardless of the state of the switch. <S> So no changes will happen when you push the button. <S> This is what I think you made: simulate this circuit – <S> Schematic created using CircuitLab <S> Can you figure out what changes you need by looking at this? <S> It should be pretty obvious... <S> Hint - make sure both inputs of the NOR are connected to a level, and that that level changes in a way that changes the output when the button is pressed. <S> You probably want to have no series resistor in the Vcc of the NOR - instead, put a series resistor in line with the LED. <S> And since the truth table of a NOR is A B C0 <S> 0 <S> 11 <S> 0 <S> 00 <S> 1 0 <S> 1 <S> 1 <S> 0 <S> you will want the unused input at ground - then the used input needs to change state when the switch is pressed, so tie it (the currently open one) to the node between the switch and the LED. <A> The recommended maximum supply voltage for the 74HC02 is 7 volts - it is Not Safe to run it from 9 volts. <S> Either use a 7805 or similar voltage regulator to reduce the supply voltage to 5 volts, or run the circuit from a 6 volt battery pack (four AA or AAA cells). <S> The 510 ohm resistor won't drop the supply enough as the chip's typical power supply current is only 40 microamps, so the 510 ohm resistor may only drop the voltage by about 2 mV when the output is low, and by considerably more when the output is high, driving the LED. <S> With the output high, there may be enough voltage dropped in the resistor that the chip won't operate correctly. <S> Also, as this is a CMOS part, all unused inputs must be connected to ground or to Vcc, otherwise they may float to a "maybe" state, and cause the chip to try to draw exessive current. <A> There's some serious problems with your circuit. <S> I'd say the biggest one right now is that one of your inputs is floating. <S> That's usually the cause of undefined behavior, though sometimes there's an internal pull up or pull down. <S> Don't count on it. <S> Judging by the truth table, all you need to do is tie B to ground if you want only the one button. <S> As the other answerer beat me to by a mere 9 seconds, your switch never pulls up. <S> It's always ground. <S> You want that input on the other side of the resistor. <S> It will be ground until the button is pressed and that node is pulled up to 1. <S> That's also one fundamental reason why you're not seeing any changes. <S> There's no reason to put a resistor on a power pin, especially a 500 ohm one. <S> Delete it.
| You are powering the device through a 500 ohm resistor; you left one of the inputs of the NOR gate (pin 3) unwired while pin 2 is grounded.
|
Can this 12VDC Relay be used for Switching 24VDC? Can the Songle srd-12vdc-sl-c relay be used with 12VDC on its output? On top of the relay, it writes 10A 28VDC . <Q> Contact current has a direct affect on reliability, whereas voltage only affects open contact arc duration which is determined by load inductance. <S> Since Relays are rated for typical usage, it would be impossible to define every application so they stick to standard automotive and truck voltage limits. <S> Excess voltage and inductance such as from a motor could result in continuous contact arc and burnout quickly. <S> So in short any contact voltage less than rating is acceptable. <S> However any current less than rating is not ok, but only specified by the few best manufacturers. <S> It is a well known fact by thus author, that for low currents in the mA range, relay contacts rated >2A would be unreliable unless they have a capacitive load to arc through oxide which will quickly build up on any contacts rated >2A but used for extreme light current. <S> Relays <2A often used in telecom often use gold plated to prevent oxidation. <S> This may not apply to you, but is worth remembering to use 10% of rated current with capacitive surge current or resistive current MINIMUM. <S> But the more current above this threshold will reduce contact switching life according to a log curve as shown in spec. <S> The other important fact on DC current ratings for relay contacts is that Inductive loads must be derated for current. <S> For this part, I found the spec to be 50% or 5A instead of 10A DC. <S> The reason for MTBF vs contact current has to do with erosion of contact material in this case Silver- Cadmium-Oxide due to I^2*R t N for arc duration, t , contact resistance, R (which accelerates with age) and switch cycles, N. <S> So in short don't worry about less voltage, but be aware of the switched current relative to specs and added experience. <A> I did not look this particular part up but based on my experience 12V should be the relay winding voltage (used to activate the switch). <S> The other specs are the switching specs(how <S> much voltage/current it can switch). <S> This relay should be able to switch up to 10A at up to 250VAC or 10A at 30VDC. <A> The ratings for a relay on the output side are typically the maximums the relay can handle at continuous use. <S> So the load side should be good up to 10A or 28/30VDC. <A> I am no pro engineer, but I have designed my solar system , several switch boxes, and bus boards. <S> I think the big question revolves around the type of switch that you are using. <S> You have a tag stating solid state, and if that is true I would first find the schematic to the relay and that will tell all. <S> If solid state the specs on top are specific and should be followed, as it looks the relay is powered by 12-volt and switch 10-amps at three different voltages that will be checked by the circuit and may or may not recognize lower voltage and could possibly create a brown out situation and over heat the relay because the voltage or pressure is inadequate causing the amperage to rise. <S> One thin to always remember is a*v= <S> w it is absolute, and if volts drop amp rise and vice versa. <S> the best thing to do here is to Google the relay and find manufacturers specifications, recommendations, and uses. <S> I just did a quick Google of the part number and it jumped right out at me, so the absolute answer is easy just read it. <S> Here is the Google url. <S> https://www.google.com/search?q=srd-12vdc-sl-c+datasheet&rlz=1C1OPRB_enUS517US517&oq=sdr-12vdc-&aqs=chrome.2.69i57j0l5.16631j0j7&sourceid=chrome&es_sm=93&ie=UTF-8
| If it is a simple mechanical relay then less voltage on through the contact points is not a big problem providing the amps are not exceeded. If you put a 12v load on the switched section, you should be fine.
|
Does a 230 V (240 V) single-phase motor technically draw twice as much current as the label states? I've always thought P = U * I (units watt, volt and ampere, respectively), but I ran across this discussion on a forum: If you look in your panel there are 2 “hot wires coming in from the pole”. 1 is the 120v A phase and 1 is the 120v B phase. you need a hot leg from each one to make 240V. if you have a machine drawing 20 amps on 120V it is drawing it from 1 phase. If you have the same machine drawing 10 amps on 240V it is drawing 10 from the A phase and 10 from the B phase. The easiest motor for me to read the name plate on is a 1.5 HP 3450 rpm Baldor motor. It was on the shelf. It states at 115V it draws 13.2 amps. next it states 230V it draws 6.6 amps. “amps x volts = watts” 13.2×115 = 1518 6.6 x 230 = 1518 no matter what you do it will draw the same amperage total. To me this explanation contradicts itself since it says that the motor draws both the same current and the same power. Is the motor actually drawing 6.6 A from each hot wire (for a total of 13.2 A), or is it drawing 3.3 A from each hot wire? If it's 6.6 A from each hot wire, it seems the classic "current x voltage = power" equation is misleading for 240 V "single-phase" circuits. Update: to clarify, this question applies to 120 V and 240 V current in the US. <Q> A 240 volt motor will only be connected to the two live wires, not to neutral, so your example draws 6.6 amps at 240 volts. <S> If it is connected to operate at 120 volts, it will be connected between one live wire and neutral, and will draw 13.2 amps at 120 volts. <S> A more correct description would be that it draws 6.6 amps from one live wire, and returns that 6.6 amps through the other live wire. <S> Using the same terminology, in the 120 volt case, the motor will draw 13.2 amps from the live wire, and return that 13.2 amps through the neutral wire. <A> It is written in a confusing way, but well. <S> The one phase motor has only one phase from which something is drawn , the other one is bound to ground. <S> You use a one phase motor because you don't have three phases. <S> That means using phase-phase voltage on it wouldn't make sense, you should be using a three phase motor instead. <S> The 120V vs. 240V is not related to phase to phase voltage(or live wire to live wire) as that would be \$120\sqrt(3)\approx 207V\$. <S> It is a refference to the outlet voltage for different countries. <S> You have: 120V 60Hz (for example US) <S> 240V 60Hz (for example Brazil) <S> 240V 50Hz (for example Europe) <S> The other ratings you read were for people in other regions of the world that want to use the same motor. <S> You need a bit more of data in the question, and clarify it so that I really know what you are talking about. <S> I'm now doing my best guess at what you really wanted to ask. <A> You can think of it this way: the motor is using the same amount of power regardless of the voltage. <S> From your formula, you know that since the voltage doubled, the amount of current flowing through the wires and motor must have halved, since the power is the same. <S> This is also the reason devices that are switchable for 120/240 volts use a fuse with half the current rating of the 120 volt setting when set for 240 volts. <A> I would suspect that you will be metered on both phases and the current you are charged for is the sum of currents in the hot wires. <S> So although the physics says it's the same 6.6A current coming in one phase and going out the other on one circuit across 240V, the accountants charge for it twice. <A> Is the motor actually drawing 6.6A from each hot wire (for a total of 13.2A), or is it drawing 3.3A from each hot wire? <S> A phrase like "drawing from each hot wire" is unclear. <S> For the 120V circuit, there is one hot wire and one neutral wire and the motor is between the two. <S> The current is the same in both the hot and neutral. <S> For the 240V circuit, there are two (out of phase) hot wires and the motor is between the two. <S> Just as you do not add the currents in the hot and neutral for the 120V case, you do not add the currents in the two hots for the 240V case. <S> Perhaps a drawing will help. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> In the left hand circuit, the load "draws" current from 1 hot wire and the current "returns" through the neutral. <S> In the right hand circuit, the load "draws" current from 1 hot wire and the current "returns" through the other hot wire. <S> Assuming the power is the same for both loads above, the current in the 240V circuit is half that of the 120V circuit.
| The current is the same in both hot wires. I think it is misleading to say that, in the 240 volt case, the motor draws 6.6 amps from each live wire.
|
9V from two AAA batteries plus charge pump: batteries in series or parallel? I am driving an OLED display via two AAA batteries plus a charge pump to step up the voltage to 9V. I was wondering if there is likely to be any significant difference in efficiency between (a) using the two batteries in parallel and using a charge pump to step up from 1.5V to 9V, or (b) connecting the batteries in series and stepping up from 3V to 9V. <Q> With a Dickson, that rule is the same as you've got diode (or mosfet) <S> voltage drops to overcome. <S> And you'll need more stages to get to higher voltage with a 1.5V input. <S> With 3V you have less stages and therefore less voltage drops wasting your energy. <A> You can calculate the efficiency by using \$n = 1 - \dfrac{p_{in}}{p_{out}}\$ and get the power \$p_{in}\$ by measuring the current from the batteries times the batteries voltage and the power <S> \$p_{out}\$ by multiplying the current to the LED times the voltage across the LED(s) <S> (at the output of the converter). <S> This assumes <S> the converter has a filter capacitor. <S> Use a scope and a shunt resistor of about 0.1 Ohms if not. <S> Although trickier, you can estimate the current consumption by averaging the pulses height times the duty cycle. <S> $$I_{avg} = <S> I_{peak} <S> \times \frac{t_{on}}{t_{off}}$$ <S> From my experience doing a lot of this sort of thing, using a higher voltage into a boost converter will improve efficiency. <A> As a generic answer, you need to pick some values, and do the math. <S> So we have 3V or 1.5V, to 9V. <S> Let's assume 100mA load, though your OLED probably uses less. <S> And let's assume 85% efficiency, a good average switching regulator efficiency. <S> So first we need to know the output power usage. <S> $ <S> $P = <S> V <S> \times I$$ <S> $$9V <S> \times 0.1A = 0.9W$$ <S> Next, we can calculate the input power usage. <S> $$N \times <S> 0.85 = 0.9W$$ <S> $$N = <S> \frac{0.9W}{0.85}$$ <S> $$N = <S> ~1.06W$$ <S> So at 85% efficiency, you need 1.06W at the input. <S> So we can figure out the current pull at the input. <S> Reverse the power formula. <S> $ <S> $I = <S> \frac{P}{V}$$ $$\frac{1.06W}{3V} = 0.350A <S> $$ <S> while $$\frac{1.06W}{1.5V <S> } = 0.7A$$ <S> With the typical AAA having 1500mAh, you have 3V 1500mAh, or 1.5V 3000mAh. <S> You would have 4 hours with either. <S> BUT your charge pump might not be 85% efficient with both setups. <S> And battery drain may not be the same in parallel. <S> You need to figure out the efficiency by measuring the current draw at the battery in both setups, as well as the current draw of the regulator + load. <S> Any multimeter with a current/ammeter setting will help. <S> This is not including varying loads, as they are more difficult to figure out.
| As a rule of thumb, the closer your input and output voltages of smps's the more efficient it will be.
|
Reducing 12V to 5V DISCLAIMER: I know nothing of electrical engineering I just seen this as the best fit category for my question. I have a solar panel that is being run to a controller switch (for lack of a better name) the controller switch then has a hookup for a battery and a hookup for output. I have the battery connected and its supplying 12V - 12.8V to the output. I want to hook up a female USB end to the the output. But I know that a USB port should only provide around 5V. Before I had the controller and battery I had the solar panel hooked directly up to the guts of an old cigarette lighter phone charger. It worked great. But when I tried to hook up that same little circuit board to the output of the controller it just arced and so I removed it. Have no idea what I'm doing wrong here. I hooked a voltage meter to the output and sure enough, 12V. Hooked a LED light up to it and it lit up real bright. But whenever I hook up that little circuit it arcs and if I hook up the circuit board from the inside of a USB wall charger... Nothing, no power coming from the USB port (measured with voltage meter). <Q> The simplest circuit will be using a voltage regulator like LM7805 . <S> These regulators are very common. <S> However, it can only supply a maximum current of 1A and you will also need a heatsink. <S> It is simple to build: connect the 12V wire at the left most terminal of the IC, while looking at the inscription and with the pins down. <S> Connect the 5V output for USB port at the right most pin. <S> Connect the ground of your 12V supply and of your USB to the middle pin or to the heatsink. <S> You may also add two capacitors like: From Fairchild datasheet . <A> Voltage regulators come in 2 types: <S> Linear <S> Switching <S> Linear: <S> A linear voltage regulator converts your voltage by dissipating the remaining as heat. <S> What this means is that in your application the heat dissipated is (InputVoltage - OutputVoltage <S> )* Current Supplied = (12-5) <S> * 1 = 7W!!!! <S> Now that is a large amount of heat that you will need to dissipate, so you will definitely need a heatsink and good airflow in order not to burn your regulator. <S> Switching: Now <S> a switching regulator works by switching states, this is way more efficient and dissipates way less heat. <S> A switching regulator is the best option when your current draw is high. <S> Other References: <S> http://www.ti.com/lit/an/snva558/snva558.pdf <S> https://www.sparkfun.com/products/9370 <S> http://www.aliexpress.com/item/10pcs-XL6009-DC-DC-Non-isolated-step-up-converter-replace-LM2577-dc-dc-module/1508297668.html <S> ( i have personally used this and found it to be reasonably good) <A> While a linear regulator like the LM7805 may suffice a couple things need to be taken into account: <S> Power dissipation could be high, depending on your current needs. <S> At 1A, you will be dissipating a bit more than 7W which, unless you install a heatskin, will fry your regulator in no time. <S> Even if nothing is connected to the 5V pin of the regulator there will be a leakage current that will eventually deplete your battery, given the time. <S> If you're serious about power consumption you may be better off using DC-DC converters that you can find at very low prices. <S> Their efficiency is quite good. <S> Make sure you wire the USB port correctly. <S> Also, even if your charger provides a clean 5V output, not necessarily all devices will be able to charge from it. <S> Some need a certain voltage on their D- and D+ pins.
| What I would recommend for your application is buying a readily available switching regulator PCB that has all the components already soldered, all you need to do is connect the input supply, test the output till you get 5V and power your usb device. What you require for this application is a voltage regulator, to be more precise a step down voltage regulator.
|
What is a Schmitt Trigger and its application exactly? i would like to ask about what is a Schmitt Trigger and about its application. I searched a lot but still didn't understand it. Please explain step by step and hope you help me in its applications in real circuits. <Q> Most devices have a set point which is the same for a rising signal as it is for a failing signal. <S> For signals that have fast rise times, this is not a problem, but for signals that have very slow rise times, or are noisy, the can cause the output of the device to oscillate back and forth from off to on and back due to the signal hovering right at the set point. <S> Obviously the threshold for the former is higher. <S> In this diagram, two bands are shown. <S> The top one represents the high set point, and the low band represents the low set point. <S> They are shown as bands since there will be some tolerance in the specification. <S> The difference between the bottom of the high band and top top of the low band is the hysteresis of the device. <S> As mentioned earlier, Schmidt triggers can be used for either slowly changing signals, or noisy ones. <S> Here are some examples of places where Schmitt triggeers can be used: <S> There are many ways to buy or build Schmidt triggers. <S> There are many logic ICs that include Schmitt triggers on their inputs, such as the 74HCT132 , but it has fixed thresholds.. <S> You can also build one using discreet transistors, but the easiest is just to use an op-amp since the only additional components needed to add the hysteresis are resistors: Unlike a lot of Schmitt trigger schematics found on the web, this one uses an op-amp with a single supply. <S> The voltage thresholds \$V_{\text{high}}\$ and \$V_{\text{low}}\$ are set using a combination of the voltage divider resistors \$R_1/R_2\$ and the feedback resistor \$R_{\text{FB}}\$: $$R_{1\text{FB}} = <S> \frac{(R_1 \times R_{\text{FB}})}{(R1 + R_{\text{FB}})}$$ <S> $$ <S> V_{\text{high}} = \frac{(V <S> \times R_2)}{(R_2 + <S> R_{1\text{FB}})}$$ <S> $$R_{2\text{FB}} = <S> \frac{(R_2 <S> \times R_{\text{FB}})}{(R_2 + R_{\text{FB}})}$$ $$V_{\text{low}} = <S> \frac{(V <S> \times R_{2\text{FB}})}{(R_1 + <S> R_{2\text{FB}})}$$ There is a nice Schmitt Trigger Calculator that makes it easy to figure out the resistor values you need. <A> The Schmitt Trigger is a comparator with hysteresis built in. <S> A normal comparator will have it's output depending upon the input compared to a set point. <S> It outputs a 1 if the input is higher than the set point and it outputs a 0 if the input is lower than the set point. <S> This is fine for many applications, but if the input transistions slowly and has a bit of noise, then there will be a small time when the input will be "vibrating" around the set-point which will cause the output of the comparator to switch back and fourth between high and low very frequently. <S> A Schmitt Trigger attempts to resolve this nebulous state where the input is hovering around the set point by adding in hysteresis. <S> This means that there's now two set points, one from the low side and one from the high side. <S> Lets say for example that the low-side set-point is 2.0 V and the high side trigger is 1.5 V. <S> If the input starts to rise, as soon as the input (with noise) hits 2.0 V, it will switch the output to a 1. <S> Then it will remain at 1 until the input drops back down to 1.5 V. <S> This area between 1.5 V and 2.0 V prevents noise enabled switching and creates a more expected output from the Schmitt Trigger. <S> The hysteresis of a Schmitt Trigger can be used for a few things with a couple of the applications being the creation of a timer (simple clock signal creation), or the debouncing of a switch. <S> The timer can be made by adding an RC to the output and feeding that signal back to the input. <S> Simple debouncing can be done by sending the input of the switch to the input of the Schmitt Trigger and taking the output. <A> A Schmitt trigger circuit is similar to a non-inverting amplifier except the important difference <S> is that the input is applied to the op-amp inverting terminal, instead of the non-inverting input terminal, and that feedback from the output is connected to the non-inverting input. <S> A Schmitt trigger is a comparator application which switches output from one level to another level. <S> The key is positive feedback to provide the hysteresis.
| So a Schmitt trigger is a device (or the input portion of a device) that has separate thresholds for a rising signal and a failing signal.
|
When should I use a low ESR capacitor I am in the middle of a new design and I need to choose the right capacitor. What is the impact of equivalent series resistance (ESR) in a capacitor? When should I use a low ESR capacitor? <Q> If the ESR of the capacitor is high relative to the reactance of the capacitor (\$X_C= \frac{1}{2\pi fC}\$) at frequencies of interest, then you might want a low-er ESR capacitor. <S> The requirement for "low-ESR" capacitors normally arises in output filters of switching power supplies, where the frequency is relatively high (kHz to MHz). <S> It's less important in mains filters (including the input filter of a SMPS) where a large capacity electrolytic tends to have a proportionally small ESR so that 100Hz or 120Hz ripple is not greatly affected by the ESR. <S> ESR also causes \$I^2R\$ heating, which can dramatically shorten the life of electrolytic capacitors (half life for every 10°C rise is a rule of thumb). <S> They're also useful in building ultra-low noise analog power supplies, because the low ESR part can reduce the noise with fewer filter stages when you use a high-quality low-ESR polymer electrolytic rather than alternatives. <A> ESR is just what it says, resistance in series with your capacitor. <S> The RMS ripple current will cause heating (I^2R) losses in the capacitor, and additional ripple voltage. <S> It will also affect the frequency response of your capacitor. <S> The ESR zero formed by the RC circuit can actually help stability in a power supply control loop, at the expense of higher output ripple. <S> So if your application has high ripple current and you don't need the ESR zero for stability then a low ESR cap will likely be the way to go. <S> If you are looking for energy storage without large di/dt then a high capacity electrolytic is more appropriate. <A> You should use a low ESR capacitor when the expected I^2 R heat loss (ripple current, squared, times the ESR), is too much heat for the component. <S> Power-supply capacitors smoothripple on DC power supplied from AC sources. <S> When the AC source islow frequency (50 Hz, 60 Hz, 120 Hz...) <S> the capacitors are physicallylarge, and could tolerate high ESR (like, 1 ohm for a 1A supply with a 1000 uF filter capacitor). <S> That's becausea <S> one-amp ripple current only created one watt of heat, and a large (over a square inch of surface area) 1000uFcapacitor can shed that heat. <S> When switchmode supplies went up to 50 kHz, and a suitable ideal-capacitor valuewas (again for 1A output) about 2.2 uF, 1 ohm ESR means that same 1W would be dumped intoa capacitor the size of a pea. <S> It'd fail, becauseit's too small to dissipate one watt of heat. <S> That isn't the full story <S> (there might be local heating 'hot spots' even if theaverage dissipation seems supportable), so there are separate ESR and ripple current specifications. <S> Capacitor ESR, outside of DC power supply filtering, is also of concern because itis an unwanted stray impedance. <S> It may be discussed as 'dissipation factor', or 'loss tangent', or Q, and have significant frequency dependence. <A> Another situation where you would want a low ESR capacitor is when there's a lot of current draw in small bursts (like a sub-woofer amplifier). <S> In such case a higher ESR will limit the maximum current that can be drawn hence limiting power output and performance of the circuit.
| Low ESR is important if there's a lot of ripple current in your capacitor.
|
2N2222A Mismatch between emitter and collector I am trying to figure out what is going on here. I have a simple circuit to send current to a brushless fan running at 12V on the high side, using a NPN transistor 2N2222A: This is the picture of the datasheet for the pins: If I set up the circuit for a quick test, it seems that the datasheet (or the transistor) has the pins swapped. When I apply a voltage between the pin 1 to 3, as soon as the voltage rises over about 8V, the current starts to flow, even when the base has no voltage (pulled down or floating), and the transistors gets pretty hot. It looks like a "diode". If I rotate the transistor 180°, everything works as I would expect, current flows, and the fan power is proportional to the base voltage. This is the pic of the transistor, as I understand that it should work, but it doesn't (it is always 'on' with 12V between the collector and the emitter with the base floating). What do you think? Am I missing something here? <Q> There really isn't a single '2N2222' transistor, since each manufacturer just seems to use XYZ_2N2222 as a part number for a generic 'NPN silicon amplifier transistor'. <S> Hence the 2N2222 pin-out is sadly not standardized. <S> However, some manufacturers have the pins going C-B-E for the TO-92 package. <S> For example, the ON Semi P2N2222A variant: datasheet <A> You can determine the pinout and NPN/PNP of an unknown BJT with the diode function of a digital multimeter in seconds. <S> You have to try each of the three pins to the two others, with both polarities (6 pairs of tests). <S> The base will show a diode connection to both other pins, in only one polarity. <S> No other pin will show that. <S> If the red test lead is on the base, then it is NPN, if the black is on the base, then it is PNP. <S> Now you have identified the base pin and whether it is PNP or NPN. <S> To distinguish collector from emitter, you look at the voltage shown in the diode function with the one successful test that found the base. <S> Try not to touch the transistor while testing it because temperature will change the voltage readings. <S> The slightly lower of the two voltages will correspond to the collector-base junction , and the other will be the emitter-base junction. <S> This is true of almost all modern transistors (a few are made more symmetrical). <S> To confirm, you can double check with the hFE function if your meter has that. <S> The hFE is usually much higher when properly connected than when collector and emitter are swapped. <A> If it is to replace a shorted transistor, we will never know if both are the same ebc configuration between your new 2N2222 and the old 2N2222. <S> The situation worsen <S> when all these china fake transistors crowded the whole market, there are no standardization at all. <S> You can have up to 3 types of configurations.
| Most 2N2222s have the orientation which your diagram shows, where if the flat side is facing you, the pins are E-B-C respectively.
|
Converting Inverter Output from Square Wave to Sin Wave I bought a UPS, it has output of 220v AC, the problem is the output is square-wave, which causes distortion on TV/LCD, is there circuit that can take this Square-Wave as input, and output Sin-Wave? <Q> There is no practical solution in your case. <S> Some big changes must be done in the inverter circuit to make it give sinusoidal output. <S> And it is not an easy and cheap work for an end user to do. <S> There must have been a warning message on the box of the product, giving information about flaws of the product, which is understandable by any non-technical customer. <S> If there wasn't, you can sue them on for it. <A> You can use a 2nd order low pass filter made from an inductor (in series with the AC) and a capacitor to neutral. <S> You will also need a resistor: - simulate this circuit – Schematic created using CircuitLab 1 Henry and 10uF form a 2nd order low pass filter that will attenuate the higher order frequencies from the sq wave and make the output signal more sinusoidal in nature. <S> It might work fine or it still might give your TV problems if it is particularly sensitive to harmonics. <S> The resistor is needed to keep the Q of the circuit low and prevent high ringing voltages. <S> Q = <S> \$\dfrac{1}{R}\sqrt{\dfrac{L}{C}}\$ = <S> 3.16 using the values above. <S> Q needs to be about unity <S> so I'd advise to make C bigger and L proportionally smaller but be aware that the value of resistance is in series with the TV and whatever current the TV takes, it flows through the resistor. <S> For instance, 110 watts needs 0.5 amps from 220 V and this means the I^2R losses in the resistor are 25 watts - choose big wirewound resistors. <A>
| An Ott filter will do a good job of changing your square wave output to a sine wave without causing an inductive load on your inverter which other low pass filters do and can cause damage to your inverter.
|
Building a laser driver circuit? I have a small laser diode I ripped out of a CD/DVD read write drive. It has 3 pins on it and my first question is what function does the third pin have? Is it a second ground? How do I go about determining the function of each pin safely without damaging it? I'm attaching a photo of a driver circuit I found online. Would this be a suitable driver circuit for this laser diode? I'm not for sure on the specs of the diode but I'm guessing it's more than 100mW. Furthermore, in a driver circuit for a laser I need to regulate not only voltage but current as well. Therefore, I'm confused on how I'm supposed to design a circuit that satisfies both of these conditions. For some reason as beginner electronic engineering student I can only make sense of having one of these regulators in a circuit controlling voltage OR current. To me, changing one would effect the other. So how can I control both since controlling one will control the other. <Q> It has 3 pins on it and my first question is what function does the third pin have? <S> Many laser diodes are packaged with a photodiode that receives the light from the laser's back facet. <S> This allows setting up a control loop to drive the laser in a constant output power mode rather than just setting a constant current. <S> Usually the laser and photodiode are connected in either "common cathode" or "common anode" configuration, so that only 3 pins are needed for the two devices. <S> How do I go about determining the function of each pin safely without damaging it? <S> The best way is to read the datasheet for the part. <S> Obviously when you're salvaging parts you might not be able to do that. <S> You can probably tell one from the other because the laser ought to emit at least a small amount of light when you find its pins. <S> Preferably use a diode tester that is voltage limited to maybe 5 V and current limitted to a couple of mA. in a driver circuit for a laser I need to regulate not only voltage but current as well. <S> For a laser diode, you generally want to drive it with a constant current source. <S> However you should design the source to have a maximum output voltage consistent with the laser's maximum ratings to avoid damaging the laser during power up, power down, or in case of a current-control failure. <S> Even better, if your laser does have a monitor photodiode, is to control the supply current to achieve the desired output power level. <S> Again this circuit should have appropriate current and voltage limits to avoid damage. <S> You might also want to design your supply circuit to have a "soft start" feature to eliminate high inrush currents when turning the laser on and off. <S> (This is probably the reason for the 10 mF capacitor in the schematic you posted) Final note: <S> 100 mW is more than enough to cause permanent eye damage if you mishandle the laser. <A> Your intuition is correct. <S> You can regulate voltage or current, but not both. <S> But you can have a current regulator with a voltage limit , or conversely, a voltage regulator with a current limit. <S> Many benchtop power supplies can operate in either mode, and switch smoothly between them. <A> The circuit is correct, I have made it with 6ohm resistor to Adj pin of LM317 <S> and it's working. <S> Can burn some match stick heads.
| In that case, you have to basically diode-check each combination of pins to find the laser anode and cathod and the photodiode anode and cathode. Be sure you understand the risks and take appropriate safety precautions before powering up this device.
|
Why is it that a TEM mode propagates in a - Two separate conductor wave guide? Please someone explain to me in Simple English or Basic equations as to why does a Transverse Electric and Magnetic Modes(TEM) propagate on only two surface Wave guide like a coaxial or a parallel plate wave guide? <Q> The paper you linked to (despite spelling and language errors) is actually pretty good. <S> From page 4 ... " ... all transverse components of E and H can be determined from only the axial components Ez and Hz." <S> For TEM mode support you need to have BOTH Ez=Hz=0 simultaneously. <S> The paper deals with the mathematic reason nicely, what you are looking for is a physical sense of what is being said in the mathematics. <S> What is comes down to is that the H field is supported by induced currents in the walls and the E field is supported by induced voltages in the walls and in order for the wave to propagate these must reinforce each other, but in a single conductor system they cancel each other. <S> The solution? <S> The conductors will be capacitively and inductively linked, a single conductor can't be. <A> That's because, the only way to propagate a TEM mode along a specific path is by flowing a physical current also along that specific path. <S> To produce a current, you also need a physical voltage. <S> Therefore you need 2 conductors. <S> Moreover, this is not the case with TE and TM modes, as they are able to manifest and be guided along the walls of a single conductor (due to boundary conditions). <S> This is due to the fact that TE and TM modes have more freedom, as they bow only to 1 defining equation(ie. <S> Ex = 0), where TEM must satisfy 2 equations (ie Ex = 0 <S> and Hx = 0). <S> Infact, a single conductor waveguide has NO physical current (displacement current is there) or voltage.. <S> only E and H waves. <S> TEM can't be sustained in such environments. <A> A waveguide is a single conductor with a dielectric inside it (Air is also a dielectric). <S> TEM mode is characterised by electric fields and magnetic fields perpendicular to one another and perpendicular to the direction of propagation. <S> Inorder to have such a configuration, there has to be a source of electric field at the centre from where E fields originate and terminate on the outer conductor and there has to be a current source which can generate magnetic fields. <S> For TEM mode the current flow should be along the axis of the waveguide, which creates rotating magnetic fields which are normal to the electric fields generated due to the (moving) charges in the current carrying conductor. <S> Since such a current source is absent and waveguide being a single conductor configuration, TEM mode cannot exist inside a waveguide. <S> Also it is evident from the above explanation that for TEM mode to exist, presence of atleast two conductors is compulsory. <A> Please take a look at the following link. <S> As it says in the page consider we want to have TEM, which means that electric fields and magnetic fields are both pependicular to the direction of propagation, in waveguides. <S> Then we know that magnetic fields are close loops and from Amper law <S> we know that if we have a magnetic field, there should be a current in between which produces it. <S> However, as there is no current in the middle of waveguide, TEM cannot be supported in such a one conductor structure. <S> https://www.ntnu.no/wiki/download/attachments/81790668/Waveguide_propagation_06.pdf?version=1&modificationDate=1443510894000&api=v2
| If you have separate conductors then you can shape them to have the Voltage and Current in the conductors reinforce each other.
|
Is Isopropyl Alcohol 70% a good choice for cleaning electrical wires I need some wires inside my phone cleaned. And the only alcohol I can find is 70%. Is it safe to clean electrical wires with it? Or would that be too much water? <Q> It's usually okay to clean with water, so provided the water was pure and was allowed to dry before power was applied it might be okay to use water+IPA and a soft brush. <S> Another concern is what exactly is in the remaining 30%. <S> Most of the stuff available from local pharmacies here leaves a nasty white residue, and I would not suggest using it. <A> 70% IPA isn't good for anything. <S> If you should ever discover the preceding statement to be false, you can make 70% aqueous IPA easily from pure IPA. <A> I often use n-propyl bromide (marketed as Ensolv) for both flux removal and as a general cleaning solvent. <S> It's flux removal ability is nothing short of magical, but it will dissolve some plastics, so be careful. <S> The good thing about it is that it leaves zero residue of any kind, which 70% isopropyl might. <S> I find it also works on cleaning wires and PCBs better than isopropyl.
| If it is drug-store (pharmacy) "rubbing alcohol" it may contain other additives that can leave a residue which could affect the operation of electronics. It might be okay, however usually we use 99% IPA, which has to be ordered from chemical suppliers (and is considered hazardous since it's quite flammable). There is no need to be concerned whether or not 70% IPA is good for electronics due to its water content, because there is no need to ever buy or use anything other than "99%" IPA.
|
How can I minimize the variance in voltage drop across transistors - or eliminate transistors from this design? I have a fairly simple circuit that I'm using with an arduino to measure the impedance on a very low-resistance circuit. The user plugs in a device at A and B and the arduino can compute the resistance across the user's device by measuring the voltage at A. No resistance on the user device means I read 0V, infinite resistance means I see about 1 volt. The most common user device will register about 1 Ohm. (For the sake of anyone familiar with arduino, I use the internal voltage reference so that 1V reads near the max for analogRead.) +5V | z z 220 Ohm Resistor (.1% tolerance) z | A----------------------------------------\ | | z | z 47 Ohm Resistor (.1% tolerance) | z | | | | |GND---------------------------------------B The trouble is that the circuit has to measure multiple user devices at the same time. I can't just replicate this chunk of circuit 3 times because changes on any one of the user devices will affect the values read on the other arduino input pins. My solution to this was to put a transistor between 5V and the first resistor and compensate for the voltage drop across the transistor by choosing a smaller resistor. This makes the circuit look like this: +5V | (Worst ASCII art transistor ever) \ \| 1K Ohm |-----NNN---- (To Arduino Pin to select this channel.) /| / v | | z z 150 Ohm Resistor (.1% tolerance) z | A----------------------------------------\ | | z | z 47 Ohm Resistor (.1% tolerance) | z | | | | |GND---------------------------------------B This circuit gets replicated once for each user input. This works, but my input values are unpredictable because the voltage drops across the transistors isn't consistent. (A measurement of 27 on one channel might equal a 2 Ohm user device, while that same device on a different channel might read 47. A 10% jitter I could tolerate. Greater than 60% renders the project unusable.) I don't think that I can get transistors that will be in the neighborhood of .1% tolerance without paying a fortune (assuming I can get them at all.) Because the math is being done on the arduino, I can't easily take 3 measurements (using the transistor-free design) and solve the simultaneous system of equations fast enough. (I'm looking at 500 to 1000 measurements of all three channels every second.) Is there any way to salvage the project? <Q> No, I don't think you are looking at this correctly at all. <S> If your 5V is stable then there is nothing wrong with your method using fixed resistors and no transistors. <S> The problem is that each ADC input on your MCU has a different error voltage. <S> Check out the dc offset error potential in the data sheet. <S> Here is a typical example from maxim covering the offset error on ADCs and DACs: - Around 0V, the error could be +/-50mV. <S> In a perfect system, a 1 ohm resistor fed from 5V via a 150 ohm resistor produces a voltage of 33mV - you got a digital value of 27 and, assuming your ADC is 10-bit then 27 represents <S> 132 mV - how do you rationalize this? <S> Forgive me if it isn't a 10-bit ADC <S> but, if it were 12 bits then 27 represents 32.9mV (possibly coincidentally of course) <S> but 47 represents 57mV!!! <S> Assuming they are all 1 ohm resistors and accurately matched (or you used the same resistor on a different channel) <S> you have to conclude you are witnessing ADC offset error in action. <A> You don't show what kind of transistor (NPN Or PNP) you're using, but the implied 1.75V drop makes me think it's an NPN emitter follower. <S> You want a high-side saturated switch. <S> The 3mA or so base current will give you a saturation voltage of about 85mV that should be consistent within about 20%, so that's a variation of <S> about + <S> /-0.3 <S> % in current. <S> With a MOSFET you can easily get down to 0.1% by choosing a logic-level p-channel MOSFET with an Rds(on) of less than 200m\$\Omega\$ over temperature. <S> In both cases, low = 'ON' so you'll need to reverse the logic. <A> Use a P-channel FET with an RDSon that is very small compared to your resistor values. <S> If this isn't for production you could even use a device with a few mOhms of on resistance. <A> replace point 'v' with a resistor and then a zener to ground that makes a new voltage reference <S> (lower than 5v) - you'll lose just under 2v in the switching transistor so chooses a resistor that leaves a voltage just a bit above 3V (so the zener kicks in) <S> maybe something in/ <S> around 30ohms or so <S> (play a bit, it depends on the transistor you choose)
| You could use a P-channel logic-level MOSFET or you could use a PNP transistor such as a 2N4403/MMBT4403 with maybe a 1K base resistor.
|
Zener diode as voltage regulator I've been trying to make a voltage regulator using a zener diode. I used the BZX79 3.3V Zener diode.I connected the diode as the following: Data Sheet . I assumed that as as most of them it operates at around 1mA to 10mA safely in the break down region. I connected my supply which was 5V. The resistance was chosen to be 220 ohms. This will make the max current of the zener around 7mA. Which should be safe. Now, when the zener was unloaded, I got a smooth 3.3V as an output. But, when I loaded the zener diode, the voltage across the diode dropped to 2.4V. Why did that happen? My assumption is the following: The load which should operate at 3.3V, is consuming way too much current that the zener current is below the min current. This caused the zener to get out of the break down region. Is my deduction correct? And what are available solutions, taking in note that I've used probably the smallest resistance possible that is 220 ohms. (At least of what I have). I also have a supply of 8.4V. Will it work if I connected it directly to the supply?At the end I will have more current available to the zener even after loading it. Edit: The data sheet states that the zener is fine for 6 Amps. That is a huge and weird number isn't it? <Q> I connected my supply which was 5v. <S> The resistance was chosen to be 220ohms. <S> This will make the max current of the zenor around 7mA. <S> This means that if your load requires more than 7 mA (I actually calculate 7.7 mA, <S> not 7 mA), the resistor will drop V out below 3.3 V. <S> In that case the zener will no longer be regulating. <S> But, when I loaded the zener diode, the voltage across the diode dropped to 2.4v. <S> Why did that happen? <S> Your load was taking more than 7.7 mA. Given that the output voltage dropped to 2.4, we can calculate that the load current was (5-2.4)/220 = 11.8 <S> mA. <S> You could make this work by reducing your series resistor. <S> If the load is fairly stiff, reducing the resistor to 110 ohms or so should bring you back into regulation. <S> This assumes the load current doesn't increase to more than 15 mA when the supply voltage is raised to 3.3 V. <A> No, at high load, you can ignore your zener. <S> You then just have a voltage divider between your 220 ohm resistor and your load. <S> A zener can be used successfully as a voltage reference, but if you want it to actually regulate voltage to power a load, you need a very light load. <S> Instead use a zener voltage to set the voltage level of a common drain amplifier to get ample current while still regulating voltage. <S> The 6 amps is only to be done for very short periods of time 100 microseconds to be exact. <S> And only if the ambient temperature is 25 degrees C. <S> That means for very short periods of time, you can pulse it with 6 amps of current without frying it. <S> This amount isn't useful for your application because you want a constant current on it which it doesn't really mention from what you've shown. <S> The circuit I speak of would look pretty much like this except the BJT <S> would be replaced with a mosfet (although a BJT would work too). <S> http://i.stack.imgur.com/qlBYs.png , here, if BJT used, the output will be 3v3 - vbe, ~ 0.6v. <S> Also instead of 10K use 330Ohm for 5mA zener holding current. <S> A better solution is a linear regulator. <S> They come cheap and are meant for exactly what you're after. <A> When designing a simple zener regulator circuit like this, there are two important criteria: (1) the maximum load current and (2) the minimum load current. <S> By KCL, the minimum diode current occurs in case (1) while the maximum diode current occurs in case (2). <S> The KCL equation is: $$I_D = I_R - I_L = \frac{V - V_Z}{R} - I_L$$ <S> Clearly, one must pick \$R\$ small enough such that the minimum diode current is at or above the zener holding current. <S> Also, one must pick \$R\$ large enough such that the maximum diode current does not cause excessive diode power dissipation. <S> Now , with the values picked, the upper bound on load current <S> is $$I_{L,UB} = <S> \frac{5V - 3.3V}{220 \Omega} = <S> 7.72mA$$ <S> This is an upper bound because (a) the output voltage <S> must be less than 3.3V for any larger load current and (b) the diode current is zero for this load current. <S> Since there must be some diode current for the diode to have 3.3V across, the actual maximum load current should be less than this. <S> Thus, if your load requires more current than this, you must either decrease \$R\$ or increase the source voltage . <A> You have to choose the resistor so that the load current plus some current for the zener diode will still leave 3.3 volts across the zener diode. <S> The BZX79 series of zeners are rated at 500 mW maximum power dissipation, so your 3.3 volt diode should safely handle up to 150 mA. <S> If your maximum load current is 20 mA, and you want to allow 10 mA minimum in the zener, the resistor should be about (5V - 3.3V)/(20mA + 10 mA <S> ) = 56 ohms. <S> Even if you disconnect the load, the zener will only have to carry 30 mA, which is well within its capabilities.
| If it's possible to have an open-circuit condition at the load, you need to choose a zener that can take all the current that would normally go to the load.
|
Hall effect sensor as toggle switch I know little enough about electronics to have to ask basic questions :P If I wanted to use a hall effect sensor as a toggle switch what is the minimal circuit that could be used? Essentially want to put an LED into a badge and use a magnet to turn it on when near but stay on when the magnet is removed. Then turn it off next time the magnet is near and leave it off. <Q> Minimal circuit could be one chip like an analogue asic but that would cost many, many thousands of dollars. <S> Stretching it a bit, minimal could mean low power. <S> Putting all this to one side, amplify the hall sensor's output, feed that into a suitably referenced analogue comparator. <S> That will produce a high signal when the magnet is close. <S> Feed that into the clock input of a D type flip flop configured as a divide by two and drive the LED, via a resistor from the output. <A> The simplest solution is to use a latching hall effect sensor. <S> You can use one of these US1881 <S> When you expose it to a magnetic field the output will flip based on the field direction then when you remove the magnetic it will continue to output the current state. <A> Here's a simple solution for a toggle switch using a 555 timer rather than a hall effect sensor <A> I would say that the "minimal circuit", would be this one. <S> simulate this circuit – <S> Schematic created using CircuitLab
| Minimal could of course mean cheap or small or both. Dependeing on the polarity of the Hall Effect Sensor, when you approach one of the poles of the magnet, the led will turn on.
|
IR proximity sensor for automatic spraying I am a beginner in field of circuits, so excuse me for my amateur questions. Let me explain my task: I have to build a low cost proximity sensor for a sense and spray device. I have read various posts on IR proximity sensors in this site. But I am still not clear in understanding the concepts. As I am a beginner, I get stuck at some silly amateur doubts. So, this is what I am planning to do: Build a IR sensor transmitter by pulsing the signal to 56 kHz using the oscillator from PIC MCU and then build the receiver part by using IR photodiode, band pass filter that allows only signals with 56khz carrier frequency, amplifier, op amp as a comparator and then the output is given to the microcontroller. My objective: When someone walks by the device, it should detect the movement and spray the liquid. after that it should go to standby mode for 15 min. It should not spray even if anyone passes at this time. After 15 min, it should come back to running mode. This is the link for a similar type of product in the market. My hurdles so far which I haven't crossed yet: To reduce the effect of ambient light and other IR sources, I decided to pulse the signal. But I couldn't get the right circuit in the receiver end to demodulate and amplify the signal. Because it has to be sensitive up to 50- 75 cms (even more would be better).I can use a tsop series photodiode which comes with bpf and amplifier. But I want to build the circuit with as simple of components as possible. When a black body is in front of sensor it absorbs all the IR radiation and does not reflect back any. I don't know how to solve this problem. I have to design a circuit and then write a program for a PIC18F4550 microcontroller. But I think I can find a solution for the program. But the circuit diagram seems to be a bit difficult for me. Please suggest a circuit diagram for the receiver part with the band pass filter that allows only 56khz signals, amplifier and opamp. Any kind of help and suggestions are welcome. Please don't hesitate to explain in a simple way. <Q> You will need to write an algorithm that senses rapidly changing values on the ADC pin, which will indicate some sort of motion. <S> If you want a narrow detection area, you can use a tube over the photodiode as a blinder. <S> Method 2 <S> : If you are trying yo detect proximity by using an IR source and measuring its reflection from an object within proximity, you already have the correct setup. <S> However, you will need to check the datasheet of your IR receiver module for its carrier frequency. <S> I think 30Khz to 40Khz is the most common. <S> You can use the hardware PWM pin on your PIC to constantly produce this carrier frequency on one of the IR LED pins. <S> Connect the other pin of the IR LED to an IO pin on your PIC. <S> Now you can send pulses or even serial data to that pin and it will automatically have the carrier frequency on it. <S> With IR proximity, however, you will always run into the trouble of not being able to detect non-reflective dark objects. <S> In which case, see method 3. <S> Method 3: <S> Use an ultrasonic transducer for proximity detection. <S> Typically two are used. <S> Use one for pinging a pulse (at the resonant frequency) and use the other for detection. <S> You will most likely need an op-amp or comparator circuit to amplify the output of the receiving transducer for greater ranges. <S> The benefit of this method is being able to calculate exact distance to your object based on the flight time of the "ping" and its return. <S> Flight time will be approximately 1/2 the speed of sound since the "ping" has to travel to the source (1) and back (2). <A> My advice to you is to go for an IR transmitter reciever circuit that is readily available in the market. <S> Since you are a starter first try it out in the simple way. <S> I would suggest Sharp-GP2Y0A21YK <S> IR sensor. <S> http://www.sharpsma.com/webfm_send/1208 <S> The above link provides a pdf stating its information. <S> I have used it successfully for my project of a blind guidence system using MCU 8051. <A> Use synchronous detection. <S> Turn <S> IR transmit LED on Digitize input <S> Add to sum <S> Turn <S> IR transmit LED off <S> Digitize input <S> Subtract from sum <S> Do this 1000 times and if the IR light is coming back the sum will climb.
| Depending on what type of human proximity you are trying to detect, here are a couple of options that might work well: Method 1: If you are trying to detect motion, the cheapest way is to use a photodiode or CDS cell connected with a pulldown resistor and read by one of your PIC's ADC pins.
|
3.3V Regulator giving 4.8V with 5V Input The ST L78L33ACZ 3.3V voltage regulator has 5.028V in the Vin pin but the Vout pin is giving 4.765V. The datasheet states that the dropout voltage is 1.7V. Shouldn't 5.028V Vin be sufficient to regulate the voltage to 3.3V? Or is there another problem? Photo + Update: May be hard to identify in the photo, but I did make the necessary cuts to the traces. Vin is now 3.927V after adding the load and using a new regulator. Have not used the capacitors yet, maybe thats why its at 3.9V? Or maybe the load (Xbee) is not pulling enough current? <Q> (so it's not a very good regulator for this application), but that does not explain why you're getting higher than 3.3V. <S> Assuming it's the correct part number, and is not damaged, the simplest explanation is that \$V_{OUT}\$ and \$V_{IN}\$ are swapped and you're reading the voltage drop of a diode with very low current through it. <S> Or the GND pin is not connected to GND. <S> Note that the pin order on the TO-92 is reversed compared to the familiar TO-220 78xx regulators. <A> A 3.3V regulator with a 1.7 dropout voltage should begin regulating at 5V. <S> The datasheet shows that given an input of 8.3V, expected output voltage should be between 3.036 and 3.564V, with a typical of 3.3V. <A> Although the datasheet doesn't explicitly state a minimum load current, it does give the output regulation rating for 1 mA to 40 or 100 mA, implying to me that there is a minimum load required for the part to regulate (and I recall the older 78xx regulators specifiying a minimum 5 mA load current for proper operation). <S> Put a 1 mA or more load on it and see if it works. <A> Input ripple. <S> Is your input supply actually a stable 5.028 volts? <S> Are you using a multimeter to check or a scope? <S> A multimeter is not good for measuring an unstable supply, it will average out what it sees. <S> Input capacitor. <S> Is it good? <S> Within the reg's specs? <S> Input and Output capaciters are not always optional. <S> It can depend on your input supply stability or distance. <S> It can depend on your loads operating frequency. <S> Output capacitor. <S> Consistance loads can deal withou a output cap, but variable loads might require multiple, on top of the regulators required cap if it has one. <S> Minimum regulating load. <S> Some can be 20mA to 100mA. <S> The bigger the regulator was designed to handle, the higher that minimum tends to be. <S> Output ripple. <S> An oscillascope is needed to see what's actually on the line. <S> Finally, there are tolerances in the typical specs given. <S> Just because it is typically 1.7V drop out, it could actually be 1.55V or 1.85V instead. <S> Frankly, giving the reg only 0.028V over the dropout voltage is asking for trouble. <S> Never push a regulator to the line on any spec. <S> A 5.5 or 6V supply, or a 1v dropout ldo would do better.
| The dropout voltage is only "typically" 1.7V, there is no guarantee of how bad it can be other than that implied by the 40mA out at 5.3 in It can depend on your output load. Mainly, bad/ovr/undersized caps or insufficient/excessive loads on the output can cause ripple, which will give you the wrong idea of the output voltage with a multimeter. Your measurement of 4.765V is outside these specs, so either the regulator is defective, it's wired incorrectly, the measurement was not correct, or something else is contributing to the value. Some regulators require higher minimum output loads for prper regultion. While a manufacturer tries to meet the typical, different batches might not meet all typical specs and different circuit desgins will change them.
|
How are neon sign transformers built? I'm aware that neon sign transformers (NSTs?) produce high voltage - up to 15kv. But I cannot picture what's inside of one. Wikipedia seems to indicate that they may be a form of resonant transformer but provides no diagram. Googling "resonant transformer" shows images that may be laminated core or toroidal based, close proximity series transformers, but it's hard to tell. What would a typical NST look like if it was cut open, and would it be possible (not that I want to try) for someone to home-build a HV transformer like a NST? Note: I'd never trust myself to build one, so that may answer the second part of the question - if I wanted a tesla coil, I'd buy a working NST <Q> Ordinary power transformers are designed to have good voltage regulation (the ratio of input to output voltage is fairly constant regardless of load)- <S> the flux is mostly linked between primary and secondary and the leakage inductance is minimized. <S> Neon sign transformers are made to have high leakage inductance- <S> ferromagnetic " shunts " are inserted (magnetically) in parallel with the secondary, which is similar electrically to having a large inductor in series with the output. <S> That makes the transformer more of an AC constant current source than a constant voltage source. <S> It allows the voltage across the neon tube to rise in order to start the ionization, and prevents excessive current from being drawn once the discharge starts. <S> Below is a photo of a disassembled Neon Sign Transformer from this website <S> (arrows and caption added). <S> It's possible to fool with the shunts in order to change this behavior (removing them increases the short-circuit current). <S> Modern neon sign "transformers" are typically switching power supplies designed to have similar characteristics to the older style of mains-frequency transformer. <S> The old style ones are practically indestructible, and the new ones are not going to last nearly as long. <A> Mostly a "neon sign" transformer is a transformer with a high step-up ratio. <S> The amount the voltage is stepped up from input to output is the turns ratio of turns of the secondary winding (the output) to the turns of the primary winding (the input). <S> The secondary also has to have a significant impedance, because neon signs really run on current. <S> It takes a high voltage to get the gas ionized, but after that you keep it going with a fixed current at a much lower voltage. <S> High impedance largely comes along with many turns. <S> Put another way, ideally you want to drive a neon sign with a current source, not a voltage source. <S> A transformer with significant output impedance approximates this well enough. <S> You mention resonance, so apparently some types have a capacitor in there to form a tank circuit at the line frequency. <S> A friend in college had a neon sign transformer that we used to power up the CRT from a old TV with, but I don't remember seeing a capacitor in there. <S> As I remember, there were just two wires coming out of one end of a sealed block with a transformer in it. <A> The first answer above is exactly right. <S> Neon transformers are a high leakage high voltage transformer. <S> Open circuit voltage (no current flowing) is typically 7500 to 15000 volts between the (2) secondary legs. <S> Short circuit current varies from 30 to 60 mA. <S> When operating a neon tube, the RMS lamp voltage is roughly half the open circuit voltage and the lamp current is roughly 80% of short circuit current. <S> The difficult part of making a neon transformer is the secondary windings. <S> Typical turns can range from 10-13,000 per secondary for 6000 and 7500 volt transformers, up to more than 20,000 on 12000 to 15000 volt transformers. <S> The prospect of trying to hand wind 39 AWG magnet wire on a kraft core tube with kraft paper inter-layer insulation is daunting to say the least. <S> Your better option is to find a transformer that has failed and cut a cross section of it using a band saw. <S> I have done it many times, and it is a cool conversation piece. <S> Good luck.
| Neon transformers do not use a capacitor, except for power factor correction, which is required in some municipalities, like NYC.
|
How to make two motors spin at the same speed? I am currently using two identical motors to drive a robot. The motors are both controlled using relays but one of the motors is spinning faster than the other. How can I slow down the faster motor to turn the same speed as the slow one? <Q> The motors are mechanically different, so you can not get them to move at the same speed at the same voltage. <S> This is a problem if you're driving them with relays since relays tolerate a very slow frequency, so they can not be PWM'ed. <S> However, if you're willing to change your design and switch to power mosfets you can basically split the problem in three: <S> For the first part, you will be needing a rotary encoder. <S> There are plenty of types and can be home made. <S> If you're using an Arduino, reading the information from the rotary encoder and determining which is faster and which is slower should not be a problem. <S> Lastly, you can adjust the speed of the motors using PWM. <A> You have not described your needs sufficiently. <S> Wouter's comment makes what seems to be the reasonable assumption that you're driving two wheels, one on each side, each with a different motor. <S> In that case, his comment is correct. <S> Depending on your physical setup, you may be better served by mechanically linking the two shafts, using gears and a timing belt. <S> If you must go electronic, you'll need a rather sophisticated setup. <S> Note that a simple velocity loop will not guarantee that the shafts, and hence the wheels, turn exactly the same amount over time. <S> When you start up, if one wheel starts driving before the other, when the shafts equalize the first one to move will still be ahead of the other. <A> You need to implement a control loop. <S> Either a speed feedback, position feedback, limit switch (in case of a limited travel movement) or any combination of the above. <S> As for how to implement such a loop, it is a very design dependent.
| Measure the speed of each of the motors Determine which of the two is moving faster Adjust their speed accordingly. You'll need an encoder on each shaft to measure position, then a position-zeroing loop to equalize one to the other.
|
Is it possible to store flyback voltage in capacitors? I recently put together a circuit that I use to control an electrical motor. I use an Arduino's PWM through darlington-pair transistors to control the speed of the motor. During construction of this circuit I was advised to use a flyback-diode to block flyback voltage spikes created during the collapse of the motor's magnetic field to prevent a spike from damaging parts of the circuit. Would it be possible to somehow harness this spike of voltage and store it in a capacitor? I am a hobbyist and know enough to put together some basic DC circuits, so I'm not super well versed in the capabilities of different components. I figured if this was possible, I would somehow have that short burst of energy the capacitor(s?) store then applied to the motor when a sudden increase in RPMs is needed. Any thoughts, ideas or reference material on how to store flyback voltage in a capacitor? Or am I just coming up with silly ideas I don't understand? ;) <Q> Yes, it is possible to store that energy in a capacitor; after all, that's exactly what flyback-mode switching power converters do! <S> So your idea isn't silly at that level. <S> However, using that energy to "boost" the motor drive is a little misguided, because the amount of energy you get from the flyback effect (which is due to "leakage" inductance in the motor) is orders of magnitude smaller than the amount of energy required to accelerate the rotor to any signficant degree. <S> In other words, the effort required to implement this would not be rewarded with any practical benefit. <S> You may be thinking about regenerative braking systems. <S> But such systems are not storing "flyback" energy — they're actually using the motor as a generator and storing the energy created by physically slowing down the motor (and the attached machine or vehicle, etc.). <A> In principle, yes. <S> In practice, already doing it. <S> Consider the workings of a flyback diode. <S> When the current to a motor is turned off, the energy in its windings (i x i x L / 2) needs someplace to go, and without the diode will produce a high voltage spike (V = L di/dt). <S> The energy which needs to be transferred is shunted back into the motor power supply by the diode, and is soaked up by the output capacitance of the supply. <S> So the idea is not totally without merit - it's just that it's already happening. <A> Instead, it's much better to allow flyback current to flow as freely as possible with minimal voltage drop, and use a fast enough PWM rate that the current doesn't rise or fall too much on any given cycle. <S> Basically, what happens is that during the "on" part of the cycle, the applied voltage works to get current flowing in the motor, imparting energy; the current can't stop flowing until the energy is dissipated somewhere. <S> To instantly stop the current flow would require taking the energy out of the motor electrically. <S> Allowing the current to keep flowing, however, will allow most of the energy to remain within the motor and continue doing useful mechanical work . <S> In general, the faster you can switch the motor current, the better. <S> Unless you go so fast that transistors can't keep up, higher switching speeds will make the motor run more smoothly, efficiently, and predictably.
| It would be possible to capture inductive flyback energy in a capacitor, but doing so will make the motor run less smoothly and is thus only desirable if the intention is to induce vibration in the motor shaft.
|
How does a pre-amplifier work and why is it needed? I am making an amplifier and came across the fact that, if I want to operate a microphone then I will need a pre-amp. What is the difference between power amplifiers and pre-amplifiers? Do both of them have the same gain, and if so then why do we need pre-amps? Detailed explanation would be more more helpful to get the concept. <Q> Generalizing, power amps for audio devices all tend to have the same input characteristics to make them compatible and generally interchangeable. <S> BUT, a pre amp is usually specific to it's signal source and you'll find that a pre amp suitable for a guitar is not suited for a microphone. <S> Within the microphone family there are many different types and a pre amp suited for an electric or condenser Mic will be pretty poor with a ribbon Mic and some moving coil microphones. <S> Pre amps also tend to incorporate tone controls and these tone controls are clearly just affecting the instrument that is plugged in whereas the tone control of a power amp (when it receives signals from a mixing desk) will make global tonal changes to all the instruments. <S> As mentioned in another answer, pre amps tend to have very low noise inputs, making them suitable for signals that are particularly weak. <S> Pre amps can also feed phantom power to condenser microphones. <S> In short, pre amps are tailored to the specific instrument that they are intended for and another example is the pre amp for a moving coil pick up cartridge on a record deck. <S> It has a specific frequency characteristic that de emphasizes the cartridge's incorrect characteristic thus making it "sound" correct. <S> Perhaps an analogy with a different industry will help. <S> Think industrial sensors and data collection. <S> This sort of system might use an ADC to digitize signals from various sensors but each sensor will require a different pre amp to feed to the common ADC. <S> In this rather weak and off-the-cuff analogy, the input to the ADC can be thought of as the "standard" input to a power amp. <S> Inputs can vary more so than in the audio world. <S> For instance, a thermocouple has a very low level output and may require large amplification <S> but, it's bandwidth is usually small so low noise amplifiers may not be needed. <S> A strain gauge can also have a low level signal but can be used up to many tens of kHz and can need very specialist pre amps and activation with a polarization current. <S> RTDs tend to need low gain and most applications are limited bandwidth. <S> Horses for courses. <A> A power amplifier generally takes line-level signals and amplifies them for loudspeakers - it produces the larger power needed to drive speakers. <S> A pre-amplifier takes the very weak signals from a microphone (for example) and boosts it to line-level. <S> Example signal levels for comparison purposes <S> Microphone <S> -60 <S> dBV Consumer Line-Level <S> -10 dBVPro Line-Level <S> +4 dBVLoudspeaker +24 dBV From Understanding Signal Levels Note that microphone sensitivity varies widely, that ouput levels obviously depend on the loudness of sound being recorded. <S> Pro line-level is usually measured in dBU not dBV. <A> As Red says there's a difference in the input and output levels and impedance, but there also is another great difference: noise. <S> As we know from the Friis formulas the noise in a cascade of stages is primarily established by the noise coming from its first stage. <S> Moreover the noise contributions of the subsequent stages are all divided by the gain of the first one, so your pre will need to: have a low input referred noise <S> have the highest gain possible (allowable) <S> Usually a microphone pre is based on a couple of transistors, the first one being a (J)FET. <S> FETs have a very very low input noise and can achieve very high gains in common source configuration, so the output signal is practically already line level. <S> The subsequent power stage will rise the voltage even more but will also have a very high current gain to properly drive a speaker: a power stage is often made with two stages, a common source/emitter to give voltage a boost (voltage gain), and a source/emitter follower that dramaticaly lowers the output impedance thus giving the wanted current gain. <S> Note that sometimes you can make a quite good pre out of an op amp: usually the op amp choosen, that must have a low input referred noise, will use FET for the differential input pair. <A> Yet another difference is frequency response. <S> A magnetic phono cartridge (remember them?) has different frequency response requirements from a microphone or a tape head. <S> See, for instance, RIAA preemphasis. <S> These differences are best handled at a low level. <S> Once the frequency response of the source has been equalized, power amplification is (pretty much) "just" a matter of providing a flat response. <S> (My apologies to those of you with golden ears.)
| Pre amps tend to have an output level and impedance compatible with power amp inputs
|
Bluetooth general question about antenna I want to ask you about Bluetooth antennas. I saw that some modules like HC-07 have a zig zag antenna on them: And others like BTM-331 do not have such an antenna: Is this antenna mandatory? How does this antenna influence the good working of a Bluetooth module? Here is the back photo of the BTM-331, the antena is top right corner between the 2 grounds(that half circle). Please exclude the fact that the reset pin is not connected to the GND , I will solder that ti GND because I saw in datasheet that reset is active HIGH. <Q> Looking at the BTM-331 Datasheet, it only has a RF pin. <S> You need to provide the antenna structure on your motherboard. <S> From the datasheet: <S> Pin 26 | <S> RF_IO ANT | Antenna Interface <A> Zig-zags in PCB traces can be for impedance matching, but also for control of signal integrity and timing. <S> Depending on the frequency and physical size of the PCB, a designer may include the antenna as a trace that is a single bar, a "L" or "T" shape, a loop, or a zig-zag. <S> The goal is to match the length of the trace to the frequency in such a way that avoids reflecting power back to the circuit but also corresponds to a common denominator of the wavelength. <S> Bluetooth operates at 2.4GHz, which has a wavelength of ~125mm. <S> Antennas are often 1/2 or 1/4 the wavelength, so you might find that the zig-zag trace is somewhere close to 31.25mm if "stretched" out. <S> The BTM-331 doesn't show an obvious antenna in the image, but might have one on the reverse side of the PCB or even included inside an ultra compact ceramic chip antenna like this WRL-00144 . <S> Edit: <S> Per the addition of the photo of the back side of the BTM-331, it clearly lacks a PCB trace-based antenna. <S> Either it has a pin to connect an external antenna, as Dzarda suggests, or it uses an antenna that is very small. <S> If it uses an ultra compact antenna, its performance/range won't be very good. <S> If it allows for an external antenna, then performance <S> could be much better. <S> The question then is whether you are comfortable buying or creating an appropriate antenna, and what sort of performance is acceptable. <A> The antenna is necessary for operation, but may be external on some modules instead of etched on the pcb. <S> External antennas, if properly matched, can provide much better results, especially an increase in range.
| In the case of antennas, impedance matching and minimizing reflection are the main reasons.
|
Is there a cheap thermally conductive, electrically insulating potting compound? I've got some some ready-made 12v LED units . I wanted to pot each and put it in a metal container for robustness and to try and dissipate some heat. I'd like to pot the circuit but was hoping to avoid expensive potting compound. Is there something cheap I could pot the circuitboard in? It would need to be electrically insulating but have better thermal conductance than air. Not necessarily that much better, I assume these units are meant to be used in enclosed spaces like desk lamps. I was thinking of silicone sealant or clear casting resin but I have no idea of their properties. Bonus points for optical transparency but it's not a requirement. Any suggestions? <Q> Just about anything will have better thermal conductivity than air. <S> That's not the whole story though, since most of the cooling in air will typically be from convection. <S> Typical potting compounds are available from suppliers such as Hysol. <S> If you need guaranteed electrical characteristics, that's a good way to go, but they're often not that easy to source, and it's expensive to buy a 4l or gallon size <S> can. <S> As Eternity said, the dimensional change during curing can rip parts off the board or place them under great stress so they fail very soon with thermal cycling. <S> Clear silicone (depending on the type) can have highly corrosive (and conductive) acetic acid in it <S> (some types do not). <S> It's not all that good thermally (2 or 3 times worse than epoxy), but it can seal against moisture and is available in translucent. <S> Do not use the acetic acid type on electronics. <S> thermal pad to transfer the heat to an aluminum heatsink. <S> There are a wide range of these available, with varying prices and performance (including some that are anisotropic- <S> they are more thermally conductive in one direction than another). <A> I just had the same query. <S> Arctic silver adhesive is good for small uses, it's made for LED's and sinks and you can make a first coat to ensure electrical insulation. <S> HBN boron nitride conducts very well <S> and you can mix it with tin/platinum cured silicone, and perhaps check your shops out for solventless silicone tubes as glue. <S> HBN costs 20-40 a kilo on alibaba and will last you a lifetime. <S> If you stuff thick glass fiber into the potting compound it can treble the conduction of normal silicone at .35WmK, which is not much compared to 20WmK rating of HBN. <A> At this level of dissipation, which is low, the PCB will probably be FR4 for cost, not metal core, so the thermal conductivity through the board should suck, unless the manufacturer drilled lots of vias. <S> Cooling it from the back would thus be kinda dubious if there are no thermal vias. <S> In fact, since I do not see any resistors or LED driver chip in the picture, I would guess they must be on the back. <S> Obviously if there are components soldered on the back of the board, you won't be able to mount it on a heat sink, but for 1.5W as said above, it does not matter. <S> Therefore, some spray-on conformal coating should do the trick, but you must be sure it adheres everywhere, including the LED phosphor. <S> Since this LED assembly is certainly NOT CHEAP (£5 for 100 lumen? <S> seriously?) <S> if I were you <S> I'd simply purchase 12V LED bulbs like these: <S> The bulb is glass, there is a glued-on plastic lens on the front, and the connections at the back look waterproof. <S> If you manage to connect the 12V supply in a waterproof way, this should do the trick for you, and it is much simpler and cheaper than waterproofing your PCB.
| Your best bet may be to use a minimal thickness of conformal material such as silicone rubber The LED assembly you have has 27mm diameter and only dissipates 1.5W, so it should have no trouble getting rid of heat by convection alone if it is placed vertically, as hot air rises... Googling a bit, I also found submersible LED strips , so there should be many simpler solutions that will end up cheaper than purchasing potting resin...
|
Existing methods for bi-directional data transfers using no more than 4 wires? I want to be able to exchange data between two units (in my case, two AVR processors), and I want to get away with using no more than 4 wires. So what are the existing methods for doing this? I know there's USB, but that seems a bit overkill here since I don't need to for example support multiple connections over the same cable. The requirements are not entirely set but I can at least give some approximations. The AVR processors I intent to use are ATTiny2313 and ATTiny13 which will run at 16 MHz (the ATTiny2313 will also run V-USB). Data throughput is extremely low since I will use this to implement a custom keyboard, so it will probably be something like a few hundred bits/s. The length of the wires will be something like up to one or two meters, maybe three. <Q> Without going into too much detail (because a lot has been said about them here and how much information there is readily available about them), the two main buses you can use are I2C <S> (I-squared-C) and SPI . <S> You can also use UART . <S> Most microcontrollers come with built in modules for this that do the legwork for you. <A> Common methods are SPI and I2C, often supported by hardware on the microcontroller. <S> I2C requires two signal wires, and SPI needs four including chip select. <S> SPI is very simple and can often run very fast. <S> Both are most suitable for short distances -- like on the same board. <S> For longer distances, you can consider RS-485 (using on-chip UART support) and CAN bus (some chips have hardware support). <S> Edit: If you use the UART you have to ensure that there is close enough matching between clock frequencies at the two ends that you don't get errors. <S> That can preclude using internal RC clock oscillators, especially if it has to be reliable over a wide temperature range. <A> Traditional Ethernet runs on only one wire (well, one plus ground/shield). <S> And the Chaosnet subset of Ethernet (which doesn't attempt to avoid packet collision and counts on the fact that collision will be retried after a random delay) is only about 20% slower than the full implementation. <S> With four wires and only two devices being connected, it should be easy; that's a dedicated pair in each direction.
| I2C can accommodate more than two devices on the bus, requires only two wires, but is relatively complex and can be much slower than SPI. UART or other basic serial protocol with appropriate start/stop sequences to synchronize the transmission should work Just Fine.
|
Is it possible to store a large enough amount of power to supply a house? Say I want to provide power to my house off the grid (i.e. without relying on utility companies). Say I have a method of generating power elsewhere (e.g. wind power). Is it possible to "farm" the power, save it in a large enough "battery" (I'm imagining something the size of a barrel here) and have it power a conventional house for, say, a week? I would very much like to learn about the feasibility of this proposition. <Q> It is probably the cost, rather than the size, of the battery which will limit how large a battery you'd be likely to install in practice. <S> This site claims the "true cost" of a battery only a third the capacity of what Dave Tweed calculates would cost around $58k for Li-ion or $105k for lead-acid (converted from Euros to dollars). <S> They claim lead-acid would actually be more expensive due to having higher transportation cost, shallower usable depth-of-discharge (DOD), and much shorter cycle life which would lead to multiple replacements over the same time period. <S> http://www.powertechsystems.eu/en/technics/lithium-ion-vs-lead-acid-cost-analysis/ <S> The cost could be substantially reduced by only storing 1-2 days worth, or even less depending on reliability of the source of generation. <S> For example, with a solar setup, the house might be powered "directly" (not counting inverters etc) from the solar panels during the day, with enough extra solar capacity to also charge the battery during the day; the house would only run from battery at night. <S> Thus the battery capacity required would be enough to get through 1-2 nights and maybe a few especially cloudy days. <S> As energy usage tends to go way down while people are sleeping, capacity required to run from battery at night would be much less than day. <S> Paying particular care to reduce usage, e.g. efficient appliances, LED lighting and so on would further reduce cost. <S> The assumption here is that generation is cheaper than storage, notably for solar, which has gotten much cheaper the last few years. <S> If you needed more energy to run from during the day, you'd install more solar panels rather than more batteries. <S> The batteries are just for when the solar panels aren't getting enough sun to power the house. <A> If you can stretch the meaning of battery a bit there are some neat mechanical based solutions, such as <S> this one <S> (No advertising intended). <S> The idea is using a huge fly-wheel connected to a brushless motor: <S> when you have energy to spare you speed it up, when you need energy you get it from the motor that can work as a generator too. <S> Mechanical solutions have their problems such as friction, vibrations, dimensions, costs and such, but these guys' prototype adresses them in a smart way. <S> Their fly-wheel is enclosed in an air thigh conainer from where most of the air is pumped out in order to reduce air friction, moreover they use some magnetic bearings and the whole rotating mass is not a solid block but a sort of metal net that auto adjusts its shape reducing vibrations (negative reaction everywhere!) and dramatically cutting costs since a big metal wheel that goes that fast would need to be manufactured with very strict tolerances. <S> About dimensions... <S> I did not do the math <S> but I think that such a thing may have a higher energy density than most modern batteries. <A> Size of house, how much electricity do you use a day, time of year (heating/cooling). <S> A small cottage or two bedroom apartment, with 12v or lower lighting and devices, would do much better than a large 4 bedroom house, with 120V electric stove/fridge/Inefficient TV running at all times. <S> I mean, I'm good with a laptop, ipod radio, and a lamp for most of the day, plus two mini fridges. <S> Easily done with Solar + Battery in some states. <S> Highest power draws are (Electric or HVAC) <S> Heating or Cooling and Fridge/Freezer. <S> Electric Stoves and Television or Hi-Fi Stereo are the other typical high draw usage. <S> If you manage those, then the rest is very feasible under off the grid power.
| In practice you might not install enough energy storage to run for "a week" unless you had good reason to believe your offline generator e.g. "windmill" might produce little to no energy over that long a time period.
|
USB as a local bus in an embedded system Is USB a reasonable choice for a local bus? what are pros and cons? what reliability concerns are there? Bus spec device count ~4; peripheral devices are permanently connected to same PCB as host (soldered or via headers). Some device are puny, e.g. serial port or temperature sensor, some are complex, e.g. an LTE modem or ethernet or wifi. Peripherals are such that are available as standalone USB devices or same chips are used in such devices. Linux is supposed to have all the drivers already. Ideally I'd use only one bus (with hubs if necessary) for simplicity and eventually modifications without some components and with other low-speed components. System spec ARM, Linux, DC powered, roughly equivalent to an Android tablet. <Q> What you are looking at is a problem I like to call bus hierarchy . <S> Connecting a full fledged LTE modem over I2C will seriously bottleneck the system. <S> And connecting a temperature sensor on USB is a serious overkill. <S> You need to prioritize. <S> What devices are to be accessed most often? <S> Which ones need to respond quickly? <S> And which don't need that much bandwidth? <S> Feel free to edit your question. <S> Edit: <S> USB may not be such an overkill after all. <S> Only in the latest versions of it (2.0, 3.0) it has gotten the notion of being targeted to fast peripherals only. <S> Before that, it was simply a Universal Serial Bus . <S> This doesn't change anything on the fact that it's implementation cost <S> is very often too high. <A> Unless the device already has a USB interface, such as a keyboard or mouse, this is going to entail a lot of work and extra hardware. <S> For example, connecting to a temperature sensor that only has an I2C interface. <S> You are not going to be able to add a USB interface to the sensor, so you will have to add a small microcontroller, such as a PIC18 <S> that has both a USB device and I2C interface. <S> The PIC then talks USB back to your host and I2C to the temperature sensor. <S> But why not just connect the temperature sensor directly to your host microcontroller? <A> Based on your needs, yes, usb is ideal. <S> Keep in mind, the U does stand for universal. <S> It's not the most effecient, but for two nics, a temperature sensore, and a serial device, its designed for it. <S> So much that the majority of computing device manufacturers rely on it heavily. <S> * <S> * Not just cheapo sbcs or tablets, but even heavy hitters like Apple and Dell use it for touchpads and keyboards and webcams and wifi and bluetooth and ir ports in all their laptops. <S> ** <S> USB is ubiquitos, easy to implement, and has a very low board cost in terms of routing and parts. <S> While you can get 4 port arm devices, most have one or two root ports (buses), then connected to a hub ic. <S> Your biggest bottle neck will be mixing High speed devices with Full or Low speed devices on a single hub. <S> Cheap hub ICs have a Single Transaction Translator, that can bring a single low or medium speed downstream device to a high speed uplink. <S> Better ones will have a MTT, Multiple Transaction Translators, so multiple low speed devices can be bridged at high speed speed. <S> Or simply ensure that the low speed are on one hub while high speed on another. <S> But since you have arm as the intended SOC, you will have access to proper buses for sound or i2c or spi (for the temp sensor or serial) or video or even a built in ethernet driver minus the magnetics. <S> Higher end ARM chips comparable to cheap Android tablets or routers are fully loaded. <A> SPI Pros good for 50Mhz can communicate with multiple slaves simple protocol <S> Full duplexCons <S> Not a standard interface <S> I2C Pros <S> many slow chips uses I2C broadcast protocol where multiple slaves can reside on the bus <S> Cons <S> slow speed more complicated than spi USB Pros standard interface <S> probably driver ready and tested Cons <S> very complicated to debug with hub, the peripherals will share bandwidth <S> Other interfaces include SDIO, UART etc Again as already mentioned, you will have to define the bus hierarchy with your bandwidth requirements. <S> Probably the LTE modem would require a direct memory interface or a PCI interface. <S> Also there are phy translators like FTD232 ( http://www.ftdichip.com/FTProducts.htm ) which can do USB-Spi, usb-uart etc and is widely used
| You can have usb nics, wifi, mouse/keyboard/touchpad/touchscreen, sound cards, webcams, hell, even usb displays. You have high speed devices that need a fast low-latency path to the CPU (like the LTE modem) and slow devices like the temperature sensor.
|
How to double my clock's frequency using digital design I am trying to double my clock's frequency using only gates, flip flops or whatever but unfortunately I get a signal of which the duty cycle is far from 50%. Unfortunately I have to develop my system using FPGA but the chip I work with, does not support a PLL so before trying to work with another board I want to be sure that I cannot get the double frequency of my input clock. The input frequency of my system is 10 MHz and I want to make a signal of 20 MHz. I have done it using the attached circuit and I have also measured it but the duty cycle of it is not satisfying at all. Please I would appreciate if could someone suggest something that could be helpful. Here is the circuit I have used. <Q> I am trying to double my clock's frequency using only gates, flip flops or whatever Start with a 20 MHz clock (that comes under the "whatever" umbrella) and reduce it to 10 MHz where it is needed using a flip-flop clock divider. <A> A PLL is generally required to achieve what you want to do. <S> Trying to use just logic to do this requires the addition of some extra delays via R/C time constants to bring the 2x pulses up to near 50% duty cycle. <S> However that will not generally happen inside an FPGA without bringing some signals to pins on the part where the R/C can be connected and then fed back into other pins. <S> Another limitation is that such scheme will not be right on 50% duty cycle and for a given set of R/C values will only be useful at a particular narrow range of input frequency. <A> Doubling the frequency can be as simple as this: <S> thanks to the gate propagation delay <S> (I actually used this to overclock a TRS-80 <S> when I was young). <S> Solving the duty cycle problem could be done (approximately) by changing the number of gates in series, but would only work for one frequency (and would probably be sensitive to components charateristics, temperature, etc.) <S> You could double the frequency twice and divide it once with a flip-flop to obtain a perfectly square signal, like Andy said. <A> To cleanly double the frequency of an applied input clock would require a PLL, FLL, or other such circuit. <S> Depending upon what you're trying to do, however, if you need to generate two clock events in response to an external clock stimulus over which you have no control, two approaches which I call "putt-putt-wait" and "putt-putt-skip" might be better. <S> For "putt-putt-skip", you need a free-running oscillator that runs more than three times (preferably more than four times) as fast as the input clock. <S> Count how many pulses have been received on the input clock and how many have been output. <S> On each clock from the local oscillator, latch the number of counts from the reference input, and output a pulse if the previously-latched count doesn't equal half the number of pulses output. <S> Note that basing the output pulse on the previously-latched count will add an extra local clock's worth of phase delay, but will avoid any possibility of outputting metastable or "runt" clock pulses. <S> For "putt-putt-wait" <S> , you need an oscillator that can be started and stopped smoothly; the oscillator should run whenever the reference count isn't equal to half the number of pulses output, and stop whenever it is equal. <S> If the oscillator can start and stop smoothly, this approach may yield a more consistent phase relationship between the input and output waveforms than would putt-putt-skip. <S> It may also be more energy-efficient. <S> Both of these approaches will yield outputs whose phase relationship is not as clean relative to the reference wave as would be a PLL or FLL which has had time to acquire a lock . <S> On the other hand, if the reference clock may be started and stopped, a PLL or FLL would require a certain amount of time to reacquire a lock each time the reference wave stops and restarts, and until the lock was reacquired its output phase would be essentially random relative to the input. <S> By contrast, the putt-putt-skip or putt-putt-wait approaches will output a pair of pulses which follow within well-defined windows each input clock pulse received, regardless of whether those pulses form a continuous train, or periodically start and stop. <A>
| To double the clock frequency using only logic gates one can simply pass it through a buffer with propagation delay equal to one fourth of the clock period and then simply xnor both the clocks to get double the frequency.
|
Idle state in RTOS, sleep state or lowest frequency? In real time systems using an RTOS, what how would the RTOS handle an idle period? Would it run nop instructions at the lowest frequency supported by a Dynamic Voltage Scaling capable processor? or would it turn to a sleep state? Can anyone refer me to actual practical implementations. Thanks <Q> I depends entirely on the system requirements. <S> Other systems might have plenty of power but need to be very reliable... <S> these could be doing self-tests in the background task. <A> It would most likely go to for one of the device's sleep mode. <S> It's very quick (often a matter of a single instruction) and designed to do exactly that: fill inactive periods with inactivity ;) <S> This in turn helps to save power. <S> However, if power is not a concern to you, you may simply "halt" in a polling loop until a continue condition occurs. <S> Clocking the system down seems like a "half-way solution" - doesn't make much sense to me. <A> You asked about a practical implementation. <S> Here are the QNX power management definitions. <S> It's highly customizable. <S> General CPU Power Mode Definitions <S> Our sample power policy is based on four general power mode definitions: Active/Run, Idle, Standby, and Shutdown. <S> Because the QNX power management framework is completely customizable, these power mode definitions are used for convenience only. <S> There are no assumptions or dependencies on these definitions. <S> The general CPU power modes can be defined as follows: <S> Active/ <S> Run - <S> The system is actively running applications. <S> Some peripherals or devices may be idle or shutdown. <S> Idle - System is not running applications. <S> CPU is halted. <S> Code is all or partially resident in memory. <S> Standby - System is not running applications. <S> CPU is halted. <S> Code is NOT resident in memory. <S> Shutdown - Minimal or zero power state. <S> CPU, memory, and devices are all powered off. <S> These definitions are used as a guideline only. <S> Multiple subsets can be defined for each state (i.e. Idle1, Idle2, etc.). <S> Further, not all these CPU power modes may be required or even possible for a specific board or CPU.
| Systems that need to operate at very low power could go to sleep until the next interrupt.
|
How can I "print" traces on the back of a ceramic package? I have a project I'm working on that is so tightly packed that I'm totally out of room. I could save the whole thing by slapping a bunch of surface mount LEDs (30 of them) on the back of a (non-surface mount) 28-pin ceramic package in my circuit and wiring them to the device's pins. I've tried a few things without success, like gluing the LEDs in place and running very fine wire to the solder points on the surface mount LEDs and soldering them in place. The solder breaks down the glue (crazy glue almost works, but one way or another, the solder won't bond to the top of the contacts on the LEDs.) I have copper tape that I've tried X-Acto-ing traces out of, but the soldering iron breaks down the adhesive and the whole assembly disconnects itself. I've even tried conductive glue and conductive pens. They have such hit-or-miss impedance properties that the LEDs don't light evenly. One will be many times the brightness of another. If I could afford the space, I'd just slap a PCB on there and call it good, but I really need the LEDs right on the back of the IC. I can fill in with epoxy after the fact to keep everything protected and in place. Thanks... <Q> These will print traces onto injection-moulded plastic... <S> I've never priced them, but I doubt they qualify as "inexpensive". <A> The ceramic is too smooth for glue to adhear to properly. <S> You need to scratch it up some with a coarse grade sandpaper or dremel bit. <S> Just enough that the contacs are not covered. <S> Let it cure over night or two. <S> Then you can solder the wires to the leds an pins. <S> Other than that, a quick pcb order from seeed or itead or any other cheapo pcb shop with the thinest board will only cost 10 bucks for 5~10 boards (5cmx5cm) which is enough for 20 or 30 of your project. <S> Since the pcb can be double sided with vias, it takes some of the routing and wiring issues away. <S> but if you are still in the pcb planning stages and have vertical room <S> you could create the same board above, but use SIP instead of dip headers. <S> Basically a single row of pins, which you then connect to the led board with a header or a ribbon cable. <S> Also think about using 0.05' headers, which are half the width of 0.1" standard headers. <A> I don't know about printing, but various folk make adhesive copper PCB lands, usually used for board repair. <S> As an example, http://www.intertronics.co.uk/products/crc1152600.htm Since you're modifying a ceramic package, I'd think it would work. <S> This technique would be expensive, but not like a PC board. <S> How steady is your hand?
| Solder or reflow the leds, and use some standard 0.1" headers so the board can stack "or float" on to top of the ceramic chip with some breathing room around it. Then a thin line of 5 minute epoxy with the leds on top. IDE cables make for a great source of easy to access ribbon cables for you too.
|
Voltage divider with short circuit part 2 simulate this circuit – Schematic created using CircuitLab This question is a slightly modified follow-up to my previous question Voltage divider with a short, what is Vout? In this voltage divider I was originally wondering what \$V_{out}\$ was when a short was created across points A & B. With the short, the voltage at A is given by: $$V_{A} = \frac{R4}{R1 + R4} \times V_{in} = \frac{200\Omega}{200\Omega+200\Omega} \times 5V = 2.5V$$ The CircuitLab simulator shows the voltage at \$V_{out}\$ as 2.5V, and I actually built this on a breadboard to test it out and indeed the voltage at \$V_{out}\$ is 2.5V. What I don't understand, is why the voltage at \$V_{out}\$ is 2.5V, since it seems like all the current from A to B should be flowing over the short, i.e. the path of least resistance. My intuitive expectation is that \$V_{out}\$ should read 0, or at least have a floating value, but this isn't the case. Perhaps this is rightly a Physics question, I don't know. But why is there a voltage on \$V_{out}\$? <Q> But why is there a voltage on Vout? <S> By Ohm's law, the current through R2, from left to right, is $$I_{R2} = <S> \frac{V_A - V_{out}}{R_2}$$ <S> Also, from Ohm's law $$I_{R3} = \frac{V_{out} - V_B}{R_3} <S> $$ <S> Now, assuming there is no other circuit connected to the \$V_{out}\$ node, the current through R2 must be the current through R3, i.e., R2 and R3 <S> are in series . <S> Thus $$\frac{V_A - V_{out}}{R_2} = \frac{V_{out} - V_B}{R_3} <S> $$ <S> But, \$V_A = <S> V_B = <S> 2.5V\$ <S> so the only possible solution is $$V_{out} = 2.5V$$ <A> simulate this circuit – Schematic created using CircuitLab <S> This is your circuit now. <S> Vout will be the same as points A and B, unless a load is connected at Vout. <S> For a circuit analysis approach, the resistance looking into Vout forms a voltage divider with...an open circuit, or an infinitely high valued resistor. <A> The voltage at A, B, and Vout are all 2.5 volts. <S> Since the voltage at A and B is the same, there is no current through R2 and R3. <S> the voltage drop across R2, which is R2 times the current through R2, which is zero. <S> 2.5 minus zero is 2.5
| The voltage at your output is the voltage at A minus
|
Schematic editor capable of diagonal components I've found several great editors capable of vertical and horizontal components, but none that can do diagonal ones. Are there any available? Edit - This is purely cosmetic. I've just started an introduction to circuits course and a good deal of the exercises involve diagonal components. AFAIK, in all cases these can be redrawn to vertical-horizontal schematics, but I'd like to show the original circuit as well. <Q> Every decent schematic editor I've used has a built-in library shape editor. <S> If you need a diagonal component such as a resistor at 45 degrees then create one as a part and save it to your library. <A> The direct answer to your question is "Yes". <S> However, you should ask yourself why you really want diagonal components in a schematic. <S> You say it's for cosmetic reasons, but that's exactly why you DON'T want diagonal components most of the time. <S> There is a good reason most components are defined oriented either horizontally or vertically. <S> Other than for a small number of exceptions, diagonal components make a schemtatic harder and more annoying to read. <S> You may not care yet if you're new to reading schematics, but after a while, properly drawn subsystems will look similar accross many schematics. <S> This allows them to pop out at you, sortof like how you read the words of sentences as whole entities and don't decipher them from the individual letters most of the time. <S> If you break these patterns, other will find your schematics annoying to read. <S> The two most common places I see diagonal components is a diode full-wave bridge or something like a wheatstone bridge. <S> A wheatstone bridge is hardly used anymore, but in any case, both can be drawn just as well by using vertically oriented parts. <S> Here is a diode full wave bridge, for example: <S> In this one case, a diamond arrangement for the diodes would have been acceptable, but this vertical version is just as readable and nobody will object to it. <S> In fact, I'd say that when you're starting out with schematics, don't use diagonal components. <S> Consider then outright wrong. <S> Eventually you will learn in what rare cases they are acceptable, and then you can use them if you really think it adds clarity. <S> However, for now it is good to learn to draw schematics with only vertical and horizontal components, even if someone gives you schematics with diagonal components. <A>
| Eagle allows you to rotate objects by 45 degrees using the ROTATE command (but not via the mouse alone).
|
Cost-sensitive way to maintain a 220C temperature I'm building a device which is designed to be built by people of varying skill and education levels. Part of it needs to climb to and maintain a temperature of 220C, but I don't need very tight regulation. Swings from 215-225C are acceptable, but not desired. My normal goto for this is a microcontroller, thermistor, MOSFET, and heater cartridge. I know for a fact this is above my target audience's skill level. My next goto would be digital PID controllers, and those are going to be out of my budget by a significant portion. My project has 5v & 12v available (5v would be preferred actually, saves me a 12v power supply). I've seen temperature fuses, but those seem to be one shot so as not to set fire to something. I've seen PTC thermistors, but ... I don't know how well strapping one of those to the hot part of this assembly is going to work. Any suggestions? My ideal solution could be had from either a local B&M store, or Mouser, for $5 or less qty 1. <Q> It is quite simple to do it without any digital electronics (MCU with ADC) or analog comparators (thermistor) with triac. <S> You can use only a component: a fixed temperature thermostat . <S> The circuit becomes very simple and reliable. <S> Just connect it in series with the heating resistor. <S> Also there is no need for auxiliary power supplies. <S> Just make sure the switch is rated at a higher than the required amperage. <A> There is a partial answer, cheap and readily available. <S> Use the thermostat from a toaster oven. <S> These normally operate up to 450 F (232 C), and are certainly cheap (I've seen toaster ovens advertised online for $20, so you could buy the oven and rip out the thermostat, if necessary). <S> I'd suggest some experimentation. <A> If the enclosure is well insulated, you could then use optical feedback to set the temperature with a photo resistor, rather than sensing the temperature directly.
| What I cannot guarantee is that the temperature swing of the thermostat is within your limits. You could use a halogen bulb and a reflective enclosure to heat your project, like a childs toy oven.
|
Design vs reality and what to do when they differ I've been trying to focus a bit more on Analog circuits lately and found that my design and actual results often don't match up exactly. An example is a Pierce oscillator I built a while back, the circuit worked mostly as expected but the gain required was much less than I calculated for (meaning I got some distortion). Is it common practice to just change the values to what seems to work right and go on or is it better to make sure the theory matches up as well? To clarify, I mean that after observing the difference and playing around with some values I change the design to match, the circuit then gives the desired output but my initial design was inaccurate. Should I go back and try to identify why or is it just not worth it? ie, no calibration on production units. Thanks for all the replies, I'm going back to the drawing board because there's clearly something going on that I don't understand. Ignoring it would possibly create other problems. <Q> No, the common practice is to assume that some parameters will change depending on the operating environment. <S> The design should be made in such a way that the final output is less dependent on such changes. <S> For example, the value of resistor comes with a tolerance rating. <S> If your design is sensitive to small change in the value of a particular resistor, then choose a resistor with less tolerance. <S> It doesn't mean that its value will not change. <S> It simply means that its value will change in given limits. <S> So you must make your design in such a way that even if it changes a little bit, the system output suffers a minute change. <S> And remember, no matter what you do, you can not make a system with 100% accuracy. <S> You have to be reasonable with yourself about the systems accuracy. <S> You decide for yourself, what amount of change in the system output is acceptable. <S> Always try to have this system accuracy before you even start designing any system. <A> If your prototype performance doesn't match your anticipated performance this can indicate an error in the design process or a build error. <S> You really should sort this out if you are going to be making several units or more because it will only come back and bite you. <S> ISO9000 talks about "Design Verification" - this is basically proving the design/prototype does what it was intended to do. <S> This is important and shouldn't be short-changed - if your pierce oscillator doesn't produce the correct amplitude I'd want to know why. <S> "Design validation" checks that production units are still meeting expectations. <S> A really good test that I always do is spray the circuit with a freezer spray and see what happens <S> and I also touch each chip and transistor with the tip of a soldering iron. <S> This is done on the bench <S> and I'm looking for unexpected brief changes in amplitudes (or some other parameter) as an indicator that something is wrong. <S> If all is OK then nothing beats a good full load test at elevated temperatures. <S> This can find a lot of anomalies on a complex circuit. <A> The main point in Analog Circuit Design is to always know the reasons why things actually happen. <S> So for your problem there are 2 different cases: <S> This is unavoidable and you need to design your circuits so that they work in spite of these inaccuracies. <S> No need to change the calculations. <S> Something in your pracitcal realisation is different than you calculated it. <S> Let's say your pierce oscillator has an output amplitude which is 10% of what you calculated. <S> This tells you something is wrong with the circuit or your calculations and in that case you need to understand the issue and refine your calculation. <A> The most important thing is to know why it doesn't work as expected. <S> Only then can you show in your design the ranges and/or conditions under which it does work as expected. <S> e.g. <S> The oscillator frequency is X (+/- <S> 10%) at temperature Y, using 1% precision resistors, etc... <S> You can never test all the variables, but the more coverage you provide, the fewer people will come to you later saying "I built it just like you said and it doesn't work".
| The deviations between calculation and realisation are due to component mismatch (e.g. resistor and capacitor tolerances).
|
Calculating Solar Requirements for a Refrigerator I am attempting to run a refrigerator on solar power, it's "Energy Guide" says 410 kWh/year, so I assumed that it uses 46 W each hour (410 kWh / number of hours per year = 410 kWh / 8760 = 46 W), I really double that a refrigerator would require that very low power, or this is the running power? The power consumed while the motor is running? and not starting? Since I have seen that the power required to start the refrigerator is 10x that, so 460 watt required from my solar panel to run this fridge? <Q> Based on the Energy Guide numbers, that means that it's using about 1.12 kWh each day. <S> As you calculated, that is an average of 46 Watts. <S> However, this is an average over a long period of time (a year!), with many on/off cycles. <S> This "average" is useful for figuring out how much solar energy you need to generate (and store) in a day to break even. <S> Depending on the size of the refrigerator, efficiency, etc... the refrigerator may draw hundreds or thousands of watts when it's running, and close to zero when it is "resting". <S> All appliances should say the maximum current they draw from the outlet - this is the instantaneous power. <S> You would use this value to figure out how large of an AC inverter you need. <A> Well the "Energy Guide" and you both are correct. <S> To know why you must understand the operation of refrigerator. <S> First the refrigerator is at room temperature. <S> When you switch it on, then it starts cooling. <S> So at that time it consumes maximum power. <S> You should really find the power consumption at this point. <S> You can use <S> a simple Power Meter to do that. <S> This stage is considered as Start up state . <S> Now when your refrigerator is cooled down below pre-set temperature, the refrigeration process stops. <S> At this point the power consumed is lowest. <S> This can be termed as Ideal state . <S> When the temperature inside the refrigerator increases above pre-defined value, the compressor starts again to initiate cooling process. <S> But at this time it consumes more power than <S> ideal state and less power than start up state . <S> So finally when you take the average power consumption over a year, you get a value far less than that required at the Start up state. <A> If it's got an 'Energy Guide', then probably there would be some sort of electrical specifications sticker with the rated power consumption as well. <S> Now this rated power again would be at a certain temperature, according to the local standards, of the condenser (which is sometimes outside and sometimes inside the refrigerator). <S> This can either be scaled up based on a judgement of the 'worst-case' condenser temperature or can be actually measured (by operating the appliance at higher outside temperatures). <S> The solar panels and intermediate storage can then be sized accordingly for power. <S> The cables would need to be sized according to the current draw considering the (lower?) <S> voltage of the panels. <A> I am installing a solar system and have purchased a new refrigerator rated at 408 KWh/year. <S> I looked at the tag on the compressor and saw that LRA is just under 12.LRA stands for Locked Rotor Amps and that is the maximum current that the compressor would ever draw. <S> So the INVERTER has to deliver <S> 12x120 or 1440 Watts, peak, for a fraction of a second. <S> Add a bit for losses along the way. <S> That is frig only, so if something else is using power at the same time that has to be considered. <S> What short-term power can your inverter deliver? <S> I then put an ammeter on the frig wire and found that it uses .8 to 1 amps while running (not in defrost cycle), so about 120 watts. <S> That is surprisingly low, to me at least. <S> And the compressor only runs for a fraction of the time, depending on how often you open the door. <S> The 408 KWh per year works out to 1.12 KWh per day. <S> I don't care about hours, since the sun doesn't shine at night and varies considerably during the day. <S> So my batteries have to supply 1.12KWh to the frig in a day, and the panels have to recharge them by that amount. <S> Of course the batteries should only be discharged about 20% if you expect a reasonable life-span, and you have to expect some days without sun. <S> So I've multiplied by 10 (20% discharge and 2 days without sun) <S> so am planning on batteries rated for 12 KWh. <S> For a 12 volt system that is 1000 <S> Ah (12000 Wh/12 V). <S> So 2 batteries at 6 volts and 500 Ah will do the trick. <S> Battery specs tell you how many Ah the battery can deliver at a certain rate. <S> With my system the current draw will average about 4 Amps so I am using the 50 Hr rate. <S> That means a battery labelled at 550 <S> Ah will easily deliver 500 <S> Ah at the 50 Hr rate. <S> (I get the 4 amps by dividing 1.12 KWh/day by 24 h, so <S> 50 Watthrs/hr, then dividing by 120 volts, so .41amphrs per hour at 120 volts, then multiply by 10 v to get amps at 12 volts. <S> That comes to 4 amps.) <S> The panels then have to recharge the batteries - I would say in a day. <S> I won't do those numbers here.
| It looks like you may be confusing energy with power , resulting in some comparisons that don't make sense. A refrigerator has a (hopefully) low duty cycle, meaning that it's actively cooling down only a small part of the time.
|
Wirelessly get the current date and time I know there is a wireless signal all over the US (at least) sending out the current date and time. Some clocks use it so they don't need set, just not sure what its called. Is there a module or a circuit out there to listen to this to get the time into a MCU? <Q> As @andrejaKo mentioned there is WWV which is a radio station run by the National Institute of Standards and Technology. <S> This station broadcasts on several frequencies that can be picked up with a general coverage shortwave receiver. <S> 5, 10, 15, and 20 MHz come to mind. <S> There are modules available which can receive this signal and convert it into digital data for MCU interfacing. <S> Second is the GPS satelite system. <S> There are receivers that can pick up GPS signals and provide time base information for computers. <S> Third, some broadcast radio and TV signals have digital information embedded, which contains date and time information. <S> Mobile phones always seem to know what time it is. <S> I don't know if you can get that information from the signals transmitted by the mobile phone network, or not, unless you have a device with a mobile phone service plan. <A> I recommend GPS for this. <S> GPS modules generally output a NMEA serial pattern containing (among bunches of other things) a UTC timecode. <S> gpsinformation.org is an invaluable reference. <A> Another option is to require the device to log into a WiFi network and use a standard NTP time server, such as these ones from NIST. <S> I've had spotty results getting the WWVB signal , though my Casio watch seems to manage it if I point it just right at the window and leave it overnight.
| There are a number of signals being broadcast that contain date and time information.
|
Difference between UART and RS-232? Most of the time RS-232 and UART come together in serial communication theories. Are they both the same? From my readings I concluded UART is a hardware form of the RS-232 protocol. Am I correct? <Q> UART is responsible for sending and receiving a sequence of bits. <S> At the output of a UART <S> these bits are usually represented by logic level voltages. <S> These bits can become RS-232, RS-422, RS-485, or perhaps some proprietary spec. <S> RS-232 specifies voltage levels . <S> Notice that some of these voltage levels are negative, <S> and they can also reach <S> ±15V. Larger voltage swing makes RS-232 more resistant to interference (albeit only to some extent). <S> A microcontroller UART can not generate such voltages levels by itself. <S> This is done with help of an additional component: RS-232 line driver. <S> A classic example of an RS-232 line driver is MAX232 . <S> If you go through the datasheet, you'll notice that this IC has a charge pump, which generates ±10V from +5V. ( source ) <A> UART (or USART) <S> - Universal (Synchronous) Asynchronous Receiver/Transmitter <S> This is, essentially, a serial communications interface. <S> The "universal" part means that it can be configured to support many different specific serial protocols. <S> The term is generic, and does not represent a specific standard. <S> At minimum it means that it has a TX and an RX line, which sends a serial data stream and receives a serial data stream. <S> RS-232 <S> - A standard defining the signals between two devices, defining the signal names, their purpose, voltage levels, connectors and pinouts. <S> This is a specific interface standard that allows for equipment interoperability. <S> While two pieces of hardware may have UARTs, you don't know that they'll connect without damage, or communicate properly unless you know they have the same pinout and voltage standards, or include a converter or specially wired cable specific to the interconnection of these two specificl devices. <S> To avoid the need for special converters or cables, the manufacturers may choose to follow the RS-232 standard. <S> You know, then, that a standard RS-232 cable will connect the two. <S> However, neither the UART, nor the RS-232 standard define what is sent on the TX and RX lines. <S> Generally, when people use RS-232, they use a simple 8 bit NRZ encoding with one start bit and one stop bit. <S> Most equipment today manufactured uses this encoding, but there's no requirement to do so. <S> You can find older equipment that includes parity bits, or uses 7 or 9 bits. <S> The UART can be configured to support these various protocols on its TX and RX lines. <S> UARTs do not typically interface directly with RS-232. <S> You will need to convert the output of the UART to the +/-12V standard that RS-232 requires. <S> A complete RS-232 interface will typically involve both a UART and an RS-232 level converter. <S> Further, the RS-232 standard includes the definition of several other signalling pins besides TX and RX , which you may need to use depending on the equipment you need to connect to. <S> These will also need to be level converted, and your UART may, or may not, support these signals. <S> If it does not you will have to control them with your software/firmware directly. <S> So while a UART may help you implement an RS-232 interface, it is not an RS-232 interface itself. <A> The clock pin of the UART chip is feed by a programmable clock source. <S> The clock speed is determined by the baud rate configuration that the device will be using. <S> The clock speed is 16 X the baud rate. <S> Placing an oscilloscope probe on the clock pin of a UART chip and determining the frequency, then dividing by 16 is one way to determine an unknown baud rate.
| The UART functions to convert parallel data from PC bus lines to serial data for transmission via line drivers to RS-232, RS-422 , and RS-485 devices. No, UART and RS-232 are not the same.
|
Converting serial signal (12V-5V) and reading it using Arduino I'm trying to read some commands from a device that uses non-standard voltage levels for serial communication. It uses 0V for 0 and 12V for 1. For all I know, TTL levels are 0-5V, so if I want to communicate with it using my Arduino, I need to level down the 12V to match the 5V. The Arduino Mega provides a pin with an output of 5V, so I figured I could use it, add a diode and get about 5V which I can connect to RX. For now I only need to read the data. TX pin stays untouched. I made a schematic, presented below: I figured that the drop on the diode (about 1.8V) will allow me to have (~)5V on the RX pin when the signal from the device is at 12V, and 0, when its 0V. 12V - 5V - 1.8V = 5.2V. The R1 is 3kOhm. Could somebody explain to me why doesn't it work? Is this solution even proper? What do I need to change for it to work? EDIT: I managed to get it to work - I modified the circuit: The diode is a simple red diode, which has a drop of 1.8V. The three resistors are all 1kOhm. From my calculations, if the maximum signal voltage is 12V, I can now get 5V after reconnecting the diode to the GND. What I don't understand is - when the pictured red line is disconnected, I get nothing - my Arduino doesn't respond. BUT when I connect the device's RX with TX I read the exact data I wanted! Now that's not very obvious to me, I got it accidentally by playing with the board. Is there an obvious reason why the device starts transmitting after I connect the red wire? EDIT2: Below is the device's schematic. CONTROL SYSTEM is the only connector I am able to get to. 12V comes from a simple 12V adapter, ground is also connected to adapter. Rx is connected to arduino, the rest is exactly like on the picture with the red wire. Bigger version on Imgur <Q> For the 12V->5V direction a simple 2-resistor voltage divider (e.g. 7kOhm + 5kOhm) will probably be perfectly fine. <S> Usually you can't just assume that the +5V source can actually sink any amount of current. <S> Plus, normal diodes are relatively low bandwidth so that your signals may become more or less distorted even for only a few kBit/s. <S> Schottky diodes mitigate this issue. <S> Another simple solution could be like this (use Schottky if possible): simulate this circuit – <S> Schematic created using CircuitLab <A> See below for a circuit that will work. <S> "RS232" serial is inherently very simple but can have a surprisingly large amount of "dark magic" added that means you are not seeing what you think you are. <S> Addressing your hardware requirement is easy. <S> Being sure that it really works as stated may be harder. <S> You say that "it doesn't work" but give no information re what it does do when it doesn't do what you hoped. <S> And, some information on what levels you see where / when and how you measured them may help. <S> The basis for your formula is obscure. <S> The diode dropp you use is wrong if it's a standard silicon diode and you should say what it is if it's a zener or other device. <S> And your formula is almost certainly wrong if the circuit is as shown OR the circuit is wrong (or both). <S> As shown the diode will clamp Vin to a maximum of +5V PLUS one diode drop. <S> If we use Vdiode = 0.6V then Vin_max =5+0.6 <S> = 5.6V.This exceeds the maximum operating voltage allowed on input pins and can make the processor misbehave or die. <S> A 'safer' circuit is shown below. <S> Vout max is Vzener at the current offered. <S> As shown if a 4V7 zener is used current will be about 0.7 mA and Voutmax will be somewhat less than 4V7 as zener voltages are usually specified at more than 0.7 mA. A 5V1 zener will probably give <5V max as shown. <S> If you have no zener diodes and you do have a number of std silicon diodes you could make a temporary solution using a number of diodes in series. <S> About 6 is probably about right. <S> Try it and see - change R1 (affecting current) or number of diodes to adjust. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> Assuming that "mark" and "space" polarities are the same for the 12 volt source's output and the Arduino's input, that the 12V signal comes from a voltage source which is stiff enough to source at least 1 mA and stay within a couple percent of 12V, and that the current into the Arduino's <S> I/O is << 1mA, <S> this'll work: 0-12V in | [10k] <S> | +-->0 to 4.86V out to Arduino | <S> [6k8] | GND
| What you are doing is "illegal" and can cause the processor to malfunction or even destroy it.
|
Strategies for managing code size - PIC18 XC8 I'm new to embedded C development and I'm looking for some general principals/guidelines for managing the size of the generated code. In my specific example I'm using XC8 on a PIC18F4550. My code so far uses about 13% of the space. Once I use "time.h" and 1/2 functions from it, the usage jumps to 45%! I realise that the free XC8 compiler does not optimise but I'm still very surprised to see just how much space is used. What I'm looking for a tips / staring points along the lines of Alternatives to the standard libraries that implement on small targeted subsets of the functionality. E.g. a date/time lib. i.e. are there repositions I can get useful routines from? How to see what is using all the space. (Listing/map files - and tips for analysing them) Any other tips / resources. EDIT :I found a nice implementation without using stdlib here: https://codereview.stackexchange.com/questions/38275/convert-between-date-time-and-time-stamp-without-using-std-library-routines The general question still stands though. Are there guidelines, good repository sources etc <Q> I've done some looking around and here are the tips I can find <S> Write better code. <S> Code size and speed must be considered at each step of the way. <S> C compiler/linker will only use the functions you actually use. <S> So just including a .h should not increase code size (much) <S> Standard functions are however often more generic than you require. <S> It is possible to write smaller versions that only do what you required Shared strings as per @BrianK's answer <S> Use an optimising compiler, e.g. MPLAB <S> Pro <S> I would still like an easy way of seeing which functions and included functions are using the most space. <S> I'll update here if I find an easy way to do so. <A> There are a million smaller, more specific optimizations that you can do, but a good reference collection of those kinds of tricks is the book Hacker's Delight . <S> It's very practical (especially for bit twiddling like you often do on a microcontroller) and I recommend it. <A> Here are some things I have done when using Microchips C18 compiler. <S> Maybe the concepts will apply to your compiler:- declare each string one time. <S> Put in a separate .c file and use a .h file to reference them. <S> In other words don't duplicate display messages multiple times.- declare strings so that they go in rom. <S> This wont help you with ROM (code space) but it will save memory.- write tight code. <S> If several lines of code are duplicated, put them in a function. <S> Copy / paste is not necessary an embedded programmers best friend.- <S> like you already thought of, implement your own functions instead of including a library. <S> I once saved a ton of space by creating my own itoa() function. <S> Try not to use printf.
| Then there are some alternatives that don't address the core issue of code size but may need to be considered if all else fails Use a PIC with more space Use assembler for some or all of the code Implementing your own version of standard functions instead of including the entire library can help.
|
What causes this resistor to fail - open circuit and no visible damage? The resistor in question is R10 (523K 1% 1/4W) in the circuit below: The resistor is reported to fail as open circuit and there is no visible damage. We have shipped some boards and got some damaged ones back with R10 damaged. So this is not a single instance. The AC input is 220V. The resistor specification from the manufacturer is: 1/4 W Max working voltage: 300V Max overload voltage: 500V Max dielectric withstanding voltage: 500V Since R10 withstands an AC signal, the Vrms it sees is less than 300V. The wattage it withstands is also less than 1/4 W. But R10 on a few boards just failed and they are now open circuit/huge resistance and there is no burn mark on the outside. We did a few tests, trying to amplify the problem. We overload one board with 253V AC (230V*1.1) and let a blower heat up the board. We also put a more-than-usual load on the board. The board did not fail after several hours of continuous test. I have no clue on how R10 would die. Any pointers are greatly appreciated. Is there any way to examine the dead bodies of R10 to determine the cause? The excerpt of the resistor (Metal Film type) is shown below (I do not have the full datasheet): The measurement on R10 and GND (the voltage drop across R12 is less than 3.3V) is shown below (the peak is about 320V): <Q> It is my experience (failure analysis) that 1% metal film resistors are not reliable long term with high voltage DC on them. <S> I've also seen huge changes in value without them complete going open. <S> You might try to fit a MOF (metal oxide film- also known as metal glaze) type if you have room. <S> I recommend Vishay (BC Components nee Philips) <S> VR25 resistors for this service if you care about reliability. <S> They're tested at 100VDC, but have a "rating" of 1600VDC. <S> There's a hint here that moisture (probably plus elements of the lacquer) play a role, so if you want to recreate the failures I'd suggest putting them in your environmental chamber at elevated temperature and 95% RH and see what happens. <S> Obviously, you want to avoid condensing humidity when power is applied or bad things (tm) could happen. <A> R10 is seeing almost all of the 220V input full wave rectified (there is a voltage divider with R12 but R10 <S> is more than 100 times larger). <S> The peak voltage across R10 is thus given by 220*1.414 which is 311 volts. <S> This is larger than the specified working voltage of 300 volts. <S> Since it is not due to overtemperature but overvoltage, the failure will not be visible on the outside. <S> Most likely, there is internal failure of the insulation. <S> In any event it would be advisable to get a resistor with a higher voltage rating. <A> The resistor in question is not protected against lightning strikes to live and neutral relative to earth. <S> This could be the problem <S> I.e. <S> both L and N get raised to some absurdly high transient voltage whilst earth <S> remains pretty much steady at ground potential. <A> I sell thousands of small dusk to dawn sensors which have a 100R 1/2W metal film resistor in the AC circuit. <S> I used to get returns with exactly the same symptoms, with the resistors appearing normal upon inspection. <S> The way I overcame this problem was to use a 1/2W carbon film resistor. <S> Problem fixed!
| It is quite possible over time that this overvoltage is causing the resistor to fail.
|
PWM driven LED array over a shift register I am trying to drive 8 LEDs connected to a 74HC595 shift register with PWM. I want to be able to set each LED to a different brightness. The PWM signal is connected to the Enable Output pin of the shift register (it is low active so the PWM signal must be inverted). By selecting each LED (only one LED at a time) and setting the PWM frequency I thought it would have been done. So currently I have following approach: set PWM frequency "activate" desired LED by writing according value to shift register (for example first LED would be 0b00000001 write shift register value to shift register outputs by setting the Latch input to 1 and clear it back to 0 start over again with new PWM frequency and next LED This is resulting in following fault: When I set the first LED to full brightness and the next LED to no brightness (off) I notice that for a short time the full brightness of the first LED is showing up on the next LED. This behavior gives the second LED a little brightness which is bad because I want no brightness (turn it off). I know I could just jump over the LED to leave it off but I would like to only control LEDs brightness by setting the PWM frequency. Also I have this effect when setting for example first LED to full brightness and next LED to half brightness. There is always the brightness of the preceding LED on the next LED for a short time. I think it is because I can't control the PWM output like I can control the shift register output by its latch. The PWM frequency is applied as soon as I set it in my code. This causes the short blink with preceding LED's brightness. I also tried to change the order of steps in my approach. Do you have any idea how to solve this problem? Some lines of my real code (if the pseudo code is not enough): OCR0A = 0; // set PWM to full brightnessSPDR = 0b00000001; // select first LEDwhile(!(SPSR & (1<<SPIF))); // write to shift registerPORTB = 0; // latch outputsPORTB = 1;_delay_ms(1);OCR0A = 255; // set PWM to no brightness (off)SPDR = 0b00000010; // select second LEDwhile(!(SPSR & (1<<SPIF)));PORTB = 0;PORTB = 1;_delay_ms(1); My target hardware is an ATmega168 clocked at 20 MHz. I am using avr-gcc . <Q> I believe you need to set PWM to off while you are changing content of the 595. <S> OCR0A <S> = 255 <S> ; // set PWM to no brightness (off)_delay_a_little_more;SPDR = 0b00000001; // select first LEDwhile(!(SPSR & (1<<SPIF))); // write to shift registerPORTB = 0 <S> ; // latch outputsPORTB = 1;OCR0A = 0; // set PWM to full brightness_delay_ms(1);OCR0A = 255; // set PWM to no brightness (off)_delay_a_little_more;SPDR = 0b00000010; // select second LEDwhile(!(SPSR & (1<<SPIF)));PORTB = <S> 0;PORTB <S> = <S> 1;OCR0A <S> = 255; // set PWM to no brightness (off)_delay_ms(1); On a side note - there is more efficient way of doing what you want (i.e. controlling brightness of multiple LEDs with 595 and EN pin). <S> It's called Binary Code Modulation. <S> http://www.batsocks.co.uk/readme/art_bcm_3.htm <A> This is a bit old and you've probably figured it out by now, but if I understand correctly, you were trying to use PWM on the output_enable pin to control each register's output independently, which simply can't work, because that pin affects all the outputs. <S> The shift register doesn't "remember" the PWM cycle that was active when you entered a bit (the value on each channel is always either "on" or off), and it doesn't store any analog information. <S> There are some libraries that do most of the work for you (ex., ShiftPWM). <S> Basically, if you wanted the first LED to have a 25% duty cycle, the second to have 50% and the third to have 100%, you'd make them cycle through something like this: B00000111 <S> B00000100 <S> B00000110 <S> B00000100 <S> You can still connect output_enable to a PWM pin to affect all the LEDs, but then you'll have to be careful to make the software update rate a sub-multiple of the hardware PWM frequency, or you might get strange results. <A> I have had the exact need in a project, so I wrote a library which makes shift register pins PWM capable. <S> In a nutshell, what is does is setting up a timer interrupt which in turn updates the shift register's output pins at a chosen PWM frequency. <S> You can find a detailed description here: ShiftRegister PWM Library (74HC595) <S> The library works well with the ATmega328 but can also be ported to other microcontrollers. <S> It uses timer 1.
| To get independent PWM, you need to control the duty cycles in software, by cycling each register through a bit pattern that matches the PWM (or BCM) you want, while leaving the output enabled.
|
Why is non-inverting op-amp input resistance on a tee to ground? In many of the explanations I've read of non-inverting op-amps, the non-inverting input is given a resistance to meet the specs of the op-amp. I'm confused by how the resistance is applied. Since the resistor is just acting to control the input current, I expected it to be inline with the input voltage. However, the resistor is usually attached as a tee from the input going to ground. Why is the input resistor on a tee and not just inline with the non-inverting input? <Q> Let the resistance looking into the non-inverting input be \$R_{in+}\$ <S> If a resistor \$R_i\$ is placed in series with the non-inverting input, the resistance seen by the source \$v_I\$ is $$R_I <S> = R_i <S> + R_{in+} \ge R_{in+}$$ <S> If a resistor \$R_i\$ is placed in parallel with the non-inverting input, the resistance seen by the source \$v_I\$ is $$R_I = <S> R_i||R_{in+} \le R_{in+}$$ <S> Since, for an ideal op-amp, \$R_{in+} = <S> \infty\$, the series case gives $$R_I = <S> R_i <S> + \infty = <S> \infty$$ <S> while for the parallel case $$R_I = <S> R_i||\infty = R_i$$ <A> There are two functions of a shunt resistor on an inverting input. <S> One is in the case when you need a termination resistor, like in the case when the signal is brought in on a coax or strip line. <S> The second reason is more subtle, in the non-ideal case (i.e. every real Op-amp) <S> the input has leakage currents, which interact with the various resistances to create a offset voltage on the input to the op-amp. <S> To partially compensate for this, the resistances seen by each input must be matched, that means in your example, that \$R_{in <S> } = R_1||R_f\$, where the symbol \$||\$ means "in parallel with". <A> The resistor does not control the input current. <S> Ideally, there is no input current because the + input has infinite resistance. <S> What R1 does is it establishes a finite input impedance for the amplifier. <S> Also, op-amp inputs generate small DC bias currents: some models more than others. <S> This current needs a path to allow it to flow to the ground, called a "DC return" path. <S> The resistor provides that path. <S> Suppose that the broader circuit is like this: simulate this circuit – <S> Schematic created using CircuitLab <S> The source device happens to be capacitively coupled, represented by C1. <S> (C1 could be part of the amplifier based around OA1, or it could be part of the source device; it doesn't matter.) <S> So, the only DC path from the + input to ground is through the resistor! <S> What happens if you remove the resistor? <S> Or connect it incorrectly, in series between the capacitor and non-inverting input? <S> Current flowing out of the + input will slowly charge C1 until a voltage builds up that pushes the + input out of the common mode input range. <S> R1 helps keep C1 discharged. <S> Note, however, that the bias current flowing across R1 generates a voltage on R1 (V = IR) which creates an offset voltage which gets amplified. <S> If the op-amp has similar bias currents flowing out of both inputs, this problem can be attacked by choosing a value of R1 which is the same as the combined resistance faced by the - input, as a result of the feedback resistor network. <S> Thus R1 is chosen in order to establish some desired input impedance, and the magnitudes of the feedback resistors are chosen to balance the bias current to null the offset (while their ratio is chosen for the desired gain). <S> Some op-amps have built in bias current cancellation. <S> These op-amps have a much smaller bias currents than similar op-amps without the cancellation. <S> Moreover, the remaining uncancelled currents from the two inputs are not similar at all, and may be of different polarity. <S> With these op-amps, the trick of balancing the resistances is not applicable; R1 can be chosen independently of R2 and R3. <S> For instance R1 could be, say, 100 kOhm to set up an input impedance that high, whereas the feedback resistors could be chosen only in the thousands of ohms. <A> Briefly, to summarize, there are two motivations: To minimize the drift of the output due to the bias input current (offset). <S> In this case \$R_{in}=R_{1}//R{f}\$ To match the input impedance (i.e. in video amplifier). <S> In this case \$R_{in}\$ must be equal to the impedance of the source, for example 75Ω for coaxial cable in analog video. <S> Sometime, in case of ac-coupled amplifier, \$R_{in}\$ provide the return-to-ground path for the input current, as said in the "Horowitz-Hill". <A> If your signal into the circuit is referenced to a dc value between the rails of the power supplies (normally 0V or mid-rail) then you don't need an input resistor. <S> You typically use an input resistor to make a "light" connection to midrail (0V) when coupling an input via a capacitor.
| The op-amp's natural very high impedance is not necessary or desirable in some applications.
|
Can I see an analog signal with changeable frequency on oscilloscope? I have a sinusoidal signal with changeable frequency (which implies that it is not periodic). I wonder is it possible to see it on oscilloscope? Does it show non-periodic signals? As it is apparent my signal has different frequencies. The range of frequencies are less than 100 kHz. <Q> What, exactly, do you mean by "possible to see it on oscilloscope"? <S> The trivial answer is yes. <S> Just set the scope mode to single shot and trigger on a zero crossing. <S> If you don't see the signal you're looking for, just trigger again (and, possibly, again and again. <S> Patience is advised.) <S> If by "see" you mean, can you reliably trigger on the areas of interest which you have marked on your illustration? <S> The simple answer is probably not, or at least not with your scope's built in trigger facility. <S> There are various circuits which you could build which would do the job of providing a fairly reliable trigger, provided you have a good idea of what you're looking for. <S> It would help if you're using a digital scope, of course, since single-shot viewing is hard without it. <S> In the case you've shown, where the special areas are marked by a lower frequency than the unwanted signals, you use a comparator to convert the signal to logic. <S> You then feed this into the clock input of two retriggerable one-shots, such as an MC5438. <S> One half has a pulse width very slightly less than the period of the desired signal, while the second has a much shorter period. <S> The output of the first drives the reset of second. <S> The output of the second is used as a scope trigger. <S> This will discriminate against frequencies higher than desired. <A> The only type of oscilloscope that won't be able to display a non-periodic waveform is a "sampling" type (which are now referred to as "equivalent time sampling" to distinguish them from ordinary real-time sampling digital oscilloscopes), and that type is mostly used at frequencies where real-time sampling is difficult (GHz). <S> Even a cheap digital oscilloscope samples fast enough to see a snapshot of a signal with a bandwidth of 50MHz or 100MHz in a single shot (0.5G samples per second is common in inexpensive scopes). <S> It perhaps needs to be mentioned that the oscilloscope will only have a certain "depth" of memory <S> so you will only get a kind of keyhole view of the signal, starting at the trigger and extended some thousands of samples after the trigger. <S> After that snapshot, the oscilloscope may trigger again or it may not, depending on how you've set it up, but you cannot gather true continuous data from the input with a typical oscilloscope, just snapshots of it. <S> For continuous acquisition (say to capture the signal over many seconds, minutes or hours) <S> you need a data acquisition system capable of taking samples at at least double the highest frequency component of interest, and of sufficient bit width for the accuracy you care about, and storing it to suitably capacious memory in real time. <S> It's not hard to fill gigabytes of memory if you're gathering high precision data over multiple channels. <A> Any half decent modern oscilloscopes will be able to show the waveform as you have shown it. <A> CRO will show the waveform. <S> But measuring time period may be difficult since waves will be running most of the time. <S> Adjusting trigger for such signals are difficult and this frequent change in trigger will feel the viewer that the waveform is running. <S> But a DSO can show you the wave form correctly. <A> I'd probably try to read out the data with a (digital) oscilloscope, and then use an FM demodulator in software to see the frequency shift over time. <S> There is a package for Matlab providing an fmdemod function, or you can use GNUradio. <S> If you need this measurement repeatedly, look for an oscilloscope with FFT analysis options, or use a spectrum analyzer with FM vs time display.
| Scopes can show non-periodic signals and these can be easily triggered and "captured" and held on the display.
|
How can I make a fine tipped object emit an electric field similar to that of a human finger? I've asked this before, but knew less about the tech and didn't word the question properly. I know other people have asked similar questions and knew little, so let me be as specific as possible here: What I want to do is make a fine-tipped stylus for my iPad so that I can write and draw without an awkward clunky stylus that may as well be another finger. I know there are fine-tipped styli out there, but I dislike all of them as they either do not work as advertised, scratch the screen, or are to flimsy.But most importantly: I like making things. The sensor array in the iPad is mutually capacitive. A grid of capacitors is laid out under the glass. A constant voltage is passed through one axis of the grid. The other axis waits and detects changes in the voltage. So to trip a sensor, an object such as a human finger or stubby capacitive stylus must be brought close enough to change the voltage of one of the capacitors with its local electric field. When that field covers a wide enough area, the device registers it as input and decides where the center point is. This is how it maintains accuracy while being so low-definition. So to reiterate: how can I make a device that generates the same electric field as a human finger over a ~5mm radius from a much finer tip? It can be ugly, hooked up to wires, even grounded to human skin with a wrist strap. I don't care about form. Just function. <Q> Some data as what the excitation signals for the screens are would help. <S> But even without that you could design a powered stylus with a fine tip. <S> The basic setup would be a simple metal wire connected with one end to a voltage source. <S> The other end of voltage source should be insulated. <S> Now you have a artificially generated electric field around the wire. <S> The nice thing about it is that the tips always get the highest fields. <S> You should put an insulation around the wire tip to prevent scratches. <S> If you put a battery in, it won't even be drained because there would be no significant current path. <S> As for the needed voltage, I can't guess that well without any data. <S> The higher the voltage the higher the field will be, what means that you can have a smaller tip. <S> The problem with this approach could be that the electric field projected from the tip is too weirdly distributed. <S> I have no idea what the expected input signals for the processing system are. <S> So it could be possible that the tip is not recognized because it has a too weird field distribution. <S> If you knew the exact parameters of the system you could do something similar to a microatennae which gives the same inputs to the system as a fingertip. <A> I've been wanting to find out info about this subject my self and also don't have much in the way of electronics background. <S> I believe that Raiden wants to create his own DIY fine point stylus like the Nota stylus ( http://hex3.co/products/nota ) which is described as electronically activated. <S> There are also others which are coming to market in the near future. <S> So I've looked into what can be done to increase capacitance of the stylus. <S> Formulas <S> C = <S> Q/V <S> OR Capacitance = <S> Charge / Voltage <S> C= εS <S> /D OR Capacitance = <S> (Dielectric Constance X Surface Area) <S> / Distance between plates <S> If i understand correctly when you touch the screen you make a sort of capacitor due to the layer of insulating film /glass and the change in voltage at that point is the detected. <S> (May be completely wrong about this).So in the 2nd equation if you reduce the surface area you will reduce the capacitance. <S> So in order to increase the capacitance we need to change the dielectric constant of the material being used. <S> Here is an example of a fine point stylus that uses foam and water <S> https://www.youtube.com/watch?v=alrweIVt2RQ . <S> The Constant of water is ~80 compared to rubber of <S> ~3 <S> and i believe that is why this example of a fine point stylus works. <S> Unfortunately it is inconsistent and water doesn't play nice with touch screens. <S> I would theorise that using a material with a high constant would help reduce the size of a stylus point. <S> For example Graphite has a constant of ~ 36. <S> My other thoughts are to try using an electronic circuit to add voltage to the stylus point. <S> But thats well out of my range of understanding. <A> I saw this write-up on how to make a stylus with a tip roughly the size of a ballpoint pen, which I'm sure you can reduce further as your needs require. <A> I would recommend trying to get ahold of a commercially available stylus with a metal shaft and either covering <S> it's tip with a metallic material, or somehow molding a replacement tip out of a mixture of plastic and metallic material <S> (maybe you can 3D a replacement?). <S> Now for the fun part, now that you have a "conductive" tip, connect it to the pen's body via some sort of wire and voala! <S> Every time you touch the metal body of the stylus, you increase the capacitance of the tip of the pen and thus, make it work with any display!
| As far as I understand they work by increasing the capacitance of the stylus point.
|
Will doubling thinner wire in lieu of thicker wire work? I've been needing a jumper cable for a while and have plenty of 10 AWG copper wire lying around. From what I've read, 6 AWG wire is recommended for jumper cables. I want to make a 7 foot cable. So, I was wondering if it would be possible to use three (or more if needed) 7-foot pieces of 10 AWG wire, and use them instead of one 7-foot piece of 6 AWG wire? Would the 10 AWG x 3 cable be able to handle as many amperes as a single 6 AWG wire can? <Q> The current capacity is directly related to that area. <S> This means that to create the equivalent of a wire of AWG(N), you need two strands of AWG(N+3), or three strands of AWG(N+5). <S> Three strands of AWG(N+4) gives you some extra safety margin. <A> Yes, this is a common practice. <S> With electric motors, for example, we often substitute 2 or 3 thinner parallel wires for 1 thicker wire. <S> This allows us to fit the wire through thinner openings and thinner wire is often easier to bend. <S> When you substitute, you will want to keep the cross sectional area the same or more than the 6 AWG wire. <S> 6 AWG has a cross-sectional area of 26,244 circular mils. <S> You could use three 10 gauge wires (31152 cir. <S> mils) which would be more than enough. <S> Or you could use two 10 AWG and one 12 AWG (27297 cir. <S> mils) which would be about right. <A> The problem with light jumper cables is not typically the ampacity of the wire, it's the voltage drop due to the resistance. <S> Two AWG 10 wires will handle similar current to a single AWG (110A vs. 101A) as can be seen from the table I've linked. <S> The reason is that there is more surface area on two wires so they can shed the heat better. <S> That does not help your car to start because it means that the power that should be cranking your engine smartly is going into the wires <S> and not the starter motor. <S> So you want to keep the resistance down to the equivalent of AWG 6 for 7', which is 2 <S> *7/1000 * 395m\$\Omega\$ <S> = 5.53m\$\Omega\$ (using the ohms/1000' values from the table I linked- image below). <S> Three strands of AWG 10 are <S> 2 * <S> 7/1000 <S> * (1/3) <S> * 1000m\$\Omega\$ = 4.67m\$\Omega\$, which is a bit better. <S> If you make the cable longer, you would want to keep the total loop resistance similar, so an even heavier gauge of wire is called for. <S> It's not uncommon for 16' jumper cables to be AWG 4, but that works out to 6.3m\$\Omega\$, which is worse than your three strands of AWG 10 that are only 7' per side. <S> Edit:- <S> The question has been raised that perhaps the ratios of ampacity for chassis wiring do not represent the ratios of ampacity for free air, that they might somehow be completely different rather than roughly 2:1 for free air. <S> I won't insert the relevant charts here, because to use them you have to refer to a lot of other charts and derate for various factors (and they are not conservative without derating), but to pick a single data point, continuous operation at 70° <S> C rise (limited by insulation rating) <S> , the AW6 ampacity is 120A and AWG 10 is good for 60A, so just as I said. <S> Derating for bundling the AWG 10s into triples or doubles is left as an exercise for the reader, since ampacity is really the wrong thing to be looking at, once we have established that it is more than adequate . <S> Refer to FAA specification 43.13-1B for more information.
| Yes, keeping in mind that the rule is that an increment of 3 in AWG numbers represents a halving of the cross-sectional area of a wire.
|
Effect of using buck converters in parallel What is the effect, downside or purpose, if any, of using buck converters in parallel? For example, to connect the Vout and Gnd together on two converters. Could this be used to increase the current capability? Assume that the converters are identical in design. <Q> The purpose is generally to get higher power output capabilities. <S> In general, it may be less expensive to design a single 20-30W converter and duplicate it than to design a single 100W converter. <S> To reduce loading on the input supply and improve noise characteristics, you can find multiphase buck controllers. <S> These work by sending the same clock signal but phase-shifting between the multiple converters. <A> No real benefit is achieved. <S> The buck that regulates to a slightly higher output voltage wins and the other buck basically switches off. <S> However, it's probably a bit worse with synchronous buck regulators because they have active high and low mosfets and can act as a shunt regulator. <S> This is likely to be a no win situation for either buck with one device trying to regulate downwards by shorting the output whilst the other will try and connect it's series pass transistor to the incoming supply rail far too often in order to fight the other device. <S> My advice is get chips that can work in master-slave mode or design a better buck regulator. <A> This can be done to: improve transient response: output inductors are seen by the load as one inductor with lower value (L_{tot} = L_{ph}/N). <S> This improves converter's transient response (check out VRM converters) <S> improve efficiency: individual phases can be switched off at light load to maximize overall efficiency decrease input/output current ripple: <S> Good at very high currents. <S> Downsides: increased active component use: <S> pricey needs additional control (1): if individual converters are voltage control they will not share current equally between phases. <S> This can be mitigated a bit by special design. <S> Current control or voltage droop characteristics is advised. <S> needs additional control (2): individual controller ICs needed (pricey) or controller has to have many PWM outputs (limited number of those in typical ucontrollers)
| EMI benefits, in some cases this can lead to reduction of installed electrolytic capacitors and this can lead to improved reliability increase current rating/decrease conduction losses: current is split between many phases.
|
How to connect 1.5mm SMT alternating pins to 0.1" pin header? I have a toy I'm trying to rehabilitate - the microcontroller was fried and I'm attempting to replace it with an Arduino. It looks like the connections were at a SMT pin-pitch (1.5mm spacing). To work with breadboard and jumpers, I'd like to install something that terminates in a female pin header with breadboard spacing (0.1" pin pitch). What is driving this: as you can see in the photos, I have a sort of janky setup where I've soldered each individual contact of a ribbon cable. This is not a mechanically sustainable solution! The pins are breaking free. I'd like something that is more solid, for example a cut-to-size PCB with the (mystery SMT contacts) on one side and a pin header on the other. So my questions are: What would be the best way to get this to end up having a 0.1" pin header? What is this SMT alternating connections pattern used on the motherboard called? Is there a thing I can buy that will connect to the SMT alternating connections? Pictured is the motherboard, with the empty slot that once held a daughterboard, which in turn had a microcontroller. Note that you can see the ribbon contacts breaking off. The connectors on either side alternate and never line up with each other. Here's a photo of the original daughterboard with the connections. A fried, blob-covered microcontroller chip is on the other side. <Q> That's just a custom pad spacing that the designer came up with to connect the two boards together. <S> The staggered 0.75mm pitch connections may not match anything you can buy. <S> The pads are going to be fragile, since they're just held on by adhesive (no through holes to act as rivets). <S> That leaves you with two options as I see it- make up a transition board using one of the cheap online PCB sources .. or use thinner wires (maybe AWG 30 wire-wrap wire) that won't rip the pads off and put some strain relief on them, perhaps going to a chunk of perf board before heading off to your external circuitry. <S> If you do the latter, you can stick down a chunk of perf board with the header on it first , then run (not too taut) <S> AWG 30 wires to the pads (or where the pads go if you have ripped the pad off). <S> It should be do-able in maybe twenty minutes to half an hour- <S> there are fewer than 30 pins, it looks like. <S> If you do the former, you can just match the pin layout with a board just like the one with the micro on it, and wire the pads to a 0.1" header. <S> It will look really nice, but you'll have to wait a while for the board to arrive in the mail. <S> P.S. <S> The ribbons look a little messy, but you did well to get those boards out without destroying everything. <A> Lots of people solder ribbon cable to a PCB for one-time repairs. <S> (a) <S> (a) <S> (b) (c) <S> (d) <S> Some people make a big blob of glue that covers the solder joint and the half-inch or so of the ribbon cable. <S> If you do this, make sure you aren't using the kind of glue that contains acetic acid which corrodes coppper <S> (assembly tips) . <S> Other people guide the ribbon cable to some other empty point of the PCB and put a big glob of glue there, making it obvious that the short cable between that point and the solder joints is slack even when someone yanks on the far end of the ribbon cable. <A> Not exactly sure how the spacing will work out, but you might be able to get a socket like this: <S> http://www.ladyada.net/wiki/partfinder/sockets , bend the pins flat, and then try and solder them to each pin. <S> It's worth a shot, at least!
| I think the only thing you are missing is adding hot-glue as a stress relief -- so pulling on the ribbon cable doesn't stress the solder joints.
|
How much clearance should you include in through-hole component holes? Is there a general rule as to how much clearance you should add to through-hole components' holes to allow them to fit easily? For example, if I have a component with 1mm pin diameter, what should the diameter of the holes for it's pads be? Using my calipers on a PCB I have handy, it looks like about 0.1mm is added to some holes, but I don't know if that's "normal" or not. <Q> Typical recommended clearance for throughole pins is 0.15 mm (which is equal to 6 mils, or 0.006 inch). <S> Keep also in mind the shape of the pin and tolerances. <S> If a pin has a rectangular cross-section, then the hole should be sized to the length of diagonal \$ \textstyle \sqrt{x^2 <S> + y^2} \$. <S> Often the datasheet for your throughole would specify the dimension of the pin with tolerances. <S> You should use the max possible size (which is the worst case). <S> For example, if the datasheet specifies 2 ± 0.1 mm, the hole should be sized for 2.1 mm pin. <S> The PCB fab, in turn, will specify the tolerances for finished hole size ( example ). <S> For example, if the fab specifies 2 ± 0.1 mm, the actual hole can be as small as be 1.9 mm. <S> More recommendations about thougholes. <A> That (0.1mm) is too tight <S> More like 0.25 to 0.4mm, and towards the high end if you're designing for automatic insertion of parts with bent leads. <S> Usually 0.8mm is okay for most leads except fat diode leads, for which you can use 1.0mm. <S> Usually <S> Data sheet recommendations often err on the side of making the holes on the loose side, especially for parts like terminal blocks and relays. <S> If the leads are flat or square rather than round you can go a bit tighter on the diagonal dimension, assuming a round hole. <S> For really flat leads it's better to specify a slot, of course. <S> Here are some recommendations (in inches, unfortunately, but 25.4 is fast to key in). <A> In addition to desired clearance, you must also take into account the tolerances (variances) in your part. <S> There are engineering standards for fits and tolerances <S> (ISO 286-1 (2010) and ANSI B4.2-1978) which are nicely summarized here . <S> There are three main classes of fits- clearance (never overlaps), transition (sometimes overlaps, within part tolerance) and interference (always overlaps). <S> In your case, you're definitely looking at a clearance fit since PCB is brittle and won't withstand strong compression forces. <S> Which one you choose depends on the requirements for assembly time compared to locational accuracy- <S> it's a tradeoff. <S> Without knowing the specifics of your project, I wouldn't recommend using a larger clearance than that in a practical engineering application. <S> Once you decide which fit you'd like, use this calculator to determine what amount of clearance you need, taking into account the tolerances of your parts.
| Of course if you're using some kind of special part such as a staked connector or press-fit part, follow the recommendations on the datasheet and pay attention to the tolerances too. A 0.1 mm clearance as you mentioned would correspond to a loose running or free running fit. You should use the min possible hole size (which is the worst case). 1.3mm holes are specified for 1mm pins (for example on terminal block datasheets), sometimes 1.5mm which is really, really loose.
|
What is a suitable temperature rise for PCB traces? I'm designing a PCB for a 10A relay and am trying to determine what the trace width should be. According to this trace width calculator , the biggest factors in the width are copper thickness, maximum current, and temperature rise. I would like to use 1oz for the copper thickness since that makes the PCB cheaper, so that leaves temperature rise as the most desirable variable to change. Using the above calculator with these settings: Current: 10 ampsThickness: 1 oz/ft^2Temperature Rise: 10 CTrace Length: 1 in The calculated trace width is 283 mils, which is too wide. If I change the Temperature Rise to 100 C, the calculated trace width is 70 mils, which isn't bad at all. However, I don't know what kind of temperature rise is acceptable. How do I determine this? <Q> The number you need is called "MOT" (maximum operating temperature) for the laminate you have in mind. <S> You also need to know what the internal temperature will be in your product (including the heat the relay connections add). <S> For FR-4 to maintain electrical properties , that might be 130°C (a bit higher for mechanical properties). <S> If the maximum temperature in the vicinity of your PCB will not exceed 60 <S> °C you could conceivably allow for 70°C rise. <S> For FR-2 it might be 105°C, so the limit might be 35°C rise. <S> It's conceivable UL approvals might be complicated with internal temperatures exceeding 105°C. <S> There are some very nice higher temperature laminates with Tg = 170°C available, and commensurately higher MOT, but it's cheaper to use 2oz copper. <S> Other options are to pull back the solder mask and parallel the conductors with solder (assuming wave soldering), or to solder a jumper wire in place of, or in parallel to, the conductor. <S> If you can keep the conductors short in length, most of the heat will get sunk out of the pins. <S> Look at the design of any PC power supply for ideas, just about every penny has been pinched in their design. <A> Temperature rise is something you have to consider, but usually the resistance and the resulting voltage drop at full current have been the limiting factors when I've gone through this. <S> That said, 100°C is a large temperature rise. <S> That's not enough to be a problem for a copper trace on a FR4 board by itself, but that's going to affect the apparent ambient temperature for nearby components. <S> If you have that much temperature rise, you're dissipating significant power in the trace, which means power loss in your system. <S> Again, the first concern should be how much voltage drop you can tolerate. <S> Once you get that to acceptable levels, the temperature rise is usually low enough. <S> Also consider that 2 oz copper and more is widely available. <S> The extra cost of specifying 2 oz copper for outer layers may be less than making the board larger or dealing with the heat or voltage drop. <S> 2 oz on outer layers doesn't usually add that much cost. <S> If you stitch together a trace on both outer layers, you have 4x the copper cross section than for a single trace of 1 oz thickness. <S> If it's only one or two traces in a otherwise low current design, you can leave the soldermask off the trace and have a copper wire soldered over the trace. <S> There are actually bus bars meant for this. <S> However, consider the manufacturing cost. <S> 2 oz copper may start to look like the cheap option when you consider the total cost of alternatives. <S> Again, look at all the options and all the criteria for deciding on trace width. <S> Don't just focus on temperature rise, or assume that thicker copper is more expensive once the whole system is considered. <A> 100C is a lot of heat and power wasted. <S> As a customer, I'd not accept a product that was so hot in its wires (traces). <S> I'd say 50-75C would be MAX acceptable amount for me. <S> (But I still would not be happy).Do <S> you have other options? <S> As Olin stated, if you are creating heat you have resistance and are wasting too much power doing nothing useful.
| More normal practice is to allow for 20-30°C to keep the PCB from getting all discolored and weak over time and there might be issues with component life if you add too much heat.
|
How to turn on/off a sub circuit with a transistor I bought a dtc144 transistor because it was written in its datasheet that it could do a "Switching circuit" ( as it is written in the Applications section in the datasheet). I though it meant that I could turn on/off a sub-circuit in my PCB design, but when I tested, it didn't worked as I imagined. Did I misunderstand what switching circuit means? How can I use this transistor to turn on/off a sub circuit? The datasheet (first page) has the following image: (if you can not see the image, check the datasheet . I am having problems to upload the image) I thought that as a transistor, if I put a GND in the "in" pin, the transistor would behave as high impedance between the "out" and the "gnd" pins, and low inpedance if I put VCC instead of GND in the "in" pin. But it seems that I am wrong. I'd appreciate if you could help me understand. Thanks. <Q> You are asking a specific question about a specific circuit, but you're not ready for this yet. <S> You need to <S> understand how a transistor works, at least its first pass approximation. <S> The type of transistor you show is a NPN, which is a type of bipolar junction transistor (BJT). <S> Surely there are many basic introductions to NPN transistors out there, <S> so I'm not going to go into any detail. <S> Basically, you put a little current into the base and out the emitter, and the transistor can support a lot of current into the collector and out the emitter. <S> When IN is raised to high enough voltage, then current will flow into the base, and the transistor will pull down on OUT. <S> There are of course a lot of details. <S> Without knowing exactly what you did, we can't tell why you didn't observe the behavior as described above. <A> Referring to the data sheet the transistor works as a switch if OUT has a higher voltage potential than IN. <S> IN must be 3 volts (value taken from table) or higher than GND for the transistor to conduct from OUT to GND (switch closed). <S> If IN is close to 0 volts compared to GND the transistor is not conducting OUT to GND (switch open). <A> I thought that as a transistor, if I put a GND in the "in" pin, the transistor would behave as high impedance between the "out" and the "gnd" pins, and low inpedance if I put VCC instead of GND in the "in" pin. <S> But it seems that I am wrong. <S> No, you are correct, except that you left something out. <S> Your description of how the transistor acts as a switch is right on, as long as the "gnd" pin is tied to GND . <S> If you are trying to use the OUT/GND path as a short / open element in a signal path, it won't work. <S> It will only provide a short/open path to ground.
| Your top circuit is actually correct in that when IN is grounded, the transistor is off, which essentially open-circuits OUT.
|
Why can't the PIC18 perform a divide operation accurately? I just noticed that when I am converting coordinates from N/S E/W format to decimal format it getting wrong product. I tested 1256/3600 which should be 0.3488888888889 but my pic gives me 0.3488922 and 7/60 which should be 0.11666666666 and pic gives me 0.116666794. When adding those products and the number 23 I get 23.46582 but it should be 23.4655555556. As I am building a laptimer I do not want this much error.According to http://www.sunearthtools.com/dp/tools/conversion.php I need 0.00001 precision which is 1.11 meters. I could tolarate a bit more but not much more. I could give a guess that this is because of the processor but I really think it should be a way around it. The formula I am using is: x + y / 60 + z/3600 where x,y,z are integers. <Q> Some compilers for the PIC have an option to select either a 24-bit or 32-bit floating-point format. <S> Note, BTW, that floating-point division is apt to be much slower than multiplication. <S> Pre-computing the values of 1/60.0 and 1/3600.0 and multiplying by those is apt to be much faster than dividing by 60.0 or 3600.0. <A> Because of floating point formats, numbers are not exact. <S> If you need that precision, use fixed point math. <S> What every computer scientist should know about floating point math. <S> by David Goldberg, 1991 <A> It depends on your compiler. <S> One of your numbers (1256/3600) appears to be calculated to 5 digit precision (about 16 bits) and the other (7/60) to about 24 bit precision, implying mixed 24 and 32 bit math (with one byte used for the exponent). <S> Using 32-bit floating point math should be good enough for you (perhaps called doubles with your compiler). <S> Some compilers have 64-bit doubles, which is more than good enough (but slower).
| You don't specify your compiler or its settings, but I would guess you're set to use less precise math.
|
Why are twisted pair cables used in electric power distribution systems? I'm an Electrical Engineer, and understand how a twisted pair of wires can be used to reduce noise in the presence of magnetic fields. However, I recently noticed the power company replacing the cables on a high voltage transmission system with a twisted pair of cables. The top most ground cable is still a single cable, but they now use two cables twisted in a pair for each of the 3 power cables as shown here. Why do they use these types of cables? EDIT: After reading the answers by WhatRoughBeast and Waqar, it would seem that the most plausible explanation for using 2 cables would be current capacity versus weight, but there must be more to it than that. The engineers that designed these transmission systems 30 years ago weren't stupid. They certainly knew about skin depth, and could easily calculate the optimal cable size and number of cables to use. As far as I can tell, this idea of using multiple cables for each phase is relatively new. I recently noticed that in some cases, they use multiple sets of two cables for each phase. <Q> After nearly 2 years, I found the answer to my question. <S> I recently walked past an electric utility's storage yard and noticed this reel of twisted pair cable. <S> The manufacturer is Southwire Company of Carrollton, Georgia and the cable is called VR2, Vibration Resistant Cable. <S> Their web page says VR2 uses a twist to provide resistance to Aeolian vibration and ice galloping. <S> Since I had never heard of Aeolian vibration, here is <S> a quote from this article titled: "Aeolian Vibration Basics" en-ml-1007-4aeolianvibook-1.pdf When a smooth stream of air passes across a cylindrical shape, such as a conductor or OHSW, vortices (eddies) are formed on the leeward side (back side). <S> These vortices alternate from the top and bottom surfaces, and create alternating pressures that tend to produce movement at right angles to the direction of the air flow. <S> This is the mechanism that causes aeolian vibration. <S> Here is an example of an Aeolian Vibration Failure. <S> Here is <S> a YouTube clip showing these vibrations. <A> At a guess, they're doubling the current capacity of the lines. <S> If, instead of a pair of wires, they had used a single wire 40% thicker, the wire would have been noticeably stiffer and harder to spool and unspool for transportation and installation. <A> One possible benefit is reduction of corona discharge. <S> This article states, The electric field gradient is greatest at the surface of the conductor. <S> Large-diameter conductors have lower electric field <S> gradients at the conductor surface and, hence, lower corona than smaller conductors, <S> everything else being equal. <S> The conductors chosen for the Calumet to the line were selected to have large diameters and to utilize a two conductor bundle. <S> This reduces the potential to create audible noise. <S> In my country it is common to see four 'bundled' conductors per phase with 'X' spacers at intervals between the pylons to maintain the desired separation. <S> This article from India gives some details on the technique. <S> The OP's conductors are in contact but perhaps there is still some benefit. <A> There are a lot of advantages for doing that <S> As @WhatRoughBeast said, current capacity. <S> For same amount (and hence weight) of conductor. <S> As you know AC currents flow closer to surface in a conductor than flowing evenly in each part (Skin effect), so one thicker cable will be loss of metal on the inside. <S> Heard of solenoids? <S> This twisted conductor pair creates a similar effect (although not exact because twists are not exact close circles) and keeps magnetic field induced at minimum outside of pair. <S> More twists/inch are better for field cancellation but increase the current path length (and so heat losses) so a trade off is done. <S> Top ground wire is for protection and most of the time no currents are flowing through it. <S> (Generally speaking, they use a delta circuit for HV lines) <S> So no need to replace it.
| The reason they're twisted is not for reasons of noise susceptibility or anything like that - it's to provide mechanical support for the wires, and makes the pair stronger than they would be if they were not twisted together.
|
Why does old PIC draw too much current? I pulled an old PIC from the PIC24 family out of storage, probably last used about a year ago. I reprogrammed the device with a bare minimum program. It seems to work fine on all counts except that it pulls 55 mA from the Vdd pin and the current exits through Vss. All other pins seem to draw current in the uA range. No peripherals are enabled Input pins are not floating Output pins are not drawing current This current draw is way out of specification for this device which should draw about 2mA. What would cause such high current to be drawn on a device that is otherwise operating normally? <Q> You say that 55 mA is "way out of specification", but you provide no evidence of that. <S> It seems to me you haven't bothered to look in the datasheet. <S> You also haven't said which PIC 24. <S> I grabbed a random PIC 24H datasheet and looked up Vdd current. <S> The PIC 24HJ12GP201, for example, can draw up to 90 mA at 3.3 V and 25 <S> °C when running at 40 MIPS. <S> 55 mA is therefore not at all obviously "way out of specification". <S> READ THE DATASHEET. <A> You actually don't know whether the chip operates normally, because the space of functionality of what the chip can do is quite large; you have not executed an extensive test suite of all its functions. <S> What can be said is that it works normally for your "hello, world" test case that you're running on it. <S> It does sound like some area of the silicon is leaking a lot of current through. <S> It could be some on-chip peripheral, for instance. <A> This is less than 1/4 watt at 3.3V. <S> If the chip is operating at a high speed, performing even seemingly simple calculations, and no power saving measures are enabled, then a 24 series PIC processor can certainly dissipate a quarter watt running around in circles. <S> If you provide the chip part number, the program, and schematic, we might be able to identify specific reasons it's consuming more than the 2mA you expect. <S> If you want to investigate further <S> Consider replacing it with a new chip and a similar program to compare the two. <S> It may have a MAC and a divider. <S> If your code is exercising these features heavily you'll consume a surprising amount of current <S> Some peripherals consume current when not specifically configured - go through and disable the peripherals and peripheral clock <S> Some older chips had rather high current consumption for certain blocks, like the brownout detector. <S> Disable these in the fuse settings. <S> Perform a complete chip erase and reset. <S> Disconnect any programmers/debuggers to disable JTAG and related blocks. <S> Ensure inputs aren't floating - even though the risk of damage is all but gone these days, floating inputs can draw significant currents operating in the linear region.
| The IC has many circuits on it that are connected between VDD and VSS; if some of them leak, that might not impair the chip's ability to be programmed and to execute a "hello, world" program.
|
"If an antenna can transmit, it can usually receive as just as well" Scenarios So, I set up an induction loop, just a simple single wire loop around a house with a little pickup coil for picking up the loop audio. Lets say I want to run this in REVERSE I have heard "If an antenna can transmit, it can usually receive as just as well". I hook up the amplifier to the loop around the house, and all I hear is 60hz HUM , and when I play audio up to the little pickup coil, i don't hear anything through the amplifier, just 60 hertz. Can I indeed run an induction loop in Reverse, or not? Second Scenario When hitting an Amateur Radio repeater, I sometimes can hear it full quieting, but when I transmit, they can't hear me. So is "If an antenna can transmit, it can usually receive as just as well" True? <Q> The thing you're missing is that all other things must be equal. <S> This includes the transmitter power, receiver sensitivity, noise and interference levels, etc. <S> In the case of your inductive loop, the large transmitting coil is much better at picking up the ambient 60 Hz field than the small receiving coil is, so when you use the transmitting coil as a receiver, the signal to noise ratio is vastly different. <S> In the case of your repeater, your transmit power is significantly less than that of the repeater, while the receiver sensitivities are probably very similar. <S> Therefore, you can hear it even if it can't hear you. <A> Reciprocity is one of the most useful (and fortunate) property of antennas. <S> Reciprocity states that the receive and transmit properties of an antenna are identical. <S> Hence, antennas do not have distinct transmit and receive radiation patterns - <S> if you know the radiation pattern in the transmit mode then you also know the pattern in the receive mode. <S> This makes things much simpler, as you can imagine. <S> Taken from here and note that the send or receive patterns for a big loop and a small loop are massively different. <S> You are citing reciprocity but you are not applying it correctly - <S> these are two different scenarios. <S> Your big induction loop will pick-up 60Hz whether it is transmitting or receiving. <S> When transmitting, the 60Hz in the loop is of no consequence because your amplifier is pumping out amps and defeating this current on all fronts. <S> Your little receiver coil is also picking up 60Hz <S> but the magnitude of the magnetic signal from the big loop is overcoming the 60Hz it picks up. <S> On the other hand, when you are transmitting on the small loop, you are generating only a fraction of the flux you generate with the big loop. <S> This means the voltage induced into the big loop has to be amplified significantly more than the small loop. <S> Also, because most of that big loop isn't magnetically coupled to the small loop, the background noise it picks up can be massive. <S> This is not true when the big loop transmits - all of the small loop is "bathed" in flux from the big loop. <A> You have two issues there: <S> You are picking up a wide frequency range, including 60 Hz, where you can hear the electromagnetic waves emitted by the power lines in your house. <S> Your induction loop runs in parallel to the horizontal distribution to your outlets, so it is bound to pick that up easily, and at a power level greater than other transmissions. <S> If you amplify this and output to a speaker, you will hear the dominant frequency. <S> To extract the other frequency components, you need appropriate filters. <S> These can be either analog or digital if you use an ADC to sample the data. <S> As you have a dominant interferer which would easily saturate your ADCs before it could pick up the other signals with good quality, analog is the way to go here, for example a high pass filter. <A> "Usually" is an unnecessary hedge . <S> Reciprocity implies that an antenna works equally well in either direction. <S> I'm not going to summarize the proofs here, Wiki has it all.
| Yes, it's true; it's known as the principle of reciprocity .
|
Given metal dimensions and material, is it possible to determine the maximum current that the structure can handle? [semiconductor processing] I have a linewidth structure that has very low resistance. I want to know the maximum current that this structure can handle. Since the resistance of the metal is so low, it's hard to measure the voltage drop. We can't change the size of the structure (as it's on all our masks and we're also limited in real estate) and we can't increase the voltage resolution of our tester (without sacrificing capacity or spending money). So the only solution that I can think of is to increase the test current. I've been searching for an equation or series of equations that will tell me at what current the structure will break (like a fuse). I'm sure that, given the structure dimensions (LWH) and the material parameters (resistivity, thermal conductance, etc), this or other similar equation exists. However, I can't seem to figure it out... And then, to make things more complicated, I'm pulsing this current with a pulse width <= 100ms. It's normally only a single pulse, so a duty cycle doesn't make much sense. Thanks, <Q> Well, there are papers out there such as this one that predict the fusing current limits. <S> The current limits set for normal long-term continous operation of ICs are not limited by fusing current, but by electromigration, so they'd be pretty conservative. <S> You could also just sacrifice a few samples to determine what the limits are empirically. <S> I'm not sure this will lead to the results you <S> want- <S> whether it's aluminum or copper or something else, the metal is going to have a significant temperature coefficient , and if you're pulsing it <S> so it heats up by hundreds of K <S> , how will you separate the temperature effect from the room-temperature resistance? <S> I suppose if you had enough points you could extrapolate a curve back into the grass where the temperature change is minimal. <S> I know every problem doesn't have a circuit design as the solution, but could you just make a preamplifier for your tester? <A> Once you know that, from the line dimensions you can compute resistance. <S> Copper, for instance, has a resistivity (rho) of \$1.68 \times 10^{-8} \Omega m\$. Pouillet's Law says \$R = \rho\dfrac{L}{A}\$, where L is length and A is cross-sectional area. <S> If you want to determine melting current, you have to factor in thermal capacitance and resistivity thermal coefficient, but to a first order this is fairly straightforward, particularly for very short pulses, where there is little time for heat to diffuse and/or radiate away from the hot spots. <A> The maximum current for a given metal structure in an integrated circuit depends on many factors such as conductor material, geometry, dimensions, temperature, target product life time. <S> While you can easily make a hand estimation for the resistance of a given structure it's not so easy for the maximum current. <S> This is why you can find this information in the design manual of your semiconductor process . <S> Usually you will find a realtion between current density and life time <S> (higher current decreases circuit life time) as well as an absolute maximum current.
| If you know the metal composition, you can easily find the bulk resistivity.
|
Why almost all decoder zero selected output? I have decoder IC 74138 and I found almost all decoder make selected output low (0) and I want it high (1) and I don't want to connect NOT gate to all of the outputs (it is illogical). What should I do to make output high? Or is there any way to use this one without buying a new non-inverting decoder? If there is not what type of decoder should I buy (IC number)? <Q> It is natural for TTL to use active low signaling. <S> This is because of its polarity asymmetrical nature. <S> Low output drivers are typically stronger than high output drivers. <S> Also unlike CMOS, TTL input switching voltages are much close to 0V than Vcc. <S> Furthemore, you ca directly tie logical input to 0V, but not to Vcc, you need a resistor there. <S> This cause open-low outputs are much more common than open-high ones (I cannot remember single chip with them). <S> While it is better in many cases driven wire correspond to active state (e. g. for Wired-OR and hot plug) it is better to have low state as active. <S> So it is natural when designing TTL circuits to have active-low signalling. <S> If you still want design active high circuits you should look toward CMOS (4000 series chips): 4028, 4514, 4555 are decoders with active-high outputs. <S> Also there 'migrated' chips like 74HC4028 which are (TTL-compatible) copies of corresponding CMOS circuits. <A> TTL (and therefore 74S, 74L, 74L LSTTL and 74HC CMOS) decoder outputs are typically active-low. <S> The reason (which is the question in your title) is not completely obvious to me, but were I to speculate I might point out that it is somewhat arbitrary for normal push-pull outputs, and may be related to the way the ancients would "wire-or" open-collector outputs (eg. 7405 and 7438), implying an active-low. <S> If you're driving a 7-segment display, you probably want a BCD-7-segment decoder such as a 7447 or variant, or something from another family. <S> The outputs of this chip are indeed active-low, so you'd connect the anode of a common-anode display to the supply voltage (+5 typically) and each output to a segment (through an individual current-limiting resistor, of course). <S> Each "low" output results in the respective LED turning "on". <S> If you happen to have a common-cathode display, all is not lost, you can use a part such as 74HC4511 , which has active-high outputs. <S> I recommend this part, as it's likely to be around for quite a while longer. <S> it's very loosely guaranteed, so this is a bit risky, and the part may be hard to find). <A> what should i do to make output high? <S> Use a 74HCT238. <S> This is a pin-for-pin substitute for the 74138 and has the active high outputs you want. <S> It may be possible to find surplus sources of the 74LS238, if you're really keen on sticking with "real" TTL, but frankly I doubt it's worth it. <S> Your call, though. <S> As to your title question, the answer is that the original TTL family and its bipolar offspring (7400, 74LS, 74S, 74AS, 74ALS, etc), all used totem pole outputs - see page 2 of http://ee.hawaii.edu/~sasaki/EE260/Labs/Datasheets/7400.pdf <S> In this configuration, the lower NPN transistor can sink more current than the upper transistor can source, so active low is the preferred output. <S> Furthermore, the heart of the input is a multi-emmiter NPN, and this works faster for low inputs than high.
| You could also use the 74LS48 (link with 7447 above), which has active high outputs and internal 2K (nominal) resistors to directly drive a common-cathode display with no external resistors (brightness may vary too much to be acceptable between adjacent digits-
|
Is a full-wave rectifier really required with a 7810 regulator? I'm possessed of a 12-0-12 500mA transformer. To supply a stable 10V, I seek to connect a bridge rectifier, roughly filtered with a 1000uF/50V electrolytic capacitor and a 7810. Is a bridge, or even a FWR really required with the 7810? Is the 7810 capable of handling the pulsed output of a HWR? <Q> In this situation: 12 V at 500 mA: <S> After HWR (half-wave rectification) <S> the peak-to-peak voltage is \$12\cdot \sqrt{2} - 0.7 <S> = 16.27\,\mathrm{V}\$. <S> The 10V regulator needs a voltage greater than 12.5V to work, so the maximum ripple shouldn't exceed 3.77V. <S> This means that the capacitor value should be: <S> \$C = \dfrac{I}{fV_p} = 2650\,\mu\mathrm{F}\$ minimum. <S> But with a center tap transformer you can use this kind of full wave rectifier (not bridge!) <S> : <S> Source: Wikipedia - Center tap <S> So the minimum value capacitor has the same value because the maximum available current and frequency are double now. <S> But if you only need max. <S> 500 mA a capacitor of minimum \${2650 / 2} = <S> 1325\mu \mathrm{F}\$ will be enough. <A> The 78XX regulators do not specify the input waveform shape. <S> For their regulation to work, the input has to stay within a certain range at all times. <S> In a nutshell, the input to a 78XX regulator should be regarded as "possibly ripply DC", where the ripple is such that the voltage stays within range. <S> This requirement actually rules out the use the raw output of a without any reservoir capacitor, because such output periodically drops to close to 0V. <S> (So no, the rectifier cannot handle the pulsed output of a HWR, nor the more frequently pulsed output of a FWR!) <S> The actual waveform that is usually input into a 78XX is substantially smoothed by the reservoir capacitor, such that it is DC, with a small amount of ripple. <S> If a half-wave rectifier is used, the reservoir capacitor simply has to be chosen large enough (with respect to the current draw from the regulator) so that the voltage never drops too low, keeping in mind that the capacitor only charges at half the duty cycle compared to a full wave rectifier. <S> For the 78XX regulators, "too low" means: less than about two and a half volts above the output voltage. <S> For instance, for a 7810, the input voltage should not drop below around 12.5V at any time. <S> There are some simple calculations to determine the size of capacitor needed. <S> It is also not difficult to determine by simulation, or to determine empirically (trying different capacitor values, while observing the behavior of the recitified and smoothed voltage with an oscilloscope). <A> If you use a half-wave rectifier and your output current is limited to about 140mA <S> you should almost be okay <S> (that's limited by the transformer winding rating of 500mA). <S> Nominal peak output voltage is \$12V \times 1.414 - 0.8 <S> = 16V\$ <S> Allow 10% for line voltage drop (not a lot), and you have 14.4V. <S> Allow 2.4V for the regulator to work (conservative at 140mA), and you have 2V for ripple. <S> If your mains frequency is 100Hz, the ripple will be \$\dfrac{I_{out} \times 0.01 \,second}{C}\$ or 1.4V peak-to-peak. <S> That's perhaps okay, <S> but I'd like to see more margin for brownout on line voltage. <S> Using a full-wave rectifier (four diodes and half the winding) would add another diode drop and only use half the secondary, so it's a lose-lose proposition.
| Using a full-wave rectifier (two diodes using the center tapped winding) would be better (still only a single diode drop and half the ripple).
|
Why use asymmetrical capacitor values for crystal? Are there any circumstances where you would want asymetrical load capacitors on a crystal? I came across this schematic in the documentation for an NXP UART. It looks just wrong to me. Can anyone tell if this is a typo, or if there is a reason behind it? NXP Uart Documentation (see Fig 11 on page 18). Here's the schematic at issue: <Q> The real question is why would you think that the two capacitors need to be the same, which implies that they serve the same purpose? <S> Often we do see them the same. <S> That's the coincidence you should be asking about. <S> There seeems to be a lot of religious beliefs and so-called "rules" out there for crystal capacitors, but none of those are substitutes for actually understanding the issues. <S> I have discussed these issue a number of times here already. <S> See: https://electronics.stackexchange.com/a/17894/4512 <S> https://electronics.stackexchange.com/a/16025/4512 <A> I am not smart enough (yet) to summarize the information in the following links, but the information in there is pretty interesting. <S> I have to admit, I never really thought or cared about the crystal or how it works. <S> http://www.crystek.com/documents/appnotes/Pierce-GateIntroduction.pdf <S> http://www.crystek.com/documents/appnotes/PierceGateLoadCap.pdf http://www.foxonline.com/pdfs/xtaldesignnotes.pdf <A> According to the Atmel application note below, the unbalanced capacitor load on the crystal can make it less sensitive to noise locking it up. <S> The downside is that it changes to duty cycle and resonant frequency of the crystal. <S> The application note has more detail. <S> Atmel AVR042: <S> AVR Hardware Design Considerations [APPLICATION NOTE]
| The two capacitors serve different purposes, and you also have to consider other impedances in the circuit, not just those of the capacitors.
|
What is a good lab surface to hot-air rework on? I have been scouring the internet for information regarding what would be a good surface to do hot air rework on. Right now, my lab, if you want to call it that, is a wooden bench with cardboard surface...not the greatest. I recently got a hot air rework station to do some awesome SMD work but considering it gets so hot, I'm worried that my workstation will spontaneously combust. At previous employments and labs, there were ESD mats that we'd used. Considering those are pretty expensive, what would be a suitable affordable solution? <Q> Use a 12" x 12" ceramic floor tile. <S> It will cost you less than one US dollar <S> but if you want to splurge you can spend another dollar and buy some small stick on rubber feet for it. <S> Any ESD mat isn't necessarily going to hold up against the heat. <S> You need a high temperature version if you're going to be using a hot-air rework station. <A> An ESD mat. <S> The expense is worth it. <S> You don't have to purchase a large roll; there are many suppliers from whom you can get 16x24 or 24x36 inches, such as Desco , for $30-60. <S> Failing that, I would recommend going to your hardware store and purchasing a piece of MDF (medium density fiberboard) as a work surface. <S> It's smooth, can take some abuse, and is easily and cheaply replaceable if you damage it. <A> <A> I use this very inexpensive tool: http://www.banggood.com/Fixture-Motherboard-PCB-Holder-For-Mobile-Phone-Board-Repair-Tool-p-928075.html?rmmds=myorder <S> and it makes a world of difference! <S> I screwed it in to a piece of 2x4 for stability. <S> For larger boards I bought also this station: https://www.amazon.com/gp/product/B00Q2TTQEE/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 , but did not use it yet - my boards happen to be quite small :) <S> Small PCB holder Holder for larger PCBs
| you can use silicon rubber mats what you use for baking to protect you workbench surface quite cheap to buy from most home stores
|
Driving TEC below rated voltage Can a TEC driving IC such as the MAX1979 rated for TEC voltages up to 6V be used to control a 12V TEC - can TEC work under their rated voltage, with the amount of heat moved controlled by current, or would the colling performance be greatly diminished at lower voltages? <Q> As rough approximation, TEC's heat transfer is proportional to its current, but ohmic self-heating is proportional to square of current, so at lower voltages TEC produces less own heat per unit of treansferred heat, so it is more effective at lower voltage. <S> Thus, it is better to drive TEC with variable voltage/current to control its power than use PWM. <S> But TECs have relatively high thermoconductivity, so in some circumstances smaller (and less powerful) <S> TEC is preferred in order to reduce thermoconductivity losses. <A> Assuming TEC , Thermo Electric Cooling <S> then yes you can, the performance is obviously affected, The datasheets often show this variation in performance. <S> Performance is a function of voltage which controls the current just like a resistor. <S> and the reverse is true. <A> TEC-12706 has high efficency when curent is 3.5A,TEC-12706 has max rate when curent is 6A.Diffent <S> TEC has diffient efficeny,I will do experiment to prove it. <S> Use 40 <S> *40*40mm square Cu,and TEC-10A tec driver,10ohm <S> 50W resistor,use max 30v 3a power supply heat resistor,then test the curve, <S> x-axis is resistor power,y-axis is TEC power rate,the curve is very intresting.if <S> you want the result,please leave your email below.
| TEC performance is pretty good in low voltages due to lower ohmic losses.
|
Is it better to route a pad to a trace, or a trace through a pad? When routing a PCB, is it better to route a trace through a pad as in 1 below, or to route a pad to a trace as shown in 2 below? <Q> Electrically, there is no differences. <S> Well, in fact there are some... <S> But only when considering very high frequency signals. <S> If the passive element is a decoupling capacitor, your solution 1 will looks like this: simulate this circuit – <S> Schematic created using CircuitLab L1 and L2 represent the little inductors made by the routing tracks themselves. <S> You can see that the capacitor is connected directly between L1 and L2, without (or more precisely "negligible") inductance. <S> The decoupling will be good. <S> (even better if L2 is very small by putting your decoupling caps very close to the load). <S> But using routing option 2: simulate this circuit <S> The little extra routing track forms an added inductor (L3) between the decoupling caps and the load. <S> Thus your decoupling would be worse rejecting very high frequencies. <S> It worth nothing to mention that there is also an unwanted inductor at the GND connection of decoupling caps. <S> This should be as small as possible too. <S> There is another reason: Reflow soldering. <S> Your component has to be "thematically balanced". <S> I mean that your footprint has to look symmetrical. <S> Thus it will heat-up evenly during reflow soldering and your component will not rotate or just move due to surface tensions into the liquid solder. <S> Imagine that the solder paste get liquid on one pad when it is still solid on the other, because of thermal imbalance on the footprint: The component may move and end up soldered at one pad only. <S> (see picture) <S> If both pads were routed using your option 1, this is not symmetrical in the X nor in the Y direction. <S> But if both pads were routed using your option 2, this would have been perfectly symmetrical and this is good. <S> In that point of view, everything that is symmetrical (in X and Y) is good. <S> (there are other thing to consider but I will deliberately omit them here, because it would be out of scope) <S> I would finish by saying that these things are becoming critical only when considering mass production and relatively high quantities. <S> Reaching thermal balance on your footprints may reduce by some percent the number of badly soldered components. <A> In the rather obscure field of designing zener barrier circuits (for intrinsically safe equipment), option 1 would be the preferred solution because if a zener diode became disconnected by a PCB track break, then the output of the "barrier" would naturally be disconnected from the potentially dangerous input voltage i.e. it is fail safe: - simulate this circuit – <S> Schematic created using CircuitLab <A> If you need to split a trace to two different locations, do it from the pad. <S> I prefer option one, with one modification. <S> Make each trace meet the the pad right on the corner. <S> Personally, I like the nice smooth 135 degree pad to trace angle, but more importantly, having 45 degree angles between copper features is asking for etchant traps. <S> Meaning that in the etching process, acid gets caught in the acute angle, and continues etching unpredictably. <S> The boards will test fine in the manufacturing process, but there will be random failures in the field. <S> The way to prevent it is keep all angles greater than or equal to 90 degrees. <S> PCB manufacturers have better control over this than they once did, but for high reliability and long service life products, it's a chance not worth taking. <A> But when space is tight I will switch to the 1st version, although I would prefer to avoid that sharp angle. <A> I think that's quite personal (I prefer the second solution) <S> but there are some objective differences. <S> Option two might be better because soldering on that pad is somewhat easier since the thermal resistance to a bigger thermostat is double the first solution resistance. <S> If you are soldering by hand that might make a big difference. <S> Moreover excess solder can be swept easily away in solution 2, while in solution 1 that's somewhat more difficult. <S> That's particularly true for SOIC or similar SMD chips, if your trace comes out at an angle it might be very, very difficult to solder them by hand. <S> I bet there are other issues, I'm sure somebody around here can add a lot <S> , that's just my two cents. <S> Anyway, as I said, I find option two a whole lot neater than one.
| To add my E 0.01: For a prototype I prefer (for all other things the same) the 2nd option, because it makes it easier to cut the trace to the component and make some other connection to it.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.