text
stringlengths
83
79.5k
H: Converting old organ keyboard to MIDI I have a very old keyboard, a CASIO MA-100 that I want to convert to a MIDI keyboard: Being a programmer and a digital electronics enthusiast, I know how to do it, but I could use some help to save time. I guess the biggest issue is choosing a µC. Something with a USB interface* would be great, something that can also be powered by USB, even better. Then there's the issue of talking MIDI or MIDI-over-USB. I don't know how hard they would be, but I could probably do with some already written code there, too. (Unless they're very simple and don't need much testing.) I looked around some electronics project sites this morning, trying to find some open source MIDI or MIDI-over-USB controller firmware, but couldn't. I did find some Arduino projects, but a prototyping board seems a bit overkill for such a simple project. The key matrix is 10x8 (10 select in * 8 data out), simple boolean logic, no velocity data. (Though two select lines are easily expendable.) So I guess my simplest option would be a ~1 MHz µC with 8 input, 8 output pins and a serial buffer (+I/O pins) for MIDI. My best would be a project called "USB MIDI device firmware for Make SeriesXX microcontrollers." Any ideas? *: An easy USB interface, i.e. not PIC18. (Edit: This was a simple prejudice arising from the state of the organisation and documentation of the PIC USB framework a few years back. I guess it's time to break it.) AI: Sounds like a PIC 18F2550 is just the thing, or maybe a 18F4550 if the extra I/O lines are needed. I don't know why you say a PIC 18 is not easy. You say you are a programmer, so I don't see what you're afraid of. Perhaps nobody has done a MIDI USB interface ready for you to add the keyboard scanning code to, but certainly there are various examples of the basic USB driver out there. Microchip has some code, and so do I. My 18F USB firmware is available from the downloads page, and fits into our PIC development environment. I've never done a MIDI device, but I sortof vaguely remember there is a USB class standard for that. If so, then it's really easy since you don't have to write a host driver and it will work with any OS that implements that USB class. All you have to do is look at the class definition, fill in the right enumeration data in the include file for that purpose, then send/receive data over the appropriate endpoints according to the standard. Any other microcontroller will require something similar. Again, short of finding free USB MIDI firmware out there (which you say you can't find), you need to do pretty much what I said above regardless of what flavor microcontroller you use. USB is USB, so all the USB device peripherals in microcontrollers do pretty much the same thing with only a few details different.
H: Microcontroller with ADC and capable of SPI communication I am designing a system where Analog Signal ---> (ADC- Digital Data )---> UWB chip mostly WSR601 or AL6301/AL5100 Chipset Note (1): UWB is an abbrieviation for Ultra Wide Band wireless communication technology. Wireless USB chips which are being used here make use of this technology. So, in short the data is transmitted at 5 Mbps to the UWB (wireless usb) chips using SPI or USB 2.0. These wireless chips then transmit data to the receiver. Note (2): The data sampled through the ADC just directly needs to be passed on to the UWB chip through whatever interface (USB , SPI etc). Data does not need to be processed in any manner. I am looking for a microcontroller to perform the function of ADC and interface with the UWB chip. Both (WSR601 and AL6301/AL5100) support various options like USB 2.0 , SPI, SDIO 2.0 , UART etc. 1) The ADC that I need is 10 bit and the data rate resulting from that which I need to transmit to the UWB chip is around 5 Mb/sec. ADC sampling rate required would be around 5 * 10^5 times per second. 2) It needs to be as low power as possible 3) Would SPI be the best choice for this considering the data rate and the low power or do you think some other communication interface would be better? 4) Any uC suggestions having sufficient processing power for the ADC and SPI to work simultaneously? I was suggested PIC32MX250F128D by someone who claimed that it consumes 14.5mA at 40MHz, 3.3V. But again this uC has a LOT of interfacing options available which I think is unnecessary and also this uC doesn't seem to be available on the microchip website. So I hope someone can suggest uC with a little lesser functionality and hopefully lower power consumption than one under consideration. AI: I don't know what you mean by "UWB" (use standard or common abbreviations, no I'm not going to look it up, it's your job to explain), but many many micros have 10 bit A/Ds and SPI hardware. Even without the SPI hardware, SPI is simple to do in firmware by controlling the I/O lines directly. In the Microchip line, there is a wide spectrum that meet these requirements. A low end PIC 16 can be small, cheap, and very low power. A fast dsPIC33 can run up to 40 MIPS but of course will use more power. There are various PIC 18 and PIC 24 in between. What you need to explain is how fast you need to sample the 10 bit A/D and what the micro needs to do to these 10 bit values before passing them on via SPI. This "answer" is more of a comment because too much important information is lacking. It can be turned into a answer if you cooperate and answer the specific questions asked, not what you feel like answering or or you think is important. As it stands, this question is too vague to be reasonably answered and should be closed. People will come by and close it as they encounter it. When 5 close votes are cast, it's over. The clock is ticking. You may have only minutes to a few hours. Do what I said exactly as I said quickly and you may get your answer. Ignore it and not cooperate and you'll be sent home without a cookie. Added: You have now added that the A/D sample rate is 500 kHz and that this raw A/D data is to be passed on via SPI. Since the A/D is 10 bits, this is apparently where you got the 5 Mb/s SPI data requirement from. This is doable, but will require a reasonably high end micro. The limiting factor is the 10 bit A/D at 500 kHz sample rate. That's quite fast for a micro, so that limits the available options. Another thing to consider is that there is more to SPI than just sending the bits. Bytes may need to be transferred in chunks with chip select asserted and de-asserted per chunk. For example, how will this 10 bit data be packed into 8 bit bytes, or will it at all? The main operating loop of the firmware will be quite simple. You probably set up the A/D to do automatic periodic conversions and interrupt every 2µs with a new value. Now you've got most of 2µs to send it out the SPI. If the device really can just accept a stream of bits, then it might be easier to do the SPI in firmware. Most SPI hardware wants to send 8 or 16 bits at a time. You'd have to buffer bits and send a 16 bit word 5 out of every 8 interrupts. It might be easier to just send 10 bits each interrupt in firmware. Sending SPI bits in firmware if you only need to control clock and data out is pretty easy. Per bit, you have to: Write bit value to data line. Raise clock Lower clock It would make sense to unroll this loop with preprocessor logic or something. A PIC 24H can run at up to 40 MIPS, so you have 80 instructions per interrupt. Obviously you can't use 8 instructions to send each bit. If you can do it in 6 it should work. There is some overhead to get into and out of each interrupt, so you might make the whole thing a polling loop waiting for the A/D, but then the processor can't do anything else. I'd probably try to cram this into the A/D interrupt routine using every possible trick so that at least a few forground cycles are left over for background tasks like knowing when to stop, etc. Check out the Microchip PIC 24H line. I think most if not all have A/Ds that can do 500 kbit/s, and they can all run at least up to 40 MIPS. The new E series is even faster, but I'm not sure how real that is yet.
H: FSM Using Excitation Equations and VHDL I have been trying to create a FSM using the excitation equations I developed. I have not had much luck. The circuit has no output. I DO NOT WANT TO USE 'TYPE' and custom state types. That is the easy way out. Please don't tell me that's what you would do! Its probably what I would do too. I am trying to force myself to learn new methods. Below you will find my process for the sequence "2314". I set up my DE2 so the push buttons were each assigned a number, ie X(0) is push-button 0 or number "1". I found out the program would need 5 states (3 FF) using a Moore machine. If there is no input on the state ("0000") then the input should hold. I decided to use D flip flops for this experiment for ease of transitions. Turns out its not so straight forward! Thanks for your help. My equations for the D flip flops are as follows (derived from state diagram/ transition table) They may not be simplified completely, sorry! d0 = Q2'.Q0'.(X1.Q1'+ X2.Q1) d1 = Q2'.(X2'Q1.Q0' + X3.Q1'.Q0) d2 = x0.Q2'.Q1.Q0 z = Q2.Q1'.Q0' You will find the VHDL code below. The component is also shown below. The current VHDL file is just one of my many failed attempts. The simulation does not have an output, therefor z is a constant '0'. library ieee; use ieee.std_logic_1164.all; entity sequencedetecttwo is port ( x : in std_logic_vector (3 downto 0); clk : in std_logic; z : out std_logic ); end entity sequencedetecttwo; architecture arch of sequencedetecttwo is signal q : std_logic_vector (2 downto 0); signal d : std_logic_vector (2 downto 0); component dflipflop is port ( clk, d : in std_logic; q : out std_logic ); end component; BEGIN dff0 : dflipflop port map (clk => clk, d => d(0)); dff1 : dflipflop port map (clk => clk, d => d(1)); dff2 : dflipflop port map (clk => clk, d => d(2)); p0 : PROCESS(clk, q) BEGIN d(0) <= q(0); d(1) <= q(1); d(2) <= q(2); IF (clk'EVENT AND clk = '1') THEN q(0) <= not q(2) and not q(0) and ((x(1) and not q(1)) or (x(2) and q(1))); q(1) <= not q(2) and ((not x(2) and q(1) and not q(0)) or (x(3) and not q(1) and q(0))); q(2) <= x(0) and not q(2) and q(1) and q(0); END IF; END PROCESS p0; z <= q(2) and not q(1) and not q(0); END ARCHITECTURE arch; And the flip flop component: library ieee; use ieee.std_logic_1164.all; entity dflipflop is port ( clk, d : in std_logic; q : out std_logic ); end entity dflipflop; architecture arch of dflipflop is begin p0 : process (clk) begin if (clk'event and clk = '1') then q <= d; end if; end process; end architecture arch; AI: I'd use TYPE and ENUM! Ok, mostly I said that to make a point. And that point is that there are things in VHDL that make the code easier to read and figure out what is going on. The way your code is, it's almost unreadable. I certainly can't tell you exactly what's wrong, although I can find lots of things wrong. Before you start trying to do things the hard way, you should perfect doing things the easy way. That being said, here are some things I found wrong. These are almost certainly not your main problem, but we might as well start somewhere... Your instantiation of the D-Flip-Flops is wrong. You didn't specify where the outputs of the FF's goes. I'm actually surprised that the VHDL compiler let you get away with that. You did not assign an initial value to signals d or q. This could be putting your state machine into an invalid state at startup. Even if it isn't, this is bad practice. The lines "d(x) <= q(x);" in the first part of your process isn't great practice either. While technically OK, it will slow down simulations and on some older compilers will generate bad logic or just not compile at all. In the context of your code, these lines could just be deleted since you don't use d() anywhere. While you're at it, remove "q" from the sensitivity list. Instead of saying "IF (clk'EVENT AND clk = '1') THEN", use "if rising_edge(clk) then". This is clearer, and works better for simulations in some cases. Once you remove all of the useless code, your entire code can be reduced to something quite small. Here it is in its entirity: library ieee; use ieee.std_logic_1164.all; entity sequencedetecttwo is port ( x :in std_logic_vector (3 downto 0); clk :in std_logic; z :out std_logic ); end entity sequencedetecttwo; architecture arch of sequencedetecttwo is signal q : std_logic_vector (2 downto 0) := (others=>'0'); signal d : std_logic_vector (2 downto 0) := (others=>'0'); begin p0 : process(clk) begin if rising_edge(clk) then q(0) <= not q(2) and not q(0) and ((x(1) and not q(1)) or (x(2) and q(1))); q(1) <= not q(2) and ((not x(2) and q(1) and not q(0)) or (x(3) and not q(1) and q(0))); q(2) <= x(0) and not q(2) and q(1) and q(0); end if; end process p0; z <= q(2) and not q(1) and not q(0); end architecture arch; That being said, I still don't know why it doesn't work properly. And honestly, I'm not super excited to figure it out (just because you want to do it the hard way doesn't mean that I do too). But hopefully by clearing up the code a little you can better see what it's doing and why it might not be what you intended.
H: Arduino + Max7221 + Common anode 4-digit 7-seg LED array? I'm trying to hookup a common anode 4-digit 7-segment LED array to my Arduino via a Max7221 IC. Here's a hard-to-see (sorry!) pinout for my LED array (my LED array is the bottom common anode one, LFC0566XXX) Here's the datasheet for the Max7221 IC that I'm using. I was following a tutorial on the Arduino Wiki and it said that the Max7221 will not work with common anode LED arrays like the one I have. However, the comments on the Max7221 Sparkfun product page say that it is possible to use it: You can drive common anode displays with this chip just fine. It has 8 cathode outputs and 8 anode outputs. The only thing you lose is the BCD-7 segment decoder, which would work strangely hooked up to a common anode 7 segment display. But if you’re just telling the chip which segments to light directly, it’ll work just fine either way. How can I connect my LED array to the Max7221? AI: I do not believe you can reasonably run your display (or any multi-digit common anode display) using this chip. You may be able to finagle it to drive a single digit display through some creativity by hard-wiring the common anode to VCC and not connecting any of the DIG pins of the chip. The way the chip works is that the SEG* pins "source current to the display" and the DIG* pins "sink current from the display common cathode". The way it's meant to be wired is that the common cathode of each digit on the 7SD is wired to a corresponding DIG pin and the SEG pins are wired to the corresponding anode segment pins of the 7SD. You serially load up "what should be displayed" into the memory of the chip and some configuration settings and it takes it from there. The chip "scans" the 7-segment display for you and does this by, for each digit N: switching the DIG N pin to GND (and all other DIG pins to high-impedance). setting all the SEG pins to what is stored in its memory (optionally decoding the stored value as BCD first) then moving on to digit N+1 modulo the number of digits its scanning... There's just no way you are going to be able to take advantage of the chip's multiplexing algorithm because it relies on the DIG pins driving the common cathode to GND to "enable" each digit in turn. You could insert an inverting buffer between all the SEG and DIG pins of the chip and the display and then you would communicate with the chip and wire it up "normally" as though it was a common cathode display. Not worth it if you ask me...
H: Christmas card with tiny screen I've just received a Christmas card with a tiny lcd that played a movie when opened. Sweet! Obviously, my first impulse was - time to load my own video! I hooked it up via a tiny usb port I found and I managed to open the video on it - it was titled "SOMETHING-MPEGx17.avi". Now, I tried loading an avi and then an mp4 onto it - neither played correctly. Does anyone have an idea of what to try next? Is there some way to archive an mp4 into an avi or something? Thanks! PS: Not sure if this is the right stackexchange site for this... Is it? AI: An AVI file is just a container. Inside of it are multiple streams, each requiring their own codec to make sense of. For example, your AVI file could have an 8-bit h264 video stream and a MPEG layer 3 audio stream. I hope you kept the original file! There are tools out there to show you what streams are in an AVI file (can't link without knowing your OS), so use one of these to figure out how the original file was encoded. Then (hopefully) you just need to encode your material in those formats and load it up (assuming it fits).
H: How to Calculate the time of Charging and Discharging of battery? How do I calculate the approximated time for the Charging and Discharging of the battery? Is there any equation available for the purpose? If yes, then please provide me. AI: Discharge time is basically the Ah or mAh rating divided by the current. So for a 2200mAh battery with a load that draws 300mA you have: \$\frac{2.2}{0.3} = 7.3 hours\$* The charge time depends on the battery chemistry and the charge current. For NiMh, for example, this would typically be 10% of the Ah rating for 10 hours. Other chemistries, such as Li-Ion, will be different. *2200mAh is the same as 2.2Ah. 300mA is the same as 0.3A
H: How do i test capacitors? I've just gotten through replacing capacitors on a trio of dead LCD screens (nothing's blown up yet, so far) - they either had one or two capacitors on their inverter circuit SLIGHTLY bloated, and not quite leaky. I ended up replacing all capacitors of the same brand/'colour', even the ones that looked fine, in case. Now, checking a bad resistor is simple - i can use a standard multimeter to test it, and i tend to check my solders with the continuity testing option of the multimeter. How would i test a capacitor ? Is there some standard, common way to test one? AI: Charge thru a resistor to the working voltage. Choose a resistor so RC (where R is the resistance, C is the capacitance, and RC is the time constant) is workably large. The final voltage should equal the applied voltage - IR, where I is the leakage current. The rate of charge will give you C ( if I is large you will need to correct for that ) This ignores the burden of the meter which is probably above 1 meg and for a supply cap probably does not matter.
H: How to measure battery voltage I am building a battery powered device. Almost all of my logic is running at 3.3v, although I do have a 5v supply for a few hobby servos. I want to measure the battery voltage, but I can't do so directly with the ADC on my controller because the battery voltage (depending on the cell count of the lithium polymer battery that the user connects to the device) can vary between 6 and 36 volts. (My 5V and 3.3V supplies are fine with this input variation already.) The ADC can't measure anything above its supply voltage. Obviously I need some sort of amplifier with a fractional gain, about 1/12 or so. Should I just use a simple voltage divider? How do I decide what values to use? Maximizing sleep-mode battery life is a concern, so that votes for using large values. What constrains how large those values can be? (The input impedance of the ADC, right?) Am I better off using some sort of opamp amplifier circuit for some reason? What's the usual solution here? AI: There is no one "usual" solution. Some are: Use a high side switch. Use a fairly low impedance voltage divider, but only turn it on for a short time around each battery reading. Since it's on for only a very small part of the total time, the average current draw will be low. This is usually done with a P channel FET so as not to add a offset voltage. Use as high a impedance divider as your A/D can tolerate. A/Ds are specified for some maximum source voltage impedance for two reasons, to charge up the sample and hold cap within the specified acquisition time, and so that leakage current causes a small enough offset to ignore. Too high impedance for the first reason can be overcome by a longer sampling time, which some A/Ds allow you to control. However, there is nothing you can do about the leakage. 100 nA will cause 100 mV error with 1 MΩ source impedance, for example. Use a high impedance divider followed by a buffer amp. You still have to consider leakage, but good opamp input leakage is usually a lot less than microcontroller pin leakage.
H: Power supply of LOGO 12/24RC PLC from SIEMENS I bought LOGO 12/24RC PLC from SIEMENS, and I didn't try it yet because I am worry about the required voltage needed to switch it on. I tried to see the data sheet but I confused with lots of data. If any one has any idea I will be thankful. Here is the data sheet for LOGO 12/24RC AI: In Appendix A of the data sheet you have all the information you need: So you can run the LOGO 12/24 from anything between 10.8V and 28.8V
H: Cheapest way to do an IR re-transmitter (IR protocol agnostic, dumb device is good enough) Looking out for ways to retransmit IR, bi-directionally, like this: [IR TX-A]----->[IR RTR-1]------>[IR RTR-2]------>[IR RX-B] [IR RX-A]<-----[ ]<------[ ]<------[IR TX-B] My interest, is in the "IR RTR" device which can retransmit received IR data bidirectionally, s.a. to increase effective distance. While if it is specific to the IR protocol, it is fine, but if it cheaper / easier to behave in a protocol agnostic way, i.e. received signal is just amplified as-is and fed "dumbly" on the transmitter LED, without needing any transmitter, this is quite acceptable, unless of-course it might introduce significant noise, s.t. it becomes difficult / expensive to deal with on the other end. If there are ready schematics for this, would be glad to be pointed to it. BTW, I have nothing against a uC based approach, but I'm probably keeping that option as a backup, since my requirements in order of priority are: Low cost - My target is a sub $5 BOM -- all components, PCB, battery holder etc. included, but except the enclosure. Low power consumption - This is probably going to be the hardest part, given how power-hungry IR LEDs are. Maybe I am dreaming, but it'd be great to see this circuit run-off disposable batteries (like the A23 or PP9), for last for at least 6 months without a change. Small size - I'd like to keep it no bigger than a box of Altoids. Edit: I do not need this to function as a universal remote control range extender, i.e. I am also quite happy if this little device of mine can act as a bidirectional signal repeater for a specific carrier frequency, modulation-type which might well be proprietary and chosen so as to avoid interference and effects of ambient noise. Edit (#2): Adding some more information about the comm. needs: Throughput of 80-100bps is good enough, excluding the error-check/correction overhead Communication is bursty but cannot be predicted. However communication during a burst is a repeated transmission of same information several times, s.t. if receiver can sleep/wakeup fast enough, it shouldn't miss information. Information is a 10 byte packet, that is sent upto 10 times, with/without acknowledgement. The RX/TX IR-pair in each end-node, and the repeater need to be placed close together to make a compact pair, but I am hoping of avoiding interference between the pair by having some optical barrier between them, similar to double-barrel gun. Typical distance between end-node and repeater, I hope to achieve, is 10-12feet. AI: One would think the purest way is to use a photodiode to drive a transistor, which in turn drives an infrared LED. Let's call it the three parts solution (actually you also need a small series transistor for the LED). This can be done, but it has the disadvantage that everything the photodiode detects gets amplified, including noise it picks up. You don't want that. OTOH, IR receiver modules are usually tuned to a specific protocol and frequency, but if the used frequencies are close a single receiver may be used. The module includes a filter around the center frequency, which eliminates noise, together with an AGC (Automatic Gain Control) stage, which also helps eliminating unwanted (low level) signals, like the radiation from HF fluorescent lamps. But if no real signal is present the AGC will amplify the incoming noise to a normal signal level. And this noise will be retransmitted. When a real signal is received the AGC's amplification will be adjusted, and the noise will be suppressed, so a real signal will come through properly, despite high noise levels when not transmitting. So while there will also be a lot of noise picked up and retransmitted by an IR receiver module, just like the three parts solution. The disadvantage of the latter is that it won't suppress the noise if a proper signal is detected. Its advantage is that it's protocol-independent. As for power, this is a tall order. The three component solution will transmit noise all of the time, and will drain the battery fast. The receiver module contains more electronics, and will draw around 0.5 to 1 mA. Which is also too much to let the battery last six months. edit If the power is really premium you may have to stick to a specific protocol and decode the received commands before retransmitting. The \$\mu\$C will consume some power too, but will cause the LED to remain off for most of the time, like up to 99.99%, since it won't transmit noise, just valid commands. It's possible to program the \$\mu\$C to decode multiple protocols, but like I said earlier, they'll have to have close characteristics, like pulse-pause ratio and carrier frequency.
H: How to connect MPLAB X with mikroICD? How can I connect the MPLAB X software from MicroChip with the mikroICD debugger on my Big Pic 5 board of microElektronics so I can flash and debug my assembler programs? The MPLAB X Software only contains 'ICD 2' and 'ICD 3' under the menu 'Programmers'.. I want to type in a program in assembler in MPLAB X and then be able to set breakpoints and check the registers while it is paused on my Big Pic 5 board. AI: If I remember correctly (and manual seems to agree with me), mikroICD only supports mikroElektronika's development tools and searches aren't bringing any hacks. Since mikroE is playing the vendor lock-in card, you seem to be out of luck (although some sources claim that it's Microchip that's blocking the compatibility part). If the board has programing connector (I can't check right now), you could use a Pickit with it. You could also try asking mikroE's support for any tips on assembly debugging. Some of their software my support it, but I haven't seen it mentioned anywhere in official documentation.
H: EMF Detector Sensitivity A fun little project I've been working on is an EMF detector using my recently acquired Arduino. It is based off of the guide at http://www.aaronalai.com/emf-detector, primary differences being my own implementation of value smoothing and outputting Geiger-counter-style popping with a piezo element (just because it sounds cool, hehe). Now from what I understand the principle behind the operation of the detector is that changes in electric fields are inducing a potential in the antenna wire, which is then read by the Arduino... However since I'm quite new to the whole electronics scene I do not know the function the 3.3 meg-ohm resistor holds (it grounds the antenna wire, as seen in the link above), and more specifically, what kind of effects increasing or decreasing the resistance actually has on the setup (yes, I have tested this, however since the setup is so so sensitive I can't discover a pattern... I figured finding what makes it work would help). So if someone could explain the effects of the resistor in the circuit, it would be greatly appreciated (more so if any proper terminology is pointed out, its a learning experience for me!) AI: I watched the video - the resistor will change the sensitivity of the device. It's basically a charge detector. The antenna picks up a charge from a nearby object which turns the input FET on/off. The resistor controls how quickly the charge will dissipate to ground, and therefore how sensitive the circuit is to external e-fields. You can build the same thing using one FET, 9V battery, resistor and LED. Here is an example circuit with an excellent description of what is happening. In the second version of the Arduino version an LCD + averaging algorithm is used to low pass filter the readings and provide a numeric display of the field strength.
H: What circuit element is this? Rectangle with diagonal arrow, called G What kind of circuit elements are \$G_\mathrm{Na}\$ and \$G_\mathrm{K}\$ in this circuit diagram? I understand that \$G_\mathrm{L}\$ is a conductance, but what about the arrows? AI: They are variable conductances, think of them as potentiometers with the slider connected to one end. The currents Ina, Ik and Il depend on the values of the conductances and the voltages.
H: How does the Villard circuit double voltage? How does the Villard circuit double voltage? I don't understand the capacitor role when the voltage sinewave goes negative. AI: It doesn't actually change the peak-to-peak voltage of the AC waveform. What it does do is impose a DC offset onto that AC waveform. So, a wave that is say +/- 12V becomes a 0-24V waveform (less a little bit for the diode voltage drop). The capacitor is charged up when the waveform goes negative (through the diode), and releases its charge when the waveform goes positive. Here is a link to the Falstad Circuit Simulator with a Villard circuit. You can see how the waveform stays the same but is shifted upwards.
H: Using a LED to transmit data I am curious about the possibilities offered by LEDs to transmit data over a short range (2 or 3 meters), and what maximum data transmission rate can be expected from carefully chosen, but consumer-grade components. I am interested in a minimal hardware + "smart" (micro-controller) software solution. So I see this as a two-parts design problem: The "physical medium" (hardware) layer: what would be a good choice of LED and receiver (phototransistor?) for high frequency signaling? What kind of driving circuitry should I use? The "signal encoding" (software) layer: would a protocol along the line of Manchester code be efficient? Or are other encoding protocols more efficient for this medium? Things I am ruling out: I know about inexpansive and robust IR5 modules, but they are not designed for fast data transmission. I also understand that using coherent light (a laser diode) may provide better bandwidth. Also, no fiber optics: data would be transmitted through air. Update: The motivation for this setup would be as an alternative to power line communication (PLC) or Wifi; so a bandwidth in the 25 to 100Mb/s range would do the trick. This also explains the "no fiber" constraint, but some minimal reflector would be acceptable. Considering the "across the room" distance I am considering, I think powerful / tightly focused solutions such as Ronja may be overkill (they have actually a much higher "minimal distance"). Considering the hardware part: you are positive in the high bandwidth I can attain with proper, "non phospor" LEDs. Are some colors better than other in this regard? What should I look for in datasheet to ensure they have this characteristic? Considering the encoding: what would be better than Manchester for this usage? Something more bandwidth-efficient such as an RLL variant? I am more of a programmer than an electronics person, so I am more at ease with software encoding/decoding; but would some ICs help me with the decoding (which, as I understand it, is the hard part)? Should I consider some pre-filtering of the signal before decoding, perhaps by taking advantage of the frequency characteristics of the encoding protocol? AI: Desired result 1st Full enough details to build one of a 160 Mbps at 1 metre free air LED to PIN diode link here Free Space Optical Communication Link Using LEDs ECE 4007 Senior Design Project Section L01, FSO Group Adam Swett Clayton Huff Trang Thai Nguyen Trinh May 1, 2008 Receiver: Transmit circuit BUT see text: Through air optical communications handbook. Cited above. Annoying format. Here I originally said: Using a non-phosphor LED I'd expect 10's to 100' of Mbps to be possible, with the received being the main limiting factor, followed by the difficulty in cleanly modulating the LED at such speeds. It turns out this is about right :-). Real world reports indicate rates of 100 Mbps are achievable with White phosphor LEDS using relative simple methods - mainly filtering and equalisation, for a gain of about 25x over the "out of the box" rate of around 4 Mbps for a white phosphor LED. So - real world free air transmit: White Phosphor LED as supplied - about 4 Mbps White Phosphor LED with not too hard magic - 100 Mbps LEDs driven with NRZ DC - 200 Mbps LEDs with negative low NRZ to sweep out charge - 300 Mbps LEDs theoretical pushing limits of "laws of physics" - 1 - 2 Gbps Receivers Sufficient unto the morrow is the evil thereof. PIN diode receiver. Read the application notes. Play. Superb discussion of powering issues for IR comms in low power / battery equipment. Appears superb at a quick skim. They say The use of infrared (IR) light as a means of wireless communication between computers, computer peripherals, digital cameras, and other consumer products has gained wide acceptance in recent years. This is primarily due to the low cost of implementing IR solutions in contrast to radio-based implementations. The increasing pressure to produce low-power, high-speed consumer products in this arena, however, makes the implementation of IR transceivers, which is an integrated transmitter and receiver, more challenging. This article will address some of the key technical issues that need to be considered when designing IR transceivers. A theoretical starting point: Extremely comprehensive notes on optical semiconductor souces - see page 35 of 67 for LED modulation bandwidth. More theoretical than you were wanting BUT "sets the stage" for other material. Real world achievements: From Mark Rages Ronja reference Through air optical coms page It says: This page deals with long-distance atmospheric (through-the-air) optical ("lightbeam") communications of various types using coherent and noncoherent light sources, methods of mitigating atmospheric effects on such communications, as well as various technologies involved in transmitting and receiving such communications. The majority of the content on these pages is produced by self-funded hobbyists that have taken on the challenge of furthering the state of the art in this somewhat arcane field.) More on same same people Ronja They say: Ronja is a free technology project for reliable optical data links with a current range of 1.4km and a communication speed of 10Mbps full duplex. Applications of this wireless networking device include backbone of free, public, and community networks, individual and corporate Internet connectivity, and also home and building security. High reliability and availability linking is possible in combination with WiFi devices. The Twibright Ronja datalink can network neighbouring houses with cross-street ethernet access, solve the last mile problem for ISP’s, or provide a link layer for fast neighbourhood mesh networks. How to modulate a white phosphor LED at about 25 x it's unmodified bandwidth. Well worth a look: This August 2009 "letter" shows how fast you can push a slow white LED !!!. They use a white LED with phosphor response in the few MHz range, filter out the slow yellow component and equalise, to get 50 MHz modulation bandwidth, which allows on/off NRZ at 100 Mb/s. They note that the achieved 50 Mb/s is 25x the unequalised unfiltered bandwidth. I'd wonder, why not use a blue LED without phosphor? Some practical limits and an easy means of extending them: This abstract notes that InGaAsP LEDS are good for 300 Mbps at full power if you talk to them nicely (reverse bias off pulsing to sweep charge out faster) and 200 Mbps if you drive with non reverse bias. They say: The application of reverse bias pulses at on-off transitions increased the maximum bit rate of full power operation of long wavelength InGaAsP LED's from 200 to 300 Mbits/s by reduction of the stored charge fall time. Although designed primarily for nonreturn to zero (NRZ) DS-4 experiments, the circuitry operates from 50 to 300 Mbits/s for the return to zero (RZ) or NRZ format with fixed or pseudo-random word patterns. Another way of arriving at max modulation rate Here is a useful but compact answer to "How fast is an LED" and it is worth noting that they say 'about 2 GHz modulation bandwidth or about 1 Gb/s' compared to the 300 Mb/s above. Note that for engineering purposes 300 ~~~= 1000 :-) Some sligtly suspect real world claims: Raw rates believable. Rain affected rates seem "rather good". Here is a "through air claim of 400 Mbps over several kilometres using LEDs: MegaMantis - LED based, 400 Mbps in free air, several km range, moderately rain immune, Walker. I'd take anything technical that these people said (company now defunct I think) but Power Beat claimed 400 Mbps open spave transmission over several kilometres using LEDs (not LASERS). Gargoyle for MegaMantis (the optical link) and Powerbeat (the company) and Peter Witihera (the CEO and main ideas man) to see what you can make of the claims. 2007 discussion with broken links Probably the best technical comment you are going to get “With one LED today it is possible to get up to 400 Mbps in modulated speed,” Witehira says. And Witehira says his company’s system isn’t affected by rain, and can be adjusted for fog. “You can overcome that by having a combination of two different wavelengths at the extremes you can get with light — far infrared and near ultraviolet, which is a deep blue. If you have both of those running at once, you don’t have a problem with fog. You may still have a problem with whiteout,” he said. Getting around corners, Witehira said, is just a matter of bouncing light off glass or by making a network of lights. And the line-of-sight possibilities are growing: Eighteen months ago the company’s technology could send data just 3 meters; now it can span 4 kilometers. The maximum line of sight at the moment is probably 11 kilometers, the company reckons. But, caution Will Robinson ...
H: Verilog structural CORDIC implementation for sin/cos calculation Does anybody have a reference to an in depth explanation of hardware implementation of CORDIC algorithm for sine/cosine calculation? I'm looking for a way to model it in Verilog on structural level. I was able to do it on behavioral level, but when code got synthesized, I got way to many gates, so now I want to optimize the design by describing it structurally. I would appreciate any help. AI: As Chris suggested, the best would be to use a macro provided by the technology vendor. Otherwise, you would need to study alternative structures for implementing a CORDIC core. From your description of having too many gates, you might just be using an architecture that is not suited for hardware implementation. Your Verilog model needs to be based on hardware building blocks (RAM, multipliers, logic) instead of software algorithms. HDL synthesis tools do not magically convert algorithms to hardware blocks efficiently.
H: LiPo series charging I have a 3 cell lipo connected in series and I want to charge them without removing them from circuit. I only have single cell chargers so I can only charge one at a time or charge them in parallel but if I don't remove them from the circuit, charging them in parallel will short the contacts. but what if I use 3 single cell lipo chargers? Is it possible for me to charge these lipos while they are still connected to the main circuit (while circuit is open) AI: With 3 x LiPo in series and no load connected, charging them one at a time is entirely acceptable. Note that LiPo and std LiIon are essentially the same for the purposes of this question. Key differences may be the maximum allowable charge rate as a proportion of full capacity. Std LiIon is usually charged at C (1 hour rate, ma = mAh capacity numerically) initially. Some few may allow 2C and some want as low as C/2 but usuallyy C. LiPo vary to some extent with manufacturer's boldness and higher rates may be allowed. See data sheet in all cases !!! The charger need to be truly floating with respect to the battery when disconnected so that any one cell can be accessed at a time without interaction. You would want to avoid having to use the combination while batteries were in a different state of charge - although even this would do no harm as long an no cell was discharged fully. The danger in discharging a series LiIon battery combination with different states of charge is that exhaustion of any one cell is not readily detected without monitoring each cell individually. If you DO monitor each cell for minimum voltage on discharge and stop discharge when this occurs, then even discharging a differentially charged battery is acceptable. As you are going to need to connect to the cells one at a time, you could consider making up a switchable connection to the charger, and then rotate between charging cells reqularly. The excessively enthused [tm] could could easily automate this with eg relays (or electronic switches if more venturesome.) Swapping between cells every few minutes say should still produce an acceptable charging pattern due to the well behaved nature of Lithium chemistry cells when charging (as opposed to eg NimH where this would be a bad idea. For the first 70%-80% of charging from fully discharged the call is in constant current more and then changes to constant voltage, decreasing current when maximum voltage is reached. Both these stages would be well handled even if you swapped batteries every few minute. Parallel charging with a single cell charger is not possible without isolating the cells electrically. If the charger is not capable of providing more than Imax for any one cell then there would be little advantage in doing so compared to the occasional rotation method mentioned above. If the charger was capable of providing say 3 x Imax then parallel charging would be faster than one at a time BUT current balancing would be absolutely essential.
H: How can I safely charge 3 lithium 18650 batteries to use in one pack? I'm working on a project to make my own super-bright bike taillight using an emergency flasher LED (something like this:) The LED package requires a 12V input, but from what I've read from other people who've done this before, it will still work with as little as about 8V. It also uses a 12V momentary charge to switch flash patterns. I'm planning to use 3 18650 lithium-ion batteries in series to power the light. Each battery is 3.7V, so I should get 11.1 V total, which will (supposedly) be sufficient. I'll put them in a 3-battery holder like this one: This should be easy enough to set up, but I'm wondering how I should go about charging the batteries. I haven't been able to find 18650 chargers specifically designed for 3 batteries. I've found them for 1, 2, and 4 batteries only. My (limited) understanding of lithium batteries is that all batteries that will be used in a single device should be charged together so that the cells can be balanced, and that if this isn't done, it poses a fire risk. I'd like to avoid having a fire erupt between my legs while barreling down a hill at 30 mph. Would it be safe to use three 1-battery 18650 chargers, if I charge them all for the same time? Do they actually need to be balanced at all, or am I misunderstanding something? If they do all need to be charged together for safety purposes, then is there any way for me wire it up to get 12V out of 2 or 4 batteries, which I would then be able to charge normally? AI: Read my just posted answer to this question. While not identical it covers aspects which will answer some of your questions. 3 x 18650 LiIons (or any 3 LiIons) will have a fully charged voltage of 3 x 4.2V = 12.6V and a fully discharged voltage of ABOUT 3 x 3 = 9V. How low low goes is up to you. Too low and battery dies. Read my answer above re balancing. It is not NECESSARY as long as you are CERTAIN that no cell is ever deep discharged AND if charging in series, as long as no cell is in constant voltage tail off mode while you are attempting to inject full constant current at 1C. 'Attempting to" period may be short. IF you charge this off the bike and if all 3 cells are isolated from the world (but connected to each other) then my answers above re charging one at a time apply. You can charge 3 at a time with 3 chargers ** as long as** all charger outputs are truly isolated. An easy way to get 12V is to use one of the many many available switch mode power supplies. You can get 1 or 2 or 3 cell LiIon to 12V capable supplies. An 18650 LiIon cell is has a capacity of about 2000 mAH x 3.6V nominal =~~ 7 Watt hours. IF your flasher worked at 1 Watt average and was anything like serious it would blow following motorists off the road. Depends on design. 1 Watt at 10% duty cycle = 10 Watts when one. 1 Watt at 1% duty cycle = 100 Watts when on. Properly collimated a 1 att red LED willl do a very very very very good job. So a single 18650 cell with inverter of say 7% efficient (low) will run for 7 Wh/1 Watt x 70% = 5 hours. Ample for most people. ADDED: OK, so some clarifying questions. 1) how can I be certain that no cell is ever "deep discharged"? No cell ever under 3 Volt. Monitor voltage and prevent this happening OR Never discharge beyond known capacity to ensure this is true. Murphy says you will fail if you take the 2nd choice. 2) if I'm using a COTS charger (and charging each cell separately), what do you mean by the charger outputs must be truly isolated? If I'm using a physically separate charger for each cell, If the cells are not connected in any way this is irrelevant. This is an issue only if the cells are connected as in a battery holder. Outputs are fully isolated from the charger input. If you operate 2 chargers from mains simultaneously you must get no sensible voltage readings when measuring from eg V+ out of one to V+ out of other. If you plav a resistor from V+ out of oneto Ground out of th eother no current flows. Well under 1 mA would be acceptable. I'd expect good isolation. What is to be avoided is having ground out hard connected to ground pin in. 3 truly isolated chargers will work happily on 3 cells in series if there is no closed current path apart from the cell interconnections. will it be safe if when they're done charging separately I put all three cells back into the same system together Yes.
H: Initial or undefined value of flip flop I am modeling Digital Circuits using ICs in a software. I have worked with flip flops and counters, but I don't remember it well. How do I model undefined or initial value of flip flop (SR or JK etc.)? I have three options '0' state for all uninitialized nodes assign random value '0' or '1' to the new node generate error message, & ask user to clear or preset the flip flop Also consider a JK flip flop, if the user input is '0' & '0', the output is 'Q' & 'Q bar'. What value do I assign in this case? '0' & '1'? This is the initial case, i.e the circuit has been made & the console just powered up. Please share your experience. AI: In some types of simulation, the more states the merrier. If you are doing only single-clock synchronous logic, I would suggest three states (high/low/undefined), but expand out the JK flip flop's logic so as to include the full computation of the next value. For example, if one has a circuit in which both J and K inputs are tied to the AND of the output and a RESET signal, one should apply output := (J & !output) | (!K & output), so that the former term will cancel out, leaving output := !RESET & output, whose value would be well-defined if reset is high, even if output is undefined. If you are trying to do a continuous-time simulation, many more states become necessary, including 'rising', 'falling', 'stable unknown', 'unstable unknown', etc. with some complicated truth tables which depend upon the previous states of inputs as well as the current states (e.g. 'rising:high & rising:high == rising', but 'rising:high & high:falling' == 'unstable unknown'), since the first signal might or might not have gotten high soon enough to generate a high pulse on the output.
H: What other than capacitor rot could cause a capacitor to bulge and fail? I've been teaching myself the fine art of monitor repair - replacing capacitors on a trio of lcd screens. Apparently they all had capacitors that had suffered from the plague - though a mild case of it since they bulged a tiny bit, as opposed to leaked all over the place., and replacing them has allowed two of them to be usable, least over the past week. The third however has exhibited the same symptoms as it did before - one of the two capacitors i replaced seems to have bulged again, as did one of the ones i didn't (made by the same company that made the caps i replaced earlier). Since it was only on the board a few days, and ran for a total of maybe an hour i'm assuming its not capacitor rot. Did i just get a bum capacitor, or could there be other issues? Is there anything i can test to try to work out the source of the problem? AI: One big issues with consumer electronics is that they use the cheapest components possible. Electrolytic capacitors in particular are notoriously failure prone. When replacing failed capacitors it generally a good idea to replace them with ones of equal (or close) value but with a higher voltage rating. For example if the manufacturer used a 6 V capacitor on the 5 V line, you should consider using one rated for 10 or 15 V. You probably did not get bad capacitors, assuming a reputable source, but if the replacements had the same ratings as the original, and the originals were marginal (and thus failed), the replacements were probably marginal as well. I should probably add that heat is not your friend. How is the cooling in that part of the board? If the air vents are clogged with dust etc. that could cause them to fail as well. If you would like another opinion see this EEV Blog forum. The conscious seems to be that you can't go wrong with Panasonic or Vishay capacitors but that many of the lesser brands will be nothing but problems. (Of course there are other good brands as well). "That means you absolutely have to have low Rs (esr) at some high frequency. I wouldn't touch anything that didn't have a data sheet showing low esr at 100 kHz. If it isn't specified, you don't want it."
H: Principles of DC/DC converter w/ jumper-selectable outputs? I have an application where the load is a user-selectable component (an electric door strike) that comes in many flavors, with each flavor requiring a specific DC voltage, most commonly either 12V or 24V. I would prefer not to have separate parts for the different voltages, and so I would like to have a jumper-selectable 12V or 24V DC/DC converter on my board. I have played around with TI's WBENCH Designer and it seems like getting an efficient DC/DC converter for a single voltage is a piece of cake, but how do I go about adapting one to produce different outputs depending on the jumper configuration? My first thought was simply to use WBENCH Designer to produce two different designs based on the same TI chip and then "meld" them into a single circuit with some creative hackery. I'm reasonably confident this could be made to work, but I'm also pretty sure there would be some redundant components from going this route (particularly the large and relatively expensive inductors) and naturally I'd prefer to avoid that. Oh and obviously I'm ignoring the possibility of using a voltage divider or simple dissipating regulator because I'd prefer not to waste power, but should I be? Is there a way to use one that isn't wasteful? AI: There's a number of ways you can go about it: Use an "adjustable" buck regulator and switch the adjustment resistors for different values through jumpers. Use multiple buck regulators to go from your input voltage to all the output voltages in one go (all running in parallel - only one of them active at a time) Use multiple buck regulators in a "tree" formation - one which for example goes from input voltage to say 24v, then one which takes the 24v to (for example) 18v, then another which takes the 18v to say 12v - or whatever voltage combinations you want. Option 1 is probably the cheapest as you only need 1 regulator - picking your feedback resistors can be tricky though if you want precise voltages. Option 2 is probably the most efficient if you want multiple voltages to be available at the same time. Option 3 is most commonly used for a combination of buck and linear regulators - buck it down to a lower voltage then linear it down lower still to give a good clean output. Oh, and by the very nature of the linear regulators there is no way to use them that isn't wasteful. They do have their place though as mentioned in option 3 (no switching ripple).
H: Arduino pulse counting & storing I'm using jeenodes from jeelabs for capturing data such as temperature, light, humidity and motion. Now I am looking to capture gas and water consumption using reed switches (the meters produce x number of pulses per kWh. How do you suggest I achieve this? The main questions are: How should I store the pulse count locally? (EEPROM? I can't simply transmit every time a pulse occurs because some packets might get lost- there might be network outages etc) How often should I transmit data? How should I store the pule count centrally? (just the cumulative figure? which I then have to compare to the value at any given time to determine the consumption between 2 dates/times?) AI: A 99% workable solution likely lies somewhere between the absolutes. For example: You could transmit an incrementing count. The receiver can miss some transmissions as long as it gets a later one. If it gets a later transmission re-starting from (near) zero, it can assume the transmitter has been power cycled and can add the historically received count to the new one. You could measure the time duration of any gap and estimate the number of missed counts during the power loss based on either the rate before the loss or from a past period that might plausibly be similar (ie, same time of same day in preceding few weeks, or from a few weeks period a year ago, etc). This may work even better if you make the correction after the fact to equalize consumption over longer periods (ie, outage of a few hours, fix the total for the day to match similar days, rather than the hour to match similar hours). Also consider that the fact of a power outage may alter behavior and thus gas/water usage. You could periodically store the count value to EEPROM, if you do it at nice round numbers you could do so using relatively few bits since you would only need the significant ones. Upon power cycle, you could restart the count at the last saved number. The receiver would see the count resume at a slightly lower number than before, and could add the difference back in to the received numbers. As most power outages are short (some recent exceptions aside) you could use battery backup. If the meters have a display, you could take an entirely different approach and point a camera at them and use optical character recognition on the images. No system is perfect - in extreme cases, intelligent manual correction may be needed.
H: what's in this peculiar safety plug? This unusual plug interfaces an electric hair dryer to the 120V 60Hz mains. The thing that makes it peculiar is that when it is tipped back and forth, a small 'clunk' can be felt, as something inside shifts in response to being tilted. It is a small boxy thing, about a 1.75" x 1.25" x 1", has no ground lug, but is polarized. The wire coming out of it almost certainly carries 120VAC. There is a molded-in warning not to replace, open or immerse the plug. There are no openings of any kind, nor any obvious ways to disassemble it non-destructively. What would clunk back and forth inside there? It probably isn't an isolation transformer, not in a box that size, for 1800W. I doubt it's a tilt sensor, but can't rule that out. A replacement fuse might be about the right mass, but wouldn't be much use in an box that can't be opened. Anyone know what this is, before Mr. Plug is introduced to Mr. Hacksaw? Mr. Plug's mugshot .. No buttons of any kind. That metallic looking spot where a screw might ordinarily be is absolutely flat, and doesn't move. There are two not-screws like that, the other one is not visible in the picture, being hidden behind the right-hand prong. follow up .. After removal of the cover, a circuit was revealed: Turns out that the the thing that went clunk was that inductor in the foreground. Interestingly the connection on the right side failed, so the loose inductor was just wagging up and down. You can just see the hole in the wiring board where the lead was meant to connect. AI: I was inclined to say it was a ground fault current interrupter. However, those that I am familiar with have manual test and reset buttons. I did a search to see if an auto-reset version exists, and apparently it does.
H: What kind of component would suit my needs? I want to apologize first as I'm a beginer in electronics and my question might sound stupid. I've started experiencing with my Arduino Uno (I love it!) and I wanted to start a project. However, I'm missing a key component and I'm not sure it even exists. Basically, I want to create a sort of Knob that would be robotized. I want to be able to move it to a specific position (exactly like a Servo motor) but be able to manually turn the knob and that my arduino sense the difference. I had some ideas, for example using a potentiometer with a step motor, but I'm not certain it's the best idea. I tried a regular Servo motor but I don't think they are meant to be "manually overriden" as it's really hard to do and there is no way to read the new position. Ideally, the solution has to be really precise and inexpensive. Any suggestion would be greatly appreciated! Thank you in advance and hurray for an Electronics stack exchange site! :D AI: What you want is a motorised slide potentiometer. These are used in top end mixing desks. When a preset is recalled from memory the sliders all move to the right position. For example, sparkfun has this one: http://www.sparkfun.com/products/10734
H: Essential or recommended Digital ICs for a software I am creating a program in which circuits using (only) Digital ICs can be made. I have shortlisted around 25 ICs from the 74xx family. Some of them are 7400 (Quad 2 input NAND) 7402 7404 7408 74161 etc. I have used most of these. Now my queries are: How many ICs do you want to see supported in such a program? Name some specific, essential/recommended ICs to be included. Are digital ICs alone able to model a large number of circuits, or are analog elements also required? Is it correct to name an IC with the same function (like XOR) but a different packages (like W, N, D etc.), different types (like LS, S), or different manufacturers as a single name, such as 7486? IC 7400 & IC 7401 do the same job, so is it ok if I skip 7401? Suggestions & criticism welcome. This will greatly influence my software design, like extensibility. By the way, the project is free and open source, hosted here on Sourceforge if you're interested. AI: Sounds like a cool project. Many circuits can be designed entirely out of pure digital logic (things that can be implemented out of ideal NAND gates), such as most of the components of a CPU design. Some of my favorite digital chips are the 4:1 mux 74AC153 and the 2:1 mux 74HC157 (multiplexers are the tactical Nuke of Logic Design), and the 74HC595 shift register. If you want people to be able to simulate complete CPUs with your software, there are only a few remaining parts of a CPU that cannot be built out of ideal NAND gates: three-state logic for interfacing to the bidirectional "data" lines of a typical RAM chip. Perhaps one tri-state buffer and one tri-state latch out of 74HCT244, 74HCT245, 74AC253, 74HCT374, 74HC541, 74HC573 (an improved 74HCT373), and 74HC574. open-collector logic for interfacing to the bidirectional "data" lines of I2C Flash EEPROM chips an oscillator some sort of input (pushbuttons and switches; perhaps something that can simulate a hexadecimal keypad) some sort of output (LEDs, perhaps pre-arranged in 7-segment displays; perhaps a simulated HD44780 LCD controller; perhaps a simulated bitmap display as used in N&S Building a Modern Computer from First Principles). "Hierarchical design" is nice. It would be nice if your users could place a box labeled "32-bit adder" on one schematic as if it were a single chip, then open up that adder to build its implementation as several "74181" ALU chips, then open up that ALU to build its implementation as several simpler chips. Perhaps you could take the extreme N&S approach and build everything out of ideal NAND gates (except for the above-mentioned things that cannot be built out of ideal NAND gates). If your users want some other 74xxx digital chip, they could build it themselves out of NAND gates and three-state buffers and open-collector buffers. It would be nice if your simulator could warn people about circuits that might produce glitches or unexpected state transitions. In other words, instead of simply assuming one particular input-to-output delay, I wish the simulator checks to make sure the design is robust enough to handle the full range of possible input-to-output gate delays and output-to-input transmission line delays (zero delay to max delay) -- even if today we use a fast chip here and a slow chip there, and tomorrow we use a slow chip here and a fast chip there. That seems far more useful to me than precisely simulating the exact delays of one particular chip at one particular temperature. I think sticking with ideal digital logic, with the above exceptions -- temporarily ignoring power dissipation, PCB design, etc. -- will already be plenty useful -- enough to do high-level design of entire CPUs.
H: Use a PWM or other controller for 24V/500W application I've been gaining understanding about using PWM for a motor speed controller. I'm developing a project (go kart) that uses a 24V DC starter motor and I want to build a motor speed controller that is somewhat rudimentary/simple. Is it possible to utilize Arduino technology or some kind of PWM connected to a relay that switches the power supply on and off to the motor at the cycle speed that will act as a 'throttle'? Or, is there a rudimentary means of controlling the motor speed in 4 or 5 stages (less elegant but equally as effective...)? Any links to other resources or advice is greatly appreciated. AI: You've got the right idea with PWM, but relays are totally inappropriate as the switches in this case. You want to run the PWM at least a fw 100 Hz, and that would be slow. That's fast enough for the motor to work well enough, but could cause audible whine. That is why most motor controllers pulse at 25-30 kHz, just past the audio range. Probably the best way to switch the voltage to your motor is with a low side FET, or perhap several in parallel. Use good FET gate drivers intended for that purpose, and control those from the PWM output of your microcontroller. A starter motor is not really a good fit for what you are trying to do, but you should be able to get some results like you expect. In general, start motors take a lot of current, have high torque, but aren't meant for sustained operation in several ways.
H: Why is my XNOR output always low? I recently bought some Texas Instruments TTL chips. So far they've been OK, except the XNOR (SN74HC266N) chips (I've tried 3, including one that's never been in my "real" circuit) always output low no matter what the state of the inputs are. They weren't working right in the real circuit, so I pulled them out to test them in isolation. Maybe I'm not testing them right, but here's how I did it: ---- Input1 - - Vcc Input2 - - MM Probe (+) - - - - - - - - Ground - - ---- Where Input1 and Input2 where tied either to ground or Vcc of my supply (5.25v as measured by the meter). I expect the "Y1" pin above to measure near Vcc with respect to ground if Input1 and Input2 are either both high or both low, but the meter measures ground no matter what. Am I testing this thing wrong, or do I have a bad run of chips? Am really new at digital electronics, so I'm fairly certain I've done something wrong. AI: "Open Drain" output devices operate like a switch. They don't source current of their own. They are usually used to either drive higher current devices, or to connect to a bus along with lots of other devices. To use as a standard output device you have to supply the output with a voltage. This is in the form of a pull-up resistor (a resistor connected between the output and the supply voltage) so that when the output is "off" the resistor provides power to the output, and when the output is "on" the output pin is connected to ground. Note that the output actually operates inverted so that a logic 1 is an open switch.
H: Can an LED achieve full brightness in 40 µs? How fast can an LED achieve it's full brightness at it's rated voltage and current? I need to do multiplexing of LEDs to make a matrix display and I've calculated that each LED can only stay on for 40µs. I don't know if that is enough time for the LED light to be seen however. AI: (1) LED on times for phosphor LEDs are in the 100'2 of nanoseond range (2) Turn on times for non-phosphor LEDs are typically in 10's of nanosecond range if driven correctly. Average current = Peak_Current x time_on / ( time_on + time_off ) Peak current is assumed to be "steady". (3) Brightness when mutiplexed = B_DC x time_on / ( time_on + time_off ) x k Where B_DC is the brightness when the LED is operated at this PEAK current when DC is used and k = a factor relating to loss of efficiency with current, change of efficincy with die temperature etc. Initially k=1 is close enough. or Brightness using average current = = B_100% x k at average current (4) Modern phosphor LEDs have an allowable peak current 20% to 100% higher than the rated DC current. ie you cannot usefully multiplex modern phosphor LEDs directly. (5) SOME modern LEDs MAY allow higher peak/rated current ratios but you should check the data sheet in EVERY case. (6) There is a way to multiplex LEDs to allow high peak multiplex currents when the actual LEDS have low allowable peak/rated current ratios. It takes more circuitry and/or design effort. Few people do this AFAIK There are various possible implementations but the basic method is to multiplex power (LED drive) to an energy store and then drive the LED from the energy store in such a way that LED current is about constant. An "energy store" can be a capacitor or an inductor, plus supporting circuitry. (a) Multiplex into capacitor across LED directly. Input desired average current. LED will stabilise at appropriate voltage for the average current. Energy is lost in the driver due to unavoidable I^R loss. Capacitor must be large enough to prevent LED current rising above rated value during recharge pulses. The capacitor increases the turn off time to at least a few multiplex cycle periods and probably 5 to 10 multiplex cycle periods, and maybe much longer at very high multiplex ratios. Turn on time is under the control of the designed but will also usually be slowed to several mutiplex cycle times. (b) Multiplex into eg inductor in series with LED to ground. Reverse diode from input to ground. This is effectively a buck converter.
H: Tektronix's 465B Analog Oscilloscope Volts/DIV's Question I just purchased a used Tektronix 465B Oscilloscope and I am having some difficulty with the VOLTS/DIV knobs. Both channels have markings from 5mV up to 50V. All of the settings work except for the 10, 20 and 50 volt settings. The knob will not physically turn to these settings. Its almost like its locked out or something. Has anyone had experience with this? I feel like I should be able to measure 120V on this hunk of machinery, however I am limited to a max of 20V. :( Its also worth mentioning there is a x10 mag button located on the front. I don't think its what I am looking for. I have been able to locate a tech manual, but have been unsuccessful with an operational manual. Any experience with this would be greatly appreciated! AI: I imagine the 10, 20 and 50V markings are for when the probe is set to 10x. The dial should have two bands to correspond to 1x and 10x settings. I have an old tek scope which does this - the highest you can turn to for 1x is 5V/div. I just googled for a picture of the 465b and it looks like this is the case - notice there are two bands on each knob. On the bottom knob you can see one is at 1V/div and one is at 10V/div, which would correspond with 1x or 10x setting: EDIT - I have added arrows pointing to the bands to clarify things.
H: Where can I find a 110V/60Hz to 220V/50Hz voltage converter I'm debugging a power supply issue with a product made for a 220V/50Hz power source. Most made-for-USA step-up convertors provide 220V/60Hz (from a 120/60 USA mains supply). I'd like to try providing 220V/50Hz (from a 120/60 USA electrical supply). Where can I buy such a converter? AI: If you were willing to use a 12V DC supply you could use an inexpensive inverter designed to produce 220 V/50 Hz from a car battery. Here is one available for $38 which has a sign wave output and will handle 400 watts continuous, you did not state how much power you intend to draw. Obviously this could be run from a standard 12 V bench supply with sufficient capacity, perhaps you have one already? Added: The above solution is "off the shelf" and is a good one for lower wattages. As wattage increases the current required at 12V becomes annoying to handle. 24V units are available but even that becomes a compromise. A potential solution is to use an existing 12V-230V inverter but to disconnect the 12V-230V portion and just use the HVDC to HVAC portion. Many low-V DC to High-V AC inverters use two stages. LVDC to HVDC then HVDC to HVAC. In many cases, using a 12-230 inverter you can implement an HVDC power supply and feed it into the DC HV rail in place of the LVDC/HVDC. It is far easier to implement a say 300 Watt DC power supply from 110V mains than to build a 12V, 30A power supply. As wattages increase the build rather than buy option gets more attractive, so it depends on your Wattage. If it's eg a power tool or incorporates any sort of a heater, then building will probably be very attractive. If the above is enough of an answer and/or for more help on this consider asking here
H: Can a majority of DC electronics run on high current (i.e. lamp, car) batteries directly? I've seen some people run an inverter off a large set of batteries, to power mobile devices and whatnot or even game consoles. My thoughts are, if I can rig some lamp batteries together and use a portable tv I could power something such as an SNES (super nintendo/famicom). The SNES would require 12V (suitable for some larger batteries, or some in series) and ~200mA possibly less when running. Would it be a good idea to plug a battery directly in to where the DC socket is, sans the regulation and all that? Does the adapter provide some sort of expected power or behavior different from a "pure" DC source? Also a silly question, assuming I've a pile of 6V lamp batteries that could supply 100mA each - would I be able to place them in series+parallel to achieve 12V + higher maximum current draw for this purpose? AI: Whether you can run it safely off batteries depends on the design of the unit. If the regulator is in the supply then you will need to add a regulator to your batteries. If the regulator is in the unit you will be able to directly attach your batteries. Most systems have the regulator in the unit, so it should be OK to just power it off battery. Be warned though that "12V" lead acid car batteries are actually a higher voltage (around 13.5V) so a regulator should really be used with these for safety. As for increasing current - yes, just put pairs of 6V batteries in parallel. Connecting batteries in parallel increases the current. Connecting them in series increases the voltage. If you think of a 12V battery as two 6V batteries in series, then connect these "12v batteries" in parallel you will get 12V and higher current. Electrically, a single 12V battery is the same as 2 6V batteries in series. A battery is made up of cells. Each cell can provide between 1.2V and 1.5V depending on chemistry. A 6V battery is a battery of 4 cells (battery in the non-electrical sense - think artillery battery, a group of artillery guns) - 4 x 1.5 is 6V. Put two 6V batteries together and you get a 8 cells in series - that's 8 x 1.5V = 12V.
H: How do I define a module with a modified parameter in Verilog? I want to define an add module which has a modified parameter in my declaration of the new instance but it doesn't go well. It is in Verilog. I want to define an instance of this module: module add #(parameter wd=1) (input wire [wd-1:0] a,b, output wire [wd-1:0] o); assign o = a + b; endmodule I tried this line but I get an error: add len_plus_1 #(8)(.a(len),.b(8'h1),.o(lenPlus1)); AI: You've got the order wrong. When using module-instance parameter value assignment (the rather wordy terminology for this method), the syntax is: module-name #(parameter-assignment) instance-name (module-terminal-list) ; where the parameter assignment can be by name or by the order of the values. You're already familiar with the module terminal list, so I'll just give the parameter BNF: parameter-assignment ::= (values-by-name / values-by-order) values-by-name ::= .parameter-name(parameter-value)*[, parameter-name(parameter-value)] values-by-order ::= parameter-value*[, parameter-value] So your example should be one of the following: add #(.wd(8)) len_plus_1(.a(len),.b(8'h1),.o(lenPlus1)); add #(8) len_plus_1(.a(len),.b(8'h1),.o(lenPlus1)); The former (named) version is preferred, because it maintains its behavior if you add another parameter. The following example gives additional options (this is adapted from Figure 9-4 in Verilog HDL: A Guide to Digital Design and Synthesis by Palnitkar) module bus_master; // Note: These could also be ANSI C-style parameter declarations with // module bus_master (#parameter delay1 = 2, delay2 = 3, delay3 = 7); parameter delay1 = 2; parameter delay2 = 3; parameter delay3 = 7; ... <module internals> ... endmodule module top; // Assignment by name: bus_master #(.delay2(4), delay3(8)) b1(); //delay1 = 2 (default), delay2 = 4, delay3 = 8 bus_master #(.delay1(1), delay3(6)) b2(); //delay1 = 1, delay2 = 3 (default), delay3 = 6 // Assignment by order: bus_master #(7, 8, 9) b3(); //delay1 = 7, delay2 = 8, delay3 = 9 bus_master #(1, 3, 5) b4(); //delay1 = 1, delay2 = 3 (default, but by assignment), delay3 = 5 bus_master #(1, 5) b5(); //delay1 = 1, delay2 = 5, delay3 = 7 (default) endmodule There is also another method which uses the defparam keyword to define the values before instantiation like this: module top; defparam b6.delay1 = 1; bus_master b6(); //delay1 = 1, delay2 = 3 (default), delay3 = 7 (default) endmodule; but that's considered poor style (though personally, I'd prefer it to the values-by-order syntax).
H: How is pouring water addressed in high-voltage electric transport systems? An electric train is typically powered with something like 1.5 kilovolts of direct current of something like 25 kilovolts of alternating current. In my experience electric device manufacturers charge a fortune for even 220-volts (mains voltage in many regions) appliances that can be used outdoors, so atmospheric moisture is a huge problem for electrical devices. Yet an electric train will move under the heaviest rain with its pantograph contacting a bare overhead wire and no short-circuiting happens. How is that achieved? AI: First, notice that there is nothing near where the train is touching the overhead wire. Distance is insulation. Then if you look closely you will probably see insulators in serveral places in the mechanical gizmo that pushes the contact against the overhead wire. The same problem applies to high voltage transmission lines. The big ones have metal towers, which of course can't be allowed to have high voltage on them. In fact, they are deliberately grounded. The high voltage cable is usually suspended from a long ceramic insulator. This has a number of ribs or discs to increase the surface distance from one end to the other and keep water from collecting along the whole surface. Smaller but quite visible ceramic insulators will be on the power lines in your neighborhood and at the primary side connections to the transformer for your house or building. Google "high voltage ceramic insulator" and you will see many pictures and descriptions for these devices. The insulators on the train may be of a different material, but are probably visible if you look closely.
H: Bandpass filter to isolate musical note "A2" I would like to design a bandpass filter to isolate the musical note A2 ( 110Hz ) from its neighboring notes at a precision of a half-step. This means that G2# = 103.83Hz and A2# = 116.54Hz should be in the stop band. In the ideal case, 110Hz would be at 0 gain. G2# and A2# would be silent (infinite negative gain?), and there would be a smooth roll-off from the A2 to each neighboring note. How can I select my window type, determine how many coefficients are necessary, and calculate those coefficients? I took a few EE courses back in college, but I am far from an electrical engineer, so please ask for clarification where it is necessary. References: Note frequencies Filter types AI: As I understand it, you want to detect the amplitude of 110 Hz component with a bandwidth of less than the 12th root of 2 on either side. The adjacent notes that should not be detected are 103.8 Hz and 116.5 Hz, which are about 6% off from the center frequency. First, that is a very tight filter. This is not going to happen with analog electronics, at least not in the baseband. You can do this digitally by sampling the composite input signal and multiplying it by the sin and cos of 110 Hz. Low pass filter each of these products so that 6 Hz is attenuated to the level you want adjacent notes attenuated. Then square each of the results and sum them. That single number will be the square of the recent amplitude of any 110 Hz component in the input signal. Keep in mind that since this filter has very narrow bandwidth, it will respond slowly. It will take a few 100 ms to stabalize from a step in the incoming 110 Hz amplitude. If you just want to detect that the 100 Hz component is above some threshold, then you can use the squared amplitude value directly. If you need the real amplitude, then you'll have to take the square root of the result. I have done something similar to detect individual DTMF frequencies in a DTMF signal. The frequencies, bandwidth, and therefore the time constants are different, but the algorithm is identical. Here is a result showing the amplitude squared value I described above for three successive DTMF frequencies with the algorithm set up to detect the middle one: Here is the code snippet that ran over each input sample to produce the squared magnitude (MAGSQ) and the real magnitude (MAG): for sampn := 0 to nsamp do begin {once for each input sample} t := sampn * sampdt; {make time of this sample} samp := getsamp (t); {get input sample} r := t * freq; {make reference frequency phase} ii := trunc(r); r := r - ii; r := r * pi2; prods := samp * sin(r); {mix by ref frequency sine and cosine} prodc := samp * cos(r); filter (filts, prods); {low pass filter mixer results} filter (filtc, prodc); magsq := sqr(filts.val) + sqr(filtc.val); {compute square of magnitude} magsq := magsq * 4.0; {normalize so input 1.0 results in 1.0} mag := sqrt(magsq); {compute linear magnitude} The FILTER subroutine performs a two pole low pass filter the usual way. Each pole follows the standard algorithm: FILT <-- FILT + FF(NEW - FILT) In this case FF is 1/128. Since it is a integer power of two (-7 in this case), it could be performed in a microcontroller by a right shift of 7 bits.
H: What is the risk in unplugging a USB device without disconnecting it in the OS? I see people unplug a USB e.g. External drive from the port without flagging/ejecting it from the OS first. What are the risks in disconnecting a USB device in the middle of a transfer? Could it damage my hub controller, or blow-up my motherboard or such? AI: USB is intended to be electrically hot-pluggable, so the issue is actually one of software state rather than at the hardware level. Essentially, the concern is that a mounted file system could have uncommitted buffers in ram at the time when the device is unplugged, or could be in the middle of some interruption-unsafe move operation or meta-data modification. Journaling file systems can provide some protection against this if well thought out (or make an even more hopelessly confused mess if badly designed). Further questions about that aspect of the issue would probably belong on superuser. It would certainly be possible to (accidentally?) design a USB flash controller IC which conducted interruption-unsafe housekeeping operations below the level of the SCSI-like block device interface seen by the host, such that even when the host OS thinks the device is safe to remove it might not yet be. Hopefully that is not the case.
H: How do I draw a PCB antenna in Eagle without DRC errors? I'm designing a board that should contain an antenna I found in an application note. I'm using Eagle and I tried to create a library part for the antenna. However, since the antenna is basically a fancy-shaped short circuit, Eagle tends to report DRC error for it. Is there a way to draw a PCB antenna in Eagle in such a way, that the DRC errors wouldn't show up? AI: No, there is not. Well, not for an antenna- You can make a junction with a soldermask opening that will create a short (if you use a stencil cut from the output of the CAM tools), but there's no way to join two different nets on a copper layer in the PCB editor. Just keep doing what you're doing; it will produce a DRC error but that's OK. As I wrote at How do I facilitate keeping multiple grounds, (i.e. AGND, DGND, etc…) separated in the layout when using Eagle?, you can move on by select one of the errors to enable the "Processed" and "Approve" buttons ("Approve" is the only one I use on a regular basis) and choosing "Approve" to move the error from the errors list to the approved list: and will stay there on subsequent runs of the DRC. Note that this only moves this specific error with this specific pair of nets at this specific location. Closing this window and running the DRC again produces the notification "DRC: 1 approved errors" and no "DRC Errors" dialog. When you don't get a new DRC errors dialog, you're done!
H: Can I run an Arduino off 8 x AA batteries? Can I run an Arduino off 8 x AA batteries? The documentation says it can run from 5-12v which is in the limits of the the specs. I wanted to ensure I had more than enough power for anything else I wanted to drive through it. Would it be better to run the Arduino off a 5v regulator from the 8 battery supply then draw anything else off the power supply directly? AI: The first thing the power jack goes to inside the Arduino is a 5V regulator. This can (for the UNO at any rate) supply a maximum of 800mA. Any more than that and you will have to use the external power. How much current the AA batteries can supply depends on the chemistry. But yes, you can run (and many people do) off 8 AA batteries.
H: Implementation of a large parallel algorithm for communication with a server I want to run a parallel algorithm I will implement in Verilog/VHDL and use a FPGA to run it. I have some questions: How can I make an http request to servers using an FPGA - should I use a computer and transfer the data to registers? What are the parameters in an FPGA which indicate the number of registers I can use/define? What are the parameters in an which indicate the number of nand gates I can use/define? Which FPGA is the most powerful? Is there any way to parallel 2 or more FPGAs? AI: Various ways, all will involve sending the data from the FPGA to something that can send via HTTP (e.g. microcontroller, PC, ...) As Kevin mentions you can implement an ethernet MAC core on the FPGA to handle things - depending on resources available (size of FPGA, percent used, etc) this might be the best solution. You can use as many registers as you like up to the number present on the FPGA. As above, as many gates as the FPGA has can be used. Typically an FPGA has a number of Logic cells which are composed of (very roughly) a register and 3/4/5/6 input LUT, which can be configured in various ways to implement your HDL. For example the Virtex-7 series is listed as having 2 Million logic cells. Compare this with a typical $10 FPGA which might have 100,000 logic cells. Depends on your definition of "powerful" (e.g. size, speed, RAM, DSP, analog, etc) Examples of "top of the range" FPGAs would probably include chips like Virtex-7 and Stratix-V. They are also priced accordingly ;-) Yes - you can parallel as many FPGAs as you like. Just as you can connect as many 74 series chips as you like.
H: Generating SMPTE time code signal SMPTE signals are (one of) the signals used to synchronize video and audio recordings from multiple cameras/recorders. How does one go about generating such a signal? I have a GPS-derived clock and 1PPS signal that the time should be based on. AI: This is not a task for the inexperienced. You can buy SMPTE generators and if you need one and can afford a commercial one that would be the easiest path. Next easiest, if PLCC44 and TQFP44 are easy, is probably the ICS2008B from Intergrated Circuit Systems Inc. ICS2008B SMPTE Time Code Receiver/Generator datasheet The task itself doesn't look too too difficult. Actual code is "like NRZ but different" (SMPTE = A transition at every bit boundary plus 1 = a transition at bit centre). That's the easy part. You could probably "roll your own" with many microontrollers, but the timing synchronisation is probably the 2nd hardest part and understanding the specification may be hardest. Even using an ICS2008BV would be"interesting". Wikipedia gives a fair idea of why you don't want to roll your own. Their explanation of drop frame time codes where no frames are dropped but frames 0 and 1 have time code dropped in the first second of every minute except when minutes are divisible by 10, all this to remedy a multiplication by 1.001 that was introduced due to colour NTSC because ... , reminds me of an extremely old poem about Inuits making fur moccasins. "The skin side is the inside but the inside's on the outside and the fur side ...". At least the poem was trying to be confusing*. Do it with a Mac - SMPTE TO Midi donationware Useful intro discussion - if you can't follow this, buy a commercial unit. If you can, buy one anyway :-). SMPTE / MIDI slideshow. Some value * A little Gargoyling shows it was, in fact, "The Song of Milkanwatha"
H: How to choose an IC to use with your project? This may be somewhat contrived, but I'm going to use an illustration. Let's say you're building a desktop computer for yourself. Now, one way that you could go about do this is just to visit a site that distributes components (e.g. Newegg) and browse CPUs until you find one that you want. Then, find a motherboard compatible with the CPU that you like. Then build off that. Before you know it, you'll have chosen all of your parts. Back to electrical engineering: often, I'll know "what kind of part" I'm looking for, and have a vague idea of what specs it should have. But simply doing a search on a components site (e.g. Digikey) will often yield tens, hundreds, maybe even thousands of results. This is staggering for someone like myself who has little experience, as it would be difficult to distinguish an appropriate general-purpose component that I could use. How would one with little experience go about picking a central IC around which to develop one's project (assuming that such a design is appropriate)? Are there any resources that have lists of such useful or simple or commonly used ICs (transistors, op-amps, micrcontrollers, etc..)? AI: I think everyone probably has these thoughts at some point. There are books/sites which recommend a bunch of "useful components" to have available. The only trouble is these things go out of date very quickly. For example the 741 and PIC16F84 are still being recommended in places even though they have both long (long long) since been surpassed. If you know what is needed spec wise for your project (as you should do) then you can pick the components based on the specs. For example if you need 10MHz analogue bandwidth and you are using a 5V supply then you can filter opamp results accordingly. What speed does your uC need to run at 10MIPS? 40MIPS? what peripherals does it need? USB? SPI? CAN? Filter accordingly. Parametric searches are your friend here (all the decent sites like Mouser, Farnell, Digikey, etc have them) This applies to just about everything, so there's no quick way around reading through datasheets and making an informed decision (unless you already used the part of course) So I would say the answer is probably to jump in head first and start learning how to use the search tools properly (look at any help available) picking your way through the components, read the datasheets, learn about what the specs/graphs/etc mean. I certainly remember being overwhelmed by all the different options and long winded datasheets, but after a while your brain gets pretty good at filtering out the info you need quickly. Still takes time though, and is not the most enjoyable task. Of course, if you're sure of the specs and you can get someone else to do it for you that's always a good option ;-) Keeping up to date with new chips is useful too, I sign up for all the new product notifications for various places.
H: How does this flasher circuit work? I was watching the video on Forever Flasher circuit in Advent Calendar of Circuits 2011 series by vk2zay. Below is the circuit I am talking about. However, there are some things I understand and most things I do not understand about the working of the circuit. Things I understand and do not understand: When the circuit is powered up, Q2 is turned on a little through R1 and R2 which turns on Q3. When Q3 is turned on, Q2 is turned on more with the current coming from the collector of Q3, through C2 and R5. So they are complimentary pair as vk2zay said in the video. When Q3 is on, it turns Q1 on through R4. When Q1 is turned on, base current that were supplied to Q2 through R1 and R2 is no longer supplied because bottom end of R1 is in the ground potential. In this position, where Q1, Q2 & Q3 are on, currents flowing are: from Q3:C to R7 to GND, from Q3:C to C2 to R5 to (Q2:B & (R2 to Q1:C to GND) ), Q3:C to R4 to Q1:B to GND. These are the ones I understand but I do not not how C1's current flows and comes from where and goes to where. But here, I think the voltage at "out" and Q3:C which is supply voltage, adds up. After some point Vc2 goes up to about 0.9 volts which turns Q2 off. So it turns Q3 off. What happens to the charge and voltage at C2? How and to where it discharges? At this point, how and from where to where will Ic1 go? I just added QTLP690C as a high forward voltage LED. Assume the forward voltage of the LED is 2 to 2.5 volts. Sorry if I sounded complicated. I would appreciate any detailed information on this. Also, any tips on how to understand how these kind of circuits work? AI: Re I understand but I do not not how C1's current flows and comes from where and goes to where. But here, I think the voltage at "out" and Q3:C which is supply voltage, adds up. The output if driving an LED would depend on Vsupply being < Vf_LED_On but > VfLEDOn/2. When Q3 is off C1 charges to vsupply via Vsupply-R3-C1-R7//R4//Q1_be. When Q3 turns on the left side of C1 goes from 0 to Vsupply so the right side of C1 goes from Vsupply to ~= 2 x Vsupply *(as voltage across a capacitor cannot change instantaneously and left end was raised by Vsupply so right side must be too. 2 x Vsupply acrosss D1 turns it on if VF_D! < 2 x Vsupply. This is a bad wayto drive D1 as it provides large chort current pulses. IF the circuit is driving D1 at about mean rated current then current peakswill be >> I rated. Moderm LEDs only allow a small margin - which this will exceed if LED is near mean rated current. BUT cap C1 is charged vi R3 + R7 etc. If Vsupply = 1.5V then Icap charge = 1.5/27k = very very very little. . _______________________________________. Ocsillator action: Q1 Q2 Q3 are effectively inverters. Remove C2 temporarily Force Q1b low -> Q1C high Q1C high -> Q2b high -> Q2 on. q2 on -> qQ2clow -> Q3 on -> Q3C high. So the 3 Q's are high low high And Force Q1b high -> Q1C low -> Q2B low -> Q2 off Q2 off-> Q2C high -> Q3 off -> on Q3C low So the three Q's are low high low This like 3 CMOS inverters in a row with output connected to input. As their are 3 you get net inversion. Connect out to in as here and it tries to "chase its tail" With pure R biasong it will settle dowm to some stable point/ BUT R5 + C2 connect across an inverting point - when one end is high it is driven by a low input and when low it is drive by a high input. This provides the negative feedaback to ensute ris system is unstable and will always chase its tail. This is not a very "exciting" circuit. It id not obvious that it does anything overly well. But, it may. Consider this circuit: Try simulating that. Make L1say 1 mH to start. Can be say 100 uH or whatever. Play with R1 & C. Does it oscillate. Note this is for 1 cell. Q2 grounds Q1's base - noyt good for high Vsupply Components may be re-added as desired - this was a stripdown attempt AFAIR. If R2 C1 time constant is long - say 0.5 second, you have a LED flasher. If R2 Ca time constant is short you have a boost converter and steady LED driver (it seems visually). I "invented" this circuit in about 2000 and published it on-web in ?2001?. I say "invent" as Q1 Q2 oscillator was used by Noah to power a deck light. I simply added L1 which was wholly obvious -and very successful. I would be completely non-surprised if this had been invented by 3,456 people, 10 years before I suggested it, BUT I've never seen any earlier versions. Several close version turned up inside 6 months of my publishing the original. No doubt a fluke - they didn't mention me :-).
H: Verilog : Are there any good sites contains open source projects? i was wondering if there are any good sites who encourage open source in the fpga world using code in verilog or vhdl? since the open source community is very powerful and all the big firms contribute to it with great modules in software, is there any similarity in RTL codes? AI: Open Cores has a collection of open source Verilog/VHDL cores.
H: Electrical Circuitry Programs aimed at Children / Beginners I'm sorry of this is off topic, but I figured I have a better shot asking the question here then anywhere else. What I'm looking for is an Electrical Circuity program that was released around 2000 that makes it easy to make circuits on the computer. The program that I am talking about came with a computer mag that I had in England, this was around 2000 or 2001. It allowed you to make a circuit on the computer and test it. It gave you items like light bulbs, switches, batteries and much, much more. I remember being able to over volt light bulbs (with to many batteries) and having them break, so you would have to replace them with a working one. It was very simple and child friendly, I used it for one of my school projects. Does anyone know of this application, and where I could get it? Or do you have a list of applications like this that you could post here. I will accept applications that are in the same vein, that are better then what I'm asking for. But I would like to emphasize that it should be able to be used by children relativity easily. AI: could have been http://www.crocodile-clips.com/ ?
H: Is there anything inherently wrong whith this fpga project? I am a software engineer in 3d graphics by day so please bear with any obvious mistakes. I am looking for a project that I can use my software knowledge with in hardware and am thinking of creating a frame buffer and lcd to display it. I have looked around and think I can accomplish it with this fpga: https://xess.com/prods/prod048.php And this LCD: http://www.sparkfun.com/products/8335 I think they have: 480 x 272 = 130560 pixels on the screen 130560 x 24-bit = 3133440 bits for the frame buffer 67108864 bits of sdram to store the frame buffer So I think I'm ok there. And I think can run the fpga at 9 MHz (that the lcd needs) because it has "digital clock managers" to change from 12 MHz. Which I believe I will need 3133440 Hz to write the entire buffer. I think I can also get input from the usb for writing the pixel colours to the buffer. The fpga can output either 5, 3.3 or 1.2 v for logic, but the lcd requires 2.5v however in the manual it says "0 ~ +4.5"... So could I use the fpga logic voltage directly? I am learning as I am doing this so I am going to make a lot of mistakes, but is there anything obvious I am missing or am I good to get our my breadboard and have some fun? Thank-you AI: If you got a board which had a VGA connector (or rigged one up, with some resistors) you might find it simpler to start by driving an LCD with that interface, and then work up to a bare one. Block memory inside an FPGA tends to be easier to work with than SDRAM, and is dual port which simplifies access, but of course it's more limited. Still, it could be worthwhile to start that way and then add the SDRAM complexity. A higher gate count FPGA would typically have more block ram, too. Of course you can start by drawing some bars on the screen just using a state machine or counter without any frame buffer at all. An oscilloscope would be a huge help. Many LCDs actually aren't that picky about frequency, so while you can use the clock generators to get it just right, you may not need to. An issue not to overlook is the practical task of securely cabling the LCD to the FPGA board - with 24 bit color there's a bit of work there unless you really luck out and you can just plug one into the other.
H: Good way to pick up voices in a small room for speech recognition I've written an app that's pseudo-intelligent and responds to voice commands. I'd like it to be able to pick up my speech from anywhere (initially just one room, but possibly many later on). At present I'm using a bluetooth mic but it's annoying and frankly looks ridiculous. The room I'm starting with is approx 4x7m. The floor is carpet and there's furniture against almost all the wall space. There are no obvious echoes (at least that I can hear). Can anyone with some experience suggest how I should get started? What sort of microphone should I be looking for? and do I need any processing equipment? AI: Boundary microphones are specifically designed for this application. Mount it on a wall or in a corner.
H: Using Nixie Tubes With some (very) rusty electronics knowledge I thought I'd have a crack at getting some Nixie tubes to display using my microprocessor (an mbed). It seemed so simple, but the information I can find online is confusing! I have a bunch of IN-12As, some of the russian binary-to-decimal ICs (analogous to the 74141N I believe), some 74HC5959PW shift registers and a 'Nixie Tube Power Supply' I bought from eBay - it takes 12V and supplies 5V and 180V suitable for Nixies (supposedly). I do all my electronics work on breadboard (I managed to fry one of these power supplies already when two Nixie tube wires touched - oops) so I'm trying to design a PCB to hold two IN-12 Nixie tubes, the two bin-dec ICs and a shift register. The idea being that this could be stuck on the side of a breadboard and used as a simple nixie breakout. As it uses a shift register I'd also like them to be daisy chainable (so you could have 5 of these side by side and simply tick 40 times rather than just 8 to update all 10, rather than the usual 2). Enough rambling and back story - How should I design this circuit (I'm using Eagle)? I currently have this layout: My questions are probably a little idiotic: Where does my powersupply above come into this? (Do I drive the IC1 and IC2 with it?) Have I made any big blunders? If you'd like this Eagle file you can download it here - if I get something working I'd love to release it so others can use it too, so consider it free of any copyright. (as a side issue - if anyone has any recommendations as to places to have small runs of PCBs made in the UK I'm all ears!) AI: A Nixie tube is a version of a standard cold cathode vacuum tube / valve / ... . The Anode is most positive and the Cathode or Cathodes most negative. The diagram below from here shows a typical Nixie which is representative enough of your one for the purpose. The Anode connection (A) is taken to high voltage +Ve via a resistor or current source. The Cathodes are grounded via the driver IC when illumination of the selected element or elements is wanted There are numerous excellent Nixie Tube websites available. See some references at the end. Finding Nixie tube driver circuits etc. Go to Gargoyle or search engine of choice and enter nixie driver Then the magic part - select "images". Pages with circuits become clear and allow easy searching. Gargoyle manages this Producing: Excellent DIY page - At a skim he seems to be over voltaging his driver ICs - I'd need to look to see if I've missed something. Ah - clever. IF another Cathode is on, an off-Cathode will rise to the struck voltage of the other Cathode. If all are off it may be "interesting". Even a "." would do. {How to drive Nixie tubes](http://www.glowbug.nl/neon/HowToDriveNixies.html) they say. Building a Nixie Clock - Excellent !! Another - excellent Open Source? project - even the photos alone are useful. HV513WG ICS. An instructables mainly kit assembly but some use. Driving Nixie tubes. Some driver ICs have high voltage outputs intended for driving thermionic devices such as Nixie tubes or electroluminescent displays. If you want to use a "standard IC" with maximum voltage of 5 V or 15V or similar then you need some sort of high voltage buffer or driver. The most basic method is to use a "common emitter" transistor buffer - the IC drives the base via a resistor and the high voltage to be switched to ground is connected to the collector as shown below. Use MPSA42 transistor or equivalent (probably). The above circuit turns the Nixie on when the base drive is high and off when Vin = low. If a driver IC is used low = on and high or float = off then the sense is inverted by this circuit. The circuit below also provides high voltage buffering but with no inversion. Vin = low = on , Vin = high = off. The disadvantage (or a feature :-) ) is that Q1 provides voltage buffering but not current buffering - the IC must provide whatever drive current is required by the load. This is a "common base circuit". This arrangement in this sort of context is extremely useful but rare - I searched google images and could not find a single example that I could adapt. Nixie tester Somebody having fun. From here - circuit and here - webpage Nixie power supply. Nothing overly special about circuit. THIS CIRCUIT WILL HAPPILY KILL YOU IF YOU LET IT !!! From here A mainstay in the low power high voltage transistor world for many decades has been the TO92 packaged MPSA42. This is rated at 300 V Vceo. Much less common and almost unknown is the MPSA44 rated at 400 V. I have a few of these that came my way with a large collection of parts but have never seen them in the flesh anywhere else, whereas the MPSA42 is very common. MPSA42 in a TO92 package (std small plastic 3 pin) are in stock at Digikey at $US0.21 each in 25s. Digikey list MPSA44 but show no stock. SMD SOT23 equivalent for pricing, and for datasheet Fairchild KST42 = 300V, KST43 = 200V. Note the 2/3 part number and 300/200 voltages are swapped However, Digikey list an MPSA42 variant in stock at an utter bargain price. BUY THESE NOW -> STPSA42 2 CENTS EACH IN 25 quantity These are presumably end line at such a fantastic price - but they show 16,000 in stock. STPSA42 datasheet - 300V, 500 mA - but not both at once (or not for long). Here's another end line HV bargain. TO220, 400V, 4A, $US0.23/1, $US0.16/1000 BUL704 and datasheet !!!!!!! Worth knowing about: SOT23, 500 V.150 mA. 42 cents/25 datasheet here Ah doo een oh ! | Happy new year L-) Nixie Tube Clock - liable to be relevant. Vast quantity of parts. Impressive and here Wikipedia is useful Nixie World - many fun examples in German and English. Data on numerous specific tubes Example tube Another Tube Clock - wow! The Woz shows off his Nixie Tube Watch - Apple as it was meant to be. Gallery of Nixie Tube clocks
H: Transistors: why are resistors needed? I have a solid state relay which needs at least 3V to activate, and I need to toggle with a 2.3V output from a microcontroller. I've also got a 6V 1A power supply which I can use to power the relay. I understand I need to use transistors somehow and I've got the basics down, but I don't understand why I need resistors in the circuit for the transistor to work. So my questions are: why do I need resistors, how do I know which resistor to use, and which transistor is suitable for my needs? (The solid state relay is a Crouzet 84 134 900) AI: Resistors in this situation are about current limiting. If you applied your 2.3V micro output directly across a transistor base-emitter junction, the transistor would try to draw far more current than is really needed, which would harm either the transistor, the micro, or both. So you put a 500 ohm or 1K resistor in series and this limits the current into the BE junction. The particular value depends on the transistor. You'll choose your transistor primarily based on the needs of the relay. You need something that can withstand the 6V supply when not conducting, and that can pass enough current to close the relay when it is conducting. Now, you said this was a solid state relay, so this current is probably a lot less than you'd need for a mechanical relay, so you'd probably get away with any garden variety switching transistor, e.g., 2n2222, 2n3904, etc. Fwiw, there are solid state relays that can be directly driven by logic circuits.
H: Best way to send sensor readings over simple RF connection I have bought a pair of simple 315MHz TX/RX modules. I want to use these to connect a battery powered ATTiny85 to an Arduino base station. The ATTiny needs to regularly wake up and send a sensor reading to the base station. In theory I should be able to simply write data to the TX and read it from the RX module. However, how do I ensure that I write/read at the correct rate? What code do I need to use to transmit at a particular speed (bytes/second)? What is the best way of doing error correction/detection? Since I want the transmitter to be battery powered could I use a transistor to turn off VCC to the TX module when idle. What will the RX module receive when the TX module is powered down? AI: Those modules basically make the receiver pin wiggle in response to how you drive the transmitter pin. They know nothing about what you think wiggling the pin means, and don't contain a UART. More details weren't immediately obvious without digging. That's your job, so I didn't bother to go further. You should provide a link to the datasheet, not the product splash page. These modules work on AM modulation. The short writeup says ASK, but it's probably just on/off keying of the transmitter (which is technically a subset of ASK). The problem with this scheme is that the receiver can't inherently know the level for when the transmitter is on. It therefore most likely looks at recent received signal strengths and picks a value in the middle to decide between on and off. This is called data slicing. If you are not regularly transmitting ons and offs, the receiver looses track of what levels on and off are, and can no longer data slice correctly. This is usually dealt with in two ways. First, a preamble is sent. This contains a bunch of ons and offs in rapid succession so that the receiver can settle on a good data slicer threshold. It is expected that some or all of these bits are not correctly interpreted by the receiver, so are therefore not really "received". The second strategy is to send data so that there is always a recent on and off for the receiver to refer to. Some receivers, particularly cheap ones that do the data slicing in analog, just slice about the low pass filtered average received signal strength. For such receivers, you not only need to vary between on and off frequently, but the average needs to be close to 1/2 on. This is why manchester encoding is so popular for such RF links. I won't go into manchester encoding here since this is well known and you will have no problem finding lots of information on it out there. One nice feature of manchester code is that it averages to 1/2 on over each bit. A bit is divided into two halves. On-off may mean 1 and off-on 0. Manchester is probably the best easiest to do encoding scheme. You can use a UART, but you have to be careful and you will give up some bandwidth (battery power). Look at what a UART will transmit. If you send the characters immediately following each other, then each one will take 10 bit times. There will be a start bit, 8 data bits, and a stop bit. The start and stop bit are always opposite polarity. You can arrange to use codes in the remaining 8 bits that have a equal number of 0s and 1s to keep the data slicer threshold in the middle. This means you only get to send 4 bits of information in each UART character. You'll also have to think about the preamble carefully. In general, you should assume any one RF transmission has a significant chance of bit errors. This means some kind of checksum is a good idea. You can send data in packets, and include something like a 16 or 20 bit CRC checksum with each packet. If the packet is not received intact, then it is discarded like it never happened. The system also has to deal with the random noise received when the transmitter is powered down. In that case the receiver threshold will drop and it will start data slicing whatever random noise it picks up. With a properly designed preamble and checksum, you can make the chance of random noise looking like valid data vanishingly small.
H: How to Design Binary Multiplier for 2 bits? \$(X_1,X_0)*(Y_1,Y_0)=>(S_0,S_1,S_2,S_3)\$ What should I use here? Half Adders? Full Adders? MUX? What goes were? AI: Think. You learned the on-paper multi-row method of decimal multiplication? Just transfer that to binary. All you need is addition (HA and FA) and multiplication (AND, but a suitably wired MUX will do fine). Your teacher was mild, in the assignement below I ask for a 4 x 4 multiplier :) The text it Dutch, but it might give you some hints. It also show a block diagram of an 8 x 8 multiplier. http://www.voti.nl/hvu/1ICSN1/2004-2005-1ICSN1-5-p.doc
H: Solenoid Electrical Characteristics I'm looking at this line of solenoids, but I'm not sure how to figure out the electrical characteristics. If the solenoid is rated at 12VDC, and 3W, does that mean I can strap it across a 12V supply, and the solenoid won't melt? As in the manufacturer built in a 48 Ohm series resistance to limit the current to 0.25A and I don't have to rely on something else in my circuit to limit the current? Also, assuming I wire it like this: How long does it take for these things to de-magnetize in general? Microseconds? Milliseconds? It should be determined by the inductance of the coil, but the inductance isn't specified in any kind of solenoid datasheet I can find. AI: As Just said, the voltaqe rating of a solenoid is what you use. The power rating tells you how much power it will take to keep it energized. 3W / 12V = 250mA, which is what the solenoid will draw in steady state with 12V applied. Manufacturers often list a family of solenoids with a particular wattage, because that is what remains constant accross the various coils they offer in that family. To keep the magnetic force the same, the same number of turn-amps is required. Let's say they make a variant with twice the number of turns. That means it only needs half the current to achieve the necessary magnetism. To keep the physical size of the coil the same, the wire diameter needs to be 1/sqrt(2) of the original version, which is half the cross-sectional area. Half the area means twice the resistance per length, but the new coil is twice as long so overall has 4 times the resistance. To get half the current of the original version, you have to apply twice the voltage to this new coil. Note that in the example the voltage doubled but the current halved, which means the power stayed the same. I haven't looked, but the manufacturer probably offers otherwise identical solenoids with different voltage and current combinations that all come out to about 3W, like 6V at 500mA, 24V at 125mA, etc. As for the turn off speed, that is limited by the mechanical part of the solenoid. The magnetic field is proportional to the current instantaneously. If you make the current stop, the magnetic field will stop too. Whatever was held in place by that magnetic field still has inertia, and will therefore take some time to react. Relays, which are solenoids with a well controlled and known mass to move, can switch in a few ms for fast ones to a few 10s of ms for ordinary ones. Generally solenoids move heavier things, so the system takes longer to react when the coil current is shut off. This all depends on the mass that is moving and how much force is pushing it. See Newton's second law.
H: How can I make my own potentiometer? I want to create my own potentiometer for a project. Part of the reason is because I believe it'll be more adapted to my needs but I must admit that it seems like something really fun to do. I've read online that the resistive part of the potentiometer is either made of Graphite or a "resistive cable". I know many good stores selling electronics component but I wasn't able to find graphite stripes to make my own potentiometer. Another idea I had is to use a cable used for heating since they are pretty resistive by definition. I'm just not sure if it could work correctly. So what are my options? AI: MAKING YOUR OWN VARIABLE RESISTORS Anything conductive, accessible, doesn't oxidise, able to be "wiped" with a wiper (resistor pickup) with adequate dying "too quickly". As this is as much for fun as anything else "too quickly" may be able to be of lower duration in time or cycles than usually. Resistance values that you generate may be lower than not, depending on material used. Properly "potentiometer" mans a 3 terminal device with voltage across it and a sliding voltage tap but I'll take it to also just mean 'variable resistor. Connection to start may be with "crocodile clips or pushed in "drawing pins" / "thumbtacks/other. Pencil lead. Select an old (or new) pencil. Sharpen both ends. Measure resistance to see what sort of pot resistance you are going to get. CAREFULLY break open and remove the lead intact. May need a few pencils to get it right. Connect clips at either end. Connect ohmmeter to one end. Run other ohm-meter along length and note variation in resistance. If you connect a voltage across length then you can use a slider to puck off variable voltage with position. Resistance wire In place of the pencil lead above you can us a length of new or used resistance wire. Wire can be strethed tight between eg thumbtacks or nail in a piece of wood. Note that wood becones part of the resistor. New Nichome or Chomel wire canbe bought for modest cost. Ohms per metre varies with thickness - thinnest possible is liable to be best. Around 10 ohms/meter is common but higher R is possible. Nichrome from old heater or toaster element works. This may be somewhat oxidised with age and may be brittle. You can sand surface carefully once stretched in place. Butyl Rubber and friends Black rubber used for roofing has carbon black in it. Take meter and wander round sticking probes in rubber on sale and other material. When you find a sheet of substance that has some resistance acquire a small sample by best permissible means and cut strips to make a pot. Paper and salt water. Lay out a strip of newspaper Wet well but not until soggy with salt in water solution. Test pot. Note how result varies with salt concentration, degree of saturation of paper, passage of time, ... Try copper-sulphate in place of salt. Try "Epsom Salts" Try ... ? Copper wire !!! (1) Get thinnest possible bare copper wire. Measure resistance. Low but usable. (2) Now for a very good trick. Get thinnest (within reason) enamel or varnish or polyurethane insulated copper wire. Sortthat insulation can be "sanded" off with care. Find a "former" that is an insulator and that you can wind your copper wire on. Round or oval cross section is good. Once you have built one you will get a better feel for shape that is needed. Wind copper carefully and neatly in a long ish coil along formr. Many turns. Not too too many the first time. Wind neatly so turns stack against each other neatly. Fasten carefully at both ends. Now CAREFULLY use fine sand paper to sand along top surcae of coil so you expose copper on each turn BUT DO NOT TAKE OFF SO MUCH THAT COIL TURNS ALL GET SHORTED TOGETHER. Run a wiper along the bared copper. You have a wire-wound variable resistor. "Plastic" Use epoxy resin and silicone rubber. Fill with various amounts of carbon black, or pencil graphite or powdered metal etc. Make a track. Let set. Test. Also silver filled compound used for PCB track repair. Also ??? - look around you ... . By now you should have a few other ideas. Report back :-) !!!!
H: How to make my own volume control for headphones? I have headphones that don't have volume control built in on the cable, so I thought why wouldn't I try to make one? However, I don't know where to start. Is it enough to just use a logarithmic potentiometer, or do I need something more? If just a potentiometer is enough, what should be its ohmage? I also use FIIO E3 headphones amplifier. Is it better if I put volume control before or after the amplifier? At what should I pay attention to avoid creating hum or other unwanted noises? My headphones are: http://www.sennheiser.co.uk/uk/home_en.nsf/root/private_headphones_dj-headphones_500156 AI: The writeup you linked to doesn't say much useful, but it appears these are bare speaker-type headphones (guessing from the size and shape). That means they are probably small speakers with 4 or 8 Ohms impedance. You don't want to put a pot in line with speakers. That wastes power, doesn't present the right load to the amplifier, and probably messes up the frequency response due to the impedance change. The best place to put a volume control is in the signal path, not the power path. This means put it at the input of the amplifier that drives the headphones. Whatever is driving the amplifier input is probably a "line" output. These usually have a few 100 Ohms impedance with a nominal 1V signal. A 1 kΩ logarithmic taper pot would be about right. Nowadays logarithmic tapers are harder to find because old fashioned analog pot volume controls aren't used that much. Nowadays the signal is handled digitally somewhere anyway, so the volume control is done by a digital multiply. If you can't find a logarithmic taper pot, it's not that big a deal. A linear taper will have a lot of change at the low volume end and not much at the high volume end, but for just setting a comfortable headphone volume it's probably good enough. You can make a linear pot non-linear by putting another resistor accross the output. This doesn't make it logarithmic, but should spread the volume range out a little. Personally I wouldn't bother with this unless you've tried it directly and really didn't like the result. As for avoiding hum and noise in audio, make sure everything is shielded. If necessary, mount the pot in a small metal box with the box grounded to the bottom lead of the pot, which should also be the ground for the input and output cables.
H: Battery charging questions Parallel charging and battery balancing of LiPos I'm having a long discussion on an RC board regarding LiPo parallel charging. The basic crux is that my understanding of how charging works is something like this: Charger Line voltage of x(8.4v in this case) @ y amps (5.0) with 4 batteries connected. The battery capacities are listed as 2x1000mah and 2x1200mah. Each battery internal voltage will rise as current is soaked into the battery. As each battery approaches 8.4v it will naturally soak less current up until the whole battery bank is approaching 8.4v at which point the peak current will drop low enough that the charger shuts off. My assumption is that each battery will increase in voltage at more or less the same speed given that the battery bank is wired in parallel... That means the 1200mah batteries are soaking proportionally more current than the 1000mah batteries... Or am I drinking too much moonshine? The second part of the question regards balancing, my understanding is that the individual cells (2) are wired in series, this means that those cells have the potential to charge at different rates. Therefore balancing is recommended, but probably not mandatory all the time? Thank you for your time. AI: What colour is the magic smoke when it vents with flame ? :-) Rushing immensely, more later, but ... What you describe seems to run a severe risk of doing damage. To be ure, first you need to specify the allowed MAX charge rate for each LiPo. You have 1.0 + 1.2 = 2.2 Ah in parallel so 5A = 5/2.2 = 2.27C. This MAY be OK if cells are specd as 2C or more and are balanced in draw. If specd at say 10C then it all may survive. If specd at 1C it is very very bad. BUT when a cell pair plateaus at 8.4V it's current will start to drop and if the charger is able to make 5A the extra current WILL flow into the still in current more other battery pair. If max charge rates are not >> 2C then what you describe is at best an extremely poor compromise and at worst a disaster either in magic smoking or in cell lifetimes. If max charge rates are around 2C then what you describe is at best a beating of some of the cells regularly and at worst a journey towards magic smokedom. In an arrangement like this with different capacity pairs wired in parallel you need to carefully monitor individual cell pair or even cell voltages to prevent discharge-damage. This is going to make balancing more important, although I have been impressed with how well cells from the same batch seem to track when I have checked it (not often). Operating cells of different capacities in parallel is an immednsely bad idea usually unless you manage and turn off each pair individually. Apart from one pair endpointing before the other and throwing more charge or discharge onto the other there is a lack of certainty re how cells load share. eg Say you have a 1000 and 1200 mAh cell and load both with 1000 mA. The large cell will see this as less of a percentage load so it's natural terminal voltage will be larger and it will "happily" supply the extra current. but there is no guarantee that it will o this in the ratio of the tywo capacities. The large cell may prove very "sacrificial and provide most of the load for most of its capacity. BUT when it finally falters the small cell will then take up most of the load and may now be overloaded. And there is no certainty that the LARGE cells will not now expire and be driven into a damaging mode. Probably not, but. too many uncertainties. Why run cells of different sizes and in this 2 x 2 pattern? Key question: What are the max allowable charge current rates for the 1000 and 1200 mAh cells. Without this information the question become svery hard to give a good answer to.
H: Unoccupied SMD and TH pads and noise/interference/capacitance Imagine a rather noise sensetive application, My question is if there are unoccopied pads for SMD and through-hole are existing on the board and somehow connected to other components through theire trace lines, what would be the side effects? I have the following PCB which capacitors or resistors are soldered on it (only one of the footprints will be used). What will be the effect of the unsed pads? (This is to measure capcitance/Inulation Resistance): AI: The extra pads, like all parts of a net, will have extra capacitance to surrounding nets. Whether that matters is hard to tell. If you have a nearby noise source that will capacitively couple onto your traces and this noise is significant, then it probably will matter. One way to deal with this is with shielding. That trades off more capacitance to ground in return for greatly reduced capacitance to the noise source. If capacitance to ground isn't a issue, then this is a good tradeoff. One difference to consider between thru hole and SMD pads is that SMD pads are only on one side of the board. If they are on top, then the bottom layer could possibly be used as a shield, eliminating coupling from noise on the bottom side of the board. This doesn't work with thru hole pads since they are on both sides of the board. If the noise source is external to this board, put it in a metal box. If you are worried about coupling between components on this board, then ground or guard traces may help.
H: Web-resources for learning how to read electrical circuits I would like to learn how to read electrical circuits. My final goal is to be able to develop some basic "smart" digital devices using microcontrollers. Could someone please suggest a nice web-tutorial on this topic. Thanks! AI: There is more to schematics than just being able to "read" them. To read them you may think you just need to understand what the symbols mean. Yes, that is an important part of it, like knowing what the letters of the English language mean. But you also need to understand how the components in the circuit work, and how they interrelate to each other (kind of like Grammar and Syntax). To learn the symbols all you need is a list, like this one: http://www.kpsec.freeuk.com/symbol.htm However, to understand what the components do and how they work you will need the following: Knowledge and training of the basics - resistors, capacitors, transistors, inductors, etc. Knowledge and training of how the more complex devices operate and interrelate - op-amps, microcontrollers, other specialist chips. Data sheets for any components that are more complex than a simple resistor or capacitor (unless you require high tolerances in which case you may want data sheets even for those). So it's not like learning to read another language, like say Japanese. It's learning the language and the culture and the history of the country. Yes, there are often common themes in circuits, where you will see recurring schematic chunks - like the Darlington Pair, the Emitter Follower, etc, but even a common circuit chunk like that could operate completely differently in a different circuit.
H: High Resistance PCB materials - reasons behind it? I like to know if there is a relation between using a high resistance (the more expensive stuff) and environment noise effect on circuit. The reason is I heard for high frequency or sensitive applications, PCB's has to be made with high quality - high resistance materials. Is this count as a way to fight with noise or loss of signal? What can be the very particular reason of such design? Also, using high-resistance top layer on PCB's would account for preventing interference between individual traces on PCB it self? Here is the link to the article which made me start thinking about this!: http://www.pcbdesign007.com/pages/columns.cgi?clmid=9&artid=21182 AI: As Russell said, all pure PCB material is high resistance. However, there are different processes. Not all PCBs are created equal. I worked for HP a long time ago, and one of the divisions had a special "high Z" process. There were specs for Ohms per square, but I don't remember the numbers. Theirs was significantly higher than what you'd get ordinarily. If I remember right, the main difference wasn't so much the material but its handling and particularly its washing. They may have used a special solder mask. I do remember those boards were more shiny on the surface than ordinary boards. There was a paper on that stuff, and what I remember most of it was about getting rid of stray ions by more careful washing procedures. The raw material is a very good insulator. Just about all surface conductivity is the result of impurities (dirt), particularly ions left over from the other processes the PCB is subjected to during manufacturing. This also means you have to keep the board clean and handle it carefully after manufacturing else it won't stay high Z. One fingerprint in the wrong place and you've wasted your money on the high Z process. As for why you'd want it, it is for high impedance signals. Leakage currents can add up fast on PCB traces. 10 MΩ/square may sound high, but if you have two tracks running next to each other for 10x the spacing between them, they are essentially connected with a 1 MΩ resistor. The usual and more reliable way to deal with very high impedance signals is to use guard traces. The high impedance trace drives a unity gain buffer amp. The trace into that amp is then surrounded by the buffered output. Since that is at the same voltage or close to it, any resistance to the guard trace won't cause current. You have to be careful in layout to make sure the guard trace properly surrounds the high Z trace everywhere current could leak accross the PCB surface. This guard trace scheme allows boards to have lower surface resistance so makes things more reliable. Sometimes when even that isn't good enough you look into special high Z PCBs. After that it gets big and expensive, like special glass insulators and the like. You don't go there unless you really need to, like you're in the GΩ range.
H: Any way to identify "directionality" of electret microphones? Picked up a handful of electret microphones from a local component store, and store owner claims them to be generic. He calls all components generic for which there is no data-sheet or specific part number. Wondering, if there is any way to determine if these are uni-directional mics, or omni-directional ones ? Doing some search to see if there are any distinguishing physical characteristics, I came across pictures almost the same, just that few seem to have 3 leads, and most have 2 leads. Edit: This is an alternate approach I am trying, by replacing the electret microphone that came with an el-cheapo baby-monitor, which is definitely omni-directional, and currently results in pretty terrible howling, when the 2-way talk feature is activated. The other approach is in-discussion (as some might have seen/noticed) in this question. AI: In terms of actual directionality, you'll probably just have to test them by measuring the response to a source at different angles. Normally this would be done in an anechoic chamber, but you might be able to accomplish something by supporting the microphone on a post well off the ground in the center of a large carpeted room and walking around it with the source, or outside on a calm day. You could tie a string to the post to measure a consistent radial test distance. Directionality will probably be somewhat different at extremes of frequency. Since your source probably wouldn't be omni-directional, try to be consistent for example always aiming it at the microphone.
H: Avoiding echo/feedback on speaker-phones, how? Even a $20 mobile phone with a speakerphone has no problems of feedback. While I understand that companies like Mediatek have use crazy volumes to bring down mobile chipset prices so low, but reading some articles I get the impression that the circuitry/electronics to suppress/remove feedback from such speaker-phone arrangements where speaker and mic are placed in very close proximity, is fairly complex (involve powerful DSP), involved and expensive. Am I missing something very basic here ? Are there some environmental constraints that are used, in case of mobile-phone to simplify the design of such circuitry and there-by, keep the costs low ? I am approaching this from the study of an el-cheapo baby-monitor with 2-way "talk" feature, where, in the problem of feedback is terrible. I've tried several things s.a. replacing the electret microphone, speaker type of this device, to no avail. This audio codec used on this device is apparently an ALC one but much of the chip's surface is etched, but I do know that the processor is a Winbond ARM7. It had a shiny sticker on top which I managed to scratch-off to reveal the part number. AI: The audio processing algorithm you are interested in is called "Acoustic Echo Cancellation", or AEC. It is most commonly used in speakerphones to remove the output of the speaker from the mic signal. Most of this benefit is to the person on the other end of the phone call, since he won't be hearing echos of himself. Some cheap and not so cheap speakerphones don't use AEC. I have a Polycom speakerphone which is "half duplex". Meaning that when one side is talking, the other side is muted. Because of this, there is no chance for echos or feedback to happen. Unfortunately, this also allows for a "filibuster"-- if one side never shuts up then the other side can never interrupt. There are many types of AEC algorithms, and almost every type is patented. Most of them involve some form of modeling, where a model of the "speaker to mic acoustic signal path" is created. Once created, we can predict how the speaker output will be picked up by the mic, and thus remove that signal from the mic, leaving only the intended sounds in the mic signal. This model would thus figure out how the sounds reflect off of the walls and other things in the room, etc. The patents for AEC usually center around exactly how this model is initially created and later updated as things change in the room (mic position, position of people and furniture, etc). In addition to the "room model", there are other noise-reduction algorithms used. While these algorithms are not technically part of AEC, there are no useful implementations of AEC that don't use these. Normally there is some sort of simple noise-gate (or a multi-band noise gate). Other algorithms are also typically used, but are either patented or treated as a "trade secret"-- which is why I can't tell you about them! :( Most AEC algorithms operate on a limited frequency range, 300 Hz to 3 KHz, which is the same frequency range as most telephones. Increasingly, wide-band AEC is becoming popular with the advent of higher-bandwidth teleconferencing/telepresence systems. AEC algorithms are very computationally expensive, and the wide-band AEC requires several times more horsepower than the more limited versions. It is not uncommon for a single "run-of-the-mill" DSP to only be able to do 1 or 2 channels of AEC. For a high quality wide-band AEC, a single high-powered DSP might be required for a single channel. AEC algorithms are also very difficult to implement. In the entire USA, there are perhaps only 10 or 20 people who have the ability to write a good one. One very smart person that I know just wrote a wide-band AEC algorithm and it took him over a year! For a 2-way baby monitor, I highly recommend using a half-duplex approach!
H: Why there is only 4.5V at the 5V output of my arduino board? I have an Arduino Uno R3. At the 5V output port of the board with nothing connected and blinky running while powered through USB, I can measure only 4.5V. Is this normal? Or is there anything wrong with my board? AI: Now that you've posted the schematic, a straight answer is possible. That schematic is a sloppy mess, but I know that's not your fault. It doesn't say much about the folks that designed your arduino board though. Yucc. It makes you wonder what else they didn't pay much attention to. The board can be powered from USB or a external supply. When from USB only, there is a diode from the USB power to the "5V" supply. The USB supply voltage is nominal 5V, but can be lower than what you actually measured in some cases. What you measured is about expected with 5V from the USB then with a diode drop in series. It looks like there is at least a reverse blocking diode (D1) at the external DC power input. That means if you hook up the external supply backwards the board won't run but nothing will be damaged. You therefore didn't break anything, at least due to providing the wrong external supply polarity.
H: How should I organize this star grounding network? I am trying to lay out a PCB for a SEPIC switching regulator. However, I cannot be sure how to layout the ground tracks. My area and budget are limited and my components are big. A picture says more than my words, so here are the schematic, my questions and some more details: I only included some of the components for the sake of simplicity, if the whole schematic needed, I can upload. Grounds of CU2, U2 and U1 are tied together (may be daisy chained), then gathered in one point which is "AGND". Grounds of C1 (which supplies the additional current to the push-pull driver since 78L12 can only supply 100mA), Q2 and Q3 are star tied together at one point that is "PGND". Then, PGND and AGND are star tied to the ground point of C6, which I've chosen to be the reference point. If my star network is connected wrong or can be problematic, how should I organize it? Is the ground side of C6 a good place for the reference point for the star ground network? Will daisy-chaining AGND nodes lead to problems? Should I star-connect 12V rails, if so, how? (U1 has a 100nF bypass cap which is not shown here) Here is the datasheet for Q3 which is a IXTP44N10T. BC817 and BC807 are 500mA transistors. Here is the internals of 78LXX. If it will help, here is my current board layout for the mentioned part: Top, Bottom, Bottom Inverted AI: Star grounds for most things, and especially for power supplies, is bad. It is much better to just have a giant solid ground plane across the entire PCB, and have short & thick traces from your components directly to the plane. While you're at it, you should have a solid plane for your +12v rail. Although I'm less sure about this, because it depends a lot of stuff you didn't put in your schematic. The reason why star grounds are generally bad is because it provides the opportunity to have ground voltage differences in different areas of the PCB's due to current flow in the ground traces. Very careful PCB routing with really wide traces can prevent that, but just using a solid plane will reduce the ground inductance/resistance enough that for most applications the need for a star ground (or isolated ground) just goes away. Update: If for some reason you can't have a solid ground plane, then approximate one as best you can. Do it like this: First, identify your high-current paths. This is normally your Vin, Vout, any FET's and Diodes used as the switching elements, inductors, the caps on Vin and Vout, and the GND that connects these parts. Route these traces first. Make them as short and fat as possible. What you're trying to do is give that path a very low impedance/resistance and also reduce the loop areas. After that, route everything else. When routing the GND, try to approximate a gnd plane. Sure there will be lots of holes, but you'll get reasonably close. And since you routed all of your high-current GND traces already, the really critical stuff has already been done. It is most important to reduce the noise on the high current paths, even if that means more noise on the grounds. This is a switching regulator after all, some noise is to be expected. By dealing with the high current paths first, you are going to have a higher net noise reduction than anything with a star ground. Unfortunately, if you can't have solid power/ground planes then everything is going to be a compromise. It'll never be perfect, and it'll never be "right". You'll have to settle for "good enough". On the plus side, I'm sure you can end up with something that works for you.
H: Charge board timer conditions/disabling - mcp73213 Datasheet for MCP The MCP73213 has a built in timer. In the datasheet it states the typical timer elapsed values are 0(disabled) 4, 6, and 8 hours. The conditions column is empty. I need to disable this timer, or at least set it to 8 hours (or max allowed time). Is there any way to? I have contacted Microchip support with no response. Has anyone had success with their support? AI: Table 1 in the data sheet gives you all the options for the device configuration: The subtle clue in this table is the words "Factory Preset Options". The timers, voltages, output status - in fact everything configurable - is configured at the factory, not by you. When you purchase the chip you specify the settings you require, and they configure it for you (in reality they will probably have pre-configured chips to cover all the option combinations). It then goes on to say you should contact your local rep to get samples, and that samples come always configured for 6 hour timer.
H: Why buy protocol analyzer modules for an oscilloscope? Scopes with logic analyzer inputs often have optional add-on modules that let them decode various serial protocols: SPI, RS-232, I²C, CAN, etc. Tek and Agilent want around US $700 per protocol family for theirs. My question is, why would I want to buy a software module more expensive than Photoshop to do this when there are many PC-based protocol analyzers on the market at a fraction of that cost, many of which decode multiple protocol families? Are Tek, Agilent, et al just soaking EEs, or do these modules have features you don't get with a US $150-400 PC-based protocol analyzer? AI: I think the main benefit is that you can measure analog signals directly correlated in time to decoded serial protocol traffic in an integrated display. These types of modules will also often come with an indexed search kind of capability to let you jump to user-defined events through the common interface of the scope. Sometimes they will also identify errors or warnings in the serial traffic as well. Lots of bells and whistles beyond just decoding the serial traffic for you. For a very large company that bills engineering hours at say $100/hour they can justify such a capital expense if the features of the module will save 7 hours of labor (debugging time) over the useful life of the scope/module, as compared with the doing that same labor without it. The calculus works out, since these companies are obviously able to sell them. Whether that kind of thing is worth $700 to you is another story though.
H: How to use Counters ONLY to construct a School Bell circuit? I am really stuck here, our instructor told us not to use the 555 timer (and to be honest I never used it). So we are supposed to make a circuit by using counters only, I guess. How can I generate time periods, and set time in seconds or minutes? Is Johnson Counter the best to use here? I included the project needed and the periods I made, if any one could help me on that. My project is due to next Monday, and I would be really grateful if someone could give me an idea or a hint to start. The Project: Design a digital circuit that can be attached to a school bill which can work automatically from 7:00 AM to 12:45 PM, and it has the following features 1- Rings for 5 seconds. 2- Start ringing 7:00 AM to announce for the field gathering. 3- Rings 7:20 for going to class. 4- Rings for the start of the first class period at 7:35 AM. 5- Rings for end of each period after 40 minutes from its start. 6- Rings for break after 10 minutes from the end of the previous period to announce for the next class period. 7- After the third period, a break of 30 minutes. *The Bell rings for 5 seconds. 7:00 AM (Ring for field gathering) 7:20 AM (Ring for going to class) 7:35 AM (Ring for the 1st class START) 8:15 AM (Ring for the 1st class END) 8:15 AM – 8:25 AM (Break for 10 minutes) 8:25 AM (Ring for the 2nd class START) 9:05 AM (Ring for the 2nd class END) 9:05 AM – 9:15 AM (Break for 10 minutes) 9:15 AM (Ring for the 3rd class START) 9:55 AM (Ring for the 3rd class END) 9:55 AM – 10:25 AM (Break for 30 minutes) 10:25 AM (Ring for the 4th class START) 11:05 AM (Ring for the 4th class END) 11:05 AM – 11:15 AM (Break for 10 minutes) 11:15 AM (Ring for the 5th class START) 11:55 AM (Ring for the 5th class END) 11:55 AM – 12:05 AM (Break for 10 minutes) 12:05 AM (Ring for the 6th class START) 12:45 AM (Ring for the 6th class END) AI: However you do it you will require some kind of time signal as a base for your system. That could be the (banned by your teacher) 555 timer, or a crystal oscillator, or anything which will give a regular on/off signal with a known frequency. Then you have your counters. Now, a binary counter module (like the 74xx393 for example) is also a frequency divider. Take this truth table for example: IN | Q1 | Q2 | Q3 | Q4 ----+----+----+----+---- 0 | 0 | 0 | 0 | 0 1 | 0 | 0 | 0 | 0 0 | 1 | 0 | 0 | 0 1 | 1 | 0 | 0 | 0 0 | 0 | 1 | 0 | 0 1 | 0 | 1 | 0 | 0 0 | 1 | 1 | 0 | 0 1 | 1 | 1 | 0 | 0 0 | 0 | 0 | 1 | 0 1 | 0 | 0 | 1 | 0 0 | 1 | 0 | 1 | 0 1 | 1 | 0 | 1 | 0 0 | 0 | 1 | 1 | 0 1 | 0 | 1 | 1 | 0 0 | 1 | 1 | 1 | 0 1 | 1 | 1 | 1 | 0 0 | 0 | 0 | 0 | 1 1 | 0 | 0 | 0 | 1 0 | 1 | 0 | 0 | 1 1 | 1 | 0 | 0 | 1 0 | 0 | 1 | 0 | 1 1 | 0 | 1 | 0 | 1 0 | 1 | 1 | 0 | 1 1 | 1 | 1 | 0 | 1 0 | 0 | 0 | 1 | 1 1 | 0 | 0 | 1 | 1 0 | 1 | 0 | 1 | 1 1 | 1 | 0 | 1 | 1 0 | 0 | 1 | 1 | 1 1 | 0 | 1 | 1 | 1 0 | 1 | 1 | 1 | 1 1 | 1 | 1 | 1 | 1 You can see that Q1 is toggling at half the speed of the IN pin. Q2 is toggling at half the speed again, and Q3 at yet half again - and so on. So, it could be said that the frequency of Q1 is half IN, and Q2 is 1/4 IN and Q3 is 1/8 IN and q4 is 1/16 IN. Therefore, if you have an input frequency of, say, 32768Hz (the speed watch crystals run at) then just using counters you can get: 32768Hz 16384Hz 8192Hz 4096Hz 2048Hz 1024Hz 512Hz 256Hz 128Hz 64Hz 32Hz 16hz 8Hz 4Hz 2Hz 1Hz - that's 1 second pulses 0.5Hz - 2 seconds 0.25Hz - you're at 4 second pulses now 0.125Hz - 8 seconds 0.0625Hz - 16 seconds 0.03125Hz - 32 seconds etc You can see how it's possible to build up some fairly long periods from what starts out as quite a fast input clock. Combine various counters together and you can soon get lots of different times. Of course, if you start with a different frequency you can get different time combinations. For instance, if you create a 0.2Hz clock signal to begin with (that's a 5 second pulse) then use the counters, you can make 10 seconds, 20 seconds, 40 seconds, 80 seconds, 160 seconds, etc quite easily.
H: What kind of signals can a frequency synthesizer like this generate? Take this chip as an example: http://www.maxim-ic.com/datasheet/index.mvp/id/3491. It says that the frequency range is 8.1kHz to 133MHz on the main output and 8.2MHz to 133MHz on the reference output. But, to my untrained eye it doesn't say much else. The datasheet left me with a few questions: What kind of oscillator is it? Sine wave, triangle, saw tooth? It says it only needs a single +5v supply, but what if I wanted the sine wave to oscillate between, for example, -2.5 volts and 2.5 volts? I know I can build an oscillator with an op-amp, but this question doesn't relate to that. I'm merely curious about the nature of chips like the one I posted. AI: The output is a square wave compatible with digital logic. The "high" state is at least 2.4 volts and could be as high as the power supply. The "low" state is between 0.0 and 0.4 volts. Chips like this are used for generating clocks for digital logic and are not suitable for making sine waves.
H: Poor eye diagram, where to start looking? I'm trying to debug a 100Mbit ethernet board and I'm running up against a problem I'm having trouble trying to resolve. This is the eye diagram for the transmit pair. The receive pair is very similar. It's a LAN8700 PHY, and I've got the MII interface effectively disabled, so the PHY is transmitting IDLE code sequences. It's forced into 100Mbit/FDX as per the datasheet. 100Mbit/HDX is identical. Correction: The design is using the LAN8700's internal 1.8V supply to power its VDD_CORE net; I must have been confusing the 1.8V logic supply with the VDD_CORE supply in my earlier description. It seems to me that power supply noise is not such a high likelihood, since the high, zero and low levels are actually pretty decent. That is, the eye isn't "squished." The fact that the violations all look like very good transitions, just "skewed" in time makes me think the problem lies in the crystal or supply for the crystal driver/PLL in the PHY. If I let the eye diagram run (about 15min) the violations in the mask "fill in" such that the white violations you see in the picture become white chevron (>) shapes in the right-hand sides of the blue masks. This would tell me that the timing errors are more or less randomly distributed rather than some kind of discrete noise yanking the timing off an exact amount. The crystal that the PHY is using has a 30ppm spec which is well within the 100ppm 802.3 spec, and even within the 50ppm recommended spec that the PHY specifies. I'm using loading capacitors which match what the crystal is looking for, and is pretty close to what the LAN8700 specifies as its nominal capacitance. Before I disabled the MII interface I would see framing errors (as reported my Linux's ifconfig program). There are no errors if I force the link to 10Mbit. One of the very odd things I have noticed is that if I set the scope up to trigger on the RX_ER (receive error) signal from the PHY to the MAC, it never signals an error even though the frame errors accumulate in the MAC reports. Now from reading the datasheet for the PHY, it is clear that there are actually very few situations where RX_ER would assert, but I find it very difficult to believe that with an eye diagram like what I am seeing the errors are actually between the PHY and the MAC. I do understand the basics of eye diagrams, but I'm looking to some of the more experienced posters, hoping that they would be able to share some of their experiences in translating specific eye pattern mask violations to likely sources. (edit: added schematic, corrected VDD_CORE supply source) AI: I see many things that could potentially cause the eye diagram issues that you see. No "smoking gun", but some things that could potentially mess things up. You have 0.01 uF caps (C211, C212, C214, & C217) on the unused pins of the RJ-45 and the center taps of the transformer. I recommend shorting out those caps. Your use of caps here is unusual and could cause issues later on, although they are unlikely to be causing the eye-diagram issues you're having. Near as I can tell, the only reason to have these caps is as a DC-Blocking scheme for when someone is using a non-standard power over Ethernet scheme. Standard POE doesn't need this protection, and since the POE standard is now "old" you are unlikely to encounter non-POE standard equipment. Remove C19 and C25, 10 pF caps on the Ethernet termination resistors. These are way too small, and too far away from anything critical to be of any use. Change C18 and C24, 0.01 uF caps on the Ethernet termination resistors, to at least 0.1 uF. You could even try 4.7 uF. The "power rail" that these caps are decoupling needs to be fairly stable, and there could be a surprising amount of current flowing through the termination resistors. If L4/L5 is restricting current flow too much, and the caps aren't taking up the slack, then you could have data errors. Remove C16, C17, C22, and C23-- all 10 pF caps on the Ethernet data lines. The only reason for these is EMI filtering and are not needed for debugging. Remove them to make sure they are not causing other issues. You can always put them back later if you need to. Change C20 and C21, 0.022 uF caps on the transformer center taps, to at least 0.1 uF. 1.0 uF might be good to try as well. This line might be drooping too much given the 10 ohm resistor and L4/L5. You could even short this to VCC for debugging. The only reason for the resistor (and to a lesser extent the cap) is for EMI filtering. When you re-spin the PCB, you should connect the 10 ohm resistors directly to VDD33 instead of going through L4/L5. The 10 ohm resistor and L4/L5 are redundant. By going direct to VDD33 you can prevent injecting noise into your termination resistors and also makes optimizing the filtering in this area easier. You'll need more caps on the VDDIO pin, or short out the bead. This pin is providing power to lots of I/O pins and will have a lot of current on it. If it is current starved because of the LC filter (bead + 0.4 uF) then you'll have lots of simultaneous switching noise on the I/O pins. That'll actually cause more noise than what you're filtering out with that bead. It's even possible for this noise to make it to the Ethernet outputs. Verify that you have the pin-outs on your transformer correct. While unlikely, it's possible to have the center tap and another pin swapped. It's worth spending 5 minutes verifying things. For that matter, verify the pin-outs of the LAN8700 as well. If none of that improves things, then get a 25 MHz metal can oscillator and replace your crystal. I've seen crystal circuits do weird things, so if only for the peace of mind it's worth hacking up your prototype board to make sure your clk is stable. That's all I see at the moment. Hope this helps!
H: Make LUFA for Arduino UNO / atmega16u2 I have an Arduino Uno r3 board which has an atmega16u2 chip that normally contains the usb to serial firmware that allows the board to communicate with the IDE. I have been learning how to flash that chip with different firmwares that let it act as other types of USB devices ( Keyboard / Mouse specifically ). I have found some hex files that I can use online, but I am trying to learn how to build my own version of the keyboard and mouse hex files. Here are the variables that I've set in the make file: MCU = atmega16u2 ARCH = AVR8 BOARD = UNO F_CPU = 16000000 the LUFA_PATH is set like this (I did not change it): LUFA_PATH = ../../../.. When I save the makefile like this and try to run make all an error occurs: ../../../../LUFA/Drivers/Board/Joystick.h:119:31: error: Board/Joystick.h: No such file or directory ../../../../Common/Common.h: No such file or directory ../../../../LUFA/Drivers/Board/Buttons.h:135:30: error: Board/Buttons.h: No such file or directory The weird part is that I can travel to the path that it states and those files do actually exist and are located there. How do I need to set my LUFA makefile parameters in order to build for the atmega16u2 that is on the Arduino UNO rev3? EDIT: These are the only steps that I've taken, which led to these errors. Download LUFA project zip. Travel to dir: C:\LUFA-111009\Demos\Device\ClassDriver\KeyboardMouse Open makefile in this directory. change the MCU, Board, and F_CPU speed to the values located above. (Arch is already set correctly) save make file Open cmd in this dir. Type "make all" this process results in the above errors. EDIT 2: Ok, I made blank Buttons.h, and Joystick.h and put them in the KeyboardMouse/Board/ folder. that got rid of the file not found errors but still gives me this: KeyboardMouse.c: In function 'SetupHardware': KeyboardMouse.c:111: warning: implicit declaration of function 'clock_prescale_s et' KeyboardMouse.c:111: error: 'clock_div_1' undeclared (first use in this function ) KeyboardMouse.c:111: error: (Each undeclared identifier is reported only once KeyboardMouse.c:111: error: for each function it appears in.) KeyboardMouse.c:114: warning: implicit declaration of function 'Joystick_Init' KeyboardMouse.c: In function 'CALLBACK_HID_Device_CreateHIDReport': KeyboardMouse.c:174: warning: implicit declaration of function 'Joystick_GetStat us' KeyboardMouse.c:175: warning: implicit declaration of function 'Buttons_GetStatu s' KeyboardMouse.c:183: error: 'BUTTONS_BUTTON1' undeclared (first use in this func tion) KeyboardMouse.c:188: error: 'JOY_UP' undeclared (first use in this function) KeyboardMouse.c:190: error: 'JOY_DOWN' undeclared (first use in this function) KeyboardMouse.c:193: error: 'JOY_LEFT' undeclared (first use in this function) KeyboardMouse.c:195: error: 'JOY_RIGHT' undeclared (first use in this function) KeyboardMouse.c:198: error: 'JOY_PRESS' undeclared (first use in this function) make: *** [KeyboardMouse.o] Error 1 AI: As per my comment, you have specified UNO board, but it doesn't have Keyboard/Joystick required definitions for the board (I'm not sure if UNO has any buttons to be defined there, it only has Leds, and leds are defined in Led.h - check out \LUFA-111009\LUFA\Drivers\Board\AVR8\UNO) So what you could do is to create Board folder under your KeyboardMouse and make empty files Joystick.h and Buttons.h there. This should get you going further. Errors you are seeing are due to the following code in \LUFA\Drivers\Board\Buttons.h #if (BOARD == BOARD_NONE) #error The Board Buttons driver cannot be used if the makefile BOARD option is not set. #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Buttons.h" .... #else #include "Board/Buttons.h" <------ THIS IS EXECUTED SINCE UNO DOES NOT HAVE BUTTONS #endif So your error ../../../../LUFA/Drivers/Board/Joystick.h:119:31: error: Board/Joystick.h: No such file or directory means that your folder structure and your LUFA configuration is correct, but you're missing file Buttons.h in your KeyboardMouse/Board/ folder. Got it? Try what I've suggested and see how far you get. You can see how to define buttons in other Board's folders, for example in LUFA\Drivers\Board\AVR8\USBKEY\ EDIT Btw, I forgot to mention, error about common.h should go away hopefully after fixing this since that ........\ is coming from a file in a different location in folder structure thus confusion. EDIT OK, so here's the link on how to build custom board drivers: http://www.fourwalledcubicle.com/files/LUFA/Doc/111009/html/page_writing_board_drivers.html What you need to do is to copy files Buttons.h and Joystick.h LUFA\CodeTemplates\DriverStubs\ (or try copying Buttons.h and Joystick.h from USBKEY better, I think you still would need to specify a value for each definition otherwise) This should get rid of undefined errors. You have TODO sections in the files that you need to update. OK, so I think I should also mention how this is supposed to be used before going further. These drivers/definitions are meant to be used in a specific manner in your code, and LUFA is unifying the approach for you. As far as I can tell, buttons are used in a following manner: if (Buttons_GetStatus() & BUTTONS_BUTTON1){ ... do something when button 1 pressed.... This way, if you have several boards with at least one button, your code should theoretically stay the same across the boards. Similar stands for LEDs, you can use them like: LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); .... LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); I hope you get the picture. In order to use these library functions you have to define buttons/joystick/led specifics in their respective header files. So for example - in buttons.h you need to specify any custom header files you need, add port masks for buttons (on which pin of which port they are connected), specify port initialization and how to read the status of the buttons. You can find all of that in the USBKEY's buttons.h - e.g. it's importing common.h, defines BUTTONS_BUTTON1 like pin 2 of a port, initializes PortE with this button (so button is pin 2 on port E), and in Buttons_GetStatus it reads the status of the button. I could go on and on in the same manner for joystick as well, but I hope you get the picture. Joystick is more involved but it's like having 4 buttons of which 0, 1 or 2 can be active at any time. BTW, this is only useful if you have any buttons on your board. For example, I made keyboard driver without any buttons (I had to remove buttons specific code though). I used Ir Diode to read remote control codes and make the board act as keyboard. So you don't really need the buttons, nor the joystick (of course, it completely depends on what you're doing).
H: Embedded linux on FPGA I have very limited experience with FPGAs (Altera - used only the visual design tools). I am planning for a new project in which I need FPGA and I could benefit a lot from an actual linux running on the same board (mostly for TCP communication as well as some DSP). My question is, is there a recommended FPGA that has a supported embedded linux prepared for it? no fancy drivers (just ethernet, wifi could be a plus, ...). I imagine there would be a micro controller built into the FPGA (this means it would eat up lots of the FPGA and I would need a larger FPGA). AI: A textbook 32-bit RISC processor core capable of running the no-mmu version of linux doesn't actually need to be that large - the real resource you need is far more RAM (10s of megabytes) than available in any FPGA, so you'll probably want SDRAM on the board and a controller for that in the FPGA. That said, if you want anything more than a trivial level of performance, you probably want a core with some optimizations (pipelining, etc), and that starts to increase the size somewhat. Adding a full mmu will make memory (re-)allocation more efficient and enable the usual copy-on-write fork() behavior. Both major FPGA vendors have soft processor cores with available linux ports - Microblaze for Xilinx, Nios II for Altera. You should probably read their docs for specific platform recommendations as it is of course a target that moves with time. A third party core design might be somewhat larger for similar performance, if it is written in a more portable way and not as specifically optimized for a given FPGA family. Historically there have been chips available combining both a hard processor core (often powerpc) with a region of configurable FPGA fabric. Another option to look at would be a separate processor (likely ARM) on the same board as an FPGA. A lot of the decision will depend on how tightly you need to couple the processor and FPGA. If you can reduce the problem to configuration registers and a stream of data, it could be as modular as hanging an FPGA board with a fast USB chip off the USB host port of an embedded linux board like a BeagleBoard or RasberryPi. For tighter integration, you may want the FPGA on the same board and sitting on the processor's external bus. Or for low data rates, it's trivial to put an SPI register interface in an FPGA, and UART interfaces are entirely do-able though a bit trickier. Finally, there is the question if you actually need a full operating system such as linux, or if a more "micro-controller sized" embedded TCP stack would solve your problem while requiring less memory.
H: Troubleshooting Eclipse IDE for Arduino I have been using Arduino IDE for sometime with my Arduino Uno. Recently I heard about Eclipse and I thought give it a shot. I downloaded the c++ version and installed the AVR plugin. Then I tried to configure it following instructions from here: http://www.arduino.cc/playground/Code/Eclipse When compiled the library, there was some error about 'arduino.h' not found. When I copied that file to the core library, there were more errors now. Then I downloaded the Eclipse blink example from https://github.com/allgood38/Arduino-Blink-Eclipse-Project. It comes with its own arduino core library and compiled without any troubles. Then I uploaded it to Arduino Uno within the Eclipse itself. Everything went fine except the led on the Uno is not blinking. It just stays ON. I have tried uploading the compiled HEX file with other program but still the result is same. Please help me to figure out what's wrong here.. If there is anybody out there who have successfully integerated arduino 1.0 with the latest version of Eclipse in windows 7, please post the URL that you have referred. EDIT: Finally compiled a blinky project without errors. But there is still error on the CoreLibrary project. Here is the screen shot: AI: I just built the Arduino 1.0 core as a static library in Eclipse and using Windows 7. One thing you didn't mention is that you have to get pins_arduino.h from somewhere as well. For the Uno, which uses the ATMega328P, I believe, I think you want the "standard" variant. I copied into the static library project all of the files from: hardware\arduino\cores\arduino I also copied into the static library project the pins_arduino.h file from: hardware\arduino\variants\standard Could it be you just got the wrong pins_arduino.h file for your target chip? Also are you sure you have the right chip and clock speed selected under Project Settings => AVR => Target Hardware? I would delete your Arduino Core static library project, start over by downloading the Arduino 1.0 zip file from arduino.cc, and make a new project from scratch. I just redid the process a couple times to make sure there were no problems and it's pretty quick to apply the project settings once you've done it once (took me < 5 minutes the second time). Edit WProgram.h is deprecated in Arduino 1.0. It has been replaced by Arduino.h. Arduino libraries need to support both through #defines on the ARDUINO constant as described here. You need to define ARDUINO for the compiler as well in your main project, which you would do under Project Settings => AVR Compiler => Symbols and Project Settings => AVR C++ Compiler => Symbols respectively. You're going to want add a new Define Syms (-D) named ARDUINO with value 100 in both places I believe (ARDUINO=100). Edit 2 I also had to explicitly include Arduino.h at the top of my blink.cpp source file (where setup and loop are defined), not sure how to do avoid compiler errors without it. Edit 3 If you need to use Arduino Libraries, then you need to put the cpp and h files from the Arduino Library root folder into the arduinolib source folder, and any cpp and h files from the Arduino Library utility folder in an arduinolib/utility folder and include both arduinolib and arduinolib/utility in the project directory include paths (ala Project Settings => C/C++ Build => Settings => Tool Settings => AVR Compiler => Directories and Project Settings => C/C++ Build => Settings => Tool Settings => AVR C++ Compiler => Directories). You should only include those libraries in this folder that you actually use or the image will be bloated, presumably by way of each library's global variable declarations. A better way to go is probably to have separate static library projects for each Arduino library you want to use and place a project dependency on them from your main project, but that's a bit more work (could pay off in the long run though).
H: Measuring low current at very high speed I have a circuit with a very-low-power Jennic JN5148 module with microcontroller and 2.4 GHz radio, and some low-power sensors. I have to measure the supply current of all these components, in an interval of around a second and with a resolution of about 100 uA. These currents may have a maximum value of about 30 mA for the Jennic module, and slightly under 1 mA for the other components. I should measure these currents simultaneously and at a frequency of about 10 ksample/s, and i need at least 4 channels. The other requirements are to use as more as possible instruments over building amplifiers and so, and to perturb at least as possible the supply of components. Actually, the requirement is NO COMPONENTS and ONLY INSTRUMENTS. Does anybody has an idea about the best fitting solution? (i think that i've explained all but tell me if it lacks something) EDIT: Found this that could be a solution, but can you help me understanding what is the perturbation that it adds to the circuit? AI: So you need to measure supply current at 10 ksamp/s from 100µA to 30mA, which is 300:1 range. That by itself sounds doable enough. Even a 10 bit A/D built into a microcontroller is enough resolution if the signal is amplified properly. 10 kHz sample rate is also quite doable. In fact, I'd want to sample faster than that and do a little low pass filtering and decimation in the micro. 100 kHz sample rate isn't even pushing it for something like a PIC 24H. At 40 MIPS that would leave 400 instructions/sample. That is much more than needed for a little low pass filtering and background bookeeping, so that checks out fine too. The real question is what does the power feed look like and to what extent can you break into it. Are the units under test powered with LDOs? That would be useful, since a small current sense resitor before the LDO wouldn't effect the unit under test power voltage at all. You'd have to subtract off the LDO current, but that is doable. By putting the current sense before the LDO, you can afford to have it drop a little more voltage since the LDO will make sure the UUT still sees the same supply voltage. This of course assumes there is enough input voltage headroom to play with. If you have to put the current sense directly in line with the UUT, then you have to carefully consider voltage drop versus sensitivity and therefore ultimately signal to noise ratio. Maybe 1Ω is reasonable. That would only drop 30mV max, which wouldn't effect most devices much at all. You'd need a differential amplifier and a overall gain of 100 so that 0-30mA results in 0-3.0V, which is just about the right target for a processor running at 3.3V. Various folks make such diff amps or specifically high side current sense amps. If this is a one off, I'd start with Analog Devices. A 10x diff amp with 1 MHz gain-bandwidth shouldn't be hard to find. That would need to be follwed by a ordinary 10x amp before the micro, again with 1 MHz gain-bandwidth being adequate. You could try doing the whole thing with a single 100x diff amp, but the gain-bandwidth product should be at least 10 MHz so the choices will be more limited.
H: Seeking MCU with 9 data bit UART I need to develop a controller board for some peripherals which communicate at 9600 baud with 1 start bit, 9 data bits, no parity and one stop bit. I am not sure that I am up to coding a serial port driver or even modifying an existing 8 data bit driver to handle 9, so - does anyone know of an MCU which comes, off the shelf, with a serial port driver which can handle 9 data bits? I strongly prefer SD card support, and Ethernet / Wifi would be nice (I don't care too much about BlueTooth or USB, so long as they don't significantly increase price). Needs to be able to run 24/7 in an embedded device. I prefer something with FreeRTOS or similar and a good development IDE including debug facilities. Am I asking too much or does such a beast exist? AI: The ATmega series has a 9-bit UART The ATmega series of microcontrollers (datasheet) has the ability to use 9 data bits without messing with the parity bit. This functionality is described in the timing diagram: Note that the bits are numbered in the figure from 0-8, which is a total of 9 bits. The caption refers to this numbering, it does not indicate that you can use 0-8 data bits. The minimum number of bits in a character is 5, and the maximum is 9, not 0-8. You can set the width of the data section by the UCSZ bits. The settings are described in table 19-7, pictured below: To set this in C using AVR Libc, you would need to execute the code: #include <avr/io.h> // _BV() macro, register definitions // Set the Uart Character SiZe to 9 bits as described in table 19-7 UCSR1B |= _BV(UCSZ12 ); UCSR1C |= _BV(UCSZ11) | _BV(UCSZ10 ); Note that you'll probably want to specify the other bits in these registers while you're at it. Many other processors also have this There are almost certainly other processors which support this feature set. Atmel's ATtiny processors have the same USART as the ATmega, and are code-compatible, their AVR32 processors have the same true 9-bit support, but a different programming interface, the dsPIC processors support it, but without a proper parity bit (see page 243 of this datasheet; set bits 1 and 2, PDSEL of the UxMODE register)...the list goes on. The first processor that I checked which did not support it was a Stellaris Cortex-M3 part, which supports 5-8 data bits, but not 8 bits. But you should use your other constraints to narrow the options first. In the end, though, you should do your processor selection based on other factors first. You wrote: I strongly prefer SD card support, and Ethernet / Wifi would be nice (I don't care too much about BlueTooth or USB, so long as they don't significantly increase price). Most people will access the SD card in SPI mode, and almost everything has an SPI port or two. Ethernet/WiFi is too generic a spec and a much harder requirement to meet - Do you want an integrated MAC with an MII interface? Integrated PHY? Would you prefer to do all the TCP/IP stuff on-chip, or offload practically everything to something like a WIZnet W5100 or Lantronix XPort. You can also use components like the Microchip ENC28J60 to move the MAC and PHY to an external chip, accessed over SPI. Your other requirements are much more exacting than a 9-bit UART. In fact, you could probably use a $1.50 ATtiny as an SPI'/I2C<->9-bit UART converter if you wanted to. That would be much less expensive than choosing a sub-optimal processor for your other requirements.
H: What does the third wire on this speaker do? I salvaged two large speakers from an old iPod player/alarm clock device. Each of the speakers have three wires tied to it. There is a positive and negative and a third which I assume is ground since it is tied to the thick metal casing. I understand how a two-wire speaker works and is used but I haven't encountered a three-wire speaker before. I don't see the point to the third wire besides it being a ground. AI: The size difference and rough casing on the center wire indicate that it's probably shielded cable. This takes the form of a braided wrap on the two speaker wires, and prevents the speaker from receiving interference, for instance from 60Hz mains wiring or transformers in the iPod player device. The speaker itself is basically an electromagnet, or, more simply, a coil of wire. Current goes in one end, and out the other, and that's about it. This coil should be isolated from the speaker casing. The speaker is driven with AC, and probably capacitively isolated from ground. Shorting to ground could damage the amplifier, depending on the configuration, so shielding is not generally used on speaker wire. However, in an alarm clock (plugged into mains), which is also used to play audio and charge iPod batteries (which are significant power draws), there's probably a sizeable transformer in the enclosure, which is probably pretty close to this speaker and the speaker wire. This could produce a hum, so the designers of the device decided that the speaker needed to be shielded. The risk of the speaker wire shorting out and damaging the amplifier is minimal, because the speaker wire never needs to flex within the alarm clock. If you do connect these speakers to something else, you can probably ignore the third connection. If you reuse the cable, simply leave the shield at the other end floating.
H: What would be the difference in a coil of wire and just a cylinder of solid copper? Ok so I am learning about induction and I always see coils of wire with no insulator. So I was wondering, What is the significance of it being a coil of wire rather than just a solid cylinder since there are already many points of contact between each "wrap" of the coil? AI: The part you are missing is that what looks like uninsulated wire actually isn't. A lot of enamel coated or "magnet wire" can look like bare copper at first glance, but the wire is actually coated with a thin semi-transparent insulation layer. The reason for using thin insulation is so that lots of turns of the coil can fit into the tightest possible space. Electrically, a coil of wire is quite different from a cylinder. To make a magnetic field, you need current flowing around where you want the field. Think of a cylinder of current surrounding the area. The magnetic field is proportional to the total current in the cylinder. A coil is sortof a cheat on that. The same current is re-used each turn to add to the apparent cylinder current. Let's say you have a coil with 100 turns. If you run 1 A thru it, each of those turns contributes 1 A to the overall cylinder current. You get the same magnetic field as if it were a solid cylinder with 100 A running around it.
H: "ATML U942", is it a 555 clone? Was looking for 555's in my parts box, and while I did find one NE555, I found a dozen of these, in the same pouch. Wondering if the seller pushed me some slugs, because I can't find datasheet for this part. Not even in the Chinese / Russian parts search sites !! The form-factor is same as NE555 (8 pin DIP), and markings on top say - ATML U942 2FB 2 9H07258 and the bottom die sealant says that it's manf'd in Thailand. AI: That is an Atmel AT24C512B. Two-wire Serial EEPROM, 2.5V, 512K (65,536 x 8). See the AT24C512B datasheet page 13 for markings.
H: If I try and fix my laptop power adapter can I damage my computer or endanger people? I have a CR-48 Chrome laptop adapter. It is bent at the end which plugs into the computer. I have to jiggle it and tip it against a wall to make it charge. My novice understanding is there are two or three wires inside the jack. I'm thinking I should be able to use a knife to peel back the protective cover and correct the problem. If I use a knife to peel it back is there anything I should be worried about like damaging my computer or making it dangerous for people? This is a link to a replacement part so you know the specs: http://www.amazon.com/gp/product/B003NJUPQE?ie=UTF8&tag=chromebooking-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B003NJUPQE AI: Well the Amazon link doesn't help much because we can't see the jack itself, so post photographs of what you have. As for the question itself, it's a bit difficult to answer. In general, yes you can kill the computer and kill yourself and others if the failure is really spectacular and the circumstances are correct (say the PSU starts burning and the fire spreads). However if you're careful the worst thing that can happen is that the charger may die and you can trip the circuit breaker. In practice, if the jack is damaged there is little you can do. If the barrel is physically deformed, you can try to straighten it out. The plastic part itself is most likely injection-molded and it's very likely that you won't be able to open it without destroying it. You'll most likely have to find a plug of same dimensions (measure inner and outer diameter) and same number of connections. They are in general standard-made so you could obtain one from usual component distributors if you look hard enough. If it turns out that you have to replace the plug, be very careful when you remove it! I suggest that you do not simply cut it off. Instead carefully remove the outer-most layer of insulation near the jack and see if the wires inside are colored. If they are, cut the existing jack so that some part of the cable stays attached to it. Later on, use a multimeter on continuity (or resistance) to figure out which cable goes to which pin. In the rare case that they are of the same color, you'll have to first cut one of the inner cables, use multimeter on it to see where it's connected and then mark it. Repeat procedure for all wires inside. As for potential dangers, the two biggest (which could later on cause chain reaction) would be shorting the wires inside the jack and extremely bad soldering of the wires to the new jack. In general the power supply should have short-circuit protection, overheating protection and so on, but it's of course best not to rely on them. I can't say more about this than to be very careful what you do and plan each step you're going to do ahead of doing it and know what to do if something interrupts you during the step. The short between wires can be detected by using a multimeter and probing contacts to see if there's continuity between them. t may be difficult to do that on the barrel of the jack, so be sure to think in advance how to do it on the wire contact side of the jack. The bad soldering will show up as either bad connection (which can get better or worse as the cable is moved) or as abnormally high resistance. To check the resistance, short the probes of your multimeter and measure the resistance between them. Then measure resistance between barrel and wire contact side of the jack. It shouldn't be higher than the resistance of the probes (but be sure to connect the probes to the jack properly). As for bad connection, try moving the cable and keep checking resistance while you move the cable. It shouldn't change. Finally make sure that you power on the power supply in a safe area after the intervention (and be sure to connect it to power with no computer attached first). In a reasonably bad scenario, the power supply may have an undetected short and some part of the input cable, output cable or the body of the unit itself may start melting and later burning (hopefully by that moment the circuit breaker or internal fuse should have activated). The power supply may also overheat with no signs of external failure in case the protections kick in. So when you turn it on, it should be reasonably cool. You can expect same things when you connect the computer for the first time (but of course, since the PSU will have load, you can expect it to get warm). Do make a plan in advance what you're going to do if the PSU starts melting! I thing I have covered all bad scenarios related to this (and pretty much any similar) problem. It's up to you to judge if you want to take the risk of repairing it or just get a working one. While (in my estimation) the chances of anything bad happening are very low, it's always good to be prepared.
H: What does "Pins are on 0.17" centers" mean? I'm looking at some switches (here) and the description reads: Small PC mounting slide switch features SPDT contacts and white positive action slide lever. Size about 0.56"L x 0.25"W x 0.34"H (excluding lever). Pins are on 0.17" centers. What does "centers" mean in this context? Will I be able to mount the switch on a standard breadboard? AI: No. Centers, in this context, means that the pins are spaced at 0.17" intervals. Basically, the "center" of each pin is 0.17" from the previous pin's center. As such, "on x" centers" can be translated as "the center of each pin is x from the center of the previous pin" For a component to work in a common solderless breadboard, the pins have to be spaced 0.100" apart, in other words, they have to be on 0.100 centers (or some integer multiple of 0.100", such as 0.200" or 0.500" centers).
H: Multiple radio in a small dimensional sensor node PCB I'm planning to develop a wireless sensor node that equips dual IEEE 802.15.4 radios. Although the board will equip homogeneous dual radios, both of them will operate at different channels. Regarding the design, however, I'm worrying about any possible bad correlations between the radios which will be placed in a relatively small dimensional sensor node such as 4" x 2". Is is possible to practically use dual radios in such a small dimensional board? If possible, what special care should I give the board in layout stage? If possible, I'd like to use a chip antenna in order to save space in a board. What is the pros and cons of a chip antenna? Can it be a proper decision? What special care should be taken for antenna selection? AI: If you want to use two radios, do they both need to be active at the same time? By this I mean could radio A be active for 30 seconds with radio B using the next 30 seconds for example? Even better would be a single radio capable of operating on two frequencies. Most of the time it could be listening on both channels simultaneously and occasionally transmitting on one channel or the other. This would greatly simplify your design as you would not need to worry about one radio interfering with the other. If you really need for them both to be active (and perhaps transmitting) simultaneously this is possible, but would require good RF engineering and isolation of signal paths. On board chip antennas will greatly complicate the design, particularly if omnidirectional coverage is required. One thought would be to use a two sided board with each radio on it's own side and use a multi-layer board with one of the interior layers being a full copper ground plane for isolation. EDIT: In response to "explain more in detail about why the chip antenna would bring about complicated hardware design " If I were going to have two radios, one on each side of the board, I would think that a 1/4 or 5/8 wavelength antenna perpendicular to the surface(es) of the board would be a good choice with an inner layer of the multi-layer PC board serving as a ground plane for both antennas. Assuming the board was mounted in the horizontal plane then both antennas would have an omni-directional pattern with vertical polarization. Further assuming a sufficiently large ground plane then there should be maximum possible isolation between the radios. You should be able to easily simulate such antennas using software like NEC2.
H: Free circuit simulator for educational purposes I am looking for a free circuit simulator for educational purposes. My requirements are: Visual ("draw a circuit diagram, click simulate") It should contain light bulbs as circuit components such that 2.1. They become (visually) brighter if you apply more power 2.2. You can change the manufacturer specs for example "3.5V,0,2A" It should contain swiches, npn-transistors, diodes and LEDs as well (the LEDs should react to interactive changes in the simulation) Any recommodations for this? It would be nice if the simulator runs under Linux, but that's not a strict requirement. AI: I often use the falstad simulator: http://www.falstad.com/circuit It's a Java applet, so will work on pretty much any operating system. The interface does take a bit of getting used to, and there are problems saving in Linux (it gives you a link to copy and paste, and copy and paste in Java doesn't work too well in Linux). Other than that it ticks all your boxes. It also has some good sample circuits. A Windows version (circuitmod) is based on this.
H: Basic questions about transistor amplification Can anyone explain how a transistor can amplify voltage or current? According to me, amplification means - You send in something small, it comes out bigger. Say for example, I want to amplify a sound wave. I whisper to a sound amplifier, & it comes out say, 5 times bigger(depending on the amplification factor) But when I read about Transistor Amplifying action, all text books say that since a small change in the Base current ΔIb but a corresponding large change in Emitter current ΔIe, there is amplification. But where is amplification? What is being amplified as I've defined it? Is my understanding of the term amplification wrong? And how is current being transferred from a low resistance area to a high resistance area? I think I've understood how the transistor is constructed & how the currents flow. So can anyone explain the transistor amplification action clearly & relate it to what I understand about amplification. AI: I'll start first with definition of amplification. In the most general way amplification is just a ratio between two values. It does not imply that the output value is greater than the input value (although that's the way it's most commonly used). It is also not important if the current change is big or small. Now let's move to some common amplification values used: The most important (and the one your question talks about) is \$ \beta\$. It is defined as \$ \beta= \frac {I_c} {I_b} \$, where \$I_c\$ is the current going into the collector and \$I_b\$ is the current into the base. If we rearrange the formula a bit, we'll get \$I_c=\beta I_b\$ which is the most commonly used formula. Because of that formula, some people say that the transistor "amplifies" the base current. Now how does that relate to the emitter current? Well we also have the formula \$I_c+I_b+I_e=0\$ When we combine that formula with the second formula, we get \$\beta I_b + I_b + I_e=0\$. From that we can get the emitter current as \$-I_e=\beta I_b + I_b= I_b (\beta + 1)\$ (note that \$ I_e\$ is current going into the emitter, so it's negative). From that you can see that using the \$ \beta \$ as a handy tool in calculations, we can see the relationship between the base current of the transistor and the emitter current of the transistor. Since in practice the \$ \beta \$ is in the hundreds to thousands range, we can say that the "small" base current is "amplified" into "large" collector current (which in turn makes "large" emitter current). Note that I didn't speak about any deltas until now. That's because the transistor as an element does not require current to change. You can simply connect the base to a constant DC current and the transistor will work fine. If the change in current is required, it's not because of the transistor but because of the rest of the circuit which could be blocking the DC part of the input current. There is another value also used and it's name is \$ \alpha\$. Here's what it is: \$ \alpha = \frac {I_c} {I_e} \$. When we rearrange that, we can see that \$I_c= \alpha I_e\$. So \$ \alpha\$ is the value by which the emitter current is amplified in order to produce collector current. In this case, the amplification actually gives us a smaller output (although in practice \$ \alpha \$ is close to 1, something like 0.98 or higher), because as we know, the emitter current going out of the transistor is the sum of the base current and collector current which are going into the transistor. Now I'll talk a bit about how transistor amplifies the voltage and current. The secret is: It doesn't. The voltage or current amplifier does! The amplifier itself is a bit more complex circuit which is exploiting properties of a transistor. It also has input node and output node. The voltage amplification is the ratio of voltage between those nodes \$A_v = \frac {V_{out}}{V_{in}}\$. The current amplification is ratio of currents between those two nodes: \$ A_i=\frac {I_{out}}{I_{in}}\$. We also have power amplification which is the product of current and voltage amplification. Do note that the amplification can change depending on the nodes we chose to be input node and output node! There are few more interesting values related to transistors which you can find here So to sum this up: We have transistor which is doing something. In order to safely use transistor, we need to be able to represent what transistor is doing. One of the ways of representing processes happening in the transistor is to use the term "amplification". So using amplification, we can avoid actually understanding what is happening in transistor (if you have any semiconductor physics classes, you'll learn that there) and just have few equations which will be useful for a large number of practical problems.
H: esd protection of power supply line I have designed a small MCU circuit which is to be supplied by a 3.3V DC supply. Since this is a small subcircuit which will be mounted upon other PCB's, I need to consider ESD (at least on the power supply). The circuit input power pin is connected to a PI filter, two capacitors and a ferrit bead, mainly to suppress noise, but will this be sufficient to protect against ESD? I have been looking at different TVS diodes and application notes, but they all seem not to mention power lines, is this because the capacitance on power net is normally enough to shunt any ESD? AI: Normally the capacitance alone is enough to protect the power lines. Even a 0.1 uF cap will absorb most of the zap. If you want to make extra sure, use the PI filter. Unfortunately, odds are high that you'll have issues on your other lines long before you have issues with ESD getting on your power. Start by filtering/protecting your MCU's reset line, even if it doesn't go over a cable.
H: Adding microphone/amplifier to Gumstix Overo Earth COM? I am new to hardware hacking in general. I have a Gumsitx Overo Earth COM and a Palo35 expansion board with audio in/audio out capabilities. According to Gumstix's wikipage on audio input, the Palo35 board has "stereo audio in," but not a "stereo headset jack." I know that I am going to need an amplifier if I want to add a microphone, but I am not sure how to actually integrate an amplifier or microphone onto the board. I have searched for answers on Google for how to do this but I have not found many helpful results. AI: The Overo COMs have line-level inputs and outputs. You're right that if you want to drive anything other than a line in on a stereo or amplified speakers, you will need to hook up an amplifier. It can be as simple as a little transistor amplifier or LM386 op-amp, or as complex as the guitar amp on "Back to the Future." :-) Adding a microphone input to the COM will also need an amplifier, as you've already mentioned. If you just want to get up and running quickly, I suggest something like this SparkFun kit; it's only mono, but you can connect both the left and right inputs of the COM to the output of this without trouble.
H: Alternation of Magnet Poles in DC and AC Generators I want to create a generator. The current design I am looking at has several magnets along a wheel, with coils around the outside of the wheel. The wheel then spins generating current. I know that if I alternate the poles of the magnets, I will be generating AC Current. So my question is, If instead of alternating the poles of the magnets, If I have all the same poles facing out, while I then be generating DC pulses instead of AC? AI: First, there is no such thing as a DC "pulse". DC means a steady level, which a pulse by definition is not. No, you always get AC out of a coil. The coil is driven by changing magnetic field. You can shove a bar magnet down a coil, but it won't produce any steady power. There will be a blip as the magnet moves into the coil, but this is because the magnetic field is changing at that time. Your generator with all the magnets the same will make AC, but at twice the frequency and less power than if they were alternating. The magnetic field will still change because it will be strong right at a magnet and weaker between them. The magnetic field therefore goes thru one repeating pattern every magnet. Since it's the change in magnetic field that matters, the output won't be as strong since the field goes from peak to 0 (at best) over one cycle. With the magnets alternating, the field the coil sees will go from positive peak to negative peak repeating every two magnets. That's why the output will be half the frequency but stronger since the magnetic field the coil sees will have stronger variation.
H: MSP430 Code Size in CCS This should be pretty straight forward, but my google-ing is not turning anything up... I can build my project successfully in TI Code Composer Studio (CCSv5) and target my device. Now I want to know my program code size, so that I know how much space I have for future growth etc. When I develop for AVRs in eclipse with the avr-gcc tool chain it conveniently tells me this in the compiler output in the console. Even Arduino compilation reports this information right there in the IDE. No such luck with CCS it seems. So the question is, how do you get the MSP430 memory utilization statistics in CCS? A bonus would be how to configure the IDE to tell me this information in the console output when I do a build. Note: I know that it tells me in the console when I load it onto a device with Run => Debug. I'm looking for output at compile time. AI: Set up your project to output a "MAP" file. This gives all of the memory use information. In CCS4, the project properties "Basic Options" under the linker options will do this. From command line, use "--map_file". The map file will show up in the Debug or Release folder. The first section will look something like the example below which shows the location, length, and use of each memory section. (Note that the example shows 3 special sections which you won't have: BT_FLASH, NV_FLASH, and BI_FLASH.) To understand how these sections are defined reference the project's linker command file. Example: MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- SFR 00000000 00000010 00000000 00000010 RWIX PERIPHERALS_8BIT 00000010 000000f0 00000000 000000f0 RWIX PERIPHERALS_16BIT 00000100 00000100 00000000 00000100 RWIX INFOD 00001800 00000080 00000000 00000080 RWIX INFOC 00001880 00000080 00000000 00000080 RWIX INFOB 00001900 00000080 00000000 00000080 RWIX INFOA 00001980 00000080 00000000 00000080 RWIX RAM 00001c00 00004000 00003fea 00000016 RWIX BT_FLASH 00005c00 00001000 00000f34 000000cc RWIX NV_FLASH 00006c00 00000500 0000002a 000004d6 RWIX BI_FLASH 00007100 00000100 00000010 000000f0 RWIX FLASH 00007200 00008d80 00008d80 00000000 RWIX INT00 0000ff80 00000002 00000000 00000002 RWIX INT01 0000ff82 00000002 00000000 00000002 RWIX INT02 0000ff84 00000002 00000000 00000002 RWIX INT03 0000ff86 00000002 00000000 00000002 RWIX INT04 0000ff88 00000002 00000000 00000002 RWIX INT05 0000ff8a 00000002 00000000 00000002 RWIX INT06 0000ff8c 00000002 00000000 00000002 RWIX INT07 0000ff8e 00000002 00000000 00000002 RWIX INT08 0000ff90 00000002 00000000 00000002 RWIX INT09 0000ff92 00000002 00000000 00000002 RWIX INT10 0000ff94 00000002 00000000 00000002 RWIX INT11 0000ff96 00000002 00000000 00000002 RWIX INT12 0000ff98 00000002 00000000 00000002 RWIX INT13 0000ff9a 00000002 00000000 00000002 RWIX INT14 0000ff9c 00000002 00000000 00000002 RWIX INT15 0000ff9e 00000002 00000000 00000002 RWIX INT16 0000ffa0 00000002 00000000 00000002 RWIX INT17 0000ffa2 00000002 00000000 00000002 RWIX INT18 0000ffa4 00000002 00000000 00000002 RWIX INT19 0000ffa6 00000002 00000000 00000002 RWIX INT20 0000ffa8 00000002 00000000 00000002 RWIX INT21 0000ffaa 00000002 00000000 00000002 RWIX INT22 0000ffac 00000002 00000000 00000002 RWIX INT23 0000ffae 00000002 00000000 00000002 RWIX INT24 0000ffb0 00000002 00000000 00000002 RWIX INT25 0000ffb2 00000002 00000000 00000002 RWIX INT26 0000ffb4 00000002 00000000 00000002 RWIX INT27 0000ffb6 00000002 00000000 00000002 RWIX INT28 0000ffb8 00000002 00000000 00000002 RWIX INT29 0000ffba 00000002 00000000 00000002 RWIX INT30 0000ffbc 00000002 00000000 00000002 RWIX INT31 0000ffbe 00000002 00000000 00000002 RWIX INT32 0000ffc0 00000002 00000000 00000002 RWIX INT33 0000ffc2 00000002 00000000 00000002 RWIX INT34 0000ffc4 00000002 00000000 00000002 RWIX INT35 0000ffc6 00000002 00000000 00000002 RWIX INT36 0000ffc8 00000002 00000000 00000002 RWIX INT37 0000ffca 00000002 00000000 00000002 RWIX INT38 0000ffcc 00000002 00000000 00000002 RWIX INT39 0000ffce 00000002 00000000 00000002 RWIX INT40 0000ffd0 00000002 00000000 00000002 RWIX INT41 0000ffd2 00000002 00000002 00000000 RWIX INT42 0000ffd4 00000002 00000002 00000000 RWIX INT43 0000ffd6 00000002 00000002 00000000 RWIX INT44 0000ffd8 00000002 00000002 00000000 RWIX INT45 0000ffda 00000002 00000002 00000000 RWIX INT46 0000ffdc 00000002 00000002 00000000 RWIX INT47 0000ffde 00000002 00000002 00000000 RWIX INT48 0000ffe0 00000002 00000002 00000000 RWIX INT49 0000ffe2 00000002 00000002 00000000 RWIX INT50 0000ffe4 00000002 00000002 00000000 RWIX INT51 0000ffe6 00000002 00000002 00000000 RWIX INT52 0000ffe8 00000002 00000002 00000000 RWIX INT53 0000ffea 00000002 00000002 00000000 RWIX INT54 0000ffec 00000002 00000002 00000000 RWIX INT55 0000ffee 00000002 00000002 00000000 RWIX INT56 0000fff0 00000002 00000002 00000000 RWIX INT57 0000fff2 00000002 00000002 00000000 RWIX INT58 0000fff4 00000002 00000002 00000000 RWIX INT59 0000fff6 00000002 00000002 00000000 RWIX INT60 0000fff8 00000002 00000002 00000000 RWIX INT61 0000fffa 00000002 00000002 00000000 RWIX INT62 0000fffc 00000002 00000002 00000000 RWIX RESET 0000fffe 00000002 00000002 00000000 RWIX FLASH2 00010000 00035c00 0000aa80 0002b180 RWIX
H: What does E mean in this instance? On all about circuits I keep seeing E in tables like this: In the table I and R make sense with the units. But the E doesn't. So where does it come from? I was looking at this article on superposition theorem.. AI: "E" stands for "Electromotive force", which is essentially just voltage. We just have come used to using "V" instead of "E" It would be the same as asking why Current is "I" even though it is measured as Amps. Likewise it would also be the same as asking why Resistance is "R" even though it is measured in ohms. This might also help you understand the saying "Eli the Ice Man" where the E stands for voltage.
H: Recommendations for analog tri-state buffer? I'm currently working on a project that requires interfacing to a clock and data line at a configurable voltage between 0V-5V with nonstandard logic levels, this voltage is generated elsewhere. To be able to receive data the lines needs to be able to go into a high impedance state. I'm currently playing around with a 4066, I have two lines of two pairs hooked together, one channel of the 4066 is hooked to the voltage and the other to ground and I simply drive them inverted. To get a high impedance state I drive both switches low. This being said it doesn't work real well since I'm having trouble hitting the ground rail. All the buffers I found with tri-state outputs are for digital logic levels, could anyone recommend a analog one or another approach? (For anyone interested I'm investigating the lowest voltages that I can use to interface to various IC's) I eventually found this bug, I replaced the the 4066 with one from another manufacturer and it worked... AI: If I understand correctly, you are looking for an analog multiplexer with the option of setting the channels to high impedance. If so, the 4052 or 4053 should do the job, they have an enable input which sets the ports to high impedance. As mentioned in the comments, it might be a good idea to post a rough schematic of what you are doing, as it's a little unclear at present.
H: Tiny speakers, used in headphones - what are these called? After having searched Mouser and a general search for "tiny speaker", "small speaker", "headphone speaker", and not having found what I am looking for, wanted to see if someone here can help me find the correct term, part-number of the tiny speakers used in headphones (s.a. handsfree kit for mobile phones, mp3 players etc.) If required I can crack open one of the several damaged handsfree sets and share a pic, but just being lazy. Edit: Please note that I am looking for the tiny speaker, as a component - that is housed inside the ear-plugs, head-sets etc., not the whole finished product. Also, I am looking for speakers that have a diaphragm that vibrates with enough power to push airwaves through an air-tube for a short distance, like 5-6 inches, yet be small enough, light enough to be put behind a lapel pin. AI: Added: For components try searching for "speaker" and sort by size. In Digikey's catalog "speaker" will get you this and after you reject the expensive tiny specialist units you get eg. These Drawing low on dimensions. A few here Allegedly 13mm x 2mm. http://www.puiaudio.com/pdf/AS01308MR-R.pdf Or these - prices and datasheet. From 13 mm dia http://www.mallory-sonalert.com/Articles/TechAppGuides/Miniature%20Speaker%20Models.pdf http://search.digikey.com/us/en/products/PSR-11N08S-JQ/458-1119-ND/2071435 Earpiece. Magnetic earpiece (some)(mot common) Piezeoelectric earpiece (some) Many but not all of these will be relevant, with links - via Magnetic earpiece and Piezoelectric earpiece
H: How to measure/compensate wire's stray capacitance How should one measure and compensate (If necessary) a wire's stray capacitance in low-level measurements? Is Guarding applicable here? If so, does it mean having a wire with same signal voltage twisted around signal wire? In the example below, DUT is a capacitor whose leakage current must be measured. The black rectangle represents a metal shield. Metal shield is connected to LO terminal of source. (Sorry for childish drawing - I am not Da Vinci :D) AI: Several points of confusion here. To measure capacitor leakage, stray capacitance doesn't matter. You're looking for the current the cap draws in DC steady state. Guarding (surrounding a trace with actively driven guard traces) is a means of dealing with non-perfect insulators and nulling out the leakage currents that would otherwise run thru them. You recognize that the material has some finite resistance. You arrange for a signal that is actively driven to the same voltage as the sensitive signal to be on the other side of that resistance. Since the voltage accross that resistance is now zero, there will be no current flowing thru it, therefore making it not matter. Guarding is not accomplished by using a twisted pair. That is for a whole other set of issues. Basically a twisted pair tries to make each signal couple equally to the environment, thereby making any noise picked up from that environment common mode. This is not relevant to your problem of measuring the leakage of a capacitor. Stray capacitance is very hard to predict. Sometimes you use a shield to trade of capacitance to some unknown source with a higher capacitance to something that doesn't carry noise, like ground.
H: What exactly is happening when a graphing calculator LCD malfunctions when batteries are weak or overloaded? I'm a beginner in electrical engineering, and I have limited knowledge of how electronics work internally. I'm trying to understand some odd LCD behavior when the batteries are weak or subjected to a heavy load. I'm running a TI-Nspire with Clickpad graphing calculator in diagnostic mode. When I run the USB OTG test and connect a USB device that accepts power over USB using the mini-A-to-mini-B cable (supplied with the calculator), the batteries are subjected to a heavy drain. Because the batteries are not monitored in this mode, if the batteries become weak, the handheld malfunctions. Specifically, the calculator no longer responds to keystrokes and most notably, the LCD goes haywire, displaying a fast-moving pattern of horizontal and vertical lines. I've read a voltage of as low as 3.24 volts from the 4 AAA batteries on my DMM while a USB device is connected. No hardware damage actually occurs, only the AAA batteries get drained. The handheld seems to eventually regain its sanity and reboot normally. The LCD appears to be that of the STN type. The question I'm trying to ask is how this fast-moving pattern of lines is generated on the display and why this occurs instead of normal operation. In other words, why does the LCD do this with insufficient power and an active heavy load? Edit: The display is a grayscale 320x240 dot-matrix LCD. When it starts to act up, slight disruptions appear first: horizontal lines appear on top of the normal content and the content may shift slightly or shrink vertically by up to 12% as more and more lines flash on the screen. Eventually, the content is lost and the screen is dominated by randomly flashing horizontal lines. At this point, the background is simply a series of squiggly vertical lines, which can be hard to see behind all of the horizontal lines. Vertical lines occasionally flash on the screen momentarily in place of horizontal lines. If the load is removed (by disconnecting the USB cable), one of three things can happen: If the batteries are OK, the calculator will function normally and accept input. If the screen was starting to flash horizontal lines, but the normal content was still present beneath these lines, the horizontal lines disappear and normal content will be restored but the calculator is frozen and does not accept input. The display will malfunction again when the cable is reconnected and the batteries are placed under load again. If the normal content was lost, the horizontal lines will disappear, but all that is left is either squiggly vertical lines or a blank screen. The calculator is actually powered on, even if the screen is totally blank. If the cable is reconnected, either the horizontal lines reappear, or the calculator shuts down altogether, momentarily flashing a single horizontal line on the screen. AI: All ICs (Integrated circuits or "chips") have a working voltage range outside which their behaviour is undefined. This means the manufacturers of the chips don't specify what will happen, just that it (probably) won't work as it should. So the microcontroller in your Nspire may have a operating range of say 4V - 5.5V and outside this it might do just about anything. Typical stuff would be resetting, running code it's not meant to, etc. This goes for all the other chips in there, including the LCD controller chip (the chip that drives the display) so odd behaviour is to be expected. As long as the voltage is lower than it should be, damage will be very unlikely, it just won't work properly. EDIT - some speculation: My guess at what is actually happening is RAM that holds the pixel information for the LCD is not being read correctly at the lower supply voltages. Either that or the pixel matrix drivers are not transferring the data correctly. It's hard to say without more info on the display type (e.g. TN, STN, TFT, OLED) as the method of driving them is a bit different. Also seeing the "fast moving lines" would help - for example if they are horizontal then that might fit with the scanning row by row from top to bottom that is usually the way the pixels are driven in LCDs. Of course it's also possible the LCD read port is not reading correctly, the microcontroller is acting up, etc, etc. Normally it should have a low voltage sense and brownout active, but if it's in diagnostic mode these features are probably turned off. All the effects described will be mainly due to the transistors no longer acting enough like switches as vicatcu discusses in his answer. EDIT 2 - more info provided Thanks for updating with more info. However, there's not much more that can be added which isn't vague speculation. To find the exact cause of things you would need to check things like: The display and microcontroller datasheets, microcontroller source code, scope the uC -> LCD connections, possibly even scope the LCD controller chip. Even then you may not be guaranteed to find the exact (original) cause as it may be on an unreachable part of the silicon (so all you see is secondary effects) for example an internal RC oscillator changing frequency so timing is not met on the chip, etc.
H: What motor driver should I use based on amps? I am building a robot that sports 2 motors ripped from an old RC car. After many attempts to find the data sheets, nothing of use turned up. So, I ran some test and found this out about the motors. Operating Amps(No load): 130 mA Max Eff: 500 mA Stall: 2.5 A My question is, How many amps does my motor driver circuit need to be able to handle? Could I get away with a 1A driver, or should my circuit need to be able to handle the full stall amperage? AI: The easy answer is that it should be able to handle up to 2.5A. Since that's the max the motor can draw, the driver's limit won't be exceeded. Another approach is to use a weaker driver and then actively limit the current somehow. This is not so good for two reasons. First, at a lower current like 1A you will have lower torque. If the motor is presented with some mechanical resistance, it might not be able to overcome it at the limited current. Second, it makes the control electronics more complicated. A H bridge or low side FET drive isn't much harder to make for 2.5A than 1A at your low voltages. I wouldn't try to play games cutting corners on the driver. That's the most likely component to fail since it would be the most stressed, especially if it can't really handle the full current.
H: How to implement a synchronization signal with AVR (attiny45)? In pseudocode I want to do following: i = 0 state = 0 while (1): compareState = readDigitalIn() if state == compareState: i = i+1 else: i = 0 state = compareState writeDigitalOut(dataVector[i]) In english, I want to reset the counter i every time I change the state of digitalIn-pin. Is the above a good way of doing this? Does attiny have event listeners or similar? The ultimate goal is to synchronize multiple pwm controllers in different chips (writeDigitalOut is changed to AdjustPwmFrequency...) Edit: Can I use interrupts for this? How? Can create an interrupt that fires when digitalIn-pin is changed? AI: Yes, this is a pretty good application to use interrupts for. What you are interested in is the external interrupt, but let's break down the general structure of an interrupt first. If you have enabled a particular interrupt on your system, when that interrupt type occurs, the processor will look up into a table to find the function or service routine to jump to in order to service that particular event. This function is called an Interrupt Service Routine, or ISR for short. This is a method that you must write. So let's identify which interrupt you want and which ISR you want to write. To do this, we need to consult the datasheet. The type of interrupt that you're interested in is in the family of interrupts called external interrupts. An excerpt from the ATiny45 datasheet: 9.2 External Interrupts The External Interrupts are triggered by the INT0 pin or any of the PCINT[5:0] pins. Observe that, if enabled, the interrupts will trigger even if the INT0 or PCINT[5:0] pins are configured as outputs. This feature provides a way of generating a software interrupt. Pin change interrupts PCI will trigger if any enabled PCINT[5:0] pin toggles. The PCMSK Register controls which pins contribute to the pin change interrupts. Pin change interrupts on PCINT[5:0] are detected asynchronously. This implies that these interrupts can be used for waking the part also from sleep modes other than Idle mode. The INT0 interrupts can be triggered by a falling or rising edge or a low level. This is set up as indicated in the specification for the MCU Control Register – MCUCR. When the INT0 interrupt is enabled and is configured as level triggered, the interrupt will trigger as long as the pin is held low. Note that recognition of falling or rising edge interrupts on INT0 requires the presence of an I/O clock, described in “Clock Systems and their Distribution” on page 23. So they've mentioned some registers of interest here: PCMSK and MCUCR PCMSK controls which pins can trigger the interrupt - so you want to wire up your toggling signal to whichever pin(s) you specify here, and MCUCR defines how the pins must change in order to trigger the interrupt. In this case, you would probably be interested in configuring your interrupt for Any logical change on INT0 generates an interrupt request. As outlined in table 9-2 in the document. Continue reading what the registers do in the external interrupt section, they are as follows: MCUCR, GIMSK, GIFR, PCMSK. The information you want to get out of this is How to configure the interrupt (PCMSK and MCUCR) How to enable or disable the interrupt (GIMSK) How to check its current status (GIFR) Now on to the actual coding. The structure will look something like this (pseudo code): volatile int i; // volatile because this gets changed in the ISR, so the compiler will know to NOT optimize this when used in loops int main(void) { /* set-up your registers here ... */ /* enable global interrupts */ i = 0; while (1) { boundsSafeVectorPrinter(i); i++; } } ISR(PCINT0_ISR) { i = 0; } Now whenever a pin change occurs on one of the pins you specified (given that you've set-up all the registers correctly), the ISR(PCINT0_ISR) routine will be executed. So how did I know to use ISR(PCINT0_ISR)? You will need to lookup in whatever definitions file that you are using to see if they have provided the PCINT0_ISR mapping for you, if not, consult the datasheet again and look at section 9.1 Interrupt Vectors in ATtiny25/45/8 and define it yourself. If you are using avr-gcc, the ISR() macro is defined here. I think this covers the basics without giving away too much code. Good luck and have fun!
H: What is the voltage divider rule? Can anyone explain what the voltage divider rule is? How has the author of this book used it for analyzing the Voltage Divider Bias circuit for transistors? And can anyone explain how the two resistors are parallel? And how has the author assumed the battery to be a short circuit (as shown in Figure 4.28)? Thanks a lot. ________________________________--- From above link: AI: (1) It MAY be of assistance to you to note that equation 4.29 in the above cited text COULD be called "the voltage divider rule" as it refers to R1, R2 and Vcc. ie changing what it says just slightly without changing the meaning: Vout = Vin x R2 / (R1 + R2) ie R1 & R2 form a voltage divider and the above equation defines a "rule" of the result. BUT (2) There IS NO "voltage divider rule" as such. Even if somebody uses that term there is still no such rule. BECAUSE the terminology is much too general. That's even more general than saying eg "The Ohm's law rule" where you at least have some guide. If you have a specific question you should explain it clearly in words and not use general terms or few words or the real requirement is liable to be missed. Added: Re question: Can you tell me how this 'rule' is derived? I'm a beginner so I didn't understand how he got the relation Vr2= (R2)(Vcc)/(R1+R2) (1) Short answer. Voltage across each resistor is proportional to current in it (Ohm's law). As current in both resistors = battery current = the same THEN the voltages across each resistor are proportional to their resistance value. THIS IS THE KEY FACTOR THAT MAKES THIS WORK Vout = Vr2 = ib x R2 Vcc = Vr1+Vr2 = ib x R1 + ib x R2 = ib x (R1 + R2) So Vout / Vcc = Vr2 / (Vr1 + VR2) = ib x R2 / (ib x (R1 + R2) ) Cancel ib's Vout/Vcc= R2/(R1 + R2) Multiply both sides by Vcc. Vout = Vcc x R2 / (R1 + R2) QED. (2) Longer answer. You MUST know Ohms law. If you don't know Ohms law and it's various re arrangements, stop reading this now, drop all lse and learn it. Wikipedia and Google know all about it N time over ... time lapse ... or no time at all as the case may be ... So we know you know Ohm's law. So - one version of Ohm's law says, as you know V = i x R ie the voltage drop across a resistor is equal to the value of the resistor multiplied by the current flowing in it. Now look at fig 4-29 Take this circuit in isolation. The current from the battery flows from B+ at the top left of R1, via R1, then via R2 and back to B- and the bottom left. Look at the diagram and be SURE that you agree with the above. Now, lets call the battery current Ib. Call the current in R1 I_R1. It can be seen "by inspection that I_R1 = Ib. Call the current in R2 I_R2. It can be seen "by inspection that I_R2 = Ib. So I_R1 = IR2 = Ib. ie the current is the same in each resistor and out of and into the battery. Now, the voltage across R1 = VR1 is, based on Ohm's law = I_R1 x R1. And, the voltage across R2 = VR2 is, based on Ohm's law = I_R2 x R2. BUT I_R1 = Ib and IR2 = Ib. So VR1 = I_R1 x R1 = Ib x R1 And VR2 = I_R2 x R2 = Ib x R2 The ratio of VR2 / VR1 = Ib x R2 / Ib x R1 = R2/R1 ie the voltages across the two resistors are proportional to their resistance values. Look at the diagram. Vbattery = Vcc Vcc = the voltage across R1 + the Voltage across R2 Vcc = VR1 + VR2 Vcc = ib x R1 + ib x R2 Vcc = ib (R1 + R2) So To determine the ratio Vout / Vcc: Vout / Vcc = V_R2 / Vcc = ib x R2 / ib (R1 + R2) but the ib's cancel so Vout/ Vcc = R2 / (R1 + R2) and rearranging Vout = Vcc x R2 / (R1 + R2) So the voltage across R2 compared to battery voltage = Vr2= (R2)(Vcc)/(R1+R2)
H: How do I measure impedance of my guitar pickups? How would I measure impedance of my guitar pickups with a multimeter? Is it similar to measuring resistance? AI: Since the pickups have both a reactive and resistive component, it's not just as simple as measuring resistance alone. The (assuming standard coil) pickups are inductive, will have some resistance and some stray capacitance also. The impedance is calculated using both components, using $$Z = \sqrt{R^2 + X^2}$$ The resistive part is easy, just measure with a multimeter on ohms. For the reactive part you need an LC meter (which your multimeter may have, but most only have the C testing capability). Depending on the LC meter, it may do all measurements for you and display reactive, resistive and total impedance, or it may just display reactive. You will be interested in the results over the entire frequency range (for a guitar pickup say 100Hz to 5kHz). Or you can use a scope and known impedance/signal to drive the coil with and do the necessary calculations. IIRC, wound guitar pickups are usually in the 5k - 100k range at audio frequencies, but my memory is fuzzy so this may be a bit out.
H: 'Contains FCC ID' compare to just 'FCC'. Certificate of conformity I wanted to get FCC certification for my device. The device uses WIFI module (FCC approved). The testing house said the test will leverage on the WIFI module FCC test. Instead of getting FCC certification, I will get Certificate of Conformity. I need to put "Contains FCC ID" xxx-xxxxx" on the product, instead of just "FCC" logo. Is there any difference between putting "FCC" and "Contains FCC ID"? Thanks! AI: If your device has been fully tested to comply with FCC then you will be given an FCC ID. This is the ID for your device. It sounds like your device is only going to be partially tested, and that the majority of the testing will be taken as read by using the previous test of the WiFi module. The WiFi portion of the device will not be tested. I would guess that you are being told to put the ID of the WiFi module on the product for public inspection. This will be so that the test for the WiFi can be obtained and read if required, as well as the test for your device.
H: Very basic questions on resistor and gnd Im a total beginner. I bought an arduino starter kit and this is the first sample program - it makes an LED blink. The accompanying text gives no theory about what is happening in the sample programs so I have a couple of questions. What is the function of the resistor here? Why is it a 560 ohm resistor (as opposed to 2 ohms or 20000 ohms)? The circuit starts from arduino pin 13 that I understand puts out a voltage of 5 Volts. But the circuit then ends at gnd. I thought circuits were supposed to loop around so that the currently will keep flowing non-stop? What is the reason for the circuit terminating at gnd? Here is the circuit - AI: In brief: The resistor in this circuit is a "Current Limiting Resistor" The resistance is dependent on the forward voltage drop and current requirements of the LED. Ground forms part of the circuit. The microcontroller is also connected to ground. It is a reference point that all other voltages in the circuit are measured against. In more detail: The LED requires a certain amount of current to light up. It also has a certain voltage that it operates. These are never the same as the 5v Arduino puts out through its IO pins. So, if the LED has a forward voltage of 2.2V and a maximum current rating of 25mA, and the Arduino puts out 5V, then we need to lose some of that voltage to get it down to 2.2V. The resistor does this for us. We calculate the value of the resistor by using Ohm's Law, which states that: \$R=\frac{V}{I}\$ Or, the resistance is the voltage divided by the current. So, for our LED of 2.2V we will need to lose 2.8V using the resistor. The LED can draw 25mA (max without burning up), as noted above. So, we can put those values into our Ohm's Law formula: \$R=\frac{2.8}{0.025}\$ Which gives us the answer 112Ω For the LED I picked at random above, you'd use a 112Ω resistor to stop it from going pop. As they don't make 112Ω resistors commonly (you can get any value made, but they cost shed loads), the next value up is chosen - typically 120Ω. Without knowing the exact specs of your LED it's impossible to know exactly what resistor should be used, but a higher value resistor is safer than a lower value one (it just may not light up as bright) and around the 500Ω area is a reasonable value to cover most LEDs. As for the ground connection - that is just another wire - the "return" connection that keeps the current in a loop. Just because it's called "ground" it doesn't make it special - it's just a reference point. The 5V in the circuit is actually "5V With Reference to Ground". All parts of the circuit marked with the ground symbol are all connected together - it just saves drawing in the wires.
H: Any drawbacks to "low temp" lead-free solder paste? I am about to try my first "reflow skillet" soldering job, and as I look at the available types of solder paste I see there are lead-free pastes with much lower melting temperatures than others. For example, this one from ChipQuik. The advantages seem obvious, but somehow the marketing literature does not mention any drawbacks to this type of solder paste. In the quantities I would order the price seems about the same. Is there a reason this Sn42Bi58 formula hasn't become standard? AI: 42/58 Tin / Bismuth is not unknown as a low temperature solder but has issues. While widely used for some very serious applications (see below) it is not a mainstream industry contender for general use. It is not obvious why not given its substantial use by eg IBM. Identical to the Bi58Sn42 solder you cite is: Indalloy 281, Indalloy 138, Cerrothru. Reasonable shear strength and fatigue properties. Combination with lead-tin solder may dramatically lower melting point and lead to joint failure. Low-temperature eutectic solder with high strength. Particularly strong, very brittle. Used extensively in through-hole technology assemblies in IBM mainframe computers where low soldering temperature was required. Can be used as a coating of copper particles to facilitate their bonding under pressure/heat and creating a conductive metallurgical joint. Sensitive to shear rate. Good for electronics. Used in thermoelectric applications. Good thermal fatigue performance. Established history of use. Expands slightly on casting, then undergoes very low further shrinkage or expansion, unlike many other low-temperature alloys which continue changing dimensions for some hours after solidification. Above attributes from the fabulous Wikipedia - link below. According to other references it has low thermal conductivity, low electrical conductivity, thermal embrittlement issues and potential for mechanical embrittlement. SO - it MAY work for you, but I'd be very very very cautious about relying on it without very substantial testing in a wide range of applications. It is well enough known, has obvious low temperature advantages, has been widely used in some niche applications (eg IBM mainframes) and yet has not been welcomed with open arms by industry in general, suggesting that it's disadvantages outweigh advantages except perhaps in areas where the low temperature aspect is overwhelmingly valuable. Note that the chart below suggests that flux cored versions seem to be specifically unavailable either as wire or as preforms. Comparison chart: The above chart is from this superb report which however does not provide detailed comment on the above issues. Wikipedia notes Bismuth significantly lowers the melting point and improves wettability. In presence of sufficient lead and tin, bismuth forms crystals of Sn16Pb32Bi52 with melting point of only 95 °C, which diffuses along the grain boundaries and may cause a joint failure at relatively low temperatures. A high-power part pre-tinned with an alloy of lead can therefore desolder under load when soldered with a bismuth-containing solder. Such joints are also prone to cracking. Alloys with more than 47% Bi expand upon cooling, which may be used to offset thermal expansion mismatch stresses. Retards growth of tin whiskers. Relatively expensive, limited availability. Motorola's patented Indalloy 282 is Bi57Sn42Ag1 . Wikipedia says Indalloy 282. Addition of silver improves mechanical strength. Established history of use. Good thermal fatigue performance. Patented by Motorola. Useful lead free solder report - 1995 - nothing to add on above subject.
H: Why are batteries measured in ampere-hours but electricity usage measured in kilowatt-hours? I was reading about energy usage in batteries and don't quite understand why it is measured in different units than home electrical usage. An ampere-hour does not include a measure of volts. But my understanding though is that a battery has a constant voltage (1.5V, 9V, ...) just as much as home electrical usage (120V, 220V, ...). So I don't see why they have different units by which they are measured. AI: \$kW \cdot h\$ are a measure of energy, for which grid customers are billed and usually shows up on your invoice in easily understood numbers (0-1000, not 0-1 or very large numbers; ranges which, unfortunately, confuse many people). \$A \cdot h\$ are a measure of electrical charge. A battery (or capacitor) can store more or less a certain amount of charge regardless of its operating conditions, whereas its output energy can change. If the voltage curve for a battery in certain operating conditions are known (circuit, temperature, lifetime), then its output energy is also known, but not otherwise, though you can come up with some pretty good estimates. To convert from \$A \cdot h\$ to \$kW \cdot h\$ for a constant voltage source, multiply by that voltage; for a changing voltage and/or current source, integrate over time: $$ \frac{1 kW\cdot h}{1000 W\cdot h}\int_{t_1}^{t_2} \! I(t)E(t)dt ~;~~E~[V],~I~[A],~{t_{1,2}}~[h]$$
H: Measuring current with multimeter I have to measure the current of a battery of 3.7 volt(used in HP IPAQ VM) and I am connection a resistor of 10 ohms in series with multimeter and the battery. Since the actual current of battery is 1.26 amps (1260 mA) but the meter shows only 0.37 amps. How to measure actual current of source using multimeter? AI: Your meter is correct. With a 3.7 V battery and a 10 ohm resistor, Ohm's law (\$V = I\cdot R\$) tells you that the current should be 0.37 A. The 1260 mA you mentioned is probably 1260 mAh (milliamp hours). This tells you the capacity of the battery, not the current draw. For example, if you drew 100 mA from the battery continuously, it would last 1260 mAh / 100 mA = 12.6 hours.
H: Connecting copper wire to a nine volt battery I don't have a cap for a nine volt battery so I am connecting to it with copper wire. Which connector is positive? Have I wired these up correctly? AI: Look at the body of the battery - it will tell you. The round one is positive, the crown shaped one is negative.
H: Arduino resetting while reconnecting the serial terminal I wrote this code for the Arduino Uno. It will count a variable every second and send that count to the serial terminal. The problem is when I close the terminal and reopen it, the count will start from 0 again. I am confused with this behavior. Please tell me why this is happening. Here is the code: #include "Arduino.h" #include <avr/io.h> #include <avr/interrupt.h> #define setbit(x,y) x |= 1<<y unsigned long newmillis(void); void newdelay(int x); void toggle_led(void); unsigned long volatile _count = 0; volatile char state = 1; int count = 0; ISR(TIMER0_COMPA_vect) { _count++; } unsigned long newmillis(void) { //toggle_led(); return _count; } void newdelay(int x) { unsigned volatile long y = (unsigned long)x + newmillis() - 1; while (y>newmillis()); } int main(void) { init(); TCCR0B = 0b11; OCR0A = 249; TIMSK0 |= 0b10; sei(); Serial.begin(9600); DDRB |= 1<<5; //int count = 0; for (;;) { Serial.println(count++); newdelay(1000); toggle_led(); } } void toggle_led(void) { if (state==0) { state = 1; PORTB |= 1<<5; } else { state = 0; PORTB &= ~(1<<5); } } AI: When you program the Arduino the microcontroller on the board has to be reset to enter the bootloader so you can upload the new software. Arduino, in their infinite wisdom, decided that this should be done automatically whenever you connect to the serial port. There are much better ways of doing it, but I guess that they decided on this with the first Arduino board before they really knew what they were doing (do they even now?) and are now stuck with it. Personally I would have used a different USB->RS232 chip right from the start - one that can do more than just serial comms, such as the MCP2200 which gives you both a CDC and a HID device in one, and 8 GPIO lines that you could use to trigger events on the board, like resetting, programatically. However, I digress. There are two ways around the issue that I am aware of - one which damages the board permanently, and one which is far simpler and nicer. The official way is a permanent mod to the board. I wouldn't recommend this way - there is a far nicer way (see below). Look for a little link on the front called RESET-EN and cut it with a very sharp knife. This will disconnect the serial chip from the reset pin and the board will never auto-reboot again. However, this will break the ability to program the board easily. From now on you will have to manually reset the board by pressing the reset button at the right time to program it. The method I use is far simpler and less destructive. Connect a 22uF capacitor between RESET and GND (on the POWER header). You will need to disconnect it to program the board, but it doesn't involve breaking the board at all. Just plug it in between those two connections in the header, making sure the - side of the capacitor goes to ground. This works by holding the reset line high enough to stop the chip from resetting even when driven low by the USB chip. The reset switch should still work, but you may need to hold it in for a bit longer than normal. On a side note, the ChipKIT™ UNO32™ has the same problem - they had to keep that functionality to maintain compatability with other Arduino products and methodologies. However, they have been much more sensible about it. They still have the little link to cut, but instead of it being between the pads of an 0805 footprint, they are between the plated through holes of a 0.1" 2-pin header. This way, you can cut the link, and install a normal jumper header. From then on you can enable and disable the reset functionality by just installing or removing a jumper.
H: My own millis() function not accurate in the arduino I wrote a program myself to implement the millis() and delay() function without the arduino library. I included a counting variable which counts every second and send its value every second via serial port. What I found is its value runs away from the true value by almost 2 seconds every 3 minutes. Is there anything wrong with my code? Or is that Serial.print() the culprit which may lag that routine? How much time does that Serial.print() takes to execute? Here is the code: Edit: I edited the code like this, but the count on the arduino still lag around 4seconds after 4 minutes. It lags 13 seconds after 10 minutes ie, it counts only 587 seconds after actual 600 seconds. Edit 2: Here is my updated code. Still there is lag in the timing. I get a lag of around 6 seconds in 5 minutes. #include "Arduino.h" #include <avr/io.h> #include <avr/interrupt.h> void toggle_led(void); unsigned long volatile millis_count = 0; volatile char state = 1; unsigned long volatile current_count = 0; unsigned int volatile count = 0; ISR(TIMER0_COMPA_vect) { //Timer interrupt ISR millis_count++; if (millis_count - current_count == 1000) { current_count = millis_count; toggle_led(); Serial.println(count++); } } int main(void) { init(); TCCR0B = 0b11; //Timer settings for interrupt at every millisecond OCR0A = 249; TIMSK0 |= 0b10; sei(); Serial.begin(9600); DDRB |= 1<<5; for (;;) { } } void toggle_led(void) { PORTB ^= (1<<5); } AI: Your delay will be the length of the newdelay() function plus the time it takes to send the serial data. You have: Send the count through serial wait 1000ms toggle LED. Each of those steps takes time. To get an exact 1000ms time you can either trigger the serial sending from a 1 second interrupt, or you can examine the millisecond count within your loop and send the serial data when the milliseconds loop through 1000: unsigned long lastmil; lastmil == newmillis(); for(;;) { if(((newmillis()%1000) == 0) && (lastmil != newmillis())) { lastmil = newmillis(); Serial.println(count++); toggle_led(); } } (another way to stop it looping multiple times for a single millisecond would be to add a short delay inside the if(..) to ensure that the routine takes at least 1ms) The Serial.println() function will take a varying amount of time depending on: The baud rate in use The number of characters sent At 9600 baud you are sending 9600 symbols per second. With "8N1" format that's 10 symbols per byte. So for a string of 3 digits, plus the carriage return and line feed, that will be 10 symbols × 5 characters, which is 50 symbols. 9600 baud is 0.0001041670.000104167s per symbol (or 104µS per symbol), so 50 symbols will be 0.00520835s (or 5.20835ms). That is the actual transmission time. You then also have to add on to that the time taken to actually do the formatting of the data and the calling of the serial routines. These all take an unspecified amount of time. To find this out you will need to know the assembly code the routine compiles into then find the number of clock cycles each instruction takes and total them up.
H: Best way to detect horizontal vibration/shaking! I need to detect shaking (not just vibration or small movements but significant horizontal rocking movement)! (its a long story) I have an Arduino already in place, controlling some other stuff. I've tried a couple of simple methods with gyroscopes and pendulum like shake sensors and like, but they are either too sensitive or to hard to calibrate. Mostly I need to detect horizontal plane movements. Any suggestions? Anyone had done anything like this? AI: You have to decide what exactly you are trying to detect. You say "horizontal rocking" which implies a pivoting motion, but then "horizontal plane movements" which is something else. You need to make up your mind. I would detect these two differently. Also, what exactly is "movement". Do you need to know the distance your object has moved, it's speed, or will acceleration do? Acceleration is the easiest of these to measure with small and cheap off the shelf sensors. A number of companies, including Freescale and Analog Devices, make MEMS accelerometers. These come in flavors that either put out a analog signal proportional to acceleration, or also digital. You can use two single-axis accelerometers, or it may be more convenient to use one two-axis chip to detect motion in a plane. With the two axes aligned along the plane, the total acceleration magnitude is the square root of the sum of the squares of the individual acceleration signals. If you're just looking for some threshold, then you can square the individual signals, add them, and compare that to the square of the acceleration threshold. You can do limited itegration of such acceleration signals. There is enough offset and hysteresis in cheap MEMS accelerometers that inertial navigation for more than a second or two becomes so inaccurate as to be unusable for most purposes.