source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
What material are the thin, colored wires in my headphone cable? My broken headphones have different colored wires. Are the red, green and blue wires all copper? The colored wire is wrapped around a white thread. <Q> Yes, all of the conductive stuff inside the cable is copper. <S> However, the copper wires are coated with a very thin insulating layer called enamel. <S> As you can see, you don't need to clean your fingernails before you do this. <S> The thread makes soldering the cable pretty difficult. <S> Usually, if I find threads in my cable, I just throw it away. <A> The inner conductor is usually copper. <S> The outside, the colored stuff (red, green, blue) is usually some kind of plastic. <S> You can carefully remove the insulation from the conductor to reach the copper. <S> Some headphones have very thin wires which easily break when you try to pull off the insulation. <S> Don't tell the other electronics engineers here that I said this, but if you are careful you can remove the insulation by carefully holding it in a flame of a match or cigarette lighter. <S> If you are planning to try and connect the wires together to make it working again, be careful to not make shorts between different colors as that may kill your amplifier. <A> I broke the connector off a bluetooth microphone for a car stereo. <S> The wires inside the sheath were red and blue, but happily nestled together... <S> I soaked them in nail polish remover for a few seconds, agitating slightly...then burned the enamel off - carefully. <S> To my surprise... <S> I was left with slightly carbon-covered copper wire... <S> definitely something I could work with. <S> I soldered the newly "cleaned" ends after tinning carefully at 700 degrees. <S> The result is a serviceable salvage job.
But one of the problems with headphone cable specifically is that it often contains some thread to reinforce it. The enamel can sometimes be removed by rubbing molten solder on it. If this doesn't work, then you might have some luck rubbing some fine emery paper on it.
SSC-32, can I and how can i program it A friend recently gave me this board that he had never used and didn't know anything about it. It had a USB to serial cable plugged into it with the driver software that I installed and it had a servo motor included. Question 1- is this a micro controller (i know it has something to do with servo motors but is it programmable?)? Question 2- if this is programmable how can i program it (what language, what tools) and if so can i UNPLUG it from the computer and still have it run (flash memory or something like that) And last, does this have inputs (digital, analog) so I can perform actions based on the inputs? i notice some pins in the middle that don't look like they are for servos. <Q> The SSC-32 is a dedicated servomotor controller with an embedded microcontroller in it, the ATmega168 . <S> Answer 1: <S> It has a microcontroller, and thus is a microcontroller board. <S> The microcontroller on this can be reprogrammed - ICSP pins are accessible on the board, though not in a convenient ICSP header. <S> However, it comes preprogrammed with serial interface and servo control logic, changing the programming will eliminate the purpose of this board. <S> Answer 2 <S> : You can program it in C using AVR-GCC, or any of a host of other programming tools that support Atmel ATmega microcontrollers. <S> You will also require a programmer device, one that supports ICSP. <S> Yes, the board can operate when unplugged from the computer, <S> so long as an appropriate power source is provided to it. <S> The microcontroller internally contains Flash memory, as well as RAM and EEPROM storage. <S> See the datasheet linked above for details. <S> Last: The microcontroller does have both analog and digital input/output pins, but they may not all be conveniently broken out to pins on the board. <S> So yes, if you sacrifice the Servo Controller function of the board, you can use it to perform actions based on inputs. <S> Those pins you notice in the middle are, in fact, input pins used by the default programming to trigger servo related functions. <A> Disclaimer: This is a shameless plug for a friend/former employer. <S> As Anindo points out, you can't reprogram the SSC-32 without wiping its normal servo controller functionality. <S> If you program it with the ISCP header, it's just an ATMega168 board with headers broken out for servo hookups, but you've deleted the servo control code. <S> However, the Servotor32 is designed to do exactly that. <S> The onboard microcontroller is an ATMega32U4 running the Arduino Leonardo bootloader. <S> It uses a bunch of CPU time (and the SPI bus) for the servo control portion, but most of the spare <S> I/O is broken out and you can write code in the normal Arduino IDE that works alongside the servo control library. <S> Both the SSC-32 and Servotor32 primarily function by accepting commands over a serial UART (USB as well for the Servotor32 instead of the big old DB-9 connector). <S> The Servotor32 UART is broken out on the I/O header and can be used with an external Bluetooth module (sold separately). <A> Tools and the relevant documents are available here . <S> The board itself has documentation <S> I don't see any ADCs or anything else. <S> Look at the manual about whether it is USB powered or if it can be powered otherwise (it should be).
The board is a servo controller based on the Atmel ATMEGA168.
An opto-coupler/triac oddity -- is it a problem, and is there a solution? I'm using VO2223A opto-coupler/phototriacs to drive some low-current mains lighting with a PIC controller. All are working fine, but when the (DPST) mains switch is first turned on during system power-up), on 50% of occasions the lamps will briefly flash, even though the PIC control inputs on the chips are being held low. (Even grounding these inputs as a test has no effect on this flash.) Why are the power triacs being triggered? Is there a voltage surge? And is this potentially damaging to the V02223As? If it is a potential problem, is there a way of softening the initial power-up, raising the voltage more gently, and preventing this somewhat disconcerting flash (of 35 lamps...)? Many thanks. <Q> I assume the problem would also occur in an optocoupler triac too, even though it doesn't have a gate wired up. <S> This application note describes the problem, with some example solutions. <S> http://www.fairchildsemi.com/an/AN/AN-3008.pdf . <S> (You can probably google for other sources on this same topic, and there may be app notes that pertain specifically to optocoupled triacs). <S> One item that the paper mentions is that the problem is worst when the triac starts off in the state where no power is applied, as that is when the "collector to gate" (in the 2-transistor equivalant model) capacitance is greatest, and thus quite effectively couples the pulse from you turning on the switch into the gate, turning on the triac, at least for one half cycle. <S> I would not expect this to harm the devices, as this is just "normal operation" albeit for a very short time. <A> The flash may be because of a float / negative spike between the LED cathode and the PIC circuit ground. <S> Some options to debug / resolve the issue: <S> Use a pull-down resistor of say 10k between the anode and cathode pins (2 and 3) of the LED in the opto, and between the anode (pin 2) and PIC circuit ground. <S> Use a small capacitor between those two pins 2 and 3, say 0.1 uF, to bypass any circuit spikes at power-on. <S> Use some form of HV spike control between pin 8 and the HV supply rail <S> The spikes should not have any impact on the longevity of the power triac in that package - those are designed to cope with significant current spikes. <A> I agree with gwideman about using a snubber circuit and a pulse on collector-to-gate of the triac. <S> You can add an RC circuit in parallel to the triac (pins 8 to 6 with a minimum 200V rated film capacitor) <S> like the app note suggests in figure 10. <S> Mostly likely a transient spike upon power up is getting "across" the opto input, so you could also add a film cap across pins 8 and 5. <S> Also, are you sure you aren't drawing too much current across the Triac. <S> 35 light bulbs = only about 3.4W/lightbulb.
I suspect the issue here is that the triac part of the VO2223A is triggering due to a transient pulse at its input which occurs when turning on your main power switch. With ordinary triacs, the general problem of transients triggering triacs is treated with what's called a "snubber network".
What kind of inductive load does a mains LED lamp present? This follows on from another question I'd been asking. Having been 'gifted' dozens of mains LED lamps, I've been blithely assuming that they don't offer much in the way of inductive load. But, of course, they aren't just a mass of LEDs: there's a rectifier, and perhaps an inverter (though a glance at the wiring of the LEDs in my lamps suggests that there's two parallel chains of 65 LEDs, which would be about right to drop 230 V). I've searched for information, but there's nothing that I've found. Does anyone know a) if there is appreciable inductance in such lamps, and b) how one could set up a test rig to measure it? thanks <Q> LEDs are a nonlinear load and probably these lamps will not have a power factor correction converter. <S> This means that the current will not be sinusoidal <S> therefore you will have some reactive power flowing. <S> There may be a PFC choke before the rectifier bridge. <S> If you want to measure the power factor and harmonic content just take a scope with voltage and current probes and measure line voltage and line current. <S> PS. <S> This it how you distinguish China Export mark from European CE: <A> I measured a few LED table lamp bulbs. <S> The PF was 0.86. <S> I also measured some CFLs, and the power factor was 0.90. <A> However, it sounds like these lamps are wired in a way that would probably not have much inductive component to their load. <S> The large chain of LEDs in series probably means there is a full wave bridge, the LEDs, and a load resistor in there. <S> If so, the power factor won't be great, but there should be little inductive component.
The only way to really know would be to get the datasheet of the lamp or to measure it.
Correct place to attach shields for twisted pairs I have two PCBs connected by a cable containing 5 sub-cables: 6v power through a custom made coaxial cable (similar to that found on laptop power supplies). 2x 100mbps LVDS through 100ohm impedance screened twisted pair. 2x 1mbps CAN through the same 120ohm twisted pair cable. Each LVDS cable is terminated at the RX end with a 100 ohm resistor. They have foils screen with drain wires. Each CAN cable is terminated at both ends with a 120 ohm resistor. They have foils screen with drain wires. Isolated 24v power is delivered to the left board, where it's switched down to 6v (non-isolated). Both boards contain their own 3.3v DCDC regulator (non-isolated) for the local electronics. My questions: At which ends should the shields be connected? I assume the LVDS shields should be connected at the source end, as shown in the diagram. Since both ends of the CAN buses are sources, should both ends of the CAN shields be connected to GND? Added:Both PCBs are housed in plastic cases, and there is no attachment to earth. <Q> This is a difficult one to answer, mostly because RF and EMI are so incredibly non-intuitive. <S> One might say that if someone claims to understand EMI then they most certainly do not understand EMI. <S> I do not claim to completely understand EMI. <S> I know a lot about it, but I have some holes in my knowledge. <S> Consider that when reading my answer. <S> My main concern is that LVDS, and really any other differential signaling method that does not use isolation transformers, is not perfectly differential. <S> There are mismatches in the differential drivers that cause common mode "noise" on the diff-pair. <S> This common-mode noise also has a signal return path, which would be on the GND or shield in this scenario. <S> The problem with having the shields disconnected at one end is that this signal return path would be on the power cable-- causing a huge loop area and resultantly huge EMI. <S> While the common mode noise return current is small, the loop area his large, and so this must be accounted for in the design. <S> In one design of mine, I ran some 2.5 GHz signals over an 18" SATA cable. <S> For those who don't know, a SATA cable has two diff-pairs in it and two shields. <S> Both shields are connected together at the ends. <S> There are no GND wires in the cable other than the shields. <S> In my design, the shields were connected to signal GND at both ends. <S> This design worked great, and is in volume production right now. <S> It complies with FCC Class B, and the equivalent CE version, for electro-magnetic-compliance including radiated emissions, RF susceptibility, and ESD susceptibility. <S> Going on with the SATA comparison, all SATA motherboard/drives connect the shields at both ends, and they work fine at high speeds. <S> SATA cables are available in length of about 6 inches to 2 feet-- similar to what the OP is using. <S> Systems with SATA meet the more stringent EMC regulations. <S> And they are shipped in the tens to hundreds of millions of units per year. <S> There are millions of modern systems that show this works. <A> The LVDS are differentially terminated (across phases) so there should be no net flow of current - it is balanced. <S> The twisted pairs give you quasi TEM mode propagation so the concern of the shield here is purely electric field. <S> terminate at one end as you have drawn to avoid introducing current loops. <S> Since you have implemented a differential CAN system and are going point to point rather than bussed the same arguments apply for this as for the LVDS. <S> Your power connection looks fine. <S> All image current flow from the power will flow back close to the power coming in. <S> There is no image current flow from any of the signalling because they are differential and terminated, so a signal ground return associated with power is fine. <S> You don't mention if there are other potential aggressor circuits/cables around. <S> that may change this scheme. <S> For verification read Henry Ott's book on this subject "noise reduction techniques in electronic systems" <A> I've had problems with a similar arrangement where the R.H. 3V3 regulator circuit needed better decoupling to prevent switch-mode currents taking a partial route through data screens that were grounded at both ends. <S> I'm not saying don't ground at both ends, just be careful about the 3V3 regulator if it is a switcher. <S> The problem manifested itself as occasional data corruptions and I suspect that it was power current through the data screens that coupled to both wires in the twisted pair and caused the receiver common-mode "issues".
Were I designing this system, I would connect the shields at both ends. I would break the shield connection on the RHS but keep the one on the LHS.
Is MC8051 is a microprocessor with some components on chip? The 8051 microcontroller is a microprocessor with RAM, ROM, I/O ports, timers, and serial ports on chip. Is that the correct distinction between a microprocessor and microcontroller? <Q> It is very common to mix up microprocessors with microcontrollers. <S> Most 8051 variants I've come across would be classified as microcontrollers. <S> Typically a microprocessor is defined as a CPU core and not much else. <S> This would consist of circuitry comprising an Arithmetic Logic Unit (ALU), Program Counter (PC), Stack Pointer (SP), and various registers to hold the data being operated on. <S> Instructions and data are loaded into the registers via buses from external memories. <S> The CPU in your desktop or laptop would be considered a microprocessor. <S> These may include (but are not limited to) Memory (ROM and/or RAM), General Purpose IO (GPIO), communications interfaces, timers, PWM generators, and capture/compare circuitry. <S> AVR (Arduino), PIC, MSP, and most 8051's are considered microcontrollers. <S> Things can get even more confusing when you bring Digital Signal Processors (DSP) and System On a Chip (SoC) into the picture. <S> DSPs are a special form of microcontroller that typically have special instructions integrated into the microprocessor core to handle floating point numbers or specialized multiply instructions to make the programming of certain types of digital filters more efficient. <S> They also usually have Analog to Digital Converters (ADC) or Digital to Analog Converters (DAC) listed among their peripherals. <S> TI's C6000, Freescale MSC, and Analog Devices SHARC are examples of DSPs. <S> SoCs consist of one or more microcontroller and/or DSP cores, a variety of on-chip memories, programming interfaces, and timing sources. <S> Oftentimes they include Radio Frequency hardware on the chip such as can be found in your smartphone. <S> It is also common to see voltage regulation and circuitry to monitor power and temperature on the chip as well. <S> You will occasionally see programmable logic incorporated into the design as well such as in the Cypress PSoC. <A> In general, "microcontroller" means a processor with self-contained memory on the chip. <S> Most have no external memory bus at all. <S> The pins are used instead to interface to real world stuff that the microcontroller controls and senses. <A> Yes. <S> 8051 is the processor core and usually there are a set of peripherals. <S> RAM is always there, but timers, FLASH/ROM, Serial (UART or others) depends on what the company wants to add around it.
A microcontroller consists of a microprocessor and various associated peripherals.
Want a Second Look Do all of these Capacitors Need to be Changed? I pulled apart my monitor to check the capacitors and I think almost all of them need to be replaced but there are a couple I am not sure about <Q> The white goop in your photos is not something that exploded out of the capacitors. <S> It's something like a potting compound, and if I guess right, it has a kind-of rubbery consistency. <S> I suspect it's there to prevent the tall parts from being bent over to where they touch the heatsinks next to them. <S> If that were to happen, those capacitors could be overheated and their lifetime would be shortened considerably. <S> I've seen similar compounds used more commonly on tall parts to dampen physical vibrations which could wear out the leads over time, but given all the other tall parts on your board that don't have the goop on them, that's probably not what's going on here. <A> On your first picture, the central IC/microcontroller has a sticker on it with a "2007.9.7" marking. <S> It might be the date of manufacture or assembly. <S> Most electrolytic capacitors made around 2002 to 2010 in Taiwan/Hong Kong <S> /China were known for early failure: dubbed the " capacitor plague ". <S> The " CapXon " brand of capacitors is from a manufacturer in Taiwan and Google search for " capxon bad capacitors " is picking up a lot of hits (9,140 results). <S> I suggest that you replace all the capacitors including those that doesn't look bad. <S> Those that hasn't failed yet is most likely to fail soon - and worse, taking Murphy's admonition , cause catastrophic circuit failure. <S> So save yourself of that trouble and of having to disassemble the device again by replacing everything including the surface mount capacitors in the first picture (the one you marked "OK???"). <S> Those are surface mount electrolytic capacitors. <S> As a legal maxim goes, "falsus in uno, falsus in omnibus" or false in one, false in all: if the CapXon capacitors can't be trusted, the rest of the components may also be of shoddy manufacture. <A> Bulging is the obvious sign that a capacitor has failed, so those will need replacement. <S> The one marked "what happened here" just looks like it's been physically pushed over during assembly or disassembly. <S> There is no way to reliably test a capacitor in-circuit that I'm aware of <S> and you really need to remove to measure ESR and capacitance. <S> You should be aware that the failure mode of capacitors includes being open, shorted, low capacitance and high ESR and depending on their usage any of those (especially a short) <S> often will damage other components so it's not likely to be as simple as just replacing all the caps. <A> From your images it is the first one and the last two that you are questioning? <S> Any physical deformity, such as in the first, suggested needed replacement. <S> I cant' quick make out what is going on in the last picture. <A> You have disassembled the unit entirely. <S> Don't try to save 1 or 2 Euro's/Dollars by leaving not replacing a few of them. <S> Replace them all, especially since it looks like they are all the same brand. <S> Hopefully the rest of the circuit didn't get damaged due to the bad caps. <S> I'm really curious why so many are in such bad shape.
You may want to replace all the electrolytic capacitors. They all probably came in one batch and from one manufacturer. The others may very well fail soon too and you'll have to do the whole operation again.
Do any SMT components require hand soldering due to heat limitations? It has been claimed on another board that some SMT components cannot be used in an automated production line (i.e. reflow or wave soldering) because they cannot withstand the heat/temperature. Hand soldering is used to avoid these problems. An example given where this was the case was film capacitors. Capacitors are often the component which limits the maximum temperature and time at high temperature, but I haven't seen any that preclude the use of reflow soldering. I haven't encountered a single SMT component that cannot be used in an automated soldering process in the past. Some require care i.e. the temperature profile must be carefully chosen and times at high temperature limited. Some components do not support the use of lead free solder (in terms of maximum temperature), but these are becoming rare. I suspect that requiring hand soldering is either due to: Limitations in the equipment i.e. the reflow oven cannot deliver heatquickly enough to meet the requirements. Poor design i.e. it hasn'tbeen designed with reflow in mind and large and small componentscannot be soldered at the same time. A few very special componentsrequire special treatment and it is easier to hand solder than changemanufacturing processes. Small scale production where hand soldering doesn't cause costs to explode. I also feel it might be incorrect to assume that hand soldering results in lower temperatures, but that is not the core question here. I don't think it would ever be an inherent limit in an SMT component - they pretty much came about to support automated manufacture. Thoughts? <Q> I have never encountered a SMD part that needed to be hand soldered. <S> Probably what someone ran into is a part that needed a special profile such that the board would have had to be run thru the oven twice. <S> If this is due to a single part, it could well have been more cost effective to run the board thru the normal process and <S> hand solder the special part afterwards. <S> It's not that it couldn't be reflow soldered, but that for that process in that situation it wasn't economical. <S> I have seen this case a few times. <S> Another case I've seen a few times is when there are only a small number of parts on the bottom of the board. <S> Two-sided reflow takes some special handling, and for a very small number of parts it's more cost effective to run the normal process for the top side, then add on the small number of bottom parts by hand. <S> More stuff is hand soldered than you might imagine in places where the labor rate is low. <S> A factory one of my customers used in China had a whole manual assembly line right next to the more automated pick and place and reflow line. <S> Again, it is highly unlikely <S> what you heard is due to a part needing to be hand soldered due just to the part itself. <S> A assembler may have said they "need" to hand solder a particular part, but that was due to their process and tradeoffs, not inherent to the part. <A> I can think of a few realistic situations that could have been distorted just slightly to get someone thinking there's SMT parts that can't take automated soldering: <S> Some SMT parts might require reflow soldering rather than wave. <S> Or wave might require an added process step (and added expense) of gluing them down to the board to avoid the wave washing them away. <S> Some parts can't be aqueous washed. <S> This can make them incompatible with some solder processes, although "no-clean" is more common nowadays. <S> The only case I've run into was a through-hole transformer, but I could imagine it happening with an SMT transformer, relay, or switch. <S> Someone who'd had to change a design because of one of these situations might only remember, a few years later, that there are SMT parts that aren't compatible with automated soldering. <A> At my employer, more TH parts are hand-stuffed than SMT parts. <S> In general, the industry is trying to make PCB assembly more automated, not less automated. <S> It is common to have over 1,000 parts on a PCB these days, and hand-stuffing those would be very labor intensive, error prone, and expensive. <S> If a PCB with 1,000 parts was stuffed by hand, and it took 5 seconds per component (I'm very optimistic), then that PCB would take 1 hour 23 minutes to stuff. <S> It <S> it took a more reasonable 15 to 60 seconds per component <S> then things look even more unreasonable at 4 to 17 hours. <S> To make things more interesting, parts like BGA's, QFN's, 0402's, and 0201's are more reliably soldered down with an automated process than when hand soldered. <A> Heat limitations are solved in several ways. <S> By cold air or covered dry ice beds. <S> Automation should be using a dry refrigerated cold box. <S> Fans circulate the cold air through the box from two ends. <S> One end sends cold air as the other circulates it back to refrigerate and blow again. <S> Then blows direct cold across the circuit boards components. <S> The automation line lays the board made to rest onto the cold air box opening with rubber seal grommets to rest the circuit boards. <S> Soldered behind the board from top. <S> Problem solved. <S> They used this at Texas Instruments in the 1970's through 1980's. <S> It will require a climate controlled automation area though so condensation won't become a problem.
An old part (SMT or through-hole) designed for tin-lead solder process might not be able to take the heat of a lead-free solder process.
Lower Voltage of 15 VDC Power Supply to 13 VDC for DC Blower I have a centrifugal blower, model 007-A42-32D, that uses 12 VDC at 17.5 amps. The performance information provided by the manufacturer, SPAL Automotive, was acquired at 13 VDC. I have a power supply that provides 15 VDC at 20 A. I feel that applying 15 VDC to the blower, given that it will be subject to continuous duty, may cause premature failure. Question #1:Is applying 15 VDC to a blower that was tested by the manufacturer at 13 VDC problematic? Question #2:Will someone please provide to me the simplest method of reducing the voltage of the power supply using electronic components? Thank you to all who help for your time. edit:I understand Voltage is the product of Current and Resistance as in V = IR. Since 12 VDC power supplies capable of 17.5 A minimum are not cheap, if the placement of a resistor can allow my 15 VDC power supply to work, that is the most sensible choice. Given V = IR, if I = 17.5 A, then R must equal the equivalent series resistance of the blower combined with additional resistors such that V will equal 12. Is that correct? <Q> Is applying 15 VDC to a blower that was tested by the manufacturer at 13 VDC problematic? <S> Like Olin says, only the data sheet of the fan can answer this for you. <S> I understand Voltage is the product of Current and Resistance as in V = IR. <S> Since 12 VDC power supplies capable of 17.5 A minimum are not cheap, if the placement of a resistor can allow my 15 VDC power supply to work, that is the most sensible choice. <S> Your fan isn't really like a resistor. <S> For example, it probably needs a lot more current to start up than it does after it gets running. <S> If you size your resistor for the running current, you might prevent it from starting up. <S> If you size your resistor for the start-up current, you might overheat the fan after it gets running. <S> Will someone please provide to me the simplest method of reducing the voltage of the power supply using electronic components? <S> Diodes will drop roughly the same amount of voltage over a wide current range. <S> It's up to you to find a combination of diodes that can carry 18 A continuously and drop close enough to the right amount of voltage. <S> Also, these diodes will be burning about 36 W, so you will need to be sure they have heat sinks or other means of cooling. <S> Edit <S> Olin's comment points out that your question title says the fan needs 13 V, but your text says 12 V. <S> To drop 2 V, your diodes (or any other thin you put in series) will need to burn 36 W, to drop 3 V, they'll need to burn more than 50 W. Careful consideration of cooling will be needed. <A> You could use two of these STTH30L06 <S> power diodes in series; they have a current rating of 30A, and a maximum forward voltage drop Vf of 1.55v at 25 deg C and, and <S> a typical Vf of 1.0v at 150 deg C. <S> So two of them in series would give you a drop somewhere between 3.1v to 2.0v, which fits your requirements. <S> Make sure you use hefty heat sinks on each diode. <A> Will <S> 15 V hurt a 12 V blower? <S> Maybe. <S> What does the datasheet say about absolute maximum and operating maximum voltage? <S> Reducing the voltage at this power level is the wrong way to go about this. <S> Get the right power supply. <S> 12 V is a common power supply voltage, so this will be easy.
If you're determined to hack this, 2 or 3 series diodes would be a better choice to drop the voltage than a resistor.
Why does active low even exist? In my career I've often encountered signals that are active low (Reset being the most common). I've even seen interfaces where all control signals are actively low. To me, this is very unintuitive and confusing.Why is there ever a need to use actively low? Is it merely historic or is there actual gate count / power concerns that explains it? <Q> I can imagine it was even more common in IC designs than in discrete logic, because all logic was essentially built from inverting (NAND) gates, but I'm not personally experienced in that area. <S> That level of optimization is rarely needed today, or at least it's done automatically by synthesis tools so that it's transparent to the designer. <S> Like you noticed, there's only a few cases where active low signals are still very commonly seen. <S> One advantage of an active low signal for functions like reset and interrupts, is it's very easy to create "wired OR" logic for an active low signal simply by using open collector outputs. <S> That is, if there's several different circuits that need to be able cause a reset or an interrupt, each of them can simply have an open-collector output tied to the ~RESET or ~INT wire. <S> Then, any one of them can pull the line low and cause the appropriate response without the need for any additional logic to combine the signals. <A> In logic families like TTL a open terminal is interpreted as High, since it depends on current sinking logic to detect a logic zero input. <S> Designing a pin active low ensures that it is functional if and only if an intentional logic state is applied, ie. <S> to avoid ambiguous floating input condition. <S> Additionally special case of RESET has been answered in this question. <A> The primary advantage to active low is safety . <S> It is used widely in the C&I world in situations where a lost signal would be devastating . <S> One example would be the water level of a boiler being low, another would be an emergency stop, another would be low fuel pressure. <S> If one of these events happen the machine must be stopped. <S> If the system used active high, and the instrument broke or a signal cable was damaged, the controller would never know there was a problem. <S> If the system uses active low, and the instrument broke or a signal cable was damaged, the system would respond in the same manner as it would to the instrument being activated. <A> Active low signals are more tolerant of noise in some logic families, especially the old TTL. <S> A high TTL signal must be at least 2.8V out and can be as low as 2.0V in. <S> That leaves 0.8V margin for voltage drop and noise. <S> And a pullup resistor to the 5V supply can be added for additional margin. <S> A low TTL signal must be no more than 0.4V out and can be as high as 0.8V in. <S> That leaves only 0.4V of margin for voltage drop and noise. <S> You can use either level to represent either logic state. <S> But it makes sense to choose the most noise-tolerant level for the state that the signal will spend the most time in. <S> Many signals spend almost all of their time inactive. <S> Therefore it's wise to use the noise-prone low-level to represent the infrequently-occurring active state, and the more noise-immune high-level to represent the frequently-occurring inactive state. <A> Logic signals have two states. <S> Which one you consider on or off, or use to communicate on or off is totally up to you. <S> There is nothing more right about high being on or true than low. <S> That fact that it is unintuitive to you is irrelevant when designing a system. <S> You may think high should indicate true, but it may be completely the other way around for someone else. <S> Good engineers try to do what makes sense, not get hung up on religious points. <S> Sometimes it doesn't matter, then you get to pick whatever your preference is. <S> Sometimes it does matter. <S> For example, since it is convenient to have circuits that must communicate share one common net that we usually call ground, and most logic circuits have evolved to require positive supply (think about it, it could just as well have been the other way around), logic signals will generally be either at ground or the positive supply level. <S> Let's say you need to drive a digital input from a normally open pushbutton. <S> Especially if that pushbutton is mounted physically not right at the circuit, it is convenient to tie one side of the pushbutton to ground. <S> That means the other side will be driven to ground when the button is pressed. <S> That inherently creates negative logic, meaning a low indicates pressed and a high (with a passive pullup) means released. <S> It woud be silly to add a inverter just for religious reasons if this line then went into a microcontroller. <S> The firmware in the micro can deal with either polarity representing pressed, so other than satifying a superstition, the inverter would be just a waste of space, power, and cost.
In historical digital designs, active low signals would be used whenever their use would allow reducing the number of gates in a design, and thus reduce the cost of the circuit.
How to measure the capabilities of a wall adapter? I purchased this from dx.com. The specs on the device claim 1A@24V. The device exhibits 24V at no load on pins +4,5 and -7,8. According to Wikipedia, this is called a passive power injector . I tried drawing 1A from the device and failed (some protection drops the voltage to 0V). How do I determine how much current can I draw from it? Are there some cheap variable resistor blocks or some other tricks? <Q> The basic answer is "try different loads to see what works and <S> what doesn't". <S> All other answers are a variation on this. <S> Of course you can swap out different values of load resistors, measure what the voltage/current is with different resistors. <S> Then graph the results. <S> That's the "poor man's" way to do it, and it works surprisingly well. <S> On the other end of the "sophistication scale", there are electronic loads. <S> This is a box that looks a lot like a nice benchtop power supply, but provides a load. <S> You can configure this load in a variety of ways (Constant current, constant voltage, resistive, pulsing, etc.). <S> You change the load electronically and graph the result. <S> A third way is to make your own electronic load box. <S> Again, there are many ways to do this. <S> Simple relays that switch in/out load resistors works. <S> Or you can do the equivalent of a high-wattage current mirror (or amplifying current mirror). <S> An opamp plus MOSFET or Bipolar transistor can be turned into a regulated load. <S> All three of these options are valid. <S> But I can tell you this: most people use the first approach, just sticking on some load resistors. <S> If people get fancy then they add some switches and a heat-sink to the resistors. <S> Cheap, simple, and adaptable. <S> One thing to keep in mind with any of this: <S> It is likely (70% ?) <S> that some sort of Polyfuse is being used to limit the current. <S> This is basically a resistor that dramatically increases it's resistance when it gets hot. <S> Run a lot of current through the device <S> and it heats up, thus increasing the resistance. <S> When the temperature goes down, the resistance goes back down. <S> These are used as self-resetting fuses. <S> The problem with these is that they are not terribly accurate, and their operation depends on the ambient temperature. <S> So on a hot day they might kick in at a lower current than on a cold day. <S> Keep that in mind when figuring out how much current your wall adapter can support. <A> Since it appears that the device is protected against loads that try to draw 1A, you know that there is an upper bound on its performance somewhere below that load, and that it is not destroyed by the attempt. <S> So you can cheerfully probe the device with various smaller loads and plot voltage versus current on a graph. <A> simulate this circuit – Schematic created using CircuitLab <S> This was my test circuit, as I found it rather hard to get large resistors. <S> Here is the review of the product. <S> Basically, I am vary happy with the purchase: $5.67 (if ordered ten units) <S> 24V 1A 0.5Vpp noise at full load <S> RJ-45 jack Over-current protection (not very accurate, rather a short-circuit protection) <S> Thanks to everyone for the advices! <A> Adding to the answers above, the best way to test this quickly and easily is to use an electronic load. <S> Here you can specify how much you will draw from the device, and so you can quickly test to see whether it is drawing that much. <S> It will work for extended periods. <S> EEVBLOG had some great video about testing a power supply that failed after being subjected to its maximum limits (it had a design flaw). <S> Can't seem to find that video now.
Yes, there exist high wattage / low resistance variable resistors with sliding potentiometer taps for this sort of load testing.
How to determinate a reasonable clock frequency for a MCU? Currently my datalogger is running at 12Mhz, and sleeps 90% of the time. When it's active its mostly blocked by I/O like SD-card or UART. I suspect the system would still work at 6 Mhz, but how do you know whats reasonable? I can decrease the clock untill weird bugs starting to occur, but that seems too fuzzy. I can count all assembly instructions and calculate the value, but thats too exact (and way too much work). So are there some rules of the thumb to make a reasonable estimation? <Q> If your code isn't working as the clock speed reduces it sounds like you're keeping all the interupt sources alive (nested interupts) <S> when your servicing an interupt routine. <S> With all the interupts enabled all the time, you will jump out of some code and into a higher order interupt if one occurs, only returning to a lower order interupt once the highest order one has finished. <S> This can lead to major timing issues if the interupt priorities aren't properly managed especially with communication ports such as a UART & SD CARD. <S> If one assumes the GPIO are connected to the outside of your box, then the GPIO interupts will happen "at will" in a data logger and can't be predicted so keeping these routines very short is advantageous. <S> This may lead to setting a maximum GPIO toggle rate for these external pins so your code remains valid (maximum 100Hz on any external Input pin, and a maximum of 2 KHz across all inputs for example). <S> If you want to reduce current then you run in active mode at a higher clock speed, by altering the code so that all routines are event driven and go into a sleep or wait mode for the rest of the time to reduce the supply current. <S> A few microcontrollers have extremely low current Wait modes by 75% of active mode (CPU off, peripherals on) but most only reduce the current by ~20-30% from active mode. <S> One or two micro vendors can even keep the peripherals running in deep sleep modes with fast wake-up, but most micro's usually turn off all the peripherals in deep sleep and only allow the the GPIO, WDT, POR, BOR or an RTC to wake up a micro. <A> Provided you don't have to spend time busy-waiting within your CPU, total charge (energy) consumption by the CPU core will be a function of the total number of instructions you need to execute, rather than the clock speed at which they are executed. <S> The amount of power spent by a CPU core which is active 10% of the time at 24MHz will often be roughly comparable to that of a CPU core which is active 20% of the time at 12Mhz. <S> If the chip has a programmable internal VDD, and can only operate at higher speeds with higher VDD settings, using those higher settings will likely increase the per-instruction charge consumption regardless of the speed at which the CPU actually executes those instructions . <S> Thus, cranking up the CPU beyond a threshold that requires a higher VDD will have a much better effect on charge consumption than cranking it up to a point just below such a threshold. <S> My recommendation would be to figure out roughly what speed you need, figure out from that what VDD and other settings one will need, and set the CPU clock to be as fast as possible given those constraints. <S> Then once you've done that, focus on making the CPU be idle as much of the time as possible. <A> supercat's answer is pretty much what I would have suggested, but also check your circuit for other consumers that draw current when they don't need to. <S> If there are external ICs, see if they provide a power down mode (one candidate is your UART: if you have a level shifter, it might be possible to switch it off at least partially during sleep). <S> Voltage dividers, pull-ups or pull-downs, check anything. <S> Passive components are often ignored because "they don't do anything", but they do draw current. <S> Provided that you have external components, chances are that these draw more current than your microcontroller even before you have optimized voltage, frequency and active time. <S> If this is just a prototype, see if you can redesign it for optimized power consumption. <A> With a duty cycle of 10:90 cycle at 12MHz, then about 1.2 MHz should give a 100% duty cycle with no margin for error. <S> Pick a factor of safety within your comfort level and multiply it by 1.2MHz. <S> If 10:90 is an estimate you could raise an output bit when the MCU wakes and lower it again just before it sleeps. <S> You can then find the run time with a scope or a DVM that can measure frequency and duty cycle. <S> Make the above adjustment and measure again. <S> Repeat until it meets your duty cycle, power consumption, or other goal. <A> My strategy of choice when dealing with this type of application, is to make the code event-driven (or asynchronous) and not worry too much about clock frequency. <S> Several of the Atmel MCUs have levels of sleep that will enable/disable certain interrupts for wakeup. <S> ARM Cortex M-series MCUs also have advanced interrupts abilities that goes well with power savings. <S> When the event queue is empty, do the default action: go to low-power mode for some time. <S> That way, the clock frequency isn't important, as you're only powered up and using power when you have anything to do.
If you drive the system with interrupts (for instance via timers or peripherals), you may be able to lower the MCUs power-level to some sort of hibernation setting as the default action and only do something else on interrupts.
Is wire wrapping still used nowadays? I know that wire wrapping was used in critical applications where reliability was a major concern because it is more reliable than PCB based assemblies. But is it still true? The AGC (Apollo Guidance Computer) was wire wrapped but what about current designs?Are mars rovers, space telescope or critical nuclear power plants systems wire wrapped? <Q> Occasionally, in some R&D lab, maybe, if they really need a one-off prototype and someone knows how to wire-wrap and has the tool and wire, and reliability isn't important. <S> Otherwise making multi-layer PCB has just gotten too cheap and easy for everyone. <S> Of course, multi-layer boards are much harder to fix than a rat's nest of thin wires, but with modern EDA software, are far more likely to be correct in the first place. <S> In some parts of the world where financial limitations and difficulty of access to markets force people to make do with whatever they have, it's no surprise to find old techniques in use. <S> But google turned up no concrete anecdotes like that for WW. <S> (Maybe I didn't spend enough time googling.) <S> More likely, WW is to be found in use by hobbyists with an itch to go retro, for example http://hackaday.com/2012/07/10/16-bit-hcmos-computer-is-a-wire-wrapping-wonderland/ <S> where one commenter states " <S> It’s rather <S> zen, and an enjoyable way to burn a day – like knitting, basically." <A> Wire wrap isn't used much today for a few reasons, but perhaps the most important is density. <S> It's not possible to pack wire wrap connections much closer than the classic 0.1 inch spacing, which means you can't have as many connections on an IC or board of a given size. <S> Applications which demand high reliability usually demand small size as well, so multilayer (often far more than 8 layers) <S> printed wiring boards are ubiquitous. <S> Another consideration is the amount of skilled labor needed. <S> A surface mount printed circuit can be assembled almost entirely by machine, while even the most automated wire wrap systems still need manual intervention. <S> Once the printed circuit assembly line is up and running, the defects are minimal and can be monitored statistically. <S> It's much harder to ensure quality with an army of humans holding wire wrap guns. <S> There is one place where wire wrap, or at least the wire used for it, hasn't died: white wire (a.k.a. green wire) <S> fixes. <S> The first iteration of a board often has a few design defects which get fixed in the first copies of the board by cutting incorrect traces and making a correct connection by soldering down pieces of wire wrap wire. <A> I frequently use wire wrap techniques to make quick connections between eval boards and similar pre-pcb prototype setups. <S> Most .100" headers/connectors (and even with care the 2mm variety) will take a single layer of wrapping just fine. <S> It's cleaner and no more time consuming than soldering, and doesn't leave any residue behind when removed. <S> Sometimes one end of the wire will end up soldered into a via or directly to an SMT pin, but the other may end up wrapped onto an available header pin. <S> Frankly I suspect this is why the tools and wire are still fairly widely available, even though long-pin wire wrap sockets and headers seem to be scarce. <A> WW circuit boards are not common, if you read the NASA standards (all available online) they allow WW, through-hole and SMT. <S> However, it's still used extensively in telecomms for terminating wires on distribution frames. <S> Edit to add: http://nepp.nasa.gov/index.cfm/5575 <S> - well worth a read if you've got a minute. <A> imho wire wrapping is not necessary more reliable compared to a soldered PCB, but wire wrapping makes it easier to change if you need to re-route the connections, hence it is found in early telephone exchanges https://en.wikipedia.org/wiki/Wire_wrap#Manual_wire_wrap <S> it is also very useful for prototyping, e.g. this enterprising maker creates a cpu and computer out of basic chips <S> http://www.bigmessowires.com/bmow1/ with arduino, beagle bone, raspberry pi, etc, electronics fads, wire wrapping is making a comeback with these diy electronics as it turns out wire wrapping is an effective and rather low cost way to connect mcu modules to breakout boards and other components and it can easily scale to very complex systems as the 2 links above show https://www.google.com.sg/search?ie=UTF-8&oe=UTF-8&q=wire+wrap&sitesearch=http://forum.arduino.cc https://www.sparkfun.com/categories/20 <A> In all I've seen maybe for prototyping. <S> I had the last class in a university and we wire-wrapped an entire 8088 computer <S> , I think I must have spent 300 hours doing that. <S> After that I've only used it for prototyping and not even that much. <S> All of the aerospace hardware I've seen is all PCB's, in American space programs you have to shake your hardware in a vibe test before its sent to space (to simulate the rigors of a rocket ride, in which the payload experiences extreme g forces from turbulence). <S> I doubt anyone today would want to do a vibe test with a wire wrapped board. <S> This could leave you with a dead spacecraft. <S> I did use wire-wrapping for to prototype a photometer trans-impedance amplifier to detect photons for an ultraviolet imager. <S> But that was not for flight hardware, just for demonstration purposes. <S> PCB's are cheap and plentiful today, 40 years ago there were no computers to design PCB's, they had to be drawn by hand. <S> Wire wrapping then would be an attractive option. <S> Today there is no comparison for PCB's they are cost effective and take less time than wire wrapping.
The other problem with wire wrapping is, if not done correctly, wires can break.
Is it generally possible to uniquely identify an individual MCU (for licensing purposes) (no MAC address available) I am being asked to enhance the firmware installation program for an MCU (specifically, a Freescale MC9S12E64 - though I don't know if this matters). The purpose of the enhanced installation is to limit the number of times the firmware can be installed. It seems the best way to do this would be to uniquely identify the specific MCU in use during firmware installation, in order to keep track in a central database. If the MCU had a MAC address, this would seem to be feasible. Unfortunately, these MCU's have no network interface, and hence no MAC address. Looking through the manual for the MCU noted above, I cannot find an indication of a unique identifier for the MCU. My question is: Do MCU's typically have unique identifiers associated with them - analogous to a MAC address - that can be obtained by software as firmware is burned into these devices? <Q> ICSP <S> i think, In-Circuit Serial Programming. <S> I'm not sure about Freescale. <S> Perhaps migrating to a different mcu is the answer. <S> In that case you could program a unique number to each unit and store them in your database. <A> They almost all do, but they're not always accessible to the users. <S> I think your issue is more complex because you're trying to use it to enforce an installation. <S> Please note that many of the DRM methods fail when a proper adversary attacks them (especially since you can't trust the microcontroller since the user has control of it). <S> A cursory search through the datasheet of the microcontroller failed to find any identifying serial. <S> You should contact Freescale directly. <A> The type of MCUs that have serial number will be anything that uses encryption, such as Bluetooth, workstation CPUs, such as Intel (though I understand this feature may be turned off), and of course the previously mentioned ethernet MACs, which themselves contain elaborate MCU subsystems. <S> The kind of technologies that can be used for a serial number are limited. <S> In fact it may well cost more to add the serial number than the increased profitability of your licensed software. <S> The usual techniques are: efuse: a type of polysilicon which goes open circuit when a high current is passed.floating gate transistor: uses quantum mechanical tunnelling to make a small memory. <S> EEPROM, EAROM, FLASH: uses extra mask layers to provide a memory function.1-wire serial number interface: a separate chip and low cost interface. <S> All of these methods require extra masks, royalties, test time or all of the above, so are generally not implemented on mass-produced MCUs. <S> Expensive desktop processor can absorb the cost, but there are privacy issues in paranoid countries like America. <A> One possible solution to your problem could be to have the original MCU firmware generate a random UUID at first startup, and write this to EEPROM. <S> This UUID would then be used as a unique serial number afterwards. <S> This approach fails if firmware upgrades clear EEPROM, and also if the user/adversary can clear the EEPROM. <S> However all DRM schemes can be defeated and this approach would at least stop casual/accidental firmware piracy. <S> There are multiple ways to generate random numbers on MCUs. <S> If you think this solution has promise, try finding a source of noise, such as uncorellated timer sources or temperature sensors.
Microchip has their own system of adding unique serial numbers to mcu's.
Will checking the backup voltage on an RTC drain it's backup battery? I'm working on an ATMega project that will be keeping time and I'm trying to make it so you have an option of either software time (millis() based), DS1307, or DS3231 (ChronoDot) RTCs. At the most basic, what I would like to do is have headers for a ChronoDot available to solder in and then somehow in software detect if the ChronoDot is attached and switch to using that. It would typically be easy enough to check that either the DS1307 or DS3231 is present as they use the same I2C register, but after that initial check they do deviate from one another a little and the latter has more features. So I still want to determine which is connected. In general, I plan on having a place directly on board to solder in the DS1307 as the default option and the DS3231 support would be with a complete ChronoDot only via dual 4 pin headers. The ChronoDot would essentially fit over the place where the DS1307 would normally go (it would not be populated in this case). The main reason I'm focusing on the ChronoDot specifically is that it's popular, easy to acquire and doesn't require SMD soldering for the end user (this if for a kit). So, here's what I'm thinking... The both the DS1307 and DS3231 have a Vbat line on the chip, but it's not really needed for anything. However, the ChronoDot has an actual VBat pin on the breakout board. I could maybe hookup only Vbat from the ChronoDot header and not the DS1307 and connect it to a digital input pin on my ATMega. But have that input pin pulled down to ground by a resistor (not really sure what value... maybe 4.7k?). If my EE theory is correct I can then read that pin and if I get a low, there's no chronodot but if I get a high, there is. Something like this: simulate this circuit – Schematic created using CircuitLab My main question here is if doing this will just end up draining the backup battery on the RTC? Normally there would be no current drawn from the backup battery while main, 5V, power is supplied but would hooking this up to a digital input make it draw power from the battery all the time? Or, is there a mode I would need to put the pin into after reading from it in order to "disconnect" it, so to speak? I know I could change it to output, but I believe that if it's set as output and low I would basically be grounding the battery. Anyways, my EE courses were a long time ago. Any help on the theory here would be appreciated. <Q> You will certainly drain the battery through the resistor. <S> The amount of current you will draw will be governed by Ohm's law: <S> I = <S> V / R. Lets say your battery voltage is 3V (i.e. the usual chronodot Vbat). <S> With a 4.7 kOhm resistor you will draw 3/4700 = 638 microamps continuously. <S> If you make that a 1 MOhm resistor, you will instead draw 3/1000000 = 3 microamps. <S> And If you make that a 10 MOhm resistor, you will instead draw 3 / 1e7 = 300 nanoamps. <S> The bigger the value resistor your choose, the less current you will draw continuously, but the longer it will take for your digital pin to transition (think R*C time constant governed by resistance and the capacitance of the pins and traces). <S> So long as you wait long enough (or check back periodically) after startup, you should be OK with a 10 MOhm resistor. <S> Theoretically, you could pick up more noise with a larger value as well (as it starts to look more and more like an open circuit), but I think you'll be fine. <S> I might even consider going up to 100 MOhm. <S> A typical CR1632 has 130 milliamp-hours (mAh) of energy stored in it, and maybe 80% of that is useful life, so lets just call it 100 mAh for ease of calculation. <S> A coarse estimate of your battery life is then milliamp-hours / milliamps draw. <S> With your 4.7 kOhm resistor <S> that's 100 / <S> .638 = 156 hours = 6.5 days With a 1 MOhm resistor that's <S> 100 / 0.003 = 33333 hours = <S> 3.8 years <S> With a 10 MOhm resistor that's 100 / <S> 0.0003 = 333333 hours = <S> 38 years <S> These are upper bound numbers that assume the rest of your system draws no power. <S> They represent the lifetime of your system when it is off and the battery is simply drained through the resistance. <S> There are also lots of second order effects that are not taken into account (voltage decay, internal battery leakage chemistry, etc). <S> The resistor is unlikely to be your biggest problem depending on the lifetime you are hoping to achieve. <A> The solution then, is to only have the measuring circuit draw current during briefly at infrequent intervals, when you are actually taking a measurement. <S> For a digital test, this could be as easy as using an internal, software configurable pulldown, and only configuring it as a pulldown for a brief period of time surrounding the test. <S> However, you will need to look into possible complications of having voltage on the pin when the MCU doing the measurement is not powered/in sleep mode. <S> An analog measurement would get trickier, but similar ideas could be applied. <S> For example, you could connect the lower resistor of a (high impedance relative to the I/Os) voltage divider to an output pin, and only drive it low for a time surrounding the measurement. <S> Or you might even be able to build an RC circuit with a small low-leakage capacitor and a single I/ <S> O pin which you could drive low as an output, then configure as an analog input and measure the voltage after some period of time. <S> If the device's digital threshold voltage is consistent (watch out for temperature!) <S> you can even do make an analog measurement with a digital input this way, by measuring the time it takes for the capacitor to charge to the threshold voltage. <A> The DS3231 has internal temperature that you can read. <S> You could issue a command over I2C to read the temperature, <S> if you got a response you have the DS3231, if not you have the DS1307.
Pretty much any of these measuring schemes involving resistors, if left permanently connected, will cause unacceptable current draw and life reduction of the small lithium battery that powers these devices.
Emitter Resistance in BJT Amplifier What is the importance of resistance at emitter and collector of BJT amplifier? What will be effect on output if they are removed? <Q> This is the basic circuit you seem to be asking about. <S> It's known as a common-emitter amplifier with emitter degeneration: <S> The two resistors have totally different functions. <S> R C is totally fundamental to the operation of a common-emitter amplifier. <S> It determines the voltage gain of the amplifier. <S> If you removed it, you simply wouldn't have a working circuit, because there'd be no path for current to flow through the collector of the BJT. <S> If you removed it and replaced it with a short circuit, the BJT would still produce current gain, but the output voltage would always be exactly equal to the V+ voltage, and the circuit just wouldn't be very useful. <S> Note: In some cases, R C is not present, but the load is connected from the collector to the positive supply, so that the load itself fills the role of R C . <S> R E , on the other hand, is a little more complicated. <S> This resistor is why we call the circuit "emitter degenerate". <S> Having R E means that an increase in collector current tends to reduce V be , which reduces the portion of the input voltage that contributes to gain. <S> This is a form of negative feedback. <S> The main benefits of this is that it increases the range of input bias where the circuit operates linearly, makes the circuit gain more stable if the BJT properties vary, and it increases the input resistance of the circuit. <S> If you removed R E and replaced it with a wire you'd just have a standard common-emitter amplifier. <A> The emitter resistor serves many functions. <S> Together with the biasing point used with the base, it sets the quiescent current for the amplifier. <S> (In this sense, think of the BJT operating as an emitter follower.) <S> The quiescent current will be \$I_q\approx \cfrac{V_b-V_{be}}{R_e}\$ (when \$I_q\cdot R_E\ge 200\:\textrm{mV}\$.) <S> Together with the collector resistor, it makes the estimated signal gain expected at the collector more predictable and reduces dependence of the specific \$\beta\$ of the transistor. <S> The signal gain will be \$\approx -\cfrac{R_c}{R_e}\$ (\$180^{\circ}\$ out of phase with the input signal at the base.) <S> Reduces temperature dependence of the signal gain. <S> The thermal voltage divided by the emitter current (sometimes called "little re" or \$r_e\$) represents an equivalent resistance that is added in series with the emitter resistance to compute signal gain. <S> When \$R_e\gg r_e\$, changes in ambient or operating temperature have far less impact on the signal gain. <S> It similarly makes the quiescent current very much more predictable because it reduces the dependence upon \$r_e\$. <S> It increases input impedance two ways: (1) by raising the emitter voltage, the base voltage can be placed more to the center between the power rails, allowing the Thevenin equivalent of the biasing base pair of resistors to be higher; and, (2) reduces the impact of the reflected impedance seen at the base, since its effective impedance contribution is \$\beta\cdot R_e\$ and the larger <S> that \$R_e\$ is, the less it impacts the biasing pair's Thevenin loading. <S> It also allows the emitter to provide a low-impedance output signal at a gain of about +0.99 (in phase with the input at the base.) <S> In fact, it serves so many different purposes that most practical amplifiers will find ways to separate some of the functions so that they can be independently set. <S> For example, using an AC gain-setting leg in the emitter allows separating out the DC setpoint for the emitter voltage from the amplifier's signal gain. <S> And bootstrapping, by using the low-impedance emitter output (in phase) to stiffen <S> the base is also commonly seen. <A> the resistance in collector will determine the value of your V(CE) which is important for you to determine your quiescent point for your transistor depending on what is your purpose on your transistor. <S> The resistance in emitter is for stability, because BJTs are highly sensitive in temperature and it will affect your current gain. <S> But you can still remove the that resistance in your emitter. <S> Removing the resistor in your collector may cause damage to your transistor due to very high current.
Having a resistance in emitter will make your circuit more stable than no resistor at emitter.
What does this circuit do? Op-amp with transistors in feedback I'm an electrical engineering student and I find this circuit in a guitar amplifier schematic, and basically, I'm just wondering what it does, and how one would go about working out what it does. Like what approach do you take when you're confronted with this kind of problem. P.S. The voltage source supplies for the op-amp are actually 16V, not 15V. <Q> Clearly, the transistors are intended to modify how the feedback network passes current, so the question is to figure out how they do that. <S> The basic feedback is provided by the string of resistors in the middle, which pass current according to the voltage difference divided by the total resistance. <S> As long as the voltage across either of the 22K resistors is less than about 0.6V, neither transistor will turn on, and you have a basic inverting amplifier with a gain of about -10. <S> However, if the output voltage exceeds about +14V (note that the "–" input of the opamp is held at "virtual ground"), the lower transistor will start to turn on. <S> This will pass extra current through the feedback network, reducing the gain of the amplifier overall. <S> In terms of the application, this provides a "soft clipping" or "limiting" function. <S> The other transistor conducts when the output tries to exceed -14V, making the operation symmetrical. <S> Note that the diodes are required in order to prevent current from flowing in the "wrong" direction through the 22K resistor and the B-C junction of the corresponding transistor. <A> Clipping distortion. <S> The amount of current going through R4 is always Vin/R4 (as the inverting input is virtual ground), and no current enters the terminals of the op amp. <S> Without the transistors and diodes, all the current from R4 would then go through the three resistors in the middle feedback path. <S> The transistor/diode paths just steal current from this path. <S> In a first approximation, this would be a clip in both directions at the absolute value of Vout greater than the transistors' Vce plus a diode drop. <S> The reality would be a softer clip as the transistors reach saturation. <A> The circuit will limit the output amplitude from the op-amp to about 20V peak to peak I reckon. <S> It could be a bit higher as one of the previous commentors has suggested. <S> I don't see that it's main purpose <S> is to provide a distortion feature, rather than protect any circuit that connects to its output.
In opamp feedback circuits, it's all about the current flowing in the feedback network, which must balance the current flowing from the input.
How to switch light on by standing on a mat I'm working on a project for school. And I have this dance matt. As long as you stand on that matt the light should go on and stay on until you step off the matt again. But I have no idea how to make this. My teacher says I have to buy a lamp with a remote control and take that apart. But what should I get out of it to make sure it will do what I want? <Q> You have a few options for this, either a step switch or touch sensitive switch only if the mat can conduct. <S> Here is normal step switch which is pretty rugged, inexpensive and can hold up to students bouncing back and forth on the mat. <S> The only issue is that it stays on per step and has to be stepped on again to toggle it off . <S> You will most likely have to do what the previous poster mentioned and swap the internal switch out for a compression <S> based switch shouldn't be too hard, but at least you'll have the housing and wiring already manufactured if you buy this. <A> There was an excellent article on hackaday where someone had built their own Dance Dance Revolution pad. <S> You might want to take a look at their construction technique and apply it to your design. <S> If I were to do it myself, I would use two metal plates separated by compression springs placed in metal posts that are slightly smaller than the spring's uncompressed size. <S> This gives you a switch that is very solid and which will practically last forever. <S> Since the actual switch itself is under no stress (the metal plates and the springs take all the compressive force) <S> it should be reliable and allow you to use any microswitch, reed switch or whatever you want. <S> If you don't want to use a computer (which is good, there's no need for a computer of any kind for this) <S> you can use the switch contact to fire a triac or drive a relay which actually connects the lamp to power. <A> There are lots of ways to do this, you just need to find the answer that suits you. <S> For me, I would use my PC (and ebay), at least at first. <S> I would look at the connector on your dance mat and look at how I would connect it into my PC, for example if its an old playstation one, you can get a playstation to USB convertor that makes it appear as a gamepad to the PC. <S> For controlling lights, I would use a cheap DMX interface (for which programming libraries are available) and connect it a LED disco light, its gives you loads of flexibility and won't scare the teacher by working directly with mains! <S> This way you can concentrate on your functionality at first and have the choice of many different programming environments. <S> (and most of them free) <S> And the last advantage is, whats bought on ebay maybe sold on ebay so after the project is over you maybe able to get some money back by selling the bits again!
You can then take apart a USB keyboard or joystick or anything that already talks to the computer and wire your mat switch "in parallel" with the usb device's button that you want the mat to use.
Connecting push button to a controller pin This problem is decades old but I do not see a direct answer to it on this site. I want the following: This circuit just allows to check the state of the button from inside the micro-controller. Nothing fancy. My questions: Is there anything better than this simple design? Is the value of 100 kilo ohms resistor adequate for our days CMOS devices, like dsPIC30FXXXX and not a high power application? <Q> First, a lot of microcontrollers and digital signal controllers will have internal pull up resistors. <S> Here's an example, an Atmel ATMega164. <S> There will typically be a register that allows the internal pull ups to be turned on and off. <S> Using internal pull ups for hardware debounce would not be a good idea, since it's not possible to predict their exact value. <S> Whether the 100\$k\Omega\$ value is adequate depends. <S> For things that are going to switch more rapidly, such as rotary encoders, the process I would go through is <S> Find maximum sink current in data sheet <S> Calculate <S> a pull up value using Ohm's Law Choose a standard sized resistor a few sizes bigger, depending on the speed actually needed Test and see if the resistor size chosen gives the required rise and fall times Adjust accordingly <S> So if the maximum sink current per GPIO pin were 10 mA and operating at 5V: \$R=\dfrac{V}{I}=\dfrac{5V}{10mA}=500\Omega\$. Keeping this R value small as possible will allow for the sharpest edges and highest switching frequencies. <A> You can get simplier than that. <S> 100k is adequate, but internal pullups could to be a bit lower in some MCUs, for example in AVR atmega8 <S> it's 30-80kOhm for reset pull-up and 20-50kOhm for all the other I/O pins. <A> Is there anything better than this simple design? <S> Better can't be answered without specific criteria to measure against, which you haven't provided. <S> In most cases, the topology you show is fine. <S> Two variations might be "better" depending on the situation: Many microcontrollers have internal pullups on some of their pins. <S> These are meant for exactly this kind of situation. <S> The resistor is then internal to the micro <S> and you set a bit someplace to enable it. <S> The only external part required is the just the pushbutton itself. <S> Another useful variant to keep in mind is for low power designs where the button might be a switch that can be closed for long periods of time. <S> In that case you want to minimize the long term average current thru the pullup resistor. <S> You make it as big as possible, but there are limits to that and drawbacks for making it too big. <S> Instead, you switch the pullup on for just a few µs at a time to take a button reading. <S> If you check the button every 1 ms and the pullup is on for 10 µs, then the average pullup current is reduced by 100x. <S> With a external resistor you use another pin to drive the top side of the pullup. <S> With a internal pullup, you enable/disable it in firmware as needed. <S> Is the value of 100 kilo ohms resistor adequate for our days CMOS devices, like dsPIC30FXXXX and not a high power application? <S> I have already answered this at length here . <A> Better than that simple design? <S> Yes. <S> Throw a cap on it <S> and you have a simple hardware debounced switch. <S> The Capacitor would be a common 0.1uf ceramic cap. <S> The Resistor would be a 10k. <S> This site has the full details on why. <S> In short, a debounce circuit prevents the microcontroller from false registering multiple presses when you press the button. <S> The Resistor/Capacitor setup smooths the button's mechanical bouncing so that it's a steady transition. <A> EDIT - the comment i made below was meant to follow-up what Olin had said later about the circuit with a capacitor to supposedly add debounce. <S> I'm sorry it seems to appear in the wrong place <S> - maybe someone can fix this because I'm obviously too blind or stupid to see how i should have done it!! <S> I agree with Olin - it does not provide good debounce. <S> I would also add that shorting the capacitor out can cause a big surge of current that can reset the microprocessor if PCB layout is not really good. <S> Some switches need a wetting current to operate correctly and reliably and 100k may be too high for some switches (especially membrane switches).
Just use an internal pull-up/pull-down resistor in your microcontroller. Due to variations in the fabrication process, these internal pullups come in a very wide range, and are not a good choice if you need very close control over current draw in ultra low power applications. If it's just a switch that will be periodically flipped by a user, then 100\$k\Omega\$ would be a good choice for minimizing power consumption. If keeping component count low is important, this is an easy way to do it.
Connecting a simple device with my secured home wifi I am planning on building a simple device, which retrieves information over wifi. The device shall be as cheap and simple as possible, so it won't have a keyboard or a display. My question is: What possibilities are there to connect said device with my secured home network without having the keyboard/display to chose a the right network or to type in the security credentials? <Q> If the device is sophisticated enough to connect to <S> Wi-Fi, it probably has some fairly powerful microprocessor to implement enough of the stack to be able to do this. <S> If that is the case, maybe you can support an AP mode in the device (it acts as an access point). <S> In this mode, it exposes some trivial listener on 192.168.0.1:80 which serves up and processes an HTML form. <S> Voila, you now have a keyboard and screen with which you can configure client credentials. <S> A sliding switch on the device can toggle it beween AP and wireless client mode. <A> There are a number of choices. <S> You'll have to evaluate them with regard to your actual use cases and security requirements. <S> Build the credentials into the source code. <S> Put the credentials into some sort of nonvolatile memory, perhaps using the in-circuit programmer/debugger. <S> in order to enter the credentials. <S> Use removable nonvolatile storage (USB stick, SD card, 1-wire device, etc.) <S> to transfer the credentials to the device. <A> You can use a WPS authentication if you have a router that supports it. <S> When you want to connect the device to the network all you need to do is to press a button both on your router and on the device you want to connect.
Temporarily connect to the device using a serial interface (UART, IrDA, SPI, I2C, etc.)
Why pic18fxxx microcontrollers is better for C language Pic18fxxx family has a lot advantages and improvements from the pic16fxxx family of microcontrollers. What is the particular feature that make them better for C programming than the pic16fxxx devices? <Q> I don't know about "ideal for". <S> That's a marketing term that has no place in a learned discussion. <S> However, one big advantage of the PIC 18 architecture versus the original PIC 16 architecture, especially related to compilers, is that it is possible to implement a software data stack on a PIC 18 with single instructions for PUSH and POP. <S> The PIC 18 also has a deeper call stack, 32 versus 8, which can help when a compiler implicitly calls subroutines. <S> The PLUSW indirect addressing mode is probably something a compiler would make more frequent use of than a human programmer. <A> Some C compilers store local variables on a hardware or software stack. <S> When code enters a subroutine, the size of its local variables is added to or subtracted from a register which is used as a stack/frame pointer. <S> When the "enhanced instruction set" is enabled, PIC18Fxx instructions can access the first ~96 bytes following the frame-pointer address directly. <S> This is ALMOST <S> a really good feature. <S> It would have been a really good feature if e.g. the processor had made 15 bytes of the unbanked address space map to addresses 1-15 bytes above FSR2, and 7 bytes map to addresses 1-7 bytes above the each of the other FSR registers, while leaving most of the unbanked space as unbanked RAM. <S> Unfortunately, notwithstanding the fact that most functions won't even have eight bytes of local storage (much less 16), giving up 96 addresses to handle offsets 0-95 above FSR2 is absurdly wasteful. <S> Note that some other C compiler systems assign fixed addresses for local variables; such systems determine at link time which functions cannot be "live" simultaneously, and can allocate the variables for such functions at the same addresses. <S> Provided code does is not called in re-entrant fashion, this approach can be just as efficient (sometimes more so) than using a stack; it does, however, not work with re-entrant routines. <A> You can ask google well about the lot of comparison between PIC16F vs PIC18F. <S> Coming to you <S> question <S> Why pic18fxxx microcontrollers are better for C language? <S> PIC18F or any other micro-controller that can be assumed better for C language are those micro controllers that supports such assembly instructions by default that can help C compilers to make efficient and optimized hex files. <S> One major example of these kind of instructions can be MATH related instructions <S> XC8 compiler supports extended instruction set which is specially helps C compilers to generate we optimized binary file.
The PIC 18 also has other advantages that are useful both for compilers and human programmers, like 3 hardware pointers instead of one, auto inc/dec indirect addressing modes, a 8x8 into 16 hardware multiplier, add with carry, and subtract with borrow, and a few other niceties.
How to recognize the type of analog filter given its topology? Having trouble to tell what kind of filter (Low-Pass, High-Pass, Band-Pass, Band-Reject(Notch) are present given a topology in cascade. In the following picture I see 3 stages, is this ok? (2 active stages, 1 passive stage) but cannot tell if LP, HP, BP, or Notch filter is which one and why. /!\Note: the values of resistors and capacitors showed are of no importance right now and are the values by default in circuit lab. <Q> In a purely academic sense, a bandpass or notch filter by itself must have an even number of stages so the roll off rate is the same on each side of the filter. <S> This isn't always the case in the real world, but that is beyond the scope of this question. <S> A low or high pass filter can have an odd or even number of stages. <S> The easiest way to determine filter type is by looking at the reactive components. <S> Typically, in active filters capacitors are used exclusively. <S> They are easier and cheaper to manufacture, and with tighter tolerances than inductors. <S> Since the impedance of a capacitor goes to zero as frequency goes to infinity, a capacitor to ground is a low pass filter. <S> In the case of the Sallen-Key topology, a capacitor to ground and in the feedback loop will form a low pass filter. <S> As the others have mentioned, your circuit is a 5th order low pass. <S> A high pass filter is formed by switching the Rs and Cs. <S> There is also a Sallen-Key bandpass filter, but it's only first order roll off on each side. <S> Another common topology that is pretty handy to know about is the state variable . <S> It isn't as dense as the Sallen-Key, but one circuit contains a high pass, low pass, and bandpass with the same critical frequency. <A> It looks to me like a 5th order low pass filter made from two sallen-key 2nd order filters with a simple RC low pass in between them. <S> It's low pass because of the configuration of the R's and C's. <S> The key thing to look for is the RC directly before the non-inverting input of each op-amp - if there's a C to ground then it's low pass. <S> Ditto the RC between the two 2nd order op-amp stages. <S> The easiest way to think of it is that C's will conduct more as the frequency rises therefore a series R and C to ground will pass DC and low frequencies but at some frequency point in the spectrum the C will start to dominate. <S> This is determined by the frequency of 1/(2*PI*R*C) and for the circuit above it is approx 1.5kHz. <S> I haven't got my calculator with me so maybe someone else will correct my brain math. <A> It is low pass, because it has a DC path (low frequency) from input to both non-inverting amplifiers and an AC path to ground (high frequency). <S> So DC is propagated to the output and AC is filtered to ground (or through the low output impedance of the amplifier). <S> This is a extremely simplified analysis of things. <S> It doesn't account for order, nor for the cut off frequency. <S> If you want to know for sure, you can always simulate the circuit in a tool like spice or CircuitLab.com <S> A high pass filter would have capacitors and resistors swapped, and a band or notch filter would have mixed positions. <S> To differentiate between band and notch filter, you probably have to do some actual calculations on the specified parts. <A> You can recognize the category of filter from whether the capacitors shunt the signal, or pass the signal. <S> The tricky capacitors are the ones in the feedback path, but a mental shortcut to classifying them is to regard the amplifier output as a ground-like low impedance. <S> What's happening there is that those capacitors are "bootstrapped" from the amplifier output instead of going to the ground. <S> Do not mistake these capacitors as a bypass path for high frequencies around the amp. <S> Rather, it is more helpful to pretend that the output of the filter is an alternative ground. <S> As a shortcut, mentally redraw the circuit diagram such that the amplifier is removed, and the positive feedback element (resistor or capacitor) terminates to ground instead. <S> Then apply your understanding of RC networks to determine the combination of high and low pass filtering. <A> Having trouble to tell what kind of filter (Low-Pass, High-Pass, Band-Pass, Band-Reject(Notch) are present given a topology in cascade. <S> For a start, find the gain as the frequency goes to zero (open the capacitors, short the inductors) and the gain as the frequency goes to infinity (short the capacitors, open the inductors). <S> Given just the four categories of filters you've listed, you have the following possibilities: If the gain goes to zero at both extremes, you have a band-pass filter. <S> If the gain is the same at both extremes, you have a band-reject filter <S> If the gain only goes to zero at one extreme, you have either a low-pass or a high-pass filter. <S> Of course, there are other possible filters to consider such as, e.g., shelving filters and all-pass filters etc. <S> Now, looking at the circuit you've posted... <S> with the capacitors open, the gain is 1. <S> with the capacitors shorted, the gain is 0. <S> Thus, this circuit is a low-pass filter.
Both the filter stages are low-pass filters because in all the RC networks, the capacitors shunt the signal to a low impedance.
Why do AC-to-DC adapters have long cables on both ends? Why do AC adapters have long cable on both ends? I believe that almost everyone using one would want it either directly next to the gadget it is powering (even possibly joined together with it if possible) or next to the power plug (possible made into a single unit with the power plug). It is inconvenient to have it hanging in the middle of a power line. Is this simply a design flaw, or does it have particular reason? If I were to replace either the AC side or the DC side cable with a very short one, does it have any difference between the two options electronically? <Q> Usually for thermal management or mechanical compliance. <S> thermal -- placing the power supply away from the potentially hot device and away from the wall (better airflow) results in the most efficient operation. <S> mechanical -- large power supplies would block adjacent outlets if connected directly. <S> They can also be heavier than can be safely suspended (hung) from wall outlets. <S> Basically no... <S> except for the above mentioned reasons. <A> Two main reasons. <S> Ease of use, and appearances. <S> You can even buy mini extensions just so that you can plug a wall wart into a power strip without taking 4 spots. <S> On the other side, it can be extended for the same reason. <S> A power adaptor might be a pound or three, and you wouldn't want that extra weight on a laptop or monitor. <S> And then there is aesthetics and appearances. <S> The cable length allows the bulky, ugly power adaptor to be hidden. <S> Again, with like a monitor or printer or anything really, you don't want to have to put the power adaptor right next to the device, on a desk, or hanging half way off the device. <S> You get a generous length so it can go flat on the ground where it can't be seen, where it will get proper air flow as well. <A> When doing EMC testing in order to meet legislation a long cable on the AC end can reduce the conducted emissions back to the AC because of the filtering the longer cable provides. <S> This assumes the adapter is a switch-mode type. <S> The longer cable can reduce the adapters susceptibility during EMC testing too. <A> I think there is one more reason, outside of what has been mentioned already. <S> Laptop power supplies can be changed to be used in multiple countries just by replacing the cable that connects the power supply to the outlet. <S> Specifically, what I have in mind is the C13/ <S> C14 connector: (image credit: Museo8bits via wikimedia commons) <S> If there were no cable to replace, similar flexibility <S> w.r.t to outlet types would require replacing just the prongs, which could be more mechanically difficult. <S> Also given that large (computer) power supplies can use the same cable, and such power supplies require a cable (you cannot locate a desktop power supply immediately adjacent to the wall), the same cable can be used both for desktop power supplies and laptop power supplies, increasing their utility and ubiquity. <A> The AC cord has to be long enough that the user can put the box on the floor, even if the outlet is fairly high on a wall somewhere, or otherwise in some inconvenient place. <S> With cables, it's better to err on the side of too long. <S> A few inches of excess length is a minor inconvenience compared to a few inches of insufficient length.
Ease of use because sometimes the power supplies are too bulky or heavy to plug right onto a outlet or power strip.
How to encode a large number of digital input signals into a signal result I would like to know how I can detect simultaneous pulses on several wires. Essentially I will have several wires that will serve as connection points when pressed upon. A simple visualtization of this is if you were to view several wires draped over (but not touching) a metal plate. The plate would be connected to the negative end of the battery & the wires would be connected to the positive end of the batter. When touched, the wire will hit the plate & pulse. Initially I was thinking something like a 64-6 encoder, but I now I feel that there are much better solutions. So, in short, what is the best way 'hardware' to encode 2^n into n data lines. Any help is appreciated! <Q> You can easily encode 6 digital lines into one analogue line. <S> Each button connects a different value resistor to the sensing line. <S> The resistor values are chosen such that every combination of buttons creates a unique parallel resistance. <S> This resistance is measured, and the combination of buttons can be worked out by the microcontroller. <S> Here I have drawn the metal plate, and six wires hovering over it. <S> What you are creating here is basically a manual Digital To Analogue Converter . <S> Some examples: <S> No wires touching -> <S> Output Voltage = <S> Vcc <S> First wire touches - <S> > <S> Output Voltage = <S> Vcc x 1/2 <S> Second wire touches - <S> > <S> Output Voltage = <S> Vcc <S> x 2/3 <S> First and last wires <S> touch -> <S> Output Voltage = <S> Vcc <S> x 0.667/1.667 <A> If I understand you right you are looking for something like a wired OR <S> setup: <S> In the above diagram A and B are isolated from each other (i.e. if B goes high, <S> A doesn't), but if either goes high, C goes high. <S> The number of diodes/connections above can be increased as much as you wish. <S> Or if you need things to be slightly more complex, then you could use a bunch of logic gates or even a CPLD. <A> If you wish to "detect simultaneous pulses on several wires" and you are not interested how many or which are contributing, then connect each wire through a 10k resistor to a common point and tie that common point to ground via 1k. <S> when 1 wire touches the metal plate (connected to +5V) you will see 0.455 volts across the common 1k; when multiple wires touch the metal plate you'll see 0.833V (2 wires shorted) and this rises as more wires are shorted. <S> Use a simple comparator circuit to detect voltages greater than about 0.6V and this should work.
I remember my old Sony MD walkman used to do something like this to encode all of its buttons into a single line. Each wire is connected to a different value of resistor.
Arduino Time.h - Resets on Serial Connection for Sync I realize and understand the problem with arduino boards resetting whenever you open a serial connection as stated and answered here . However, because of that I'm trying to figure out how various arduino-based clocks can actually handle a time sync over serial without just resetting every time. For example, the BulbDial clock checks for a sync every time the loop comes around. But trying to sync via the processing sketch would just reset the controller and it would miss the sync. Granted, I do not have one of these clocks, but I based by design for the sync off of it and every time I open the serial connection to send the sync, the board just resets. Is there something that I am missing? Now, I have gotten it to work by placing a 10 uF cap between RESET and GND. But since others are able to do this without that cap I'd love to be able to do it without as well. I've also written a python script that will set the time and I've tried all sorts of DTR, RTS configurations to try to force those lines to stay high and not reset the board during connection but I've had no luck. Code below: com = serial.Serial() com.baudrate = baud com.port = port com.timeout = 1 com.rtscts=True com.dsrdtr=True print com com.open() Any thoughts on how this is supposed to be done? <Q> Searching for ' arduino disable auto-reset ' for how to do this to various arduino boards. <S> It will be board specific but most involve adding a bleed resistor across the reset capacitor, removing a capacitor, or cutting a trace on the board. <A> There technically is no need to modify the board. <S> The answers to the linked question are not quite correct in their assumption - in actuality this occurs due to software behavior (of the connected PC) rather than something forced by the hardware. <S> It is possible to configure the host operating system serial API to not automatically command set/clear of the DTR signal upon connection/release, and thus avoid the resetting entirely in software. <S> For example on linux/unix, you want to disable the HUPCL setting in termios; <S> not exactly sure how you do that in python, though running something else (such as the stty tool) might be an option. <S> However it remains susceptible to being reset by software which does not take care to avoid this, and perhaps by the first usage of the port after boot <S> (unless the change of configuration is made more permanent). <S> For those reasons, a special purpose design would likely not have the hardware to support auto-reset, or have a jumper to enable/disable it. <A> There seem to be 4 ways to set up an Arduino-based clock: <S> Once all the firmware is loaded, disconnect the clock from the PC and never connect it again. <S> Use buttons on the clock to set the correct time (and to re-correct the time if it ever drifts). <S> Have a program running on the host PC that opens a connection to the clock and leaves the connection open. <S> Occasionally (perhaps once a day?) <S> that program sends time updates (perhaps derived from NTP ). <S> The Arduino gets reset once when that program first opens the connection, but then it should continue running indefinitely (weeks, months, years) as long as the connection remains open. <S> There's no need to close and re-open the connection, which resets the Arduino -- just leave the connection open.(When the host PC shuts down, the Arduino will keep running as long as it has power. <S> When the host PC powers back up and that program opens the port again,it will reset the Arduino, but then immediately update the time again, so perhaps no one will be looking at it and no one will notice the temporary glitch). <S> As JRobert mentioned, disable the hardware that does the auto-reset, so the Arduino never gets automatically reset no matter what happens on the serial lines. <S> This means you have to remember to manually hit the reset button whenever you want to upload new firmware. <S> Searching for 'arduino disable auto-reset' , <S> Arduino resetting while reconnecting the serial terminal , etc. <S> Use some other serial port on the Arduino (one of the other hardware UARTs on the Arduino Mega, or use the "Software Serial" library on pretty much any other Arduino) to send time updates to the Arduino or receive data back from the Arduino or both. <S> Only use the "programming port" for actual programming of firmware updates.
In this case, I think you have to disable the reset-on-serial-connect function by modifying the board.
Differential or Single-Ended ADC? I'm getting to know the Freescale Kinetis L microcontroller. It's ADC has a lot of options, but long story short, it seems like I should be able to get 16-bit resolution in either single ended or differential mode. The sensors I want to read vary their resistance, so I was going to just hook them up in a voltage divider to determine the resistance: simulate this circuit – Schematic created using CircuitLab Is there any benefit to using the differential inputs in this scenario? I was thinking maybe it would have better common mode noise rejection in this mode. Am I over-thinking it? The sub-family datasheet certainly makes me think I get better resolution (effective number of bits) in Figure 7 and Figure 8... So when is it appropriate to use the Differential Inputs? <Q> There is virtual zero benefit in using differential inputs for your application. <S> Assuming the sensor is close to the uC, you'll be able to get almost identical results from either single ended or differential, +/- <S> a couple LSB. <S> The real benefit of differential signals is in long cable runs and noisy environments, for increased common mode rejection. <S> They're also very useful in instrumentation, when dealing with very small signals. <S> A common way to deal with sensors that vary their resistance in small amounts, such as strain gauges and pressure cells, is to use a Wheatstone Bridge. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> This configuration by itself centers the measurement in the ADC span. <S> \$V_+-V_-=V_{differential}\$ <S> It's important to match the default resistance as close as possible. <S> Any deviation from the default resistance will show up as offset in the measurement. <S> Again, this is done <S> because: the changes in resistance are very small more often than not, the sensors are far away from the data acquisition and processing equipment <A> To REALLY answer the question, we'd need to know what sort of resistance changes you expect to see. <S> If they're small -- a few percent of baseline, the correct answer is the Wheatstone bridge configuration and the differential input seen above. <S> We'd also need to know what sort of noise you can tolerate. <S> If The signal is big and you don't care about noise, it makes no difference what you do. <S> In the medium situations, things get a bit grayer. <S> If the signal is going through a long cable in an electrically noisy environment, using twisted pair cable and differential configuration will get you a cleaner signal. <S> Lastly, if your tolerance for noise is low, whether you use differential or single sided configuration may not be as important as preamplifying your signal so as to cover nearly the full range of the ADC. <S> The best approach is to figure out how many bits of effective resolution you need, and then calculate how much resolution you're going to lose to noise (might need to measure to see this), and then plan what you need to do to get those numbers to match. <A> I just had a quick look at the data sheet and didn't find too much info on how to connect the inputs differentially <S> and I have a concern that the way you are anticipating connecting them may be incorrect and/or non-beneficial. <S> Most (maybe all of them?) <S> differential A2Ds require a true differential input to achieve the best performance. <S> I would have thought you need to input diff signals that are anti-phase and centred around half Vref. <S> On another point, the input resistance of the analogue inputs is quite small and you would get possible errors directly connecting your sensor. <S> I'd urge you to get more information on the ADC before committing to a design that you may be disappointed with.
Generally, if an ADC provides a differential input it does so to maximize its performance.
How to wind a toroid for 170 uH Inductor I am planning on buying a toroid core from Digi-Key . I want to be sure that this is the right type and that I can achieve 170 uh inductance with 22-18 AWG wire. How can I wind this and what is the formula so I can calculate this myself in the future. If this doesn't work which one can I buy from Digi-Key to get the right inductance. (my budget is 4 dollars or under for the toroid core) Last, I want this to handle up to 10 amps of current so tell me if I can't use 18 AWG wire. edit-fixed broken link, i guess it was just because it was linked directly to my shopping cart From a comment It said to buy my own I can't find any already pre-wound 10 amp 170 uH toroid and the only thing close was like 10 dollars so I would like to wind it myself!!! <Q> Magnetics design is hard. <S> Bear with me as I walk through some of the considerations. <S> On the surface, it's actually fairly easy to figure out how many turns you need to get a given inductance on a given toroid. <S> First, check the datasheet for the core and see what the \$A_L\$ (inductance factor) is: <S> Your core's inductance factor is 1760nH +/- <S> 25%. <S> The actual ratio that inductance factor stands for is: \$ A_L = \dfrac{nH}{(turns)^2} \$ <S> So, to get the number of turns you need, it's simple algebraic manipulation: <S> \$ turns = \sqrt{\dfrac{nH}{A_L}} = \sqrt{\dfrac{170000}{1760}} = 10\$ <S> Now the hard part. <S> To figure out whether or not the inductor is suitable for the application (i.e. will it saturate out) you need to know some things so you can calculate <S> \$B_{max}\$: The operating frequency The expected peak-to-peak AC current <S> Is there a DC component to the current The material characteristics <S> Number 4 is a biggie here. <S> Why? <S> The material for your choice of toroid is N30 , which is suitable for frequencies from 10 to 400kHz according to the datasheet. <S> Is this important? <S> That's the thing with inductors. <S> The core material has a huge impact on what you can do with the part - it's not just the inductance. <S> The core material dictates how much loss will be generated, at what flux density the core will saturate ... essentially everything. <S> You're not in a position to figure out the best number 4 unless you know number 1, 2 and 3. <S> That means lots of calculations / predictions / simulations, and potentially lots of trial and error, before the magnetics are done 'right'. <S> So, will your 18AWG wire be OK for 10A? <S> Most likely. <S> The core? <S> It depends on many things which you haven't specified in your question (like operating frequency, peak-to-peak ripple, etc.) <S> so I cannot say for certain. <A> I believe 18 awg is ok up to 16 amps. <S> Toroidal inductor calculator here -> <S> http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/indtor.html <S> You will have to find the permeability of the core material (ferrite? <S> iron?) <S> to enter into the calculator. <S> Cheers. <A> The next step after MMGM's excellent answer is to put a few numbers from his datasheet into the calculator from Mark B's answer at <S> Averaging the inside and outside diameter (6mm and 10mm) <S> we get radius 0.4cm and MMGM's 10 turns. <S> Datasheet has "Ae=7.83mm^2 <S> " so enter 0.0783 (cm^2) in the "Area" box and it will calculate a coil radius. <S> Enter 4300 for relative permeability (datasheet calls it ui, calc calls it k, these things happen!) <S> and the calculator confirms inductance 0.168mh, pretty close... <S> So far so good. <S> Now the crucial question : will the coil take 10 amps? <S> There is another calculator to answer that on the same site... <S> Enter the radius (0.004m this time!) <S> 10 turns, k=4300 again. <S> And new, the "Flux density near saturation" from the N30 data sheet - B = <S> 380mT = <S> 0.38T, and click the link to "current" above. <S> For this core size and material, with these turns, and this saturation flux density, the calculator says "0.177 amps". <S> So, no... <S> As an experiment, try a 4cm radius, 1cm^2 area, 9 turns, same material. <S> The first calculator says 0.174mh, again pretty close. <S> The second now says 1.96 amperes which is heading in the right direction, but a MUCH bigger coil... <S> So, as MMGM says, magnetics design is hard. <S> But that was a first step. <S> Now try some different core materials (lower ui=k, larger cores, lower inductances, and see where you get. <S> (Also bear in mind that 10A DC may translate to 20A or more at AC. <S> Try designing for 1A,5V until you have something working)
To figure out if your wire is going to fit, you need to consider the inside dimension of the toroid and figure out how many diameters of your wire can fit inside it.
How to divide 50MHz down to 2Hz in VHDL on Xilinx FPGA I have a Xilinx FPGA board, with a 50MHz crystal. I need to divide that down to 2Hz in VHDL. How do I do this? <Q> Basically, there are two ways of doing this. <S> The first is to use the Xilinx native clock synthesizer core. <S> One of the advantages of this is that the Xlinx tools will recognise the clock as such and route it through the required pathways. <S> The tools will also handle any timing constraints (not really applicable in this case, since it's a 2Hz clock) <S> For example, for your case, the number of fast clock pulses that make up one clock period of a slow clock cycle is 50000000/2 = 25000000. <S> Since we want half a clock period, that's 25000000/2 = 12500000 for each half-cycle. <S> (the duration of each high or low). <S> Here's what it looks like in VHDL: library <S> IEEE;use IEEE.STD_LOGIC_1164.all;-- <S> Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned valuesuse IEEE.NUMERIC_STD.all;entity scale_clock <S> is port ( clk_50Mhz : in std_logic; <S> rst : in std_logic; clk_2Hz : out std_logic);end scale_clock;architecture Behavioral of scale_clock is signal prescaler : <S> unsigned(23 downto 0); signal <S> clk_2Hz_i : <S> std_logic;begin gen_clk : process (clk_50Mhz, rst) <S> begin -- process gen_clk if rst = '1' <S> then clk_2Hz_i <S> <= '0'; prescaler <= <S> (others => '0'); elsif rising_edge(clk_50Mhz) then -- rising clock edge <S> if prescaler = X"BEBC20" then -- 12 500 000 in hex prescaler <= <S> (others => '0'); clk_2Hz_i <S> <= not clk_2Hz_i; else prescaler <= prescaler + "1"; <S> end if; <S> end if; <S> end process gen_clk;clk_2Hz <= <S> clk_2Hz_i;end <S> Behavioral; Things to note: <S> The generated clock is zero during reset. <S> This is ok for some applications, and not for others, it just depends what you need the clock for. <S> The generated clock is going to be routed as a normal signal by the Xilinx synthesis tools. <S> 2Hz is very slow. <S> Simulating for a second is going to take a while. <S> It's a small amount of code, so it should be relatively quick to simulate even for 1 second, but if you start adding code, the time taken to simulate a clock cycle of 2 Hz could be significantly long. <S> EDIT: <S> clk_2Hz_i is used to buffer the output signal. <S> VHDL doesn't like to use a signal on the right of an assignment when it is also an output. <A> Use a clock prescaler. <S> Your prescaler value will be your (clock_speed/desired_clock_speed)/2 <S> so (50Mhz(50,000,000)/2hz(2))/2 <S> = 12,500,000 which in binary would be 101111101011110000100000. <S> More simply: (50,000,000)/2)/2 <S> = 12,500,000 convert to binary - <S> > <S> 101111101011110000100000 <S> Here is some code of what to do:Use newClock for whatever you need 2hz for... library <S> IEEE;use IEEE.STD_LOGIC_1164.ALL;use <S> IEEE.STD_LOGIC_UNSIGNED.ALL;entity ClockPrescaler is port( clock : in STD_LOGIC; -- 50 <S> Mhz Led : out STD_LOGIC ) <S> ;end ClockPrescaler;architecture <S> Behavioral of ClockPrescaler is -- <S> prescaler should be (clock_speed/desired_clock_speed)/2 <S> because you want a rising edge every period signal prescaler: STD_LOGIC_VECTOR(23 downto 0) : <S> = "101111101011110000100000"; -- 12,500,000 in binary signal prescaler_counter: STD_LOGIC_VECTOR(23 downto 0) : <S> = (others => '0'); signal newClock : <S> std_logic := '0';begin <S> Led <= newClock; countClock: <S> process(clock <S> , newClock) begin if rising_edge(clock) <S> then prescaler_counter <= <S> prescaler_counter + 1; if(prescaler_counter > prescaler) <S> then -- Iterate newClock <= <S> not newClock <S> ; prescaler_counter <= (others => '0'); end if; <S> end if <S> ; end process;end Behavioral; <A> You usually don't actually want to clock anything that slow, just create an enable at the correct rate and use that in the logic: if rising_edge(50MHz_clk) and enable = '1' then you can create the enable thus: <S> process variable count : <S> natural;begin <S> if rising_edge(50MHz_clk) then enable <= '0'; count := <S> count + 1; if count = clock_freq/desired_freq then enable <= '1'; count : <S> = 0; <S> end <S> if; end if;end process; create a couple of constants with your clock frequency and desired enable frequency and away you go, with self-documenting code to boot. <A> I would rather suggest using Xilinx primitice digital clock manager IP . <S> It has graphical settings interface where you can specify what frequency you want. <S> It will generate a component with your desired output as frequency. <S> It can be found in IP Wizard; <S> And then you will be able to specify what frequency do you want: <A> Factor = input-signal-frecuency/output-prescaler-frecuency. <S> CE = Clock Enable. <S> It should be a one clock (clk) wide pulse or high if not used. <S> Q = Output signal of one clock wide pulse with the desired frecuency. <S> library <S> IEEE;use IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_ARITH.all;use <S> IEEE.STD_LOGIC_UNSIGNED.all;entity prescaler is generic ( FACTOR : integer); port ( clk : in std_logic; rst : in std_logic; CE : in std_logic; <S> Q : <S> out <S> std_logic);end prescaler;architecture <S> for_prescaler of prescaler is signal counter_reg, counter_next : integer range 0 to FACTOR-1; <S> signal <S> Q_next: <S> std_logic;begin -- for_prescaler process (clk, rst) <S> begin -- <S> process if rst = '1' <S> then -- asynchronous reset (active low) counter_reg <= 0; elsif clk'event and clk = '1' <S> then -- rising clock edge counter_reg <= <S> counter_next; <S> end if; <S> end process; process (counter_reg, CE) <S> begin -- <S> process <S> Q_next <= '0'; counter_next <= <S> counter_reg; if CE = '1' then if counter_reg = <S> FACTOR-1 <S> then counter_next <= 0 <S> ; Q_next <= '1'; else counter_next <= counter_reg + 1; end <S> if; end if; end process; process (clk, rst) begin <S> -- process if rst = '1' <S> then -- asynchronous reset (active low) <S> Q <= '0'; <S> elsif clk'event and clk = '1' then -- rising clock edge Q <= <S> Q_next; <S> end <S> if; end process; end for_prescaler;
The second way is to use a counter to count the number of faster clock pulses until half of your slower clock period has passed.
How to Wire This Latching Relay I am looking to switch a water solenoid valve using two water level switches, one will be placed at the top of a tank and will be NO (when water level is between full and empty) so that it will send a signal to the relay when the water reaches the top to stop the solenoid. The other switch will be at the bottom of the tank and will be NC so that it will send a signal to the relay when the water reaches the bottom of the tank to open the solenoid. The switching will be done with a latching relay. The diagram of its pins is here: I simply do not understand this enough to figure out how to wire this. The switches are SPST. The switches, solenoid valve, and relay are good for 120V. What I am asking for is this: on that diagram, where do the switches connect? Where does the solenoid valve connect? Where does mains power connect? Lastly, do I need any resistors on the control side of the circuit? Thank you so much in advance for your time. <Q> I don't believe your application can be solved with the components you mention. <S> My proposed solution is with a regular non-latching relay (and thus pin numbers may be wrong). <S> If the relay is rated for 120V, then my first attempt would look like this. <S> The below is with a non-latching relay though. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> simulate this circuit – Schematic created using CircuitLab <S> I think this will work. <S> The stop switch (high water level) is trying to apply power to turn the relay on because it is a NC switch. <S> If the start switch (low water level) is operated <S> then power is fully applied to the relay and the start switch is bypassed by one of the relay contacts and this keeps the relay on. <S> When the top water level is reached the stop switch disables the relay and the system is reset until water level is low enough to close the start switch again. <S> BTW the schematic editor is really coooool <A> Power neutral connects to A and to one side of your solenoid. <S> One switch connects to B. <S> The other switch connects to 8.Power hot connects to either 11 or 21, your choice, and to the other terminal on each of the switches. <S> The second solenoid wire connects to either 14 (if hot is on 11) or 24 (if hot is on 21), your choice. <S> There should be no requirement for any resistors, provided that the relay can tolerate 120V, 100% duty cycle, on its two actuating terminals.
Either you need switches that give a single pulse or a non-latching relay. This operates the solenoid and it starts "pumping" water.
Are AC adapters electrically isolated? Are AC adapters (e.g. laptop chargers) electrically isolated from ground because they have a transformer? I'm asking this because I read that isolated transformers have a 1:1 ratio whereas AC adapters are commonly a step-down. <Q> You mix up "isolat ed transformer" with "isolat ion transformer". <S> The latter is a transformer that has only one single goal and that is galvanic isolation from the mains supply, without changing the voltage. <S> These transformers are often used for testing, so it is somewhat safer to accidentally touching one of the conductors. <S> When unsure measure resistance between primary and secondary windings, this should be very high. <A> Actually if you look at many of the switch mode ac adapters today, they have a capacitor from the secondary to the primary. <S> This raises concerns. <S> If you take a voltmeter and measure a voltage from the secondary to the mains you will get a 110 volt reading or so. <S> Obviously if the capacitor fails, you have a much bigger problem. <A> First off for AC there is really no such thing as perfect isolation. <S> Capacitance is everywhere. <S> That is why non-contact voltage detectors can work. <S> However there is such a thing as sufficient isolation that it is safe to touch the output. <S> Broadly speaking mains power supplies can be divided into four categories. <S> Not isolated at all. <S> Such power supplies should only be used in situations where there is no chance of user contact with the output. <S> "Class 2" isolated. <S> There is <S> no earth connection and isolation is provided between input and output. <S> Common on very small power supplies, but the leakage through the RFI filter capacitors starts to become a problem as the power supply gets bigger. <S> There are ways to reduce leakage while keeping acceptable EMC such as using split-bobbin transformers, but they come at a cost in efficiency. <S> "Class 1" isolated. <S> The output ground is DC isolated from all the input terminals, including ground but the mains ground is used as a barrier between input and output to redirect leakage away from the user. <S> There is likely to be substantial capacitance between output and ground. <S> "Class 1" ground-referenced. <S> The input is isolated from the output (though the isolation may be quite leaky) and the output is tied to mains ground. <S> In my experience the first category while quite commonly seen inside equipment is very rare for separate power supplies, though I have seen reports of non-isolated power bricks being supplied with some dodgy "direct from China" stuff. <S> Phone chargers and similar low power wall-warts nearly always fall into the second category. <S> Laptop power bricks and similar-sized generic power bricks are normally in the second or third category, <S> In my experience older laptops and generic replacement power bricks are more likely to be in the second category while the power bricks supplied with recent laptops (at least in the EU) seem to nearly always be in the third category. <S> Desktop PC power supplies are pretty much always in the fourth category. <S> Generic open-frame or semi-enclosed power supplies designed for use inside equipment are usually in the third category. <A> Normally they are however it depends on the circuitry inside the adapter. <A> Yes, they are isolated from the mains L and N, using a transformer (not necessarily Protective Earth though - PE, see below). <S> The transformer can be any ratio and it will isolate as long as the windings are separated <S> (i.e. it's not an autotransformer ). <S> You are probably thinking of specially purposed 1:1 isolation transformers which an EE may use when e.g. designing power supplies or working on high voltage equipment. <S> All modern consumer equipment should be isolated from the primary mains side (however as Chris notes, some old consumer equipment was not isolated and one should not assume anything until tested and confirmed), though a charger may be referenced to earth ground at it's output (my laptop adaptor is) <S> An easy way to test this is to use a multimeter and see if there is any continuity between the adapter output and the plug earth pin (if it has one - if it doesn't it's completely isolated, or "floating")
All normal transformers, when properly connected, offer galvanic isolation, but beware that there do exist types (like autotransformers) that are internally wired in such a way that they don't.
Sawtooth generator not working - transistor won't discharge my capacitor I have been trying to build a sawtooth generator using a current source which linearly charges my capacitor and a comparator which was supposed to discharge my capacitor; instead it doesn't. Here is the schematic (first picture) of my attempt which doesn't work. I decided to break the connection between the operational amplifier output and the transistor base to check the signals OSC_CH2 and OSC_CH3 with my osciloscope (second picture) . I figured out that the operational amplifier is working just fine (third picture) . The problem must lie in the transistor or the circuit behind the operational amplifier. But how do I fix my problem? <Q> The output from the LM358 should go through a resistor or it will be limited by the base-emitter voltage and strange things may happen. <S> Try inserting a 1 kohm resistor in series with the base connected to the LM358. <S> I think the circuit needs hysteresis. <S> Here's why... <S> As the capacitor starts charging and the +input starts to rise close to the -input, the comparator output will begin to rise and this will start to turn on the transistor, but not enough to discharge the capacitor - just enough to sustain it in limbo with maybe 0.4 V on the base of the transistor and stalemate on the capacitor. <S> Try a 10 kohm in series with the +input and 1 Mohm from the comparator output back to +input. <S> At least try this to see if it starts oscillating; then we can move on. <A> A relaxation oscillator requires a discharge device or circuit which exhibits hysteresis: this means that when the capacitor charges to the high threshold, the device turns on a discharge path and keeps the discharge path open even as the capacitor drops below the threshold until some low threshold is reached at which point the discharge path closes. <S> The discharge transistor you have there does not have hysteresis. <S> Furthermore, the circuit has stabilizing negative feedback. <S> The discharge transistor acts as an inverting stage (which is why it is negative feedback even though it goes through the + terminal of the op-amp). <S> Turning on the discharge transistor more causes it to conduct more collector current, draining the capacitor to drain to a lower charge, which has the effect of opposing the turn-on of the transistor. <S> This arrangement will naturally solve for a capacitor voltage which is precisely so high that, through the op-amp, via a minute voltage difference between + and - inputs, it programs the discharge capacitor to have a collector current which matches that of the charging capacitor. <S> The charge current continues to flow, and just enough of it trickles into the capacitor to keep it charged in the face of any leakage. <S> The rest goes through the discharge transistor's collector-emitter path. <S> Any build up of extra charge on the capacitor is amplified through the comparator's monstrous gain, and almost instantly raises the collector current on the discharge transistor, which will promptly remove the charge. <S> If the capacitor loses charge, the discharge transistor will instantly reduce its collector current, causing more of the charging current to be diverted into the capacitor to replenish the charge. <S> Such system as described could oscillate, but not as a relaxation oscillator. <S> There would have to be some frequency at which the product of the gain and feedback is 1, and the feedback is phase shifted by 180 degrees. <S> That would be a phase shift oscillator. <S> Without hysteresis, and without the conditions for phase shift oscillation, your circuit is simply stable. <S> It settles back to equilibrium even if externally disturbed. <A> As suggested in another answer you should add a resistor between the LM358 output and the transistor base to limit current into the transistor base. <S> Correction: <S> Below comment is incorrect as pointed out by Andy aka. <S> I misread the schematic connections. <S> As drawn your circuit does have a fundamental design problem though. <S> When the capacitor is initially discharged the LM358 + input will be at a higher voltage than the - input. <S> This will cause the output to be high which in turn causes the NPN transistor to be ON. <S> The ON transistor will cause the capacitor to stay discharged. <S> One way to correct this problem would be to interchange where the + and - inputs to the LM358 connect into the circuit. <A> My first guess would be thatyou fried your transistor by discharging a big cap across it with nothing to limit the current.
I think you need to add hysteresis, but this might be detrimental given the circuit you've gone for, because you don't want to be adding resistors from the comparator output to the capacitor, because it'll tend to limit its ability to linearly rise with time.
What is Q-point of transistor? What is the Q-point of a transistor? Why it is needed? How can we set this Q-point of transistor? Please explain it as I am having difficulty understanding this concept. <Q> The quiescent (quiet) point are the values of the voltages and currents of a circuit when no signal is present . <S> From Wiki : <S> The operating point of a device, also known as bias point, quiescent point, or Q-point, is the steady-state voltage or current at a specified terminal of an active device (a transistor or vacuum tube) with no input signal applied. <S> The choice of Q-point depends on the application and is a crucial part of the design process. <S> The desired Q-point is an input to the DC bias design equations for the circuit. <A> For a 10V supply, the collector would ideally be biased to stand at 5V with no signal present. <S> This allows the largest p-p excursion of a signal before clipping. <S> It's a little bit more complex than this to achieve optimum q-point results <S> but hopefully this advice should help. <S> See this http://qooljaq.com/Q-Point.htm for how to set it correctly. <A> Although it is certainly true that Q stands for "quiescent," the desired Q-point for a bipolar junction transistor totally depends on what CLASS of amplifier is intended. <S> Class A amplifiers commonly have the q-point at (or close to) mid-range, because they are intended for the best linear response from a single transistors. <S> But Class A amplifiers are inefficient. <S> Class B amplifiers typically use two transistors in a push-pull arrangement, and the q-point will be at (or close to) cutoff. <S> Here, the linearity is still fairly good, but the efficiency is much better. <S> Class C amplifiers will have the q-point well below cutoff. <S> Here, the goal is maximum (or at least very-high) efficiency, and there is intentional clipping of the signal, which is usually RF.
Q means quiescent operating point and in simple terms it is when the collector of a transistor (in class A configuration) is biased so that under no-input conditions the output voltage is mid rail.
ATMEL 169PA resets with MCUSR = 0 On rare occasions, my ATMega169PA resets with MCUSR=0. What can cause this? I have multiple units (> 500) running the same code and on rare occasions 1 or 2 units will reset with MCUSR=0. <Q> Answering your question directly will require a lot more information. <S> How do you know it's restarting? <S> Have you accidentally cleared it before it's read? <S> Otherwise this would indicate a Power-On-Reset where the voltage drops below VPOT (as specified in the datasheet). <S> I smell a hardware issue somewhere. <S> [Edit] Given the new information that the unit is being subjected to very cold temperatures. <S> It's almost certain that some units are likely failing because of this. <S> I'd contact Atmel with the failing chip information (lot #, date, etc that are marked on the device) and ask for more guidance. <S> Perhaps a lot had issues. <S> The failure rate seemstoo small to be a PCB issue, but could definitively be explained by some devices not meeting up the -40C spec. <A> Every now and then I forget to tie the \$\overline{\text{RESET}}\$ pin to Vcc, resulting in random resets. <S> Use a 10k resistor if you want to be able to do in-circuit programming, otherwise you can save the resistor and tie the pin to Vcc directly. <A> According to the ATmega169P Datasheet the MCUSR register has the following values upon startup: <S> • Bit 4 <S> – JTRF: <S> JTAG Reset Flag <S> This bit is set if a reset is being caused by a logic one in the JTAG Reset Register selected by the JTAG instruction AVR_RESET. <S> This bit is reset by a Power-on Reset, or by writing a logic zero to the flag. <S> • Bit 3 <S> – WDRF: <S> Watchdog Reset Flag <S> This bit is set if a Watchdog Reset occurs. <S> • Bit 2 <S> – BORF: <S> Brown-out Reset Flag <S> This bit is set if a Brown-out Reset occurs. <S> The bit is reset by a Power-on Reset, or by writing a logic zero to the flag. <S> • Bit 1 <S> – EXTRF: <S> External Reset Flag <S> This bit is set if an External Reset occurs. <S> The bit is reset by a Power-on Reset, or by writing a logic zero to the flag. <S> • Bit 0 <S> – PORF: <S> Power-on Reset Flag <S> This bit is set if a Power-on Reset occurs. <S> The bit is reset only by writing a logic zero to the flag. <S> In the case of a power supply glitch I'd expect the register to contain a value of one, or if the external reset pin was not tied high securely <S> I'd expect a value of two. <S> If you (or the compiler in question) are using the recommendation of reading and resetting the register closely after startup I suspect the microcontroller isn't resetting at all. <S> A more likely cause is a code error causing code execution to revert back to either the reset vector or a point in the code that makes it appear as though a reboot has occurred. <S> The reset vector is located at program address zero so any jump to that address may cause that problem, but without seeing the code it's difficult to determine. <S> Maybe it's an edge case in the sequence of code and/or interrupt sequences that tends to occur very infrequently, or it may depend on the usage patterns of the devices that exhibit the problem. <S> Also as suggested by jippie depending on the compiler, the last instruction after main(); is either a rjmp .-2 or <S> a jmp 0x0000 <S> so if the program manages to leave main(); then the controller may show similar behaviour.
The bit is reset by a Power-on Reset, or by writing a logic zero to the flag.
Is upping the voltage on a multiplexed LED display an appropriate response for dimness? I have a 10 character x 16 segment display that I'm driving using multiplexing off a PIC. The problem is, however, that with each display only being on 1/10th of the time, the display appears much dimmer than it normally would. Currently the LED's are getting their recommended voltage - 2.2 volts across each red segment. Would increasing the voltage across the display be a safe way to make it brighter? Is there a way to do this in software? <Q> It isn't about raising the voltage to the LEDs. <S> The current may be limited by either a constant-current driver, resistors on each LED, or a resistor array serving multiple LEDs. <S> Changing this current limiting mechanism can be done, but is not for the faint of heart. <S> Also, the display then will be unsuitable for direct (non-multiplexed) drive, as the LEDs would blow due to too much current. <S> Alternatively, if resistors or a resistor array have been used, the voltage source feeding these resistors could be increased, thereby increasing current through the segment. <S> Also, keep in mind that increasing the current through an LED significantly over the rated current, for however short a period, can have detrimental or outright destructive effect on the LEDs. <S> See this answer for further insight into this. <S> Another approach that merits investigation is whether the multiplexing algorithm is optimal, as in, is it keeping individual segments lit as long as it can per cycle. <S> If not, then software fixes can improve the brightness somewhat. <A> You can overdrive an LED with more than the rated current. <S> The destruction of an overdriven LED is caused (mostly) by the heat generated in the junction (P=IV, and I scales exponentially with forward voltage, V, so power is a higher exponential in V). <S> If you can contrive to keep the heat within reasonable boundaries, probably by overdriving for only short periods to allow heat to dissipate, you can put as much current though an LED as you want. <S> @Anindo Ghosh's answer has a link describing the limits of this. <S> Another solution, which you can do if you have the ability to add components to the design, is to use shift register/LED driver. <S> This means you can push the data in to a chain of ICs and have all the LEDs constantly driven at a constant current (some driver ICs also include things like dimming controls). <S> When you have pushed in new data, you flip all the chips to the new values at once. <S> Many driver chips have 16 outputs, which sounds like a good match for your displays. <S> Additionally, you only need 2 pins from your MCU for an I2C device (4 for an SPI), do you can potentially downside on the MCU. <S> You might need another couple for things like output enable and latch strobe if this is not part of the serial protocol used, but it should still be less than the "outputs * log2(devices)" for a basic multiplexer. <S> Also, the time taken to write out to the displays is very short (you only need a few cycles per LED to toggle the lines, and if you can use an interrupt-drive hardware module, it becomes even easier!), freeing processor cycles for other things. <S> An example part is the Texas Instruments TLC5925, which has 16 constant-current outputs up to 45mA with analogue dimming control. <S> You need 2 lines to clock data in, one line to en/disable the output and one line to strobe the register latches. <S> This part costs about £1 in single-unit quantities, half that in bulk. <S> It is an SOIC, so soldering is easy, but you can also get much more compact packages if space if limited and your hand is steady. <A> No... upping the current is what you want to do to increase brightness. <S> Said differently, LED brightness is a function of current passed through them. <S> Many LEDs can handle upwards of 100mA at 10% duty cycle. <S> So long as you control the duty cycle, that's the way to go.
To increase brightness of a multiplexed display, the current through each LED segment needs to be increased (to a limited extent), while ensuring that the average current and power ratings of each LED are not exceeded. You can also ditch whatever multiplexers you currently have.
FM Quadrature detector - is it the best choice My input is an FM carrier of 80.00MHz. It is FM modulated with 625kbpsec data. The deviation from carrier is about +/-700kHz. The data never spends more than about 38us in a low state or high state i.e. it is scrambled. Carrier is frequency locked using a PIC and a PLL (ADF4111 from memory but this isn't too important other than to say the varactor that "centres" the frequency is fed from a much slower signal than even the lowest data might produce). Please ask if I've forgotten anything relevant. The above are all givens. I'm considering using FM quadrature detection - is this the best choice given that I can't alter the transmitter design (well maybe not this month anyway!!). EDIT - March 21st - the answer below about counting the cycles stirred thoughts and it provoked me to consider using a high-speed Exclusive or gate as an alternative to the conventional mixer circuit within the heart of the quadrature detector. It would still require a resonant 90º phase shift circuit and simple amplitude limiting so, is this a better choice? Options Conventional Quadrature Detector Quad detector using an exclusive or gate Cycle counting techniques A PLL (I've added this but i can't see a decent way of doing it though somebody may) If one of the above is the best technique, an answer that adequately justifies it gets the nod from me! <Q> It's a better choice for most purposes than a slope detector, a Foster-Seeley, or a ratio detector, but for this application you might be better off with a counting detector. <A> So I've done some research since I have a similar problem and everything leads me to fully integrated quadrature demodulators like LT5517 with a good NCO if you need AFC. <S> All digital systems with direct sampling might have even better noise performance especially if you use oversampling ( source ) but they have a detection delay, so your application should tolerate this delay if you want to use this method. <S> Search for FPGA or DSP FM demodulators, there are plenty of articles. <S> The best solution for data transmission I've found so far are specialized transceivers with interference resistance like AD9364, but those come in 144-LFBGA and cost $210 per chip. <S> See this article for more info. <A> quadrature detector is the cheapest but phase comparator detectors (XOR are simple phase comparators but not as sensitive as AD8302s) are still the most linear.
If you need a simple and decent demodulator, conventional quadrature demodulator has the best noise performance if you use high quality parts for it.
Measuring the step length during walking I would like to measure the step length during the walk and I am searching some ideasto solve this problem. I am not really an expert on sensors so I am trying to collect some information in order to understand how to build a system for this purpose. Normally I use arduino with accelerometers and pressure sensors embedded into shoes. I was thinking that maybe a possible solution consists in finding the distance betweenthe two feet at every moment, and reading the distance values when each foot hits theground (such event can be detected by using pressure sensors). I don't know if some sensors able to track small distances exist. In case can youplease give me a link where I can have some information? Do you have any suggestion or hints to solve this problem? <Q> It's actually a fairly difficult problem, depending on your constraints and requirements. <S> Determining local positioning is prone to high levels of interference and accumulation of error. <S> GPS will be way too inaccurate unless you setup a super expensive differential GPS system, which sounds like it would be too much for you. <S> I'm not exactly sure what the application of this project is, but a low cost solution could be to just mount some ultrasonic distance sensors to the shoes? <S> Or you could use cameras and colored shoes to track the movement? <S> Just some thoughts. <S> Personally I'd just tie a rope to the shoes <S> and then I'd know how long every step would be :) <A> You could do this using an IMU. <S> (3 axis accelerometers, and rate gyroscopes).By integrating twice <S> the accelerations returned by the accelerometers and taking into account the orientations using the rate gyros. <S> you can know the position of your IMU sensor <S> BUT, theses system drift! <S> You have to add some knowledge to the system to cancel or account for the drifts. <S> For example, you could detect when the foot hit the ground. <S> At this point, you know that it's speed relative to the ground is 0 and that the foot is flat on the ground. <S> Thus you can reset the drifting computed speed vector and angles. <S> In fact, you perform the inertial measurement only during a short time, when the foot is on the air. <S> It sounds feasible, but it also sounds that there will be a lot of real world issues to account for. <S> For instance : How to detect for sure that the foot is on the ground? <S> Where to put the IMU system on the shoes? <S> ... <A> Using Doppler shift and sound-waves might work. <S> Transmitter in one shoe, receiver in the other. <S> The Doppler shift will be zero at some point (when both feet are stationary at the end of the stride?). <S> The D-shift will be at a max as the legs cross. <S> Knowing time and the integral of D-shift should dictate distance. <S> Maybe? <S> Or just rope the shoes together like 7200rpm said!!
You could use accelerometers/gyroscopes as you mentioned, but there is a reasonable amount of error depending on your funds and how much error you can tolerate.
L293D maximum current with heatsink I saw in datasheet of L293D that maximum current per channel is 650mA. I have two dc motors that draw within that limitation. Most of the time, measured current is around 1.1A (sum for both motors). Under heavier load it could probably rise few hundreds of mA. With usage of heatsink would that limitation be extended ? Am i on the safe side ? <Q> Exceeding the ratings continuously is not a good idea. <S> The part will fail. <S> And possibly catch fire (I am not kidding). <S> A heat sink will not improve things by much on a plastic DIL. <S> The junction isn't thermally connected well enough to the case to bring the heat that far, even if you do manage to firmly attach a heatsink to the surface. <S> However, you seem to be fairly close to the limit, and you claim to have a bagful of L293s lying around. <S> You can simply use multiple channels in parallel (one chip per motor instead of half chip per motor). <S> This should be enough to keep things within the acceptable limits. <S> The L293D can have multiple channels connected in parallel. <S> This is not a generally applicable approach, though. <S> Don't try this with, say 7805s or LDOs without first considering the consequences. <S> Power regulation ICs which allow this will have mention of it in the datasheet as load balancing. <S> However, the L293D is not strictly a power regulating IC, and your load is fairly specific (a motor). <S> There will be minor separation in (a) turn on time and (b) on resistance. <S> (a) will mean that there will be a brief transient on one channel before the other turns on and (b) means that the current drawn through the two channels will be unequal. <S> The differences will usually be small enough to not be a cause for too much worry except if you've also got highly sensitive systems on the same supply lines or physically very close to it. <A> No It is not good to use L293D in this particular case. <S> Better you use L298N <S> , It has a better capacity (upto 2A). <S> It'll be better for your application. <A> You're never on the safe side operating so close to the maximum rating of an IC like that. <S> IPC-9592A says that a bipolar linear IC (which most likely describes this driver), at a minimum (Class I stress factor) should be derated to 90% of its maximum output current and have a maximum junction temperature of 115°C. <S> With a DIP IC, the amount of copper connected to the pins of the device will influence the junction temperature, as conduction from the die through the bonding wires to the legs is the 'best' (albeit not so great) way for heat to escape. <S> Read: if your layout is flimsy, the junction will be hotter than predicted. <S> Since you have many IC's, I would consider using one IC per motor, paralleling at least two drivers per motor (as described by other answers) - that way the average per-driver current will be below the absolute maximum, and the total power needed divided up over multiple junctions. <S> (Also, if one driver blows, it doesn't take down all the motors.)
For most practical purposes it's fine, and personally I've generally preferred to use the L293 in parallel instead of the L298 if the current is under an ampere per motor because of the headache L298's package brings to the table.
Circuit Analysis With Non-Ideal Diodes I have seen how to do circuit analysis with ideal diodes, that is replace forward-biased diodes with connections and replace reverse-biased diodes with gaps. But the problem is that I want to know how to analize real circuits that contain non-ideal diodes. How do I do so? I need a few leads. EDIT See comments. <Q> If you don't want the simplifications, you have to fall back to the general model of a diode: $$ <S> I = <S> I_o <S> \left <S> ( e^{\frac{eV}{nkT}}-1 \right)$$ <S> This equation relates the diode current to the diode voltage (it's V-I characteristic) <S> Io - is the diode reverse saturation current <S> k - Boltzmann's constant = 1.38e-23 Joules per Kelvin T - Analysis temperature (Kelvin) <S> e - Magnitude of electric charge <S> n - Ideality factor (for silicon diodes, n=2 for small currents and approaches n=1 for large currents; in theory should always = 1) <S> You can now solve your circuit via the system of equations that it produces. <S> Although you now have continuous V-I functions to describe your elements, a closed-form solution is not always guaranteed to exist. <S> It is often necessary to use an iterative solution technique such as Newton-Raphson to approximate/approach the answer. <S> This is what SPICE solvers do in the general case... and why they ask you for initial conditions (which can dramatically speed up the solution time). <A> You can either use one of the mathematical models of varying complexity (see e.g. Diode Modelling ), if you are using e.g. Matlab/Scilab, etc. <S> Or as Leon suggests use ready made SPICE models and simulate your circuit in something like LTspice. <S> Or of course you could build and analyse your circuit directly. <A> For more complex circuit I concur that simulation is the method to use because with analytical approaches sooner or later you will run into a transcendental equation from the diodes I-V characteristics therefore a numerical approach is needed which is basically what the simulator does.
For a real basic circuits(probably just one diode on the circuit), you could use graphical approaches as a load line.
Booting FreeRTOS on ARM I am building an embedded device (like a phone) that will run FreeRTOS. I am using an ARM Processor . How can I make my homebrew device boot FreeRTOS? Is there a special type of storage drive that I can use to start freeRTOS? <Q> FreeRTOS is statically linked. <S> Ok, maybe an over simplification, because you also need to install three interrupt handlers, but that is all. <S> There are lots of pre-configured examples available for lots of different ARM Cortex-M processors (like the one you link to) that come with buildable projects and instructions on downloading and running. <S> Here are some links that might be useful: links to documentation pages for ports buildable project for an LPC18xx like the one you link to http://www.freertos.org/Creating-a-new-FreeRTOS-project.html <S> http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html <A> Looking at the FreeRTOS ROM use <S> it's quite frugal <S> so the usual way would be to load it directly into the 512KB FLASH integrated into the microcontroller. <S> The most convenient way to do that will be to provide JTAG programming pins on your design and load the image using a JTAG programmer. <S> While I haven't used NXP ARM parts in particular my approach would be to find a reference design or evaluation board circuit and copy the JTAG interface. <A> I build the freertos using Xilinx SDK to create the elf file. <S> Then I used the uboot to grab the file from TFTP server and boot it.the commands are like: tftpboot 0x0 freertos.elf; bootelf;
If you can compile, download and run a bare metal (no OS) application, then you can boot FreeRTOS because all you need to do is include the FreeRTOS source files in your build then call vTaskStartScheduler() from main().
Is current the same coming out of an IC as it was going in? (source: fatcow.com ) This is my first diagram so keep that in mind. I've come up with this circuit becauseI've got some 74** series ICs and I want to be able to make them work. This example isa simple AND gate with the 7409 IC. Obviously, if the circuit works, the LED should glow but only if both switches are on.What I don't know is what the current will be when it gets to the LED. The reason I'm not sure is what happens to the current when it is output from pin 3? R1, and R2 slow down the current so that it can safely enter pins 1 and 2. But is the470 ohm resistor required to protect the LED? <Q> The 7409 is a Quad packed 2 input AND Gate with Open Collector Outputs . <S> It needs a pull up on the output pin 3 to work. <S> And it can only sink 16mA when the output is logic level low. <S> Logic level high leaves the internal open collector transistor off, with a leak current of 250µA, only if the external pullup is there. <S> It won't work at all in the setup you have pictured. <S> Notice <S> the Output Y is connected to a transistor's Collector. <S> Current would flow from external vcc through (in your case) <S> the resistor and led, into the collector and out through ground (Or other way around depending on your school of thought). <S> But you would need to connect the led/resistor to VCC, not Ground. <S> And mind the 16mA limit. <S> (Which is listed for TI's SN7409, not sure about the original 7409's maximum current) <A> There are a couple mistakes in this circuit: <S> The switches won't work as expected, because you need a pull-down resistor to force the inputs low when the switches are open; <S> In fact, it will be directly taken from the supply pins. <S> Anyway, directly answering the question in the title, yes the current going out of any component is the same of the current going in. <S> But, in this case, it will enter from the supply and exit either from the ground or from the output. <S> In any case, for the Kirchoff's law of current, in every component (or block, or node) <S> the sum of entering currents must be equal to the sum of exiting currents. <A> Pin 3 delivers a voltage at its output, depending on whether it is a 0 or a 1 it will be (approximately) 0V or 5V. Note that you mention 6V, which is not a good idea for a 74xx chip. <S> 74HCxx chips are more tolerant. <S> The current required to provide those voltage come from the ground and power pins, not from the inputs. <S> If you chip is really a 74xx (old style TTL) <S> it will regard floating (unconnected) inputs as 1 (high). <S> Short the input to ground (no resistor necessary) to make it a 0. <A> The current through the LED won't depend on R1 and R2. <S> When both inputs are high, the output is latched up to the supply rail. <S> Current will flow through pin 14, through the resistor, then the LED.Because of this you can assume the output as a voltage and calculate the current from there: (Vsupply - Diode formward voltage drop)/R3 (approximate because diode forward voltage drop changes with current). <S> Also I don't think the circuit will work well because your switches only ever pull each input high. <S> When they're not on, the inputs will be floating and will behave strangely. <S> You should have the resistors R1 and R2 attached from the inputs to ground, then the switches from the inputs to the 6V. Cheers
The current coming out of the AND gate won't be dependent on the current on its inputs (virtually zero).
What should I get to desolder components from random boards After failing trying to use my friends blow-torch to De-solder components from all these circuit boards and burning them badly and probably both of us getting lead poisoning and smelling the crap all day, I decided that I were to invest a bit of my money on de-soldering technology. I know Radio-Shack is a bit pricy, but I can bike to it and get free shipping therefore I don't want to get it online. I first heard about the de-soldering wick, but that runs out and I've heard it isn't the best. After a bit of internet surfing, two things popped up that seemed they may be suitable this and this . The first one is a desoldering iron with a bulb. I would like to go for this because it is cheaper but I don't know if it will work very well (like it not sucking up any solder or me having to replace the bulb ALL of the time). It does look nice because of it's one-handed-ness but does it work? any experience with these? The second one was a de-soldering vacuum and it was a bit more pricy but may work better for my needs because of its spring-loaded pump. So... Is the first one suitable for de-soldering a bunch of circuit boards, or should I get the vacuum? Sorry if it is not "on topic" <Q> Neither is particularly useful for desoldering all the components from a board. <S> Desoldering in general is not something easy to do in large amounts, but sort of a "here and there" type thing. <S> Sometimes, an element of a board needs to be reworked, and tools like that can help, or maybe a hot air station would be more useful for your special case. <S> There are also a variety of different devices that would supply you with vacuum, like this . <S> Without knowing exactly what you're trying to do, and why, its tough to be more specific. <A> I typically use a hot air gun. <S> I bought this one sometime back and its great and cheap. <S> The soldering gun, kinda sucks, but I bought it mainly because of the hot air <S> , the iron was just an added bonus (even though I dont use it) http://www.ebay.ca/itm/SMD-2in1-898D-Soldering-Rework-Station-Hot-Air-Gun-Solder-Iron-Welder-Parts-/121061748887?pt=LH_DefaultDomain_2&hash=item1c2fd7b097&_uhb=1#ht_2829wt_1139 <A> The iron with bulb is very easy to use for through hole components. <S> desolder wick is required for some smd stuff, but in general is hard to use, and easy to burn yourself on (heat moves through copper mighty fast). <A> What type of component are you trying to de-solder? <S> through hole or surface mount?? <S> Also what kind of packages?? <S> For surface mount, I would not try any of the two approaches. <S> For through hole components I would only try on axial 2 or 3 lead packages, otherwise It would be too time consuming. <S> , I actually use that for my prototyping at my work place <A> Back in the day when I found it useful to remove large numbers of through hole components from PC boards I devised a scheme to heat the whole board up to solder melt temperature. <S> Components were then able to be lifted off with simple needle nose pliers. <S> Heating <S> the boards was done on an old cook stove in a large sized "cake pan". <S> The pan was partially filled with peanut oil to a level that covered over the board. <S> Peanut oil supports being heated up to a temperture over the solder melt temperature of older style 60/40 tin-lead solder. <S> Certain cautions ARE REQUIRED if to use this technique. <S> A) Apply heat indirectly to the pan and do not use open flame to heat the pan. <S> B) Make sure to wear heavy leather gloves that go all the way up your lower arms. <S> Hot oil splashes will instantly burn through your skin. <S> C) Make sure to wear a face shield as hot oil can splash up and hit you in the face without it. <S> D) Keep a fire extinguisher nearby that is designed for oil fires in case something gets out of control. <S> E) <S> Do not do this in a living space unless you want your house to smell like a Chinese Restaurant kitchen for the next six months. <S> F) <S> Lastly make really good and sure that you do not introduce water into the hot peanut oil at any time. <A> It's mainly for SMD components <S> but I suppose it could be used for thru-hole components. <S> https://www.sparkfun.com/products/10925
You could also potentially use ChipQuik. You should consider a hot air rework station , sparkfun.com has one for about $100 but its well worth it
What's the best/easiest way to measure an unkown inductance without an RLC meter? Is there a decent way to measure inductance accurately using an oscope and a function generator? The best method I can find is to build a tank circuit and sweep the frequency until the highest voltage appears. Then use the formula below to solve: $$f = \dfrac{1}{2\pi\sqrt{LC}}$$ It seems like there must be an easier way! <Q> I've used a two terminal oscillator, with the inductor in parallel with a suitable capacitor, with a scope or counter to measure the oscillation frequency. <S> I once checked an inductor on a very expensive inductance meter at work, and the values were identical. <S> The source-coupled oscillator using two FETs is ideal for this application, or the LM311: <A> The sweep and oscillator methods are both decent ways <S> but, you need to consider the value of the inductor's parasitic self-capacitance in many cases. <S> You should also consider what errors might be incurred if the Q of the tuned circuit is low. <S> More about that at the bottom but for now I'm assuming you can create a high-Q resonant circuit from an unknown L and known C. Use \$Fn = \dfrac{1}{2\pi\sqrt{LC}}\$ to "extract" the inductance value - <S> the L value you calculate is based on "known capacitance" that parallel-resonates the circuit at frequency Fn - this capacitor has to have an accurately known value. <S> This gives you the first estimate. <S> Add <S> another "known" capacitor in parallel and <S> you get a new lower frequency. <S> You may find that if you recalculate the inductance based on the new circuit, it will be slightly different to before and this is due to the inductor's parasitic capacitance offsetting the known capacitors by a few percent. <S> You now have enough numbers to calculate the precise inductance value. <S> You also have enough information to calculate its self capacitance and therefore its self-resonant frequency (SRF). <S> Do math now! <S> As a final check, run the inductor (with no added capacitors) at its SRF and see if the component resonates at what was predicted. <S> In most cases this will tally. <S> However, if you are dealing with small values of inductance (say < 100nH) the parasitics involved will be of the same order as any measurement probes etc.. <S> Then you'll need specialist equipment to resolve these problems I would say. <S> Low Q circuits will also incur an error. <S> The "damped" resonant frequency will reduce as Q factor reduces and this means the \$\dfrac{1}{2\pi\sqrt{LC}}\$ formula will progressively become more inaccurate. <S> Here's a wiki picture that explains: - Note that this graph works for mechanically resonant situations or electrically resonant circuits. <S> If you look at the blue line on the graph you'll see this is where the resonant peak moves as damping increases. <S> It can produce significant errors and be aware of this. <S> Adding the extra cap to give a better chance of calculating the real inductance value (as I mentioned above) will also increase the circuit's "damping" so care MUST be taken when trying to calculate inductance when the "resonance" peak is not very strong. <A> Observe the current through the choke with a scope, and the slope and voltage give you the inductance. <S> $$V= <S> L\frac{di}{dt}\\L = <S> V\frac{dt}{di}$$ <S> So you'd need a scope, some means of measuring the current (a shunt resistor should do), a capacitor, some means of charging the capacitor, and a switch that can safely short the capacitor with the inductor. <S> Start slow, of course; depending on the size of your inductor, you could easily destroy it by putting too much voltage or too much capacitance on it. <S> A switch capable of opening the contact (and handling the inevitable inductive kick) might be preferable, so you can be sure you don't dump all the energy in the cap straight into heating the choke. <A> John Becker had a constructional project where he built a PIC LCF meter. <S> He used the following circuit to obtain oscillation. <S> He used the 4011 Nand gate but one can also try using an inverting Buffer (74LS04 etc ) instead of the Nand Gate. <S> I tried the HEF40106 <S> but that did not work well at all. <S> The standard formula applies: <S> So the series capacitance C in this instance <S> is <S> 10nF. VR2 is there to ensure that the oscillation starts reliably and remains stable through its operation. <S> The L1 inductor provides a minimum inductance which one can subtract to get the unknown value of L.
I commonly measure inductance of power chokes by charging a capacitor to a fixed voltage, then momentarily applying that voltage to the choke.
Headphones impedance and the SPL The headphones A has an impedance of 32 Ohms. The headphones B has an impedance of 250 Ohms. Both of the headphones are similar by size. Is it right that the headphones B will play quieter by 250/32=7.8, if we talk about the sound pressure level? 7.8 times is approximately 9 dB. <Q> The only spec that matters is sensitivity . <S> For normal speakers, sensitivity is usually listed as dB Per Watt at 1 meter. <S> For headphones, it is usually listed as db per milliwatt at "ear distance". <S> There are lots of things that can affect sensitivity, and impedance is just one of those. <S> What I can say is that at the same "volume setting", one of these headphones will consume about 7.8 times more wattage than the other. <S> But how that impacts volume is completely up in the air because we don't know the sensitivity. <A> If all else were equal, then yes, in theory. <S> However, you really can't make that assumption because there are so many other variables regarding how the two different headphones might be designed. <S> You really can't make any meaingful assumptions about loudness from just the impedance. <A> Headphone B may be more sensitive than headphone A - it has more turns on its magnets and this <S> can make it more sensitive to signals and make it louder in some cases. <S> EDIT - I originally made a mistake in the calcs below <S> so I'm editing this bit... <S> An amplifier's headphone socket usually has resistors in series with the output to restrict the power taken by headphones and if the resistor is (say) <S> 100 ohms, the voltage across A would be much lower than B. Taking only impedance into account <S> this would mean power into B is about 0.5dB more than A <S> Please note that the above are just simple examples showing how wrong it might be to assume A is louder than B
There can be significant variation in the mass of the vibrating element, its area, how far it can travel, the magnetic coupling, the strength of the magnetic bias field, how the pressure from the back side of the vibrating element is handled, how well the front side pressure is coupled into your ear, etc, etc.
Smallest circuit to make a sound I'm looking for the smallest circuit to make some noise. This sound has to be constant and annoying, it's intended for the alarm on a timing device. Any ideas? The circuit will be triggered with a high line from a microcontroller. Supply voltage can be 5V or 9V. <Q> Perhaps the least-effort option that meets the specified requirements is to use a piezoelectric buzzer, such as this one: They can be had for under US$1 from various sites like eBay.com. <S> This datasheet lists a number of such buzzers <S> : Stay away from the ones that specify "without circuit" or "external drive type". <S> A MOSFET or BJT as a switch, driven from the microcontroller GPIO pin, is sufficient to operate the buzzer. <A> You could just probably drive a DC buzzer, which Anindo showed, with a transistor using one of your microcontroller's pins. <S> I have shown an example in the below schematic. <S> Pick the R1 so that it gives enough gain to your transistor. <S> Since you do not want much components, you can maybe remove pull-down resistor R2 if you can get away with small problems, such as a weak and short beep on power-on, when the microcontroller's pin is floating. <S> Also, a fly-back diode may not be necessary, depending on the buzzer. <S> I have happened to pick a PIC16F616 <S> , it is an over-kill as Olin notes <S> and I did not pay attention to that. <S> Feel free to use your own microcontroller which you are already using in your design. <A> If you are into discrete components, one of the simplest circuits possible is the Astable Multivibrator: <S> simulate this circuit – <S> Schematic created using CircuitLab <S> It is thoroughly explained on Wikipedia or in various questions here. <S> E.g.: <S> How does an astable multivibrator LED blinking circuit work? <A> What is the most annoying sound you could think of? <S> It'll be different for you to me <S> so why not use one of these: - http://www.electronics123.net/amazon/datasheet/A96010.pdf <S> It records 20 second of speech and can be played back using simple control circuits. <S> Then you can record whatever sound or noise is the most annoying to you and hey-presto!! <S> There are others: - <S> http://www.eletech.com/Products/QuikVoice_Chips/quikvoice_chips.htm <S> I'm sure there must some chip-level solutions that'll be cheap and small <S> and i used one of these a few years ago <S> so i know they work: - http://www.experimentalistsanonymous.com/diy/Datasheets/ISD%20Chipcorder%20Circuit%20Examples.pdf
I'm sure there'll be some chip-level solutions that'll be really small and cheap These buzzers come at a wide range of "annoying" sounds, pick one to your liking.
What does it mean for a CPU to support a stack? How can a CPU not support a stack? Doesn't any architecture that uses subroutines (I'm pretty sure that's all architectures) have to push the return address onto the stack so it can return to where it called the subroutine from? The stack just means a section of memory with a pointer that grows in a certain direction and acts as a stack data structure no? I just don't understand how an architecture could not support a stack. To what extent is automatic memory storage (automatic variables vs. static variables) determined by the compiler vs. the hardware architecture? <Q> There are many low-level microcontrollers that have hardware stacks for subroutine call/return and interrupt handling, but make it difficult if not impossible to store data (variables) there, and implementing a purely software data stack would be terribly inefficient. <S> The 8051 is one classic example, and low-end PICs (PIC12/PIC16) are another. <S> On these machines, the data stack is emulated by assigning static storage locations for automatic variables, with the amount of reuse of these locations being dependent on the sophistication of the compiler. <S> Note that if stack emulation is being done this way, it means that recursion — a function that calls itself, either directly or indirectly — does not work, since each instance of the function reuses the same static locations for its supposedly "private" variables. <S> Some compilers do allow the limited use of recursion (typically implemented by means of a #pragma of some sort), which will cause it to create a true data stack <S> no matter how much it slows things down. <S> Just as an aside, there have been CPU architectures that did not have a hardware stack at all, not even for subroutine/interrupt handling, including the DEC PDP-8 and the IBM System/360. <S> On these machines, the PC (return address) and status register (for interrupts) were saved in registers or memory locations, but in every instance I can think of, the machine also had sufficiently flexible address modes that made it easy to create a stack with software. <A> You can emulate this without hardware support through emulation, which is compiler generated code that the same sort of things in RAM using variables. <S> It's rare / uncommon to not have direct support for stack in any modern computer architecture. <S> Semantics of variables in programming languages have almost nothing to do with the target hardware architecture, for any language higher than straight assembly. <S> The compilers job is to generate machine code that is compliant with the semantic contract of the programming language. <A> Some architectures (e.g. PIC) have a hardware stack that's limited in capability (can only be used for return addresses, not variables). <S> Some extremely small architectures don't have a store-and-increment or PUSH instruction, so it's more fiddly to do a stack. <S> 'auto' variables in C should always be compiled to something with 'auto' initialisation behaviour, and 'static' with static behaviour; on some architectures you're not allowed to do recursion, in which case the compiler can statically allocate all the variables.
"supporting a stack" means having an explicit stack pointer register, and having primitive machine code instructions for manipulating / using the stack pointer register (like reti, which changes the program counter based on the stack pointer in order to return from a function call).
DC DC Converters in Parallel for double current I am using a 15V 7A DC DC converter for powering a robot. I am looking for a 15V 20A supply. For this can I put three of those regulators in parallel and expect them to provide about 20A of current? Also can anybody suggest a better method?(given that my original source is a 5 Cell LiPo Battery(18.5v))By parallel, I mean shorting the 3 inputs and 3 outputs. I connect the battery to the shorted inputs and attach my device to the shorted output. <Q> Shorting the outputs will be problematic. <S> They are voltage regulators and the one (of the three) that wants to regulate at slightly higher voltage than the other two will end up supplying most of the current to the robot. <S> It's best to choose a dc to dc convertor that has better spec. <S> Alternatively maybe you can, with relative ease, redesign some of the robotics so that they can operate directly from the LiPo battery <S> - There is a decent chance that this might be easier - using a DC-DC convertor running from about 15V and supplying 15V makes the convertor design more complex and no-matter <S> how efficient it's <S> spec says it will waste power. <A> This app note from Recom <S> addresses the question. <S> Connecting the outputs of DC/DC converters in parallel is possible but not recommended. <S> Usually DC/DC converters have no possibili- <S> ty to balance out the output currents. <S> The overloaded converter may then drop out of circuit lea- <S> ding to power supply oscillation. <S> The only possibility to balance out the indi- <S> vidual currents is to use a special balance function (like in R-5xxx) or use converters with SENSE function and additional load- <S> share-controllers (as can be done for RP40- xxxxSG) <S> So like Andy aka said, it's not the best idea. <S> Not that it definitely won't work; I've done it on a few occasions in a pinch, and I didn't have any problems. <S> It's been a while, but I believe I added diodes to the output of each unit, and connected all the cathodes, which helped the sharing problems. <S> But you still need to derate the total combination, because they'll never share perfectly. <S> If you go the diode route, I'd recommend four converters, not three. <A> For a motor, I wouldn't do a separate DC-DC step unless the voltage difference is really huge. <S> The DC-DC converter is a FET and some logic for voltage measurement, and an inductor. <S> The motor controller is a FET and some logic for current measurement, and an inductor (motor). <S> These can be combined into a single FET+inductor circuit because you only care about the current through the motor, as long as the motor controller reacts quickly enough to avoid overcurrent. <S> You get a bit better efficiency, but performance is more dependent on the battery charge state. <A> But you will have to add load sharing. <S> Not simply shorting the outputs. <S> Load sharing can be active, by means of an <S> LTC4370 . <S> Load sharing can be passive, by means of series resistors. <S> The resistor will drop the voltage slightly, reducing the output voltage of the power supply when current increases. <S> This is called droop. <S> The effect is that when supply 1 current increases, the voltage will drop below the output of supply 2, thus drawing more current from supply 2. <S> The disadvantage is that you cannot regulate this very well with fixed resistors. <S> That is where the LTC4370 comes in. <S> What if supply 2 is slower? <S> - Drift. <S> Setpoint of supply 2 will raise over time/temperature causing it to do more. <S> - Oscillation of currents. <S> If they respond to load changes poorly. <S> You might also need to add a reverse diode, if the power supply cannot withstand reverse voltage. <A> This is slightly besides the point but for really supplying power in parallel from SMPS converters, you should run them phased. <S> Multiphase or polyphase are better search terms than 3 phase.. <S> Three converters running at 120 degree phase shift would be able to supply (approximately) <S> 3x the power needed. <S> It's not quite that simple of course <S> but these things rarely are. <S> Getting the supplies to really balance requires current mode control and so on.
If you can look into the robotics and decide which parts can run from an unregulated voltage this might be better. You can use supplies in parallel. So there is potential danger that if the loading is asymmetrical, that one of the converters starts to be overloaded while the others have to deliver less current. The problems you could encounter when doing it passively: - Problems with power-up.
Why would large portions of traces be completely covered in solder I've recently found, in some old stuff, a circuit board from an toy, specifically a target for a light gun (if you light up the photoresistor in the middle of the target with the light from the "gun", it generates a sequence of pretty lights). What baffled me is that the traces look like this: As you can see, a large portion of the traces is covered in solder. Since I wasn't able to deduce a sensible reason (only several nonsensible ones relating to either incompetence or improvisation), my question is: What would be the rationale for covering the traces with solder in the manner shown? For reference, here's the other side of the board: <Q> This is a classic example of the early days of wave soldering w/o solder mask. <S> It looks like a phenolic pierce and blank style board too so a very low cost. <S> Obviously solder was not considered a cost item nor something to be minimized. <S> It did have the additional effect of reducing trace resistance. <S> Do keep in mind that the copper needs to be covered to prevent oxidation and corrosion so this solder cover was necessary too. <S> You used to get PCB's (or PWB's however you want to call them) <S> made with solder coating on the traces, (see picture in question? - probably) and when solder masks first came out these were applied over the solder coated traces, and then subsequently wave soldered. <S> It resulted in the solder reflowing under the mask and getting all ripply and even causing tin whiskers between traces. <S> The next step was Nickel plating to prevent copper oxidation and NOT having the ripples. <A> This is due to the process used to make the board. <S> No soldermask was used, so the solder stuck to all parts of all copper traces. <S> There is really nothing wrong with that. <S> It all comes down to cost. <S> Note that these are cheap boards, being single layer and probably punched instead of drilled and routed. <S> At high volumes the few cents saved can add up. <A> I would agree with a conclusion that this bakelite based boards tend to quickly degrade over time and that etched traces because of LQ gluing to bakelite tend to crack off the board if there's slightly heating present. <S> Todays impregnated epoxy based resin pcbs are way better thermal conductors. <S> And cheap way to achieve better electrical and thermal conductivity over a whole board. <S> So there's nothing wrong with those pcbs. <S> They could only "look ugly from todays pov" if you prefer using modern CAD tools and solder mask.
And soldering traces is cheapest way to protect copper traces from oxidation so these could retain designed properties over time and in various operating environment (as no solder mask is used). Apparently for this board, at that time, with the available processes to that manufacturer, at that volume, this was the most cost effective way to produce these boards.
1-Wire and the resistor I have been playing around with some 1-Wire components and got these questions simulate this circuit – Schematic created using CircuitLab Can I break anything if I forget the 4.7 k resistor ________? Does it have to be 4.7k _________? Came across an Adafruit lib that used 10 k but changing between the two resistors (4.7k and 10k) didn't seem to influence the readout. But is it the lib that defines what resistor size I should use or should it just be between an interval..? I'm a newbie when it comes to electronics and right now I'm just learning-by-doing. Reading the theory behind thing doesn't help me that much since I don't understand half of the terms used.. <Q> 1) "Can I break anything if I forget the 4.7 k resistor?" <S> No. <S> You might damage the external device if you drive the Arduino output active HIGH instead of high-impedance. <S> Usually the libraries take care of this. <S> digitalWrite( 1 , HIGH ); <S> pinMode( 1 , OUTPUT ); // <S> Bad, active HIGHdigitalWrite( 1 , LOW ); pinMode( 1 , INPUT ); // <S> Good, high impedance. <S> 2) <S> "Does it have to be 4.7k"? <S> No. <S> Check the datasheet for details and considerations. <S> Depending on speed and power requirements pull up resistors usually vary from 1kΩ to 100kΩ. <S> Your 4k7 is about as good as my usual 10kΩ. <A> 1-Wire devices have open drain outputs so the pullup is required to maintain a logic "1" when the bus is not driven, just like with I2C. <S> The reason for using open drain outputs is also the same as in I2C: to allow multiple devices on the same bus (see also this question ). <S> You won't fry anything if you forget the resistor (as long as you don't drive the bus high from your master device) but your 1-wire bus isn't going to work except by some accident. <S> All of this is thoroughly documented in Maxim literature including datasheets and app notes . <A> If you don't have the resistor at all, there is no power supply to the 1-wire device. <S> It's a "pullup" resistor. <S> Its exact value isn't important, there is probably a broad range in which it will work.
If you replace the resistor with a short you can potentially damage D1, if it ever tries to output '0'. The value of 4.7K is most likely chosen to ensure sufficiently small rise time with common cable lengths. The real parameter that governs the maximum allowed resistor value is rise time of the signal, determined by bus resistance and capacitance.
Radio Waves reach in function of frequency What is the relationship between the reach of a RF signal and its frequency? What I mean is: If power is kept constant, should I use high or low frequency waves to get a better reach? Why? <Q> In free space, it doesn't matter. <S> The power per incident area of a propagating wave is inversely proportional to the square of the distance from the transmitter. <S> This is true regardless of frequency. <S> Certain frequencies are reflected, refracted, absorbed, and scattered differently by different materials. <S> There is no single monotonic relationship until you get to really high energies, like gamma rays and beyond. <S> At these really high energies (high frequencies), the waves basically just blast thru any material in their way, with higher energies passing thru material with less attenutation. <S> Diffraction effects can make low fequencies (long wavelengths) appear to bend around objects, but this actually occurs at all wavelengths. <S> The "near" layer where diffraction effects occur scales with wavelength <S> , so it appears to us at a fixed human scale that long wavelengths go "around" objects where short wavelengths don't, but that is due to our perception scale. <S> On the scale of the earth <S> , commercial AM radio frequencies around 1 MHz are low enough to diffract around the curvature of the earth to some extent making over the horizon AM reception possible. <S> Commercial FM radio, being 100x shorter wavelength, exhibits this effect much less for the same size earth, so FM radio appears to us to be mostly occluded by the horizon. <A> You are looking at a quite deep topic called radio wave propagation . <S> From what I understand, low frequencies can follow the curvature of the earth (ground wave) and can get around obstacles more easily due to their larger wavelength. <S> Higher frequencies are often restricted to line-of-sight propagation. <A> "Free-space propagation of a waveform between antennas is completely independent of frequency" <S> However, apart from the above mentioned effect of low-frequencies following the curvature of the earth, another common reason why lower frequency signals get better communication distances is that their quarter-wave (or other type) antennas are physically larger, giving a larger "effective area" in the antenna equations, and better coupling between transmitter and receiver. <S> See this article from dsprelated.com <A> Besides from what has been said by the others (in free space frequency doesn't matter, if there is not free space absorbtion, refraction, diffraction, scattering etc. has to be considered and those dependend very much on frequency and the matter inbetween) <S> it will also be important how easy it is the construct effective antennas for the frequency you use. <S> You need to get the power somehow into the space and out of it. <S> E.g. if you want to use a rather low frequency in order to penetrate into matter (e.g. below earth or sea level) <S> but it is very difficult to build antennas for such low frequencies (several km wavelength).
Up to below Xray frequencies, there is no single answer, and it depends on the material between the transmitter and receiver.
Measuring Signal Strength with a RF Circuit Note: I'm primarly a 4th year Computer Science student, but I have also interest in electronics but I have very limited knowlege. Is it possible to measure the signal quality or level of a RF transmitter with a RF reciever (like this: https://www.sparkfun.com/products/10533 )? I need to know if I am getting close to the source. I mean is it possible to use these RF transmitter/recievers for not data transfer but signal level calculation? <Q> The datasheet does not give particularly good specs, as is common with the Sparkfun datasheets I have looked at. <S> If you could identify the real manufacturer, they might have better data. <S> In this case, that takes us to a page on www.rf.net.tw which has exactly the same data sheet. <S> However it does have an "Ask Question" form where you could ask if this module has an RSSI function. <S> (Be prepared for the question to be ignored or misunderstood, but it may be worth a try). <S> The datasheet DOES say "Modulate Mode : ASK" which means "Amplitude Shift Keying" which means the linear output MAY vary in voltage to some extent with signal strength, but probably not enough to be useful, because AGC (automatic gain control) will keep the output signal almost constant. <S> One of the comments on the Sparkfun page talks about using the linear output for RSSI and links to this page about it. <S> Doesn't look very reliable to me. <S> This page describes digging into a similar module (different manufacturer) and finding an undocumented RSSI signal, if you are brave enough. <S> All of which probably leaves you looking for another receiver : this time, search for "315 MHz receiver with RSSI" and you may find something more useful. <A> The part you linked has an output pin labeled "Linear Out". <S> The word linear implies the output of this pin should be somehow linearly related to the rf signal. <S> But there doesn't seem to be any further information provided about this pin. <S> Does it deliver the full 315 MHz signal? <S> Does it deliver a demodulated version of the signal? <S> It might even provide a slowly varying output indicating the received signal strength, which would be the most convenient for you. <S> If you have access to a 500 MHz scope, you should be able to see if any of these are good guesses about the function of the pin. <S> If one of them is, you should be able to use this signal to determine the received signal strength. <S> On the other hand, with nothing more than a pin name to go by, it's possible that this pin is not connected to anything at all. <S> Even in that case, there's probably somewhere on the circuit board you hook up a bit of wire-wrap wire and pick off a signal proportional to the input signal. <S> But finding it would depend on either knowing the circuit schematic or reverse-engineering it somewhat. <A> There is a chance you could use a loop of wire (probably two turns maximum with a small tuning capacitor to broadly tune 315MHz) and an "RF" diode detector and decoupling capacitor. <S> This will give you a dc signal that rises as you approach close to the transmitter <S> BUT it won't work at much of a range - maybe a few inches or a couple of foot maximum. <S> This is based on an expected low or sub mW output from your transmitter. <S> I know folk have used this before but if your looking at more than a couple of feet it'll run out of steam. <A> The device that you are looking for is called a field strength meter. <S> RF engineering is one of the most complex specialties within the field of electrical engineering. <S> Here's a link to an article that discusses the construction of an analog field strength meter.
What you are looking for is a receiver with an RSSI function (Received Signal Strength indication); this is usually an analog output proportional to the log of the signal strength.
analog circuit to convert one resistance to another I plan to have a thermistor attached to a CPU heatsink control the speed of a computer case fan . For temperatures below 30c (room temp) I want to stop the fan, and for temperatures at or above 60c, I want the fan to run at full. I've heard someone tell me it's better to use PWM to control the speed since I won't be dissipating so much heat, but it feels silly to use a whole arduino to control a computer case fan. So unless you try to convince me that's a better approach, what I would like is to scale the response of the thermistor to a range of resistances that more closely approximates what the fan needs to reach those goals. I know I can add to the resistance of a black box with a resistor in series, but I don't know how to scale the output resistance of the termistor. (note: I'm leaning towards this one ) Any advice? (PS - this is an educational hobby project; I know I could get a simpler premade solution off the shelf) (PPS - I'd be open to using the 3-pin "fan 2" output from my motherboard (asrock A75M mini-itx), which is already controlled by a temperature, but I don't know how to apply the pinouts to a simple DC case fan) <Q> Yes it's silly to dedicate a whole arduino to running a fan. <S> But, step back and think what a arduino really is. <S> It's a little microcontroller with a lot of sugar coating around it. <S> You don't need all that stuff to make a fan run, so use a microcontroller directly. <S> There are many many small and cheap micros that are totally appropriate for dedicating to running a fan. <S> Most arduinos use Atmel micros inside, but there are also PICs from Microchip, MSP430s from TI, etc. <S> You really want to use PWM because it will waste less power, making less heat, requiring less means to get rid of the heat. <S> Even a few 100 Hz is good enough to run a fan. <S> Once you set it up, you write the duty cycle value to a hardware register, and the rest is hardware that drives the fan proportional to that duty cycle value. <A> This will give you the 'scale' you are looking for. <S> Here is a good site that explains in a bit more detail: <S> http://www.mstarlabs.com/sensors/thermistor-calibration.html <S> Obviously, this method only works if you have another 'calibrated' method of determining temperature. <S> Also, one major pitfall here is notice the graph of the 'typical' thermistor. <S> Notice values outside the curve would likely not be of value. <S> But in this case that exceeds 100 C. <S> Just note that it is important to choose a thermistor of appropriate value. <A> Another suggestion is an Op-Amp and 555 timer IC based circuit. <S> We use one op-amp for knowing that when does the temp goes over 30 and another to know when it goes over 60. <S> The circuit is shown below: The OP1_min output goes to high when the temp goes more than 30. <S> At this time if temp were below 60, the OP2_max will be low (or ground) <S> The Astable circuit will become active. <S> We should set the needed frequency (high and low time of output) by choosing R9,R8 and C1 from wikipedia . <S> If the temp goes more than 60, OP2_max output goes high and forced the output of the 555 to high. <S> and the Fan speed goes max. <S> OK, Now we just have to know the value of R1-R5. <S> the min voltage should be equal to sensor voltage when it is at 30 and the high voltage should be equal to sensor voltage when it is at 60. <A> If you throw enough current through a thermistor to drive a fan, you'll be self-heating the thermistor and screwing up your control. <S> I'd suggest splitting this into two or three problems sensing the temperature, using a low current circuit to generate a voltage related to temperature using this voltage to figure out how fast the fan needs to go actually driving the fan at that speed.
You need to calibrate the thermistor, which in short means taking measurements of the resistance (of your entire circuit including the thermistor and any added resistors at known temperatures). There are plenty of small and cheap micros with PWM generators built in.
High current, low voltage (~10v area) supply from standard 220v/10A outlet I have a few brushless motors and some ESCs (Electronic speed controllers) which expects a 2 or 3 cell LiPo battery. For testing purposes I would like to have a power supply that can drive the motors - with the ESCs - so that I don't need to charge the batteries all the time. I need 7.4v (2 cell) or 11.1v (3 cell) and it would be great to have 10A+. I want to keep down price, so can I make one myself? <Q> No, in your case you should simply buy one. <S> Jameco has a pretty good selection. <S> They probably have a model that produces the current you want at the required voltage. <S> Since you didn't say what either of those are, there is little more that an be suggested. <A> What you think you need is called regulated power supply. <S> It's main property is that the voltage output is regulated and it's supposed to keep it within range of values close to set output voltage even as the load changes. <S> Today very large number of power supplies are regulated, so <S> the usual assumption when talking about just "power supply" is that you're actually talking about regulated power supply. <S> Different types of regulated power supplies will have regulation of different quality. <S> For some purposes, very tight regulation is needed, but to power motors, there's no need to worry about how good power supply regulation is. <S> For motors, even a power supply with very bad regulation will do, as long as it can supply needed current. <A> Power supplies would really be better named power converters. <S> It sounds like what you have is a power supply that converts AC to 19V, but you need 12V, and you are thinking that converting from 19V to 12V will be easier, cheaper, or somehow better than converting from AC directly to 12V. <S> There are devices that will do this. <S> The simplest is a linear regulator, which will convert the excess energy from the excess voltage into heat. <S> This is not practical at your design current: a linear regulator would create \$ (19V-12V) <S> 10A = <S> 70W \$. <S> This is quite a lot of energy to waste, and simply keeping it cool will be hard. <S> There are DC-DC buck converters that can do this more efficiently, and this would be the solution if you had to power your device from 19V. <S> However, it sounds like the 19V supply isn't a hard requirement in your case, but rather you are assuming using it will be better. <S> This isn't really the case. <S> It doesn't matter if you are converting from 19VDC or 120VAC, the problem is the same: you need a power supply. <S> However, converting from 120VAC directly to 12VDC will be more efficient, and since 12VDC supplies are so ubiquitous, it will probably be easier and cheaper to find this supply than a DC-DC buck converter that meets your specifications. <S> You probably won't save much money doing it yourself, and it's much safer to get one that's been designed by an experienced engineer and been put through a safety certification process.
What you want is called a "power supply". I would further advise that you purchase, rather than build the 12VDC supply.
In USB, what is the difference between a PHY and a transceiver? I understand PHY to be the physical layer of the transceiver protocol stack. At the same time I understand that transceivers are devices that transmit serial data at a very high speed i.e >100Mbps. What I am not sure about is ICs that have PHY in their title and others that have Transceiver in their title. Here are 2 examples. One is a USB PHY while the other is USB transceiver. e.g http://www.smsc.com/Products/USB/USB_Transceivers/USB3280/Download and http://www.smsc.com/Products/USB/USB_Transceivers/USB333x/Download What is the difference between them? <Q> The terminology is vague at best. <S> There are no hard and fast rules, and nobody playing police when people don't use the term correctly. <S> Usually, but not always, a transceiver is a simple buffer that has different signal standards on the inputs and outputs. <S> For example, an RS-232 transceiver usually interfaces TTL signals to RS-232 signals. <S> Also, transceivers are similar to "drivers" and "receivers" except that a transceiver usually does both driver and receiver functions in the same chip. <S> With Ethernet it is MII/GMII/etc on one side and, well, Ethernet on the other. <S> There are other Phy's <S> that talk USB, PCIe, and many others. <S> Phys usually incorporate some sort of SERDES (SERializer-DESerializer) function and line encoding. <S> More sophisticated PHYs contain a mini-DSP in them to do all sorts of crazy communication things like advanced baseband wander correction. <S> A transceiver does not have to be associated with a serial data-- they can be used for parallel data as well. <S> A PHY usually involves some sort of serial data stream. <S> But this is more of a convention than a rule, and I am sure there are chips out there that are exceptions to this. <A> Electrically, they are similar devices. <S> PHY tends to be associated with protocols. <A> Talking specifically about USB, the terms "transceiver" and "PHY" are synonyms and are used interchangeably. <S> In all cases, some aspects of the physical layer are implemented by the controller, not the PHY. <S> This is the case for all PHYs: the full-speed ones with a serial USB interface, the high-speed ones with ULPI or UTMI, and super speed (USB 3_ with PIPE interface. <S> In all instances, the link state changes are marshalled by the controller. <S> The non-PIPE/UTMI/ULPI transceivers - those limited to full-speed USB (12MHz rate) - do not perform the serialization/deserialization either. <S> So the functionality is split roughly as follows: <S> Controller - physical layer link state control. <S> ULPI/UTMI/PIPE PHY or Controller when a serial FS transceiver is used - serialization/deserialization,. <S> PHY - Logic-to-bus level translation, equalization, drive/receive. <S> In practice, it doesn't matter since you'd use a PHY that matches the interface provided by the USB controller. <S> If the controller provides a ULPI or UTMI interface, you'd use an ULPI or UTMI PHY that does serdes. <S> If the controller has a serial interface to the transceiver (only for LS/FS operation), you'd use a FS transceiver with a serial interface (literally a TXD and RXD pair).
A Phy is similar to a transceiver in that there is usually different signal standards on "both sides of the chip".
DC-DC isolation for my car stereo... Where do I start? I recently noticed that my jeep's stereo whines with a frequency that seems proportional to the rpm of my engine (and alternator), and is louder when my headlights are on. If my stereo was powered by AC electricity it would be no problem to add an isolation transformer, but since I am working with DC I really don't know how to isolate the stero from the rest of my vehicle's power system. A quick eBay search came up with some small ICs that appear to be DC isolators but none of them exceed 1W - an I have a 200w stereo. How should I go about isolating my stereo from the rest of my Jeep's electronics? Alternatively, What if I were to add a huge cap in parallel with my car battery, would that help keep things smooth? If I used five of these 3V capacitors in series I would essentially have a 4F, 15v capacitor. Would that be able to prevent noise from my alternator and headlights from affecting my stereo? <Q> Headlights are DC. <S> So I'd guess that the alternator is noisy [under load], and your stereo is picking that up. <S> You could try beating the noise at the source, or focus on the stereo. <S> If you want to rip off & re-terminate your stereo DC plug, you could wind a couple of turns on a toroid [ring] core. <S> If playing with plugs doesn't appeal, try winding the DC cable around a ferrite rod. <S> Hold it in place with electrician's plastic insulating tape. <A> Your alternator generates noise on the power line. <S> Better car radios have internal filters for the power supply (a big choke and some caps). <S> You can also buy those filters separately (for example this one ) or just build your own - a big choke in series with the positive wire followed by a cap in parallel to the radio's power input. <A> Prevention is better than cure or so the doctors tell us so I'd be inclined to sort out the generator's noise rather than try and cure the amp. <S> As a last resort I'd filter the power to the amp. <S> I wouldn't want to isolate the amp if there's a radio because (from memory) the radio's antenna needs to be grounded and <S> isolation might cause more problems in that area.
I'd also look at the cables feeding the amp and if necessary wire then directly from the battery rather than let them share possibly contaminated current paths with other circuits.
Questions about reflowing solder on a motherboard One of my laptop's DIMMs is dead and working with less than my usual 8GB of RAM is brutal. Multiple sources suggest reflowing the board. I quite frequently tinker with/hack my electronics, but I've never attempted to reflow a board, especially whilst putting my beloved computer at risk. I have a few questions before I start: Temperature? I know it depends on what kind of solder alloy is used, but I don't know how to check it. Is there a de facto standard I can resort to? Time? Oven or heatgun? How come the processor (among its other chip buddies) don't burn out at 200°C+ temperatures while being (essentially) baked, but burn out when operating at near 100°C? Any advice you can offer on the basis of dramatic/entertaining anecdotal evidence of how this can all go terribly wrong? <Q> Heatgun with aluminum foil warped around the rest of the board loosely, to act as a heat shield. <S> You only want to heat the bad chip. <S> No need to reflow everything else. <S> If there is anything on the other side of the board, that might be an issue. <S> This is just based on what I've read, no personal experience on this. <S> The reason that the chips don't die when baked at a high temperature is because the temperature is external, and takes a while to transfer through the ic package. <S> Not only is the package designed for this in the first place (SMD/SMT was created for both size and ease of machine automatization. <S> It allows for simple reflow after using a pick and place machine, instead of requiring manual soldering), the reason high temperatures kill ics is because the internal junction temperature is too high. <S> Without proper cooling, the inside cooks itself. <S> It's the reverse of normal baking. <A> It's perfectly possible to reflow your motherboard, but you have to do it really carefully to avoid destroying it. <S> The reflow soldering process is designed to avoid these problems. <S> This is the temperature profile of a typical reflow soldering process: <S> (source: apemswitches.be ) <S> The idea is to pre-heat the whole board to a high, but safe temperature. <S> It is then held at this temperature for about a minute, allowing everything, even the insides of the chips to reach the same temperature. <S> Then the temperature is briefly brought up to the melting point of the solder, and then the heater is switched off, and the board is allowed to cool slowly . <S> Fast cooling will cause thermal stress, and can shear off solder joints, especially on large BGA chips. <S> This is what you should do: Pre-heat the board in an oven. <S> Try to raise the temperature fairly slowly, taking about three minutes. <S> Get a laser temperature probe, and check that the board is about 180ºC all over. <S> Now get your heat gun, and heat up the suspect component, taking care to heat it evenly all over. <S> Keep the temperature sensor pointed at it the whole time, and stop heating when you see the temperature hit 245ºC, or when you see the solder melt all over. <S> Put the board back in the oven, and switch it off. <S> Allow it to cool gradually, and take it out when it's safe to handle, about 40ºC. Your processor can operate reliably upto 80º <S> or so. <S> Above this it will not operate reliable, but won't suffer permanent damage. <S> Above the reflow temperature may cause permanent damage. <A> You definatley want to use a heatgun to remove the chip, the data sheet should give you the reflow profile if you use it to re-attach as well, if using an iron than try to use some flux and have some wick handy to handle any bridges. <S> this should be a pretty easy job theres really not much that could go wrong, chips are more resiliant than you'd think...
Several things can go wrong during soldering: thermal stress caused by different parts of the board being at different temperatures, and chips getting too hot.
How do I program a PIC12? I have a PIC12F675 that I need to program. I'm using a Pickit 2 and the Pickit 2 software. Supposedly I should be able to program it using this circuit , but the Pickit 2 software is not detecting the chip at all. What's going wrong? EDIT: I've added an image of my circuit breadboarded out. And here is where you can find the datasheet for the PIC12F675. Skip to page 4 for the pinout. EDIT2: I just actually looked at the chips (dumb, but I kind of assumed mouser would send me what I ordered), and I noticed they're actually PIC12C671's. How much of a difference would this make? Final EDIT: Wow! Thanks to everyone that helped me with this! I was not expecting this kind of response. It ended up being a small stupid problem just like I thought it would be. It was my fault for not double checking everything when I received the package from Mouser. <Q> A possible problem is that some PICs need a power-cycle to get into programming mode. <S> The 12F675 in particular needs this when the configuration word in your application configures the MCLR pin as GPIO. <S> When the pcikit2 powers your target chip it will provide the power cycle. <S> With the independent +5V you supply it can't do this. <S> After covering the most probable problems you might go for the improbable ones... <S> Don't laugh at me, I am drawing on my own experience! <S> could you have two pickit2's connected? <S> (Yes, I once did this and was flabbergasted that the one the pickit2 application selected was not the one the PIC was connected to. <S> I hve also once wasted an hour when I had two target PICs wires in parallel. <S> That gives very strange results when they both put their chip ID out to the programmer. ) <S> is the pickit2 you are using connected to the PC you are using? <S> (I do PIC classes and the students can get quite creative in who's laptop connects to who's PIC) <S> are both the pickit2 and the chip <S> the right side round? <S> The pickit2 pciture is as seen from above (where the button and LEDs are). <S> is the chip really a 12F675? <S> (I once tried for full day to get the A/D converter of a 12F629 working - for the non-PIC-guru's: that's the cheaper brother of the 12F675, it is cheaper because it does not have an A/D converter ). <S> Are the wires exactly as you show them, not mixed up? <S> And are they not by any accident broken? <S> If you are using a solderless breadboard: does it still make all the contacts? <S> Is the firmware in the pickit2 a version that matches your PC side? <S> maybe re-load the firmware to be 100% sure. <S> In response to your EDIT2: <S> ROFL, check my bullet 4. <S> The PIC12C671 is a totally different chip, and the C means it is an EPROM (one-time-programmable) chip, which is not supported by pickit2. <A> The PICkit2 programmer should work as-is for your part without any headers. <S> (Debugging is another matter altogether.) <S> As well as the decoupling capacitor advice that was offered, consider this: most (all) PIC devices need a 10k pullup from _MCLR to VDD. <S> Try adding that and see what happens. <S> Here's a wiring example from the PICkit3 setup poster. <S> (The pinouts of the PICkit2 and PICkit3 are identical, so the information is 100% relevant.) <S> You can see that the programmer's pins 1 through 5 need to be connected to your circuit. <S> Your schematic is missing the VDD Target connection from pin 2. <S> Try connecting this and allowing the PICkit2 to power the circuit. <A> This means there is something wrong with your setup. <S> There are some things you can check: <S> Is there a problem in the communication with PICKit? <S> No, if this would be the case, you would get an error that the ICSP tool couldn't be found. <S> Is there a problem with the circuit with the chip? <S> Possibly . <S> You should check your circuit, add decoupling capacitors if not done yet. <S> All VDD and VSS pins should be connected, also those of the ICSP connector. <S> Also, check your power supply: is it smooth? <S> Is there a software problem? <S> Most likely , I'd say. <S> Have you selected the right chip in MPLAB? <S> Can you program other chips with the same setup?
PICKit2 does support your device ( source ).
Does it exist: Latching Relay with Manual Switch I'm looking for a latching relay (so I can control its state remotely) with a manual switch (preferably with a rocker style switch, so I can control its state locally). Do these exist as I'm struggling to find one? Thanks <Q> If you can't find one, consider the option of having a local switch. <S> Wire it in like you would the light-switches at the top and bottom of a staircase. <S> Whatever the state of the switch at the bottom of the stairs, the switch at the top can always activate and deactivate the light. <S> Now,.... who knows how to convert it to a local with two remotes? <A> I looked for something like this a while ago. <A> The closest I can think of is the "NVR Switch" built around a relay, commonly used in machine tools. <S> One green button to start it (energise the relay, which then drives the load and holds itself on) and a big red button to stop (breaking the relay coil circuit). <S> It's normal to take at least the "STOP" switch connections to remote locations, to allow emergency stop switches in obvious places. <S> It's deliberately NOT a latching relay so that it also switches off when power fails - the last thing you want is for unattended machines to restart when the lights go back on!
Doing a quick search, look at things like the HFE10-2 also keep in mind that depending on the type of switching you are doing, it doesn't take a lot to create a local trigger that delivers the same switching current to the relay with just a local spst button
How to syncronize two motors with one pot? I am trying to synchronize two dc motors with their own controllers. The controllers are name brand and use a 10k pot to control the speed. I have a duel 10k pot and would like to be able to "trim" one of the motors to stay in sync when the speed is changed. First, I tried adding a second 10k pot in series with one of the sides of the duel pot, one lead to the wiper, one to one side. That didnt seem to do anything. Then I wired the second pot in parallel with one leg of the duel pot using all three leads. This kinda worked, the two motors changed speeds together but if I synchronized them using the second pot then changed speeds for both motors with the duel pot the two motors were no longer in sync. The purpose of all this is to run an accessory with a conveyor belt. I would like the teeth of a gear like part to run at the same rate as the conveyor underneath it. I was going to do it mechanically using one motor but for a couple reasons it would be great to do it with two and not have to manually sync them every time the speed is changed.Thanks in advance!Philip <Q> I doubt this will get you the results you desire. <S> What you need is often called Electronic Gearing. <S> The Wikipedia page on Motion Control describes it briefly. <S> Put <S> simply, Electronic Gearing requires a position control loop on one motor, slaving it to another on the basis of position. <S> The master motor runs in a speed control loop and the slave motor runs in a position control loop using the position of the master motor as input. <S> As a result, the slave motor appears to track the position of the first motor independent of speed or load. <S> You didn't post a link to the datasheet for your motor controllers, but I'd start by determining if they support it natively; many do. <A> You would likely need a large number of trim points, which makes any non-microcontroller solution impractical. <S> You want to operate the two motors in lockstep, presumably over longer periods. <S> I seriously think that DC-controlled motor controllers can be used to do this. <S> There will always be an inaccuracy somewhere, so one motor will run slightly faster than the other, which will accumulate over time. <S> I would start searching for motors with encoders (or stepper motors) that can really be slaved to each other. <A> Are the individual motor controllers setup for torque compensation - this will keep a DC motor's speed fairly constant across a decent range of torques. <S> In case anyone is wondering, the compensation makes use of the current taken by the motor (which obviously varies with loading) and applies a fractionally higher DC voltage as current rises. <S> If you are trying to sync the speeds this is probably quite important because I can't tell from your words whether the loading between them varies much and if it does you'll need to have them torque compensating to stand a prayer of keeping them in sync. <S> I can't offer much else other than go for synchronous DC motors but these are probably outside most folks hobby budget.
You are trying to synchronize the motors on the basis of the input to their velocity loop. It is not difficult to make a circuit that allows you to trim one motor a little bit with respect to the other, but there is no guarantee that the trip which is OK for one speed will also work at another speed.
What can cause a Drain-Source short in a FET? Background: I am using a Si7456CDP N-channel MOSFET in a switching power supply. The power supply and load are housed in a plastic enclosure. Yesterday, the power supply and load were working perfectly. This morning, when I came to power it on, nothing worked. No power. Eventually, I discovered that the MOSFET's source and drain had shorted together. Replacing the MOSFET fixed the problem. Question: What could cause an N-channel MOSFET to suddenly fail with a source-drain short? <Q> There are two principal mechanisms but first a diagram: <S> Body and source are tied together, and several features are removed for simplicity. <S> Scenario 1: <S> Over voltage spike on Drain, causing filaments and the contacts and drain implants to be spiked. <S> IT may or may not have causes the contacts to fail/melt but very high currents can cause breakdown of the D/B junction. <S> Once the junction is spiked it is connected to the well drain and source are now shorted. <S> This only requires breakdown at one location in the transistors Scenario 2: <S> HIgh voltage on drain, causing EOS (Electrical Over stress) on the GOX (Gate Oxide) particularly on the gate nearest the drain. <S> Very likely this is a LDMOS structure with an extended drain structure (which means the gate voltage need not get to the same voltage as the drain ever). <S> Breakdown at that end of the gate can cause the gate to short to drain. <S> Once it is shorted, it now is essentially on always, but also, the gate now gets driven to levels it wasn't intended to be at and the failure runs away. <S> THis still only requires one fault in the transistor. <S> There are other scenarios but they all require two faults. <S> This device is fairly large and will be visible under a microscope. <S> De-lidding this might be instructive. <A> That is actually a MOSFET. <S> Drain-source shorts are the usual failure mode in MOSFETs and are usually caused by transients on the gate. <A> (Sometimes the die blows itself to smithereens.) <S> This includes: Excessive over/under voltage at the gate Poor / improper gate drive causing thermal runaway Thermal runaway in general (loss of cooling / forced air) <S> Avalanche-induced EOS <S> Without more specific application information, it's hard to judge which mode could be the culprit.
Anything that damages the die could lead to a drain-source short.
Why JFET is called a voltage controlled device while BJT is called a current controlled device? Why are JFET/FET called voltage controlled devices while BJTs are called current controlled devices. Both require a voltage to operate properly. In both an electric field is produced so what is the difference? Now the question is that current is also generated due to voltage and still BJT is current controlled and FET voltage controlled. <Q> Because the base-emitter voltage of a BJT in its operating region will be affected by base-emitter current, and vice versa, changes to the base-emitter voltage of a given transistor will affect the collector-emitter current. <S> On the other hand, the amount of base-emitter voltage change required to affect a given collector-emitter current change is often huge and unpredictable; it will vary enormously with temperature, aging, the phase of the moon, etc. <S> By contrast, within a transistor's "linear" operating region, doubling the base-emitter current will roughly double the collector-emitter current. <S> Not absolutely-precisely double it, but pretty close. <S> Such behavior is far more predictable than the relationship between base-emitter voltage and base-collector current. <S> A FET or MOSFET by contrast doesn't have any gate current except for currents resulting from leakage or stray capacitance. <S> Those currents aren't exactly zero, but manufacturers generally try to minimize them. <S> As such, it's not really possible to characterize the transistor's response to different levels of gate current. <S> The relationship between the gate-source voltage and the drain-source current isn't nearly as predictable as the relationship between base-emitter current and collector-emitter current in a BJT, but it's a still apt to be the most predictable way to characterize the device's operation <S> (it's a lot more predictable and consistent than the comparable relationship on a BJT). <A> The statement is wrong. <S> Both devices are voltage-controlled. <S> The accurate model for a bipolar transistor is the Ebers-Moll equation. <S> Note how the independent variable in the Ebers-Moll equation is: <S> \$V_{BE}\$. <S> Not base current! <S> A BJT is a transconductance device, just like a JFET. <S> The idea that a BJT amplifies current is a feature of the approximate model which can be used to design the majority of simple BJT circuits. <S> A particular simplification/idealization of the BJT is a current device, not the real BJT. <S> It just does not work that way. <S> There simply isn't a little demon in the base which counts electrons moving through the base, and dispenses \$\beta\$ <S> times that many electrons into the collector. <A> What this means in practice, is that if you have a voltage source can source very little current (such as your finger, after you've dragged your feet across a carpeted room to build up some static electricity), you can use this signal to control the FET, but not a BJT. <A> BJTs require more current, because of how it works, collector-emitter current is proportional to the current from the base. <S> Both use tension and current, but the impedance of FET are so high, and the current that they need to control is so low, that you only need a tension over the gate to do the control. <S> Thats why FETs are considered tension controlled devices.
In BJTs, the emitter current is proportional of the base current (this is the hFE value of the BJT), while in FETs the source/drain current is proportional to the gate voltage . In very simple words and no maths involved: FETs in general, source-drain current is controlled with a very little current from the gate.
9V to 5V regulated or 6V to 5V regulated? Which one is more efficient? I have a choice of choosing 1x 9V Duracell battery or 4x AA Duracell batteries. I want to regulate the voltage to 5V with a 7805. From what I understand, the voltage regulators just converts the unwanted energy into heat to reach the regulated voltage. My best guess for efficiency is using the four AA batteries, less wasted energy and higher mAh. Should I be looking into the drop off voltage for these different power sources? My application is to power a MCU while data logging without having to change the batteries often. It would be best to have the highest mAh option, but with a maintained voltage. Is there somewhere I can look to obtain more information on this? Or could I be enlightened? <Q> Neither is a good choice. <S> As you say, the 9 V battery will be quite inefficient. <S> 9 V batteries are pretty poor in terms of energy density, and then you're going to waste 44% of what you do get in the regulator. <S> If you do go that route, you need a LDO (low drop out) regulator. <S> There are plenty available that can regulate 6 V down to 5 V. <S> The efficiency is decent enough with the 4 AA batteries (83%), but the problem is that you won't get the full life from these batteries. <S> Even a LDO needs some headroom to operate, figure 300 mV roughly, although you need to consult datasheets for the real figures. <S> That means your 4 batteries must supply at least 5.3 V, which is 1.33 V per cell. <S> There is still significant energy left in a normal AA cell at 1.33 V. <S> The energy you do get will be used efficiently enough, but you'll leave a lot in the battery. <S> So what to do? <S> There are several options: <S> Don't use 5 V. <S> Why do you want 5 V anyway? <S> Modern microcontrollers run from 3.3 V, and so does most other circuitry you connect to it. <S> These also tend to be more efficient in terms of computes/Joule, so you win on that account too. <S> Use a small switcher. <S> There are various small switcher chips intended for exactly this application. <S> Microchip makes some nice ones I've used a few times, but I don't remember the part number off the top of my head. <S> Check their selector guide. <S> With a switcher, you don't have to match battery voltage and circuit voltage anymore. <S> Now you can use 2 AA, which still contain more energy than one 9 V battery, you can use their energy efficiently, and you can suck them totally dry. <S> This together with a 3.3 V circuit would be the best approach from a power standpoint. <S> I have done this myself a few times. <A> As you stated, the 7805, a linear regulator, turns a higher voltage into a lower one, with the difference being dissipated as heat. <S> It is not very efficient, especially with higher voltages. <S> A switching regulator is much more efficient. <S> As for using 4 AAs, assuming Alkaline 1.5v cells, and not NiCD/ <S> NiMH <S> Rechargeable 1.2v, you would have 6 volts. <S> 6 Volts is not enough for the 7805. <S> A better option would be a comparable LDO (Low Dropout Regulator). <S> You would want/need one that has a drop-out (Minimum required voltage difference between input and output) of less than 1 volt, because you also need to consider the batteries draining down to 5.6v (0.1v per battery) or less after some usage. <S> But the better question is, do you need 5v? <S> 4 Rechargeable 1.2v Batteries give 4.8V, which is within most 5v ic operating range. <S> Or use 3 regular batteries for 4.5 (or 2 for 3v) if your IC/Microcontroller has a wider input range. <S> You might not even need a regulator, depending on your setup. <S> The other option would be powering your 5v microcontroller from 2 batteries (3v) by using a step-up regulator, many which have 75 to 90% efficiency. <A> The 7805 needs 7 V or so input to regulate properly, which you won't get from four AA cells. <S> An LDO regulator would be more sensible. <S> I'd use the AA cells rather then a 9 V battery, they will last much longer. <S> Many modern MCUs don't need a regulator (it wastes power) and can run from two AA cells. <A> When choosing batteries, one should strive to have an input voltage which, for the life of the battery, will either always be above or always be below the target voltage. <S> If you use a good switching-power-supply chip (and associated components) <S> you will get vastly better efficiency than with a 7805. <S> If you need five volts, using a 9-volt battery with a decent switcher will allow you to run until the battery is basically depleted (0.9 volts per cell). <S> If you're thinking about a 7805 for reasons of simplicity, you should consider instead using a three-pin switching-power-supply module which is designed to drop into places that would normally use a 7805. <S> The 7805 is pretty well obsolete for just about any purpose; even if you want something simple and cheap, using some other linear regulator would probably double the life one could get from a 9-volt battery before a +5 supply started to sag; a switcher could probably extend things even further.
4 AA into a 3.3 V LDO is less efficient at making the final target voltage, but you'll probably need less current and you'll be able to drain the batteries to their end. 4 AA batteries will make about 6 V at best, which is well below what a 7805 regulator requires as input to make a reliable 5 V out.
What does "no fit" mean in electronics? I have found at some places, especially: Raspberry Pi Forums eLinux RPi Hardware page the following wording: S2: DSI interface. 15-pin surface mounted flat flex connector (possibly no-fit) S5: MIPI CSI-2 interface. 15-pin surface mounted flat flex connector (possibly no-fit). P2: 8-pin 2.54 mm header expansion (header not fitted on Revision 2.0 boards), providing GPU JTAG (ARM11 pinout, pin 7 is nofit for locating) For a non-English reader this is not 100% clear. Could you please tell me what it means? <Q> This must be British. <S> For them "fit" means something like what we would call "install". <S> For us, "fit" means how well something fits, meaning how good it is at mechanically going into the right mounting holes or whatever, or how effective it is overall in the role it is being used in. <S> This is often done when a part may be useful for original testing in the lab. <S> Once the product has been verified, the part is of no use anymore. <S> Instead of respinning the PCB, you leave the pads there but just not install the part during manufacturing. <S> The same PCB can be used to build different variants of a product depending on which parts are installed or not. <S> In one case I had a product that was to be sold with either a RS-232 or CAN interface. <S> Since space was tight, I re-used the PCB area for the CAN driver chip and the RS-232 chip. <S> The pads of the two chips sortof overlapped such that only one could be installed at a time. <S> There were some other parts that had to be installed or not depending on the variant being built. <A> Other common terms used are "no placement" (NP) or "do not place" ( <S> DNP) but <S> "no fit" would fall into the same category. <S> It means the circuit board (PCB) has pads where a connector may be placed, but when you receive the board it won't have a connector installed. <S> It will be up to you to source the connector and install it youself if you require it. <A> "No fit" is an instruction from the designer to the manufacturer: do not fit this component. <S> It means the connector won't be there but can be fitted later.
In this case "no-fit" means "do not install".
Difference between RTL and Behavioral verilog Can someone tell me what is the difference between RTL and behavioral Verilog code? Is there any clear cut demarcation between designs at these two levels? <Q> Behavioral code is higher-level and usually can't be synthesized. <S> Constructs like loops, delays, and "initial" statements are behavioral. <S> RTL code is lower-level and is intended to be synthesized. <S> It defines a circuit as a combination of interconnected registers and the operations performed on signals between those registers. <S> Taken from Yahoo Answers and found immediately with Google! <A> "Register transfer level" code is code described in terms of registers and combinatorial logic that sits between them and intended to be used as input to a synthesis tool. <S> The code sticks to a synthesizable subset[1] of the language. <S> There are no explicit delays, all timing is in terms of clock edges. <S> Structures representing level triggered latches are generally avoided. <S> Registers are typically clocked off a small number of clocks whose details can be given to the timing analyser. <S> The combinatorial logic is usually expected[2] to settle within a single clock cycle which limits it's complexity. <S> It's higher level than a gate level model <S> but it still defines what value every register has on every clock cycle. <S> but it not intended to be synthsizable. <S> It may be used to describe the environment surrounding your design in a simulation. <S> It may be used as an early step in a design to get the overall design in place before detailed RTL design of the individual modules is overtaken. <S> [1] <S> The exact subset allowed varies between synthesis tools. <S> [2] <S> If it doesn't settle within a single cycle than simulation and synthisis may give different results and the timing analyser will show a violation unless it's explicitly told not to. <A> A more generalized definition. <S> Behavioral Code: <S> By definition it defines the behavior of a digital component. <S> It does not give information how it will be implemented into actual HW (synthesis). <S> It will not give information how registers and gates will be implemented to perform required operation. <S> It is more like writing an algorithm or FSM in C. RTL: It is more precise form of a digital component. <S> It gives information, how code will be implemented as actual HW (after synthesis). <S> Also it gives information how data will be transferred between registers and gates. <A> It's the same language, but different styles are used. <S> With experience you can tell them apart quickly, here's a few traits of each: Behavioural verilog code generally looks more like a sequential computer program running from top to bottom within an initial begin block. <S> You may find there are no input/output ports defined in top level behavioural modules, since the output may be to simulator facilities, like the console $display() or filesystem with $open or waveform dumper with $dumpfile and $dumpvars . <S> Watch for delays between statements implemented using long simulation time waits <S> e.g. #4000 and invoking tasks wishbone_master.checked_read(addr, value) . <S> For these higher level constructs is it not obvious what the synthesised technology equivalent would/could be. <S> Verilog for synthesis always has input/output ports, as without connected ports the module has no side effects and can be eliminated [1]. <S> Delays probably implemented by counting cycles of some particular clock. <S> Note some Verilog system functions e.g. $clog2(PARAMETER) <S> may be permitted in code for synthesis, so the presence of $function is not a guarantee either way. <S> Code for synthesis tends to comprise many of independent 'processes' each with a sensitivity list. <S> Some technologies do permit initial begin blocks for memory initialisation so again that is not a guarantee. <S> Ultimately the designer knows the purpose of the code they write and will appropriately invoke it with the synthesis toolset or in a simulator. <S> [1] except for certain IP blocks which may make back-door connections to internal chip facilities, e.g. JTAG
"behavioural" code is generally code that describes behviour at a higher level for use in a simulation
From C to Silicon: How to implement software/firmware solution as hardware? In light of this question, I was wondering if there was a fairly standard process for turning a software solution into a hardware implemention. Forgive me and my imagination, but would there be a compiler that could take a C program and compile it in terms of a schematic of transistors, resistors, etc. or maybe even well-known PCBs? I realize that I could be looking at this scenario from the wrong perspective. Historically from my own experience, typically you have some piece of hardware that somebody has implemented as a software solution (think hardware emulation). Does this concept in reverse even exist? How do these bigger companies do it such as software vs hardware IP routing? <Q> No, there is no standard solution for turning software into hardware. <S> Generally speaking, taking software that was not written with a hardware implementation in mind <S> cannot be easily converted into hardware without huge waste and inefficiencies. <S> Usually, the best thing to do is just make a chip that has a CPU and ROM-- and put the software in the ROM. <S> Over the years there has been compilers that would take "C-Like" code and compile it into hardware-- much in the same way that VHDL or Verilog can be compiled into hardware. <S> But the key thing is that it is "C-Like", and not C. <S> You still cannot take, for example, a C/C++ program that calculates PI and magically convert it into hardware that calculates PI. <S> Most of these C-Line languages have gone away, or is not used in any numbers. <S> One of the more popular versions of this is SystemC , but it is important to note that it is not C/C++ and is not useful for generic "let's write software and then compile it into hardware". <S> You still need to "write some hardware, that also might be compiled into software". <S> Switches and routers typically have hardware the does most of the commonly used and speed critical router functions (Looking up stuff in routing tables, managing queues, etc.) <S> in hardware and then use a CPU to do all of the not-so-common functions (handling exceptions, errors, routing table updates, etc). <S> In many ways this is similar to how modern CPU's work, where the most common opcodes are done in hardware and occasionally some opcodes are actually implemented in software (for example, floating point instructions when an FPU is not present). <A> The closest thing would be Altera's C-to-Hardware (C2H) Compiler . <S> It can do some of what you're suggesting. <S> But there are defiantly caveats. <S> But specific functions work rather well and you can see a dramatic increase in performance. <S> Typically you would implement a NIOS II softcore processor into an Altera FPGA. <S> You would then write some ANSI C code for it like you would any other processor. <S> Then say one of the C functions you've written involves some heavy math that would benefit performance-wise from some parallel execution. <S> Here's <S> an example of coding a Mandelbrot computation in ANSI C and then implementing it in hardware: <S> The C2H compiler-accelerated Mandelbrot algorithm results in a speed improvement of at least 60x <S> compared to the same algorithm running on the fastest Nios II processor using compiler optimization level 2 (-O2). <S> This speed increase is because of the parallelism and fast iteration speeds that hardware can provide, which are not possible from a general-purpose processing unit. <S> Going back to your example, the NIOS II processor can run Linux. <S> And certain functions that would be necessary to perform routing tasks could benefit from hardware acceleration. <S> It would most likely perform better than a pure software router. <S> But it will never approach the performance of specially designed dedicated ASICs. <A> You mention "C to Silicon" in your title and mention board level products in the body. <S> I'll just focus on the part of that equation that does exist -> <S> "C to Silicon" design flows. <S> C in itself is not a natural fit for the description of hardware as it lacks some fundamental support for the inherent parallelism of hardware, the need to prevent race conditions and other issues, and it's not notably expressive in being able to represent these concepts. <S> Or not nearly as much as Verilog and VHDL are. <S> C code that is synthesizable (i.e. can be rendered to a hardware description) and here hardware = digital logic, wouldn't win any coding contests judged by software developers. <S> Here is a list of some notable vendors <S> supply <S> C -> <S> Silicon tools for the ASIC flow crowd. <S> Forte Cynthesizer Mentor Catapult BlueSpec C Synopsys Synphony (ex- Synfora) Cadence C-to-Silicon <A> Turning software into hardware is not a completely trivial task if you expect reasonable hardware. <S> Hardware tends to need more architecting to carefully manage resource usage which relates to area/cost. <S> Having said that, there are a number of tools that take C in some form, allow you to add hardware specific information (for instance, what is the hardware interface?), and generate optimized hardware. <S> Proficient users can easily get better results in less time than hand coded RTL.
You invoke the C2H compiler, say "Implement in Hardware" and it essentially turns that function into a peripheral of the NIOS II softcore processor. You can't turn just any C code into hardware, nor would you want to.
how to automatically reverse the direction of a stopped gear motor and restart 12 hours later The reversible gear motor needs to turn on @ 6:00 am pull a object 12 inches and shut off. Twelve hours later the gear motor needs to turn on and reverse the direction and place the object back in place. A timer would turn the motor on and a contact switch would turn it off but how would you get it to reverse direction and stop it at starting point? What other pieces of equipment are required and how would it be wired. The object being moved would be connected to a chain. The object could also be connected to a actuator? <Q> Ah, the old chicken coop door circuit. <S> I've linked to this so often on various forums, I wonder if I should just commercialize it and get it over with ;-) <S> The relays are connected in such a fashion that activating one causes the motor to run in one direction until it hits a limit switch. <S> The limit switch disconnects the relay coil and stops the motor. <S> Then when the other relay is activated, the same thing happens in the other direction. <S> The activation is done by two timers that provide contact closure outputs. <S> The inputs are "move door LEFT" and "move door RIGHT"I first posted this design to www.backyardchickens.com about four years ago. <S> I haven't built it myself, but the people who have say it works quite well and is simple enough for a non-technical person to understand. <S> Hope I described it well enough to understand. <A> Garage/Industrial doors open when you press a button and if you walk away they stop at the required point. <S> If you press open when they are open they do nothing. <S> Should you then press "close" <S> they start to close and whether you are there or not they close and stop. <S> This involves "knowing when to reverse the motor", "knowing when to stop" and "ignoring illegal commands". <S> Instead of the "open" button you had a timer that triggered at 6am. <S> Instead of the "close" button you had a timer that counted 12hours from the open time. <S> Look up garage doors <A> (In addition to what @Andy aka said:) In general you could do this in one of two ways: Open loop. <S> This is where you assume that the motor is doing what it is supposed to do, but you don't check. <S> Closed loop. <S> In this configuation you have sensors that provide feedback to the system. <S> So if you know that your motor will move your object 12 inches if it is turned on for 120 seconds, you could use an open loop. <S> As @Kvegaoro implied, with DC motors, generally you just reverse the polarity to make them rotate in the opposite directions. <S> However, what you probably really want is a closed loop system: the motor is turned on by a timer (or a microcontroller), and some sort of switches (mechanical, optical, or otherwise) tell you when the object is in position so that the motor is shut off. <S> EDIT A : <S> The usual type of circuit to control the direction of a motor is called H-bridge or "full bridge". <S> EDIT B : There are two ways to go: a circuit with a central brain, and one without. <S> The former might look something like this (under the assumption that your sensing switches are normally closed). <S> The timer would reverse the direction of the H-bridge output ever 12 hours. <S> The diodes are there so that once a switch is tripped, the motor is still able to go in the other direction. <S> You'd probably want flyback diodes there somewhere, given that the motor is an inductive load, but this is just a general sketch. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> Myself, however I would probably use a microcontroller or an Arduino: this will give you much more flexibility as to how the system is configured. <A> I'd suggest a stepper motor. <S> This way, you can command the motor to turn an exact amount (revolutions and fractions of a revolution) in either direction. <A> I would take an arduino, some relays boards and a real time clock (a chip). <S> Easy to do with relais.
The simplest way of doing this without involving electronics is to use two single pole double throw relays as an electromechanical H-bridge and two normally-closed limit switches that stop it when triggered. The reversing of the engine is done by reversing the polarity.
If watts is power and amps is current, what is volts I know power is measured in the terms of watts, current is measured in amps, so is there an X for voltage? <Q> A Volt is a Joule per Coulomb: <S> \$V = J/C\$. <S> The voltage between two points tells us how much energy each electron will gain or lose when it moves between those two points. <S> The separation of opposite charges stores energy. <S> If we separate charges such that there is one volt between them, that represents less energy than if we separate the same charges such that there are two volts between them. <S> And of course we store more energy by separating more charges at the same voltage. <S> This is why power is related to both current and voltage. <A> power is measured in <S> watts current is measured in amps <S> electric potential is measured in volts <A> \$1V=\dfrac{1J}{C}\$ \$1A=\dfrac{1C}{s}\$ <S> \$\therefore <S> P= <S> IV=\dfrac{C}{s}\dfrac{J}{C}=\dfrac{J}{s}=W\$ <S> Any of the different formulas for power can be derived using these relationships. <A> Victorian textbooks had an excellent take on this, introducing electricity for engineers more used to hydraulics or steam... <S> Power is the equivalent of hydraulic power; Current is the equivalent of current; and Voltage is the equivalent of pressure. <S> In fact up until about the 1920s you will see textbooks talking about "electrical pressure, measured in Volts". <S> It is a really good analogy in that the concepts translate perfectly, and really make understanding the difference between voltage and current, and how circuits work. <A> Voltage is an electric potential energy difference. <S> Think of it like gravity but for the force between electrons rather than the attractive force between two objects with mass. <S> Google defines it as The SI unit of electromotive force, the difference of potential that would carry one ampere of current against one ohm resistance.
Voltage is the difference in energy between two points in an electric field, expressed per unit of charge .
Fet is named field effect transistor,why? FET is named Field Effect Transistor while field effect is also producing in bjt. What are the factors/reasons that FET is called field effect while bjt is not? I have read textbook but it didn't explain it. <Q> A electric "field" is produced whenever and wherever there is a voltage difference. <S> Actually the field is always everywhere, but becomes non-zero when voltage differences are non-zero. <S> Since non-zero voltages are fundamental to how every electrical device works, all such devices can be said to work based on or somehow related to the "field". <S> Field effect transistors (FETs) work on a pricipal that uses the field produced by the gate in a way that makes the channel conduct more or less. <S> In bipolar transistors, the current that can be carried between the collector and emitter is modulated by the base current. <S> Of course there are electric fields inside a bipolar transistor. <S> It's a naming scheme, which is not meant to be a detailed description of how the device works. <A> The value of drain current from the source can be controlled by the potential applied to the gate i.e. the electric field b/w gate and source. <S> That is why such transistor is known as F.E.T. <A> For the FET an electric field is established by the charges present, which control the conducting path of the output circuit without the need for direct contact between the controlling & controlled quantities. <A> Bipolar transistors are so named because they conduct by using both majority and minority carriers. <S> The field-effect transistor (FET), sometimes called a unipolar transistor, uses either electrons (in N-channel FET) or holes (in P-channel FET) for conduction. <A> You are correct. <S> There are fields inside of a BJT. <S> The fields are not what is driving current. <S> Current is actually delivered by the diffusion of minority carriers in the device. <S> The fields in this case just ensure that the carriers go the correct direction across the junctions, and only effect how they cross junctions, nothing else . <S> (But not always and there's some more fuzzy math to go around, taking into account tunneling and other quantum effects. <S> However, that's way out of scope.) <S> Where as in FETs, the field either creates (MOSFETs) or removes (JFETs) <S> a region with majority carriers that acts as a conducting connector. <S> How conductive this region is, effects the current. <S> So the current is directly dependent on the strength of the field. <S> Thus the electric Field Effects the transistor.
The FET was named such because the of how the static field, as apposed to current, plays a central role in the operation of the device.
Programs resistant to hardware issues I recall at one point reading about embedded development where the programmer took into account things like memory corruption and possibly other hardware issues. For example: If an instruction in memory is somehow corrupted, the program would run correctly anyway. If the value of some variable in memory is changed, the program will still produce the correct result. Dealing with #2 seems like a reasonable application of error correcting codes, but #1 seems to me like it would be very difficult. Does anyone know of any references or examples of someone doing that in software? <Q> There are various techniques to reduce the problem like the ones you mention, but there is no 100% solution. <S> Memory corruption can be corrected by error correcting (ECC) memory, at the cost of extra memory and the correcting hardware itself (which causes extra delay). <S> In some cases you must take care to access all memory regularly to prevent single-bit errors to develop into (uncorrectable) multi-bit errors. <S> Sensors are often a source of problems. <S> Reading multiple values and averaging and/or throwing out the outliers helps. <S> Processors can fail, and software can contain bugs. <S> The space shuttle is a famous example of multiple processors (not all of the same type!) and software written by independent sources. <S> Arbitrating between processors/programs that claim different results can be tricky. <S> In most cases an occasional problem can be tolerated if it is detected and handled in a safe (or otherwise satisfactory) way. <S> This can vary from halting the system to offering degraded performance. <S> In practice you will have to assess which problems are likely to occur, and then find ways to handle those problems. <S> There is no catch-all solution. <A> This isn't exactly what you describe, but there are several techniques for forcing embedded systems to reboot when something unexpected happens, after which they hopefully will run correctly. <S> A watchdog timer is a circuit that reboots the processor if the timer does not get reset by a software instruction every so often. <S> This adds protection against the program getting into an infinite loop, getting stuck waiting for a peripheral, etc. <S> Filling unused program memory with instructions that cause a reboot (or a jump to a location that does that) will help if the processor somehow jumps to those addresses. <A> The only way I could think of to implement #1 is to continually CRC the program memory against a known value and if it fails the CRC check retrieve a known good copy of the program from another source. <S> There's many gotchas to this: the stored CRC value might get corrupted somehow or there may be no 'other source' of your program readily available - user intervention might be required. <S> Also, since the corruption might be anywhere in program memory it might affect the CRC code so it doesn't run or the bootloader <S> so it won't function (you can go as far down the rabbit hole as you like in this regard). <S> You could combine the CRC check with a watchdog timer or external health monitor such that if the CRC code fails to run or fails to produce the correct result the microcontroller will reset and run a special recovery bootloader instead of the application. <S> What the recovery bootloader would do depends on your application: it could somehow alert the users that a new program load is needed or if you designed for it attempt to retrieve a pristine copy of your program from external memory if available. <S> The same rabbit hole as above applies <S> : how do you know that the external memory hasn't been corrupted? <S> Or, if the CRC is corrupted your program would be right but always fail the check. <S> At some point your device can't handle this type of error by itself and if you want the thing to keep running you'll have to bring a development system and programmer to it to bring it back up. <S> This type of scheme will probably add a few 9's to your reliability though even if it's not perfect. <A> There are two techniques that I know ,used in this <S> are of studies Virtualization. <S> Fault torrence computing. <S> [http://en.wikipedia.org/wiki/Fault-tolerant_computer_system] <S> There may be more techniques in the industry that I don't know. <S> Feel free to complete the list. <A> As metioned in other answers there are dedicated HW solutions (such as ECC memory). <S> I've seen several approaches to try and deal with corrupt/failing memory through software: <S> Write each memory block with a CRC/hash/checksum so that you can detect if a bit were erroneously changed or a memory cell went bad. <S> There are also special schemes designed to not just detect bad data (bit errors) but also correct it by introducing redundancies ( Reed-Solomon Error Correction for example) which will allow you to read back the data correctly, even if part of it is wrong. <S> If memory is on the edge of going bad, it will show most at boundary cases (low voltage for example). <S> If the memory is on the edge of corrupt, sometimes it can be detected before it fails if your read-back pattern doesn't match you test pattern. <S> These are just a few ways that software can avert/detect corrupt/failed memory locations.
You can test for memory locations which are about to go bad and mark them as unusable by programatically lowering the memory voltage to just above the lower operational threshold, writing a known test pattern, and then reading it back.
Voltage and Current relationship in generation Please could someone explain why the current is 180 Deg out of phase with the voltage when measured at the generation point and then in phase with the voltage when measured at the load point. I am purely talking about a resistive load. We can talk about VAr (Reactive Power, leading, Lagging, inductive, capacitive) later. I would really appreciate if someone who studied this could share a bit of their knowledge. I can provide examples of sine waves recorded that verify my above statement if required. I have the data, just having a hard time trying to get my head around it. thanks in advance - Mark Thanks for the response. Brian and The Photon are relating to what im saying. By convention current entering a load is positve and leaving a power source is negative thus 180 out of phase.To answer some other questions about my post. The measurements are recorded on a Transient Fault Recorder that has micro second accuracy.The system is a HVDC Interconnector and it has Inverter and Rectifier Modes.In Rectifier mode (drawing power from the grid) the Current is in phase with the Voltage but in Inverter mode (delivering power to the grid) the Current is 180 deg out of Phase with the voltage.I understand that it all has to do with the direction of the current and how its represented but i bet if i was a few hundered yards up the road at the first load point and i was able to look at the wave forms on an oscilloscope the Voltage and Current would be in phase again. Maybe it is just the way the CT's are orientated. I might have just answered my own question <Q> As Brian says in comments, it's a matter of convention. <S> In network analysis , it's a common convention that the current associated with a device (generator or load in this case) has a positive sign when it flows in to the device. <S> This appears to be the convention your text is using. <S> Notice that this convention means that when a device is providing power to the circuit (like a voltage source or generator does), it will have a negative current. <S> This seems anti-intuitive, but it's just a consequence of choosing a common sign convention for device currents regardless of whether they are sources or loads. <S> And, as Brian says, if current is flowing into the load, it is necessarily flowing out of the generator. <S> So with the network theory convention, the signs of the two currents must be opposite, which is the same as a 180 degree phase change. <S> i bet if i was a few hundered yards up the road at the first load point <S> and i was able to look at the wave forms on an oscilloscope the Voltage and Current would be in phase again. <S> Because you would be measuring the current in the direction away from the generator and towards the load. <S> If you turned your current probe around and measured the current going towards the generator, it would be 180 degrees different. <S> In your original measurement, when you measured at the generator, you had the current probe/sensor pointed toward the generator; when you measured at the load, you had the probe/sensor pointed toward the load. <S> So you got results that differed by 180 degrees. <A> Your question can't be answered because it is based on incorrect assumptions and therefore makes no sense. <S> If what you have between the generator and the resistive load has significant inductance, then there can be a phase shift at the generator, but then the load as seen by the generator isn't resistive anymore. <S> However, this can only at most push the phase shift up to but never at 90°. <S> At exactly 90°, no net power is actually being delivered by the generator. <S> Having a resistor somewhere dissipating power, whether at the end of a long inductive transmission line or not, would be violation of conservation of energy, thermodynamics, and a few other felonies of physics. <S> If you have data that supposedly shows a 180° difference between the generator and at a resistive load, then you got a polarity flipped somewhere. <S> Note that 180° is a sign flip, or negation. <S> Let's say you have two wires coming out of the generator labeled A and B. <S> The voltage of A with respect to B and B with respect to A will be exactly the negative of each other. <S> With a repeating AC voltage, this can be expressed as a phase shift of 180°. <S> Somewhere along the line, you lost track of which wire <S> is A and which is B and flipped a measurement. <A> Voltage is a potential difference which has to be measured between two nodes in a circuit. <S> The the two nodes span across a device or network which is reactive, then there will be a phase shift between the current flow across the device and the voltage. <S> If the device is purely reactive (inductor or capacitor with no series resistance) then the phase shift is 90 degrees. <S> If the two nodes span a device or network which is purely resistive, then that voltage is in phase with the current flowing across that network. <S> It is not possible to make voltage and current out of phase, and then send them that way through a wire. <S> The phasing behavior is exhibited by the reactive device. <S> For instance if we have a two-terminal device which is made by connecting a capacitor in series with a resistor, then that will have a phase shift depending on the R and the C value (somewhere less than 90 degrees). <S> But that resistor taken individually has no phase shift across it, and the capacitor has 90 degrees.
For a resistive load, the voltage and current are always in phase, whether at the generator or at the load.
AC Adaptor converted in USB charger, is it safe? Is it safe, or maybe I should I say "logical", to take an AC adaptor and splice the wires, reconnect them and solder together with a USB cable to power a device? I had an old gameboy advance sp laying around and had an idea (sometimes my ideas are good, but most of the time they are not so good), well I cut the ac adaptor wire about half way and then took a usb cable, cut it and then soldered the wires together. Not knowing which wires should be connected to the corresponding wire, I took a guess and matched most of the color coded wires together. There were some that didn't match up so I just guessed and prayed. The original plan was to be able to use it as a transfer cable, but like I said sometimes my ideas aren't so good. It turned out, it actually charged the gameboy. To my surprise, nothing bad happened, it charged the gameboy just fine, no smoke came out from anything, no sparks either. But that brings me back to my original question; is it safe? Would the watts or amperage be an issue with the original charger being 100V-120V? <Q> It can be safe, and it can be logical, but based on your description, it is neither. <S> By "AC adapter" I am assuming you are talking about a regulated wall pack (wall wart, as some people say)... <S> It is becoming easier to mix things now that so many devices charge with USB like cell phones, tablets, etc. <S> USB is 5V DC, and can have a wide range of currents. <S> First, you have to make sure that the AC adapter has a 5V output, and not some other value like 6V or 12V DC. <S> Next, you have to see what the current output from the adapter is. <S> It may well be higher than your intended device was designed to handle. <S> This information should be printed on a small sticker on the side of the AC adapter. <S> The power requirements for your device should be in the operator's manual. <S> On top of that, a USB cable has at least 4 wires in it. <S> A power cable typically only has 2, unless the AC adapter has additional sensor wires in it. <S> Yes, typically a red wire is V+, and a black, white, or uncoated wire will be ground. <S> But this is not always the case! <S> You would really need to test each wire with a voltmeter to determine what the correct wires are. <S> A good piece of electronic equipment should have protection from over current, over voltage, and reverse voltage, but not everything does. <S> If you apply the power backward or use too high of a voltage/current, you could easily damage the circuitry or battery you are trying to charge. <S> Also, not everything has an internal battery charger circuit, some of them rely on the circuit held within the AC adapter designed for that device. <S> If you connect it to something else, you could damage the battery or cause it to overheat and explode. <S> Lastly, I don't understand how you plan to use an AC adapter as part of a "transfer cable. <S> " That doesn't make any sense. <A> With respect to @Kurt E Clothier's answer above, there are some clarifications I feel that need to be made. <S> You can't "overcurrent" a device. <S> It just won't use the excess. <S> If your AC adapter has higher current rating it won't destroy your device. <S> USB is 500mA max but an unenumerated device can only draw 100mA. <S> When you plug a device that is meant to be powered through USB to your computer it can only draw 100mA which is why most USB power stealing designs (i.e. ones that don't enumerate) are designed with that limitation in mind. <S> USB charger cables only have power and ground connected. <S> You can leave the rest of the pins unconnected and a device that is powered through USB would still work. <S> As long as your wallwart puts out 5V at 100mA (which is minimum for USB) it should work. <A> A USB wire has two main functions generally: power and data transfer. <S> The usb data standard is not similar to the 90's standards. <S> The power supply for your gaming device has only one function: power. <S> Further, the gaming device is not meant for external data transmission. <S> However, the usb may provide insufficient power voltage and amperage. <S> Another worthwhile mention is that this action may not always be safe and it will usually not work. <S> However, if you do your research, it might be fruitful.
In theory, however, you should be able to power the device in the aforementioned manner by connecting the red and black usb wires with the appropriate ones on the adapter. It also might not supply enough current to power the device. Every device has different power requirements: voltage level and current input. You will not be able to transfer data to a device designed to power devices as well as to send and receive their data. You can certainly exceed the device voltage which is why his AC adapter should be 5V rated.
What makes the buzzing sound when touching an audio line? I recently built an audio amplifier based on the LM386. When I touch one of the input signals with my finger, I can hear a buzzing sound on the output. I checked with the oscilloscope, and there appears to be some kind of voltage signal on my hand with respect to the amplifier's ground. What is this voltage? By what theoretical principle can I understand this? <Q> Your body becomes connected to the circuit. <S> Probably, capacitively coupled through an equivalent of about 100pF. <S> Then, several things can happen: <S> Extra capacitance makes your amplifier oscillate. <S> Your body acts picks up 50/60Hz interference from power lines (aka "60Hz hum") and introduces it into your amplifier. <S> To see this, poke an oscilloscope probe at yourself and observe the signal. <A> Your body is acting as an antenna, or more accurately, the secondary winding of a transformer. <S> When you touch the input line of an amplifier, the tiny voltage/current is amplified and a 50 (or 60) <S> hz sine wave is produced at the amplifier's output. <S> This causes the speaker cone to push and pull 50 (or 60) times a second, producing the hum you hear. <S> Anything that can act as an antenna (or transformer secondary), whether your body or a piece of metal or a length of wire, will have the same effect. <A> I think, the humming sound comes from the mains supply line in your house. <S> Try to turn off the circuit breaker in your house and touch the audio amplifier input line, you will not hearing any humming or buzzing sound come out from the speaker.
A tiny AC voltage/current is being induced in your body from the electromagnetic field produced by the mains electricity power lines all around.
Checking materials (cheapest possible) to be used for a solar dark-detecting LED light bulb circuit I want to make this circuit, which includes a joule thief: It's for a solar dark-detecting LED light; and I'm trying to follow this guide: https://www.instructables.com/id/Solar-LED-Light-Bulb/?ALLSTEPS I'm having a lot of trouble picking the right material and I'm not sure how to make a safe alteration for my needs (I want to use a brighter LED and a different solar panel than the author of the guide). I've done over a week's worth of research but have gotten vague results. I've come up with a few possibilities for materials, and I would really appreciate it if someone could tell me if it would be safe to use these specific materials in the circuit. I don't want to burn out the LED or start a fire or something. I've already purchased solar cells for a previous project, but that project required tiny 52x19mm solar cells. I would like to reuse them; the makeshift solar panel would be made like this: https://www.instructables.com/id/Solar-7-up-Solar-phone-charger-in-a-bottle/step3/Superglue-stack-the-solettes/ Basically, 10 solar cells are glued in series on a playing card (and one more which would be used as a conductor...? Not totally sure how that's supposed to work).The seller's description of the solar cells: B Grade Average Power (Watts): 0.14 Wp Average Current (Amps): 0.28 Imax Average Voltage (Volts): 0.5 Vmax Effeciency: 17.6% So with 10 in series, it'd be a 5V, 280mA solar panel. The author of the guide used a 4.5v solar panel, as you can see in the circuit diagram. On a sort of side note, can I use any kind of solar panel? E.g. 3V, 280mA; 10v, 280mA... Apparently your diode's amps should greater than your cell's amps to be safe. The only ones I've heard of are the 1N914 diode and the 1N4001 diode. The 1N914 diode seems too small as my solar panel is over 200mA but since 280mA is the MAX current, the solar panel would never reach that current, right? Would it be okay to use the 1N914, or should I get the 1N4001? The 1N4001 seems a bit overkill since it handles 1A. Better suggestions would be much appreciated, as I'm sure there are other kinds of diodes out there that are better suited. Googling stuff like "280mA zener diode" and "300mA zener diode" didn't really get me anywhere. For the NPN transistor, I was thinking of a 2N4401 transistor because apparently the LED will be brighter because it can handle more amps? And for the PNP transistor I was thinking of getting a 2N4403 transistor, only because it is 40V and 600mA also. I thought I'd make it match... I'm not sure if it matters though? Anyways, please tell me if these are safe decisions. And for the resistors, the author of the guide used a 5k ohm resistor. Would a 5.1k ohm resistor work okay too? It's hard to find a 5k one. I was thinking of a 5.1k 1/4W carbon film resistor with 5% tolerance. And then a 1k 1/4W carbon film resistor with 5% tolerance that is connected to the joule thief. For the ferrite toroid, I found a FT-50A-75 toroid on eBay. On another site, the product description says: Excellent attenuation from 0.5 MHz to 20 MHz Inner Diameter: 0.312 inches Outer Diameter: 0.500 inches Height: 0.250 inches AL Value: 3000 µH/100 turns Is it possible to determine if it's a high permeability toroid from that information? If so, please tell me how. For the joule thief to work, apparently you need a high permeability toroid. I'm having trouble getting one at a reasonable price (with shipping included), and this seems best so far. For the LED, I want to get a 5mm white straw hat LED. Forward voltage is 3.2-3.4V and forward current is 20mA with 12000-14000mcd (around 63 lumens). LEDs seem to need specific resistors, but I'm not sure. So I would like to make sure that this LED would work perfectly fine on this circuit without a separate, special resistor connected to it. It's just that some other sellers sell LEDs in sets that actually come with separate resistors that are supposed to be used with those LEDs. Okay, so with a 3.2-3.4V LED and a 5V 280mA solar panel, as well as a joule thief, would one AAA NiMH battery with a 1800mAh capacity be all right to use? Now, what baffles me most is the wires. Magnetic wires, solid wires, insulated wires... 22 gauge, 30 gauge, which one should I use? Some say magnetic wires are best to use for the joule thief (maybe better because they're thinner) and others say it has to be insulated, and still others say it doesn't matter... I don't even have any possible material in mind. I hope someone can shed some light onto the wires for me. I thought this part would be most simple. Wires also seem to cost way more than I thought they would. I might be looking in the wrong places and typing in the wrong things, so I would really appreciate some help. Also, is it called "hook-up wire"? I mean, would something like this work?: http://www.ebay.ca/itm/Aapex-17-Feet-18-Gauge-OFC-COPPER-RED-Positive-Primary-Turn-on-hookup-WIRE-CABLE-/250922109505?pt=US_Car_Audio_Power_Speaker_Wire&hash=item3a6c1f8a41 Should I use a different kind of wire for the joule thief and a different kind of wire for the rest of the circuit? If possible, I would like to use the same kind as I really do not have money to spend. I would extremely appreciate any answers or even partial answers (even if you don't tell me about ALL components and just tell me if, for example, the LED and resistors will work). I've honestly been agonizing over this for a while, and have put in a lot of effort before trying to get help. I know this is very long, so thank you for even spending time on reading through it. I would appreciate some explanations, but even just a simple "yes, x, x, and x are safe" and "no, x is NOT safe" would help. <Q> It is a long question, but better than a short one, as you've shown your own research. <S> 1) Solar cells. <S> If you're stacking your own ones, stack 9 of them and get the 4.5V of the original circuit. <S> 2) Battery charging. <S> Batteries are the only thing you've left out of your spec. <S> This is an area where the circuit design relies on cutting a lot of corners. <S> In theory it might be out of spec, if you were to put 4.5V at 280ma through AA NiMH cells indefinitely. <S> In practice, you don't get full sun all day, you'll be using it indoors, and you're not going to get optimal power transfer from the cells, so this isn't going to cause problems. <S> 3) Diode. <S> It's just a regular diode, not a zener. <S> Current through it is actually determined by the battery and right hand side circuit, not the solar panel - the transistor is off when the panel is generating electricity. <S> The original 1N914 will be fine. <S> 1N4004 will also be fine. <S> 4 <S> ) Resistors: not a precision component here, use whatever meets your cost constraint. <S> 5.1k for 5k is fine. <S> 5) Wire: not critical. <S> Your ebay link looks suitable. <S> 6) <S> Transistors: <S> stick with the exact part numbers. <S> Design may rely on specific parameters. <S> 7) LED: again, this circuit relies on cheating. <S> Normally a white LED won't run from two NiMH cells. <S> The joule thief part provides a boost converter that gives small pulses of higher voltage. <S> It doesn't have the capacity to provide a lot of current at that voltage. <S> In combination with the pulsing this means there should be no risk of damaging it. <S> (A proper analysis of this circuit would be good, if nobody else supplies one I'll do it in a few days). <A> Metal film are much better. <S> That 5k resistor isn't critical, a 5k1 will be fine. <A> Regarding your inductor - I had a quick look on the internet to find out about joule thieves and one of the things that was said on wikipedia <S> was: - The predominant mode of operation relies on the non-linearity of the inductor (this does not apply to air core coils). <S> As the current ramps up it reaches a point, dependent upon the material and geometry of the core, where the ferrite saturates (the core may be made of material other than ferrite). <S> The resulting magnetic field stops increasing and the current in the secondary winding is lost, depriving the transistor of base drive and <S> the transistor starts to turn off. <S> The magnetic field starts to collapse, driving current in the coil into the light emitting diode (raising the voltage until conduction occurs) and the reducing magnetic field induces a reverse current in the secondary, turning the transistor hard off. <S> What this implies is that you have to be a little careful when choosing the toroid core. <S> You want one that will saturate and from the your coil spec (3000uH/100 turns) <S> it looks like a fairly low permeability type and this may not saturate as expected. <S> I'm not saying it won't work <S> but i am saying in my experience that when I calculate the inductance per single turn ( <S> 3000uH / turns-squared) <S> I get 300nH per single turn and it strikes me that the inductor core is a possibly a low saturation type given the size it appears to be on the videos i saw plus number of turns and likely current flow.
Carbon film resistors aren't used much these days. Thinner is better for the toroid.
PCB vias impact in cost Often times I read comments/recommendations about placing lots of vias for GND in 4-layer designs, as well as a line-up of vias surrounding the board to protect from EMI, etc. I was always under the impression that vias (either tented or not) have a certain impact in the final PCB cost, so I tried to minimize their numbers in my designs. However I might have been wrong and vias are extremely cheap? For instance, in a 4"x4" board, how much would it affect a design cost to have 400 or 200 vias instead of 100? Does the diameter of the via matters? I'm talking about normal all-the-way vias, not buried vias which I know are much more expensive. <Q> Vendors are not good at telling you how costs will vary based on different specifications. <S> They will always ask you for your files and provide a quote to that specific board. <S> They generally can't, or won't, give you a relative answer. <S> In my experience the number of vias is not as important as the size or type. <S> Blind vias (which do not extend through the entire board) will also be more expensive. <S> The price difference between having 200 vias and 100 is probably going to be negligible. <S> Back when holes were drilled manually the cost would have been impacted much more, but nowadays with machines doing all the work, it really doesn't make much of a difference. <S> Keep your via diameters large whenever possible, though. <S> If there's a higher chance of a bit breaking (because it's so small), the board house will charge you more for the fab. <A> If I recall correctly, many years ago the local board shops did charge per hole, but I haven't seen hole charges for many years for normal boards. <S> There might be an extra charge for something with an execessive quantity of holes, like a breadboard layout. <S> (This may, of course, vary with the board shop.) <A> The NC drill will need more time to drill 400 vias instead of only 100. <S> These machines are expensive and the board manufacturer will charge you in some way for the number of holes. <S> If your smallest drill size is about 0.7 mm, they may drill 3 boards together in a stack, but when smaller drills are used, it is possible to drill only 2 boards in stack or even only one. <S> Drilling 2 boards in stack instead of 3 will need 50 % more time, 1 instead of 3 will be 200 % more time. <S> Using very small drills requires a machine with more revolutions per minute to get clean holes. <S> Very small vias cause problems during the galvanic deposition of copper on the hole walls, the electrolyte liquid exchange may be blocked by dust or air bubles. <S> Dont forget you need a reliable connection of some vias to the inner layers. <S> The board house must clean the hole walls after drilling to ensure a good and relaible connection of the copper on the hole walls to the copper of the inner layers. <S> This process is called etchback. <S> You have to ask your favourate board house for the cost of different number of holes and different drill sizes. <S> Ask if they do an electric test of the connectivity of the boards and compare different board houses.
Microvias (definitions may vary from vendor to vendor) are much smaller and will cost more than a standard via. Some of the prototype shops will charge extra if you specify too many different drill sizes, or sizes outside their normal drill set.
I need help designing a very simple timer I'm designing a very simple led light timer based on the Pomodoro time management technique. For those of you unfamiliar, you work for a set amount of time, take a short break, and repeat. My end result is to have a 5v USB powered device that lights a green LED for 25 minutes, then switches to a red LED for 5 minutes over and over again. This does not at all need to be accurate...+/- 5-7% isn't going to kill me. Ideally, it'd be small enough of a device, like one of the smaller Altoid tins, to sit on my desk unobtrusively. Though an Arduino-controlled Nixie tube countdown timer does have its charm.... I've found and re-read this q&a , as a start but there are so many options that I'm not sure where I need to start. From my understanding of the 555, it pulses (I'm thinking of it in astable mode), and triggers something. I'd originally thought I'd need a decade counter to keep TRACK of the pulses, but the page noted above seems to indicate that I can control the time between triggers with resistor and capacitor combinations. Of course, that suggests I'll need some formula to determine proper capacitance and resistance...which I've been unable to find. Other solutions suggest relays, which I've not worked with yet...so I don't know what I don't know about relays in this solution. Can someone point me in a good starting direction, or perhaps recommend which schematic on the above page would be most appropriate for my purposes, if any? <Q> This is a very simple thing to do for a small microcontroller. <S> Even the smallest of them all, the PIC 10F200 can easily to this job. <S> It has a internal oscillator that is well within your accuracy requirements. <S> Otherwise, it only has to control 2 outputs, which is fine since it has 3. <S> A nice thing about a micro is that you can customize things a bit. <S> For example, you might realize after a while that you don't always notice when the light turns color. <S> It would be easy to have the micro flash the new state at 2 Hz for the first 5 seconds or something. <A> A suitable MCU would be a much better solution - lower power, better accuracy, easier to design, and simpler hardware. <S> Something like a PIC12F675 would be ideal (it has a factory-calibrated 1% oscillator). <S> A piezo buzzer could also be incorporated. <A> 25 minutes is probably a bit too much for a simple 555 circuit due to leakage currents and the like. <S> An Arduino Mini only requires a USB-serial interface, they're pretty common to obtain. <S> Otherwise pretty much any microcontroller can do the job, but requires a programmer. <S> If you surf around a bit you can get pretty good prices for Arduino or compatibles. <S> http://arduino.cc/en/Main/Products <A> If you want to make it USB controlled, the simplest way is to purchase one of those super cheap USB to serial converters. <S> Installing the converter will install a virtual COM port driver. <S> You can then use the DTR or RTS data flow control lines to switch your LED. <S> These lines can be controlled from either Win32 API or the SerialPort class in .NET <S> The first circuit on this page shows a similar example. <S> It controls a relay from a serial port. <S> When I have time I can draw up another circuit that demonstrates just an LED being controlled.
By far easiest would be small Arduino (Micro, Nano), especially because of the fact that you don't need any extra hardware to program it.
uC platforms to consider for faster CPU and 30+ GPIO pins I am building a Persistence of Vision project with 120 RGB leds (=360 total lines to be controlled). We have settled on the TLC5940 for driving the LEDs (and could be open to changing this), however, now we have a problem getting the data fast enough to the LED driver chips. Currently we are using ATmega328/ATmega128-class chips which top out at 20Mhz, and we aren't able to process the data to be loaded onto the TLC5940s fast enough. Should we consider another uC? The desiderata are: Low cost/uC Low startup costs (For instance, CPLDs require a certain initial investment to get started with) 3.0-5.0V Ideally available in a DIP package for easy prototyping 30+ GPIO lines (to load the LED controllers in parallel) This question may be an intellectual poor cousin of this question , however, I think our requirements are somewhat different. Details: why ATmega328 isn't fast enough (so far) In the ideal world, we should be able to load the data for all LEDs in under 746uS (that's the project requirements), and again, in theory, if we bitbang at 2clocks/bit we should be able to do it in 108uS @20Mhz, however, all the bit shifting to decide what intensity to send to each LED right now gives us 1536uS load times. This is with avr-gcc OPTLEVEL=2 or OPTLEVEL=3 , all sorts of loops manually unrolled, parallel loading of all LED controllers, and every time-saving technique we can think of. <Q> I would step up to a cheap ARM. <S> Also being an arm you will get 32 bit registers so you can do more per op-code. <S> Also it has a DMA engine <S> so you might be able to off load the loading of the LEDs to DMA while the processor updates the memory. <S> You can get them from Digikey as well as the other usual suspects. <S> As for development tools there is CooCox , <S> mbed and CodeWarrior . <A> The Atmel XMEGA line is rated up to 32 MHz, is fairly cheap, and comes in up to 100-pin packages. <S> Sparkfun has a pre-made breakout for the xmega128A1 for prototyping: https://www.sparkfun.com/products/9546 -- there are also a bunch of dev kits including Atmel's XPLAIN board. <A> I would probably look into the mbed platform. <S> You might be able to use one of their DIP modules as your "uC DIP", though it will contain the necessary surrounding peripherals as well (crystal, power, etc). <S> While this will be significantly more expensive than buying bare microcontroller chips, it sounds like you're not producing this in mass so that shouldn't be too much of an issue.. <S> There is a large developer community and the hardware can definitely meet your I/O and speed requirements. <S> Due to the readily accessible development tools these rather complex microcontrollers will still have almost no start-up time. <A> The PIC24EP256GP204 is a 16-bit machine, can run at 70 MIPS and has 35 I/O lines. <S> Unfortunately it's not available in DIP. <S> It doesn't need an external oscillator and is a 3.3V device. <S> It can be in-circuit programmed with low-cost programmers like PICkit3 (around $70), has a free non-optimizing C-compiler (XC16 - licensing it gets you optimization) and two free IDEs with simulators (MPLAB 8 and MPLAB X). <S> It's been my experience that working in assembly on this part isn't that bad <S> - I use the free version of the compiler and hand-optimize in assembly where necessary.
You can get the Freedom Board which is a Cortex-M0+ which can run up to 48Mhz.
Estimate current draw for battery replacement Trying to revive an old electronic keyboard. It is labelled to take 9-12V and I have an appropriate connector, but don't have an idea of how much current to allow for. It can also be powered by 6 D cells, and presuming that they should last for some non-trivial length of time, that should give some kind of reasonable approximation, but I don't know the calculation to do. So, if I want to use a wall-wart or line-lump transformer of big enough but not overkill from my junk box, how to reasonably estimate from the 6-D batteries to how much current to allow for? <Q> how much current to allow for? <S> You have to supply more current than the keyboard needs. <S> If you supply the right voltage then the keyboard will draw itself the needed current. <S> What is important here is to supply it with the right voltage. <S> So 9-12V and also check if DC or AC . <S> If you supply it with more current then nothing bad will happen. <S> If you supply it with less current then it will not work, nothing bad happens. <S> If you supply it with more voltage then it needs you will destroy it. <S> If you know, how long did the keyboard last on that batteries, then you can calculate the power consumption based on the D batteries capacity. <S> I am assuming the capacity of 8000mAh http://en.wikipedia.org/wiki/D_battery <S> If the keyboard was able to play for 4 hours, then: <S> 8Ah / 4h = <S> 2A <S> So the average current draw was 2 Amperes. <S> Bare in mind that this is only the average. <S> So you should supply more. <A> Just as a guess, figure they wouldn't design the thing to take more than 1 A from the batteries. <S> Fortunately small power supplies, like wall warts, are readily available in the 1-2 A and 9-12 V range. <S> I'd go for a 12 V 1 A supply and very likely that will be fine. <S> That's 12 W after all, which sounds like quite a lot for a keyboard. <S> It would probably work with 12 V and 500 mA, but you're not going to save much money compared to a 12 V 1 A supply. <A> Some keys should be played with volume up full to get a decent estimate. <S> Do you have a multimeter that measures DC current? <S> If you only have a voltage measuring instrument, put a 1ohm resistor in series where you would have fitted the ammeter and measure the volts across it. <S> Current is what you need to know <S> but if it's power it's PSU output voltage <S> x measured (or inferred) current
If you have an appropriate (but possibly too physically big) power supply in your junk box, measure the current taken when connected (you might have to make an adapter to break-in to the power cable) to the keyboard.
A device that wirelessly, securely posts to a server in response to door opening: off the shelf or custom-make? I am looking for an off the shelf component for a project I am currently working on. Due to the nature of the project I cannot go into much detail about the project itself, only give a high level overview of the requirements of the desired component. I am not an electronic engineer, I am from the dark side of software engineering, so please forgive me if any of my terminology is wrong, I find myself thrown in at the deep end of this project. I am looking for a component which can sit on the frame of a door (with part on the door itself (very similar to a burglar alarm sensor in the UK)). When the circuit is broken, the component should be able to perform a HTTP GET/POST to a URL (probably located on the local network - but not necessarily). To this end, my component requirements are as follows: Wireless equipped (not to fussy on standards as this point, as long as major encryption formats are supported). Ability to GET/POST to a url in event of a break in the circuit. Low power consumption. Configurable Ability to exchange the power source (swap batteries) The component should provide a SDK (at this point in time, the language used to call the SDK is not important) which can configure the device (for example, setup network configurations, give the device a unique identifier (as multiple could be used on the same network)). I do not know enough about the range of components avaiable which fit my requirements to specify how configuration should take place, but in my head I imagine it being hard-wired to a computer to perform the configuration. Are there any such components available which would fit my requirements? <Q> A Raspberry Pi may be a reasonable compromise: it can run various flavors of Linux, which supports TCP/IP and many flavours of security <S> it has numerous GPIO lines which can be polled by something as simple as a Python script <S> it supports many off-the-shelf <S> USB-to-WiFi adapters <S> it consumes around 5W at peak loading, and could run for a long time off a household UPS with a switching wall-wart adapter powering it <A> If you can't find it off the shelf, investigate a arduino, a wi-fi shield, some door switchs of the home-security type, a battery, and your API is the relevant arduino libraries. <S> It's basically C with a set of high-level libraries that make it pretty easy to deal with all the hardware. <S> If that doesn't work for you, then I'd say you need to investigate what the DIY home security companies have to offer. <S> I can't imagine they wouldn't have something that can do this, but I'm not sure it would be cost effective (depends on how cost sensitive you are). <A> Ninjablocks Have a look at Ninjablocks: http://www.ninjablocks.com <S> The have a wireless button, door sensor, temp/humidity sensor among other things, e.g. http://ninjablocks.com/products/contact-sensor <S> The blocks run off a beagle bone circuit with an Arduino daughterboard, and the whole thing is open source. <S> From what I can tell, the device communicates data and events back to the ninjablocks server, which you can hook into using their REST API or with their own interface: <S> http://docs.ninja.is/rest/rule.html <S> Since everything is open source, it would be easy to start with this system which you know will work, then move onto implementing your own. <S> The code for the beagle bone could be modified to send POST messages to your own server rather than the ninjablocks one. <S> This system meets requirements 1,2,3 and 5. <S> As for 4, my idea of low power is running off 2 AAs for 6 months. <S> The door sensor might do this, but I thing the ninjablock itself requires a wall wart. <S> Alternative <S> The door sensor could wake the Arduino up from power-down sleep mode, from which it can send a POST message to your server via GPRS. <S> The benefit being no WiFi network is necessary. <S> However, without some experience in embedded systems I think this would take a month or more of tinkering to get something working well. <S> A good base Arduino board would be something like a Seeeduino stalker or a Rocket Scream mini 8MHz which have been designed for low power.
The other thing you might think about is an Arduino with a GPRS shield and door sensor.
Improving absolute precision of ADC to balance battery voltage I plan to use a relatively high-end microcontroller ( Piccolo TMS320F28035, 12-bit resolution, +/- 4LSB offset, +/- 60 LSB gain ) to measure voltage across stacked battery cells and control associated analog electronics to equalize their charge. The microcontroller will also store data in an eeprom memory (blackbox). The current plan is to read up to 10 cell voltages. The problem is the large common mode voltage (each cell can go up to 3.5 V) - I cannot use isolated amplifiers such as INA124 or non-isolated high-precision INA117 due to high cost. The current plan is to use voltage dividers (0.1%) at each tap and calculate cell voltages relatively to each other: V1 is measured directly V2 is calculated as measured V2 value less calculated V1 and so forth The problem with this setup is that the tenth measured voltage will suffer from high voltage-divider ratio and thus could be off by too much. Another approach is to use a battery monitoring chip and use is as an analog front end ( BQ77PL900 ) but the cost is quite high as well. Are there better ways to precisely read battery cell voltages? Thanks, SBNY <Q> I was thinking about a circuit like this one to 'extract' the single cell's voltage: <S> (My first shot at circuitlab, please be lenient :)) <S> simulate this circuit – <S> Schematic created using CircuitLab <S> This scheme can be applied identically to every cell to be measured. <S> I'm not sure if this works when "self-powered" from the battery pack as sketched. <S> You should definitely go for a rail-to-rail op-amp, which kind of excludes bi-polar devices. <S> Are you actually charging batteries or rather "supercapacitors"? <S> - Maybe you can find some ideas for either case by searching for "supercap balancing", resulting for example in this paper on the topic. <S> Edit: <S> Maybe it's worth mentioning that with this op-amp-based circuit you can of course scale the output value to your exact needs by varying the resistor values. <S> For example, one might want to scale some "3V max. <S> " of the cells (= range from 0V to 3V) to an output of "5V max." (range 0V to 5V) to feed into a 5V-ADC. <S> Or one may scale the voltage down, for example to measure "4.2V max. <S> " LiPos with a 3.3V µC/ADC. <S> Edit #2: <S> With one more op-amp per cell <S> it's also possible to remove some constant offset voltage and increase the resolution of the measurement. <S> If, for example, a single cell needs only be measured between 2.5V and 3V, the 2.5V constant voltage can be subtracted by the 2nd op-amp, and the resulting, limited voltage range of only 0V - 0.5V can then be scaled up to, e.g., 0V - 3.3V. <S> With a 10-bit ADC this would yield a (theoretical) resolution of 0.5V/1024 <S> ~ 0.5mV/LSB. <A> Use an analogue multiplexer followed by a single high-precision resistor divider. <S> The multiplexer will need to be powered from the highest point in the battery stack for it to work correctly. <S> Control the multiplexer from IO pins on your MCU - 4x IO pins will address up to 16 multiplexed inputs - in this way you also save 9x analogue input pins. <S> Net gain is 5 pins. <S> EDIT - I would recommend using an external ADC and one that is 16-bit. <S> It can sit on the output of the precision attenuator. <S> You can find decent ones that are much more linear than internal MCU ADCs. <S> I would also suggest powering the MCU at midrail on the battery stack so that a cheaper lower voltage range multiplexer can be used. <S> This will mean that the ADC has to measure negative voltages but there are some that can do this. <A> A uC with a 10-bit A/D costs almost nothing these days. <S> No need for a resistor divider, simple use a reference (TL431 or similar) and have the uC measure the reference's voltage with respect to its supply voltage. <S> The uC's can send their measurements to the central uC via optocouplers or and IR LED (one per slacve uC) + a TSOP receiver (one).
A radical approach would be to put a separate microcontroller at each battery.
Is it safe to parallel wall-wart inputs via a single cable? I have 4 identical devices each with their own low amperage wall wart, and I want to tidy up my power cabling. (They are more like laptop power supplies than wall warts, as they have an AC cable, instead of just a wall plug.) I'm not any kind of expert on electricity, but I started thinking about power bars, and assume they must connect things in parallel. This made me think I might be able to cut the all the AC leads off the wall warts and join them together, to create one plugin source feed to all 4. Is this dangerous, or is it as simple as it sounds? They are grounded, so I would be joining the grounds together as well. <Q> However, safely making such a connection would be difficult. <S> Personally, I would prefer to keep the separate plugs, even if I had to buy another power bar (and I do have the skills and tools to make the suggested connection safely). <A> If the cable length is the issue, depending on which cable it uses, you might be able to get shorter ones, standard or custom made. <S> For example: 1ft "Figure Eight" C7 cable <S> http://www.amazon.com/Ziotek-Notebook-Power-Cord-Figure-eight/dp/B000BSLS0W <S> 1ft C13 PC power cable <S> http://www.monoprice.com/products/subdepartment.asp?c_id=102&cp_id=10228&cs_id=1022801 Or a Y cable of the same? <S> http://www.hosatech.com/product/340384/YIE-406/_/Power_Y_Cable,_Dual_IEC_C13_to_NEMA_5-15P,_1.5_ft <S> And the Mickey Mouse C-5 Cable as well. <A> A lot of switching power-adapters rely on the AC cable to sufficiently attenuate what would be "illegal" levels of conducted EMC emissions. <S> OK so you were planning on using 4 and this makes a mockery of the governing legislation!!! <S> Who doesn't use a stack of them all connected to a single outlet? <S> Is it safe? <S> Safe in terms of electrical shock but, maybe not safe to do so without incurring the wrath of the legislative gurus. <S> Will you be caught? <S> No, of course not!!
They can't blame you for using 4 that have been untampered but maybe they can if you've shortened the cables. Electrically, combining the four AC input cables into one would be equivalent to plugging them all into a common power bar. There are even 3 way versions of that cable.
Electrolytic capacitors connected with one terminal only? I've got an ordinary PC motherboard. So, out of curiosity, I started looking at the power circuits on it and found several large 1000–1500 μF electrolytic caps: It's easy to see that their cathodes are not connected to any wires on the back side of the board. However, they aren't connected on the front side as well: At first I thought that these might be soldered in as reserved components, uhhm... but now I'm inclined to reject that hypothesis. It makes little sense; and what's convincing the most is that other similar caps are wired in the same anode-only fashion. I guess that this might work, because of electrostatic induction happening inside the caps, which would still allow to store energy in there over 1 wire only (and thereby absorb unwanted ripple current) – but wouldn't that effectively reduce the caps' capacitance? Also, can the cathodes be wired back to ground, theoretically? Will this enhance power regulation stability? Finally, I have a suspect that this could be related to the obvious difficulty of routing the ground wire to nearly every component on the board. If I'm correct, is connecting of EL caps by 1 wire only a common practice in the industry? Or did I just notice an extremely dirty awful hack, which I shouldn't ever repeat in my designs? <Q> PC motherboards have more than just the top and bottom copper layers that you can see. <S> In cross section, it looks like the example labled "1" in this picture: ( image courtesy Wikipedia ) <A> Ground plane . <S> A good designer will keep split power planes sandwiched between them, and sometimes even more to separate high speed signals from each other. <A> A capacitor has to complete a circuit to do anything useful. <S> Like any circuit element, if one of it's terminals is floating that means no current will flow into that node and that component is effectively omitted from the circuit. <S> An obvious exception to that is an antenna which picks up RF energy and injects it into a circuit, but capacitors are not in that class of circuit elements. <S> None of that matters in this question though. <S> As @PeterJ commented motherboards are almost always multi-layer constructions. <S> There is a lot more going on, in terms of routing, than what meets the eyes on the top and bottom of the board. <S> More often than not, two or more of the internal layers are unbroken ground planes that ensure impedance controlled transmission lines for high speed signals (like the memory bus and system bus), and also to ensure good EMI/EMC performance. <S> Your mystery capacitors are most likely making a connection to ground on those internal layers.
The capacitors are connecting to a hidden layer somewhere in the middle.
Pull Switches - why so expensive I would like to use a pull switch as a trigger for an alarm that I'm building. When the switch is triggered it will turn on a siren and potentially a strobe light. I've found plenty of options out there, but the prices are a bit staggering. Take this one for example, it's $238. I was thinking $20 would be expensive! My alarm isn't going to be used in an industrial environment and the items I'm securing aren't worth enough to justify spending that kind of money for a switch. I think a simple pull type light switch would be sufficient, but I need the cable to break away from the switch when activated and not damage it in the process. I guess I have two questions: Why is this switch so expensive? What other options are there for a N.O. pull cable switch that stays closed after being activated? I'm open to ideas of building my own switch. <Q> One simple way to make your own N.O. pull switch would be to use something like a 3.5mm audio or DC plug and a socket with the extra contact to detect if the plug is inserted. <S> So the lower two pins would be normally open with the plug in place, and closed once the cable had been pulled out. <A> Why is this switch so expensive? <S> The switch you reference is made to be used as an emergency stop via a length of pull cord (think of a stop-request cord on a transit bus ). <S> It is made to latch open once pulled (i.e. it's a mechanical one-shot). <S> It is more than a simple pull switch. <S> It is rated IP67, which equates to dustproof and immersion proof. <S> It is made for demanding industrial applications including washdown and nontrivial shock and vibration. <S> It is a safety device made by a name brand company. <S> What other options are there for a NO pull cable switch? <S> I'm open to ideas of building my own switch. <S> Something as simple as <S> this can have a string tied to it such that the switch actuates when the string is pulled. <S> If you need the cable to break away from the switch, there are plenty of mechanical ways to accomplish this. <S> A breakaway lanyard is made to open at a certain tension. <S> There are also more repeatable "tension fuse" type devices based on magnets for various applications; take a look through a big industrial catalog for ideas. <A> "What other options are there for a N.O. pull cable switch that stays closed after being activated? <S> I'm open to ideas of building my own switch. " <S> Here's my simple do-it-yourself suggestion: <S> (Sorry for the MS Paint drawing, I'm not on my own computer and don't have any fancy graphics tools installed.) <S> The thick blue line represents a cord or ribbon made of something non-conductive. <S> The brown lines represent two bent metal clips under slight tension, such that they will close together if the ribbon holding them apart is pulled away, electrically connecting the red and black wires. <S> The tension also serves to hold the ribbon in place until it is pulled. <S> For neatness and reliability, enclose the whole thing in a small box, with a hole in one end for the cord and at the other end for the wires. <S> Of course, there are plenty of variations you could make to this basic design. <S> Heck, a plain old clothespin with some aluminum foil glued between the prongs for contacts would probably do the job in a pinch (pun not intended).
Edit: If you used a (more or less) rigid plastic stick tied to the line for the blue part in the diagram, you could even design the switch and its enclosure so that you just need to push the stick back in to reopen the switch. Many switches can be used as a pull switch depending on the specifics of your application.
What's the use of tantalum resistors in audio circuits? I've been looking at some "pro audio" sites and saw that tantalum resistors are often mentioned with claim that they somehow improve sound quality, but I've been unable to find any reasonable descriptions for discrete component operation that don't trip my audiophoolery alarm. So is there any real need for them? <Q> You can hear the difference on a clean sustained bass note, where, with other metal resistors, you can hear the electrons shuffling up and down across the galvanic potential between the two metals. <S> With tantalum, the murmur of the electrons is much happier. <S> They do not grumble and mutter as much with tantalum. <S> I think it has something to do with Fermi levels in the different metals. <S> I found this link: <S> Oh dear, it seems I can't post an instant link (good idea, too). <S> Here is the image I found. <S> You can see clearly the electron's path between the two metals is much noisier. <S> One must be careful, grabbing info off the web! <S> For instance, in my graphic above, there are a lot of errors. <S> There is something fishy about it. <S> For one, the Fermi levels are wrong for a metal. <S> Here is a corrected image: <S> In many countries, on April 1, there is a tradition of practical jokes and pranks. <S> This was intended to be an April 1 joke answer. <S> Please do not take any statements in this post seriously! <S> bb <A> I have been an Electrical Engineer in the Professional Audio world for more than 15 years, and have worked with engineers from 10+ different Pro-Audio companies. <S> I have never, ever heard of Tantalum Resistors. <S> Must be more of an audiophile thing than pro audio. <A> No! <S> @BobbiBennet posted this picture as an explanation for using tantalum resistors with tantalum capacitors. <S> In the picture, a "Fermi-Level discontinuity" explanation is posited as the reason why Aluminum and Tantalum parts work poorly with each other (in comparison to Tantalum-Tantalum). <S> First, the application... <S> You don't have tantalum wires connecting things <S> so the problem should still manifest. <S> Tantalum resistors are extremely inert so they are great for use in corrosive or moist environments. <S> That's why they exist. <S> It's possible that replacing a corroded Ni-Cr resistor in an old audio-amp with a tantalum one results in noticeably better audio (depending on the circuit topology), which may be the origin of this audiophilia. <S> The electron velocities are so great in metals (and amplification factors so high in audio applications) that Johnson thermal noise will trump any noise created by the Seebeck effect (metal discontinuity) at audio frequencies. <S> ... <S> and now the physics. <S> Fermi levels don't work this way. <S> When you join two dissimilar materials the Fermi-levels align. <S> It's the band-levels that move in the band-theory of solids. <S> Solid conductors don't have a band-gap <S> (that's what makes them a conductor!). <S> In terms of Fermi energies, aligning the Fermi-levels of two conductors would result in no discontinuity since the electrons on both sides of the interface would be in the conduction band and could move freely across. <S> The "number of electrons" (presumably free electrons) on both sides of a Tantalum/Aluminum interface would be equal. <S> Otherwise, they would just move to equalize the distribution. <A> It said this on Angela Instruments website: - "offering unparalleled resolving power and transparency with warmth and musicality. <S> NO metal film or foil type resistor even comes close" <S> I don't believe a word of it - they appear to cost about £2.50 or $4.00 each. <S> Placibo effect is my estimate of their usefullness. <S> How can a resistor have "transparent" performance yet also be "warm" (or possess qualities of "musicality") - see quote above
Tantalum resistors are more compatible with tantalum capacitors.
How to detect line level audio signal? I'm planning to build an automatic switch box for line inputs to my speakers. The switching itself seems fairly straightforward (a pair of de/multiplexers), but I don't know how to detect the audio signal, it should also not interfere with the signal itself. The switch box will be controlled by an Arduino or something similar, as it needs to have some kind of timer so that it wont switch back and forth randomly if there are multiple inputs active. So, how do I detect an active audio signal using an Arduino? (or similar) Will it interfere with the signal itself? How? How do I avoid that? <Q> Detecting the signal - do you want to do it the hard way or the easy way - if the signal amplitude is in the order of 3 or 4 V peak-to-peak then it can be done the easy way using a couple of signal diodes, a couple of capacitors and a resistor. <S> This would be fed via a Schmidtt trigger into an IO line. <S> At a push the Schmidtt may be avoided if the logic levels are 3.3V. <S> The hard way means that the signals levels are lower than 3 or 4 volts peak-to-peak and <S> an input amplifier needs to be inserted to boost the signal up to these sort of levels. <S> There are simpler audio detectors based around a couple of transistors and these might be suitable too but, due to their simplicity they may trigger on noise or crosstalk. <S> These might be good enough though. <S> None of the circuits described above will cause any appreciable deterioration of the original analogue signal but care would need to be taken when connections are made to audio lines. <S> The answers are all here (above) and to move further you need to do a little work on measuring the signal levels or opt for the more sophisticated system with gain so that small-ish signals can be detected and acted upon. <A> For anyone finding this: Chinese shops like Aliexpress offer ready-made video and audio signal detection circuits for about 3 dollars. <S> They have 4 ports (positive, ground, signal in, answer out as a high-low signal). <S> It even has built-in time delay that you can adjust with a small screwdriver. <S> I'll try using it to automatically switch on my music amplifier which, unfortunately, can only be turned on through the remote control or a modern push button that I can't hack so easily. <S> Luckily, the infrared remote has dedicated on and off buttons, each with their own code. <A> If you've got ADC channels available, then you could use those. <S> I'm assuming that these really are line level 1V signals. <S> Take the left hand of this circuit: <S> http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/ : 10uF capacitor, voltage divider to bias input. <S> Take audio samples at intervals. <S> If there's no audio, the samples should be around a very small range of the middle (it won't be exactly constant due to noise). <S> If there is audio, there will be more variation in samples. <S> You can then experiment with where you want the cutoff to be between "very quiet audio" and "background hiss only, turn it off". <A> Here's a description of a circuit that doesn't require an Arduino. <S> Instead, it has a pair of opamps in series, with the output energising a capacitor and powering a relay via a MOSFET when it has reaches a threshold voltage. <S> Refer to circuit 1. <S> You could use the same circuit but ditch the MOSFET (Q1) and relay, and link the D5/C4/R11 connection to an Arduino digital input.
There are a few ICs that can apply large amounts of gain and then large amounts of compression to boost small signals to the same amplitude as larger signals and these could play a role.
Will a 3V3 rated UART be damaged by applying 5V signals? If I have a device specified for 3.3V operation and I connect a 5V level TTL signal to it ? Will it's UART ports be damaged or not ? I have a WiFi module and I want to know if its UART ports will have been damaged by applying 5 Volt signal levels during an experiment or if there is still hope that it has not been damaged ? This WiFi unit This may be the manual <Q> While there is no yes/no answer to whether your particular device has a damaged UART port many devices that are specified for 3.3V operation can have their I/ <S> O lines damaged by applying 5V logic levels. <A> As mentioned by other, you have to check the datasheet to see if the Rx pin is 5V tolerant. <S> If not, there are many level shifter ICs you can use to shift 5v to 3.3 and vise versa. <A> Whenever you are stuck with any of these questions, it is best to refer to the datasheet for your specific module. <S> I have worked with modules which run at 3.3(V) but can tolerate 5(V) inputs to the serial port. <S> That being said, this is very device specific and really depends on if the manufacturer has added the ability to tolerate 5(V) line. <S> As for your UART issue where "...." being seen, you should check whether this is happening if you have none of the TX and RX connected. <S> If you still get that without any serial connection, it might just be something the WiFi module is sending by default (possible bad WiFi module firmware or maybe malfunction). <S> Like mentioned, however, that would be the topic of another question, which you should post if you want the proper answer to that. <S> Either that or you can choose to run everything at 3.3(V) if you don't need the higher 5(V) rail which usually can be done. <S> Hope that helps. <S> Happy Engineering!!!
Best practice is to check the datasheet and confirm the particular device is 5V tolerant and if not mentioned in the specifications either assume it's not and use 3.3V logic or contact the manufacturer for clarification. A solution to your issue is to just you a logic level shifter.
How to find socket for keyboard connector? I am looking for a socket which is able to receive the connector of the ThinkPad X41's keyboard. How do I identify the socket so that I can find it on the (German) market? Background: I want to build a custom keyboard controller, to connect the keyboard via USB. Picture: Receptacle (left, 20 pins) and plug (22 pins) <Q> I've dug up the schematics of the T60 keyboard as well as the X41. <S> There is a very high chance that the keyboard receptacle is AA01B <S> -S040VA1 <S> manufactured by JAE . <S> The landing pattern is the same and it looks very much the same (Google images for the 30 pins version: AA01B <S> -S030VA1) <S> Molex SlimStack 54363 <S> -0478 can be used as a substitute to the AA01B-S040VA1. <S> My previous edits say otherwise because of my bad soldering. <S> After fixing the soldering, it works well. <A> When dealing with unknown connectors, please follow these steps to aid your search: <S> Measure the "pitch" or distance between <S> connector pins Count <S> the number of connector pins Count the number or rows of pins Measure <S> the pin length/depth <S> Determine the gender of the connector (male/female... should be obvious ;-) ) <S> Measure the overall dimensions (that's the dimension of the smallest box that can contain the entire thing) <S> Here are the usual types of connectors by functions (lifted from TE's Connector Picture Search which is highly recommended): <S> PCB connectors <S> I/ <S> O connectors Power connectors <S> Terminal blocks/strips Terminals/splices RF or Coax connectors Ribbon or Flat Flex Wire <S> Fiber optics Sockets (chip, processor, memory) <S> Now based on the eighth steps, here's what I can figure out from the information you had provided so far: -- <S> no guess -- <S> 40 pins 2 rows (2 x 20 pins) -- no guess -- <S> you have both the male and female samples -- no guess -- board-to-board <S> stacked related to the ThinkPad series of docking stations Your laptop's datasheet , aka service manual, was released in 2005 so that makes the probable manufacturing year(s) to be around a year or two before that. <S> The connector therefore must have existed in the market during those times +/- <S> 3 years prior or after; somewhere between 2000-2008. <S> Please verify further if it indeed is the connector you are seeking by measuring the missing dimensions and comparing it against the datasheet. <S> EDIT: <S> From the new dimension data you have provided, the connectors you're looking for is still manufactured by JAE with part numbers AA01A-S040VA1 for the female/socket and AA01A-P040VA1 for the male/plug. <S> Check out the datasheet here . <A> I would say sift through a component distributor's website, such as Farnell Then go about sorting one option at a time. <S> Connectors > <S> Board-to-board/Wire-to-board/stacking (stacking would be my first choice) <S> > then start selecting various parameters, such as 40 pins, 2 rows, 1.27mm pitch (I'd measure this if possible, <S> but it's fairly standard and looks about right). <S> Hopefully there won't be too many components found, around 100 or so (4 pages). <S> If you still can't find it, then try a different branch higher up the tree, such as board-to-board connector, or even ffc/fpc based on your second picture. <S> Sorry <S> I don't know outright, and good luck! <A> Use a better magnifying system and look for something that might be a partial model or series number or manufacturer's logo or abbreviation. <S> If you still can't see it, desolder one or both connectors and check the bottom. <S> Usually there is some kind of marking on such connectors.
Determine what type of connector it is by function (see next list) Some hints I found (Google) pointed me to this connector datasheet by Japan Aviation Electronics (JAE) which was released (or updated) in 2007 and matches currently known specs of your connector. Finally, look for clues for the manufacturer (brand, logo, letter/part number marks, etc.) If you can't see it on the exposed laptop part, look on the mating part instead, they'll both indicate the common series of parts you need to look for.
Does an over voltage, over current and reverse polarity protection IC exist? I'm designing a circuit that has the following protection requirements: Reverse polarity Over voltage (60v max) Over current (approx 1A) There's quite a large input voltage range, 10v to 60v. 48v is nominal, drawing about 150mA. At 10vin, it draws rougly 750mA. I made and tested the following circuit to satisfy the conditions: (Values are working but not proved optimal) M1 was my starting point for reverse polarity, then the zener, divider & M2 were added for over voltage. I found that D1 was needed when I breadboarded it, much to my annoyance as I wanted to avoid much voltage drop. (I smell redundancy...) The fuse is the most frustrating element. I don't want to have to replace any components if there is a fault (even a fuse in a housing), so I was working with a PTC resettable fuse. Not only does this have an horrific tripping time (~4 seconds!), it also has a large footprint on the PCB; much too large for me I'm afraid :( I decided it is more beneficial to me to monitor the current and turn off a FET for example, than to crowbar the circuit if such a fault should occur. My question is... A) Is there an IC that can take care of these three elements? I've been looking at battery charger protection ICs but I haven't found anything yet. B) Does anyone have a suggestion about incorporating the over current requirement in my circuit without a fuse? My initial thoughts were to use a sense resistor, comparator and another FET, but I can't help but think the whole circuit could then be simplified a great deal. Thanks for looking. <Q> If you want your circuit to be tolerant of over-voltage, you will have to specify up to which voltage, because your protection circuit must be built to withstand that voltage. <S> If you can afford the drop a diode bridge is a sure way to be polarity independent. <S> You can eliminate the drop by using a relay. <S> For over-current you will have to decide what to do when you detect over-current. <S> Limit the current to the maximum value? <S> That implies a linear element, and hence (lots of) power dissipation! <S> Another option is to cut of the power to your gadget until power is removed. <S> This implies some memory element, a thyristor can be convenient for this purpose. <S> Note that your wish not to have a fuse makes a huge difference in cost <S> : otherwise a fuse + power zener diode would do the reverse and over voltage protection, and a current triggered thyristor crowbar would do over-current. <S> You seemed to be unhappy with the drop for a series diode. <S> You must realize that almost any form of current monitoring will need some voltage drop, and lower drops require a more complex circuit.. <A> Yes. <S> You can find umpteen number of ICs for your requirements. <S> Below is for the Linear Technologies' LTC4361 . <S> All the LTC43 series are one or the other protectory ICs. <S> You can go through the datasheet of the below IC and design the peripherals accordingly for your requirements. <A> It can be quite inexpensive to build your own circuit though. <S> There is a reasonably good article in EDN online <S> which describes a discrete component circuit as shown below: <S> A neat feature of the above circuit is that it operates like a circuit breaker and removes the load from the faulted input. <S> It stays removed until reset via a tact switch or the input power is removed. <S> It is my suggestion that the reverse polarity protection can best be provided via a series Schottky diode in the Vin+ supply line. <S> I also suggest that you design your over voltage detector and over current detector in a manner that leaves the GND of the circuit intact. <S> Someday when your project ideas turn into a real product that you must take off to a lab for emissions and immunity testing you will really appreciate using design techniques that keep a single GND, GND planes and chassis/enclosure references. <A> Try this IC: http://www.linear.com/product/LT4356-1 <S> LT4356-1 and -2 <S> - Surge StopperFeatures Stops High Voltage SurgesAdjustable Output Clamp VoltageOvercurrent ProtectionWide Operation Range: <S> 4V to 80VReverse Input Protection to – <S> 60VLow 7μA Shutdown Current, LT4356-1Adjustable Fault TimerControls N-channel MOSFETShutdown Pin Withstands –60V to 100VFault Output IndicationGuaranteed Operation to 125°CAuxiliary Amplifier for Level Detection Comparator or Linear Regulator ControllerAvailable in (4mm × 3mm) <S> 12-Pin DFN, <S> 10-Pin MSOP or 16-Pin <S> SO Packages <S> You should note that the previously commended LT4361 IC is similar but does not support your input voltage range requirements; many ICs out there are intended to support protection of low voltage supply buses, less support the higher voltage ranges you seek. <S> LTC4361-1/LTC4361-2 - Overvoltage/Overcurrent Protection ControllerFeatures <S> 2.5V to 5.5V OperationOvervoltage Protection <S> Up to 80VNo Input Capacitor or TVS <S> Required for Most Applications2% Accurate 5.8V Overvoltage Threshold10% Accurate 50mV Overcurrent Circuit Breaker<1μs <S> Overvoltage Turn-Off, Gentle ShutdownControls N-Channel MOSFETAdjustable Power-Up dV/dt Limits Inrush CurrentReverse Voltage ProtectionPower <S> Good OutputLow Current ShutdownLatchoff (LTC4361-1) or Auto-Retry (LTC4361-2) <S> After OvercurrentAvailable in 8-Lead ThinSOT™ and 8-Lead (2mm × 2mm) DFN Packages
There are chips that do provide for functions of over voltage detect or over current detect.
Crystal circuit works in breadboard but not in perfboard I'm a beginner and I'm trying to build a digital clock. My clock generator looks like this: circuit http://img189.imageshack.us/img189/855/tempgd.png It works perfectly on the breadboard, where I can see the LED blinking at 2 Hz. However, when I try to solder it on the perfboard, it blinks much faster. I don't have a way to measure, but I'd say something like 10 Hz. I tried to mount three times on the breadboard and three times on the perfboard, and always get the same result. I checked and rechecked the connections, and everything seems to be fine. I have no idea where the problem might be. What could be wrong? EDIT I tried replacing the two 15pF capacitor for two 22pF, but it didn't help. Unfortunately, I don't have access to a oscilloscope to see what's happening inside. Here are the photos of the circuit. The first one is the component side. photo1 http://imageshack.us/a/img405/5062/dsc07884v.jpg The second one is the soldering side. Please excuse my bad soldering, I'm a beginner, and it's a little messy from all soldering/desoldering. However, I tested all connections and the connections are correct. photo2 http://imageshack.us/a/img132/9470/dsc07885l.jpg Additional question: I'm using a 10K resistor. I saw a similar circuit on the internet that uses a 220K resistor in its place. Could that be the problem? <Q> Your plug type proto board adds capacitance to each node of the circuit that is greatly reduced when you attempt to duplicate the circuit onto the perf board. <S> You could try increasing the values to 18pF and then 22pF to see if either change would get your oscillator to settle down and operate at 32.768kHz as you expect it to. <S> It may even be necessary to try 27pF or 30pF as well <S> and it may even be necessary to use different values at each side of the crystal. <A> the net load capacitor's value is too small for 32kHz crystal.since the breadboard has big stray capacitance, it is larger than perfboard. <S> when you setup the circuit on breadboard, the stray capacitance will adding into load capacitor, this will make circuit running normally. <S> try to use 22pF or 33pF replace the two capacitor. <A> This chip has 3 pins that are part of the oscillator circuit. <S> The correct way to connect a crystal is pins 10 and 11 (from the intersil datasheet): <S> As far as I can see from your diagram and photo you are using pins 9 and 11.
It is likely that the 15pF capacitors that you show on either side of the crystal may not be the correct capacitance in the perf board version of the circuit.
Does it make sense to measure components in-circuit in order to prove non-functioning? When an electrical circuit is not working properly does it make sense to use a multimeter to measure/test the individual components in-circuit (without soldering them out), e.g. measure transistor continuity test/ fall of voltages? I am asking myself an in-circuit measure disturbs the result and may lead to false-positive (or false-negatives).What are your practical experiences of finding damaged parts/repairing of an electrical component? I am asking this as an hobbyist with only basic theoretical and practical knowledge - I am trying to repair some devices at my own and like to get more knowledge regarding electrical engineering. <Q> For solder joints give special attention to inductors, transformers and connectors that may see physical stress. <S> Next I start measuring in circuit without power applied. <S> Especially identifying shorted transistors, diodes or blown fuses is easy. <S> When a component looks bad, I go on and if it still looks bad <S> I desolder it to check it again. <S> Only when that fails to find the problem I either scrap the board (depending on how many I have of them) or I desolder more components to check them. <S> Especially electrolytic caps are often bad; when they refuse to charge in circuit and measure couple MΩ out of the circuit it is fit for replacement. <S> Also when they look deformed, replace them. <S> I personally don't like powering up the circuit for measuring, but that is mainly due to the fact that the most circuits I repair are mains power supplies and those tend to bite when I'm uncareful. <A> Generally, trying to measure components in-circuit is of little use. <S> If you know the circuit surrounding something, that can help interpret results. <S> Usually for diagnosing a complete circuit it is better to run it, perhaps with some deliberate stimulus, and look at the voltages at various points. <S> There are some exceptions to the above. <S> For example, resistors in circuit should always read at or below their correct value. <S> If a 1 kΩ resistor is reading 10 kΩ, then you know something is wrong. <S> However, if it reads 120 Ω, then there is no conclusion you can draw. <S> Most of the time you will get the latter, so this method will usually be a waste of time. <S> Another problem is with any stored energy in the circuit. <S> That can distort readings and possibly cause harm. <A> If the design is new then testing components can make sense. <S> If it's a faulty PCB / unit from a proven / working device <S> then I test with the components in circuit. <S> Study of the circuit diagram tells you how the circuit should behave. <S> Unless the device has been abused in some way the components are rarely faulty if your on the end of a production line. <S> Visual inspection, as the others have said, is your friend here. <S> Checks I make to start with are: <S> Check the rails <S> Any voltage references.(Zenner diodes and IC's) <S> Is the circuit receiving what is expected? <S> If op-amp based circuits are used I check the virtual earth's of the inverting circuits. <S> They should be close to 0V or the mid rail if it's a mid rail based circuit. <S> Any that are not I check the outputs are against the rails (If the virtual earth is not 0V / <S> mid rail <S> then the output should be against a rail unless limited by something else). <S> Then I check the input is where it's expected. <S> Then it's feed in changing signals and see what in the signal path is not working. <S> The most common faults are... Bad solder joints. <S> Solder splash. <S> Connectors not making contact. <S> (Include connects wired wrong here and not just broken wires) <S> I once had some jumper pins that were open circuit because the flux had got on the pins and was stopping the jumper from making a physical connection. <S> Both the Test Engineer and I were absolutely stunned. <S> It took a coffee break and ruling out other faults to realise this. <S> Just because it's never happened before doesn't mean it can't happen. <A> I also start with an optical inspection: <S> are there missing parts <S> are there burnt parts or traces <S> are there any obvious mechanical issues (heatsinks, evidence of physical abuse, etc.) <S> After this, I usually probe around as-is (no parts removed) and look for obvious signs of trouble: diodes that don't act like diodes things that aren't low resistance that appear as low resistance (like actual resistors or capacitors, power supply rails) <S> MOSFET body diodes that aren't there <S> I also try doing selective power-ups of the various power rails using a current-limited external power supply, to see if a rail is drawing excessive current or no current at all (usually both are "bad signs"). <S> This sort of probing does require knowledge and judgement, as Olin indicated, and as your question stated. <S> It's much harder blindly troubleshooting something without a schematic vs. troubleshooting a familiar or well-understood circuit. <S> I find that doing some work before pulling parts out often helps narrow down the candidates for removal, saving time and unnecessary wear-and-tear. <A> I'll answer the direct question as posted: <S> Can you test components (implying component values) in circuit? <S> The TLDR version: sort of mostly. <S> There is a technique called signature analysis which applies stimulus to a board while unpowered <S> and then it compares the V,I vs. frequency response (amongst other parameters) against a known good board for evaluation. <S> which is just one device <S> I'm aware of, I am sure there are others out there. <S> If your circuit is simple enough then you could apply similar techniques if you have a voltage/Current source (waveform generator) and a Oscilloscope.
There is no right or wrong in troubleshooting a circuit as long as you are aware of what you may be measuring and as long as you don't blow any other components (or zap/hurt yourself) while you're on it. I always start with a good visual inspection for blown components and bad solder joints. One device that does this is a Huntron Tracker
How do I get started with PIC programming? So I opened up a big bucket o' worms asking this question . Two of the answers mentioned that instead of using a 555, a PIC10F200 or PIC12F675 may do the trick. Now, I've been spoiled with Arduino's programming interface...and have looked at this answer , and I want to expand on it a little bit. Mainly, I need someone who knows what they're talking about to confirm ro redirect my assumptions. Assumption 1: There's some universal language for programming. It's likely assembly or some such. Assumption 2: There's likely some software for PC that will allow me to write the program, and possibly even debug it. Assumption 3: There's likely a USB or serial device that takes the completed code from my PC and flashes the chip. If I'm working with DIP-8, DIP-14 and DIP-28 chips at different times, is there some kind of universal IC flasher? or do I need a separate device for each chip? What are some of the other questions that I need to be asking or pitfalls of which I need to be aware? <Q> Today, one way to get started with PIC programming, for about 35 dollars (plus ten dollars shipping) <S> you can get the PIC24F <S> Microstick 3V. <S> To program this, you download and install MPLAB environment, and add the separately downloaded MPLAB C30 compiler. <S> The Microstick is a tiny board "about the size of a stick of gum" with a USB port to plug into your PC. <S> With this you can program the PIC, examine memory, run the code, and debug with breakpoints and single-stepping. <S> The device comes with headers you can install so that you can plug it into a socket on your own board, so there is no need to transplant the chip between the stick and your environment. <A> There are many different ways to learn about specific topic however you can start reading books and knowing the main features of Microcontrollers, what is it?,learning about Risc vs Cisc Architectures,..etc. <S> I recommend you this : http://www.amazon.com/PIC-Microcontroller-Personal-Introductory-Course/dp/0750666641/ref=sr_1_1?s=books&ie=UTF8&qid=1364953188&sr=1-1&keywords=microcontroller <S> Assumption 1 <S> : There's some universal language for programming. <S> It's likely assembly or some such. <S> As you know microcontrollers and humans communicate through the medium of the programming language called Assembly language. <S> The word Assembler itself does not have any deeper meaning, it corresponds to the names of other languages such as English or French. <S> In the practical world we have many didferents language but the comon used is C/C++,Vbasic . <S> Assumption 2 <S> : There's likely some software for PC that will allow me to write the program, and possibly even debug it. <S> if you've the proper elements (microcontroller,capacitors,resistors..etc for your project) you will need a programmer for flash or load your instructions in the chip,i know mplab is a Windows program package which enables easy program writing as well as easy program development. <S> It is best to describe it as development environment for a standard program language designed for PC programming. <S> MPLAB technically simplifies some operations consisting of a lot of parameters, which, until the IDE environment* appeared, were executed from the command line. <S> You Can use for debuging porpouses,besides you could use Proteus for the simulation,and do the design. <S> Assumption 3 <S> : There's likely a USB or serial device that takes the completed code from my PC and flashes the chip. <S> If I'm working with DIP-8, DIP-14 and DIP-28 chips at different times, is there some kind of universal IC flasher? <S> or do I need a separate device for each chip? <S> Programmers : <S> http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2519&param=en534451 I've used pickit3 is usb for the connection. <A> I like TI's MSP430 Launchpad . <S> You program it in C/C++ (or <S> assembler).The launchpad (ships with 2 microcontrollers) costs less than 10 USD <S> The launchpad connects via USB to the PC ( <S> Windows and Linux work, <S> Mac OS X will possibly work - <S> I have not tried - with some components requiring compilation). <S> Once the microcontroller is programmed you can take it off the launchpad and use it on your own PCB/stripboard/breadboard.
- you get a free license for a Windows IDE (Eclipse based tool called Code Composer Studio, limited in compile size), or you can use a GCC toolchain under Linux.
Can anyone locate specs on this wifi module? This little module was liberated from a Canon wifi enabled printer that decided not to work anymore. It appears to bear the label "Product Number: K30306" at the upper left, which naturally was the first target for a thorough googling.. as were all the other numbers that looked remotely like part IDs. Sadly this did not yield the expected results. Probing the connector on the printer's motherboard did not reveal any obvious power rails; apparently this printer doesn't turn on the wifi unless it's happy, i.e., not generating a terminal error code. If I were to speculate, I'd guess that the two twisted pairs might be USB and the 5th wire a special line for powering the RF sections. Hopefully someone has run across this module or something like it before and can shed some light on how to make use of it. Fwiw, the printer was a Canon pixma mx860. <Q> Your assumptions are close :D. <S> It doesn't turn on the wifi unless you go through the menu to enable wifi and add the ap settings and all. <S> Based on the FCC ID AZDK30306 (AZD is the Grantee Code <S> , K30306 is the model), searching on The FCC ID page, it's 3.3v (not 5v tolerant), no internal regulator. <S> Peak 0.6A. <S> Based on USB. <S> Full 802.11b/g support. <S> Pins from the left to right (facing the connector, on the top side): <S> Gnd D+ D- VCC Gnd <S> There are some internal pictures, of the thing with the rf shield off, but they are low res, so can't read the labeling on the three main ICs for more info, but the sheet says it's a arm based . <S> Unless the USB vid/pid pair is a common one, finding drivers will be, well, ice cube in hell. <S> I doubt there is standard Windows drivers available for it, being a wifi module only meant for two specific types of printers. <S> Looks like there was probably a mistake in them providing the datasheet, but even then, based on the pictures of the module online <S> , it was obvious that the two outside pins were ground, <S> the VCC was the second pin from the right <S> was vcc (big trace on top and bottom [under the sticker]). <S> Leaving the last two unknown, but considering how often manufacturers have moved to modular design with usb as the connection of choice, I would have guessed usb anyway. <S> That's being used for everything from internal webcams, touchpads, keyboards, character lcds, etc. <S> USB is just really convenient. <A> Although maybe a bit late, here's the chipset from the board. <S> Hope it helps :) <A> I plugged this module into my Ubuntu Linux machine, and it worked perfectly. <S> I was able to connect to my wifi network right away. <S> (Of course I put a 3.3V regulator on Vdd since the 5V from USB is too high)
My Mac recognised it, but doesn't have any drivers for it.
2 × 20 pin SMT to DIP adapter? I want to adapt a 40 pin SMD (0.5mm pitch) for usage on a breadboard. Are there any adapters available that I can use together with a simple soldering iron? Already I found the SchmartBoard adapters, but they only are available up to 2 × 14 (28 leads). <Q> Ready made? <S> Maybe. <S> Based on the pin pitch and relative width of the adapter, Look for 0.5mm pitch tsop (or tssop) <S> 40 and 48 pin adapters. <S> There is 0.65mm pitch tssop as well, avoid those. <S> You can find these in most common places (ebay/dipmicro/digikey/etc). <S> You could also try your hand at pcb design, and have a board made at a pcb fab. <S> Oshpark is good/cheap for small boards, while Seeed has a decent ten (you'd often get 12) <S> 10x10cm board for 9.90 plus small shipping. <S> You could make a board specific for just adapting that socket, or make a board that holds everything you want, microprocessor and regulator and whatever. <A> The reason they may not have shown up in casual searches is that the common pin count in that range is 48 pins (24 x 2), rather than 40 pin. <S> Alternatively, look for two pieces of 0.5mm pitch, 20 pin FPC to DIP adapter boards , and use them facing each other, if the distance between the two rows of contacts on the SMD part is too much - as it appears it would be from the photograph in the question. <A> The guys as SchmartBoard pointed me to their 202-0007-01 , which I have missed. <S> It supports SMDs with up to 72 pins. <S> So it's quite a bit bigger than necessary.
There are indeed 0.5mm pitch SMD to DIP adapter boards available on sites like eBay.com for around $2.75 with free shipping:
How should I search up parts for basic hard-wired computer? (really basic, no, more basic than that) I'm looking to build a computer the size that I can use small jumper cables for the programming, no soldering . Of course it won't be able to do much more than binary counting, etc. What kind of parts would I use? I would like to assemble inverters and diodes to build the AND gates, XOR gates, etc . on my own. I would however need a way to ensure consistent timing , so I would need a CPU clock, and it would need to be slow enough for debugging purposes. For those of you who have built computers inside the Minecraft game, that is what I have in mind, except I want it in the real world. Can you point me to the right class of parts that I should be using? I would like to keep everything on the surface, so I don't want to buy pre-built XOR gates, for example, I would like to keep it to diodes and inverters and then whatever timing mechanism I would be needing. Actually I was tempted to use magnetic relay switches for the AND gates, cause it makes that cool clicking sound and has an inherent delay. Can you outline what I need to build such a computer? <Q> You're going to need a lot of space. <S> http://www.homebrewcpu.com/ is an example of someone who's done this with wirewrap and TTL logic, not individual transistors. <S> If you're serious about doing this, and don't want to solder, wirewrap is a good option. <S> Another example: http://www.nzeldes.com/HOC/Handwired.htm . <S> Wirewrap is easier to undo than solder, has less risk of damage to parts. <S> It takes up more space and isn't good with high speed signals, which is why it's fallen out of use. <S> As for components, you'll need transistors. <S> The NMOS 6502 CPU has about 3,500 of them. <S> If you buy through-hole 2n3904 on digikey that will cost you about £60 and a lifetime of assembling them. <S> The relay option could lead you to duplicate the Zuse Z4: http://en.wikipedia.org/wiki/Z4_(computer) <S> (attractive wooden cabinetry and 4kw power supply not included). <S> Clocking is the least of your worries; you could start with a pushbutton actuated by a cam on a cranking handle, giving you a variable rate of a few Hz. <A> So you want to build a computer using discrete transistors? <S> Like: <S> http://hackaday.com/2011/02/28/2-bit-full-adder-using-just-thirty-six-555-timers/ http://hackaday.com/2012/04/20/building-a-computer-with-discrete-transistors/ <S> http://www.waitingforfriday.com/index.php/4-Bit_Computer <S> http://hackaday.com/2010/01/11/194-transistor-clock-will-blow-your-mind/ <S> http://hackaday.com/2009/10/30/processor-built-with-transistor-transistor-logic/ <S> Not all of these are pure transistors, but they use ttl chips, which you can easily build using discrete parts. <S> If you are into killing time with mindless tedious repetition. <S> Have fun. <A> Note all the wires! <S> One would not want to get a tool or hand underneath a bunch of those and accidentally pull some out. <S> Obviously you could make a less capable computer using the same type of breadboards and a lot of transistors. <S> You could use these male-to-male jumpers for programming.
Because of your requirement that there can be no soldering, you might want to look at the Duo Adept , which was constructed using 100 mostly TTL chips and 17 solderless breadboards.
Can I connect a "J1708" port to my computer? This question is related to another question I posted here on the new Reverse Engineering site. I'm working with a small public transit agency on a neat open-source project that will help us to offer realtime data to local developers. A key piece of data we need is the current bus route a given vehicle is on. Currently, there is only a single electronic system that knows this information: the vehicle logic unit (VLU) that each vehicle is equipped with. When a bus driver begins a route, they type its ID number into the keypad on the operator control unit (OCU). This ID number is sent to the VLU, which then displays the appropriate text on the LED signs on the bus. On the OCU, there are two DB9F ports. In the manual, they are described as "J1708 PORTS". One of them is connected to the VLU, and the other one is available for me to plug in to. Connecting to it gets me some data that you can read about in my other question . Essentially, I'm questioning whether my computer is even properly hooked up to the OCU. Currently, I'm just running a plain old 6ft Straight Through Serial Cable (DB9 M/F) between my computer's serial port and either of the "J1708 PORTS". I can consistently get the same data this way, but I'm beginning to doubt that the data is being properly... transmitted? I am now fairly certain that I'm using the wrong cable or something. Here's a diagram of the cable that is running between the OCU and the VLU: J1708.png Do I need a similar cable to connect the OCU to my computer? If so, why is it still sending me non-random data when I use a plain old straight through DB9 cable? <Q> The SAE J1708 protocol is a low level protocol designed for use in heavy vehicle applications and is based on RS485 but using pull-up/pull-down resistors instead of line termination (hence the RTX+ and RTX- pins shown in your cable diagram). <S> The protocol is basically 8N1 serial, but messages are separated from each other using an idle timeout ( <S> minimum 10 bit times - at 9600 baud <S> this works out to be 1.25milliseconds). <S> Messages consist of one message identifier (MID) followed by one or more data bytes and a checksum byte. <S> The checksum should be the two's complement of the eight-bit sum of the MID and all the data bytes (a message is considered valid if the eight-bit sum of all the characters including the MID, data bytes and checksum is equal to 0). <S> The total message length cannot exceed 21 bytes. <S> You cannot connect this directly to your PC without at least an RS485 to <S> RS232 converter <S> - you can get away without the pull-up/pull-down resistors for testing but should ensure that any termination resistor is open. <S> Looking at this cable diagram it looks like you've got one side of the bus connected to the PC <S> RS232 receive pin (RXD) and the other connected to data carrier detect (DCD). <S> While your signals are way outside the range defined by RS232 <S> I suspect there will be enough of the signal to cause the port to see something. <S> IMHO the J1708 protocol has been poorly designed, particularly for noisy environments as automotive systems tend to be. <S> There is no clearly defined header value (the MID is binary and all values are valid), <S> the is no clear packet length indication <S> (this is much worse when combined with J1587 which is the most commonly used higher level protocol) and the checksum will still be correct if two or more packets are joined together (which is very easy to do without decent idle detection hardware). <S> A simple interface circuit for your requirements (receive only) is shown below. <A> Warning: <S> J1708 is not the same as RS-485! <S> The only time you can use an RS485 port on the J1708 bus is if you NEVERtransmit. <S> The receiver is compatible but the transmitter is not. <S> But since some of the data you would likely want to see is "by request", you will need to transmit and that is where it gets more complicated. <S> And also, as timrorr said in his excellent answer, there are tight timing considerations as well, so even if you are just reading, you are likely to have timing issues as he described (because messages are separated by idle time, requiring some other high speed interrupt in your computer hardware to detect the message separation pauses) <A> According to Wikipedia, J1708 is based on a physical RS-485 port. <S> There are many RS-485 interfaces available out there. <S> There are also resources to build RS-232 to RS-485 interfaces yourself. <S> This may help with your reverse engineering activities.
So if youjust want to read the data, any RS485 interface should be okay (just don'ttransmit). Due to the nature of the J1708 protocol however this should not really be used in conjunction with an RS232 to USB converter as these generally play merry havoc with the signal timing when converting the RS232 stream into USB blocks, and can cause two or more packets to be combined.
Circuit that can convert current pulses to voltage I have an anemometer which outputs current pulses. I can't take it apart but I know there is a phototransistor and LED in parallel shining through holes to it. I was told that with 30m/s wind there will be 3uS long current pulses over the normal current (through the LED). My problem is to transfer these pulses to an Arduino or convert these pulses to voltage 0/1. Arduino is no problem for me, but I am inexperienced in circuit design. <Q> You don't want a "frequency to voltage" conversion. <S> That tends to be tricky, error prone, and generally a hack of a solution. <S> What you really want is to run the pulses directly into the MCU and measure the frequency directly. <S> Here is an app note on exactly how to do that with the AtMega MCU's. <S> How you actually do it with the Arduino software is something I can't answer. <S> AVR205: <S> Frequency Measurement Made Easy with Atmel tinyAVR and Atmel megaAVR <A> Without specs, we don't know if there's a one-shot making 3us <S> (?) pulses twice per revolution (based on the mechanical diagram) or the pulse entirely controlled by disk cutouts. <S> But what you can count on is two pulses per revolution. <S> It's unlikely that the pulse frequency would overwhelm an Arduino (if it does, you've got bigger problems than electronics!) <S> so you could count pulses in a simple loop. <S> Take a f'rinstace: a 1KHz pulse train means 1ms interval between pulses. <S> Remember, we're just counting them, not measuring them, so a grossly inefficient loop could certainly keep up with it. <S> 1000 <S> Hz would imply an anemometer speed of 500 RPS = 30000 RPM! <S> Your anemometer would disintegrate before then. <S> So pulse counting won't be a problem. <S> You can decide whether you only need the Arduino to count pulses or to do some heavier processing with the result. <S> In the latter case, read the the data sheet about counter-timers (chapters 15-17 for the ATmega328p, f/ex). <S> By using a counter timer, the hardware will count for you while your program only has to read the counter value every so often to find the speed, and its entire processing power is available for whatever else you want to do with the data. <A> There is some confusion here <S> so I looked at the picture linked to by the OP(below) <S> That's the only explanation I can think of. <S> Given also the assumption that the LED is driven with an asymmetrical duty cycle up to possibly 100 times the mark period, it might be feasible to construct a circuit that converts the pulse trains into a positive voltage and when the opto is "shut" it returns 0V. <S> Maybe something like this: - <S> Therefore I would (given all the assumptions and reading between the lines) propose that the photodiode in the opto-coupler is buffered with a transimpedance amp and then its output feeds a conventional AM detector built around a diode, resistor and capacitor. <S> This output then feeds a comparator/data slicer and is then suitable for an Arduino input <S> To make things less hardware intensive on the analogue side the pulse train from the transimpedance amp could directly feed an Arduino input and the software can "construct" a demodulated version which can be counted. <S> The counter would be two pulses per rev (assuming the picture is representative) and this should translate to wind-speed. <S> I say "should" because there is likely to be a non-linear relationship between wind-speed and rotational speed. <S> Good luck with this project.
If the duty period of "something" is 3us then it just can't be caused by the gaps in the spinning wheel - it has to be that the led is pulsing as a means of providing a counter-measure to normal sunlight getting in.
Is it possible to reduce the number of capacitors in the ft232h recommended configuration? I'm trying to design a board as small as possible. I'm trying to minimize the number of components I need. My design is based off the self powered configuration of the FT232H chip. I've decided to use ceramic instead of tantalum caps(I'm aware of the repercussions). http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232H.pdf So my question is, could I reduce the amount of caps safely(why)? <Q> Trust me, a datasheet configuration doesn't guarantee good operation. <S> You may find that you'll need more, not less, capacitors in various places - the layout is said to contribute the equivalent of half of your BOM in unexpected parasitics and interactions. <S> I would suggest not deviating from the initial configuration on your first pass. <S> Also, avoiding tantalum where practical is a good approach. <S> Ceramics are safer if the board is handled and built properly (mechanical stress is their only real weakness). <A> I agree with Madmanguruman - layout and caps on a lot of digital stuff can cause hours of heartache. <S> So you want to design as small as possible - If it's a four layer board then consider mounting some components underneath chips on the reverse side - I'm assuming "small as possible" means chiefly board dimensions first and foremost. <S> If you are also worried also about board height issues then ignore my recommendation. <A> The only caps I can see that you can safely reduce would the the three 0.1uf caps between VIIO and Gnd. <S> They are in parallel, and having three of the same value would mean they are filtering out the same frequencies if any. <S> A single 0.3uf cap would just as easily replace all three. <S> The other caps, all coming from the internally regulated 3.3v rail, are after an inductor, and are different values, so they would be there to smooth out the regulated line down to the needed voltages. <S> You may be able to skip the 0.1uf minor decoupling cap, but not the 4.7uf. <S> As @Relianthe pointed out, the layout has pins grouped by function. <S> The VCCIO pins are not together, so each should have it's own decoupling cap.
You can always test removing some caps and if the performance is acceptable, leave them not populated in the final product.
Controlling LED with microphone input I know this is an extremely simple question, but I haven't been able to figure this out on my own. I'm trying to get an LED to get brighter as ambient sound rises. What I've come up with: use a transistor, attach the base to the electret microphone (that's the part I'm not sure how to do), then have the circuit for the LED pass through the collector and emitter. Would this work? Would the LED brighten continuously? Most importantly, is there a better way to do it? The goal of this is to visualize the interference pattern created by two speakers. I'll have a camera set up using a long exposure, move the circuit around the lab area, and hopefully the bright spots in the picture correspond to points of constructive interference. <Q> Why think "one LED"? <S> An LED VU meter has a bunch of leds that progressively illuminate as sound gets more intense. <A> I'm not sure just a transistor will produce the gain you need. <S> It'll be safer to use an OpAmp. <S> Also put a resistor between the LED anode or cathode and the other side to protect it. <S> But even then, it'll not work as you expect because it won't be continuous; it'll respond to the sound waves, so it'll blink, rise and fade quickly. <S> You could use a capacitor between the OpAmp output and the ground to reduce this effect, but to have exactly what you want it'll need a more complicated circuit. <S> For instance, a cheap microcontroller with an ADC input and a program to calculate the average input level, and a PWM output to feed the LED. <A> Also consider a cluster of LEDs. <S> This is how most LED bicycle lights work. <S> Controlling the LEDs with a small microcontroller is likely the most adaptable solution.
Changing the duty cycle on one LED will give you some brightness control, but changing the number of LEDs simultaneously lit will give a much greater range.
ArduinoISP fails with Atmega368, 168 - Device signature = 0x000000 So, apparantly this is a common error, which many people have fixed many different ways, none of which have worked for me. I have two different Arduinos - an NG and an Uno, with an Atmega168 and 328 respectively. Both of these have the bootloader burnt onto them. I'm looking to burn the Arduino bootloader onto another 2 Atmega328 chips I purchased (from Digikey). So, I set up the connections as given on the Arduino site , using the NG's 168 to program the new 328 that I put onto the Uno. It doesn't work, and running avrdude -C "path\to\avrdude.conf" -p atmega328p -b19200 -P COM5 -c avrisp -v -v -v returns avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "I:\Users\Collin\Documents\Arduino IDE\hardware\tools\avr\etc\avrdude.conf" Using Port : COM5 Using Programmer : avrisp Overriding Baud Rate : 19200 AVR Part : ATMEGA328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : STK500 Description : Atmel AVR ISP Hardware Version: 2 Firmware Version: 1.16 Vtarget : 0.0 V Varef : 0.0 V Oscillator : Off SCK period : 0.1 usavrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.05savrdude: Device signature = 0x000000avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.avrdude done. Thank you. Here's everything I've done. Each step resulted in the same error when running the aforementioned command. Thinking maybe it was an issue programming using the NG or the 168, I rearrange things so that I'm using the Uno - with a 328 - to program a 328 in the NG. I then try every permutation of board and chip. Thinking that maybe I had bricked one chip with all the shuffling, I tried a different (new) 328. Thinking maybe both had arrived DOA, I tried with my known-good 168 chip. Tried it with the known-good 328 ship. Thinking that I had just wasted an hour when one of the wires I was using was intermittent, but they all tested good, and swapping them out with others made no difference. Thinking maybe there was something wrong with one of my boards, I dropped a fresh 328 onto a breadboard and set it up as instructed, using the Uno+328 to program. Tried the same with the NG and 168 as ISP. Tried different programmer settings ( -c arduino , avrisp , stk500 ) Tried various settings of -B ### with avrdude Tried lots of the above on a Mac and a PC Tried using an external 5V source Tried adafruit's fork of ArduinoISP Tried optiloader loaded onto either board - got non-descriptive error 0x0 When programming with the Uno, pulled the reset pin high (165 ohms) When programming with the Uno, attached a 100uF capacitor between ground and reset I know at least some connection is being made between the two chips as, when programming with the Uno against the NG, if I don't hold the Digital 10/Reset pin to pin 1 of the target chip, I get a stk500_disable(): protocol error, expect=0x14, resp=0x51 error. And yes, at the end of this both original chips are still working fine, so I don't think I've messed either up them up despite all of this. Here's a picture of one of my setups - yes, the yellow wire is indeed to reset, not 3v3. Lower NG board is supposed to be programming the chip in the upper Uno. <Q> The only thing that worked for me was to follow this tutorial: http://3g1l.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno <S> One very important note: Even though the tutorial concentrates on the minimal setup, for some chips (depending on the supplier) it works ONLY WHEN you add the external oscillator and the two 22pC. <S> The tutorial also shows a 10k resistor between reset and 5V rail. <S> The missing components might make your setup(the one from your picture) work too. <S> Many users stated in their comments that they got the exact same error as you until they added the oscillator: this might be it!!! <S> Hope <S> it helps - I struggled for a day before finding this <A> For me it was the version of the arduino UNO that made a difference. <S> I've tried with a more recent one and everything is fine now. <A> Couple of other things that could be going wrong with it: <S> This person also had trouble with the reset line. <S> A different sketch to program via Uno is recommended. <S> Hopefully it's just the reset line on the Uno, but if it isn't... <S> That page reminded me that most bootloaders set the fuses on the target chips in such a way that they no longer function without the external crystal (plus the two small caps to ground from the lines to the crystal). <S> So if you ever successfully started to upload, you have likely set your fuses for external crystal, which just means you'll have to aquire a 8/10/16/20 crystal plus some small caps to resuscitate your ATmegas. <S> This does not apply to the ATmegas when they are in NG or Uno, but the NG is problematic anyway in that the RESET line is not easily accessible. <A> The line "avrdude: AVR device initialized and ready to accept instructions” actually demonstrates that at least your first SPI transaction completed successfully. <S> Something that could help diagnose the problem is the output log if you pass <S> -v -v <S> -v -v to avrdude. <S> You could also pass the -t -F <S> option to avrdude and poke around a bit <S> (e.g. to see what the fuses read as). <S> Don’t try any modifications when operating with -F , though. <A> The ATmega328 and the ATmega328P are not the same thing - they are actually slightly different, so if you're using the wrong one it'll fail the signature check. <S> When you call avrdude, change the target-chip type to match the actual chip type you're using. :) <A> I had the same issue when using Arduino ISP to reburn Arduino bootloader into a Nano board (also m328p). <S> However, there was another application in it (AmForth). <S> Although avrdude complained about invalid signature 0x000000, the chip was working normally (I just wanted to reflash it back to Arduino). <S> There was no possibility to get through with Arduino ISP. <S> Luckily I had a USBasp in my drawer and with this programmer everything worked normally, absolutely no problem. <S> What puzzles me is that USBasp itself is based on AVR chip, so I don't know exactly what is wrong with the Arduino sketch. <S> Perhaps the overhead in Wiring in the Arduino ISP breaks the timing, while in USBasp there is a normal program written in assembler and hence no overhead and unnecessary time delays. <S> The basic precondition of success is that fuses are not blown wrong (i.e. no external clock settings). <A> Okay. <S> Try doing the connections given(look at the last picture with external oscillator and caps) on the ArduinoISP page <S> I'll edit the answer with pictures later.
if you are getting a signature verification error, you need to the signature of 328p in avrdude.conf file and fool the arduino IDE so that it uploads the bootloader onto the barebones 328p.
No previous knowledge of programming, considering electrical engineering I am still at school and wont finish until 2015 but i have seen people control doors, toy cars etc with their iphones and i really want to get in to something like that. I have a lot of spare time and was wondering where i would start, i want to try some projects that help my understanding of electronics and also help me decide if this field is really for me. I have no idea how they control toy cars, doors, tv's so i would really appreciate it if someone could guide me in the right direction. <Q> While this question is not within the norms for this site, it is one frequently asked, so here is an outline, take it where you will: It would behoove you to get a couple of books to gather a preliminary understanding of electronic design in general, e.g. Practical Electronics for Inventors, Third Edition , Starting Electronics Construction: Techniques, Equipment and Projects , Getting Started in Electronics <S> Read up on the various hobbyist electronics sites, and forums of hobby-friendly electronics platforms (such as, dare I say it, Arduino ) to see what people are doing in areas like controlling RC cars and remotely locking doors. <S> This article is interesting reading, and might provide you insight on why a site like this one isn't the ideal place to start. <S> Subsequently, with some clarity on a project to take up, this site would be useful for asking specific questions around a problem being faced, so long as the questions demonstrate good initial effort towards solving the problem. <A> You'll meet people at all levels of expertise with varied onterests who will be only too willing to help you along. <S> Plus you'd likely have use of a larger kit of tool than you'd likely want to own initially. <A> Figure out what you have a passion for doing and start there. <S> If it's photography, make camera control gadgets for panoramic pictures or remote control or automation for wildlife photography. <S> I can't see anyone get passionate about door openers but <S> maybe that's just me... <S> But when you encounter difficulties and you will , that passion, whatever it is, will drive you on to actually get through them and get it working. <S> Plus that way you may discover a niche <S> need that enough other people share, to build a viable product or business around.
See if there is a hackerspace or other hobbyist group nearby.
Are E and B fields in phase in electromagnetic radiation? I recently wrote this answer , in which I said: Radio waves are electromagnetic radiation . Electromagnetic radiation contains of two components, one electrical and one magnetic. These components create each other, as said above. The red magnetic field creates a blue electric field, which creates the next magnetic field, and so on. I got this diagram from wikipedia, but my physics book and Jim Hawkins WA2WHV give the same diagram. In the comments, a discussion followed: Olin Lathrop : Your first diagram is wrong. The B and E fields are actually 90 degrees out of phase with each other, not in phase as the diagram shows. The energy is constantly sloshing back and forth between the E and B fields. Keelan : Are you sure? Wikipedia and my physics book show different. The two fields should have a fixed ratio, I believe, which cannot happen when out of phase. One field is horizontal and the other vertical, there's a 90 degrees angle - the diagram is an attempt to show three dimensions. Olin Lathrop : Hmm. I always understood them to be in quadrature, but I don't have time to look that up right now. This could be a case of one bad diagram blindly copied by lots of others. Where is the energy when both fields hit 0 in your diagram? In quadrature, the sum of the squares of each field's amplitude is a constant, which gives a good explanation of how the energy can persist. It sloshes back and forth between the two fields, but its total is always the same. I follow Olin's logic and can't say myself why the fields would be in phase. So my question is: are the E and B fields of electromagnetic radiation in phase or not? How can one understand this? <Q> The complete derivation from Maxwell's equations fills entire college-level textbooks, and is too involved to get into here. <S> But when considering radiation from an antenna (a current flowing in a linear conductor), it boils down to the fact that there are several distinct components to both the E (electric) and H (magnetic) fields around the antenna. <S> For the H field, there is one component that is proportional to 1/r 2 and another that is proportional to 1/r. <S> For the E field, there are three: a 1/r 3 component, a 1/r 2 component and a 1/r component. <S> The 1/r 3 term is the dipole electrostatic field, which represents the energy stored in a capacitive field. <S> Similarly, the 1/r 2 term represents the energy stored in an inductive field. <S> This represents the "self inductance" of the antenna conductor, in which the magnetic field produced by the current induces a "back EMF" on the conductor itself. <S> Only the 1/r term represents energy that is actually carried away from the antenna. <S> Near the antenna, where the 1/r 3 and 1/r 2 components dominate, the phase relationship between E and H is complicated, and these fields do indeed store energy in the manner that Olin describes, and return energy back to the antenna itself. <S> However, in the "far field" (e.g., more than 10 wavelengths away from the antenna), the 1/r components of the fields dominate, creating the propogating electromagnetic plane wave, and these components are indeed in phase with each other. <A> The impedance of free space is constant. <S> Its value is proportional to the ratio of E and H. <S> It is a resistive quantity which means E and H must rise and fall in magnitude together. <S> Wikipedia: - <A> The confusion stems from the fact that they (the instantaneous electric and magnetic vector fields) are 90 degrees apart in space, not in time. <S> That is to say: \$ <S> E \cdot <S> B = 0\$ , <S> and \$ <S> E <S> \times <S> B \$ is the direction of propagation (the poynting vector). <A> Suppose we're given an electric field propagating in the \$\hat{z}\$ direction, \$\vec{E} = \hat{x}E_0 <S> \cos\left(\omega t - kz\right)\$. Maxwell's curl equation relating the electric and magnetic fields is given by,$$\nabla \times \vec{E} = <S> -\frac{\partial}{\partial t}\mu\vec{H}$$This essentially relates the spatial derivatives of the electric field to the time derivative of the magnetic field. <S> If we look at this equation, in order to find \$\vec{H}\$ we'll have to take the space derivative of \$\vec{E}\$ and then to find \$\vec{H}\$ <S> we will have to integrate that same function over time, so essentially we end up with the same time-harmonic function we began with. <S> Due to the negative sign on the time derivative of \$\vec{H}\$ we end up with the electric and magnetic fields being technically 180\$^\circ\$ out of phase, but they aren't in the same plane in space either. <S> Basically, diagrams like the one linked in the question can be nice for visualizing the fields in space, and if you look carefully you can see the field phasing. <S> Looking at the equations can be just as revealing though, and if you go through the math Maxwell will give you the answer. <A> To quote the Wikipedia : <S> The electric and magnetic parts of the field stand in a fixed ratio of strengths in order to satisfy the two Maxwell equations that specify how one is produced from the other. <S> These E and B fields are also in phase, with both reaching maxima and minima at the same points in space (see illustrations). <S> A common misconception is that the E and B fields in electromagnetic radiation are out of phase because a change in one produces the other, and this would produce a phase difference between them as sinusoidal functions (as indeed happens in electromagnetic induction, and in the near-field close to antennas). <A> Voltage is not dependent on magnetic field but on its rate of change. <S> Therefore induced voltage is highest when magnetic field is zero, when its derivative is highest. <A> Yes they are in phase or -180 <S> ° phase as pointed by "Captainj2001" when using the Maxwell equation to demonstrate it. <S> I actually learned it with the wrong 90° phase between \$\vec{E}\$ and \$\vec{B}\$ (or \$\vec{H}\$ ), but now I am convinced after following the reasoning of Maxwell equation. <S> Another way of seeing the need of \$\vec{E}\$ and \$\vec{B}\$ for being in phase is that is the only way to keep \$\vec{E} <S> \times <S> \vec{B}\$ (Pointing vector) in the same direction. <S> And this has to happen since the Pointing vector is always aligned with the propagation of the wave. <S> So for instance if the wave has only \$Ex\$ , \$By\$ components and the propagation is in positive \$\vec{z}\$ direction, then \$\vec{E} <S> \times \vec{B} = <S> \hat{z}Ex By\$ can only have this direction if \$Ex\$ and \$By\$ are either both positives or both negatives. <S> And the last conditions may only happen if \$\vec{E}\$ and \$\vec{B}\$ are in phase as can be easily checked in the initial picture.
For constant energy in an EM wave, we need the magnetic component and the electric component of voltage to be 90 degrees out of phase : thus we need the effect of the magnetic field to be greatest when the electric field is 0; this happens when the fields themselves are in phase.
Simulating Altera FPGAs with an old version of ModelSim? I'm hoping to do some development work on Altera FPGAs that will likely be larger than is supported by the free edition of ModelSim. I have an old copy of the full version hanging around (version 6.5, I think) -- is this likely to work for designs with modern FPGAs (e.g. Cyclone IV), or do I need to upgrade? <Q> Well theoretically it should work, the only thing you need to do is to compile your libraries in modelsim. <S> One thing I don't understand is why do you think your files would not work with modelsim? <S> Is it because you are using Verilog 2001 or syntax that is not supported?As long as your code is written in high level language like verilog and VHDL, you will be able to fix it <S> so it can work with older version of Modeslsim. <A> If you are not using any vendor-supplied cores, then it doesn't matter what device you are using. <S> If you have vendor cores, then as long as you have the source to any cores you are using and can compile them in the old tool (which is likely as most vendor cores only use VHDL-93) there should be no problem there either. <S> Device specifics matter a lot more in synthesis than simulation. <A> Watch out if using Altera QSYS for system assembly, the generated interconnect uses some SystemVerilog which will probably not be supported by MSim 6.5. <A> The latest version of Quartus web edition is free. <S> http://www.altera.com/products/software/quartus-ii/web-edition/qts-we-index.html <S> I doubt your version of Modelsim will work with any of the Cyclone series.
As long as the VHDL you write is supported by the old tool, you should be fine.