source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Sounds or music into a DC fan? Perhaps my understanding of how magnets work is off, but would it possible to play some waveforms into the positive and negative leads of a DC fan (think motherboard fan) and get a coherent sound? I understand if this were possible, that you'd need amplified sound to be driving into the fan to get a sound due to design constraints, equipment I don't have so I can't test it. Crazier... If it was possible to play sounds from the fan, would it be possible to attempt this with the fan spinning? <Q> You could try that, but if you get any sound out then it would be by accident. <S> It's equally likely that you'll damage something trying. <S> Standard DC muffin fans want a DC input, not an AC input. <S> They don't work well with anything AC. <S> There is a type of device called a rotary woofer , which is basically a fan that changes the pitch of the fan blades to move air. <S> The speed of the fan remains constant, but only the blade pitch is changed. <S> It's wacky, for sure. <A> Most fans (I have a brushless DC fan here that does it) starts to whistle when you drive them from PWM. <S> By changing PWM frequency and duty cycle, you change the sound. <S> It would sound more like an 80's computer game than a hi-end stereo though. <A> I have done this before on Sumo Robot motor driver. <S> The drivers played a sound using the motor coils when they booted up to let you know they were all alive. <S> The idea is to pulse the direction back and forth at the frequency of the sound. <S> An Arduino Example can be found on this site http://letsmakerobots.com/node/18211 <S> Requires the ability to reverse the direction so may not work with the computer fan. <S> May be possible to do while moving with a drive/stop motion. <A> Maybe not exactly what the posting person had in mind <S> but this may be of interest: Ham radio operators used to use a DC fan's rotating blades to modulate a He-Neon laser beam passing through (actually between) <S> the rotating blades. <S> I have done something similar using a CPU cooling fan salvaged from a computer. <S> I mounted the fan in front of a small mirror, (approx. <S> 5 <S> " x 7") that reflected sunlight onto a photo cell about 50 feet away. <S> This produced a nice appoximately 600Hz tone in my little Radio Shack "Mini Amplifier" (US$13). <S> The modulated sunlight in turn passed through a home-made shutter. <S> This is a minature version of those used on WW2 warships. <S> This rig enabling me to send Morse code via sunlight. <S> I have not tried using voice modulation of the fan motor's current but <S> a highly qualified EE Ham assured me that it will work. <S> Thanks for listening, Ed KF6DXX <A> It works with a brushless DC computer fan. <S> It is the coil whine that makes the sound. <S> They seem to work better with the blades locked. <S> I used a soft handled flat blade screwdriver to lock the blades and transmit sound to a desk. <S> They vibrate when running too so a hard suface is useful. <S> I've done it with half an LM324 or a single LM386. <S> the idea is to feed the fan a DC-biased, amplified signal. <S> For the LM386, look at the datasheet. <S> You don't want the cap on the output though. <S> For opamps, such as LM324 or LM358, try a summing amplifier. <S> I ran a pot from Vcc to GND, unity gain buffered it and tried a few different summing/subtracting topologies. <S> The idea is to add or subtract the signal and baseline and amplify the result. <S> You can drive the gate/base of a transistor if you need more power. <S> A combination of these may be even more effective but I'm not there yet. <S> i think the anti-lock mechanisms in newer fans may have a part to play. <S> Adding a resistor (10-100 ohm, careful with power!) <S> before the fan can help. <S> I used 11.75 ohms on a 12V 700mA fan running a baseline of 6V, gain 200 (LM386) and got reasonable sound quality, for a fan at least.
You can get intelligible music out either with the fan spinning or not. Older CPU fans seem to work best.
Charging devices - Voltage and Amperage When dealing with voltages and amperage, which one can destroy your equipment when not properly matched to the proper device? Am I correct in thinking that attempting to charge a device with an adapter of the correct voltage but too low an amperage won't damage the device but will just take longer to charge? <Q> Note: <S> Main OK point from below is that a power supply with the correct voltage rating and a higher than specified current rating will be OK to use in the vast majority of cases. <S> The situations where this does not work are so rare as to be worth risking unless major safety or $ value concerns exist. <S> Even then you can probably check with over current supply at correct voltage and see if problems occur. <S> If the equipment is worth over 2 weeks income get the correct supply :-). <S> Power = <S> Volts <S> x <S> Amps = <S> V <S> x I Too high Voltage will do damage. <S> Equipment may be damaged <S> Equipment MAY shut down Slightly too high <S> may be OK. <S> YMMV. <S> Too low voltage may do damage. <S> Slightly too low may work AOK or at reduced current. <S> Too low may damage equipment but not usually. <S> Too low may damage charger but not usually. <S> Correct voltage rating and too high current rating is USUALLY <S> OK - equipment will take what it needs. <S> A very few items of equipment will object in some way. <S> Slightly too low may be OK with computers an similar. <S> Older equipment using power supply as charger will quite often work with current rating far too low and just charge slower. <S> Too low current rating - equipment MAY load power supply down - MAY damage supply - MAY work - MAY just refuse to work. <S> eg Most notebooks / laptops / tablets - typically with 15 to 20 Volt supplies - will not even try to charge if power supply voltage is more than a Volt or two too low <A> Using an adapter with under-rated current could result in a couple of different outcomes, depending on the particular adapter. <S> (Assuming that since you said 'device' and not just 'battery', that we're talking about devices that have managed batteries in them, which is pretty common now) A very cheap one might overload and burn out. <S> Device will take very much longer to charge. <S> A better one, with protection will reduce its output voltage to keep the current constant, in which case, due to the reduced voltage, your device won't charge much faster than in the first case. <S> You actually want an adapter that has as much, or more, current capacity than the device you're trying to power. <S> The current marked on the adapter isn't the current you necessarily get, you see <S> , it's the upper limit of what the adapter wants to provide. <S> The amount of current you actually get depends on the device, and if it demands too much, your adapter will suffer. <A> My laptop had a charger (standard) of voltage 19.5 V and 3.67 <S> A current. <S> Similarly, my mobile had charger of 2A and 5V. <S> Now, curiosity was with my laptop as well as mobile charger, both blew out. <S> Now, I had a charger of 6.7 A at home, I put it in my laptop, there was no change but laptop now charged frequently. <S> (Note that voltages were same). <S> Likewise, I put a 1 A charger into my smartphone, it was very slow and eating my battery. <S> I researched and found out : If voltage ratings are same and current provided by charger is small, the device will get affected and if high, it will draw a standard current of its operation and work fine. <S> ThanksAsad
Correct voltage rating and too low current rating may cause damage.
How do I shield a card like Visa payWave and MasterCard PayPass to block its communication? This is basically a replication of this question on Personal Finance SE . Suppose there's a wireless smart card like Visa payWave or MasterCard PayPass or MIFARE Ultralight. The owner wants to temporarily shield it so that it's totally impossible for a malicious third party to make the card confirm a transaction. Will wrapping it into tinfoil be enough? How much shielding is needed to shield such card? <Q> A piece of metal foil (any metal) adjacent (within a few mm) to the card will do it. <S> It does NOT need to be wrapped round the card - close to the card on one side, and at least about a quarter of the area of the card will do fine as this will damp any read field. <S> As the card is powered from the read field, you do not need to absorb anything like the same amount that you would for a conventional radio signal. <A> Best of all a pocket of mu-metal. <S> BUT as others have said a sheet of metal foil close-by should suffice. <S> A sleeve of Aluminum foil glued on the outside of a properly sized plastic pouch would allows easy insertion/removal and long life. <S> MIFARE and other systems are almost always "near field" inductive power transfer systems. <S> Your aim is to provide a conductive surface that the induced magnetic wave will dissipate energy in. <S> Wikipedia MIFARE & variants <S> MIFARE is the NXP Semiconductors-owned trademark of a series of chips widely used in contactless smart cards and proximity cards. <S> The MIFARE name covers proprietary technologies based upon various level of the ISO/IEC 14443 Type A 13.56 MHz contactless smart card standard. <S> Variants: <S> MIFARE Classic employ a proprietary protocol compliant to parts (but not all) of ISO/IEC 14443-3 Type A , with an NXP proprietary security protocol for authentication and ciphering. <S> MIFARE Ultralightlow-cost ICs that employ the same protocol as MIFARE Classic, but without the security part and slightly different commands MIFARE <S> Ultralight Cthe first low-cost ICs for limited-use applications that offer the benefits of an open Triple DES cryptography MIFARE DESFireare smart cards that comply to ISO/IEC 14443-4 Type A with a mask-ROM operating system from NXP. <S> MIFARE DESFire <S> EV1includes AES encryption. <S> MIFARE Plusdrop-in replacement for MIFARE Classic with certified security level (AES 128 based) MIFARE SAM AV2secure access module that provides the secure storage of cryptographic keys and cryptographic functions <S> Hacking Barclays version with a cellphone - video news item. <S> Python script to read the cards. <S> Nice pickpocketing demo :-). <S> VISA <S> payWave <S> They say <S> Transaction Protection: Cards can only be read up to 4 inches from the secure reader and each transaction is accompanied by a unique security code to protect against fraudulent use. <S> Plus, you maintain control of the card at all times, which reduces the risk of fraud. <S> More here with few seconds of video demo <A> A more durable option than wrapping foil around the card is to get a wallet with a wire weave in its construction to block RFID scanning. <S> I bought and tested a wallet like that with the proximity badge my employer uses for access control, and it prevented the badge from being read when I held large sides that would normally face out when the wallet is in a pocket against the reader and when I did the same with the top/open edge of the wallet. <A> I would imagine that if tinfoil works, then using the material in one of the film bags used by travelers to protect film from airport xrays would work well too <A> If they are all metal, then they should work as a Faraday shield. <S> These have been used for years in all shapes and sizes, to shield against radio frequencies upsetting scientific tests etc. <S> I am always wary of "snake oil" salesmen, trying to flog off dubious items.
Because the card is resonant it may be able to do some fairly wonderous things at low signal levels in some cases so a solidly enclosing metal foil pouch is probably wise.
Input impedance of an op Amp I noticed that the input impedance of an op Amp is extremely high. Why is that so? <Q> It's one of the rules. <S> For an ideal opamp goes that input impedance is infinite (input current is zero) <S> gain is infinite output impedance is <S> zero input offset voltage is zero <S> If these requirements aren't met several basic opamp circuits wouldn't work. <S> Take for instance the inverting amplifier. <S> The transfer function is \$ <S> \mathrm{V_{OUT <S> } = - \dfrac{R_f}{R_{IN}} \cdot V_{IN}} \$ as derived in this answer . <S> The proof relies on the infinite input impedance, but you can't explain the transfer function based on both inputs equal, because that's not a property of the opamp! <S> So-called proofs that start from the fact that the inverting input is at ground are invalid. <S> Note that FET input opamps do better than their BJT input counterparts. <S> The former will have pA input current, whereas for the latter this may be several \$\mu\$A. <S> Further reading: Opamps for everyone <A> A very high input impedance gets us closer to an ideal op-amp. <S> The characteristics of an ideal op-amp are: Infinite bandwidth Infinite gain Infinite input resistance <S> The ideal op-amp exists because using it as a basis for analysis provides several worthwhile shortcuts that simplify the math involved. <S> The infinite input resistance is important because it ensures that no current goes into the op-amp. <S> This simplifies the analysis of feedback op-amp circuits. <S> Also, high input impedance is desirable in most circumstances. <S> If it had low input impedance the op-amp would draw down the voltage of the weak signal and not properly amplify it. <A> The higher the input impedance, the less likely that the opamp itself will effect the input signal. <S> Think of input and output impedance as a voltage divider made from two resistors. <S> The input impedance of the opamp is the lower resistor, while the output impedance of whatever device is feeding the opamp is the high resistor. <S> The best case is when the output impedance is super low while the input impedance is super high. <S> In this case the voltage divider is barely bringing the voltage down. <S> Worst case is when the output impedance is super high and the input impedance is super low. <S> Then the signal might be divided down to 1/100th of the original voltage, or worse! <S> So, it's better if the input to the opamp has the highest impedance possible. <S> There are cases where you might want a lower input impedance. <S> But in these cases you usually just put a load resistor on the input signal and don't rely on the opamp to do that for you. <S> Your load resistor (or terminating resistor, or whatever) will have higher tolerances than what the opamp will give you normally. <A> The answers are all good, but there is a more basic and more important concept behind that, in part explained by David. <S> The Op-amp, at least the most common type of op-amp, is a voltage-input, voltage-output component: it means that it takes a voltage as input, does some operation and spits out another voltage. <S> Reading a voltage requires attaching an instrument to the voltage source, as you would do with a voltmeter: this instrument has to be put in parallel (has to read the same voltage) with the source itself, and will see a current on it that depends on the input resistance of the instrument itself, in this case the op-amp. <S> The current will also flow on the output resistance of the source, as shown in the picture: <S> The current on the resistor will cause a drop on the input voltage to the op-amp, that won't be anymore equal to the source: <S> we don't want that. <S> So if the op-amp has an infinite resistance, the current on the input will be zero and the read voltage will be Vg, as desired. <S> Of course that's an ideal condition, but the higher the better.
It allows a signal with very weak drive to be correctly read by the op-amp and amplified.
Pull-up resistor over a microphone What is the reason of that 1 kilo ohm connected to the microphone? Why always too high resistors are used? I couldn't find any explanation. How do we calculate these values? <Q> The microphone is an electret type, which needs a bias for the capacitor, which it basically is. <S> Some electret microphones also have an amplifier built-in, which also needs power. <S> The larger the resistor from \$V_{CC}\$ the larger the voltage drop caused by the supply current, though for an unamplified electret the current is low and the resistor may be bigger. <S> A too small resistor will cause the signal to be attenuated. <S> \$V_{CC}\$ is ground for AC signals and a small resistor will cause too much current to go that way. <S> In practice you'll often see higher resistor values, like 10k\$\Omega\$. <A> The mic diaphragm itself doesn't need any bias, since it's an electret mic. <S> " Electret " means "permanently electrically charged". <S> So the diaphragm is always already biased, even without any power applied. <S> So the resistor and bias voltage has no effect on the frequency response or other properties of the diaphragm. <S> The resistor value does affect the gain of the FET, however, since this is a common source amplifier . <S> Increasing the resistor (within reason) will increase the output voltage level. <S> (and 1 kilohm is not a high resistor value. <S> If the diaphragm was not electret, you'd need to supply your own bias to it, through a resistor, and for minimal self-noise, this is typically in the giga ohm range, which is 1 million times as large.) <A> Microphones can generate voltages by themselves sometimes, but often they need to be powered by an external source: in this case, the resistor is used to provide a supply to the microphone without forcing it's output voltage. <S> The signal generated from the microphone will be a variable current which will cause a varying drop over the resistor. <S> Note that there is a series capacitor to AC-couple the signal, which means removing the common mode voltage (DC component). <S> And by the way, 1 kOhm is not a too big value: consider that 1 Ampère in electronics is often too big, and milliAmpères are far more common. <A> The microphone as drawn in the circuit diagram is an electret microphone. <S> It basically is a capacitor of which the plates can slightly move further and closer apart, by sound. <S> A capacitor without an electric charge does nothing, so a slight electric charge is applied to the capacitor through the 1k resistor. <S> Now when the plates of the capacitor start moving closer/further apart (caused by slightly changing air pressure from sounds), the capacity of the device changes with the distance between the plates and while the charge on its plates takes a relatively long time to change, the result is a varying voltage across the microphone. <S> These devices have a very high impedance for audio frequencies and therefore you often see an small buffer amp built close to it, so it can drive a long cable. <S> This type of microphone is very cheap and audio quality is high. <A> Examples of Condenser Mic specs with their corresponding data sheets can be found on DigiKing (see Electret Condenser Microphones ). <S> Most devices specify both a typical/standard operating voltage along with a max voltage. <S> They also provide in the data sheet the typical current consumption (0.5mA appears a lot). <S> Armed with these facts, it's straight forward to determine the resistor pullup value. <S> $$Pullup\; <S> resistor = <S> \frac{supply\;voltage - operating\;voltage}{current\;consumption}$$ Example using a 9V supply and a 0.5mA current consumption with a 2V standard operating voltage $$\dfrac{9V-2V}{0.5mA} = 14K\Omega$$
The reason there's a pull-up resistor is to supply power to the built-in FET impedance converter:
How to remove DIP ICs from breadboard? I am new with electronics and I have some issues removing DIP ICs from breadboard after testing something with them. I end up bending their legs if I pull them with bare fingers or pliers. Is there some recommended way to pull them up nicely? <Q> I usually try to leave some room at one end, so I can insert a small screwdriver underneath the IC. <S> Then just lift. <S> Will bend the pins ever so slightly that it doesn't cause problems upon reuse. <S> Alternatively, Wiha seems to have chiplifters, a bit like a small crowbar: <S> This will need a bit less room. <A> On a breadboard , take practically any old pointy thing that will fit in 'the gutter', and nudge it carefully under one end of the chip (that's what the gutter is for!) <S> until it just starts to come up. <S> Then move to the other end, and bring that end up a little more. <S> At that point it should be loose enough to just pluck with your fingers. <S> Things with short right angles work best. <S> Another article that sometimes works is the corner of blank PC slot covers. <S> In the days of desktops with 8 ISA slot motherboards, these were easier to find, but you can probably still scrounge something. <A> Just lifting a little on alternate sides of the chip, until it comes out. <A> For DIPs, I've seen two basic types of tools. <S> One which grasps the DIP under the long sides and one which grasps the DIP under the shot side and both have their uses. <S> If the component is close to the board, sometimes the pins of the long extractor won't be able to reach under it <S> and it can be difficult to remove the DIP. <S> In that case the short end extractor is more useful since on the breadboard there us usually a trench under the DIP <S> and there will be enough room to insert the extractor. <S> The downside of the short end extractors is that you can lift one side of the DIP with them and leave the other in the breadboard which usually causes pins to bend. <S> Also sometimes considerable force may be needed to actually operate the extractor which increases the chances of DIP slipping and flying off once it has been removed from the breadboard. <S> On the other hand, the long side extractors apply force more evenly along the DIP and the change of DIP pins getting bent <S> is lower with them since practically all pins get removed at the same time. <S> Unfortunately, Google can't find the long-side extractors such as ones I have, so this blurry image will have to serve as illustration. <S> EDIT: I managed to find a link to the narrow one. <A> I use a chip puller like this: http://www.circuitspecialists.com/ex1.html or a small screwdriver.
Personally, I use a small chip lifter or pry bar . My favorite thing to use is a sort of heavy-duty dental pick I have, that has a right angle with a pointy end about 1/4 inch long.
What microcontroller programming toolchains are available on mac OSX and how do they compare? I am trying to figure which microcontroller starter kit to buy, provided i have only macs and like to code on them (and look for a solution without linux in virtualbox and the like). It is an acceptable answer to say that all compare poorly to Linux or Windows based toolchains but has to be explained. <Q> I don't know what other gcc code-generation options are available, but it would surprise me if gcc didn't target most of the more popular devices. <A> Depending on your needs, Arduino may be a fun starter kit with lots of shields (hardware expansions) available and a huge community. <S> Arduino has a low entry level from both a hardware and software respective and you can still write regular C/C++ with it. <S> However, Arduino doesn't have a debugger. <S> Recently Atmel has released AVR Studio 5, which is integrated into Visual Studio. <S> It makes it even less portable to OSX, unfortunately. <S> I do know microchip has released MPLAB X final recently, and it is supplied for Mac OSX out of the box. <S> I don't have a Mac to test it , but I am pretty certain it will work (have seen 1 or 2 random video's of people using it fine with Pickit 3 and PIC24's). <A> OS whatever is a FreeBSD "port". <S> Anything rated for unix or linux can be made to work with an amount of effort proportional to your experience level.
I use the gcc/AVR toolchain under OS-X, inside eclipse and from the command line.
Beginner in Arduino, what materials are needed? I'm a programmer and i would really like to have with Arduino. I don't know anything in electronics but if there are things to learn, i can do it. I want to know what materials are needed to get started with it. Just like what type of Arduino board is needed, do i need the segment display so on.. Can you guys help me?? <Q> I came from the same background as you did <S> and I've started tinkering with Arduino this year. <S> I would recommend a starter kit (I see you've already went in this direction). <S> I can personally recommend this one: http://www.sparkfun.com/products/10173 <S> What's good about it? <S> It contains: the basic stuff (an Arduino, a breadboard, a set of resistors, a bunch of jumper wires), a multitude of diverse components; and <S> it includes learning materials - an instruction booklet and breadboard overlays. <S> I would look for these qualities when deciding on a starter kit. <S> Note, by the way, that the learning materials in the aforementioned kit are available online for free (the links can be found on the product page). <S> One more thing: once you catch the Arduino bug, you will eventually need tools. <S> Here's a nice overview. <S> However , the only tool that might be useful to you at the very start is a multimeter and some cutters. <S> You shouldn't need to solder or work with wiring at that point. <S> If the description of a kit you're considering implies it, perhaps start looking for an alternative - unless you already posses experience in those departments. <S> Finally, consider investing in a storage box with movable separators. <S> Not necessary, but it helps when working on projects :). <A> I started with a Duemilanove168 compatible board. <S> It has enough analog (6) and digital (13) <S> I/ <S> O to get started. <S> It has the standard Hello-World-LED13 on it, and it lets you experiment with timers and interrupts. <S> I think it is replaced with Arduino Uno. <S> It is a matter of how much money you want to spend, a bigger board brings more <S> I/O but is more expensive. <S> There are loads of compatible boards, that may go a little cheaper than the original ones. <S> Personally I'm very charmed with DFRobot Arduino-Compatible Screw Shield to attach wires to Arduino. <A> While many of the kits of parts all seem fine, personally, I prefer to only buy what I need when needed. <S> If you start with blinking LEDs as most do, you'll need some LEDs and some 220 Ohm resistors. <S> Both for digital and analog (PWM) control. <S> Playing with the serial console requires just programming. <S> Measuring analog data reading a potentiometer or thermistor is a common start. <S> As you master some aspect and want to learn to use another external device, get it when you need it. <S> Of course a breadboard and some hook up wire is needed. <S> I actually need a toolbox to hold all the electronics junk I've collected. <S> Do not throw away any electronics without scavenging those for parts. <S> VCR's are essentially obsolete and hold a wealth of electronics not the least of which will be the motor(s). <S> It is possible <S> I'm seconding jippie's answer in which case give him the credit. <S> Have fun whichever way you decide to collect information and "getting started parts." <A> I'm a programmer who got into electronics too, and i might say this - build something you really need. <S> Not just some toy, but real stuff, a THING (real world object made of concrete matter) <S> you need right now. <S> It will guide you from there... <S> Random toying with random stuff is ok, but it does not contain passion element that would drive you forward.
Regarding the kit you posted, you don't really need an LCD module for learning about working with Arduino, as it includes a library for bidirectional serial comms. Get a small breadboard , they're not too expensive and make experimenting easy.
Connecting power supply to fan? Does it work? I'm all new to electronics and I was wondering whether or not this work. That one, as you can see it has a black + red cable, can I connect it to this Brushless DC Cooling Blower Fan 12V 50mm x 40 mmx10mm 4010 2 pin Wire? And as you see in the 2nd picture, it has a white thing on the cables, can I cut that off and connect all the cables together and then, would the fan start working? <Q> The battery holder is for 4 AA cells, which are 1.5V for alkaline, or 1.2V for NiMH. <S> That's either 6V or 4.8V in total. <S> The fan is a 12V. <S> Make sure it's DC! <S> The white dingus is a connector, which you would use with a mating part, which you probably don't have. <S> So you can cut it off, and solder the wires directly together. <A> The answer is maybe. <S> Usually the 4*AA holders are used to create batteries by serially connecting the 1.5 V (nominal) cells into a 6 V battery. <S> The voltage drops with use and can go as low as 3.2 V in some cases when the battery is nearly depleted. <S> On the other hand the fan in its specifications has the 12 V input voltage and maximum current of 100 mA. <S> It's more or less usual laptop fan and it may or may not start working at 6 V. <S> Basically such fans need some voltage to start operating and then can work on lower voltage. <S> The 6 V provided by the holder populated with fresh AA cells is on the lower border of the start voltage. <S> If the cells aren't fresh, the fan probably won't start. <S> The solution to this problem is to get two such AA cell holders (or one for 8 AA cells). <S> This would give you nominal voltage of 12 V at the fan and it should work fine. <S> About the connections part <S> : Take two holders, connect red wire of one holder to black wire of the second holder. <S> This will give you a 12 V battery <S> and you'll have one red and one black wire free. <S> Connect the black wire of the newly created battery to the black wire of the fan and the red wire of the newly created battery to the red wire of the fan. <S> In addition to that, the lowest voltage you can expect from the battery now is around 6.4 V with no load. <S> This should be enough to be sure that the fan will work until the cells are completely depleted. <S> And yes, you can safely cut the white connector from the fan <S> , it's just there <S> so you can plug the fan into a device which has the matching receptacle. <S> If you don't have the receptacle, you don't need the connector. <A> Convention rules here <S> Red is + so series connect two 6V compartments <S> then 12V fan runs Red to Red and Black to Black.
You may want to put a switch on the connection between the two red wires or on the connection between the two black wires so you can more easily turn the fan on and off. It may work at the lower voltage, though it won't blow very hard. AndrejaKo suggests to use a second set of 4 AAs to get to 12V, but you better get a 12V DC wall wart. The 100mA the fan uses will drain your batteries in a day.
Circuit to Convert Line Level to Mic Level How would I design a circuit that converts a line level signal to be able to be fed into a microphone input? The input impedance of the microphone jack is 2 kohms. <Q> I would use a simple resistor divider: <S> This attenuates the voltage by about 1000, which should be about right. <S> The 100 Ω output impedance is well below the 2 kΩ microphone input impedance, so it won't be loaded by the mic preamp. <A> What you need to do is reduce the voltage level, and block any DC. <S> The resistors are set up as voltage dividers which reduce the input level to something managable by the microphone input. <S> The capacitors block the DC. <S> How much should you attenuate the signal? <S> It depends on the typical line levels you'll get from your equipment. <S> According to one test , typical microphone voltage levels are in the region of a couple of 10s of millivolts. <S> Line levels are probably in the region of a volt . <S> So you'll need something like a 100:1 reduction in signal level. <S> Of course, the input impedance will also act as part of the resistor divider. <S> To play it safe, you could simply use a couple of pots so that you can start off with a strong attenuation, and slowly lessen it until the levels are nice. <A> Drop your inputs with a resistive net (10K-ish) and a DC block, maybe a 104 cap, then once the signals are down, mix it all back out with an op amp like a TL072 with <S> whatever -gain you want out of it, or you can use the opamp as a buffer if the attenuation is ok. <S> The point is that the opamp will give you a really high impedance and a really low output impedance, that's good. <S> Mixing is best done at low volume levels anyway. <S> The mic input may be 2K or whatever it is, but it's not that important since it's a voltage device and not a current device. <A> That's what a DI (aka direct box) does. <S> You can use a DI to take a line level keyboard or mixer output and bring it down to mic level to plug into a mic preamp for example. <S> DI's often have a switchable pad so they can accept line level sources (with the pad on) as well as lower level signals from a guitar/bass etc with the pad off. <S> Something like 12-20dB is usually plenty for the pad. <S> All you need is a step down transformer and a resistive pad. <S> Usually DIs use a 12:1 transformer or so. <S> Something like this could work: Image from: https://sound-au.com/p35-f2.gif <S> You might not need that RC circuit at pin 1 of the XLR. <S> I usually leave that out for stuff like this. <S> Impedance matching is not so important here. <S> A line level source will likely have pretty low impedance which is fine for this situation. <S> Hope this helps!
Your main goal is to bring the signal level down to something the preamp can work with. You would only run into trouble if its impedance were too high, more than about 150Ω, but that's unlikely.
Do AVR registers and ports need to be initialized to zero? During the initialization routine of my code I use to do such things as: clr r0 ; will always stay zero and: out PORTA, r0; initialize portsout DDRA, r0out PORTB, r0... Is this actually necessary? Or can I be sure this is automatically done upon reset? Especially, can I rely on all ports to be set as inputs by default so there is no problem with external votages when no code is executed? <Q> The I/O ports of an AVR are set to INPUT / Tri-State / Hi-Z (DDRx = 0x00) upon reset. <S> Most microcontrollers (if not all?) have this behavior. <S> It's the safest state for a pin to be in. <S> So yes, you can rely on the ports to be set automatically as inputs. <S> Some excerpts an the ATmega16 show exactly that: <S> The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. <A> Port initialisation is ALWAYS a good idea, regardless of what the data sheet says. <S> If the datasheet says nothing then it is an utterly vital idea. <S> You only need to define the port data contents if you care about what will happen when your program runs. <S> If you don't care about the result you don't have to set the port data bits :-). <S> it is STILL a really really good idea to initialise them yourself anyway. <S> "Boundary conditions" are where most things go wrong - eg start of a loop, end of a loop, circular buffer wrap round point, ... . <S> Processor startup is a hardware equivalent. <S> In a real world with noise and glitches and people in it, being in charge of your programs destiny as much as you can is a really good idea. <S> Port initialisation is an easy part of this. <A> Neither registers nor SRAM is initialized upon reset, only some of the peripheral registers. <S> You should initialize things you use.
If manufacturers say explicitly in the data sheets that port data bits are set or cleared then they may be BUT
Converting an NO reed switch to a NC with lowest leakage current When the switch is closed I need the pin on the microcontroller to be high impedance, when the switch is open I need it connected to the ground. I need the leakage current to be minimal.What should I use? An inverter, an open drain transistor, or are there any other options, like an inverting relay package? <Q> Fix the overall design so you don't have inconvenient issues like this at the lower levels. <S> The first obvious solution is to use a normally closed reed switch. <S> Second, why is the polarity important when it's going into a micro that can interpret high or low any way it wants to? <S> If you need to minimize power, have the micro sample the switch periodically, turning on the pullup or pulldown for a few 10s of µs only around the test. <S> If this switch needs to be detected on a human time scale, then sampling every 50 ms will probably be good enough. <S> If you really really need to have a switch cause high impedance when closed and pull to ground when open, <S> one FET and one resistor can do this: This won't work well if there is any noise on the switch line, since the FET gate is at high impedance. <S> You can use a lower resistor, but that increases current too. <S> If you're going to reduce the resistor to have a few mA thru it when the switch is closed, you might as well substitute a NPN bipolar transistor for the N FET shown. <A> I had this exact problem just the other day, when I got shipped NO reed switches instead of SPDT switches <S> (description was in error). <S> I couldn't easily change the wiring, which was buried in a wall, so I was stuck unless I returned them for the right ones. <S> Flash of brilliance while pondering the problem lying in bed that night: fasten a second fixed magnet with opposite N-S orientation near the switch to bias the switch "on". <S> When the movable actuation magnet gets close enough, its opposite polarity will interfere with the field of the bias magnet, turning the switch off. <S> You will probably have to experiment a bit to figure out how close to to put the bias magnet. <S> Worked perfectly. <A> Depending upon how quickly you need the switch to react to events, and depending upon what other circuitry you have in your design, I would suggest that you might want to consider using a port pin with a switchable pull-up resistor. <S> Periodically wake up, enable the pull-up, and check the pin state. <S> If high, and if if the processor can wake on a falling edge, leave the pull-up enabled. <S> Otherwise disable it. <S> This will offer instant response to switch closures, and will respond to switch opening at a time dependent upon the pulse signal; the logic level on the switch pin will only change, though, when the switch opens or closes.
An alternative approach in some cases if you have available a signal which is mostly low but occasionally pulses high is to connect both that signal and the switch to inputs of an "or" gate, and have the output of that gate connect back to the switch via high-value resistor.
How do I use VHDL generic parameters when I place a sheet symbol in Altium? I'm using Altium Designer Winter 09 to synthesise a design for an FPGA. This includes a VHDL-defined entity MyShifter that includes generic parameters so I can have it be reuseable: library IEEE;use IEEE.Std_Logic_1164.all;entity MyShifter isgeneric( data_width : positive; pad_width : positive);port( -- ...other ports... DataIn : in std_logic_vector(data_width-1 downto 0));-- architecture follows... With any other VHDL entity I could just right click on a schematic and use Place » Sheet Symbol , and then synchronise the sheet entries with the ports defined in VHDL. Altium will, later on, automatically generate the higher-level VHDL that maps ports to other ports and I don't have to worry about it. When I try this with my entity-with-generics, I end up with sheet entry labelled DataIn[-1..0] . This is unsurprising, since I haven't "told" Altium what data_width actually is. My question is: how do I tell Altium what the generic parameters data_width and pad_width are for a particular instance of MyShifter ? <Q> I'm not sure a good solution exists. <S> Then you could just place that second-level VHDL file onto the schematic. <S> Not ideal, but it maintains reusability, as you can just make new second-level files for every different size you want, and you only have to change the first-level file to affect all instantiations. <A> Have you tried adding it as a parameter to the sheet symbol? <S> Double-click on the sheet symbol, Go to the parameters tab, and add a parameter data_width . <S> I would guess you want it of type INTEGER . <S> I'm kinda guessing here. <S> I don't really use Altium with logic synthesis. <S> You may have to correct the sheet-entry labels manually after you add a parameter (or maybe just recompile the project). <S> Alternatively: <S> I know you can define project variables, but I don't know if they are presented to the VHDL synthesis system. <S> If data_width is used in multiple places (and is the same everywhere), it may be worth trying. <S> Project >> <S> Project Options <S> >> "Parameters" tab. <S> It does not have the data-type options of the sheet-symbol, as described below, so it's possible that the VHDL synthesis system does not see project parameters. <A> 1- If you add parameters to the VHDL symbol as suggested above: this will add the following code the the VHDL file: <S> 2- The easiest way to get the results that you requested, is just to add a single line at the beginning of the vhdl file: to verify that this works, you can quickly synchronize the symbol with the vhdl sheet
You could add a second VHDL file that instantiates your first VHDL file's entity with the appropriate generic map.
Web site for PCB routing or PCB tools I am a noob so please excuse my lack of knowledge, Is there a web site that can be fed with the circuit and it would route it and would give me the final bitmap of the PCB? I'll be also glad if you guys point me out to some free software for such PCB routing. I think there must be some kind of cheap alternative of those professional software tools that do the same but you just can't afford for small hobby activity. <Q> Is there a web site that can be fed with the circuit and it would route it and would give me the final bitmap of the PCB? <S> Querying Google for "PCB Design Service" yields lots of offers, but obviously, you don't just feed them with the circuit but also with (probably a lot of) money. <S> PCB design cannot be fully automated and will be done by humans. <S> I'll be also glad if you guys point me out to some free software for such PCB routing. <S> I can recommend KiCad . <S> This software can also work together with online autorouters (which is what you might be looking for) such as http://www.freerouting.net/ , but beware that this no "circuit in, PCB out" magic machine. <S> Unless you have a really high number of signals, the effort usesd in correctly configuring the autorouter to produce an acceptable result is much higher than routing by hand. <S> Also you still have to place the parts, which is sometimes the hardest part. <A> PCB layout is a very work-intensive discipline, and routing is only a part of it. <S> You'll have to define the board outline, define design rules, and place the parts before an autorouter can get started. <S> And even then you may want to route some critical nets by hand before the autorouter takes over. <S> So if you want an online autorouter which will automagically design a PCB from your schematic just like that, I'm afraid that doesn't exist. <S> noah1989 mentions one design service, based on a Google query. <S> Mentioning one is a bit pointless if you don't know where they're located and what they offer. <S> Location can be an issue. <S> You may want to discuss the design face-to-face with the layout engineer, and then it's more convenient to have her at 50km than at 5000km. <A> It is a high-performance topological router. <S> You can download Lite version, which limitations are - up to 125 nets and 8 signal layers. <S> As many people said here before, with autorouters - you don't get a tool with a magic button that makes all work for you. <S> The software I'm talking about does provide you with good or even excellent results of autorouting, however you will need to make certain changes manually. <S> Useful info: <S> just now TopoR lacks schematic capture and library editing, so you will need to import your project from some other CAD.It accepts data from KiCad and DipTrace, already mentioned here. <S> As far as I know DipTrace has freeware version too, it's limitations are 300 pins and 2 layers.
Speaking of freeware, have a look at TopoR (you'll need to google it).
Need for DRC for Gerbers? In reference to this question , do you actually perform DRC on Gerbers? Or do you do it for the PCB (post-design or interactive) and trust that the generated Gerbers will be OK? <Q> One thing should be clear: you can't just do a DRC on the Gerbers alone. <S> Your PCB design may have several design rules which the Gerbers don't have information about, like clearance between nets (like mains voltage and SELV) or trace width for high current nets. <S> I have interactive DRC, so I get warned when I'm violating a design rule during layout. <S> Before I create my Gerbers I run DRC again over the complete design. <S> That's it. <S> If you talked these through with your shop you should have the same design rules in your EDA software, and you shouldn't get any surprises. <A> I always run the "DRC" in my PCB software before generating Gerbers. <S> The netlist and most of the other information that is helpful for finding the kinds of common errors that DRC is supposed to catch is simply unavailable in any of the Gerber files. <S> I don't run any sort of check on the Gerbers, other than printing out the Gerbers at 1:1 and briefly glancing at it while dropping a few physical components on it. <S> Advanced Circuits and a few of the other PCB manufacturers have software that somehow performs DRC checks using the limited information available in the Gerber files. <S> In theory any possible problem they could find should have already been caught by my PCB software DRC check. <S> In practice they have caught a problem on more than one board of mine that the DRC in my PCB layout software somehow missed. <A> The only sensible path is to check both within the CAD software ("is the design correct") and also check the Gerber, drill, etc. <S> files ("will it be correctly fabricated"). <S> Your CAD system will have high-level information about what you're trying to accomplish. <S> In the world of CAD software people this is called your "design intent". <S> Starting with the schematic's logical connections, the layout can be confirmed. <S> But, just because the CAD system thinks things are going to be connected, the fabricated reality may be quite different. <S> The people that build the board are very, very likely do so from Gerbers. <S> They may get the gerbers from you, or they may generate them (many shops have a "native design conversion" option of some kind). <S> Either way, the machines they have need gerbers and the outcome of fabrication will depend on how well they are crafted. <S> It's not just about "trace and space". <S> There are a myriad of problems that come into play when copper is removed from fiberglass with acid, holes are drilled, etc. <S> Review your gerbers after you confirm your design in CAD. <S> Use a free gerber viewer to grab pictures to include with the order <S> so the board shop knows what you saw when you thought to yourself " <S> yeah <S> , that's what I want".
The PCB shop may/will run a DRC on the Gerbers it receives, mainly to check minimum trace widths and clearance between traces/pads.
Industrial electronics layout and design Why do industrial panels for oil and natural gas compressors or other industrial equipment use terminal blocks for wire management? I have been doing some repairs for companies and was wondering why they chose that layout. I was thinking instead of all these wires going to different terminal blocks why not make a industrial PCB? Is this possible? Is it considered bad practice? <Q> Why of course, making industrial PCB is possible. <S> But also, there are good practical reasons for using wires and terminal blocks. <S> Control panels can be large A typical limit on PCB size is <S> about 0.5x0.5m. <S> The limit is set by the size of a PCB laminating press. <S> Control panels can be much larger than that. <S> High currents Dealing with high currents (above 10A) on the PCB is possible, but it requires wide traces. <S> A medium sized 18AWG wire is rated for 15A. High currents encourage to use wires. <S> Relatively low quantities Makers of industrial control panels like to use ready-made blocks (thermostats, displays, alarms). <S> They come in standard sizes: 1/8, 1/16, 1/32, DIN rail. <S> They have screw terminals as a way of interfacing to the rest of the system, so you have to have wires to interface to them. <S> Maintenance Long service life requires maintenance in place. <S> Ideally, maintenance should be possible without specialized tools. <S> Screw terminals need only a screwdriver. <A> Vibration is killer on connectors. <S> Screw terminal blocks are more resistant to it than pin connectors or card edge connectors. <S> The question mentioned oil and gas industry. <S> One spark in wrong place there can be critical and cause loss of many lives. <S> IEC Standards also stand for usage of proper installations and because of these standards there are several blocks created to make these secure installations easily. <A> I would agree with Nick Alexeev but wanted to add a couple more important reason and a note. <S> Reason 4: <S> Flexibility Unlike consumer based industries and devices, Industrial process and manufacturing is constantly changing. <S> Machines and systems commonly need to be changed to adapt for product variations, re-purposed for new products/task, constant improvement. <S> ( In consumer industry like your HVAC or even electrical panel, circuits may not change for the life of panel. <S> In commercial panels, like restaurants, they don't change that often. <S> In consumer market when you want new improved, you take out the old and buy a complete new device/system. ) <S> Reason 5: <S> Downtime <S> When you are doing that change or maintenance, it is critical <S> you do it as quick as possible because the ' True Downtime Cost ' can cost thousands, even millions. <S> So the quicker you can add or change out bad device wired to it, the more money is saved in downtime cost. <S> Note: In the old days, hard wired circuits where used, they where called proprietary. <S> Industrial customer had to rely on vendor of circuit, hope they where still in business, thousands in downtime. <S> relays for switching higher currents had to be un-soldered, etc.. <S> Later the industry evolved to relay sockets for faster replacement, then later to PLCs for even greater flexibility. <S> Now days the PLC (just a dedicated microprocessor) to a PAC ( <S> Ind. computer emulating a PLC). <S> Because the controller still interacts with real-world where flexibility and high currents still need to be dealt with, the Inputs and outputs go to terminal blocks. <A> why not make a industrial PCB? <S> What could your industrial PCB look like? <S> We can design one and see how it develops. <S> It's the control panel for a mobile killer robot equipped with a laser death ray. <S> It needs:- <S> Fieldbus controller with metal screened enclosures pneumatic valves and actuators for the arms 100 KVA 3 phase power supply with a large fuse power relays to control the laser water cooling system power drivers for the electric wheel motors <S> So it might look like this:- <S> All of these components might find themselves inside a single control panel. <S> This has similar components, including a large mechanical device (white thing). <S> Which bit would be the PCB with pneumatic, high and low analogue signals and digital /optical signals? <S> By the end of their lifetimes, I'd bet that most control panels are unique as a result even if there were duplicates originally. <S> How would you evolve such a PCB to add another death ray, or upgrade the power of the original one? <S> Adding another 200A capacity to a circuit board isn't practical. <S> This one is a good example of a mixed discipline panel where there's half digital logic and half pneumatic controls. <S> You effectively have wires connected to pipes:- <S> Discrete parts allow that. <S> You can easily replace the PLC with a newer more powerful model, especially if the panel is well designed with ample space. <S> Crowded panels don't help anyone in the long term and might be considered dangerous. <S> A PCB would need to be completely re manufactured if you decided to use fibre optics rather than RS232. <S> By connecting standardised parts together, you avail yourself of the division of labour and economies of scale. <S> These are the tenets of an industrialised society.
Connectors are one of the most common causes of failure in electrical systems - reduce the risk of their failure with more secure connectors like screw terminal blocks or mil-spec connectors and you stop seeing as many failures. Also loose connections that are about to break are serious danger in causing fires. Virtually all serious control panels evolve as operations evolve. If you've invested £100K in a large panel, you need to protect that capital for a few years by incorporating a great deal of flexibility.
Are board stiffeners OK? See this page . Is this OK? I know that Pb-based solder is extremely creep-sensitive, so you don't want any force exerted on solder connections. That's why heavy components (think transformers or components mounted on a heat sink) should always have a mechanical fixing (screws) apart from the solder connections. So for me it's a no-no. What do you think? Do other solders show less creep? edit (re Fake's comment on snap-in) The snap-ins seem to be hooked pins which hold the bar in place (during soldering), as there are also soldering pins: <Q> When they're designed as board-stiffeners, sure. <S> They're no problem. <S> On the page: We offer single and multi-layer copper bus bars both insulated and un-insulated. <S> The snap-in rigid/bus stiffeners provide board rigidity without the need to clinch pins. <S> Critical section highlighted . <S> They're not relying on the solder for mechanical support. <S> The pins are shaped so they lock into the PCB. <S> It's worth noting that they also bill them as helping in high-vibration environments. <S> While I do agree that if you can, you should have more screw-mounting points for a PCB, I think Board-Stiffeners are more intended for situations where you are designing a system to fit into pre-existing packaging, and adding additional PCB supports is not an option. <S> If your choices are "sagging PCB" and "PCB with stiffener", it's pretty obvious what the better answer is. <S> The answer is to fire your mechanical engineer <A> One place I've used one is on a large ("C" size) pluggable Eurocard format board. <S> The idea was to prevent the board from flexing due to excess force applied when plugging it in and out of its slot. <S> Since it wasn't carrying any sustained force (only intermittent force) <S> I designed the stiffener in because I was seeing failures in prototypes that might have been due to board flexure. <S> Standoffs were not an option for a pluggable card. <S> And a soldered connection is much lower cost than fastening on a stiffener with screws. <S> I don't know how this would have held up in the field because the failures didn't become an ongoing problem and the stiffener was never loaded for production boards. <A> I've seen instances where operators have handled power supply PCB assemblies by gripping a large heatsink, causing the board to flex and several ceramic caps to crack (and go CRAAAAAAAAAAAAAAAAACK! <S> on initial power-up). <S> It wasn't intuitive to the operator to handle the board by the edges. <S> (This was a North American factory, BTW - so much for 'skilled' workers) <A> They don't seem to know how to profile their products. <S> One is indeed a board stiffener, the other seems to be a bus bar for power distribution, but they call that a rigidizer as well. <S> And this has a snap-in version. <S> I would separate mechanical and electrical function. <S> If it's electrical (bus bar) <S> you probably want to solder it, <S> if it's mechanical you definitely don't want to solder. <S> Like you say solder joints should never take mechanical forces. <S> The snap-in seems to have a mix of solder pins and hooked snap-ins to keep the bar in place before soldering. <S> So it's not like the snap-ins have to carry the high current ( 11 A per pin , not 64 A).
Board stiffeners also help in production environments where the PCB assemblies have to be handled before being locked down into a chassis. I wouldn't expect creep to be a problem.
What is this: a dual CAP? I am trying to figure this cap out and locate a new one. It says 107K and 10K on it. Is is polarized ? what is it and where do i find one ? <Q> The "K" with the bars above and below is a trademark of Kemet. <S> The yellow encapsulation and the stencil font of the numbering are consistent with Kemet capacitors as well, but I can't say for sure whether other companies have copied them. <S> Their circuit diagram shows two ground leads, presumably to reduce ESR and inductance (although it seems like if you really want to reduce ESR and inductance you should use a surface mount capacitor) <S> Aha, this is what they say about the three-lead design: <S> The three-leaded design (the anode is in the center) enables operators to insert the capacitors into printed circuit boards correctly without having to visually determine polarity. <S> This timesaving device also eliminates board damage that may result from incorrect insertion. <A> Nope, I think stevenvh is right. <S> OK, I have changed my mind again after seeing Jason's answer . <S> This is the reason Murata give for their three terminal capacitor. <S> According to Murata , they are used when you want a decoupling capacitor with greatly reduced effective series inductance. <A> This looks much like the dual capacitors found in this discussion thread . <S> Here's a picture: I would argue that they're non-polarized ceramic capacitors. <A> From the three pins I'd say a ceramic resonator , and then the 107K reminds me of the 10.7MHz intermediate frequency in FM receivers. <S> Resonators have their frequency as marking. <S> So probably a 10.7MHz resonator. <S> (Though in receivers crystals are more used than resonators, because they're more precise and more stable)
It's a ceramic resonator. It's a 10V 100uF 3-leaded tantalum capacitor from Kemet (T396 series -- see Kemet's website and TTI ).
Tinning wires that will be screwed in to a chocolate block/terminal strip This is subjective per say. But I am looking for other peoples experience. If I am going to screw eight wires into daughter relay board's terminal block, is there a benefit or advantage to tinning the copper end before? The environment that the units are to be installed is not near the coast and is not normally damp/wet. Rather dry and hot. <Q> You MUST NOT fully tin the copper wires to be inserted into a screw down terminal block - that your days may be long on the face of the land. <S> It is permissible to tin the tip to maintain the wire shape. <S> The minimum possible amount of copper should be tinned. <S> Any competent regulatory authority will have this requirement as a rule in their system (see below) <S> The reason for the prohibition is that when you fully tin a multistrand wire fully, the solder wicks between the strands of copper and forms a solid block, part of whose volume is metallic solder. <S> When you clamp the solder and copper bundle you tighten the screw or clamp against the solder block, and in time the solder metal "creeps" under the compressive forces and the join loses tension. <S> The wire can then either pull out or cause a high resistance connection with heating. <S> This is a genuine real-world issue and is covered by genuine real-world regulations in many countries. <A> If you want to do your installation a favor, use wire ferrules: <S> Image source: http://de.wikipedia.org/wiki/Aderendh%C3%BClse?uselang=de <S> Do not, ever, tin the wires. <S> The contact resistance will rise. <S> In the worst case, your contact will become hot and cause fire. <S> If you don't have wire ferrules at hand, just twist the stranded wire before putting it into the terminal block. <S> While not recommended because some strands might cause shorts to neighboring terminals, this will still be far better and reliable than a tinned wire. <A> The tinned whole will be soft and the screw will become loose in no time. <S> Instead crimp a ferrule on them. <S> Also for solid wire <S> I don't think tinning is needed. <S> Think about it: have you ever seen electrical wiring in a house where the 2.5mm\$^2\$ or 4mm\$^2\$ wires were tinned before fixing into the wiring cabinet? <S> Yet these connections are used in all kinds of environments and for tens of years. <A> According to https://www.ipc.org <S> If you go here: https://www.ipc.org/4.0_Knowledge/4.1_Standards/IPC-A-610E-redline-April-2010.pdf <S> On page 4-6 under section 4.1.4.2 Hardware Installation – Threaded Fasteners - Wires <S> Near the bottom which states "tinned wires" as a defect.
A tinned wire will slowly give way to the screw's pressure and eventually become loose. If they're stranded wires: don't tin them!
Using resistors at their rated power A standard 1% metal film plated-through hole (PTH) resistor is usually rated at 250 mW. Under which conditions can it handle that power? Are special mounting precautions needed, or will mounting flat on a PCB, with 0.5 mm traces do? <Q> You may encounter the term 'derating' in this situation. <S> For example, a 250mW resistor built into a design so as to dissiplate 200mW is derated by 50mW. <S> You typically leave at least a little margin because a resistor's actual resistance may depart from its stated value when it becomes too hot, and it will generally become appreciably heated if you operate it at its specified maximum power rating. <S> The amount of derating required in a design has everything to do with the physical arrangement of the circuit; its enclosure, whether there is air flow (or some other coolant), how close together the components are, and of course, the expected power dissipation of all the other parts of the circuit, too. <S> This is commonly called a 'thermal analysis'. <A> The real answer is in the datasheet, of course, but generally the power rating of such a resistor is for still air at some specified temperature, usually 25°C. <S> You can use the resistor at its rated power only if you can guarantee the conditions. <S> For example, if this is a open board in a office situation, then that's probably doable. <S> If the box has a fan and it will be used in a office environment, then you probably can. <S> If the circuit has to work outdoors without any active cooling, then you can't guarantee the 25°C spec. <S> In that case, you have to look in the datasheet again and see how much you have to derate the power spec. <S> The datasheet should give a derating curve or equation, like derate by 2 mW per degree C for example. <S> Let's say this unit has to work just about anywhere outdoors, so figure air temperatures up to 125°F are possible, which comes out to 52°C. <S> Now add whatever the temperature rise is in the box compared to outside due to dissipation. <S> Let's say that's another 10°C, so now the resistor can see up to 62°C. <S> Add some more for possibly sitting in the sun <S> , so maybe we'll call it 75°C. <S> So now you've got 75°C - 25 <S> °C = <S> 50 <S> °C rise above the full power spec level. <S> At 2 mW per °C, that means you have to derate the resistor's power capability by 100 mW. <S> So in this example (I just made up these numbers, see datasheet for the real values) <S> a "1/4 Watt" resistor can only be used at 150 mW. <A> A resistor will reach a thermal equilibrium when the dissipated energy equals the energy drained to the environment. <S> To drain heat to the environment the resistor's temperature has to be higher than the environment's; the higher the temperature difference the more heat will flow. <S> So the resistor can dissipate more power at low environment temperatures. <S> Rated power may be specified at 25°C and derate at higher temperatures. <S> These thick film chip resistors derate only from 70°C, as the following graph shows: <S> So a 100mW 0603 can still dissipate these 100mW at 70°C, but shouldn't dissipate more than 50mW at 100°C environment temperature. <S> The datasheet doesn't give suggestions towards copper layout (land patterns and trace widths) which will influence conducted heat. <S> (Convection will be low for SMDs, and radiation almost zero; the temperature is too low for that.) <S> It may be tempting to have lots of copper connecting to a pad, but make sure that this doesn't cause trouble in soldering. <A> On top of all he good answers, when you come up with an acceptable power value, derate it some more if you care about lifetime. <S> Dissipation values for SMD components will often have one or more related notes. <S> These may say eg 1. <S> "free air" / 2. <S> mounted on a double sided FR4 PCB with at least 4 square centimetres of copper / 3. <S> when cooled by Boulder dam outflow in mid winter, or similar. <S> Heat sinking into 0.5mm copper traces and flat on the PCB is probably close to worst case for cooling. <S> Derating to a fraction of the calculated value after other factors are considered "is probably wise". <S> Running any component thermally "on the edge" is liable to make its days less long on the face of the land. <S> Usually running at 50% of max allowed value in a given situation is not a major problem. <S> If you need to run at maximum dissipation, ask yourself how sure you are that this really IS the maximum maximum it will ever see.
If its in a small closed box or there are other things dissipating significant power in the same box then you probably can't meet the 25°C spec.
W/L Ratio of a MOSFET In the schematic builder that calculates voltages/currents/transient analysis that we have been provided for the electrical engineering course, MOSFETs have the parameter "W/L Ratio". I figured that it was probably Width:Length, but how does that affect the constant K, and the voltage threshold? I realise that there is not enough information for absolute values, but really I'm looking for a formula that relates the variables. So my question is, what is the relationship between W/L, K, and the threshold voltage of the MOSFET? <Q> \$K_n\$ <S> is given by: $$K_n = \frac{k_n'}{2}\cdot\frac{W}{L}$$ <S> Where <S> $$k_n' = \mu_nC_{ox}$$ <S> \$\mu_n\$ is the mobility of the electrons in the inversion layer and \$C_{ox}\$ is the oxide capacitance per unit area. <S> According to Neamen the \$k_n'\$ parameter is called the "process conduction parameter" and is considered to be a constant for a fabrication technology. <S> Therefore the ratio \$\frac{W}{L}\$ is the transistor design variable. <S> Neamen goes on to say that the design variable is used to design MOSFETS to produce specific current-voltage characteristics in MOSFET circuits. <S> EDIT: <S> Yes w refers to width and L to length. <S> It relates to the geometry of the semiconductor. <A> Just a few additions to Konsalik's answer: \$V_T\$ (threshold voltage) is not affected by the W/L ratio of the transistor, as it depends on other parameters, such as the gate insulator thickness and dielectric constant; it also depends on Source-Bulk voltage, in what is called Body effect: $$ V_{TB} <S> = V_{T_0} <S> + \gamma (\sqrt{V_{SB} + 2 \phi_{B} - \sqrt{2\phi_{B}}}) $$ <S> Just as note: usually in integrated circuits, L is limited by the technology (as small as possible) and the conductivity is increased with bigger W; in this way, though, also the gate capacitance is increased, so often it doesn't bring any advantage. <A> I performed an experiment to explore the relationship between threshold voltage and W and L separately but not the ratio of them. <S> And the result is as shown below <S> I suppose maybe threshold voltage is related to W or L separately <S> but it is a constant when W and L increase as a constant ratio. <S> Hope this may be useful.
The K constant you refer to (more specifically \$K_n\$) is called the conduction parameter of the n-channel device.
What PCB electromagnetic simulation tools are available? I would like to perform electromagnetic simulation and analysis of simple PCBs (coupling, capacitance, impedance, EMI, etc.) Are there any reasonably priced (sub £1000), or free packages available which will do this? <Q> crunchyard.com offers cloud-based renting of CPU time which includes, as an option, Feko. <S> You pay for VM/hour and the prices are quite reasonable. <S> There's also a free Lite version that you can use without time restrictions (you just need to ask for a license) but it has stringent limitations to simulation complexity. <S> One thing you could do is use the Lite version to create/edit your model and then rent time at Crunchyard to run the simulation. <S> The Trial and Lite versions include good instructional videos for the basics of using Feko. <S> But, as Kortuk said, it's laborious to recreate the PCB in it. <S> One alternative you have is to import other CAD formats like DXF, provided your PCB design software supports it. <S> But you're obviously importing just the geometry, not the EM profile of the traces. <S> Those AFAIK you'll have to setup by hand. <S> By reading Feko manual it appears that when importing Parasolid files it'll recognize special attributes of the objects that may contain EM characteristics, but I never tried it. <S> You'd need a PCB software that can export that format and also be able to read those characteristics from somewhere (the schematics perhaps). <S> This is the simulation result for a simple PCB rectangular surface area. <A> If you Google "microstrip coupling calculator" and "microstrip impedance calculator" you may find a couple of tools for the passive calcs. <S> EMI is another matter. <S> To determine the far field strength at 300 MHz from your board, what 300 MHz drive voltages and currents would you use in the simulation to represent to output from the 30 MHz processor on the board? <S> Or whatever frequencies and harmonics are applicable for your board? <S> Because it is so difficult to come up with believable values for driving voltages and currents, often one uses: an existing body of design knowledge, best design practices, design iteration, and testing. <S> This may be why folks are reluctant to develop a software simulator. <A> There is an emerging open-source candidate as well, which works in conjunction with Matlab or Octave. <S> http://openems.de/start/index.php <S> This can import a Hyperlinx data file, such as can be exported from Eagle and many other PCB layout tools. <S> I've inquired about support from KiCad, but at the time they did not yet output Hyperlynx format. <S> It's been several months, so may be time to check on that again. <A> Sonnet Lite is a free but stripped-down version of their profi tools; for a comparison see this . <S> The main limitations of the free Lite version are: max two metalization levels maximum of three dielectric layers available maximum of 4 ports only one parameter in a parameter sweep 32 Megabyte memory limit (if you register, otherwise just 1MB) <S> Can still do PCB trace crosstalk analysis, in theory, though. <S> It does not expire (unlike the one in the accepted answer). <S> Alas the aforementioned limitations are pretty crippling. <S> You can't run basically any of their included examples. <S> For a 0402 resistor model you get this: And even for simpler stuff the memory limitation is pretty crippling, e.g. the following wideband filter can't be simulated in Lite because of that:
You can download a free trial of Feko at their website which is unrestricted for 45 days (requires a login registration).
Instrumentation Amplifier - how to use it correctly I am trying to perform some measurements based on a special technique used to detect corrosion in rebars of concrete bloc. The idea is to measure the potential difference between an electrode and the rebar: I tried it with a conventional voltmeter. It worked just fine. The potential difference lies between 0V and 1V. Now, I want to do it with a micro controller. My idea was then to connect the two inputs (electrode and rebar potential) to the input of an instrumentation amplifier and then to read the output with an ADC input of the micro controller. To do so, I used the INA118. I left the Rg input unconnected to have a unity gain. V+ = 5VV- = GND (therefore "single supply operation")Vo = ADC input (with 100nF capacitor to GND)Ref = GND I also connected two resistors of 1MOhm between Vin-,+ and GND. Now the problem is that I have nothing on the output of the INA118. More precisely I have 30mV always; even when I short-circuit Vin+ and Vin-. What is wrong with my circuit? Should I add an offset voltage to the inputs of the INA118?I have read that:"With single supply operation, V+ and V– must be both0.98V above ground for linear operation. " Or is it that the input bias current is too low? Thank you Image of the circuit: <Q> Input voltage range issue. <S> With 0 & +5 supplies, the input range is only 1 to 4 volts. <S> Your inputs are below the range where this amp will work. <S> Check "linear input range" on datasheet. <S> One fix is to get negative voltage on V-. <S> Another is to bias one end of the voltage measurement. <S> Eg, bias the low side to 1.5 V and leave the high side unbiased/high impedance. <A> As has already been mentioned, your circuit doesn't work because you violated the amplifier's common mode range. <S> This is yet another example where reading the datasheet carefully would have avoided a obvious mistake. <S> However, you can easily bias the amp you have near the middle of its range like so: <S> R1 and R2 form a voltage divider to make 1/2 the supply voltage. <S> C1 attenuates nasty frequencies that might be on the supply that are high enough so that the amp's active circuitry can't eliminate the noise as common mode signal. <S> R4 and R3 apply this 1/2 supply bias voltage to each of the inputs. <A> Resistance of concrete (if dry) might be quite high, up to GOhm and unstable (depend on humidity <S> -can change 3 orders of magnitude! <S> area of your electrode <S> , force applied to it,..). <S> So 1MOhm input resistance can simply shorten the voltage You want to measure. <S> I would use FET input Instrumentation Amplifier. <S> Or use High Input impedance voltmeter with computer interface.added: I have checked: the meter for concrete I have found in internet had 100MOhm input resistance, 2MOhm upper range and sponge type electrodes for good contact. <S> May be <S> problem is in contact resistance between electrode and concrete?.
A simple fix is to get a amp with common mode range that extends to ground.
Transistor to drive an ignition coil I want to drive a 6-volt ignition coil with a DC resistance of 3 ohms, from a power supply of 6.2 volts DC at 2 amps. I propose to use a 555 timer as the PWM, with a 50% duty cycle at about 5 to 10 kHz, with a totem pole amplifier. I don't need full power output from the ignition coil. What would be a good power transistor for the output? (I would like to use a MOSFET, but don't have a grounded working mat or wrist strap.) <Q> Olin is right about the BJT. <S> Your requirements are not that high, however. <S> 2A at 50% duty cycle is 1A average, a 200mV saturation voltage will cause only 200mW dissipation. <S> Also, while there are logic MOSFETs that are specified at a few volts \$V_{GS}\$ they usually can only deliver a few hundred mA at that voltage. <S> Most of the time they'll need 10V or higher to get > 1A drain current. <S> A quick search for low saturation voltage transistors gets us a the OnSemi NSS40301 , which has a maximum collector current of 3A continuous. <S> The graph shows that \$V_{CE(SAT)}\$ at \$I_C\$ = <S> 2A is less than 200mV, so average power dissipation is less than 200mW, far less than the 2W maximum rating. <S> \$H_{FE}\$ is minimum 200, then you'll need at least 10mA base current. <A> Even though the input voltage is only 6.2 V, there will be some kickback on the input side of the coil. <S> The transistor needs to be able to handle significantly more than 6.2 V. <S> A 60 V transistor is probably a good choice, especially if you clamp the input to a bit less than the transistor can handle. <S> You haven't given a reason for using a MOSFET other than you'd like to, which is no reason at all. <S> A bipolar NPN will be easier to drive from this low voltage. <S> There are plenty of medium power NPN transistors with respectable gain out there. <S> At a gain of 40, for example, you need 50 mA base current. <A> Design Rule #1 Thou shalt not tell how to design a solution unless you define exactly what output you need. <S> "don't need full power output from the ignition coil" Design Rule <S> #2 Always specify inputs and outputs fully before suggesting any implementation. <S> We do need a full description of the output spec. <S> I gather you want some sort variable spark generator. <S> Did you know an ignition coil has a turns ratio around 1k and you can drive it with a pulse switch with clamp diode to \$V+\$? <S> Think \$Vout= L <S> \cfrac{di}{dt}\$ <S> and this is an autotransformer. <A> You don't need wrist strap and the like to solder mosfets You can just connect together all the mosfet terminals by wrapping aluminium foil around them, if you are worried about ESD. <S> Grab it by the tab first. <S> Also, the power mosfets have huge gate capacitance so you're unlikely to fry them easily. <S> The bigger issue is the gate voltage - you will need 10 volts for that. <S> You can make voltage doubler pretty easily though.
For power switching a power MOSFET is often chosen because of it's low \$R_{DS(ON)}\$, therefore it's low voltage drop, therefore it's low dissipation.
How do I fix an Omron d2fc-f-7n microswitch from unwanted clicks? Omron d2fc-f-7n microswitches are used in computer mice all around, and they eventually start clicking several times per hit. AFAIK there is a flexible metal plate that wears out due to metal fatigue, so there must be a way to prolong its life. The obvious solution is to remove the malfunctioning microswitch and replace with a spare, but where I live they aren't available at all. <Q> Delivery costs many times more than the items themselves <S> Even from eBay? <S> Whereabouts do you live? <S> One way you can get spares is to smash open another mouse that's broken for some other reason. <S> Perhaps a friend has a broken one? <S> It may be possible to repair them. <S> Those little switches have a snap fit cover, and can be opened up. <S> carefully pull on the catch with a fine blade, and remove the cover. <S> At this point, plug in the mouse and test the switch. <S> gently push on the metal spring on the switch, and see if the problem still happens. <S> If not, try to push on it in such a way that the problem happens. <S> After you have attempted to fix the switch, you will be able to test it again without re-assembling the whole mouse. <S> Unplug the mouse now. <S> The switches come in a variety of different designs, but they are fairly similar. <S> There's a bistable metal spring which normally serves to ensure the contacts move rapidly and decisively. <S> Either it's this spring which isn't pulling as hard, or the contacts are dirty. <S> Let's start with the spring itself: You need to flatten it slightly. <S> Place it on a table, and squash it slightly with your finger. <S> Not too much. <S> Better to err on the side of caution. <S> Then put the spring back in the switch. <S> Test it again now. <S> If it still bounces, then you might need to flatten the spring a little more. <S> If this doesn't work, then try cleaning the contacts. <S> Tear off a thin (5mm wide) strip of J-Cloth or similar. <S> Apply a little abrasive cleaner (like CIF) to it. <S> Thread it through the switch and pull it back and forth to rub away any dirt from the contacts. <S> Tear off another strip, and soak it in methylated spirits (or pure alcohol). <S> Use this to clean off the abrasive cleaner. <S> Test the switch again. <S> If it still doesn't work, then get a new switch. <A> OP here. <S> It was time to fix my mouse again, and this time around I didn't have enough unused switches left (last time I used sensor sensitivity buttons as donors) in the mouse to replace the bad ones. <S> This time I solved it by buying the cheapest mouse (~5 bucks) and taking switches from there. <S> No waiting for delivery, the switches are identical except for the color, and very cheap in face of alternatives. <S> Not exactly fixing the old ones, but an even better, frugal solution. <S> And the switches are brand new. <A> You also might use the designated "Electrical Contacts Cleaner", if just spray on the switch. <S> Those avoid the dismantles. <S> Youtube has a video: Logitech MX Revolution mouse repair <A> Say 100nF or so. <A> I just exchanged the right and left switch and no more problem. <S> The right click doesn't care about double clicks.
A small capacitor across the switch may do the trick. You might find it easier to remove the spring from the switch first.
Why is the Anode positive if Anions are negative...? When I was younger I learned in Chemistry class that Anions were negatively charged and Cations were positively charged ( Fun fact: I memorized this because anion sounds like onion which makes you cry and is therefore negative; while cation has cat in it and cats are cute, so it's positive :P ). Now that I've started getting into electronics, I've learned that the Anode is the positive lead while the Cathode is the negative one. It seems odd to me that they're reversed; can someone explain why this is? <Q> From Wiki : Faraday also introduced the words anion for a negatively charged ion, and cation for a positively charged one. <S> In Faraday's nomenclature, cations were named because they were attracted to the cathode in a galvanic device and anions were named due to their attraction to the anode. <S> In the diode , and specifically in the so-called depletion region , there is diffusion of carriers (electrons and holes) from one region to the other. <A> The anode is not always the positive lead. <S> It is the electrode through which electric current flows into a polarized electrical device. <S> For a discharging battery, this is the negative lead. <S> This is how I connected anode/anion and cathode/cation during chemistry class when we were discussing batteries. <S> I was confused when I learned that for other components, such as an LED, the kathode is negative, and the anode is positive. <S> Until I learned that it's not about polarity but about the direction of current flow (anode = in, cathode = out), and the naming of ions is based on how they move in a discharging battery, probably because that's what chemists often deal with. <A> IIRC anions are the ions that are attracted to the anode in an electrolytic cell. <S> Opposite charges attract, hence the charge of an anion is opposite of that of an anode. <S> An electrolytic cell (not to be confused with a galvanic cell!) <S> decomposes chemical compounds by means of electrical energy, in a process called electrolysis [ http://en.wikipedia.org/wiki/Electrolytic_cell ] <A> The anode have negative chare because it don't do workers without the cathode , so cathode have positive charge due to its efficiency of giving - es <A> As the anode have negative charge because it takes the m - es from cathode i-e positive charge because influence of the nucleus to the around revolving es is more as well as less in rare cases <S> so it hold the es permanently in this way <S> the consumer is <S> cation and saver is anion sion work done is taken by cation <S> therefore it is positive and opposite to this <S> is for cation because it alone do nothing
Since the Anode is positively doped, it will attract electrons from the cathode , and this will cause the formation of Anions in its side of the depletion region.
Why are these switches connected to ground? Sorry for the vague title. This is a schematic of a Nerf Rayven foam dart gun: Why did they make the connections that I circled in red? I'm guessing it has something to do with the inductors on the left side of the motors, but what exactly is it doing? <Q> This is clearly for safety reasons. <S> The idea behind this is to stop the mechanics of the gun as quickly as possible by shorting the motors when the door on top is opened or the ammo clip is removed. <S> Putting your finger into one of these locations could cause injuries when the flywheels used to accelerate the foam bullets are still rotating due to inertia. <A> Why not? / <S> safety / braking. <S> This is unlikely to be an intended effect but exists. <S> If the motor is grounded when not used there is minimum chance of a fault elsewhere allowing the motor to operate. <S> If a contact is floating it has the potential to be shorted to something which can cause a problem. <S> If grounded then such a short would cause the PTC to overheat and no action to occur. <S> In practice, it probably makes extremely little difference in most cases. <S> In the cases where it does make a difference, the difference is a positive one from a safety point of view. <A> I don't know what a Nerf Rayven foam dart gun is, but connecting the bottom of the switches to ground instead of leaving them open actively shorts the motor in some of the cases instead of leaving it disconnected. <S> That would provide a little viscous breaking. <S> Whether that is intentional and/or useful <S> I don't know without a description of what the device is supposed to do and how it works.
With motors grounded there will be substantial drag if the motor shafts are turned, due to their acting like shorted alternators.
Designing a Power supply unit I know this might be a little bit funny question. But how can you determine the current that will used up as well as the power rating, when you a designing a power supply unit for a device. Because usually, I will always know the voltage, say 5V, but how can I calculate the current the device will use up. Thanks. <Q> What current will be used is determined by the load, not the power supply. <S> We've had a number of questions like this before, like "how do I limit the current of my 5A supply to 1A". <S> What your device will need is just the addition of the current for the different components on the board. <S> You usually start with the power-hungry parts: motors, relays. <S> If you have a lab supply which displays current you may use that as a rule-of-thumb, but you may want to give it some headroom. <S> Used current is definitely useful if you want to design a power supply. <A> At a very simplistic level, if you know the voltage, and you know the resistance of your device, you will know the current needed: I=V/R <S> Alternatively, if you know what the power requirements are, again you can calculate: <S> I= <S> P/V <S> Your power supply needs to be able to deliver the required voltage at the greatest current your device may draw (usually plus a safety headroom factor) <A> The first thing to do is to check the datasheets of the main components, depending on the kind of circuit <S> : if you have motors, speakers, power LEDs, hungry microcontrollers...Sum up the power consumed by the hungriest components first, and then check what else remains. <S> You can also use a benchtop supply and measure the maximum consumption of the circuit, but take care of checking the maximum load and then don't trust it too much if it's lower than expected (looking at the datasheets). <S> Some margin is not only needed for safety, but also because if the supply works always at 100% capacity it will suffer from heat. <S> Oversize it a bit will result in it being cooler and work better. <S> As always, you have a tradeoff between having enough headroom versus smaller price/size/weight.
As Steven said, to design a proper power supply you have to know the maximum current consumption of your circuit and then add some headroom (depending also on how accurate the prediction is). For a microcontroller you'll have to look up in the datasheet what it needs at a given clock frequency.
Compare resistance to a setpoint and trigger a relay I want to compare a PTC thermistor to a set point, and trigger a relay if the temperature goes below a set temperature. In particular, my temperature to turn on the relay should be 33 degrees F (845 ohms) and turn off at 36 degrees F (860 ohms). I could easily do this with a microcontroller, but this seems like just too simple of a project to waste one on. How can I accomplish this with basic electronic components? <Q> It's pretty easy with a comparator. <S> As the resistance of the thermistor goes down, it increases the voltage of the comparator's positive input (pin 3). <S> When this input goes higher than the negative input (pin 2) the output will go high. <S> To set the threshold, you simply adjust the potentiometer. <S> The output of the comparator probably won't be able to drive a relay (check the current requirement of the relay, and the output drive of the comparator). <S> So I have added a transistor which switches current to the relay. <S> Relays are inductive loads which will produce a negative voltage spike when they switch off. <S> The diode will absorb this spike. <S> Hysteresis <S> : Make sure that the comparator you choose has some built in hysteresis. <S> E.G. <S> LTC6702 or <S> MAX9021 . <S> Alternatively, add a resistor (R5) to force some hysteresis. <S> Added: <S> You have now specified the exact on/off temperatures. <S> These give voltages of 2.710v and 2.688v. <S> Which is a hysteresis of 22mv. <S> If my calculations are correct (probably not) then I think you need to use 100k for R5. <S> Added 2: <S> How to calculate R5 First, using the formula for parallel resistors, we calculate the effective resistance of RT1 and R2 as about 460 ohms. <S> Next, we use consider a potential divider formed by R5 on top and (RT1 & R2) at the bottom. <S> For ease of calculation, assume that we have 2.5v at the bottom (generated by RT1 and R2). <S> Now, the question is, what value of R5 do we need if we want V to change by 0.022v. <S> I.E. <S> +-0.011v. <S> Using the 0v case, because it's simpler: 2.489v <S> = <S> (R5 / (R5+460)) <S> * 2.5v R5 = 460 / <S> (2.5/2.489 - 1) = <S> 104085 <S> So, about 100k. <A> While I agree with Rocketmagnet 's schematic (though I would decrease R4 to 1k\$\Omega\$) <S> I can't agree with his calculation of resistor values. <S> Copy of the schematic: Rocketmagnet calculates for two different voltages on pin 3 of the comparator, which should represent the hysteresis. <S> However, at both toggle points this voltage is the same, namely the voltage set on the inverting input using the potmeter. <S> edit <S> The confusion stems from the fact that the hysteresis feedback is added to the signal, rather than the reference voltage, which you would normally do. <S> The consequence is that despite the hysteresis we only have one reference voltage: the voltage at the potmeter's wiper. <S> A more common way to solve this would be to connect the potmeter with R5 to the non-inverting input and the signal to the inverting input. <S> But we'll see that this works too. <S> Let's suppose the potmeter is set to 2.5V (could have been done with two resistors), and that the comparator's output swings between 0V and +5V (\$V_{CC}\$). <S> The comparator should have a push-pull output. <S> The comparator's output should go high when the NTC's resistance is 845\$\Omega\$. Until that moment the output is low, so that \$ R5||R2 = 845\Omega\$ to let the non-inverting input pass the 2.5V toggle point. <S> Likewise, the comparator's output should go low when the NTC's resistance reaches 860\$\Omega\$. Until that moment the output is high, so that \$ R2 = <S> 860\Omega||R5 \$ <S> So we have the following set of simultaneous equations: \$ \begin{cases <S> } \dfrac{R5 \times R2}{R5 + R2} = <S> 845\Omega \\ \dfrac{860\Omega <S> \times <S> R5}{860\Omega <S> + R5} = <S> R2 \end{cases} \$ <S> which gives us \$ \begin{cases} R2 = <S> 852\Omega <S> \\ R5 = 96.89k\Omega \end{cases} \$ <A> By your description, you're using an NTC thermistor. <S> (This matters for the hysteresis.) <S> This circuit has a normally-low output. <S> When the threshold is reached, the comparator changes state and the output goes high. <S> The inverting input has the NTC and a pull-up resistor. <S> As the NTC heats up, its resistance drops and the voltage on on the pin will decrease. <S> The non-inverting input has a divider acting as a voltage reference, plus an extra resistor going to the output which provides hysteresis.
An easy way to do this is with a comparator like an LM393 and some sort of a voltage reference.
Wifly or Xbees for wireless Arduino I am controlling Arduino from my phone through Processor program which sends commands to Arduino via USB cable. Now i need to put Arduino lets say 10 meters away from the PC. I still didn't get the difference between Xbees and Wifly. I am trying to establish a simple wireless serial communication between PC and Arduino. Is a Wifly shiled enough to achieve that? Or pair of Xbees? Which is easy to establish communication? Thanks, By the way i want to mention that i don't have access to the router. I just share Wifi in an apartment but the router does not belong to me and i can not access that. <Q> Xbee shields easily act as cable extenders, you can have them both setup to communicate with eachother and just send simple RS-232 data over them. <S> With a WiFly you are instead going to need to have the wifly act as a server or client in an exchange over TCP/IP. <S> If you have no way for the WiFly to connect to a router I think the options are limited here, you really cant use the WiFly at all. <S> They are very different devices and this is almost apples and oranges. <A> Since you're communicating with a PC, consider bluetooth. <S> You can get bluetooth shields , or even Arduino clones with onboard bluetooth . <S> Either one appears to the Arduino as a simple serial port. <S> Since you can use a standard bluetooth dongle on the PC end (or built in bluetooth, if your PC has it), this is likely to be cheaper than an XBee based solution. <S> Range, however, may be a concern - 10 meters is at the edge of the range you can reliably achieve with Bluetooth. <A> If you need to connect over wifi, you cannot use a standard xbee - XBee/ZigBee use a separate networking protocol, not compatible with 802.11(b/g/n). <S> There are a number of wifi shields for arduino, such as Sparkfun's wifly shield . <S> This module definitely supports adhoc networks - see page 44 of the reference guide (pdf) for details. <S> There are other options, including other arduino shields , the blackwidow , which is an arduino clone with built in wifi, or the rn-xv wifly module , which is pin compatible with an xbee but speaks wifi. <S> All appear to support adhoc mode. <S> Unless you have a compelling reason, I would go for the Sparkfun wifly shield. <S> Of all the solutions, you're least likely to have issues sourcing more of them, and they even publish their schematics, so you could make your own if you had to. <S> Whichever solution you use, the procedure on the Arduino end will be much the same. <S> The module includes a basic TCP/IP stack, so the Arduino doesn't have to implement its own stack. <S> You speak AT commands to the shield (like a modem), including telling it to open or accept connections. <S> In connection mode, you can treat the TCP socket like a serial connection. <A> Something else to consider is power. <S> XBee can be configured to use very little power. <S> This can be a huge issue in mobile applications. <S> While the Wifly solution can provide the remote / internet connectivity, you should be careful about the power cost.
I would suggest the XBee for their simplicity, but WiFly will allow you to go to a completely different location and use the internet as part of your range extender.
What would a professional use to switch sprinkler solenoids? As evidenced by several previous questions of mine, I'm working a project to design a sprinkler controller. This involves driving one of 16 solenoids (well, probably only one at a time...) based on a schedule. I have the microcontroller sorted out, and the software is just about finished up. As reference, the solenoids I'm driving are generally between 300mA and 500mA inrush current, and 200mA and 400mA holding current. They're driven at 24VAC. My initial hardware design involved a set of SSRs, of this Sharp variety . They're non-zero-crossing type optoisolated triac-output SSRs. I've tested the solenoids with these, and they seem to work well. The datasheet shows a protection diode (which is probably overkill) and a snubber circuit (to be used especially when driving inductive loads), but I gleefully ignored that advice, and I haven't seen any ill effects yet. Because I'm curious, I took a peek inside a couple of commercial controllers. Inside, I saw nothing that looked to me like my SSRs. One of them had what seemed to be a set of TO-220 size triacs. I couldn't see what other componentry surrounded the triacs. My question is, what would a professional use to drive these solenoids? Are the SSRs overkill in this application? Would it be simpler and cheaper to just use logic-level triacs directly? Is my lack of a snubber circuit going to come back and bite me eventually by destroying the SSR, the solenoid, the MCU, or my entire neighborhood in a flaming fireball of death? Note To all those suggesting DC solenoids, please don't. Commercial sprinkler systems use AC solenoids. That's just the way it is. I will not be using DC solenoids, because Home Depot, Lowes, and others don't sell DC sprinkler valves. Such a thing (to my knowledge) doesn't exist, at least not in markets where the average home user would be. To be absolutely clear I'm not asking for a list of possible ways to drive solenoids. I can imagine a lot, and there are lots more available out there. I'm asking how this sort of thing is done professionaly, i.e. how it's done when designing for cost, robustness, and mass-producability. <Q> Several comments: If you don't need isolation, then (obviously) you don't need any device that includes isolation, such as a SSR. <S> If you do need isolation, you probably don't need it for each channel. <S> A single isolation gap, for all 16 channels, should be enough. <S> All this could save you money. <S> Snubbers don't protect the switches (the SSRs, in your case). <S> They just reduce the probability of false triggering. <S> False triggering is not a harm for your switches (they are there to be triggered, even continuosly). <S> The false firings are an inconvenience (or an obstacle), if your application is such that the load should never be powered when you don't want it <S> to (e.g., you have an electric saw, there's been an accident, and you need to switch it off right away). <S> Since the 24 V are AC, if you use unidirectional switches (such as MOSFETs, or BJTs), you will need two switches per channel. <S> EDIT: <S> a MOSFET is unidirectional, because it conducts in both directions, but it blocks in only one direction. <S> For instance, a normal silicon NMOSFET cannot block current from S to D, due to the parasitic diode it has. <S> Since that diode is there, if you want to use MOSFETs for AC, you CAN, but you need to put two in anti-series (with their sources tied together, and their gates tied together), or otherwise you won't be able to block in one of the two directions. <S> GaAs MOSFETs don't have that parasitic diode, so one device would be enough, for AC. <S> A cheap TRIAC like this one would work. <A> Most door bells use 24Vac xfmr's, but the solenoids cost a bit more on AC vs dc not much, so I concur with David to use Mosfet switch for low power loss with bridge. <S> I see huge variety of SSR's now since 20 yrs ago, for less than a buck. <S> No reason to use discrete switches and better for reliability in case of failure on driver to protect microcontroller. <S> Pick one here http://search.digikey.com/us/en/cat/relays/solid-state/1048664/page/2?k=solid%20ssr&quantity=100&ColumnSort=1000011 and use suggested noise snubber. <S> I dont know your load current. <S> For example PR39MF21NSZF RELAY SSR 240VAC .9A <S> ZC 8-DIP <S> $0.88 @1k <S> Several AC ratings PR2xx,PR3xx also Zero crossing avail PR29MF1xNSZ Series $0.75@1k <S> Sharp make the best opto isolators in my mind on several specs. <S> Heed warning on app. <S> note snubbers. <S> And that's my final answer. <S> You know if you push the envelope, you are still stationary!.. <S> If this answer seems perfect then score accordingly, otherwise if just an "also ran", ignore it. <A> Use an MOC3010 triac output optocoupler. <S> Easily driven directly off a microcontroller and provides isolation. <S> This can either directly drive a solenoid or it can drive a bigger triac to drive a solenoid. <S> Look at the specs to see what you need to do. <S> Easy, cheap. <S> My final answer. <A> I've driven sprinkler valves before. <S> I'd just use a MOSFET. <S> Make sure you use some protection diodes and maybe a self-resetting fuse to prevent damage due to bad things (ESD, shorts, close but not direct lightning strikes, etc.). <A> I would prefer 24V DC solenoids, lower cost and power. <S> I concur with ULN2803 driver. <S> Although the latching solenoids use less power, that's your choice if you have backup battery or not. <S> Your AM radio might pick up the switch noise from a long cable, you could add a Cap to reduce induced E fields. <S> Preferred for MOSFET, but not necessary for Bipolar driver. <S> But that is optional, even if most people are sleeping when the sprinklers go on and your alarm sensors shouldn't pick it up switching noise and nor pulses from near lightning strikes. <S> EMI testers won't notice these non repetitive events on their scanners. <S> A PTC current limiter is a good idea too. <S> These are not expensive. <S> (self-resetting fuse or polyfuse). <S> I concur with David. <S> Otherwise if using AC solenoids use SCR's, try to use 60/50Hz gated pulses from controller to make them zero crossing switch functions. <S> Some guys use relays. <A> I know this is ancient, but... <S> Company I worked for used transformers to keep Halogen bulbs illuminated in a vision system. <S> Transformers melt down if turned on at the wrong part of the AC cycle. <S> My solution was to use an H Bridge with a DC supply. <S> As an ex Nuclear Submarine engineer I worked with pointed out, if the signal is PWM, there is no heat loss.
I would go for a cheap TRIAC per channel (probably, without any snubber, because 24 VAC is such a low voltage, that you probably won't hit any dV/dt limit). So use a bipolar hex driver with decoupling ceramic Cap on DC solenoid, clamp diode, and PTC polyfuse and LED indicator with optional Ferrite beads. SHARP Micromight be my choice if 500mA was not enough.
Did I Kill My Chip? I've got an ENC28J60 Ethernet Controller in a circuit I'm building. I was testing it out but when I got to the point of talking to it over SPI with my micro-controller I got utter silence back from the device. I got a 'scope out and sure enough, the the SCK and MOSI pins on the device are wiggling the way I expect them to while the /CS pin is driven low, but the MISO signal is flat-lined at GND (all measured at the pins of the ENC28J60). So I got to looking at the solder joints on the device more closely (using an SMD package). I saw that I had a subtle bridge between two of the pins: VCAP and VSS! So I went back to the soldering station and remedied the bridge and headed back to the 'scope. Still not working, but doing something different (progress!?). Now when the SCK signal fires away, the MISO signal does "react," just not as I'd expect. The signal has a "wiggling characteristic" that is correlated with SCK, but it's certainly not what a digital output should look like, and voltage levels go negative to about -100mV, and never exceed 0V. On to the question. What is the impact of having grounded VCAP? Is the chip fried? What is the explanation for the negative quasi-inverted quasi-digital output on the MISO line? Edit I measured (with a 'scope) every pin of the ENC28J60. Why would the crystal not be ringing? Anything else look out of the ordinary? +-------+----------+-------------------------------+| Pin # | Name |Measurement Result |+-------+----------+-------------------------------+| 1 | VCAP | 2.66VDC (760mv P-P @ 4.15MHz) | | 2 | VSS | GND || 3 | CLKOUT | GND | | 4 | /INT | 3.3V || 5 | NC | 3.3V | | 6 | SO | Noisy/Negative Digital Signal || 7 | SI | 0V/3.3V Digital MOSI Signal || 8 | SCK | 0V/3.3V Digital SCK Signal | | 9 | /CS | 0V/3.3V Chip Select Signal || 10 | /RESET | 3.3V | | 11 | VSSRX | GND || 12 | TPIN- | 1.08V (floating) | | 13 | TPIN+ | 1.08V (floating) || 14 | RBIAS | 1.28V || 15 | VDDTX | 3.3V | | 16 | TPOUT- | 3.3V || 17 | TPOUT+ | 3.3V | | 18 | VSSTX | GND || 19 | VDDRX | 3.3V | | 20 | VDDPLL | 3.3V || 21 | VSSPLL | GND || 22 | VSSOSC | GND | | 23 | OSC1 | GND (hm...) || 24 | OSC2 | GND (hm...) | | 25 | VDDOSC | 3.3v || 26 | LEDB | GND | | 27 | LEDA | GND || 28 | VDD | 3.3V |+-------+----------+-------------------------------+ <Q> VCAP is the 2.5V reference of the IC. <S> It's internally generated from the 3.3V supply. <S> There's a telling footnote under the "Absolute Maximum Ratings" table: <S> VCAP is not designed to supply an external load. <S> No external voltage should be applied to this pin. <S> The most important part of that is: "not designed to supply an external load". <S> Your short circuit was a significant external load. <S> If VCAP hasn't recovered after the external short was removed, replace the IC. <S> Even if VCAP is OK, if you can't get correct behaviour on MISO and you have any doubts, replace the IC. <A> Short answer : <S> Probably Yes Long answer: <S> Page 83 of spec says... <S> MAX! <S> VCAP with respect to VSS -0.6V to 3.0V <S> But you shorted Vcap to Vss..i.e. <S> shorted internal 2.5V reference on Vcap to ground. <S> Vss <S> so Check pin 2 for 2.5V. and go from there. <S> If ok then pin 3 CLK out... if ok then other pins. <S> Pushing the envelope or stationary running?ha. <S> Score as fit as you may be. <S> OSC1 is input and OSC2 is the inverted output. <S> If both pins are low (gnd) then the output is either shorted to ground or blown. <S> Normally high resistance feedback between pins internally will make input Vdd/2 and output must oscillate. <S> Is crystal connected? <S> if so which? <A> I am not sure. <S> This chip also has an oscillator, so if you can check that do that as well (if there is anything sine-wave like in the frequency of the crystal <S> it's OK). <S> I've experience with microchip parts working fine when VCAP was shorted or tied to 3.3V in a few initial test attempts. <S> This was, however, a PIC32 or PIC24.. <S> so if the microcontroller doesn't want to load a program you're checking voltages and ICD connections straight away and fix the issues. <S> Chapter 16.0 says that Vcap should stay between -0.3V and 2.75V in respect to VSS. <S> So, 0V in respect (that is VSS) is also included. <S> It doesn't say anything about the short circuit capability though. <S> If the Vcap still has got 2.5V, it's probably fine. <S> As long there is a decent 10uF capacitor on there it should work. <S> In that case the chip may still work. <S> The negative ground signal may be something to do with the measurement set-up. <S> Are you probing GND directly at your chip, or very externally? <S> This may cause voltage spikes or shifts. <S> If your Vcap is now way off <S> (I can imagine you have been running this for some time figuring what's going on), then I'd replace the chip.
You can have no response from chips at all when the SPI is not clocked in correctly.
LED Voltage Drop in Series Perhaps a Simple Question, but maybe Im misunderstanding "Voltage" drop in terms of LEDS. So I have a Circuit wired up with a 9V Battery, one 270ohm Resistor and 3 Blue LEDS (that draw around....20ma and 2.0v forward voltage. (this is for testing purposes, I would always put a resistor with each LED) I put in 1 Led and Read the Ground and Positive Leg of the LED. Multimeter says: 3.52 Vok..... 2 Leds (same LED): 3.35v 3 Leds : 3.20v It's hard to see on my super crude MS paint, but im labeling each LED with what the Voltage on the Multimeter reads when I measure that LED leg. Whats going on here? the LEDS get slightly dimmer (and I mean VERY slight).....but shouldn't the voltage difference after each one be alot more? Also the Entire System is drawing 30mA exactly (+/- .2-3 mA) regardless of How many LEDS I have on there(and im checking the mA after each additional LED leg to be sure). Clearly im missing something? Is this because the LEDS are in Series? I just kinda assume "Ok more LEDS = MORE mA drawn and voltage drops among each LED. And I know theirs a Similar question about LEDS in Series, but im more curious about WHY there is no voltage drop or mA change per LED in Series than if it's a good or bad idea (Im sure it's not a great idea to keep LED in series like that of course). <Q> You're getting the expected result. <S> What you see is the normal behavior of diodes in series and it's completely normal to have one resistor and a string of LEDs connected after it. <S> What's basically happening is this: When they told you that the forward voltage is 2 V, they lied. <S> It actually depends on the current going through the LED <S> and you can consider the 2 V some sort of nominal value, but the exact drop should be read in the datasheet (if it's available). <S> In general case when you want to connect diodes in series, you use this formula for resistor: $$ R= <S> \frac <S> {V_{supply}-NV_{f}}{I_{f}}$$where the N is number of diodes you have. <S> This way it turns into simple Ohm's law. <S> But in your case, you're approaching the border at which the above formula will not hold. <S> Take a look at this diagram from Wikipedia: Notice <S> the point marked \$ V_d\$. <S> For this diode, once the voltage at the diode terminals reaches that point, the current will start quickly increasing with only a small change in voltage. <S> That is why adding more LEDs doesn't immediately affect current. <S> The voltage is high enough that all LEDs will conduct. <S> Should you for example put 10 LEDs in series, the voltage will be too low and they will either show barely noticeable light levels or stay off. <S> Next, let's take a look at the different voltages you got at the LEDs. <S> Again take a look at the curve for the diode from the Wikipedia. <S> The \$V_d\$ point for each diode made is different and there are some tolerances here. <S> So some diodes of same model number will at same current have <S> a bit larger voltage drop and others will have a bit smaller voltage drop. <S> Next about LEDs in series. <S> There is nothing wrong with that, but you're still not doing it right. <S> Using the formula I provided, you should set the resistor so that the LEDs will be within their rated current. <S> If you fulfill that condition, there's absolutely nothing wrong with having multiple LEDs connected in series, should you have voltage to spare. <A> It's a little hard to tell from the photo, but it looks like you have the LEDs in parallel, rather than series. <S> This is the difference. <S> I'm sorry if I miss read your photo, and this is patronising. <S> Why did they work when connected in parallel? <S> Because the LEDs have some internal resistance, they will share current if connected in parallel. <S> However, because you are working close to the steep part of their voltage/current curve, any slight variation in them may cause one to draw noticeably more current than the others. <S> You can often get lucky and have 3 LEDs working in parallel. <S> But you can just as easily be unlucky. <S> And you may also find that, as the LEDs age, they do so differently, and that a year from now, one is brighter than the othes. <A> An LED is basically a diode (thus they have equivalent models in a circuit). <S> Current through an LED will not be affected very much, and the voltage drop across an LED is some constant number (in your case, around 0.15V). <S> I think you might be confusing an LED with a resistor, which has a variable voltage drop due to the circuit / current provided. <A> It seems you did not understand the equivalent circuit of a Light Emitting Diode, is a Diode . !! <S> and have an effective series resistance. <S> The diode voltage for Blue and white is ~ 3.2V <S> while red yellow <S> ~ <S> 1.6V. <S> The ESR depends on current and size but is around 20~40Ω for 5mm. <S> So use Ohm's Law to solve for current in each LED and assume they are matched from the same batch which are usually binned in 0.2V range. <S> If you want to run 3 in series on 9V battery, it may be not be enough, but 2LED is plenty in series and use 20mA for one & 40mA for two LEDs so your current limiting resistor needs to change and increase in power dissipation.. <S> ( Not reliable) consider Lithium coin cells <S> 3.2V work well on 3.2V BLue/white LEDs direct drive.or for 3 LEDs in parallel <S> use 3 R's in parallel for current limit. <S> or 2 for 2, 4 for 4 etc
You basically have a circuit with one branch only and the current going through that branch isn't going to much change with the number of LEDs if the voltage of the supply is high enough to be higher than LED forward voltage. You should connect the LEDs in series to work correctly.
How important is the shield on an RJ45 connector? If I am going to use a PCB mount RJ45 connector for 100mbps Ethernet, does it need to be a shielded connector, or can I get away with using an unshielded one? Is there some standard which deals with this, or is it just my responsibility to get the thing EMC tested. <Q> <A> There does not need to be a shield. <S> I think the reason there are shielded <S> RJ-45 jacks is so that you can make a reasonably tight chassis without a gap in it at the connector, but that is just speculation on my part. <S> The way to deal with ethernet EMI is to use the right transformer. <S> Good ones have a balun on the network side of the differential pairs. <S> Sometimes that's enough by itself, and sometimes you need to put small caps, like 22 pF, on each line to ground. <S> Note that the caps then limit the isolation voltage between the ethernet and your device. <S> That may not matter, but you need to think about it. <S> If necessary, use high voltage caps. <A> See my similar question over here: safe to use an unshielded jack for 10Mbps Ethernet? <S> I've had no problems running a 10MBps link with an unshielded jack, but I don't know if there's any EMI emission from it. <S> I'd definitely suggest using a shielded jack for 100/1Gbps just to be on the safe side. <S> Regarding EMC - if you're doing it for a personal project, probably don't worry about it. <S> If you want to sell it (at least in the US) you need to get FCC Part 15 tested; similar rules apply for the EU.
Standard ethernet cable has no shield, so even if the socket were shielded it wouldn't do much for the data on the cable. One advantage of using shielded jacks is that the soldered shield tabs provide a very mechanically robust anchor to the PCB, reducing the chance of damage if the cable gets yanked.
Use two ADC channels to increase resolution I need to capture the waveform of a low-amplitude signal that sits on top of a slow-varying, higher-amplitude component. I'm thinking of using an ADC with two channels, and feed one of them with a low-pass filtered version of the signal and the other one with an amplified, high-pass filtered version of the signal. That would increase the apparent resolution of my ADC. Am I wrong? Can you foresee any problems with this? I forgot to say I have to capture the low-frequency component as well (the algorithm needs the average value of the signal). The "high"-frequency component goes from 0.01 hertz to 10 hertz. The low-frequency component is mainly the average value of the signal, but it may change, slowly. The faster-changing component may have an amplitude 100 times smaller than the maximum average value. The microcontroller we will use has a 12-bit ADC (I cannot change that), but with many channels. <Q> This is a very good idea. <S> The BioTac tactile sensors from Syntouch do this very same thing. <S> They have a pressure sensor inside them which captures both the low frequency part of the signal at about 50 sps, and the high frequency components amplified and sampled at 2000 sps. <S> This works beautifully. <S> However, I don't know if you can actually combine these two signals to create a higher resolution, I.E. more bits. <S> You may be able to with some clever signal processing, but it wouldn't be trivial. <S> Another way to increase the ADC resolution is by oversampling . <S> If you take 16 12-bit samples (and assuming there's at least one LSB of noise) then you really have increased the effective resolution. <A> The DAC could even be a delta-sigma DAC. <S> I think this would give you better results than if you use an analog high pass filter, because the transfer function of raw input to 2nd channel would be more easily characterized if done digitally, vs. an unknown (and potentially-changing) transfer function for analog. <S> But it's hard to say w/o knowing the frequency content + other requirements. <A> This doesn't make a lot of sense. <S> Since you apparently only care about the high frequencies, why not simply present the high pass filtered signal to the A/D? <S> Nothing in your description explains why you want to look at the low freuqency signal. <S> Feeding that into a A/D isn't going to do anything useful. <S> If the two frequencies are close enough together so that separating them would be difficult in hardware, then could put the compsite signal into a A/D and filter digitally. <S> However, the A/D would have to have enough resolution for the small signal while having the range for the large slow signal and sample fast enough to properly respresent the fast signal. <S> This may not be possible. <S> We can maybe suggest something more concrete if you give particulars of the amplitude and frequency range of the two signals, and what resolution or signal to noise ratio you need to measure the fast signal with. <A> Use a couple of fixed gain bandpass filters tuned to match the centre frequency of each of the two component signals. <S> Feed each separated signal to its own ADC. <S> Voila... <S> Job done.
Perhaps you could feed in the raw waveform to 1 ADC channel, then use a DAC controlled by your microcontroller (or whatever is running your algorithm) to subtract off the low-frequency component, then amplify the residual signal to a 2nd ADC channel.
Cheap accelerometer in DIP package? I've been looking around to see if there's a relatively cheap (around £5) accelerometer / tilt sensor in a DIP package for prototyping. Breakout boards exist for the ADXL335 but seem to be comparatively expensive. Does such a device exist? <Q> Well I presume you want a DIP for rapid prototyping needs <S> and you can't work with SMDs, <S> So check out sparkfun's tutorial they have a very comprehensive list! <S> http://www.sparkfun.com/tutorials/167 (many are outdated though) <S> The cheapest one I could find is this : http://www.sparkfun.com/products/10955 <S> Pros: <S> Cheap and easy to use/interface. <S> Cons: its a binary output, acts like a switch. <A> I took a look at Sparkfun and Adafruit like Shungun, but SeeedStudio have a few more. <S> Their cheapest is a breakout for the ADXL335. <S> If you don't mind and are able, you could potentially use/find a surface mount accelerometer like the MMA1270EGR2 and solder to a breakout board like this one from Sparkfun or one from Scmartboard . <S> That method doesn't end up being much cheaper, but you might find you'll have a bit more flexibility choosing an accelerometer. <A> Consider these http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/28526-MMA7455-3axisAccel-v1.1.pdf $20 from Digikey (1x) I2C bus suitable for UAV stabilization or embedded solution. <S> If you want analog out... <S> those are avail too.
I'm not sure if you want a tilt sensor or an accelerometer, if you just need to differentiate between two discrete positions, you might do well with a mercury/ball tilt sensor : http://www.adafruit.com/products/173
How to initialize stepper motor? Friends, My robot is actuated by a stepper motor, so I can keep track of positions changes while the power is on. But how can I initialize the robot at power on ? Do I need a sensor ?This is in case the position has been moved while the power was off. Here is a Video showing my robot. <Q> You have two choices: <S> At power on, perform a referencing procedure. <S> Many milling machines do this. <S> They will drive the motors until they hit an end stop or reference switch or sensor, at which point they know exactly where they are. <S> Added: <S> To decide on your solution, you first need to think about what accuracy you require. <S> Having seen the video, my guess would be that it doesn't need to be super accurate. <S> Whatever sensor you choose has to be able to measure the motor's position to the accuracy you require. <S> You also need to decide if the motor needs to be able to rotate more than 360º. <S> If it's less than 360º <S> then you can just use an end-stop with a microswitch. <S> Screw the switch down to the base of your robot using the two handy screw holes. <S> And attach a piece of wood on the moving part of the robot so that it bumps into the switch. <S> Whenever the robot resets, it can simply drive slowly round until it detects the switch was pressed, and then it knows exactly where it is. <A> All disk drives with stepper motor actuators ( <S> when I knew this technology well) used a metal flag and optical interrupter for sensing the home position on power up or any reset condition. <S> ( tear apart a CD or floppy) <S> Many methods of sensing "home" or "end stop" <S> Consider one such optical sensor here uses gap and acts like transistor so requires skill to use like tx/rx signal detector, but low cost. <A> Errr, I'm so sick with that micro-switch idea ! <S> If your using a microcontroller then go ahead a buy($$$) <S> a hall effect sensors whichhave a SPI interface. <S> They are quite fancy, easy to interface and rich in precision. <S> http://www.melexis.com/Hall-Effect-Sensor-ICs/Triaxis%C2%AE-Hall-ICs/MLX90363-759.aspx <S> [note :- please note that I'm not work for melexix <S> ,you could chose any other vendorwith SPI enabled if you wish].
Fit an absolute encoder to the motor so that you always know its position, even if it gets moved while the power is off.
Using a momentary push button as a latching on-off toggle switch Please check the schematic here> Here is the circuit that I have developed. I am not very sure about the design. Here is what I want it to do. When the user presses the push button S2 the TPS_EN line should toggle. I am using BSS84 P-ch mosfets.The resistor values are as in the schematic. Here is an explanation of how the thing should work.The TPS_EN line is low at first. Since it is pulled down by a 10k pull down resistor(not shown in the schematic).When the user presses S2, the mosfet Q2 turns on because ground is applied to its gate. which enables the power regulator connected to the TPS_EN line . The regulator now starts up and starts powering the microcontroller. The microcontroller pulls the LATCH_OP1 and LATCH_OP2 low. The mosfet Q2 and Q6 now 'turns on' due to this.Q6 is turned on and now causes the 1st and 2nd terminals of the push button s2 to go high. And the LATCH_OP1 causes the Q2 to latch thus enabling a constant high signal (VBATT)on the enable line. Now when the user presses the button Since Q6 was 'on' the VBATT gets applied to gate of Q2 and turns off Q2.The regulator turns off. turning off the microcontroller and the LATCH_OP2 and LATCH_OP1 return to VBATT. BATT is around 3.7v.The Micrcontroller is running on a 3.3v supply The circuit does not work as intended. I tried manually changing the latch lines to ground when turning on and it worked. But when i connect the lines to the microcontroller it does not work Please help me out! Feel Free to point out mistakes if any. This is my First circuit design!(So please excuse my noobness! :p) <Q> If you were to look at the voltage at the switch, instead of seeing a nice perfect square wave as you might imagine, what you'd actually will horrify you. <S> Assuming your circuit works, switch bounce will totally mess things up, because it will cause TPS_EN to toggle multiple times with every press of the switch. <S> What you need to add is known as a debounce circuit : <S> Having said all that, I think there's a better way to solve your problem, using fewer components. <S> You already have a microcontroller, so let that do all the hard work. <S> When you press S1, it causes Q1 to switch on, which powers the MCU. <S> From now on, the MCU keeps a watch on the Switch_Detect line. <S> It will go high when the switch is pressed again. <S> The MCU waits for the button to be released, then waits a further 100ms. <S> This is to make sure the switch has really finished bouncing. <S> Then the MCU lowers the MCU_Signal line, causing it to power off. <S> Added: <S> There's also the LTC2955 Pushbutton <S> On/Off Controller which does the same thing. <A> Just to point out a few things that were wrong in your schematic: You have Q6 upside down. <S> The way you have it, there would always be current flowing through its parasitic diode, and through R25. <S> So, Q6 is always "on", no matter what you do to its gate. <S> When LATCH_OP1 is low (pulled low by your MCU), pushing S2 would create a low-impedance path {VBATT --> parasitic diode of Q6 --> S2 --> <S> NMOS of your MCU output}. <S> The high current created could damage Q6 or your MCU. <S> "turning off the microcontroller and the LATCH_OP2 and LATCH_OP1 return to VBATT". <S> No. <S> When you turn off the MCU, its outputs don't go to VBATT. <S> This depends on the specific GPIO implementation but, in most cases, all GPIO pins will stay connected with two diodes to GND and VDD. <S> One diode goes anode to cathode from GND to the GPIO pin, and the other diodes goes anode to cathode from the GPIO pin to VDD. <S> So your GPIO pin can never be 0.7 V below GND or 0.7 V above VDD. <S> VDD will be zero (or close to it, if you inject a significant current through the upper diode of any of the GPIO pins). <S> In any case, the GPIO voltage won't be VBATT. <S> Probably, it will be so low that it will keep the gate of Q2 low, and Q2 on (thus, turning on again the regulator). <A> You designed an elgantly simple T flip flop concept. <S> suggestions to avoid: (1) avoid interface with uC to prevent latchup SCR effect of CMOS uC when voltage applied to any signal pin when Vdd is off. <S> (2) avoid design that drains Vbat when switch is not used (3) need switch debounce cap. <S> preferably across switch to burn contact oxidation. <S> Reliable low current switches are gold plated. <S> ($) <S> {1} Consider logic T type Flip Flop for your solution {2} Consider D type Flip Flop with -Q connected to D (=T FF) and use Clock input to switch and -Q to TPS_EN. <S> {3} "In your design spec !! <S> " <S> Specify if you want action on switch make or break " but consider Clock input prefers fast rising input to avoid internal race condition if any. <S> {4} Switch bounce can discharge cap in 1 bounce but with long bounce time (0.5~5ms) determine bounce time and make RC time 10x for margin. <S> Cost is ~0.12 for D FF (1 of) http://search.digikey.com/us/en/products/SN74LVC1G80DCKR/296-9852-1-ND/380101 for example
I haven't examined the circuit much yet, but one thing you'll have to be wary of is switch bounce. Immediately, the MCU raises the MCU_Signal line, which keeps Q1 switched on, even if you let go of the button. This is a real effect and happens on almost all switches.
Sinusoidal Waveform Induced on Long (~15m) Wire I have about 72 of the following circuits on my board. The MOSFET and R2 comprise of the output stage and the pull up resistor is my input stage. The long length of wire in-between is the wire under test. I've had this working for quite some time now and it works well. However, today I hooked up a wire harness of about 15 m in length - I wanted to see how much ringing was present. I noticed something else though - there was 1.3 MHz sinusoidal waveform present at the "Output Voltage" node. The peak to peak voltage was approximately 400mV(!). Here's the waveform in all it's glory: When I measure the voltage at the MOSFET's drain, I get this: The induced voltage seems to be gone when the MOSFET drives the line low. I then got another harness of about 4 m in length - the amplitude of the waveform was much reduced now - approximately 150mV but the frequency was the same. Twisting the wires reduced the amplitude (I forgot by how much. I will do the test again when I go back to work and post here) however, for us, twisting the wires isn't a solution. The harness is manufactured according to our customer's specs and if they dont' specify twisted wires, we can't have twisted wires! My questions are: What could be causing this? Are these voltages being induced from somewhere? The environment isn't noisy. How can I ensure these voltages don't cause issues when my CPLD reads the voltage at the "Output Voltage" node. NOTE: I know the o-scope screens don't show the frequency, I'm not sure why that is, but the frequency was a stable 1.3MHz. I remember this vividly. How did I measure the signals? I connected my probe ground clip to a ground point near the pull up resistor, R1 (it's not visible in the schematic). I then I connected my probe to the "Output Voltage" node. This is the measurement at the input side. To see what was happening at the MOSFET side, I again connected my probe near a ground point that was near the MOSFET and measured at the MOSFET's drain. As the rising/falling times aren't excessively high, I don't think this is a measurement error - ESPECIALLY because the waveform's amplitude was reduced when I got a shorter wire. <Q> I'd bet that if you disconnect the wire at the MOSFET then you'll still have the 1.3 MHz at the pullup resistor. <S> If that is the case then your wire is acting like an antenna and you're receiving something. <S> Sources of radio waves tend to change. <S> This could be why you haven't seen this before. <S> Or, you never used this kind of wiring harness before and so never tried an "antenna tuned to 1.3 MHz" before. <S> There is not much you can do with this to fix it. <S> At least, not much that doesn't have some negative side effect. <S> One solution is to put an RC filter just before the pullup at the input. <S> Size it <S> so the cutoff frequency is as low as possible without effecting the speed at which you can measure the cable. <S> It might be that you can't do it without effecting the speed, those are the breaks. <S> Keep in mind that the R from the RC, and your pullup resistor will form a voltage divider. <S> When the MOSFET is on, and the wire is 'low', then the R+Pullup will limit how low the voltage on the input will go. <S> Make sure that the R in the RC is low enough, or raise the value of the pullup, so your input will go low enough. <S> This is unlikely since the speed of the signal traveling down the wire and back is much faster than 1.3 MHz. <S> But if it were a problem then I would look at putting a resistor in series with the MOSFET. <S> Basically something to slow down the falling edge of the signal. <A> twisted wires (cheap) coax cables (expensive) Or redesign with: larger output voltage swing <S> (so the interference is small in relation to signal) <S> symmetric outputs (two outputs: one is high, then the other one is low. <S> And the other way around.) <S> current loop (instead of measuring voltage, measure current. <S> Commonly 4-20mA is used) <A> Longish comment: <S> How can you be sure that the environment isn't noisy? <S> I think that it's quite impossible to have a completely noise-free environment, even inside a Faraday cage; the point is how noisy it is. <S> How do you connect the grounds and the supplies? <S> Obviously, if they aren't connected together, and you measure at the left side (referenced to Q1's source) the other end will be basically dangling when not pulling low. <S> You don't have a push-pull output stage, so in any case the resistor will be a weaker (even if not so weak) pull-up. <S> But I think the strongest point is n. 2, so if you can, post a diagram of the measurement scheme. <A> Well it looks like you "harnessed" a resonance mode of your cable to act as an AM radio. <S> Actually a "cable has up to a pair of connectors, and a "harness" has more than 2 connectors.
Another possibility is that you are exciting some sort of resonance in the wire.
What back-end and front-end are in hardware design? I saw these two terms in context of chip-design. what are Back-end and Front-end? what are the differences between them? <Q> These are terms that refer to different stages of wafer processing. <S> These expressions are typically written as "Back End of Line" (BEOL) and "Front End of Line" (FEOL) and refer to different stages of manufacturing. <S> Front End of Line refers to "Front" or first part of a wafer manufacturing line. <S> This is where all the wafer-based devices are formed, such as transistors, poly capacitors, non-metal resistors, and diodes. <S> This is where the metal interconnection is added, as well as any top insulating layer. <S> In addition, metal resistors, metal-metal capacitors, and inductors are build using these steps. <A> @W5V0's answer is true. <S> But Front-end can mean RTL-level design (Verilog or VHDL) and back-end is the chip-specific work (e.g. synthesis, mapping to gates) that results in a GDS-II file for the chip manufacturer. <A> Seems like the answer depends strongly on context. <S> Where I work (an IC manufacturer), I generally use these definitions: <S> IC design IC simulation IC fabrication (includes FEOL and BEOL) <S> The back end is the support functions for characterizing and ensuring quality of the IC: <S> Lab evaluation, including eval PCB design Automated test, including ATE PCB design Applications/customer support
Back end of Line refers to the "Back" or last part of the manufacturing line. The front end is the required work for creating the IC:
Pool alarm with wireless remote alarm, how to integrate with it? I have this pool alarm http://www.diycontrols.com/p-6711-sensor-espio-inground-pool-alarm-safety-item.aspx . I would like to log whenever the alarm goes off so I know if it is tripping while I am gone very often. How can I find out when a signal is sent? I don't want to hack into the remote alarm, but actually detect the radio signal. <Q> Looking at the manual, this is FCC certified. <S> That means you can find out a lot about it. <S> I went to here and searched by the parent company's name, MG International, bringing up 4 applications. <S> One of these is the Sensor Espio. <S> From there, I can see it works on 433.92 MHz <S> - this is probably the most common band for wireless devices. <S> The schematic is available - it uses a TI CC1100 . <S> The operational description says it uses OOK with a 16 bit security word and 8 bit command word. <S> Most of these 433MHz devices use fairly simple Manchester encoding , sometimes using infra-red remote protocols over RF. <S> I've not used a CC1100 before, but have used a CC1110, which is fundamentally the same. <S> They have a lot of fancy features for FSK and MSK, but are quite basic and hard work for ASK/OOK. <S> I think this means that the protocol is essentially free choice, but most of these will be a long preamble of 1010101010 or similar, followed by the security/ID <S> and then command word repeated several times. <S> You can use any of the simple 433MHz receivers to pick these raw signals up, but then you will need to use a microcontroller or similar to wait for the preamble and listen to the words. <S> The website JeeLabs has a large number of tools to help you connect a 433Mhz receiver to an Arduino and decode it. <S> By logging - do you mean simply recording? <S> Any microcontroller can do this. <S> Or do you mean alerting you via SMS or email? <A> You probably won't have much luck just detecting the radio signal. <S> There is noise on every frequency, so your alarm listener would probably constantly detect a signal. <S> What you would need to do is listen for a valid wireless message. <S> But you will need to do some major reverse-engineering to figure out what constitutes as a valid message. <S> I would probably just add a mosfet to one of the alarm outputs which activates your own circuit to perform logging. <A> You can just attach a latching device so when it gets switched on, it stays on. <S> Search for SCR (thrysistor). <S> You can attach one to an LED, and if the LED is on, then you will know. <S> Attach this to the remote. <S> To log, I know of a clever instrument. <S> You can have a photoresistor attached to a 555 timer circuit. <S> Attach output to tape recorder. <S> As you play back the recorded tape, if there are any frequency changes, you know that it has gone off. <S> Point the photoresistor at the indicator lights. <S> Or you can just place a tape recorder next to the alarm. <S> Attach mike. <S> Point mike at speaker of the alarm! <A> If you can hear the alarm, you dont need the RF signal, just filter the audio tone with a good BPF and a cheap mic and an event monitor perhaps on USB with suitable software or use an auto-dialer to your desk at work. <S> BPF of my choice is a high Q Sallen & Keys with adjustable F and adjustable Q to tune to Pool alarm. <S> Or higher Q with State Vbl BPF adjusting Q with Ra. <S> Choose Q>100
Much better to hack into the remote which is already programmed to receive an alarm message.
Is a CAN enabled microcontroller sufficient to drive a CAN bus? There are a number of CAN modules built into microcontrollers these days. The PIC18F2480 is an example of that. Is that microcontroller (with built-in CAN) capable of driving a CAN bus on its own or is an external CAN transceiver/controller required? I believe CAN has both a software and hardware layer and by the looks of it these CAN-enabled microcontrollers appear to have just the software, but it does not state that it can or cannot drive the CAN bus as is. I'm looking to connect more than six microcontrollers through a CAN bus and would like to know if I need a transceiver across all of them or whether the built-in stuff can handle the communication from a software and hardware perspective. Assume that I'll have necessary termination resistors and other small discrete components (caps, resistors, etc.) <Q> This is a very good question. <S> As a general rule, CAN requires a transceiver for every node: <S> However, under certain circumstances, you can actually get away without any transceivers! <S> Those circumstances are: Short bus length (much less than 1 meter) <S> Preferably all microcontrollers are on the same PCB, or stack of PCBs. <S> The bit rate is low <S> The environment isn't too electrically noisy <S> These aren't hard rules. <S> You might get away with maximum bit rate (1MB/s) if you have a really short bus (10cm). <S> To achieve this, you need to know a little about what the transceiver does. <S> Like most transceivers, they can output a high or a low to the bus (representing 1 and 0), but the 0 can dominate a 1. <S> I.E. <S> If two transceivers try to speak at the same time, and one is saying 1 and the other is saying 0, then the 0 will win. <S> We can re-create <S> the same situation simply using diodes: See the Seimens application note AP2921: <S> On-Board Communication via CAN without Transceiver <S> But here's something even more interesting: The PIC actually has hardware support for transceiverless CAN! <S> You can configure the CAN TX pin so that is behaves in exactly the same way as the transceiver. <S> This means you can wire up the CAN bus without the diodes. <S> You'll still need the resistor though. <A> The LPC11Cxx family of microcontrollers (ARM Cortex-M0 based) include the CAN transceiver on-chip. <A> Yes, you need a tranceiver. <S> The CAN pins on the micro are receive and transmit. <S> The CAN bus itself uses a twisted-pair with differential signalling on two wires called HIGH and LOW. <S> One of the transceiver's jobs is to take the logic level you present on the TX pin an turn it into CAN bus signals: a logic '1' is represented by not driving the bus, so the HIGH and LOW lines "float" to 2.5V - called a "recessive bit" in CAN terminology. <S> a logic '0' is represented by driving the HIGH line high and the LOW line low - called a "dominant bit" as it will override any recessive bits being transmitted. <S> The other is to take what is on the bus, and turn it back into a logic-level to send back from the RX pin to your micro. <A> Check out the MCP2551. <S> Update 17 Aug 2017: <S> I'm at the Microchip Masters conference right now. <S> I was told flat out by Microchip engineers that one of the new parts that resulted from the Atmel acquisition is both cheaper and better than the MCP2551. <A> Analog devices has an example <S> CAN transceiver circuit using a differential amplifier. <S> I haven't tried this, am just aware of it. <S> Also interested if it could be implemented with an op-amp The advantages of using dedicated IC CAN transceiver <S> is they will handle arbitration for you and you don't have to worry about interfering with the bus. <S> If you are only observing the bus and it's not a fault critical environment, the circuit may be fine. <S> While the mcp2551 is very popular, there are many options for interface chips. <S> A new evolution are the System Base type of chips which include voltage regulation, power modes, and ESD protection from the bus. <S> Like timorr said above, NXP's LCP11C24 is unique in that the processor includes CAN transceiver. <S> A demo board with this is only $19. <S> Another low cost solution is to use the $9.38 Cypress PSoC5 demo board, the CY8CKIT-059. <S> The PSoC5 doesn't have a CAN controller; it goes one further: <S> the controller is implemented in the FPGA-like universal blocks. <S> The controller's registers are configured via the IDE's GUI, making filtering and R&D pretty easy. <S> A key method I have found when perusing data sheets is the mcu <S> TTL is labeled CAN-Tx and CAN-Rx while the transceivers' data lines to the bus are always labelled CAN-H and CAN-L. <S> I dislike the diagrams in the other answer where TxRx are shown connected to the bus; this goes against convention and contributes to confusion.
You need a CAN transceiver chip between the CPU and the CAN bus.
Why is this Circuit Measuring 1.8v So I made a small 5v Power Supply (Regulated) using one of Sparkfuns tutorials. I used a Slightly Different LED (a 2.6v with 20mA) and a 270 ohm resistor ( have no idea why they use a 330 Ohm one...270 was even overkill for mine. Anyways Im using my Multimeter and measuring the voltages (Marked in purple, - for Ground probe, and + for my + probe). Im getting a correct 5v reading after the LM7805 (well like 4.95 volts.....close enough), but when I measure after the LED I get 1.8v.... This doesn't make any sense....... Here are some pictures of the circuit itself, I have drawn arrows to where I measured the 1.8v with my Probe (Positive red probe), the Resistor is a 270ohm, and I was incorrect about the Forward Voltage, it's actually 2.25 (MAX was 2.6......thats what got me confused). Sorry for the Long pictures, but wide-ways they are kinda hard to see. Capacitor values are same as schematic. edit: Corrected Picture.edit2: Added picture of circuit <Q> If I'm not mistaken, your schematic and breadboard circuits do not match. <S> In the schematic you have your LED before your resistor. <S> On the breadboard you have your resistor before your LED. <S> Since you are measuring the anode of the LED in the physical circuit, what you are measuring is the voltage drop after the resistor. <A> Your question does not make sense as stated, but one can guess at what is happening. <S> If you measure the LED Anode = <S> + side you are measuring the identical location to the +5 output As you report two different voltages for the same point there is something wrong with what you are reporting. <S> You did not report LED colour, and this makes a difference. <S> A red LED will drop about 2V - could be up to about 2.3V and may be under 2V. <S> The 1.8V you report <S> MAY be the voltage across the LED. <S> As YOU are placing the test probes YOU MUST tell us where they are when you measure. <S> Otherwise your questions are random and the answer is "The sound of one dog barking". <S> The LED series resistor drops the voltage not dropped across the LED. <S> IF LD voltage =2V then resistor voltage = <S> 5-2 = 3V. <S> The current in the resistor and in the LED then is R <S> = V <S> / <S> I = <S> 3/330 ~= <S> 9 <S> mA. <S> Changing the resistor changes the current. <S> The chart below is out of date and LED voltages change as technology improves, but this gives an indication how both colour and current effect a LED's forward voltage. <S> Draw a line horizontally at say <S> 20 mA <S> and see how the voltage varies with LED colour. <S> For example, using the LEDs below, and noting that the same colour LED in a newerdesign and/or different technology may give a different result, consider a red and HE green LED from the chart below. <S> At 20 mA the red LED drops (= "has a forward voltage drop of") <S> about 1.7V <S> (sounds close to your 1.8V) and the HE green drops about 2.2V. <S> Much more related information here <S> Key: <S> 3 <S> Bright Red <S> 4 <S> Ultra Red <S> 5 <S> Red <S> 6 <S> HE Red <S> 7 Orange <S> 8 <S> Yellow <S> 9 HE Green <A> The positions of R1 and D2 are reversed. <S> So when you measure the voltage you are just measuring the forward voltage of the LED, which is about 1.8 V as expected. <S> In the schematic, you showed measuring voltage across the series combination of the LED and resistor, which would have read as 5 V. <A> Based on your LED datasheet (which you haven't linked to as far as I can tell, by the way) <S> the Forward Voltage Drop <S> (I don't know what Dropout Voltage is in the context of LEDs) is 2.6V. <S> Based on your circuit measurements, the actual Forward Voltage Drop you are experiencing is about 3.15V. <S> The current your LED will have pulled through it is exactly the voltage you measured past the LED (1.8V) divided by the the current limiting resistance (270 Ohm). <S> That is only 6-7mA. <S> A bigger resistance will only make that current smaller, and you really want your current to be around the knee of your IV curve for the LED which is often around 20mA. Assuming <S> your actual Forward Voltage Drop is 3.15V, you would need to set your current limiting resistance to something not much bigger than 1.8V <S> / 20mA = 90 <S> Ohms. <S> That being said, I've only really seen forward voltage drops that high for Green and Blue LEDs, so that sounds fishy.
For an LED you want to set the current flowing through the LED by choosing the current limiting resistor that is appropriate for the forward voltage of your LED. The circuit in your photograph is not the same as the circuit in your schematic.
Easiest way to extend a pulse I have been messing around with my cars ignition. I know a lot about cars, butI haven't learned much about electronics. When I did study electoincs it was almost 20 years ago. Anyways. The car's computer sends a 5 V square wave signal for the cars igniter to charge and fire a coil. There are 6 clylinders, and each one has it's own signal and coil. I was finally able, and one of the first to do so, to use non-factory coils and not use the car's original igniter. My new coils have their own igniters. And they don't really care if it is a square wave or not. I just need to send at least a 4 V signal to the coil and it will charge up and fire when the signal is gone. Even a 12 V or higer is OK too. 5 V is standard for these coils and my cars computer already sends 5 V signals. So what I want to do is take the signals from the computer which are about 3.2 ms with the car idling, and drops to about 2.3 ms when the RPM increases above about 1,500 RPM.All I want to do is take this signal and extend it about 1.7 ms. So at idle I would have a 4.9 ms pulse and as the RPM increases I would have a 4 ms pulse, or even just a flat 4-5 ms pulse all the time is OK. To use these coils I needed to simulate a signal that the factory igniter box sends to the cars computer. I did this by using a tranistor array, that has 7 transistors. I only really needed 6. All 6 signals come from the cars computer to this transistor array (in parallel) and I have the signal wire that comes from the igniter box to the car's computer hooked up to the array also. the signal wire is a continous 5V signal from the cars computer going to the igniter box. When the igniter box thinks a coil fired it grounds the 5V wire from the compputer. So it dips this 5V signal to about .8V for about 1.5ms. OK, so..in summary what I want to do is: Take a 5V square wave signal that varies from about 3.3 ms to 2.2 ms, and extend the falling edge of it about 1.7 ms or, make each of these pulses a flat 4-5 ms pulse. The new pulses don't need to be perfectly square, as the new coils don't really care about that.the coils have 4 wires to them. A 12 V source, a trigger wire, and 2 ground wires.I know I can probbably do this with six 555 timers, but I really don't want six of those. A single or maybe 2 ICs would be OK, or maybe a capacitor connected to the 5V signal wire.I can also make the 5 V signal a 12 V signal, and use a capacitor, then the capacitor will charge up at the same time my coil is charging, once the signal from the computer stops the capacitor will discharge and keep the coils igniter triggered a little bit longer. If I can add all of this together to create my fake signal to the computer and also extend the 5 V signal pulses it would be the perfect thing. Does this sound OK? Or what is the simplest method? If I could extend it by anticipating the rising edge it would be ideal. I don't see any easy solution to that. So once the ECU sends the signal, I want to make it longer. To make it easier the signal doesn't need to be square anymore. The triggers on the new coils are pretty sensitive. A 555 timer did great at test firing them. I thought about the monostable circuit using some 555s. I think I have about 20 of them to play with. I guess I can set up 6 of them and see if I like it. I think I have only seen up to a dual monostable capable IC. I had thought of the Schmitt trigger also, and something with a capacitor and resistor. I thought about adding a capacitor and it will give the square signala longer duration, but not so square looking of a wave, then a Schmitt trigger can fix it to be square again. I might have confused some people about what I already accomplished. I can use the factory ECU and non-factory coils without using the factory Igniter box. The factory igniter box steals about 0.7 ms of dwell. And, what happens is the factory igniter box cuts off the ground to the ignition coils. My car actually ran that way, but I don't want the factory igniter box to cut off the ground to the coils and the coils built in igniter doing the same thing. The factory igniter box works like this. Lets consider only cylinder 1 for the example.The ECU sends a signal to the igniter, 3.3 ms at idle, 2.2 ms at higher RPM. The factory igniter sort of pauses and connects the ignition coils ground about .7ms later. As soon as the ECU stops sending the signal, the igniter immediately cuts off the ground to the coil causing it to fire. The igniter senses current flowing from the ignition coil and passing throuh the igniter to ground. When current flows through the coil and out the igniter to ground, the igniter dips the Voltage of a totally different wire connected between the ECU and the igniter box. So, there are 7 wires directly connected from the ECU to the factory igniter box. 6 of them are the 5V square waves for firing the coils. The 7th wire is always a constant 5 V. It's called the Ignition Confirmation Signal, Toyota abberviates it IGF. When the igniter senses current passing through it, it grounds out the 7th wire. It only grounds it out for about 1.5 ms, this is no matter how long the dwell is. If the ECU misses a few of these signals it shuts down the cars fuel system.It does it really fast too. So I am doing pretty good so far, the car ran really good today. I won't say how fast I took it today, but the Audi messing with me quickly disappeared in my rear view mirror. I can do all of this if I was one of the guys replacing the factory computer with an aftermarket computer, but good ones go for much more than a $1,000. My car is a 1994 Totota Supra, twin turbo, 6 speed. Right now it's only about 415 HP to the rear wheels, but its enough for me. I'm not seeking more. I just replaced my old bad coils, and new factory ones are about $100 each, no thanks.My new coils need a little bit more dwell. Most people on many kinds of cars say 5 ms is the ideal dwell, after 5 ms it doesn't charge up much more. So I'm shooting for that. Update I have ordered some components to try two methods. I will try one with a monostable circuit, and I will try the hex Schmitt trigger with a diode, capacitor and resistor.Making it work both ways can help me learn something and accomplish want I wanted. <Q> You can use something like this for each channel. <S> D1 = BAT54 R1 and C1 so that you have the extra 1.7 ms (in the order of 1 uF and 2 kohm) <S> U1a = <S> U1b = 1/6 of 40106 <S> The output will be high as soon as the input is high, it will remain high while the input is high and, when the input goes low, the output will remain high for some extra time that is proportional to R*C. <S> That extra time should be your 1.7 ms. <A> Here's a quick solution using an HC132 which is one of those weird components to have around: <S> The HC132 is a Schmitt-trigger NAND gate. <S> When the input goes low, the 1st HC132's output immediately goes high, which gets inverted by the 2nd HC132; when the output returns high, the 1st HC132's output takes a while to go high again because of the RC circuit, so the circuit extends an active low pulse. <S> To extend an active high pulse, move the 2nd HC132 to the input. <S> This won't work for short pulses (though you can put a diode in parallel with R1 to get around that) <A> retriggerable and non-retriggerable with edge trigger <S> (See mono-stable multi-vibrator= one shot) try this. <S> $0.63 http://www.nxp.com/documents/data_sheet/HEF4047B_CNV.pdf stock at D-Key or get the dual version sorry no hex one shots <S> If you prefer discrete solutions with 2 Q, 4 R's and 2 C but more work, that is possible too. <S> Another is a D Flip Flop which is clock edge sensitive for leading edge and RC delay to reset for your desired pulse width to the V/2 threshold <S> But I think the easiest solution is scope the ignition module and increase the differentiating Caps that create the one shot to desired width.. <S> but I cant say your intent makes sense, but it should increase the arcing voltage. <A> The OP has a problem that has been ignored by him and consequently in the answers. <S> He writes "fire when the signal is gone" which means that the timing occurs on the falling edge. <S> Where I think the OP is hoping to just increase the "charging" time of his new coils he will also delay the firing time. <S> Either by a fixed amount of time or a variable amount of time that would cause very real ignition timing problems unless they were compensated for elsewhere. <S> This may be a misunderstanding but that seem unlikely in this case. <S> However the original factory engine management system may be deliberately altering the "charging" period to change the spark energy but <S> this is unlikely, more likely it starts the "charging" period based on some crankshaft angle reference and then fires the coil based on the ignition timing lookup table. <S> The various delay circuits proposed should work mostly as advertised but may cause unexplained ignition timing changes and variability due to engine RPM. <S> However as indicated on one comment at High RPM <S> it seems that there will not be enough time to charge the coils <S> this is not the case as a 4 stroke engine needs 2 revolutions per spark so will have twice as long and within the limits. <S> There may be a remedy and this is to extend the sparking period to say 3ms (or something <S> between 2 and 5 ms <S> I expect) and then switch to charging which may now be much longer at low RPM but close to the desired minimum at high RPM and then use the falling edge to create a spark pulse starting at the correct instant. <S> The only drawback here is that the charging period may be even longer than usual at low RPM and cause unnecessary heating of the coils but perhaps this is something that is acceptable. <S> The given timing circuits (like @jasons explanation) could likely be adjusted to this kind of functionality but my fuzzy head is not up to the task just now.
You need to characterize the output voltage vs dwell time or pulse width, but to answer your simple question, the solution is called a one shot, which can be implemented in dozens of ways and in 2 basic modes.
Measure the resistance of some DC Motors I did the following to measure the resistance of some DC motors I have and I'm wondering if I did it properly and if my conclusions are sound : I had 4 motors (same model) already connected to a breadboard in parallel. I have a semi-broken "Universal AD-DC converter" variable power supply that is set to output 4.5v. When I plugged that on my breadboard (motors started turning) and measure the voltage straight on the adapter, it was fluctuating around 10 to 11 volts (Unregulated I guess). I then measured the current and it was about 0.6A (even though the adapter says "200mA Max"). It means my circuit had a 16.6 Ohms resistance, so each motor is around 65 Ohms. Makes sense? <Q> It may be 65-ish ohms per motor. <S> It also may not be. <S> The 10-11 v output was likely measured on a multimeter. <S> The average voltage over some time scale reported by the dc multimeter may not be a good description of the output. <S> Likewise for the current. <S> The real output may be swinging from high to low in cycles. <S> In which case the linear division of dc voltage by dc current may give a somewhat wrong result. <S> This would not be a concern with a known good stable supply operated within specs. <S> If you have access to an oscilloscope you can tell pretty quickly. <S> To get a dc resistance measurement you may need to disconnect the motors and measure their resistance. <S> Also, are you sure it's the supply that's broken and not the load? <A> Here's the formula... <S> $$ \frac{1}{R_{eq <S> }} = \frac{1}{R_1}+\frac{1}{R_2}+..... <S> +\frac{1}{R_n}$$I <S> just multiply it by the number of resistors <S> so 16.6 X 4 is 66.4. <S> But it would be better if you measured one at a time, or just use a multimeter! <A> Even a power supply with the worst regulation won't output a higher voltage than rated when massively overloaded. <S> You would expect an unregulated supply to output a higher voltage at no load, lowering to rated voltage somewhere in the middle of the current range and dropping to lower at full rated current. <S> Beyond this, the regulation may become even worse, but normally the limit is a power limit - it will start getting hot. <S> If it is adjustable (you say it ignores the setting), then this is usually achieved by a linear regulator. <S> For it to be unregulated and have a switch, it would need multiple taps on the transformer, which is expensive and not normally done. <S> So it sounds like your power supply may be broken. <S> If you have any power resistors of between 20 and 30 ohms then you could perform a simple load test. <S> They will need to dissipate at least a watt (if it is doing 4.5V at 0.2A), or you could parallel 4 or 5 1/4 watt resistors. <S> Keep an eye on the heat, as if it is outputting 10V+ then much more power will be dissipated. <S> On the flip side, this could be an issue with your meter. <S> DC brushed motors introduce vast amounts of broad spectrum noise onto power supplies. <S> This can confuse meters - especially cheap ones. <S> The worst case is for cheap RMS meters. <S> You could be getting spurious readings. <S> However, it may be worth taking a step back. <S> Are you actually intending on measuring resistance? <S> But why would you want to know the resistance of a simple DC motor? <S> Are you actually trying to characterise the motor for some other purpose? <S> In that case you really need to perform current measurements under no load, stalled and for several points in between. <A> What you measured is the impedance; which is the net of resistance and inductance of the motors. <S> To measure the resistance, you only have to apply about 10% of rated voltage while locking the rotor to prevent the motor rotation, then measure the current: \$V\div I= <S> R\$
The windings in the motor will have a resistence, but this needs to be measured with the motor stationary, ideally using a meter on the resistance range. The fluctuations may mean the output is bouncing around.
How can I reduce the size of an AVR ethernet bootloader? I am writing an ethernet capable bootloader for an AVR ATmega328 MCU. I am currently running over the 4k size limit and need some design advice. Bootloader requirements: Needs to be able to update the application via a simple UDP based messaging protocol (similar to TFTP). As the device operates in a variety of LANs, it should support DHCP. With my current code, I need about 4k for the Ethernet driver, DHCP, ARP and UDP support.Plus 1.5k for the actual messaging and app programming. Compiler optimizations are turned on. My current considerations to proceed are: The code is not particularily optimized, so I guess I could save some bytes by following AVR035 . I doubt I can save enough code size going this route though. I could simply extend the bootloader area by reserving 2k from the top app memory area for the bootloader. I need to be extra careful then to not overwrite that area when programming though. And, I would end up with a large, complex bootloader which probably has bugs, which I cannot update in the field. I could move some functions from the bootloader to the app. DHCP could be a good candidate: The app obtains a IP address via DHCP and stores it into EEPROM. The bootloader then can simply use the stored IP address and does not need to do DHCP itself. This could be dangerous though if the app fails e.g. by software bug or random corruption. Which route would you suggest? Are there other ideas I should consider? <Q> I managed to reduce the size of the bootloader to around 3k. <S> Here is what I did, maybe it helps someone with a similar task: <S> I removed DHCP and ARP support from the bootloader. <S> I make the assumption that I can always reach the device via UDP broadcast, so I don't need it to obtain an IP address when running the bootloader. <S> I also did a lot of code tweaking, which helped reduce the size some more. <S> The removal of DHCP/ARP was the biggest chunk, however. <A> One approach that might sometimes be useful (even not for the original asker, for others who need tiny boot loaders) is to have a two-part bootloader. <S> One part would be in "permanent" memory, and would basically just have enough smarts to send a broadcast packet, listen for a reply, and throw a suitable-looking received reply into memory and execute it. <S> Otherwise, it would perform a checksum on the second part, executing it if it looks valid. <S> The second part would be in writable storage and could contain the logic for ARP and other such things. <S> That part could in turn be used to perform application updates. <S> Note that the second part may not fit entirely within a 1.5K Ethernet packet, but there should be no difficulty fitting enough logic within a 1.5K Ethernet packet to load a few more packets worth of boot-loader code (especially since the hardware will already be set up for that purpose). <S> The Apple II uses this type of approach to load from floppy. <S> A 256-byte PROM sets up a 128-byte table to decode 7-bit GCR data into 4-bit nybbles, advances the head mechanism outward a bunch of times, looks for a sector-zero header, and then reads 256 bytes of data to address $0800. <S> The code there is large enough to read the next 15 sectors from the same track (since the table it requires has already been produced), and the code within those 15 sectors can finish loading the OS. <S> Setting up a boot loader to work this way may be somewhat less convenient than having a "load everything in one step" loader, but it offers the advantage of allowing the unchangeable part of the boot loader to be very tiny. <A> I made a bootloader for the atmega328 that is updated via ethernet using TFTP. <S> I have DHCP in the application space and the results go into eeprom. <S> The bootloader reads the eeprom, so the bootloader effectively has DHCP as long as the application runs at least one time in the network. <A> Without seeing your code, or at least the layout of some of it, it is hard to say what you can change and omit/recycle. <S> Have you tried using different optimization's? <S> On a 4k program I think I have seen variations of almost 1k by just changing the optimization used, (this was a while back, it may not have been that dramatic.) <S> Although I doubt that would get you the ~33% reduction you would need. <S> I would try to write or find some asm examples that may be smaller than what to compiler would make and use them in place of some of your code then recompile and see how much of a difference that makes. <S> You could also compile, step through the asm, pull out sections <S> you like swap that in your code, then change the optimization, compile and repeat. <S> But this would be tedious!
Your best bet is probably extend the bootloader area and make sure the bootloader won't overwrite this when it is being programmed.
Legality of Reverse Engineering If there was a "law/legal" stack exchange site I'd post it there, but it's in its infant stages in Area 51 . I'm a musician and an electrical engineering student. I've designed a modification to the pickup system of my acoustic/electric guitar that I know some people within a certain circle would be pretty interested in. I've read a lot of complaints about the stock pickup system on electronics forums, and it doesn't seem that anyone has figured out a solution, so I thought I'd make a detailed video on the work I've done. To be honest there's not too much to it, but if I post some partial schematics of the part of the original preamp I've managed to reverse engineer, can that get me into legal trouble at all? I don't plan on marketing this modification at all; I just want to share what I've done. <Q> The best answer is always "talk to a lawyer." <S> That being said, you could check out any kind of license agreement you may have implicitly agreed to when you purchased the item. <S> Since you are not marketing this modification, the worst that could happen is that you could get a takedown request/notice for the video or a cease and desist letter. <S> Odds are, the company either will not care or will see this as free advertising. <A> In general there are two main problems with reverse engineering: patents and copyrights. <S> For US, it is often said that only the actual component layout is covered by copyright <S> and you'll have problems if you directly copy it. <S> The patents on the other hand protect the idea itself and the patent descriptions try to be as broad and vague as possible in order to cover a much room as possible. <A> AndrejaKo is right about the patents. <S> To prevent you to come up with some variation to the invention patents are never very specific, so that they cover any possible variant. <S> Also, most of the time it's not just the product which is patented, but patents are registered for every possible detail. <S> I've seen relatively simple products listing over 150 patents. <S> It's almost impossible that you can use anything from that design. <S> You can reverse engineer as much as you want to study the design, but you can't use any of it, especially not for production. <S> It's unlikely that lawyers will hunt you down if you reproduce a design for your own use, just a single copy, albeit because they won't be aware of it. <S> The layout copyright is hardly relevant if you can't use the schematic anyway. <A> The concept of patents is disclosure of invention and make minor improvements to prior art. <S> So you are not violating their design, but showing creative improvements . <S> The value of a patents only comes to bear when others profit by similar results and get caught or the patents are worth selling. <S> This company would not likely waste their time or money taking you to court. <S> But for the entertainment field, it might detract from revenue to copy ideas and make free so people like Google/ YouTube censor copyright protected music etc. <S> on personal uploads. <A> Reverse engineering is understanding of how things work. <S> I think it is not illegal when to reverse engineering anything. <S> It's like hear the chords of a song and write it down to a paper. <S> Unless you use the design to produce and sell copies, if you do it will be copyright infringement and or patent violation. <S> But this is just my opinion <S> , I'm not a laywer. <S> In fact if something is patented and have a patent number, it makes it a lot easier to reverse engineer. <S> Because in order to have a patent granted, the owner have to provide all the information about the related patent, through a public domain. <S> A patent does not make anything harder to be copied, it makes it easier, it just give the owner legal rights to sue anyone that is using your patent. <S> A example can be found here: http://youtu.be/Fj7e3WGUKO8?t=35m37s <A> Sounds legal, but I'm not a lawyer. <S> Is the original preamp you're concerned about patented? <S> If so, is the patent expired? <S> Even if its still covered by active patent, you're probably not violating the patent.
If you reverse engineer a patented idea, the idea is still covered by patent and the company can still chase you in case of reverse engineering.
GPS Data Accuracy on Inclines I have a BU-353 , and I am using it in a car. I want to use it to get a more accurate speed reading than RPM/wheel diameter calculation can give me. I am wondering how the incline of a slope, that the car might be going up would impact the GPS reading (specifically NMEA VTG and RMC data). In other words, would the speed out put from the GPS be inaccurate if the altitude of the car is changing, and if so how could I account for that in the software? The device can also use the following NEMA Protocols: GGA, GKK, GSA, GSV, RMC, VTG, MSS, ZDA <Q> Next to longitude and latitude data GPS gives also altitude information. <S> It's up to the receiver's software designer to decide if she uses that information. <S> She should, <S> and then the speed is determined by \$ <S> Speed = \dfrac{\sqrt{(\delta <S> \mbox <S> { } longitude)^2 <S> + (\delta <S> \mbox <S> { } latitude)^2 + (\delta <S> \mbox{ } altitude)^2}}{\delta \mbox <S> { } time} \$ <S> Note <S> that distance as a difference in latitude is constant (111.1 km per degree), while for longitude it's function of latitude: 111.1 km per degree at the equator, 71.4 km per degree at 50 degrees north or south, for instance. <S> edit <S> The BU-353 supports <S> NMEA's GGA sentence, which gives you essential fix information including longitude, latitude and altitude. <A> A GPS receiver isn't going to give you good speed values in the short term relative to what tire rotation can tell you. <S> There is some jitter on each GPS fix, <S> so subtracting the positions from two fixes will have a significant distance error for the purpose of computing speed of a car. <S> I would look into using the GPS over a long and flat stretch of road to calibrate the travel length of a tire rotation, then use that for immediate speed measurements, which your speedometer does already. <S> You could even have the GPS system working the background to make small adjustments to the tire rotation calibration based on longer distance and time averages when the car is going reasonably straight without much speed variation. <S> If it did this automatically whenever a good circumstance arose, the tire rotation speed measurement should be quite accurate. <S> If you need more, then you probably have to look into a fifth wheel just for the purpose. <S> It's hard to say how much accuracy a GPS system might loose due to elevation change. <S> GPS is much better at measuring lat/lon position than altitude, particularly in the short term. <S> However, keep in mind that something that appears steep to a car still has a rather mild slope mathematically. <S> The cosine of even a "steep" road is still close to 1. <A> It may complicate the system, but an IMU (Inertial Measurement Unit) can greatly improve the performance of your speedometer, if added to the GPS receiver. <S> That applies also for slopes. <S> An IMU consists in a set of accelerometers, gyroscopes and magnetometers (they work well together, but you don't necessarily need them all), which allow an accurate calculation of the heading of your system (the car in this case). <S> The way in which this is calculated is often referred as AHRS (Attitude and Heading Reference System). <S> The GPS receiver by itself is very noisy and inaccurate, and this results in your measured position to bounce around the real one in a radius of 1 to 20+ meters. <S> About the inclination Using an accelerometer to determine the inclination of your car is far more accurate than calculating the difference in altitude, because it's just a variation in the direction of the G-force. <S> The downside of this is that you require a computating unit, which needs to make some heavy calculations. <S> But I've made an experiment with an STM32 (Cortex M3) and we've (with other people) been able to calculate the heading every about 20 ms, without great optimization. <S> So it's something that you can easily achieve with a comparable microcontroller.
The benefit is immediately clear: knowing your heading helps greatly a GPS-based system in determining your movement direction and speed, which can be used to estimate your position over different points.
Questions about capacitors in DC 1.Does the current flow through the capacitor when (a) it's not charged, (b) it's partially charged, (c) it's fully charged ? How does the flow changes in time (ex.: exponentially, logarithmically, linearly, etc.)? 2.If you charge a 16V capacitor from a 9V battery and then you disconnect the battery, what will be the capacitor voltage? 16 or 9? <Q> If it's fully charged there's no current. <S> The current curve depends on how your voltage source is connected. <S> If you supply a constant current the voltage will rise linearly, if you charge over a resistor it will rise exponentially. <S> That's because the rising voltage will cause the voltage drop over the resistor to become smaller and smaller, and hence the current through it will also decrease. <S> A lower current means that charging goes slower. <S> How fast the capacitor charges depends on both the resistor's and the capacitor's value. <S> The larger the resistor the slower the capacitor charges, and it also charges slower if the capacitance is greater. <S> The exponential curve is said to have a time constant \$RC\$. <S> After about \$5 \times <S> RC\$ the capacitor is charged to 99%. <S> 9V. <S> The capacitor's rating has nothing to do with it, that only determines how high a voltage you can apply. <S> Just look at what voltage is available, and that's 9V. Just take care that the capacitor is fit for the supplied voltage. <S> You can safely charge a 16V capacitor to 9V, but not to 25V. <A> You seem to have some basic misconceptions about capacitors. <S> The current thru a capacitor is proportional to the change in the voltage. <S> In more mathematical terms:  current = <S> K dV/dt <S> The proportionality constant K is the capacitance. <S> When the units are Amperes, Volts, Farads, and seconds, it all works out with a scale factor of 1:   <S> Amps = <S> Farads <S> * Volts / second <S> So if nothing is externally forcing the voltage of a capacitor to change, there will be no current thru it. <S> Equivalently, if nothing is forcing current thru a capacitor, it's voltage won't change. <S> If you charge up a capacitor to 9 V by connecting it accross a 9 V battery and waiting long enough for the current to go to zero (the voltage to stop changing), then disconnect it, the voltage on the capacitor will stay 9 V. <S> That is for a perfect capacitor. <S> Real capacitors have leakage , meaning a little current will leak thru them to discharge them, as if a large resistor was connected accross them. <S> The voltage rating of a capacitor only tells you how many volts you can charge it up to before it may break. <S> So charging up a 16 V capacitor to 9 V is perfectly fine since 9 V is less than 16 V, but that 16 V rating has otherwise nothing to do with how many volts will be on the capacitor in a circuit. <A> Keep in mind many caps have self leakage , so may decay fast. <S> Plastic types (polypropylene) are much better than electrolytics which are better than most ceramics. <S> If you connect a discharged cap to a charged Cap. <S> YOu can predict the voltage change from the cap value or visa versa. <S> since total charge remains almost same. <S> Q=CV
When not or partly charged there will be current if you apply a voltage to it.
Multimeter misuse by shorting a 220 voltage through it I intended to measure an AC voltage, but I forgot the multimeter on the resistance position (200 Ohm scale). I've shorted the 220V through the multimeter. The fuse is not damaged, neither the bridge, but it is not working anymore for AC voltage, it gives wrong measurements for DC voltage, and the resistance scale seems to function only on the highest position on the scale. Can I throw away the thing? <Q> Yup, sounds like it's toast. <S> Fancy expensive meters might protect themselves from something like this, but 220 VAC in Ohms mode is really major abuse. <A> Had a similar "100+V @ 200 ohm" experience recently, with a cheap chinese meter. <S> A 900 ohm one was blown open. <S> After replacing it, the meter seems to work fine. <S> It's worth giving it a try, before trashing it. <A> IC's. <S> if your Multimeter is Single Chip then ya throw it away. <S> sorry about this, I don't think any multimeter is a single chip. <S> If you really want to dig into this, then download the circuit diagram of yourmultimeter, invoke the test cases, and try to troubleshoot it. <S> You just simplydo ad-hoc troubleshooting on this, you don't simply need to concern about delta debugging like things. <S> Because it's a simple circuit. <S> it's easy to throw it away.
You can throw the thing away at any time, but it sounds like in this case that's about the only thing left to do if you don't want to salvage parts from it. I can see cheap meters not bothering with protection for this kind of event. The easiest form of protection if one were to be added would probably be a crowbar so the fuse pops. I opened it up, had a look inside and measured the SMD resistors - there weren't that many of them. if your multimeter is digital then try replacing and troubleshooting forlinear comparator
How do I build a TRRS headphone jack with a jack that is detectable by an iPhone I have a circuit and I am trying to integrate it with an iPhone via a TRRS headphone jack's microphone input. I have a generic TRRS cord and am trying to send a signal through it. However, the iPhone does not detect that a mic is even plugged in. However, if I plug it into my Mac via line-in and record, I can record the signal I am sending perfectly. I have read online that it needs to detect resistance between the ground and mic, which I have. Are there any other things I need to do? It seems like this is an issue that stems from Apple's proprietary technology, as the earbuds are from a Windows Phone before they were spliced. Thanks so much! <Q> You might want to take a look at this and check if you have the same config. <S> http://www.wisebread.com/build-a-cable-to-control-your-android-phone-while-you-drive <S> I'm sure android and apple are the same kind (I've used them interchangeably) though samsung android phones have two rings swapped. <A> I used a variation of the schematic found at http://www.creativedistraction.com/demos/sensor-data-to-iphone-through-the-headphone-jack-using-arduino/ and was successfully able to get audio into my iPhone. <S> This is what my schematic looked like for hooking up my iPhone to a Baofeng UV5R radio: <S> I've put the Eagle files up for this here: https://github.com/johnboiles/BaofengUV5R-TRRS <S> UPDATE: <S> @jose.angel.jimenez in the comments says the capacitance isn't necessary. <S> That may well be. <S> My testing wasn't the most scientific. <A> Impedance (the iPhone mic input) is a little trickier than straight DC resistance. <S> johnboiles' schematic uses some series RC for (I assume) <S> signal matching/conditioning to the iPhone's mic input <S> and he's apparently using the left (?) channel of the iPhone's output to feed the mic input on the ham radio <S> (??). <S> A 1.6Kohm resistor is a workable approximation, but isn't really impedance-matching. <A> The Apple implementation swaps the standard Ring2 (normally microphone) and <S> Sleeve (normally Ground) functions as used in OMTP <S> TRRS <S> The Apple CTIA <S> TRRS is Tip- Left Audio, Ring1- Right Audio, Ring2- Ground, Sleeve- microphone. <S> (source: Wikipedia https://en.wikipedia.org/wiki/Phone_connector_(audio) ) <S> --This pinout switch on same-connector implementation, will be familiar to those who used Avid's products in the late 1990's.---
From my testing, the iPhone seems to need some capacitance in the circuit for it to detect a microphone. Impedance line-matching has always involved a few passive components (cap's and/or coils). Still, this was the circuit that definitely worked best for me.
Is it practical to use separate MOSFETs for PWM and direction control? I have an idea for a design which I'm curious to get some feedback on. Without worrying about support circuitry, consider the following MOSFET h-bridge: The idea is that Q1 is a high-speed, high-efficiency device such as an IRF6 , while the remaining devices can be cheaper FETs, for example, a pair of FDS8984 s. My questions about this concept have to do with the behaviour and properties of MOSFETs: What are the consequences for power consumption and heat? My understanding is that most of the losses in a MOSFET occur during switching. If Q2 and Q5 are continuously conducting, does that mean that the losses mostly occur in Q1, or are the others effectively "switching" too, when the upstream supply is being switched by Q1? Similarly, what are the consequences for the timing attributes of the devices? Will the rise and fall times be just that of Q1, or is it the max of Q1, Q2, and Q5, or worse, some sum of them? The specific application being considered is a class D amplifier, but I'm looking to understand these things better generally, as the principles apply to power supplies, motor controllers, etc. Thanks! Edit to add: The reason this design (if it works) would be particularly excellent for an amplifier is that the PWM for an amp must be 200kHz to 1MHz to achieve accurate sound reproduction, but the direction will only need to be capable of changing as fast as the fastest sampling rate (48kHz). A full-bridge design also enables building an amp with a single power supply. This design is a way to sidestep the usual objection to full-bridge amplifiers, which is that it takes twice as many of the expensive, audio-grade FETs. <Q> Such circuits may be usable for motor control, but I really wouldn't recommend one for audio applications. <S> A typical PWM will behave most linearly when it's near 50% duty cycle; linearity falls off badly at the extremes. <S> In a class D amplifier, a zero-volt input signal is represented by a 50%-duty-cycle output. <S> As a consequence the zero-crossing point, which is where the ear is most sensitive to distortion, is where the circuit behaves the most cleanly. <S> This will be especially true if one is driving a reactive load where voltage and current are not in phase. <S> The behavior of a class D amplifier when voltage and current are out of phase will be relatively clean and consistent when the voltage crosses from positive to negative. <S> By contrast, in a circuit such as you describe, the transition from positive to negative voltage will trigger a sudden change in how the circuit handles the currents that are flowing in the load at the time of the change. <S> With a practical load, such currents are likely to exist and to be significant. <S> An abrupt change in them will almost certainly generate audible crossover distortion. <A> Several comments: 1) <S> The IRF6665 is neither faster nor more efficient than the FDS8984. <S> IRF6665 @ <S> Vgs=10 <S> V: <S> Rds_on_typ = <S> 53 mohm <S> Qg_typ = 8.4 <S> nC Qgd_typ = <S> 2.8 nC <S> FDS8984 @ <S> Vgs=4.5 <S> V: <S> Rds_on_typ = <S> 24 mohm <S> Qg_typ < 5 <S> nC Qgd_typ <S> < 2 nC <S> The FDS outperforms the IRF in all three parameters, so it will be faster and more efficient. <S> Your IRF is more expensive just because it has a higher voltage rating, and because it can dissipate more power. <S> 2) <S> Assuming we had a fast and efficient Q1 and slower and less efficient {Q2,Q3,Q4,Q5}: 2.1) <S> It doesn't make any sense for Q1 to have a higher voltage rating than each of {Q2,Q3,Q4,Q5}. <S> Each of them has to stand a reverse voltage equal to the supply voltage. <S> I'll explain more, if you want. <S> 2.2) <S> Capacitor losses only happen when, for a capacitor, its voltage changes . <S> If you keep Q2 and Q5 always ON, neither of their Cgs or Cgd capacitances will change in voltage (see figure), and therefore, they will not incur in switching losses (only ohmic losses, due to Rds_on). <S> Only Cgs and Cgd of Q1 will be changing in voltage and therefore the only switching losses will happen there. <S> So yes, by using that topology, you reduce from 2 to 1 the number of transistors that have switching losses, at any time. <S> 2.3) <S> You do reduce switching losses, but increase the ohmic losses. <S> Talking only about the latter ones, Q2 to Q5 will continue dissipating whatever they were dissipating, and you add a new element, Q1, with a nonzero Rds_on, and therefore new losses. <S> It won't always be the case that you will have a net benefit (it will be for high frequencies). <S> 2.4) <S> I've never seen that in digital audio. <S> I'd bet that the small benefit in efficiency (if any) wouldn't compensate the added complexity in control, added price of Q1, and added distortion (Q1 is nonlinear, and you have a discontinuity at your center range that you have to deal with). <S> 2.5) <S> The rise and fall times will be those of Q1 (and taking into account that you have the Rds_on of three devices in series, now). <S> Q2 and Q5 will not add <S> rise/fall time, if kept ON. <A> I think this is one of those things which might just about pay off, but probably not a huge amount. <S> The advantage is not immediately obvious, and may only become clear after a lot of shopping for transistors, and calculations of the benefits. <S> From the question, it sounds like the only reason for doing this is to save on part cost (which is surprising considering how much audiophiles are usually willing to fork out on equipmemt). <S> Therefore you'll have to be totally sure that the high performance transistor + gate driver, and 4 low performance transistors really are cheaper, and that you couldn't actually make the 4-transistor design cheaper just by shopping harder. <S> I'd start be carefully defining the performance spec you need. <S> Then actually go through the tedious calculation+shopping loop. <S> Selecting parts for both designs, then simulating them in LTSpice to work out the actual losses, then trying more parts based on the results of the simulations. <S> Was the performance within spec? <S> What if you swap in a cheaper transistor, is it still within spec? <S> etc. <S> It's tedious work, but the pay off at the end is two fold: 1. <S> having a more optimal (cheaper) design and 2. <S> knowing you proved wrong all the nay sayers.
If you try to use an H-bridge simply for direction switching and a separate transistor to modulate the output amplitude, it will be very difficult to achieve any sort of smooth behavior near the crossover point.
Is it possible to connect an embedded device to the internet through a USB internet Dongle? In my country (Nigeria) we have very few wireless hotspots,most people connect to the internet via private USB dongles. I was wondering if it is possible to use these dongles to allow an embedded system connect to the internet. I know that involves knowing some form of USB protocol with which these devices communicate with a system, but I don't know if there is some standard for that or something to make it generic. <Q> Wireless USB Internet dongles come in two flavours. <S> A wifi dongle connects to a 2.4GHz 802.11 network <S> (but, I don't think you mean these?) <S> A GSM modem dongle connects via the cell phone network. <S> Like a modem for the fixed line telephone network, many GSM modems have RS232 and Hayes (AT) commands. <S> The easiest GSM dongle to interface to an embedded system is one which exposes an AT command set. <S> If you are lucky then you will be able to attach directly to a UART. <S> But, you may need to implement a USB host with support for CDC/serial devices. <S> Interfacing any other dongle will be considerably harder. <S> In the best case, you might identify chips and find an open source Linux driver to port. <S> In the worst case, you will need to reverse engineer the Windows-only binary USB driver then clone it into your embedded firmware. <S> If you're really unlucky then you'll need to implement a TCP/IP stack too. <S> I recommend the AT command route, if you can . <A> I've looked into this and the other answers are correct. <S> In most cases you'll need a microcontroller with USB host support. <S> Most of the newer USB GSM/3G/4G dongles support a common USB-PPP driver so one driver could probably support many devices. <S> You'd still have to port the diver from linux which would be hard work unless you were planning to sell loads. <S> If you were planning to sell loads it'd be much cheaper/quicker to buy a GSM module specifically for designed for embedded systems. <S> These leave out the USB interface which is just an unneeded complication. <S> If you're only planning a one off or a couple, your money (and time) will be much better spent on a small Linux board (eg. <S> Raspberry Pi) with a consumer USB GSM dongle. <A> Otherwise it is effectively not possible. <S> The microcontroller would have to be capable of being a USB host, which some are. <S> However, you'd have to know the protocol of the dongle over the USB, which you are unlikely to get. <S> In effect, you are limited to systems the manufacturer has already written a driver for.
If your embedded system contains something like a single board computer that can run a operating system with a network stack, USB, and where you can install a driver for the USB dongle, then it should be possible.
Electrical installation: how to label wires? When installing it is of course useful to label the wires to avoid having to trace them when modifications become necessary. I was wondering what people are using for this. The following solutions I found unsatisfactory: isolation tape: the glue is too "liquid"/"soft" causing the tape to slide on the wire and leave sticky residue. Also it tends to become even softer in warm environments and falls off over the span of a few years. brown packing tape: while a good solution short term, the glue becomes hard and pulverises over the span of a few years causing the labels to fall off <Q> Heat-shrink labels all the way. <S> They never fade or fall off. <S> But you may not be able to use them if the cables already have connectors at either end. <S> Another great one is these twist on cable labels . <S> There are literally dozens of solutions to this problem. <S> If you want to google it, the key words are cable identification . <A> I cut narrow strips from self-adhesive labels, which I wrap around the wire and stick the ends together so they stick out as a little flag. <S> You can write a lot on a cm length! <A> I've actually struggled with this same problem. <S> I have a small home music studio with a dozen MIDI, USB and audio devices. <S> There is a rat's nest of cables and it's difficult to tell them apart. <S> My solution was to have some custom vinyl stickers made up. <S> The nice thing about this as opposed to some of the solutions mentioned above is that I was able to customize the colors and patterns of the stickers so I can tell at a glance what is paired up with what. <S> The label printers are nice, but it is not really an ideal solution for quickly identifying cables.
Alternatively, try cable clips , which can be clipped on after the connector. You can get nice little labelling machines to write neatly on them.
Simplest way to upload sketches onto "hackduino" without having a arduino duemilanove Update: The ATmega came bootloaded with the arduino software is that can simplify anything I have this board: I'm looking for a bone-simple way to upload sketches. Ideally without buying additional components... Double points if you've got a http://fritzing.org/ diagram! <Q> I'd recommend buying an AVRTinyISP from adafruit . <S> This little kit has been very useful for me. <S> It allows you to very easily program just about any AVR chip you'll run across and easily works from avrdude. <S> I bought one and have used it for everything from attiny45s to atmega328s <A> As long as your chip has the Arduino bootloader you can use the Arduino board itself to program the chip. <S> If your chip does not have a bootloader <S> then you can either burn the bootloader onto it or just program it like a regular old AVR chip with an ISP header. <S> Here is the pinout for an ISP header ( <S> both six and ten pin) <S> And the corresponding pinout on the chip <S> For more info checkout: <S> http://www.evilmadscientist.com/article.php/avrtargetboards http://arduino.cc/en/Tutorial/ArduinoToBreadboard <A> A USB to TTL-serial cable, such as this one , a bootloader in your chip, and AVR-dude ( <S> the uploader part of the Arduino IDE; if you're using the IDE, the cable's all you need). <S> If your chip doesn't have a bootloader in it already you'll have to get it in there another way. <S> The easiest way is to replace the with a pre-programmed one. <S> The first one I found is the 168's pin-compatible big brother, the 328, at Adafruit Industries . <A> Your board, in its current form, is not ready for that yet. <S> If you want to deploy sketches directly from the Arduino IDE to your custom board, then it must have at a minimum: <S> The arduino bootloader loaded on to the AVR <S> Some kind of way to accept UART (serial) communications from the PC. <S> (serial cable with max232 level shifter, or a usb to serial chip like the FT232) <S> The arduino bootloader is a program that is loaded on to the board from the factory. <S> It is the one that is responsible for accepting new programs ("sketches") from the IDE over serial communication with the PC and writes the program to a particular location on the chip where it will then run that application. <S> So how did the bootloader get there in the first place? <S> It's written there using a tool called an ISP programmer . <S> There are plenty of them out there to choose from <S> but they all do the same thing: they follow a protocol to put the chip into a programming mode and then writes directly to its flash memory. <S> If you want to get the arduino bootloader on to your blank AVR <S> then you'll have to do this and also get familiar with a command line tool called avr-dude . <S> As others have pointed out, you can actually make your own ISP programmer from an existing arduino because all you need it to do is follow that programming protocol - which is well documented and can be implemented by writing your own sketch to do that. <S> This still leaves point #2 - you'll need to find a way to hook up your PC to your board. <S> There's no getting around the fact that you'll need some kind of cable or IC or combination of both to get that done.
Since you don't want to buy any more external hardware, perhaps the best way is to buy an AVR chip with the arduino bootloader already loaded on to it as another answer suggested.
How to adjust the voltage of this SMPS? I bought this kind of module for my led light project . Unfortunately it did not come with instructions. It can be found from eBay with "3.5-28V to 1.25-26V DC-DC Converter Boost Buck Step Up Step Down Voltage Module" My plan is to set a load on the "OUT" side, set up a multimeter and turn that screw in the down middle until I get the correct reading. Is that the way to fry the board? <Q> Strange. <S> This is a single supply module, yet it has two switchers on board. <S> Anyway. <S> Yes, connect a voltage between 3.5V and 28V to the input and measure the output voltage, which you indeed should be able to adjust with the multiturn potmeter. <S> Check the switchers' datasheets for the maximum output current. <S> The right IC seems to be an LM25005 , that can deliver 2.5A. <S> May be a bit high for the coil though. <S> The left one I can't read. <A> I found the datasheets for both the LM25775 and the LM2596S . <S> Here is the typical application of the LM25775 <S> Here is the typical application of the LM2596S <S> If this is all one module it looks like the resistor values are changed by the small pot you were referencing. <A> From the picture, it seems like You assume the circuit is a "black box" and connect the input and you should get a voltage at the output. <S> The output voltage seems to be controllable via the small (blue) pot near the bottom of the picture. <S> Though while connecting your actual load you might want to ensure the current drawn is within the acceptable range of the board :)
What you have described is correct, connect the input and measure with a multimeter at the output and adjust till desired voltage is achieved.
Could someone identify this variable resistor? I'm trying to find this part online, to replace it, as it broke. However, using the text on the part, I wasn't able to find anything. Could someone help me? The board itself would be 200$ to replace, so it'd be way better if I could just use the old board and repair it. <Q> It's a 10k\$\Omega\$ slider potentiometer. <S> The "B" suffix indicated it's a logarithmic one. <S> Linears have the suffix "A". <A> It looks like a slide pot without the slider. <S> You said it broke. <S> Could it be that the slider broke off? <S> There seems to be a slot where the slider would fit in. <S> Finding the exact right slide pot replacement could be difficult. <S> Electrically any pot of the same resistance would work. <S> You can replace it with a much easier to find rotary pot if you're willing to run wires to it and turn a knob instead of pusing a slider. <S> Use a ohmmeter to measure <S> accross the ends of the pot. <S> You will need to know this value to find a electrical replacement, whether it fits mechanically or not. <A> Suppliers like Digikey have a category for slider potentiometers . <S> There are only 155 items in that one. <S> When you arrive at the short list, measure dimensions of the pin pattern of the old pot. <S> Look through the datasheets for a compatible pattern. <S> If you don't get lucky, you can do surgery on the board. <S> Your PCB by itself is very primitive: single sided, throughole components. <S> In principle, you could drill new holes for a brand new slider pot and fly wires to it. <S> By the way, what kind of instrument are you repairing? <A> It appears to be a fader resistor. <S> \$ <S> If you cannot get replacement parts from the board manufacturer, you may have to go the route of a 'compatible' fader and try your luck: Bourns pro audio <S> Panasonic EWA series
10k\Omega\$ appears to be a common value . If you know the resistance of your broken part (you can measure it, also check if it's linear or logarithmic), it will narrow the search a lot.
Reducing the sensitivity of a PIR sensor? I have several standard BISS0001 based PIR sensor modules, but lack any sensitivity trim pot. I am hoping there might be a way to reduce range/sensitivity to a very small field. Currently they are detecting motion about 15-20 feet away. Does anyone know of a way to reduce the field as low as maybe a 1 foot radius? I am using them with an Arduino Mega 2560 or an Arduino Uno. I have tried placing various objects / films in front of the sensor. Running the sensor through a tube (cardboard or PVC) seems to effectively reduce the sensor to a very narrow beam of detection, however I also need to reduce the overall range, as even with through the tube the sensor fires off at 15-20 feet away. I have tried placing plastic wrap or the reflective static free plastic that electronics are shipped in over the end of the tube, these do not seem to do the trick. <Q> You can attenuate by using thin sheets of polyethylene. <S> Polyethylene is the same material that the PIR lens is made of. <S> It will pass, but attenuate the wavelengths you are interested in. <S> Find something around .015" and begin stacking until you hit your desired range. <S> Here is a source: http://www.mcmaster.com/#polyethylene-plastic-sheets/=hc4uvj <A> You can either do this physically using an IR opaque material as Jason suggests, or electronically by modifying the sensor. <S> Most (all?) of these small PIR detectors seem to be based around a BISS0001 chip. <S> These have two amplifier stages for taking the signal from the PIR FET. <S> If you take a look at the example circuit on page 4, most of the detectors I have seen follow this almost exactly, down to the component labels being the same. <S> The resistors don't always seem to have the same values on the boards. <S> But by simple observation, you can see that for opamp OP1, it is operating in non-inverting mode. <S> The gain is R7/R8, 2M/47K or approximately 20x. <S> OP2 is in inverting mode and the gain is R5/R6, 1M/10k or approximately 100x. <S> I would adjust the values of R7 and R8 to reduce the gain and make the device less sensitive. <S> Alternatively, you could adjust R1 (connected to the source of the PIR detector) or try reducing Vref (which sets several of the voltage references inside the chip). <S> All of these require removing and adjusting components though, so maybe the physical way is easier. <A> black film may be transparent to Infra Red ?? <S> If you can access the load resistor across the PhotoDiode, (PD), then you can change the gain of the receiver. <S> Since light generates current, gain is proportional to R. PD is always reverse biased with R to V+. <S> Or if using BISS0001 chip reduce 47KΩ in spec sheet. <S> or feedback resistor between pins 16,15. <S> http://www.ladyada.net/media/sensors/BISS0001.pdf <S> I remember designing a light sequencer in the 70's using a cheap electret mic inside the drummer's kick drum. <S> Needless to say it was too sensitive. <S> So I taped the aperture and the string of spot lights which spelled the band's name sequenced with the beat of the music. <S> It worked well until they changed the sign to 1kW spot lights, and then the triacs burnt out. <A> I worked around this problem by using a prescription pill bottle and foil tape (the kind used for sealing heating ducts): <S> Cut off the top and bottom of the pill bottle. <S> Wrap the foil tape around the cylinder with a bit hanging off the one end <S> On the end with a little extra foil tape, connect that towards the PIR sensor <S> In my case the cylinder creates a field of view approx 2 or 3 feet wide and about 12 feet long (maybe less). <A> I have had the same issue with a PIR sensor I bought online (cats, and even the wind was setting it off). <S> The lid is a semi-clear. <S> I just did this a few minutes ago, will let you know how it works. <S> OK after some field work, and suggestions on this page, here is what I did: <S> Cut off the threaded end of a pill bottle <S> Duct taped a used toilet paper tube around the sensor Placed the pill bottle inside the T.P. roll <S> The IR sensor is transmitting through the bottom of the pill bottle (no modifications). <S> I can slide the remainder of the pill bottle in and out of the empty T.P. roll for a finer adjustment. <S> The wind is no longer triggering it, and when the pizza guy shows up in my driveway we will see if it goes off properly. <S> And abandoning the coffee can idea! <S> OK, so I cut off the bottom, more distance, better isolated beam. <S> Hope this helps. <A> The module you have is the old RadioShack sold, manufactured by Parallax, BISS0001 based modules, which lacked the sensitivity trim pot. <S> The way the newer ones handled it was by placing a large trim pot in series with a fixed resistor. <S> This is connected to pin 12, 2OUT <S> (2nd stage Op-amp output). <S> It is marked RL2 on the schematic below. <S> The series resistance would be between 470kΩ and 1.4MΩ depending on the trim pot. <S> In a Keyhole light I have based on the same IC, the resistance used is 2MΩ. <S> The light is only sensitive a few feet away. <S> You can attempt to change this resistance on your module. <S> The Better option is simpler. <S> Remove the Fresnel Lens. <S> The lens provides multiple benefits to the sensor, by dividing the field of view, providing a wider angle, and focusing IR into the sensor. <S> No lens, no benefit. <S> This should be enough to both narrow <S> it's view, and weaken it's sensitivity to distance . <S> If you want a single foot of distance, then try this before taking a soldering iron to the module. <S> The Lens should pop right off.
I have placed a coffee can around the sensor cut off the bottom (metal lined, not plastic) and placed the lid on it.
What is going on with these SPI transmissions? I just got a Saleae logic analyzer and I'm using it to hack a Guitar Hero drum set . The main board within the drum set talks to another sub-board using SPI. When I tap into the conversation, I see this: Black is MOSI, Brown is MISO, Red is CLOCK, and Orange is ENABLE/slave select. I notice two strange things going on here: The clock doesn't always "run". It certainly has a pattern to it: It runs when ENABLE is low (every 100 Hz). Even when ENABLE is high (which I assume to mean the slave is not selected), conversation between the master and slave occurs. Does anyone have a guess as to what is going on here? Did the board designers get lazy, or did I do something wrong when capturing the data? Details: Captured at 4 MHz The clock runs at 2 MHz, when it is actually running Here is another view, zoomed in: Obviously, neither of these pictures provide much information as to what is actually being "said", since I didn't zoom in far enough. But I think that they are enough to get my point across. If you want a different image, just ask. EDIT Kris suggested that the enable line is used to poll the slave board into sampling. This makes sense. Check out this screenshot: The small black bubbles with red outlines are instances where the software was able to decode a SPI transmission. These only occur when the enable line is low, which follows what Kris suggested. <Q> I believe the bus you're looking at simply has multiple slaves. <S> They share MISO, MOSI and CLK but have dedicated slave select lines for each of them. <S> The ENABLE signal in your waveforms is one of those slave selects. <S> You can look for other slave selects on the master chip pins if you want to test this hypothesis. <S> Note how signals seem to change polarity from one slave to another (most noticeable in the clock). <S> Maybe different slaves use different SPI modes . <A> Thorn is quite right. <S> What you are seeing is quite normal. <S> Firstly, multiple peripherals can be connected to an SPI bus. <S> They all share the MOSI, MISO and CLK lines. <S> But each one gets its own CS line. <S> (Just for simplicity, here I have not shown the MISO line) <S> If the MCU wants to send a byte to ADC1, then first it lowers CS1. <S> Then it sends 8 clock pulses on the CLK line while writing the data bits to the MOSI line. <S> While this is happening, CS2 and CS3 remain high. <S> To send one byte to each ADC, one might see a waveform like the following: <A> You said it yourself: <S> Details: <S> Captured at 4 MHz <S> The clock runs at 2 MHz, when it is actually running <S> There is also something called the Nyquist Frequency , or the Nyquist Limit. <S> Basically it says that the highest frequency that you can see is less than half of the sample rate. <S> So if your sample rate is 4 MHz, then you can only see frequencies of less than 2 MHz. <S> There is something important here that most people get wrong. <S> You can see frequencies up to, but not including , half the sample rate. <S> So at 4 MHz, you cannot correctly see 2 MHz frequencies. <S> The side effect of this is also called "aliasing". <S> What this means in practical terms is if you are looking at a signal that is close to, but <S> not exactly 2 MHz, then it will appear as if the signal comes and goes. <S> For a time that clock will be there, then it will go away. <S> This is what I think is happening in your pictures, where the clock is sometimes not there when I think it should be. <S> A similar thing can happen to your data as well. <S> To get reliable data for debugging this you need to be at least 4x, and sometimes 16x of your max frequency. <S> So for a 2 MHz clock you should be capturing data at 8 to 32 MHz.
The waveforms appear to repeat with a certain period which would indicate that the master queries slaves one after another in a loop.
Can a solid capacitor be damaged by a heat gun? I used a heat gun to solder a 32 pin SOIC IC (DIR9001) and after I was done I saw that a cap nearby (solid cap) got EXTREMELY hot and started to discolor (yellowish hue). Is it possible that the cap died? It hasn't exploded or something. <Q> What exactly do you mean by "heat gun"? <S> If this is not temperature controlled, like a hot air soldering station, then you probably damaged a lot of things, not just the capacitor. <S> Obviously this thing made air hot enough to melt solder, but you don't know how much hotter. <S> If it is not temperature controlled, then using it to solder was a really bad idea. <S> The fact that a nearby part got hot enough to discolor means you really overdid it. <S> Everything in the vicinity of the IC you abused should be considered suspect and replaced, including the IC. <S> Even if a part appears to work, it could be damaged in subtle ways and cause hard to diagnose problems. <S> You ruined a bunch of parts and possibly the board under them. <S> Replace them and move on. <A> The temperature to which you set your temperature controlled heat-gun is about 100 degrees C higher than the recommended reflow profile for ceramic capacitors. <S> A normal vapor/air reflow profile looks more like this, where Peak Temperature is between 230-260C: <S> There is more information available in these documents: AVX Processing Guidelines for SMPS Multilayer Ceramic Capacitors , vapor reflow section TDK Cap Application Manual , <S> page 48 Murata Chip Monolithic Ceramic Capacitors , page 28 <S> Basically, you want to be careful to avoid thermal shock cracks, which occur when the part is heated too quickly. <S> Move the heat gun in from a distance over the course of a minute rather than directly exposing it to 360C air. <S> Also, avoid heating the capacitor to much over 260 C for any length of time. <S> This temperature is the general maximum for most parts, including silicon parts like the SOIC you replaced. <A> Soldering with a non-temperature-controlled heat gun (and whatever other non-controlled tool) is generally a bad practice, because there is no way to ensure that the proper temperatures are used. <S> It depends on the power, the distance, the conductivity of the material compared to air... <S> So it's quite likely that you exceeded the maximum temperature for that component, and it's recommended to consider it broken. <S> Probably the same helds for the IC, which is not better suited for this kind of operations. <S> If you want to do reflow soldering, consider using a good oven and the proper solder paste. <S> And check ALL the datasheet for reflowing temperature profiles. <S> Edit <S> So it was a temperature controlled heat gun (good), but you also exceeded the normal reflowing temperature (bad) of around 50 to 100 degrees (see Kevin's graph). <S> I'd suggest you to check also the FR4 temperature specifications, because you may have damaged also the PCB itself. <S> And of course replace (if keeping the board) <S> all the components that have been heated to that temperature. <A> I used a temperature controlled heat-gun of course! <S> It is analog and not digital though, and I set it to about 300-360C. <S> I ended up replacing the capacitor (never checked if it works, though) <S> and the board works fine. <S> Thanks. <A> Of course it is possible that the capacitor damaged. <S> To deny that statement is to assert that it is impossible for the capacitor to be damaged, which is absurd, given that it was hot enough for its finish to discolor. <S> The capacitor should be assumed to be toast and replaced. <S> It's a waste of time trying to confirm whether it is good or bad since it takes less time to just put in a new one and lay all doubt to rest. <A> All electronic components have threshold operating temperatures. <S> You could have also heated some flux residue which could cause the discoloration. <S> If you are worried just find a relevant datasheet and check the operating temperatures. <S> If it looks like you could have damaged it you can easily find a replacement.
It is possible that you damaged the capacitor from prolonged exposure.
What are some ways to extend life of Nixie Tube? I'm working on a Nixie tube clock and have read that nixie tubes have a life of about a year. Does anyone know of ways to extend the lifetime of a tube? Can you use a mosfet to switch the high voltage power supply using PWM or would that just end up delivering a lower average voltage? Specifically I'm using IN-14 Tubes , and plan on driving them with 170VDC, 3mA. Any input is appreciated! Thanks! <Q> Not all are created equally. <S> Also note your spec final page end.. to operate all elements if not in use for extended periods... <S> Suggest <S> a sleep mode to disable display if inactive on 0000000 Also reduce cathode current to 1.5mA and Cathode voltage to 170 <A> I just "repaired" 3 failed IN-1 nixie tubes with a low-voltage power supply. <S> There were 2 numerals shorted together, for example <S> when '1' is powered, both '1' and '6' illuminate. <S> And yes, if '6' was powered, I would get '1' and '6' as well. <S> Using an ohmmeter I found about 5-10 ohms between the numerals. <S> It should be infinite. <S> I suspected a small metal whisker formed between the 2 numerals, so I applied a low-voltage across the 2 digits, and as I slowly increased the current I saw a small incandescent glow. <S> The whisker vaporized between 100 and 300mA. <S> Now all 3 tubes illuminate correctly. <S> Now, regarding the 2 tubes that only had a failed '1' numeral. <S> Wanna take a guess ? <S> That's right! <S> The '1' cathode was shorted to the anode as confirmed with an ohmmeter. <S> These took a bit more current to repair, on the order of 400-1200mA. They too are working now. <S> The big question is how long will they operate now; will they fail again ? <S> I will dissect the last failed tube to see if the failing numerals are adjacent to eachother, to confirm my suspicions. <S> I've read from a few sources that the ionization voltage increases with age, so the solution is to use a higher supply voltage along with a larger dropping resistor (to keep the current the same). <S> Keeping the current at nominal rating will result in less age degradation versus running at or above maximum current. <S> From my own experience, I see wildly different reliability for different tubes. <S> I have three 6-digit nixie clocks using Burroughs 5092 tubes, and after 1 year of continuous operation there have been zero failures for 18 tubes. <S> Many of these tubes are 50 years old, and they still illuminate perfectly. <S> In contrast, I have another clock with fifteen IN-1 tubes, and after 1 month of testing, I have had 6 failures (1 completely dead, 2 have a dead '1' numeral, 3 are leaky and have two numerals illuminated at the same time). <A> IN-14 are unlikely to have reliability problems. <S> They are mercury doped tubes, and therefore automatically designed as "long-life" tubes. <S> The violet tinge on the digits is a tell-tale sign. <S> IN-14s are rock solid. <S> Even IN-1 (not doped) can be used successfully, but you have to take more care with them. <S> considerably. <S> I run 3 IN-1 clock 24/7/365 and have had 1 failure out of 18 tubes in just over two years. <S> Multiplexing IN-1s also seems to help.
I have found that judicious dimming (via PWM) and blanking (turn the digits off when not in use) can increase the life if IN-1
How to power a GSM Modem from a Li-Po battery? I want to integrate an AirPrime SL6087 GSM modem into a design, this is my first try at working with a GSM module. The datasheet states that the modem draws 2A for 1mS every 4mS (max) at 3.6V, the problem is that I intend to run this project from a single Li-Po battery and want to use a buck-boost regulator so I can keep the unit alive for as long as possible (running it down all the way to 3V). The only regulator I can find capable of this is the LTC3113 but there doesn't seem to be stock anywhere. The LTC3112 is also a possibility but it's 2.5A output current is rated at 5V input not down to 3V. My question is this, there's a lot of small GSM products on the market, how do these go about keeping the power supply stable while running on a single Li-Po battery? I have this nagging feeling that I'm over complicating this... The complete datasheet for the module is only available after logging in, registration is free however. Here's a quick recap (page 20): In connected mode, the RF Power Amplifier current (2.0A peak in GSM/GPRS mode) flows with a ratio of 2/8 of the time (around 1154uS every 4.615mS) <Q> In summary, you need to go from Vin = 2.7 V to 4.23 V to Vout = <S> 3.6 V <S> Iout_peak = 2 <S> A <S> Iout_average = 500 <S> mA. <S> If you use a big capacitor at the output, able to provide the 2 A peak without loosing too much voltage, you'll be able to use a buck-boost regulator that provides 500 mA average, at the output. <S> For instance, the LTC3536 could work for you (which may deliver up to 1 A at 2.7 V input), and it's in stock. <S> Choose the output capacitor this way: <S> \$ C=\dfrac{I·\Delta t}{\Delta V}=\dfrac{2·0.0012}{\Delta V}\$, where \$\Delta V\$ is the voltage drop <S> you allow yourself to have, at that 3.6 V output. <S> The smaller the drop you permit, the higher the capacitance you will need. <S> For instance, to have a drop of only 0.2 V, you will need 12 mF (=12000 uF). <S> Also, the capacitor must have a low ESR, to be able to deliver 2 A to the load. <S> Since the LTC3536 has an adjustable output voltage, you probably want to aim at a Vout slightly higher than 3.6 V, to compensate for the drop in the capacitor, or even at a clearly higher Vout, and use a 3.6 V LDO (but able to provide 2 A peak) between the big cap and the load, to completely hide the drop at that capacitor. <S> That will allow you to use lower capacitances. <A> My experience (across four different cellular modems, both GSM and CMDA), is that they are intended to be run directly off the battery. <S> For the AirPrime SL808x series (as an example as I haven't worked with the SL6087), VCC_3V6 (which is used for the power amplifier), is rated at 3.3v min to 4.3v max, with a typical value of 3.6v -- this closely matches a nominal 3.7v Li-Po battery which may reach 4.2 volts on a full charge. <S> The digital section of the cell module (logic levels), on the other hand, runs off a 1.8v rail which is internally generated. <S> It is also output on the VREF_1V8 pin (1 ma max). <S> So you don't really need a high power buck-boost regulator at all. <S> If you need more than 1 ma to power your logic level conversion circuitry (assuming 3.3v logic levels elsewhere), you will need to provide an LDO regulator to generate 1.8v from the 3.3v rail. <A> There are many regulators which are capable of buck-boost regulation. <S> Don't limit your search to just buck-boost type regulators, you can also do this with a SEPIC or flyback topology. <S> This is also easy to do with an inverting topology: <S> Connect the battery such that it provides -3 to -4.2V, and you can output most any positive voltage (including 3.6V) which you'd like. <S> If you're interested in an LT part, it looks like there are a lot of options. <S> I did a switching regulator search for 3V minimum input, 5V maximum input, 3.6V output, and 2.2A max current which produced 644 results - and <S> those offerings are all from one company! <S> These offerings notwithstanding <S> , you have some large and fast current spikes from 2mA of sleep current to 2.2A of active current. <S> It's likely that both your battery and your regulator will have a hard time adjusting that quickly. <S> Therefore, I'd recommend boosting (always, so you just have a simple boost regulator) to 5V, putting a great big capacitor (say 220 uF) on this rail, and using an LDO to output 3.6V. <S> The capacitor will still droop under the sudden load, but the LDO will stabilize the output and the switcher will kick in before the capacitor droops too far. <S> It's only a 1.4V drop, so your efficiency is still pretty good and power <S> dissipation isn't that bad. <S> Since this is your first try, it's probably a good idea to make this one a little overbuilt <S> and later you can iterate the design to get the smallest, most efficient high-frequency buck-boost converters that can handle this load behavior. <A> For a similar project (battery powered only, gsm, autonomy time ~10days) <S> This way I won't have any consumption from any LDOs, the battery is able to supply as much current as it has and the large capacitor (maybe supercasitor) will help. <S> Great attention will be given to sleep modes. <A> 100% Practically working Solution:- <S> Actually GSM modules are very compatible with single cell li-ion / li-polymer batterris as there operating voltage is 3.6V-4.2V but not 5/3.3. <S> You can directly connect Battery to GSM MODULE.But <S> here important thing is you have to charge/dischage battery. <S> Simply you can use MCP73833/4 Stand-Alone Linear Li-Ion / Li-Polymer Charge Management <S> Controller(see <S> datasheet http://www.microchip.com/TechDoc.aspx?type=datasheet&product=mcp73833 ). <S> It will work very easily. <S> Keep in mind <S> Vbat track should be enough broad with PTH.
I'm thinking of suppling the gsm (3,2 to 4,8V input, 2A spikes) direct from the batteries (3AA backtoback=4,5volts & ~3Ah) with only a big capacitor.
Electro Optics vs Optoelectronics > What's the difference? I've seen both wikipedias of Electro Optics & Optoelectronics but I'm still confused on what the difference is. I'm currently pursuing a degree in either Physics or Electrical Engineering because optics,photonics etc and the excitement of attempting to replace electrons in computers and such has sparked my interest. Electro Optics vs Optoelectronics > What's the difference? <Q> I don't agree with what David has said. <S> If you think about it, the first word defines the type and the second defines the object <S> (warning: these terms are used pretty loosely and are probably incorrect). <S> Here's a couple definitions from Wikipedia: Electro-optics <S> An electro-optic effect is a change in the optical properties of a material in response to an electric field <... <S> > <S> Opto-electronics Optoelectronics is the study and application of electronic devices that source, detect and control light <... <S> > <A> Electro Optics is for dyslexic people. <S> The rest of us use opto-electronics. <S> But seriously, they are all the same thing. <S> Just different way of saying things. <S> I don't know the reason for the differences (probably an international translation thing), but it doesn't matter since the terms are used interchangeably. <A> Simply speaking, Electro-Optics is more "optics" and Optoelectronics is more "electronics". <S> Optoelectronics is still electronics , whose purpose/function is related to optics. <S> For example, semiconductor lasers, semiconductor optical amplifiers and semiconductor photodetectors are all electronic devices , operated by electrical current/voltage, but their functions is to generate, amplify and detect optical wave . <S> They are often referred to as Photonics too. <S> Electro-Optics refers to controlling optical properties of material using electrical field. <S> This may sounds similar to what Optoelectronics is, but they are very different indeed and they are used in different places. <S> For example, the word "Electro-Optic" is often used with the word "material". <S> Lithium niobate is a very important Electro-Optic material , the index of which changes when an electric field is applied. <S> As a result people use Lithium niobate to make optical modulators. <S> But a Lithium niobate modulator is simply a bulk material with electrodes, it is not a electronic device, thus not Optoelectronic either. <S> These are NOT interchangeable terms/concepts. <S> If this is still confusing to you, if not even more confusing, I came up with a simple rule of thumb: If the device involves a semiconductor PN junction (as in any electronic devices), it's Optoelectronics ; Otherwise, it's Electro-Optics .
In electro-optics, the important word is "optics", while in opto-electronics - the main bit is "electronics".
Identifiy the Diode-ish device I've got a component (4 of them), from a Bruel & Kjaer 2803 Two Channel Microphone Power supply -- side note, anyone have a circuit diagram for it, would make life easier to trouble shoot. The component comes from the 28V pre-amp power supply subsystem, and the four of them are kind of connected in a bridge-rectifier type configuration, but not quite. It has the marking "ER 21" on it, and a symbol that looks similar to I'm looking to replace the components, so I need to know what I could replace them with <Q> Have you checked if they are actually diodes? <S> I've taken apart old electronics, and seen devices in a very similar package that were just diodes. <S> In the early days of silicon diodes, they came in a lot of odd packages. <S> I would bet that the tapered end is very likely the cathode. <S> Try using the diode-check option on your multi-meter. <S> They're probably just simple silicon rectifiers. <S> If so, you can replace them with inexpensive 1N4001 diodes, or similar. <A> Perhaps the symbol you mentioned is supposed to indicate a Schottky diode or a Zener diode. <S> (I tried to upload the symbols from http://en.wikipedia.org/wiki/diode ; I don't know why they don't show up here). <S> I've seen a few tantalum capacitors with an axial package/case that looks similar to that -- a cylinder with a chamfer on one end: (picture from http://www.digikey.com/us/en/ph/Vishay/TANTALEX.html ) <A> I've seen these in 1970s Radford (UK) solid state hifi amps and preamps. <S> But then I have a curve tracer :-) <S> Or else leave them be.
They were rectifier diodes when I encountered them, but I would bung them on a curve tracer to double check they aren't Zeners. Considering that this is an older piece of equipment (googling Bruel & Kjaer 2803 gets me documents from 1967), it's probably just a early silicon diode. It wouldn't surprise me if that was actually a diode.
PIC32 running a program from RAM Wondering if anyone has tried running an entire program on a PIC32 out of RAM? How would one go about doing that. I understand that you can use the ramfunc keyword to move certain functions to RAM however they still require the copy to be on Flash. What I would like to do is have a loader program on the PIC32 that can accept a hex file over the serial port etc and rather than writing it to flash have it run out of ram directly. Ideally I was hoping that by modifying the default linker script you could target a program to run from RAM alternatively if anyone knows how we would patch up a program that was linked to run from flash to run from RAM that could work too ThanksMike <Q> Both the longramfunc and ramfunc attributes place the function in a special area of flash that will be copied to RAM by the startup code. <S> You don't want to use them. <S> For functions which will be called from flash, you want to use the longcall attribute which specifies that a 32-bit call (JALR) is needed instead of a 28-bit call (JAL), since flash and RAM are located in separate 512MB segments. <S> The longramfunc macro also includes the longcall attribute, whereas the ramfunc macro does not, and is intended for calls from one RAM function to another. <S> In your case, for functions called by other RAM functions, you do not want to use the ramfunc attribute because it sets up the copy from flash. <S> Since you will be copying the functions yourself (e.g. off of an SD card), you will need to include your own loader that interprets the hex code and copies the data to flash as needed. <A> You have three basic solutions to your problem of wanting to download programs to run after flashing the part. <S> Use an interpreted language like Lua, Basic, or Forth. <S> Write (or, more likely, just port) an existing virtual machine that interprets text instructions rather than machine code, and download the program as text. <S> You have to reimplement your program in the interpreted language, but that's quicker and easier (in Lua especially) than writing it in C. <S> Just get some extra storage and reflash the whole part. <S> You haven't described what you're doing, so I can't know if this is applicable, but it's easy enough to add a serial Flash IC and/or microSD card with plenty of storage to your board and have the bootloader select a profile to run. <S> At a Flash lifetime of 10,000 rewrites, this gives you 27 years of once-per-day reflashes. <S> Do what you originally intended. <S> This will require some careful programming (see tcrosley's answer for some methods required) and some fancy linker scripts. <S> Good luck. <S> Largely adapted from my answer to 'Compiling code to run from external RAM' ; a similar problem. <A> The easiest way to make library of DLLs that will be run from RAM one at the time - make a helper project, include in it some functions that will be run from RAM, (debug it on real hardware if needed), then make UART2 subprogram (in this helper project) that saves RAM in hex format from locations indicated by map file (generated by linker). <S> Run this program on emulator and make it save RAM contents to file (it will be UTF8 coded, so convert it back to ascii). <S> Here you are - the memory image of the first DLL is done. <S> Your project may load this image from SD card and call first function (which should be the same i.e. not the body of function is <S> the same but just declaration must be exactly the same, and at the same place in helper and in main project). <S> Then you pass to that function pointer to the table of pointers to functions and other structures that functions in RAM may need to use from main program that resides in flash memory. <S> Proceed with the rest of DLLs you need.
You will also need to set up a custom linker file with an executable RAM section, and include that section name on every function that is placed there.
Is it possible to calculate effective value of a signal from its average value? I have a signal which I want to calculate its effective value. The signal is a voltage value read on a 33.3m\$ \Omega \$ resistor connected series to a 220V AC power line. My aim is to calculate the reactive power transferred on the power line. (Frequency is 50Hz. Vertical scaling is 10 mV/square for both signals.) I obtained the "Filtered Signal" by the circuit below: The filtered signal can be assumed to be a DC voltage level. Its value read from the oscillator screen represents 150mA current level through the current sensing resistor. This is the average value of the current flowing on the power line, isn't it so? However, I need the effective value of the current in order to calculate the power. Since the current on the line is not sinusoidal, I cannot calculate the effective value from those simple AC voltage wave formulas. So, what can I do? I'm stuck at this point. Is there any way of calculating the effective value of this current from these available data, or any way of calculating the power directly? <Q> This is the average value of the current flowing on the power line, isn't it so? <S> However, I need the effective value of the current in order to calculate the power. <S> Be careful. <S> If the shapes of the currents or voltages are not sinusoidal, knowing the RMS values for them, and the phase difference between them, is not enough. <S> \$P=\dfrac{1}{T}\int <S> v(t)i(t)dt \$ <S> Nowadays, that is usually done in the digital domain. <S> You have two ADCs (or a single ADC with two S/H front-ends). <S> One converts v(t) and the other one converts i(t). <S> In the digital domain, you multiply those two signals, and do the integral. <S> You can also do it in an analog way, using an analog multiplier and a low pass filter, but analog multipliers are tricky to use. <S> In summary : the circuit that you posted, that filters the shape of the current, is not valid for computing power, if the current may have the shape that you show in the figure. <A> "You can't get there from here" :-) <S> - ie there is no practical (or known, in the general case) <S> ) way to get what you want using the heavily filtered average current value that you have. <S> For signals which depart more than a little from pure sine waves you need to take account of the waveform. <S> For reactive loads you also need to know the time relationships of the voltage and current waveforms. <S> For the waveform shown, which is immensely non sinusoidal, the result obtained from using the average current value will be unrelated (except by chance) to the actual value. <S> Your RC filter with 5 sets of 10k and 1 uF will filter well enough but it is not a formal 5 stage filter in any usual sense. <S> A properly designed filter using one or two opamp sections will have a vastly superior performance as a low pass filter. <A> I'm guessing by "effective value" you really mean RMS. <S> Please be more specific next time. <S> No, you can't determine the RMS value from the average. <S> Sorry, but the math just doesn't work out like that. <S> For example, the average of a sine is zero, but its RMS is <S> it's peak divided by the square root of 2. <S> Even something as simple as a 0-5 V square wave doesn't work. <S> The average is 2.5 V but the RMS is 3.54 V. <S> I just doesn't work that way.
For arbitrary waveforms (as in your figure) for either one of the two (voltage or current), the only way to have an accurate calculation of the power is by integrating the product of the instantaneous voltage and the instantaneous current.
Why do DMMs have a capacitor on their AC measurements? see answers to this question . Is a capacitor really necessary? And wouldn't it make measurements frequency-dependent? <Q> A series capacitor acts as an high-pass filter, also known as AC-coupling capacitor. <S> The reason is that for DC current, a capacitor is like an open circuit, whereas for higher frequencies (depending on C and the other resistances) it becomes more like a short circuit, if it's big enough. <S> The measurements will be indeed frequency dependent, but if the frequency is high enough the signal will fall in the right part of the curve, which is approximately flat. <S> So it's an useful tool, but to be used carefully. <S> The same happens with scopes, where leaving the AC coupling on when measuring signals will distort them, like this square wave: <A> A series capacitor is not necessary to measure AC. <S> A capacitor to ground may be used to filter the derived DC. <S> Some meters do not utilise series capacitors. <S> The meter in the previous question MAY use a capacitor somewhere in the circuit <S> but it is at least partially DC coupled as it reads 2VAC for every 1VDC when DC is applied. <S> I have seen this behaviour frequently in the past with analog meters. <S> The meter in the previous question may be an analog meter. <S> Use of a series capacitor allows DC components to be easily eliminated. <S> This may or may not be desirable depending on the circuit used. <S> A series capacitor will cause some low frequency roll off but as the circuit can easily be very high impedance overall a modest value of capacitance will allow almost 'flat'measurement at mains frequencies. <S> " <S> AC" is usuallty 50 or 60 Hz in the large majority of cases. <S> If one will allow of the use of the dread Gargoyle in an answer then this link will be most informative regarding typical practice <S> Below is the circuit of an entry level "yellow' multimeter as found in zillions all over. <S> Circuit diagram quality is only about 0.27 Olins but sufficeth for this task. <S> It appears to use a simple half wave rectifier with no series capacitor. <S> C_unreadable at left centre to the right od <S> D_unreadable aoppears to be smoothing of sorts. <S> [Far better circuit both in circuitry and in Olins is here and many more via gargoyle image link above. <S> Note: <S> Use of Gargoyle image link here seems a very very good and appropriate use of the facility in an answer. <S> If any disagree please advise and my second will call. <S> [ :-) ]. <A> You would only get a wrong reading when measuring DC. <S> If your AC signal is superposed to DC the capacitor will block the latter and only let the AC pass. <S> The circuit which converts the AC to it's average will give a wrong reading if there's a DC component present. <S> And yes, the result is frequency dependent. <S> A DMM will be tuned to measuring mains frequencies, i.e. 50Hz or 60Hz. <A> DC can't cross the capacitor - only the AC components of a signal can. <S> If you want to measure only AC then some method to block the DC component of a signal is necessary. <S> It will cause some frequency dependence, but the manufacturer can match the capacitor size to the internal resistance of the measurement device and choose the frequency response of the circuit to accommodate most signals. <A> In fact, and now that you ask, a "true-RMS" volt/ampmeter should not have a capacitor in series, because the true RMS of a DC input is that DC value itself, and a series capacitor would just make that reading impossible. <S> Anyway, to answer your question, yes, a capacitor makes the measurement frequency dependent.
If the AC signals you want to measure are pure AC, without DC component, it would be better not to have the series capacitor.
Understanding voltage and current While reading "Electronics for dummies" went through the following block and I realised that I have some uncleared concepts about electricity: Electrostatic discharge involves very high voltages at extremely low currents. Combing your hair on a dry day can develop tens of thousands of volts of static electricity, but the current is almost so negligible you seldom notice it. The low current prevents the static discharge from really hurting you when you receive a shock. Instead, you just get an annoying tickle I thought that voltage is the driving force that drives current, and the magnitude of generated current depends upon the resistance attached between terminals of a voltage difference, if so then why is there a low current generated by tens of thousands of volts of static electricity? if 220 volts in socket can electrocute then why not this tens of thousands of volt can? the resistance is the same i.e. the body <Q> I like being graphical. <S> Your hair, when charged electrostatically, acts like small capacitors charged to high voltages. <S> The energy stored in those little capacitors is finite and small, and so it can do little harm to you. <S> On the other hand, a 220 Vrms outlet has a much lower voltage, but it is an unlimited source of energy. <S> Even acting upon the same load resistance, this is much more dangerous, because all that extra energy means it can cause more heating of your tissues, and therefore more damage. <A> This is like asking, if I pour a cup of water off a skyscraper, why can't that drive a turbine to produce some meaningful electricity? <S> It's got the gravitational potential, so what's the problem? <S> After all, hydroelectric dams not as tall as a skyscrapers generate many megawatts. <S> Static electricity can have the capacity to kill. <S> This occurs in nature and is called lightning. <A> Well the description is a bit unclear there. <S> That limits the time duration during which the current can pass and limits the amount of damage that can occur. <S> Over time, the current is indeed low, but the point that needs consideration here is that the current basically goes through to stages: <S> The part where you have current and the part where you don't have current. <S> The part during which you have current lasts for only a short time and during that time, the current is result of the voltage and the resistance of air (which is pretty complex as air has non-linear resistance). <S> Over time the current decreases as the electrostatic charge is depleted and the resistance of air changes due to air movement. <S> The resistance of a volume of air through which the current is passing tends to decrease over time, but that air heats up and expands and moves away from the source of discharge meaning that the total resistance increases because the length of the conductor is increasing. <S> This lasts for a very short time. <S> At one point you reach the part where the resistance is too high to maintain the arc (or alternatively you reach the point at which the charge has been depleted) <S> and then the arc breaks. <S> From that moment on, you don't have any current. <S> Another point is electrocution. <S> For that you need not only sufficient voltage but also sufficient energy. <S> An electric outlet at say 220 V can provide "large" current for very long time (compared to how long the arc lasts) and that allows large enough transfer of energy which is expanded to damage tissue. <S> That energy doesn't exist in case of usual electrostatic discharge. <S> How electrostatic discharge works can be seen in this simulation. <S> Notice the time on the lower right part of the black screen and click on the switch and see how quickly the capacitor discharges. <S> Something like that happens with electrostatic discharge too. <A> Recall that current is the amount of charge that moves through a slice of conductor per unit time. <S> I think the text's mistake is to conflate charge with current. <S> Ohm's Law still holds, the current itself will be high...for the duration of the ESD event, which is on the order of microseconds or around there. <S> But the charge itself is very low, so the current cannot be sustained. <S> If you were to measure the current in units of "charge per microsecond", you'd see a high current for a brief period, but if you measure current in "charge per second" (i.e. amps) <S> then it doesn't look so large. <S> So even though there is 5000 V on the cap, there's so little charge that it can't cause much damage; once the ESD event occurs, the charge is all gone, and no more current flows. <S> And while there's "only" 220 V coming out of the wall, for all intents and purposes it has unlimited charge, and it will continue pumping charge into whatever is connected to it for the duration of the connection. <A> When we talk about voltage, we refer to the potential difference between two points while current is the rate of flow of charge. <S> The notion of conductors and insulators is very relevant here. <S> In conductors, there exists free electrons which allow the flow of current but in insulators, there are very few free electrons so current flow is restricted. <S> With a large potential difference, if the material is an insulator like your hair then little current can flow to hurt you. <S> But if thoselarge voltages were developed in a conductor, there is a rush of current. <S> Think of a conductor as a valve that is open and an insulator as a closed valve. <S> Imagine the water pressure as the potential difference and the water through the valve as current. <S> when the valve is closed i.e an insulator then little or no water flows through but when the valve is open <S> i.e a conductor there is a flow of water i.e current which depends on water pressure i.e potential difference/voltage. <A> That is assuming a source that can provide the current. <S> Electrostatic build up has a limited potential, lighting would be on the opposite end and a rotor craft somewhere in the middle. <S> In any case you can not use more than whats there getting that level of static to kill you is hard but not impossible.
With electrostatic discharges you get lots of both instantaneous current and voltage but little electric charge.
Securing PCBs - Screws Vibrating Out I am curious what methods are most suitable for securing PCBs. I have a large PCB which is fixed to a sheet metal enclosure using #4-40 x 1/4" stainless steel screws. The receiving end is a #4-40 captive standoff (PEM product). Initially I was not doing anything to prevent the screws from vibrating out. Sure enough, I started getting complaints that the screws were backing out just during shipping alone. So, I started to use a loc-tite product. This works well, but it's very labor intensive to put a drop on each screw. I have not used a lock washer as it tears up the PCB. Any suggestions? <Q> Crinkle washers (aka wavy washers) do the same job as shakeproof/star washers and don't damage the PCB. <S> They can also be removed and re-tightened more often than star washers without degradation. <A> There are a bunch of options. <S> You are encountering the "Quality costs money" paradigm that shows up in production. <S> In production it is also super important to make decisions - not on how something seems but on actual measured results. <S> Perhaps brushing the heads of the screws with locktite seems labour intensive. <S> But if you measure the time/cost for an assembler to do this it may be less expensive than your alternatives. <S> Now it sounds like you've got <S> pem inserts pressed into bent metal. <S> There are plastic inserts that have tangs for capturing the board. <S> They have a wide base and press in through a hole in the metal and use tangs for stability on the metal side. <S> The plus side: no screws or screw drivers. <S> Low assembly cost. <S> Down side: its hard to design them in after you've gone to production with metal pem insert design. <S> Maybe next time. <S> A bit tricky to assemble. <S> Another option is self tappers into plastic inserts. <S> These are smaller profile than the snap-in inserts above, and still require screws and screw drivers. <S> But you might get away with them after going to production. <S> Use self tappers where you can. <S> They bite in for good retention. <S> And anything threaded adds cost to the piece parts. <S> Better yet - use snap-ins. <S> Torque spec. <S> Use a torque screw driver when inserting the screws, whether pneumatic, electric, or hand driven. <S> Figure out the best torque setting and use it. <S> The screws shouldn't be backing out that much that often that early if they are torqued in. <S> All that: maybe a quick brush with locktite doesn't cost that much. <S> Remember: "Quality costs money." <A> You may also consider PEM <S> SNAP-TOP Standoffs or similar? <S> They install into steel metal and there are no loose parts to drop. <S> See NASA Reference Publication 1228, Fastener Design Manual for more information.
Another option is self tapping screws into the metal with plastic tube standoffs. I personally err away from crinkle washers etc; they've been proved to be mostly useless and in some cases detrimental.
Using Vin pin on Arduino with a shield I just bought a wifi module shield and using it with Arduino. I power Arduino (with the wifi shield on it) via USB from the PC. I need to demonstrate it without using the PC as a power supply. And I cannot also use 2.1 power plug or 9V adapter jack since i don't have that component. I don't have time even to buy that. So the only option for me is to use the Vin pin with a 9V battery. I am just afraid if i may damage the wifi shield or Arduino. I read some warnrnings about that. Is the Vin pin used only with Arduino without a shield on it? Thanks in advance, <Q> When you are realy in such a hurry, you could attach the wires of the battery with some tape to the spots I marked in the picture. <S> Maybe the bottom is easier to get the wires stick to. <S> When I remember right (1) is +9V and (2) <S> is GND. <S> The integrated diode should prevent damage, if you connect it the wrong way. <S> After taking a look at the schematic <S> I would mean, that connecting the battery to VIN is save. <S> Just be carefully not to change polarity, because you skip the protection diode. <S> This forum thread approves my thought. <S> In the comments you asked, whether you could use an additional external diode to increase safety. <S> In my opionion this is not neccessary. <S> It is just getting more complex. <S> Get two colored wires (black, red) and connect them to the battery, so you can immediately see whats GND. <S> When you connect the wires, just pay attention . <A> Vin is not the correct pin, it is related to the reference Voltage of the ADC's only. <S> I stand corrected. <S> I confused AREF with Vin. <S> I've used the +5V and GND pins before which worked for me with a 5VDC power supply, but I don't think the normal voltage regulator likes being reverse powered and <S> will eventually die from it. <S> I just read you are using 9V battery; in that case you can use the jack plug only!! <S> What do you mean by not having it? <S> Is the voltage regulator missing too? <A> The Arduino VIN pin is connected after the Barrel Jack and Reverse Protection Diode, and before the 5v regulator. <S> It is designed to have power input there. <S> What you normally should not do is provide power directly to the 5v pin, unless you are sure of what you are doing. <S> The Wifi shield uses the VIN pin as well, to power it's 3.3v switching regulator. <S> You may find it hard to insert a wire into the VIN pin socket, AND have the shield plugged in at the same time, but due to the design of the Arduino shields using pass through extended lead headers, you can plug in the 9v battery to the Wifi shield's VIN pin header and it will work for both.
One of my Arduino's has a little jumper link on it especialy for this purpose, being powered from USB, directly powered or through a higher voltage on the jack.
Solder doesn't stick wires to connectors I'm always having problems soldering wires to connectors. I've read through the Solder won't stick question, but nothing there seems to have helped. Here's my procedure: If the connector is being difficult, I rub the surface of the connector with fine-grain sandpaper to clear any oxidisation. Get my iron up to about 175 deg C (it's a temp-controlled iron) Brush the tip across a damp sponge. Add a small spot of solder to the tip. Line up the wire to the connector, usually with a clamp. Hold the tip of the iron on the connector for a short time. Push some solder onto the wire at the edge of the tip, so the solder melts onto the wire. Remove the iron. Brush the tip across the sponge again to clean off the excess solder. The problem I'm having is that the solder just doesn't stick the wire to the connector. It usually holds for a second, then unsticks from the connector as soon as the wire moves. I've tried more solder, less solder, different solder - same issue. I've started to notice the same issue when soldering onto stripboard, too. The flow seems to be poor, the solder doesn't look shiny, and it's all rather viscous. Am I doing something wrong? Is my iron / tip bad? <Q> 175C is pretty low for soldering. <S> Low temperature lead solder ("63/37") melts around 185C, RHoS solder even melts around 250C. <S> The solder flows fast and evely if the pads/pins have the right temperature. <S> If you have problems with soldering in general check <S> solderingguide.com , the soldering is easy comic or the tons of videos on youtube . <A> Apply flux to both the connector and the wire. <S> Stay away from lead-free solder <S> ; use 60/40 Tin/Lead solder. <S> Use copper wire. <S> (I've rarely seen solder not bond to copper wire; what are you using?) <S> Simultaneously heat both parts that are being soldered. <S> The solder should flow onto both of them. <S> You will see that the flux assists this greatly. <S> Flux is very important. <S> Never use the abrasive to clean the tip of your soldering iron, by the way. <S> (In case you're tempted.) <A> Speaker wire can be of several types. <S> One type uses two different coloured wires to make it easy to keep speakers in phase. <S> This type commonly uses copper for one wire, giving a reddish colour, and aluminium for the other, giving a silver colour. <S> Copper will solder easily. <S> Aluminium won't. <S> For aluminium, ALL the soldering advice above is of no value or use. <S> Aluminium CAN be soldered - with specialist techniques, solders and fluxes. <S> Not easy to do at home, especially if you are not skilled in the technique needed. <S> One problem is the oxide layer which forms immediately on exposed aluminium surfaces. <S> If your attempts at soldering just result in the silver wire not tinning, but disappearing in a black gunge, that is the oxide layer forming and disintegrating. <S> If this is your problem, crimp the wire, or buy some wire which is not aluminium.
When it heats up, its acidity "eats away" the thin layer of corrosion that can prevent the solder from making contact with the metal. You also do not seem to use flux - do it.
Power management of sensor IC I am using Microchip TC77 temperature sensor with a battery application. I would like to know if it is worth to turn it on and off let's say every second. Or is there some kind of overhead from the powerup process? <Q> Don't keep removing and reconnecting the supply to it. <S> Keep it always powered, and write to the Configuration register to put it in shutdown mode (1 uA max) and bring it back to normal operating mode (400 uA max). <A> From the datasheet (p.9): The first valid temperature conversion will be available approximately 300 ms [...] <S> after power-up. <S> The table under DC characteristics even mentions 400ms as maximum. <S> So if you power it up once every second it will still have a power duty cycle of 40%. <S> Yes, you can improve on that by sampling less frequent; in 1s temperature won't change much. <S> Anyway, maximum supply current is 400\$\mu\$A, so at 5V that's 2mW, which your battery probably can spare. <S> I would leave it on. <S> That 2mW won't influence your result much either; the sensor is 1°C accurate (which is not bad at all), and 2mW on a PCB <S> mounted SOT23-5 won't cause that large temperature rises. <S> edit Note that the TC77 will measure the temperature of the PCB, not the air's temperature. <S> That's because thermal resistance in conduction is way lower than in convection, which is the way heat is exchanged with the surrounding air. <A> According to my reading of the TC77 datasheet : Time to first conversion after a power on or power up from standby is 300 mS typical, <S> 400 mS maximum. <S> Standby current is 1 uA worst case or 0.25% of worst case operating current. <S> It is not immediately obvious that entering standby rather than powering off confers any advantages <S> NB: Standby mode can be triggered either by SPI command OR by reducing Vsupply to <= <S> 1.6V <S> (typical) <S> [Section 3.2 page 9]. <S> Whether PI command, Vdd voltage reduction of turning off is superior depends on you application. <S> Assuming worst case supply current, <S> standby current ignored shutdown immediately after one conversion cycle, coms time minimal, then - Supply-current reduction fraction = <S> Kcr say = 400/Tcyle Tcycle is time in ms of all of (wakeup, read, shut down, sleep cycle). <S> So eg for Tcycle = <S> 1s = <S> 1000 <S> mS cycl <S> Current reduction = <S> 400/1000 <S> = 40%. <S> ie mean current is 40% of what it would have been. <S> eg <S> 160 mA instead of 400 mA. Extending tcycle to 5 seconds gives 400/5000 = 8% of original or 92% saving. <S> SPI line Loading and self heating <S> : The data sheet notes that self heating can cause errors of up to 0.5% if the SPI lines are loaded to the maximum level allowed. <S> Keeping SPI output loading as low as reasonably possible is recommended.
On off or standby cycling will also reduce self heating, but the effects will be liable to be minimal if SPI loading is not high.
Sensing signal on a power line from high side I have a circuit design as above. I'm trying to sense the voltage difference accross the \$ 0.1 \Omega \$ resistor. I physically connected the sensory circuit to the low side of the AC line, and saw that it is working alright. I'm going to make a boxed circuit of this, and I'm going to connect it to the wall outlet with a standard plug, seen as below: The plug is symmetric. I can accidentally connect it reversed (on the other hand, i don't want to check the polarity every time I'm connecting it to wall outlet). In that case, the sensory circuit is connected to the high side as seen below: My question is,What happens if the sensory circuit is connected to the high side? Would a terrible thing happen? Do I need to do any modification on the overall circuit for making it connectable to the high side? Supose that, RMS of the AC is 230V. VCC is 5V, and it is electrically isolated from the AC by a transformer. All circuit elements are rated to work between -5V to +10V.The electrical device drains small current (below 10A RMS). This question is not about personal usage risks. Please focus your answers on the circuit level, about the risk on the circuit elements. <Q> If VCC and GND are electrically isolated from Phase, Neutral and Earth, it doesn't matter the direction with which you connect the plug. <S> Your sensory circuit doesn't even know there's 230 VRMS somewhere else. <S> It will just see the voltage across the current-sense resistor. <S> I have to think that what is right is the schematic, and that you think they are electrically isolated, but they are not. <S> You wrote " This question is not about personal usage risks. <S> Please focus your answers on the circuit level, about the risk on the circuit elements ", and I gave you an answer according to that. <S> The one-wire (or two-wire, with little volts between them) connection between the mains and your sensory circuit won't do any harm to your circuitry, and won't distort any reading, but just remember: <S> YOUR SENSORY CIRCUIT DOES NOT SEEM TO BE ELECTRICALLY ISOLATED FROM THE MAINS. <S> If you touch any node of your sensory circuit, you may die. <S> So, be very careful if you have experience with such circuits, and do not build anything if you don't have such experience . <A> The answer depends on your "sensory circuit". <S> As you have provided zero information about how the sensor works and have not included the utterly obligatory actual circuit diagram then it is not possible to answer your question with certainty. <S> You say to ignore safety <S> but the fact that you are asking this question at all strongly suggests that for a competent person to answer this question and to ignore safety would be dereliction of duty. <S> Indications are that the circuit will work as well with the sense element in either lead. <S> Your statement that "it is working alright" should be treated with great care. <S> The connection between sense circuit ground and one input pin does not make sense if the unit is electrically isolated as stated. <S> If the 0.1 ohm sense element goes open circuit then some of all of the whole input side of your interface goes to phase in either configuration shown. <S> Your transformer must, of course, be rated to handle worst case voltage input (say 250 VAC+) and inductive spikes and general surges or dips. <S> Added: <S> What has happened here so far is extremely unsatisfactory and potentially dangerous and life threatening. <S> A member who is keen to learn but who has a limited grasp of electronic and electrical fundamentals (based on prior questions and comments) asks people to trust him over his ability to do things safely with mains voltages. <S> Based on the information given , which is inadequate when dealing with mains, there is a significant chance that events well within the range of normal may kill the questioner or a friend or family member or random stranger. <S> Odds are this won't happen. <S> @Kortuk - your thoughts on this may be of value. <A> AC isolation aside as requested, although it may cause certification issues. <S> In the first circuit, input 1 sees +/- <S> 1.41 V, and input 2 sees 0 V. <S> In the second circuit, input 1 sees 0 V, and input <S> 2 sees <S> +/- <S> 1.41 V. <S> You say your sensor can withstand these voltages. <S> If it also produces the correct results with these voltages then you're in luck.
Update : It is hard to tell whether your sensory circuit is in fact electrically isolated or not from your mains, because the text in your figure says they are, but the connection between your "mains side" and the GND of your sensory circuit, according to the schematic, says they are not. It is even likely that the precautions taken are adequate. This may be a safety issue but in the absence of a circuit we cannot be sure. But this is by no means certain and competent annswerers need to be more discerning than has been the case so far.
Female header with common pins? I'm looking for a .1" pitch female-female or female-male header with common pins, i.e. all the pins are connected. I'm sure it exists, I'm just having trouble coming up with the right keywords to find it on google. I want to use it as a cheap way to expand the ground and 5V terminals on an arduino without needing a whole shield. <Q> Then solder the lead to each pin. <S> In the following image, the green line represents the lead, and the red ellipses are the soldering points. <A> If you have your specs or already have an idea of your application, catalogs are better places to look for things than Google. <S> From my answer on a question here: Try exploring catalogs like the one from RS or TE's picture search . <S> the industry has to offer. <S> Some are even better by providing you application tips and advice. <A> To expand those ports I would probably make a small shield with a proto board and male headers to plug-into the Arduino. <S> Then connect a female header on top of both the 5v and ground males and solder all the female leads together for each. <S> A less elegant solution would be to just plug the first lead of a row of female headers and bend/solder all the others together. <S> With both of these options the 5V is running through the Arduino so you should check to make sure drawing lots of current or back voltage won't occur. <S> Otherwise you could get your +/- <S> from the actual power source and run a line off to power the Arduino.
For a cheap solution, I would cut one lead off of a resistor, then lay it across all of the pins in your female-male header. Most catalogs will give you an idea of the keywords, specifications, and common parts
Hand crank DC generator - a simple dummy load that won't burn out? I'm working on a project that allows a user to crank a hand generator while current and voltage sensors measure the output. After the user finishes cranking, software displays information about how much power was output. This is the generator we're using: http://windstreampower.com/Human_Power_Generator.php It seems like it should be a simple problem. However, in the current setup, I've been using the provided 12V voltage regulator and feeding power into 12V incandescent bulbs, and once the rig gets under heavy use, the voltage regulator burns out, and the bulbs blow. The setup is like this: Hand Crank => 12V Voltage Regulator => 12V Incandescent Light Bulb (50W) So, I'm wondering if there is an alternative approach to this configuration (we don't need light bulbs or anything visible). Maybe feeding the crank directly into a 12V battery with some type of charge regulator and a constant drain? Maybe connecting the generator to several bulbs in series? What is the simplest, most inexpensive dummy load we can attach to the generator, just so we can get current and voltage readings of the user's output while they crank? <Q> If you happen to have a car battery available, that would work fine. <S> You'll also have your muscle work charging the battery, but I don't know how relevant that is in your setup. <A> You need power resistors (e.g. from Ohmite ). <S> Simple, not that expensive (~$5 US). <S> I wouldn't mess around with the regulator. <S> EDIT: <S> As @Alan Christopher Thomas pointed out, this will get hot. <S> For extended use (more than a few seconds) consider an additional heat sink. <A> Cement resistors (caution, may get hot with enough current): <S> Note that resistor value will affect braking torque, i.e. the less the resistor value, the harder it will be to crank your generator quickly (probably not much difference at slow speeds). <A> One rather obvious solution is to drop the regulator and just use an incandescent bulb (or network thereof) which can take whatever voltage the generator puts out. <S> As a bonus, the user will have to crank hard to get the light bulb to grow more brightly and and at a higher color temperature. <S> With a regulator, there is no additional feedback for faster cranking once the regulator has enough input to maintain the voltage clamped at 12. <S> (No additional feedback other than the voltage regulator blowing out, that is, haha). <A> I am currently experiencing the same problem with a similar generator http://windstreampower.com/443540_PMDCG.php . <S> I feel that using a dummy load produces too much heat in my application, where the speed of the DC generator cannot be predicted or regulated by mechanical means. <S> I am currently considering some PWM approach for current limiting but in my system, I have no stable voltage reference to drive the gate on/off. <S> This is a problem I have not yet solved. <S> Another consideration is this: the generators are rated to produce more current for short periods of time, and of course, the body of the generator will heat up. <S> However, during this period ( 10 min or 15 min ) <S> the generator is quite usable, and to waste that usable current by a resistor seems wasteful. <S> A better approach would be to allow the generator to run over-rated for an allowable time, and then apply limiting. <S> When the case temp gets to high, switch on the current limiting circuit. <S> How to realize that current limiting circuit is still unknown to me. <S> I am charging up a bank of supercapacitors rated at 25V. To the DC generator, they appear as a very high load indeed, a dead short when V=0 on the bank.
A thermistor could be attached to the body of the generator and monitor the case temp. There is no way hand cranking can overcharge a car battery, and it will maintain the voltage fairly steady.
Using a counter to reduce pin counts for SPI slave selection I've got five SPI SRAM chips, which I want to control off a single Arduino. I've seen setups like this, which share SCLK , MOSI and MISO , with separate SS pins: (image courtesty of Wikipedia) However, I'd like to avoid using five pins for separate SS enables. I'm considering using a counter to select the different slaves, so I can cut the count down to 2 pins. The idea is to use two pins for the counter's direction and clock. The code would look something like this: int currentSlave = 1; // on setup I'll set the counter to 1void SelectSlave(int id){ // error checking if (id < 1 || id > 5) Serial.writeln("Invalid slave ID passed to SelectSlave."); // calculate the ID difference int diff = abs(id - currentSlave); if (diff == 0) return; // no need to do anything if (id > currentSlave) set(CTR_DIRECTION); // increment if (id < currentSlave) clear(CTR_DIRECTION); // decrement // calculate the number of clock pulses to send to the counter int pulses = 0; if (id > currentSlave) pulses = (1 << (id - 1)) - (1 << (currentSlave - 1)); if (id < currentSlave) pulses = (1 << (currentSlave - 1)) - (1 << (id - 1)); // send the clock pulses for(int i = 0; i < pulses; i++) { set(CTR_CLOCK); delay(1); clear(CTR_CLOCK); delay(1); }} I have a few questions: Are there any issues related to turning multiple SS pins on and off during the interim counting period? Can I rely on (most) counters being set to zero when it is first powered on? Are there other/better ways to cut pin counts in this kind of setup? <Q> However, in your case you would need 3 signals to produce the 5 chip select lines using this approach(you actually get 8 outputs for 3 inputs). <S> Your approach has merit also, as long as your not sending data while you are cycling through your chip select options. <S> Most counters have a preset line or some method of clearing them on startup. <A> You need 2 pins. <S> You can generate as many enables as you wish with 2 pins. <S> A 74HC138 decoder would need more pins as the number of outputs increased. <S> A counter would need many many clock pulses to enable only one output at a time in some cases. <S> The 74HC164 shifter needs at most n clock pulses to produce n enables. <A> I have faced a similar problem in the past, but with only two SPI devices. <S> My solution was to use a PIC12F1822 as an SS switcher. <S> It ran at 8 MIPS using its internal oscillator, and had code that did this function: if SS input goes low then if MOSI is low, then set SS_OUT_1 low else set SS_OUT_2 low end ifend ifif SS input goes high then set SS_OUT_1 high set <S> SS_OUT_2 highend if It just looped forever on that. <S> The code was written in about 20 assembler instructions, and had a pretty good latency of about a microsecond IIRC. <S> You could write some very similar code to allow you to select any number of slaves, using MOSI as an up/down signal, E.G. bits = <S> 0b11111110begin loop <S> if SS input goes low then if MOSI is low, then bits <S> <<= 1 else <S> bits <S> > <S> >= 1 end if SS_PORT = bits end <S> if if SS input goes high then SS_PORT = 0b11111111 <S> end ifend loop <S> Although you'd have to use a PIC with more pins <S> E.G. <S> PIC12LF1840T48A .
The typical way to do this is with a demux or decoder 3 to 8 decoder . You might consider a serial-in-parallel-out shifter like 74HC164.
How can I improve USB EMI insensitivity? I have several devices and some long cables on my PC's USB buses and every now and then I get a message like hub 6-0:1.0: port 2 disabled by hub (EMI?), re-enabling... on my Linux machine. Especially the devices on my desk (keyboard, mouse, 2 Arduino's) are being disconnected and reconnected. These devices respond to electric shutters for the windows, but also from passing motorbikes. What can I do to improve immunity to EMI? Tried ferrite cores on the mains cable of the shutters and some other equipment, but doesn't really improve much. Bus 006 Device 025: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB Bus 006 Device 026: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Bus 006 Device 027: ID 03f0:0324 Hewlett-Packard SK-2885 keyboard Bus 006 Device 028: ID 046d:c046 Logitech, Inc. RX1000 Laser Mouse Moved the keyboard off the hub, errors still appear. Moved the mouse off the hub, errors still appear. Moved the Arduino off the hub, errors still appear. Eventually replaced the long extension cable with a shorter one and haven't had any errors for over a day. The longer cable is required to reach my desk though without cables dangling halfway in the air. <Q> I took a rather thin USB extension cord, ran it 4 times through a ferrite core (one that comes in two halves in a piece of plastic and can be closed with a click) and ever since I haven't had any errors on my PC. <A> Shielded cables. <S> But that isn't the problem if it is due to passing vehicles (as @Polynomial said in a comment above). <S> USB is differential. <S> Radiated EMI would effect both lines essentially the same, so it won't have much of an effect. <S> That suggests you have conducted EMI problems. <S> However any decent power supply won't pass enough EMI through to be a problem. <A> Have been working a little with EMI issues and have done some studies. <S> A motor bike can absolutely create some serious EMI emissions, very broad band emission, nasty stuff. <S> Especially if it's an old model or if it is home <S> "tuned". <S> If you want that super spark and you have a long cord to the spark plug, you have created a good loop antenna. <S> And running 15000 volts from a capacitor trough that loop creates big spikes. <S> No doubt. <S> Just listen to an AM radio when those guys are driving by the block gives you the answer. <A> I'm late to the party, but I've been pursuing this issue (port X disabled by hub (EMI?), re-enabling...) for quite some time. <S> It's especially aggravating because this syslog message is often followed by the computer shutting down. <S> I think I've tracked down the cause (for me). <S> This computer is my media server and I have it my my master bedroom closet, which is adjacent to the master bedroom bath. <S> The bath has two independent exhaust fans. <S> Today I determined that simply turning off either of these fans triggers the "port X disabled by hub (EMI?), re-enabling..." syslog message. <S> Turning on either fan doesn't cause an issue. <S> I can't confirm that motorbikes cause the issue, but I can confirm that switching off a small inductive load (fan motor) generates enough EMI to trigger it. <S> I'm going to buy a snubber, or build my own, and see if that resolves the problem. <A> I have experienced similar issues with some USB-based diagnostics kit. <S> The problem we have found is it is more often then not the hub within the computer that is the problem. <S> From what we can deduce, if we are connected to our motor-drives and we start switching, EVEN if the controller is gnd-referenced <S> then there is disconnect issues and lockup at some point. <S> If we use laptops and essentially float the laptop then there isn't any issues, likewise if we use an optical fibre USB link then there isn't an issue. <S> > <S> UUT causes the PC, using cheap, commodity parts to have problems.
Some form of gnd-loop between the PC -> USB device -
Line, Neutral and Ground and another Ground I try to make a 110VAC energy meter connected to my computer out of the CS5490 This IC measures voltage and current over a voltage divider and shunt resistor respectively and then calculates the power. Besides connecting the measure inputs, the IC also needs power. In a stand alone metering application this power needs to come from the same line and that is the example they give in the datasheet. But in my case I have an external power supply that I would like to use. Also I think (correct me if I am wrong) one should not connect the Neutral from the line to the ground from a PC. Fig 21 on page 54 of the datasheet is then plain wrong? What is the correct way of doing this? Can I do it without the need of adding another power supply? And what does a pointing down triangle mean compared to the more usual ground symbol? It's an awesome group of EE's here, any help is highly appreciated! <Q> Also I think (correct me if I am wrong) one should not connect the Neutral from the line to the ground from a PC. <S> Right. <S> Never connect neither the phase nor the neutral of the mains to any node of a PC. <S> If you did that, touching any node (including the chassis) of the PC could kill you. <S> Fig 21 on page 54 of the datasheet is then plain wrong? <S> It is not wrong. <S> It just assumes that all nodes around the CS5490 and the "Application Processor" (including the "triangular" ground) are electrically isolated from any end user. <S> This means that, if you want to connect a PC to the CS5490, you MUST insert isolation between them. <S> Easiest: insert isolation at digital links like RX and TX (isolating analog links is much more complex), using either optocouplers or magnetic isolators like these ones <S> (I've used many of them, and they work very well. <S> They allow you to work at higher frequencies than with usual optocouplers. <S> Some of them even allow you to transfer power to the other side (the isolated one). <S> Look for "isoPower" in that same page). <S> Can I do it without the need of adding another power supply? <S> You need a power supply for the CS5490, which cannot be the same as your PC's power supply. <S> And what does a pointing down triangle mean compared to the more usual ground symbol? <S> Conceptually, the same. <S> All of them mean grounds (0 V reference points, for their "local" circuitries), but different ground symbols mean different grounds. <A> This sensor is mains-connected. <S> This means your PC is isolated from the mains. <S> The datasheet is 100% correct. <S> There's no electrical reason why an 'application processor' cannot be referenced to the same return as the sensor. <S> Inexpensive 'white good' appliances like washing machines and microwave ovens often have all their control circuitry non-isolated from the mains, and provide isolated user interfaces (buttons and knobs). <S> That being said, PC != 'application processor' in the context of that datasheet. <S> You cannot mix isolated and non-isolated circuitry without dire conesequences. <S> As Teleclavo says, you need some form of isolation to bring those signals to and from the PC. <S> If you're just doing hobby work, I would strongly recommend using the reference design <S> PCB <S> as your platform, since the isolation is built in already. <A> In some countries, the Neutral is Earth (i.e. here in the UK) as it enters the home. <S> Indeed there is no Neutral, just three live phases and earth. <S> (It's called PME) <S> However a miswired plug could easity reverse that fact so it cannot be relied on for safety past the consumer unit. <S> It is very dangerous to connect any mains kit to a PC. <S> To be sensible, you must use galvalic isolation. <S> Idealy power your sensing circuit using an isolated DCDC converter. <S> Then, even if there was a fault and any power or signal on your sensing circuit became live, there would be no risk to life (or the health of your PC) <S> Indeed it is possible to create sensing circuits where the circuit 'floats' at 250Vac mains. <S> You can use optical, magnetic or GMR based isolators to transmit the signals across the isolation barrier.
The power supply inside (or outside, if it's a laptop) your PC will have some form of isolation transformer which electrically isolates the mains from the PC power rails. You need to be extremely careful when you're working with mains-referenced circuitry - not only the inherent electrocution risk, but other dangers like PCB creepages and clearances.
Splitting wires for newbies I'm in the process of getting ready to build a car PC running Linux. One of the features I'd really like to incorporate is the ability to record car statistics from the sensors live using ODB2. Due to the location of where the ODB2 port is on my car (in the dash where the door opens), it'll be pretty difficult to close the door while the cable is plugged in. Therefore, I'd like to split the line further back a bit and route an ODB2 cable to the back of my car to the machine. I've never done stuff like this before, but I have done a bit of electrical work (ie: switching out switches, plugs, rewiring things). I'm assuming that what I'd need to do would be to cut the existing cable and basically solder all of the internal wires together to both plugs, the one available in the door for mechanics, and the one running to the back for my computer. Is this what I need to do? How can I put the wires back together again in a nice, insulated fashion? <Q> I would recommend using inline wire splices. <S> They are available at any auto parts store. <S> Alternatively you can go the inexpensive and more compact (but more difficult) route. <S> To be absolutely pedantic, NASA has a splicing guide, too . <S> Some pictures follow. <S> Inline splices (option 1): Manual wire joining (option 2): <A> MULTICOMP - 878106 - QUICK SPLICE BLADE <A> The actual problem to be solved is this: * <S> Due to the location of where the ODB2 port is on my car (in the dash where the door opens), it'll be pretty difficult to close the door while the cable is plugged in. <S> so the first thing to do is to see whether the OBD2 connector can simply be uninstalled and relocated such that the above problem goes away, without any cable splitting or tapping. <S> Since there can be only one OBD2 terminal connected at a time, you don't actually solve any problem by splitting the connector.
If you need to remove your temporary connection, a tap splice might be better. This is strictly for the sake of providing an additional connector in another place, which will never be used at the same time as the original connector.
Overvoltage i/o pin fried my arduino uno. Can it be saved? I accidently put 12V into one of the i/o pins and fried the board bad enough to go through the usb and shut off my laptop. Is the whole board junk now or just the atmega? <Q> It's hard to definitively say, but I wouldn't be surprised if the whole thing is toast. <S> There are a few things you can do to check. <S> Look over the board for any visible scorch marks or popped caps, anything physically damaged. <S> With the atmega removed, plug the board in. <S> You might try plugging it into something other than your laptop to start with. <S> Something with a solid 5V output, like a wall to USB charger for a cell phone. <S> There's enough other stuff on the Uno that, even without the Atmega, you should be able to discern whether things are working properly. <S> Get a multimeter and probe around testing voltages. <S> Make sure that +5V pins are actually at +5V and +3.3V pins are correct as well. <S> Feel the board (carefully) and make sure nothing is hot. <S> That's a sure sign that things aren't going well. <S> If that turns out okay, go ahead and plug the board into your laptop without the Atmega. <S> Check if your Arduino IDE or any serial terminal program can still recognize the COM port. <S> If it does, I'd say you're probably in luck and the board may be ok. <S> Lastly, if everything is successful, you can try putting the Atmega back in. <S> I wouldn't hold my breath about it working, but it isn't unheard of that just a single <S> I/O is fried. <A> Try what bjthom suggested and if the FTDI chip is OK, then you're probably OK to replace the atmega. <S> Get one of <S> these pre-programmed chips from Adafruit or similar and pop it in, everything should be OK. <S> While you're at it you can get some cheaper non-programmed ATMega328P-20PU chips from a variety of places and load the ArduinoISP example sketch from the sketchbook and use that to program the Arduino bootloader onto some spares in case this happens again. <S> They're pretty cheap, and as you can see if you burn up a chip and don't have any way to program the Arduino bootloader onto an new chips, you're out some extra money and time. <A> CMOS does not like having a voltage applied to signal pins greater outside the supply rails. <S> It causes the "Crowbar effect" If the protection diodes fry open then the chip turns into an SCR and latches a short across the supply, which in turn shuts off the supply if it creates an undervoltage (UVP cct) <A> Prior advice is mostly good. <S> For future reference - I have had an extreme case where about 150 VDC was shorted into a piece of equipment (a long ago D2 development kit) <S> which has two PCBs and dozens of TTL and MOS parts. <S> I had a second identical system and all the ICs were socketed! <S> I marked the suspect ICs visually so there would be no mistakes and then swapped in all the ICs from the working system. <S> The "dead" system worked. <S> I then progressively swapped back the suspect ICs testing operation after each swap. <S> A number of ICs were thus identified as dead and replacing them restored operation. <S> What was interesting was that all the "power" ICs died and none of the non-power ines did. <S> Anything that had a port intended to sink or source 10 <S> + mA or so died. <S> Gate ICs and similar didn't. <S> As I recall (30+ years on :-) ) it was quite a consistent boundary test for dead or alive. <S> Whether this is useful generally or in your case <S> I don't know, <S> BUT if you were desoldering devices it may provide a guide to which ones to try first. <S> If any supply bus is hard short (5V, 3V3) check tantalum caps, which go VERY hard short when invited.
I think it's most likely that you've fried your atmega, everything else is probably OK. A complete power down (battery removal) is only needed to drop the standby voltage in this case if it is involved with the circuit affected. It is sometimes recoverable as long as traces and diodes and chips dont have enough time to smoke.
QFP on stripboard, without PCB? Are there any tricks I can use to connect a QFP (or similar) package component to a stripboard (veroboard), without the hassle of setting up a personal PCB fabrication kit to make a breakout board? I've seen TQFP-to-DIP adapters on places like Farnell, but they tend to be extortionate - some are over £80. <Q> Farnell is expensive, and we only use it because of its overnight delivery. <S> There are cheaper options. <S> EZPrototypes has for instance a QFP64 to DIL adapter for 10 dollar. <S> edit <S> Not DIL <S> though, so it won't fit on a solderless breadboard, but on Veroboard it will do. <A> If you are patient or desperate, there is another solution, called "dead bug": <S> This requires no additional materials except some wires and maybe some glue to fix the chip on the board but extraordinary soldering skill. <A> Buy a breakout board, such as those made by Schmartboard: http://www.schmartboard.com/ <S> I'd make my own, it's quite easy.
Since you're in the UK, HobbyTronics has a QFP adapter for a mere GBP 3.
Arduino-controlled slot car set - Why are my MOSFETs burning out? I'm attempting to control the speed of a slot car using an Arduino and a MOSFET. I'm new to MOSFETs, however, and while my setup works for a moment, eventually the MOSFETs (N-Channel) open up, and they no longer regulate the car's speed. I'm using this slot car set and this MOSFET . The wiring is like this . The slot car controller ground and the MOSFET source are connected to the Arduino's GND. The Arduino control line is connected to the MOSFET gate and the Arduino GND through a resistor. The other line from the slot car runs to the MOSFET drain, and I put a diode over the rails of the track to prevent reverse voltage spikes. I'm able to fluctuate the speed of the car for a while, but eventually, the MOSFET goes out and no longer works. The slot car power supply is 17V DC. Here are some more photos: http://imgur.com/a/iRL7D What could be causing the MOSFET to burn out? The car flying off the tracks, maybe? Or, could it be heat? Would a heat sink attached to the MOSFET eliminate my problems? Do I have the right MOSFET? <Q> I see a couple of things here; none directly obvious as the culprit. <S> How much current are you drawing from the slot car? <S> It's hard to say whether the MOSFET (and your wiring, for that matter) is going to handle it OK. <S> Does the Arduino output 5V logic levels or 3.3V? <S> Both parts sold by Sparkfun are 5V logic level MOSFETS -- shame on Sparkfun for saying - This is a very common MOSFET with very low on-resistance and a control voltage (aka gate voltage) that is compatible with any 3-5V microcontroller or mechanical switch. <S> because it's not compatible with circuits that output less than 5V. <S> If you have a system that outputs 3.3V, you need a MOSFET with on-resistance specified at 3.3V. <S> The freewheeling diode between MOSFET drain and the power supply is to protect the MOSFET, not the motor, from inductive voltage "kickback". <S> Keep your wires short! <S> They add unnecessary resistance and inductance. <S> Breadboards are questionable for currents over 100mA; I'd keep the power supply wires off the breadboard and solder directly to the MOSFETs. <S> Yes, a heatsink would be helpful; that may be your problem. <S> If the tab of the FET is too hot to touch, you probably need a heatsink. <S> There are some easy clipon heatsinks at Digikey that are < 50 cents. <S> Here's one: 591202B00000G . <S> I always put a resistor between microcontroller output and the MOSFET gate; it prevents oscillation due to inductance, and it prevents damage from propagating back to the microcontroller. <S> (see my blog entry for more info) <S> I always put a pulldown resistor to keep the MOSFET in a defined state during reset. <S> grounding: <S> The connection between microcontroller ground and MOSFET ground is critical; if you add inductance here, that can cause poor turn-on or turn-off in the MOSFET. <S> Keep this short, and if you can't, then you may want to use a MOSFET driver located right at the MOSFET. <A> What is the maximum current? <S> Do you dare to touch the transistor (beware its temperature)? <S> or the diode not properly working. <S> What type of diode are you using? <S> It needs to be pretty fast with PWM and it must be able to handle the max. <S> current. <A> All looks OK.Power feed cannot be seen in photos but presumably 17V is fed to track via controller and MOSFET is on negative side of load so actual V+ does not appear on breadboard. <S> Run a V+ lead to breadboard and connect a reverse diode from FET Drain (centre terminal) to V+, Cathode to V+ <S> so diode is reverse biased usually. <S> I know you show a diode across the tracks BUT having one at the FET elminates several possible errors and problems. <S> You risk blowing up your Arduino as is. <S> MOSFETs can short drain to gate in some failures and insert 17V into your Arduino. <S> If control is PWM on/off this appears fine. <S> Is Arduino providing 3V or 5V gate drive? <S> 3V is a bit low for those FETs but should be OK. <S> Under PWM the FET should not get more than barely warm. <S> How hot does it get? <A> In other words, from V+ driving the car to the drain of the MOSFET. <S> This is reverse biased, so it's not a short circuit when the FET is on. <S> However, since the slot-car is an inductive load the current will need a place to go when the FET turns off. <S> By adding this diode the current is able to recirculate through the motor instead for driving a huge voltage spike across the FET. <S> This is also equivalent to using a half-bridge where the high-side switch is replaced by this diode. <A> First of all, stop using cheap diodes like the 2n4001-4. <S> DC motors can create high BEMF, due to load and frequency... <S> I would get ultrafast switching diodes like mur2020. <S> The heat could be cause from the gate not getting enough power. <S> Check the spec on mosfet gate input... <S> 5 to 12v range. <S> Mosfet need to be fully on, or off... <S> If you have it half way on, it will create heating. <S> This could be the main problem, but also a heat sink is needed when pulling amps...
I think it is either: temperature (so a heat sink should work). You need an anti-parallel diode across the slot car.
How to capacity threshold dectector with a simple analogic circuit? I try to make an extremely simple capacitive proximity sensor using a metallic plate and a plastic sheet, to show how it works. My aim is to put the capacitor in a circuit that lights a lamp (or a LED) if its capacity C is above some critical value C0 and turns it off when C is smaller than C0 (the order of magnitude of the capacities is 1-100 pF. Now the problem is to keep the circuit as simple as possible, so that it is easy to understand (and fits in what my target already knows). I especially want to avoid microcontrollers (thus an Arduino setup like in Triggering a capacitive sensor electronically? is not possible) - the most advanced device I can use is an op amp. All I have now is a AC tension divider followed by a rectifier, but it has grown because I have to amplify the output then compare it with some reference voltage to turn on and off the lamp. Do you have any idea ? Thanks. <Q> its frequency will depend on the measured proximity) and then determine whether the oscillator frequency is above or below the threshold. <S> The are probaly several good ways to do the latter, e.g. employing a simple f/V converter (e.g. one-shot and low pass filter) plus an comparator or (though not an analog solution) <S> using a digital counter that gets periodically reset by a signal of fixed reference frequency and checking whether highest counter bit gets high eventually: <A> An omp-amp comparator compares the voltage to a fixed value. <S> Simple and easy to use. <A> Leaving quite a bit of room for improvement, but very simply understood is the circuit below. <S> Two voltage dividers powered by an AC voltage, one with a fixed capacitance, the other with a variable one. <S> Diodes are added to avoid negative voltages. <S> The voltage difference between both dividers can be used to drive a LED. <A> Compare the RC rise time of the capacitance to be sensed relative to a reference RC. <S> Measure the difference with a D flip flop (DFF). <S> C2 is the capacitance to be sensed. <S> C1 is the reference capacitance. <S> Node 'tog' toggles between high and low. <S> When 'tog' goes low, 'tri' and 'sns' race to get lower than 'hyst'. <S> If 'sns' gets there first - because C2 is less than C1 - then the DFF U2A will clock in a zero. <S> If 'sns' does not get there first, because C2 is greater than C1, then the DFF will clock in a 1. <S> So pQ goes high when C2 is less than C1 - below 100 <S> pF. <S> nQ goes high when C2 is greater than C1, above 100 pF. Notes: - <S> no micro as requested - opamps can be substituted with low power R2R <S> SOT23 opamps - DFF can be substituted with SN74LVC2G74 SOIC8 DFF - total power can be below 1 mA - 3.3 VDC supply used as an example. <S> Still works with 5 VDC supply. <S> - D1-R6 quickly charges C2 to get ready for the next cycle - Does not use schmitt inputs to get hysteresis - so it's not dependent on input trigger voltage variation for accuracy. <S> Both opamps trigger at the SAME voltage "hyst', which you could control by adjusting R1. <S> - normal supply bypassing and power supplies not modeled for clarity <S> Schmitt input trigger voltages can vary slightly between different inputs on the same chip, and can vary with temperature. <S> This circuit offers an alternative to schmitt inputs for precision electronics. <S> Demonstration with C2 at 70 pF. Demonstration with C2 at 120 pF. Hope this helps. <A> If I could convince you to use another technology that only costs $2.69 for (1) can run off a cheap 3V Lithium coin for a year has high noise immunity and with two units will extend to 20cm range? <S> The part number is stock at DK . <S> Get the coin cell and holder too <S> I vote for the HSDL-9100 Integrated Reflective Proximity Sensor. <S> trigger it with your finger or wave your hand swish.... <S> Then use a D Flip Flop Q# to D to toggle inputs if you want it to latch the on off state.
I would use the capacitor as frequency determining element of an oscillator(i.e.
How can I use all of AA battery's energy in an instant? It would be fun to know how to pull the whole energy supply of a single AA battery for a one time operation, like making a huge spark, firing a photo flash or a very bright light. What kind of electronics would be needed? upd: discharging the battery should power some useful device (or be useful without a device), not just discharging for the sake of it. <Q> There is no practical way to dump "all of the energy" in a flash. <S> But you can discharge it slowly into an expensive UltraCap with many Farads of capacity and a few mΩ ESR and then dump the ultraCap in a flash enough to weld copper. <S> This is how electronic flash cameras work today, except you get many flashes per battery charge using just normal low ESR caps not "UltraCaps". <S> Is this for Sir Guy Fox day or just for a lark to raise some eyebrows in airport security and end up in Gitmo or are you competing with the Swiss in generating a Higgs Boson particle? <A> Also, to be able to inject that current, you'll need to treat the battery as a load, and connect it, upside down, to a high voltage source or (preferably) a high current source. <S> The battery won't like it, though. <S> The internal resistance of a battery does not limit the current. <S> That would be true only if all the voltage that we had access to was the one from the battery itself. <S> But that is not true. <S> No one impedes us from connecting an external voltage. <S> The question asks for the fastest way to remove all possible energy from a battery. <S> In the following example, the short-circuit current of the battery would be 1.5/0.2=7.5 A. <S> By connecting it upside down to a voltage generator with (for instance) 100 V and 0.01 ohm, we can force a current of (100+1.5)/(0.2+0.01)=483 A (in that ideal model), which is much higher than the short circuit current. <S> If you slowly transfer the energy in a battery to a supercap, and then quickly consume the energy in the supercap, that is not answering the question. <S> The question asks how can we use all the energy in a battery (not in a cap) in an instant. <A> You added: Any way to fully use all of a battery's energy will do. <S> If we should store it somewhere first, so be it <S> Which makes it much easier, subject to conversion efficiencies. <S> A boost converter will help in some cases by maqtching thebattery output to the storage system. <S> All of the following rely on transferring the battery's energy to a system which allows rapid "discharge". <S> All are potentially useful. <S> Death is possible with all of these with due carelessness. <S> About 10 kJ Joule of energy is typically available. <S> Enough to damage or kill in all cases. <S> Charge a supercap. <S> When as much battery energy is transferred to cap as system uses allows. <S> Discharge cap. <S> A VERY large cap needed. <S> Not really practical Use electrolysis of water to produce a Hydrogen Oxygen mix. <S> Ignite mixture. <S> (Don't try this at home etc ... !!!). <S> Eminently practical and potentially extremely dangerous. <S> Use a motor to spin up a flywheel. <S> Apply the flywheel to "something". <S> Easily enough doable. <S> Heat a Phase change metallic material with PC temperature of > 100 C ( <S> various Bismuth alloys meet this spec) <S> so it liquidifies. <S> Add water. <S> Very doable. <S> Finely divided matrix helps energy transfer to water. <S> Potentially lethal. <S> More possible ... <A> Batteries have internal resistance. <S> Since their output voltage is (for most intents and purposes) fixed, you have a fixed maximum current output. <S> Telaclavo's answer covers a situation where this isn't true, but I'm going to walk you through a simple short of the battery. <S> A typical internal resistance for an AA battery is about 0.2&ohm; [1] , so <S> if we ignore the resistance of any connecting wires it's not too difficult to calculate the (theoretical) maximum output current. <S> Since we know R and V, we can calculate I as I=V/R <S> , therefore I = <S> 1.5/0.2 = <S> 7.5A maximum current [2] . <S> Your average alkaline battery will give you about 2000mAh of juice under 0.5A load. <S> I can't find any detailed specs on how long they last when shorted, but it's not going to be less than 1/10th that amount. <S> So, at an absolute minimum, it's going to take about 90 seconds to drain the battery. <S> Footnotes: [1] 0.2&ohm <S> ; is what Duracell and Panasonic state are their "standard" internal resistances for "normal loads". <S> [2] There are other resistances involved, and the internal resistance changes as you increase the load on the battery. <S> I'm just trying to keep things simple here. <A> It would be fun to know how to pull the whole energy supply of a single AA battery for a one time operation <S> Pedantic: <S> Most of the energy in your battery is tied up in the nuclear forces that bind together the subatomic particles that make up the atoms in your battery. <S> To liberate the whole supply of energy, you will need probably need to resort to nuclear fusion or fission. <S> Fun fact: There is more energy in the uranium impurities in a kilogram of coal than can be liberated by just burning that kilogram of coal! <A> An AA battery has a finite internal resistance, which will limit the current and thus the rate at which one can remove energy. <S> You could try transferring, over time, <S> the energy in the battery to a lower impedance external energy store (super capacitor, inductor, flywheel, lift a rock up a cliff, etc.)
If you force a very high current (much higher than the short-circuit current) into the battery's negative node, and out of the positive node, you'll be able to remove all the energy in it in a minimum time, but that time cannot be zero.
How do you determine whether your product requires CE marking? I haven't been able to come across definitive information regarding the procedure to find out whether an electronics product (PCB) requires CE marking or not. Since it is difficult to ask hypothetical questions, let me ask by using specific examples. Let's take this RS485 IO card as a first example. Would this product require CE marking to be sold in Europe? (Maybe a similar question: would this product require any FCC approval/marking to be sold in the USA?) Let's look at a second example . This is an A/D board. Would this product require any regulatory approvals/markings? It would be a great help if someone with CE/FCC experience could give answers, explaining the reasoning behind those answers. <Q> I don't know about CE, but you legally need FCC approval to sell a product in the US if it is a intentional radiator. <S> If not, it still has to meet part 15 requirements, but it is up to you how you comply <S> and there is no mandatory testing. <S> You can just throw a unintentional radiator out there (in the US) without testing, but if there is ever a complaint or some reason the FCC decides to test it and it is found non-compliant, then you're in deep doodoo. <S> They can confiscate all your inventory, fine you, and even criminally prosecute you in extreme cases. <S> If you can show you had the product tested properly and it was found to pass, the problems will be less onerous. <S> You still won't be allowed to sell them anymore, but they might not confiscate all your inventory, there might not be fines, and probably not criminal prosecution. <S> A bunch of years <S> ago there were some asian motherboards that radiated all kinds of crap. <S> The FCC waited until one of the major trade event and made a public spectacle shutting down the perpetrators and confiscating their gear. <S> You may think your little product is too low volume to get on the FCC's radar. <S> That may be true by itself, but how much do you trust your competitors? <S> One of my customers makes a end user product that includes a RF remote, so is a intentional radiator. <S> They went thru all the trouble to get it to meet emission standards and to get it certified. <S> One of their competitors is importing something my customer knows is not compliant, so they filed a formal complaint with the FCC. <S> It's too soon to tell how that will play out, but I wouldn't want to be in the other guy's shoes when the FCC finally gets around to testing and finds illegal emissions. <A> Certain categories of products must have a CE mark to be sold in the EU. <S> However another category is Electromagnetic Compatibility. <S> In Annex 6 of the "Guide to the implementation of directives based on the New Approach and the Global Approach" (aka the "Blue Guide") it states: <S> All electrical and electronic appliances together with equipment and installations containing electrical and/or electronic components which are liable to cause electromagnetic disturbance or the performance of which is liable to be affected by such disturbance. <S> Note <S> this is very similar to the Part 15 requirements of the FCC (which of course don't apply to the EU), as described by Olin in his answer. <S> Since you can self-certify your products for a CE mark, if you are sure your product is compliant, then you can apply the CE mark to your PCB without testing. <S> But I don't advise that. <S> Note there are very specific requirements regarding how the CE mark should appear on your product. <S> They are also covered in the Blue Guide. <S> All the products I have designed for this client (which include intentional radiators such as cell and Bluetooth modules) are tested for EMI/EMC, and meet FCC requirements, CE requirements, and UL requirements (which audits the facilities on a periodic basis). <S> And yes, this costs big bucks (tens of thousands of dollars). <A> The simple answer is that you should be contacting someone who is an expert on this, probably some kind of lawyer. <S> You're asking for a laypersons interpretation of law, and that is never a good thing to do. <S> The quick answer is: I'm 95% sure that you will have to get some sort of regulatory certification for your example products.
One of my clients manufactures medical devices, which are of the categories specifically mentioned, so they definitely required a CE mark (and have one).
What gauge of single strand wire works well with breadboards? I bought some single strand wires hoping to prototype on the breadboards. Unfortunately it was too small to properly fit into the breadboard holes. So my question is which gauge fits well on those small holes of breadboard? <Q> Plain single stranded copper wire works fine in these breadboards. <S> That's what I primarily use. <S> I find 22 guage is about right. <S> Fancy specially made jumper wires may be more reliable in the long run, but cutting a piece of wire off a roll and stripping the ends is easy and quick. <S> You can do that many times for the cost of one jumper wire. <S> A while ago I bought a set of pre-cut and pre-stripped wires for this use from Jameco. <S> It sounded like a good idea at the time. <S> Having the wires ready to use is nice, but they stupidly decided to bend the stripped ends at right angles right where the insulation ends. <S> That makes them difficult to use except for the ones that only go 1, 2, or 3 holes. <S> As I cut and strip more jumper wires from a 500 foot roll of #22 wire, I put them into the box the Jameco kit came in according to their lengths. <S> Over the years, the stripped ends of a few wires have broken right at the end of the insulation. <S> This happens quite rarely, so the trouble to cut and strip a new wire is nothing. <A> AWG22 or AWG24 generally work well. <S> i personally prefer AWG24. <S> Anything bigger than AWG22 can mangle the breadboard connector <S> (I've had to unmangle some). <S> Anything smaller than AWG24 may not connect reliably. <S> When you cut the wires, cut on an angle, not straight across the wire. <S> This gives you a needle point on one side, and makes insertion easier. <S> (Hypodermic needles are constructed this way for precisely this reason.) <A> RadioShack sells a jumper wire kit for use with their solderless breadboard . <S> I'm not recommending that to you, since you are outside of the U.S., but using that as an example -- the wires are 22-gauge. <A> 0.6mm diameter single/solid core wire works great for breadboards. <S> This is the same as the diameter of a typical 1/4W resistor lead. <S> In AWG terms, 0.6mm is between 22 AWG and 23 AWG. <A> There are several reasons but the main reason is so that the contacts in the breadboard don't stretch or otherwise become deformed. <S> You won't notice the stretched contacts until you go to use a component with small diameter leads. <S> 1N4148 diodes are where I notice stretched contacts - the diode lead just isn't tight in the contact. <S> Your friendly telephone installer is usually happy to hand out 25-pair off-cuts anywhere from several feet long to as much as you can carry. <S> Don't strip the jacket from the cable until you have cut it into the desired lengths. <S> That gives you 50 pieces of that length. <S> After I have stripped the insulation from the individual wires, I use a pair of scissor-type wire strippers (Miller 101) to cut the very tip of the stripped wire at an angle. <S> That makes inserting the wire into the breadboard very easy. <A> Using just plain wires is never an optimal solution. <S> Breadboards require that you push in some solid copper, but solid copper wire is difficult to route. <S> You should just buy a set of Jumper Wires, like this: http://www.pololu.com/catalog/category/68 <S> And I think you can probably get them for less.
Although both 22 AWG and 24 AWG solid-core wire works well, my preference is to use 24 AWG. I make my own breadboard jumper wires from standard 24 AWG telephone wire.
How does CPLD propagation delay work? My question is about CPLDs in general, but take for example this cheap Xilinx one . I understand that unlike a microcontroller, a CPLD does not have a clock; external edges activate the logic immediately, without waiting around for an interrupt dispatcher to create a context switch and call a function. On the unit linked above, the "max" Tpd is shown as being 10ns. Does that mean it's literally anywhere from 0ns to 10ns on a given edge, or is it more consistent within a certain set of environmental conditions? Which conditions would affect that delay most heavily? <Q> The delay specification in a CPLD is the maximum (i.e. worst case) pin-to-pin delay. <S> That is, the maximum delay it takes for a signal "edge" to propagate from any pin to any other pin through the internal (combinational) logic. <S> Comparing it to a microcontroller is also not really suitable, since CPLDs implement hardware, not software. <A> It's a great question at first <S> it is a big unknown until the design is simulated. <S> Added: <S> THis simple answer is NO. <S> THat only applies to prop delays from pin to pin for accessing the closest register. <S> There is considerable more latency if you read all the specs on timing. <S> The designer must be aware of metastable conditions and race conditions in defining input and output states <S> so the macrocell process works as required. <S> It is also prudent to test the device using +/-% <S> clock and <S> +/-% <S> V for fault margin.. <S> i.e. test to failure or 15% max and verify that states are clocked in a timely fashion to prevent assumptions in timing errors. <S> Doesn't Xilinx tools have good simulation data to analyze this? <S> But you are correct to beware that there will be latency, setup and hold time for each macrocell. <S> It is also worth noting that the tradeoff between MC-LP and MC-HS is power and latency. <S> Clocking serial data is essential and knowing the jitter margin between data transitions and clock active edge. <S> This is what turns digital communication into the analog world. <S> 2nd <S> Add: <S> With respect to the latter question"Which conditions would affect that delay most heavily?" <S> As I indicated that there are two types of macro cells (MC) <S> the ones obviously most critical for delay are the Low Power ones (LP) <S> MC's which contain large trees of boolean conditionals, or deeper trees, will create longer latency. <S> Ripple counters are notorious for this latency. <S> Setup time is cell specific and similar to individual chips. <S> A revue of these datasheets will give you more details. <S> Generally if process is complex in boolean logic & ripple counters delays, then it is necessary to synchronize the state into Latches. <S> THis adds controlled latency but prevents race conditions and is the basics of a State machine. <S> Events can be processed depending on combinational inputs, outputs or intermediary states. <S> Clocking these states into latches, aka FF's or hardware "registers" for further processing with more logic before the next clock cycle. <S> Look up Finite State Machine theory and design methods to gain insight here. <S> ** <A> The statement "Unlike a microcontroller, a CPLD does not have a clock" <S> is simply untrue. <S> Speakig rather generally, they both have synchronous sytems as well as combinatorial ones. <S> Making a comparison about interrupts is also misleading. <S> CPLDs don't normall run machine code, though machine code could be implemented in one (I used to teach a class on doing just that) <S> So a CPLD could 'cause a context switch' if it were made to run machine code. <S> Tpd is Time-propogation delay (worst case). <S> In PLDs is it a measurement to be taken with a big pinch of salt. <S> This is because it's definition is completely down to the manufacturer. <S> It usually means the longest possible time, given worst case environmental conditions and manufacturing tolerances for a signal to travel from one pin via the shortest possible route to another. <S> In reality this usually means - pin->input <S> pad->routing pool->output pad->pin. <S> Depending on the CPLDs architecture, routing pool may or may not include the LUTs (lookup tables) that form the internal logic facilities, and <S> if it did it is most certainly the fastest route through it. <S> So really, Tpd is made up of a completely useless function for the PLD, a piece of wire with no logical functionalty! <S> If you want to get a better view of the speed of a PLD you need to examine it's manual for the 'Timing Model' this takes better account of the internal architecture to implement, e.g. a LUT-flip flop-routing pool that typically makes up the internals of any function. <S> To answer your last question, there are two variables that effect speed, Voltage and temperature. <S> Lower voltage devices are generally faster. <S> Internal resistances and thus the current available to charge a gate are affected by temperature. <S> Higher temperature <S> = more resistance = <S> slower device.
Saying that a CPLD doesn't have a clock is misguided; you can use a pin as a clock input to feed sequential logic.
Is there a something else I could use in this circuit instead of inductor? I'm making the analog interface for MCP3909 chip , I'm having a problem in finding any inductor where I live .. I've two question :- Is there a substitute of this inductors ? What's the reason of them ..! here's the link for the reference design manual if the image isn't clear. <Q> Doesn't Digikey ship to Egypt? <S> They're EMI suppression coils, often referred to as "chip ferrite beads". <S> These have low resistance at DC and low frequencies, but up to several 100s of Ohms at 100MHz or higher. <S> The LI0805H151R-10 is 150\$\Omega\$ at 100MHz, yet only 150m\$\Omega\$ at DC. <S> I'm afraid there's little else <S> you can replace it with, at least not in 0805 package. <S> If you want to live dangerously <S> you can replace them by a 0\$\Omega\$ jumper, but don't quote me on that! <S> Your circuit will probably work, but most likely fail EMC tests. <S> For a commercial design you definitely want the chip ferrite beads! <S> You can more or less simulate the ferrite with a wire wound resistor as Jason suggests. <S> Assuming that a 0.15\$\Omega\$ Yageo KNP100 has about 10 turns it will be around 0.17\$\mu\$H, which theoretically gives about 100\$\Omega\$ at 100MHz. <S> In practice the value will be higher due to the skin effect. <S> Note that neither the chip ferrite bead nor the wire wound resistor are ideal inductors, as the following graph of a Murata ferrite bead shows, and the simulated coil may give different results in EMC measurements. <S> (Laird doesn't publish a graph in its datasheet). <S> Chip Ferrite beads look more like resistors than inductors; there's no coil visible. <S> That's because the coil is inside the ferrite: This X-ray image shows an actual coil: <S> Note: <S> I now see that I've given an almost identical answer in the past, even with the same images. <S> I had completely forgotten about that. :-) <A> How can you build any electronics without access to basic parts? <S> From your profile it appears you are an engineering student. <S> A large part of an engineer's job is locating parts, and you need to learn how to do this. <S> At least four of the major electronic component distributors say they ship to Egypt or have a representative there. <S> Mouser <S> Newark <S> Digi-Key Farnell <S> Admittedly, the shipping is going to be expensive, so you might want to combine your order with some of your fellow students'. <A> I would be very surprised if you can't buy them in your country. <S> Instead of inductor, search for ferrite bead although technically these are still inductors, they are not sold as such. <S> Failing that find the highest value low resistance <30R, wire wound resistor you can. <S> It will behave pretty much the sam as an inductor at 100's of MHz. <S> (posted with the same caveat that using the recommended part is best for a commercial design) <A> You can buy them in Egypt - or something equivalent. <S> You can make an adequate substitute by winding insulated wire onto a physically small leaded resistor - resistor value say above 1000 ohms. <S> Number of turns can be discussed if needed. <S> Probably 10 turns on a small resistor would be adequate - solder wire to resistor lead at each end <S> so DC resistance is = <S> ~ 0 <S> Ohms due to the wire. <S> The design will work without them but MAY add noise to the circuit being measured. <S> They act as interference filters.
If you can get small Ferrite beads or small ferrite cores you could wind wire on them BUT ferrite grade and core dimensions needs to be known.
Why are red LEDs so dim & how do I make them brighter? Background I am an electronics novice/hobbyist who is recently using an Arduino connected to a breadboard to prototype a set of navigation lights for a remote controlled hexacopter that I am building. Similar to nav lights on airplanes, I have four strobing white lights that go on the tips of the back four rotor arms, and this alternates with strobing orange lights (beacon) on the top center and bottom center of the craft. This is all fine. In addition to the strobing lights, I have two solid green lights to go on the two right rear rotor arm tips, and two solid red LED lights to go on the left rear rotor arm tips. All of this is fine too, but the red LEDs are really dim . Question No mater if I run the red LEDs through a battery or the Arduino, with a resistor or without and no matter the brand or MCD rating of the LED, they are always more dim than their counterparts of other colors. How do I brighten the darn red LEDs? Update Here are the specs for the LEDs. I got them off of eBay from a Chinese manufacturer. There is not a brand name, but all are from the same source: Emitted color: red, blue, green, yellow, white20pcs for one colorSize: 5mmForward voltage: 1.9 - 3.6V DCLuminous intensity: 500-20000 mcd <Q> Also, driving an LED incorrectly can destroy it or reduce it's output from then on. <S> Such damage can occur almost instantaneously. <S> Red LEDs have lower operating voltages than White LEDs <S> so are more likely to be damaged by the application of a constant voltage that is too high and not current limited. <S> The efficiency of LEDs varies widely. <S> It can be expressed in lumens/ <S> Watt = l/W. <S> The best White and the best red LEDs have similar enough l/W ratings that both should appear about equally bright when driven with the same power input. <S> White LEDs typically have operating voltages = <S> Vf in the 3.0 - 3.6V range and red LEDs have Vf = 2.0 to 2.5 Volts. <S> So a red LED would need about 50% more current to achieve the same power as a White LED as Power = <S> V <S> x I. <S> You state the LED output range as 500 - 20,000 mCd. <S> That's a 40:1 brightness range. <S> Note that candela are a measure both of energy out and area of illumination. <S> Less area = <S> more brightness for the same light energy. <A> LEDs come in all sorts of brightnesses and viewing angles. <S> Within some limits, the brightness of the LED is proportional to the current flowing through it, though this relationship is far fron linear. <S> The amount of current transformed into light is a measure of the LEDs efficiency. <S> If you want a set of coloured LEDs to match, then examining the manufacturers datasheet is a good start. <S> Also make sure you take into account the viewing angle. <S> Although not strictly true, half the viewing angle results in about four times as bright for the same power and effeciency. <S> Select LEDs with the same brightness at similar currents and identical viewing angles. <S> Lastly remember the human eye responds really badly to deep red and deep blue colours (see Wikipedia ) so the aparent relative brightness between different coloured lights is somewhat subjective. <S> I should have included that LEDs are current devices, not voltage. <S> The voltage across (Vf) <S> them is variable between samples and over temperature. <S> (remember LEDs get hot). <S> This means high power ones should be driven by a constant current circuit. <A> I had this problem once matching brightness between green and red LEDs. <S> I put the red LEDs on a pwm pin and then used a pot to change its brightness. <S> Use the serial connection so you can see the value of the pot as you tune the brightness. <S> Once you find the level of brightness you want, take the value displayed in the serial connection and hardcode it. <S> Then remove the pot (and its associated code) and you are good to go.
It is highly likely that your red LEds are of lower luminous effiiency than your white LEDs.
Implement MicroController Power Switch and re-use the button for other features This is similar to other questions, but I feel it is different because of the reuse of the "power" button. I want a "latching" Momentary Power button. Behavior: User Pushes momentary button, holds down as long as necessary and the device powers up. Between Power On and Off the same button will be re-used for other functions When it is held down for 5 +/- seconds the MicroController will turn itself off. Design Constraints: Battery provides between 3.7V to 2.9V during it's usable life The Voltage regulator requires Vin +/- 0.3V on the Enable Pin, 3.1V output. MicroController operates at 3.1V MicroController Output Pin High state is 2.7V Max Debouncing: In this case I'm not concerned about debouncing the switch, if the user doesn't hold it down long enough for the MicroController to set it's Digital Output pin High the device doesn't power on. I've worked up the following schematic, which kind of works. Falstad Circuit Simulator of my schematic It assumes 3.7V from the battery.Uses an Analog Input for the Power button, which then uses the variation in voltage to determine if the button has been pressed. In the current design the difference is 0.12 V (from 3.4 to 3.52), but the MicroController has a 12 bit ADC so that shouldn't be a problem, in addition I can adjust the sensitivity range of the ADC. Questions: What is the difference between reality and the simulator? Is there a better way? How can I get a greater voltage difference on the button input? I've tried many different combinations but they increase the voltage range above the 3.6V Input High Maximum specified in the datasheet. I'm not excited about the "Leakage current" when the uC Controlled Power Pin is Low, any suggestions? Thank you for any ideas/suggestions/answers. <Q> This is variation on my answer to this question . <S> Like Mike, I am also using a P-channel MOSFET. <S> The OP stated: "The Voltage regulator requires Vin +/- <S> 0.3V on the Enable Pin", and "MicroController Output Pin High state is 2.7V Max". <S> Therefore when the battery voltage is above 2.7v, the µC will be unable to supply the required voltage to meet the voltage spec for the Enable lead. <S> So I am using the control lead of the µC to control the MOSFET, which in turn switches the battery voltage (or Vin) to the Enable lead. <S> Initially, the control lead from the µC is configured as an input. <S> When the button is pressed, battery power is applied through a Schottky diode (keep Vf below 0.3v) to enable the regulator. <S> Meanwhile, the button can be used as an input. <S> The circuit should draw very little power (less than 1 µA) <S> when the µC is powered down, assuming the regulator shuts down completely when the Enable lead is low. <S> This eliminates the cost of the LTC2954 chip which runs over $2 in 500 unit quantities. <S> This circuit should be under 10 cents in quantity (except for the switch and regulator). <A> Many micros, expecially the ones designed for low power such as the MSP430, have a zero power interrupt. <S> The CPU goes to sleep rather than completely powered down. <S> In this mode it takes a few uA. <S> No need for any external circuits (other than the button). <S> See this TI app note for an example <A> You probably want a Push-Button Controller , such as the LTC2954-1 . <S> They're available in TSOT-23 at around $5 each in small quantities. <S> This is going to perform a lot better than trying to keep your MCU from raining the battery. <S> And yes, the simulation is probably close enough to reality. <S> The circuit above shows a PFET for switching the regulator on or off, but if your regulator has an active-low enable input, you can just hook EN up directly. <S> EN is an open-drain pin, so you don't have to worry about what the high voltage is; the regulator will need to pull up its EN pin itself, or you can put in a pullup resistor. <S> If it has an active-high enable (haven't seen many of those), you can put an NFET and a couple pullups in between the controller EN and the converter EN to invert the level. <S> Again, this is an open-drain pin which doesn't care what your VCC is, just add a pullup resistor. <S> Further, there's a KILL input that the MCU can use to turn the power off itself. <S> The capacitor on PDT sets how long a "short" INT press is vs. a "long" OFF press. <S> Linear makes several similar controller chips (all LTC295_ numbers) with various features; look through them to be sure to get the right one.
When the button is pressed it is woken by an interrupt (i.e. power on as far as the user is concerned) after which on it can monitor the pin for some input and turn off or do some other function depending on the way the pin is pressed. The µC then configures the control lead as an output and grounds it, keeping the enable lead high through the MOSFET (which keeps the voltage at the battery level). When your system is running, pressing the button for a short time will pull INT low. VIN can fall all the way to 2.7 V and it will still work.
Convert Eagle v6 BRD file for autorouting? I've just finished designing a PCB in Eagle. Now I want to use the freerouting.net autorouter to route my board (because Eagle's default auto is crap, sadly). The one problem: converting my Eagle PCB in BRD format into the DSN format used by the freerouting.net router. There seems to be no way to export a BRD as a DSN.I've tried using the brd_to_dsn.ulp script on the freerouting website, but it's broken. How can I convert my BRD to DSN? Alternatively, is there any good autorouter that can accept Eagle files? Any help is greatly appriciated! <Q> Go to http://www.cadsoftusa.com/downloads/ulps and try to find "brd_to_dsn_v6.ulp" click "Download" or try this - http://www.cadsoftusa.com/downloads/download/407 <A> The Electra autorouter is supplied with many PCB packages, including the Pulsonix software I use. <S> It's an option with Pulsonix. <S> I don't use it much, but it does a good job, and is very fast. <S> It works with Eagle files that have been converted to DSN format. <S> Pulsonix imports Eagle V6 files and libraries, BTW. <S> They provide ULPs, which make it quite easy. <S> Here is the Arduino file from Eagle 6.2.0, converted from the original .brd <S> file into a .eip file that can be opened from Pulsonix. <S> I was able to unroute it and autoroute it to 65% without optimising any settings. <S> If the OP provides his file, I'll autoroute it for him. <A> According to the FreeRouting website, there exists an Eagle to DSN converter script. <S> see This Link <A> Answer 2: Eagle -> <S> AD -> <S> DSN - <S> > <S> Router -> ????? <S> Once in AD, Altium Designer can read and write .DSN files. <S> Though if you have access to Altium you might be better using that to start with! <S> Also, after being routed, I don't know of a way to get your board back into Eagle.
You can indirectly convert your Eagle design to Altium Designer using third party scripts for Eagle (info here )
Which way to draw diode in a circuit diagram Im having a bit of trouble drawing a circuit with a diode in. I know the current flows from negative to positive, but convention says that current goes from positive to negative. When drawing a circuit with a diode do you draw the arrow pointing to the positive (matching the actual flow of electrons) or towards the negative terminal (matching conventional current)? If you follow convention then surely when building circuits from the diagram the diode will not allow current as it is actually facing the incorrect way? <Q> In normal circuit analysis, we almost never think about which way the electrons are flowing. <S> We nearly always calculate and visualize how the "conventional current" is flowing. <S> In the case of a diode (to simplify things somewhat---see Steven's answer for some special cases), conventional current flows through the diode from the anode to the cathode; that is, conventional current flows in the direction that the "arrow" of the diode symbol is pointing. <A> The arrow symbol is actually a simplified depiction of a point contact diode . <S> It happens to point in the direction of conventional current. <S> The "way electrons move" is not important for circuit design and you should not worry or even think about it, it will lead to nothing but confusion. <A> The diode arrow points in the direction of conventional current. <S> Conventional current flows in the opposite direction from the actual flow of electrons. <S> Digging deeper into the physics, there are actually two possible types of current: electron current and hole current. <S> Electron current is the movement of electrons. <S> Hole current is the movement of an absence of an electron. <S> In your statement of "current flows from negative to positive", you are referring to the flow of electrons. <S> Unless one is dealing with the physics of a semiconductor devices, you typically don't use "hole current". <A> One exception is the zener diode , which is mounted backwards. <S> If you place a common diode backwards it will block the current, save a small leakage. <S> But if you increase the voltage at a certain point there will be a breakdown where suddenly current starts flowing, and that can be a lot of it. <S> The voltage will not increase much anymore. <S> Every diode will behave like that, and zener diodes are especially made to use this behavior. <S> In their production we can control at what voltage that breakdown will occur. <S> If you would place a zener diode the normal way, pointing in the direction of conventional current, it would look like a normal diode, also showing the 0.7V voltage drop. <A> The anode of a diode is + and the cathode is - to forward bias it and allow current to flow through it. <S> If you make the anode - and the cathode + the diode will not allow current to pass through it.
Like the others said, we always think of conventional current, flowing from the higher voltage to the lower, and then the arrow points in the current direction.
How do electrical body fat detector work? I would like to build me own electrical body fact calculator from a microcontroller (the Arduino), but I would like to know how does it work. I have a 5V analog reader, So I guess I sould calculate the current passing through my skin compared to a 0 body fat skin resistance? Is that it? Thank you <Q> I have designed cardiac output meters, which is something related to what you are asking, although more complex. <S> Cardiac output meters measure transthoracic electrical impedance, and --knowing that the blood is a good conductor of electricity-- <S> they correlate conductivity with the amount of blood present in the volume between the sets of electrodes, at any given time. <S> They provide as a result a waveform of the instantaneous flow of blood through your heart, in liters/minute. <S> Body fat "meters" provide a rough estimate of the proportion of fat in your body. <S> I'm not very familiar with the latter ones, but I know they also work by measuring electrical impedance. <S> To measure electrical impedance, you inject an AC current through some portion of the body of a patient. <S> You use two electrodes to inject current, and two electrodes to measure voltage. <S> The amplitude of the AC current is kept constant, and the amplitude of the sensed voltage is proportional to the instantaneous impedance. <S> Typical frequencies used range from 20 kHz to 100 kHz. <S> If the current has to go through your heart, a maximum of 400 \$\mu\$A\$_{rms}\$ is allowed, at 50 kHz. <S> If only the magnitude of Z(t) is needed, best is to use a synchronous demodulator, to extract the amplitude information from the sensed voltage. <S> If phase information is needed, you need more complex methods (like very fast ADCs and FFT). <S> There is no way that a circuit like this one can be done by an amateur, so forget about this. <S> You need a very good schematic, and a better PCB design. <S> I ended up with 4 or 5 ground areas, plus the same number of -5 V and +5 V areas. <S> One of my toughest challenges, but the results were very good. <S> All this was for electrical bioimpedance in general, and for transthoracic impedance in particular. <S> Knowing that fat is a relatively bad conductor of electricity, body fat estimators must correlate conductivity with amount of fat between the electrodes. <S> I guess they use weight and volume data to help in that correlation, and data from MRI scans to have some absolute references. <A> current. <S> So in principle it's simple, but what I think is hard is to calibrate it, because you need to have very good reference values. <S> This Wiki seems to suggest that these instruments measure resistance, as it's dependent on the water volume, greater in adipose tissues. <S> You also need a quite sensitive and accurate current meter, but it's less than an issue. <S> What you need the most is another - commercial - instrument to take the reference values and maybe create a look-up table and define a function that relates current to fat percentage. <S> An alternative: according to Body Mass Percentage wiki <S> , you may achieve better results engineering your bath tub to measure the water displacement when you get in. <S> But do it before using bathfoam :) <A> ANSWER: <S> Capacitance is Voltage @ <S> F using a current source sine wave is proportional to gap between electrodes or calipers which equates to BMI. <S> I believe "body mass index" (BMI) measurements are just pinching a gap of fatty skin between calipers or "capacitance measuring electrodes" grabbing onto the excess fat on the surface of the body with a wide smooth jaw. <S> Each jaw is isolated so that the result is between the two conductors. <S> Many readings are averaged to get an Index value. <S> To replicate this electronically would be to measure the distance between two metal conductors measuring the dielectric capacitance. <S> Resistance will be nulled out and has no significance as it is largely skin surface resistance from moist salty skin. <S> By cancelling out voltage that is "in-phase" with the sinusoidal current source, the instrument can measure the reactive vector component. <S> Since the body dielectric is capacitive the voltage will have a 90deg phase lead relative to the current source. <S> They are completely non-invasive and harmless signal levels. <S> Frequencies of useful range are 1~100KHz. <S> I have a 4 digit autoranging LRC meter that displays capacitance at different frequencies, but I have never attempted to calibrate my BMI. <S> I do have my fingers calibrated for capacitance though and resistance , whenever I have to tune my circuits.... <S> ;)
You need to sense a few microvolts (with a good instrumentation amplifier), and at the cables right next to the sensed voltage you have your excitation signal, spanning several volts. The body fat calculator works measuring the conductivity of the body, so it applies a signal (an AC voltage) and measures the (very small, for safety)
3V to 500V DC converter I am making 3V to 500V DC converter for a GM (Geiger-Müller) tube kind of application. Basically the tube needs to see 500V across it.I read this relevant thread here : 5V to 160V DC converter and I have a couple of queries: Would the LT1073 circuit be suitable for this application.Whatwould be the maximum voltage felt by the LT1073 at the SW1 pin ? SW1pin MAX is mentioned as 50V. Is this independent of the supplyvoltage? Suppose I use the common low cost MC34063 , would 3V be theabsolute minimum I could go down to? Suppose I use a flybacktopology instead of a boost converter,would I be able to get byusing the internal switch of the MC34063 instead of an additionalexternal switch? I suppose the external switch is needed more forthe HV rather than the current drawn. <Q> A typical conservative recommendation for boost converters is not to boost by more than a factor of 6 (six) in a single stage. <S> It's harder to make the feedback loop stable at higher boost factors. <S> Going from 3V to 500V is a lot more than 6x. <S> Flyback topology could work. <S> I've just done a design, which had a 12V to 150V 20W flyback. <S> Here's an EDN article that describes an HV supply: 1-kV power supply produces a continuous arc (2004). <S> It has a flyback followed by a diode/capacitor charge-pump multiplier. <S> LTC1871 is used in the article, but other PWM controllers designed for low side MOSFET (boost, flyback, sepic) can do this job too. <S> A third possibility is a push-pull converter. <S> If you want to buy an HV power supply module, you can go to a place like EMCO . <S> I read this relevant thread here: <S> 5V to 160V DC converter <S> and I have a couple of queries: <S> Would the LT1073 circuit be suitable for this application. <S> What would be the maximum voltage felt by the LT1073 at the SW1 pin? <S> SW1 pin MAX is mentioned as 50V. <S> Is this independent of the supply voltage? <S> [N.A.: I think, this question is in the context of figure D1 on page 93 of Linear Tech's app'note 47 , which was originally suggested by Zebonaut in 5V to 160V DC thread ]. <S> The circuit in the app note is a combination of a boost and a diode/capacitor charge-pump voltage doubler . <S> The output is of the boost stage is half of the total (give or take a few 0.7V diode drops). <S> Both stages are controlled by a single outer control loop. <S> In the original figure, combined output is 90V, so the output of the boost stage is around 45V. <S> SW1 sees the voltage within it's rating. <S> Zebonauts post was suggesting to change the feedback resistors so that the combined output is 160V. <S> In that case SW1 would see 80V. +1 to the O.P. for noticing the voltage limit on SW1. <S> Another way of increasing teh output voltage of the aforementioned LT1073 circuit is to add more voltage multiplier stages. <S> Each stage can add up to 50V the output a voltage (equal to the output voltage of the boost stage). <A> Making a 500V supply capable of a few uA is actually pretty trivial: From TechLib.com <S> The transformer can be any generic 1:1 isolation transformer, the phone isolation transformers you can buy at radioshack work quite well. <S> However, this power supply is not capable of supplying any real power. <S> It works great for a geiger-counter, but if you have a load smaller then ~\$50M\Omega\$, you will begin to overload it. <A> A circuit to provide 500 Vol output from a few Volts DC will usually use an output transformer. <S> You could achieve this with a single stage boost converter but dealing with stray capacitance (which tends to limit peak voltage achieved) becomes difficult and if things 'gang aglae' and the 500V gets into the input circuitry they will gang very aglae indeed. <S> The <= 220 VDC ouput Nixie tube power supply that I referred to in my '160V question' answer IS capable of extension to 500V <S> BUT it was already layout dependant and the author recommended following his design & PCB. <S> extending it to 500V would be substantially harder as energy storage in capacitors increases as V^2 so as (500/200)^2 = <S> ~ <S> 6:1 layout becomes much more critical. <S> Adding a secondary winding as in the EDN 1 kV converter {see Accompanying article here } or with a MC34063 using eg figure 25 page 17 in the data sheet <S> Below is an "indicative only" somewhat modified version of the EDN 1 kV supply to show something that would work. <S> See article above for details. <S> I've removed the output current protection FET (and left the unused components in place) and removed the voltage tripler. <S> MC34063 startup voltage. <S> You asked <S> Suppose I use the common low cost MC34063 , would 3V be the absolute minimum I could go down to? <S> The datasheet page 7 table 8 says minimum startup voltage is 2.1 Volt <S> ** <S> typical* with MC34063A and 1.5V typical with MC34063E. <S> This is limited by the oscillator star voltage <S> and you'd want to look at output drive issues etc. <S> If you really wanted minimum possible Vin with an MC34063 you could provide a local supply driven by its own output once it started running. <S> You could probably run such a circuit from two cells (NimH or Alkaline or ...) with due design care. <A> I've not done one with that sort of boost myself, but I've seen designs of 5V to 400V converters using several stages of boost type DCDC architecture. <S> I understand that you have to be very careful about harmonics of the switching frequency of each stage affecting the next. <S> Synchronising the stages helps. <S> You have the advantage that the GM tube takes very little current (10's to 100's of uA peak) at a high voltage, so a ladder type voltage multiplier hanging off the end of a flyback might be a better choice. <A> The LT1073 is a gated oscillator converter. <S> The MC34063 is a constant period converter. <S> Neither of these approaches build up a high voltage quickly. <S> The duty cycle changes dramatically during the ramp from 0 to <S> 500 V. A photo flash charger, such as http://www.digikey.ca/product-detail/en/TPS65563ARGTR/296-23687-1-ND/1927748 accommodates the large voltage range better. <S> It delivers a constant energy per cycle in the shortest time possible, by detecting when the energy has been delivered. <S> Discontinuous operation also eases the component stresses. <S> Boost does not. <S> Also the magnetics will need to be tolerant of the voltages. <S> Please consider safety in this design. <S> What happens to the stored charge in the output when power is removed? <S> What protection is used to prevent user contact with the high voltage nodes?
Flyback works well at these high voltages.
Differential resistance for a zener I'm reading the BZX79 datasheet . On page 4 it lists differential resistance at 1mA and 5mA. For instance for the 3V version differential resistance is typical 325\$\Omega\$ at 1mA. Would that mean that a 1mA rise in current would result in a 325mV rise in voltage? That looks wrong to me (much too high). So how should I interpret that? <Q> Like Mike says, 1mA is not really much for a zener. <S> For low-voltage zener diodes zener voltage is often specified at currents as high as 50mA. <S> The following graph is from the datasheet of a different diode, the MMSZ5225BT1G : Note that at \$V_Z\$ the curve isn't very steep yet, the derivative \$\dfrac{dI}{dV}\$ is low, which means that a small change in current (Y) results in a relative large change in voltage (X). <S> For this diode the zener voltage is specified at 20mA, that's where the curve is much steeper (larger \$\dfrac{dI}{dV}\$), and the resistance at that current is "only" 29\$\Omega\$. <S> This means that a 1mA difference will result in a 29mV voltage change. <S> That's 1% of the rated voltage, and that's why I put the "only" between quotes. <S> I've seen several low-current zeners, specified at 50\$\mu\$A, but none of them shows anything about differential resistance in the datasheet. <S> Perhaps not really surprising, because the figures would probably look very bad. <A> Super zener: <S> This response is re the TL431 shunt regulator as it is effectively a programmable super zener which can cost very little more than a standard zener diode and usually has vastly superior electrical specifications in almost every way. <S> Everyone doing electronic design and construction should be aware of the TL431. <S> There are many other shunt regulators available, and many have better specifications, but <S> it's <S> very very widespread use and low cost have lead to even wider spread use and even lower cost <S> and it is now superb value for money and in many cases offers performance unmatched by a zener diode at little or no more all up cost. <S> Two resistors program it from 2.5V to 36V (1.25 to 18 or 36 V in low voltage versions. <S> Comes into regulation a about 0.5 to 1 mA and thereafter is near rock steady compared to a std zener (not as good a rock as a good std regulator). <S> Typically 0.5 ohms dynamic impedance across whole operating range compared to ~ 300 ohms reported in original question. <S> The TL431 is probably THE cheapest IC on earth. <S> About $US0.02 in manufacturing volumes in China. <S> The excessively enthused can use it to make a switching regulator (low speed), amplifier (really) and more. <S> TL431 datasheet here , and for the updated version TL431LI <S> See pages 28-31 in above data sheet for a range of applications. <S> Basic circuit. <S> Dynamic impedance <S> 0.2 / 0.5 ohms typical/max 1 mA to 100 mA at 1 kHz. <S> Can get in 2%, 1%, 0.5% tolerance parts. <S> 14/34 <S> mV typ/max ref deviation across temperature at 10 mA. <S> In regulation from 0.5 <S> ~ 1 mA on up to max. <S> (@ >= 100 uA for low voltage version.) <S> Programmable with two resistors 2.5V <S> - 36V. Or 1.25V - 18V low voltage version (1.25-36 Zetex and some others). <S> 2 or 3 cents US in moderate production volumes. <S> SOT89 part has 9 <S> C/W Rth_jc and 52 C/W Rth_ja. <S> 100 mA rated so at say 5V and max current = 500 mW temperature rise of SOT89 in free air <S> no heatsink = <S> 26 <S> C. Compare the graphs below to those for a standard zener (!): <A> The differential resistance is <S> dV/dI at the specified current. <S> Yes, 325\$\Omega\$ is high but then 1mA is a low operating current for a low voltage zener. <S> The differential resistance falls to 80\$\Omega\$ at 5mA, so you would expect rather less than a 325mV rise in increasing the current from 1mA to 2mA. The working voltage and <S> temperature coefficient are characterized at 5mA which is a more realistic operating current.
It's a typical value and it shows the limitations of a zener diode: you have to keep the current under control to have a good regulation.
ZigBee and Zigbee Pro interoperability Will products based on different ZigBee stacks (like the "Zigbee" and "Zigbee Pro" profiles) be interoperable? <Q> The simple answer is yes, as long as they use the same frequency range and bitrate, as there are multiple options for these in the standard. <S> This means physical layer interoperability (i.e. if you wrote the code for one or both, the modules should be able to talk to each other), not application-layer interoperability (i.e. any two random devices with a Zigbee logo on the box will not necessarily have anything meaningful to say to each other :) <A> This is covered in the ZigBee <S> FAQ : <S> ZigBee <S> PRO is the primary development choice; therefore, products built with the ZigBee Feature Set can only participate in a ZigBee PRO network as end devices. <A> ZigBee and ZigBee PRO are not different stacks: they are feature sets, and the latter is extended compared with the standard version. <S> From the same page Nick linked: <S> ZigBee <S> PRO has a number of optimizations designed specifically for larger networks comprised of thousands of devices. <S> If you also look at this table : they are cross compatible, but the PRO version is better optimized for some tasks. <S> The price is higher traffic load and (most likely) $.
Due to the wide variety of products able to use ZigBee, interoperability of products is determined by ZigBee standards.
Trying to make a usb car charger I'm working on a project to build usb car charger for my phone. The goal is to do it using only off the shelf parts (radio shack) and as cheap as possible. The size is also a bit of an issue but I'll deal with that later. I expect the phone to draw about 500mA and my car puts out a pretty steady 14.1V from the cigarette lighter. I came up with the design below but I though of one big problem. IC1 is a 7805 5V regulator (sorry forgot to label it). It will give off somewhere around 4W, which is way too much and right on the edge of what it's rated for. I set it up on the bread board and confirmed that it's very hot. Then I put the diode in to try and help distribute some of the heat but still way too hot. Any ideas? It seems like this will work as long as I can take care of the heat. There's not enough room in the case for a heat-sink either. <Q> As noted by retro - you can buy converters that will probably do what you want from Amazon or ebay or similar for a few dollars. <S> And you could use a linear regulator (with series input resistor as per my comment) and a heat sink. <S> Agh!!! - just had a look at my answer of May 2nd. <S> Just do this :-} <S> Ancient but glorious MC34063 + big brother <S> app note Claims to assist in component selection <S> Another version from here but its a stolen 2006 Silicon Chip circuit. <S> Bigger version here <S> For inductor they say 75 turns of enamelled 0.5mm dia wire on Neosid 17-732-22 powdered iron core. <S> The diagram and notes below are from figure 11, page 7 of the MC34063 data sheet from OnSemi. <S> Digikey <S> $US0.48/1 for SOIC-8 and $US0.62/1 for DIP8 . <S> You also need: A 1N5819 1A Schottky diode $US0.40 !!!!/1 <S> but far cheaper in modest quantity. <S> A few R's and C's. <S> An inductor. <S> 220 <S> uH 1A say <S> In the circuit below L = <S> 220 uH and Vin = 15-25V. Iout = 500 mA at 5V. <S> It will operate below 15 V in - a smaller inductor would be better. <S> Say 100 uH. <S> The circuit is very forgiving of inductor value. <A> 4.5 W is what it should do: (14 V - 5 V) <S> x 0.5 <S> A = 4.5 W. <S> The simplest solution is a 3-pin Plug-in-Power part, e.g. PT78HT253 from TI. <S> It is an integrated switching power supply and has much better efficency than 5 V/14 V =36% that you will see with a linear regulator. <S> If you need higher current, as @Kortuk suggested (probably for USB 3.0), the TI PTH0800W is good to 2.25 A. <A> Here in the UK, we have pound shops - similar to a dollar store in the US. <S> I happened to buy a Signalex USB in-car charger in one today for £1. <S> This shows that your project must be possible! <S> I just cracked the thing open for you, and there's one IC in there - MC34063. <S> Other than thatm <S> there's an inductor, a diode, 5 resistors, 2 electrolytic capacitors and 1 ceramic. <S> And 2 USB sockets. <S> Oh, and I just noticed a fuse that fell out. <S> Just one question - at that price <S> , do you really want to build one yourself? <S> Here it is on Amazon . <S> Photo added. <S> RM:
But, if you WANT to make your own and learn quite a lot and hav something that will be useful for many other tasks, then an MC34063 is a cheap and easy way to do it.
How to compute input impedance? I use a Sallen-Key filter for a project at university and I need to know its input impedance. Is there a way to compute it theoretically ? Here is my circuit: <Q> I just wanted to show you how to go about getting some numbers out of a circuit simulator so you could check your work (or apply the same concept to a more complicated circuit). <S> Here's your Sallen-Key filter in CircuitLab : <S> And here's the frequency domain simulation showing the input impedance looking into the input: <S> You can open the circuit and change the parameters, configuration, op-amp model, etc. <S> Just hit F5 and you'll see the V(out)/V(in) <S> Bode plot, as well as the input impedance plot that I've included a screenshot of above. <S> Using custom expressions in the simulator, like MAG(V(in)/I(R1.nB)) , allows you to calculate quantities like small signal impedances quite quickly! <S> Using a test current source, rather than a test voltage source, makes sense for how I'd probably go about solving this on paper. <S> However, for simulation purposes, using a voltage source as the test input allows us to more easily understand the V(out)/V(in) <S> Bode plot at the same time. <A> Yes, this is a standard circuit analysis problem. <S> Perform the analysis in the frequency domain (R and Xc) and connect a 1A ac current source at the input. <S> Solve for the input voltage as a function of frequency and that expression is the impedance. <S> I suggest using nodal analysis to perform the analysis. <S> Assume that the op amp is ideal <S> and so the current into the +/- <S> terminals is <S> zero and the voltage at these terminals are equal. <A> Use the extra element theorem, as explained in Wikipedia. <S> There are multiple paths to the solution with this approach (since any of the components may be made the "extra" one). <S> Choosing C4 as the extra element looks like one of the simpler choices. <S> In your circuit, the op amp complicates things a bit, but you can write down the currents and voltages on the schematic to compute the various impedances required. <S> Once you've mastered the extra element theorem, you can then proceed to the generalized N-Extra Element Theorem (NEET, originally developed by S. Sabharwal), which enables you to write down the answer by inspection and a bit of algebra on the schematic: $$Z_{in}=(R3+R23) <S> \frac{1+s[C5(R3||R23)+C4(R4+(R3||R23)-\frac{(1+R5/R24)}{1+R23 <S> /R3}R4)]+s^2C5C4(R3||R23)R4}{1+s[C5R23+C4(R4+R23-(1+R5/R24)R4)]+s^2C5C4R23R4}$$ <A> @snickers <S> I pretty much just compute the Input Impedance, Zin in my Head. <S> Well you could solve for it using Ohm's Law and summing node equations, but after you've done it a few times, just do it in your head. <S> Step 1. <S> Do a DC analysis Step 2. <S> Do an AC analysis where f is > <S> > <S> fo(BPF) <S> Step 3. <S> Figure out what happens at f= <S> fo <S> so here we go. <S> 1. <S> Zin= R1 + R2 2. <S> Zin= R1 (since C5= 0Ω) <S> 3. <S> Zin= open circuit due to cancellation of signals . <S> i.e. no feedback and hence maximum gain. <S> So if you had one of those nice HP or Anritsu Vector Network Analyzers, you get Zin with a big spike at f0 on a flat line where Zin starts at 35.6kΩ & ends at 33.0kΩ or something close to that... <S> But I do like the beautiful simulation and graph done above by one of our astute young Engineers. <S> See it my way? <S> or your way starting with <A> You can obtain the input impedance of this active circuit using the fast analytical circuits techniques or FACTs . <S> Install a test generator <S> \$I_T\$ <S> across the input terminals of your filter. <S> The \$I_T\$ current is the stimulus while the voltage <S> \$V_T\$ <S> across the source is the response. <S> First, consider the circuit for \$s=0\$ : open-circuit all caps. <S> and inspect the circuit below. <S> The input resistance in this condition is simply \$R_0=R_3+R_{23}\$ . <S> Now, reduce the excitation to 0 A and open-circuit the current source. <S> Then "look" through the capacitor's connecting terminals to determine the associated time constants in this mode: <S> The first time constant is found by inspection while you need a few equations to get the second one involving <S> \$C_4\$ . <S> You combine these time constants to form \$b_1=\tau_5+\tau_4\$ . <S> Then, short \$C_5\$ and "look" again through \$C_4\$ 's terminals to get the new time constant. <S> It's easy, its \$R_4C_4\$ . <S> You have \$b_2=\tau_5\tau_{54}\$ . <S> The denominator is equal to \$D(s)=1+sb_1+s^2b_2\$ . <S> For the zeroes, consider a response <S> \$V_T\$ <S> across the current source equal to zero: we null the response. <S> A zeroed response across a current source is similar to replacing the current source by a short circuit. <S> There we go: <S> The maths are not difficult and you will determine \$\tau_{5N}\$ , \$\tau_{4N}\$ and \$\tau_{54N}\$ in the same way as I did in the above lines. <S> The numerator is obtained by combining these time constants together: \$N(s)=1+s(\tau_{4N}+\tau_{5N})+s^2(\tau_{5N}\tau_{54N})\$ . <S> Finally, the transfer function is \$Z_{in}(s)=R_0\frac{N(s)}{D(s)}\$ . <S> I have captured these data in a Mathcad sheet: <S> and the plots are here: <S> A quick SPICE sim tells us this is correct: <S> Some more work can be done to rearrange a bit the transfer function with quality factors in <S> \$N\$ and \$D\$ but nothing insurmountable. <S> the FACTs are a powerful tool and gets you to the transfer function you want in a few steps that are all verifiable by a simulation.
Calculating the input impedance by hand is almost certainly what you're supposed to do as the other answers have suggested.
Arduino-controlled slot cars - alternative to MOSFETs for speed control? I'm attempting to control the speed of two slot cars in a set using Arduino. Each car is controlled by a controller with a variable resistor that looks like this: They're wired in parallel to the same 17V DC power supply: Simplified: For Arduino control, I experimented with manipulating a single car's speed using a MOSFET. It worked really well. Using a PWM output on the Arduino, I was able to pulse the MOSFET on and off to throttle the current and change the car's speed. The behavior of the MOSFET seemed to be exactly the same as the variable resistor controller; the resistance, voltage, and current fluctuated the same way on various parts of the circuit. Enter car B. I added a MOSFET to the setup and mimicked the MOSFET wiring for car A, grounding them both to the Arduino ground. The result looks like this: Here's a sketch: Close up, MOSFET A: MOSFET B: At first, all seemed well. I sent signals to MOSFET A and successfully changed Car A's speed. I stopped Car A and pulsed MOSFET B, and I was able to control Car B's speed just fine. Then, I turned Car B to a constant speed, and sent a signal to MOSFET A while Car B was still running. Car A started, but Car B's speed immediately dropped as a result of running Car A. I hooked a multimeter up across the rails of Car B and watched its voltage while it ran on its own. Then, sure enough, when Car A started running alongside it, Car B's voltage dropped dramatically. I figured this was because of my wiring configuration, so I left the multimeter on Car B, and made one change. I replaced MOSFET A with the original slot car controller: I started running Car B again using its MOSFET. The multimeter showed a steady voltage, so I began to squeeze Car A's controller (the variable resistor), and Car A's speed increased. This time, however, unlike using a MOSFET to control Car A, the variable resistor did not affect Car B's voltage at all. Car B remained at a steady speed the whole time. Any idea why this happens? The MOSFET seemed to function the same as the variable resistor (empirically) with a single car, but had totally different behavior with two cars in parallel. Is it because the MOSFET is not really changing resistance to current, but just switching it on and off, so it opens up another path for current to flow fully every time it closes? Is there an Arduino-controllable alternative to a MOSFET that would fluctuate actual resistance like the variable resistor? Digital potentiometer? Servo hooked up to a potentiometer? ;) I'm really curious what the difference is and what causes the major differences in behavior. <Q> YOu are entering a world where Electro Magnetic Compatibility is at risk. <S> Pay attention to the stray current spikes that radiate noise (Egress) and their influence on other circuits of high impedance (Ingress). <S> YOu probably also have ripple or the conducted egress and ingress as well. <S> For radiated noise a handy tool is a small AM radio (not FM) nearby, to locate such noise issues if you dont have a scope. <S> Noise suppression management may include some common mode chokes to the track or pot lines. <S> Perhaps some supply rail filtering may need to be added around the track. <S> I would use ferrite beads for each driver with caps after the bead and then use twisted pairs to send the current after going thru a ferrite torroid or similar common mode choke , like those used in Video cables. <S> Its good to have a kit of parts for such issues. <S> Add decoupling caps to the breadboard for both sides. <A> I suspect that your two PWMs are in phase: on at the same time, off at the same time. <S> This is likely to cause the voltage to drop at the output of the power supply. <S> You should also have a diode connected in parallel with your driver MOSFETs, in the normally non-conducting direction. <S> This shouldn't make much functional difference other than avoiding damage to the MOSFETs from back EMF. <A> I ended up finding that the L298 driver provided all the circuitry internally to control two motors separately and keep them isolated. <S> It worked really well using the part directly, but it needs some extra stuff to control heat. <S> This got complicated pretty quickly, just like trying to isolate the MOSFETs did. <S> Finally, I settled on buying this motor driver from SparkFun, which uses the L298 at its core: https://www.sparkfun.com/products/9670 <S> It has worked incredibly well for months, and it was a good investment to not have to design the circuit around the L298 myself. <S> Plus, it adds a few extra really nice-to-have features and packages it all together in a nice board with screw terminals for your power supply and motors. <A> You have got diodes across the motors so that is ok... <S> I think you problem is one of current, a breadboard and the jumper wires will limit the current flowing to the motors from the supply, you need a thicker wire for the common ground from the FETs to the supply negative. <S> One motor is ok, but when you start to use two, the extra current will cause problems. <S> Try taking 2 identical jumper wires from the motor supply ground, and have 1 to each fet source pin (leave the other wires to your ground rail on the bread board (Yes you will get a ground loop, but for testing this will prove if the breadboard / links are limiting the current))
Try a large electrolytic capacitor of suitable voltage rating across the power supply, and making sure that your PWMs are out of phase.
Measuring the rotation of a bicycle steering wheel I would like to mount a bracket onto the head tube of a bike frame to measure the degree of rotation the bike's handlebars have been turned. Ideally, this would be a contactless solution to increase the chance of the bracket fitting correctly. Two of the options I have researched are: A Hall Effect sensor on the fixed head tube and a magnet on the rotating bike fork Optical sensor on the fixed head tube and encoded object on the rotating bike fork Before I delve too deep into creating a Hall Effect prototype, does anyone have a better suggestion than the above options or any tips on how to best design this sensor? Thanks in advance! EDIT: @TelaClavo @RocketMagnet Thankyou both of you guys for the detailed answers. I think due to the requirement of mounting the sensor(s)/magnet on the perimeter of the head tube I am more favoured towards TelaClavo's solution. The sensor would be located in a bracket fitting on the front of the head tube, just above the moving ring between the head tube and fork. The magnets attached around the ring. The assumption I am making now, is that in order to accommodate head tubes of different diameters, a universal bracket can be manufactured to house the PCB components and sensors to fit flush to the head tube in both the sensor and magnets. <Q> My suggestion would definitely be the Hall Effect solution. <S> We use these extensively for rotation measurement, and they work very well. <S> There are two ways to do it: Ratiometric Hall Effect: Use a device like the A1324 . <S> It's a 3-pin device which gives an analog voltage proportional to the magnetic field strength. <S> For a magnet, you have two options: <S> A diametrically polarised ring magnet mounted on the steering column. <S> The sensor should sit at the circumference of the magnet, facing the centre. <S> Mount it on the steering column with its diameter colinear with the rotation axis. <S> As the steering column rotates, the analog output voltage will vary sinusoidally with angle. <S> Therefore, if you need to know the exact angle, you'll need to calibrate it. <S> Take readings with the handlebars at several known angles. <S> Then create either a piecewise linear function, or find the correct parameters for the perfect inverse sin function. <S> Added: <S> This option only works if we assume that the handle bars don't rotate more than about ±75º, preferably less than that. <S> Rotary Magnetic Encoder IC RLS have several good Hall Effect based rotary sensor chips . <S> You simply place a diametrically polarised button magnet on top of them, and it can tell you the rotation to 13-bit resolution. <S> The AM8192B1 is the highest resolution one. <S> Added: <S> This is the option to choose if you need to measure rotations beyond ±90º degrees. <A> With a single Hall-effect sensor, if you don't want to deal with the mechanical complexity of having to position your magnet right on the axis of rotation, and the sensor close to it, but steady, and choose to place the magnet in a spot on the perimeter of the rotating tube, and the sensor on the fixed tube, you won't have a very good SNR when the magnet is away from the sensor. <S> I would use a few (three or four) sensors, and one magnet. <S> Create a PCB with the shape of an arc of a circle, and put there the N sensors, concentrically, plus your analog circuitry (if needed), and your MCU (with N ADC channels). <S> Secure the PCB to the fixed tube, and the magnet, to the rotating tube. <S> Reading the N input signals, you'll be able to deduce the angle of the handle bar with more than decent resolution. <S> Responses to comments : (I don't have enough space there). <S> Rocketmagnet: <S> In the second half of your answer, the AM8192B1 is not a single Hall-effect sensor. <S> It is an IC with many Hall-effect sensors inside. <S> See page 1 of the datasheet: "The AM8192B1 uses Hall sensor technology to detect the magnetic flux density distribution at the surface of the silicon. <S> " <S> That's exactly my answer. <S> As far as your comment, you were right, and I've edited my answer. <A> Accelerometer+Gyro for handle bar would probably work. <S> If you add a Hall sensor, it could be compensated for drift very well. <S> I almost design something like this for a customer but at the end he couldn't find the money and I end up just dreaming it.
Hall sensors are placed in a circular array around the center of the IC and deliver a voltage representation of the magnetic field distribution. An axially polarised button magnet.