text
stringlengths
83
79.5k
H: Upper limits to chip size This question on physics.stackexchange has an answer, which has a piece of information which is new to me: Now, you could say "OK, let's increase the chip size instead". It turns out that it's also limited. Again, cost aside (pure silicon isn't cheap), the signals must be transmitted across the chip in less than a clock cycle, so that the chip stays in sync. The information isn't travelling any faster than the speed of light, but what is the size of a chip that gets its information in less than 1/2 clock cycle at, say, 5GHz? That's 30mm. And that's assuming electric potential travels in silicon at speed of light in vacuum (it doesn't), and that's assuming it's OK to have signals 180° phase-shifted (it isn't). Seeing as I'm doing a project on Moore's law and its limits, I found this interesting, but I don't quite understand what "the signals must be transmitted across the chip in less than a clock cycle, so that the chip stays in sync". What exactly is a "clock cycle" and what does it mean for a chip to be "in sync"? Also, does this have to do with frenquency ("5 GHz") AI: The clock is the fixed frequency signal that controls the logic circuitry on a chip. A clock cycle is the period (measured in seconds) of the clock. Thus a 5 GHz clock has a cycle time of 0.2 nanoseconds. In order for the circuitry on the chip to work properly, it is necessary (within certain limits depending on the actual chip design) for the clock signal to arrive at all points on the chip at nearly the same time. This is what it means for the chip to be in sync. The assumption you quoted makes the assumption that the delay across the chip cannot exceed 1/2 of the clock cycle. For a 5 GHz clock, this is 0.1 nanosecond. Since the speed of light is 300,000,000 meters second, the distance covered in 0.1 nanosecond. is 0.03 meters or 30 millimeters (mm). Slower clock speeds have larger cycle times and allow the chip to be larger and still achieve the 1/2 cycle requirement.
H: Is the battery being drained? I'm building a simple intrusion alarm system with a piezo buzzer fed by a 9V battery, I have a switch to activate/deactivate the alarm, and a trigger (like a switch) connected to a tripwire so if someone goes through the wire the alarm is set off. My question is which of these configurations (A or B) is better in terms of saving battery life (so that the battery lasts longer if there is never an intruder), is there even a difference between the 2 configurations. I'm a newbie. Conf A: Conf B: Which one would you use? AI: In an open circuit, no current flows, so the battery should last as long as its normal shelf life (i.e. not in use). Both configurations are effectively identical. To answer your question "Which one would you use?" Since they are electrically equivalent, I would use whatever one was more convenient and matched the physical layout. (To avoid having to run extra wire, for example.)
H: Is rms value of a positive varying DC voltage same with its mean value? I know that rms of an AC is totally different than its mean. But what if the voltage is not alternating(DC) but varying by time. For example a noise with a huge offset. How is varying DC measured by voltmeters? Mean or rms? Or as in my question are they the same thing for a varying DC? AI: The rms voltage is given by \$\sqrt{\frac{1}{t_1-t_0}\int_{t_0}^{t_1}v^2(t) \mathrm dt}\$ The mean voltage is given by \$\frac{1}{t_1-t_0}\int_{t_0}^{t_1}v(t) \mathrm dt\$ As you can see, these are not the same, except in special cases. A pure positive dc voltage is one such special case. However, if the dc component of voltage is much bigger than any ac components, the rms and mean will be very close to each other. This could apply to the case of "noise with a huge offset".
H: does this design look suitable for a 4-bit adder I am working on a project that will include a basic 4-bit adder, I have designed a layout is Adobe Illustrator and would like people to check over it to see if it looks like it should work. I am very new to this side of electronics and don't entirely know what I am doing. The IC's are as follows: http://www.mouser.com/Search/ProductDetail.aspx?R=M74HC08B1Rvirtualkey51120000virtualkey511-M74HC08 http://www.mouser.com/Search/ProductDetail.aspx?R=SN74HC86NE4virtualkey59500000virtualkey595-SN74HC86NE4 http://www.mouser.com/Search/ProductDetail.aspx?R=L7805ABVvirtualkey51120000virtualkey511-L7805ABV http://www.mouser.com/ProductDetail/Texas-Instruments/SN74HC32N/?qs=sGAEpiMZZMuyBeSSR239IT5Ta765RsfIl7Z%252bPKBp%2fGI%3d All of this is going to be on this breadboard: http://www.mouser.com/Search/ProductDetail.aspx?R=TW-E40-1020virtualkey58930000virtualkey589-TW-E40-1020 The switches are these: http://www.mouser.com/ProductDetail/CK-Components/BD01/?qs=sGAEpiMZZMv%2f%252b2JhlA6ysMM4cIGc%2fmHBGn0VI%2fQp1N0%3d And the lights are these: http://www.mouser.com/ProductDetail/Lumex/SSF-LXH400SRD/?qs=sGAEpiMZZMtAPyr1PQZl3x9IHrxpF7wHvobBBX3aJ9s%3d I want to make sure all of this will run properly and I don't know where all I need to put resistors or capacitors. The running voltage will be 5. This is my planned layout: simulate this circuit – Schematic created using CircuitLab This is pretty cluttered so if you need something more visible, then I can try and upload the AI file that is organized. With these lights, would it be a good idea to put a 250 ohm resistor on the supply? (5V/20mA=0.25=250 ohm?) thanks AI: You can probably use smaller resistor values, or none at all, with the LEDs. Most CMOS gates, operated at 5 V, will not be able to supply 20 mA anyway so there is little risk of damaging the LEDs. However, it is essential that you add a pulldown resistor on the right side of each switch (the side connected to the gates). Otherwise your gate inputs will be floating when the switch is open, which leads to very bizarre and unpredictable behavior. The value of the resistor is not critical. You probably want something over 10k just to reduce the power consumption and 100k might be a reasonable upper limit to make sure the inputs are pulled down to ground well. This a purely combinational circuit operating at very low speed, so bypass capacitors on the power supply pins aren't needed.
H: Deriving simple voltage equation $$V_o = \frac{V_s \cdot R_2}{R_1 \cdot (1+R_2/R_L)+R_2}$$ I need to derive this equation given this circuit: This is what I have so far. $$I=\dfrac{V_s}{R_1+\dfrac{R_2 \cdot R_L}{R_2+R_L}}$$ $$V_{R_L} = I \cdot R_L$$ Where am I going wrong? AI: If R\$_L\$ wasn't present the voltage output would just be: - \$V_{S}\times\dfrac{R_2}{R_1 + R_2}\$ So, adjust R2 mathematically to account for R\$_L\$ being in parallel with it. Can you take it from here?
H: STM32F4 - Floating point unit ( FPU ) I would like to know, what is the purpose of the special FPU unit, that is advertised with STM32F4 microcontrollers ? To quote this website : " The Cortex-M4 core features a Floating point unit (FPU) single precision which supports all ARM single-precision data-processing instructions and data types. " What would be the difference, if this unit was not present in the architecture ? Does this mean I need to use some special libraries / functions when doing arithmetics with floating point variables ? Thank you. AI: Yes, if you don't have a hardware floating-point unit then floating-point operations must be performed using library functions. That's what is done with typical Cortex-M3 processors that do not have hardware floating-point support, and the execution time for these operations goes up significantly.
H: Middle-Tapped Transformer Full-Wave Rectifier Vs. Full-Wave Bridge Rectifier In terms of output voltage, which one of these would be best? Coming into this, I would have to say the center-tapped transformer full-wave rectifier would allow the most accurate output voltage (only 1 diode voltage drop). I've always heard: Cost of the middle-tapped transformer is greater than 2 more diodes. Is this all that it comes down to? AI: The cost of the diodes is one thing. The cost of adding a center tap is another. Increased efficiency by losing a diode drop is another thing. You can get 24% more DC current out of the same weight and size transformer with the 4-diode full wave bridge. So if the filtered DC voltage is more than 2-3V, the full wave rectifier comes out ahead, assuming the diodes-vs-centertap is a wash.
H: Audio from Arduino Due's analog outputs using LM386 Due's DACs provide 0-3.3v (actually less) and are rated at 3mA max. As far as I know, common speaker/headphone impedances range from 8Ω to a few hundreds, so driving these from the DACs will destroy it at best. I guess I could stick a series resistor, but it would need to have a huge resistance and would greatly reduce the output volume. According to Arduino's SimpleAudioExample I can drive a speaker from Arduino's DAC using an LM386 amplifier. Is it because \$\rm{R_{in}}\$ (datasheet, page 2) is the LM386 input resistance, so \$I = \frac{V}{R_{\rm{in}}} = \frac{3.3\rm{v}}{50\rm{k\Omega}} = 66\rm{\mu A}\$, which is a lot less than the max 3mA the DACs can handle? Arduino's SimpleAudioExample circuit looks like LM386's "Minimum Parts" example (datasheet, page 5) with a 10μF capacitor between \$V_{in}\$ and the pot: Is this extra cap AC coupling the DAC with the LM386 input to remove the implied \$\frac{+3.3\rm{v}}{2}\$ DC bias at the input? I hope I got all that right. Even at a low 20x gain setting (pins 1-8 open) \$20*\frac{\pm3.3}{2}\ \rm{volts}\$ seems like a lot! Also, max input voltage is listed at \$\pm0.4\rm{v}\$ (datasheet, page 2). Is something (I guess the pot) reducing the input voltage and preventing huge Vout? Could it accidentally be set to deliver the whole 3.3v input and break the speakers? What am I missing? AI: Well, it's shown as a gain of 200 amplifier, and the signal can be 1.18V RMS, so if it was amplified by 200 and fed into an 8\$\Omega\$ speaker, you'd have almost 7kW going into that speaker. That's not what's going to happen, fortunately. The LM386 can't output more than Vs/2.8 RMS (+/- Vs/2 peak) volts so you don't need to worry too much. Once the output gets close to Vs or GND it stops. It will start distorting horribly if you overdrive it (turn the volume up too high) and make it hit the limits. That's called "clipping". A ~100K resistor in series with the input would keep that from happening, and keep the input within the +/-400mV range. You're correct about the purpose of the capacitor and about the input impedance.
H: Audio from Arduino Due's analog outputs to line-in Line inputs are high-impedance, Wikipedia says around 10kΩ. Due's DACs provide 0-3.3v (actually less) and are rated at 3mA max. \$\frac{3.3\rm{v}}{10\rm{k\Omega}}=0.33\rm{mA}\$. According to Wikipedia line levels are 0.316 VRMS for consumer-grade and 1.228 for professional equipment. 3.3v = 1.18 VRMS. Then, can I assume driving a line-in won't break my DAC or line-in? I found Groovuino which uses just a 500Ω resistor between the DAC and line-in, but it seems odd he got it working without any DC blocking. Perhaps the device he's plugging to is doing it for him? Should I put a capacitor around 10μF between the DAC and the line-in just in case I plug somewhere without DC blocking? Is there any reason not to? Groovuino's 500Ω resistor is very small compared to line-in. Why is it there? To plug headphones? Perhaps also to protect the DAC from an eventual short to ground? AI: Then, can I assume driving a line-in won't break my DAC or line-in? You can drive a regular amp's line-in directly from a Due, but read on ... I found Groovuino which uses just a 500Ω resistor between the DAC and line-in, but it seems odd he got it working without any DC blocking. Perhaps the device he's plugging to is doing it for him? Any half decent amplifier will have AC coupling capacitors on its input. Should you blindly rely on that? Probably not. Should I put a capacitor around 10μF between the DAC and the line-in just in case I plug somewhere without DC blocking? Yes you should. Is there any reason not to? Unless you want extremely low frequencies, if not DC, and you are absolutely sure what you are doing (so well aware of out- and input stages) there is no reason why to leave them out. Groovuino's 500Ω resistor is very small compared to line-in. Why is it there? To plug headphones? Perhaps also to protect the DAC from an eventual short to ground? Probably the last. Limit the controller's output current so you don't accidentally damage it. With only 500Ω output impedance and approx. 10kΩ input impedance you won't notice the slightly lower input level caused by the resistive divider. To absolutely limit current to 3mA @ 3V you would need 1kΩ or even better use an output buffer to drive the cable and amplifier. The 1kΩ resistor will influence the frequency response too (high pass filter). The circuit as proposed has barely any protection for the microcontrollers output pins and that is bad practice when connecting long cables and external equipment to it. An extra opamp is much cheaper than a new Due.
H: Simple broadband RF generator How to make a generator of RF signal which have multiple signal outputs ? Details: Fout = [ F0, .., Fn-1, Fn ] , where F0-F1 = F1-F0 = .. = Fn - Fn-1 = const 1000 Hz (i.e. constant stepping) F0 is ajustable from 0.1MHz to 10MHz n is somewhere about 100 steps I can't use white noise sources over a single wave because signal must have uniform spectre and provide constant output to each step frequency. AI: Please note that the first half of this answer steers down the path of using two square waves BUT this won't generate all the harmonics - see edited section at bottom. A single square wave has odd harmonics of the fundamental frequency but these harmonics reduce with frequency. To counter this, feed the square wave through a filter to shape the harmonics to be of equal amplitude. Here is a picture of the basic harmonics inside a square wave: - As can be seen from the picture, a single square wave gets you half of what you appear to require. Next, do the same with a square wave at twice the fundamental frequency. This then fills in the even harmonic gaps. (No it doesn't - see edit below) It should be noted that the energy spectrum of a square wave falls off at 6dB per octave so a simple high pass filter (differentiator) will restore the energy to remain pretty flat over a wide desired band of frequencies. Note also that in doing this you are creating a repetitive impulse and, if anyone remembers college days then you'll know that this type of waveform has a flat frequency spectrum. Finally feed those two waveforms into a summing amplifier and use a final low pass filter stage to kill off spectra above the high point at 100x the fundamental. EDIT Damn those crazy harmonics and my befuddled mind. The best way is to use a waveform that has all the harmonics present and I believe the easiest type is the sawtooth: - Forget about two sq waves - just use a sawtooth waveform and add emphasis, via a filter to restore the 6dB/osctave roll-off to a flat response.
H: What happens to a transformer if the supply side is shorted? Suppose I have an industrial plant, where a switchboard is fed through a transformer. The switchboard have only "passive" loads, i.e. they don't contribute with short circuit currents. If there is a short circuit on the switchboard feeding that transformer (on the grid side), my intuition tells me that the transformer would be demagnetized (disregarding remanent flux), thus energy must go from the transformer to either the secondary or primary side. Since current can't immediately change in an inductor, I think this energy should go to the secondary side. My simulations show this behavior. As the image below show, there is current/power flowing for about 2 ms (the results on the primary side is identical, so I haven't included it). However, I'm not sure if this is the correct physical representation or a result of inaccurate mathematics. The minimum integration step I can select is 1 ms, so it might be a result of that (I think). The reason why I doubt the results is because the exact same current flows from the shorted bus and in to the transformer on the primary side. Investigating the results on both sides of the transformer, I see that the exact same amount of energy goes in and out after the primary side is shorted. This tells me the transformer is not demagnetized. Now, as we all learned in kinder garden, current in must equal current out, so how could I expect something different? Well, it's not really true in all situations (you can for instance charge a capacitor). I know the energy store in a transformer is magnetic energy, not electrical. Still, there is something here that doesn't seem right to me. I appreciate any input! Thanks! Update It is possible that my explanation has not been good enough. The short circuit I'm talking about is a fault that occurs after a certain time, 3-phase, line-line, line-line-ground or line-ground. Here's a part of the single line diagram. I don't have any "justification" for why the delta-star connection is relevant for the analysis (I don't think it is, it's simply how the system is designed). There can be many reasons, elimination of zero sequence currents for one, but this shouldn't be relevant for this quesiton. The diagram below is how the transformer is represented in my simulation tool. I can't "show" how the circuit is shorted. The way it is done is I add an "event": "Create a (3 phase / Line-Line / ...) fault after 3 seconds. Then I can see the system response as a result of this event. I would think the general behavior of the transformer is independent of the topology, vector group etc. AI: Think of a single phase transformer feeding an open circuit on the secondary. The AC is a normal AC signal then suddenly the AC signal instantly becomes 0 V (this represents the short on the primary feed). There will be some amount of magnetic flux (aka energy) in the transformer core that will push a current back out of the primary windings into the 0 V AC source. If the transformer is perfect in all respects (other than it has a magnetizing inductance), the current will flow into the "0 V" indefinitely BUT there are of course resistive losses so this current will be an exponential decay to zero. If there is no leakage inductance on the primary winding, the 0 V (aka short) will ensure that there is nothing seen on the secondary other than the cessation of the AC waveform when it instantly falls to zero. If there is leakage inductance on the primary (normal of course) then there will be a small kick-back voltage seen on the secondary due to the magnetizing inductance of the primary not being perfectly shorted to 0 V. With or without a load it won't make a difference - there will be a small kick-back voltage seen on the secondary as the magnetic flux (and current) exponentially decay to zero. It should also be noted that if the AC falls to zero volts at the very peak of its waveform, the current in the magnetizing inductance of the primary is zero and no effect will be seen. This is because, at that instant in time, the flux in the core will also be zero. If, on the other hand, the AC voltage halts at a zero-cross (and stays at zero), the flux in the primary will be at a maximum and the effect described above will take place. At all other points the effect will be proportionally less.
H: Why is OCR1B values are not stored? I have following program to control two servo motors: #include <avr/io.h> #include <avr/delay.h> void main() { int x,i,j,t=0,y=0,n=0; DDRA=0b11111111; DDRC=0b11111111; DDRB=0b00001111; //Configure TIMER1 TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|(1<<WGM11); //NON Inverted PWM TCCR1B|=(1<<WGM13)|(1<<WGM12)|(1<<CS11)|(1<<CS10); //PRESCALER=64 MODE 14(FAST PWM) ICR1=2499; //fPWM=50Hz (Period = 20ms Standard). DDRD|=(1<<PD4)|(1<<PD5); //PWM Pins as Out OCR1A=65; OCR1B=50; unsigned int k[1],z[1]; while (1) { for (i=0;i<=4;i++) { //for keypad PORTB=0xf7>>i| 0xf0; x=PINB; if (x==0b11101110) { //key 1 for moving motor 1 OCR1A=OCR1A+1; _delay_ms(100); } else if (x==0b11011110) { //key 2 for moving motor 2 OCR1B=OCR1B+1; _delay_ms(100); } else if(x==0b10111110) { //key 3 for storing value of OCR1A k[t]=OCR1A; t++; _delay_ms(1000); _delay_ms(1000); } else if (x==0b11101101) { //key 4 for storing value of OCR1B z[n]=OCR1B; n++; _delay_ms(1000); _delay_ms(1000); } else if (x==0b11011101) { //key 5 for moving motor from k[0] to k[1] OCR1A=k[0]; Wait(); for(OCR1A=k[0];OCR1A<=k[1];OCR1A++) _delay_ms(100); _delay_ms(1000); } else if (x==0b10111101) { //key 6 for moving motor from z[0] to z[1] OCR1B=z[0]; Wait(); for(OCR1B=z[0];OCR1B<=z[1];OCR1B++) _delay_ms(100); _delay_ms(1000); } } } } I have 4*3 Keypad connected port B. Both motors work properly through keys, but while storing only values of OCR1A are stored properly and somehow OCR1B values are not stored properly. Is there any difference between functioning of OCR1A and OCR1B? After moving motors I am storing the values of OCR1A and OCR1B which represent their current positions. I am storing those values in array (k[] and z[]). Keys 5 and 6 are used to access the values stored earlier so that I can move the motors between the two positions. AI: You have declared the arrays k[] and z[] to have just one element each. Therefore, it is likely that the values you write to k[] are overwriting the values for z[], and the values for z[] are getting clobbered by other variables.
H: How to graduate from Arduino to using a microcontroller directly? I've been working on an Arduino project. After I get everything working using the Arduino, I would like to move to a solution that does NOT use Arduino. That is, I would like to use a microcontroller without involving the Arduino board. This will allow a single board, no shield solution. I know there are methods to make my own Arduino on a breadboard, but that's not really what I'm trying to do. I'm not really how sure how to do this. Unless there is a better option, I'm leaning towards using the ATmega328, which is used by the Arduino. I understand that development tools are available free or at least not very expensive. For the purpose of this question, assume I can get +5V to my circuit. My first question is how to program the MCU. I believe there are two options: Buy a programmer, program the MCU, and then place the chip in my circuit. Design my circuit to include support for in-circuit programming. I'm assuming that if I go with option #1, it's as simple as inserting a programmed chip in my circuit; I don't need anything else. Of course changing the software would be inconvenient. But for option #2, I'm not sure what I need. From the bit of reading I've done, I think I need a programming cable, and a connector on my board (what type?). Then I guess I (properly) wire the connector to certain pins on the ATmega. Either way, I will need Atmel studio. Second, other than the power supply, is there anything on the Arduino that I absolutely need? I guess maybe a reset switch? AI: Welcome to the wonderful world of Atmel. Let me offer you some answers to your questions based on my hobby and professional experience. Do not bother with anything BUT in-circuit programming. Unless you are a perfect coder, removing a chip every time you want to program it is a nightmare. I recommend the AVRISPmkII as an entry level programming tool. The disadvantage is there is no hardware debug supported. An alternative is the dragon but I have no experience with that. I can say that the JTAGICEmk3 is a nice capable debug tool. Atmel studio is good for programming. It is actually my favorite embedded development environment. You can use CLI tools such as AVRDUDE and AVR-GCC but the IDE takes care of that for you. IN SUMMARY: Buy an AVRISP for just programming (easier, plug&play) or a DRAGON (I can not offer advice). On your board, bring out the ICSP pins to a 6-pin dual row 0.100" header -- the connections are described in this datasheet. Reset switches are not needed.
H: STM32 Timer to control GPIO I'm trying to output a slow clock (4kHz) on an I/O from the STM32F0. I'm wondering what the advantage is (if any) of using one of the timer pins to output this clock vs toggling another GPIO on the timer interrupts. I was thinking I could do PWM mode with 50% duty cycle if I use a timer pin but I could also just as easily toggle any I/O each time the timer interrupt triggers an update. AI: A timer interrupt will have significant jitter, unless it is the only interrupt source/handler in the entire system. Clocked devices typically do not behave well when the clock is jittery. Thus, I would personally use a 50% PWM timer instead of a software-generated pulse train, when all I know about the other devices is that it's a "clocked device." If there's some reason that it's OK for the clock to have jitter on the order of whatever your worst interrupt latency/jitter is, then you could go with either option, although the PWM clearly has less moving parts and thus is less likely to break. Software is not to be trusted if you can do it in hardware :-) (And I say this as a software engineer)
H: Radio antenna isolating transformer I need to isolate galvanically my antenna from my RF transceiver. For this I have been recommended a transformer, I select a 1:1 transformer operating in high frequency range. Is it enough to wire it in between the antenna and the transmitter, or we need to take more considerations. The present antenna impedance is 50E. I also need recommendation for ferrite core to operate at 900MHz and provide least insertion loss. AI: Try CoilCraft - they have this that is suitable for your operating frequency: - I don't think they can handle much power (1/4 watt say CoilCraft). Insertion loss is 0.7dB which is OK but nothing special. I still believe an air-cored transformer is the best bet.
H: In Eagle, why is the tstop layer larger than the pad itself? Why is the tstop aperture around a pad larger than the pad itself? I would have imagined that it would be exactly the same size, or slightly smaller, so that the solder stays only on the defined pad. Would there be any reason to make it larger, or smaller? AI: The TStop layer is for solder mask, the thin coating that prevents copper on the board from being exposed except for the areas where desired. The TStop layer leaves apertures slightly larger than the pads so that the copper is still exposed in case of misalignment when producing the PCB. However, extreme misalignment can cause copper to be exposed by the wrong aperture and you wind up with a situation where two nets are both easily shorted by solder in the same aperture. From Printed Circuit Design & Fab Some PCB software will let you change the amount of pullback of the TStop layer, but ideally you should have some so that minor misalignment doesn't hide some of the pad, especially with fine pitch pads.
H: Lifting electromagnet & Induced EMF An electromagnet is lifting/pulling large pieces of iron, from a distance $r$. Is there an induced EMF in the coils of the electromagnet due to the change in flux? Another configuration would be the piece of iron is rotating around the electromagnet is there still EMF induced? I'm confused because if a ferromagnet is introduced to a magnetic field, there is a change if flux, however, is the magnetic field produced by the ferromagnet = to the external magnetic field? Also are there large voltages induced? AI: Any time there's a change in the flux in the coil for whatever reason there will be an induced EMF in the coils.
H: Unipolar stepper motor and a MCU I have been trying to steer unipolar stepper motor (5V, 0.7A) using microcontroller powered only by USB (5V or smthing like that). The motor clicking got louder but the motor doesn't move yet. I tried to lower resistance of R1, R2, R3 and R4 and motor cliks got louder, but when I completely removed these resistors it again clicked more silently... Does anyone have any idea on how to make this motor turn as it should? I used ohm meter to measure the internal resistance which was 5Ω and I am affraid to lower R5, R6, R7 and R8 any more as my external power supply isn't very strong plus I might damage transistors... When I tested the motor all by itself with no microcontroller It did turn if approximately 0.3A current flow through the windings. Maybee my: transistor isn't fully opened current through the windings in motor is too low my external power supply can't handle it (this is not an option for me :S i have to make it work lol) Schematic: Closeup of the right part of the schematic: EDIT: This is the circuit schematic after I consulting with you guys: I hope this will do the trick. AI: Did you read the transistor rating of BC546 in the datasheet, Collector Current − Continuous IC 100 mA dc. Your mcu specs mention an absolute max or 4mA as output current (you have already exceeded that with the base resistor you have used). You need to select a more powerful transistor and a high gain Darlington would suit your needs, a device like TIP120 Your mcu is a 3.3v device and a Darlington transistor needs about 1.5v between base-emitter so a resistor of about (3.3v - 1.5v)/0.003A = 600 ohm should do or slightly higher to 620 Ohm If you don't have a Darlington available you can use two discrete transistors in a Darlindton configuration to increase the current gain. simulate this circuit – Schematic created using CircuitLab Note that I've uses a 1A transistor for Q1. You'll need four of these, one for each coil.
H: Heating and Chilling ICs instantly from 200C to 0C? Does it damage the silicon inside? I soldered VCXO oscillator and suddenly tried to cool it down with a cooler spray. Do you think that sudden cooling and heating damages the chip. The heating and cooling were well within the spec requirement but I don't know if the sudden change in temperature of the device damages the IC inside the oscillator. AI: Theoretically, you can introduce thermal shock that can crack an IC's casing, or cause bond wires to break off. Depending on how close the heating and freezing is and where the heat and cold is introduce, it can cause flexing from the different thermal expansions. In practice though, it's hard to say if it has or has not happened. It might require a couple of cold/hot cycles to affect it. It depends on how fast the IC parts actually change in temperature. It depends on the temperatures it reaches. It depends on the IC's casing's thermal resistance. You need to test it, and next time, avoid drastic temperature changes.
H: Controlling a DC motor speed with Arduino I'm trying to follow this tutorial But instead of the components specified in the tutorial, I'm using the following: - RS-360SH DC Motor - BD139 Transistor - 1N4007 Diode - 220 Ohm Resistor I understand that the components are different than specified in the tutorial, but these components are specified in another (less clear tutorial with the same schematics. And I have the following arduino code: int MotorPin = 9; void setup() { pinMode(MotorPin, OUTPUT); } void loop() { analogWrite(MotorPin, 200); delay(1000); } All I can get is a buzz in the motor. There doesn't seem to be enough current to power it on. Can anyone explain what I'm doing wrong? Edit This is my schematic (I put the 2N2222 transistor, because I tested with that one as well): simulate this circuit – Schematic created using CircuitLab And this is how I plugged everything onto the breadboard. AI: Your schematic is correct, basically. Although it is not explicitly shown on your diagram, I assume you have the Arduino plugged into a USB port which supplies it with power? What happens if you connect the 9V power supply directly to the motor? Of course the motor should spin constantly at full speed. This tests that the voltage of this power supply is appropriately matched to your motor, and the power supply can source enough current to run the motor. Now, what happens with the wire disconnected from pin 9 on the Arduino and plugged into +5V on the Arduino? If the transistor and other parts are wired up correctly this should also cause the motor to spin up constantly at full speed. If this doesn't work double check the pinout of the transistor. Now, in your software, try turning the motor on with a single digitalWrite(MotorPin, HIGH) statement in the setup part of your program. Don't put anything inside the loop at this stage. This should just cause your motor to turn on and stay on all the time at full speed. Now, if that works, try something like analogWrite(MotorPin, 128) executed once in the setup part of your program, with nothing in the loop. The motor should now turn on, and stay on constantly, at reduced speed. Is the motor current too much for the 2N2222 to handle? (Once you know what the motor's actual specifications are for current draw, check the collector current in the 2N2222 datasheet.) You may need to consider substituting a different, higher-current transistor such as a TIP120 or BD675.
H: What sort of a ferrite core will I need to make core memory? I am building a homebrew computer using core memory. What sort of a ferrite core will I need? AI: Look for a core that saturates in a low H field (lower power needed) and the core should have a wide hysteresis curve so that it stays magnetized when current is removed. No air gaps of course. Try ferroxcube, they do a good range.
H: What is the purpose of the Motor Run Capacitor? Looking at a control box for a marine Air Conditioner and it has a HUGE capacitor in it. The schematics label it a "Motor Run Capacitor", but I always thought it was just used to start the motor. What function does a huge cap like this have in running the motor? The Air Conditioner is being run off AC power from a generator, no DC involved. AI: It's more than likely a single phase induction motor. Unlike a 3 phase motor that can automatically generate a rotating magnetic field, a single phase induction motor has to manufacture one by using 4 stator poles. Two of them are fed with the regular AC voltage and the other two are fed AC via a capacitor. If the value of the capacitor and winding inductance is chosen to electrically be a low Q resonant circuit at the AC frequency supplied, the voltage phase difference between the two sets of stator coils will be approximately 90 degrees and this will set the motor spinning. Here is a decent link and below is a snapshot: -
H: Making a three phase voltage source to drive a gyroscope I'm trying to drive a gyroscope that needs a 3 phase 400Hz 32v 1A power supply. How can I provide that supply? It's one part of my university project and I'm a beginner in this field. I'd like to find the best way to provide a suitable supply. thanks AI: Use a Johnson counter with a ring of nine outputs ( or greater multiples of 3). Use resistors from each output weighted so that an approximation to a sinewave is created. You can use another set of resistors to create another sinewave at 120 degrees and ditto for 240 degrees. Now you have a rough approximation to three sinewaves set at the right phase angle for 3 phase. And you can control the output frequency by varying the clock into the Johnson counter. Alternatively buy and program a DDS chip from analog devices. It does the same effectively.
H: Measuring AC voltage from DC battery When measuring the AC voltage across a DC battery (CR2032), and I am getting 6v. The DC voltage across it is 3.01 volts. I also tested on a 9 volt battery; again the same thing. I am reading about 20 v AC and 10v DC. I am using MASTECH MAS830L multi meter. I also used another multimeter, and I get the same result. When I am putting the multimeter probes in the same polarity with the battery, I am getting the AC voltage, but none if I put the probes in reverse polarity. Why is this happening? AI: When I am putting the multimeter probes in the same polarity with the battery, I am getting the AC voltage, but none if I put the probes in reverse polarity. This is the clue to what is happening - "nothing" when you connect in reverse means that the meter uses a simple precision half wave rectifier to convert AC to a rational DC voltage. I'm guessing the meter makes no claims to measure RMS AC voltage - it assumes the AC voltage is a sine wave and, the output from the precision rectifier is averaged (with a filter) to give a "steady value" that is representative of the AC RMS value. The problem is that this "steady value" will be about 50% of the AC RMS value and, if the inputted voltage is always at a peak value (because it is DC), then the steady-value will also be the peak value hence, with a 3 V battery, the steady-value measured by the meter is 3 V (the meter doesn't know any better and indicates that it is measuring a 6 V AC voltage). If it were a 6V AC source it would see about 3V.
H: How does spread spectrum VCXO (voltage controlled oscillator improve EMI on your board? I have seen people adding spread spectrum voltage controlled oscillator to EMI on the board, How is EMI affected by single spectrum crystal and with spread spectrum crystal. AI: Spread spectrum improves EMI by spreading out the peak emission. Instead of one very strong spike at a high energy level, you end up with a wider "peak". The power output is the same, at the cost of frequency accuracy. The benefit to this becomes apparent when you have specific emissions requirements to meet. You may not be permitted to emit more than xmW at a given frequency. Without a spread spectrum clock, you might not come close to meeting this requirement, but if you spread the emission frequency out a little, the power at any specific frequency in that range might fall below the maximum allowed, and now you pass. The downside to spread spectrum clocking is that your frequency is no longer precise, because it (intentionally) wanders over a wider range of frequencies that are centred around your desired frequency. The average frequency is your desired frequency, but at any given point in time you will somewhere in the spreading range. This can cause trouble if you're trying to communicate with other devices. Here's an exaggerated picture of the difference between a clock output at a specific frequency vs the same clock output with some spreading. Ignore the "noise level" note, or instead imagine that the dashed line "noise level" is the absolute maximum level that you're allowed to radiate in order to pass emissions testing) (The picture source is http://www.tapr.org/images/ssfig1.gif.)
H: Soldering guidelines for freezer applications? I'd like to do a home project where I take temperatures inside of my freezer and inside liquids. Liquid-compatibility aside, I'm mostly curious about whether or not anyone can recommend some best practices for the board design. I haven't found any resources online that explain what will happen in applications that are intended for 0C temperatures. I assume the solder joints will contract due to the cold, but does this mean that a surface-mount design will inherently fail? Therefore, should I limit my temperature (and possibly microcontroller) selections to through-hole parts? Is there a better solder formulation to go with, i.e. lead-free or not? Should the pads or through-holes be larger than what's normally found on the IC data sheets in the footprint section? Any advice or insight would be really appreciated. I'm more than willing to experiment and learn from my mistakes, but if I could get a better head start, that would be nice. :) AI: Some useful information about different types of solder: NIST Metallurgy The main important tables are 1.12 (coefficient of thermal expansion/elastic properties of leaded solders) and 1.14 (tensile/shear strength of leaded solders). I believe the document has information for lead-free solders as well (that is what it is called after all), I didn't look too hard for these. The key properties for 63/37 leaded solder: Coeff of thermal expansion: $$ \alpha = 24 \frac{10^{-6}}{K} $$ Elastic Modulus (I'm using the 20 degree figure, it will be slightly higher near 0 degrees, not exceeding 38.1 GPa at -70 degrees): $$ E = 30.2 GPa $$ Tensile strength: $$ \sigma_{max} = 56.19 MPa $$ The worst case scenario is if the solder is mounted onto something completely rigid. Suppose we were to take the 0 stress state as room temperature (25C). The contraction due to thermal expansion is: $$ \epsilon = \alpha (25C - 0C) = 0.0006 $$ And the appropriate tensile stress is: $$ \sigma = E \epsilon = 18.12 MPa $$ This is well below the tensile strength of the solder. However! Even better is that the PCB board itself will contract with the solder as it cools down. Depending on the actual layup direction, this closely matches the 63/37 solder CTE (~20e-6/C for the primary direction), so the actual stress will be lower. tl;dr: you'll be fine. You might have to worry more about moisture/condensation, as well as having components which are rated for below 0C operation instead of worrying about solder joints cracking.
H: What are the typical qualification norms for assembly line workers? My question seems OFF-TOPIC, but I do believe there might be people here(at electronics_stackEx) who know the answer. And I really don't know a better place to post this. Here Goes the question: What kind of education qualification do electronics assembly line workers possess? I don't know the nature of this kind of work. AI: IPC have international standard courses on assembly: http://www.eytraining.org.uk/t/Services/IPC-Training.aspx The five IPC certification programmes are: IPC A-610 Acceptability in Electronic Assemblies is for quality assurance/visual acceptance of electronic assemblies based on the world's most widely used electronics assembly acceptability standard IPC J-STD-001 Requirements for Soldered Electrical and Electronic Assemblies is for hand and machine soldering processes and material requirements. It includes hands-on training. IPC A-600 Acceptability of Printed Boards is for quality assurance/visual acceptance of unpopulated printed circuit boards and explores the specifications, problems and faults that occur with the manufacture of PCBs. IPC/WHMA A-620 Requirements and Acceptance for Cable and Wire Harness Assemblies is for improving the quality of your cables and harnesses, reducing errors and costs. IPC 7711/7721 Rework, Modification and Repair of Electronic Assemblies is for the rework, repair and modification of electronic assemblies, rather than scrapping them. It features hands-on training.
H: What exactly is a potential barrier in transistors? Here it says that: When a transistor is OFF, there exists a potential barrier between the source and the drain.. I don't know exactly what a potential barrier is. If I had to make an educated guess, it would be a barrier that an electron has to overcome in order to reach the drain, from the source. If you don't want the electron to reach the drain (i.e. the transistor is "off"), you make the barrier harder to overcome. However, this guess raises questions (the foremost being whether or not the guess is actually correct): What kind of barrier is this? Obviously, a 'potential' barrier, but how does this work? Is this barrier removed if you want a transistor to be on? AI: For the first answer, this barrier is caused due to the different materials used to construct the transistor. Think of each connection in the transistor as a diode. Now, the source may be of n type material(i.e. have extra free electrons) and the substrate might be p type material (i.e. have extra holes - positive charges). Now if you don't apply any external voltage, there will be an equilibrium state where the electrons at the border of the n-type material will cross over to the p-type substrate. This would then result in the formation of a charge neural depletion region, and any new electron which now needs to cross-over to the p-type substrate would require an additional external voltage. This voltage is your barrier potential. When you apply an external voltage, this barrier potential reduces as electrons are able to flow more freely, thus turning the diode on. Why do I refer you to diodes, it's because a transistor can be considered as device with two back-to-back connected diodes. Once you understand how a diode works, transistors become easy! [1] http://www.electronics-tutorials.ws/diode/diode_1.html
H: Generating simple alert tone MCU project A receiver part of my project should activate a light tor few seconds but they decided to add an alert tone which will be played on the PA sys of a building. I think input is 8 ohm imp PA. I was looking for an easy, fast way to implement a ability to generate an alert tone. I'd love to make DTMF tones and step them up in sequence (in volume) since they are easy on the ear. Nothing too complicated basically an alarm clock sounds would be nice. I have my design done, and I have an Atmel AtMega, so I don't want to add anymore parts and like to use the Atmel to accomplish this. Any guides on this would be a great help. I've never generated a tone directly out of the MCU. AI: You can use PWM to produce audio tones in (at least) two ways. The first, and simplest, solution is to use a PWM module to produce a square wave (with duty cycle 50%) at the desired frequency of the tone. It is usually desirable to then pass the square wave through a low pass filter to round the corners off (resulting in a "cleaner" sound) by removing the upper harmonics. If you want to mix tones using this method then you need to use one PWM module and LPF per tone, and post-mix them with an op-amp. The second, more complex and ultimately more satisfying, solution is to use a PWM module as a DAC and drive it with a software Direct Digital Synthesiser (DDS) to generate as many mixed tones as you want (within the limits of your available processing power). To use a PWM as a DAC, drive it at the highest possible frequency, preferably well over 20kHz to ensure that any spectral artifacts not removed later are outside the normal human hearing range (nominally up to 20kHz). When you feed the high-frequency PWM through a LPF with corner frequency around 5-8kHz, the output amplitude of the LPF, as a percentage of rail voltage, will approximate the duty cycle of the PWM signal fed to the LPF. For example, with a rail voltage of 5V and a duty cycle of 50%, the output of the LPF will be approximately 2.5V. The DAC output can be modulated by varying the duty cycle of the PWM. To modulate it with a sine wave of a given frequency, the "lowest cost" approach is to use a lookup table that contains a set of pre-calculated fixed-point duty cycle values that map a sine wave and can be fed to the DAC. The lookup table needs to cover only 1/4 of the period of a sine wave because you can use reflection to reconstruct the other 3/4 of the wave from the first 1/4. The rate at which you feed the sine lookup table into the PWM module governs the output frequency of the audio it produces. So, an 8-point lookup table (so, 32 points for the entire sine wave) used to update a PWM signal at a 20kHz rate will produce an audio tone of 20,000 / 32 = 625Hz. This is a software DDS. If you want to combine multiple tones into the DDS, you need to provide a substantially higher resolution lookup table. Where before 8 points (or even 4 points) for a 1/4 wave was adequate, you are now looking at 128, 256, even 1024 if you want good resolution. To vary the frequency of the modulated output, step through the lookup table at different rates for each tone. So, for the 625Hz example above and a 1024-point table, you would increment the table pointer by 128 on each update. If you want to add a second tone, at say 1600Hz, you would increment a seperate pointer by 1600/625*128 = 328 (giving an actual frequency of ~1602Hz). Add the two values extracted from the table together, add a DC offset, and feed the result to the PWM module at a 20kHz rate and it will output an audio signal containing both tones. In order for either DDS approach to produce "nice" tones, you need to pay careful attention to the PWM update timing. Jitter minimisation is the key. Use a high-priority interrupt to do the updates, and (here's the key) pre-calculate the next update before you leave the interrupt service routine. When you arrive in the ISR next time, immediately feed the PWM module with the pre-calculated update value, then calculate and store the next update value. This should ensure that the amount of time between the ISR firing and the update being fed to the PWM module is constant.
H: Explain how this LED driver circuit will work - is there any way to turn on the LED? Is there any way to turn on the LED in the below figure? You can apply different voltages at the diode input: AI: It's not clear what the triangle with the circle is in detail, I suspect it's the output driver of a logic circuit (a microcontroller such as a PIC or AVR ?). If you can get the output of the driver to sink enough current and be at ground (0 Volts), the LED should light up. If the circle of the output driver is meant to indicate negation, then you would have to set the input to logical 1 to switch the LED on.
H: Is it a good idea to make one instrumentation amplifier with three operational amplifiers for thermistor sensing circuits? Is it a good idea to have those three amplifiers with LM741 Operational amplifier? Has anyone done this so far? I thought of this as this was a cheapest idea. The instrumentation amplifier costs about $6 but the quad LM741 costs like $2. I know that buying instrumentation amplifier would be most effcient. But does anyone see any huge disadvantage in this making of instrumentation amplifier with three LM741 op-amps? AI: It is possible, but the CMRR (common mode rejection ratio) will be worse than a monolithic InAmp. In a monolithic InAmp, the resistors R1-R3 are matched. Also, they are on the same die at the same temperature. By the way, the above holds independent of the OpAmp model. A Designer's Guide to Instrumentation Amplifiers has more on inner workings and rationale behind the design of InAmps. Building an InAmp with 3 separate OpAmps could be a neat learning exercise**. You can plug in different OpAmps and compare results. You can compare CMRR with a factory-made monolithic InAmp. ** As Matt wrote in his comment. He had beat me to it.
H: Do you always need a GPIO expansion chip when using i2c? SUMMARY: I'm trying to learn the basics of understanding how to wire up a simple circuit using the i2c. I'm wanting to build just a simple project involving an LED and a push button with my raspberry pi. From what I understand the "pi" already is i2c capable and i2c isn't a piece of hardware it's just a protocol from what I understand. However, I thought initially all I had to do was wire up the push button and LED to the SDA and SCL pins on the pinouts of the "pi" and I would be good. But apparently I need an expansion chip or some similar device that provides instruction and registering for devices like the LED and PushButton. QUESTION_1: Do I need a GPIO expansion chip to connect to my "pi" before I can start hooking up devices using the i2c functionality? I already ordered a 579-MCP3008-I/P and a 579-MCP23017-E/SP in case I have to. I'm unsure on what the I/P or E/SP means but I was told the MCP3008 and the MCP23017 were good ones to get. QUESTION_2: From my research here and through examining the circuit diagram below I thought the (SLAVE) devices were my LED and Push Button and then my (MASTER) device was my "pi". I going to assume that my pi is my MASTER device but my SLAVE device would be considered my expansion chip NOT the LED or PushButton. Therefore, my LED and Push Button isn't a slave or a master device it's just an extension of the SLAVE DEVICE being the expansion chip. Do I have this right. I drew out my conclusion of what i'm understanding. Forgive my drawing as I know it's not to scale. Can someone critique me on whether or not i'm understanding this setup and terminology when it comes to slave and master. AI: When communicating, there must be an established set of rules for how to interact. Much like how when we speak to each other we are currently using English. In a similar fashion, chips have to have an established protocol for how they communicate in order to transfer data between them. When speaking, the rules involve use having sounds that form words, and then rules which describe how those words go together to form sentences. When writing, we have symbols which come together to form words, and then the same rules about how words come together to make sentences. In just the same way, your chip has two pieces of understanding. The first part is the protocol, and the second part is the interface. I2C has both a protocol and an interface at the same time. It describes the interface, which are the rules for how a chip should send electricity to another chip (much like the sounds for speaking or symbols for writing). I2C also describes a protocol, which are rules for how to interpret that information transmitted via the interface (like the syntax for a sentence). Now, the types of devices which are meant to communicate using I2C are things like microcontrollers and computers. Things which have a high enough level of "understanding" or at least capability to think of things like "addresses" and bytes. When you buy a device which lists that it understands I2C (like this fancy led https://www.sparkfun.com/products/8579 ), then you know that it will understand those rules for both the interface and the protocol of I2C, and you can interact with it directly. A "normal" LED (like this one: https://www.sparkfun.com/products/9590 ) doesn't understand anything like I2C. It is like a lightbulb, it just turns electricity it receives into light! Because of this, you can't "communicate" with it using I2C. In the same way, a button (like this: https://www.sparkfun.com/products/97 ) doesn't speak I2C either. It is like the switch you used. If you push the button, it physically connects two of the pins on the outside. If you want to use a button or LED like these, you should look into something called the "General Purpose Input/Output" pins, also called GPIO. These are pins on your Raspberry PI which can simply send "hi" and "low" voltage to a component (like your LED), or read if the electricity on a pin is "hi" or "low" itself. Now, with all of that out of the way, let me answer some of your actual questions! Q1) From what I understand the "pi" already is i2c capable and i2c isn't a piece of hardware it's just a protocol from what I understand. A1) With an interface it is quite tedious and CPU intensive to sit in a loop and repeatedly set the pin "hi" and "low" and then wait a precise period of time in order to send your data. Since we would frequently like to send the data, and then have the CPU go and do something else, many microcontrollers and CPUS include sections of hardware which understand how to transform the data from a series of bits into the electrical signals necessary to communicate using certain protocols. Inside of your raspberry pi, there is a special set of registers (or at least memory locations) which, when written to, can cause some of your pins to behave in a manner consistent with the I2C specifications. When doing this in Linux through the kernel this can be quite difficult, which is why many designers will use "memmap" and /dev/mem in order to toggle those memory locations directly. This is quite involved, and you will likely need to find more substantial references than I can provide. Q2) Do I need a GPIO expansion chip to connect to my "pi" before I can start hooking up devices using the i2c functionality? A2) As I stated above, if you are not willing to use the GPIO pins already available on the raspberry pi itself, you will have to find a device which can transform the I2C information into a simpler form that your LED and push button "understand." Q3) Who is the master and who is the slave on my I2C bus? A3) So there is only one device in I2C which is allowed to initiate communication at a time. In this case, the only device which should be a master is the raspberry pi. If you do in fact have a push button which is I2C enabled, you will tell the raspberry pi to ask the push button slave "are you pushed or not?" and the button will reply, and then you will use that information. I hope that helps!
H: Simple frequency deviation to voltage converter I have a capacitive sensor connected to a 555 timer wired as an astable multivibrator and the free running frequency is 60kHz. When the capacitance of the sensor changes, the frequency of the 555 also changes. The maximum frequency deviation from the center frequency is 20kHz, i.e lowest frequency (60kHz-20kHz) is 40kHz and I want to convert this frequency deviation to voltage. I need a simple circuit using a 555, OPAMP, transistor etc. I would prefer not to use the LM331 frequency to voltage converter. AI: One simple method is to add a single-shot / monostable vibrator that is triggered by the oscillator. If the mono time is slightly shorter than the period time of the highest frequency (\$T = \dfrac{1}{60\text{kHz}}\approx 16.7\text{ms}\$), you effectively have a PWM signal that is proportional to the input frequency. Then all you need is a low pass filter that filters out the high frequency and outputs a DC-voltage, averaged from the PWM.
H: Fixing ATtiny45 Clocksource I accidently changed my ATtiny45 clock source to 128khz . After that I can't program it . I tried avrdude in terminal mode but it doesn't work . >>avrdude -P COM4 -c avrisp -b 19200 -p t45 -t -F -u (I'm using Arduino as ISP for programming) How can I fix it ? AI: The ISP frequency can be up to 1/4 of the core clock so you must set you programmer to work at lower frequency. For 128KHz core clock the ISP can be up to 32KHz. Use the -B flag of avrdude, try -B250 ( 4kHz) -B bitclock Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only). The value is a floating-point number in microseconds. The default value of the JTAG ICE results in about 1 microsecond bit clock period, suitable for target MCUs running at 4 MHz clock and above. Unlike certain parameters in the STK500, the JTAG ICE resets all its parameters to default values when the programming software signs off from the ICE, so for MCUs running at lower clock speeds, this parameter must be specified on the command-line. It can also be set in the configuration file by using the ’default_bitclock’ keyword. If Arduiono ISP doesn't support that flag and you don't have any other programmer available you can use this ArduinoISP firmware that supports low speed chip erase and fuse burning.
H: Atmeg16 USART communication problem In my project, I use a atmega16 to send data to PC via USB to TTL converter at baud rate of 9600 and internal RC of 4Mhz. If I power the atmega16 using my laptop through a usb cable I can receive the data perfectly, but when I power the same using a 9v DC battery and 7805 regulator, I get garbage value on the PC. Please help me out. AI: You must connect Rx, Tx and ground. When you supply power from USB then they both PC and mcu operate on a common ground, when you use a battery that ground connection between mcu and PC doesn't exist. Connect the grounds of USB and battery(-pole) and it should get fixed.
H: circuit analysis of DC-source, inductance and modulated resistance Here's an interesting problem. Consider a DC voltage source (for bias), an inductor (supply wires, for instance) and a resistor, which changes its resistance as a function of time: \$ R(t) = R_{offset}+R_{mod}\cos(\omega t)\$, where \$R_{offset} > R_{mod}\$. The bias voltage across the photoresistor would cause an AC-current \$i(t)\$ to flow. simulate this circuit – Schematic created using CircuitLab Now, to find the unknown AC-current \$i(t)\$, I would solve the following ODE: $$ V=L\frac{di}{dt}+i(t)R(t) $$ which can be rearranged to: $$ \frac{di}{dt}+i(t)\frac{R(t)}{L}=\frac{V}{L} $$ which enables us to solve the DE using the integration factor method. $$ i(t)=\frac{\int e^{\int p(t)dt}g(t)dt+c}{e^{\int p(t)dt}} $$ where \$g(t)=\frac{V}{L}\$ and \$p(t)=\frac{R_{offset}}{L}+\frac{R_{mod}}{L}\cos(\omega t)\$. We get: $$ i(t)=\frac{\frac{V}{L}\int e^{\big(\frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)}dt + c}{e^{\big(\frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)}} $$ which becomes: $$ \require{cancel} i(t)=\frac{V}{\cancel{L}}\frac{\cancel{L}}{R_{offset}t + \frac{R_{mod}}{\omega}\sin(\omega t)} + \frac{c}{e^{\big(\frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)}}\\ =\frac{V}{R_{offset}t + \frac{R_{mod}}{\omega}\sin(\omega t)} + \frac{c}{e^{\big(\frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)}}\\ $$ The first term goes to 0 after briefly going to \$\infty \$ when \$R_{offset}t\$ and \$\frac{R_{mod}}{\omega L}\sin(\omega t)\$ are equal (big L-'hard-start'?). The other term goes to 0 with \$e^{-t}\$ which looks kind of strange, as I would expect some sort of steady-state solution. Am I asking the wrong kind of question, here? i.e., is the problem badly stated, or am I missing something else? EDIT: After doing the write-up, I have a suspicion, that: $$ \int e^{\big( \frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)}dt \neq \frac{L}{R_{offset}t + \frac{R_{mod}}{\omega}\sin(\omega t)}e^{\big(\frac{R_{offset}}{L}t+\frac{R_{mod}}{\omega L}\sin(\omega t)\big)} $$ I will have another look, and correct if needed. AI: You won't (easily) get a closed form for \$\int e^{p(t)}dt\$. The solution to the differential equation that you wrote is: $$i(t)=\left(\frac{V}{L}\right)e^{\frac{-R_{mod}\sin(\omega t)}{L\omega}-\frac{R_{offset}t}{L}}\left(\int_0^t e^{\frac{R_{mod}\sin(\omega \tau)}{L\omega}+\frac{R_{offset}\tau}{L}} d\tau\right)+ Ce^{\frac{-R_{mod}\sin(\omega t)}{L\omega}-\frac{R_{offset}t}{L}}$$ where \$C\$ is an unknown determined by the initial condition. Obviously the term involving integration is the troublesome bit so lets focus on that piece. The power series for \$e^{x}\$ converges uniformly on bounded sets so we can exchange the power series with the integral giving $$\int_0^t e^{\frac{R_{mod}\sin(\omega \tau)}{L\omega}+\frac{R_{offset}\tau}{L}} d\tau = \sum_{n=0}^{\infty}\frac{1}{n!}\int_0^t\left(\frac{R_{mod}\sin(\omega \tau)}{L \omega}+\frac{R_{offset} \tau}{L} \right)^n d\tau.$$ Integrating the inner terms involves integrating terms of the form \$\tau^k\sin(\omega \tau)^{n-k}\$ which have closed form solutions. The real upshot is that if we only want approximate solutions we can bound the tail of this series by bounding the integrands and using that $$\sum_{n=N+1}^{\infty}\frac{1}{n!}x^n = e^x-\frac{e^x \Gamma(N+1,x)}{N!}.$$ Then we will have a closed formed approximate solution \$\tilde{i}_N(t)\$ which approximates \$i(t)\$ and we will know a bound for the error \$|\tilde{i}_N(t) - i(t)|\$.
H: PWM with programmable Dead Time I need to make a circuit that generates a PWM signal for a motor. The motor has 2 inputs - P and Q. They are the inverse of each other. Now, both signals aren't allowed to be high at the same time. That's why there needs to be a programmable Dead Time - the time between the signal that is high to go low and the low signal to go high. Now I know how to easily make a PWM signal. It's allowed to have a fixed signal width and fixed period - because it's for educational purposes. To generate this, I just have a comparator with on one input a 8-bit-counter continuously counting, and a constant on the other. Now, I need to somehow check whether the signal toggles upwards or downwards. If it goes upwards, it can go straight through, but else it has to load a loadable 8-bit counter with certain value and wait for it to overflow before the new high output gets outputted. For the loadable counter part I should have enough knowledge, but I don't know how to detect the edges (preferably asynchronous stuff should be avoided) AI: You can produce two outputs from one PWM signal using an RC filter and a couple of logic gates. Try this: - Because you don't want either to be high at the same time, invert the OR gate's output. Use schmitt trigger gates for the best result.
H: How to ADD resistance with a push-button (Schematic Incl.) Edit: New schematic, my apologies. Background: The circuit below shows a potentiometer "R1", which is not used until the normally open push-button "S1" is pressed. The second resistor "R2" is not used until the normally open push-button "S2" is pressed. The orange square just represents a PCB I didn't design with components irrelevant to the issue. Problem: Obviously if both S1 and S2 are pressed at the same time, then R1 and R2 are in parallel. I need to make S2 increase the overall resistance even if S1 is currently pressed. The specific impedance is not too important, I just can't have R1 in parallel subtracting from the impedance of R2. Basically I need S2 to override S1, either by somehow adding R2 in series with R1, or by having R2 replace R1 in the current. Conditions: S1 pressed: R1 only S2 pressed: R2 only S1+S2 pressed: at least R2 or both R1+R2 Default State: No current Can this be done using only passive components and push-buttons? AI: Basically I need S2 to override S1, either by somehow adding R2 in series with R1, or by having R2 replace R1 in the current. This can be done, with a button that does both NC and NO (Essentially a momentary SPDT). A toggle switch illustrates it. simulate this circuit – Schematic created using CircuitLab As you can see in the top illustration, The Default state of SW2 is to R1. But SW1 is in the way. So SW1 must be pressed, and the resistance of R1 is seen at the output. When SW2 is pressed, SW1 and R1 are completely removed from the circuit, so only R2 is seen at the output, with no parallel load. But since you say that series resistance is not an issue, just move things around, and you can keep using a simple NO Pushbuttons. With R2 (R4) first, pressing SW1 Results in R2 + R1 in series, while SW2 results in Just R2 (Because R1 is shorted out). Though it does depend on if the orange circuit logic can be changed to handle that setup. Oh, and if you want to get real fancy, a momentary (or not) On/Off/On switch can be used, replacing SW2 in the top circuit, while getting rid of SW1. Since it's still a SPDT type switch, there will never be any parallel load, since it has a middle off, it still allows neither circuit to be activated, AND it prevents the user from activating both circuits at the same time. Logically, A, B, Off, not A, B, A+B, Off.
H: How does installing battery backwards damage a torch? Recently, I bought a high performance torch which uses a CR123 lithium battery. The manual warns against installing the battery backward and says it "will damage electronic components". I recall doing simple circuitry at primary school, and installing a battery backwards never caused any problems. So what makes a torch vulnerable to a battery installed backwards? AI: Without knowing the schematic of the flashlight (torch), it's hard to say. Some might have reverse voltage protection, some might not. Since it states it outright, it probably does not. Since some of these high performance ones have integrated ICs for boosting the battery voltage from 3v (CR123) to the needed operating voltage of the (assumption) LEDs and control circuitry, reversing the voltage can cause a breakdown of sensitive parts. There are three main sets of circuits that these advance flashlights can have. LED Driver (Boosts power from low voltage battery to LEDs) LED Control (Microcontroller in the Switch allowing various dimming levels or features like signal flashing or patterns) Battery Charging (What it says on the Tin) If any of these lack reverse voltage protection, they can break. And that specific one has a temperature sensor. Don't know why, probably for thermal shutdown reasons. On the other hand, my dollar store 9 led flashlight has exactly three parts to it. 3 AAA batteries, 9 LEDs, and a simple Switch. No resistor, no current control. It depends on the resistance of the batteries, the high current load of 9 LEDs in parallel, and they often blow leds over time. Very simple, and while a practical design for it's intended use and production cost (pennies on the dollar), NOT performance oriented. Essentially, you are underestimating the complexity of the flashlight in question, and overestimating your simple electronics knowledge.
H: What is the equation for the 555 timer control voltage? I was just wondering what the equation is to find the 555's output frequency is, when a control voltage is applied to pin 5. That would be very useful for me to know! [Edit By OP] So based on what Spehro Pefhany said, the equation for the output frequency (Substituting the equations for the high and low times) would be: Where: \$V_{Control}\$ is the control voltage \$C \$ is the timing cap \$V_{cc}\$ is the supply voltage \$R_{1}\$ and \$R_{2}\$ are the timing resistors \$f\$ is the output frequency AI: simulate this circuit – Schematic created using CircuitLab The time when the output is high is \$ T_H = \tau_1ln(1- \$ \$V_C\over 2Vdd - Vc \$) (it charges from \$V_C/2\$ to \$V_C\$) The time when the output is low is \$T_L = \tau_2 ln(2)\$ (it discharges from \$V_C\$ to \$V_C/2\$) frequency is f = \$1\over T_H + T_L\$ Where \$ \tau_1 = (R1 + R2)\cdot C\$ \$ \tau_2 = (R2) \cdot C\$ The above ignores propagation delays and saturation voltages, so it's more accurate for low frequencies, fairly high resistance values, and a CMOS 555. Here is an example plot with R1 = 1K, R2 = 10K, C = 10\$\mu\$F, Vcc = 10V and \$V_C\$ varied from 0.5V to 9.5V.
H: Floating EEPROM (28c64A) pins an option? I am building an eeprom programmer for the 28C64A (dip package) with my old basic stamp ii "homework" board (lost my arduino in the move). I have the first four address and data pins, as well as W E and G connected from P0 to P10. I am working with what I already have, so buying shift registers and friends is not an option. My question is that I read over the eeproms datasheet and it said nothing about leaving unconnected pins floating, so is it okay to do that, or must they be grounded? AI: Read the part about input current. Close to zero, right? It's a CMOS chip, so you must tie all the inputs to appropriate logic levels (high or low, depending on what you want).
H: How to connect 120V to a relay on a prototype board? I'm designing a microcontroller controlled switch. I idea is to have a 120V outlet controlled by time of day, or a motion sensor, etc. The plan is to have a lamp plugged into the outlet. I will switch the 120V with a relay, which I plan to have on the same board as everything else. Since I have the 120V anyway, I thought I would use a Recom AC/DC Converter to provide 5V. My questions are more mechanical than electrical, but important to the design: How do I get the 120V to the board? Can I use a lamp cord with a standard plug on one end, with the other end connected to a terminal block? Can I use a 2-conductor cord (i.e. no separate ground) ? If I use a terminal block, what gauge wire should I use to connect from the block to the realy? Let's say I decide to make a "real" board out of this...can I put 120V through traces? AI: Yes, you can. Research "creepage and clearance" to be sure you route the high voltage conductors properly. Yes, you don't need a third wire ground. If you are mounting this whole thing in a metal chassis a third wire ground would be a good idea. (Connect the ground wire directly to the metal chassis.) Depends on your maximum load. Search for AWG vs. load to see the appropriate recommended conductor for your lamp load. Yes, assuming you follow the creepage and clearance and insulation isolation rules, as well as sizing the traces for the amount of current. A fuse mounted somewhere in series with your AC line input would be a good idea as well.
H: Switching between several high power DC devices? I would like to control several high power DC devices (12V DC LEDs). From a tutorial, I found that I can control these using a 3.3V PWM input and a MOSFET. From what I understand, the MOSFET only allows current to flow through the LED to ground when the PWM input is high. I have several (lets say 4) of these LEDs and want to be able to select which one I am controlling. If I could activate the LEDs directly using the 3.3V PWM, then I would probably try to do something like this: Get a 2 to 4 bit decoder. Connect 2 output pins from the controlling device to the 2 select pins of the decoder. Get 4 AND gates. Using the AND gates, AND together each of the 4 outputs of the decoder with the single PWM output from the controlling device. Connect the outputs of the AND gates to the LEDs. I think this would work (please correct me if I'm wrong). If I got one MOSFET per LED, then this approach could still work with the higher power devices that I can't directly control. My two questions are: Does this approach make sense? Is there a way to accomplish this using only a single MOSFET? AI: You can skip step 3 if you get a decoder with an enable input, e.g. 74HC238. Connect the PWM output to the enable input and this will switch the decoded output on and off with the PWM signal. You will still need one sink per device you want to switch though.
H: Comparator won't flip to HIGH I am learning to use a comparator (LM393N) and running into trouble. No matter what I do, the output is always LOW. I am running off of a 9V battery, and I've added a voltage divider to send half of that to the V- (inverted) pin of the comparator. Yet, whether the non-inverted pin is connected directly to the positive rail (all the way HIGH) or to ground (all the way LOW), the Output pin always reads LOW (0V). What am I doing wrong? Here's a sketch of what I've set up where: Pin 4 is inverted pin Pin 5 is non-inverted pin Pin 3 is positive power source Pin 2 is output Pin 12 is ground Sorry for the weird pin numberings! I couldn't figure out how to change it in TinyCAD. AI: The device output is open collector. What this means it that it can either sink current (provide ground) or leave the output at a high impedance state (floating). You need to add a pull-up resistor from output to the positive supply to force a high voltage level in that floating state. The value of the pull-up depends on the needs of your circuit. The comparator can sink 6mA min so for 9v you can use a value of about 1.5k and higher. If the circuit connected to the output doesn't need much current or you just want to experiment you can use a value like 4k7 to 10k (about 1-2mA) simulate this circuit – Schematic created using CircuitLab
H: convert self-powered speakers to passive Is it possible to convert a self-powered speaker into a passive one? (and if yes, how?) My scenario: I have an old pair of PC speakers i'd like to use with my portable MP3 player even if there is no power outlet nearby... AI: Passive speakers like the Sony SRS-P7 are cheap headphone type speakers combined with acoustic amplification. A carefully designed sound channel amplifies the audio. Like cupping your hands to make your yelling louder, or sticking a cellphone in a bowl (I use a roll of blue painters tape, it really works well). There's a limit to what can be done based on the size of the enclosure. Active speakers on the other hand, are typically directly facing the outside. To modify an active speaker into a passive one, would need new speakers and some manufacturing of a sound channel (Using a router or plastic injection moulding or 3d printer, etc) The best thing you can do would replace the power and amplifier circuits with a battery powered one. And the speakers themselves will need to be resized. Essentially, the only thing you would keep is the audio cable and the case. Not practical or pragmatic. Hit a dollar store. Buy a portable mp3 player speaker case, or a set of passive speakers...
H: Basic operation of a bipolar junction transistor I've tried really hard to understand the basic operational principle of a transistor. I've referred to many books and been to forums but have never got a convincing answer. Here are the things I want to understand: A transistor is similar to a reverse biased diode unless a voltage is applied to the Base. Since the Emitter-Base junction is forward-biased, there will be conduction of - say - electrons (npn). What happens then? Is it true that these electrons from the Base break the barrier of the Collector-Base junction and then the combined current passes to the Emitter? (IB + IC = IE) And why is that we are getting more current? Where is amplification? It can't be like creating something out of nothing. I know I'm missing some crucial point here. Can somebody explain me clearly in simple terms? It has been a week I'm tryin to understand this. :( AI: When electrons flow through a forward-biased diode junction, such as the base-emitter junction of a transistor, it actually takes a non-zero amount of time for them to recombine with holes on the P side and be neutralized. In an NPN transistor, the P-type base region is constructed so as to be so narrow that most of the electrons actually pass all of the way through it before this recombination occurs. Once they reach the depletion region of the reverse-biased base-collector junction, which has a strong electrical field across it, they are quickly swept away from the base region altogether, creating the collector current. The total current through the base-emitter junction is controlled by the base-emitter voltage, which is independent of the collector voltage. This is described by the famous Ebers-Moll equation. If the collector is open-circuit, all of this current flows out the base connection. But as long as there's at least a small positive bias on the collector-base junction, most of the current is diverted to the collector and only a small fraction remains to flow out of the base. In a high-gain transistor, fewer than 1% of the electrons actually recombine in the base region, where they remain as the base-emitter current, which means that the collector current can be 100× or more the base current. This process is optimized through careful control of both the geometry of the three regions and the specific doping levels used in each of them. As long as the transistor is biased in this mode of operation, a tiny change in base-emitter voltage (and a correspondingly small change in base-emitter current) causes a much larger change in collector-emitter current. Depending on the external impedance connected to the collector, this can also cause a large change in collector voltage. The overall circuit exhibits power gain because the output power (ΔVC × ΔIC) is much greater than the input power (ΔVB × ΔIB). Depending on the specific circuit configuration, this power gain can be realized as either voltage gain, current gain, or a combination of both. Essentially the same thing happens in a PNP transistor, but now you have to think of the holes (the absence of an electron) as being the carrier of a positive charge that drifts all of the way through the N-type base to the collector.
H: H-Bridge ic not working as expected Hi I am using the SN754410 h-bridge driver to try to control a motor using two switches. As I understand the SN754410 should be identical to the L293D. I have hooked up a circuit and I think I have followed this tutorial correctly, however when I try to use it the motor will not work when I try to attach pins 2 or 7 to a 5 volt positive source the motor will not start. Even stranger when I try to attach one of those pins to the ground the motor starts in one direction, and when the other pin is attached to the ground the motor spins in the other direction. Can anyone explain this weird behavior to me. I understand that the problem is caused by floating inputs acting as a high and when one of the inputs is brought low the motor moves, but i do not understand how I would fix this problem, as suggested i have connected a diode between the input and ground, however the circuit still doesn't work. AI: The inputs need to be actively pulled-down for them to operate: - Notice the PNP transistor will not be turned on unless a current is taken from the base to GND. To be sure, if you are using switches, use 10k pull-up resistors (as indicated in the data sheet) and the switches should ground the inputs to activate them.
H: SMD Connector type? I am trying to find the connector type (see links below) for some time with out success. The pitch is 1.25mm. Also the "Shrouded Header WR-WTB" is really similar but the "key" is not in the center.Also the pins are closer to the pcb in my connector. http://imageshack.com/a/img534/2446/s66h.png http://imageshack.com/a/img200/3314/6oj2.png AI: If the pitch of the connector is 1.25mm, then it might be 1734261-4 from TE Connectivity. Please check the datasheet of the connector from the link.
H: Terminating a 50 Ohm source into 1M Ohm oscilloscope input Due to buying some equipment several months apart I am now faced with the task of connecting a high speed ,up to 1GHz, light detector that requires a 50\$\Omega\$ load impedance, but my oscilloscope only offers a 1M\$\Omega\$ input impedance. Can I connect via a tee piece and a 50\$\Omega\$ terminator? Are there other options to connect the detector to the oscilloscope? AI: If you don't have access to a \$50 \Omega\$ feedthrough terminator, a T-connector with a \$50 \Omega\$ termination should work just as well. This was standard practice at my old company when we used external hall-effect current probes with our \$1 M\Omega\$ scopes. (Aside: I personally prefer using external \$50 \Omega\$ terminators even if the scope supports \$50 \Omega\$: they're usually capable of handling more power, and if you accidentally hook up something incorrectly, at least you're blowing an inexpensive and easily-replaceable component vs. necessitating a potentially expensive scope repair!)
H: What to plug in first to usb charger when charging: wall outlet or cell phone and why? I asked this question on Physics StackExchange but was advised to ask it here. When I charge me cell phone or notebook or whatever device what should I plug in first? Should I at first plug in usb charger to the AC wall outlet and only then to the cell phone or vice versa? What are the precise physical arguments for this? And are there any differencies at all? I think it is safer to plug in wall outlet first because of peak charge. Can someone give me a technical explanation? Thanks in advance. AI: Such chargers1 are (at least, supposed to be) basically just constant-voltage supplies, i.e. whenever connected to AC power they should offer the specified voltage, no matter if a device is already connected. For a modern switching power supply, there's quite a lot of circuitry included that makes sure this goal is met pretty reliably, so indeed you don't need to worry about anything here. But older power supplies are often built much simpler: occasionally, these would consist only of a transformer and a roughly smoothened rectifier. simulate this circuit – Schematic created using CircuitLab When connected to a device while not on AC, nothing much happens at all (a simple diode can make sure no current is "draining back" from the batteries), so we shouldn't worry about that. However, the other case, connected to AC but not to any device, is not so uncritical. The thing about transformers is, they only work properly (in the sense of, providing a fixed ratio between the voltages on both sides) when there's a current in both windings. However, when running idle, the voltage in the secondary coil exceeds the nominal voltage. That's especially a concern because the smoothening capacitor will then charge up to that voltage, and if you connect a device at that instant it may suffer damage from the excess voltage. 1 Note that a properly designed actual battery charger is not a constant-voltage supply, but the part that controls this is nowadays build into the device rather than the power supply.
H: How to detect how much battery power is drawn? I'm programming a small device using a microcontroller. I'd like to optimize it to use less battery. How can I detect how much power uses over time as I run it through some tests? Based on the tests I can optimize the code to use less battery life. If I can't get an amount of power used over time, then what's the easiest way to see if the sleep is really working and if it is using any power at all? In laymen's (or at least programmer) terms please! I'm definitely heavier on the software side of things. At least what pins do I connect the voltage meter too. Sorry for noobiness. AI: I would measure current: Remove the red lead from the multimeter Set the multimeter to milliamps Plug the red lead into the milliamps socket Disconnect the power from VCC of the microcontroller (which may be multiple pins) Connect the multimeter probes in series with the power source and the VCC pin(s). If the sleep state is very low current I would turn the range switch to microamps range (if the meter has one).
H: Standing Wave Ratio(SWR) Measurement I'm trying to find a way to measure SWR digitally. Generally SWR is measured with analogue equipments and it is not practical on self designed PCB. I did not find so much resource on how to do it digital way. I have 10 Mhz hcmos oscillator which is filtered and converted to sine wave. The most simple idea which came to my mind was, connect PCB's sma output to also an ADC of uC in PCB design. I'm sure there should have been some more clever solutions. AI: To measure VSWR of a load accurately, you need to measure two things: The power outbound toward the load, and the reflected power returning from the load. The reason for measuring the outward going power is that many generators will change their output capability slightly, depending on the reflections coming back from the load. For example, in your setup, the filter that's converting your 10 MHz square wave to a sine wave is likely to change it's characteristics depending on the effective load impedance it is seeing. In order to measure the outward and inward-travelling signals separately, it's usual to use a directional coupler, or a combination of directional couplers. You can buy a reasonably-specified pcb-mount directional coupler from a company like Mini-Circuits, or, particularly since you are interested only in 10 MHz or a narrow range of frequencies around it, you may be able to construct one(PDF link) yourslef. Having separated the the forward and reverse signals, you should consider rectifying each one with an rf detector rather than sampling directly with a fast A/D. The detector will convert each signal to a "dc" level which can be sampled with a low-speed, low-cost A/D.
H: How do I use a button to wake up an atmega32? Sorry for any noobiness, I'm more of a software engineer. How do I use button interrupts in general? As in, if I put my microcontroller to sleep, I'd like a button to wake it up. How should I go about doing this? Edit Adding this to main, thanks to @jippie DDRD &= ~(1<<PIND2) PORTD |= 1<<PIND2 GICR |= ( 1 << INT0 ); // Enable INT0 MCUCR = (0<<ISC00)|(1<<ISC01); sei(); And this outside of main ISR(INT0_vect) { sleep_disable(); // If ISR got called while it was sleeping, this would work lcd.string("works"); }; ISR does work, but only if the device is not sleeping. FIXED Changing from INT0 to INT2 ( and moving from PIND2 to PINB2 ), it works... According to documentation, INT0 and INT1 use level interrupts but PINB uses edge... so.. that's maybe why? My voltage meter drops to .2 while in sleep mode, then wakes up from ISR. AI: \$\overline{\mathsf{RESET}}\$ A push button from \$\overline{\mathsf{RESET}}\$ to ground is the easiest way, but it forgets current state entirely. Interrupts For interrupts to work you need a pin that attributed as INTn and for ATmega32 you are limited to PB2, PD2 or PD3. Not all sleep modes support waking up by external interrupt and different sleep modes support edge or level triggered interrupts. For thes pins you have to: Enable the interrupt in the General Interrupt Control Register GICR; Review the Interrupt Sense Control bits in MCUCR and MCUCSR. You don't need to add an complete ISR (interrupt service routine) if all you want to do is wake up and continue where you left off, but you shouldn't rely on the default vector. It depends on the compiler what actually happens on a bad interrupt. Refer here for the name of the interrupt vector to use. ISR() { INT0_vect , EMPTY_INTERRUPT }; For details check the chapter titled 'External Interrupts' in the ATmega32 datasheet. For a button to ground on PD2 (INT0) code might look a bit like this (untested): DDRD &= ~ ( 1 << PD2 ); // Configure PD2 as input PORTB |= ( 1 << PD2 ); // Enable pull up resistor // MCUCR default triggers on LOW level. Changing to edge trigger requires different sleep mode to wake up. GICR |= ( 1 << INT0 ); // Enable INT0
H: ECG Shield electronic circuit explanation I have this electronic circuit which is from a shield for the Arduino which allows me to collect ECG signals. However I do not understand what is happening. I am familiar with op-amps and amplifiers in general but do not understand this circuit. There is a INA321EA (PDF) instrumentation amplifier and a OPA43040U (PDF), which I can find on the internet, however I would like an explanation of what is happening in the circuit so I can learn how each component works. https://i.stack.imgur.com/zXL2A.png AI: The first op amp sets up a reference at Vcc/2 for single supply operation. The resistors on the input limit current to the body and set up a body reference at or near the common mode voltage on the electrodes (using big noisy resistors). The instrumentation amp takes the differential signal, provides a gain of 5, and spits it out as a single-ended output, where the next op amp low-pass filters it, and then sends it to an inverting amp with a big gain (1M/3.3k) that also removes most of the DC offset prior to amplification.
H: Karnaugh Veitch diagram and ordering of the variables I have a little problem understanding the ordering of the variables at the axis. For example, at the lecture we did 4 variable Karnaugh Veitch diagram as a A 0 1 1 0 C 1 0 1 1 D 0 0 1 1 B On this site I found it like this(page 5) http://sus.ziti.uni-heidelberg.de/Lehre/DSTVorlesung1213/DST_Fischer_05_KMAPs.pdf A 0 0 1 1 D 1 0 1 1 c 0 1 1 1 B And examples here are also different. http://de.wikibooks.org/wiki/Karnaugh-Veitch-Diagramm:_Theorie_des_KV-Diagramms 0 represents logical not, 1 represents normal Can somebody explain or refer me to a website/book where I can find out, how to put variables on the right place at the axis. Thank you very much!!! AI: The lower K-map is wrong: A 0 0 1 1 D 1 0 1 1 c 0 1 1 1 B It can better be drawn as: A 0 0 1 1 0 _ _ _ _ 0 D 1 _ _ _ _ 0 1 _ _ _ _ 1 C 0 _ _ _ _ 1 0 1 1 0 B The goal is to have a unique combination of variables for each cell in the matrix. It doesn't really matter which variable goes where, as long as you get the distribution right. For both horizontal axis you can either use: (top) | (bottom) 0011 and 0110 or 1100 and 0110 or 0011 and 1001 or 1100 and 1001 or 0110 and 0011 or 1001 and 0011 or 0110 and 1100 or 1001 and 1100 As long as you carefully check which combination of variables is related to every single cell. Same goes for the vertical two axis.
H: Charge at 24v and discharge at 12v for battery system Is my thinking correct. Below is a simple diagram of the concept I want to check. Is this: 1: Possible 2: Feasible? I.E are there any concerns or foreseen issues with this design? Edit: AI: It will work fine as long as gray and brown wires are not present at the same time. The diodes are redundant, they don't fix anything - they will prevent a short-circuit present when both green and brown wires are attached, but the output won't be 12V. I don't see why you simply won't keep the 12V parallel connection of batteries and charge them from a 12V charger? Let's not forget that the ideal charging situation is when each battery cell is handled by an individual charger. In a 12V lead-acid battery there are 6 cells, each with 2.0V nominal voltage. Ideally, the cell-to-cell links would be exposed, and one would use a 7-wire connection to the battery for both charging and discharging (with a charge/discharge controller). This is the ideal scenario and maximizes battery life. This is how electric cars and professionally designed battery packs are made (in contrast to cheap junk). So, even the situation with a 12V battery used as a unit is less than ideal since there's 6 cells in series, without individual cell management. By connecting two of the batteries in series, you're making things even worse.
H: What is the difference between Timer0 and Timer2 in AVR I'm using ATmega32. This two timers looks very similar. What is a difference between them? When should I use Timer0, and when Timer2? AI: Timer2 is async timer. It means it can count when sleeping. But it's tricky to setup it when external clock is required. When external clock source is to be used a few pulses to setup it correctly is needed. I.e. it limits timer2 counter to be used as random pulse counter.
H: Coiled wire around connector terminal, what do I call this, and how do you do it? Please consider the following image: I randomly wandered into the telecom room at work a while ago, and I noticed these strange looking terminals. How do you terminate a wire like this? Is there a certain tool to create the coil around the terminal? What do I call this sort of terminal? AI: This is called Wire Wrap. The low resistance connection is made by cold-welding the wire to the pin at the corners of the pin. There is a special tool for making wire wrap connections. Here's a video about wire wrap. [Nothing special about it. This is the first one I've come across.]
H: At what resistance do I not see a voltage drop across a resistor? If I have a circuit like this and measure the voltage drop across the resistor I get a value, regardless of what resistor I use: However, if I stick a piece of wood in there instead of the resistor I get nothing. My intuition says there must be some resistance value between wood and conductor where the voltmeter switches from reading the voltage source to reading zero. Is that how this works? Is there some high resistance value where the voltmeter reads a fraction of the source voltage? Is my understanding of electronics terribly wrong? EDIT: I suspect the answer has to do with current and the voltmeter not being an ideal, infinite resistance machine, but I can't get from there to the answer. AI: If your voltmeter is digital, it has a least significant digit that will read zero until you overcome that threshold. It also has a finite input resistance, for example say 10 megOhms. So it's a simple voltage divider problem. The meter resistance/(wood or whatever resistance + the meter resistance) has to be greater than one least significant digit to cause the meter to read anything.
H: AC and DC voltage are constant even though the frequency changes In the circuit below, why does the AC voltage remain constant even though the frequency increases? AI: I can't see your circuit since the server in my university blocks the domain of the image hosting site, but based from your comment "I connected a my circuit to a function generator and oscilloscope. My circuit is also connected to two resistors," I am assuming that those are the only components in your circuit so I will base my answer on that. Resistor is a component that is NOT frequency dependent unlike capacitor \$X_{c} = \frac1{2pifC}\$ and inductor \$X_{L} = 2pifL\$. Following Ohm's law, \$V = IR\$, the voltage of the resistor will not change since \$X_{R} = R\$, in contrast with capacitor and inductor whose voltages will change over frequencies. But if your circuit is RLC, RL, or RC, the total voltage should change in varying frequencies.
H: How will I know the Power Efficiency of a load? I have a thevenin circuit with a source load. How will I get the Pin and Pout? AI: A Thevenin equivalent is a voltage source with a resistor in series like this: For power to flow you need a load which is Rl in this schematic. The load at which maximum power is transferred is when the load is the complex conjugate of the thevenin output impedance. If there are no reactive components, it is when the resistances of Rth and Rl are the same. Power dissipated in load = Vth^2 * ( Rl / (Rth * Rl)^2 ) These equations come courtesy of Bucknell University. Read more here
H: What are class E amplifier RF choke guidelines? I am designing a novel circuit that I beleive has not been constructed yet! No -- I'm just using an exotic switching device for a class E amplifier. My operating frequency is close to the 160 ham band (my target is between 1 and 2 megahertz). I have seen multiple designs for bands closer to 80 meters (a few megahertz) that use a 47 uH RF choke on the drain of a mosfet. I will be winding this inductor myself so I would like to optimize this value and determine its effect on the output matching circuit. I have an LCR meter and I am operating this amplifier at a bandwidth not exceeding 10kHz. Have a schematic (I see this is for 160m and has a larger inductor): Do I have to know my load impedance before selecting the RF choke or is that load independent? (as a side note I am using Cree SiC power mosfets because I have a source...) AI: I already implemented this topology in the past. I had the chance to collaborate directly with the inventor of the technology, Nathan O. Sokal, but fortunately you don't need to because references are available. The most useful document about this class E topology to design and tune our amplifier was the following paper: Class-E RF Power Amplifiers. It contains all the design equations required.
H: How to Calculate Appropriate R-2R D/A Converter Resistor Values? I am trying to make a 4-bit R-2R D/A Converter where a +5V signal on D3 would output -5V, a +5V on D2 would output -2.5V, etc. How would the resistor values for R/2R be calculated? AI: To a first approximation, the resistance R cancels out, however things are not so simple. One factor that needs to be considered is the performance of the switches. If they are CMOS outputs they will have a substantial resistance, it will be different between switches, it will be different for "high" vs. "low" and the resistance will vary with temperature. Take, for example, a CMOS buffer such as the CD4050. From the linked data sheet, we can see the output characteristics. Let's assume 10V (+/-5V operation). The sourcing resistance is about 220 ohms, and the sinking resistance about 55 ohms maximum. It will increase by perhaps 40-50% at 125°C from the 25°C values in the graphs. So, even if we reduce the 2R resistors by some average value of the switch resistance, there will be errors. If you want the error due to switch resistance to be much less than one LSB on your 4-bit DAC, you can calculate a minimum value for 2R. Say we choose something like 100K. The maximum value of R will be limited by input bias current of your amplifier and noise, and also by parasitic capacitance if you expect the DAC to have good high frequency performance. For example, an amplifier with 200nA of input bias current and with R=100K would have an output voltage error of \$ 2 R \cdot 0.2\mu A\$ or 40mV. That could be reduced in cases where the offset current is much less than the bias current by placing a matching resistor on the non-inverting input of \$ 2 \over 3 \$ \$ \cdot R \$ since the ladder has a constant impedance looking into the summing node of R. It's pretty easy to achieve sub-LSB errors with a 4-bit DAC, but the difficulty increases rapidly as the number of bits increases. simulate this circuit – Schematic created using CircuitLab
H: Should I use step-up or step-down transformer? I am designing a 21" tablet using a development board, the development board takes 5V DC whereas the display takes 12V DC. The display will take around 800mA and the development board around 500mA. I am wondering should I use a 12V adapter and Step-Down transformer to convert to 5V, or a 5V and Step-Up to convert to 12V? What is the standard technique? And how do you decided which to choose? Will the power consumption be same in both? AI: Since you mentioned transformers and \$12\$V adapters, I assume you are stuck in the old ways of linear power supplies, which typically only have a power efficiency of between \$50\$%-\$60\$% So if you go from \$120\$V AC at the wall to \$12\$VDC to \$5\$VDC there is a \$50\$% worst case power conversion loss at each stage. It won't matter if you step up or step down, you can assume that the up-conversion or down-conversion is equally efficient, and the losses are more from the linear regulators than anything else. In this day and age, you should really only be using switching power supplies, especially for digital electronics like a tablet. There are numerous designs available and numerous chipsets with efficiencies approaching \$98\$% these days. If you go the switching regulator route, then the path will be \$120\$VAC -> \$12\$VDC -> \$5\$VDC and you can expect \$80\$%-\$90\$% efficiencies at each stage. This is the path I would use if you were coming from the wall, because this is two buck regulators in series and a buck regulator is inherently more efficient than a boost regulator. This is because a buck regulator is either on or off, and in the on cycle it is delivering current to the load, and in the off cycle the inductor is doing it. However, a boost regulator first must deliver current to ground through the inductor to build up the inductor's magnetic field, then in the off cycle (and during the collapsing field) the inductor delivers current to the load. So the resistive losses of the inductor during the buildup phase of a boost regulator are wasteful (however, modern boost controllers go through extra hoops to minimize this wasted energy) However, if you are working off a battery source (you did say "tablet", so I assume portable), then your choice of buck vs boost is often directed by your source voltage available. If your source is a couple of lithium-polymer cells, then you only have a few volts to start with, and so you will need a battery -> boost \$5\$V -> boost \$12\$V configuration.
H: Effect of the high impedance or low impedance of oscillospe I am measuring a sine waveform range 0 to 40MHz by using Agilent InfiniVision DS0-X 3034A. The data sheet of the oscilloscope is here: http://cp.literature.agilent.com/litweb/pdf/5990-6619EN.pdf My question is when do we need to use low or high impedance setting of oscilloscope and why? I know that high impedance will give less distortion on the waveform, but why it will give less distortion? AI: Your point "I know high impedance give less distortion on the waveform" is not true. The high impedance mode adds a lot of capacitance to your circuit at the point of probing, and this excess capacitance certainly can and will distort your circuit, especially at high frequencies. You will need to consider this when deciding to use one input impedance or the other. In general, you will almost always want to use the high impedance mode of the scope, i.e. the \$1\mathrm{M} \Omega\$ input impedance when probing a circuit. You will use the \$50 \Omega\$ mode if you are connecting to an equivalent \$50 \Omega\$ ohm output impedance of a source, for example a signal generator with a \$50 \Omega\$ output or an RF signal generator with \$50 \Omega\$ characteristic output impedance, or a TX device under test that has a \$50 \Omega\$ output impedance. All transmitters operating in the GHz range will be \$50 \Omega\$ outputs. When using the \$50 \Omega\$ low impedance input mode, you will want to use a \$50 \Omega\$ coax too. You always want your source, line and load (the oscilloscope input) to be impedance matched to minimize reflections that will add or subtract from the true signal you are measuring. Most work with high-frequency will want to use the lower impedance, lower capacitance mode with a matched impedance signal chain. For very high frequency work, there are also so called Lo-Z (low impedance) probes that are nothing more than a short section of \$50 \Omega\$ high quality coax and a series resistor of 450 ohms, giving a x10 probe at \$50 \Omega\$. This type of probe input is used at very high frequencies, 1GHz or more with up to 10GHz bandwidth. The benefit of this type of \$50 \Omega\$ probe is that it has almost negligible capacitive loading of the device under test, compared to the \$1\mathrm{M} \Omega\$ which has between \$10\$pf-\$20\$pF of capacitance (up to \$100\$pf when you add the length of coax). A Lo-Z probe such as this adds a \$500 \Omega\$ load to the point where you attach the probe , so you need to be aware of the effect of that load on your circuit at that point. You always need to be aware of the impedance of your probe and the capacitive load that your probe places on the circuit where you attach it, and can your circuit handle it without causing loading problems and distortion. Only then will you be an oscilloscope Jedi.
H: What is the purpose of a filter consisting of a capacitor and two inductors? I have the following filter in a single device: It looks like a ceramic capacitor, but with 3 legs, and also states capacitance like such capacitor (only 103 printed). What is the typical purpose of such filter? How would it usually be connected? AI: It looks like a bulkhead feed-through capacitor with parasitic or intentional inductance: - If it is this type of component it is used for passing signals through bulkhead plates (inside enclosures) between circuits. It's usually classified as an EMC component. If it is a regular looking PCB component then it's still a filter that is intended (usually) to remove unwanted high frequency noise. The centre pin will usually be grounded and the two outer pins are for passing a signal in and out of a circuit. It's usually bi-directional.
H: Will RF cause any health problem? This is out of curiosity. I am working with rf 433 MHZ transmitter receiver module. I just wanted to ask whether it affects health in any way. I have read that such radiation has carcinogenitic effects. Does the power transmitted by the transmitter has any effect? AI: There are two actions through which electromagnetic radiation can cause health problems. If the radiation is ionising (ie has a high enough energy to liberate electrons from their atoms) then it has the potential to cause wide ranging unpleasant effects. Fortunately EM radiation is only ionising at frequencies somewhere in the far ultraviolet region - not an issue for RF applications. The other way that EM radiation can cause damage is through dielectric heating. This happens over a range of frequencies, and is the method that a home microwave uses to heat food. At the frequencies that you're dealing with, this is the only potential vector for health issues. Whether the RF radiation you're dealing with can cause health issues is completely down to the power levels that you're using. Most RF emitting devices you use in your home (WiFi router, garage door opener, hobbyist RF transceivers etc) only transmit a maximum of a few hundred milliwatts of power. A cell phone might transmit at 2W. Thanks to the inverse square law, the actual power of the transmission that can possibly interact with your body drops off with a square of the distance (and so very quickly). The efficiency of that RF in heating your body will also be considerably less than 100% (you could probably work this out using the heating equation given in 1). This all adds up to a very small amount of the transmission power actually being absorbed by your body. For reference, the body apparently generates about 1W/kg of heat while at rest, rising to 2-3W/kg while active. The very small amount of heat generated by the RF will be easily dissapated by your body's existing cooling system (you are incredibly effective at maintaining a stable temperature), and is dwarfed by the heat generated by muscle movement. So to summarise? If you're dealing with standard consumer RF transmitters, you're safe. If you've built an RF transmitter which could potentially broadcast at high power levels, then you could experience adverse effects. It's always worth noting when discussing this topic: 1. Humans have only been routinely carrying RF transmitters close to our bodies for a couple of decades. It may be that time shows us that this isn't a great idea, and 2. There's a lot of crazy people who will say a lot of stuff on this topic that is wrong. The kind of low power RF transmissions used for WiFi are exceedingly unlikely to have any effect at any distance. Every study I'm aware of has demonstrated in double blind tests that claimed "electromagnetic sensitivity" is entirely psychological.
H: Relay max current I'm building a magnetic stirrer. I wanted to add a heated bed and I've been looking at peltiers as a heat source. To control the temperature I've identified the "WH7016K", a Chinese-made temperature control system designed specifically for direct peltier control and it's only about 20 bucks. However, the data sheet for the device says the max load of the relay is 8A/30VDC or 2A/220VAC. If I'm using a 12VDC peltier is it safe to use one that draws 5A? Am I correct in assuming that the relay has a max load of 240 watts and the 60W load of a 12V/5A peltier should be fine? Manual for the device is available here, ‎but it is fairly sparse. It's also a word document so heads up if that rubs you the wrong way. AI: If the relay is rated at 8A/30VDC then it should be OK at lower DC voltages and lower DC currents such as 12V/5A. If in any doubt use an external relay triggered from the one in the controller.
H: Design semiconductor device like CCD I'm wondering if it is possible for an amateur (I have a physics background but not EE) to Learn how to design something like the CCD or cMOS or LCD Learn how to prepare the necessary files for the Fab (like TSMC) to produce my design What is the best way of learning these? Are there any good tutorials or examples I can follow, or what kind of courses should I take if I'm in a university? AI: Yes, it is possible. Yes, it is expensive. Most fabs will need the design on a mask, to get the data onto a mask you should provide it in an industry standard of GDSII or OASIS. TSMC will probably make a multi die wafer with your design being only one of ~200-4000 dies on the whole wafer. It will be manufactured with similar devices, sorted by die size and process. The software is out there, most is expensive, but there are other options. Klayout will allow you to draw the patterns, but testing the structures and making sure the device does what you want would be a huge test suite of software. The point being if you already know what to do for the design, using off the shelf freeware is ok, but there are a lot of complexities (hence huge corporations) to get everything right. The fab can help but they will charge you a lot. As far as courses- digital design, analog signal processing, device physics, signals and systems. Those are the starting point. After those courses you will have fairly good base knowledge to expand it to the exact things you want to know.
H: 3.3V signals to a shift register IC with a 5V supply I have an SN74HC595N shift register that I want to have output 5V on the Q outputs. If I power it with 5V on VCC, can I tie the SER, SRCLK, etc. pins directly to the 3.3V digital outputs on my microcontroller? I wasn't sure if I needed a transistor between each microcontroller pin, or if the lower voltage would be acceptable directly to the IC. AI: It is not guaranteed to work. You could use a level converter chip xx145, or you could use a 74HCT595, which will accept valid TTL levels at the inputs (and a 3.3V CMOS chip will give you that). Edit: The margins are fine for 3.3V input, as alexan_e mentioned. See below. Note that you should not connect any outputs form the HC595 or HCT595 directly to the 3.3V circuit. A simple single-transistor level shifter was discussed here: If you use a MOSFET you don't need the base resistor, so it can be even simpler.
H: RFID + permanent magnet A project I'm exploring requires placing a permanent magnet in close proximity to an RFID tag (within a cm or so). Can an RFID tag be read when there's a permanent EM field so close to it? AI: That really depends on your RFID technology and frequency range you are using. With LF (125/135 kHz) and HF (13.56 MHz) you will have problems (as they work inductive) due to core losses, i.e., eddy currents (the higher the frequency, the higher the losses) and hysteresis. You will have more problems with HF than LF. LF tags sometimes have ferrite cores to increase the inductance of the coil. With UHF tags you may have even advantages, depending on the distance (frequency dependent) and orientation between tag and magnet and the antenna design of the tag. However, there exist UHF tags particularly for use on metal.
H: Grounded thermocouple vs "grounded" thermocouple I'm having problems with documentation and what appears to be conflicting use of the word grounded. The way I understand it, a thermocouple can be [grounded, ungrounded, or unsheathed] (http://www.omega.com/techref/themointro.html). But neither of the two wires are actually connected to ground, they're still floating when they go into the thermocouple amplifier. However, I've been reading a lot about thermocouples and they talk about grounding them by connecting the T- side to ground through a 1M resistor. This is a completely different type of grounding to me (http://www.analog.com/library/analogdialogue/archives/44-10/thermocouple.pdf) I'm trying to use a Max31855 breakout board, and it specifically says it's not compatible with grounded thermocouples. So which grounding do they mean? I've not had either wire connected to ground (but I'm using a K-type grounded thermocouple), and occasionally a static shock when I touch it will reboot my Arduino and send out all kinds of garbage over the serial. AI: Omega's guide is focusing more on the thermocouple itself. Analog Devices' article focuses more on the sugnal conditioning for thermocouples. I'll explain what is implied by Grounded and Ungrounded in the Omega's guide. In the context of the Omega's guide, the thermocouples are a part of thermocouple assemblies or thermocouple probes. Ungrounded thermocouple. Thermocouple wires are not connected to the sheath of the thermocouple probe. Grounded thermocouple. Thermocouple is deliberately connected to the sheath to improve the response time. Here's an example of how a thermocouple probe can be used. It measures temperature of water in a tank. The tank and water are grounded. As a result, the sheath of the probe is grounded. If the thermocouple itself is connected to the probe sheath, then the thermocouple is grounded to the tank, no matter how you connect the thermocouple wires. If thermocouple wires are not connected to the sheath, you can connect the output ends as you see fit. related How To Avoid Grounding a Thermocouple
H: Max voltage input to microcontroller I have looked at the spec sheets of this chip and it states that MAX Voltage on any pin with respect to VSS (except VDD, MCLR. and RA4) = -0.3V to (VDD + 0.3V). They also state that MAX Input clamp current, IIK (VI < 0 or VI > VDD) ± 20 mA. Where I work our design actually has us bringing 20VDC to 30VDC to RA5 at < 1mA. Our boards work fine for the most part, we do have issues where there are weird offsets being written to the microcontrollers, I nee to figure out why. I am wondering if this 20VDC - 30VDC (at low current) to a pin would cause this. I've contacted MicroChip with this question and have had no luck. AI: The clamp current rating is a guarantee that the chip will not be damaged by latchup. It is not a guarantee of proper operation. You should not exceed the rails by more than a few hundred mV in normal operation. In particular, operation of ADCs and analog functions can easily be affected. If that is what you mean by offset (voltage rather than address offset) it could easily be your problem. What happens is that some of the clamp current spills over into other inputs and causes a current to flow into unrelated input pins.
H: Problem with relay current requirement and how to increase current in DC circuit? What is the minimum current required to run a relay of 5 V (part: RWH-SH-105D). Will the relay run with 5V DC and 0.8mA current (my inputs)? If it does not work, then please suggest methods to run the relay by giving suggestions on increasing current. AI: You seem to suggest that your control source has limited current drive ability (5v/0.8mA). If this is the case then using the suggested transistor circuits that require a few mA will be a problem. Consider using a Nmosfet connected as a low side switch. It requires a small current to charge the gate capacitance on transition (on/off) and no current for static operation (steady state). simulate this circuit – Schematic created using CircuitLab
H: Rail-to-rail oscillations in subtractor op amp circuit simulate this circuit – Schematic created using CircuitLab Just bumped into a problem. When I am trying to make a voltage subtractor based on AD8055 op Amplifier, I get rail-to-rail oscillations/noise one the output. The signal is 0.5sin + 1.5V at 1MHz. I wish to shift down the signal to 0.5sin + 0.5. Any ideas why I do not get a desired output? Edit: AI: This is a pretty fast op-amp. It's almost certainly due to layout or decoupling. Do you have ceramic decoupling caps right at the supply inputs to a ground plane? Is this on a PCB with short traces and a tight layout or is it on a breadboard? If it's the latter you might want to try a lower bandwidth op-amp. Since your differential gain is 1 but your noise gain is 2, you need an amplifer with a gain bandwidth of say 10MHz or so. (Assuming the 1MHz signal is the highest frequency you need to work with.) This is a 300MHz amplifier, which is probably making your life more difficult than it needs to be.
H: Does C-1602A-1YN LCD use the HD44780 controller? I am new to using PIC microcontrollers and electronics in general. I have been reading a tutorial on how to interface a PIC with a HD44780 compliant LCD. As I have been shopping for a LCD I have been finding it difficult to tell whether a LCD uses the HD44780 interface after reading its datasheet. The specific device in question is the C-1602A-1YN from Tinsharp. Please let me know whether this uses the interface, and where in the datasheet this information can be found. AI: The LCD uses (it's in the second page) Controller/driver: KS0066UP00CC/KS0065B KS0066 is Samsung equivalent of Hitachi HD44780.
H: Pocket AVR Programmer + PIC32MX Is it possible (and how) to program a PIC32MX chip with a pocket AVR programmer? AI: As delivered, no, because the AVR programmers are coded to assume the AVR SPI programming protocol, which is not compatible with the PIC programming protocol. If you had enough hardware hacking to change the pins around, and enough software development skills to build a new version of the firmware to talk the PIC protocol, and a programmer that had updateable firmware, then it would probably be possible to get from "here" to "there" with enough effort invested. The Wikipedia article on "in circuit serial programming" gives a brief overview of the differences: http://en.wikipedia.org/wiki/In-circuit_serial_programming My advice is: Get a PIC programmer. If money is tight, try eBay or another source of cheap-but-usually-working equipment; perhaps a local hacker swap meet.
H: Understanding max and min propagation delay in flip-flops I've been working my way through Digital Design and Computer Architecture, but am very confused by the equations for time delay - what each of the variables are, and how to conceptualize these equations. Assuming no clock skew, the book gives the following two formulae: $$t_{pd} \le T_c - (t_{pcq} + t_{setup})$$ $$t_{cd} \ge t_{hold} - t_{ccq}$$ What I understand so far is that contamination delay is the minimum amount of time that will pass before an inputted value will start to change, and the propagation delay is the maximum amount of time that will pass before the output is sure to be resolved. I also understand that the setup time is the amount of time before the rising edge of the clock that an input must have stabilized, and the hold time is the amount of time after the edge that we wait before we can be certain that the output is stable. Assuming this understanding and no further, can you please explain and help me conceptualize the two above equations? AI: The first equation tells you the maximum propagation delay allowable through a block of combinational logic between two clocked registers. For ideal flip-flops the delay would just be the clock period, \$T_C\$, but for real flip-flops you have to subtract the time from the clock edge until the inputs of the combinational block (the outputs of the first set of flip-flops) become stable, \$t_{PCQ}\$, and the required setup time (when the outputs of the combinational block must be stable before the clock edge on the second set of flip-flops), \$t_{setup}\$. The other side of the timing analysis is that the flip-flop inputs must remain stable for a short period of time after the clock edge to make sure that the inputs are properly latched. This characteristic of a flip-flop is called the hold time, \$t_{hold}\$. In order to satisfy the second flip-flop's hold time requirement, it is necessary that the clock-to-q contamination delay, \$t_{ccq}\$, plus the contamination delay of the combinational logic, \$t_{cd}\$, must be greater than the flip-flops hold time requirement. Rearranging the equation, you can specify the relationship between a characteristic of the combinational logic, \$t_{cd}\$, to the two characteristics of the flip-flops, \$t_{hold}\$ and \$t_{ccd}\$. In practice, you will have many combinational paths in a block of logic between two sets of registers. For the first equation you should use the largest propagation delay of any path, while for the second you should use the smallest contamination delay on any path.
H: Any good suggestions for Basys2 optional oscillator 50 MHz or 100 MHz? I want to get the optional stable oscillator for the Basys-2 but don't know which would be the best choice for 50 MHz and 100 MHz? Has anyone bought and used any? If so, what is the part number? AI: Basys 2 already has integrated LTC6905 oscillator (IC5) that can be controlled with a jumper (JP4). You can easily obtain 100MHz, 50MHz or 25MHz just by soldering the jumper, so I would just recommend doing this. This silicon oscillator is connected to input B8 of FPGA. For most applications it will be more flexible to just use the integrated oscillator. In a few special situations you might want to install the optional second oscillator. For example if the frequency you need is not easily obtainable by dividing the one from integrated oscillator, or when you need a signal of greater stability (LTC6905 is not very stable). Note that the second oscillator is connected to a separate input M6, so you can use both of them at the same time. The example part number for 50MHz oscillator would be ABRACON ACHL-50.000MHZ-EK. Of course the question what exact frequency you need depends on your application. You never explained what do you intend to do with your Basys 2 board.
H: 16x2 LCD not working with ATmega 8 Below program is written in AVR studio. Connections: PORTD pins 0 to 7 are connected to data lines of LCD i.e. DB0 to DB7 respectively, PORTB.1 connected to RS, PORTB.2 connected to R/W and PORTB.3 connected to EN of 16x2 LCD JHD 162A. In program PORTD.7 is checked whether it is busy or not. Characters do not seem to be displaying. Any suggestion or help would be greatly appreciated. #include<avr\io.h> void lcdcmd(unsigned char value); void lcddata(unsigned char value); void lcdready(); void MSDelay(unsigned int time); int main() { DDRD=0xFF; DDRB=0xFF; PORTB = 0x00; lcdcmd(0x38); lcdcmd(0x0E); lcdcmd(0x01); lcdcmd(0x06); lcdcmd(0x86); lcddata('M'); lcddata('D'); lcddata('E'); while(1); return 0; } void lcdcmd(unsigned char value) { lcdready(); PORTD=value; PORTB=PORTB & ~(0b00000010); // rs PORTB=PORTB & ~(0b00000100); // rw PORTB=PORTB & ~(0b00001000); // en MSDelay(1); PORTB=PORTB | 0b00001000; return; } void lcddata(unsigned char value) { lcdready(); PORTD=value; PORTB=PORTB & ~(0b00000010); // rs PORTB=PORTB & ~(0b00000100); // rw PORTB=PORTB & ~(0b00001000); // en MSDelay(1); PORTB=PORTB | 0b00001000; return; } void lcdready() { unsigned char temp; PORTD = 0x00; temp= PORTD | (1<<7); PORTD= temp; PORTB=PORTB & ~(0b00000010); // rs PORTB=PORTB | 0b00000100; // rw while(temp==1) { PORTB=PORTB & ~(0b00001000); // en MSDelay(1); PORTB=PORTB | 0b00001000; temp= PORTD & (1<<7); } return; } void MSDelay(unsigned int time) { unsigned int i,j; for(i=0;i<time;i++) for(j=0;j<1275;j++); } AI: As the datasheet for the HD44780U says, you can't check the busy flag until the controller is fully initialized. Use delays before sending 0x30 to the display three times, with durations of 15ms, 4.1ms, and 100us respectively. See the "Initializing by Instruction" section of the HD44780U datasheet for details.
H: Need to know battery configuration for a 250 watts inverter I have a 12 Volt inverter which have ability to produce 250 W output. I would like to purchase a battery for this. can any one tell me the configuration of battery ? eg: Minimum AH AI: Ball park figure calculation. Assuming an 80% efficiency Power in = 100/80 x power out power out will be 250W (maximum) then required power in will be about 313 watts By Ohm's law this gives a figure of 313/12 Amps i.e. 26Amps So if you need to run for 1 hour this would suggest you need a battery of at least 26 Amp hr rating.
H: Can Arduino power and hookup to logic chips? I am making a device that has two external interactions i.e. a button and a infrared sensor. My only problem is that I am using a logic chip for this because it would save me time coding on the Arduino, but now I don't know if the Arduino can cooperate or power the OR CMOS. I am a beginner in the logic and 555 timers field so every time I see them I try to ignore it. I have it now. Tried to draw a schematic and it just clicked. Thank you for trying to help. AI: I don't know if the arduino can cooperate or power the OR CMOS. There are many models of Arduino and many clone or compatible Arduino-like devices. An exact answer depends on exactly which you have. An Arduino typically has a 5V regulator and a 3.3V regulator and can be USB-powered (which may make a difference to the current it can supply). You can check the data sheets for the regulator used on your particular Arduino and make an allowance for the current used by the AVR microcontroller on the PCB. That gives you an idea how much remaining power can safely be drawn from the board for other devices. In general, yes, you can power a small number of CMOS logic ICs from the power pins on an Arduino. I'd keep an eye on the actual voltage and on regulator temperature. As Ignacio points out, you need to be aware of the difference betwen 3.3V and 5V signal levels and, if necessary provide for level conversion.
H: Is it safe for micro to switch pins from input to output in a loop? I'm trying to make use of a keypad that I took out of a phone which has 3 columns and 4 rows. I've traced out the schematic on its PCB and figured out a way to drive it that I think might work, but I'm not sure whether it's safe for the microcontroller (it's a teensy++ 2.0 in this case, but I think the answer would be the same for most AVR microcontrollers). The way the keypad works is that it has 3 pins out for column 1,2,3 and 4 pins out for rows 1,2,3,4 when you press a button to completes a circuit between the row and column that the button is in. So the circuit I designed would work like this: I have 3 output pins connected to the columns and 4 input pins connected to the rows. I would cycle through the columns putting a high signal and then reading the rows to see if any button was pressed. I realized one safety issue with this design which is that if you hold down two buttons on the same row, there would be a short between two different columns and since one was set to output high and the other output low that could create an overcurrent condition (like it described in http://www.ruggedcircuits.com/10-ways-to-destroy-an-arduino). To resolve that I had the idea to make the column output pins actually input pins when they're not being used to output a high signal - and adding pull down resistors to my row input pins. What this would mean though is that I'm flicking the pins between input and output mode in a loop that repeats every 15 ms (since I sleep for 5 ms between polling the columns). Is it safe/healthy for the microcontroller to switch its pins between input and output in a loop of about 15ms? or could this circuit be made safe in a different way? I would also really appreciate any links to pages that describe which basic circuits with input/output pins are safe and which aren't. AI: What you describe is the standard way of scanning a matrix keypad. Essentially you are using the outputs as open-collector / open-drain (because you switch between output+low and input). For chips that do not have this possibility a diode can be put in series. Switching a pin between input and output is totally safe and valid, it is done all the time, when a standard (push-pull type) pin is used to implement protocols like I2C and dallas/maxim 1-wire that need an open-collector output. Depending on the value of your pull-up resistors you might need to wait a little between switching to a new output and reading the inputs. A few ms would be a starting point. To suppress key bouncing it might be advisable to have the readings of a key no less than 50 ms apart. This can be used to derive your timing plan. You seemed to be a little worried about doing things as fast as a few ms apart. For a microcontroler running at a few MHz that is thousands of instructions apart!
H: Level-triggered flip-flops in shift register I am studying shift registers. My book mentions that level-triggered flip-flops cannot be used to make a serial-in serial-out shift register. What is the reason for this? AI: If you use level-triggered flip-flops (without a two-phase, non-overlapping clock) then all of the flip-flops will be transparent at the same time. The input to the first flip-flop will propagate all of the way to the output of the last flip-flop whenever the clock input is asserted. By the way, I think it is better to call a level-sensitive storage element a "latch".
H: What does this IGBT data sheet mean by "transient" gate voltage? I'm using IXGH45N120 to discharge some capacitors. The gate voltage is derived from the capacitor voltage, through some resistors and a zener. The circuit has worked fine for a long time, many hundreds of discharge cycles. We've recently had cause to look closer at it, and it appears the gate voltage is, at most, 23V when discharge starts. It drops to 20V within 150 mS. The data sheet says the max continuous gate voltage is 20V. Max transient gate voltage is 30V. I don't see any definition of what qualifies as "transient" gate voltage. I haven't heard any response from IXYS on the matter. Is there any way I can know if I'm operating within spec? Is 150 mS short enough to be "transient"? AI: Nooo... I would definitely not allow the gate voltage to approach that limit with 150 milliseconds duration. Here is an ON Semiconductor application note where they include a data sheet spec of the conditions. 5 microseconds and duty cycle (0.1%?). Note also the failure mechanism, which is partly thermal, so (as the lawyers say) time is of the essence. The voltage across the dielectric, between the gate and emitter can cause tunneling of carriers through the dielectric if it exceeds the leakage limit, especially where imperfections (traps) exist. This tunneling creates heat, which if allowed to continue for a sufficient period of time, can cause damage to the oxide which in turn creates more traps. This process can quickly increase to the point where significant damage occurs in the gate oxide. It should be apparent that at higher gate voltages it is necessary to limit the duration of the event to assure that the temperature rise due to the tunneling electrons does not exceed a safe level. If the oxide becomes hot enough to cause damage, that damage will be cumulative. This is why both the time and duty ratio of the transient event are included on the data sheet. Over a period of time this damage can cause the threshold to shift lower which may cause improper operation of the circuit or in extreme cases can cause a failure of the gate oxide. ON Semiconductor IGBTs are tested in qualification testing, at levels well above the transient voltage rating to assure that this is a safe transient level for the gate-to-emitter voltage. The DC rating is a very conservative gate voltage level and no tunneling or other degradation will occur at or below that operational level.
H: What reasons are there to avoid vertical through-hole resistors? I'm working on a layout for a PCB and I need to include a handful of pull-up resistors. The board I'm working on will be a proof of concept, and it is likely I will only need one (and order two). That being said, I'd like to keep the board area small. In addition, I'm using through-hole components to make any revisions easy. For these pull-up resistors, vertically mounting them would save some space and cost instead of alternatively mounting them horizontally. However, I rarely see vertically mounted resistors in commercial or industrial products. So, should I avoid using the vertical resistors even though they will save cost up front? Upon searching Google for an answer to my question, I came across these two links: http://www.head-fi.org/t/162556/any-reason-why-i-shouldnt-use-resistors-vertically http://www.proaudiodesignforum.com/forum/php/viewtopic.php?f=6&t=90 The consensus is that vertical resistors are less popular because: Auto-insertion machines can't (or don't prefer) vertical resistors. This isn't an issue for me since I'll be soldering the board myself. Horizontal mounting provides more stress relief. This is also no problem since my board will be safe in an enclosure that is only going to get light use to prove a concept. Are there any other reasons I am overlooking? Granted, most modern designs use SMT components that take up even less space. If the best answer to my particular situation is to just break down and learn to solder the SMT components, I would still like the background knowledge as to why the horizontal resistors are more popular. AI: Mounting a resistor vertically creates a bigger loop that can pick-up interference magnetically. Compare this with a resistor being mounted on the PCB flat against a flooded ground-plane. The voltage pick-up level is proportional to frequency and area of loop formed by the resistor. This is why surface-mount resistors are preferred a lot of the time. Also, A high value resistor mounted vertically is also asking for trouble in the presence of HF electric fields - what you can create is a mini-antenna. As for pull-ups and downs, surely you won't be swapping these out in your prototype - I'd consider using surface mount devices for these parts.
H: It is it possible to safely use a 110V variac (variable transformer) at 230V? I've come across a variable transformer/variac which is designed to be used with 110V input. Our line supply here is 230V. If I was careful not to exceed the VA rating of the transformer (920VA) would it be possible to safely use this with a 230V input? (I'd expect the output voltage to be twice of course, and I suppose replace the fuses with 1/2 current equivalents) It's something like this: AI: No, the core will saturate and (if you're lucky) blow a fuse. If your 230VAC happens to be (say) 400Hz, the answer might be different. Wikipedia has a very nice animated image showing the effect of too low frequency. Too high voltage has the same effect. The value of (maximum primary voltage)/frequency is a constant for a given transformer design). As you can see, the magnetizing current spikes up twice per cycle and the resistive heating losses increase with the current squared.
H: MOSFET discharge (turn off) I am using the IRF9321 P channel MOSFET for controlling my BLDC motor. The MOSFET is driven via a transistor which in turn is run by a freescale controller(3.3V pin). Now, when turning it on, it works fine. But, when turning it off its a disaster with the MOSFET taking almost 5ms to come to '0' Volts. My circuit is shown below. I have been through the datasheet and it says turn off delay time is 180nSecs (approx .1uSecs). Am I missing something? AI: I presume you mean 5usec, not 5msec. If it is really 5msec, disregard the below and check for a bad (open) resistor, or perhaps one that is 270K not 270 ohms. That's not far off what you'd expect discharging the gate charge, which could be relatively large (tens of nanocoulombs) with a 270 ohm resistor. The MOSFET will only switch in 180nsec if you actually change the gate-to-source voltage fast. To get it to switch quickly, you could use a gate driver capable of amperes of current such as the MCP1406/1407 which will quickly discharge the gate charge.
H: Design of a 1-bit adder-subtractor with additional carry/borrow input I have to design a 1-bit binary adder/subtractor unit that can both add or subtract two input values A and B depending on a control input C (it is assumed that two's complement is used). Also, the adder/subtractor has an additional input \$C_{in}\$ for a previous borrow or carry. When subtraction is to be performed and the borrow input is 1, an additional subtraction of 1 is to be done. There are two outputs, one for the borrow/carry and one for the sum. How would the corresponding circuit look like? I thought that (because in two's complement \$ A - B = A + (\bar{B} + 1)\$), \$ A - B - C_{in} = A + \bar{B} + 1 - C_{in} = A + \bar{B} + \overline{C_{in}} \$ So is it correct that when doing subtraction, all I have to do is invert B and \$C_{in}\$ and feed these inverted values to the inputs of a normal full adder? Also, how would I construct a 4-bit adder/subtractor from those single 1 bit adder-subtractor cells? AI: The standard adder / subtract circuit is given by the figure below.For an explanation of how it works please see my previous answer here : Subtraction using adder circuit Now notice that if you were to change the input that is tied to '0' to Cin, then the circuit would now perform the operation: A + ~B + (Cin ^ SUB), meaning that: 1) it would be a normal Adder/Subtract circuit when Cin is 0. 2) if Cin = 1 and Sub = 1 it would evaluate to: A + ~B + (1 ^ 1) = A + ~B = A + ~B + 1 - 1 = A + (~B + 1) - 1 = A - B - 1 , This means that the normal Add/Sub circuit can achieve the operation you require, all you need to do is change the input tied to '0' your Cin. You could also design the desired circuit by using the usual method of writing all your possible inputs into a truth table, then deriving the Boolean equations for them, then simplifying them to get your final circuit equation.
H: Supply noise due to Motor I'm currently trying to install some IR sensors on an Arduino robot and am having issues with the sensor readings anytime the motors (2 of them) turn on. I'm using an Arduino Uno connected to an Arduino Motor Shield. The IR sensors are Vishay IR detector modules powered from the regulated supply rail (5V) on the Arduino. Anytime the motors are powered off, everything works just fine; that is when it detects IR the output of the sensor goes to GND. But as soon as the motors turn on, the output keeps dropping to GND regardless. I used an oscilloscope to confirm that indeed there is high frequency (~10 MHz) noise. I'm assuming this is noise introduced into the supply by the motor/Motor Shield PWM control signal? But isn't the whole point of a regulated 5V supply to provide a stable voltage? I even tried connecting the sensors straight to the Battery (3300 MAh NiMh cells, so current draw isn't a problem) and it made no difference. I've also tried putting capacitors across the motor terminals, across the IR sensor Vin and GND, and also tried them across the Output and GND. No dice. So are the motors actually causing ripples on the Battery voltage? Any insights? EDIT: This is the IR detector: http://www.pololu.com/file/0J19/TSOP34156.pdf AI: I'm fishing around a bit and this graph is what I found. It tells you that the sensitivity of the device optically can be significantly changed in the presence of quite small variations of noise on the power line feeding it and this could be magnetically coupled or just a high-frequency loading effect the motor has on the battery which in turn gets dumped onto the sensor via its power wires: - The graph tells me that as the "ripple" voltage on the power supply wires gets higher in frequency, the "effect" it can have becomes more dominant. Shown are ripple disturbances of 1kHz and 10kHz and I can envisage a scenario of 10 mV at 100 kHz having an effect. Even higher in frequency, I would say 1MHz at 1mV is likely to cause problems. On this basis I'd consider having a local voltage regulator on the device just so the device power supply is kept as clean as possible. I don't know how long the cables are feeding the sensors but maybe if they could be shortened this might help too. The capacitors you may have tried should not be electrolytic but rather they should be ceramic 100nF types. I'm aware that my answer may be missing the real problem but I'm just reporting worries on reading the data sheet.
H: Not getting input on STK600 with ATmega8515 I recently had a written exam for a class and one of the questions was to write a program for the ATmega8515. I wrote down this: #include <avr/io.h> #define F_CPU 4000000UL #include <util/delay.h> #define Delay 5000 int main(void){ DDRB = 0xFF; //set to output DDRA = 0x00; //set to input PORTB = 0xFF; //turn off all LEDs while(1) { if (PINA == 0b11111100){ //if SW0 and SW1 are pressed for(uint8_t i = 7; i<=0; i--){ PORTB &= ~(1<<i); //Turn on led at location i _delay_ms(Delay); //Delay PORTB |= (1<<i); //Turn off led at location i _delay_ms(Delay); //Delay } } else if(PINA == 0b11111110){ for(uint8_t i=0; i>=7; i++){ PORTB &= ~(1<<i); _delay_ms(Delay); PORTB |= (1<<i); _delay_ms(Delay); } } else if(PINA == 0b11111101){ for(uint8_t i = 7; i<=0; i--){ PORTB &= ~(1<<i); _delay_ms(Delay); PORTB |= (1<<i); _delay_ms(Delay); } for(uint8_t i=0; i>7; i++){ PORTB &= ~(1<<i); _delay_ms(Delay); PORTB |= (1<<i); _delay_ms(Delay); } } else{} } } For some reason this does not work. The expected outcome is that if the first two switches are pressed (SW0 & SW1), it'll scroll the leds from left to right. if the first switch is pressed (SW0), the LEDs will scroll from right to left. And if the second switch is pressed (SW1), the leds will scroll from left to right going back and forth forever As of now, I know the for loops work, I've tested them in other programs. It just seems like I'm not getting and input from the switches. AI: Your code expects three possible states for PORTA inputs, PINA == 0b11111100 or PINA == 0b11111110 or PINA == 0b11111101. You want to check only PINA.0 and PINA.1 but instead you also check the rest of the bits in the port (b7:b2). This would only work if you have enabled all the internal pull-ups of the port (unless you have connected eight external pull-ups which I doubt) PORTA = 0xff; // enables internal pull-ups for all bits A better solution, just check the state of the two pins which are actually connected to the buttons, discarding the result for the rest of the port bits. DDRA = 0x00; //set to input PORTA = 0x03; // enable internal pull-ups for PORTA.0 and PORTA.1 if((PINA & 0b00000011) == 0b00000000) // check if both button are pressed { } else if((PINA & 0b00000011) == 0b00000010) // check if button in PORTA.0 is pressed { } else if((PINA & 0b00000011) == 0b00000001) // check if button in PORTA.1 is pressed { }
H: Charging of Cell Phone Batteries and Electricity! Does charging an already charged battery of cell phones/laptops consume electricity? Whenever my cell phone becomes fully charged while charging, it asks me to remove the charger from the socket to save energy. I was wondering why would a charged battery consume energy/electricity from the socket? NOTE: My phone is a Nokia 7210 Supernova (old model, I know!) AI: The charger has to have some "housekeeping" circuitry active in order to detect that the phone is attached and react to the state of charge of the battery. Some of the best will go to sleep and periodically wake up to check to see if there's a device that needs charging attached. So it's not delivering charge to the battery, but it is using power to keep some of the circuitry alive. There are also parasitic and efficiency losses in the circuitry that converts the AC voltage to the DC housekeeping supplies.
H: Do servo motor specifications take into account the gear ratio inside? I know this question may not belong here but I assume this is most likely where the most well informed people can help me. I am looking at buying a servo motor for a an application that must be able to lift 4-5 lb at a rotational speed of approximately 1rpm. The servo motor listed here http://www.robotshop.com/ca/en/hitec-hs755mg-servo.html states a stalling torque of 200 oz-in. Is this torque rating at the horn of the servo motor or the torque rating of the actual motor before any gear reduction is done? Is this motor sufficiently strong for my application? AI: In general, for a motor with integrated gearbox, specifications in the data sheet are "at the shaft" which is the shaft that comes out of the gearbox. In the case of hobby RC servos, like the one you're linking to, it is always the case that the torque takes into account the gear reduction (because it's a bigger number, thus better marketing.) When you say "lift 4-5 lbs" you do not specify the distance of the lever arm. For a winch that winds a cable, that arm is the distance from center-of-horn to outermost-layer-of-cable. If you attach an arm, it's distance from center of servo horn to center of weight, projected to the ground plane. You also don't specify how far you need to lift the load. And you should know that most motors (and certainly all cheaper, hobby-style servos) are specified in maximum "stall" torque, which is not a level of performance they can provide on a continuous cycle. If you stall the motor for more than a few seconds, you are likely to burn it out. The "holding torque" or "continuous torque" is typically 0.3 to 0.15 times the stall torque, depending on motor construction, cooling, etc. This important data isn't even generally available for hobby servos, but is often specified for industrial automation components. Also note that that servo likely has, at most, a 180 degree rotation angle. A better Stack Exchange to ask this question on might be the Robotics Stack Exchange. I don't know how to go about moving questions/answers, though.
H: Find product lead dimensions I am building a project for a robot on breadboard, and I have come across the need for a voltage regulator. I have an existing voltage regulator, but it will not fit into the holes on my breadboard. As a result I have begun to look for a new voltage regulator that will fit into my breadboard. I ran into this voltage regulator with the datasheet here https://www.jameco.com/Jameco/Products/ProdDS/902071.pdf, and in the datasheet it seems to say that the lead width is 0.69 - 0.94. I don't understand why the width of the lead would change and is displayed as a range and which part of the range to count as the lead width. My breadboard only accepts wires between 20-28 AWG. I was wondering if the regulator would fit well into the breadboard without being forced. AI: The lead widths are merely specified as a range on the datasheet, for various reasons ranging from simple tolerances to manufacturing process changes. Voltage regulators are also notorious for having rectangular (instead of round or square leads) that are wider than breadboard holes will allow. When I need to use a voltage regulator on a breadboard but it won't insert, I usually solder some small jumper wires onto it similar to how I would use a panel-mount potentiometer: The leads can then be inserted in the breadboard easily. However, with a voltage regulator, you need to be careful that it has proper air circulation and/or heatsink.
H: How do I increase (multiply) the value of a current sink? I have been shown an IC that is a current sink PWM dimmable LED regulator. It happens to be a WS2811. While this works well for low drive currents (up to about 20mA), I was approached with the idea of making it drive power LEDs (~1 amp @ 3 volts). I immediately thought of using a PNP transistor in this configuration: simulate this circuit – Schematic created using CircuitLab While it does demonstrate power gain, the efficiency is terrible! We would like to make this solution use as few components as possible. Since this is not an opinion-based site, please illustrate examples of highly efficient methods of "multiplying" current sinks, say by a factor of 100. The major constraint is component count. AI: Your circuit has another issue, if you were to try to build more than one of them you would find that the LED current would vary dramatically from unit to unit. That's because the beta of a 2N3906 (or most transistors for that matter) varies widely. Your requirements are somewhat contradictory. To get efficiency you need a switching current regulator, which necessarily has a controller, an inductor and at least a few other parts. One example is here: http://www.ti.com/lit/ds/symlink/lm3434.pdf You can find other solutions (and depending on how much current you really want some more highly integrated solutions) by searching the TI website or many other semiconductor manufacturers.
H: I need to use some sort of component to boil water inside of a container that will be triggered by an arduino signal. How? I'm trying to build a prototype for my own coffee machine. It'll have a container of water that will need to be boiled when a signal is sent by my arduino. The question is, what component should I use to handle this? This is for a hackathon this upcoming weekend, so I don't mind it looking incredibly terrible. Some have recommended that I simply run a kettle through a relay controlled by an arduino, but my problem with that is I need the water to be inside a container that I'll be making, as it will need to be connected to some sort of stand. I was thinking I could take the kettle apart and isolate its heating element. Would this be ideal, or is there some component out there that will handle this? Any suggestions and/or advice would be very much appreciated. EDIT: An idea - What if I just connected a fully assembled kettle to a fuse, and used some sort of "pump" to retrieve the water in it? rather than creating my own container with a heating element that I would be able to drain with by opening a flap at the bottom. AI: You should confine yourself to materials that are safe for contact with potable water, which rules out a bunch of possibilities. One idea might be to cannibalize a rice cooker- they have a heater below the rice bowl and a spring-loaded thermostat. I've seen them as cheap as $8 at discount stores, but $15 might be more typical. They are designed to shut off when the liquid is gone and the temperature rises. Perhaps you could substitute your own (open) container for the rice bowl. I do hope you're not planning to make a homemade pressurized boiler. If so, I will have nothing to do with it, and you should check your local laws and regulations about what kind of testing and approvals may be necessary.
H: How can I model a variable current sink in spice? For a project I am working on (related question here) I need to model a nonideal variable current sink in spice. Simply reversing the orientation of a current source or inverting its value is not sufficient because it is still sourcing current, just in another direction. I am fairly certain there is a 'trick' using some built in components to simulate a variable resistance since as far as I understand, that may be the most accurate model for this component. AI: If you want a current sink that can't drive a node below ground, just add an ideal diode as a voltage clamp. simulate this circuit – Schematic created using CircuitLab
H: Circuit abbreviation: GND, MIN, TRANS, etc? I am originally a programmer, so I am not quite experienced in circuit symbol and abbreviation. I receive a custom made 2-in-1 Light photo diode receiver + Current-to-Voltage converter from my professor and I'll have to write microcontroller program to receive data from light. However, there's 6 pins, and I don't know what to plug into those 6 pins. There are some notes written: 4.5V, GND, OUT, MIN, DIFF, TRANS. I only know that I should plug in 4.5V supply, Ground, and Output. I have absolutely no idea about the other three abbreviation (MIN, DIFF, TRANS). Unfortunately, my professor isn't available during this week, so I am on my own. Can you help identify what are those pins for? Diagram: https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn1/t1/q77/s720x720/1925344_10152043333083095_442508481_n.jpg Actual Circuit: https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-ash3/t1/p296x100/1977361_10152043333208095_1265265624_n.jpg AI: A nice guide for abbreviations used in electronics you can find here Includes some of the appendix A of ANSI/IEEE Std. 991-1986 which is the standard
H: Get location data for a program using GPS dongle I'm working on vehicle tracking system using GPS. What I want to do is connect GPS receiver to my laptop and fetch the location data in to my program. I have seen many commercial GPS receivers and dongles. Those devices providing there own driver software. Is there any way to fetch those location data in to my program using those devices. Thanks in advance AI: Most GPS receivers output data in a serial format called "NMEA-0183" - it is readable ASCII text, normally sent at 4800 baud. If the receiver has a USB port, it will normally appear as a normal serial port, so you should not need any special drivers. If the receiver has an NMEA-0183 or RS-232 output, you will probably need an RS-232 to USB converter. Again, the computer should already have the necessary drivers. Offically, NMEA-0183 should use differential signalling, and 0 - 5 volts, but most RS-232 serial ports should be able to receive the data correctly, using only one of the NMEA-0183 wires. Your program will just have to read the data from a serial port.
H: Making an Android accessory that supplies more current to Android Tablet I'm making an android accessory that uses a PIC microcontroller and a FTDI FT312D chip to poll a bunch of sensors and then report the findings back to a nexus 7 tablet. Although I am using a 4A power supply, the tablet is not getting enough current to charge and is instead discharging. Ive been reading up on Android Accessorys and USB specs but havnt found a way to enable a higher current draw. AI: So you are making an accessory, and through this accessory you also want to charge your Nexus 7, if this is the case, You are feeding 5V through your USB VBUS line. Now Charging the battery over a USB connectors isn't plain simple like just applying 5V and the Tablet will charge. There is some handshake going on on the D+/D- line, just some simple voltage levels. Since your are using an FTDI on the USB line this will probably block the charging negotiation. What you could do is place a IC between your USB connector and your FTDI that will do the negotiation (I know there are some that will detect which kind of charger is applied but I don't know for sure if there are charger IC's) and will get the tablet to draw more current. Here is an App note from Maxim that will go into more detail: http://www.maximintegrated.com/app-notes/index.mvp/id/4803 Hope this helps a bit ;-)