source stringlengths 620 29.3k | target stringlengths 12 1.24k |
|---|---|
PullUp and PullDown Network in CMOS How exactly pullUp and pullDown Network in CMOS should be defined... I mean why "PullUP" or "PullDown"? And why PMOS in pullUp network and NMos in Pulldown network?Why not Pmos in pullDown and Nmos in PullUp? <Q> Pullups pull the voltage up towards more positive values, and pulldowns pull the voltage down towards more negative values. <S> P E MOSFETs have a negative threshold to turn on, so putting them in the pullup role means that they will conduct when their gate voltage drops, and vice versa for NEMOSFETs. <S> Putting them both in series in the same circuit and tying the gates together results in a natural inverter. <A> PullUp and PullDown Pullup - a network that provides a low resistance path to Vdd when output is logic '1' and provides a high resistance to Vdd otherwise. <S> What if PMOS is used in pullDown and NMOS in PullUp? <S> If we use PMOS in pull down network, then its gate terminal should be provided with a negative voltage. <S> Similarly if we use NMOS in pull up network, then its gate terminal should be provided with a voltage that is more positive than Vdd. <S> So the voltages corresponding to logic states at input are different from that at output. <S> Hence two such 'CMOS' gates can not be interfaced directly. <S> In other words, \$V_{OH} < V_{IH}\$ and \$V_{OL} > V_{IL}\$ which will result in negative noise margin. <S> And hence this logic family would be incompatible with itself. <A> The basic reason is similar to using an NPN verses a PNP transistor. <S> In a simple approximation the PMOS and NMOS parts work by shorting the Drain and Source pins, when the Gate voltage is satisfied. <S> For NMOS the Gate is satisfied when it goes high. <S> For PMOS <S> the Gate is satisfied when it goes low. <S> (In relation to the Source pin) <S> For a NMOS part the Source pin must be connected at the low level, so when turned on the Drain pin can only "pull down" to that same low level. <S> For a PMOS part the Source pin must be connected at the high level, so when turned on the Drain pin can only "pull up" to that same high level. <S> When you have one NMOS and one PMOS connected in a push-pull arrangement, (Gate to Gate, Drain to Drain, one Source at high, and one Source at low), putting a square wave onto the Gates will give a similar square wave (a pull up then a pull down) on the Drains.
| Pulldown - a network that provides a low resistance path to Gnd when output is logic '0' and provides a high resistance to Gnd otherwise.
|
How to implement 8-bit 2:1 multiplexers on a PCB? I need to implement a 2:1 multiplexer for 8-bit data. That is: as inputs it should take two 8-bit numbers and a Select line; and as output an 8-bit number. I could use two 74HC(T)157 s (this is a quad 2-input multiplexer), however, because of its pinout (see below), implementing an 8-bit 2:1 multiplexer would cause a mess on the PCB, and I will probably use several multiplexers in this project. What is the common way to implement more-than-one-bit (2:1) multiplexers on a PCB? Are there readymade ICs for this (I couldn't find them) or is there a way to keep the PCB uncluttered? Since I will be home-etching the prints I'm unfortunately rather limited to one layer. The final project should be a home-made CPU of discrete components (really). This is the pinout of the chip I mentioned. For example, 1I0 and 1I1 are inputs for 1Y. S is the common selector. <Q> The 74HC298A is more expensive (Digikey has it for $5.81, while the 157 is around $0.70) <S> but it was designed for 4-bit data lines (instead of 4 1-bit data lines), so it has a much friendlier layout: <S> You may be able to route the traces for input 2 upwards and squeeze C1 between D1 and D2. <S> With some luck, this might extend to two of these side-by-side. <A> First, presumably you've already looked at assigning channels by geometric convenience rather than number and decided that doesn't solve your problem. <S> A CPLD could give you a lot of pinout flexiblity, but perhaps would be "cheating" by your goals (though there were board-level mainframe CPUs that used early PALs). <S> On the novel front, if your delay budget is generous an (E)PROM loaded with a suitable truth table to use address lines as channel and select inputs could be a solution. <S> Perhaps you are already using something similar to hold a table for instruction decode or even microcode. <A> How about a pair of 74LS541s? or 74LS245s? <S> May depend on precisely how you are driving them, they're both cheap enough. <S> I believe you're doomed to a set of jumpers either way. <A> Probably the best alternative you will find is a sn74LS399. <S> But to be honest, you should just do two layers. <S> You are going to have serious issues getting power and ground to all of your chips with a 1 layer. <S> It isn't that hard with home etching, just be careful with lining everything up. <S> There are a lot of examples online of how to do this.
| A more off-the-shelf solution might be to use tri-state buffers on each side, with only one enabled at a time, or even at an extreme, open-collector logic gates and a pullup.
|
Do standard white LEDs produce a full spectrum of light? At places like Radioshack, small (and sometimes large) LEDs are available that are labeled to be "white". This is a link to a Radioshack page for such an LED: http://www.radioshack.com/5mm-white-led/2760320.html#q=white%2Bled&start=2 Does a light like this produce a full spectrum of light, such that appropriate light filters could produce any spectrum of visible light? <Q> @Shamtam have already commented that: (1) the light from a typical while LED doesn't match the spectrum of the sunlight (2) <S> white LEDs are blue LEDs with additional phosphor <S> This is to expand on @Shamtam's comment. <S> Spectrum of a white LED showing blue light directly emitted by the GaN-based LED <S> (peak at about 465 nm) and the more broadband emitted by the phosphor. <S> (source: Wikipedia ) Diagram of the spectrum a LED lamp (blue), a CFL (green) and an Incandescent (purple) superimposed the solar spectrum (yellow). <S> Note that the energy used by each lamp is at least the area underneath its curve. <S> ( source ) <A> Quick answer - Shantam to the contrary, yes. <S> But let me explain. <S> Nick Alexeev provided a spectrum from a typical white LED. <S> While it is not a faithful simulation of an incandescent (the big spike in blue is notable), it does contain all visible wavelengths. <S> Your question asked "Does a light like this produce a full spectrum of light, such that appropriate light filters could produce any spectrum of visible light?", and the answer is obviously yes. <S> If you wanted a predominately green light, for instance, it wouldn't (relatively) be very bright, but you could do it. <S> This is not true for RGB LEDs, which would have very narrow spikes of intensity at 3 different wavelengths, with nothing in between. <S> So, while you could easily produce a subjectively yellow light from an RGB LED source (just transmit red and green in the proper intensities), a narrow-band yellow filter would transmit nothing. <A> White LEDs do not produce a full spectrum, like an incandescent light bulb does. <S> This has to do with the process that produces the light/photons. <S> In an LED, when an electron crosses the PN junction, the electron itself drops to a lower energy state, and the excess energy is emitted as a photon. <S> This voltage drop is basically constant, therefore the energy of the photons emitted, and the color of light produced is basically constant. <S> This is also true of white florescent lights, which depend of three phosphor colors to produce white light.
| If you were to combined three LEDs, such as in an RGB LED, you still would not have a complete light spectrum, but rather three emission lines visible in a spectroscope.
|
Do fuses affect a PC PSU's amperage output? I have a PC PSU powering a load that should pull 20 Amps. I put a 10 Amp fuse in series with the load and the PSU. However, the fuse simply will not burn, and the PSU continues to supply the load, albeit at a weaker output (the load doesn't operate as quickly as without a fuse). Is the PC PSU somehow accounting for the fuse and lowering its output? I'd appreciate any input. <Q> The answer is only very slightly as Ambiorix and PeterJ explains. <S> I have put 20A through a Fluke meter for more than a minute before it blew the 10A protection fuse. <S> (I didn't know the fuse was 10A at the time or that the meter wasn't calibrated for it either ..oops ) <S> There are different fuses but what you find is that a 10A fuse has to last (almost) indefinitely at 10A. <S> The fuse blowing is an exponential behaviour. <S> when you get to 2 times the rated current some fuses last 1 minute or more, at 2.1 time they may last 30 seconds and at 10 times they all react very fast... <S> but it depends on the type of fuse. <A> Virtually all PSUs have an integrated current limiter circuit. <S> This circuit typically reacts much faster than a common thermal fuse. <S> It does not mean that a load that's rated at 20A draws this current under all circumstances. <S> It could well be that this is only in certain modes or at maximum setting. <S> The best way to verify the operation of the current limiter is via a variable dummy load. <S> Measure the voltage over and current through the load and observe the readings when you increase load gradually. <S> If you don't have such a device try finding a load that's confirmed to be below the the maximum rating (10A) and check the readings. <A> This could depend on the fuse characteristics eg fast-acting, slo-blo, hrc, etc. <S> For example, on fuses protecting direct on-line motor starter circuits, the fuse needs to be able to handle up to 10 x motor rating current during inrush (while motor starts). <S> Also the fuse should only be used on circuits with a voltage LESS than the fuse rating. <S> If you put your multimeter in series with the fuse and the load, what current are you reading? <S> Assuming it is 20A or above, that would explain why the PSU output is dropping which will be nothing to do with the fuse. <S> The following may be a useful reference: http://fuseparametricsearchtool.bussmann.com/default.aspx
| The thing to note with fuses is they are thermal devices and take time.
|
Appropriate shapes of an Electromagnet What is/are the thumb rules for determining an appropriate shape of an electromagnet? By appropriate I mean having a reasonable amount of attraction/repel strength towards metal pieces. If I were to bend an existing electromagnet (made out of an iron core wound with appropriate wire) into, say, a heart shape, would it still function? Would different sections of it behave differently (distribution of poles across the heart shaped structure)? <Q> A circular coil shape is the optimum use of wire to obtain the largest magnetic flux. <S> Any deviation from a circle will use more wire for a given coil area and the extra coil resistance can reduce the peak current into the coil or, necessitate more power having to be delivered to the coil to obtain the same current. <S> There is a more subtle effect too. <S> The magnetic field around the areas that form the V section in the heart will be significantly weaker because the wire will have to nip in and out sharply and the magnetic fields will tend to cancel at this point. <S> Having said all of that if you wind a circular coil and reshape the magnetic field into a heart shape by reshaping the iron this won't be such a problem. <A> junk-yard crane elecromagnets are disk shaped cores with the winding in a circular groove. <S> door electomagnets (maglocks) are bar shaped, with a double groove which holds the rectangular shaped winding. <S> The circular shape uses less copper to enclose the same cross-section of corewhich reduces the materials bill and/or by having lower resistance saves power. <A> I sometime feel like a broken record. <S> The force from a magnet will depend on the field gradient. <S> One way to get a big gradient is to bend the two poles of the magnet so they are near each other. <S> Where are the two poles in this video? <S> Try winding a coil around an iron nail, and then bend the nail into "U" shape. <S> Which holds a piece of iron with more force... <S> (for a give coil current.) <A> In a C shape(with the two points being the poles) <S> your flux is at a maximum there, so although you won't get a good average but in the gap and pole points the magnet field will be very strong. <S> The magnetic field will have less distance to travel and have a higher density in that area (flux)
| As long as you can get enough core behind the windings that the core does not saturate any shape of winding will work well.
|
reflection test on coax cable I used a silicon coax cable (characteristic impedance 45 ohms) and sent a square wave with frequency 1 Mhz and amplitude 5V through it. The cable was teminated openly with no end resistance. I could find a reflection in-phase with the input signal. Now i tried to hit the cable in between with a force around 80N so that the cable is deformed. But i dont find any reflection in the area that i tried to deform in the oscilloscope. The reflections are still like before for the open end and every time i bend or squeeyze or deform the cable, i dont find any reflection for that area. Whats going wrong here and how can i have reflections on the cable during impact with an object ? Thanks <Q> I think that the massive reflection from the unterminated far end is masking anything you might expect to see. <S> I also think you might benefit from putting the measurement circuit inside a Wheatstone bridge arrangement. <S> The bridge stimulus will be the driving signal - feed it via (say) 2x 47 ohm resistors to (a) the terminated cable and (b) to a reference impedance to ground. <S> The reference impedance to ground will be 45 ohms (possibly adjustable to compensate for the basic cable being a few ohms different). <S> Use a differential amplifier to measure the difference voltage between what is applied to the cable (via one 47R) and what is applied to the reference resistor (45R) by the other 47R. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> With a perfect far-end termination and perfectly homogeneous cable, there should be zero signal from the difference amplifier. <S> Deforming the cable should produce a small reflection and this should be detectable. <A> Most coax cable is purposely made to withstand a significant amount of abuse. <S> Most bending and denting will hardly at all result in a measurable impedance change at the abused point. <S> In terms of an impedance change at the "deformed" area, when you deform a round cross-area it becomes oval like, the oval shape thins at two points but also widens at two other points. <S> So the averaged capacitance from center to shield at the deformed point is hardly changed. <S> For the center conductor's inductance, note that you are unlikely to change this as it is very much protected at the center of the material layers. <S> Even when coiled the center conductor does not see (magnetically) <S> the other close conductor loops due to the shielding. <S> You might test this by running the reflection test while slowly crushing the cable in a strong metal twist clamp or vise. <S> You will likely find that the cable needs to be significantly crushed before seeing a reflection. <S> If the need is to create a cable that detects a mechanically altered point try using a simple piece of flat cable. <S> On it's own a conductor in this type of cable <S> is only partially shielded by the nearby conductors. <S> A sharp bend or other damage to this type of cable may be much more detectable. <S> Using two or more flat cables laying over each other might make an even more sensitive detector of a point that is being crushed or abused. <A> You can't see anything because the signal you're using is not suitable for reflection measurements. <S> Generally, for manual measurements you don't want more than one stimulus pulse present inside the length of your conductor and time between pulses must be sufficient for all reflections to die off. <S> A squarewave would be a poor choice here. <S> Imagine yourself shouting in a canyon and hearing the echo. <S> Now imagine another thousand people doing the same while standing next to you - will you be able to recognize your own echo? <S> To better understand what is happening take a look at pics below - I took them while fixing a sampling head in my TDR. <S> This instrument generates its own stimulus signal with ~25 <S> ps rise time <S> ~300 ns wide with rep.rate of 1 KHz. <S> Note the time scale. <S> This is the DUT. <S> It is a sampling head of the TDR - the device that "sees" the signal. <S> Upper right connector has bad contact inside the head. <S> All connectors SMA. <S> That's how the stimulus looks like when 50 ohm terminator is placed on the connector. <S> You can see the step traveling a short distance inside the head ( horizontal section at the third division ) before being reflected. <S> That's the same signal but now the terminator is removed. <S> You can now see more reflections coming from the open end of the head. <S> They are travelling back and get reflected again. <S> Now, this head was specifically designed to dampen those reflections and when you use some general purpose input like an oscilloscope you'll get many more of those. <S> The signal after the head has been fixed. <S> You can now see the small reflections from mating surfaces of the connectors getting smaller and smaller as time passes. <S> That is what you will see when the cable you're studying has some non-uniformity caused by mechanical stress. <S> The signal will be quite small and in order to see it you want it to be clean. <S> Before continuing with reflectometry build a source of fast risetime pulses. <S> Any general purpose transistor driven to avalanche will give you better than 1 ns.
| If you start to abuse the cable to the point where the conductive shielding becomes significantly damaged or cut then that should begin to produce a measurable reflection. No large reflection can be seen anymore.
|
Does it make sense to power multiple 12V devices from one single power source? I have a number of devices (External hard disks, switches, router) on my desk. Each ones comes with a own power supply. This leads to a waste of space and a mess with all the cables. Does it make sense to power all devices from a single power source? I would simple buy a power supply which provides enough current to power all devices and would connect all the cables to this single power supply. Are there any risks in doing this? Are there important things to pay attention to? <Q> The idea has reasonable merit. <S> No utterly major show stopper but things to think about. <S> The arrangement is non standard. <S> These MAY vary between devices. <S> You could always replace plugs that do not fit your standard but this is annoying at least. <S> You still need all the cables. <S> With mains feed to plug-packs you can cluster the groups of packs but with your scheme all power cords must reach your hub. <S> You could have sub-hubs but then risk voltage drop due to extra cabling - voltage drop is higher at low voltage for the same power. <S> As PlasmaHH says - adding single point failure mode is undesirable. <S> Worse, as he also notes, if the psu ever went high-output you could have <S> a grand Y'All come peripherals barbecue. <S> Or worse. <S> I have about 20 x 12V devices in use here - mostly multi Terrabyte hard drives. <S> A substantial open cage supply may be rated at 12V, 250 Watts - or about 20A. Many devices use a 1A x 12v supply but some use 2A or 3A supplies. <S> So in my case I'd need at least 2 x 250 W supplies. <S> YMMV. <S> I have never had a plugpack fail in my "hive". <S> I have shelves of external drives or other equipment with plug-packs on a lower shelf close to their drive. <S> Cords can be neatly tied. <S> Various spiral or apparently spiral plastic sleeves can be bought to tame the wires. <A> For 12V distribution, automotive cigarette lighter jack may be appropriate; and for 5V, you have USB. <S> I have a power brick that takes mains input and gives me <S> regulated 12V with a standard automotive cigarette lighter jack. <S> This makes 12V distribution using one of those 12V distribution hubs for automotive use appropriate for me. <S> My 5V distribution is based on externally powered USB hubs - I have 3 of them, and they actually all connected to my computer. <A> Yes. <S> This is done frequently by the end user in the amateur radio hobby. <S> The only reason it's not done for consumer computer devices is that no one can agree on any standards. <S> However, it's slowly coming around via USB chargers. <S> For instance, I have the following charger: <S> http://www.amazon.com/gp/product/B00OJ79UK6/ Computer peripherals simply use power from USB, and with the new higher power USB standard I expect manufacturers to stop using external power supplies altogether except for unusually high power devices. <S> If you want to do this with 12 volts, I'd suggest following amateur radio suggestions - they won't all apply to your specific needs, but you'll find they have a few standard connector types, power supplies, and fused distribution designs that should simplify it for you. <S> Make sure you are sufficiently fused (ie, you could short out any wire and a fuse would blow long before the wire melted its insulation) and you should be safe.
| You need a 12V distribution hub with appropriate sockets. Some COTS solution may exist and you can work based on those.
|
Is it possible to check an Ethernet twisted pair with a multimeter? It would be useful to measure electrical parameters (such as I,U,R and perhaps L,C or other) at the end of the cable, when the other end is disconnected or connected, and analyze the physical layer of the Ethernet computer network. For example when you occur problems on a network adapter, packet losses, loops or get an electric shock when touch the metal parts of equipment. Some clarifying questions: Is it possible to do this using one or several multimeters? If it's possible then what and where exactly measure (between the wires or pairs of the cable or relative to ground)? Could this give some additional and more detailed diagnostic information about the cable or NIC? <Q> The only thing you might be able to test is the continuity of the cable. <S> If you are attempting to test to see if data can traverse the cable than this is an okay way to test. <S> If you are looking to test data rates, etc. <S> this is not the method you should use. <S> I have also experienced Layer 1 (Physical Layer) issues where the cable was fine but <S> the female port (The jack on your Ethernet card or motherboard) had bent risers that were not making good contact with the Ethernet connector. <S> Other than continuity <S> (Does point "A" have an electrical connection to point "B") <S> the electrical test you would be able to perform with a multimeter would have nothing to do with data rates. <S> PoE testing is best observed at the device, switch, or router because part of the IEEE standard for PoE requires an end-point to negotiate with the end supplying power and no current will be present if you just connect a test lead. <A> To add: <S> Yes, it's possible, but unless the jacks/terminations are in bulk uninstalled state or very close to one another (like same room) <S> you're going to need test leads going between one of your multimeter conductors and and the other end of the cable. <S> Many cheapo "cable testers" do exactly this but they have two seperate ends which don't need to be physically connected to show continuity like a typical multimeter does. <S> Just measure continuity on each conductor, one at a time. <S> Remember that the pins are not straight through: http://www.creativeitresources.com/wp-content/uploads/2014/11/RJ45T568AandT568BPatchCable.jpg <S> No. <S> This will be a very basic, layer 1 troubleshooting tool only. <A> Possible. <S> If the cable in question is structured cabling you may want someone else team up with you to move jumpers at the other end (a pair of good sharp tweezers are good enough as a jumper) and for patch cables multimeters with really thin sharp probes can work. <S> Continuity of the cable. <S> Check if cable is correctly wired as a straight through, and no cable is shorted over. <S> If you have advanced tools like function generator and spectrum analyzer <S> you can try do some high frequency crosstalk tests. <S> If all you have is a bunch of multimeters all you will get is whether the cable works or not. <S> If you have the advanced gear like function generators and spectrum analyzers you can also test the maximum speed the cable in question can carry (e.g. 10BASE-T, 100BASE-TX, 1000BASE-T, 10GBASE-T or 40GBASE-T, at speeds 10, 100Mbps, 1, 10 and 40Gbps) <A> Yes, it is possible to test Ethernet twisted pair with multimeter, but with the multimeter it is very difficult because you need to match your cable end or socket with the multimeter pin. <S> Also it is difficult to maintain proper pairing of the wire. <S> With this device you can also determine length of a cable or distance to a break or problem area.
| There are some best twisted pair testing tools which are used by professionals such as CableIQ Qualification Tester which quickly identifies the cabling problem and also verify wire pairing and detect installation defects like “split pairs”.
|
Solution for "No drop" LDO I have a very noisy 5V supply, the noise is in very low FQ around 1kHz. From all the components In my project there is only one I have to provide with 10Hz - 2kHz clean 5V. But because I need 5V and I only have 5V. I can not just use LDO.So my current idea is to use low noise LDO with boost converter: LT1109 LT1761 simulate this circuit – Schematic created using CircuitLab I'm looking for integration solution and right now I have found only this one: I found this one ( http://cds.linear.com/docs/en/datasheet/3537fd.pdf ) but Rejection Ration of this LDO is disporting + I would not have a way to hand solder it. Any suggestion ? <Q> If you absolutely need 5 V, that is all your input is, and <S> passive series filtering isn't enough, then a boost followed by a linear regulator does make sense. <S> However, there is no point boosting to 12 V if you just want a clean 5 V. <S> There are plenty of LDOs that can work with under 1 V headroom. <S> Boosting to 6 V would provide plenty of voltage room to loose a little due to series filtering, then still provide enough for many LDO's to do their job. <S> That's usually 600 mV <S> or so. <S> It's not hard to find LDOs that work with half that or less headroom. <S> For example, here is a snippet of a schematic from a real product where I employed this trick: <S> The thing controlling the switcher pass element (Q1) compares the signal out of the R4/R6 voltage divider to a internal 600 mV reference to decide if the switcher output is above or below the regulation threshold. <S> Q4 is set up so that it turns on when the "5.6V" line is the B-E drop above the LDO (IC2) output. <S> The reason for scaling the collector of Q4 down with the divider is so that the system doesn't get fooled into thinking it is above the regulation threshold during startup when the voltage is rising and the LDO input might be 600 mV above its output even though the output is not yet in regulation. <S> In that case Q4 still turns on, but the voltage divider prevents the feedback signal from reaching the 600 mV reference until the LDO input is close to full voltage. <S> I've done this a bunch of times, and it has always worked very well. <A> You don't need an LDO if you use a boost converter, but in any case I suggest using two separate devices for this task. <S> There are not many one-device solutions. <S> For example, you could use a DC-DC converter or boost converter to generate 9V or so and use a TPS7A4901 regulator (which does happen to be an LDO) to get the clean DC. <A> Many devices which require "5V" can actually work with a lower voltage. <S> This is commonly used for audio circuits, as many high end converters require "5V" for analog power (e.g. AKM converters ) but in reality, a 4.85V linear-regulated power supply may be used if the 5V is too noisy to use directly. <S> As an example, the AKM AK5552 ADC operates as low as 4.75V and can be paired with a TPS 76248 4.85V LDO . <S> Note that the dropout voltage is < 100mV at 100mA load, so that LDO can easily provide a "cleaned up" 4.85V from 5V USB power.
| This is why there are many "4.85V" or "4.75V" LDOs available with low enough dropout to enable operation from 5V power (such as USB). A trick I have implemented a bunch of times now is to use the B-E junction of a transistor as the threshold detection above a LDO output.
|
uController SPI Over optoisolator I would like to interface Arduino over SPI but need a way to decouple the system with an optoisolator. Any pointers in which optoisolator to get? Everything works on 5V. I've tried to connect with CNY 17-3 but it didn't work.Maybe CNY 17-3 is too slow, or something. Datasheet CNY 17-3 : PS: One more note, I don't need any transfer from slave so only one direction.CS, MOSI, CLK lines are needed. <Q> There are digital isolators from different companies to support your application, but here I feel an important thing OP is missing, what is Insulation Rating(kVrms) <S> you are looking for. <S> Based on the insulation rating Analog Devices link offers you several SPI isolators. <S> TI doesn't have dedicated link for SPI isolators, but the app note on page #5, they explain how to use their digital isolator for SPI. <S> Even you can look in to MAXIM link also for their digital isolator supporting SPI application. <S> There are some more options like IL717 from NVE isolations, link here which talks about using NVE isolators. <S> Even you can look into Silabs, for isolation products, but I am not sure whether they have something dedicated for SPI. <S> Now, the onus is on <S> you decide which isolator you want go with, based on the availability of the product in your region and Insulation Rating and most important factor is the price if you are going for mass production. <S> Hope <S> this helps you to understand the SPI isolator selection in future as well. <A> SPI buses have unidirectional lines. <S> Any good old-fashioned digital optoisolator should do the job, but you need to isolate each line in the appropriate direction. <A> I am using the 4n35 optocoupler for serial and it works well. <S> Check out this question <S> I just asked, is the circuit I am using. <S> Make sure to invert the resistors, because the non transistor inverts the logic. <A> Previously i used avago's hcpl 5Mbd optocoupler series for communicating to cs5463 power meter chip (which is connected to 220v line) via spi lines. <S> These hcpl optocoupler's are very fast but they need vcc.
| Not only Analog devices, you can find digital isolator from Linear Technology . You can certainly use an IC like the MAX14935 , which will do all your lines with one chip.
|
What is this component? D5SV17 What is this component? Can someone link me to an equivalent replacement, haven't been able to find anything D5SV17 <Q> The massive planes and the small tap off of the gate suggest a switching power supply design, so I assumed a power MOSFET. <S> The Q on the silkscreen is another telling sign. <S> This marking chart looks much the same, note the line over the year and week. <S> In addition this pinout looks about right to the usage. <S> The only confusion is the capacitor between gate and source. <S> A little bit of context might help that. <S> Hope this helps. <A> if forced to guess i'd say it's probably a dual transistor with only one half being used. <S> there;s <S> no other way I can explain its use as a 3 terminal device and the capacitor across pins 3 and 4, also Q in the silkscreen suggests a transistor <A> http://www.s-manuals.com/pdf/datasheet/e/m/emd5%2C_umd5n_rohm.pdf
| Possible candidate with a D5 suffix: Rohm General Purpose (dual digital transistors)
|
Floating diode in a Sot23 package I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them. Should I let the second floating with unconnected pin or should I connect it to ground? <Q> If not, I'd short it out lest it act as an accidental antenna/detector. <S> IOW if you're using the BAT54C or BAT54S, use pins 1 and 3 and either leave 2 open or short it to 3. <S> If you're using the BAT54A you can't do this. <A> Yes, you can leave the anode of the second diode unconnected. <S> But, why use a dual diode package in the first place? <S> There are plenty of single Shottky diodes available in small packages. <S> Unless you are using the dual diodes elsewhere in the same design, just use the right part. <A> If it is literally just a 2 diode package the extra diode can float with no ill effects. <S> Any other connection may cause problems. <A> Seems like there is a third option besides floating or grounded, shorted? <S> i.e. connect the anode to the cathode.
| If the common is connected to a low-impedance node you can leave it floating. I'd also suggest using the single out of the pair that would be present if you bought the one-diode version of the 3-pin package (if possible), just for future compatibility.
|
Max voltage vs current for LED There's some basic flaw in my understanding of how LED's or diodes in general work so hope someone can help and forgive the simple question. So generally when one has an LED in series with a resistor, it seems the LED will always have voltage drop corresponding of around 2V (more exact value can be read from datasheet). This means the voltage drop across the resistor will be the voltage drop of the source minus the 2V, and the resistor should be chosen simply to limit the current to, say, max 20 mA or whatever the datasheet says. But the relevant point here is that the size of the resistor won't impact the distribution of the voltage drops (over the resistor vs the LED). The LED has a "hard-wired" voltage drop and the resistor takes the rest. So what if we have a different scenario, where a Zener diode is used to convert the voltage. So in this case, I have a Zener and a resistor in series, connected to the power supply. Let's say the Zener diode is 5V. It's connected "reverse" to take advantage of this reverse breakdown voltage. The resistor is such that the max current drawn can be 20 mA for the whole circuit. The circuit is seen here: The Voltage drop across the Zener should now be 5V (assuming the voltage source has a higher voltage than that) and the resistor limits the current. Now the question is: What happens if I connect an LED in parallel with the Zener, without any resistor? A resistor shouldn't be necessary for current-limiting purposes since the resistor (in series with the Zener) is already limiting the current so we know there's never be an excess current. But since the LED is in parallel with the Zener, the voltage drop across it will be 5V, i.e. higher than before. So this is different from the case before where the circuit ensured the voltage drop across the LED was 2V. Here it seems it cannot do that, because there is only the LED to take the whole voltage drop. Will this setup damage the LED? What value should I look for in the datasheet to find out what max voltage drop I can apply when there's no resistor? In the sheet I have for a typical LED, such a voltage is not listed under absolute max ratings. But I suppose I couldn't just put a drop across 1000V even if I assured the current was < 20 mA? I'm also thinking if the wires will start acting as (small)resistors in series with the LED and somehow take the excess voltage. <Q> The trick with diodes is they have an exponential I-V characteristic. <S> This means that the current flowing through has an exponential dependence on the voltage, and past a certain point very small changes in voltage result in very large changes in current. <S> The resistor basically serves as feedback, relating the voltage and current with a better-behaved linear relationship that is less sensitive to changes in voltage (linear instead of exponential). <S> The exponential characteristic of a diode can be modelled as zero current until a thresold voltage is reached, then a constant voltage drop. <S> Below the threshold, the diode is turned off ('in cutoff'), and above the threshold it will be forward biased. <S> If you put an LED in parallel with a zener diode, most likely no current will flow through the zener diode (it will be in cutoff) and all of the current will flow through the LED. <S> So the circuit will end up stabilizing with 2V across both the LED and zener, but with little current flowing through the zener. <S> You won't damage the LED so long as the resistor limits the current to something the LED can handle, but the zener will do nothing. <A> In your circuit, if you choose the resistor to allow 20 mA through the 5 volt Zener, then connect a 2 volt LED in parallel with the Zener, the LED will hold the voltage down to 2 volts, but the current will be much more than 20 mA, as the resistor now has to drop 3 volts more than in the no-LED case. <S> With the LED there, all the current will flow through the LED, and no current will flow through the Zener, as there will only be 2 volts across it. <S> The LED datasheet will show the typical voltage across the LED with some specified current. <S> Often, there will be a graph showing how the voltage varies with current. <A> The voltage and current across the diode are related in a non-linear fashion. <S> E.g. here is a graph of forward voltage vs current for an LED: <S> A resistor on the other hand would give a straight line starting from 0 with a slope of 1/R. If you put other diodes or resistors in parallel with the diode then you have to solve a system of non-linear equations to get the actual current and voltage drop. <S> Using a fixed forward voltage drop for a diode is just a convenience. <S> This value is either the current at which the forward voltage doesn't change much with increasing current (e.g. in the graph above when the line starts getting steep) or for LEDs, the recommended current for the rated brightness. <S> E.g in the graph above if the current required for the rated brightness is 20mA <S> the forward voltage will specified as 2.0V.
| You could think of the diode as a voltage-dependant resistor. This is because if you try to put more than 2v across an LED (assuming the forward voltage is 2v), you will get a very high current flow (amps, not mA) which the resistor will limit with a large voltage drop.
|
What is the minimum supply voltage for the MC34063E in step-up (boost) configuration? I need help determining the minimum supply voltage specification for the MC34063E in step-up (boost) configuration. I can't tell for sure by reading this datasheet . First, on page 1 they say: Features: ... Operating from 3 V to 40 V Then, in page 7, table 8, under section "Electrical Characteristics - Total Device", which I copy below, they say that the device start-up voltage (\$V_{START-UP}\$) is 1.5V, which is the " minimum power supply voltage at which the internal oscillator begins to work. " I understand that the start-up voltage is not necessarily the supply voltage at which the device starts regulating properly. It's the voltage at which oscillation starts. But then, what's the relevance of this information? Why would I need to know that the device starts oscillating at 1.5V if it is only guaranteed to regulate voltage properly at inputs above 3V? If I apply the lowest possible input voltage (3V), that's already above the start-up voltage (1.5V) so it will get the oscillation started anyway. I understand that this parameter (start-up voltage) is relevant for other devices (such as the MCP1640 ) in which the start-up voltage is higher than the minimum input voltage. That means we must apply the start-up voltage when the device is initially powered on and then its input voltage may be lowered. The specs for the MCP1640 are: Low Start-up Voltage: 0.65V Operating Input Voltage: 0.35V But that's not the case for the MC34063E. Its start-up voltage is lower than its stated minimum input voltage: Start-up voltage: 1.5V Operating from 3V My interpretation is that minimum supply voltage for the MC34063E is really 1.5V and not 3V as stated. Is that correct? My question is: What is the minimum input voltage for the MC34063E to operate within its specifications in the step-up (boost) configuration? Another thing that is annoying me is that the 3V minimum supply voltage doesn't appear in any other part of the datasheet. It only appears on what I consider to be the "marketing" section of the sheet. Is that spec stated in any other "more technical" part of the datasheet, such as a table under Electrical Characteristics section and I'm not seeing it? <Q> If you wish to obtain datasheet wisdom by adumbration you could look at other hints as well :-) <S> Note fig 12 where they could easily have taken Vin under 5V and have chosen not to do so. <S> 5V is used as reference test Vcc in many cases. <S> Note that at any sort of current the internal darlington saturation eats a significant amount of your lunch at < 3V Vcc. <S> That's an ST data sheet <S> but I think it looks like a redraw of the very old Motorola version. <S> What do other manufacturer's data sheets say? <S> In practice I have found that MC34063xxx curl up their toes at slightly under 3V Vcc. <S> I've run them from 3V on up with good results. <A> Never trust a 'typical'. <S> My experience tells me that typical values in a datasheet are the most atypical. <S> Seriously though, these start-up values are cited as typical with no minimum or maximum. <S> As Russell pointed out, many things are spec'd at 5V, and the threshold voltage line regulation parameter agrees with the front-page spec (3 to 40V). <S> If you ever get into a spec-lawyer discussion with a supplier, the most restrictive conditions in the datasheet will apply, measurement conditions matter, and typical values are utterly redundant. <S> (Trust me.) <S> I would read this datasheet as, "I should probably start at 5V, maybe go as low as 3V for supply voltage: it may start sucking juice below 3V but the outcome may not be nice. <S> Consider external UVLO. <S> Unit-to-unit variation is possible between 3-5V." <A> My interpretation is that minimum supply voltage for the MC34063E is really 1.5V and not 3V as stated. <S> Is that correct? <S> I read it like this - you are stepping up a supply voltage and the manufacturer says that the chip will work as low as 3V. <S> Later on it says 5V is the test voltage for the main body of the data sheet's written values (page 6 and 7). <S> This then concerns me as to how far the device will be guaranteed to work under 5V. <S> I then see "Figure 12. <S> Supply current vs. input voltage" and it does not show operation below 5V. <S> That's sealed it for me - I can't expect this device to work as expected below 5V 100% of the time and for 100% of every chip I might buy. <S> In other words I can't realistically design it to operate below 5V unless I'm prepared to test it below 5V and expect failures. <S> But, then I notice Figure 17. <S> Voltage inverting converter and it shows it operating at 4.5 volts. <S> I then have to make a decision based on how this circuit works as to whether I can transfer <S> it's good news (4.5 volts) to my circuit (step-up). <S> Maybe I can. <S> Lastly, I go back to where it says the oscillator may start at 1.5 volts and this to me is a warning that maybe if I dropped the voltage to that sort of area strange behavior will occur <S> and I worry because at 1.5 volts any old thing may happen. <S> Take the 1.5 volt operation as a warning that things could go stupidly wrong at too low of a supply voltage.
| It says 3V on the front page and that is nearly always a typical figure because the front page of the data sheet tries always to say the nicest things about the device without being dishonest.
|
Connecting a galvanometer directly to a microcontroller's PWM output Is it a good idea to connect a galvanometer (100 µA panel meter) directly to a PWM output of a microcontroller (or any other digital device for that matter)? I set PWM frequency to approximately 10 kHz and duty cycle varies from 0 to 6% for full scale. My worry is if the push pull output has a dead time, then the inductor will induce spikes on the driver pin. Does it require extra Schottky diodes to the power supply or are the internal protection diodes sufficient? I have the diodes lying around, it is not a matter of cost, it is a matter of what is best / necessary practice? Another option would be a 27k resistor in series and use full 0 - 100% duty cycle, but the question remains as the inductor acts as a current source and "doesn't care" about a series resistor. ®Stellaris LM4F120H5QR Microcontroller <Q> Use a series resistor, scaled such that 100% PWM output (i.e. 3.3V or 5V depending on the MCU) gives 100uA or a bit over (up to 50% over). <S> Direct connection would only allow something like 10% duty cycle before full-scale deflection, not very useful. <S> And the series resistor will attenuate any inductive spikes from the meter coil well enough to protect the MCU. <S> It is possible but unlikely that a 2mA overload, e.g. from a software error (integer overflow?) could cause damage to the meter movement. <S> Unlikely to burn the coil out, but it's a fairly violent mechanical movement. <S> 100uA movements should be pretty tough but more sensitive ones used to have delicate jewelled bearings, like watch movements. <A> A 100uA meter will be no problem- <S> the outputs are push-pull and do not have a dead time. <S> I suggest you use a series 1% resistor to get a stable reading. <S> Otherwise the scale factor will be determined by the output's current limit and by the resistance of the meter, both of which are variable and change with temperature. <S> Use a resistor that's just low enough to get a full-scale deflection at maximum duty cycle (or slightly more and throttle it back with a firmware calibration). <A> The meter's inductance will cause spikes. <S> However the coil in a moving coil meter is usually wound around an aluminum former which acts as a shorted turn (to damp the movement). <S> Putting a resistor in series will reduce spike intensity even further, and protect the meter from overload if the PWM ratio goes over 6%. <S> Most microcontrollers have internal protection diodes on their I/ <S> O pins, so the only thing to be worried about is whether they can handle the spike current. <S> With a 27k resistor the spikes would have to exceed 27V to push 1mA into the I/ <S> O pin. <S> I tried driving 10KHz 50% PWM into a 50uA meter with a BS107 MOSFET and 27k series resistance. <S> At the meter terminals the spike had a peak amplitude of 1.1V. <S> At the FET it was less than 0.6V. <A> AT 10 kHz, your meter will not move at all and integrate the current quite well. <S> The inductor in the meter will filter the current spikes from the controller and will generate a small over load, but this will be absorbed by the controller without any damage (the spike intensity is smaller than the injected current intensity and the controller is in low impedance when it stops driving the output, so there is no power and therefore no heat and thus no issue). <S> The real question is the range, but a factor 10 of momentary overload should not be an issue as the average value remains within the specification of the galvanometer.
| When combined with the relatively low inductance and high resistance of the coil, the spikes should be quite weak.
|
Is there any problem soldering a device while it's powered on? I'm frequently tempted to solder to devices that are still powered. Assuming that: it's a low-voltage device there's nothing static-sensitive on the board I'm not going to short anything out (because I'm a ninja) Is it possible to damage anything (device, myself, soldering iron) by soldering things on the board without powering it off? Are there any hazards that I haven't considered? <Q> Typically, no - if you're careful. <S> It is actually quite convenient during debugging since you just resolder homemade probes from one test point to another instead of figuring out how to re-clip fancy expensive ones without shorting adjacent pins. <S> For parts with 0.5 mm pitch and less soldering is the easiest way to attach a probe since you'd have to probe under a microscope anyway and while you move your eyes from the board to the display of your instrument you can also easily move a probe if you're holding it with your hand. <S> No matter how good you think you are never solder live line-powered circuits, under any circumstances. <S> At my job I don't have an iron in a room where I work with SMPS stuff. <A> Figure that while soldering you are likely to bump with your soldering iron anything which is too close to the things you are trying to solder. <S> This is likely to momentarily short things. <S> In some cases, these issues don't pose any problem. <S> In many cases, they pose a slight concern, but no real danger. <S> For example, if an embedded system takes an annoying amount of time to boot up, and an accidental short would disrupt its operation in such fashion as to require a reboot but have no other consequence, one might decide to solder such a device while in operation even if there was a 25% chance of bumping something. <S> Figure that if everything works cleanly, one has saved the hassle of rebooting, and if one slips up one still would hardly be any worse off than if the circuit had been powered down first. <S> Of course, there are also many common scenarios where a slip up could destroy the circuit being worked upon, and some where it could pose a safety risk to the person soldering, so it's important to use good judgment. <S> Absent <S> a really good reason, I would be inclined to solder on live circuits only when the consequences of an accidental short would be minimal. <A> If you use a regular soldering iron while the device is on, you could short out the pin/trace your soldering. <S> Even if you do use a hot air or gas soldering iron there are other problems: One problem that you may encounter is exceeding the absolute maximum temperature of a given part, this especially applies when the part is on. <S> If the part is off this doesn't matter as much because a part is able to handle the soldering temperature profile for that part. <S> If you exceed the absolute maximum rating, damage is sure to occur. <S> Electromigration <S> When metals are hot AND have current flowing through them you can get bad things like electromigration that can damage an IC. <S> This can also happen if you turn off the device and solder a part, and don't let it cool sufficiently before turning the device back on. <S> Don't exceed, maximum temperatures in the datasheet, and follow the temperature ramp for solder profiles on a package datasheet. <A> Actually I think there is a bigger problem in soldering while circuit connected to the power. <S> This is completely based on my experiences, I learnt it in hard way (I damaged 3 MFRC522 boards in a row till I found out the cause). <S> I think in soldering a board, there are at least 2 different kinds of metal(Cupper,Lead and Iron in soldering iron) together with intense heat, it makes an unintentional thermostat and it will produce some voltage (if you have an LED near the point you are soldering you may notice some blinks) in your circuit and based on point <S> you are soldering this voltage may add to potential on that point even if it is negligible and exceeds the maximum voltage rating and damages your IC. <S> I categorically recommend you to cut your board off the power before doing anything. <S> cutting off means that you should even disconnect your ground connection
| Further, some soldering irons are constructed to have a conductive path from their tip to ground; this may help avoid ESD hazards, but may sometimes pose a problem if that path interacts badly with the circuit being soldered. "Careful" is very important. You can use gas-powered iron or just unplug the usual one from its power source just prior to making a joint (that's what I do).
|
Connecting two center-tap transformers for isolation transformer I need to create an isolation transformer so I can float a Device Under Test (DUT). The parts I have to do so are two transformers: 120V primary / 6.3V-0-6.3V secondary @ 3A. I intend to connect the secondaries together to create an (essentially) 1:1 isolation transformer with 120V output. My question is: do I connect the center taps? My understanding is that with the center taps connected, the voltages reference them as neutral - essentially creating -6.3V and +6.3V (180 degrees out of phase). Without the center taps, 12.6V would be the voltage across the remaining two (secondary) leads - right? <Q> Leave the center taps disconnected, since with floating center taps there'll be no chance of imbalance in the 12.6 volt windings causing damage anywhere. <S> Also, be sure that your variac drives the transformer array instead of the array driving the variac, since that way the array won't have to supply the variac's losses. <A> Your solution will work essentially equally well with or without the centre taps connected. <S> In your position I'd probably not connect them as if there is and slight voltage imbalance between the halves on either transformer, this would have less ill effect with centre taps NOT connected. <S> What you are proposing is perfectly viable and seems to be safe enough - and I'm sure I've done things like that somewhere along the way over the years. <S> When operated at full power losses will be higher than usual for a "normal" isolating transformer. <S> And you'll probably get worse regulation / more sagging under load. <S> More soon ... <A> but there's a basic problem if you are expecting to produce an isolated 120V AC supply due to the transformers regulation under load. <S> A lot of transformers will not have the "ideal" turns ratio to produce a given output and on no load a 12VAC output transformer <S> may well be 13 volts AC. <S> Under load conditions the 13V drops to 12V but the basic turns ratio is biased to produce a slightly higher output voltage under load. <S> This "amended" turns <S> ratio works OK when you step down the 120V input but then works against you when you step up the voltage <S> - the overall effect is that it may look like 120V on no load but this will drop to possible closer to 100V when you use anything near full load current on the output. <A> You do not need to connect the centre tap. <S> Leave both unconnected. <S> If you connect both you even risk of overloading the transformer as there could be a small voltage difference between both centre taps. <A> As others have recommended, don't connect the center taps. <S> However, I don't think anybody has dealt properly with the power limitation issue. <S> You have not indicated the current capacity of your transformer secondary. <S> This will directly limit the power which you can draw from your isolated 120 VAC. <S> Let's say your transformer is rated for 1 amp on the secondary. <S> Then this level (1 amp and 6.3 volts, or 6.3 watts) is all you can feed into the second transformer, and it's all you can pull from your isolated 120 volts. <S> For this example, that's 120 volts / 6.3 watts, or about 50 mA. <S> This may or may not be a problem, but you need to be aware of it. <S> You need to calculate the power drawn by your isolated load, and see if it's compatible with the transformers you've got. <S> Also be aware that the above calculation assumes a power factor of 1. <S> If your load is (for instance) <S> a switching power supply which does not have a good input filter, you will not be able to draw as much power as you think <S> without the transformer limits giving you problems.
| Your idea will work best without the centre taps connected
|
Component to short 2 wires when powered I am attempting to short 2 different wires, call them A and B when C I'd powered. I am attempting to use a transistor, but when I attatch C to the base and A or B to the emittor, it just powers A/B which isn't what I want, I need A/B to be shorted. Is there a way to configure a transistor to do this? Or might I need a relay of some sort? <Q> I would use a relay - the relay contacts are totally isolated from the controlling source <S> so there is no chance of introducing unwanted voltages, and no need to be concerned with the polarity between the points you want to short (although you do have to select a relay whose contacts can handle the voltage and current that may be encountered. <A> There are a few ways to do this -- 1) <S> The disadvantage is it is fairly large compared to other methods, and requires comparatively more power to turn on the relay, likely requiring a BJT or MOSFET transistor driver. <S> 2) You could use a pair of MOSFETs to bridge the two leads. <S> This is small, cheap, can also handle quite a bit of current, and doesn't require hardly any power to activate it. <S> However there will be a finite resistance between the two leads ( <S> R\$_{ds}\$ <S> On of the transistor). <S> This can be the the milliohms, so it probably won't be an issue. <S> 3) <S> A third way is to use an analog switch, which is particularly design for this purpose, (connecting two leads together). <S> is an analog switch such as the Maxim MAX4626 . <S> It has an on resistance of about 0.5Ω, and can handle up to 400 mA continuous. <S> The downside (if it matters) is that the voltages on the leads to be shorted must not exceed the supply voltage (typically 5v) + .3V. <A> If the current in A/B is DC and reasonably low enough and you have an optocoupler somewhere around that might work as well.
| As previously mentioned, you could use a relay; this would provide a direct short as you require, and would allow a substantial current to flow between the shorted leads as necessary.
|
How can I measure the brightness of a LED? I'm interested in converting voice of the customer (VOC) to LED brightness specification. In order to do this, I would like to be able to measure LED brightness using a cost effective instrument. What are the available instruments to measure LED brightness and respective cost effective techniques? <Q> It's not clear if you want to actually encode the voice signal with LED brightness, or whether the brightness is just supposed to indicate recent amplitude. <S> In any case, none of this requires actually measuring LED brightness, so it's not clear what you are really trying to do. <S> The simplest means to measure brightness is probably with a light dependent resistor (LDR). <S> These are CdS cells that vary quite dramatically with light intensity. <S> The signal is strong, but CdS cells are relatively slow (good for voice amplitude, but borderline for actual voice), and non-linear. <S> Light can also be measured with photodiodes or phototransistors. <S> These are faster and can be arranged to produce a linear signal. <S> But, they are a little more complicated to drive and their signal is generally "small". <S> They require active amplification to get to typical useful levels, and therefore are subject to picking up noise. <S> There are two broad ways to use a photodiode, in leakage mode and in solar cell mode. <S> In leakage mode, you reverse bias it. <S> The current is reasonably insensitive to the bias voltage over a wide range, and quite linear with light. <S> It is small though, so is usually run directly into a transimpedance amplifier. <S> In solar cell mode, the diode is kept shorted, and the current resulting from it acting like a solar cell is measured. <S> This produces good results, but usually requires a negative supply to make a positive voltage. <A> To measure the brightness and color of an LED and get a number that is comparable to the number on the LED datasheet requires a calibrated instrument such as a photometer or spectroradiometer with an integrating sphere or a goniometer (measuring the radiation pattern). <S> Here is one setup. <S> There is a good introduction to LED metrology here, from German supplier Instrument Systems . <S> Typically LED brightness is not specified to a very tight tolerance (or required to be specified) but it is good enough for many applications to purchase an LED with a specified range of brightnesses at a given current and verify (from samples) that it looks okay. <S> If you need to be able to measure it to verify compliance with specifications, I think you'll need an instrument similar to the above-mentioned devices. <S> You could get a rough comparative measurement (or a measurement of an indirect parameter such as luminous flux per unit area as @trcosley suggests) with other much less expensive means. <S> Lux meters used for measuring illuminance are very inexpensive and commonly available <S> (I have one to measure work area illumination). <A> which is probably a little pricey for your needs <S> but I'm sure you can find others. <S> I included it because I have one <S> and it seems to work well. <S> It has the following specs: <S> Range: 400,000 lux; 40,000 fcResolution: 0.01 / 1 lux; 0.001/1 <S> fcAccuracy: <S> ±(3% + 0.5% fs)
| If you are literally interested in measuring the brightness of an LED, you could use a light meter like this one .
|
Why there are data bit lower than 8 data bit of uart Our group are creating a UART IP Soft Core with Wishbone Wrapper and we are using 5,6,7 and 8 data bit. I just want to know what are the use of the 5, 6 and 7 data bit? In addition to my question above, what are the possible applications of the customizable uart? any suggetion please? <Q> In the past Baudot code was popular 5-bit code used with telegraph machines. <S> The idea of being able to shift between letters and figures gave it coverage of uppercase letters, numeric and other common punctuation symbols above the usual total of 32 <S> you'd expect from a 5-bit number. <S> ASCII is a 7-bit code (although often now transmitted as 8 bits regardless) so that explains why that was common. <S> I'd never heard of six bits being used but presumably in the past if it was worthwhile to cover five, seven and eight bits handling six bits <S> added no additional complexity, but more likely is Michael Karas' answer in that regard that six bit encoding was also popular as well. <A> The length of the data values in a UART are historical and relate back to the day when communications was slow (like 110 bits per second). <S> For example if you used an alphabet of 26 upper case letter symbols plus 6 punctuation marks and control characters it would fit into a 5 bit code (32 combinations). <S> The Baudot code was one example of a 5 bit code. <S> The original ASCII character encoding used 7 bit encoding. <S> IBM's EBCDIC was another example of a 7 bit code. <S> There were a number of 6 bit character encoding systems in use. <S> There was DEC's SIXBIT code and also there was uuencoding which used a 6 bit character set to represent arbitrary binary data as text. <S> As a matter of fact common mag stripe cards that we still use today use a 6-bit character encoding on their track 1. <A> The original UART (as a single chip) appeared in the early 1970's. <S> It was designed so that it could be used with any of the serial communications systems in use at that time. <S> There were also some 6-bit systems developed, but there were far less common. <S> And although early ASCII-compatible equipment only made use of 7 bits, I never saw an implementation that didn't use the full 8 bits. <S> A completely compatible UART also allowed setting the number of stop bits to one-and-a-half, as this was the timing used with the 5-level Baudot machines. <S> Once the sending and receiving machines became all electronic, and especially microcontroller based, one could choose any setting they wanted and make it work by using the same settings on each end. <S> But most people stuck with the "8-N-1" convention in use by that time. <A> When sending ASCII, if none of the characters have the high bit set, using 7-N-1 rather than 8-N-1 at any given baud rate will offer an easy 11% speed improvement. <S> Beyond that, I've not seen much use for shorter bit lengths. <S> Good support for 9-bit data is helpful, though usage of it is limited by the fact that many UART devices do not support it well. <S> It's common for UARTs to support 8 bits plus configurable parity, but for such a feature to be really useful the data for the ninth bit must be buffered both transmit and receive FIFOs, and it must be possible to configure the ninth-bit state for transmission without interfering with ninth-bit reception. <S> Having a UART whose receive buffer records whether the received parity matched the transmit parity setting is useless if a byte may occur while software is preparing to change the parity for the next transmission, since software will have no way of knowing whether the incoming data was compared to the old or new setting. <S> BTW, an approach I haven't seen used, but which might be interesting would be to use a variable-length byte which would regard as a stop bit the first marking bit after the eight. <S> This would allow 256 values to be sent in ten bit times, 256 different ones to be sent in eleven, and possibly another 256 different ones in twelve, etc. <S> That would afford the protocol advantages associated with nine-bit data, but without adding extra overhead on most bytes. <S> It would increase the likelihood that framing errors wouldn't be "noticed" by the UART, but the appearance of unexpected "special" characters could be detected in the protocol.
| The classic teleprinters (mostly sold under the Teletype brand) used a 5-bit code. If a particular application could encode all the symbols that wanted to be transmitted into a smaller number of bits then it was possible to send that information to another location in less time. The 8th bit could be used for parity (even or odd), or it might be permanently set to 0 or 1.
|
Why (almost) all HDMI connectors in devices are female? I have just bought an HDMI 10m cable and of course it comes with male plugs on both ends, and that's because almost all HDMI devices have a female socket. But why is that? I can understand that when a sender-receiver difference is not clear that can work, e.g. the always wrong type RS232 connector, but for HDMI there clearly is a device that produces video, and a device that consumes it, end of story. Of course there's some sort of symmetric communication going on but the data flow is pretty clear. This came to my mind since you can't make longer chords just by plugging two extenders one in another, as you would do with mains extenders. You can yell at me that's out of spec, but female to female adapters exist and who the hell cares about the standard anyway? Some of the reasons that came to mind: you only need to design female pcb/panel mound connectors, and male cable connectors you can use tha same physical connector both as an input and an output (maybe capture video on a VGA?) ? I'm hoping not to get opinion based close votes since I (want to) believe that there's a perfectly legitimate reason behind this choice. <Q> from http://www.hdmi.org/learningcenter/faq.aspx#94 <S> Q. <S> How will HDMI change the way we interface with our entertainment systems? <S> The most tangible and immediate way that HDMI changes the way we interface with our components is in the set-up. <S> One cable replaces up to 11 analog cables, highly simplifying the setting up of a home theater as well as supporting the aesthetics of new component design with cable simplification. <S> Next, when the consumer turns on the HDMI-connected system, the video is of higher quality since the signal has been neither compressed nor converted from digital to analog and back. <S> Lastly, because of the two-way communication capabilities of HDMI, components that are connected via HDMI constantly talk to each other in the background, exchanging key profile information so that content is sent in the best format without the user having to scroll through set-up menus. <S> The HDMI specification also includes the option for manufacturers to include CEC functionality (Consumer Electronics Control), a set of commands that utilizes HDMI’s two- way <S> communication to allow for single remote control of any CEC-enabled devices connected with HDMI. <S> For example, CEC includes one-touch play, so that one touch of play on the DVD will trigger the necessary commands over HDMI for the entire system to power on and auto-configure itself to respond to the command. <S> CEC has a variety of common commands as part of its command set, and manufacturers who implement CEC must do so in a way that ensures that these common command sets interoperate amongst all devices, regardless of manufacturer. <S> It's pretty clear that in the standard, they were trying to make sure that you would ALWAYS have the right cable when trying to assemble consumer-grade AV systems, and one way to do that is to have one cable style. <S> Also, they want to play up the two-way communication features of HDMI. <S> Of course, that's speculation, but I can honestly assert that I've never cursed at HDMI connections anywhere near as loudly as I've cursed at USB connections. <A> This answer probably has nothing to do with why the HDMI connectors are the way they are, but in Professional Audio, we always try to put female multipin connectors on the boxes / enclosures and have male pins on the cables. <S> and it's a lot easier to just grab a new / spare cable when that happens. <A> so inorder to safeguard the plug they designed it to use female port. <S> think of it if you have a male port in your wall switch board. <S> wat will happen.?? <S> while crossing it you might hit it or you will get shock. <S> and if the male port is setup in the machine, it needs a lot of space which is more than female socket. <A> I suspect the most likely reason is convenience. <S> For many people, setting up a home AV system is an exercise in confusion and frustration. <S> Imagine being on your hands and knees peering behind a Blu-ray player that you can barely see because the top of the TV stand is blocking the light. <S> Now imagine that you have no idea what's supposed to connect to what. <S> Maybe there's a huge rat's nest of cables <S> , maybe there's a receiver, maybe there are three game consoles. <S> Do you want to have to worry about cable gendering? <S> Think about how many problems people have with USB connectors under the same circumstances. <S> Something like "the male end of the cable points towards the video source" sounds simple to people like us, but if you say something like that to the general public, you've already lost a large fraction of your audience. <A> This mostly comes down to common sense engineering, and a little bit of status quo. <S> It is difficult to make a connection between two completely identical pieces, so you specialize them. <S> Arbitrarily, you call one female and one male - one goes in the other. <S> The pins that stick out are easier to break <S> so you put it in the part that is easier to replace - the cable. <S> Such is true of VGA, F connectors for coaxial cables, USB, and now HDMI. <S> Given the rugged design of the hdmi jack on the cable, the pins aren't particularly at risk - but if we had reversed those exact sockets, the cable end would get unwieldy, and we still would have called it male, because it goes into the other side.
| Personally, I quite like that the HDMI cables are symmetrical and I don't have to worry about which end is which when crawling behind someone's entertainment center trying to plug stuff in. The reason is that pins do get bent and broken Because it might be due to the design of the product. Same with recent computer VGA connectors and cables: these used to be mixed male / female but seem to have changed over the past decade or so to be female connectors on the devices and male connectors at both ends of the cable. as if it has an male port it has to be pointing out (that is it should project out) of the product which may get damaged while using or might injure someone if the rub towards the machine.
|
Wired-or open drain with open collector outputs I have a comparator with open collector output (LM311) and a gate with open drain output (SN74LVC1G06). I want join these two outputs to make a wired-or, with a pull-up resistor tied to +3.3V. In a general way, is it appropriate to join an open-drain output with an open-collector output? <Q> Yes, you certainly can wire the two outputs together. <S> Open drain and open collector just reflect the different technologies used inside the chips. <S> Keep in mind that 'wired or' is assuming input and output signals are inverted, so it's really an AND gate (both outputs must high-Z for the combined output to go high). <A> There really isn't an issue with that. <S> Open drain and open-collector are essentially the same in this application. <S> Two things to watch out for <S> If the output of either opamp is high, then the output of that IC will be pulled low, and vice versa. <S> Just make sure each IC can sink (Vcc/R1)+(Vcc/R2). <S> This will be the worst case current if one output is low, and the other is high. <S> Picture for reference. <A> I am not sure if this concrete question and this practically oriented forum are the right place to reveal the philosophy behind the "wired OR" gate... but let me try... <S> Here is my explanation why the "wired OR" really represents the OR logic function. <S> There is nothing special in this connection; actually it is the primary and most elementary OR gate. <S> Only to see the OR logic function here, we have to think in terms of resistances, conductances or switch states. <S> From this point of view, the primary OR gate consists of elements (resistors, conductors or switches) connected in parallel that are driven by the input logical variables so that "conduct" (closed switch) represents "logical 1". <S> It is obvious that, in this arrangement, the equivalent network will conduct (output logical 1) if only one of the elements conducts (input logical 1). <S> Dually, an AND gate consists of such elements connected in series. <S> Now the equivalent network will conduct (output logical 1) if both the elements conduct (input logical 1). <S> Only electronic circuits use voltages (or more rarely, currents) as input and output variables. <S> So, we should first convert the input voltages into resistances by some "electrically-controlled resistors" (FET, BJT, etc.), and then - the equivalent output resistance to voltage , by passing a current through it. <S> The role of the pull-up resistor is just to provide this current. <S> NMOS logic gates are implemented exactly in this way. <S> For example, an NMOS OR gate consists of NMOS transistors in parallel and a pull-up drain resistor. <S> So, in this case we think of the whole combination as of an (N)OR gate including the transistors. <S> The same is true in the case of RTL gate (the picture below). <S> But what do we think in the case of a "wired OR"? <S> What is the gate itself? <S> In this case we do not consider the transistors as belonging to the logic gate... <S> we consider them as external (belonging to the previous gates). <S> And also, we do not consider the pull-up resistor as belonging to the logic gate... <S> we consider it as external (belonging to the next gate). <S> But wait... what has remained then from our logic gate? <S> Only a point, node, joined wires... <S> that is why it is named "wired OR". <A> In a general way, is it appropriate to join an open-drain output with an open-collector output?
| : Make sure you get your polarities right and that you need an OR gate and not a NOR gate because the open-collector/open-drain style often invert your signal. Yes (simple question, simple answer)
|
How to measure nano-amps easily? I want to measure the stand-by current of the PIC, but my DVM has minimum 2000micro (u) amper switch. It shows 0 micro amps when in 2000 u amps mode. Without building circuit a complex (more than 3-4 components) circuit, how can I measure nano amps? <Q> Put a suitable resistor in series, and your DVM (in voltage mode) over the resistor. <S> For instance, a current of 100 nA through a 1M resistor will give you 0.1V. <S> Check the input impedance of your DVM, for this to work it must be >> <S> 1M. <S> You will probably need a switch to short the resistor for the period that your target is not yet in low-power mode. <S> Another way would be to use a known-sized capacitor as power supply and see how fast it discharges. <S> Again, your measurement instrument must have a high impedance, otherwise it will disturb the measurement. <S> You might get around this by connecting the voltmeter to measure the voltage only at specific moments. <A> It has also been reviewed on the EEVBlog. <A> TIA opamp circuit with a FET opamp. <S> opa134 has ~pA of bias current. <S> 10-100 Meg ohm feedback resistor. <S> Bipolar power supply.
| Get one of those: https://www.kickstarter.com/projects/eevblog/current-gold-precision-multimeter-current-adapter .
|
Obtaining a specific resistance first of all, let me apologise for my inexperience with electronics. Now that's over with, I'm trying to follow a guide that specifies the use of a specific temperature sensor with an output of 5v DC. The problem is that the sensor I currently have provides different values and that a resistance of 14.2k ohms is required. The problem I have is that this step provides no further information. The actual step is as follows: - The outlined box above, which currently is set to 14.2, represents the resistance in to be added in parallel I'd like to know how to obtain this specific resistance to place between the sensor and the controller that reads this value. I assumed I could build the resistance in a series. I am under the impression that resistors can be placed in series, i.e. I could add a 10k ohm resistor and a 4k ohm resistor and then a 0.2k ohm resistor. Forgive my ignorance here, please, if this is completely idiotic. So I went to http://www.crownaudio.com/ohms-law.htm and entered 14200 and 5 into the respective fields and it specified that the watts was '0.00176' Does this mean that when shopping for resistors, I can buy: - http://www.maplin.co.uk/p/metal-film-06w-22k-ohm-resistor-m2k2 2.2k - 0.6w http://www.maplin.co.uk/p/metal-film-06w-10k-ohm-resistor-m10k 10k - 0.6w http://www.maplin.co.uk/p/metal-film-06w-2k-ohm-resistor-m2k 2k - 0.6w I assume I need the same wattage for all but as above, adding all the resistances in series will create 14.2k ohms but they look so flimsy. Thank you! <Q> You're off to a good start. <S> Yes, you can buy three resistors and wire them in series (not parallel!), although the first resistor you link to is a 22k, rather than a 2.2k, and if you connect the three resistors you've chosen, you'll get 34 k, rather than 14.2 k. <S> Despite the fact that they seem flimsy, the units you show will handle at least 100 times the power you expect to dissipate. <S> After all, your calculator (correctly) showed that the desired resistor will need to handle .0018 <S> watts, and each of your examples will handle 0.6 watts. <S> Finally, you really ought to be able to find a single 14k resistor to do the job, and you can forget building up combinations. <S> And finally, finally, I'd recommend you stay away from Maplin. <S> They have no search ability whatsoever, and this will make your attempts at finding appropriate parts a misery. <S> As an alternative, try Digikey. <S> I'm sure there are other suppliers in the UK as well, but that is one of the convenient go-to sources for parts in the US, and their website indicates they have facilities in the UK. <A> First of all, don't put the resistors in parallel, put them in series . <S> $$R_p = \frac{1}{\dfrac{1}{R_1} + \dfrac{1}{R_2} + \; ... <S> + \dfrac{1}{R_n}}$$ <S> Where \$R_p\$ is the equivalent resistance of the individual resistors in parallel, and \$R_1\$, <S> \$R_2\$, ..., \$R_n\$ are individual resistors. <S> If you put them in series then they just add up: $$R_s <S> = R_1 + R_2 + \; ... <S> + R_n$$ <S> The latter is what you want. <S> Another thing, you can use two E12 resistors not three: 12K + 2K2 <S> = 14.2 <S> K <S> You've already worked out that 5V across 14.2K results in trivial power consumption, so don't spend money on high-wattage parts. <S> 1/4W resistors would be fine. <S> Also, if you have to get resistors with different wattages then that would also be fine. <S> There are circumstances where that wattage rating might matter, but this isn't one of them. <A> You can also put the resistors in parallel, but resistors in parallel have a lower total resistance than the individual resistors. <S> The formula is \$1/ <S> R_t=1 <S> /R_1+1/ <S> R_2\$. A parallel combination of 15k and 270k will be 14.21k. <S> The math is harder, but it works just as well. <S> The power rating only needs to exceed the requirement, not match it, so 1/4 watt resistors will work fine (and be very cheap). <S> Those resistors you linked are all 1% tolerance, so you shouldn't try to get closer than that by just using values. <S> You likely don't need to be that accurate, but if you need to you will have to buy precision resistors or measure the ones you get and adjust the series/parallel combination accordingly.
| Use this link http://www.daycounter.com/Calculators/Standard-Resistor-Value-Calculator2.phtml to determine that you can use a 14.3 k, 1% resistor and save yourself some effort.
|
What does a buck converter do with the energy that a linear regulator would otherwise waste as heat? I've been reading for hours about how switching regulators work but I'm still unable to understand what it does to keep the power equity between the input and the output (ignoring internal losses). Let's say you step down 5v to 2v with a buck converter. What happens with the 3v dropped? Are somehow "converted" to current? Another simple example: Let's say I have a 3.7v battery and I want to feed an IC which has an input VDD range of 1.8 to 3v so I use a buck converter to step down the voltage. If I step down the voltage to 1.8v would the battery last longer than if I step down the voltage to 3v? <Q> Yes, crudely put, it converts the voltage into current. <S> Ignoring the internal losses, if you halve the voltage you double the (available) current. <S> So if you convert a 5V 1A input into a 2V output the current capacity becomes 2.5A minus internal losses. <S> Say you have a switching efficiency of 85%, then you can work it out as: $$\frac{5V}{2V <S> } = 2.5 <S> \times 0.85 = <S> 2.125$$$$1A \times <S> 2.125 = 2.125A$$ <S> You can think of it as the DC equivalent of a transformer for AC. <A> In one part of the duty cycle, the source energizes the inductor, increasing its current. <S> In the other part, the inductor drives the load. <S> This is easiest to see in a buck-boost converter. <S> Ideally, the switches and inductor/capacitor are lossless, so no power is lost. <S> This is totally different from a linear regulator, which deliberately wastes power to control the voltage. <S> In a buck or boost converter, some energy is transferred directly from the source to the load as well, but the same principle applies. <S> You can also look at a buck converter as an L-C filter on a square wave from the source. <S> Again, all components are lossless, so there's no waste. <S> This is basically how a class D power amplifier works. <A> If an ideal continuous-mode buck regulator were e.g. turning 9 volts into 6 volts and the output were drawing 1 amp continuously (i.e. 6 watts), then the input would spend 2/3 of the time supplying one amp at nine volts (i.e. 9 watts), and the other 1/3 of the time supplying zero current. <S> Real regulators differ from ideal ones, of course, but the principle of operation would be the same. <S> The biggest differences from an ideal regulator would be that the duty cycle would need to be slightly greater than 2/3, and that the output current wouldn't be an absolutely continuous one amp but would instead increase any time the device was drawing current from the source and decrease whenever it wasn't. <S> A smoothing cap would generally be required on the output to prevent the voltage from rising and falling as a consequence of this. <S> Nonetheless, I think it's helpful to recognize the following principles: A continuous-mode buck regulator produces continuous current from intermittent current. <S> A continuous-mode boost regulator produces intermittent current from continuous current. <S> A flyback regulator, even a continuous-mode one, will draw current and supply current intermittently ("continuous mode" means that it's always either drawing or supply current, but unlike the other topologies a flyback-mode supply can never do both simultaneously). <A> Remember that voltage does not carry energy or power on its own, only in combination with current. <S> Power is proportional to voltage times current, so the converter is allowed to use more voltage/less current on one side and less voltage <S> /more current on the other side, with the power of each being equal (ideally, output actually has less power due to efficiency <100%). <A> In a linear regulator The current on the input == current on the output (if you ignore quiescent power of the linear reg for a moment). <S> The linear regulator drops the excess voltage via a pass transistor which dissipates this as heat. <S> In a switching regulator the current on the input ! <S> = <S> current on the output. <S> This is done via switching an inductor ON and OFF to transfer energy from the input to the output. <S> The tradeoff is voltage & current ripple. <A> A "switching" regulator switches between two modes. <S> In the case of a buck converter with the switch closed the inductor is placed in series with the load. <S> This stores energy in the inductor. <S> The greater the voltage difference between input and output the more energy is stored in the inductor. <S> When the switch is opened. <S> Current continues to flow through the inductor but the current now comes from the ground rail via the diode rather than from the input terminal. <S> The voltage across the inductor is inverted and the energy stored in the inductor is discharged into the load.
| In a switching regulator, energy is transferred indirectly using an inductor.
|
Can an electromagnetic field be created in a non-metallic coil? OK, so here's a simple one. When current flows through a wire, it produces a tiny magnetic field. If you bend the wire into a spiral, the fields of each loop merge together forming a field you can actually measure. But does the conductor have to be metal , or would any conductive material work? E.g., would a plastic tube full of water still produce the same magnetic field? [Assuming the water has enough impurities to be considered a "conductor" to start with, which it usually does.] Edit for Clarification: OP is talking about a simple electromagnetic coil, without regard to core material or application. Assuming Air Core, would a coil of water in pvc tubing, electrified, produce a measurable magnetic field? <Q> Yes , you can make a solenoid without a metal wire. <S> The best conductors aren't metal at all, they're ceramics (i.e. superconductors). <S> Water with impurities will work fine as a solenoid. <S> If you decide to use an actuator, you'll obviously have to have that have some kind of ferromagnetism or conductivity in the actuator to be capable of induced currents, but this still doesn't require any sort of metal or magnetism on the solenoid coil. <A> Since the flow of charge through anything constitutes current, and since current creates a magnetic field, the short answer to your question: "Can an electromagnetic field be created in a non-metallic coil?" is "Yes". <A> For the sake of ambiguity: If by solenoid <S> the intent is just a coil & such a coil is to carry current & thus generate a magnetic field. <S> Yes. <S> Water can easily conduct electricity & with this electrical current flowing around the coil will produce an magnetic field. <S> How good compared to a coil made out of wire? <S> not that good <S> Why? <S> the radius of the coil. <S> The radius influences the inductance and the length & turns influences magnetic strength <S> B= <S> μI*n/ <S> l <S> L= <S> μr²n²π/ <S> l <S> Could you make the insulation of a waterpipe the same as the enamel insulation on a metallic conductor? <S> If it is todo with a solenoid associated with linear movement: <S> Any conductor will do. <S> The key here is the permeability of the material. <S> http://en.wikipedia.org/wiki/Permeability_%28electromagnetism%29#Values_for_some_common_materials <S> Compare Iron ( 2.5×10−1 ) to water ( 1.256627×10−6 ) and more importantly to Air (1.25663753×10−6) as it would be an air-cored Solenoid <S> That is a factor of 20,000 <A> For a simple solenoid, yes, it has to me metal. <S> Further, it has to be a ferrous metal. <S> Energise a coil to attract a ferrous material. <S> There are other systems though, called Linear Motors which at first glance look like a solenoid, but in fact work on a completely different principle. <S> These use a powerful magnetic field to induce a current into a conductive non-ferrous material (commonly aluminium) which then in turn generates its own opposing magnetic field. <S> These two fields repel each other and the non-ferrous material moves. <S> It's how "Maglev" trains work. <A> In case of water: Once a DC current flows through water, it begins to split into hydrogen and oxygen. <S> You somehow have to prevent evaporation
| A solenoid works by simple magnetism. Yes it would, but depending on the medium you'd run into some serious implementation obstacles.
|
How to find the positive wire on wall charger i have a TPLINK wall charger from my old router. It's almost new and i would like to use it for my 5V regulator project. The prboem is that i dont know which of the 2 wires is positive and which negative. If i connect it wrong the 3 polorized caps on the circuit will blow up. Charger specs: Model: T090085-2C1 Input: 100-240V~ Out: 9VDC .85 Amps I know tha using a LM7805 with this adaptor is not very efficient but i'm doing it for the science :) <Q> If you don't have a multimeter or LED you may consider an alternative method: <S> Take a glas of water and add a teaspoon of salt <S> Insert the two wires into charger's 9V output plug Dip <S> the other sides in the glas and keep them at least 1cm apart <S> Bubbles will appear = <S> > <S> The wire where you observe the densest bubble stream is the minus pole. <S> You way also want to watch this or this . <A> The icon at the bottom of the first picture shows that the barrel connector on that wire is center positive. <S> If you cut off and don't have the connector, or you don't have a multimeter then take any led and a 500 to 1000 ohm resistor, and test the wires to see which is positive. <A> Next to both methods described by Passerby , you can also try to use your Multimeter. <S> When it says 9V, the red wire from your multimeter is connected to the positive wire of the power supply. <S> If it shows the negative sign (9V- or -9V)
| the red wire is connected to the negative wire of your supply and the black one is connected to the positive wire. You'll most likely find that the wire with the white dashes on it is the negative one.
|
Why do capacitor datasheets avoid directly giving the ESR value? Most datasheets give a parameter called "loss tangent" instead of directly giving the ESR value. Why don't they just give a numeric value for it? Why is loss tangent preferred over ESR? Is there something that prevents giving the ESR, like it is being dependent on frequency? <Q> It's just one of many ways to specify the same thing. <S> Other ways include: dissipation factor (DF) quality factor (Q) $$ \tan \delta = \text{DF} = {1\over Q} = {\text{ESR} \over X_C} <S> $$ <S> It's simply a matter of which is more convenient for the task at hand. <S> Notice in particular that the term including ESR also includes the capacitor's reactance, which is frequency dependent. <S> Thus, to calculate the ESR from the loss tangent, quality factor, or dissipation factor, we must also know the capacitance and the frequency at which these other measures are specified. <S> Furthermore, although the ESR model would suggest a resistive loss independent of frequency, in reality the ESR also varies with frequency. <S> Thus, it is unwise to extrapolate any qualities given in the datasheet to substantially different frequencies. <A> Some capacitors, especially those with axial leads, behave much like a single ideal capacitor in series with a single ideal resistor, but many other capacitors don't; they behave more like a complex network of many small ideal capacitors interconnected via ideal resistors and inductors. <S> When driven with a sine wave of any particular frequency, even a real capacitor will generally behave like a single ideal cap in series with a single ideal resistor, but the values of apparent cap and resistor at 1Hz may be very different from their values at 100MHz. <S> Consider the following network: simulate this circuit – Schematic created using CircuitLab R1 and C1 form the equivalent of a 10uF capacitor with a "perfect" ESR of 10 ohms; R2 and C2 are equivalent to a 100uF capacitor, also with a "perfect" ESR of 10 ohms. <S> The remaining parts form a simplified version of a more "typical" 100uF capacitor. <S> If one clicks the "frequency simulation" function in the editor, one will observe that the magnitude of the current at about 158Hz is the same for R1 as for R3; one might be inclined to say that the "capacitor" formed by R3/R3b/C3a/C3b has an ESR of 10 ohms. <S> On the other hand, the magnitudes of the currents in R2 and R3 will be nowhere near that of R1 [which shows what a 100uF cap with an ESR of 10 ohms should "look like"]. <S> The above discussion is a bit over-simplified; in fact, the current/voltage phase relationship is important, and as shown in the upper plot they're very different. <S> Still, at any given frequency one could find a resistor/capacitor pair which would match both the magnitude and phase of R3, and the behavior of that pair at that frequency would still be very different from that of a 100uF cap at that frequency with that value of resistance. <A> The loss tangent is the tangent of the angle between the impedance and the reactance vectors/phasors of the capacitor, so it is dependent on frequency. <S> Consequently, knowing the capacitance and the frequency will allow the reactance to be determined, and knowing the tangent of the angle between reactance and impedance will allow the impedance and the resistive part of the impedance, the ESR, to be found.
| The choice of which measure is used might be influenced by the expected application of the capacitor, or just tradition.
|
Operating a 0.08 amp fan using capacitor I am developing a hot air blower made out of 40w heater, 25mm fan and 12v power supply.I want to be able to keep the fan working in case that the power supply is cut off, so in case the heater is still hot, the fan will cool it.This should be 5-10 seconds fan operation.Is that possible with a capacitor or should I use a battery?The fan's specs is 12 volts, 0.08AThank you <Q> The required energy, in joules, to power the fan for 10 seconds can be calculated: 9.6 joules = 12 volts * 0.08 amperes <S> * 10 seconds <S> The required capacitance needed to store such amount of energy in a capacitor: 0.133 farads = 2 <S> * 9.6 joules / sqr(12 volts) <S> The capacitance needed is equivalent to 133 millifarad or 133,000 microfarad and the closest E10 value is 150 mF or 150,000 uF. Using a radial aluminum electrolytic capacitor capable of handling 16V , the capacitor physical dimension is 18mm in diameter by 36mm in length. <S> To answer your question: Yes, it's possible to use a capacitor to store energy for powering the fan. <S> A capacitor solution is simple as you just need to connect it across the load (fan) and no complicated charging circuit is required. <S> However, your may be constrained by the following: high capacitance capacitor requires a large space <S> high capacitance also means a longer charge time: the fan may not be powered for the full 10 seconds if power is lost while the capacitor is still charging a big capacitor charging will cause a high inrush current at power on: your supply must be designed to handle that a capacitor will not provide a constant voltage as it is discharging : you may need to use a higher capacitance so the full 10 seconds discharge will be within an acceptable voltage range for the fan <S> big capacitors are not easily available: may require a special order a battery module may be cheaper than a big capacitor <S> I leave to you the evaluation of the cost-benefit tradeoff between a capacitor and a battery. <A> The short answer is it is possible with a capacitor, but I would probably go with a battery. <S> The longer answer: <S> If you use a capacitor, it will discharge during this time. <S> This means the voltage across the capacitor will drop. <S> So you will have to understand what the acceptable starting voltage and ending voltage could be. <S> To a first order approximation, if you assume 80 mA current is constant, then the change in voltage per second is the current in Amps divided by the capacitance in Farads. <S> So for example, let's say you want to run for 5 seconds and have the voltage only droop from 12V to 10V, <S> i.e. a 2 V drop <S> : You expect 2V / 5s = 0.4 <S> V/s drop. <S> So 0.4 = 0.08/C => <S> C = <S> 0.2 <S> F. <S> This is a pretty large capacitance for 12 V. Also, note that this was a 1st order approximation, meaning I'm simplifying a bit. <S> When you decrease the voltage on the fan, it will lower the current somewhat, and this will cause both a slower voltage discharge and less cooling. <S> So the answer would require more information. <S> As I suggested, I would probably use a battery. <S> You might be able to charge it during operation so it would not need to be replaced. <A> Anything is possible with the appropriate circuit. <S> In your case, however, the actual circuit depends on the tolerance of your fan to the supply voltage, since both your power supply and the fan are 12V. With a simple charge/discharge circuit, the capacitor will charge to the supply voltage (12V). <S> After the PS is disconnected, the capacitor will discharge, but as it does so, its voltage goes down as well. <S> If the fan can tolerate a lower supply voltage, e.g. 10V, you can use a simple charge/discharge circuit, with a really big capacitor - big enough to hold enough charge to keep the fan running for 10sec, as the capacitor's voltage goes down from 12V to \$V_{min}\$, the fan's minimum usable voltage (e.g., 10V). <S> You can use the usual capacitor discharge formula, \$V(t) = <S> V_0 e^{-\frac{t}{\tau_0}})\$, where \$\tau_0=RC\$. <S> In your case, \$V_0=12V\$, \$R=(12V/0.08A)\$ <S> and you need to find a value of \$C\$ that will provide you <S> \$V(t)\geq <S> V_{min}\$ when \$t=10sec\$. <S> If the fan's tolerance is too small to allow usage of a real-life capacitor, then you'd need a more complex circuit that will always provide 12V. For instance, use a voltage pump to charge the main reservoir capacitor to a higher voltage (e.g. 24V), followed by a voltage regulator to achieve 12V again. <A> Ultracapacitors would be suitable here - 2.7V and 5.5V are typical voltages, so you'd need to run several in series to get your desired voltage. <S> I use ultracapacitors in small boost power supplies for microcontrollers (as a reservoir for the boosted voltage). <S> A single representative 5.5V 1.5F <S> ultracap is about 20mm diameter <S> x <S> 6m thick (quite close to the size of two 2032 coin cell batteries stacked). <S> In that small space, it packs 22.6875 Joules. <S> Three of these in series would be capable of taking a maxiumum 16.5V charge and delivering a whopping 68 Joules of energy. <S> Obviously, your circuit doesn't need quite that much juice, so you could get <S> lower rated ultracaps - 0.22F caps are a bit more compact, and three of those would provide just shy of 10 Joules total Energy capacity. <S> 12.7mm diameter by 17.5mm height for a representative 0.22F cap I have here, though I know there are much smaller ones (less than 1/2 the height). <S> If you go with a battery solution, you'll be looking at replacing the batteries periodically because they'll eventually not hold the charge, or will fail (often damaging your equipment). <S> Charging a capacitor on the other hand is quite straightforward. <S> An ultracapacitor can be recharged hundreds of thousands of times - it will far outlast any rechargeable battery in terms of total lifespan, which means so long as you use the correct specification and stay within device ratings, you shouldn't need to replace the "backup power" portion of your circuit anytime in your lifetime. <S> Your muffin fan bearings are a different matter.
| You'll also need to provide some sort of controlled charge circuit for the battery.
|
How to compute CPU power consumption I am working on a problem for which I need to know how much power will be consumed on a given CPU as the parameter sizes are increased. The following properties/attributes of the CPU are available: Version: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz Voltage: 0.8 V External Clock: 100 MHz Max Speed: 2600 MHz It is not possible to install any special tool as far as I know from the admins of the system. I am looking for a suggestion for some kind of formula/method to map a given executable running on this CPU and the power that the CPU will consume. Do I need to know any more about the CPU to obtain a more accurate power profile? About the executable: is there a way to accurately figure out its CPU profile? <Q> For instance, the power consumption of a processor is estimated by: $$ P = <S> C <S> * V^2 <S> * F <S> $$ where P is power <S> , C is the capacitance being switched per clock cycle, V is voltage, and F is the processor frequency (cycles per second). <A> I can recommend you to have a look to the PowerAPI tookit , a middleware library that estimates the power consumption of the CPU in real-time. <S> You can even have an estimation of the power consumption per process. <S> PowerAPI does not require any third-party power meter to be connected (unless you need a custom power model). <A> A good way to evaluate power profiles for a computer should include the system, memory and power delivery components as well as the CPU. <S> After all power is also consumed by all of these components as well and in almost all cases this other power scales to some degree with increased compute load placed on the CPU. <S> That said what you really want to do is get yourself a power meter that can measure the power to your whole system as delivered on the AC power line. <S> If you get one that has a USB or RS232 interface and supports remote reading and logging then you can make use of a standard computer power profiling tool called SpecPower. <S> This tool which should be a free download can run on x86 type platforms and place loading on multiple CPU cores from 0 to 100 % and then remotely monitor the system power intake at each load level. <S> It can then generate very nice graphs of the results. <S> I have used meters called "WattsUp" for this purpose that are in the few 100 $ price category. <S> The defacto standard meter that systems manufacturers use to profile their systems with SpecPower is called a Yokogawa but they cost in the 1000s of $. <S> Read more at the SpecPower web site .
| If you're mapping a given executable and you have access to more information about the CPU then you may be able to use some equations from frequency scaling to get a power profile.
|
Does a led determine itself current load? If I use a power source rated at 2.5v and 1 amps for power a standard red led , what should happen to led? Does it get burn for the high current value or not? <Q> The relationship between voltage and current in a LED looks like an exponential curve. <S> The picture below shows the relationship for a LED with a 2.0V forward voltage @ <S> 20mA. <S> If this was connected to a 2.5V power source with no current limiting resistor, the amount of current flowing would be very high, much higher than the LED's rated peak forward current . <S> The LED would fail catastrophically, probably with a pop and some smoke. <S> * <S> If the the power supply was 2.5V @ <S> say 10mA (a very small current that you probably wouldn't find) <S> then the LED would draw more current at 2.5V than could be supplied, and the output voltage of the supply would drop. <S> *When I was a kid I had a 200-in-1 electronics project kit. <S> As the batteries wore down I kept reducing the LED resistors until eventually I had no resistor at all. <S> Then one day I changed the batteries and every LED blew. <S> I was devastated. <A> Assuming that by "standard LED" you are talking about LED rated for about 20mA at about 1.5V, yes it will probably burn. <S> The current rating of the power supply has nothing to do with it. <S> In order to match the circuit, you need to place a series resistor that will satisfy the LED rating. <S> In given example, the voltage drop on the resistor should be \$1V\$, while the current is \$20mA\$. <S> So the resistor value should be \$1/20mA=50\Omega\$ <A> 1 amp on your power supply only means that it CAN supply 1 amp. <S> The current that flows through the circuit is determined by the components. <A> I am assuming the LED is a standard red LED with a 1.8V voltage drop. <S> Since the applied voltage is greater than this, you will get a large current. <S> The supply maxes out at 1A, which is definitely enough to burn out a standard LED. <S> The right way to do this is put in a resistor that will produce the correct current given the supply voltage and the voltage drop of the LED, as Eugene Sh. says. <S> If your supply was rated for less, say 20mA, it would still apply 2.5V, but when the current gets above 20mA the supply would start to drop voltage and you would be saved. <S> So in some sense the LED is burning out because of the high current rating of the supply, but as mischnic says it CAN supply 1A, it is not going to under all conditions. <S> So the mismatch in voltage is the real problem. <S> It is possible your LED wants exactly 2.5V and your supply is accurate enough to supply exactly that, in which case you would be ok. <S> You need more information on the LED to know that (and need to tell us more for a more accurate answer). <A> Short answer: do not connect LEDs directly to power supply (unless it is a special constant current power supply designed for LEDs). <S> You will burn it! <S> Long answer: <S> Most of standard through-hole LEDs (3 or 5mm diameter) can withstand <20mA only. <S> Some (expensive) LEDs can have 3 Amps current flowing through, so you need to know the specs for your particular part. <S> In any case you have to provide a constant current for LED (not a constant voltage), in the range that it can accept. <S> There are several ways to do it, the simplest is to have a current limiting resistor connected in series. <S> Calculation of its value is really simple: You need to know voltage drop and maximum current for your LED. <S> The best way is to read datasheet. <S> If you don't have one, it is an educated guess work. <S> Simple red LEDs normally have around 1.8V drop. <S> Let's say the current we want is 10mA. Resistor value <S> will be $$R = <S> \dfrac{V_{psu}-V_d}{I}$$ <S> where: \$V_{psu} = <S> 2.5V\$ (the power supply voltage) <S> \$V_d = <S> 1.8V\$ (for standard red LED) <S> \$I\$ is the current we want to have (10mA <S> = 0.01A) <S> $$R = \frac{2.5-1.8}{0.01} = <S> 70 <S> \Omega$$ <S> Nearest common value is 68 Ω.
| LEDs have pretty stable constant voltage drop and can tolerate any current that is below its maximum specified (in datasheet) current. Yes, it will (probably) burn out the LED.
|
Is there a sensor that is equivalent to a dry toothpick? For the non-cooks in the audience the dry toothpick test is used in baking (cakes, banana bread, etc.) to determine when the item is done baking. The procedure is to stick a toothpick into the food, pull it out and look at it, If it came out moist, you are not done cooking. It is simple and effective, but you can't do it from a chair with a cellphone. Any Ideas? <Q> The best approach for determining when baked goods are done is to put a thermocouple probe in the item being baked. <S> The basic idea is bake until the probe reports that the item has reached its terminal temperature. <S> Different baked goods may have different terminal temperatures. <S> Bread, as one example, may be done at around 190F. <S> This can be varied based on personal taste and experience. <S> Thermocouple probes and cables are available that can provide good service life at bake oven temperatures. <S> The probe cable, which is quite thin, can be routed out the oven door and to an electronic device which can read out the probe temperature. <A> I have no idea if it would work but perhaps AC conductivity with two stainless steel probes. <A> A combination sensor would likely be best. <S> Even though water in a baked good would boil at 100C (212F) it will still require a certain amount of time for the bulk material to reach a fixed moisture level. <S> Even below the boiling point water still evaporates it just takes more time. <S> So temperature alone would not be an adequate test here. <S> For most bake goods there should be an ideal temperature and an ideal moisture content that indicates an ideal fully baked state. <S> While there are many common high temperature thermocouples available a high temperature moisture probe is not, (as far as I've seen) especially one that might be safe for food use. <S> A non-contact dielectric transmission-line probe can make a moisture detector. <S> If such a probe were coated in high temperature plastic, or Teflon(TM) <S> this might just fit the bill. <S> I assume the concept could be tested using a thermocouple matched up with a commercially available moisture probe like this one, <S> see: <S> http://vegetronix.com/Products/VH400/ <S> (Though this one is not suited for high temperature, but it does list an application example as moisture content of bulk foods). <S> Bon Appetit <A> Another solution that would work is to have a small diameter metal tube which draws a tiny amount of air out, as it cools before reaching the detector you could use both a thermocoupler on both ends of the tube and a humidity meter to determine the current moister content inside item baking. <S> I have seen a few commercial units that does exactly this (measures dry bulb and dew point also). <A> There are a number of high temperature thermometers available. <S> For your needs, I would recommend one sold by MONNIT (about $250 sensor and gateway) on eBay. <S> This is a wireless system. <S> If you want a cheaper method, there are those with a probe and a digital display for around $10. <S> Temperature range -80 to 300 C. Good luck.
| Matching up a high temperature thermocouple with a high temperature moisture probe should do the trick.
|
Basic question - multiple solenoids in parallel Please excuse my ignorance - I am first and foremost a software person, and I only fool around occasionally with hardware... I want to get 5-6 solenoid valves working in parallel. The solenoids are 12v DC, 500mA. I have a single 12v DC, 1A wall adapter. I would like to wire up the solenoids in parallel. To my understanding, with respect to voltage, it doesn't matter how many solenoids I have in parallel: Kirchhoff's law states that the voltage will always be 12v over each solenoid, even if I turn them all on at once. However, it is also my understanding that the current (amps) will be 'distributed' across each of the solenoids in parallel. That is, the 1A will be distributed across the N solenoids such that each has a current of 1A/N on it. If I am understanding correctly, then, I would need a new 12v DC power supply with N * 500mA to adequately power all my solenoids? Thanks! EDIT: And as a more general question... What should I "watch out for"? Would too much current, or too much voltage damage the solenoids? <Q> Each solenoid want 500ma, and you need a supply that provides 500N. Watch for really hot supplies, but more likely solenoids that don't open. <A> You need a power supply that can supply 12 volts at 3 Amps or more. <S> Each solenoid will attempt to draw 500 mA. <S> If the power supply cannot provide the total current required, depending on the supply the voltage may drop, reducing the current the solenoids draw, and possibly damaging the supply, or getting to a point where the solenoids will not operate. <S> If the supply is capable of providing a larger current than the solenoids require, there is no problem - the supply will not force the excess current <S> it is capable of through the solenoids. <A> Yes, You will need a much more robust supply with current rating to supply the N*500mA plus some additional capacity to support the surge current when you first turn on the solenoids. <S> Some of the current surge demand can be met by using capacitors right near the solenoid switching point. <S> The solenoids will sink current they require according to the voltage you provide. <S> Even if your power supply was able to supply 100A the solenoid, using your example, would still draw the 500mA (plus the previously mentioned surge current). <S> This demands that you put a reversed biased diode across the solenoid coil. <S> I would put one diode right at the terminals of each solenoid. <S> This goes along with my next suggestion. <S> I would put one transistor or FET driver per solenoid. <S> This will isolate each solenoid from the others so that variations of the DC resistance of each so not cause uneven actuation as if they were all directly wired in parallel. <A> If the distance between your solenoids and power supply is considerable you also need to take the wire gauge into account as well. <S> Example: 16AWG or 1.5mm2 metric copper wire has a resistance 0.0128Ω <S> /m. @3A <S> this equals a voltage drop of 0.038V/m. <S> At a distance of 50ft or 15m for instance that would be a voltage drop of 1.15V. <S> The result is a reduced force on the armament or even malfunction of the valves. <S> If such is the case you can either move the PS closer to the solenoids or, if that's not an option, use ticker wire gauge.
| Watch out for the high voltage spike that can happen when the solenoid coil is switched off.
|
Basic common emitter circuit: voltage reduction at the output I have a basic circuit for converting the 3.3V signal of a microcontroller board to a 24V constant voltage needed to control a device switched by voltage. When I measure voltage at the output while the transistor is on, it's 0V, and when it's off I get 24V, as expected. The problem is, whenever I connect the output to the device while the transistor is off, the voltage drops to 14.8V. The voltage I'm getting seems to be dependent on the load resistor, smaller resistor gives less voltage drop, but increases current when the transistor is closed. So the question - what causes the voltage drop and how can I avoid it? In my eyes, the resistor appears to be causing the voltage drop, but why is it not the case while the external circuit is disconnected? Is the only way to avoid this using less resistance at the emitter? Thank you. <Q> The problem is that R2 (oh, right, you don't have component designators, you'll just have to figure out from context which one that is) is the impedance of your signal when high. <S> This together with the input ipedance of whatever is being connected to your output form a voltage divider. <S> For example, using the circuit you show, let's say the output is 7 V when connected to the device. <S> That means R2 is dropping 5 V, which means 5 mA is flowing thru it, which also means that is how much current the input of your device is sinking when held at 7 V. <S> To compute the input resistance of the device at this operating point, use Ohm's law. <S> (7 V)/(5 mA <S> ) = 1.4 kΩ. <S> To get a higher output voltage, lower R2. <S> However, keep in mind that this comes at the cost of higher current when the output is low. <S> Also keep the dissipation of R2 in mind. <S> In your example, the current thru R2 when the output is low is (12 V)/(1 kΩ) = <S> 12 mA, and the dissipation is (12 V) <S> 2 (1 kΩ) <S> = <S> 144 mW. Note that the power increases with the square of the supply voltage. <S> Doubling that while keeping R2 the same will cause 4x the dissipation, or 576 mW. <S> Even a ½ W resistor would be too small in that case. <S> Added: Here is one way to fix your circuit without using a lot of current when the output is low: <S> R1, Q1, and R2 are basically what you have now. <S> Q2 is a emitter follower that provides much more current output than the bare R2. <S> The output will be about 700 mV lower than the bottom end of R2, but I expect that small amount is irrelevant for a digital signal that swings to 24 V. <S> If you can arrange the output from the microcontroller to be the opposite polarity, then you can use this circuit: <S> This circuit is non-inverting, unlike your original and my example above. <S> This has both higher output current capability and lower output voltage drop compared to the circuit above. <A> It sounds like you need a circuit for a common-ground-connected load and this would be achieved by using a high-side bipolar transistor circuit like this: - Here's also a little article on high side and low side switching. <A> @ <S> I have no idea what I'm doing , the role of the resistor that should be connected between the base and the emitter (across the base-emitter junction) of a BJT is crucial to turn off the transistor... <S> but it's not so easy to explain why. <S> Well, let's try... <S> it's a great challenge:) <S> The problem is that you can surely turn off the PNP BJT by lowering the base-emitter voltage (below approximately 0.6 V); you can't do it only by decreasing the base current (by cuting off the previous NPN transistor). <S> Here you can see another voltage divider composed by the PNP collector-emiter junction (the lower leg) and the resistor in question (the upper leg). <S> When the PNP transistor is cut-off, the ratio of this divider is low enough so that the base-emitter voltage of the NPN transistor is low enough as well. <S> You can see also this resistor in the @ <S> Andy <S> aka 's solution where it is absolutely necessary to drive (not only to turn off but to turn on it as well) the gate-source junction of the "voltage-driven" FET. <S> You can think of this resistor as of a current-to-voltage converter . <S> As I can see, @ <S> Olin Lathrop has already added this (NPN + PNP) BJT circuit solution.
| The circuit you are using is for a common-positive-supply-based load i.e. if the load is in parallel with the resistor, turning the transistor on will apply 24 volts across the load (within constraints of what current the transistor can supply).
|
Help with simple Arduino/Transistor/Solenoid circuit I'm trying to use an Arduino+transistor to control a shutter (which I believe is a solenoid) at work. The shutter is normally connected to a power supply by two small wires (positive and negative) and from what I've gathered with my DMM an 11.3 V 3.8 mA current is applied to the shutter to keep it closed, and when it is opened the voltage and current drop to 0 before reapplying the current to close it again. Right now I have the following circuit configured so that the transistor base is connected to the PMW 9 pin on the arduino, which cycles between 5 seconds of output = HIGH (5V) and output = LOW (0V). What confuses me the most is that when I take measurements with my DMM I get roughly the same results (12V and 4mA) on the solenoid but the shutter doesn't close. Any thoughts? Is there something I'm missing in my circuit? The only thing I can think of is that maybe the current isn't ramping up fast enough to induce a noticeable magnetic force (I think that's how it works, don't judge me I haven't taken emag in a while), but I don't know how I'd be able to combat this. Thanks. My circuit http://www.docircuits.com/circuit-simulation-public/12041 If my circuit isn't clear enough (mostly in the arduino area) leave a comment and I'll try to clear things up. EDIT: I realize now that the arduino is actually sending a pulse-width modulated signal with duty cycle of 100%. Could this be causing problems? EDIT2: Updated the schematic. <Q> It looks like there are some issues with your circuit. <S> Summing up the comments: <S> Your diode has the wrong polarity to stop back-emf <S> Here is an updated schematic with these fixes. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> You could also take a look at this answer to see a bit more info on driving a solenoid. <A> If the Arduino is sending a PWM signal that could be the problem. <S> However, you say it is PWM with 100% duty cycle, which would be on all the time, which is the same as a DC signal. <S> Is it on and off the same amount of time? <S> That would be 50% duty cycle. <S> If you have the same current through the coil you should have the same magnetic field and pull strength. <S> The rise rate doesn't affect that. <A> Have you got the solenoid wired the right way around? <S> Some relays, which is really a solenoid connected to pull a switch have polarity for their coils, this solenoid could be the same.
| Your base resistor is too large
|
Choosing the right voltage divider by load I'm using an Android IOIO board to detect simple digital pulses from a 12v source. The input pins are 5V tolerant. Would a simple voltage divider work in this situation? I guess my concern is whether or not the IOIO would have much if any load pull when used as a digital input sensor. I would say and I don't know this for sure that the max load would be 20mA?? What considerations do I need to make in selecting the correct resistor value ratio to go from 12v to 5v? I also have these resistors available: 0Ω, 1.5Ω, 4.7Ω, 10Ω, 47Ω100Ω, 220Ω, 330Ω, 470Ω, 680Ω1kΩ, 2.2kΩ, 3.3kΩ, 4.7kΩ, 10kΩ22kΩ, 47kΩ, 100kΩ, 330kΩ, 1MΩ I've calculated that I can get 3.84V by using a 10k and a 4.7k. Will this be too much resistance? <Q> A digital pin, when used as input, offers very little input resistance. <S> Note that this holds for DC current. <S> Since you want to scale \$12V\$ to be \$5V\$:$$5V=12V\frac{R_1}{R_1+R_2}$$that leads to \$R_1=0.417(R_1+R_2)\$. <S> There still is a degree of freedom, that is the total divider resistance. <S> The factors that can help you to choose it are: <S> Your \$12V\$ output resistance <S> Your Android board input resistance <S> The speed of your pulses Please note that the third factor might be the dominating one. <S> A good cmos circuit has an input impedance composed by the parallel of a resistor and a capacitor, the resistor being some \$10^{12}\Omega\$ while the cap being in the \$10\text{pF}\$ ballpark. <S> That means that you can forget about factor 2. <S> A good digital circuit can usually deliver <S> \$1\text{mA}\$ at least , maybe reaching \$10\text{mA}\$ in most cases. <S> Moreover your driver circuit works at \$12\$V, that's probably quite stiff. <S> Factor 1 should not be a concern too then, unless you are going to use very low resistors for the divider. <S> Now to factor three. <S> The cmos input capacitance sees a resistance that is the parallel between the divider resistors\$^1\$, i.e.$$R_P=\frac{R_1R_2}{R_1+R_2}$$As you might know this whole circuit behaves like a low pass filter, its dominant pole being\$f_p=(R_PC_{in})^{-1}\$, where \$C_{in}\$ is the cmos input capacitance. <S> Now, you wanna keep that pole quite higher than the higher frequency you want to read on the board. <S> Assuming your highest frequency is \$1\text{MHz}\$ you need \$f_p\gg10 <S> ^ <S> 6\text{Hz}\$ <S> that leads to \$R_P\ll(10^ <S> 6\cdot C_{in})^{-1}=100\text{k}\Omega\$. <S> Let's choose \$R_P\approx10\text{k}\Omega\$, and since the two resistors will be of the same order of magnitude \$R_P\approx0.5(R_1+R_2)\to R_1+R_2 \approx 20\text{k}\Omega\$. <S> Finally:$$R_1\approx <S> 8.3\text{k}\Omega$$$$R_2\approx 12\text{k}\Omega$$ <S> Now you need to choose between your resistors, that are quite limited actually. <S> Depending on your signal bandwidth you can safely increase the values somewhat, just keep the 2:3 ratio. <S> 22k and 33k would be just perfect, if you are ok with the filtering involved. <S> If you want fast signals go with 2k2 and 3k3 and call it a day. <S> \$^1\$ Actually you should sum the \$12\$V device output resistance \$R_o\$ to \$R_2\$ <S> but I am assuming <S> that \$R_o\ll R_2\to R_2+R_o\approx R_2\$. <A> Only if the pin is trying to drive an output voltage will it push or pull any significant current. <S> The pins are 5V tolerant... <S> but what's the standard IO voltage? <S> 3.3V? <S> I'd select the resistor values to give ~3.3V if that's what the IO port runs at. <S> One resistor at 3.3K and two others at 1K and 220 in series to give 1.22K would get pretty close to 3.3V (3.239) <S> How much current can the 12V digital source provide? <S> If it's very low (a high impedance source) <S> then the divider won't quite do what you expect. <S> If it's actually some kind of digital IO pin output then you're probably fine. <A> There are two competing considerations: Resistor values that are too low can draw too much current from the source and cause its voltage to sag. <S> Resistor values that are too high will no longer behave as an ideal voltage divider. <S> You should look at the documentation for the max source current from your 12V source to check #1, and look at the documentation for the input pin on your Android IOIO board to check #2. <S> If it's not documented, perhaps you can find a schematic and see what it is connected to; perhaps those components will have datasheets.
| If the pin is configured as an input, then you should get next to zero load through it. The potentially time-varying load resistance will become part of the resistive divider equation, and at very high values leakage currents due to board contamination can even become an issue.
|
How to prevent op amp from saturating? How can an op amp be prevented from going into saturation if the feedback is intermittently disconnected? For example, in this circuit (simplified case of a real-life problem), the op amp acts as a current source to a load, but the load may be disconnected sometimes. When the load is disconnected, the op amp output goes to the positive rail and the op amp goes into saturation. When the load is reconnected, the op amp takes extra time to start regulating current) and then slews to the expected current set point. Depending on the op amp, the time to recover from saturation may be very long. The current through the load is the maximum possible for that time (ouch). How can saturation be avoided in this case? Are there some additional components to a feedback network that would do it? Perhaps some kind of input or output clipping circuit? Are there op-amps that would inherently limit their outputs (or inputs) some voltage away from the rails using built-in circuitry? <Q> A zener diode connected from op-amp output to inverting input (possibly with a series std diode) and NOT switched by S1 plus a resistor from Vsense to inverting input will limit Vout+ excursion. <S> If this is dual supply then back to back zeners will do the same thing symmetrically. <S> When Vout approaches Vzener negative feedback is provided. <S> The resistor from OA- to Vsense needs to be large enough for the zener to dominate with minimal effect from Rsense. <S> A 1K should be fine but something like 100 x Rsense for low values of Rsense should be an OK compromise. <S> Zener leakage at low output deviations should be "low". <S> A more elegant solution implementing the same principle with more complex circuitry would yield truly minimal effect when the load is connected. <S> Added: <S> The centre cannot hold! <S> * <S> I knew I should have added the extra :-). <S> I thought about commenting about frequency response but didn't. <S> As WhatRoughBeast has pointed out,the zeners have capacitance which may need to be accounted for, although in most cases the effect is probably minimal. <S> eg with say Risol= 1k and <S> if Czeners = 1 <S> nF <S> then the time constant is t=RC <S> = 1000 x 10 <S> ^ <S> -9 = <S> 1 uS. <S> With 100 R it's 0.1 uS. <S> Whether this matters or matters much depends on the application. <S> Zener capacitance varies with (at least) model, applied voltage (forward or reverse) temperature, frequency. <S> Actual values can vary widely but 1 nF seems a good rule of thumb to start with. <S> Low capacitance versions are available. <S> The effect of the forward biased zener in series with the reverse biased zener at voltages << Vzener is left as an exercise for the student. <S> This 69 page RENESAS application note provides an excellent overview of zener diode charactyeristics. <S> Pages 29-31 provide information on zener capacitance aspects - with numerous graphs showing examples of voltage versus capacitance. <S> Series: .............. <S> Capacitance at 0.1 V HZS-LL ....1-10 pF <S> HZS-L ..... <S> 10-40 pF <S> HZS ....... 30-200 pF <S> HZ ......... <S> 30-200 <S> pF <S> BUT this older ONSEMI application note <S> TVS/Zener Theory and Design Considerations indicates values in the 1 to 10 nF range in some cases. <S> Capacitance starts on page 34. <S> These zeners are lower capacitance than many at 150 pF typical at 0V at 1 MHz. <S> Capacitance falls with increasing reverse voltage. <A> This could be done by changing the switch to from a SPST to a DPST type and adding a local feedback resistor Rfb. <S> When SW1 and SW2 are open feedback would be provided by Rfb. <S> Value of Rfb would be much larger than that of RLoad so that with the switches closed, RLoad and Rsense would dominate. <S> For example if RLoad were 1k Ohm, Rfb could be 100k Ohm. <A> You know when S1 is on, and when it is off (or open). <S> Create a S1b (inverse of S1) <S> signal, and using it in the following situation: <S> Your opamp is either differential (and you are providing a simple diagram), or differential-to-single-ended. <S> In either case, you can short the 1 - differential outputs in a differential amplifier2 - the single-ended output to the internal node in the differential branch. <S> Of course, this kills the gain, but everything is biased properly and the amplifier doesn't saturate. <S> We do this all the time in our circuits. <S> It's simple, and it works. <A> The easiest solution would be to parallel the load with some kind of nonlinear network such as two series Zener diodes, two back-to-back LEDs or two diodes. <S> Of course the leakage would take current from the load, so that may or may not yield acceptable performance. <S> Op-amps that limit are available, but they're not all that common. <S> You may also be able to find a conventional op-amp with a short recovery time. <A> You should examine why you are disconnecting the opamp from its load in such a manner. <S> If you want to shut down the current, driving the positive input to 0 would be better. <S> What are you trying to accomplish overall? <S> Why do you think you have to break the connection between the load and the output of the opamp? <S> Step back two levels and explain what's really going on.
| The only way to keep the OpAmp from saturating is to provide an inner feedback loop. Here are some ROHM zeners specifically designed to be low capacitance.
|
what could happen if i touch the two electrical wires of a 120 v with my hands? In my house there is 2 wires the black one and the red one, what could happen y for example I touch both wires with my hand. we have 120 V, Pd. somehow we tried to install a lamp there but didn´t work.I have googled it and it says that if i have sweety hands i will get only 12 mA that will hurt me but it won´t be fatalso what could happen? <Q> DO NOT TOUCH AC POWER <S> WIRES WITH YOUR HANDS!! <S> A 120 Volt or 240 Volt shock can cause serious injury! <A> what could happen if for example I touch both wires with my hand? <S> Death is a certain possibility. <S> If you do not know how to check for "liveness" then you also risk creating a fire - or just killing yourself or someone else. <S> Best is to use a test meter - an AC voltmeter suited to 120 VAC operation. <S> You COULD use a mains rated lamp with two test probes (wire ends) with 2 INSULATED <S> LEADS - and be aware that you could kill yourself. <S> If you touch the two test leads on a power source elsewhere and the bulb lights and it does not happen on your target wires <S> they MAY not be live. <S> One could be live and the other not - this may not light the bulb <S> BUT MAY still KILL YOU. <S> A theme is developing here :-( <S> :-(. <S> If the wires were live at one time there may be a blown fuse or a removed fuse or a circuit breaker that is turned off. <S> If so, restoring power to the circuit, may restore power as desired, or just may set the building on fire. <S> Having an electrician or knowledgeable friend have a look for you is a very very good idea. <A> As stated do not touch AC POWER WIRES WITH YOUR HANDS or any sort of wires if you have to ask. <S> If your lamp doesn't work, measuring the voltage with your body is one of the worst ways to figure out if the voltage is on. <S> A dramatization of the effects of touching wires can be seen in the video below with some description of <S> how environmental (like shoes) effects can play a role: https://www.youtube.com/watch?v=TwIvUbOhcKE
| And along the way it just may kill you. In the US or Canada, you will probably find 240 volts between the red and black wires, but 120 volts from either one to the white (neutral) wire. A local hardware store can probably instruct you in the equipment you need to detect if they outlet is working or not.
|
How to convert an array of pixels to jpg or png? I am doing image processing project in VHDL. And as output am getting array of pixels (32 bit each). I want test this output data visually, for that it must be converted to image either png or jpg or bmp. How can I do that? Edit: Or if am getting same data in four different files like alpha, red, green and blue in a.txt, r.txt, g.txt and b.txt respectively. Does this make it easier to get the image ? <Q> What about Open cores <S> jpg encoder ? <A> Write out image data in ascii PPM format is easy: http://en.wikipedia.org/wiki/Netpbm_format#PPM_example <S> A lot of image viewer understand that format, for example Irfanview. <S> There's also a more complex format supporting 32bit with alpha channel: http://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format <S> So you at least have to create the right header in front of your data. <S> The netpbm package delivers some command line conversion tools:pamtotiff, pamtopnm, pamtojpeg2k,... <S> I often used that ppm format for testbenches in the past... <A> There, probably, many ways to do this, but if you can use Matlab, this should not be too difficult. <S> It's been a long time I used it, so I do not remember the details, but the general approach is as follows: <S> First, you need to read out the values from the .txt file into your workspace. <S> Create four equal size matrices and load each of them with alpha, red, blue, greed data respectively. <S> You will have to write a small function to copy data from the txt matrix. <S> Can not tell you how, because I do not know how the data is stored in the .txt file. <S> There are different ways to display images in Matlab. <S> Check out the help file on how to create a RGB image from its components. <S> There is a built in function that will do it for you (concatenation). <S> So, when you have separate R G B matrices/channels (of equal size), you can concatenate them across the third dimension: im = cat(3,R,G,B); <S> Then you can use these functions (and other) to display the image: imshow(im) <S> imagesc(im) <S> I do not know how the alpha channel applies to the RGB image. <S> Read some docs on it. <S> Maybe you do not need it. <S> In any case, you can easily edit the data in the matrices so it can be accepted for image creation. <S> Once you have the channels you can create and save the image in a variety of common image formats that are supported by Matlab, including .jpg and .png. <A> Insert VHDL code in your testbench to write the raw frame to a file. <S> Then use a jpeg encoder/compressor to generate the jpg, and finally open it with your favorite image viewer. <S> I can vouch for this (aptly named) jpeg-compressor . <S> Using it couldn't be easier: // <S> Writes JPEG image to a file. // <S> num_channels must be 1 (Y), 3 (RGB), or 4 (RGBA), image pitch must be width*num_channels.bool compress_image_to_jpeg_file(const char *pFilename, int width, int height, int num_channels, const uint8 <S> *pImage_data, const params &comp_params = <S> params()); <S> You just need to write a tiny C++ program that calls this function. <S> Some years ago I implemented it on Nios II to save (and later load) <S> live video snapshots, and it worked well. <S> Slow, yes, but sure. <A> Basically, you want to interpret a raw array of pixel data as a image. <S> You may be able to use my INF image file mechanism for that. <S> You create a text file that contains commands to the INF reader to explain where the pixel data is in the raw array. <S> Various image manipulation utilities, which include the INF file driver, should be included in my Full Runtime release at http://www.embedinc.com/pic/dload.htm . <S> After you install that, documentation files will be in the DOC directory within wherever you installed the software to. <S> In particularly, look at the INF doc file to see if this will do what you want. <S> The image manipulation programs are generally named IMAGE_xxx, with corresponding doc files in the DOC directory. <S> The supported file formats are listed in the IMAGE_TYPES doc file. <S> You could also use IMAGE_DISP or IMAGE_EDIT to see the image directly without it first being converted to a standard file format.
| If you set up the INF file right, then IMAGE_COPY will be able to convert your pixel data to a JPG file, or a number of other file formats.
|
Why is the first band on a resistor never black? I'm taking an electronic circuit analysis class, and I was asked to give the color of the 3rd band of a 1MΩ resistor. My answer was blue, thinking it could be black-brown-blue (01 * 1MΩ), but the automated quiz said the correct answer was green (brown-black-green). So I did some research, thinking there were just multiple correct answers, and I read in a few places that the first band on a resistor is never black (0). Why is this? Does a black first band have some other meaning? It would really help me remember it if I knew the history or reasoning behind it. This question has been answered. For further reading on zero-ohm resistors mentioned in the answers and comments here, I found these questions and answers helpful: What is the usage of Zero Ohm & MiliOhm Resistor? Zero ohm resistor tolerance? <Q> The first band is never black for the same reason that you always write numbers scientific notation with a single nonzero digit in front of the decimal place (e.g. 6.022e23) - convention. <S> Generally the resistor specifications will all have the same number of nonzero significant digits (2 or 3, depending on the tolerance) except for a couple of values, namely even powers of ten (1, 10, 100, etc) and possibly a few others by coincidence. <A> Here is an example of how these codes would be read on a garden-variety 1-kilohm (or “1k”) resistor. <S> Reading the bands from the left, the brown band represents 1, and the black band represents 0. <S> Putting these together gives “10” for the base value. <S> (The first band is almost never black, except in the unusual case of a “zero-ohm” resistor: a single black band, otherwise known as a “wire.”) <S> The third band is the multiplier band; red signifies multiplication by 100, making the total value 10 x 100 = 1,000 ohms — or “1k.” <S> The 4th band is the tolerance band; gold signifies that the true resistance value of this component should be within 5% of the stated value (950 to 1,050 ohms). <A> There are additional cases where the first band can be black besides the wire or jumper case. <S> I have some .100 ohm resistors and some .050 ohm resistors that are coded with a black first band. <S> Otherwise, how would you code them? <S> Blk, Brn, Blk, Ag, Brn = 010/100 1% = <S> .10 <S> Blk, Grn, Blk, Wht, Brn <S> = 050/1000 <S> 1% = .050 <S> +/- <S> 500 <S> uOhms <S> Probably whoever coded these decided the 10^9 multiplier was unneeded and made this up. <S> After all, how often do you see a 100 Gohm resistor? <S> These probably came from Ohmite, as the picture on their site is identical to the resistors that I have, including the color code. <A> I believe this is a black first resistor. <S> Reading the top (horizontal) resistor right-to-left. <S> Not as obvious in this photo, but to the naked eye, the left (tolerance) band is definitely gold. <S> The first band looks 100% black. <S> It's reading a consistent 148 Ω, but the left lead heated up and separated from the board. <S> As I read it, it's black , Black or Brown, Orange , Gold . <S> Damaged resistors (as I understand it) usually increase in resistance (though can short [usually high value resistors]). <S> But it gives a consistent 148 Ω reading. <S> Another of the exact same resistor in another electronic burnt up and reads irregularly <S> (manipulating the leads changes value drastically). <S> I've seen as low as 6 kΩ and as high as half a mega-ohm (so it's fried).
| Black first essentially would be a 0 Ω resistor (so maybe a jumper at best).
|
Finding serial port on generic IP Camera PCB Background story is that during firmware update of a generic IP Camera , with great wisdom, I managed to wipe part of the embedded Linux files, and in order to recover it , I need to access the bootloader through serial. The PCB has no special identification, except for the strings "MP-3.4" and "1238" on the board itself. Top view: Bottom view: First I looked for the J2 label, which from my understanding usually means JTAG or Serial port with this kind of generic camera. My first suspicion laid upon the 4 connections at the top left corner of the top view: I measures 3.3v between the two adjacent right pins, but the two to the left did not provide any output, and the Serial to USB adapter I am using remained silent. I can identify all the chips on the board, as someone else with the same board described here , but could not find any schematics for it that would direct me to the Serial pins. Do I have a better option other than brute forcing every pin that looks like it's not connected to any component? Is there some kind of best practice to follow when reversing such board? Anyone has any experience with this board?.. <Q> Well I'd start with the datasheet for the ralink. <S> He's clearly the controller in this system. <S> It will take a lot of poking and measuring <S> but maybe you'll get lucky and their boot loader puts a message out at startup <S> and you can see that on a scope. <S> Reverse engineering is an exercise in patience and trial and error, followed by more trial and error. <S> On the other hand the Linux files are not stored in the ralink but rather externally in a little flash part. <S> The datasheet suggests it supports boot from spi-flash, so look up the other part numbers on the chips on your board and see if one is a spi-flash. <S> You could then just pull it off and program it with a little programmer <S> (they're not that expensive). <S> That might be an easier path if you know what needs to be programmed in. <S> Even better if you have another camera and you could just clone its flash. <S> It does mention nand flash support <S> but I didn't see boot from nand flash. <A> Although this post is old, I'd answer this in case it can help someone in future. <S> We can use Jtagulator to find the JTAG pins. <S> Module can found on http://www.grandideastudio.com/jtagulator/ or JTAGenum which is open source which can be ported on Raspberry Pi or Arduino module. <S> https://github.com/cyphunk/JTAGenum <A> If I'm understanding you correctly you <S> don't have the exact same camera discussed in the openipcam.com forum thread you linked? <S> Do you know that it at least has the same chips? <S> If they're different board designs then any information from that thread is probably useless. <S> The first step is working out what chip you want to talk to. <S> The ones I can read are: Pulse <S> H1102NL - Ethernet transformer <S> Ralink RT5350F - SoC combining Ethernet, wifi, USB host and CPU ULN2803AG - Darlington transistor array <S> I suspect that you want to talk to the Ralink. <S> Unfortunately it's a 196 pin BGA package, which makes it very hard to find where specific pins go on the board. <S> The first step is probably looking at the datasheet and identifying where the JTAG pins are located. <S> Page 6 tells us that they are pins: <S> A11 JTAG_TRST_N <S> A12 JTAG_TCLK <S> A13 JTAG_TMS <S> A14 <S> JTAG_TDI <S> B11 JTAG_TDO <S> The pinout for the part is given on page 217, which tells us that row A is the one marked with a dot. <S> That means that your JTAG pins are the ones closest to the bottom left of your IC. <S> It seems to me quite likely that the top 4 of that run are A14 down to A11 (B11 might be anywhere...) <S> You could try tracing the traces through their vias and around the board (which appears to only be double layered) until you reach a connector or a dead end. <S> Ultimately reverse engineering a board of which you have no real knowledge is hard, especially with BGA packages. <S> It's also possible that there isn't an accessible JTAG connector on the board.
| You could look at its pin list, find the location of serial or jtag pins, and then search that corner of the chip on the board. The datasheet is here . There's a big run of traces going from that area towards the bottom left of your board.
|
How to display I2C address in hex The I2C communications bus uses 7-bit or 10-bit addressing to address slave devices. Taking the more common 7-bit addresses, each packet sent on the bus by the master starts with an 7-bit address followed by a 1-bit read or write indicator (\$\text{R}/\overline{\text{W}}\$). Most datasheets only give the I2C address for their device either in binary notation or as bits on timing diagrams (with notes for configurable address bits), which are both unambiguous as they either display seven or eight bits so you can tell if the \$\text{R}/\overline{\text{W}}\$ bit is included. This seems to follow the official NXP I2C specification . The problem comes when trying to write down the address in hex. Different sources convert the address in different ways: Convert the 7-bit address to a hexadecimal value in the range 0x00 to 0x7F 0b101 0011 becomes 0x53 Examples Robot Electronics I2C tutorial , Linux i2cdetect tool , STM32 CPAL library , Arduino Wire library Include the \$\text{R}/\overline{\text{W}}\$ bit as the LSB and give two addresses, one for reading and one for writing in the range 0x00 to 0xFF 0b101 0011 becomes 0xA6 for writing and 0xA7 for reading Sometimes only the write address (e.g. 0xA6 ) is given Examples: 8051 Project tutorial , STM32 HAL library ( example of confusion ), Microchip PIC code examples (CE119) , Saleae Logic protocol analyser These two options are not always distinguishable. Clearly using binary notation is better as it gives you an unambiguous address, however this is not always possible. One notable case is on C/C++ where there is not a particularly standard way of writing binary numbers . This leads to the problem I'm having where specifying constants for devices in the circuit is ambiguous. So in choosing a standard for our schematics, documentation and code (C++) we have to pick one way or the other. That leads to my question: Is there a dominant way of displaying an I2C address in hexadecimal notation, or are both used commonly? <Q> I know what you mean. <S> I have seen these ambiguities in documentation too. <S> That doesn't make it right, though. <S> I personally only communicate the address as a 7 bit value, whether in binary (0-1111111), hex (0-7F), decimal (0-127) or some other scheme. <S> The R/W bit is NOT part of the address. <S> It and the address are two separate fields that happen to be crammed into the same byte. <S> Unfortunately, even though the 7-bit address interpretation is correct and does seem to be the more common, there is a lot of bad documentation out there. <S> This means you can't count on the next datasheet you read to do it one way or the other. <S> When reading documentation, this is a issue you just have to be aware of and be extra careful to see how exactly the address is being presented. <S> So far I haven't come across a datasheet where this couldn't eventually be figured out. <S> When writing your own documentation, please do the rest of the world a favor and express the "address" as a 7 bit value. <S> If you want to show it with the R/W bit, call it the "address byte" or something to make this clear. <A> In my experience, the most common way of expressing an I2C address is to use the 7-bit form in hexadecimal. <S> To ensure no ambiguity, be consistent: <S> In your I2C code, make sure every I2C function takes the 7-bit address as an argument and not the 8-bit address. <S> Note: I was wondering what you meant by binary being less ambiguous <S> and I realised it was because with binary you can choose to pad with zeros to give a number with either 7 or 8 digits, and thus distinguish between them. <S> Clever! <S> I wonder if people will even notice one less digit though, so probably best to be explicit. <A> There isn't a standard, and it is an endless source of grief. <S> Linux i2cset and i2cget use the 7-bit notation, so that's the closest to 'standard' as there is. <S> There exist other tools / platforms that use 8-bit. <S> Datasheets aren't consistent. <S> Chaos! <S> Anyway, when I make a document notation about I2C, I'll represent it as both a binary and hex (7-bit) value as follows: periph_i2c addr: {1 1 0 0 1 0 1 r/w} (0x65 hex) <S> This makes clear which one I mean.
| In your documentation always refer to the address as the 7-bit address.
|
Are there crystals that are tolerant of high pressure? Are there crystals that are tolerant of high pressure? Or do they all have an open space in their case? A customer wants to use our product in a submarine, immersed in high pressure oil. I thought we'd be OK using SMD crystals, based on this Wikipedia article and based on reading the reference from the US Dept of the Navy. Instead, under pressure, the top of the case of the crystal imploded. (Picture of imploded SMD crystal after high pressure oil immersion test.) Obviously, there's an air pocket in there. It was suggested that we pot the crystal in epoxy. But I have some doubts that that would work: The pressure cracked the ceramic body of the SMD crystal; I doubt that epoxy can withstand what ceramic couldn't. (Can a kind soul with 300 reputation points create a "high pressure" tag and add it to this post, please?) <Q> I've used solid ceramic resonators in high-pressure environments (inside oil-filled canisters at 120m below sea-level) without any trouble. <S> Of course as Majenko has already alluded to they're typically not quite as precise as a crystal usually is, but they quite happily clocked my PICs and were accurate enough to allow my serial comms at a few 100k-baud. <S> I did consider encapsulating a standard crystal in epoxy as suggested bu others, but my concern was that although many epoxies are generally tougher and harder to break than a crystal, I didn't think they would provide much protection. <S> My thinking was that the reason epoxy is tough & hard-to-break <S> is that it is able to flex or deform somehow by some small amount before breaking. <S> But this would be transferring force to the crystal - exactly what I was trying to avoid. <A> Talk to your crystal manufacturer. <S> They are more used to interacting with small customers than most component suppliers, given that they supply custom cuts and custom frequencies. <S> If they have packaging solutions to meet your needs, they are the best equipped to answer your questions. <S> In the UK I could recommend IQD or Euroquartz as useful contacts; I have no suggestions for other locales. <A> MasterBond makes some high pressure stuff that would probably work for you. <S> There are data sheets available but you have to jump through some hoops to get them.
| If you use a high compressive strength epoxy with a low dielectric constant (so that not much capacitance is added between the crystal's pins) you should be OK.
|
Generating electricity by moving door handle to produce 3 Watts? I want to attach a generator to a door handle and have the output charge a battery. My system needs to provide about 3 Watts. A similar question was asked here and I referenced it to get an idea of what kind of force, torque, power, and energy are needed to turn the door handle. These values, however, were calculated without the generator attached to the door handle. My question is, how would attaching the generator to the door handle affect these values? I know that the generator will also require some torque to turn it. What I'm confused on is if I should just connect the generator directly to the door handle or use gear ratios to figure out some gear system? The gear system would be to increase the angular velocity of the generator based on the gear ratio and the angular velocity of the door handle. Generators that I have looked at usually have some rating where they say what voltage and current are produced based on the rpm, so I figured I could get these rpms with gears, but gear ratios also relate the two torques. I know there is more than one question in here, but if you could help me with understanding any of this I would really appreciate this. Even if this isn't quite feasible, what would be the major constraints? <Q> This battery should be able to power a pic 24 continuously at 0.63 mW, should be able to keep a fingerprint reader on continuously at 429 mW, and keep a wifi module in standby mode continuously at 3.96 mW. <S> I am also considering attaching a dc motor to the deadbolt latch and driving it with an h-bridge. <S> This would also be powered by the battery at 1 W, but this isn't continuous and would last for about 0.5s. <S> You say you want a continuous mean power output of 0.63 <S> + 429 + 3.96 mW + 1W very occasionally = 429mW + irrelevant. <S> In a day that's about 10 Watt.hours <S> So a user inputting 3 Watts continuously via a door handle would need to do so 10/3 <S> = 3 + hours per day. <S> Or 30 W for 20 minutes - that's a significant exercise level. <S> Or 300 Watts for 2 minutes - most people could not do that. <S> ie you can easily see with such simple calculations that what you have asked for is unrealistic AND that you do not need most or the power you requested. <S> It seems extremely unlikely that you need a continuously powered card reader or that it would need siuch a high poer level in standby mode. <S> Try again. <S> 5 mW to <S> 10 mW average should be enough. <S> Over 24 hours, 10 mW = <S> ~ <S> 0.25 W.h 0.24 W for 1 hour 2.4 W for 6 minutes 24 W for 36 seconds. <S> If you can obtain that in 10 sessions it's 24W x 3.6 seconds <S> x 10 Or 2.4W <S> x 3.6 seconds <S> x 100 <S> The last figure sounds like what you might easily be able to obtain from opening a door without it bein too too obvious. <S> In practice you'd want several times more to allowfor inefficiencies and practicalities. <S> Is 100 operations a day too many - that will depend on application. <S> But the above gives you a basis for a realistic calculation using assumptions that suit you. <S> Once you have refined the spec we can talk about power generation. <S> At 100% efficiency <S> Watt.seconds ~= <S> kg_force x metres travelled x 10. <S> This could be derived from opening a door, pulling on a lever or eg standing on a step (that moves under applied weight to power an alternator). <A> Consider getting power from the opening of the door instead. <S> It's a much longer lever and the user can apply more force. <S> For example, you could have a weight on a cable that's lifted on opening, then slowly descends powering a generator. <S> You could even have it descend <S> very slowly like a clock weight, although efficiently generating electricity from that may be tricky. <S> Whatever you do charge/discharge inefficiency + self-discharge of a battery is going to consume quite a bit of power. <S> You can also do much better on the power consumption. <S> Capacitative sensing can be done with very low power consumption. <S> If the mounting plate for the fingerprint reader is a sensor then you can have it woken up on demand. <S> Don't forget to add a couple of indicator LEDs to confirm that the reader is actually working if you do this, so you can debug being locked out. <A> Energy harvesting is for micropower devices, not wifi, actuators and continuous drain devices. <S> Look for a hand cranked USB charger to get an idea of a practical, cheap generator, and read the reviews to see how much / little power it generates. <S> If you can't get external power, your best bet is a primary battery, or solar cells for charging.
| (I still think it's much easier and more reliable just to have a battery or mains connection; have a look at e.g. Lockitron.)
|
Chip Holder for LM8560 I am building a digital alarm clock, and I need a chip holder for the LM8560 chip. I tried a sop 30 to dip 30 holder. The chip fits on width but not length. The chip is to long and even if I used sop 40 to dip 40 chip holder not all of the pins on the chip would align with the holes in the socket. I have tried making a chip holder by drilling holes in a piece of MDF, sitting the chip in those holes and soldering wire to the chip pins. However in the process I believe I damaged the chip and the circuit will not work properly. Could someone please recommend me a chip holder that would work, or a method of building one that would not require soldering anything to the chip pins? Or even a company who makes custom chip holders? <Q> Try using swiss machine pin headers. <S> If the pitch doesn't match the pitch on your chip, you could look at making a custom little PCB socket to convert to a more useful pitch too. <A> The datasheet I found show the LM8560 being a SDIP chip and not SOP. <S> This means you need a SDIP to DIP adapter <S> (sdip is a skinny dip which is thinner than dip, sop is a surface mount pkg which is thinner and shorter than dip). <S> I have used these guys before: http://www.epboard.com/eproducts/ezadapter.htm#Shrink%20DIP%20%28SDIP%29%20to%20DIP%20Adapter <S> They have a SDIP to DIP 28 pin adapter if that's what you require. <S> They also do custom adapters where you can give them the specs and they make the adapter for you. <A> According to this almost-10-year-old post from a usually reliable source, production SDIP sockets (1.778mm pitch) are (or were) available from Assman and test sockets from Yamaichi. <S> Also, for an intermediate cost (machined pin rather than stamped), currently, Mill-Max and Precidip have 1.778mm pitch 28-pin sockets for about $5 each in singles. <S> For example, this one <S> P/N 117-93-628-41-005000 from Mill-Max.
| Mouser currently has 28-pin ZIF 1.778mm pitch sockets from 3M in stock 228-1290-00-0602J and, as usual, they're quite expensive.
|
Breadboard 7408 2 input AND gate always supplying current, regardless of input I am currently trying to wire the logic for my dual 7-segment display. I am stuck at my AND gate, and having tried an OR gate as well I have been unable to find why, regardless of input, the output of the gate is always supplying current. Below the inputs are shown as leading to nothing, Va is set on my DC power supply as "5V FIXED 3A." In accordance with the diagram, the 7408 chip is being supplied the 5V in the top right and grounded on the bottom left. Could anyone point out what mistake I am making that is causing for this AND gate to supply current regardless of the input? Thank You! <Q> Yup. <S> That's a classic, all right. <S> One of the interesting characteristics of the 7400-series TTL logic family is that an open input behaves like a logic HIGH. <S> It's not good practice to do this, since such unused inputs can act like antennas and start picking up noise, but it's working just fine in your case. <S> In your circuit, tie each input to +5 with a 1k resistor. <S> When you want to drive that input LOW, just ground it. <S> And since you're just starting, you need to start developing good habits. <S> That means do not leave any inputs on a chip floating. <S> You can usually get away with it with TTL and LSTTL, but it will drive you crazy if you do it with CMOS. <S> In this case, tie all 6 unused inputs of the 7408 together, and tie the whole thing to +5 with a 1k resistor. <S> This is called a decoupling, or bypass, capacitor, and for more complicated circuits one capacitor per IC is a very, very good idea, with each capacitor connected right to the power and ground pins of its' IC. <S> It doesn't have to be a high-voltage capacitor, since it will only have 5 volts on it. <A> This is the internal circuit of a 7400 TTL NAND gate. <S> If you leave A and B open, current flows via the 4kΩ resistor (top-left) through the base-collector junction of Q1. <S> This makes Q4 conduct. <S> The same happens when A and B are wired to +Vcc. <S> For TTL gates there's therefore no difference between an open input and an input tied to +Vcc. <S> Not related to the problem but just in case. <S> You're using displays with a common cathode which can be connected directly to the output of a TTL gate because the internal 125Ω resistor limits the current $$I_{led} <S> = \frac{3.4-2.2}{125} <S> ≃10mA$$ <S> 2.2V is the approx. <S> LED voltage drop and 3.4V is the typical output voltage for a TTL gate. <S> This is sufficient to light up most LEDs although some might be a bit dim. <S> If you use common anode LEDs (Wired to +Vcc) you have to put an appropriate resistor in series with the LED to restrict the current. <A> Bipolar TTL inputs will (usually) appear as High (logic 1) when not connected to anything. <S> They must be connected to ground, either directly or via the output of another chip, to be seen as Low (logic 0). <S> This applies to the plain 74xx, 74LS, 74ALS logic families. <S> For the CMOS versions (74HC, 74AC), the inputs are very high impedance and must always be connected to something - either Vcc, Ground, or the outputs of other parts. <S> They must never be left unconnected.
| Also, get a 0.1 uF ceramic capacitor, and connect it between pins 7 and 14.
|
How does the CPU handle XCHG internally? While designing my own 16-bit CPU I wonder how the register-register XCHG instruction is executed internally. From computer science I know the DLX which doesn't provide XCHG and therefore doesn't need to access two registers in write-back (would this even be possible?), but only the destination register.I guess this isn't done in one cycle, right? Thx in advance <Q> You have a couple of options. <S> You can add the extra hardware in the data path to allow it to occur in one cycle. <S> This has difficulties in a pipelining architecture because a dual port register file is often used for simultaneous reads and writes for the different stages. <S> This adds the need for a second write port. <S> Without this, there really is not a way to prevent a bubble in the pipeline from eventually having to occur. <S> A generally better option is to simply have a multicycle instruction. <S> The important thing here is to make sure you prevent any other operation such as interrupts or other bus masters (in the case of a memory swap) from make this appear non-atomic. <S> The multicycle instruction option is what is generally done. <S> For example, the ARM SWP and the XCHG instructions are multicycle. <A> Another option is to mess with the register addressing, I suspect this is how the Z80 EXX opcode swaps register banks in 4 cycles. <S> it's possibly also how EX DE,HL swaps two register pairs registers in 4 cycles on the same micro. <S> the same cycle count it takes to copy one 8-bit register to another. <A> This instruction is most likely implemented using register renaming. <S> With register renaming, the register contents are assigned to registers names with tags. <S> This makes swapping registers very easy - just swap the tags. <S> No need for multiple register writes in the same cycle. <S> This is how the Z80 implemented the EX instruction. <S> See: http://www.righto.com/2014/10/how-z80s-registers-are-implemented-down.html Swapping registers through register renaming <S> The EX DE, HL instruction exchanges the DE and HL registers. <S> The EX AF, AF' instruction exchanges the AF and AF' registers. <S> The EXX instruction exchanges the BC, DE, and HL registers with the BC', DE', and HL' registers. <S> These instructions complete very quickly, which raises the question of how multiple 16-bit register values can move around the chip at once. <S> It turns out that these instructions don't move anything. <S> They just toggle a bit that renames the appropriate registers. <S> For example, consider exchanging the DE and HL registers. <S> If the DE/HL bit is set, an instruction acting on DE uses the first register and an instruction acting on HL uses the second register. <S> If the bit is cleared, a DE instruction uses the second register and a HL instruction uses the first register. <S> Thus, from the programmer's perspective, it looks like the values in the registers have been swapped, but in fact just the meanings/names/labels of the registers have been swapped. <S> Likewise, a bit selects between AF and AF', and a bit selects between BC, DE, HL and the alternates. <S> In all, there are four registers that can be used for DE or HL; physically there aren't separate DE and HL registers. <S> The hardware to implement register renaming is interesting, using four toggle flip flops.[7] These flip flops are toggled by the appropriate EX and EXX instructions. <S> One flip flop handles AF/AF'. <S> The second flip flop handles BC/DE/HL <S> vs BC'/DE'/HL'. <S> The last two flip flops handle DE vs HL and DE' vs HL'. <S> Note that two flip flops are required since DE and HL can be swapped independently in either register bank.
| The Z80 has several instructions to swap registers or register sets.
|
Tips for desoldering difficult to desolder mini transformers I have to replace a couple of small transformers without destroying the PCB or the transformers. Unfortunately my phone camera is unusable so I need to describe them and what makes the situation so hard for me. The transformers are almost cubical with a little more than 1cm in size. They consist of two E shaped parts of ferrite, that are sitting on a plastic base. On opposite corners there are three pins on each side, close together (total of 6, lets call them winding pins). On the other two (opposing) corners, there are on each side one pin that is part of a kind of metal clamp (lets call them clamp pins), holding together the E shape. If you remove those clamps, then the E shape falls off, and you have direct access to the wiring. The whole thing is mounted on the PCB with almost no space under it. Now for my problems with soldering: applying too much force will easily break the plastic that the 6 winding pins are molten into applying too much heat will loosen the winding pins (plastic melts), and ultimately dissect them from the plastic bottom, which will rip the winding attached to them of. Or when pushed from below, push the pins into the windings. removing the clamp pins first is possible, but then part of the ferrite comes of, and the windings are on some plastic tube kind, which will be dangling and ultimately rip of the winding wires from the pins. The pins do fit really tightly into the holes, and even when removing all of the solder I can, they are stuck. I have tried to empty one of the holes as good as I can, and clean one of the pins as good as I can, and I need to apply quite some force to get the pin into the hole again. What worked ok-ish so far is to apply only a tiny bit of pressure from the backside to the pins with a short amount of heat, and then try to support it from the other side with little force until the solder is solid again. But this takes like 100 rounds until one gets of, and even then the plastic is a bit molten (btw. varying temperature between 250°C and 350°C didn't seem to make any difference here). What else could I try that allows me to get off (at least most, I have lowered my expectations) of the transformers in one piece? <Q> It sounds as if one of your problems is the high temperature needed to melt the solder. <S> There is a commercial solution called "Chip Quik" ChipQuik that should help. <S> Basically, this is a very-low melt point solder that is added to the existing solder on the board. <S> The resulting mix of solder metals has a much lower melt point than regular solder and you can usually manipulate the plastic bobbin without melting the plastic while the solder is still molten. <S> You have to be careful to remove all of the contaminated solder before resoldering the both the removed part as well as the PC board but that is easy with any of the standard solder-removal techniques (solder wick, vacuum desoldering station, etc). <S> ChipQuik used to send out free samples, enough to remove a few chips. <S> The company was recently sold and I don't know if they still do that - <S> but it's worth asking. <S> The free sample I received many years ago convinced me that the product was effective and I now keep it around on both my lab bench as well as our rework stations. <A> Easiest thing to try is hot air. <S> Using a rework station, apply hot air to the underside and that will hopefully heat all the pins at once so you can ease the transformer out with pliers. <S> Basically you want to heat all the pins (or at least all on one side) at once, so they come up as a group. <S> IF hot air doesn't work then there are soldering iron or soldering gun tips that are T shaped so you can heat a wide area at once. <S> This may be the lowest-cost option since even a cheap hot air station or a temperature controlled heat gun is around $100. <S> Kinda like wave soldering in reverse. <A> It's hard to tell without a photo. <S> Assuming this is through hole technology, I would proceed as follows: <S> arrange the board with transformer underneath and solder on top. <S> make a solder blob across each set of three pins. <S> Add 60/40 solder until it's a big blob. <S> with the biggest tip in the iron, alternately heat the two solder blobs. <S> Once all six pins are molten at once, the transformer should fall out by its own weight. <S> If that isn't sufficient, add weight somehow. <S> A Vice-Grip pliers, or pliers and rubber-band combo, or woodworking clamp, etc. <S> Sometimes there is glue under components like this, which will require more force to break. <S> After the transformer is out, clear up the excess with sucker then braid. <S> The point is to think about adding solder, not removing solder.
| Worst case, if you really need to get these things out without damaging the board and the above doesn't work, you can make a tiny solder bath the size of the transformer and push it against the bottom of the board. I can usually remove anything with hot air.
|
Can I share source code/software from Microchip through my website? I've done some projects including bootloader for PIC microcontrollers. But all these are done by modifying official microchip codes. Also want to share official drivers and softwares. I want to share this open. Is this possible? Is there any legal problems by doing this? <Q> IANAL. <S> Best to contact Microchip. <S> That said, in the file "Microchip Application Solutions Users Agreement.pdf", which accompanies one of the many Microchip source libraries I have on my system, section 1(b)(i)(1) <S> (Software License Grant) states: <S> Licensee may use, modify, copy, and distribute the Software identified in the subheading of this Section 1(b)(i) when such Software is embedded in a Microchip Product that is either integrated into Licensee Product or Third Party Product pursuant to Section 1(d) below. <S> The part that says you can distribute would, it seems to me, allow you to publish the software on your site, i.e. as one means of distributing it. <S> However, the tricky party here is the phrase "when such Software is embedded in a Microchip Product that is either integrated into Licensee Product". <S> To me, this means any such source code you want to put on your site <S> , you need to be actually using in a product. <S> Since you are probably not producing any real products (maybe you are), then I would think just using the source in one of your own projects would count. <S> But you can't just through up all of their source code on your site willy nilly whether you are using it yourself or not. <S> So check the individual license file that comes with each of the libraries you want to publish source from, and check if they include verbiage such as that above. <A> What licence is the code released under? <S> Look on their website or in the code headers or top lines. <S> It's usually included there, then search for that licence and see what the terms of use are. <A> Microchip.com, section About Us » Legal Information <S> » Copyright Usage Guidelines: <S> If you would like to reproduce, translate, and/or reprint Microchip copyrighted material for commercial purposes you must request Microchip’s written permission by following the 3-step process described below. <S> Microchip’s written permission is not required for personal use or educational (non-profit) use of copyrighted material. <S> So it seems like you'll have to contact them, but if your usage is strictly personal or educational, you don't need to (but it would still be good to do so, to be sure). <S> See the article itself for the full text. <S> Of course, some code examples (like the small ones in datasheets on how to set pins, etc.) are too small to be copyrighted .
| My guess is that if you never had to log in or pay to get access to that code you can probably share it as long as you attribute it to Microchip.
|
Integrating code for embedded systems I wonder how looks integrating code for embdedded systems. Lets suppose there are 5 programmers and everyone is doing something different. Then I am supposed to integrate the code. How do I know if it should be RTOS or not, should I be provided with some kind of API, from the programmers, that refers to theirs code ? Should the code execute sequentially or should I implement multitasking ? There are so many things to be managed and I got no idea what to start with ? Do you know any books that would introduce me to that subject ? <Q> How do 5 construction workers go about building a house? <S> Do they simply build pieces independently and hope that the general contractor can fit the pieces together? <S> Of course not. <S> What really happens is an architect makes a blue print and the workers build to the specifications in the blue print to ensure the pieces fit together. <S> For software, the system architect makes the system design and the developers build their pieces to fit the specifications of the design. <S> The system design should include at least an overview of how the pieces will integrate, such as APIs. <S> Choosing whether to use a multitasking RTOS is like the construction workers deciding what building materials to use. <S> It doesn't really matter how many workers there are. <S> And the architect makes that design decision based upon the product requirements and constraints. <A> If your task is to stitch all the code together, you are basically building the application. <S> So you should know what is the task the application has to solve. <S> Normally the decision to use a RTOS or not is so fundamental to the system (including additional costs) that you shouldn't have to make that on your own, but the whole team should discuss benefits and drawbacks of using one. <S> It can greatly influence the code your other programmers have to write. <S> This goes hand in hand with the decision to use multitasking, which requires some functions to be safe for a reentrancy, which involves your team to code differently. <S> And yes, you should get some sort of API documentation to make your life easier. <A> It depends on the requirements of your boss/client. <S> If he wants you to make something with multitasking, then yes, you should implement multitasking. <S> If not, then don't implement it so that you don't waste time on it. <S> This kind of things should be clearly stated in the functional design. <S> If it's not, you should ask your boss for more details before proceeding; or you may do things that are unnecessary and you will eventually slow down the design process. <S> (if this is a client, you should have gotten all the details straight before accepting the job). <S> Also, there are different kinds of code packages. <S> For example, some developers may have written a library which isn't meant to be standalone and you are meant to use it in other applications. <S> In that case, you should neither execute it sequentially or with multitasking, but you should use the library in the other software you have been given, or you should use the library to connect the other codes. <S> Without further specification of your question the answer is not going to be more than: 'it depends'.
| You should gather all the requirements (for example, in what time should a certain task be finished, are there interrupts which need to be executed fast, is communication happening) which have a big influence on how you will solve your problem. It depends on what the architect (system designer) specifies.
|
What does a 200MW capacity power plant mean? 1W is 1Joule of energy transferred in 1sec. So what does a 200MW capacity power plant mean? Does it mean it generates 200MJ of energy in one second. But then I have also read it can mean 200MW of power in any time, 1min or 1hour. It is confusing me a little.So what does 200MW capacity power plant mean? w.r.t Time. <Q> It sounds like you're misunderstanding power. <S> Power is a rate of energy generation or consumption. <S> If my circuit is using 1 W of power, it needs 1 J of energy to run for 1 s, 10 J to run for 10 s, etc... but the power consumption is still a constant 1 W. <S> In your case, you have a power plant that can generate 200 MW. <S> It can do this for 1 s (generating 200 MJ of energy), 10 s (2000 MJ), or any greater length of time - <S> but it cannot create more than 200 MW of power. <A> Simply, it means the plant's capacity is that it can generate 200 MJ in 1 second. <S> So you don't need to state time every time. <S> That's why they converted J/s to W so that we get rid of stating time every time we talk about the plant's capacity. <A> Don't think of the definition 1W = <S> 1J <S> /s. <S> Rather think of the load it can handle. <S> 200MW is 2 million good old 100W bulbs. <S> The plant can light them anytime, for as long as you want.
| It means that it can supply 200MJ per second in any second, or 200kJ per millisecond in any millisecond, and so on.
|
How to power an LED when a circuit isn't complete I'm an electronics beginner trying to carry out a project similar to this one: http://www.techwillsaveus.com/shop/diy-kits/diy-thirsty-plant-kit/ . I'm having a difficult time understanding how it is that the LED is powered when the circuit is not complete (the sensor detects no water) and then turns off when the circuit is complete (sensor detects water/wet soil). Also, would it be possible to create something such as what I just mentioned but in addition to the LED turning off when water is detected another one turns on? <Q> Basically the way these circuits work is by relying on the fact that soil conducts electricity, with a resistance of a few hundred kOhm. <S> When it gets wet, the resistance changes allowing the moisture level to be detected by measuring the resistance of the soil. <S> The measurement is usually achieved using an amplifier circuit which produces a voltage depending on the resistance of the soil. <S> This can be done using an Op-Amp circuit for example, or even just biasing a BJT with the soil probe such as in the example circuit below (Source of image and circuit description here ) where S1/S2 are probes in the soil, and the voltage at S1 varies with moisture level. <S> So basically if you want an LED to have the opposite indicator, you would just need a simple inverter circuit driving the second LED. <A> While Tom Carpenter's answer is correct, it's unnecessarily complicated. <S> Consider the following circuit: simulate this circuit – Schematic created using CircuitLab <S> When the contacts are in dry ground (switch is open), the LED draws 3 mA. <S> When the contacts are in wet ground (switch is closed), the voltage is less than the 2 volts needed to turn on the LED, and it is off. <S> Now, it's true that this is an unrealistic situation. <S> Dry soil does not have infinite resistance, and wet soil does not have zero resistance, but the two do have noticeably different resistances, and a circuit which can distinguish between the two can behave appropriately. <A> From the parts photo I guess it's something like this <S> the probe itself is probablly wires encased in a block of plaster of paris cast in the pill jar <A> I looked at the "manual" for that "thirsty Plant Kit" - it doesn't contain enough information to draw a reasonable schematic diagram, but does indicate that the circuit includes a MOSFET. <S> Apparently when the soil is dry, the MOSFET will conduct to turn on the LED. <S> Moist soil will produce a lower resistance between the sensor electrodes which will cause the MOSFET to stop conducting, turning off the LED.
| The LED is almost certainly not in line with the sensor, but is rather turned on or off by the measured voltage.
|
Burned a PIC12F675 - but why? I'm experimenting with PIC programming controlled by an Arduino Uno, and I'm using the PIC12F675 . I actually got the PIC to enter programming/verify mode yesterday and was able to read out the device ID, but before that happened I actually burned off a PIC, but I'm not sure exactly what I did wrong. The problem was related to the MCLR/VPP. In order to enter program/verify mode, this has to be driven to a high voltage (at least 3.5V higher than the power source) as part of a sequence of initialization events. So I connected the Arduino to a 12V power supply and used 5V to feed the Vdd on the PIC and the 12V to the MCLR (max is rated at 13.5V). At that point I thought that since the MCLR was the first signal to be driven high, I could simply tie it permanently to a high voltage source (12V). But after turning the board on, the PIC quickly became very hot and (as it turned out later) was burned out. The reason why I connected it directly without a resistor was that the programming specification ( http://ww1.microchip.com/downloads/en/DeviceDoc/41191D.pdf ) said: In the PIC12F629/675/PIC16F630/676, the programming high voltage is internally generated. To activate the Programming mode, high voltage needs to be applied to the MCLR input. Since the MCLR is used for a level source, the MCLR does not draw any significant current. In other words, the high voltage input is not used as an actual power supply, it is just a way of signaling you want to enter programming mode. So I read the above (especially the "the MCLR does not draw any significant current") in the way that the PIC's MCLR PIN would have a high internal impedance and would thus not draw any significant current, hence it should not be necessary to provide any resistors etc. Also there's no note in the datasheet saying how much current you are allowed to transfer through any of the PIN's. But clearly that's not how it actually worked. Also earlier in the experimentation I was working with smaller voltages (8.5V) where I also connected direclty, and this didn't cause it to heat up so it can't just be a plain short circuit since then 8.5V should burn it out too. Another question along the same lines: When connecting the analog PIN's of the arduino to the GP0/GP1 PIN's on the PIC, is it necessary to use resistors? Again, when the GP0/GP1 on the PIC are in input mode they should have high impedance, so I don't see why I could simply connect it directly to the Arduino. Now in this particular case, the data PIN (GP0) actually changes between input/output at specific points during programming and the Arduino has to do the same, so I guess one needs to be careful about changing at the same time so they are not both in the output state simultaneously (since that doesn't have high impedance). But to be sure I added some small resistors (470R) to limit how bad things can go. But it would be nice to know if this is really necessary, since again the datasheet doesn't say how much current you can transfer through the PIN's. (in the new circuit I made that actually works I have 15K ohm between the 12V and the MCLR and I also control the MCLR through a transistor so I can turn it on at the right point in the sequence) <Q> Not sure about your question about the burned out PIC and 12V MCLR <S> but I can answer about the direct connection of the Arduino and the PIC GPIOs. <S> If both are running off of the same power supply and your software in both is flawless, then there should be no issues with a direct connection. <S> However, I personally always connect them with resistors to limit the damage cause by software bugs and/or timing issues because there will inevitably come a time <S> were I messed something up in the software and <S> the resistor give's me the time to realize that I have a bug before something gets damaged. <A> To address your statement about the datasheet not specifying <S> how much current each PIN can source/sink, section 12: <S> Electrical Specifications, of the data sheet gives the maximum source/sink of any pin at one time as 25mA, and the sum of PIN currents cannot exceed 125mA. <S> As for the MCLR question, I have done similar projects in past, with a voltage of 9V, and never had a problem, much like yourself. <A> Since you hard-wired the power lines, it is possible that the 12 volts appeared before the 5 volts did. <S> If something goes wrong in a power up sequence, the chip could "latch up", at which point Vdd will happily burn the chip out without any help from Vpp. <S> This includes powering the Arduino (and driving some PIC I <S> /O pins) before applying power to the PIC itself. <S> not draw any significant current, hence it should not be necessary to provide any resistors <S> The fact that it will not draw any significant current means that some resistance placed in series will have negligible effect on the voltage at the pin. <S> This is somewhat opposite reasoning to yours. <S> For some reason people tend to associate "no current" with "no resistance".
| I can't find anything in the datasheet that specifically addresses applying Vpp at power-on, but it's clear from their discussion about going into program mode that they expect the chip to be already powered before bringing MCLR to Vpp.
|
Detailed explanation for PIC boot sequence I have doubts about the boot sequence of about every microcontroller but since I own a PIC I figure I should start with those first. I would like someone to explain how the PIC's boot sequence progresses. While explaining that I would also like to know how the PIC sets its clock setting such as internal or external clock without first knowing which one to use does it use its internal clock and then sets the clock to external once the register has been set? <Q> PIC are generally programmed with code that performs a dedicated task, usually without a operating system. <S> The code is stored in the same non-volatile memory it is executed from (except some PIC 32s can be set up to execute from RAM), so there is nothing to "boot". <S> The diferrent PIC architectures vary a bit in what happens on powerup or after a reset, but mostly execution just starts at a single known address. <S> The start of your code has to be at that address. <S> As for configuration settings that have to be made before any code can execute, like the oscillator selection, these are stored in the configuration bits . <S> These are special non-volatile bits that are used directly by the hardware. <S> This is, of course, all described in detail in the datasheet or family reference manual. <A> The boot sequence of a PIC is: Start executing the code at the reset vector. <S> That's it. <A> For every architecture is basically the same. <S> It starts whichever oscillator you configured with fuses, counts say a 1000 stable cycles and vectors to start location (this is usually location 0 in flash). <S> From then on it vectors to the startup, which more or less just initialises the ram variables and after that is done it vectors to your main() function. <S> From then on your SW starts running. <S> Which PIC family?
| PIC don't really have "boot sequences", since that's a software abstraction and there is no standard software that runs on a PIC, like a bios on a PC.
|
Resistors in paralel on pcb schematics? I know that capacitors in parallel are used for filtering, but what could possibly a resistor in parallel be used for? Take for example the schematics I pinned to this post http://i.stack.imgur.com/Y1Ttr.jpg and the resistor I circled in black what could possibly be its use?? I hope I've been clear enough, Thanks. <Q> If the capacitor is empty <S> it starts filling through the resistor. <S> As the capacitor fills with charge, the current through the resistor slowly falls, and the voltage on the pin also falls. <S> Once the capacitor is full no more current will flow an there will be "0V" on the pin. <S> I would also regard this as a bad design practice. <S> EDIT: <S> As the +5V supply voltage collapse to zero, the 10uF capacitor will attempt to discharge through the 10k resistor and whatever parasitic components are forming the input pin. <S> The faster the +5V supply voltage collapses, the faster the capacitor will have to be discharged, which would cause the stress on the said parasitic components inside the integrated circuit to increase. <S> If the stress is big enough the circuit will fail. <S> All of the above holds for a typical pin topology, we do not actually know how much negative voltage or current can this pin tolerate until we see the datasheet of the integrated circuit. <S> EDIT 1: Datasheet <A> Is the pin that the RC circuit in the black circle connects to called "RST"? <S> If so, that RC circuit provides a power-on reset pulse - when power is applied, the capacitor will pull that pin up to Vcc, then will be charged through the resistor, allowing the voltage on the pin to drop. <S> The signal may be normally driven by an open-collector or tri-state output. <A> The RC network circled in black is a power on reset circuit. <S> I have attached a figure from an ST application note Simple Reset Circuits for the ST6 <S> It is oppposite of the picture you attached, as this ST62XX is reset low instead of high voltage on the pin. <S> The purpose is to keep the device in reset until power rail has come all of the way up. <S> The RC circuit has a time <S> constant R*C that will create the delay. <S> The circuit in the blue circle is a simple pull up resistor on that EEPROM's write protect line, and the blue square appears to be a voltage divider to monitor the 3.3V line.
| This circuit (in the black circle) causes a pulse on the pin connected to it. The resistor in the blue circle appears to be a pull-up resistor to ensure that signal is held high when there is nothing driving it low.
|
Is it possible to run 2 motors independently with USB? Is it possible to run two motors independently in both directions with usb using no microcontroller but just some discrete components? I'm trying to create the cheapest possible robot that can just move about via two motors that can be run independently, for rotation, and rotated cw or ccw for going backwards. This robot must be controlled by an android device through USB. Can this be done without any microcontroller? I'm not creating this just for fun but also as a prototype so I'd like it to be as cost efficient as possible. <Q> You could buy one of these: - <S> Here is the link - the board cost about £20 and is described as: - The Velleman USB Experiment Interface Board Kit has 5 digital input channels and 8 digital output channels, plus two analogue inputs and two analogue outputs with 8 bit resolution. <S> The number of inputs/outputs can be further expanded by connecting up to 4 more cards to the PC's USB connectors. <S> All communication routines are contained in a Dynamic Link Library (DLL). <S> You may write custom Windows (XP, Vista, Windows7) applications in Delphi, Visual Basic, C++ Builder or any other 32-bit Windows application development tool that supports calls to a DLL. <S> Also available as a pre-assembled module. <S> If you are hoping to get away without writing software then you may be disappointed. <A> usb using no microcontroller but just some discrete components <S> Theoretically you can turn the 5V off from the computer side but this isn't normally easy to get at in the drivers. <S> For practical purposes your best option is one of the existing breakout or motor control USB boards. <A> It isn't possible without a motor control board and/or a microcontroller . <S> Depending on the motor, they usually require a lot of current to run, which cannot be supplied by a USB . <S> And if you need to reverse the polarity from CW to ACW , then USB would clearly not be able to do that without an external control board. <S> In either case almost all motors would need more than the current a USB can supply. <S> SO you will be using the voltage output as a USB to just provide the signal to keep a switch on/off but an external power source to provide the amperage.
| It is not possible to do anything with USB other than draw the continuous 5V from the supply lines without a microcontroller or an ASIC.
|
Violin bow position tracking with SMD LEDs and photoresistors Objective: Marking labels indicating the positions of the violin bow on an acoustic signal, for example, a single musical note played by a full-length bow. The following video shows the example I am talking about, please just take a look from 1:00 to 1:03: https://www.youtube.com/watch?v=XIKPHsVyxKs If divide the bow into three parts with equal length, roughly two markers can do it. So what I want to do is put those two markers on the corresponding acoustic signal, like this: The objective is to figure out "oh, at this and that moments, the bow has traveled 1/3 and 2/3 of the whole length, respectively" when looking at the acoustic signal.A naive way is to simply divide the time axis of the acoustic signal by three, but it cannot be assured that the velocity of bowing is constant. Method : According to the article http://www.ubicomp.org/ubicomp2013/adjunct/adjunct/p211.pdf which used a pair of colored SMD LEDs (as emitters on the bow) and color sensor photoresistor (as receiver on the violin) to tackle the problem. However, the circuit and the explanation of figure 3 are not clearly described, which made a lot of problems for me. Problem: In short, based on my understanding, by installing SMD LEDs with different colors on the bow (red and blue marks in the case of the above figure), and a color sensor photoresistor on violin which detects the time-varying voltage when illuminated by SMD LEDs on the traveling bow, the objective described in the first place could be achieved. The following figure explains the idea: So the peaks in the figure indicates the positions of both LEDs. By aligning the time-varying voltage and the acoustic signal, the objective shown in the first figure is solved. 1. Is the above statement correct, achievable or not? 2. If so, how to set the circuit on both two ends (emitters and receiver)? I am fairly unfamiliar with hardware and electrical components, hope you can help me if possible, thank you very much! EDIT:I've implemented the LEDs and photoresistor as detector, and it works as I desired. Here comes the other problem: the alignment of the recorded audio signal and the time-varying voltage detected by the photoresistor. What came to my mind is a acceleration-sensed LED installed on the driving point of the bow, which makes a blink at the moment the player drive the bow. The idea is to blink the LED once the change of the acceleration direction is detected by a component. Such change in acceleration direction will thus make a impulse on the displayed time-varying voltage which indicates the onset of the audio signal. How could I achieve such acceleration detector combined with a LED, with an acceptable size to be installed on the violin bow? <Q> I like it. <S> Keep it simple to start with. <S> With two LED's of the same color. <S> Then you'll just see two peaks as the led's go by... <S> you'll have to figure out which end of the bow the signal is from. <S> (or do some color tricks later.) <S> For the LED drive circuit, a 9 volt battery, two white leds (Vf ~3.0 V) and a resistor to limit the current. <S> Something around 300 ohms would give ~10 mA of LED current. <S> On the detector side, I might use a photodiode. <S> But lets's keep it even simpler. <S> Get another 9 volt battery, a light dependent resistor (LDR) and another resistor whose value we will need to determine experimentally. <S> The LDR decreases in resistance when the light shines on it. <S> So put the two resistors in series with the battery and measure the voltage across one of them as you move the led around. <S> Depending on which resistor you choose (fixed or LDR) <S> your signal will either be an increasing or decreasing voltage as the led goes by. <S> Now play with fixed resistor value to give reasonable signals.. <S> And now make some music : <S> ^) <A> You can certainly try a setup with two different coloured LEDs and two colour matched optical sensors (e.g. LDRs with corresponding coloured filters, or two outputs from a colour sensor IC) but the problem I foresee with trying to derive the bow position from the sensor responses is that the signal from the LDRs will vary not only with the movement of the bow along its stroke but also with the angle of the bow relative to the violin, which will not always be the same if you are trying to capture data from 'natural' playing, and with any changes in ambient illumination unless you are careful to eliminate this or filter it out. <S> Some other methods you might want to consider are: <S> After isolating the dots in the image the analysis could be as simple as calculating their left/right position across the frame - I think this would be much easier than attempting to analyse motion capture of violin and bow from a fixed camera. <S> An alternating pattern of dark and light bars on the bow that would be illuminated by a line light source, e.g. a bright LED shining through a narrow slot, and a single optical sensor to measure the reflected light. <S> This would give you a pattern of high and low responses from which you could determine the bow position. <S> It won't by itself give you absolute position <S> but you suggest you always intend to capture a whole bow stroke, so you can assume that (e.g.) the first peak in the response always corresponds to the first bright bar on the bow. <S> An ultrasonic proximity sensor mounted either on the violin body or on the player's right hand or wrist, perhaps combined with some sort of target on the hand/wrist or violin respectively to increase the reflection of the ultrasound. <S> If this works this should give you a signal corresponding fairly well to the absolute position of the bow. <S> Sparkfun would be one source for possible sensors ( optical , proximity ) and have distributors in many countries if you're not in the US, but many other companies also offer these types of sensors. <A> I have an idea but it requires some DSP knowledge and programming skills. <S> I assume bow movements are clearly distinguishable on the signal monitor. <S> If you filter the record with a sufficiently narrow pandpass filter, near to lowest frequencies. <S> The waveform you will have will be a function of the speed of the bow as frequency modulation. <S> What you have to do is just counting the alternations belong to the particular movement, dividing them to 3, counting 1/3 and mark, once again and mark <S> , that is all.
| A small video camera mounted on the violin body that records the motion of LEDs or reflective dots on the bow, which you could then track and convert to bow position using image analysis software.
|
Low pass filter issue - is the 10k resistor part of the circuit? This may be a really simple question but Op Amps still confuse me a little. I have a low pass filter circuit as shown below. My question is whether the 10k resistor is part of the filter circuit or is it just for input current biasing reasons. If it is part of the filter circuit how do you derive the transfer function? From looking at it i initially thought that the filter was the 47 Ohm resistor and capacitor then using 1/2*pi R C that would give the cutoff frequency but i am not sure this is correct. Thanks for your help - its really appreciated! <Q> If you have an ideal OpAmp the 10k resistor would carry no current and could be replace by a resistor with an arbitrary value, including a piece of wire. <S> Therefore the answer is no, the 10k resistor plays no role wrt. <S> the low pass filter. <A> The opamp acts only as a simple buffer with unity gain (100% feedback). <S> Because there is no voltage divider, the value of the feedback resistor has no influence on the buffer operation and - hence - not on the filter. <A> <A> The filter is effectively the R-C output network with a 33.8kHz roll off (0.707 x Vin). <S> It would be better to put a 470 pF cap across the 10K feedback resistor and omit the shunt 0.1uf. <S> In that way, the opamp output current requirement (current output slew rate) is eased (output impedance is also fixed at 47 ohms) and the cost of the capacitor is greatly reduced. <S> Buying a 0.1 temp stable (COG or NPO) cap is a $$ problem and if you use a ceramic 0.1, you also need to verify that it is voltage stable. <S> Original configuration is just a voltage follower followed by RC lowpass.
| The 10k resistor has no affect on the passive filter pole, but the resistor, together in feedback with the op-amp do have an effect on the filter by increasing the input impedance.
|
Charging a battery with two sources, should I put them in series or parallel? I would like to charge a battery using two sources (solar and a generator), should I put the two sources in series or parallel before the battery? The battery is actually 3 batteries in series. Each of them is 1.2 V with a capacity of 2300 mAh. Is it better to give the battery more current or more voltage? <Q> It's better to use just the generator <S> so you don't have to tolerate the variability of the PV. <S> If, when fully charged, each cell is at 1.2 volts, then you'll need a current-limited source with greater than a 3.6 volt output to charge them, the current limit being determined by the cells' specifications. <S> If your generator can't generate more than 3.6 volts, then the PV should be connected in series with it. <S> Unless there's some compelling reason to do so, the PV and the generator shouldn't be connected in parallel, directly, since the one with the higher voltage will feed current into the one with the lower voltage, possibly starving the battery or increasing its charge time. <S> That is, neither excess voltage across nor current into the battery is a Good Thing. <A> You should connect the charging sources in parallel. <S> To charge the battery, you need to provide the appropriate voltage, and no more current than the battery can accept. <A> Best would be to only use one source at a time. <S> When it is dark, the PV panels will act like resistors, nullifying some of the power coming from the generator. <S> Also, if you consider putting them in series, remember that the panels are rated in how much current they can conduct. <S> For instance, if you have a 380 Watt panel in series with a 100 Watt panel, the 380 will be current-limited by the 100 panel. <S> If you put them in parallel, the panel may heat up from the current coming from the generator. <S> That's not good because it can damage the panel. <S> It would be best not to mix sources like described in the OP.
| Also, since more voltage will cause more charge (current) to flow into the battery, it's better to arrange things so that the charger's output voltage only pushes the allowed current into the battery. Set up a switch so you are using one or the other, but not both.
|
Active signal generator IC for 100kHz I am trying to get an IC to generate a 100kHz sinusoidal waveform for my circuit. However when I google, all I can find are retired products which make me very hard to find (I stay in Singapore) so anyone know any active IC that can help me generate 100kHz signal? Thanks in advance. <Q> The AD9850 is used in a few complete boards that are readily available from online auction sites. <S> Datahseet to the chip: <S> http://www.analog.com/media/en/technical-documentation/data-sheets/AD9850.pdf <S> Example of a complete module with passive filters to generate a Sine Wave: <S> Failing that you could try making your own using a microcontroller generating a pwm according to a sine lookup table. <A> Is this a fixed-frequency signal? <S> If so, please Google the following terms: Wien bridge oscillator Twin t oscillator <S> I have built many Wien Bridge sine wave oscillators using a NE5534 (single) or NE5532 (dual) op-amps with a small "grain-of-wheat" light bulb for amplitude stabilization. <S> Note that the reason I chose those particular op-amps is that they have sufficient output current capability to drive the light bulb. <A> setup on the increase and decrease of the turn on/turn off and you will get very, very close to a sine wave. <S> It won't be perfect though. <S> If it's AC you're looking for, <S> the above minus the RC/LC and supplemented by a filtered H-bridge is how I do it. <S> There are probably better ways, I just use these cause <S> I needed what you need a while back.
| This might not be what you are looking for, but I generate waveforms of 100-250kHz using a simple 555 timer, logic gates to bring the signal fully high or low and either an RC or LC (this one works better but RC is easier)
|
Designing a power supply that drives an LED array supply I want to drive an LED array from mains power. The wall switch has a dimmer on it, I'd like the intensity of the LEDs to reflect the relative position of the dimmer, so as I dim the switch, the intensity of the LED array drops. Because I already have an 8V 12W Halogen bulb system in place, I want to replace it with as few parts as possible to convert it to LED. I'd like to do this as simple as possible. I know there are more sophisticated circuits that could utilize MCU or other clock driven PWM, but I am wondering if there is a more simple solution I am overlooking. My current plan was to use a step down transformer / rectifier circuit. I would calculate the maximum DC voltage available when the dimmer was turned all the way off, apply the correct resistors to limit the maximum current in this "max voltage" scenario, and then use a simple constant voltage regulator circuit to control the intensity of the LEDs as I dimmed the circuit. Would this work? Do I want to keep a constant voltage and have the current variable as I dim the switch? Is there a cheaper/better/easier way to do this than my current plan? <Q> Wikipedia has some good examples about dimming. <S> Again, wikipedia has a great picture of that Note that thyristor dimmers usually make some radio frequency noise <S> but as I see it, this is one of the simplest AC dimmers. <S> You will find more info about different dimmers on http://en.m.wikipedia.org/wiki/Light_dimmer <S> And although you would like to keep out from MCUs, at least think about them. <S> If the thyristor-stuff goes over your head, try to use MCUs. <S> You will find them to be very useful for your future projects. <A> Here you can look for better understanding: http://powerelectronics.com/lighting/dimming-techniques-switched-mode-led-drivers http://www.allledlighting.com/author.asp?section_id=455&doc_id=559431 <A> I'll take a stab. <S> Cheap and quick, definitely not what I would do, as I am not a power electronics pro, nor an electrician by any means. <S> If you use this you are accepting inordinate amounts of risk. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> If you're up for something simple, just source an ACDC supply module. <S> Something like this might do it. <A> In my opinion, the wall switch dimmer is already implementing some sort of thyristor-like circuit to provide less power to the ceiling/wall mains. <S> This would mean that the AC power that you want to rectify isn't pure sinusoidal. <S> Rectifying and filtering it would result in a variable DC voltage, so I wouldn't suggest adding a regulator at any point. <S> LED intensity is driven by current, not voltage. <S> The voltage drop of an LED array is constant and fixed by the setup of the array itself. <S> If you want to control the intensity you should either control the current or use a PWM-based circuit. <S> If you had a near one, you could use the variable voltage provided by the wall switch to control the duty cycle of a PWM circuit which drives the LED array but is powered from the non-regulated mains. <S> This isn't a quite "simple" solution <S> but I wouldn't call it "sophisticated" either. <A> You could investigate using a potentiometer (use a variable resistor for instance) to control the timing of a 555 timer IC. <S> The output of the 555 would control the Gate of a FET, which would control the gate of another FET. <S> The second FET would switch the supply on and off to the LED's and allow you to dim from a DC supply, which you should reasonably get from a rectified AC waveform. <S> Sorry <S> I understand this is not the simple idea you was after <S> but it is a simplification of an industry standard way of PWM LED's. <S> There are plenty of 555 timer circuits on the web and information on how FET's (Field-effect Transistors) work. <S> You would need a PNP FET fed by a NPN and the theory would be that if the Gate of the PNP was connected to the DC ground via the NPN being on, then DC current would flow to the LED's. <S> To turn on the NPN you would apply DC voltage (derived from your DC Source via the 555 output) to the NPN gate and this would turn on the NPN and make it conduct. <S> Ideally you would have a high value resistor to ground on the gate of the NPN FET (4k7) and also need a resistor between the source and gate of the PNP (4K7), to ensure it turns off, when the NPN is not conducting.
| For as simple solution as possible (by electrical terms) I would use a transformer, full wave DC bridge and a thyristor. I'd definitely go for the PWM option, but you'll probably need access to a non-regulated power source as well.
|
C++ in Embedded Electronics - Literature Recently, we've been discussing the use of C++ in (small) embedded systems. As all examples from controller vendors I have seen in the past are tailored to the use of C this is basically what we've been using. I would like to know if there is any literature which would get me started in this area. Basically I know C on Microcontrollers and C++ in "normal" PC environments. Yet, I would like to know more how I correctly map registers to my classes (or the other way round), how to deal with interrupts (or if there is anything special I need to know), which parts of C++ I may use (I will probably want to try to stay away from dynamic memory management, templates or exceptions) and so on. I am NOT looking for a general C++ start. <Q> It's not a book, but a set of annotated presentation slides that show many C++ specific patterns for using C++ in embedded systems and some wisdom on what not to do. <S> I also love the paper C++ Hardware Register Access Redux by Ken Smith. <S> It shows how one can use C++ template metaprogramming to provided compile-time enforcement of certain register access policies such as read-only/read-write/ <S> write-only. <S> There was also a great article on embedded.com discussing interrupt handling in C++, but it seems embedded.com is no more. <S> Check the wayback machine for possible cached copy. <S> The Arduino is also a C++ API, so it's a good, practical example of using C++ for embedded systems. <S> Another great resource is STM32PLUS - A C++ Library for STM32 Development by Andy Browne. <S> Open Source and lots of great information in his blog. <A> Maybe give this a try: <S> Christopher Kormanyos, "Real-Time C++ - Efficient Object-Oriented and Template Microcontroller Programming", Springer Verlag, 2013. <S> I've finished it just a few weeks ago (mostly bedtime reading), and the material was interesting enough that I'll make a second pass - I want to see which of the techniques he describes work for me, in my environment, so I'll probably try to convert a few of my smaller AVR C projects to C++ as I go. <S> If this got you interested: the book's page at Springer.com has downloadable PDFs for the table of contents, preface and a full sample chapter (Chapter 7, "Accessing Microcotroller Registers" - although that's not my favourite chapter), and the author maintains a Github Repository with sample/reference projects. <A> Ooof. <S> I would have to hear a really good practical reason behind why the features of C++ make any sense for microcontroller-level projects, in order to justify the expense of the language. <S> However, I think what might serve you best here is to start by reviewing the board support package from any chip vendor . <S> For example, take a look at the gcc libraries supplied by TI/Atmel/Microchip for their devices. <S> In those libraries, the vendor will assign register addresses to friendly names (like PORTB or SREG, etc). <S> This will give you an idea of how to make your own or modify it (should you need to) in any other language. <S> Although, you probably won't need to make much modification to these and could simply include using extern "C" {} . <S> Secondly, you might want to read up on the chip vendor's compiler or gcc extension to get an idea of how they map ISRs (interrupts) to function calls. <S> Often, this is also done in the BSP, or otherwise they will use some non-standard syntax which only their compiler can parse. <S> Finally, if you are convinced C++ is the way to go, have a look at some design pattern material as a way to set rules for yourself and team. <S> This will help you better construct your software in the dangerous jungle that is C++, and perhaps maximize your value from it.
| See Effective C++ in an Embedded Environment by C++ Guru Scott Meyers. One resource that worked well for me is Head First Design Patterns .
|
Using relay to switch power supply In my project I use 240 W switching power supply. Due to energy saving and some safety reasons, I don't want this PSU to be on permanently. I'd like to use relay to switch it on and off. However, this PSU has a significant inrush current - 40A/230VAC. Do I have to take some special precautions regarding the inrush current? I mean, do I have to choose a relay able to withstand 40A peak current (which would be quite expensive), or is there some other way how to handle this? <Q> But don't decide by looking at the brief ratings in a catalog. <S> Look at the data sheet and see if there is an inrush rating that is higher than the continuous duty rating. <S> Motor starting contactors are an extreme example of this. <S> They have contact materials that resist welding, and their ratings reflect this. <S> Another approach that you see in large power supplies is a separate set of contacts, in series with a power resistor, that are closed for a second or so before the main relay closes, to more gradually charge the filter capacitors. <S> Sometimes referred to as a "soft start" circuit. <A> If your PSU draws 40A constantly, you should use a relay that is rate at least for 40A permanent, not peak. <S> Good engineering practice is to use choose one from a higher bucket, 63A in this case, or better, match the relay to the fuse installed in this circuit. <A> Use a large relay such as a T90-style relay. <S> You want large contacts that don't weld easily and the T90 series relays handle inrush current quite well. <S> The particular relay of that type that we use is the American Zettler AZ2150 (form C) and AZ2150A (form A). <S> The "A" variant is indeed beefy and would handle your power supply quite handily. <S> The T90-style relay was invented by Potter Brumfield but many other manufacturers have copied that form factor and construction techniques. <S> That includes American Zettler, Omron, NAIS, others. <A> Sometimes what's done in order to minimize the problems of contact bounce and inrush current through relay contacts is to connect a TRIAC in parallel with the relay contacts. <S> In operation the TRIAC is turned on first in order to soak up the inrush surge and then, when the circuit has stabilized, the relay is turned on and the TRIAC turned off.
| Conservative engineering practices, and my own "school of hard knocks" experience say that you have to size the relay for the inrush current, because even a brief surge can weld the contacts, in which case the relay is stuck on and could lead to a bad safety problem.
|
Is a relay with a 20 amp rating enough to handle the current from a residential hot water heater? In Israel the houses usually have a hot water cylinder on the roof of the building which is attached to a solar water heating unit, but which also is connected to an electric heating element which is switched on from the inside of the house if there is no sunshine. My goal is to rewire the indoor switch to be connected to a relay and then control the heater from remote. I plan to do this using either Arduino or Rasperry Pi connected to the internet. My question is, assuming (I will double check this) that the heater uses a maximum power of 4000 Watts (4 kW), which divided by 220 volts is around 18.2 Amps, will a relay that is capable of handling 20 amps be able to handle such a load? I'm thinking of using the SparkFun Beefcake Relay Control Kit I'm under the impression that with heating elements there is generally no surge in electricity and that I don't have to worry about it spiking, unless something goes horribly wrong, G-d forbid. Also, SparkFun writes that, "There are some pretty beefy traces connecting the relay to the load pins, but the 2-pin terminals are only rated for 8A max! If you plan on connecting a larger load you’ll need to solder directly to the board." Will soldering directly to the board allow me to pass such a high current? Thank you. <Q> Probably it will, but it may not last for long, because it is close to maximum relay current. <S> It will prolong the life of the relay. <S> (30A, 40A or even 50A) Make your own PCB with <S> wider tracks for AC. <S> Use optocoupler instead of a single transistor. <S> It will isolate your controller from the AC. <S> Add snubber to your PCB. <S> Read <S> this question , asked by me, provides a lot of information about switching AC loads. <A> I would absolutely not do this. <S> I think it would be a major fire hazard. <S> Find a high voltage relay rated for 25 Amps or whatever, but with a coil rated for some low voltage. <S> E.g., 12V or 24V or 5V. <S> This won't be all that expensive. <S> Install it according to local electric code. <S> As much as possible, avoid putting low and high voltage stuff together in one box. <A> Instead, go with a higher din rail rated contactor. <S> Such as Finder 22 series. <S> (eg: <S> 22.32.0.012.4340) <S> You can still use the arduino board relay to control the contactor coil.
| I would recommend against using a board mounted relay for this current. Here are some suggestions: Use higher current relay. If it is a 5V relay, you may be able to control it directly with the arduino (double-check the current requirements), but in the worst case, you could use a 24V transformer to energize the coil, and switch the 24V with a smaller relay.
|
Flexible long wire for high currents I have an ATX power supply which has got multiple 5v outputs (at a maximum 40 amp current). I am willing to use it to power up a moving mechanical system 5-10 meters away. The problem is that since the current can be so high I need a thick wire which obviously lacks flexibility. I am looking for a way to "carry" the low voltage high current through a() flexible, long but relatively lossless cable(s). The ATX splits up the outputs to avoid thick wires into multiple 5v header pins. Should I do something similar? ; split the supply into multiple cables? I was also thinking of carrying high voltage low current but I find voltage regulators with huge current outputs to be very rare and rather expensive. What would be the best way to do it? <Q> Power companies get around it by increasing the voltage and decreasing the current. <S> There's nothing you can do to reduce the total gauge of wire needed to transfer a given current, but if you can reduce that current then you can reduce the total gauge needed. <S> Instead of feeding the 5V direct from the ATX supply you could consider feeding 12V from the ATX supply instead - you could then halve the current requirement for transmission. <S> On your remote device you can then use smaller light weight switching regulators (obviously rated for the right currents) to convert it to a higher current 5V supply. <S> Even better if you could ditch the ATX supply and use a slightly higher voltage, say 24V or 48V, which you then regulate down with switching regulators in your remote device. <A> I would just extend the existing cables one by one. <S> This is simple math. <S> However, it also depends on your needs for flexibility and characteristics of the supply. <S> An extension of the mains and placing your supply on your mechanical system may also be an option as it needs no soldering and the power cord is quite flexible. <A> One approach would be to put the supply remotely and use mains voltage through a flexible cable. <S> An affordable remote regulator of similar rating is unlikely to be much lighter (not counting the housing). <S> You can use 240V input, so a high voltage drop in the cable would be of little consequence. <S> Alternatively, look at finely stranded 'noodle' wire, which is very flexible (though you can't escape the weight for a given cross-sectional area, and thus voltage drop over a given length at the operating current).
| Using the same gauge as the existing cable may lead to a high voltage drop over this distance, so you should look for thicker cables (or splice e.g. one existing wire to two extension cables).
|
Design for long term reliability? I need to design a small board that will go into a large piece of public infrastructure intended to last many decades. I am looking for papers and the like that give guidance on such design based on real research . This board will be much bigger for mechanical reasons that it needs to be for even a spacious circuit to achieve the function with discrete parts. Things like wide traces is a no-brainer. The customer wants to minimize total parts, and wants them to be thru hole. I see the point about minimizing parts, but which parts also matters a lot, and being able to get replacements in the future is important. This function can be implemented with a handful of discrete transistors and resistors, but the customer would rather use a single logic IC in DIP package. He thinks thru hole is more reliable, but I think I remember seeing a study that says the opposite. Also, I'm worried about availability of a 16 or 20 pin DIP logic chip in 20-50 years. But, are SOT-23 transistors and 0805 resistors a better bet? There will be some opto-isolators. It seems to me those will swamp everything else in terms of reliability and future availability. Yes, I'll run the LEDs at a small fraction of the rating to increase life. So, I'm looking for real definitive research-based information on designing for long-term reliability. This is an area where it's easy to think about the 10% problem but miss the 90% problem that makes the 10% issue irrelevant. Added: I'm looking for evidence-based answers. I like to think I know electronics pretty well, and can come up with various plausible-sounding reasons why one approach may be better than another, and I'm sure others can too. However, I don't trust those because what sounds plausible and is based on sound physics may be correct but missing some other more dominant affect. I'm worried that this is where educated guessing could lead to significantly wrong conclusions. That's why I'm asking for evidence-based answers, papers from actual studies, rules NASA might insist on, etc. Added 2: Consider the environment "industrial". I'm not sure how well the environment is controlled if at all. The boards will be protected from the elements, but possibly no air conditioning or heating. I don't know about vibration, probably not much. These boards will be installed in a cabinet that houses other parts of the electrical system. Service technicians can walk up to the cabinet when necessary. Difficulty of servicing isn't the issue, but downtime is. This is not what's going on, but imagine if a interstate highway was shut down until the system is up and running again. Of course there is redundancy already, but failure is something you really want to avoid. <Q> NASA has a lot to say about long term reliability of electronics. <S> Here's one example -> https://nepp.nasa.gov/files/20223/09_109_1%20JPL_Spence%20Longterm%20Reliability%20of%20Hand%20Soldering%20M55365%20Ta%20Capacitors%2009_30%2011_09%203_2_10.pdf <S> one example (references are at the end). <S> I can't give you good link to everything related (NASA web site is quite messy), however, googling 'nasa long term reliability electronics' gives a lot of links to papers on the topic. <A> I will add to this answer what I know. <S> To begin with "creep corosion", you have an investigation here <S> It is actually related to enviroments containing sulfur. <S> It's worth a read if nothing else it's an interesting topic. <S> There are a lot of articles related to ROHS and tin whiskers from NASA, links . <S> Another thing to consider is the FR4 material itself and CAFing. <S> This is not a study, but it ilustrates the issue. <S> About the reliability of SMD, a study was conducted in 1993 and there are some interesting letters in the appendix. <S> Link . <S> For capacitors I would say to go with ceramic MLCC, here <S> is a comparison between precious-metal-electrode and base-metal-electrode. <S> Included is a table with tested units. <S> For ceramics there are capacitor designs that have a "soft electrode" and the ones that are more likelly to fail in "open mode". <S> According to The capacitor handbook (Cletus J. Kaiser) <S> the glass capacitors are the most reliable, and I remember NASA used them. <S> I did not found reliability data yet. <S> Try this for reliability data. <S> Also for other capacitor types. <A> My answer is not based on real research , but rather on real application. <S> I recommend that you use the most reliable components and and create a board with them. <S> Determine its MTBF. <S> Based on this MTBF, assemble enough boards to cover the total time this design is supposed to last, and double that number. <S> For example if the MTBF is 10 yrs, and the time the design is supposed to last is 50 yrs, then you need to make 10 boards. <S> To minimize the "down" time, a set of "switches" can be automatically activated to disconnect the bad board and connect a good board in its place. <S> The bad board can then be replaced with a good one and be ready for the next board failure. <S> You will not need to worry about repair parts not being available - you already have them!
| Generaly speaking you want to get parts that are at least automotive qualified.
|
Toolchains for STM32CubeMX IDE: what to choose from? I just installed the STM32CubeMX (original ST Microelectronics's ARM IDE if I understand right). Once installed I tried to open a new project for a DISCOVERY kit I have (STM32F0DISCOVERY). Howether after I proceed to Open project I faced with a demand to install a toolchain: As I revealed EWARM is a full functional IDE by IAR so I was surprised that STM's IDE requires IAR's IDE for its work (besides IAR's EWARM isn't a freeware - it is a very expensive software as I know). In the project settings window are three choices: IAR's EWARM, Keil's MDK-ARM and Atollic's TrueSTUDIO. All are very pricey :( So the questions are: Is it correct that STM's STM32CubeMX will not gives me any functionality for free? As I understand from the message, the project can be associated with another tool chain so can I take a look at GCC or any more reasonably priced (of course I'd rather prefer free software) toolchain? If yes: how can I use GCC with Cube? <Q> I know it's an old post, but this might help others... <S> Don't confuse toolchain with IDE. <S> You might consider the IDE to be the last link in the toolchain, but a toolchain does not necessarily imply an IDE . <S> In my case (ARM gcc build [linker, compiler, assembler, etc] + automake) is my toolchain. <S> I don't use an IDE. <S> I take the generated source code from CubeMX and write makefiles to compile it in the manner I choose. <S> This, despite the fact that I don't use (nor intend on using) TrueStudio. <S> If you want to use gcc, great. <S> But IDE selection is largely an independent choice, unless the IDE you've chosen foists some other compiler on you. <S> If you really want an IDE (IMO, they get in the way more than help), you might have to choose one that mates up with automake (Makefiles) or gcc directly. <S> Eclipse is the only one I know of. <S> Some compilers have different conventions for handling preprocessor-level constructs (macros, pragmas, conditionals, etc...) <S> but the actual source code won't vary much. <A> For an IDE which offers some features like the Cube, I can suggest Coocox maybe worth a try. <S> It's free, based on Eclipse and supports some of the STM boards out of the box. <S> From my understanding the CubeMX is just a code generator which will write you code (inside that folder you give it) where all the peripheral initialization is taking place. <S> All other development has to take place in a normal IDE. <S> Update: <S> It was recently announced that Atollic Truestudio is now offered for free for STM32 users. <S> I guess that will give access to a higher end IDE and toolchain to a broader audience. <S> I haven't used it, so I can't comment on it's features but built in hard fault analysis in the debugger could come in handy for example. <A> I would try the toolchain from Leaflabs that they use for their Maple hardware . <S> The Maple is an Arduino style board running an STM32 Cortex M3 processor. <S> They give the toolchain away with the IDE and the IDE runs windows, so the toolchain may work for your situation. <S> No guarantees of course. <A> All tools have a restricted, but free version.... <S> Despite I am inthe same shoe like you, I use GUN/Linux, unfortunately all of the tools above run under WinOS. <S> After some search I found a solution. <S> I will test soon carefully, but before I share the solution: Read the blog post of Baoshi . <S> He has a description and a Makefile file generator. <S> Some addition:With the newest Cube I need hack because Cube do not generate right <S> *.ld file for F0, so I copied from an another tools <S> *.ld <S> for the same target. <S> Maybe it is a Linux related question.
| Eclipse is an IDE that connects to many different toolchains. The toolchain option in my CubeMX options is TrueStudio because that option generates a nice linker script that I can easily change.
|
Unknown source of noise when measuring with oscilloscope The original question was how to decrease power supply noise , but after discussion it seems to be just a measurement problem. Case 1: When I short the ground lead to the probe, I read about +-2mV rms - acceptable by me. Case 2: When I connect the ground lead and the probe to the 0V of the power supply, I get a lot of noise with spikes up to +-50mV - not acceptable. Common sens and several people say that in both cases, I should have a reading as in the case 1. What could be wrong with the oscilloscope? The oscilloscope has an earth ground pin in the AC power cord. The power supply also has the ground pin in its AC power cord. I do not connect power supply's negative negative terminal to the earth ground (the green connector on the front panel). Even if I do, it does not seem to affect the measurement - I still get the same random noise. Please, help me to find the source of this noise. <Q> The most likely culprit is your bench supply. <S> First thing to do is look at the regulator input. <S> If you check the data sheet, you'll see that the output noise figure is specified for a bandwidth of 10 Hz to 10 KHz, and the spikes you see on your scope have much higher bandwidth that this. <S> There is no specified response time of the regulator to changes on the input, but it is certain to be much, much slower than those spikes. <A> Use a small capacitor between the output and ground. <S> The cap will discharge during sags and charge otherwise, and shouldn't interrupt your output because it's not in series with it. <S> You would have to calculate or experiment to find the right size cap. <A> The oscilloscope ground lead is always referenced to the earth connection of your AC plug (except battery operated oscilloscopes). <S> Are you sure <S> that the DC power supply you are using to power your circuit is well referenced to the same earth connection? <S> That does not only mean that the DC power supply ground is connected to earth pin of your AC plug, it also means there is actually a connection between the DC power supply earth to the oscilloscope earth. <S> If it does not, you will probably get the noise you are experiencing. <A> What voltage / current is your power supply putting out to your circuit under test? <S> The quick test is to simply operate your circuit from batteries and check the noise again. <S> Then connect just the negative lead of the power supply to your circuit (while it operating from batteries) and check again. <S> You should be able to narrow down the cause of the noise in fairly short order.
| You problem probably is with the earth reference between the scope and your circuit.
|
Help to identify voltage regulator from markings I have a regulator on an Arduino Mini Pro board (Chinese clone) which should be a 3V3, but it seems it's a 5V one (by measured voltage). The markings on the component are BALG. Does anyone know what it is? Edit : have added a picture of the board. I need a 3V3 one because I have a communication board that requires that voltage. <Q> It cannot be either the PAM2301/AME5110, this is because those are switching regulators and there are no inductors on that board's top. <S> Secondly the fact that there SMD codes are BA <S> *** or BAR <S> ** respectively which does not match your model. <S> It is possible that it is RT9193 5 volt LDO regulator from richtek. <S> This is as its code is BA, the LG is the lot code. <S> And it is obvious <S> it is the 5v version because of your VCC reading. <S> The manual is here <S> , this is found on s-manuals where there is a table of smd codes linking to datasheets where you can look for the respective component, this works as you can look for the respective component according to functionality. <A> SMD markings are unfortunately not unique. <S> It may be a PAM2301 or AME5110 step-down dc-dc converter, but you have to compare how it's wired in your circuit with the datasheet. <A> Sorry for bringing up an old discussion, but I was just checking up about this myself and thought it might be useful if anyone else is looking in the future. <S> On their markings, the second letter is Vout, (a/b/c/d/e/f = 3.3/2.8/2.5/1.8/1.5/3.0). <S> So BALG should give a 3.3V output. <S> Looking at the schematic, the RAW input should be connected to the regulator's Vin, and the Vout is connected to the board's Vcc. <S> If that's the case, then it's possible the regulator's not working properly.
| Searching for 'balg voltage regulator' led me to a datasheet for a Seaward SE5509B linear regulator.
|
To detect speakers are playable In my audio project, speakers are connected to voice chipcorder(ISD3800) and the voice chip is connected to micro controller.Audio functions well with the setup. My question is, Is there any way to find my speakers are playable before playing any audio?Ideas to detect speaker failure before playing any audio... Thanks in Advance <Q> Is there any way to find my speakers are playable before playing any audio? <S> Try using them as a microphone - normal speakers will produce a decent signal for regular sound waves. <S> If you can't do that try using another speaker to produce a ping sound (simple short audio burst) and detecting that in the speaker under test. <A> If you don't have direct access to the speaker - as I suspect <S> you don't since you say its driven by your chipcorder IC, then you could put a small microphone next to the speaker and monitor it with your microcontroller. <S> While there are certainly other ways to check the operation of a speaker, I think most of the less complex ones will interfere with the playback operation of the chipcorder IC. <A> What sort of speaker fault are you looking for? <S> Defective speaker? <S> Disconnected speaker? <S> In some public-safety applications, emergency paging speaker systems must be tested automatically on a periodic basis.
| One technique used is to have a microphone located close to each speaker and see if it responds when the speaker is driven with an ultrasonic (20 KHz is common) signal.
|
why don't serial lights get dimmer..? If 2 lamps of same power are connected in series, the first one connected glows better and the next one gets dimmer..then Why doesnt the serial lights( Christmas lights ) get dimmer even though they are connected in series and share the same voltage..?? <Q> If your supply is 240V ac <S> and you have 20 lamps in series, each one will have approximately 12V across the lamp terminals. <S> It makes sense for each lamp therefore to be rated for 12V operation and of course if you tried to put that across 240V it would instantly fail and blow. <S> If you took a 240V lamp and put it in series with another 240V lamp, each lamp would be receiving 120V and therefore the brightness would approximately reduce by a factor of four. <A> The answer to your second question is related to your first. <S> If 2 lamps rated for the same voltage and power are connected in series, then the same current must flow through each one. <S> Since they are rated for the same voltage and power, the resistance of their filaments must be the same. <S> Thus if the current through them is the same, the voltage will also be the same. <S> Hence, the power, which is the product of voltage and current, will also be the same. <S> Thus they will glow equally. <S> The same is true of a string of Christmas lights. <S> It doesn't matter how many; they will still glow equally. <A> As was suggested in a comment by @JarrodChristman on the question, if the two lights claim to be rated the same, but they are not the same brightness when connected in series, then the lights do not actually have the same specs. <S> Perhaps the filament on one bulb was extruded a little thinner than the other; even though they are both approximately the same rating, one has a slightly higher resistance, and burns a little hotter (and brighter, and will burn out sooner). <S> In a strand of Christmas lights, each bulb dissipates so little power (1A/125V on a 50 light string is ~2.5W per bulb) that a 5% manufacturing variance on the filaments means the bulbs are only going to vary by ±0.125W. <S> With a 40W household bulb, a 5% manufacturing variance means the bulbs could vary by as much as ±2W. <S> I'd bet that on that string of Christmas lights you consider to be "equal" brightness, <S> if you were to measure the luminance of each bulb individually (with total isolation from all other light sources) with a precise instrument, you would indeed find that some are not quite as bright as others.
| Christmas lights don't exactly "share" the same voltage on each lamp - they happen to have approximately the same voltage but that is because they are all in series and have roughly the same impedance to current when glowing.
|
What software can I use to simulate I.B.I.S Models? I am trying to simulate a switch (TS5A3154) which is made my Texas Instruments but the only models they have available are ones called IBIS Models. Now I have done a little bit of research and found that it means Input/Output Buffer Information Specification but I cannot for the life of me find any software that will allow me to play around with the model and give me some meaningful results! Here is the link to the IBIS files that I wish to simulate and if anyone could offer me any insight as to what software to use to run these models and where I could obtain said software, that would be great! I would preferably like to know about free software options if they are available because I am a bit of a scrounger like that. <Q> The unfortunate fact is that you need Mentor Graphics Hyperlynx, Cadence SigXplorer, Agilent ADS, Synopsys HSpice or a similar caliber software. <S> I have looked high and low - tried many different ones - to find any free options for my courses in signal integrity. <S> Unfortunately we are not quite there yet. <S> Altium can do some IBIS simulation as well, but last time I tried they were not really up to par. <S> If you have an interesting problem, feel free to put it up as a question and I may just quickly run it through SigXplorer or Hyperlynx for you (and add it to my blog or as an example in my courses). <S> Did that help? <A> Oh there are lots of tools that use IBIS from spice simulators like H-spice to visual SI tools like a Cadence Sigrity Speed 2000, and the list goes on. <S> Never used a free one <S> but I see support for ibis in eispice <S> and I see gnucap <S> supports it as well. <A>
| You can use Micro-Cap (evaluation version) to simulate the IBIS model in a Spice environment, using a dedicated IBIS symbol.
|
Is it safe to use a soldering gun when attempting solder repairs to a PCB with IC chips and other processing units? I have a laptop that needs to have a part repaired. I have a roughly 20 or 30 watt soldering iron, but it seems to take so long just to melt the solder onto the eyelet. Holding it there for so long causes me to wonder if I might be damaging sensitive components nearby. So I got this idea. A soldering gun heats and cools very quickly, which means I can apply the tip to the eyelet, put the solder onto the eyelet, or whatever metal contact I have to apply solder too, and then compress the switch to turn on the heat. It heats up pretty quickly, so it'll melt the solder, and once that is done, I can immediately remove the soldering gun tip and solder string, allowing the gun's tip to cool before applying solder to the next part. I was in Job Corps, and I did electrical assembly. I had chosen to build one of those hobbyist electronics assembly multimeter kits as the part to the class, however, it didn't work properly, and I couldn't figure out what I did wrong. My conclusion was that I must have damaged the IC chip when applying solder. I probably applied the iron for too long to the eyelet in order to melt the solder to it. Since then, this has always been a problem. I have to apply the soldering iron for several seconds just to get the solder to melt onto the eyelet. By that time, I fear I am destroying components. I know, I could try and melt the solder onto the iron, and let it flow onto the eyelet that way, but I distinctly remember reading that that is the wrong way. The solder must melt onto the contact in order to ensure proper melding with the contact metal. This is why I thought the gun my help me. It will surely allow the solder to melt rather rapidly, and I can remove it as soon as the solder has melted. It should be far quicker than a soldering iron. Feel free to make recommendations, as I am not by any means skilled nor experienced in soldering components. However, my primary question that I'd like answered is whether a soldering gun is safe using it in the manner that I have illustrated above. BTW, the PCB is a laptop motherboard in which the CR 2032 battery housing has become detached from the contacts, and I must reattach it after drawing a new metal lead with a PCB pen. <Q> I would not use soldering gun to solder onto any PCB ( it simply does not control the temperature, fast variations/ not good ). <S> That is not the purpose of the gun. <S> There are better tools for soldering, like soldering iron. <S> I replaced capacitors on my PC mainboard using soldering iron @ 300 degrees Celsius. <S> To make your soldering succesfull, apply a little solder onto the iron tip, then quickly place it on the solder place for CR2032 <S> ( !!! <S> battery must be removed!!! ). <S> Add more solder to finish the soldering proccess. <S> I don't think that soldering the ic for less than 10s can damage the IC (rare), but you should try to be quick as possible. <S> Soldering other components, like battery holder, would not damage other components. <S> You could apply some soldering flux to the soldering points of the holder. <S> Use quality soldering iron, be as quick as possible and good luck. <A> I agree with Triak. <S> I don't think that a soldering gun is a solution. <S> The reason why is that it does not have any feedback to control the tip temperature. <S> The right solution is to have a soldering station, which controls your tip temperature. <S> To solder an IC, you should not need either a high temperature setting or a heavy duty tip (large thermal mass). <S> The soldering process should not take more than 3 seconds, if it does there is something wrong with your system or your technique. <S> Possible mistakes are an iron tip that is oxidized, using a solder wire that does not have flux, a low quality one or even if it is lead free. <S> Concerning your technique, you may not be touching both the pad and the IC terminal at the same time. <S> There are tons of videos on YouTube about how to solder. <S> I personally recommend the one from eevBlog. <A> Although a soldering gun is not the ideal tool for PCB work, it can work well IF you are careful. <S> You are right to worry about your soldering iron not having enough heat capacity to reliably make solder connections to your PCB, especially large pads. <S> Keeping a soldering iron that isn't hot enough to melt the solder on the pad is a sure-fire way to cause the pad to lift off the board. <S> Best option is to have someone else who has the proper equipment to do the actual soldering for you. <S> This should cost you approximately nothing if you have already disassembled the unit down to the PCB by itself. <S> Next best option is to replace the battery holder (if it is damaged) and then use thin insulated wire to connect the terminals to the proper nodes on the board. <S> I find that pens filled with conductive liquid do NOT make reliable, long-term connections when used to repair missing traces or pads on circuit boards. <S> Use glue to hold the battery holder in its' location if needed. <S> Hot-melt glue works well for this and is removable if you need to do so later. <S> The two main problems with a soldering gun is the large tip size and the uncontrolled amount of heat that it produces. <S> Nonetheless, it CAN be used to make a reliable repair IF you are extremely careful. <S> One final note: there is a significant probability that your soldering gun has significant leakage current from the AC Mains to the tip. <S> The cure for this is to ground one side of the tip to Earth ground.
| I fear that the soldering gun can actually do more damage to the mainboard than the soldering iron. It may damage the PCB traces as well as the IC.
|
Why does ammeter or voltmeter measures RMS value When there's an alternative voltage, why does the voltmeter measures rms value instead of the value at that specific time? <Q> I'm assuming that you are asking about an old-fashioned moving-coil meter. <S> These meters measure AVERAGE value, not RMS. <S> An AC meter is calibrated to read RMS voltage with a sinusoidal waveform. <S> These meters can indicate the exact voltage at some particular point in time <S> IF the waveform is changing so slowly that the meter needle can follow the waveform. <S> This is possible at frequencies significantly less than 1 Hz. <S> At higher frequencies, the mechanical inertia of the meter movement acts like a low-pass filter and the needle indicates the average value of the input. <A> If you are measuring a 10Khz signal, what value would you read ? <S> What value would be useful to you ? <S> It would be constantly changing. <S> What good is a constantly changing value on an LCD display especially if its changing so fast. <S> A 10Khz signal has a period of 100 microseconds, so depending on the number of sample points taken, you are looking values changing much less than 100uS. <S> This all assumes that the meter is even capable of sampling so fast. <S> A light bulb connected turns on and off at 50Hz to 60Hz depending on your region. <S> Do you see if turn on and off ? <S> You don't because our eyes can't detect that change - our eyes are too slow. <S> 60Hz has a period of 16.67ms. <S> Now imagine its changing less than 100uS. RMS is a fixed value. <S> Regardless of the constant changing values, the RMS value will be fixed for that particular peak or peak to peak voltage. <S> If you require to see the signal, then a oscilloscope would be better suited. <S> See comments for corrections about flicker and detectable flicker frequencies for eyes <A> There are a variety of properties which tend to be related to RMS voltage. <S> For example, the amount of heat generated by a resistor which is fed by an AC voltage source will be equal to ... <S> the average of (voltage times current), which will in turn be equal to... <S> the average of (voltage squared divided by resistance), which will in turn be equal to... <S> the square of (square root of the average of (voltage squared)) divided by resistance, i.e. the square of the RMS voltage, divided by the resistance. <S> Note that while higher quality meters will actually compute the RMS voltage, lower quality meters will actually measure something else (e.g. the peak voltage or the time-averaged rectified voltage) and multiply it by scaling factor. <S> For example, since the RMS voltage of a sine wave will be proportional to its peak voltage divided by sqrt(2), a meter that measures peak voltage would scale its readings by a factor of about 0.707. <S> Since average rectified voltage is about (2/pi) times peak voltage, a meter that measured average rectified voltage would scale by 1.11. <S> Such measurement techniques will work fine when measuring sinusoidal waveforms, but will yield inaccurate results when measuring anything else. <A> When measuring AC voltages or currents, the value displayed is calculated ('integrated') <S> over some time, this is not an instantaneous measure (contrary to, for example, an oscilloscope) <S> The indicated measurement is not always the true RMS value, only instruments made for "true RMS" can measure the RMS value of any waveform, simpler ones gives a correct measurement only for sine waves. <A> Normal AC power goes through one full cycle (from 0 volts to maximum positive voltages, back to 0, then to max negative, and finally back to zero) 50 or 60 times a second. <S> A normal meter can't read and display voltages fast enough to follow the instantaneous voltage - and if the meter could, our eyes wouldn't be able to make any sense of the result. <S> The RMS voltage is the effective voltage of that continuously varying voltage, so it the value that is most often of interest to us.
| The interest of RMS over peak or average measurements is that it indicates the energy, or power, of the signal.
|
Vias in footprint with no thermal relief? I'm making a small board for a PIC18F26K22 microcontroller and the provided footprint in Microchip's Altium Vault is shown below: I'm assuming the polygon under the IC is a GND pad, but am not 100% sure since I can't seem to find anything confirming this in the datasheet . My concern is that the vias don't have any thermal reliefs and are untented, so isn't it likely that when the QFN chip is being soldered that the solder will get sucked through the vias as well as the GND pad possibly not getting hot enough? EDIT: Oh, and the square pad was not named GND (which I just noticed you can see) to start with -- that was me trying to find a way to get the pad to connect to my GND net when routing the board. <Q> That central pad is for thermal management. <S> Putting thermal reliefs would be unnecessary, since nothing is soldered to it, and counterproductive, since the cutouts would impede heat flow to the vias. <S> Since the thermal conductivity of solder is about 12% that of copper, I doubt that it matters a whole lot, and I doubt that the recommended via pattern even assumes any solder at all. <A> This is a good reference for QFN reflow and layout: http://www.ti.com/lit/an/sloa122/sloa122.pdf <S> It has a whole section about vias on thermal pads. <S> It says: <S> The thermal vias should make their connection to the internal ground plane with a complete connection around the entire circumference of the plated through hole. <S> Place a ring of exposed copper ( <S> 0,05 mm wide) around the vias at the bottom of the copper plane. <S> It also has this to say about solder loss and protrusions: <S> If thin PCBs or vias larger than 0,3 mm are used, designers may use only external vias to prevent solder loss and protrusions Solder loss and protrusions result when excessive solder flowed through internal vias during reflow. <S> Solder loss results in voiding and severely affects thermal conductivity. <S> Protrusions might cause misalignment in stencil on the reverse side of the PCB <A> If it were me I'd be planning to nonconductive fill those holes and then plate flat. <S> Of course I'd double check the part datasheet :). <S> I should add that in a qfn package which I assume that is? <S> The purpose of that pad is to conduct heat out of the part so you don't want to counter act that with thermal relief. <S> Your assembler should be able to handle putting it down. <A> From the way this is drawn, red is <S> copper and purple is the negative solder-mask (i.e. where there isn't a solder mask). <S> The central pad has a "negative" solder mask (i.e. there is exposed copper in the middle). <S> You DO want to solder it because plain metals touching has very poor conduction properties (this is why CPU's found in computers have thermal paste between the chip and the heat-sink, even though the paste has terrible thermal conductivity compared to the raw metals). <S> For obvious reasons you don't want thermal reliefs on the vias on the central pad: thermal relief is there to prevent the flow of heat into/out of the via, which defeats the purpose of a heat sink. <S> Yes, this will make soldering harder. <S> Depending on how you intend to run the chip, you may or may not need extra copper on the bottom for a heat sink. <S> I would still solder it for mechanical rigidity, but realize that there really isn't a huge heat transfer benefit without more copper to sink the excess heat to (especially since it's sandwiched between the board and the chip). <A> My concern is that the vias don't have any thermal reliefs and are untented, so isn't it likely that when the QFN chip is being soldered that the solder will get sucked through the vias ... <S> I often see these types of pads made with untented vias. <S> This seems to be okay because 1.) <S> the vias are small and after plating they really don't have a lot of volume for wicking away solder; and 2.) <S> Such a big pad will typically have an excess of solder anyway --- to avoid it <S> you might even break up the pad into 9 smaller squares and use negative solder paste expansion to give less than 100% paste coverage on the pad. <S> However you might want to check with your assembly house for their recommendation on how to set up this footprint for manufacturability. <S> ... <S> as well as the GND pad possibly not getting hot enough? <S> This type of package really needs to be assembled by reflow methods. <S> Reflow generally gets the whole board, part, and solder all up to the solder melting temperature and thermal relief isn't required. <S> You can't really get an iron onto that center pad anyway, so hand soldering isn't really a concern. <S> trying to find a way to get the pad to connect to my GND net when routing the board. <S> There are two ways to do this in Altium: <S> Add an extra pin 0 or pin 29 to the schematic symbol and connect it to ground. <S> Then number the center pad in the layout the same way and update the schematic from the layout. <S> Simply click on the pad to get it's properties and change the Net property to connect it to GND (or any other net you like). <S> I'm not sure if this could get undone the next time <S> you sync the schematic to the layout, though.
| The vias are there to provide extra heat conduction to a bottom layer of copper which is your heat sink. These usually happen when incorrect internal vias sizes and stencil openings are used. Designers are encouraged to x-ray their reflowed boards to verify that at least 50% of thermal pad area is soldered (less than 50% voiding) when using 0,127-mm thick stencils.
|
What are my options for interfacing **30** incremental encoders to an MCU? Background: I am familiar with interfacing a few incremental/quadrature encoders to a single MCU chip. My go-to chip STM32F10x can decode 4-5 encoders even in a LQFP64 package (e.g. STM32F100R8T6 has 4), which had always been more than enough for me... until now . Problem: I want an ATXMEGA128 to effectively poll counts of all 30 encoders at 1kHz (say, by keeping 16-bit counters). I cannot change the ATXMEGA128 to some other MCU, but I can add another MCU to interface with it. The bottom line is I could slap on a FPGA (e.g. Spartan3E) and make it talk to MCU through SPI or parallel, but I'd like to consider some alternatives before I go down this path (for non-technical reasons). The number can be reduced to 15 if 30 seems too hard without FPGA. <Q> A small FPGA is the way to go here. <S> You would need a very large CPLD to manage this many encoders - they are not useful for much more than glue logic. <S> Generally a CPLD gives you one flip-flop per pin. <S> An FPGA has logic resources that are specifically designed for building things like accumulators and shift registers, and far more of them than a CPLD with the same number of pins. <S> For 30 encoders with 16 bit counters on each, that's a minimum of 480 flip flops just for the counters, not counting the encoder processing and SPI interface. <A> Why not use quadrature decoder chips? <S> The LSI LS7366R <S> is a 32 bit quadrature decoder that also supports the index signal if needed. <S> Everything you need is inside that chip and read via SPI. <S> There is also the old standard Avago, previously Agilent, previously HP <S> HCTL-2032-SC . <S> It uses an old school parallel bus interface and is in a large PDIP package. <S> I am putting it here for reference as I have seen it used in many old CNC controllers. <A> This solution is very extensible, but it creates a big mess of wires. <S> You can interface one encoder with two 74HC193 s and use a bunch of I2C GPIO extender to read them. <S> This will allow you to add as many encoders as you like. <A> In the end the decision was to group them by 4 as @spehro-pefhany suggested in comment, and connect them to a bunch of MCUs, which can then communicate on SPI bus. <S> The main advantage is less cable mess, as I can place the MCUs close to the encoders.
| I would suggest a small Spartan 3 or Spartan 6 - they are available in TQFP and should be easy to interface with.
|
Which digitally-controlled chip to replace eight transistors (GE D44C7)? I would like to programmatically toggle off/on (independently) eight 5 V small light bulbs. It seems that I could use eight transistors controlled by eight independent digital control pins. (See the attached schema below.) But I'm sure there is a simpler way using a single chip ... with only one or two digital control pins (my digital control out(s) are 5 V max with a 255 steps resolution, so it could be OK to store all the different combinations within only one byte!). I'm actually using an Arduino , so some of the digital outputs are PWM (at first, I simply tried to directly use the digital output to light the bulb on/off... But not enough current was available on the Arduino :( The lights will be triggered on with a 200 mA current, but for a small amount of time (less than 50 ms) I'm OK if I need to use three digital pins! I'm aware the magical chip should have at least eight pins (one per bulb) I'm super newbie, so not too much programming please :) <Q> Try this device, it looks suitable: - <A> Your question is confusing in more than one way. <S> It starts with your light bulbs being small. <S> The relevant parameter is the current they draw, not their size. <S> Next you say that your digital outputs are 5V max with a 255 step resolution. <S> Do you imply that they are analog outputs, or maybe digital but PWM? <S> You end with 'it should be OK to store all combinations in one byte' <S> is correct if you are controlling 8 lamps, each fully on or fully off, but that implies that you need 8 output pins, and you seem to think that fewer are OK. <S> Anyway, if your lamps require let's say 100 mA each, you can use an ULN2803 chip as 8-fold buffer. <S> If you are into some more programming, you could use a TPIC6C595 to do the same, but using only 3 output pins of your microcontroller, or just 2 if you don't mind a little ghosting. <A> D44C7 is capable of 4 amperes but the chip set I am suggesting will not be able to handle that much current. <S> If your design works within 500mA you can try this: <S> ULN2003 <S> NPN Darlinton array. <S> And if you need to free up some pins you can add a PCF8574 8-bit I2C GPIO expander so you only need to use 2 pins from your MCU, and I2C is a bus so the signal lines can be shared. <S> The <S> PCF8574 / <S> ULN2003 chipset works like this: <S> simulate this circuit – <S> Schematic created using CircuitLab <S> The <S> ULN2003 is pin compatible with '2803 <S> (in the sense that it can fit in '2803 footprint, leaving bit D0 unconnected) so choose the one that suits your needs. <A> Any open-collector or open-drain octal buffer in the 7400 series, like http://www.ti.com/lit/ds/symlink/sn74bct760.pdf , with an eight-bit serial in parallel out shift register, https://www.fairchildsemi.com/datasheets/74/74VHC164.pdf , should do the job. <S> Looks like TPIC6A595 would work
| If you want to go with one chip, you need to look for an open collector output shift register.
|
How measure the voltage over a large resistance? I know initially this question might come across stupid and obvious but all is not as it seems. I want to measure the voltage drop over a 10M ohm resistor but my voltmeter's probes have an impedance of ~10M ohm, so if I try to measure the voltage drop the conventional way (i.e. put in parallel with load) but that would then cause the resistor value to half as it would make two 10M ohms in parallel giving ~5M ohm. This is a similar situation if you just try and measure the voltage either side of the resistor, when you try and measure the lower potential side it will create a voltage divider and just gives me half the input voltage which is somewhat undesirable and highly inconvenient. So my question to you folks is, how can I measure the drop over a large resistor without inadvertently putting an extra load on the circuit caused by the measurement equipment? Some information about the circuit may be of use to you budding electroneers: Voltage going into resistor = 3V DC Voltage desired out of the resistor, also = 3V DC (or a little lower) Resistor is going into a control pin for a 2:1 multiplexer / swtich (the TS5A3154 to be precise) It would appear I neglected to mention the purpose of the resistor... It is being used as a pull up resistor either on its own or as part of a transistor level translator (I have not yet decided on that) in order to get this pin to detect a logic 1 without drawing too much current. Note that the output of the MCU will only be ~2VDC which will cause the chip to drain more current than I would like it to, I haven't yet had time to think fully about how I will have this bit set up but this is the basic premise. This question is not about the amount of current that will be drawn, just purely about measuring the drop over a large resistor which is not connected straight to ground and any attempt to use a multimeter in the normal way would cause errors in results dues to probe resistance. <Q> Create a Voltage Follower circuit with a much higher input impedance and measure the output voltage of that. <S> However, by what you're describing, I'm not sure you're using the resistor right in the first place. <S> Please expand your question with a schematic and a full reasoning behind the use of the resistor. <A> An op-amp buffer (unity gain) with CMOS input can be used. <S> For example an LMC6062 has fA leakage and 100uV maximum Vos. <S> It will need about a 6V single supply minimum (9V battery would work fine) in order to measure 3V. <S> If you really want to get down to electrometer-style leakage, special construction techniques are required, but for 10M\$\Omega\$ measurements to 1% (1G\$\Omega\$) nothing special is required, just normal care, clean after soldering (and avoid no-clean solder flux). <A> JFETs have input resistances in the teraohms. <S> Using a JFET amplifier or using a specialized DMM with a JFET input will allow you to measure such a voltage drop. <A> I usually do that with a pair of LF356 connected as unity gain or gain x2. <S> If one end of your resistor is grounded, you need only one LF356 on the high impedance end of the resistor. <S> Make sure that you supply your LF356 with sufficient voltage to avoid saturation around ground and around positive supply (3 V below ground and 3 V above supply is good).
| Two things you can do: Measure the current flowing through the resistor, then calculate the voltage drop across it (Ohms Law).
|
How to calculate this LDO regulator, and how to prevent it from oscillating? I am further playing around this PMOS LDO circuit I designed and attempted to test and rate (the Edit 3 schematic, simplified by removing the protection circuit). After I dropped in a NJM4559 op amp in place of LM358 it started oscillating (previous record was none of LM324 , LM358 , TL084 or OPA2134 oscillated). Is this a blessing from TI? (kidding) How to calculate this circuit, since I have one more MOSFET than what I found in TI's application notes. If it was oscillating, how to stop it from doing it? My way of determining whether the circuit is oscillating is checking for the Moire pattern on DMM readings since it is difficult to have the LDO oscillate at the frequency (or a harmonic) of the DMM's internal clock frequency. Is this way of checking for oscillations reliable? Don't yell at me about oscilloscopes as I don't have one to start with. Donations are welcome. Here I replicate the circuit I tested. The op amp can be any one of the following: LM324 , LM358 , TL084 , OPA2134 or NJM4559 , and the last of which oscillated. R6 is a load resistor I attach when testing and value options are 10 ohms and 1 kiloohm. Respect the part numbers as those are exactly what I used. simulate this circuit – Schematic created using CircuitLab <Q> You just cannot add gain to the output of an op-amp (extra transistors) and expect this to not oscillate without the appropriate compensation. <S> Look also at the data sheet of the NJM4559 op-amp that was giving you problems. <S> There is nothing in that data sheet that even hints at what the phase margin is. <S> I would expect to see a graph like this: - This is for a TL084 op-amp <S> and you need to study it in detail; at low frequencies the phase difference between output and input is about 180 degrees - this is what you'd expect from an amplifier i.e. it is largely inverting. <S> As frequency rises there is usually <S> a mini plateau were the phase angle has shifted about 90 degrees i.e. it is behaving like an integrator. <S> As frequency rises further, gain drops to unity and the phase margin is about 50 degrees i.e. it's 50 degrees away from being an oscillator. <S> Some op-amps are a bit tighter than this and <S> for many op-amps, the unity gain point (the highest frequency that oscillation could occur) is a lot higher. <S> For the NJM4559 this is about 6MHz. <S> For the TL084 it's only 3MHz. <S> So, wiring an op-amp with regular resistive feedback and no transistors is fine for the TL084 <S> and maybe it is for the NJM4559 <S> but, the data sheet doesn't give any indication that it is. <S> I would be very mistrusting of this device given the spec that I read. <S> Now, adding gain into the feedback loop (the two transistors) is going to cause problems nearly every single time <S> - you are basically shifting the unity gain point of the op-amp up (maybe 20 dB or more) and this might very well move the actual unity gain point on the graph by up to 10x in frequency. <S> You'll probably also be degrading the phase characteristics and now you have an oscillator because the phase margin has massively fallen thru 0 degrees at unity gain. <S> So, then re-assess what the gain is at 0 degrees <S> and you'll find out that it's several dB above unity = oscillator. <S> Lower <S> the gain of the two transistors is a good start - put a source resistor into M1 of maybe 4k7 and reduce R2 to 4k7 - this is a start but by no means might this be the only thing you need to do. <A> A DMM is a lousy way to check for oscillations. <S> Use a proper instrument instead that is called an oscilloscope. <S> The circuit used may very well have to be more than just a simple low pass filter. <S> The compensation is primarly tuned to response time of the forward path through the circuit including the opamp gain, opamp slew rate and FET switching times. <S> There will however be some reauirement to deal with the circuit layout and nearby coupling between wires and components. <A> Since you've configured M1 to have negative gain from the OA1 output to M2's gate, you need, at the very least, to flip the op-amp inputs - feedback goes to (+), setpoint goes to (-). <S> As it is, your circuit will always oscillate - you may merely fail to see the oscillation. <S> The R2 feeds the roughly 4nF of gate capacitance of M2. <S> That produces a pole in the closed-loop response at 2kHz - M2 is within the feedback loop, after all. <S> Since M1 will be turned on to some extent during regulation, the equivalent resistance seen by the gate will be lower. <S> Let's be conservative and simply use R2's value, though. <S> You need to decrease R2 by a factor of 10, to 2kOhm to get the pole up to 20kHz. <S> You'll also need to add a local negative feedback around OA1, to stabilize it by adding a pole well under the 20kHz pole due to R2/Cin_M2. <S> Isolate the reference voltage from the (-) input with a 4.7k resistor. <S> Then add a 10nF capacitor from OA1 output directly to the (-) input. <S> This produces a pole at 3.3kHz, well under the 20kHz pole of the output circuit. <S> This is about as good as you're going to get it with the architecture that you chose. <S> What really kills the performance of this circuit is the use of an open-source driver M1. <S> Instead, you could use a couple silicon diodes in series, bypassed by a capacitor. <S> This would restore the bandwidth in your circuit. <S> Of course you'd still need the pull-up resistor, but it would not influence the frequency response anymore.
| To prevent oscillations it is necessary to add some frequency compensation in the feedback path to overall slow down the feedback response.
|
How to analyze this Diode Circuit by hand? I need to analyze this circuit by hand, I'm a Mechanical Engineer, so I really have no idea what I'm doing here. I thought about doing the parallel of the 2 top resistances and same for the bottom ones, but that wouldn't work. How do I analyze this? I need to know whether or not the diode is conducting electricity and the intensity of current that goes through it. Sorry if any mistakes language-wise are made, I don't know the technical terms for this stuff in English. Cheers. EDIT:Assumed it was off, calculated the Voltage on the left and on the right of the diode, it's 0.25V, therefore not conducting. Thanks for the help guys! <Q> "Analyze" is really quite general. <S> What are you specifically looking for? <S> Usually, with diode circuits you start with a guess: is the diode conducting or not? <S> Let's guess that it is. <S> If the diode is conducting, in a simple circuit such as this, you can replace it with a .6V <S> (or whatever your diode drop is) voltage source and proceed with nodal or loop circuit techniques. <S> After you've done this "analysis" using whatever technique, check against your initial guess: is the diode indeed conducting? <S> If not, start over with the assumption that it is not conducting. <A> So there are two voltage dividers. <S> It's 2.5 volts on one side and... 5V*(180/400) = <S> 2.25 volts on the other side. <S> 0.25 V across the diode. <S> We would then need to know the diode and the temperature. <S> But (at a guess) there might be 1-100 nA <A> The first question is whether this is for a class or real life. <S> In a class, this sort of "figure out whether the diode is off or on" problem usually assumes an ideal diode with zero forward voltage drop. <S> The standard approach to solving these problems is guess and check. <S> To be a valid solution, one of two conditions must be met: <S> The diode is on and the forward current (from anode to cathode) is positive. <S> The diode is off and the reverse voltage (from cathode to anode) is positive. <S> Let's try assuming the diode is off first. <S> This gives us two voltage dividers. <S> The one on the left (the anode) has two equal resistors, which gives us \$V_A = 2.5V\$. <S> For the one on the right (the cathode), we have to calculate: $$V_K <S> = 5V <S> * \frac{180}{220 <S> + 180} = <S> 2.25V$$ <S> Condition 2 requires that \$V_K <S> > V_A\$. <S> This is not true, so the diode cannot be off\$^1\$. <S> You can see this in the picture you posted, where the simulator shows current through the diode. <S> The next step is to assume the diode is on and verify that the current is positive. <S> I'll leave that part to you. <S> \$^1\$A real diode does not turn on the moment <S> \$V_D > 0V\$. <S> Silicon diodes usually have a 0.6V - 0.7V forward voltage drop at low to moderate currents. <S> There are also more complex ways to model a diode such as the Shockley Equation . <S> A normal diode in your circuit would be unlikely to conduct, but a low-voltage Schottky diode at high temperature probably could.
| You'll need to find the voltage between the resistors and calculate the current through each resistor, then apply KCL to figure out the diode current.
|
Efficiency of high-voltage power lines If it is more efficient to have high voltage, low current power lines, why aren't homes and appliances adapted to accept high voltage and low current (and remove the need for transformers)? <Q> The high voltages used in power distribution are much more hazardous than the 120 or 240 volts we currently have in our homes. <S> They also require much better (thicker) insulation than lower voltages. <S> Around here, I think the local high voltage distribution is 12,000 volts. <S> Most local power distribution here is overhead, so we can see the high voltage lines at the very top of the power poles, on large insulators. <S> When the power company technicians have to work on the high voltage lines, they keep well away from the lines, using insulated "hot sticks" to manipulate the wires and fittings. <S> You don't want that sort of voltage wandering aroudn the average home! <A> Two main reasons Safety. <S> Cost and size of insulation. <S> When you're moving around 100s of MW, particularly for long distance, it makes sense to use a high voltage and pay for the relatively large infrastructure needed to deal with the high voltage. <S> The towers that hold high voltage power lines are big for a reason. <S> The cheapest way to insulate long high voltage transmission lines is to keep a lot of air between them and everything else. <S> In underground cables, creating that kind of space around each conductor would require large and vastly expensive tunnels, so insulation becomes cheaper. <S> Even so, that insulation needs to be thick, and there is a conducting grounded sheath around the cable to bleed off the leakage that does make it thru the insulation. <S> All that is expensive. <S> Underground cables are both more expensive to install and to maintain the overhead power lines. <S> In a house, there is not enough space to use air insulation, so expensive, heavy, and bulky insulating materials would need to be used. <S> And, this doesn't end with the wires in the walls. <S> Outlets would have to be actively insulated somehow to prevent arcing, and worst of all, all appliances would need to be insulated for the high voltage. <S> Do you really want a hair dryer that is the size of a breadbox, has a 6 inch diameter line cord that weighs 30 pounds, and costs $10k? <S> Yes, the actualy power-carrying wire can be very small because it only has to carry 150 mA at 13.8 kV instead of 17 A at 120 V, but all the infrastructure to deal with the high voltage swamps that savings. <S> And, 13.8 kV is still a rather low voltage. <S> That's what goes to the transformer on the power pole in front of my house, and is used for distribution in our town. <S> The feed into town comes from much larger power lines at 100s of kV. <A> In designing high tension lines, the safe distance between conductors is 11..17 feet for the common 500..900kV lines. <S> To have an 'appliance' that operated directly off high tension would first off require an outlet and plug that were more than 14 feet wide, plus an additional 14 feet clearance on both sides for the user's safety (totaling 42 foot wide x 28 feet high for single phase; 42 foot high for 3-phase). <S> Regardless of the strength of dielectrics, how would you plug and unplug something without exposing the conductors to air? <S> Designing an appliance runs into the same problem. <S> The load must be stretched out across the 14 feet to avoid arc-over. <S> Be it a heating element or a motor. <S> You would need bread 14 feet wide for such a toaster. <S> Such a motor would necessarily be obscenely huge, maybe a 100 feet huge, because each winding must begin and end at least 14 feet apart. <S> A 4 pole motor must have a circumference of at least 8*14 feet. <S> The original generators at the power plant put out 28000 volts, and they cannot be made any smaller than the winding depth limits due to voltage generated in them. <S> This is a good foot of depth to each coil. <S> Minimally, there are 4 coils. <S> This size would go up 30-fold with a 30-fold voltage increase to 600,000 vac. <S> In addition to the scale of things being out of whack, there is the fact of electron inertia. <S> They don't weigh much, but 100 miles of high tension current cannot stop instantly. <S> Break open a switch and they pour out as arc-over, jacob's ladder, and ball lightning. <S> Without the isolating effects of a transformer, every kitchen worker would be at constant risk of such lethal surges. <S> Many a good electrician (good but not excellent) has met his death to such surges. <S> And if all of that is not enough, there is the 4th state of matter: <S> plasma. <S> When electrons are forced (by their own inertia), to make their way without a conductor (metal); they get very irritated, let's say HOT. <S> They emit a lot of photons, at about 30,000 degrees F. <S> It can cut right through living tissue the thickness of your thigh in a millisecond, perhaps nanoseconds. <S> Its called cauderizing -and is very disturbing to witness, less alone be the victim of. <A> Power lines that have high voltage are done so because the \$I^2R\$ losses over many miles of feed are reduced to an acceptable level. <S> Once the electricity reaches the end of the street, a typical house (including all the internal wires to the furthest socket) is probably a few hundred feet max therefore the economics of feeding high voltage cable to the house and throughout the house is just not making sense.
| Economics plays a big role in this argument plus safety of course.
|
How to programatically simulate a click on a capacitance-sensitive button? I am tearing apart a SONY HT-XT1, which has capacitive buttons to put it in a different case for a project: (source: digitaltrends.com ) I've taken it apart already and am now met with a motherboard with 3 pads on it. Touch the pad and the switch flips. I want to be able to control these buttons with an arduino, but I'm not sure how exactly to proceed. If you touch it with anything like a long wire or a cherry switch terminal, it flips the switch. I'd rather have some electronic way to control this over some mechanical contraption. I've never worked with capacitive buttons before so I have no idea where to start. Any thoughts would be appreciated, thanks! <Q> It depends on the internal circuit, but what might be possible is to short (for safety with some current limiting resistor like 300\$\Omega\$) <S> the two terminals of the capacitive switch. <S> A short can be seen as an infinite capacitor, which would make the circuit think that someone pushed the button (increase in capacity). <S> If that doesn't work you can use an analog switch to switch an additional capacity in parallel, which would increase the capacity as well. <S> Touch sensors have a very small capacity, so some picofarad should be enough to trigger the button. <A> Whatever input pin the switch is connected to, find the memory address, and write a "1" to it. <S> For example, if it's connected to PORT A, and PORT A is located at $1000 (hex), Then read in the value stored at $1000, do an OR operation with that number and $01, and send that value to your program instead of the real value of port A. <S> Also, you could just call the function that would execute in the event the switch was depressed, as opposed to checking the switch or calling the interrupt, or however you planned on reacting to the switch. <A> You might be able to get away with connecting each pad to an io pin with a capacitor, then switching the io pin direction, input for released and output for pressed. <S> This should do the same thing as a cmos switch, without needing any additional parts.
| That being said, fiddling with the circuit might break it quite fast (it again depends on the circuit and the algorithm used for detection), and make the button always pressed.
|
Mixed Signal PCB, 2 or 4 Layer? I'm currently designing a mixed-signal PCB for a client and I've been reading a lot about signal integrity and most of the books recommend a 4 layer board (or more) because of the noise resistance from having a solid ground plane and reduced routing. The board in question has two 16-bit ADCs and two 16-bit DACs with OP amps in the analog section, a microcontroller with some level shifters and mosfets in the digital section, and two DC/DC converters and an LDO regulator in the power section. Space is not much of a constraint, but having high resolution and low noise in the analog section is important. There's an I2C and an SPI bus running between the digital section and the edge of the analog section, operating at less than 10 MHz. Routing wise I can totally get this board done in 2 layers. Will I really notice a huge difference in signal integrity with a 4 layer board and dedicated ground plane? Is it worth the extra cost? I'm leaning towards 4 but I'd like to hear your opinions. Thanks in advance guys. <Q> first allow me to clearly state my answer. <S> A four layer board will give better performance. <S> The difference is not stark for all boards, but the four layer board will allow you to route signal, power, and ground, directly over each other in a larger variety of ways. <S> Keeping ground directly under the power plane will reduce crosstalk for close proximity lines and reduce noise by allowing overall better routing choices. <S> With four layers, single point ground is an achievable feat without also cutting the ground plane in two. <S> Essentially, if the two layer solution requires cutting across the ground plane, then you are creating two ground planes connected by two points. <S> This allows a current loop, causing noise, and this can be exacerbated by temperature differentials, nearby electronics, etc. <S> I am not sure as to the use case of this device, but the temperature, nearby EMI, and operating frequencies will all play in. <S> If this is a semi-high speed design, then a four layer will definitely save the integrity of those signal lines. <S> A lot of this comes down to how much resolution you need from those ADCs. <S> If you truly need 16 bits, then I would say a 5% performance increase from a four layer board is worth it. <S> A great reference which I pull my design guidelines from is... <S> http://www.ti.com/lit/an/szza009/szza009.pdf <S> Cheers <A> should probably work for you. <S> One of the truly awesome people I've met over the years - <S> Dave Vanhorn - routinely does fast and high-density boards on two layer boards and his products all pass emissions compliance testing without any problems. <S> But he is a true master of that art whereas many are not. <S> Regardless, your board looks fairly simple. <S> Break the bottom ground plane layer into sections for each circuit block: <S> analog & digital and ensure that you know where the return currents are flowing. <S> It's usually okay to have small breaks in the ground plane where you have to have one trace cross another. <S> But those breaks are small and fully enclosed with copper, exposing only the short trace that goes under the top-side trace. <A> It seems the regulator powering analog circuits is in the power section, you should move it to the analog section, so its GND reference pin sits on the analog GND. <S> This way, its output is referenced to analog GND, not to noisy GND near the switchers. <S> If a mistake means a respin, then you should weigh the cost and delays of a possible respin versus the extra cost of 4 layers.
| Now, for your 2 versus 4 layer question, using 4 layers will reduce the difficulty of making a very good layout, thus it will reduce the probability of making a mistake. If you can do most of your routing on the top layer and have mostly solid ground plane sections on the bottom layer, I'd say that a two layer board
|
How to autoregulate a TP4056 for maximum solar power extraction I'm using a solar panel (6V - 600mA at peak power) to charge a Li-Ion (3.7V) battery using a TP4065. The TP4065 I'm using has this configuration: Where the value of the resistor Rprog determines the charging current. The issue is that the current the solar panel provides is proportional to the light it received and the only way to keep extracting the maximum power from the solar panel is to adjust the load to keep to solar panel voltage around 6V which in my case is controlled by reducing the charging current. What would be the best circuit to automatically adjust the Rprog resistor to keep the TP4056 Vcc at a constant voltage of around 6V? Here is an example of a solar panel IV curve showing the voltage where the maximum power is extracted. Here is the charging characteristic of the TP4065 UPDATE 13-02-2015 The voltage a the PROG pin vary between 1V to 0.2V My project will use an Arduino micro controller. I could use the Arduino to monitor the solar panel voltage and regulate the TP4056 current with the following circuit: Rprog and Rarduino would be 600 ohms and the 100uF capacitor and Rarduino will act as a low pass filter for the Arduino analog out that output a 3.3V 500Hz PWM signal. When digital out is 0V, the TP4056 will see a 1.2K resistor and behave normally. As we increase the analog out voltage, the voltage at Rprog will decrease which will decrease the current in the TP4056 PROG pin and finally reduce the battery charging current. Does this solution can work? <Q> I have been looking at the same question lately. <S> My solution was a bit different than yours: By selecting D10, D11, D12 to be either OUTPUT/LOW or INPUT <S> (High-Z, no pullup) <S> I can vary Rprog from 16k <S> (D10/11/12 all High-Z) <S> down to 1050 Ohm <S> (D10/11/12 <S> all LOW)and via A0 monitor the charging current to find the MPP. <S> The funny thing is, that from all my testing, I found that the TP4056 seems to do MPPT itself, i.e. even if you set Rprog too low, Vprog seems to autoregulate itself to keep the current at MPP. <S> So that would mean that just setting Rprog to the max current the solar panels can provide would be all that's needed. <S> BTW <S> this confirms my empiric finding, having used simple TP4056 modules with my foldable solar panels without any problems for the last 2 years. <S> (It's a bit disappointing though, since I took all the trouble constructing my Arduino MPPT just to find out that I don't really need it ...) <A> I would use another chip. <S> However, if you want to use this one, you can try this circuit. <S> Put a current mirror in place to adjust the program current. <S> I assume that internally, the current flowing out through PROG is mirrored (with gain) to set the external charge current. <S> So what you have here is a current source which increases current value as VCC increases. <S> Adjust R200 <S> to get the desired current at whatever you consider to be the minimum VCC. <S> As VCC goes up, the charge current will go up, too. <S> I am too lazy to figure out a good starting point for R200. <S> But if you can find out what is the voltage at PROG, then, from the table, you can surmise the current amplification factor and come up with a good start point for R200. <S> I am thinking it will be like 47k-ish. <S> Variations on this might work even better. <S> For example if you add a voltage reference and a comparator or some more transistors, you could actually keep the charge current pegged at the maximum until VCC fell below a certain point, then it would back off the charge current to maintain VCC at that level. <S> But in my opinion, when you get to that level of complexity, you should just use an IC that does it all for you like the bq24210. <S> I am open to discuss this further. <S> Just tag me to get my attention. <A> I like the answer <S> you suggested a lot. <S> I think it is a good idea. <S> I would suggest just a slight variation as follows: <S> Also, please work through the corner cases and unusual circumstances such as when the battery is dead, and arduino cannot power on. <S> Will the charger be stuck in a zero charge current mode? <S> Maybe a strategic pullup or pulldown somewhere, or a large resistor in parallel with RPROG and 100uF cap to insure small charge current even when PWM is off. <S> Great job! <S> McKenzie <A> I'm looking into doing exactly this. <S> I think the capacitor on Vin helps a lot because when it is charging, it draws less current and stops drawing too much current from the photocell which is the point when the power output plummets. <S> Once the capacitor drops below 4v, I believe the TPS4056 will disable itself until the cap is charged back up high enough. <S> When it charges back up to 4v, it acts like a flywheel. <S> One other idea <A> Just to remember... <S> this charger IC is linear. <S> It means that if your battery is ~4V and your solar panel is ~6V <S> you are wasting around 2V*current as heat. <S> Even if you manage to extract the maximum from the panel, the energy loss is high. <S> Consider using a switching regulator, or make your own (buck) with atmega, it is a simple circuit and can have an efficiency of about 90% in any load case. <S> Have fun. <A> is maximum solar power extraction more important or How to correctly using a TP4056 more important? <S> if maximum solar power extraction is more important, then all your circuits and all the answers so far are incorrect. <S> Your 6v solar panel will give you 2-4v in dimmer light situation, and you can't expect it to charge a 4.2v battery fully in these situation, so your charger will not be a maximum solar power extraction unit regardless what charging value you use. <S> Instead, you need a low start up pre-stage boost converter with voltage regulation at 5v. <S> done, you don't need to worry about anything else. <S> don't use a micro-controller for a simple charger like that, it wastes more energy than it makes in dimmer light. <S> as a matter of fact, you should remove the TP4065 from the equation if maximum solar power extraction is the most important thing.
| I'm thinking about trying, is using a photoresistor for Rprog.
|
BC547/BC548 with 5V at base can't control 12V at collector-emitter? For an Arduino project I needed both 5V and 12V voltages. Specifically, for an IC I needed 5V and I needed to be able to switch it on and off using an Arduino PIN. Since the current drawn by the IC might exceed what can be drawn from the Atmega328 pins, and since I couldn't tolerate any less than 5V, I tried using the following circuit. So the idea was to control the 12V source using the BC547 transistor with the base controlled by an Arduino pin, and then to feed the emitter of the transistor into a standard 7805 regulator setup (with cap sizes taken from the 7805 datasheet). However, the circuit doesn't work as expected. I'm only seeing 4.32V on the emitter of the transistor - not 12V as I had expected. I can see that the input to the base is drive to 5V, and given the 4K resistor there should be amble current for the base (at least for 100-200 of collector-emitter current). Yet it seems the only voltage I'm seeing at the emitter is the mentioned 4.32V which seems to be just the base voltage minus some voltage drop. Changing the 4K resistor to e.g. 800 ohm didn't change this. So what is the problem here? It is not possible to control 12V using 5V at the base? If so, from what values in the datasheet can this fact be derived? I tried replacing the BC547 with a 2N7000 MOSFET, and that actually worked and I'm seeing 11.3V at the emitter of the transistor, and 5V at the output PIN, as expected. But I don't see why the BC547 couldn't do the job. <Q> The output will always be a bit less than the input. <S> The point of a emitter follower is usually current gain, you actually get a small loss in voltage. <S> It would be better to use a PNP to switch the voltage into the regulator, instead of the NPN you show: <S> When the digital signal goes high, the emitter of Q2 will be about 700 mV less, or about 4.3 V. <S> That will cause 10 mA to flow thru R1, most of which will be coming thru the collector of Q2, which also means it will be going thru the base of Q1. <S> R2 is only to guarantee Q1 will be off when intended, despite a little leakage and maybe some noise in the system. <S> You didn't say how much current you need at 5 V, but this needs to be considered. <S> The maximum current Q1 can handle will be its base current times its gain. <S> In this example, the base current is about 10 mA as already shown. <S> With a gain of 30, for example, this setup can support up to 300 mA. <S> If you need more current than that, then changing Q1 to a darlington or a P channel FET will probably be a better tradeoff than increasing the base current. <S> This circuit is intended to be simple and work with a wide range of parts. <S> Q2 can be just about any small signal NPN transistor. <S> Q1 could be a jellybean PNP if you only need 100 mA or so. <S> Otherwise, a small power transistor may be better. <S> Added: <S> You now say that the regulator only needs to supply 30 mA maximum at 5 V. <S> In that case Q1 can be most any jellybean PNP transistor, like a 2N4403. <S> Such small transistors will have more gain than a power transistor. <S> Figure you can count on a gain of 50 minimum, so the base current only needs to be 600 µA. <S> A couple of mA base current would then be enough to put Q1 solidly into saturation. <S> That allows making R1 larger, like 2 kΩ. <S> So here is the final circuit: <A> You need something called a "High-Side Driver" circuit. <S> This allows you to control a higher voltage power supply from a low-voltage control input. <S> This can be made from either bipolar transistors or MOSFETS or a combination of both. <S> I'll show a simple version using a pair of MOSFETs - note that the high voltage being switched is limited by the maximum voltage that can be applied to the gate of the high-side FET. <S> But it will do for illustration purposes and can be enhanced with the extra components needed for voltages higher than the max allowable Vgs of the upper FET. <S> simulate this circuit – <S> Schematic created using CircuitLab R2 is included only a a precaution against Q1 oscillating, <S> It should be mounted as close to the FET as possible. <A> As Dwayne has given a very suitable working circuit (+1 from me) I will concentrate my answer on why your circuit does not work. <S> You have made three basic errors . <S> (1) <S> You are using the BC547 (NPN transistor) as an emitter follower and not as a switch . <S> This means that the voltage at the emitter will always be about 0.7V less than the base voltage. <S> If you supply a 5V base signal the output cannot rise above about 4.3 volts no matter how much you reduce the base resistance value. <S> Switching from the positive line use a PNP type transistor or preferably a P channel MOSFET (see Dwayne's answer) (2) For a 7805 to work it must have a minimum of 2V difference between input and output. <S> There are other regulators that require less (Low Drop Out or LDO). <S> Even these could not work because they need the input to be higher than the output. <S> There should be a minimal voltage drop across the switching device. <S> MOSFETs are superior to BJTs. <S> (3) <S> A 7805 (as distinct from a 78L05) is capable of a 1A output, if your circuit had managed to switch the regulator ON you would have fried the transistor if a current larger than a few hundred mA was drawn from the regulator. <S> Ensure that any device you use to switch the regulator is capable of switching sufficient current.
| The problem is that your transistor is connected in emitter follower configuration.
|
Providing a linear adjustable DC voltage from PWM ( 1.5V to 3.3V) I'm not an electrical engineer, so a simple task has me baffled for the last week or so. I am working on project where I am required to feed a blackbox device with a stable adjustable voltage.The box will be sampling the voltage provided by analog read. The readings I provide it will be around 1.8 & 3.1V (2 modes of operation) and will be shifting for values of 0.01V to limits of +-0.2 (so in mode1 I need readings of between 1.6 and 2.0 and in mode 2 I need readings between 2.9 and 3.3)This readings will be changing so Vout must reflect the changes in a timely manner. I am using an Arduino to obtain the data, calculate it to voltage and push out a PWM. I am using a pro mini, powered by 5V applied to its raw pin which puts the device into 3.3V mode. Thus my Aref and 100% PWM cycle both equal 3.3V The frequency of PWM is at about 20kHz (I can slightly modify this if required). I have slapped together another Arduino to act as my signal analyser (as I lack an oscilloscope), with which I am probing the Vout line(it implements an LCD and pushes analogRead data to screen, with some added qualifiers I can make it show me the extreme values of Vout). So now that I can see what is being spit out I can start working on it.So I read a lot of filters literature, but half of it is not really making sense to me. What I gathered is that I need to implement a lowpass filter to smoothen Vout. So I tried building a RC filter, selecting C and R values "by luck",trying different combinations and orders of RC filters I can manage to get the Vout swing (initially 3.3-0) down to 3.3-2.7 when targeting 3V.Although better, it is still nowhere near the accuracy I require.(the parts I have on hand just now are a bit limited, so there were a 0.1uC,1/8uC 1uC, a 100uC, a 1500uC, and resistors from 10K down to 0.25K in my tests)IIRC the combination I have set up currently is 100uC/1K 1st order (adding orders was giving me negligible improvements, so I might be misunderstanding that concept) Further reading has hinted that I might need a bit more than just a filter to deal with this, so far internet's best suggestion seems to be a combination of LM317 as an adjustable regulator and a MOSFET to convert the PWM to a variable resistance. Figure 37 in the LM317 tech sheet seems like the regulator part I could use for this, but I can't seem to figure out the variable resistance part of what I need. So my question is twofold as I am assuming I might have gone a wrong direction with this: Is this the best way to do this? I am trying to keep parts and cost numbers down, so I don't want to go down the whole MOSFET regulator road if it turns out I'm just using an incorrect filter. How do I do solve this challenge? <Q> There are plenty of ways to do what you want. <S> But if you want to follow your path, first you need a PWM with more than 8 bits resolution (10 mV is the step, 3.3 V is the max voltage you want to reach - <S> this is 330 steps or 9 bits), make sure that your PWM has the correct resolution. <S> Then you need to filter the PWM output. <S> The "simplest" solution is indeed RC. <S> This is not the most efficient but its ok if you can accept some ripple. <S> Take a cuff frequency that is at least 10 times smaller than the PWM frequency for reasonable ripple attenuation (2 kHz in your case). <S> For a first order RC filter, you select R the following way: R = <S> 1/(2 <S> x pi x C x f) <S> Then you need to buffer to output of the filter. <S> This can be done with an operational amplifier used as a follower. <S> Make sure that the supply voltage of the operational amplifier is sufficient to avoid saturation and that the amplifier can supply sufficient current for your application. <S> You can have something like that: <S> simulate this circuit – <S> Schematic created using CircuitLab Select R1/R2 to set the gain (or attenuation), select R4/(R3+R4) to set the offset, select C*R2 to set the filter frequency. <S> Output will be opposite to your PWM setting (0=max, 255=min). <A> If you have a 5V PWM signal, at 20 kHz, low pass filtering a 10% duty cycle at about 2 kHz should give you about 0.5v, 50% would be about 2.5V, and 100% would be 5V. <S> It's just the mean value across one PWM cycle. <S> Once you have this in hand, you should know how to scale and offset your signal. <S> If you need to scale by a gain less than one, you need a voltage divider (i.e.,series resistors) or inverting amplifier (op amp), which you would need to reinvert later. <S> Offset would be handled with an op amp. <A> It seems to me that a component called a Digital to Analog Converter (DAC) would do what you want. <S> You can probably do what you want with PWM and a high-order low-pass filter but the DAC might be simpler for you. <S> DACs are available with both serial and parallel digital inputs. <S> You mention Arduino, so <S> I'm going to suggest that you want to use a serial DAC because the serial interface uses less <S> i/o pins from the Arduino. <S> However, serial transfers are slower than parallel. <S> There are MANY different devices to choose from. <S> Putting the string "serial dac" into Google brings up a plethora of choices. <S> Two of the first choices: Linear Technology and Maxim offer free samples. <S> I suspect that most manufacturers of DACs do the same. <A> I do the exact same thing in a circuit I'm working on at the moment, so I have something that works: <S> This is basically just a third order lowpass filter with a cut-off frequency around 350Hz. <S> For a 20kHz PWM signal the ripple will be below 1mV. <S> If you change your pulse-width it'll take about 2.5ms for the signal to settle.
| There are even ICs that will do it for you (programmable voltage regulators). A low-pass filter is the way to go. The other alternative is to twiddle the PWM pulse widths to get what you need.
|
What amperage fan is safe to replace my 0.13A fan? Fan on my wine fridge is buzzing, so I'm replacing it with a CPU or case fan off newegg. Should the replacement fan be rated at more than .13A , or less? I suppose the fridge probably puts less than .13A in, but the replacement fan should have a max of at least .13A . Would it be bad to get a fan with an even higher max, say .15A or .2A ? Edit : Existing fan specs are as follows ( from this pdf ) and the sticker on the fan. Model: RDL8020SBearing System: SleeveRated Voltage: 12VDCOperation Voltage: 6~13.8Rated Current: 0.13ARated Speed: 2,500 RPMAir Flow: 27.6 CFMAir Pressure: 1.7 mmH2ONoise Level: 30 dBADimensions: 80mm x 80mm x 20mm I found several fans that have lower amperage, but I'm reluctant to buy them. Finally I found this fan which has .13A rating, but I suppose that means it would always be spinning at its highest setting. P.S. I realize that almost all computer fans have 3 pins not the 2 that this one has. I figure I'll just splice red to red, black to black, and snip off the yellow one, which is just throttle control anyway. <Q> Because your fridge uses a 12V fan, I'm assuming that it uses a thermo-electric cooler (Peltier cells) rather than a compressor like a larger fridge would use? <S> If so, the actual fan current is probably of no consequence. <S> The thermo-electric cooler requires significant current at 12V and the power supply most likely wouldn't know about or care if your replacement fan consumes more or less current than the original. <S> Suggestion <S> : look for the quietest fan you can find. <S> Don't worry about how much current it consumes - just make sure that it runs from 12V. <S> I've recently had to replace the fans (both in power supply and on top of CPU) in a couple of professional hard-disk of multi-track audio recorder decks and it is absolutely amazing how quiet some of the new fans can be while still moving significant amounts of air. <S> There was nothing wrong with the stock fans other than that they were far too noisy to be used in the control room where they were situated. <S> The new fans were chosen to have at least the same amount of CFM as the originals but with significantly less noise. <S> The difference was impressive. <A> "Air Flow" and "Air Pressure" are the interesting parameters. <A> You don't want a jet engine in your kitchen, and a fan that size can make quite a racket. <S> The original manufacturer chose a low speed low flow fan to keep it quiet, but you won't find that in the average supplier. <S> So when you get the fan, 1) choose the slowest 12V ball bearing fan you can find, 2) <S> buy a range of 5 watt resistors, from say 10 ohms to 200 ohms, just in case you need to slow down the fan, and 3) test it for performance and for noise, on a quiet evening, before you close up the case and fill it with wine.
| The new fan should have similar, or higher values, at the same or a lower current. I recently replaced the fan in a small peltier water cooler, and I can tell you something unexpected: Even if you buy the lowest speed fan you can find, it'll probably be much too fast, and make too much noise.
|
How safely to send signal between logic and higher current pcb? I'm designing a PCB with 4 FETs. These are driven in the same board by totem pole drivers, and their load are about 5A total. I am using PWM at 1000Hz. The signal comes from a logic IC in another board. Is there a safe way to avoid loops and noise without using optocouplers? The current scheme I am using is: Logic board to Buffer PCB = 4 signal wires.And each board has its own connection to the PSU. (GND and 12V)The distance is going to be ~20cm max in what I think will be a noisy environment. <Q> I deal with exactly this situation on a regular basis. <S> Start by treating the ground connection at each pair of power boards as a star point for the power supply and controller board. <S> That is: relatively heavy wire between the ground terminals of both power boards. <S> Another wire from that point to the power supply ground. <S> One final wire from that point to the ground on the controller card. <S> What you want to avoid is having the load current <S> cause a shift in ground potential between the logic board and the power boards. <S> The ground can (will) move around with respect to the power supply ground but so long as the signals between the control and power boards remain constant with respect to each other, you should be good. <A> Is there a safe way to avoid loops and noise without using optocouplers? <S> If you can't maintain a common ground between your boards without creating a ground loop, then some kind of isolation may be required. <S> If you don't want to use optocouplers, you could look at transformer-based isolation. <S> There are devices out there that take care of modulating up an essentially dc control signal to pass it through an isolated connection (for example, from Maxim ). <S> LVDS seems like overkill for any signal switching at less than 50 Mbps, and current loop seems like overkill for a distance of only 15 cm, but either one ought to be able to withstand a few hundred mV of ground variation between the ends of the connection. <A> Based on what you've said so far, twisted pair to carry the signals should be adequate. <S> You may well want to use serial termination on the lines. <S> I see no reason to expect major problems with pickup issues, and with a 1 KHz PWM frequency you can accept a certain amount of signal degradation. <S> If you want to add insurance, put a certain amount of low-pass filtering on the signal inputs, followed by a Schmitt trigger. <S> Also, your load lines should be twisted pair as well, and if you want to really do things right, use shielded twisted pair, with the shield grounded at the driver end, but not the load end.
| If you have a roughly common ground between the boards but don't want to connect ground along the same paths as your control connections, then some kind of differential signalling should work.
|
Why would a 74LS14 be used to enable another IC? As a learning experience, I am studying a 64K 80 COLUMN expansion card for the Apple IIe . The model number is 820-0067-D for those interested. Anyway, I'm sure the schematic is online somewhere but I just wanted to do this for fun. The first thing I noticed, however, is that it appears the designers used a Hex Schmitt Trigger Inverter ( 74LS14 PC ) solely to enable another IC in the circuit (Octal Bus Transceiver SN74LS245N ). So on the 74LS14 , they tied Y1 to !E on the 74LS245 . And, since the 74LS14 has A1 tied to Y3 and A3 isn't connected to anything, it seems to enable the 74LS245 . Why would they do this? Why not just tie the 74LS245 's !E enable pin to ground? In fact, I can't see why the Schmitt Inverter is used at all. The only other connections it has is A6 to external pin 26 on the motherboard and Y6 tied to A5 and Y5 tied to nothing. It just seems like a waste. Do you think it was used as some type of propagation delay? If so, seems like it would only be around 50ns or so. Here is a crude schematic that I came up with. I might just try and dig up the real schematics to make sure I'm not crazy. lol simulate this circuit – Schematic created using CircuitLab EDIT Looks like I was wrong. A3 does indeed connect to Y5 . Also, A2 is not floating, it is connected to GND . <Q> It seems your circuit is incomplete or got pins mixed up. <S> It is extremely unlikely that outputs of the 74ls14 are used with the input being open. <S> As the 74ls14 is inverting, connecting two inverters in series to remove inversion is sensible and common. <S> Thus it seems like you miss the A3 input. <S> Finally while the delay is small, it might be sensible to make sure that the clock or enable signal arrives after some data signal or further control pins. <S> The propagation delay through two schmitt triggers might well be enough for that. <A> Your schematic is incomplete. <S> There is at least one connection you've missed, which is Y5. <S> I suspect it connects to A3. <S> You might want to check continuity. <S> In any event, the external Pin 26 provides a signal which is used to let the card act as an auxiliary memory. <S> The input is active low, and the LS245 is active low, so using 4 LS14 gates will provide signal buffering as well as a reasonable delay (nominally about 60 nsec). <S> Since this is board-level enable line, I'd guess that the delay is irrelevant. <S> More likely, I think, is that using 4 gates rather than the 2 which would make sense when seen from the point of view of buffering, may well be driven by pcb routing considerations. <A> TTL floating inputs inputs default high, so A3 high will make Y3 and A1 low, which will make Y1 permanently high, permanently disabling the '245. <S> There's obviously something happening at A3 that you missed, so you need to backtrack and reverse-engineer a little deeper.
| Using a schmitt-trigger circuit when receiving clock/enable like signals to improve noise immunity is quite sensible.
|
Why does a simple circuit drain a battery slowly? OK, so if you directly connect the two terminals of a battery, there is very little resistance in the circuit and you will drain the battery very quickly. However if you have a very simple circuit, for example a light bulb connected to the battery, the battery will drain slowly based on the watts used by the light bulb. My question is, if this light bulb provides only a little resistance, wouldn't a lot of current flow through and therefore drain the battery quickly? <Q> You may be a little confused by the resistance of a light bulb. <S> Typically, a "cold" (that is, not glowing) <S> bulb filament will have a resistance about 1/10 its resistance when hot. <S> So an operating (glowing) bulb will discharge a battery much less quickly than you might think if you just go by what a meter says the resistance is. <S> Once it's glowing, another effect comes in to play. <S> For a given desired brightness, you can get better efficiency by overdriving the bulb. <S> That is, if you take a bulb and drive it at higher voltage, it gets even hotter than it would normally, and its resistance gets even greater. <S> Since it is hotter, a greater fraction of the energy being dissipated by the filament is given off as visible light as opposed to infrared. <S> See "blackbody radiation" for an explanation. <S> Of course, this means the filament will burn out more quickly, but you can't have everything. <A> You are correct. <S> That is true for any circuit, be it simple or be it complex. <S> It's a matter of total resistance. <A> If you connect a high-power (bright) light between the battery terminals it will drain the battery faster than a lower-power (dim) light, because the bright light will draw more current than the dim one.
| If the light bulb only has a small resistance the battery will be drained fast.
|
Is a flyback diode needed if there are only inductive components on the circuit (Ex. solenoids) I'm using relays to drive a circuit of solenoids. Do I really need flyback diodes on the controlled circuit if there are only solenoids on it? The driving circuit is already protected by flybacks. simulate this circuit – Schematic created using CircuitLab <Q> A MOV or snubber or bipolar TVS will usually extend the life of the relay contact. <S> At 24VAC it may not be that important. <S> Personally, I would consider a bipolar TVS. <S> It won't affect the relay directly, but if the controlling circuitry is poorly designed you may see effects from switching such an inductive load (microcontroller resets, flakey behavior increasing in frequency as the contacts age and so on). <A> First: your show your solenoids having only 1 uH inductance. <S> I don't believe that is anywhere near close to their actual value - several hundred milli-Henrys on through several Henrys <S> would be more like it. <S> My company manufactures a lot of circuit boards used to build HVAC equipment where we have relays driving water circulating pumps that run at AC Mains voltage <S> (both 120 Vac & 230 Vac). <S> Those relays are NAIS / Aromat JS1 series and we have shipped boards containing several hundred thousand relays over the past 20 years or so. <S> There is NO transient suppression on the contacts. <S> I am not aware of any relay contact failures that weren't caused by installer wiring errors. <S> A different class of board uses either 1 or 3 American Zettler AZ2150 & AZ2150A relays directly controlling 3/4 HP induction motors (HVAC Blowers). <S> Same deal there: no relay failures not caused by installer wiring errors. <S> In general, I worry about requiring arc suppression on relays contacts driving DC inductive loads. <S> It seems to be much less of an issue when driving inductive loads from an AC source. <S> That said: I examine each specific application carefully at the design stage and determine if relay contact transient suppression is warranted. <A> The relay contacts should be snubbed with a (bipolar) TVS device or R/C snubber network; this will protect the contacts from arcing damage/wear (pitting, etal) and extend their life dramatically in this service. <S> See Chapter 7 of Electromagnetic Compatibility Engineering for more snubbing advice.
| It depends on many factors, including AC or DC operation, voltage, current, solenoid inductance, relay contact construction and relay contact material.
|
How to achieve 57 PWM outputs most easily and cheaply I need to light up 19 RGB LED strips, which it seems would require 19*3=57 PWM outs and 57 transistors. The transistors aren't an issue, but of course the 57 PWM's is. Most micro controllers simply don't have that many. How can I do this more simply? Is there some kind of device I can get that would let me just pass data to it, perhaps over I2C, and it would control many PWMs? Is there another solution I haven't considered? Maybe whatever is used to control those 8x8 RGB LED dot matrixes? Any help would be greatly appreciated. Thank you! <Q> Daisy chain 3 of these ICs ( datasheet ) and control them via SPI. <S> They are designed for driving LEDs. <S> Adafruit has dev kits if you want to play with it: http://www.adafruit.com/product/1429 <A> Add in a soft CPU <S> and you should be able to fit the whole thing into a Xilinx XC6SLX9 in a QFP144 package, i.e. easily hand-solderable. <A> Actually Cypress PSoC is well suited for this. <S> This PSoC Sensei blog post describes how to achieve 52 hardware 8-bit PWM outputs with a single PSoC3 or PSoC5. <S> The additional ones could be achieved with a $1 PSoC4 acting as a slave over SPI or I2C. <S> If you haven't heard of PSoC before you might want to take a look; they're 8051 or ARM Cortex M0/M3 cores with some programmable logic beside them. <S> There's also a variant with BLE radio built in. <S> Not affiliated with Cypress, just a pretty happy customer with their PSoC4 and 5LP devices.
| Pretty much any FPGA with a high enough pin count, basic PWM's are very simple in terms of logic design and usage.
|
What does having the v in the center, with the positive near the top wire and negative near the bottom wire mean in this circuit diagram? This is the diagram that I am asking about: I understand that the symbol on the left hand side of that middle branch is a current controlled current source, and the symbol on the right is a current source. What does it mean to have the CCCS on the left, the CS on the right, with the v in the middle, and + and - on top and bottom, respectively? Does the whole branch, having a v in the middle describe some kind of circuit that I don't know about? Can this circuit be redrawn? Perhaps as: I'm sorry for the poor redrawing. Thanks for any clarification. <Q> Circular you redraw is correct meaning of v at the center and + above and - below means drop in voltage with mentioned polarities there <A> I think it's just to clarify that the top wire is considered to have a higher potential than the bottom wire. <S> So for a simulation tool, you would connect the bottom wire to ground. <S> The v is just to indicate the voltage between top and bottom wire. <A> I hope you are familiar with the concept of independent and dependent sources. <S> Still, let me explain it here. <S> Voltage sources and current sources are basically classified as independent and dependent: <S> A dependent source is one whose value depends on some other parameter in the circuit. <S> In your circuit, the current source on left side, with a diamond shaped symbol is a dependent current source. <S> The current supplied by this source will be 2Ix <S> (two times the value of current flowing in the branch on top right side) <S> On the other hand, an independent source always maintains a value which does not depend on any other parameter in the circuit. <S> The 24mA source on right side will constantly supply 24mA, irrespective of the activities happening in other sections of the circuit. <S> Now, coming to your question, this is nothing but four elements in a simple parallel connection. <S> There is nothing mysterious about the voltage v . <S> As we know, the voltage across each element in a parallel connection will be same, this v can be considered as the voltage drop across R1 , which is same as the voltage drop across R2 . <S> After solving, if v turns out to be positive, it means that top side of R1 and R2 is at a higher voltage than the bottom side. <S> And yes, you can redraw the circuit as you have done. <S> And for practical purposes, you can consider this as a single sources of value ( 24mA+2Ix ).
| + and - symbols indicate the polarity of voltage drop.
|
Cheapest way to get a CAN signal I have to transfer signals over around five meters. My input signals are I2C or SPI-compatible, but unfortunately it is no good idea to transmit them over such a long distance. Therefore I was thinking of converting the I2C- or SPI-signal to a CAN-signal (and back). What is the best approach of converting these signals into each other without having to use (too much) external components? My first approach was to use a MCP2515, but there I already need an external clock. Is there a cheaper way to do that? <Q> Going to something like CAN is not a simple solution to my way of thinking but of course this may need to be done if distances warrant it <S> and you can't lower speed BUT think about this.... <S> Putting a micro at both ends (or the remote end) to allow CAN type communications means your overall throughput of retrieving data from a remote device is going to be limited without going to a significantly higher data rate over the CAN link <S> and you'll have to tailor your current master SPI transmission to be compatible with CAN and <S> this might mean that instead of just sending an SPI clock and CE <S> you'll have to send a more formal request for the remote data to be passed back to you. <S> Simplest way is to reduce the clock speed to suit the cable and, if necessary use balanced drivers and receivers i.e. make everything work with the delay that you get by introducing the 5 metres of cable. <S> It's easy when sending data out to a remote device - both clock and data arrive largely in sync but trying to get data back is the real problem on long distances - the receiving device gets the clock and syncs up it's data with the incoming clk but by the time it arrives back at the master things are skewed with respect to each other. <S> That is why I suggest considering clock speed reduction - the skews won't be as bad (as a percentage) and are less likely to give errors. <A> You'd use two twisted pair, one for data and one for direction control, or you could go half-duplex with a pair for each direction. <S> In the case of data/direction, you'd use the direction control line to disable the output at the slave end when transmitting to it, and disable the master output when the slave is expected to be transmitting. <A> I was in a similar situation trying to send a signal over i2c, but my distance was much further. <S> I was using CAT5 cable. <S> I had a rather hokey setup to test the idea. <S> I had setup a circuit to use an i2c extender chip (this was to get 2 arduinos to talk to each other). <S> I think I fried one or both of the chips at some point, so I just wired across the circuit (I pulled out the chips out of their dip sockets and ran very short jumper wires across basically crisscrossing the LxSy and SxLy lines). <S> Anyway, without going into too much detail I could get the signal through about 100 ft. of CAT5. <S> You might want to try before you give up or assume it won't work. <S> Otherwise you can try the various i2c bus extender chips out there. <S> The circuits are simple and the chips don't cost a bunch ( <S> TI and NXP make them P82B715PN). <S> This link (in French) is what I went off of i2c bus extender circuit
| If you have a problem with serial protocols like SPI over 5 metres then the simple answer is to lower the clocking rate for receiving data back from remote devices. If you can spare an extra twisted pair, you could go with RS485.
|
Connecting two DC wallwarts in series - to produce dual DC supply I have two 9 V, 300 mA wallwarts and would like to connect them in series to produce +9 V, 0 V and -9 V. This can be done with two 9 V batteries (as seen below), but can I do this with two non-identical wallwarts? <Q> This will work. <S> Wall warts typically have a floating ground so that you can use them for purposes like this. <A> The following is copied/pasted from here . <S> I wanted to make sure those issues were listed in this post as well. <S> This architecture would work if the wall adapters are isolated (some wall adapters aren't on purpose). <S> No power applied (offline), connect the - terminal of the primary to the - terminal of the secondary, and test the resistance between the remaining + terminals. <S> HOWEVER when the Earth is isolated/not present (2 prongs or 3 prongs with the earth prong being made out of plastic for example), you are giving up on a very important safety feature: residual current devices. <S> They cut off the supply when they detect a leak to Earth (a person or a short to case) which can be lethal. <S> You NEED to make sure the secondary voltages are inherently safe for you to accidentally touch , given the environment. <S> The voltage between V+ and V- will be twice V+, in particular. <S> Normally, the isolation would prevent any person from closing the circuit rendering it safe, but if not tied to Earth the voltage can float quite high and a fault would be dangerous. <S> Edit/note <S> : The safest is 2 terminals plus Earth connected to case, and Line-Neutral of primary isolated from secondary. <S> This way even if there is a fault, the residual current devices of your house will trigger. <S> 2 terminals which are isolated from the primary, Earth absent, is safe in the absence of fault but dangerous if there is one. <S> 2 terminals which are not isolated from the primary, Earth absent, is generally very risky: consider a very simple voltage divider as an example, and imagine the bottom one breaks - the entire line voltage is present at the output... <S> AND protect the circuit against overcurrents/short circuits if the wall adapters do not include any, to prevent fire. <S> The following is circuit specific: some circuits will behave dangerously if one of the supply rails is missing. <S> Since it's very likely that one adapter may be plugged without the other, this should be taken care of. <S> Say, with some logic that inhibit both if one of them is missing. <A> Yes, this will work fine. <S> The issue with two different wall warts is that they will have different current capabilities. <S> You have already said they are both 9 V wall warts, so their voltages will be the same. <S> When you are using your ±9 V supply end to end, meaning you are using it as a 18 V supply, then the current capability is the lower of the two wall warts. <S> For example, if one is 9 V and 1 A, and the other is 9 V and 500 mA, you only get 500 mA at 18 V when you put them together. <S> Trying to draw more could actually damage the 500 mA wall wart. <S> When you are using the +9 and -9 V outputs of the supply seperately, then the current budget for each part is whatever that wall wart can do. <S> Using the above example assuming the 1 A wall wart is driving the +9 V, then you can draw up to 1 A from +9 V to ground, and -500 mA from -9 V to ground.
| If you needed more current from the negative supply than the positive, you can flip the wall warts around and put the 1 A one on the negative side.
|
Want a 3v led to operate when 12v is applied I have a circuit with 6v and 12v. There is 1 diode between the two positives so when 12v is turned on it does not run through the 6v circuit. What I need is the led to only come on when the 12v supply is on. At the moment if the 12v feed is not on I have 6v coming through in witch the led turn's on. I only need the led to turn on when the 12v feed is turned on. <Q> It's hard to tell from your question, but apparently you have a 6 V power feed and a 12 V power feed to a circuit, and you only want a LED to come one when the 12 V feed is active, not the 6 V feed. <S> And there is a diode from the 6 V feed to 12 V feed? <S> I guess you're asking the question <S> because if you put a resistor in series with the LED sized to get the brightness you want when 12 V is applied, you still get too much brightness when 6 V is applied. <S> Use a transistor as a threshold detector set to around 9 V so that it is on at 12 V but off at 6 V, and run the LED thru the transistor. <A> One or two diodes? <S> If there is only a single diode between the +6V input and the 12V input and the 12V input directly feeds the load, it will be difficult (but not impossible) to detect when only the 12V supply is ON. <S> However, if you have two diodes: one diode in series with each supply input, it's easy. <S> Simply connect the indicator LED and current-limit resistor before the diode summing network for whichever input you want. <S> You could have two indicators if you want: one for the 12V input and another for the 6V input. <S> The diodes stop the one power supply input from backfeeding the other. <A> Put a Zener diode with reverse bias in series with the LED. <S> Say you have a 2 V LED, you can put a 5.1 V Zener in series and it will only turn on when you get more than 7.1 V.
| There are two relatively easy ways to deal with this: Put another diode, preferably a Schottky, in series with the 12 V supply and run the LED off the voltage before the diode.
|
How to differentiate center-tapped power transformer from a non center-tapped one? I'm a hobbyist and I have 2 doubts regarding a power supply described into this schematic : 1) How do I differentiate a center-tapped power transformer from a non center-tapped one? My primary language is portuguese and I cant manage to translate it... Can I assume that " 24V 2A " is a center-tapped transformer and " 24+24 2A " it's not? I need a +-20V power supply. Into the diagram, it recommends a 30V center-tapped or a 15+15V secondary in order to build one. But: 2) If I split a 30V center-tapped transformer, it will give me +-15V, not 20... Neither if I use a 15+15V, it will not amplify to 20V... <Q> Transformer datasheets should indicate this by showing a schematic symbol of the transformer. <S> The output voltage of a transformer is always given as the RMS value. <S> The peak voltage is about 1.4 times the RMS voltage, and after a bridge rectifier and filtering the DC voltage will be 1.4 volts less than the peak-to-peak voltage. <S> A 30 volt center-tapped transformer with a bridge rectifier will produce about 40 volts DC. <S> If you use the center tap as the common, or ground, terminal, that gives you +/- <S> 20 volts. <A> The "24+24 2A" is probably a center-tapped transformer. <S> If it has two separate 24 Volt windings (4 leads), 1 lead of each winding can be tied together to produce a 48 VAC RMS Voltage on the other 2 Untied leads. <S> If the two leads that are tied together are incorrect you will have somewhere near Zero Volts AC on the untied ends. <S> If that is the case then untie the 2 leads and substitute just one of the tied windings 2 leads for the other lead of the same winding and tie it to the unswitched winding lead. <S> This is a little hard to describe I hope you can understand. <S> From this you would have a 48 Volt AC center taped transformer (the 2 leads tied together is the center tap) with <S> 24 volts AC measured from center tap to each of the 2 untied leads. <S> Note: when the 2 lead are tied together their should be no current flow example buzzing, getting hot, sparks etc.... <S> When not hooked to a circuit. <A> X+X is probably center-tapped with X appearing between the tap and each end. <S> So 15+15 would give you 30 end-to-end. <S> That said, the ratings are RMS, and the rectifier will give you peak minus one or two <S> diode drops. <S> This is how a circuit can be powered by slightly less AC than the DC that is derived from it. <S> Taken to somewhat of an extreme, there is the voltage doubler power supply. <S> In this configuration, one end of the winding is used as a DC center tap while the other end alternately charges the positive and then the negative DC supply capacitor. <S> Thus, a single 9V transformer can power a 12+12 DC circuit for a total of 24VDC.
| A center-tapped transformer has three connections on the secondary, where a non-center-tapped transformer has only two.
|
AVR GCC: How do I improve code optimization I tried to compile the following C code: period = TCNT0L;period |= ((unsigned int)TCNT0H<<8); The assembler code I'm getting is the following: period = TCNT0L; d2: 22 b7 in r18, 0x32 ; 50 d4: 30 e0 ldi r19, 0x00 ; 0 d6: 30 93 87 00 sts 0x0087, r19 da: 20 93 86 00 sts 0x0086, r18 period |= ((unsigned int)TCNT0H<<8); de: 44 b3 in r20, 0x14 ; 20 e0: 94 2f mov r25, r20 e2: 80 e0 ldi r24, 0x00 ; 0 e4: 82 2b or r24, r18 e6: 93 2b or r25, r19 e8: 90 93 87 00 sts 0x0087, r25 ec: 80 93 86 00 sts 0x0086, r24 So instead of 4 instructions it gets 11! I tried to choose O1, O2, O3 and Os optimization options. The result is the same (except that O3 option optimized away this code at all). I could write the source code in the following way: period = TCNT0L | ((unsigned int)TCNT0H<<8); I will get smaller, but still not optimal code: de: 22 b7 in r18, 0x32 ; 50 e0: 34 b3 in r19, 0x14 ; 20 e2: 93 2f mov r25, r19 e4: 80 e0 ldi r24, 0x00 ; 0 e6: 82 2b or r24, r18 e8: 90 93 87 00 sts 0x0087, r25 ec: 80 93 86 00 sts 0x0086, r24 However I will not have a guaranty that the lower byte will be accessed first any more (this is essential requirement to keep 16-bit reading correct). And still the code has many extra unnecessary instructions. Am I able to change compiler options and/or change the source code to make it better? I'd avoid go to assembler. UPDATE1: I tried the code @caveman suggested: ((unsigned char*)(&period))[0] = TCNT0L;((unsigned char*)(&period))[1] = TCNT0H; But the result is also not very good: ((unsigned char*)(&period))[0] = TCNT0L; dc: 82 b7 in r24, 0x32 ; 50 de: e6 e8 ldi r30, 0x86 ; 134 e0: f0 e0 ldi r31, 0x00 ; 0 e2: 80 83 st Z, r24 ((unsigned char*)(&period))[1] = TCNT0H; e4: 84 b3 in r24, 0x14 ; 20 e6: 81 83 std Z+1, r24 ; 0x01 <Q> One method is to use direct loads to the halves of period. <S> While this looks complicated in C, it usually will generate very tight assembly, i.e. 2 loads and 2 stores. <S> ((uint8_t*)(&period))[0] = <S> TCNT0L;((uint8_t*)(&period))[1] <S> = <S> TCNT0H; Sometimes using the array math can cause issues so you could try this: <S> *((uint8_t*)(&period)) <S> = TCNT0L;*((uint8_t*)(&period) + 1) = <S> TCNT0H; <S> This actually produces optimal code. <S> Look at how there are 12 bytes used. <S> ((unsigned char*)(&period))[0] = <S> TCNT0L; <S> dc: 82 b7 in r24, <S> 0x32 ; <S> 50 de: <S> e6 e8 ldi r30, 0x86 <S> ; 134 e0: <S> f0 e0 ldi r31, 0x00 ; 0 <S> e2: 80 83 st Z, r24 ((unsigned char*)(&period))[1] <S> = <S> TCNT0H; <S> e4: <S> 84 <S> b3 in r24 <S> , 0x14 <S> ; 20 e6: 81 83 std Z+1, r24 ; <S> 0x01 <S> If you did this with assembly, it would probably seem better to do it like this. <S> It is also 12 bytes, so they are equivalent. <S> dc: 82 b7 in r24, <S> 0x32 ; 50 de: 80 93 86 00 <S> sts 0x0086, <S> r24 e2: <S> 84 <S> b3 in r24 <S> , 0x14 <S> ; 20 e4: 80 93 <S> 87 00 <S> sts 0x0087 <S> , r24 Of course, when I say "equivalent", I mean regarding code size. <S> If time is more important, then you have to look at the cycles. <S> In this case it looks like the assembly version is 6 cycles and the compiler's version is 8 cycles. <A> If you want to go hard-core with cycle savings, you could get this grab of TCNT down to a single cycle in the ISR! <S> You can take advantage of the fact <S> the high byte of the TCNT register is buffered whenever the low byte is read. <S> So if you preallocated a register (say r16) for this task... <S> register unsigned char <S> tcnt_low_byte asm("r16"); ...then filled this register with the low byte of the TCNT inside the ISR like this... R16 = TCNTL; ...which should compile down to the 1-cycle... <S> IN R16,TCNTL ...then you could later read out the full snapshotted TCNT value <S> int <S> he foreground like this.... <S> period = <S> (TCNTH << 8)| R16; Just make sure you read the TCNTH before accessing any other 16 bit timer registers since all of them share that temp temp register. <S> The total work done in the ISR is just a single in R16, TCNTL which is 1 cycle. <S> The OP did not indicate how he would signal the foreground process that an ISR happened, but if he was preloading period with 0 and then looking for a change then some extra work is needed... <S> preload <S> 0 into the TEMP <S> 16-bit register (you can do this by writing a 0 to any 16 bit register). <S> preload <S> 0 into R16 . <S> Then you can poll to see if the ISR happened with... <S> x= <S> TCNTHif <S> (x || R16) <S> { period=(x<<8 | R16) // <S> Process new period capture here...} <A> In my avr-gcc 5.4.0 simple period = TCNT1; for attiny841 seems to emit the code like this: in r24,0x2c in r25,0x2d <S> sts 0x0110,r25 sts 0x010f,r24 <S> It seems that the compiler knows already of the way 16-bit registers must be accessed and therefore the code like above is safe. <S> Avr branch of the gcc generally is not very good even in simple optimizations like the examples in the question, bun anyway upgrading the version of avr-gcc often helps. <S> Another concern is that later gccs and later avr-libcs could actually support accessing TCNT0 as single 16-bit register -- what seems to lack in the gcc used in the question. <A> Setup <S> Set bit in the DDR for ICP pin to make it an output. <S> Set ACIC to use the input pin for ICU trigger. <S> Leave other ICU bits to defaults (no noise filter, trigger on falling edge) <S> For each capture <S> In foreground <S> Clear the ICF bit by writing a 1 to it. <S> Set the PORT bit for the ICP pin to make it output HIGH. <S> Poll on the ICF bit until it turns to 1 . <S> Read captured TNCT value out of ICR register. <S> Rinse. <S> Repeat. <S> In ISR Set PORT bit for ICP pin using the SBI instruction.
| If you are willing to waste a pin, you could get a 1-instruction/2-cycle capture of the TCNT when the ISR is called by using the Output Capture Unit.
|
Correctly using RE and DE with RS485 I'm trying to build a RS-485 project using MAX485's. However, I'm having trouble finding out how to correctly use the RE and DE pins. Some PDF's and websites say that RE and DE should be tied together and then connected to a pin on a microcontroller (for example). Other places seem to have various combinations of connecting DE to ground and RE to positive, and other such things. Additionally, the places that say RE and DE should be tied together and then connected to a microcontroller, also have conflicting information about how these should then be controlled through the software. So my questions are: What am I actually supposed to do with RE and DE? Do I need any pull up or pull down resistors also? How do I control RE and DE assuming they are controlled by my microcontroller? Do I set them high/low then send data then set them low/high again? Do I do the same for receiving data? Any help on this would be appreciated, and also if there are any links to sites with this specific information about DE/RE would be good. <Q> You don't need any pull-up or pull-down resistors if you're driving those pins with normal output pins on your micro. <S> DE is the 'Driver Enable' pin and must be pulled high while you're transmitting data. <S> Depending on your micro and how you're using its interrupts you may need to be careful about when you pull it back low - check that all of the bits are completely finished first or you risk truncating the end of your message. <S> You must pull it back low before you'll be able to receive anything. <S> RE is the 'Receiver Enable' pin and must be pulled low whenever you want to be able to receive data. <S> You'll notice that the DE and RE pins have opposite polarity. <S> DE is active-high and RE is active-low. <S> So you can tie them together and control them from one pin if you want to - high means you want to transmit (DE active, RE inactive), and low means you want to receive (RE active, DE inactive). <S> Another possibility is to tie RE to ground and only control DE. <S> You would use this configuration is you want to be able to listen to yourself talk. <S> This would be useful in cases where there could be multiple masters talking on your RS-485 bus and you need to check that what you think you're sending is not being corrupted by another transmission occurring at the same time. <A> No pull up or pull down resistors are required for the enables. <S> Depending on what you're wanting to do and what the chip allows for, you can tie them together and drive them together (high is TX, low is RX), or drive them both separately. <S> The latter allows for a low power state on the transceiver. <S> edit: The 485 actually doesn't allow shutdown, the 481/3/7 do though, see pg. 5 of the datasheet. <S> So in that case, I'd tie them together and drive them together. <A> This depends on what you're trying to accomplish. <S> For example, if you never need to receive, then RE-NOT <S> (There is no RE!!) <S> can be tied high and left there. <S> If you need to enable the driver, DE needs to be high. <S> If you never need to disable it, you can tie it there. <S> You don't need pullups.
| If you're only ever going to be either transmitting or receiving then you could tie both DE and RE high (permanent transmit) or both low (permanent receive).
|
Powering and controlling multiple 12V LED strips with Arduino LilyPad USB I'm trying to use an Arduino Lilypad USB to control several separate 12V white LED strips. I am however struggling to work out how to power them. The LilyPad only operates at 3.3V and I thought a MOSFET would work, but I'm not sure how to do this when I want to control multiple strips. This will all be as part of a costume headdress, so the power supply needs to be quite compact and 'wearable'. Any assistance would be hugely appreciated. Thanks, R EDIT: to answer the comment on there not being enough info: Yes, I want to turn the strips off in patterns using the LilyPad, so each strip needs to be on a different pin. There will be 4 strips, each of 18 white LEDS. At the moment I have one strip working attached to a 2A MOSFET, 9V battery and the LilyPad. My question is then how I can best connect the other strips and their respective MOSFETs to the LilyPad and the same 9V battery, or is there in fact a better way of doing this. Regarding size, everything except the strips will need to fit on some kind of fabric pouch on the back of the head. My plan is just to hack it together and see, but any actual knowledge or advice would be very helpful. EDIT 2 (current situation): The circuit is working but the lights aren't as bright as they could be. I'm using FQP2N60C MOSFETs, but have no resistors in the circuit. I've also simplified the design, so it just uses LilyPad 2 pins; 3 LED strips are connected in series on one and 4 LED strips are connected in series on the other. I'm also using one 9V and 2*AA batteries to power the strips. Any advice on which factor could be making the lights not so bright would be really helpful. Thanks! <Q> Simply use a 4 pin opto coupler PC817 . <S> It has 4 pins. <S> Connect pin1 to the pin of your lilypad, pin2 is gnd. <S> Apply 12 v on pin 4. <S> Connect a pull down 10k resistor on pin3 and check the output from this pin, you will get 11.7-11.8v which I think is sufficient for you. <A> The base terminal to an arduino pin using a limiting resistor. <S> The anode side of the strip needs to be tied to the 12V source, and LED limiting resistor (R1) must be used somewhere in the LED series circuit to protect the LEDs from over current (SMOKE). <S> The cathode side to the Collector term of the transistor. <S> The arduino can flash the string using bit banging digitalWrite() or can do some PWM to control intensity if the PWM frequency is above ~45Hz(see analogWrite()). <S> The actual resistors used would depend on the Vf drop of the LED string and the (Imax) of the LEDs. <S> A 1K resistor for the transistor base (R2) is a good start. <S> Dont forget to calculate for the Vce sat of the transistor. <S> This design can be scaled up to higher powers by adjusting the transistor and the resistors. <S> Good Luck. <S> is a good start. <S> A MOSFET generally needs greater Gate voltage (Vgs(thresh)) before they conduct. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> A quick back of the hand calculation is that a 18 led section of 12v <S> 5050 white leds is 6 segments of ~60mA each, <S> so 0.36 Amps each. <S> If you have 4 stripes in "series", that needs 1.44 Amps at 12V. <S> Your mosfet is fine for that. <S> If it's the single diode led strip instead of 5050, then it's only 20mA per segment, or 0.12 Amps per 18 led strip. <S> And that's really at 14V. Less at 12 or lower voltages. <S> The problem is that your power source is not going to cut it here. <S> A 9V battery with that much current will not work. <S> A battery pack of 7 or 8 AA batteries wou of work. <S> Or a usb battery charger with a step up/boost converter to boost from 5V to 10~12v <S> would too. <S> Update: OPS testing showed that 3.3V was not enough to trigger the VGS of the original mosfets.
| If you want to drive the LEDs by switching the ground/Return of the LED strip this can be easily done by tying a NPN transistor (ie 2n3904)that has sufficient Collector current rating.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.