text
stringlengths
83
79.5k
H: Verilog code question I'm new in Verilog and I need to create a module that when Entry=1, it will increment 5'b000100 in the "Money" output. This is the code that I made, but it's not working properly. The program it's not storing the total of the money(that's what I want my program to do). For example, Everytime a person enters a football stadium, she pays for the ticket, and my machine will store the total money gained. The maximum of people that can enter the stadium is 15 (thats why I used 6 bits, because 4*15=60) My "machine" isn't storing the total earned. My code module Machine_Money(Entry, Money); input Entry; output [5:0] Money; reg [5:0] Money; always@(Entry) begin Money = 6'b000000; if (Entry) Money = Money + 6'b000100; end endmodule Thanks. AI: always@(Entry) begin Money = 6'b000000; if (Entry) Money = Money + 6'b000100; end Whenever the Entry input changes, you set Money to 0, then maybe add 4. So Entry will always be either 0 or 4. You might want to put the Money = 6'b0 line within an if (reset) or you might want to move it into an initial block or remove it altogeter, or whatever, depending what functionality you actually want.
H: Why is it safer to place a switch on the positive side of a voltage source? According to the research I've done, it is safer to place a switch on the positive side of a voltage source: http://www.allaboutcircuits.com/textbook/direct-current/chpt-3/safe-practices/ This only makes sense to me visualizing the circuit using conventional current (counter clockwise). When visualizing it in electron flow (clockwise), the opposite seems true. I think this stems from my use of the "water analogy." Why does a switch go on the positive side of a voltage source? AI: In theory there is no difference, but practically there is because of how most engineers use "ground". The problem is how sure are you that you truely are opening all paths for electricity to flow? If "circuit ground" is tied to the actual ground, something which happens to be resting on the ground may form a closed loop. simulate this circuit – Schematic created using CircuitLab This is common in "mains" electricity (i.e. the wall outlets), so if SW1 is closed, Joe is having a bad day. SW2 doesn't matter, and it doesn't matter if V1 is positive or negative. Another common example is when you connect "ground" to a metallic chassis, which is common in the automotive world. The circuit for this looks similar to the one above. If you want to use a low-side switch, you had better make sure you don't have any metal contact with the body of the car or anything electrically connected to the body.
H: Minimum and Maximum temperature for a copper wire to work? Is there a minimum and maximum temperature that a copper wire/s will still work on. Meaning that current will still be able to go through them. Let's say that I have battery that is heated or cooled depending on the environment, and that battery controls a light, that is also heated or cooled, and the wires connecting it are exposed to cold or hot environment. Is there a specific temperature, max / min, that will ensure that current still passes through the wires. I know this might depend on the size of the copper wire, and the specific gauge, but I am considering wires between 18 and 26 AWG. I also figured out that the melting point of cooper is about 1,085 °C, therefore that will in theory be the maximum temperature that a copper wire will be able to operate, I assume. And I am not sure about the minimum temperature. AI: The resistance of the wire changes with temperature. There is a given temperature coefficient of resistance for every material. For copper, it is 0.0039/°C. The new effective resistance of the wire is calculated by (deltaR)/(Ro)=(temperature coefficient of resistance)*(deltaT). So, if you know the resistance of the wire at ambient temperature, you can calculate its change in resistance at various temperatures. This will help you decide what size wires you need for a given temperature, or if the temperature is feasible at all.
H: Dealing with signal noise over 50 foot communication link Situation: Connecting a motor controller to an MCU. Motor controller is about 50 feet away from MCU. Connected via a single conduit (buried), containing the following cables: (There is no other electrical equipment in the area, and this is outdoors between two weather-proof boxes.) 24VAC power to motor controller (#14/2) (60Hz) Cat5 cable (24AWG copper) Signals being transmitted to MCU: Motor direction signal. This line is pulled high or low depending on the direction of the motor. No fast changes: motor runs one direction for at least 10 seconds. Motor position indicator. A TTL-level square wave (100Hz to about 1kHZ) outputting a number of pulses per revolution of the motor. The problem: Signals arriving at the MCU are very noisy - you can see the 60Hz line interference clearly - and you can see crosstalk on the two lines - the Direction signal is pulsing along with position indicator square wave. Any suggestions how to clean up these signals to be usable? I could possibly put a second MCU inside the motor controller box, but what protocol could I use to transmit across the existing Cat5 cable that would not be as susceptible to this type of interference? Would prefer I2C... suggestions? Hoping to avoid CAN bus as it adds too much complexity and extra hardware. Any suggestions appreciated. AI: Start with the easy stuff - replace the cat5 UTP with cat 5, 6 or 7 STP - shielded twisted pair. Ground the shield at one end. If that solves it, you're done with little effort. If not, whatever you do next (such as using proper differential line drivers) will work better. I'm also wondering if you are making ground loop with motor power and signal ground. Edit: as we elucidated in comments, both signals were running on a single pair, which is about as bad as they could get for cross-coupling the signals. While differential transmission is what Cat5 is designed to do, simply moving each signal onto separate twisted pairs, with the other half of the pair grounded should make things much better from a cross-coupling point of view, and in fact, did, per further comments. I'd say it still falls under the general heading of this answer, start with the easy stuff, (even easier if you don't the change cables, just how you use the wires) though I hadn't thought of cable-pair mis-use until after I wrote the first form of the answer, and asked the question in comments.
H: Conditioning a voltage using constant current for an ADC range I wish to make a set of temperature measurements inside a relatively inaccessible box. The measurements can be made using Pt100 sensors - platinum Resistance Temperature Detectors (RTD) with a resistance of \$100\Omega\$ at \$0^{\circ}C\$. The change in resistance over \$80^{\circ}C\$ is around \$30\Omega\$. I want to digitize this result within the box. I'm currently looking at microcontrollers like this STM32F373 model, which includes (several) 16-bit ADC. To minimise the self-heating on the RTD, I want to minimise the current used. To make an accurate measurement, I would seem to need a constant current source. Wikipedia suggests several arrangements, at least one of which is given as an answer to this question - Zener Diode Current Source. How can I go about arranging a known constant current, with only a constant voltage source? Should I build a circuit similar to the 'Zener Diode' question, separate from any circuitry near the microcontroller, and then just pass the sense leads to the analogue input? Is there a simple trick to precondition the voltages to lie within a good range for the ADC? Seemingly a combination of gain to scale the range to fit \$V_{DD} = \frac{30\Omega}{I_{const}}\$ along with a constant offset from another circuit would be appropriate - but perhaps this is just because I'm stunningly ignorant. AI: Making a constant-current source is, in principle, very easy if you have a precision voltage source. The basis for conditioning your RTDs is simulate this circuit – Schematic created using CircuitLab In this case the current is set by R1, and is equal to V1/R1. The output of the first op amp is equal to the current times the RTD value, but is negative. So op amp 2 is used to invert the signal (assuming you want a positive voltage to the ADC), and this section may have some gain associated with it. R5 is used to provide an offset to compensate for the fact that the RTD does not produce a zero resistance at one end of the useful range. You'll need to be careful of your resistors. If you're going to the lengths of using a platinum unit and a 16-bit ADC, this suggests that you're trying for very accurate and precise measurements. Temperature coefficients in the resistors can adversely affect this accuracy, but you can get low-drift resistors with at tempco in the range of 25 ppm/deg C.
H: Digital vs Analog signal for data transfer across boards I have 1 board that reads data from a sensor, while another board wants to get data from that sensor. Is it better to have an ADC on the first board, then send that data via i2c to the 2nd board? Or is it better to send the analog signal from the first board directly to the ADC of the 2nd board? My assumption is that sending the analog data across 2 boards is going to have a lot of noise. AI: Either approach might be alright: analog point-to-point connection (down to, say, 10 or 12 bits of resolution), or I2C. CubeSats are small. They operate far from external sources of EMI. If the switch-mode power supplies in the EPS (electric power subsystem) are properly designed, they should not generate much EMI. Is it likely that the payload will generate EMI? From systems engineering standpoint, both point-to-point and bus have their pros and cons. The pro of point-to-point is that it's simple (in the k.i.s.s. way). The con is that it doesn't scale as well as I2C. The pro of the I2C is that it scales well, and it's convenient. The con is that complexity increases. The bus can also be a single point of failure: I2C bus can get stuck. If you have more than one sensor on that board, and they lend themselves to an A/D connected via I2C. Or, if you anticipate that there may be more sensors on that board in the future. Then I2C might be convenient. p.s. In school, I have designed a C&DH board for the MAST CubeSat. It had an extensive I2C bus, which worked without a hitch. Later, I have designed and then had to grapple with an overgrown [because of lack of a better upfront judgement] I2C bus in an industrial instrument.
H: What is maximum supported RAM for Snapdragon 410? Qualcomm Snapdragon 410 datasheet says: Memory + LPDDR2/LPDDR3@533MHz + eMMC 4.5 + SD 3.0 (UHS-I) It does not talk about maximum amount of RAM supported. What is the maximum amoount of RAM this processor supports? AI: 2GB is the answer. Look at the memory map. For future reference, there's always 2 datasheets. One is for Electrical Characteristics the other is for Processor Characteristics. The bigger one is always the processor one and it always has all the info. Hardware Register Description, Qualcomm Snapdragon 410 Processor (APQ 8016)
H: Confusion on the meaning of a BJT emitter follower's output impedance Above figure is a BJT transistor emitter follower. I can understand that in an emitter follower when talking about its input impedance what meant is Vb/Ib and here it is equal to (hfe+1)*R. The idea I think similar to Thevenin equivalent. The voltage applied to circuit input is Vb; and the voltage driven by the source is Ib. So it is easy to understand the meaning of input impedance here for me. But I couldn't understand what meant by the output impedance of this circuit. What is the meaning of the output impedance here and how can we quantify it in terms of R, hfe, etc.? AI: But I couldn't understand what meant by the output impedance of this circuit. What is the meaning of the output impedance here and how can we quantify it in terms of R hfe ect.? You've got to think like a transistor but, to help you, try thinking like a forward biased diode. Let's say your anode voltage is connected to a perfect battery (strong voltage source) then, under very light load conditions on the cathode (say 0.1 mA), the cathode voltage might be 0.5 V lower than the anode: - If you increased the current a little bit to 0.15 mA, the forward voltage dropped would be about 0.525V. Take the "before" and "after" numbers and work out what the dynamic resistance is: - Dynamic resistance = change in volts / change in amps = 25 mV/ 0.05 mA = 500 ohms. If you did this at a higher level of forward conduction (say at 1mA to 1.5mA) you'd get a forward volt change of 10 mV (640 mV to 650 mV). Now, the dynamic resistance has become 10 mV / 0.5 mA = 20 ohms. This dynamic impedance represents the output impedance of the diode (at the cathode) when the anode is tied to a solid fixed supply voltage. simulate this circuit – Schematic created using CircuitLab If the diode's cathode were connected to a fixed 100 ohm resistor to ground, can you see that the dynamic impedance of the cathode in parallel with the fixed 100 ohms becomes the new output impedance: - simulate this circuit Think about converting the voltage source in series with the dynamic impedance of the diode to a current source like this: - You see now that the dynamic impedance of the diode is parallel to the 100 ohm and this makes the net resistance smaller. You don't have to consider what value the voltage source is or what the current source amperage is because you reconvert back to the thevenin equivalent and you have the net output impedance. Note - this added resistor is the emitter resistor when a BJT is considered So, if the total current drawn from the cathode is ~0.1mA the "source" impedance of the cathode and the combined resistor is 500 ohms || 100 ohms = 83 ohms. This drops to 20 ohms || 100 ohms (17 ohms) when ~1mA is being taken through the cathode. How does all this relate to a BJT you might be asking. Here's how... The base emitter junction is a forward biased diode; the base is the anode and the emitter is the cathode but, the clever thing about BJTs is that although there may be "weak voltage" at the base that is easily affected by loading, the collector current doesn't allow this to happen and it is the collector current that replaces the base current as the source of current to the emitter (cathode). Thus, you can still regard the emitter has having the output impedance of a diode when that diode's anode is connected to a strong voltage source. What I've said is a little oversimplified because there is still a bit of base current taken when providing current to the emitter but, this is usually at about 1% of the level of the pure diode scenario - this boils down to the BJT having a current gain of about 100.
H: Where does current go in these circuits? In both these schematics, the 9V source drives current through the circuit, but there doesn't seem to be any way in which the current can 'return' to the source to complete the circuit. In what ways would current flow through both these circuits from the DC source, and where would the current end up? Wouldn't all the current just go to ground? This is for an audio circuit, input is from a electric instrument and output goes to the speakers/recording equipment. AI: It is implied that the 9 V source has its negative end connected to ground. Current therefore flows out the positive end of the 9 V source, into the circuit, out the circuit's ground connection, and back into the negative end of the 9 V source. Added As Dave Tweed pointed out in a comment, and I didn't notice ealier, the second circuit uses a positive ground. In that case, current flows out the positive end of the 9 V supply into the circuit ground, thru the circuit to the -9V connection, and back into the negative input of the 9 V source. The common thread in both cases is that ground is implied as the 0 V reference for all other voltages that don't explicitly specify a reference. Both the "+9v DC" point in the top circuit and the "-9v" point in the bottom circuit are therefore relative to ground. Since they are labeled as supply points, it is assumed that a power supply is connected between these points and ground.
H: Why do DRAMs retain their state better when they are cold (when powered off)? I'm sorry if this is off-topic. It may be better suited for a computer hardware forum, but I couldn't find anything appropriate. I've been reading about the cold boot method, which can be used in forensic investigations, by enemy governments, or by criminal attackers to gain the key to an encrypted hard drive from DRAM when the computer is powered off. This method fascinates me, because I never realized DRAMs retained their state when powered off, but apparently the capacitors can retain some of their charge for minutes or even hours when the computer powers off. Something I was wondering about. The paper says that the rate of decay is significantly slowed at lower temperatures. Why is this so? I'm guessing it's because the electrons are less excited at lower temperatures, so they are less likely to jump from molecule to molecule, so the capacitors are able to retain their charges for longer. Am I correct in thinking this? AI: It's basically because the leakage current of a transistor in a DRAM cell is temperature dependent. Here's a typical DRAM cell schematic (taken from that book): And here's a generic graph of how the leakage current varies with temperature for IC-level FETs The latter graph is from another book. This is in fact an exponential dependence on temperature (note the semilog plot), well-approximated simply by using the Shockley diode model. The book says that "a common rule of thumb is that leakage current doubles for every 10C increase in temperature".
H: Single cell e-ink type components? I'd like to make my own binary watch, and something pretty small. Using surface mount LEDs would work but they use a lot of energy (~30mA a piece for something I'd consider reasonably bright) so there'd have to be a mechanism to "show the time". Instead of this I'd like to only update my display once per time unit and leave it in a stable state in between - exactly like an e-ink display, thus massively reducing the power requirement. I only have 6 binary display parts in my design so I really need individual e-ink cells, but I've no idea if this kind of thing even exists! Does such a component exist? Is this the 'right' line of thinking? Thanks! AI: Sadly, eInk is pretty difficult to make yourself. I know of nobody who has managed to make their own. LCD is also verging on impossible to home brew. Your only options are to look for an existing LCD that you can buy and use, or use LEDs. You don't need 30mA for an LED. We have surface mount LEDs here that are annoyingly bright, even at 1mA! You could go down to 0.25mA and still have a perfectly visible display. These LEDs are HSMW-CL25 from Avago Technologies.
H: Connecting multiple grounds As I'm relatively new to the electronics world, I was wondering if you can connect multiple ground terminals (corresponding to several different voltage outputs) to the same ground. Or do they each need their own? In my case I have 5 lines, one 12V, one 3.3V, two 5V and one variable from a 12V in using a voltage regulator that already has its own ground. So I'm guessing that each would need its own ground, but it is never bad to ask. AI: If you have two separated circuits the voltages of the first don't mean anything to the second and vice versa. If you want to combine the circuits you'll have to connect a reference on one circuit with a reference on the other one. In 99 % of cases you'll choose the resp. grounds for this, because that's what ground is for: a reference against which all the rest is measured. If there's a 3 V level in a circuit, it will be referenced to ground, unless specified otherwise. So by connecting the ground of a 5 V circuit to the ground of a 12 V circuit the 5 V becomes meaningful for that circuit as well: it will also be 5 V, or 7 V less than the 12 V. A well designed circuit must have a reliable ground, which means that the 0 V at one point should be as close as possible to that 0 V at any other point of the ground net. Zero difference is not always possible if you're working with high currents, but the difference should be as low as possible.
H: What is "rabbit ear" in a video-capture context? I was reading the TVP5158 datasheet, and ran into a register bit that would enable "rabbit ear". What is that? AI: This patent refers to "rabbit ears" as distortions in the video sync pulse. You can see why they're called that from the shape below. http://www.patentgenius.com/image/5374960-2.html
H: CATV Voltage Levels What are typical and maximum allowed voltage levels at a CATV coaxial cable? Looking at some datasheets for GDTs and some Coaxial Surge Arrestor manuals I'm seeing a big range of breakover voltages, ranging from 27 to 300 VDC. AI: According to "the Real Cable Guy": To measure a particular CATV RF signal at a given frequency we use a new unit: the dBmV - the decibel-millivolt. Early on in cabledom, it was observed that a television set required about 0.001 volts - or 1 millivolt - to display a good picture. So 1 mV became the reference point for CATV RF Signal measurement. Since a tv is designed to offer 75 ohms impedance, 1 mV across 75 ohms resistance became the CATV measurement of 0 dBmV. Also important to note is the fact that decibels are logarithmic and not linear; so negative dBmV levels still have meaning. Other sources cite 0 dBmV as a typical target, -10 dBmV as the minimum useful threshold for digital signals and +16dBmV as a 'maximum'. Most digital cable and DTV satellite systems use RG-6 coaxial cable. The center conductor is 18AWG, which is considered suitable for 2.3A (for power transmission). 2kV insulation between the conductor and shield is typical. The most likely reason the GDTs are so high is that they're intended for lightning strike protection - not due to excessively-strong CATV signals.
H: Why don't interfering radio stations both play at the same time? Since radio-waves are additive, I would expect that overlapping stations (eg. two different signals broadcasting on 95.7 within range) to both play over my radio at the same time. But that's not what happens. Instead, I hear only one station at a time, with the radio switching back and forth between the two stations as I drive, and some static inbetween. Why does this happen? Why don't I ever hear both stations at once? AI: Your mention of the frequency (97.5 MHz) tells us this is an FM receiver. (AM will behave differently, as will other modulation schemes). Because FM is encoded by modulating the signal frequency, anything to do with AM is undesirable. To deal with this, most receivers over-amplify the signal until it becomes larger than the later stages can pass. The signal then "clips" to the voltage of that amplifier. This stage is called a "limiter"--it limits the amplitude to some fixed value. In theory, any signal weaker than that drops out and just becomes noise, and any signal stronger than that has a very nice fixed level that the FM detector can handle without having to worry about amplitude variations. The amplifier-limiter stages create a phenomenon called "capture", where the strong signal tends to eliminate the weaker one. This is why you hear only one station. If the signals were very close in strength, you would indeed hear them "mixing together", but that only happens for a fraction of a second as the signal levels rapidly change (presumably, you are in a vehicle), so you normally don't hear that.
H: Auto-charge 8.2V Lithum-ion battery pack I am planning a device consisting of a load, a battery, and an external power source. The idea is that the battery powers the system until the external power is plugged in -- then, the external source provides the power and charges the battery. I am working with a 8.2V battery pack, and would like to add an auto charging circuit to this battery, such that it start charging when the battery has been discharged a certain amount, and stops charging when the battery is fully charged. I would like to know what is a good way to accomplish this, and what voltage source/level I should be using to charge the battery safely. AI: Please provide FAR MORE detail. Do you have a specific battery in mind? What is your application? If 8.2= 8.2V it implies 2 x 4.15V cells = (probably) two x Lithium Ion (LiIon) cells in series. If so, use of a LiIon charger or a LiIon charger IC is required. 2 x LiIon in series should never be exposed to more than 8.4V but 8.2V is safer. BUT there can be quite a lot more than that to LiIon charging. Please provide details - What mAh, cell type, use, ...?
H: Making a wireless clicker to use in presentations, suggestions? I will be needing a wireless remote/clicker of some sort to use when delivering presentations for projects and assignments (i.e. Powerpoint type). Yeah, I can buy one quite cheap - but really, what fun is that? The first thing which comes to my mind is to use a small microcontroller like the ATTiny for the receiver, connected via USB as an HID device. Then use something cheap like IR to send it the signal. I've never done this, but I think IR is the simplest and cheapest method. What other cheap alternatives should I consider? The disadvantages of IR are obvious. In terms of functionality, it needs to have the bare minimum ability to receive a signal as an indication to move on to the next slide. I'll first tackle this first, before adding further functionality. I think if I go the HID device route, it should be pretty simple if I just program the microcontroller to send a left mouse button clicked command. So should I use a microcontroller, or something else? What is the easiest way to do this, and what wireless technology would you recommend I use? Thanks. AI: Well, you'll need a transmitter and a receiver :-). Infrared You mention disadvantages like limited range and having to direct the transmitter, and it will depend on the setting how bad these are. Obviously a large auditorium will be more of a problem that a 20 seat room. Suppose we go for IR, what do we need? There's the protocol and a few codes (at least next and previous slide). For the protocol you can choose an existing one, and even use existing codes, but if you make both transmitter and receiver yourself you can also devise your own protocol. Advantage: you can make it as simple as you like, especially regarding decoding, which is more complicated than sending. One of the most simple protocols is Pulse-Pause Modulation, where you send a series of fixed-width pulses, and encode the bits in the time between pulses. Transmitter This is the easiest. Basically a microcontroller, a transistor and an IR LED. Microcontroller is asleep, and wakes up when you press a button. Start sending the modulated code until button released and go back to sleep. The finished product tomorrow morning on my desk, OK? ;-) Receiver An IR receiver is quite complex, and you don't want to make this yourself. Especially AGC is no fun. So we buy a receiver module, like from Vishay. This gives you the decoded signal which can be used directly by the microcontroller. Note that when the IR receiver modules don't receive a signal the AGC will lock to the noise and output that: a lot of garbage. But no worries: when a code is received this is as clean as can be, no noise whatsoever. RF The alternative is RF. You can use the same protocol and codes, and the transmitter will look almost the same. Just output the (unmodulated!) codes to an RF transmitter instead of the IR LED. RFM70 modules are small, cheap (around 5 dollar IIRC, I think Wouter knows them well) and easy to interface.
H: How do I write KVL in this circuit? I am studying this circuit in my course: AB is opened, E1 = E5 = 10V, E4 = 40V, R1 = 2 Ohm, R2 = 4 Ohm, R3 = 6 Ohm, R6 = 6 Ohm I want to write KVL for the Loop 1, what I do usually is defining the voltage drops polarity across each element (resistors in this circuit) but here I have many voltage sources. Now the question that confused me is: How do I define the voltage drops polarity? According to an origin voltage source (The highest one, or the one the problem is referring to)? Or I just define the polarity of each element according to its branch and its source separately? Thank you very much in advance. AI: By the passive reference convention, the current enters the positive terminal of a passive element such as a resistor. The voltage source polarity is given by the symbol. So, KVL clockwise around loop 1 is: \$U_{AB} - E_5 - I_2 \cdot R_2 - E_1 - I_1 \cdot R_1 = 0\$ Or, \$U_{AB} = E_5 + I_2 \cdot R_2 + E_1 + I_1 \cdot R_1\$ Consider how you would measure the voltage across R2. How do you choose which polarity to measure? You have a choice of where to place the red and black leads so which one is correct? Obviously, both are. If the red lead is on placed on the more positive lead of the resistor, the measured voltage will be positive. If the red lead is placed on the more negative lead, the measured voltage will be negative. Choosing the reference polarity of the voltage variable (the variable you solve for in your equations) for R2 works in exactly the same way. You are free to choose the reference polarity and, after you solve the equations, if you find that the voltage across R2 is negative, you know that the end you chose to be positive is actually the more negative end. The point is, just as with the voltmeter leads, the reference polarity is arbitrary. However, it is always a good practice to use the passive reference convention so, as in your example, if you want the voltage across R2 in terms of I2, you should should choose your reference polarity such that I2 enters the positive terminal.
H: Does an Electron really travel thousands of Miles when I use a server in another Country? When I press a key on my keyboard, it will alter the flow of electrons in a wire connecting to send data to my computer. Let's say it sends the bits: 100000000100000000100000000100000000, which is a few letters encoded in binary and ASCII. These electrons somehow move down the wire, to a chip, that detects where my data should go with transistors, or as I understand it, little switches that can be controlled with another wire. The chip will detect where my data is heading, and send it in the right direction. So the question is, if I make a HTTP request from Europe to a server in USA, do some of electrons from my PC, in 200 ms the response takes, travel across the Atlantic ocean to USA and come back to me? AI: When you push an electron into one end of a wire, they all jostle around a bit, and a different one pops out the other end. In a conductor (e.g., any metal) there is a certain fraction of the electrons that are not bound to any particular nucleus and these roam freely throughout the conductor all of the time, even when there's no external voltage applied. Applying a voltage simply causes a net "drift" of this sea of electrons in the direction of the electric field. The speed of this drift is orders of magnitude slower than the speed the electric field propogates (which is basically the speed of light). The answer to whether any particular electron might make it from one end of the wire to the other depends on the length of the wire and the signaling frequency. The drift speed divided by the signaling frequency would give you the average distance an electron might travel in one cycle. (I hesitate to call this "wavelength", but it's the same concept.) If the wire is shorter than half of this distance, some electrons are making the whole trip. Signaling frequency is important, because in the example you give, both USB and Ethernet use AC signals at rather high frequencies. The electrons really don't move very far at all. And to address your other point, about electrons from the input of a module appearing at its output — no, this is rarely true. Capacitors, transformers, tubes, FETs and most bipolar transistor circuit configurations prevent this. There are many places in your transatlantic trip where the direct flow of electrons is deliberately blocked, so no, "your" electrons definitely don't make it across the Atlantic.
H: Charging capacitor bank with current limiting circuit I would like to charge a capacitor bank with a 4.8 volt supply that I have. With the help received in response to this question, I now have a a useful current limiting circuit (shown below), that allows me to select a maximum current through a load. I have reimplemented the solution in CircuitLab . . . The circuit is set to give a 480 mA max current. As the load resistance increases, the SER of the limiting circuit drops away. The following plot shows current through the load versus load resistance . . . However, what happens if I want to charge a capacitor bank using this circuit. Where would I put it? Current needs to flow through R_sense to cause a voltage drop in order for the circuit to function. If I just add a capacitor after the sense resistor . . . . . . and then measure the voltage across the capacitor, some crazy stuff happens . . . What am I doing wrong ( -120V .. really )? EDIT: Following Oli's advice by adding a leakage resistor and paying attention to initial conditions . . . .. I now get a logical looking output, although the voltage is not up to Vcc If I place the capacitor where R_Load is, Then the voltage of the cap jumps up to 4.8 volts immediately (which I'm guessing would draw a massive current, fry my supply, and negate the point of the current limiting circuit) This looks pretty logical to me. If a cap is connected to an ideal voltage source, it will get an infinite current and be at 4.8 V instantaneously. What do I need to do in order to reproduce the effect shown in Oli's lowest plot? AI: As Madmanguruman says, the capacitor is in the wrong place. The opamp is trying to keep the voltages on it's inverting input the same as the non-inverting input, which is 240mV in your example above. To do this with just Rsense present, it must keep 480mA flowing through Rsense as you say. Now, with the cap in series, it will actually work to charge the capacitor as you have it. However, the catch is that it will not be at a constant current, and the cap will only charge to 240mV, since this it what the opamp needs to keep the balance. The cap does not pass DC, so the current is initially 480mA, and drops exponentially down to 0 as the voltage rises (and the voltage across the resistor drops) Another thing to understand here is that a simulation is only as real as you make it, and in some cases the ideal components cause problems. It's quite common for the simulator not to converge or produce odd results if there is no DC path available. Also with a transient simulation, you sometimes need initial conditions set to observe a process. For example, if I simulate the above circuit in LTSpice with an ideal 1F capacitor, the simulation does not converge (never finishes) If I add a high value of parallel resistance (10MΩ, this is actually very conservative for such a large value, probably be much lower) to provide a DC path, and (very roughly) simulate real world imperfect capacitor leakage, the simulation works: Simulation: The 240mV is produced by the 24nA across the 10MΩ resistance (24e-9 * 10e6 = 0.24V) However, the cap starts the simulation at 240mV. Is this what will happen in real life? It's unlikely, so we need to simulate things as it will be when power is switched on, or at least with the cap starting with 0V across it. The reason this happens (in SPICE at least) is because there is an initial DC operating point simulation done before the transient simulation starts. If we do the same simulation with an initial condition specified, we can see the "interesting" bit that happens prior to reaching a steady state: So remember to be aware of the difference between ideal and real world components. If simulation results appear strange, then try adding some ESR/ESL (equivalent series resistance/inductance) and parallel resistances to simulations that correspond with the components you intend to use (datasheet will give values usually) Also be aware of tolerances, for which monte carlo simulation is very useful. Finally, here is the circuit with the cap placed in the right place, (although you may want high side current limiting in your final circuit): Simulation of current through cap and voltage across it, notice the constant 480mA up until the cap is fully charged to 4.8V (initial condition used again to see the cap charging): One last thing, make sure you do not use the LM741 in your final circuit, it's completely obsolete. Choose a decent general purpose rail to rail input/output opamp (rail to rail means it can swing all the way to each rail at the output and handle voltages up to each rail at the input, many opamps, including the 741, cannot do this - another departure from the convenient world of ideal components)
H: Understanding CS5463's basic circuit power supply I'm trying to put the CS5463 chip functional using the example circuitry on page 41 of the datasheet (attached bellow): Right now, I'm working on the top part of the circuit, which is the IC power source. I've ran some simulations on Multisim and, apparently, this part is completely functional. But before proceeding to some other part of the circuit I want to understand what every component is there for. I did my research so I didn't arrive empty-handed. The 470 nF capacitor: is it a decoupling capacitor, which filters a possible DC signal from the power line? I couldn't extract this information from my simulations. I had the impression that it does something else… The 500 ohms resistor in series with the capacitor mentioned just before… Is it a simple current limiter? My guess is yes, it is, and its function is to limit the current from the negative cycle of the power line. From the simulations, I've learned that this capacitor and resistor in series are exposed to great voltages. The capacitor, for instance, is exposed to tensions up to 295 Volts (the power grid I'm on is 220 Volts RMS). Are there any capacitors of the order of nanofarads that can handle that much? About the diodes: the first one is there to close the circuit on the negative cycle. The second one's purpose is to prevent the power grid to drain energy stored on the 470nF capacitor when the power grid is on the negative cycle. The 470nF capacitor: is the component that charges energy from the positive cycle of the power grid to discharge it on the negative cycle. The Zener diode: works as a voltage regulator, keeping the voltage on, approximately, 5 Volts. The 500 ohms resistor before the Zener diode: creates a voltage difference between the 470uF capacitor and the Zener diode when the loaded tension on the capacitor is greater than the one the zener diode is holding (approximately 5 Volts). Are my hipothesys correct? The 0.1 uF capacitors: would they be by-pass capacitors? Would they function as a "virtual ground" for the AC signal? Why there is a 10 ohms resistor between the VA+ and VD+ source pins? Why are the AGND and DGND ground pins short-circuited? I chose the 1N4733A to be the Zener diode. Is it a easily found component (local stores)? Would there be other suggestions? AI: The components you mention combine to form a simple transformerless supply for the IC. These are quite common in such circuits. The 470nF capacitor and 500Ω present a set impedance to the mains voltage and limit the current. The reason a single resistor is not used is because it would have to dissipate a fair bit of power to do this, whereas a capacitor does not dissipate any power (or very little for a non-ideal cap) We can demonstrate this by looking at the numbers: Assuming a mains frequency of 50Hz, we can calculate the capacitor impedance: \$ \dfrac{1} {2 \pi \times 470nF \times 50Hz} = 6772.5 \Omega \$ To work out the total impedance, we do: \$ \sqrt{6772.5^2 + 500^2} = 6791\Omega \$ So the peak current through the 470nF capacitor and 500Ω resistor will be: \$ \dfrac{311}{6791\Omega} = 45.8mA \$ RMS current will be \$ 45.8mA \times 0.707 = 32.4mA \$ The resistor will therefore dissipate: \$({32.4mA})^2 \times 500\Omega = 520mW\$ - not too much, a 1W or 2W resistor will handle this okay. Say we had just used a 6791Ω resistor to limit the current to 32.4mA, the resistor would have to dissipate: \$({32.4mA})^2 \times 6791\Omega = 7.1W\$, quite a lot of wasted power and an expensive resistor needed. So we use the cap to do the main limiting, and resistor in series to limit transient current (if the rise time of the transient is fast, then the cap will look like a lower impedance but the resistor will still look like 500Ω) Regulation The rest of the components are to rectify and regulate the voltage, in order to present a steady low voltage DC supply for the IC. The 2 diodes handle the rectification, only passing the positive half of the waveform. This is then smoothed by the 470uF capacitor, and then regulated by the second 500Ω resistor and (probably 5.2V) zener diode. So the whole process looks like this (ignore diode part numbers, LTSpice doesn't have any 1N4002 or similar. Also I used a 6.2V zener as there is no 5V zener. The principle is exactly the same though) : Simulation on power up (notice V(IC) rises to ~6.2V and stays there): Bypass caps and 10Ω resistor The 0.1uF capacitors are indeed bypass capacitors, these present a local energy storage for high frequency current demand. Combined with the caps, The 10Ω resistor is to decouple the analog and digital supplies to some extent. The analog and digital ground pins are also a way of keeping the currents separate. This is common in ICs with an analog to digital or digital to analog function. PFMON and 470nF capacitor The capacitor needs to be rated to handle the mains voltage. There are capacitors called "X capacitors" that are specially certified for use with mains. Here is an example 0.47uF 440VAC part (picking at least 1.5 times the nominal mains is a good idea) The PFMON pin detects a power fail event when the voltage at the pin falls below 2.45V. This can be used to signal your microcontroller and take any appropriate action. With the (0.66 times input) divider shown we can calculated the input voltage where this will happen: \$ \dfrac {2.45V} {0.66} = 3.675V \$ The minimum operating voltage is given in the datasheet as 3.135V, so this gives ~0.5V headroom.
H: Is this an RC filter? I'm trying to understand this temperature sensor circuit I came across on a room Air-Conditioner controller (Want to build one myself). The sensor is an NTC type thermistor (15k at 25 deg C). What I collect is that the NTC along with R2 form a voltage divider, the output of which is fed into the ADC input of the microcontroller. What are C1 and C2 for? Do they form RC filters along with the thermistor? If that is the case, then the cut-off frequencies are 106.1Hz and 1.06Hz? These appear to be very low. What is R3 for? Is it limiting the current? If ADC input pins are high impedance, why limit the current? Do R3 and C3 form another RC filter? Then again the cutoff frequency is 3.386kHz. And there's nothing apparently operating at that frequency on the board. (The micro controller is connected to a 4Mhz external crystal and the board is powered by 230V/50Hz mains). Thanks. AI: Yes, the 10 µF gives a low cutoff frequency, but your calculation isn't right. First you don't calculate for C1 and C2 separately; if they're parallel they act as one single capacitor. For the calculation the 100 nF C1 can be ignored, it's only 1 % of C2 and that will have a tolerance of 20 % or so anyway. And due to Thévenin you have to see the NTC and R2 in parallel, so that's 7.5 kΩ. The cutoff frequency is then 2 Hz. The second section formed by R3 and C3 has a much higher cutoff frequency, but is your power supply that noisy? I would dump R3, C2 and C3, and just keep C1. Use the microcontroller to average a number of readings; a moving average filter is a low-pass filter too, is dead easy and it doesn't need any components. Olin would suggest an IIR filter (for Infinite Impulse Response), which uses less memory, but is less intuitive. Besides the moving average filter won't need 100 bytes; 5 or so is already fine.
H: Center tap vs. bridge transformer I'm designing a power supply to deliver 6V DC with a zener diode acting as the regulator. I found out that there are two types of transformers that can be used. They can be center tap or a bridge. In center taps, we will use 2 diodes, while in bridge, we need 4. What are the pros and cons of each type and which is best suitable for my purpose? I think it's worth getting to know the advantage and disadvantage of using one or the other. AI: The full bridge has the disadvantage that you have two diode voltage drops, which may be up to 2 V. I don't think the cost of the two extra diodes will matter much. I wouldn't recommend the center tap though: you have a lower voltage drop because only 1 diode conducts at a time, but you'll also use only half of the transformer. So where for the full bridge you could use for instance a 10 VA transformer for the center tap you'd need a 20 VA type. The center tap should be avoided as much as possible. If the two diodes voltage drop for the full wave rectifier is a problem, you can probably use Schottky diodes.
H: What is high side current limiting? What is high side current limiting? While google searching for the term I have found ICs that describe their application as "high side load switching". Is this the same thing or something utterly different? Furthermore, the term implies that there is low-side current limiting also? What is this? AI: The "high side" in high side current limiting refers to the placement of the current limiting circuitry. If your current limiter is tied to the positive supply rail, it's called a high side current limiter. This applies not only to current limiting. Anything that has to be placed in series with a load will be high- or low- side. A low-side switch will be placed between the load and the negative supply rail (GND). A high side current shunt will be placed between the positive supply rail and the load. And so on. An N-MOSFET will be usually placed low-side. A P-MOSFET will be placed high-side. An NPN transistor will be placed low side, a PNP transistor high side.
H: Designing a power supply (zener) to achieve steady 6V (\$\pm\$ 0.01) UPDATE: My target is to obtain 6V as the voltage output. As you can see, it is 5.94 V. I've tried adjusting my variables, yet it varies from 5.6 to 5.94V, never having reached 6V. What would be the best way to make it real close to 6V \$\pm\$ 0.01? I have designed a DC power supply which has a zener diode acting as the regulator. I've included the capacitor to filter it and to make some smoothing action and to lessen the ripple. Now, what would be the effect of adding more capacitors in a zener regulator? Also, in further designing it, is it worth maxing out the capacitor to some max value, like 10,000 uF? EDIT: zener is 6V, input voltage would be a 220 V AC (I'll be using a 6V bridge transformer), load will be anything between 500Ω to 20kΩ. The load will vary, by replacing it in 500 ohm increments, meaning one at a time. I can only use zener regulator, plus some caps and resistors. AI: A zener is a shunt regulator, which means that it is a load parallel to your actual load. The zener voltage is 6 V, so you'll need a bit more to allow a voltage drop across the series resistor R. If the input voltage is constant, say 8 V, R will see a constant current if also the 6 V is constant. That's Ohm's Law: V = R \$\times\$ I. Your load may vary between 500 Ω and 20 kΩ , which is a wide range for the zener, as we'll see. The current through the load will then vary between 300 µA and 12 mA. So we'll have to calculate R for at least that 12 mA plus some for the zener, let's say 10 mA. That's 22 mA, and if we assume the 8 V input then our R will be 90 Ω. The 10 mA for the zener is needed for proper regulation. If the current is too low variations may cause rather large voltage changes. As you can see at the maximum load aof 500 Ω the regulator is only about 50 % efficient; you have the same current through the zener as through you load. At the minimum load it's really bad: the zener will have taken the 12 mA from the load and have 22 mA total, while the load only has 300 µA. Efficiency is then only 1.3 %! That's a reason why zeners are not recommended for loads varying that much. Why would the zener take the 12 mA from the load? If it didn't R would only get 10 mA instead of 22 mA and the voltage drop would be 900 mV, for a 7.1 V output. It's the zener voltage which forces the total current to be 22 mA. So the zener current will change with varying load, but also with varying input voltage, because if the 8 V would become 9 V then the total current would become (9 V - 6 V)/90 Ω = 33 mA. If the load takes 12 mA of that then there goes 21 mA through the zener. Your zener will keep the voltage around 6 V, but with these changing currents you can't expect wonders: the 6 V won't be constant. A zener is not a good voltage regulator. A better solution would be a TL431 (Russell! ;-)). This is already much more stable with much better regulation, and costs hardly more than a zener. But the real solution is of course a series regulator. The 78L06 is a 6 V/ 100 mA part, which is easy to use: an input pin, an output, and a common ground. Add capacitors to both input and output and you're set. edit after adding requirements to the question If you can only use a zener you'll have to relax your requirements. 10 mV accuracy is absolutely impossible. That's less than 0.2 %, while the 1N5233 has a 5 % tolerance to start with, and the datasheet gives a zener impedance of 7 Ω maximum. That means that a 12 mA difference in zener current will give a 84 mV difference, that's another 1.4 %.
H: Can I Stack these two Arduino Shields? I am using an Arduino uno currently with the Si4735. I can not currently get the audio from this shield to the Arduino or other sources without using the 1/8 jack. To fix this I am thinking about adding another shield with the functionality I need that has an audio in and audio out. I need the ability to play audio from an SD card or some other source. For example this shield: Audio Shield. I known that a lot of the same pins are used, but do I need to use all of the pins from the Audio Shield? Thanks for any help. tl;dr: Is there any way to stack these two shields? AI: Yes, yes you can. And the beauty is that I can tell without even looking at the Si4735 shield you are using. How is this possible you ask? The only pins that the AudioShield use are the SPI lines (MOSI,MISO,CLK), a SPI chip select line, and an analog pin for reading the potentiometer. Obviously, the A3 analog pin for the potentiometer can be moved around and put on any other analog pin. The chip select is just an active low digital signal used to determine which SPI device should currently be using the data on the SPI lines (the SPI protocol was designed for a shared bus). So all in all what that means is for the AudioShield, all of the pins it uses were either designed to be shared, or are not really pin specific and through some super-simple hacks can be moved around. The link you provided actually explains how to move the chip select signal that I talked about to a different pin and the potentiometer hack is basically the same but you have to move it to an analog pin. Of course any code samples you use will have to be adjusted for the new pins you use. For more information on the arduino pins see here. For more information on sharing the SPI bus between two devices see here.
H: How to do pulling up or down correctly when interfacing a microSD card? I have seen people pulling up only the CS pin, so that when the microcontroller's pins are floating in the power-up, the microSD card is not corrupted. Also, I have seen many people pulling up and down DI,DO and SCLK lines. Some of the circuits that I've seen even connect pins 1 and 2 to Vdd/2 via a voltage divider that is formed between Vdd and Vss. Which pins of the microSD card should be pulled up or high when interfacing a microcontroller with an embedded SPI interface and has the appropriate logic voltage levels? AI: The specification only makes mention of the 50K\$\Omega\$ pull-up internal to the card used for card detection. It talks about this in reference to the commands used to disable it. Search for "pull" to see all the mentions of it. However, the SanDisk SD Card Product Manual is much more helpful. From Chapter 3: \$^2\$ The extended DAT lines (DAT1-DAT3) are input on power up. They start to operate as DAT lines after the SET_BUS_WIDTH command. It is the responsibility of the host designer to connect external pullup resistors to all data lines even if only DAT0 is to be used. Otherwise, non-expected high current consumption may occur due to the floating inputs of DAT1 & DAT2 (in case they are not used). \$^3\$ After power up, this line is input with 50Kohm(+/-20Kohm) pull-up (can be used for card detection or SPI mode selection). The pull-up may be disconnected by the user, during regular data transfer, with SET_CLR_CARD_DETECT (ACMD42) command. \$^4\$ The ‘RSV’ pins are floating inputs. It is the responsibility of the host designer to connect external pullup resistors to those lines. Otherwise non-expected high current consumption may occur due to the floating inputs. So you need to add pull-ups to all unused pins to prevent high-current from occurring due to the inputs being floating. For the SPI signals that you will be using, pull-ups are not required. However if your traces are long or running through a noisy section on your board, or if you are running a high clock rate, adding pull-up resistors will help to clean up your signals transitions.
H: Designing a GSM PCB antenna Before someone complains about my crappy design I should tell you that my knowledge on antennas or RF is near zero. I recently worked on a project that required a GSM module. After testing it on a PCB using an external antenna that apparently seamed fairly simple, I made a new PCB with a built in antenna. It worked well but I noticed that the signal was significantly lower than the one with the external antenna. I also noticed that if I touched the antenna connection with a wire the signal increased in strength close to the one with the external antenna. My board is a double sided board with a ground plane with a clearance distance of about 2 mm from the antenna on one nearest side. The antenna is located near the edge of the board as can be seen on the picture. Is there something that I could do to improve my antenna performance? Currently the antenna has solder mask on top of it, can this degrade its performance? Is it better to have it plated instead? Full board AI: There seems to be a remarkable lack of relevant on-web material. Maybe just hiding. This looks highly apposite Design of New Multi Standard Patch Antenna GSM/PCS/UMTS/HIPERLAN for Mobile Cellular Phones with an interesting appearance And tri-band !!! GSM Dipole antenna - very informative Designing a GSM dipole antenna Commercial product. LOOKS simple. LOOKS good LOOKs can be deceiving :-) GSM Pentaband antenna They say: 800/900/1800/1900/2100MHz Omni Directional 1/2 Wave Miniature 42 x 42 x 1mm VSWR <3.0 RG178 Coax 50Ω Impedance 2-3dBi Gain (nominal) Vertical Polarization Admitted Radiation Power 1W The free marvellous NEC RF software will probably do what you want. Links and intro to NEC here Have a look here RF/Microwave Tools and here Tools and calculators - with RF writ large If you have enough $ - Agilent ADS Advanced Design System is the world’s leading electronic design automation software for RF, microwave, and high speed digital applications. In a powerful and easy-to-use interface, ADS pioneers the most innovative and commercially successful technologies, such as X-parameters* and 3D EM simulators, used by leading companies in the wireless communication & networking and aerospace & defense industries. For WiMAX™, LTE, multi-gigabit per second data links, radar, & satellite applications, ADS provides full, standards-based design and verification with Wireless Libraries and circuit-system-EM co-simulation in an integrated platform.
H: What shift register ICs am I looking for? I'm designing a project that requires far more I/O than a typical microcontroller offers. No problem, right, just use shift registers and stuff. Wait nope, why am I having problems? I'm planning on driving 24 outputs with one serial data line, a clock, and a chip select. 16 of the outputs are connected to LEDs and the remaining 8 are connected to a HD44780 LCD display. So what I thought of doing for the 16 LEDs was to connect them up to two 8 bit counters that feed the serial data bit through to the specific LED and then change to the next consecutive output when clocked -- like a demultiplexer, but serial. For the LCD, I need to actually hold onto the data and send it all out at once, so I need an 8-bit serial-parallel register and wait until 8 clocks pass to enable it. Finding an IC which does the latter is easy -- 74HC595 seems to do it -- but for the LEDs, I can't seem to find a 7400 series chip that does what I want. All the ones I can find hold onto previous values and just shift them over, and the decoders I've found 1) don't have a data line - they're always true when selected and 2) require a binary word, not a clock. If it's not already clear, I want something that does what's on the left: I swear I've used a chip that does what I'm thinking of before when driving an LED matrix, but I can't remember its number. Any help would be appreciated. AI: I am not understanding why you cant use the 74HC595 for the LEDs. Shift in your data, then blip the clock for the storage register to hold that 8-bit value. As long as you aren't pulsing the storage register clock, you are free to shift bits all day long without effecting the final output bits. You can use the same serial data line for all your outputs and just selectively 'gate' which shift register will latch up. Please leave a comment if I have misunderstood what you are doing. I will elaborate my answer further.
H: Understanding electric DC gear motor for project I would like to build an Arduino controlled coin sorter and counter. I want to use a spinning angled disk with holes in them to pick up individual coins. I have been looking at some 3V DC geared motors on Ebay. I understand that high torque will be important so that it will be able to turn the disk with money pushing against the disk. How will I find out if a 5-8 RPM motor will be able to turn the disk? These small motors usually have no torque measurement given. Is there even a DC motor that runs at 3V that would be able to turn the disk? AI: Assuming that you can find a gear reducer with an effective moment of inertia within the motor's range, you can probably crush soda cans with a 3v motor. At some point you're so geared down that the actual load is all but invisible to the motor, and you're simply driving the gear reducer. BUT, to crush a soda can this way, it might take an extremely long time. It can take some effort to get this right. You might check out http://en.wikipedia.org/wiki/List_of_moments_of_inertia, and calculate the moment of inertia of a cylinder, maybe a quarter inch high with the density of copper and diameter of your hopper, as a first approximation of what you need to drive. The idea is that there will come a point where if you make your coin stack high enough, you won't be able to drive it. Of course, this is an approximation-- you're only trying to move the bottom layer of coins, and there's a mass sitting on top of that, yadda yadda yadda. We're ballparking here, not trying for an exact physical model. To find the inertial range of a hobby motor, try http://www.mabuchi-motor.co.jp/en_US/product/p_0303.html. Mabuchi seems like a pretty typical "hobby" motor. Enter the diameter of the motor you're thinking about, and 3 Volts, and take a look at the ratings page that comes up. You're interested in the torque at maximum efficiency. Do any unit conversions you need to do, and divide your cylinder moment of inertia multiplied by about 2-4 for a safety factor, divide by the inertia that the motor can drive from the mabuchi table, and that's the gear ratio you need for that motor. Look at the speed for that motor (in rads/sec), divide by the gear ratio, and thats how fast your coin disk will spin. If you're happy, go buy a motor/gearhead assembly to match. You can do this in any order -- start with the specs for the motor you'd like to buy, and calculate whether its good enough for you, start with a speed spec and make sure you meet it, etc. If you can't get there with a "regular" gearhead, other options might be something like a planetary gear, which would be very geared down, or maybe a worm gear drive. The opposite approach is to shop online, look for something that you think will work, buy it, wait for it to arrive, and see if it works. Repeat as necessary The right approach for you lies in between these two extremes, and has to do with how much money you want to put into it, whether returns are possible, whether you need to go way overkill just to make sure you meet a deadline, and all sorts of other factors. Lastly, look at the current specs for the motor you're about to buy, and spec out whether you can drive it without a driving circuit. As a guess, looking at some of the Mabuchi specs, I suspect you'll want something that can source about 300 mAmps to feel comfortable, maybe a half amp.
H: Programming languages for electronics engineers I am an Electronics and Communications Engineering student, before I got to college, I have been interested in programming and computer applications. I had focused on designing Windows applications and learning its techniques, but now, I feel that this is useless in my field... I don't have to learn everything about computer science and developing software! (Am I right about this?) I know VB .Net, C# and C++. I have plenty of time in my holiday so I want to delve deeper programmatically in "electronics field". So what would you recommend to learn or to focus on? I want those languages used in programming Microcontrollers and other integrated circuits. Is C++ enough or I should master C as well? Tell me your thoughts please. AI: Yes, it's almost certainly a good move to learn to use C as well as possible (C++ will give you a helpful starting point, although as leftaroundabout notes, there will still be plenty to pick up, especially the differences between coding for small embedded systems compared to writing for something like Windows) given it's ubiquity. Most microcontrollers below a certain size (e.g. PIC, AVR, MSP430, etc) use C (or assembler) as there are many high quality (free and $$ versions - e.g. many commercial compilers are based upon the free GCC compiler) C compilers available. You do get other languages like the excellent JAL for PIC (original author Wouter Van Ooijen who is a member here), PICBASIC, Ada variants, but due to it's popularity and number of compilers available, I'd say C is the language of choice for most. While this certainly doesn't mean it's the best language, using the most popular language comes with obvious advantages (documentation, support, portability, collaboration, etc) For the more complex and larger 32-bit micros like many ARM variants, there are also C++ and other compilers available. I would jump right in and grab a few development boards and get coding. You could pick a low end 8-bit micro like the PIC16F (many starter kits on Microchip Direct) A middle of the range 16-bit micro like the PIC24, and also a C/C++/embedded linux ARM of some sort - the STM32F4 ARM Cortex M4 Discovery is an very cheap dev board that might be worth grabbing. On the programmable logic and hardware description language (HDL - the big two are Verilog and VHDL) side, it may be also worth getting hold of an FPGA or CPLD dev board from Diglent or similar. If you don't want to wait for a dev board, you could download MPLAB or MPLABX and use the excellent simulator to try your hand at PIC development. Same goes for other tools too, for instance you can download Xilinx ISE Webpack for free and try out HDLs and programmable logic design.
H: 'Voltage Fuse' or better I have a power supply with multiple outputs (5v, 12, 24v) According to the manufacture (and after testing) there must be a minimum load on the PSU for it to supply the stated voltages. Without a minimum load the voltage can go up to 37V (which is very bad) As I can't garentee that the system I'm building will use minimum W all the time, I've added 'dumb' resistors to do the job. They get really hot but I used a 20W resistor when I just need to 'consume' 2W. After this, everything works fine. But in order for me to sleep well at night I would like to guarantee that if one of these resistors would fail for any reason, the high voltage would not burn the electronics. I have used a PTC for limiting current in the past but I would like to use a similar device to limit the voltage. Is there such device? Can you recommend on a different solution? I can't change the PSU now as it was the only one available in a very short notice. AI: Power supply in this circuit is +12V. Zener voltage and current rating of the PTC will depend on the specific power supply and load, of course. In case of overvoltage, the Zener diode starts to conduct and clamps down the supply voltage. At the same time, power supply current goes up. Then either power supply becomes regulated, or PTC fuse opens. For normal operation, this circuit should have margins. The Zener voltage should be slightly higher than the nominal power supply voltage. The max voltage, which load can tolerate, should be somewhat higher than the Zener voltage. (I really like this circuit, because it protects against: overcurrent, overvoltage, reverse polarity. And it does that with just 2 components.) edit: related post about this type of overvoltage protection. crowbar circuits Unlike the clamp circuit above, the crowbar circuit pulls the voltage below the trigger level. overvoltage and overcurrent protection ICs There are also overvoltage and overcurrent protection ICs. These are typically controller chips, which work with external FET switches. Some examples can be found here and here. The ICs called hot swap controllers sometimes have overvoltage and overcurrent protection functions too.
H: Conductive Lubricant for Connectors? I'm making a safety disconnect for an experimental RC craft. It will be tethered to the ground, and if it goes out of control the tether will pull a plug disconnecting the power. I will make the plug from a male Deans connector (pictured below) looped to connect the positive and negative terminals. The female connector will be in line with the battery. What's the best material to lubricate this connection? I would like the plug to disconnect as smoothly as possible when tugged by the tether. In general, what are the most common connector lubricants that are (a) conductive, (b) will not cause shorts, and (c) not messy? AI: The lubricant does not need to be conductive - the contact pressure between connector halves will push the lubricant out of the way and ensure a good connection. A wide range of lubricants will work for your application. Try dielectric grease (sold for starter battery terminals), petroleum jelly, or WD-40 (wiped, not sprayed). As long as it is very liberally applied and doesn't chemically attack/soften the plastic shell of the connector, it will likely work just fine. Be sure to mechanically strain relieve the assembly so that the connector housings take the load during disconnect rather than the conductors. If you had a bad crimp on the battery side of the connector, you might pull the connector right off the battery leads during the disconnect event, allowing them to short together directly. Not recommended!
H: Finding capacitors with low soakage (dielectric absorption) This technical note from Analog Devices indicates that low dielectric absorption is a prime requirement for choosing a capacitor for a sample-and-hold circuit (see page 11). It also suggests to look for capacitors advertised as low dielectric absorption. How do I go about searching for capacitors designed for low dielectric absorption? On Digikey and Mouser, it's not one of the listed parameters. I also tried searching based on dielectric type, based on information from Kemet and Wikipedia linking dielectric absorption to material. In this case, it seems like film capacitors are the best candidates (still can't find any datasheets that actually report absorption), but they have very low capacitance. Ideally I want 1uF or more capacitance, to limit the effects of charge injection from the analog switching logic. What terms and parameters should I use to guide my search? AI: The dielectrics with the lowest absorption are vacuum and air (which is jinxed in normal conditions by porcelain, glass or sapphire). Out of normal dielectrics, Teflon was the best in the last century. There have possibly been some improvements made for polypropylene and polyester caps. There is an article by Bob Pease about the phenomena http://electronicdesign.com/article/analog-and-mixed-signal/what-s-all-this-soakage-stuff-anyhow-6096 So your solution may involve Teflon or normal plastics. But if you are designing a new 9 digit voltmeter, then the capacitor design becomes very interesting, as interesting as a real analog trade secret can be. BTW, the percentages for DA cited on Analog Devices pages are in the range of 0.001%...
H: Detecting the placement of my finger on an invisible grid Yes, a similar question was asked before, but mine is different. Let me explain what I am thinking of. Suppose I have an invisible 3 x 3 grid on my desk, is there any way I can detect which square I place my finger on? To clarify, when I say invisible, I mean I cannot see it, but the computer knows it is there, and I have a general idea where the 9 squares should be. If it makes it any easier, imagine the grid is drawn on a piece of paper, and I need to detect which square I place my finger on without attaching anything to the individual squares. The way I thought I could accomplish this task is to use one of those distance sensors, one for each row (or column). So I have three distance sensors, and depending on how far away my finger is from the sensor corresponding to row which my finger is on, it gives me a reading to indicate the exact square. This method seems simple, but the drawbacks for me are that the device will be too bulky if I use the commonly known HC-SR04 sensor (is there a smaller one?), and would be a nuisance to extrapolate to, say, a 20 x 20 grid (not to mention expensive). Is there a cheap method I can apply to measure distance or position somehow on an invisible grid? AI: This would be an ideal situation to try a variant of the method pioneered by Johnny Lee using an IR led and a IR (infrared) camera, e.g., found inside a Wiimote or bought off ebay for $25-30. Any IR camera can be used, but the one from the Wiimote is superb for this because it's tiny and yet has a high resolution (1024 X 768) and a 100 Hertz update rate, better than even most standard (visible-spectrum) webcams. The camera tracks X-Y coordinates of a basic infrared LED in its view region, so you can get creative on where you place the camera. As far as the infrared LED/marker, you can wear it your moving finger/hand. Alternatively, if you don't want to wear an LED on your finger, you can have an array of several infrared LEDs sitting in a fixed position, emitting radiation which is detectably reflected by your finger if you put a piece of reflective tape around your finger (works rather effectively). Lots of flexibility. You can watch Johnny Lee's video demo 1 and video demo 2 of something similar to this; the demo is rather impressive given the minimalistic setup. Also, take a look at his original writeup. For this method, three pieces of software that might come in handy: Johnny Lee's C# open source to work with the IR camera's output UweSchmidt's Java version If you use an Arduino to interface with the camera, there is a library by Stephen Hobley
H: Why not run high power truck-mounted electronics from the truck's engine? At Burning Man, I see a lot of "art cars" based on internal combustion engine platforms using generators separate to the original vehicle's engine to power their LED displays and sound systems. Why do they do this? A typical truck engine might produce 200-400kW and even an extremely large LED array and sound system would only consume a few kW at most. Wouldn't it be simpler and more efficient to upgrade the original vehicle's alternator to supply the required power rather than adding a whole additional engine? AI: A typical truck engine might produce 200-400kW [...] That is mechanical power. Electrical power is generated in the alternator, and thouse typically generate power in the order of 1 kW, as that is enough to power the lights and charge the battery etc. The dedicated power generators are also more fuel-efficient, and can produce higher voltages - a big truck operates at only 24 Volts. Light and sound installations in the multi-kW range will usually need 110 or 230 Volts to operate. EDIT: Wouldn't it be simpler and more efficient to upgrade the original vehicle's alternator It would be simpler only when there is space available for a bigger alternator and when there is a bigger one actually available. But it would never be more efficent in fuel: The generators engine is highly optimized for its task (hopefully), and will be operated at or near its point of maximum efficiency. It will also be a lot smaller, as you need only a few kW instead of 100 or more. This has a big effect in fuel consumption.
H: Questions about heterodyne receivers All radio receivers seem to use the heterodyne principle. I can see that it will be easier to work with a fixed frequency than demodulating from a wide range. Questions: what's the difference between heterodyne and superheterodyne what does a double-superheterodyne add to that is there a reason why everyone uses the same intermediate frequency? is there something special about 10.7 Mhz which makes it better than 10 Mhz? is the heterodyne principle also used in modulators? AI: Superheterodyne and heterodyne are effectively the same. The "super-" merely indicates that the intermediate frequency is ultrasonic. See part way through the history section of Wikipedia's Superheterodyne receiver. Double-superheterodyne is a radio system which uses two different frequency conversion stages. This is used in analog TV to recover the audio band or in very wide tuning range radios in order to improve image rejection. See the wikipedia article's Advanced Designs section. Why 10.7MHz? In addition to producing the desired intermediate frequency signal, heterodyning also produces an image signal at twice the intermediate frequency. This is removed by the bandpass filter; however, image rejection is improved by increasing the intermediate frequency so that the image is better attenuated by the filter. At the time of FM radio development, ~10MHz was near the limits of what was possible. The choice of 10.7 vs 10 was so that the local oscillator radiation would fall in between stations since the US FM radio frequency allocation places stations every 0.2MHz. (summarized from the radio board's Why 10.7MHz IF?) Yes, the heterodyne principle may be used in modulation. Wikipedia Heterodyne page
H: DC-DC Up-Conversion without Switching Electronics I have a project where I am trying to find a means of powering a sensor with the following requirements: 24-30 V and a regulated constant current of 2 mA (about 60 mW). The latter requirement I will handle with a constant-current diode. The source power will come from a USB port (5V up to 200 mA). My problem is that I need a low-cost method of DC-DC up conversion with very low EMI characteristics and was looking for something more novel than a traditional switched-mode converter. Also, low heat generation and light weight would be desired. I am not an electrical engineer and wondered what my options were. I have some crazy ideas such as electric-light-electric conversion (such as LEDs wired in parallel sandwiched with photovoltaic cells in series), but was hoping there might be a conventional way of doing this. AI: A switching power supply is the conventional way. LEDs shining on lots of photocells in series would produce a higher voltage, but would also be horribly inefficient. You have 1 W available, so you would need 6% efficiency to get your 60 mW out. I haven't run the numbers, but that sounds considerably optimistic to me. You also say low heat generation is desirable, which means you need good efficiency. LEDs to photocells isn't going to meet that spec most likely (I say "likely" only because you haven't provide a real spec). You are also confusing requirements with implementation methods. Apparently what you really want is 25 V or so with very little noise. Don't assume you need a particular method to get that. You also haven't provided any spec. "Very low" is no spec at all, so really any method is acceptable. I would start with a normal boost switcher, filter that, then run it thru a linear regulator. Two stages of ferrite chip inductors in series with ceramic cap to ground in front of the linear regulator should get rid of the frequencies the regulator can't handle. Put a good cap on the output of the regulator too, and you should have a nice quiet supply.
H: 24 channel PWM IC I wan't to drive 8 RGB LED stripes (8 stripes * 3 colors per stripe = 24 channels) with PWM. Each output is driven with a logical level MOSFET. The stripes already have a resistor. I have looked at the TLC5940 and the TLC5942, but a forum post says, you have to set "BLANK" to ground to repeat each PWM cycle, and the ICs are a bit too "big" for this project. Is there a "simple" 24 channel PWM IC out there (SPI or I2C preferred)? AI: TLC5952 don't have this bug, and it's cheaper than TLC5942 in Farnell.
H: LT3080 regulator question The datasheet of the LT3080 voltage regulator says that "For true zero voltage output operation, this 1mA load current must be returned to a negative supply voltage." What exactly does this mean? How can I return the minimum required load current to a negative supply voltage? In case I have a single supply and I generate a negative voltage using a charge pump how would I connect the minimum load to the negative voltage generated by the charge pump? AI: Yes, you're going to have to generate a negative voltage somehow. The minimum load could be as simple as a resistor that draws at least 1mA when the output is at zero volts. However, this might be problematic at higher output voltages, because the resistor would dissipate more power and the negative supply would have to deal with the additional current through the resistor. It might make sense to use a transistor to create an active current sink. If you're using just a resistor, connect it between the output of the LT3080 and the negative supply. Suppose your negative supply is -5V; the value of the resistor would be 5V/1mA = 5000Ω. The standard 5% value of 4700Ω would give you a little extra margin: 5V/4700Ω = 1.06mA. If you'd like to add an NPN transistor to this, connect the collector to the LTC3080 output, connect the base to ground and connect the resistor between the emitter and the negative supply. The only critical parameter of the transistor is that it needs to be able to handle the maximum voltage that the LT3080 will be producing (Vce(max)). Now, when you calculate the resistor value, you need to allow for the Vbe drop of the transistor. Again, using -5V as the negative supply, the resistor value is now (5V - 0.7V)/1mA = 4300Ω. This happens to be a standard 5% value ... or you could give yourself some margin by using 3900Ω: 4.3V/3900Ω = 1.10mA.
H: Arduino - pin13 is HIGH by default I've made some tests with my Arduino UNO, all worked great: analog i/o, digital i/o, serial i/o. Then I've noticed that built-in LED on pin 13 is always on. I've uploaded an empty program like void setup(){} void loop(){} and it still was on. When I manually turned it off by digitalWrite command it switched off. So it works well. I just want to know if I've broken the board somehow or it's just some feature, which I do not get? NOTE: a mate of mine has the same board with the same problem. Any ideas? Thanks much! AI: Taking a look at the Arduino Uno's schematic explains this, if I understand the schematic correctly. I don't own an Arduino Uno, so I can't verify with a multimeter, so I might be wrong. As I understand from the schematic, pin 13 of the arduino, the SCK pin, is connected to an op amp buffer. When you (or anyone) upload a program that doesn't do anything to pin 13, it's default state is an input without a pullup. When a digital pin is configured as an input without a pullup resistor, it has a high impedance (high-Z) and unspecified voltage. It can be 0V, but might be something like 1.5V as well. The measurement will depend on the impedance of your meter, among other things. Upload an empty sketch and check the voltage on the pins - you'll find they're pretty random and not always 0V. Now, a high-Z input pin with, say, a few volts will not be able to power an LED. However, this voltage is buffered by the Uno's op amp, and repeated on the output. This op amp will be able to power up an LED, and apperently, it does. I think the Arduino team should add a high ohmage pulldown resistor (e.g. 50kOhm) to make this less confusing.
H: How to read a gyro/accelerometer I recently purchased this MPU6050 GY-521 breakout board. I tried it with my Arduino Mega using this Arduino sketch provided by official arduino.cc. (MPU-6050 Datasheet, InvenSence (producer) Page) Man, it gives this weird output!!! InvenSense MPU-6050 June 2012 WHO_AM_I : 68, error = 0 PWR_MGMT_2 : 0, error = 0 MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1944, 368, 15608 temperature: 30.576 degrees Celsius gyro x,y,z : -34, -204, -247, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1952, 364, 15304 temperature: 30.435 degrees Celsius gyro x,y,z : -38, -216, -274, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1864, 388, 15356 temperature: 30.482 degrees Celsius gyro x,y,z : -34, -233, -278, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1888, 324, 15260 temperature: 30.576 degrees Celsius gyro x,y,z : -14, -220, -261, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1904, 392, 15316 temperature: 30.624 degrees Celsius gyro x,y,z : -34, -241, -238, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1856, 308, 15604 temperature: 30.435 degrees Celsius gyro x,y,z : -33, -252, -235, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1892, 444, 15528 temperature: 30.624 degrees Celsius gyro x,y,z : 20, -236, -251, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1924, 356, 15520 temperature: 30.576 degrees Celsius gyro x,y,z : -19, -224, -251, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 1844, 280, 15732 temperature: 30.529 degrees Celsius gyro x,y,z : -1, -240, -249, MPU-6050 Read accel, temp and gyro, error = 0 accel x,y,z: 2004, 372, 15396 temperature: 30.671 degrees Celsius gyro x,y,z : -20, -252, -255, (This is only a part of it, it gives this king of output continuously). I know for sure, only the temperature reading is meaningful. But what are those values given for acceleration and gyro readings?? OK, It says those are raw values. If it is so, then how can I convert them into meaningful values. Hoping it can be helpful (as many suggested), I also like to know how to use so called Jeff Rowberg library. Hope there will be someone experienced with MPU-6050 module. Just give me a point to start. I have no clue on how to use the module... :( Any help is greatly appreciated. Thanks ! AI: The accelerometer's reading seem to make sense. The datasheet, page 13 indicates 4 different sensitivities: 2 g 4 g 8 g 16 g with resp. sensitivity scale factors: 16 384 counts/g 8 192 counts/g 4 096 counts/g 2 048 counts/g From the Z-reading I assume you have the 2 g scale selected, then 15 608 is 0.95 g, which is what you can expect from a Z-axis reading when you hold the sensor more or less horizontal. The X- and Y-reading are probably also due to gravitation when you're not holding the part perfectly horizontal. And you'll have an error in the reading too. Similar for the gyro. At 131 counts per degree/s you may have this kind of reading if you're holding the part in your hands.
H: What is clock skew, and why can it be negative? My HDL compiler (Quartus II) generates timing reports. In it, the nodes have "clock skew" column. The only definition of clock skew I found is in the TimeQuest documentation (see page 7-24): To manually specify clock uncertainty, or skew, for clock-to-clock transfers, use the set_clock_uncertainty command. So if skew is "uncertainty", why are some of my clock skews negative (e.g. -0.048)? What exactly is clock skew? AI: From Wikipedia: In a synchronous circuit clock skew (\$T_{Skew}\$) is the difference in the arrival time between two sequentially-adjacent registers. Given two sequentially-adjacent registers \$R_i\$ and \$R_j\$ with clock arrival times at register clock pins as \$T_{Ci}\$ and \$T_{Cj}\$ respectively, then clock skew can be defined as: $$T_{Skew i,j} = T_{Ci} - T_{Cj}$$ Clock skew can be positive or negative. If the clock signals are in complete synchronicity, then the clock skew observed at these registers is zero. So the amount of clock skew at one register is relative to another register. Since it's relative, it can be positive or negative. Some illustrations: Take for example an intraclock transfer as defined in the TimeQuest document you provided: Intraclock transfers occur when the register-to-register transfer takes place in the core of the device and the source and destination clocks come from the same PLL output pin or clock port. So if the destination register is physically closer to clock generation circuitry, then the clock will probably arrive at the destination register before it arrives at the source register, resulting in a leading clock skew which is actually positive. If the destination register received the edge of the clock after the source register, the clock skew would be lagging or negative. Said another way, clock skew is the uncertainty about how closely together in time a clock edge will reach two separate registers given in units of time with respect to a source register in an register-to-register transfer. Expanding that difintion to include inter -clock transfers and setup and hold times gets a bit messy. So it's probably easier to think of it as "how synchronous" an edge or a hold time is between two registers. We tend to think of "synchronous" as "occurring at the same time". But things rarely occur at absolutely exactly the same time. So we need to put a tolerance on that time. And tolerances are often stated in terms of positive and negative (i.e. ±).
H: What's the deal with this beamed mains transformer design? Take a look at the image. I always understood that transformers have as little air gaps in them as possible, but you can easily look through this mains transformers that I found in China. Not just for the EM-field, but also for dissipation purposes I'd expect the transformer to be one huge brick of metal. Where is my thought wrong? AI: Those fins you see are for cooling (they're full of oil). They have nothing to do with the electrical function; that's all inside the central casing.
H: When is an input signal considered small for BJT and JFET devices? I can't find a detailed answer to this question. What is the condition for a signal to be considered small, so that you have to use small signal modeling? Also how is this condition derived for both BJT and JFET. AI: It's not that you have to use small signal modelling when the signal is small...it's that you can use small signal modelling when the signal is small. A small signal model will typically be much simpler to compute than a large signal model. The reason the small signal model is simpler to compute, is that it linearizes all the circuit behavior around an operating point. It assumes that any change in the input signal will be reflected by a proportional change in the output signal. Equivalently, it assumes that with sinusoidal inputs, there will be no harmonic frequencies generated at any of the circuit nodes. In the small signal regime, the simulation can be done using pure linear algebra, without having to solve transcendental functions or do numerical integrations. So when are you allowed to use a small signal model? Basically when the signals are small enough that the nonlinear behavior is negligible. How small this is depends on the exact details of the devices and the circuit, and on how accurate you need the result to be. As the signal amplitudes increase, the small signal model will be more and more inaccurate. It's up to you to decide when this inaccuracy is too much.
H: RS485 Cable Lengths and Reflections In our lab we have setup a RS485 network with short cables and the network is working fine. I know that terminating resistors are required, especially with longer cables lengths due to reflections on the line. Why do shorter cables work correctly without terminating resistors, and why do we not see a lot more reflections on the shorter line? AI: Oh, the reflections are there, don't worry :-). It's just that for short distances the delay of the reflected signal is so short that it won't distort the original signal much. Think of a 1 µs pulse, in a typical cable that will stretch over 200 m (at 2/3 \$c\$). Then at a 2 m cable the reflection will come after 1 % of the pulse width, and the distortion will be limited because the phase difference between signal and reflection will be negligible. But at a 200 m cable the reflected pulse will go all the way back to the source until the end of the pulse arrives at the receiver's end. Reflecting again and you'll have ghost signals after the original signal has ended. Lengths between 2 m and 200 m will see much more interference between original and reflected signal. The rule-of-thumb is that you consider transmission-line effects when the length of the cable exceeds 1/10th of the signal's frequency. Then the cable's impedance and the terminating impedance must be matched to avoid these reflections. Note that it's all because of the limited light speed, however fast we always see it. If the light speed in the cable were infinite there wouldn't be problems like signal reflection with unmatched impedances.
H: How to explain the difference in modeling small signals for BJT and JFET devices? I know there is a difference between modeling BJT and JFET devices for small signals, but I would really like to know, in depth, how to explain this difference. AI: The form of the small-signal models for the BJT/FET are essentially the same. This is because of the way small-signal models are constructed. In both cases, there is an equation that relates the collector/drain current to base-emitter/gate-source voltage and the collector-emitter/drain-source voltage. To derive the small-signal model, the collector/drain current equations are Taylor expanded about the operating point and only the first order (linear) terms are kept (thus the small-signal approximation). The term involving the base-emitter/gate-source voltage is modelled as a voltage controlled current source. The term involving the collector-emitter/drain-source voltage is modelled as a resistor. In the case of the BJT, we do something similar with the base current equation and model the linear term there with a resistor. Since the (DC) gate current is zero, there is no equivalent resistor in the model. Of course, this simple picture ignores the inter-element capacitance and other departures from the basic governing equations. A nice derivation of the BJT small-signal model is here. The FET version is here.
H: Will moving transformer to separate case reduce noise in opamp-based circuit? I'm building a simple phono preamp for my friend. I've designed a transformer based power supply to be on the same board as an opamp, then I hesitated - will I get less mains interference if I move the transformer and linear regulators to separate box that will be far away from the preamp? AI: You can find magnetic shielding foil designed specifically for transformers. It's a bit expensive though! You can try to build a shielding enclosure for the power supply. It needs a high µ constant. Although the price of mu metal is ridiculously high, you can substitute it with steel and still get some shielding. You can even take a shortcut and use an existing shielding cage from a scrap power supply lying around somewhere. Also, depending on the construction of the transformer you're using, the magnetic field escaping outside of its core might not be that strong. Sure, you could move it a few feet from your amplifier, but that might not be necessary. It would actually be a good experiment to test how much noise your transformer induces in traces around it.
H: Inductive choke with bypass capacitors? I've been looking at a few power input circuits and quite a few of them suggest an inductive choke with a large bypass capacitor followed by smaller bypass capacitors. In theory this is what I interpret the target effect is: Bypass capacitors provide low impedance at high frequencies, and the inductor prevents current surges from entering/leaving. Essentially, in using an inductor inline and a decoupling capacitor it's creating essentially a series LC circuit. Now one of the properties of LC circuits is they have a resonant frequency. I modeled a LC circuit with an attached purely resistive load to simulate what the circuit did under different kinds of loads: VG1 is a voltage source to simulate noise and VM1 is a product of the simulation software for measuring voltages (I'm using TINA-TI). Here is the resulting Bode plot for this circuit: As expected high frequency noise is very effectively reduced (if I'm not mistaken, outside the peak region it should decay at 40 dB per decade). However, there is that ominous spike at around 20 kHz where noise is actually being very effectively amplified from the resonant frequency. Is this typically not a factor when it comes to regulating power to a board? Why isn't the RC filter created using bypass capacitors enough? Is it because the capacitor size required for an effective RC filter is too high? Or am I missing something in my model? The example recommended power filtering schematic comes from Atmel for their AVR micro controllers. AI: I'm more for an RC-filter than an LC, and the resonance is one reason. You have a high noise suppression above the resonance frequency, but hardly anything below. If you then want a low cutoff-frequency the inductor may become impractically large. I've seen circuits where EMI ferrite beads are used, but these are almost useless. They do have a near zero impedance at DC, but their peak impedance (often a few hundred ohms) often lies above 50 MHz, so much noise will hardly be filtered. But the RC-filter isn't ideal: the resistor will have a voltage drop, and if you choose a low resistance you'll need a quite large capacitor to keep the low cutoff-frequency. An RC-filter may be acceptable if the microcontroller won't need much power (don't forget what it sources to its I/Os!), but at 5 mA a 100 Ω will already drop 500 mV, which is fine if the input voltage is chosen a bit high especially for this, but which you maybe can't afford.
H: Recommend motor type to turn baby rocker, into auto-rocker Would like to convert a baby bouncer (like this one), which requires continuous manual effort to rock it, into one that use electro-mechanical means to auto-bounce. However, my aim is to make these on the cheap (as all of my other projects so far have). So I am on the look out for alternative design approaches or parts. My idea is to place a low RPM, high torque (unable to quantify, since I've not work with DC motors, beyond the ones found in small toy cars etc.), DC motor (brushless?), which periodically winds (like a winch) pulling the bouncer seat to the low-position, and then (here is where, I am not sure, it is right or feasible to do with standard DC brushless motor), just de-energise the motor, for the bouncer to bounce up, and have few naturally dampened oscillations (bounces), and then repeat the process. Is the above approach correct ? Will de-energising the motor, and the rapid unwinding in opposite direction, make it act like a dynamo and feed current back into the circuit ? Can that harm the motor ? Will stepper motor be a better approach ? AI: How about an alternative approach? Use a solenoid. You only need to inject a little bit of energy into the system to get it oscillating. Wind up a big coil. Attach a steel rod to the back of the rocker, and when you energise the coil, it will pull the rod into it. Switch the current on and off, and you'll cause the rocker to bounce up and down. If you time it correctly, you'll achieve resonance. The best way to do this is to have a little sensor to detect the position of the steel rod. Energise the coil when the rod is all the way out of the coil, and de-energise it when it's all the way in. This has the advantage that it'll be quiet.
H: Do you need to UL Certified the enclosure with the board inside? I want to use the RaspberryPI in an industrial environment that requires all devices have UL certification. The RaspberryPI board has UL certification but there is currently no enclosures that are certified. I have been told the UL certification process is expensive and probably beyond the scope of this project. My questions are: Do I need to UL certify the enclosure for a board that is already certified. Can you certify a enclosure without the board inside of it? (So i can pick up a board off the shelf and put the RaspberryPI in it) How expensive is the UL certification process for an enclosure where the board has already been certified? AI: The Raspberry PI is not UL approved, to the best of my knowledge. The original intent was not to have any certification done at all since it's essentially a development kit. However, things changed and they were forced to do some EMI and ESD tests to get CE certification , which they successfully did. They're OK for CE, FCC and C-tick approvals, but not UL. Don't be surprised if UL doesn't want to do a full investigation, including the Pi. You'll likely also have to guarantee that your setup will use an approved power supply for the Pi.
H: In a Boost Converter, where is most of the heat dissipated? In a circuit like this: I am for now assuming that a lot of the head will be dissipated by the Diode, and hence I am preparing the PCB to include a heat sink for it just in case. But what about the inductor and the switching IC U2? And the MOSFET? Any tips on PCB design to dissipate a lot of the heat that will come out of this circuit at max load? AI: Hop on over to the TI page for this chip, and fire up the Webench. That will tell you a lot about the power supply. Click on the Op Vals icon at the top, and it will list loads of useful variables. Here you can see the power dissipation for the MOSFET, Diode and IC. It looks like the MOSFET dissipates the most power, and so will need the most heatsinking. Try it yourself, and put in the correct values for input and output voltages and output current that you'll be using.
H: Using a 555 instead of 7555 I'm creating this circuit (original circuit source here) and it requires a 7555 timer. A 7555 timer is like the next generation 555 since it is CMOS. Now there are no 7555s or CMOS 555 in my area and was wondering what will happen if I replace it with the NE555? Are there any consequences? Will it behave in the same manner? What would be the best thing to do? Edit Seems like in order to use NE555, adjustments must be made. What are they? AI: The NE555, being TTL has a minimum input voltage of 4.5V. It won't work on the 1.5V that your referenced circuit uses. That said, I see no reason why you couldn't use an NE555 at 5V, provided that you adjust the values of R2, R3, and add 5 diodes (3.5V worth) in series with the LED.
H: Captive Nut For PCB Grounding I need to affix a ground strap to my PCB. A strap similar to . Ideally I want to simply screw this to the board. Are there captive nuts available for this purpose? I can't find anything via a standard source Digi-key or Mouser. I see that PEM makes some but after inquiring I have to order a full reel. That's much more than I need or want. Also, is there anything else I need to be concerned with in this situation? AI: There are PCB-mount screw terminals. Female thread on top, throughole pins on the bottom. Kind of a nut, which is soldered to a PCB. These are avaible on Mouser and DigiKey in small quantities. Use a star washer too, by the way.
H: What will happen if I apply 220 dc voltage to a 220 ac load? Let say I have a lamp which is operated on 220 V ac. Instead of applying 220 AC voltage I apply 220 DC voltage: what will happen? And if I want to convert this 220V dc to 220V ac then what should I do? AI: An incandescent bulb will do fine. The 220 V AC is the RMS value, for Root Mean Square. The sine's amplitude will be \$\sqrt{2}\$ higher than that, or 310 V. But the RMS value tells you what equivalent DC voltage you would need to get the same power, so that's exactly what you need. The bulb will use the same power and light as bright under 220 V AC as DC. Switching on an incandescent bulb may cause a large current peak: the cold resistance is only about a tenth of what it is when the lamp is lit, and when the voltage applied is high at that time the lamp may break. You may have noticed that if a bulb breaks it always does when switching on. So at AC worst case is when you switch on at the peak of the sine, at 310 V. But there will be lots of cases when the voltage is lower when switching on, even zero if you just happen to switch on during a zero-crossing of the sine. In fact that's the best thing to do for the bulb's longevity. At DC you don't have this; anytime you switch it on it will be 220 V. Not as bad as 310 V, but you can't use zero-crossing switching either. about RMS Why do we use RMS value instead of just the average? The average of a sine is just zero, so that doesn't help at all. If we want to know how much power a voltage generates in a load we have to use the power equation \$ P = V \times I = \dfrac{V^2}{R} \$ It's the second form we're interested in. Power is proportional to voltage squared, that's what the "S" in RMS comes from, we square the voltage. The blue sine is our AC voltage, 1 V peak. The purple curve is that voltage squared, and the yellowish is the average of that, or mean: the "M" in RMS. It's precisely 0.5 V\$^2\$. It has still the dimension of voltage squared, so to get to a voltage quantity we take the square root of that, that's \$\frac{\sqrt{2}}{2}\$ V. The "R" in RMS. So RMS spelled out in full means: "the square root of the average of the voltage squared". This shows that the amplitude (1 V) is \$\sqrt{2}\$ higher than the RMS value. That's where the 310 V comes from: 220 V \$\times \sqrt{2}\$ = 310 V.
H: transferring raw schematic to breadboard and PCB i have some schematic from TINA pro, pspice, orcad and the lite. Is there a way to automatically convert it into a both breadboard and PCB layout. This is a bright idea since it will save time. What are your suggestions? AI: If you use TINA pro, then let say you have a circuit below a very simple circuit indeed :)) and follow below and there, you have it
H: Power Line Crackle I walk to work every morning and pass under some HV power lines. On high-humidity days, there's an audible crackle/sizzle emanating from the lines. I never hear this on the way home. I would expect this to come from condensation on the insulators, but curiously it is audible only in the center of each span. My first guess is that it's produced all along the wire but audible in the middle because that part is so much closer to the ground. My question is: If there's enough leakage into the air that I can hear it, doesn't that represent a huge loss over miles and miles of wire? AI: Yes, there's some loss, but it's usually miniscule relative to the amount of power the wires are carrying. The sound comes from moisture on the wires themselves and in the air around them. The strength of the electric field around a narrow cylindrical conductor (e.g., any wire) is highest right at the surface of the conductor, and with high-tension transmission lines, it can reach the point where it ionizes the air itself. This is known as corona discharge. It happens all the time, but when the air and wires are dry, it doesn't produce any sound. EDIT: One other thought: Sometimes on very high-tension transmission lines, you'll see that each conductor is actually a cluster of 3 or more separate wires, held apart by spacers. This is an attempt to mitigate the corona losses, by increasing the effective diameter of the wire and thereby reducing the intensity of the electric field.
H: Error in using Arduino virtual wire I have this 433MHz RF Tx and Rx pair. I tried to transmit using following simple Arduino sketch, given in the VirtualWire manual. #include <VirtualWire.h> void setup() { vw_setup(2000); // Bits per sec } void loop() { const char *msg = "hello"; vw_send((uint8_t *)msg, strlen(msg)); delay(400); } I've installed VirtualWire Library properly (it's there in Sketch -> import Library). But Arduino IDE gives following errors when trying to verify. It says 'vw_setup' was not declared in this scope In file included from sketch_sep08a.cpp:1: C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:59: error: variable or field 'vw_set_tx_pin' declared void C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:59: error: 'uint8_t' was not declared in this scope C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:63: error: variable or field 'vw_set_rx_pin' declared void C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:63: error: 'uint8_t' was not declared in this scope C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:67: error: variable or field 'vw_set_ptt_pin' declared void C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:67: error: 'uint8_t' was not declared in this scope C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: variable or field 'vw_set_ptt_inverted' declared void C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: 'uint8_t' was not declared in this scope C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:76: error: variable or field 'vw_setup' declared void C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:76: error: 'uint16_t' was not declared in this scope C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:98: error: 'uint8_t' does not name a type C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:107: error: 'uint8_t' does not name a type C:\Users\LordXaX\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:112: error: 'uint8_t' does not name a type sketch_sep08a.cpp: In function 'void setup()': sketch_sep08a:3: error: 'vw_setup' was not declared in this scope sketch_sep08a.cpp: In function 'void loop()': sketch_sep08a:9: error: 'vw_send' was not declared in this scope Why is that. How to fix this? This is the content of imported VirtualWire.h // VirtualWire.h // // Virtual Wire implementation for Arduino // See the README file in this directory fdor documentation // // Author: Mike McCauley (mikem@open.com.au) // Copyright (C) 2008 Mike McCauley // $Id: VirtualWire.h,v 1.3 2009/03/30 00:07:24 mikem Exp $ #ifndef VirtualWire_h #define VirtualWire_h #include <stdlib.h> #include <wiring.h> // These defs cause trouble on some versions of Arduino #undef abs #undef double #undef round // Maximum number of bytes in a message, counting the byte count and FCS #define VW_MAX_MESSAGE_LEN 30 // The maximum payload length #define VW_MAX_PAYLOAD VW_MAX_MESSAGE_LEN-3 // The size of the receiver ramp. Ramp wraps modulu this number #define VW_RX_RAMP_LEN 160 // Number of samples per bit #define VW_RX_SAMPLES_PER_BIT 8 // Ramp adjustment parameters // Standard is if a transition occurs before VW_RAMP_TRANSITION (80) in the ramp, // the ramp is retarded by adding VW_RAMP_INC_RETARD (11) // else by adding VW_RAMP_INC_ADVANCE (29) // If there is no transition it is adjusted by VW_RAMP_INC (20) #define VW_RAMP_INC (VW_RX_RAMP_LEN/VW_RX_SAMPLES_PER_BIT) #define VW_RAMP_TRANSITION VW_RX_RAMP_LEN/2 #define VW_RAMP_ADJUST 9 #define VW_RAMP_INC_RETARD (VW_RAMP_INC-VW_RAMP_ADJUST) #define VW_RAMP_INC_ADVANCE (VW_RAMP_INC+VW_RAMP_ADJUST) // Outgoing message bits grouped as 6-bit words // 36 alternating 1/0 bits, followed by 12 bits of start symbol // Followed immediately by the 4-6 bit encoded byte count, // message buffer and 2 byte FCS // Each byte from the byte count on is translated into 2x6-bit words // Caution, each symbol is transmitted LSBit first, // but each byte is transmitted high nybble first #define VW_HEADER_LEN 8 // Cant really do this as a real C++ class, since we need to have // an ISR extern "C" { // Set the digital IO pin to be for transmit data // Defaults to 12 extern void vw_set_tx_pin(uint8_t pin); // Set the digital IO pin to be for receive data // Defaults to 11 extern void vw_set_rx_pin(uint8_t pin); // Set the digital IO pin to enable the transmitter (press to talk) // Defaults to 10 extern void vw_set_ptt_pin(uint8_t pin); // By default the PTT pin goes high when the transmitter is enabled. // This flag forces it low when the transmitter is enabled. extern void vw_set_ptt_inverted(uint8_t inverted); // Initialise the VirtualWire software, to operate at speed bits per second // Call this one in your setup() after any vw_set_* calls // Must call vw_rx_start() before you will get any messages extern void vw_setup(uint16_t speed); // Start the Phase Locked Loop listening to the receiver // Must do this before you can receive any messages // When a message is available (good checksum or not), vw_have_message(); // will return true. extern void vw_rx_start(); // Stop the Phase Locked Loop listening to the receiver // No messages will be received until vw_rx_start() is called again // Saves interrupt processing cycles extern void vw_rx_stop(); // Return true if the transmitter is active extern uint8_t vx_tx_active(); // Block until the transmitter is idle extern void vw_wait_tx(); // Block until a message is available extern void vw_wait_rx(); // or for a max time extern uint8_t vw_wait_rx_max(unsigned long milliseconds); // Send a message with the given length. Returns almost immediately, // and message will be sent at the right timing by interrupts // Returns true if the message was accepted for transmissions // Returns false if the message is too long (>VW_MAX_MESSAGE_LEN - 3) extern uint8_t vw_send(uint8_t* buf, uint8_t len); // Returns true if an unread message is available extern uint8_t vw_have_message(); // If a message is available (good checksum or not), copies // up to *len octets to buf. // Returns true if there was a message and the checksum was good extern uint8_t vw_get_message(uint8_t* buf, uint8_t* len); } #endif AI: You need to ensure the Arduino VERSION-specific header files that the library needs to use are in fact included. So you can either download the latest version of the library -- perhaps they've already adapted it for the new Arduino version -- or alternatively, you can try this: At the top of VirtualWire.h, replace: #include <stdlib.h> #include <wiring.h> with this: #include <stdlib.h> #if ARDUINO < 100 #include <wiring.h> #else #include <Arduino.h> #endif
H: What to look for in a motor? I am going to be making a small robot using a Arduino Mega ADK Rev3 with 4 motors, and about a pound of other stuff. This is the first time I'm doing any major hardware project, so I'm not really sure what to look for in a motor. AI: There are a few primary specifications you should look for in a motor: The type of the motor. There are a variety of different electric motors out there. In my experience the cheapest ones are brushed DC motors. These are fairly simple to drive: you send the motor a PWM signal and it spins faster with a higher duty cycle. Reverse the polarity and they spin the other way. I'm guessing this will probably fit your project the best. Electrical characteristics. This includes the nominal voltage the motor runs at, what the stall current is, and what the rated current is (note: the rated current doesn't necessarily have to be greater than the stall current). Most DC motors I've used which are capable of driving semi-small to medium sized robots (about what size you have, though probably heavier) run in the 12-24V range so you may have to plan your battery packs accordingly. The stall currents has varied anywhere from a 1-2 amps to over 30 amps. Mechanical characteristics. This includes the no-load speed of the motor, the stall torque of the motor, and any other mechanical characteristics such a rated torque or any gear ratio present (if in a geared motor). DC motors have a linear torque to speed ratio, i.e. they develop the maximum torque when stalled which decreases until the motor is spinning at it's maximum speed. The speed-power curve increases until the motor reaches half the no-load speed and then decreases. Typical DC motors have a very high no-load speed. Most I've seen vary between ~5000 rpm up to ~20000 rpm, though much high rpm ranges are definitely available. Here's how I would determine what kind of motor to look for: First I would figure out what kind of speed I want my robot to achieve. Next I would determine roughly how much my robot weighs. I would do a quick survey of what motors are available keeping in mind the mechanical characteristics. A quick calculation of the max speed of a robot is: $$speed_{robot} = diameter_{wheels} * \pi * speed_{motor} / gear~ratio $$ The required torque is a trickier quantity to calculate as you'd need to know what kind of friction/resistance your robot is going to encounter and know roughly how much your robot weighs. Assuming rotational inertia of the wheels is small compared to the mass of the robot (and if I did my math right), the ideal speed of the robot vs. time is given by: $$ V(t) = w_d \cdot \pi \cdot \omega_{NL} \cdot ( 1 - e ^ {\large{- \tau_S / (2 \pi \cdot m \cdot \omega_{NL}) t}}) $$ Where: $$V(t) = robot~speed$$ $$w_d = wheel~diameter$$ $$\omega_{NL} = no-load~motor~speed~(including~gear~ratio)$$ $$\tau_S = stall~torque~(including~gear~ratio)$$ $$m = mass~of~robot$$ $$t = time$$ $$\pi = 3.14...$$ $$e = 2.72...$$ You can add the torque of all the drive motors together. I would then design the electrical systems to fit the required electrical characteristics of the motor. This includes the motor driver, battery packs, and any wiring. Gear ratio is the ratio between the input speed divided by the output speed of a gear box. They are used to speed up or more often slow down the output drive shaft speed. As a consequence of the speed ratio change the output torque also changes. In an ideal gear box with 100% efficiency the gear ratio is equal to the output torque divided by the input torque. This is mostly true for real gear boxes, but in reality most gear boxes lose ~2% between gear mesh (note that this relation is exponential as each gear mesh produces an input/output set, so for a gear box with 12 meshes the efficiency drops from 100% to ~78.5%).
H: Selecting AVR microcontroller with or without PicoPower? I have been using ATTiny13 DIP AVR's for a few years, for very simple projects. I'm now expanding and switching to surface mount devices. I'm a little confused about some of Atmel's offerings; let's take one example, the ATTINY26. Specifically there are so many variants of this that I have no idea what to select. If I select non-reel SOIC, I'm left with three choices: ATTINY261-20SU: 20MHz, 2.7-5.5V ATTINY261V-10SU: 10MHz, 1.8-5.5V ATTINY261A-SU: 20MHz, 1.8-5.5V (PicoPower) Based on these, is there any reason I would not want to select the newer "PicoPower" (1.8V) capable AVR? I realize that the clock speed decreases with less power. In my application, I do not need to take advantage of the lower power operation. Since the cost for small quantities is similar, there's no real advantage that I can see to selecting the slower 10MHz version. Bottom line, is there any reason to opt for the older and/or slower (first two listed) rather than the newer low-power version? Edit: PicoPower on this device is 1.8V, not 0.7V. (I must have misread part of the datasheet.) AI: PicoPower AVRs are not necessarily slower. If you want them to run on low voltage, only then you have to run them slower. Older "V" devices tend to be inferior in sense of speed, newer PicoPower as far as my experience goes (I'm building my first low power design now) can run as fast as "normal" devices when powered from 5V.
H: Outrunner motor I'm building a flying copter and I've tried to control the speed of it's motors. All worked just perfect: I had a standard motor (with brushes) which had two wires, I've applied different input voltage and controlled it's speed. The problem was, it was way too powerless... I've ordered a nice outrunner motor, but it has THREE wires, so this confused me much. How do I connect it? And how do I adjust it's speed? Thanks much! AI: This is a Brushless motor. The thing about brushless motors is that an electronic circuit is required to switch the current between the coils as the magnetic part spins. You need an Electronic Speed Controller to make it work. This contains all of the switching parts, and it also (magically) able to detect the position of the rotor, so that it knows exactly when to switch the current from one coil to another.
H: 555 trigger frequency signal So, I'm remembering that back in school, I managed to make a 555 signal create a tone signal, and that another 555 could trigger the 555, such that I had a variable toned signal that could be pulsed. IE, I could change the frequency, and pulse the frequency. IE, I could have 3 pulse per second of a 1Kz tone. I've been trying to figure out how to do this circuit today, and have been having problems with one small portion of it. I can create the tone, create the pulses, but I can't seem to make the pulses trigger the higher frequency signal, I can't figure out how to trigger it. What am I missing? AI: The usual way to do it is to connect the output of the low-frequency 555 to the reset input of the high-frequency 555, so that the latter is "gated" by the pulses of the former.
H: What is this IC? The markings at the top say "TC104-1", and at the bottom "9041". It was found in a box of random ICs and parts, and googling hasn't lead me anywhere. AI: Looks to be a Texas Instrument TC 104-1, CCD line scan sensor. From Data Sheet Archive I was able to find: TC104-1 Linear CCD Image Array - DR 1000:1,WhiteRefer.Elements Vertical Pixel Count=1 Horizontal Pixel Count=3456 Vertical Pixel Dimension (m)=10.7u Horizontal Pixel Dimension (m)=10.7u Horizontal Dimension (m)=36.9m Vertical Dimension (m)=10.7u Vsup Nom.(V) Supply Voltage=14 P(D) Max.(W) Power Dissipation=112m Package=DIP These types of chips are typically used for automated inspection cameras or flat bed scanners. They are a 1D CCD sensor.
H: Replacing D cell batteries with power adaptor I have a device with 4 series 1.5V D cells batteries (About 8000maHour). The batteries last 40 hours, making the average draw around 200mA. The problem however is that the duty is about 2% at 1/3Hz, so it seems to deliver bursts of about 10A, and I don't really want to put in a 10A 60W supply for something that is only about 1.2W average. And unless my math has failed me, the bursts are 1000J so I would need about a 55F capacitor, which is out of the question. Any one know of any other tricks I could use? AI: And unless my math has failed me, the bursts are 1000J so I would need about a 55F capacitor, which is out of the question. Your math has failed you. :-) You mention that the duty cycle is 2% at 1/3 Hz. The period is therefore 3 seconds, and only during 2% of those 3 seconds does your device deliver 10 A. 2% of 3 seconds is 0.06 seconds. While your device may consume 60 W while delivering 10 A, it does so for only 0.06 seconds, then "rests" for 2.94 seconds. This means that the energy delivered per pulse is only 3.6 J, not 1000 J: $$60\text{ W}\times0.06\text{ s} = 3.6\text{ W}\cdot\text{s} = 3.6\text{ J}$$ This amount of energy can definitely be stored in a relatively non-exotic capacitor. You may not even require a huge power supply. If the device was designed by someone competent, it would already have its own specialized power supply to deliver those 10 A pulses 2% of the time, so while the device can deliver 10 A pulses, it doesn't consume anywhere near 10 A.
H: Sawtooth traces on a PCB Possible Duplicate: Why wiggle nearby tracks on a PCB? I was looking at a Raspberry Pi that a friend got today and noticed some weird traces on the board. I'm wondering why they were designed this way. Here is the best picture I could find of them. See a larger image. There are a few sawtooth like traces that can be seen just above the HDMI and coming out from the IC. AI: Sometimes snake traces are used to ensure that parallel traces for a data bus all have the same length. This minimizes the phase difference between the signals. I can't see very clearly in the picture, but if the traces are smooth curves I'm betting this is the reason. These are typically only used in very high speed designs where tiny signal delays and phase differences make a difference, the HDMI interface probably falls under that category. Also as mentioned below, differential signaling is another instance where phase differences between the signals can be very detrimental.
H: Was Benjamin Franklin wrong (about conventional current)? I am starting to see a lot of people claiming that convential current is 'wrong' because Franklin made an error when he first started investigating electrostatics, and that later scientists didn't bother correcting the mistake, but preferred to keep the 'convention' (here is a classic example: http://www.allaboutcircuits.com/vol_1/chpt_1/7.html) I always thought he didn't get it wrong. He said that current is positive in the direction that positive charge flows, and vice-versa. He of course had no way to know which side of two sticks behind rubbed actually gained or lost mass. So he wasn't wrong. What were you taught? P.S. I can't help but feel we are lucky that he got it 'backwards', because clearly many people are confused about electrostastics (including the author of that text book!) and believe electricity has to involve electrons (an unfortunate name... why couldn't they have been named negatrons...) AI: Electric current, A.K.A, "conventional current", is an abstract current, the flow of electric charge. From a previous answer I gave here: Electric current is an abstract current, the flow of electric charge, not a physical current like, say, electron current, the flow of electrons. But electric charge is a property of things, not a thing, i.e., electric charge is always "carried" by a thing. So, while an electron current is necessarily an electric current (due the negative electric charge carried by the electron), an electric current is not necessarily an electron current. For example, in a salt solution, we have two species of electrically charged ions present, the positively charged sodium ion and the negatively charged clorine ion. Imagine that the sodium ions are moving to the right and the chlorine ions are moving to the left. Obviously, we have two ion currents in opposite directions but there is just one electric current and it must have a direction. The direction of electric current is, by convention, the direction of the flow of positive charge. So, in this case, both ion currents contribute to an electric current to the right. The first term is due to the positive ions to the right. The second term is due to the negative ions to the left where the negative sign numerically "flips" the contribution to the electric current. Think about it this way, if I told you that I was travelling at -60mph west, you'd know that I was actually going 60mph east. Similarly, a negative charge current leftward is an electric current rightward.
H: Where do I find a list of Arduino DIY shields I am interested in Arduino shields for fun, so I do not have a specific need. To save money, I would like to build the shields myself. Is there somewhere I can see a list of the most common, simple and useful shields? I am interested in: Parts cost Parts availability Buying pre made print boards with no components Level of expertise needed to assemble AI: Have a google for "Arduino Shield List" or similar, here are a couple of good links: Site totally dedicated to Arduino shields and their pinouts: shieldlist.org Arduino compatible hardware: List of Compatible Hardware for Arduino To find out about the schematics and parts needed for the shield, it will depend mainly on the shield maker. If you follow the link on the shield page to the makers site, they will usually have this information in varying detail. I picked a couple of examples at random, the "Danger Shield" from Seeed Studio and the "Ethernet Shield" from Adafruit: On the shieldlist page, there was a link to a Wiki with "make it" and "use it" headings detailing components and code: Danger Shield Wiki Also there was a link to the schematics and design files: Danger Shield firmware and board design Adafuit had "make it" and "use it" pages along with these downloads: Ethernet Shield schematic and library
H: CMOS inverter with gate of PMOS transistor always grounded If there is a CMOS inverter such that the gate of the PMOS transistor is always attached to the ground and the input voltage is only applied to the gate of NMOS, then how would the inverter behave, as in: Will it be similar to a NMOS inverter with a resistor connected between its source and Vdd supply? I need to calculate the Vout for Vin =0 and Vin=2.5 volts and the switching voltage ( where Vin = Vout); thus I would like to find the equations characterizing the behaviour of the inverter. So, for any Vin, the PMOS is always saturated and it can be replaced by an resistor of resistance same as ON resistance of the PMOS and the current flowing throught it would always be the saturated current. Please tell me if my approach is correct or if not, how should I tackle this problem? To clarify, the devices are all short channel and channel length modulation is ignored. Here is a schematic: AI: M2 is essentially acting like a pullup resistor in this case. Real resistors are difficult to make on silicon chips, so a PFET in on-state is good enough for this purpose. The chip designer can vary parameters like the channel length, width, and possibly doping level. Depending on the characteristics of the transistor, it could act more like a current source than a resistor at the operating point. Sometimes a "long tail FET" is used to make a rough current source. Without knowing the parameters of M2, we don't know if it is more like a resistor or more like a current source, although in this application that wouldn't make much of a difference. Ideally you'd want a current source for a pullup, but lots and lots of places you see resistors doing that job well enough.
H: Identify a light emitting component here's a picture of component that is not a LED but emits light, it's a tiny glass light bulb with a resistor and a red plastic case for mounting it. AI: It's a neon light. Like it says it works at the mains voltage, you can't make it work at 5 V or so. The thing with the neon light is that it needs a higher voltage to ignite, but then the voltage drops, and the series resistor then will control the current, just like for a LED. So you need the resistor, which may have a high value, like 100 kΩ IIRC. Then the current will be in the order of 1 mA.
H: Protecting diode bridge from higher current I have designed a battery charger circuit. The circuit is simple AC to DC power supply circuit, it is composed of a 220 Volt to 16 Volt stepdown transformer, a diode bridge and a capacitor. Now the problem is that whenever I connect the charger to the battery the battery starts taking high current up to 19 A and the diode bridge is burnt because the diode bridge can't withstand current higher than 10 A. How can I limit the current to 10 A so that the current is kept in 10 A safe range for the diode bridge. Note that I can't find a high current diode bridge in market here. AI: If you are confident that the transformer output is appropriate for charging your battery, one solution would be to simply increase the current-carrying capacity of your bridge rectifier. You mention that you can't obtain higher current diode bridges. Can you obtain higher current discrete diodes? If not, and your application can handle the cost of 2 diode bridges, you can make an effective 20A-rated full bridge rectifier out of two 10A full diode bridge modules. If you look at the schematic for a full bridge rectifier, you'll notice that it is possible to connect the two AC input terminals together to obtain two diodes in parallel between the AC input and each of + and -. Since the diodes in a bridge rectifier are usually on the same die, they are likely to be reasonably well matched and likely to current share reasonably well (though never perfectly, so some derating is warranted). Simply use two full bridges connected in this way (one bridge for each AC input with the rectifier + and - terminals each connected in parallel)
H: Using Xilinx ISE tools, "does not have a port named" error I'm a verilog Beginner. I created a design using straight-up Verilog then tested it using the ISE design tools. Works great. I would like to synthesize this to see the resources that will be consumed but to do so seems to require a schematic file. So I created a symbol for the Verilog cicruit and then created a new schematic, plopping my symbol onto the schematic and attaching some I/O markers. When I tried to compile the schematic (AKA 'Implement the Design'), I got errors on every I/O. Here's an example: ERROR:HDLCompilers:91 - "mm.vf" line 35 Module 'method2_MUSER_mm' does not have a port named 'LL1' The other errors are identical except the line number and port name changes. My Verilog symbol is indeed called 'method2'. The schematic has a I/O definition for LL1. mm.vf is a file being generated by ISE. I have no idea what it is looking for or how to fix it. AI: It sounds like your module symbol probably doesn't have the same name as the underlying Verilog. Make sure there is a port named LL1 in your Verilog module.
H: Identify this flat connector What is this connector (and the eventual pliers used for it) that serves for Wago 256 terminals. AI: Those look like ordinary insulated crimp ferrules. A search for "ferrule" on Mouser, for example, returns lots of results like this. The crimp tool that you select will typically depend on a number of factors, including the brand of ferrule that you select and whether or not you want a hand crimper or production-quality tooling. Any decent-sized supplier should be able to help you identify the tooling options to match the ferrule that you select for your application. There's nothing magic to match a Wago 256, as it is an ordinary terminal block with a cross sectional area range of 0.08 - 2.5 mm² per the datasheet. Any ferrule that meets this requirement should work just fine.
H: Advice for building a dual rail, +- 10V, regulated, DC power supply, 25mA I am looking for some directive to build a dual rail, +-10V, regulated DC power supply to supply 25mA to two resistive loads. I am very new with this; I am an engineering student and this is my first design project. I have been told by the instructor that Google is fair game so I may as well take full advantage and directly ask a few people who actually know this stuff. If anyone could provide some guidance on where to start for the project that would be appreciated. The transformer we are using has a centre tap for the ground. AI: There are many ways to do this, but given the low current requirements and basic resistive load, a simple dual rail power supply using linear regulators sounds like it would do fine. There are hundreds of linear regulators to choose from, from the ye olde LM317 to more modern LDO (low dropout) regulators. You probably already know that the linear regulator is pretty simple to set up and use (compared to e.g. many switching regulators) but there are still potential problem areas like thermal design, stability, out to in short circuit (if the output rises higher than the input as can happen at switch off with large capacitive load or another power source starting up) Anyway, let's look a basic design example. The specs for each rail are: +10V at 25mA -10V at 25mA You don't say what your transformer outputs so I've picked a value of 12VAC (RMS) for this example. The peak voltage will be around 12V * 1.414 = 17V. After regulating to DC this will drop a little (minus a 0.7V silicon diode drop and some more depending on current drawn) so lets say it's about 16V. So we know out regulator needs to be able to handle an input voltage of at least 17V (lets say 20V for headroom) and pass at least 25mA. We can also work out the wattage it needs to dissipate. We will add a couple of mA to the output current as a rough estimate of the control current used to regulate the output, so: (16V - 10V) * (25mA + 2mA) = 162mW I picked a couple of LDO regulators, the LT1761 and it's negative complement LT1964. Both regulators can handle an input voltage from 1.22V up to 20V (-1.22 to -20V for the LT1964), up to 100mA for the LT1761 and 200mA for the LT1964. They both come in a nice and small package SOT-23. To check whether the package can handle the wattage required, we see on page 2 of the datasheet(s) the thermal resistance for junction to ambient can be anywhere between 125°C/W and 250°C/W. The value depends on the board layout - a thick copper plane underneath the IC and thick traces will help to lower the value. To be safe we'll pick the highest value and calculate: 0.162W * 250°C = 40.5°C max rise above ambient temperature at 25mA. So if we note the maximum operating temperature of 125°C we can calculate the maximum ambient operating limit: 125°C - 40.5°C = 84.5°C So we have a decent upper limit, the regulator will handle this power level okay. Finally, here is a very rough idea of the circuit (ignore the diode part numbers, any general purpose silicon diode like a 1N400x will do here). I haven't read the datasheet, just thrown in typical capacitor and resistor values, so treat this just as a starting point, read the datasheets thoroughly and adjust as necessary. Rload and Rload2 sink the 25mA from each rail to test the +10V and -10V output rails: Note that all the four way junctions have all wires connected (this is usually frowned upon in schematics and was an oversight on my part... staggered junctions are preferred to make it clear which wires are connected and which are "passing over") Simulation (blue is 120V mains, green is 12V secondary, red is +10V and light blue is -10V - note scale on the last two, the ripple is only ~20mV and can be lowered with more filtering if desired):
H: Verilog design decision - where should my counter be located? I am coding in Verilog a typical count-to-n-then-reset-to-0 counter. My module has the logic to increment and reset the counter. My issue is that I don't know where the counter itself should be defined. I could pass the counter (as inout?) to the module. That's ok, but the counter still has to be defined somewhere so it this doesn't do me any good. Nothing else except this module should touch the counter, so I'd like to have the counter created within this module, and not passed in or out. Is this reasonably standard, and if so, will someone point to a reference please on how to instantiate the counter? (I'm on day 2 of Verilog, so be afraid, heh) EDIT - Here's my code. As far as I can tell, it works. I haven't implemented DIR == REVERSE yet. Couple of interesting gotchas. The (now commented out) STEPPER=0 line was causing an error in a schematic; it thought that STEPPER was tied to ground as well as other logic. Also, I use = instead of <= in some places involving counter - I was getting timing problems (I suppose.) The procedural assignment removed (hid?) the problem. module cam( input [7:0] DIVISOR, input DIR, input SPINDLE, output reg STEPPER ); parameter FORWARD = 1'b1; parameter REVERSE = !FORWARD; reg[7:0] counter = 0; always @(posedge SPINDLE) begin // STEPPER = 0; if (DIR == FORWARD) begin counter = counter + 1; if (counter == DIVISOR) counter = 0; end else begin // counter <= counter - 1; // if (counter == (-1)) counter <= DIVISOR; end end always @(negedge SPINDLE) begin STEPPER = (counter == 0) ? 1 : 0; end endmodule AI: If you have two modules, and you want to use one in the other then you instantiate and connect the desired ports together. For instance, if you have a top module with the signals clk, rst_count, inc_count and count_out and you are wanting to instantiate a (already written) Counter module with the name "MyCount" and with port names clk, rst, inc and data_out in it: Counter MyCount (.clk(clk), .rst(rst_count), .inc(inc_count), .data_out(count_out)); An excellent starting book that will take you through Verilog for synthesis (as opposed to the large part of the language which cannot be used in this way, and is primarily for simulation) is Pong Chu's "FPGA Prototyping with Verilog Examples".
H: What type of arduino board do I need? I need some help with choosing an Arduino board or maybe something else for the task that I need to do. I want to have a board that will get a input (power signal) to the board and that will send a some sort of signal through the COM port to my PC. What do I need to achieve that? You got any examples? This will be used for example when you switch the light on and then I need to send a message to my pc that light is on. Please give me some links and ideas. AI: I think people aren't helping you because they think that you could have just googled for the answer. Anyways, here's a project that uses an Arduino to monitor voltage and current for a section of home wiring: http://openenergymonitor.org/emon/node/58 If you don't care about power consumption monitoring but just on/off, you can leave out the half of that project that does voltage measurement, and only implement the current measurement half.
H: Why is my simple boost converter giving me such a high peak output voltage? I am trying to understand switch-mode power supply fundamentals through a simulation in LTSpice. I wanted to build an excruciatingly simple boost converter circuit following a teaching model often given in textbooks, but I can't get this thing to behave at all as I expect it to, probably because things are very different in practice :) Here is the schematic diagram exported from LTSpice (note that it uses ISO symbols; the component on the right is a resistor): The supply voltage is 5V and I am seeking to increase it to 12V with a load current of 1A, or an output power of 12W. I selected a switching frequency of 20kHz. By my math, I need a duty cycle of 0.583 to do this, so the on time should be 29.15 µs. Assuming an efficiency of 0.90, the input power will be 13.34W and the input current 2.67A. Assumptions that may be getting me into trouble: Perhaps the efficiency is totally unrealistic for a design this simple and my input current is much higher than I expect. Initially I didn't care much about ripple so I just picked the inductor and capacitor randomly. Maybe the switching frequency was too small. I ran the simulation with a time of 10ms (should be visible in the graphic). What I expected to see is a voltage of 5V, perhaps with a slight ripple, at point 2 (between the inductor and the NMOS) and a voltage of 12V with a ripple at point 3 (between the diode and the capacitor). Instead, what comes out is what looks like total chaos -- I get a peak voltage of 23V that oscillates around 11.5V at point 2 and a slightly lower peak voltage of just over 22.5V that oscillates around 17V at point 3: On the hunch that my switching frequency might be too low, I tried increasing it to 200kHz (T=5µs, Ton=2.915µs) and now I get something more like what I was looking for, which is a peak voltage of 12.8V at point 2 (oscillating between that and 0V) and a peak of 12V at point 3 (oscillating about 11.8V): There was significant ripple in the voltage. I tried increasing the size of the inductor to 100µH but all it seemed to affect was the startup oscillation. So I increased the capacitance to 10µF, and that seemed to work, the voltage oscillation at point 3 is much smaller. The image above is the result with a 10µF capacitor. My questions, then, are: what is wrong with my original model? is 20kHz a completely unrealistic switching frequency (seems strange that it would be)? if I wanted a 20kHz switching frequency, what do I have to change to make the circuit work as expected? A much bigger inductor? is it normal for the voltage on the input side to be similar to the voltage on the output side when the circuit has reached steady-state? what equation should I use to size the capacitor? AI: Your boost is operating in discontinuous conduction mode or DCM (inductor current goes to zero each switching cycle). The duty cycle becomes a function of load as well as the duty cycle. If you increase the load, the inductor value, or switching frequency, you'll reach a point where you'll see your regulation where you expect it - this is called CCM, or continuous conduction mode. The inductor current doesn't fall to zero, but continuously flows. Your duty cycle formula will be valid here. 20 kHz is very slow for a boost converter. 14A peak inductor current is also unrealistic. Most PFC boost converters operate from 70 to 100 kHz. Lower frequency converters generally need larger inductors. If you want to achieve CCM at 20kHz, you'll need a much larger boost inductance value. Try 470uH in your simulation and you'll see the voltage closer to 12V. (If you had a controller in your model, it would automatically adjust the duty cycle to achieve 12V regardless of CCM or DCM operation). Because your converter is so heavily into DCM, the switching node voltage resembles the output voltage. If you get closer to CCM, you'll see a clearer picture. For this simulation, the capacitor is sized such that the switch on-time voltage sag (caused by the load) isn't excessive. In real life, there are other parameters that matter (overall loop stability, ripple current and life rating) that you must consider, along with proper MOSFET choice, reverse recovery and softness of the boost diode...
H: Turn on a relay when the output is high I purchased a 5V 8 channel realy to use with Arduino. When the output is low the relays are on. I need to turn the relays on when the output signal is high. Is there a way to make the board respond to a high input and to turn on the relay? AI: You could invert the signal inside the software. This would be my choice. put an inverter between the Arduino and the relay board. Take for instance a 74HC540(my original suggestion) or a much more common uln2803 as StevenH suggests. This would be my choice if you really can't change the software. change the board itself. Bad choice IMO.
H: 24-pad, 0.5mm pitch: better to use QFN or BGA? For a certain TI component, I'm choosing between these two packages, both of which are 24-pad and 0.5mm pitch: QFN: http://www.ti.com/lit/ml/mpqf167b/mpqf167b.pdf (4 x 4 mm) BGA: http://www.ti.com/lit/ml/mpbg520/mpbg520.pdf (3 x 3 mm) Some considerations: BGA is cheaper for a PCBA house to assemble, correct? If I use 3 mil microvias (on a 6-8 layer board) to route out BGA components, how many rows/cols does a 0.5mm BGA have to be before the routing gets annoying? Any advice appreciated! AI: Why do you think the BGA is cheaper in assembly? The operation is the same for both: pick and place. But the BGA needs X-ray for inspection, and the assembly shop may charge extra for that. The QFN can be visually inspected. The QFN also lets you reach the pins with a probe. For a scope probe no problem, but for a DMM you'll need needle probes. If you can afford the extra couple of square mm the QFN needs I would go for that. After all you can still use via-in-pad to save space.
H: Torque measurement device calibration I don't know if I'm at the right place to ask this question but here is my trouble : I'm trying to find a good way of calibrating a electronic device used to measure small torques (0 -> 25 mNm). Device adjustment : Our current way of adjusting our measuring device is by hanging measurement standards to it and adjusting the way it measures. Calibration : Our current way of calibrating this device is again by hanging the measurement standards and checking if the device measures properly. Being new to the process of calibrating a device, is there a standard way of proceeding ? Are there good documentations on the calibration problem ? AI: Calibration of equipment in manufacturing and other professional environments, when done "by the book", is governed by ISO 17025. This not only governs the procedures and methodologies, it includes things such as labeling and traceability. This standard should be a good starting point for your research into calibration.
H: Driving a large 7 segment display using a micro-controller I need to drive a large seven segment display (segment length is a about 2 inches) using a micro-controller (PIC 16F877). I've driven normal seven segments directly from PICs without issues, but I found that 5v is not enough to drive this one. It needed something around 9 volts (is this normal?) So what came to my mind is this. (Designed using Proteus ISIS 7 Pro) I've supplied 12v to this circuit and used the RV1 preset to adjust it (to make it 9V or something close). 8 inputs to the transistors come from the micro-controller. So I can drive the large 7 segment (which require 9v) this way... But it wasn't success. I checked the voltages and found the transistors switch between 0-5v (can't imagine how can this happen???). Anyway, then I tried putting the resistor to the collectors side. And took the output from collector pin. That was somewhat ok. But the brightness was varying with the number of lighting segments...(When lighting only one segment, there was very little brightness. It's almost not visible. But when lighting all the segments, brightness was too high. Felt like the display will blow.) I don't feel like to try other means. This was a so simple project. But this large seven segment ruins everything. Can some one help me with this... AI: This isn't right, and you're lucky the display needs 9 V or it would have gone up in smoke. First, the LEDs are in parallel with the resistors: your emitters go to both LEDs and resistors, and their other connections are to ground. You need them in series. Then, your circuit is a common collector circuit. One of the disadvantages is that it can't drive a load higher than the control voltage - 0.7 V, that's 4.3 V, too little for the LEDs. That's where you're lucky, if it were 3 V LEDs they would have been driven with no current limiting at all \$\rightarrow\$ magic smoke. There are no single LEDs that work at 9 V. Since you're talking about a large display it will have 4 LEDs in series for each segment, to provide equal lighting. At 2.2 V per LED you arrive near 9 V. The more common way is to drive them common emitter. That is emitter to ground, and LED + resistor in series on the collector side. For a common emitter you'll also need base resistors. 1 kΩ will give you 4.3 mA, which should be enough to drive the BC547 in saturation. You can also use a ULN2803, which is a transistor array of 8 transistors with their base resistors built in. Then you only need one part (except for the current limiting resistors). Your resistor values are also too high. If each segment needs 9 V and your supply is 12 V then the current though a segment is 3 V/ R. With 10 kΩ resistors that's 300 µA, and that's too little for any LED. A typical 20 mA LED would need a 150 Ω resistor. But check the display's datasheet for both voltage and current. The TI TLC5916 mentioned by Michael is an excellent alternative. It's three times the price of the ULN2803, but at 1.24 euro in 1s still won't break the bank (Mouser, 1.65 dollar at Digikey). It has constant current outputs, so you don't need the series resistors anymore, brightness won't depend on input voltage variations, and you save I/Os on your controller because it's serially driven. You only need data out, clock, and latch. The current is set with a resistor. Michael would still use series resistors, but they're probably not required. If you have 20 mA and a 3 V drop (from 12 V to 9 V) then all LEDs on will give you less than 500 mW, which a 16-pin DIP certainly can handle. At higher currents or input voltage they may be a good idea, though.
H: Synchronising GPIO transitions to an external clock Currently, I am using an ADC with an external trigger with the caveat that the edge of the trigger must be within +/- 25ns of the ADC's clock (See Figure 3 of the datasheet). The ADC's clock is available on a pin of the ADC. In this case, the GPIO used to operate the trigger is not synchronized with the ADC clock and therefore synchronization is necessary. Apparently, the best way to do this is with two cascading D flip-flops connected to the same clock in order to ensure that there is no race condition between the setup time and the clock pulse. There appear to be some gotchas with this approach. Some sources recommend a delay between the two flip flops for added safety. Others say that "synchronization hardened" FFs are necessary. So, what's the best way to solve this problem? Is there a ready-made logic family that will do the trick? Or a specific IC? AI: The two flip-flops are used to avoid issues with metastability. The idea is that the first flip-flop has some small probability of going metastable, but if it does, it's much less likely that the metastable state will propagate to the second flip-flop. A "hardened" flip-flop has higher internal gain than an "ordinary" flip-flop, which means that a metastable state should decay more quickly, reducing the chances of propagation. However, I've only ever seen "hardening" discussed in the context of custom IC design, and I'm not aware of hardened devices that are available as discrete devices. Putting a delay between the flip-flops is actually counterproductive, as this would reduce the window of time for the metastable state to decay. So, just use two flip-flops of whatever technology best fits in with the rest of your circuit.
H: Dual primary / dual secondary transformer heat up I've built this 220v DC motor controller. I use a 2x110v - 2x15v transformer to power up the stator. The transformer is a Myrra 45064 with the primary windings connected as follows: pins 1 and 9 connected to the mains, pins 4 and 6 in short. On the secondary windings, i've connected pin 12 and 19 to a rectifier, and 14 and 17 in short. When I plug it in at 220v AC, the transformer heats up very fast and outputs ~12V out of the expected 30V. Didn't keep it powered more then 6 seconds. I thought that this pin configuration should connect the 2 halves of the transformer in series and output 15+15V. Am I connecting them wrong, or there could be another cause for the high current through the transformer? P.S.: The schematic on github shows a 3 port primary winding, however, the board is built with the connections done as explained above. AI: The Farnell page has a little better description of the wiring needed: Primary Pin Connections | Secondary Pin Connections Style 0V 115V 0V 115V | 0V Vsec 0V Vsec UI39 1 4 9 6 | 17 19 14 12 It looks like connecting per this table parallels the primary winding to set the turns ratio for 115V input. Based on that idea, it looks to me like pins 1 and 6 should see the AC and pins 4 and 9 should be connected together, to maintain the correct phasing of the primary.
H: What use is the reference node in nodal analysis? Rules for identifying a reference node in a nodal analysis of a circuit include; Node with largest # of elements Max # of voltage sources Node of symmetry My question is, whats the point? AI: The point is just to make the math easier. Generally "ground" is going to have the most elements and will therefore be chosen as the reference node. Try writing out the equations for a large circuit by first following the guidelines above, and then next without following the guidelines. You'll find one is a lot easier. As far as I know it is only for mathematical/notational simplicity, there is no electrical or physical significance to the node you choose as your reference node.
H: Suggestions for 1-5 km range wireless communication? I am developing a VOIP application. Most clients use a wired Ethernet connection, but some of the clients need to have a wireless connection. Currently the core board is using: Cortex-A8 (TI AM3359) 256MB RAM 2GB Flash WiFi 802.11N But the range of WiFi is very terrible, compared to ~5Km walkie talkie, I know XBee might work but I have never used it in either production or development. My requirements for the digital wireless communication are: 1-5Km in Range (1Km with minor obstacles or 5Km line of sight) 100Kbps (12.5KB/s) lowest transfer rate condition. multiple clients (100 clients) relatively low price. preferably: support TCP/IP, support simple encryption (so no need to modify software stack much) So should I use XBee? or any other alternatives? Thanks. AI: Xbee modules are an option, as are other 800 to 900 Mhz RF modules, but subject to some constraints. I suggest you make your choice by looking at Digi's comparison matrix table of the different Xbee options; there are at least three that suit your application, and they are point-to-multipoint capable. The table states you can get outdoor range up to 40 km (for example, with the XBee-PRO 868), but note a couple of things: this is outdoors range; if the same transmission were attempted in an indoors environment (or generally a situation where there are intererence sources within the Fresnel zone), your range will drop markedly. this requires using a high-gain antenna, so that may be a constraint depending on what your device construction allows (in fact, I think most of the distances specified in that table are with a dipole antenna). some of the model variants are only available selectively in Europe or North America, if this matters. for some insight on performance metrics, it's worth reading this app note, where they demonstrate nearly 0% packet loss at distances up to 40 km range, but with specific conditions. Note that the data rate for the long-range models might not meet your requirement of 100 Kbps, which is a tough ask although... Alternately, GSM modules perform your bandwidth requirement easily in a different context, which brings up an alternate idea: You can also consider instead using GSM modules for your communication, although this obviously might turn pricey since you state there are on the order of a 100 users. One final suggestion is to use the low- or medium-range Xbee models, but use extenders/repeaters/relay-units to cover the required distance (or in case of the Zigbee variant of Xbee, you can even use the units in the mesh as extenders themselves). Setting up a robust Zigbee network takes some development effort, but this is somewhat simplified with the firmware stack on the Xbee ZB units.
H: Using both RS232 and USB for one device I have two options for power sources for my board, which simply has an ATMega on it --- one is a 24 VDC source going into a switching regulator that supplies the board with 5 V. Another source is via a USB Bus using an FT232R that could also supply the board with 5 V. Is there a way I can ensure that only one or the other powers the board and not both? Or could both these be plugged in parallel and have no effect on the circuit? (I find that hard to imagine) AI: Yes, the Arduino board does this. See the power section of their schematic: http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
H: Multiplexing 2 digit 7Segment with one Bit I want to control a 2 digit 7-segment LED with a MSP430 micro controller. The display has 8 input pins per digit (8th pin is the dot, which I do not need) and two ground pins (common cathode). The idea is to connect the first 7 pins from the µc to the 7 segments of both digits and then use another pin (the control pin) for selecting which digit to display. By switching fast between the two digits I would like to display a two digit number using 8 pins of the µc only. What I need is the following. We can abstract such that there are only two LEDs. If the control pin is LOW than LED1 is on and LED2 is off. If the control pin is HIGH then LED2 is on and LED1 is off. I know how to build this with a single PNP transistor (see picture below). However, this is not useful in the common cathode setting, since I want the switching gate "behind" the LEDs. My question is, how to build such a circuit with one single transistor (and resistors of course). I think it has to be a NPN transistor. This is my first EE question and I have little experience, so I hope I was able to make my question clear. AI: You are right about the NPN transistor, that is what you need in order to achieve that behaviour, however, since the µC would have to control the cathode of one of the displays, that would be a problem since most µC can only source / sink a few mA. Assuming each segment needs 10mA that would require the pin to sink 70 mA. The most simple solution is to have two NPN transistors capable of sinking at least 100 mA (such as the common BC547). Diagram bellow: Being D1 and D2 the 7 segment displays (please ignore the reference). The anodes on the LEDs will connect to the µC pins. In this configuration only Q1 conducts when the µC outputs 1 and when it outputs 0 only the Q2 conducts. Note It might be necessary to add a high value pull-up resistor (for example 100 kΩ) to the base Q2.
H: Verilog - A line stays high, I need it to go low after a while I'm working on a circuit in Verilog to be implemented on a CPLD. The output of the circuit will drive a stepper motor. The input is a stream of pulses from a machine. I generate a stepper pulse every X spindle pulses. No problem, works great. While simulating, however, I noticed that if the stepper signal is high when the spindle pulses stop (say, someone turns off the machine), the stepper signal stays high. This is because I set it back to low on the leading edge of the spindle pulse, and there are no more. This means that (with a poor implementation) the stepper could be run at full speed which would cause a machine crash. Now, I would hope the stepper controller would operate only on the leading edge, but you never know. Finally, the question - since I can't depend upon my 'clock' (the spindle pulses) to continue ad infinitum, what's a good way to make the stepper pulse go low after 'a while.' As you see, I can't even describe it properly so I can't Google it, lol. If someone could supply me with some words to search on (or better yet, describe a standard technique) I'll be off to the races. Thanks! EDIT - I'm experimenting with the following (typed from memory...) Is this sadness, or a good idea? always @(posedge Stepper) begin #50 // or whatever, this is a low Hz system... Stepper = 0; end Or does the delay only work in the simulator? AI: The best way (depending on how complex your final design will be) would probably be to use a separate fast CMOS oscillator for your CPLD system clock, and have it process the input pulses and output the stepper pulse. This way, the clock is running all the time when the system is on, and it can time the period from the last input pulse - if it's above a certain limit, set the stepper line low. This is the way a typical synchronous design works, you have an independent system wide clock and this is used to "read" (i.e. into a register) and process external asynchronous signals (as opposed to the external signals clocking the logic directly) Another simpler way would be to have another input "reset" line that sets all the registers and outputs to a certain state when it goes low. You could then use a simple RC low pass filter on the input pulses so when they stop, the line drops low and the CPLD resets.
H: Is there any motor which moves slowly and gives strong torque? I need a strong torque motor which move slow. However, I don't want to use gear train because gears will be damaged easily by the strong torque. Please give me some suggestion. AI: The cheapest and most common thing you will find is a stepper motor. You can salvage a few of those from old printers and scanners. And if you use microstep control, you can make it very slow and accurate (below the fundamental step of the motor). The problem with steppter motors is that they consume lots of current regardless of speed. In any case, there are gears that can take a lot of torque. The gearbox in your car does a good job, for instance.
H: IR LEDs for illumination, as used in night-vision cameras Being aware that IR LEDs come in various frequency-ranges, illumination intensities, sizes etc., was wondering if someone can help me identify the right type of IR LEDs, a cluster of which could potentially be used to illuminate a dark-room, s.t. I can use my standard web-cam to serve as a night-vision camera ? Professional surveillance cameras seem to have things like "IR cut filters", which I believe are optical parts that are moved-in/out electro-mechanically, to help them work well, both in night and day. Do their optics (s.a., the lens, sensors) also have some differences, say compared to those found in commonly found webcams ? AI: Answering my own question, as I found those on a more thorough search. Part-1) Right kind of IR LED for the job. This SE question has some answers. Part-2) Difference (optics, sensor) between webcam and surveillance cams. This external link has it explained quite well.
H: Can't read written data out of 24AA1025 I've got a PIC18F with MSSP that I'm interfacing with a 24AA1025. I'm using MPLAB 8 and the functions from C18 to make my life easier. The only problem is that I've (supposedly) written a byte to the 24AA1025, but when I read it back, I get 0xFF instead of the byte I wrote. Here's how I have the EEPROM wired up: A0 - GND A1 - GND A2 - Vcc Vss - GND SDA - pulled up to +5 via 2.2k resistor, and connected to SDA on PIC SCL - pulled up to +5 via 2.2k resistor, and connected to SCL on PIC WP - Vss Vcc - 5V Here's my write function (now edited with working code): bool I2CWriteByte( long address, unsigned char data) { unsigned char ret; unsigned char control_byte; unsigned char high_address_byte; unsigned char low_address_byte; control_byte = (address >= 65536) ? 0b10101000 : 0b10100000; high_address_byte = (char)((address & 0x0000FF00) >> 8); low_address_byte = (char)(address & 0x000000FF); IdleI2C(); // perform ack polling around control byte sending every time ret = SendControlByte( control_byte); if( ret == -1) return false; ret = WriteI2C( high_address_byte); if( ret == -1) return false; ret = WriteI2C( low_address_byte); if( ret == -1) return false; ret = WriteI2C( data); if( ret == -1) return false; StopI2C(); return true; } Here's my read function (now edited with working code): bool I2CReadByte( long address, unsigned char* data) { unsigned char ret; // to do a read, first do part of a write but don't send the data byte, then send a new control byte with bit 0 set to 1 for read. // see 24AA1025 datasheet page 12 unsigned char control_byte; unsigned char high_address_byte; unsigned char low_address_byte; control_byte = (address >= 65536) ? 0b10101000 : 0b10100000; high_address_byte = (char)((address & 0x0000FF00) >> 8); low_address_byte = (char)(address & 0x000000FF); IdleI2C(); ret = SendControlByte( control_byte); if( ret == -1) return false; ret = WriteI2C( high_address_byte); if( ret == -1) return false; ret = WriteI2C( low_address_byte); if( ret == -1) return false; control_byte = (address >= 65536) ? 0b10101001 : 0b10100001; ret = SendControlByte( control_byte); if( ret == -1) return false; // now return value *data = ReadI2C(); StopI2C(); return true; } EDIT -- The all-important SendControlByte() function, which does the requisite ack polling: bool SendControlByte( unsigned char control_byte) { bool nack; bool ret; nack = true; while( nack) { StartI2C(); ret = WriteI2C( control_byte); if( ret == -1) return false; if( SSPCON2bits.ACKSTAT == 0) nack = false; } } WriteI2C never returns an error, so I assume that it actually worked... I used my logic sniffer's I2C protocol analysis tool, and it sure looks like all of the data is being sent/received properly: Can anyone suggest something to do next for debugging? The control byte looks correct, as it is 0b1010 after START, followed by the block identifier, A0, A1, and R/!W. I have tested >64KB addresses and confirmed that B1 is set properly. My EEPROM has A0 and A1 grounded, so that looks correct as well. R/!W is low for writes and high just before the read. The only thing I haven't done yet is added a delay after the write, but I will give that a shot tomorrow. EDIT -- The I2C analysis option does show what you guys have been saying: AI: My guess is that the problem indeed is that you need to delay after the write. The device will be busy for roughly 3-5 milliseconds after a write, during which it will not respond to any commands. If you issue a read during this time period, the device will ignore it, and the SDA line will remain high - which would indeed lead to a result of all ones being read on the clock pulses. First off, try adding a delay after the write, perhaps 10 milliseconds or so. If that works, check the datasheet chapter on acknowledge polling, to improve the performance. In short, acknowledge polling means sending a write command over and over until the device acknowledges it, at which point you know that the write cycle is complete.
H: Best IDE for 32-bit microcontroller on Linux I'm choosing a 32-bit microcontroller to implement a Kalman filter. I am very attracted to the Atmel Studio 6 IDE. However, it only appears to run on Windows. Could anyone suggest a good Linux IDE? Otherwise, I think I'll go with Atmel Studio 6 IDE in a virtual machine. Many thanks in advance, AI: Geany is small, fast and has a good feature set. I have used it for embedded development on Linux and found it to be quite useful. PS: Here is the link to their site: http://www.geany.org/. Good though it is, I'd still recommend you to go ahead with Atmel Studio because IMO it is the best free IDE for embedded ever made.
H: FM Transmitter Modulation I am designing an FM transmitter as a learning experience and for fun, but I am having some difficulty with FM modulation. I am using a VCO with a Colpitts topology and common emitter configuration. For modulation, I am using a varactor biased at 5V with a 1kHz, 5V amplitude message signal, which should allow the varactor capacitance to vary from 9pF to 19pF. I have an RF choke and DC blocking capacitor to couple the input signal to the oscillator. When I simulate my circuit in Multisim, I am able to measure my center frequency to be around 77MHz on the spectrum analyzer, but I am not seeing any frequency deviation on the output signal. Is the deviation too small for the resolution of the analyzer, which is ~9.6kHz or is my message input too weak once it gets to the oscillator? Below are pictures of my circuit and frequency spectrum output. Thanks for any help! AI: You've got the choke on the wrong side of the varactor. It needs to go between the audio source and the varactor, in order to keep the RF (oscillator) signal out of the audio circuit. You want the RF to get to the varactor. Also, 10µF for the DC-blocking capacitor between the varactor and the oscillator tank is way too large (although it'll probably work in simulation). You really only need a few hundred pF here; say, 330 pF or 470 pF.
H: Critique of my Data logger's Power circuit design I am laying out my first full device, a fairly simple sensor-data logger, with these specs in mind: I'm running microcontroller and sensor @ 3.3V, with load varying from 10 mA to 400 mA device will be powered by a rechargeable Li-ion battery (4.2V maximum) battery charged by USB (5V) device's Power-On/Off are toggled by a pushbutton hold or upon a battery undervoltage condition (@ 3.2 V). The below schematic shows the Power-related section of my circuit so far. Note that Microcontroller and Sensor are NOT shown here. (EDIT: Schematic revised based on @Russell and @Madmanguruman's suggestions.) Labels: Descriptions of a few of the labels I used in the schematic image above: VCC: Voltage (5V) at USB power source used to charge battery 3.3V: Voltage at which Microcontroller, sensor, etc. will run UC-PIN[1-8]: Various pins of AVR microcontroller, including ADC-capable pin REG-ENABLE: Enable/disable Signal sent from output pin of STM6601 IC to the enable-pin of TPS63001. Short summary of my overall approach: From the battery's supply, a buck-boost regulator provides 3.3V for the uC/sensor. This 3.3V supply is enabled/disabled (PwrON vs PwrOFF) by a specialized controller IC, which monitors for either pushbutton event or battery-undervoltage. USB power is used to charge the battery (whose voltage is measured periodically by an ADC pin on the uC). That's it. Or more specifically, as you can see above, I am using these four components below (with their datasheet links): MCP73871: Battery-charging IC that uses ConstantCurrent-then-ConstantVoltage approach to charge the Li-ion. I set the pins on the MCP73871 to power the charging with USB (5V) with 500 mA current. TPS63001: Buck-boost regulator, supplied by the battery, and with a fixed output of 3.3V (Also, I have enabled "Power-save mode" on this regulator to allow higher efficiency for the smaller-load case of my device) STM6601: Pushbutton-based ON/OFF controller IC Initially when the STM6601 detects the pushbutton as held for a duration, then it sends out a HIGH signal, which is connected to the TPS63001, thus enabling it, and bringing the device to life. When the STM6601 detects either that pushbutton is held again OR that the battery voltage falls below a 3.2V threshold, then the STM6601 automatically sends out a LOW, disabling the regulator. Loadswitch (FPF1008): Controls current going from Battery V+ into a voltage divider The divider is used to bring down the battery voltage to within the 3.3V maximum allowed on the microcontroller ADC pin. The ADC takes battery voltage measurements periodically, which is mapped to curve of discharge level, for a rough indication to device user. MY QUESTION: Do you have any suggestions regarding this layout and approach? I am interested in any feedback you might have. Given my non-experience with any professional layout, I am expecting there are at least a couple of things "wrong"! Or things that could be improved upon; so I'm frankly open to any suggestions that I can learn from, small or big, even if they require me having to re-think/re-build the circuit. AI: Looks good. No obvious "funnies" at a quick glance. You have set charge termination = 10 mA typical (PROG3 = 100k to ground). This maximises your battery capacity at the cost of lowering cycle life. Unless you want absolute maximum capacity I'd choose the 100 MA current termination option (PROG3 = 10k) 500 mA charge current is fine as long as battery tolerates it. LiIon typically allows 0.5C to 1C max charge rate (depends on manufacturers spec with some few higher. LiPo is usually higher. So this should be OK for 1000 mAh battery and probably for 500 mAh but do check battery data sheet. Buck-Boost often have a nasty efficiency dip around the boost to buck transition point and TPS63001 is one such. Mainly evident at low Iout and not vastly bad power wise, but can be worth being aware of. Added: Be certain to use an internally protected battery pack. While you hope to avoid "vent with flame" events, it is a bonus if you can locate the battery so it can "melt down" without destruction of itself or of the area it is housed in. While I have read a large amount about LiIon and LiPo destructive events I have never seen one and never met anyone who has experienced one personally. Percentage wise the incidence is probably very small. I once tried to induce some LiPo cells I have here to self destruct by applying gross over voltage - with no success. The charger IC seems to come in 4.1, 4.2, 4.35. 4.4 Volt versions. If you use the 4.1V version you decrease battery capacity, increase cycle life - perhaps significantly, and give yourself more safety margin. The table below is from the Battry University website (copied in this case from stack exchange "Charging affects battery life" which may also be useful. This suggests an ultimate capacity of about 87% of maximum possible just by dropping Vmax by 0.1 Volt! Affect on battery mechanical stress may be significant. If you care about ultra long battery cycle life consider using LiFePO4 battery. This charger IC will not accommodate it. Vmax is 3.6V, most energy is delivered in the 3.0 - 3.3 V range so you would be boosting for most of the battery life to get 3.3V supply. If using Lithium Ion you could consider the merits of using a linear LDO regulator for the 3V3. This means you "waste" the energy below about 3.4V which is about 75% capacity at 2C rate and 90%+ at 1C rate. If you use a 1000 mAh battery then 400 mA = 0.4C and you would get 90% + of battery capacity with a linear regulator. Here are some "typical" curves which need to be checked against temperature, load and actual cells used in your case. At 4V in a linear regulator is 3.3/4 = 82.5% efficient and at the lower load mean of about 3.7V it is 3.3/3.7 ~+ 90% efficient. Your buck-boost is quite possibly no more efficient across the battery range. Not discharging LiIon below 3.3V is going to greatly help its cycle life. IF you can tolerate the loss of capacity from using Vmax = 4.1V when charging and a linear LDO regulator you get a very long life battery with no switching regulator noise issues. Overall battery cost will be higher for a given capacity but the whole of lifetime battery costs may be superior due to the long cycle lifetimes. With LiIon you still need to contend with calendar life - the battery just "gets old" even if little used. Curve below copied from When to stop draining - which also may be worth reading. You may wish to consider using a resistor diivder from Vin to the VPCC pin to provide low Vin shut down. This sets lowest Vin that will be tolerated. (Strapped to Vin at present which disables it. This is a valid option). May not be useful in your application. You have battery thermal input going direct to P$5 at present - which is wholly valid. But, ensure battery used uses a 10k thermistor (as most do) and not some other value (as can happen) and consider whether you want to tailor the valid thermal range for you application by adding series R in the thermal sense line (covered in data sheet).
H: Short circuit protection on a charging line I have a device that runs off SLA batteries that needs to be charged in a dirty environment. There is a possibility that the circuit may be shorted by accident during the charging cycle (this is unavoidable and must be protected against from a safety standpoint). I know that the smart chargers we are using will be able to handle the short but I'm worried about the batteries themselves shorting out. I thought about a simple diode inline but with a 15A charging current I'm worried about heat buildup on the diode. Also, I don't know how the smart chargers will react to a diode inline when it expects only batteries (i am making the assumption that the smart charger wont see the diode). What is the best way to protect the batteries from a short circuit in this situation? AI: A diode won't work anyway because the load will be connected to the battery, not the charger. It sounds like this can happen often enough that a fuse is not a good option because it would have to be replaced too often. This sounds like a good application for a circuit breaker. A breaker may take a few 100 ms to trip, but nothing bad should happen in that short a time. There are different types of breakers. The basic kind needs to be manually reset, but most of those have the best characteristics in terms of reaction time, on resistance, and accuracy. They usually work on the current causing a magnetic field that trips a mousetrap type of latch that opens a switch. The automatically resetting type is usually thermal with a bi-metallic element activating the switch. They may take a little longer to trip, and usually stay tripped for a few seconds. Check the specs. If you can tolerate the little extra on resistance, this type is probably the most convenient if you regularly expect the power wires to be shorted. There are electronic ways to do really fast overcurrent switches, but it doesn't sound like your application requires this level of complexity.
H: Special switch based firmware update I have to provide an update mechanism to a product. Currently, I implemented a bluetooth upgrade mechanism, updated pushed via Bluetooth. In case something goes very wrong, marketing asking for a recovery method, which is reasonable. The uP I use has an embedded bootloader (ROM). I can use this as the bullet proof method. This one requires some pin to be pulled high, original design we didn't expose this, it was a pad on the board. Now, I need some way to expose and give user a way to make this work. The thinking is to use a special power on/off button. Currently, we use a mechanical button, when off, no power to system including CPU. The idea is to find a button, if you keep pressed at the bottom, this pin is pulled high and if you have the right software on PC, things will start to move. What do you think about this approach? (I am worried about hackers) and where can I find such a switch? AI: Hackers? Once something is out of your physical control you can't stop hackers. Period. That being said, why not a three position switch where one of the positions is momentary? Here is an example - search on Digikey for switch with the 'Switch Function' set to 'On-Off-Mom'
H: Recording Servo/Motor movement with arduino Hi I'm really new to Arduino projects and don't really know how to start. I'have to do a project for university. The programming part should be no problem but I don't have any experiance with electronics. What I try to achieve is to record a spezific motor movement. For expample I move a modelcar, record the movement and let arduino repeat that motion. How can I do something like that? I've read that servo movement can be recorded but non-industrial servos are not for multiple rotations and are not very strong. It should be able to move up to 6.6 pounds record a varying movement over a distane of 10 feet. Is it possible to record the motion with something else and do the movement with a stepper-motor? Edit: I want the motor to repeat the acelleration. So I move the car that the gearing mechanism makes a particular movement. I want to detect how long the motor has to run and how fast it has to be at every moment in that timeframe. I'm only interested in forth and back. AI: It sounds like you want to move the car manually and have the Arduino record this movement, then "play it back" later. If this is the case, using a rotary encoder (example part) of some sort would be a simple way of doing it. There are various options to detect the rotation and mounting methods, magnetic sensors, optical sensors, etc so have a look around and see what suits your project. Use to sense the amount of rotation, record and then simply tell the stepper to do the same. Since the stepper has magnets and windings that will generate pulses on movement, you can also use the stepper itself as an encoder, so you may want to experiment in this direction. Here is a good page on the subject with an example circuit shown below (written by a very knowledgeable and enterprising chap on the Piclist)
H: Does it always make sense to constrain an I/O port? I am following an Altera online course on their timing analyzer software called TimeQuest. In it, their recommend that, at the very least, all clock and I/O ports be constrained. In my FPGA design, I am generating an output clock pin to an ADC by muxing various clocks (some generated internally). As far as I know, the way to constrain output ports is to use the SDC command set_output_delay, by specifying setup and hold constraints with respect to a clock. In my case, there does not seem to be any meaningful clock to base the set_output_delay contraint upon. How should my output clock be constrained? Does it even make sense to try to constrain this specific output port? AI: Well, it does make sense to apply meaningful constraints if you actually care about timing and it does matter. How to constrain it heavily depends on your design. Thankfully, Altera has tons of examples for different cases. But if you don't care at all then the best way to go is to mark that path as a false path so that Time Quest is happy and synthesizer does not hang for hours trying to route your design in order to meet timing requirements that you don't really have. That you can do with set_false_path command. For example: set_false_path -from * -to [get_ports { output_port }] (where output_port is a module's top level port assigned to a pin) If Time Quest gives you a diagnostics that not every output port has a delay, you may want to add some dummy delay as well, like this: set_output_delay -clock [get_clocks src_clk] 2 [get_ports { output_port }] For a more practical example, you can check out this SDC file for this top-level module, the path to led_n is market as false path there since I pretty much don't care about timing from my logic to the LEDs. Hope it helps.
H: What is a typical example of a combinatorial feedback loop? By looking at some of the details of the Altera timing analyzer TimeQuest, the concept of a "combinatorial feedback loop" was mentioned. The obvious search is not terribly helpful and there doesn't seem to be a Wikipedia article on the topic. What exactly is a combinatorial feedback loop in the context of FPGA and ASIC design? Is there a typical example to illustrate the concept? If an example is provided using an HDL, I much prefer Verilog over HDL. AI: A combinatorial feedback loop is created when the output of either a gate or a combinatorial path is fed back as an input to the same gate or to another gate earlier in the combinatorial path. The most simple case may look like this: always @ (a or b) a = a + b;
H: How do you mount an LED Can someone explain to me a good way to mount a 5mm component LED? A little background on the project to help. I'm working on a prop that will be carved out of styrofoam. I will be using LED's to illuminate recesses of the prop. The LED themselves will be mounted under a foam shelf or in a cavity so they are not visible to a casual view. There will of course be wires running though the interior of the prop to the LED's. My question though is how to securely mount the LED's to the foam. I don't want them to wobble (the prop is handheld). A LED doesn't really have much surface area and I doubt applying glue directly to the LED is a good idea especially if I ever want to change it. Is there some sort of LED socket I can buy that the LED snaps into? If not how would you go about mounting an LED in a piece of foam? AI: Can you glue a flat panel to the foam (perhaps a small piece of scrap PC board), then drill a hole for the LED and mount it in an LED holder? That would allow plenty of surface area between panel and foam and the holder http://well-ton.com/image/bph2.JPG will be a snap fit to the hole. Secure mounting and allows you to replace the LED if need be
H: What are these two white screws on a ps3 power supply? In this video a gentlemen turns two white screws to fix a play station 3 not turning on anymore. Could anyone tell me what these screws are, and what turning them a little bit is supposed to solve? AI: They are trim pots for OCP, or Over Current Protection, and PFC, or Power Factor Correction. They are usually used to adjust things at the factory, because a batch of parts like resistors can vary slightly even though they have the same ratings. Either they werent adjusted right at the factory, or parts may be starting to wear out requiring adjustment.