text
stringlengths
83
79.5k
H: What does this Op Amp circuit do in this circuit for a line following robot? I have seen a schematic for a line following robot, but there is something that I can't understand and is shown in the figure below, what is the purpose of the Op Amp circuit? I know that BREAK input in H-Bridge is independent on other pin. Could some one explain what this circuit does? AI: The device that looks like an opamp is a comparator, it compares the REF_I_MAX input with ISENSE_G input. The output is low unless the sense level becomes higher than the reference voltage in which case the BRAKE_G output becomes high. Seems to be a brake mechanism that is activated when the current of the motor exceeds the reference level (for whatever reason).
H: Are there any consumer-grade waterproofing solutions? Is there a common solution to protecting electronics from water by coating conductors in dielectric material? I figured you could just cover everything in thin layer of hot glue, but there might be a more added mass -effective way, like spraying hot silicone on the electronics. I heard a few years back some company in the US provided a service of coating Iphone insides with a silicone spray or something, which made them water resistant to some extent. I don't live there, so I didn't have a chance to try it myself, though. Anyway, this is a service, and I'm looking for something I could apply myself. I don't visit home depot nearly often enough to keep up with the technological advancements, so maybe I just missed it. AI: User reported results of the 'secret' and VERY expensive coating were very variable and some had zero success. A TV program showed an iphone being trashed by dunking after coating. Conformal coatings, as mentioned by PeterJ & AndrejaKo are a "good start". These are usually aimed at PCB level protection and are usually applied during manufacture. As Tony says (deleted response) coatings of silicone do not block water 100%. What is not widely understood is that NOTHING that is used as a add on costing blocks water 100%. [There is a special coating - Parylene and similar names - applied via vacuum deposition of vaporised coating which changes its molecular arrangement during the process, which is as good as you get, not perfect and very much not a do-at-home treatment]. BUT water permeates through and coating. A good coating works by having very low % water dissolved in it and by forming an aggressive voidless bond to the target. This means mainly only water vapor is present and lack of surface micro-voids which can form liquid water pockets means corrosion rates are far far far lower than otherwise. More on such below. When applied as an after-market treatment ALL conformal coatings have the potential to degrade performance or do damage. This is usually at the "obvious enough" level - use your brain, look carefully and think ahead. Covering any screen with a coating will usually be a bad idea. Getting goo that sets on any electrically connecting surface will be a bad idea. If it is meant to move (hinge, keyboard flexure, ...) then gumming up the motion is liable to be a very bad idea. Sounders/beepers/speakers that make noise may make different noises if plastic coated. Thinks that get hot and are cooled by air movement usually get hotter and are less cooled when coated. Holes that allow airflow may vanish ... . Once such 'little things' have been addressed, a range of coatings MAY help. Dow Corning make a material named Dow Corning 1-2577, which does a better than most job. It can be brushed sprayed or dipped and air sets to about a 0.1mm layer. It is not cheap, contains enough volatiles to be used in a fume hood or outdoors and you are unlikely to see it in retail sales. A "low VOC" version exists. [VOC = Volatile Organic Compound -> try not to inhale this stuff]. Dow Corning conformal coating products here Dow advertised a PV6100 material a few years ago that sounded like it would be ideal (aimed at solar cell encapsulation) but they have "gone all quiet" re it recently. May yet be available. The older Dow Corning "Sylgard 184" is much used by the DIY PV panel manufacturing community with good reported results. Also see slower setting Sylgard 182 Note: I have no involvement with Dow Corning, except as a satisfied user of their products. "Silicone spray" will provide a degree of protection against water but is far from ideal. Clear polyurethane plastic spray (sold as "lacquer" or "clear varnish") will do a passingly good job as an aftermarket conformal coating. You could spray in an excess and let it run to and from over semi inaccesible surfaces.
H: joule heating - transmitting power at higher voltages reduces resistive loss? electrical engineering hopeful here. Can someone explain with math how transmitting power at higher voltages reduces resistive loss? I know Joule's Law Power is proportional to (I^2)*R lets say we have two identical direct current power lines - 1000 feet and resistance is 2 ohms. One wire will run at 1,000 volts, and the other 10,000 volts. if both have a load of 500 watts, how can it be shown that the higher voltage line with experience less heating loss? my botched attempt to solve this - I know half of every step i make is probably wrong: wire 1: 1,000v load = 500w, so 500w/1000v = .5a = appliance amps 1000v/.5a = 2,000 ohms 2000 + 2 = 2002 ohm serial resistance. 1000v/2002r = .49a circuit amps (less current wire 2: 10,000v load = 500w, so 500w/10,000v = .05 ohms = appliance 2 resistance. .05 + 2 = 2.05 ohm serial circuit resistance. 10,000/2.05 ohm = 4878a * 10,000v = 48,780,000 watts AI: Wire 1: V = 1000V P = 500W I = P/V = 500W / 1000V = 0.5A R_wire = 2 Ohm Loss in wire 1 = I^2*R = 0.5A^2 * 2 Ohm = 0.5W Wire 2: V = 10000V P = 500W I = P/V = 500W / 10000V = 0.05A R_wire = 2 Ohm Loss in wire 2 = I^2*R = 0.05A^2 * 2 Ohm = 0.005W UPDATE: To work out the exact loss, assuming voltage is measured at start of wire: simulate this circuit – Schematic created using CircuitLab Total current, I = V1 / (R1 + R2) Load power, P2 = 500W = I^2 * R2 = (V1^2 R2) / (R1 + R2)^2 This equation can be rearranged into a quadratic form and R2 solved for. Once R2 is found, the loss in the wire can be found by I^2 * R1 To find it using the P = VI formula, calculate V2 as I * R2, the loss is given by (V1 - V2) * I.
H: How interrupts handle does work on a physical layer I want to understand how HW IRQ does work on a physical layer. I ask my question considering a specific example. As known after a packet coming to a network adapter a hardware interrupt is signalling. Wiki says that an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. I know that OS will be invoke a corresponding interrupt handler when the interrupt's type will be detected. But I don't understand how does CPU detect and distinguish incoming interrupts. Now I ask my questions: First, why CPU does know that the interrupt is coming from network adapter, but not from other devices? Second, Where does interrupt handlers registered in CPU? Is there exist a specific CPU's area which contains handler's addresses registered by OS? AI: The details depend entirely on the CPU, so you're best to pick your favorite CPU and study it in detail. For more general knowledge, there are books on computer architectures, like those by William Stallings. In one of the simplest, traditional designs, the CPU simply does not "know" at all which device interrupted it. The CPU has a single interrupt line. If there are multiple devices, they are all tied to that single line: for instance, with a big OR gate. When the CPU handles the interrupt, the top level of the interrupt handling routine has to interrogate all of the devices by peeking at their respective status registers, to determine which one, or which ones, require service. When they are properly dealt with, they de-assert the interrupt signal. Blocking specific interrupts can be implemented by making the external circuit sophisticated so that it can be programmed to selectively ignore some of its inputs. This design can be improved upon in a myriad ways. For instance, there can be protocols whereby an interrupting device has to invoke a special bus cycle, and place its ID (8 bits or whatever) on the data bus, such that the CPU picks it up. The ID can then be used to index into an interrupt vector to dispatch an appropriate interrupt. A processor doesn't even have to have interrupt pins; in one possible design, an interrupt is simulated when a device makes a write to some special memory location. Effectively, the address and data pins of the CPU serve as the interrupt inputs. See Message Signaled Interrupts.
H: Powering LED Lamp from Arduino I'm about to embark on my first (actually useful) Arduino project. I have a Kinect setup to detect when I get close to my PC, and I can send a message to my Arduino board to switch on a LED when I get close, and turn it off when I get far away. Now, I want to make a full lamp, rather than just 1 LED, however, I have a limited knowledge of electronics. What will I need to read up on before I start buying parts and building this lamp to make sure I don't blow the board/mess anything else up? AI: Number one, there is no way that Arduino will be able to supply power for an 120v AC light bulb. If you know that you are better off than some already! I frequently point new Arduino users toward Arduino Playground, it has quite a bit of useful and important information about the basics. If you want to make a 'lamp', you should investigate the links about connecting hardware to Arduino. AND…definitely learn & understand the limits, capabilities, and limits of your Arduino. The following is very important and applies to almost every Arduino alive. Not knowing this may drastically shorten the life expectancy of your Arduino - Absolute Maximum Ratings DC Current per I/O Pin ........... 40.0 mA DC Current VCC and GND Pins...... 200.0 mA 1 VCC pin: Means these Arduinos can Source a total of 200mA 2 GND pins: Means these Arduinos can Sink a total of 400mA There are not only maximum current limits per pin and per board, there are also limits on total current per port (group of pins) too! This Page has all the info you should need about that. You will need to discover how much power (volts & milliAmps) your 'lamp' will require. Then, you can determine how to power & switch it properly. Anything I would consider a 'lamp' would likely need to be powered separately from Arduino and not through any of its pins or headers (common GND though!) and only switched on & off using Arduino pins.
H: Current divider rule calculation issue I'm doing the exercises from Wisc-Online. This one I think they are really great to learn and practice and have already done a bunch of their practical trainings. But here I'm starting to be crazy. I need to calculate \$I_{r1}\$ Here's the schema : simulate this circuit – Schematic created using CircuitLab According to their lesson : \$I_{Rx} = \dfrac{R_{T}}{R_{x}} \times I_{T}\$ So : \$I_{R1} = \dfrac{R_{1} \parallel R_{2}}{R_{1}} \times I_{T}\$ With values : \$I_{R1} = \dfrac{\dfrac{1}{\cfrac{1}{5000}+\cfrac{1}{10000}}}{\dfrac{1}{5000}} \times 3mA\$ \$I_{R1} = 50000mA\$ But the answer should be 2mA What's wrong in my formula ? :'( AI: Sorry... I just figured out what was wrong... It's not : \$I_{R1} = \dfrac{\dfrac{1}{\cfrac{1}{5000}+\cfrac{1}{10000}}}{\dfrac{1}{5000}} \times 3mA\$ But : \$I_{R1} = \dfrac{\dfrac{1}{\cfrac{1}{5000}+\cfrac{1}{10000}}}{5000} \times 3mA\$ And in that case I've got the correct answer. Sorry.
H: Interfacing two PIC microcontrollers, of different power sources? I have two different circuits with 5v for each, and they are using PIC microcontroller, how can I send a data (voltage) from the first PIC using output pin to the other PIC using its input pin? I measured the output from the first PIC, it is 5v (great), but measuring it using the ground of the other circuit it is ZERO, why?????? Note: NO COMMON GROUND, THEY ARE ISOLATED CIRCUITS. AI: In order to send directly data using an electrical connection you need to have a common reference voltage, that reference level is normally the ground but if the circuits are isolated from each-other you can use an optocoupler Here is some related reading http://www.circuitstoday.com/optocoupler-devices-and-application
H: Externally Powered USB Port I have a Raspberry Pi and it requires a Externally Powered USB hub to run Portable HDD on it. So what if I connect +5 and GND port of the USB Client to external power source of 5V-1A directly rather then connecting them to the USB Host ? OR What if I use a transistor as a switch and for source isolation ? Will this work or not ? Or Do I have to give power to D+ and D- ports too ? simulate this circuit – Schematic created using CircuitLab AI: Connect the data lines from the USB port to the device, connect the ground of the external power supply to the USB ground and connect the external supply positive line to the device side USB supply only Here is one example that shown the described connection scheme using a linear regulator as power source (limited to 1A that may not be enough) but you can use any 5v source. In order to switch the power of the USB client when the plug is removed you can use a mosfet that turns on when the plug is inserted to the PC. When there is no Vcc voltage in the base of the transistor the resistor R1 works as a pullup and keeps the mosfet off by keeping the gate high. When the plug is inserted the PC side Vcc is applied to the base of the transistor so the current that flows through it creates a voltage drop across R1 and turns on the mosfet. Note that the mosfet should be a logic level type that turns fully on with -5v Vgs. Also the input should not exceed the max allowable Vgs (usually 20v but this is absolute max) Another alternative is when a switching regulator is used that has a control pin, in that case the PC side Vcc supply can be used as a signal to turn the regulator on when the USB plug is connected. The following schematic (I've modified the USB plugs slightly) shows such an example using a 1A switching regulator but the same principle applies to switching regulators of higher current.
H: Series/Parallel DC circuit analysis training issue I'm blocked in this exercise. I don't get how I can compute R1/R2/R3 voltage. Here's the schema : simulate this circuit – Schematic created using CircuitLab So I was able to calculate some values : \$ R_{T} = \dfrac{1}{\dfrac{1}{10k\Omega}+\dfrac{1}{7k\Omega+\dfrac{1}{\dfrac{1}{6k\Omega}+\dfrac{1}{1k\Omega+2k\Omega+3k\Omega}}}} = 5k\Omega \$ \$ R_{eq_{1,2,3}} = R_{1}+R_{2}+R_{3} = 1k\Omega+2k\Omega+3k\Omega = 6k\Omega \$ \$ R_{eq_{1,2,3,4}} = \dfrac{1}{\dfrac{1}{R_{4}}+\dfrac{1}{R_{eq_{1,2,3}}}} = \dfrac{1}{\dfrac{1}{6k\Omega}+\dfrac{1}{6k\Omega}} = 3k\Omega \$ \$ I_{T} = \dfrac{V_{1}}{R_{T}} = \dfrac{10V}{5k\Omega} = 2mA \$ \$ V_{R6} = V_{AppliedVoltage} = 10V \$ \$ V_{R5} = \dfrac{V_{1} \times R_{5}}{R_{4}+R_{5}} = \dfrac{10V \times 7k\Omega}{3k\Omega+7k\Omega} = 7V \$ \$ V_{R4} = (I_{T} - I_{R_{6}}) \times R_{eq_{1,2,3,4}} = (2mA - 1mA) \times 3k\Omega = 3V\$ \$R_{1}\$ should be equal to 0.5V, \$R_{2}\$ should be equal to 1V and \$R_{3}\$ should be equal to 1.5V. But I can't find a way to compute them... I've cheated a bit and take a look at all the answers to try to "RE" based on the excepted result but can't figure out what I have to do... Any ideas ? AI: Thévenin says: Remove the load that you are interested in and short all voltage sources: simulate this circuit – Schematic created using CircuitLab Notice that R6 is shorted by the voltage source and can be left out: simulate this circuit Now it is clear that when you look into the circuit to determine RTH = R4||R5. Next we move the voltage source back in place and calculate VTH: simulate this circuit VTH can be calculated by the voltage divider rule: \$V_{TH} = \dfrac{R_4}{R_4+R_5}\cdot V_1\$ Now you have a simple 4 resistor voltage divider that allows you to calculate the voltage across every resistor: simulate this circuit \$V_{R_1} = \dfrac{R_1}{R_1+R_2+R_3+R_{TH}}\cdot V_{TH}\$
H: Replacing 12 x (internal) CR2032 batteries with one (or more) external batteries As Christmas was on a budget this year, one of the presents I came up with consisted of a fishbowl with battery operated (flat CR2032 3V) tea-light candles in the bottom, these were covered in coloured glass beads and then I put air plants in the bowl mounted on driftwood. The effect is really nice (i.e. the flickering light under the beads). However, it is not practical to keep lifting out the plants/driftwood, emptying all the beads, and swapping the batteries in every candle every few days or so. Therefore, I thought about sticking the candles to a cardboard base, soldering thin wires to all the negatives and to all the positives of the candles (i.e. leaving the small battery cover off each one), running the cables to the back of the bowl and attaching some form of 'battery' holder that will site above the beads so it will be easy to plug in new batteries when needed. My initial thought (as there are 12 candles and they all require 3V CR2032 batteries) is to connect them in 3 banks of three batteries and use a square 9V battery for each. My question is (as I have no experience of this at all) will this work or am I simplifying this too much (i.e. will the 9V battery give the same 'power' output and drive the candles or will it damage them, does the length of wire have an effect at such a short distance, do I need to measure the resistance of each candle and do some calculation based on that?). Apologies for the long-winded question but I just wanted to give someone as much info as possible. AI: I'm afraid that a standard 9V battery may not power your lights any longer than the 12 coin cells. I am also concerned that if you connect several lights in series they may not flicker properly. Is there a possibility that you could use an AC-to-DC converter (a "wall wart") to provide power? I know that would mean a wire running into the aquarium but it would save a lot of batteries. If not then you might consider using 2 or 3 D-cells in series. You should be able to get a plastic holder for these batteries at a local hobby shop. Either way, you need to have a source of low voltage (3V to 6V, say) at fairly high current. Then I think you need to connect a resistor in series with each light, and connect all of the light/resistor combinations in parallel. The resistor is needed to limit the current to each light, something that the coin cells did inherently because of their low current capability. I would suggest that you start with about 100 ohms if the supply is 3V and 500 ohms if it is 6V. If the light is too dim or doesn't flicker then gradually reduce the resistance until it behaves properly. It might be a good idea to try this with just one light until you figured out a good resistor value, but you will need one resistor per light in the end.
H: What is the Global Descriptor Table memory type? What type of memory type is used for the Global Descriptor Table in an Intel Core 2 CPU? Is it just EEPROM or does the CPU normally use another type of NVRAM? AI: The Global Descriptor Table is stored in normal memory (RAM), the CPU is told where it resides using the LGDT instruction. This happens in protected mode when the CPU is effectively a 16 bit processor and the instruction needs to be run in ring 0. The CPU will retain references to the table (including in the segment registers) but it isn't physically stored on the CPU itself. And regardless, an x86 CPU does not have EEPROM. You can find some good references here: http://www.jamesmolloy.co.uk/tutorial_html/4.-The%20GDT%20and%20IDT.html http://wiki.osdev.org/GDT_Tutorial#Telling_the_CPU_where_the_table_stands
H: Backup power for adsl modem I want to create a circuitry for switching to backup power (small battery) in case of mains power failure for my ADSL modem (to avoid the internet going down in such scenario). This is a basic circuitry however I have only very basic knowledge of electrical and electronics and hence need help. The below diagram shows what I am trying to create. Request help on how to create this "instant switching circuitry". Modem specs: Current=0.6A Voltage=9V AI: The most simple backup source selector involves just two diodes The problem with this kind of circuit is that there is always a voltage drop on the diode so the voltage that reaches the load is Vsupply - Vf where Vf is the diode forward voltage drop. Also the backup voltage should be lower than the main supply or both the diodes will be on simultaneously and both sources will share the output current. A circuit that would work better (untested) would include the addition of a mosfet (it's a P-mosfet) that operates as a switch and connects/disconnects the battery depending on the availability of the main supply voltage. Note that the main supply voltage shouldn't be higher than the max Vgs which is about 20v (check the datasheet of your specific device). The battery voltage level is not a problem in this case, it can even be higher than the main voltage source. Apart fro the mentioned solutions you can always design a circuit that involves a comparator and drives a switching device to connect he appropriate source or even use a commercial chip intended for supply monitoring.
H: Possible Homemade RCA to Aux I'm going to flat out say I'm a programmer with a soldering iron. So, if I sound like I don't know what I'm talking about; take this into account. I was browsing stores for an RCA to Aux converter. However, they are all charging 20-30$. My question, does the red and white audio connectors pass things digitally. So, could I just solder Aux wire to Red/White wire? Thank you, Nate AI: I found a YouTube tutorial going through step by step: https://www.youtube.com/watch?v=xONOLbupRV0&
H: Why the emitter is earthed in the Common-Emitter configuration of a Transistor? While reading the Common-Emitter configuration of a Transistor from a book, they said that the Emitter is earthed...? Then I Googled it and found the same thing... So my question is that why it is necessary to earth the Emitter simulate this circuit – Schematic created using CircuitLab AI: "Earth" or "ground" in this case just means the point in the circuit the designer decided to call "zero volts", and use as a reference when measuring voltages elsewhere in the circuit - it does not imply an actual connection to the earth. I'd prefer to call that point "circuit ground", or "common", rather than "earth". The important thing to notice in a common emitter circuit is that the emitter is common to both the input and output sides of the circuit
H: got a too low VCE on a Infrared Phototransistor I used an Infrared Light Emitting Diode QED123(VF=1.7V) and an Infrared Phototransistor QSD123 in pair. I learnt from QSD123's datasheet that its VCE(SAT) under IC=0.5mA is 0.4V max. But the VCE I measured with an multimeter is only approximately 0.05V... Here is my schematic: I put the led and transistor head to head like this: So VCE is just voltage on OUT1... whether 0.05V is VCE(SAT) or just VCE, is it too low for a transistor? The IC I measured is approximately 1.01mA. I also found an article about VCE(SAT): Photo-transistor: Collector Saturation Voltage:VCE(sat)(V) Collector-to-emitter voltage in relation to a prescribed collector current(IC) of the photo-transistor on the light-receiving side, when a prescribed forward current(IF) flows through the LED on the light-emitting side. Since this voltage changes greatly depending on the forward current(IF), collector current(IC), and also individual variations in the current transfer ratio (CTR) and its degradation, the forward current and collector current values must be designed taking these factors into careful consideration. The article says that VCE(SAT) is greatly depending on IF... But I still got no sense on the 0.05V VCE. Is my measuring wrong or I have a bad understanding about VCE(SAT)... Reply is desired, thanks:) AI: Uh, when they say \${V}_{CE}\$ max they mean the worst-case (e.g. largest) collector-emitter voltage drop, not the smallest. Basically, they're guaranteeing that the collector-emitter voltage will always be less then 0.4V when the device is saturated.
H: Micro-Controller copy Recently I started looking into micro-controllers, I bought a velleman pc serial interface and a serial to usb adapter for programming pics, I have some experience with micro controllers, but some educational micro controller called PICAXE, it is programmed in BASIC and is very user friendly, but I wanted to take the leap and do something larger, that's why I asked a friend if he could get me a pic, I borrowed one he told me he didn't use for a while but should have some program whose code he had lost. With this, I decided I wanted to recover his code and maybe interpret it and give it back to him as a gift in exchange for the pic and his help. I started digging the web, forums, blogs, everything PIC related to look for this. With the velleman interface (K8076) I was able to connect to the pic (12F629) and allegedly "scan" the program, the output was a .hex file, but I was wondering if I could translate that to something like an .asm file so the program is readable and I can interpret it. This was done with velleman's software, called PicProg2009. Can the whole job of reading the pic be done by MPLab X? i downloaded the latest version, but i dont know much on how to work around with it, so I don't even know how to recognise the interface in MPLab... Also, what is the OSCCAL Value? it seems to be different everytime i scan the pic for code... A Last question: Could this interface be used for the same purpose if it was an ATMEL micro-controller? Best regards, AI: Yes, this is possible in a number of ways. What you need is a disassembler that supports the target microcontroller you have. The simplest way to do this for a PIC is to use MPLAB. I use the older version (v8.90) for this but there is most probably a way to do it in MPLABX also. Load the software then choose File->Import and open your .hex file. After this you can use View->Program Memory to see the assembler. This might not bear much representation to the original code if it was written in a compiled language (for example C), but it will be an accurate representation of the exact instructions the microcontroller would run. There are other free pieces of software that can do this. You can also find paid offerings like IDA Pro, which become very useful when starting to disassemble bigger portions of code.
H: Baudrate of DS18B20 I'm trying to connect a DS18B20 to my Beaglebone Black. Now I wan't to determine the Baudrate but can't find it in the Datasheet of the DS18B20. In the internet I saw different ones (9600, 19200). Can I simply choose one the Sensor pick's up on it? If so up to what maximal rate? Sorry for this RTFM question, but I really can't find the answer for that. AI: You don't normally connect 1-wire devices to UARTs. So you don't need to set a baud-rate. See Beaglebone Black 1-wire or ditto with Arch Linux As an aside, 1-wire support is standard in the Raspian OS used on the Raspberry pi, it seems somewhat easier to use.
H: OSCALL byte, what is this? I recently started playing around with micro-controllers, and with a pc interface and it's software, when reading a program from a micro controller i got a field that said OSCALL byte and seems to give me a different value everytime, my question is, what is this byte? What does it stand for? From the name i would guess something like OSScillator CALLibration, although both the S and L are doubled, this is what makes more sense to me... Best Regards AI: Your related question says that you are using a 12F629, so I will refer to this datasheet throughout. Many modern microcontrollers have inbuilt oscillators. These are fairly accurate but the exact frequency will vary due to the manufacturing process. Because of this most of these microcontrollers have some way of "tuning" or calibrating the oscillator whilst it is running. With the PIC 12F (and other similar PIC families) there is a register called OSCCAL. You can read about it in section 9.2.5.1 "Calibrating the Internal Oscillator" on page 56 of the datasheet I linked above. The datasheet says: A calibration instruction is programmed into the last location of program memory. This instruction is a RETLW XX, where the literal is the calibration value. The literal is placed in the OSCCAL register to set the calibration of the internal oscillator. This value can be calculated and set by Microchip's PICKit2 and PICKit3 programmers and probably by some of the better compatible tools. Example 9-1 on page 56 shows how this is loaded into the OSCCAL register, which is volatile and therefore needs to be set at each powerup. BSF STATUS, RP0 ; Bank 1 CALL 3FFh ; Get the cal value MOVWF OSCCAL ; Calibrate BCF STATUS, RP0 ; Bank 0 This is a simple piece of code that selects the correct bank, calls the last memory location (0x3FF) and then moves the result into the OSCCAL register. This explains why the last byte in a hex file disassembles to RETLW XX, it simply returns the calibration value. If you want to use this value which is stored in program flash you need to include a small stub like the above code that runs each time your device undergoes a power-on reset. Some PIC C compilers will automatically include this for you on relevant devices. You can read some more about OSCCAL at the following links: http://picprojects.org.uk/projects/piccal.htm http://www.electronics-lab.com/projects/mcu/017/index.html http://melabs.com/resources/articles/osccal.htm
H: Being Above Resonance What does it mean being above resonance? Does it mean that our frequency is more than the resonance frequency? In an LC circuit, why is circuit more inductive when frequency is above resonance? AI: What does it mean being above resonance? Does it mean that our frequency is more than the resonance frequency? Yes - frequency > Fresonance. Inductive reactance increases with increasing frequency. Z = 2.Pi.f.L Capacitive reactance decreases with increasing frequency. Z = 1/ (2.Pi.f.C) At resonance the capacitive and inductive reactances are, by definition of resonance, equal but of opposite sign. So, above resonance the net reactance will be inductive. ...
H: Charging my laptop with a universal adapter My laptop charger's adapter recently died, and as a new one of its kind was very expensive, I got a universal one for free (here is the model, I couldn't find a link in English though). The charger's output voltage is variable (12, 15, 16, 18, 19, 20, 24V), and my battery says 14.4 V on it, so I figured I should go for the 15V setting. What I found really weird was that it didn't charge when plugged in. I tried 16V, to no avail. Only when I cranked it up to 18V did it say that it was charging. Can someone here offer an explanation for this very weird behaviour? If you want a photo of exactly what it says on the back of the adapter and/or my battery, please tell me and I'll upload one. EDIT: If it's relevant, my machine is this ASUS gaming laptop. AI: Using your link, I found the specifications for your laptop. The AC adapter is rated at 19 volts DC output. That is why you had to increase the voltage on your universal adapter. Usually, the adapter provides a higher voltage than the battery to insure that it will provide current to the battery. Also, there is probably circuitry in your laptop to control the charging current and monitor the battery voltage so the battery won't be damaged by overcharging.
H: What is the difference between MOSFETs and BJTs After reading this page : http://learn.adafruit.com/rgb-led-strips/usage I was wondering what is the difference between N-channel MOFSET and a TIP120 transistor. More specifically, why does he add 100-220 ohm resistors at the base when using the TIP120? AI: http://www.digikey.com/product-search/en?lang=en&site=US&keywords=tip120 TIP120 is a BJT, which is a different family of transistors from FETs. Below is a broad, oversimplified, cartoon version of how they both work. The below assumes NPN and NMOS, as specified in the question. PNP and PMOS would invert some of this. A BJT has very low base impedance; essentially, there's a diode between base and emitter. This means that if the transistor is "on", the base of the transistor will be ~.7V above the emitter. If you try to drive the base higher than that (say to 3.3V or 5V with a microcontroller I/O pin) an undesirably large amount of current will flow, and bad things will happen. You have to have something between the I/O pin and the transistor base to limit that current. Thus the resistor. The processor side of the resistor goes to 5V (or whatever your microcontroller logic rail is), and the transistor side goes to ~.7V. This voltage differential, divided by the resistance, gives you the current being injected into the base. That, plus the transistor characteristics, tells you how much current can now flow through the BJT collector-emitter. A FET has very high gate impedance, so no current flows into the gate when it's turned on. You apply voltage between gate and source, and the "switch" closes. The gate can typically go up to 20V above the source, so driving a FET with a microcontroller isn't typically a problem. Instead, you have the opposite concern: some FETs need more gate voltage than some processors can supply! Now, there are all sorts of additional details. Sometimes you put a resistor in series with the gate of a FET, for filtering purposes. There is actually current flow into the gate of a FET, particularly at turn-on and turn-off, which can matter for some applications. And BJTs and FETs can be driven in an analog mode, where they're neither fully on or off, but somewhere in between. Sometimes that's good, sometimes it's bad. When I'm wearing my microcontroller hat, I tend to use FETs wherever possible. In general, they're easier to work with and their losses are lower. BJTs are sometimes cheaper, and they're more likely to be the choice for analog control applications.
H: Conversion of a Galvanometer to Ammeter and Voltmeter? I am in 12th std and while reading my Physics textbook I came across a topic called "Conversion of a Galvanometer to Ammeter and Voltmeter." So I read it and found that to convert a Galvanometer to Ammeter we connect a very low value resistance in parallel to the Galvanometer and to convert it to Voltmeter we connect a very high value resistance in series with the Galvanometer. Now my question is: What is the logic behind this type of conversion? I mean that why the low resistance is connected in parallel to the Galvanometer? Why can we not connect in series? Or why does it have to be low, why can't it be high? AI: A "moving coil" galvanometer shows a deflection proportional to current flowing through its coil due to very small voltages placed across its terminals. Full scale deflection of a galvanometer typically requires between tens and hundreds of microamperes, corresponding to a voltage of tens of millivolts across the terminals. The coil resistance of a galvanometer is typically a few Ohms to a few hundred Ohms. Typical full-scale For the sake of this explanation, let us assume a very sensitive galvanometer with 100 Ohm coil resistance, and 100 microAmperes current for full-scale deflection. Thus, by Ohms Law, the full-scale deflection will require 10 mV across the terminals. To create an ammeter with a maximum current rating of 1 Ampere, this current must generate 10 mV across a "load resistor" or "shunt resistor". By permitting 1 Ampere to flow through a 10 milliOhm resistor, 10 mV is generated across this resistor. That's perfect for our purposes, so we connect the galvanometer across (in parallel with) this 10 milliOhm resistor: simulate this circuit – Schematic created using CircuitLab As the galvanometer's resistance (100 Ohms) is much much greater than the shunt resistance (10 mOhm), we can pretty much disregard the effect of paralleling the galvanometer's coil to our shunt. Thus, in effect the Ammeter we have created, has 10 milliOhms of resistance, which is pretty much negligible, and reads up to 1 Ampere current. Now for a voltmeter. If we needed a full-scale reading of, say, 20 Volts, we would need to ensure that 20 Volts would cause 100 microamperes (assumption stated earlier) to flow through the galvanometer. Ohms Law tells us that a resistor of 200 KOhms would pass 100 microAmperes through it, if exposed to 20 Volts. If we were to put our galvanometer in series with this current path, we'd have an excellent 20-Volt Voltmeter. In this case, again, the 100 Ohm coil resistance is negligible in comparison to the 200 KOhm resistor, so we can ignore it. simulate this circuit Note that in this case too, the galvanometer is illustrated as a current meter - because that is what it remains. The combination of the galvo, and the 200 K resistor in series with it, provides us a voltmeter that meets our requirements. The above examples are extreme cases: Measurement of a small maximum current of say 1 milliAmperes instead of 1 A would require the current to pass through a resistance of 10 Ohms (to generate the 10 mV needed by the galvanometer coil). As this is a significant value comparable to the galvo's coil resistance, the actual shunt resistance value calculation would need to take the parallel 100 Ohms (coil) into account. Similarly, for measuring small voltages by using our galvo as a voltmeter, the series resistor calculation would need to subtract the coil resistance value. I am sure your textbook explains these calculations in greater detail.
H: Importing libraries in Processing IDE I am sorry guys if I didnt make myself clear. So here is an another attempt. I am trying to view the output of MPU6050 (gyrometer + acclerometer) in Processing IDE. I added the FreeIMU library in arduino and then executed the FreeIMU quaternion code from the examples. I was able to see the change in data values in the serial monitor of arduino. Now I wanted to see a graphical output using Processing IDE using FreeIMU Cube example. I am just not able to proceed furthur from here. Kindly provide me with the steps from here onwards. See video: https://www.youtube.com/watch?v=gU9vM0UE3Ug AI: FreeIMU is not a Processing library by itself but an Arduino one. So including FreeIMU in a Processing project won't work because it is made to access specific hardware and collect data from specific gyroscope and accelerometer chips. To visualize graphically data on a computer (PC) with Processing, you have to communicate with the Arduino where FreeIMU is installed, to collect the data. The FreeIMU library package, available here, have two Processing examples. If you look at the code provided you'll have your answer. FreeIMU_yaw_pitch_roll Processing example : Visualize orientation information from a FreeIMU device INSTRUCTIONS: This program has to be run when you have the FreeIMU_serial program running on your Arduino and the Arduino connected to your PC.
H: Arduino Uno board heating up and code not uploading This is the for the second time I'm facing this issue and seems to me that this frigging thing is not worth using. The board is heating up, (the little chip in the vicinity of fdti port ) is becoming hot as hell. None of the single snippets of code is uploading to Arduino I'm getting that old lifelong persisting error (whenever I'm up on something this frigging errors comes into picture and destroys my work ) THE AVRDUDE ERROR. I think I have screwed up just before new year. Is there any way , I can turn this upside down? And yeah I have burnt my fingers too. AI: Proper care and feeding is necessary for prolonged life. Knowing what "proper" amounts to needs to be learned with care - both from manuals and competent experienced users. If two sets of users differ on their "what you can safely do" advice, err on the side of caution. There are many inexperienced users in this community - which is good, because the devices are targeted at being usable by the uninitiated - but which is also bad because much advice given may be suspect. Odds are it's dead, alas. Odds are you did something fatally wrong - which is somewhat easy. A few non-exhaustive pointers: A number of the pins connect to the internals directly and must be treated as per device spec sheet. The power supply must be within the limits specified. Anti electrostatic discharge precautions must be taken when handling the device. Do check your power supply voltage. Do check that you are connecting power to where it should be connected (which is less silly than it may sound).
H: How can I scroll through all colors of an RGB LED using an Arduino microcontroller and a single Potentiometer? The RGB LED is supposed to be controlled by PWM, how can I map the position of a potentiometer to a color combination? AI: To begin with, there is no definitive discrete set of "all colors" for an RGB LED: Each of the emitters, red, blue and green, can essentially be varied through an infinite set of interim values from fully off to fully lit. If we were to simplify the problem statement per the convenience of fitting into Arduino's library functions for reading analog values and writing PWM values, it boils down to this: The ADC pin hooked up to the potentiometer can read 1024 distinct values in an ideal case: AnalogRead() returns an integer between 0 and 1023, i.e. 10-bit unsigned value The PWM pins can each accept values between 0 and 255: AnalogWrite() accepts an 8-bit unsigned integer value. Thus, 24 bits to describe all possible RGB values supported by Arduino library functions. Thus, a reasonable approach would map the 10 bit input value to 8 x 3 = 24 bits for output. Since the human eye is most sensitive to green, one proposed mapping would be 3 bits each, from the input value, for red and blue, 4 bits for green - each mapped to 8 bits for the red, green and blue AnalogWrite() values. redVal = (inputVal >> 2) & 0xE0; // Values 0, 32, 64, 96 ... 224 grnVal = (inputVal << 1) & 0x78; // Values 0, 16, 32, 48 ... 240 bluVal = (inputVal << 5) & 0xE0; // Values 0, 32, 64, 96 ... 224 This would provide a simple way of traversing most of the possible RGB values within the constraints of simplicity and Arduino library functions. The transition will not, of course, be a smooth traversal across hues. If that too is a requirement, then a color mapping into Hue-Luminescence-Saturation is called for.
H: Digital simulation display I am new in the field of electronic circuit simulation and the two articles i am reading from http://en.wikipedia.org/wiki/Electronic_circuit_simulation http://en.wikipedia.org/wiki/SPICE have led me to ask this question.Supposing i am running an analog and digital simulator like LTSpice analog and digital simulator,can i have an LED display inside the LTSpice analog and digital simulator to display some data for instance if i am working on a data acquisition circuit?. AI: In LTspice you won't have any way to display data except for waveform plots - which is what you're going to use most of the time for analog circuit design. You won't see a LED blink or a 7-segment display, if that is what you're looking for. There are other simulators that can do that (e.g. Multisim, Proteus), but I find those features to be of limited use at best. You could, however, export the data to a text file and then use other software to process it - that includes visualizing it in other way you might want to.
H: Why does coaxial cable cause this effect? This is a follow-up question related to my non-contact voltage detection circuit (here). I wanted to be able to detect voltage in a wire a few feet away from the Arduino, so I added a length of RG174 coaxial cable (with the shield grounded) between the 4-inch pickup antenna and the circuit. I was expecting the coaxial cable to prevent pickup of any other signals, but otherwise no further effects. The actual results were that the cable did act as a shield, but it substantially reduced the effect of the pickup antenna. To be able to detect the AC field, I had to length it by a few inches and wrap the antenna several times around the 120v wire. Why did this happen, and is there some way to be able to calculate these variations and be able to determine them before-hand? Diagram (excuse the MS Paint coaxial cable): AI: The coax cable shielded the signal line between the antenna and the receiving circuit, which is how it reduces extraneous pickup. Note that this does nothing about extraneous signals picked up by the antenna itself. The reason it attenuated signals from the "antenna" is because it adds some capacitance from the signal line to ground. It looks like what you are calling a antenna is really just a capacitive pickup. The capacitance from the source signal to this pickup will be small, so the small capacitance in the coax cable is large enough to form a significant voltage divider.
H: Choosing a SDRAM pcb layout I'm working on a project with the quite new STM32F429 in LQFP208 package. I need to solder the first couple of prototype by myself for low budget reason. I choose this package so I could check myself if a problem is due to the routing/firmware or just a soldering issue. In the project there are an LCD, a CAMERA, an ULPI and a 32b SDRAM bus plus some other slower interface. The FMC BUS will be only used for SDRAM, no other memory is needed for the project. The PCB stackup is a standard 4 Layer S-GND-VCC-S. I need an advice for what would be the best approach to route the SDRAM/MCU interface. Here there are 2 different design that could be done: Left one will be the best to have very short traces, but it will not leave too much room for length matching, not really needed due to really low propagation delay for short traces). The LCD/ULPI/CAMERA bus could be routed externally without much problem. Right one could be better, slightly longer traces but lot of room for length matching, and still no termination needed. The LCD/ULPI/CAMERA bus will be routed externally but they will meet the SDRAM bus in lot of point so vias count will be increased on these bus and layout will be much more complicated! EDIT: Both sides assembly is a must because of some other components. Could you explain which one would you choose and why? EDIT2: I choose the left one after populating the pcb, so there wasn't too much space for the right one. This is the preliminary result. Advice is still accepted to improve the layout: EDIT3: Added Power and Ground vias: Thank you! AI: I would choose the right option for ease of assembly. One sided will also be cheaper if you go to larger scale manufacturing. The only reason I'd pick the left option would be size constraints.
H: Switching 9V using a NPN transistor and an Arduino First of all, I'd like to say I'm not an Electrical engineer so please bear with me. I haven't got a sketch for what I'm trying to achieve but hopefully I can explain it ok. I have an NPN transistor (2n2222 specifically) and am doing the following. Connect 9V battery to transistor collector Connect transistor base to Arduino PWM output pin (1k transistor in between) Connect ground of 9V battery to Arduino ground Write a for loop (i = 0-255) which increments by 1 every 100ms and do analogWrite(PWMOutputPin, i) I then take a multimeter to measure the voltage between ground and the emitter leg and what I'm getting is values between 0-4.5 volts while the battery has about 7.68V in it by measuring it directly. I thought the purpose of the transistor is to send the full voltage between the collector and emitter provided that there's sufficient voltage being sent to the base. Is this correct? Am I doing something wrong? AI: The circuit you describe is an emitter follower - the emitter voltage follows the base voltage and is always about 0.7 volts negative of the base. The transistor doesn't care where you think "ground" is, its operation only depends on the voltages between its pins. If you ground the emitter, and put your load between the collector and the positive supply, you will be able to get very close to the supply voltage across the load when the Arduino output is high. You should have a resistor of 1K or so between the Arduino output pin and the transitor base, to limit base current and loading of the Arduino output pin.
H: Is this a valid sinusoid? The given image is from first edition of this book To me the first sinusoid seems valid, in sense that values can be computed at different points. However, in the case of second sinusoid I fail so see a logic for computing the various values given. The question is Is the second figure valid? If yes, how ? Update It seems I have created much confusion/ambiguity, and I just realized that I didn't use the 'radian' in my calculation for the points of sinusoid( I'm so pathetically used to the 'degree' unit) What I wished to say was that for the first sampled sinusoid i.e. cosine(pi*n/6) I can, very easily, compute it for n= 1,2,3... and its period, T = 12 For the second case, cosine(n/2), I couldn't compute its values at various 'n' (for the sake of it I didn't/couldn't put in there the 'radian'). Sorry fellows! AI: Yes, both are sinusoids, or at least discrete samples of sinusoids. "Valid" has very little meaning, and is not worth debating about unless you further define it. The first signal is periodic, the second is not. If you wish to define a valid sinusoid as being periodic, then the second signal fails that test. You could resample it such that it will be periodic.
H: Arduino, NPN and common cathode RGBs I'm trying to design a mood light system using 4 RGB LEDs which will be powered by an external 9V source and an Arduino for processing. Link to Fritzing file Part list: 3 x 2n2222 transistors (NPN) 4 x 5mm LEDs (Common Cathode)(http://www.jaycar.co.nz/products_uploaded/ZD0012%20-%20AL-50-30RGBC-C-004.pdf) 3 x 10k pots 3 x 1k resistors (PWM to Base) As you can see, what I've attempted to do is: connect each LEDs common cathode to ground 9V to each (R)(G)(B) collector Arduino PWM output to each (R)(G)(B) base emitter to each (R)(G)(B) anode What I was expecting is that the PWM output of Arduino would regulate the emitters voltage between 0~9V therefore being able to dim the LED with my pots. What I have instead got is that the voltage is 0.7V short of what the base is receiving from Arduino and the voltage supplied to the collector is being ignored. In fact, I can even disconnect the 9V battery, and the LEDs would still be lit. From a previous question, I believe this is emitter-follower behaviour? Is there a way I can re-wire this and get the expected behaviour? Or will I need to get some different parts. I got given the wrong LEDs (common cathode instead of anode) but the shop isn't open for another few days to go get a replacement so I'm trying to make do with what I have. Please ignore the lack of resistors between the emitter and LED. I have omitted them for simplicity. AI: Things regarding a high side switching of a voltage higher than the control voltage are not as simple as they seem. Take for example the following circuit controlled with an Arduino I/O pin When the I/O pin is LOW the voltage to the base will be 0, that means that the Vbe will be 9v and since it is >0.7v the transistor will be on. When the I/O pin is HIGH the voltage to the base will be 5v, that means that the Vbe will be 4v and since it is >0.7v the transistor will also be on. So basically that configuration can't work as a switch because the transistor will always be on. In order to make a circuit like the above work properly you have to add a level translator that will actually drive the base with 0v and 9v (or whatever the collector voltage level is), a circuit like One alternative of a working single transistor high side circuit is an emitter follower like The problem is that in this case the emitter will follow the base voltage when the transistor is on so for 0 and 5v control voltage you will get 0 and 4.3v output irrelevant of the voltage connected to the collector (within transistor specs of course) which may ot may not suite your specific application. Another alternative is to use a device like ULN2003/2803 but intended for high side switching. Such a device is UDN2981 which has 8 source drivers like the following and can be used as a high side switch controlled by TTL level logic.
H: Why do capacitors across my FETs minimize ringing/distortion? I'm designing a 24V to 350V DC-DC Converter based on a H-Bridge. The power requirement is 500W and the circuit operates at 20KHz. The design works fairly well and I've achieved about 90% efficiency at 200W load. The main issue with the circuit is ringing. The waveforms distort/ring when the transformer is connected to the H-Bridge. Without the transformer the waveforms are extremely clean, even under load. Picture below shows waveforms with the transformer connected but without any load. I found that adding a capacitor across all my FETs helped minimize the distortion severely. Here's a picture from my o-scope demonstrating this (left is without load, right is with 200W resistive load). Note that the output from the transformer is rectified with a full-bridge rectifier and smoothed by a capacitor: So my question is: why are capacitors across my FETs minimizing the distortion? What is taking place in the circuit? I initially added a RC snubber across the FETs but the circuit works much better without the resistors and just the capacitor! Here's a picture of the schematic and the layout: AI: I'm not entirely sure which picture is for which configuration but adding the capacitors is not a good idea because they will reduce the efficiency of your switching circuit. The transformer produces the ringing because it is inductive and it has self capacitance - together, when the FETs switch you will get a resonant tuned circuit and ringing will occur. I'd do nothing other than try to improve your transformer. Maybe you should give details of this. There are also other effects that can appear to cause ringing namely your o-scope earth point not being close to your measurement point and getting an induced voltage in that loop from the switching currents. This commonly happens. Make sure your measurement technique is sound.
H: Using capacitor to supply temporary surge I am learning electronics on my own and I have a feeling a capacitor can solve an issue I have. The datasheet for a part, which is powered by three lines (+12V, 0V, -12V) says that it draws 40 mA continuusouly, but that it can also draw up to 250 mA temporarily, for 0.1 second. Well, let's say I just cannot afford to put on my board a power supply capable of giving 250 mA (I can go up to 80 mA). Can I use a capacitor to help supply the temporary surge? I have thought of : Capacity required : 0.250 * 0.1 = 0.0250 A.s (Coulombs) Let's say I decide to connect the capacity to the +12V and -12V (is it ok ? Should I have two or three capacitors ?), then, with a 50 V capacity, that makes : 0.0250 / 50 = 0.0005 F So I would need a 500 µF capacity to do the job. Is that correct ? But then, when the part draws 250 mA for 0.1 s, the capacity get discharged, and it temporarily draws more current on the power source to recharge. I can solve this using a resistor, but where to put it, and how to choose it? I have thought of that : simulate this circuit – Schematic created using CircuitLab OR simulate this circuit What do you think ? Is it even a good solution ? AI: You're sort of on the right track, but you can't just put 50V across your capacitor without also putting 50V across your circuit, which would probably damage it. I would start by saying that you probably want two capacitors, one between +12V and ground, and the other between -12V and ground. Then, you need to decide how much you can allow each of the 12V buses to "sag" during the current surge. For example, if you could tolerate a 2V drop during the surge, then the capacitance needed would be 0.025 C / 2 V = 0.0125 F, or 12500 µF. The resistor — if needed at all — should be positioned as shown in your first diagram, in series with the source, not in series with the capacitor. But the power source's built-in current limiting will probably be sufficient without the need for another resistor.
H: Purpose of the diode and capacitor in this motor circuit I'm hooking up a small DC motor to an arduino using an NPN transistor using the following diagrams I found online: The circuit works, and I'm successfully able to make the motor run. Now, I'm seeking to understand why it works the way it does. In particular, I'd like to understand: Why are the diode and capacitor hooked up in parallel to the motor? What role do they serve here? Why is a resistor needed between the transistor and the digital PWM pin on the arduino? Would it be safe to run the circuit without it? AI: The diode is to provide a safe path for the inductive kickback of the motor. If you try to switch off the current in an inductor suddenly, it will make whatever voltage is necessary to keep the current flowing in the short term. Put another way, the current thru an inductor can never change instantaneously. There will always be some finite slope. The motor is partially an inductor. If the transistor shuts off quickly, then the current that must still flow thru the inductor for a little while will flow thru the diode and cause no harm. Without the diode, the voltage across the motor would get as large as necessary to keep the current flowing, which would probably require frying the transistor. A small capacitor across the motor will reduce the speed of the possibly fast voltage transitions, which causes less radiation and limits the dV/dt the transistor is subjected to. 100 nF is excessive for this, and will prevent efficient operation at all but low PWM frequencies. I'd use 100 pF or so, perhaps to up 1 nF. The resistor is to limit current the digital output must source and the transistor base must handle. The transistor B-E looks like a diode to the external circuit. The voltage will therefore be limited to 750 mV or so. Holding a digital output at 750 mV when it is trying to drive to 5 V or 3.3 V is out of spec. It could damage the digital output. Or, if the digital output can source a lot of current, then it could damage the transistor. 1 kΩ is again a questionable value. Even with a 5 V digital output, that will put only 4.3 mA or so thru the base: the voltage drop at the B-E junction ("diode") is 0.7 V, leaving the 4.3 V at the resistor. You don't show specs for the transistor, so let's figure it has a minimum guaranteed gain of 50. That means you can only count on the transistor supporting 4.3 mA x 50 = 215 mA of motor current. That sounds low, especially for startup, unless this is a very small motor. I would look at what the digital output can safely source and adjust R1 to draw most of that. Another issue is that the 1N4004 diode is inappropriate here, especially since you will be turning the motor on and off rapidly, as implied by "PWM". This diode is a power rectifier intended for normal power line frequencies like 50-60 Hz. It has very slow recovery. Use a Schottky diode instead. Any generic 1 A 30 V Schottky diode will do fine and be better than a 1N4004. I can see how this circuit can appear to work, but it clearly wasn't designed by someone that really knew what they were doing. In general, if you see an Arduino in a circuit you find on the 'net someplace, especially a simple one, assume it was posted because the author considers it a great accomplishment. Those that know what they are doing and draw out a circuit like this in a minute don't consider it worth writing up a web page on. That leaves those that took two weeks to get the motor to spin without the transistor blowing up and they're not really sure what everything does to write these web pages.
H: LM741 saturation problem in MultiSim modeling Since in my case Vs+ = 12V, Vs- = -12V I expect that when I do an open loop OpAmp, the output should be limited by +- 12V, which is not the case in my simulation. What is the problem? P.S. with a closed loop everything works as expected. AI: It looks like your op amp model is not a very accurate model. I'm guessing it does not include any limiting on the output voltage and is probably using a simple VCVS for the amplifier. If you don't like that behavior you should look for a better model.
H: Seeking 4x3 keypad for Atmel UC3 microprocessor I was doing a combined project with a friend, with me on s/w and him on h/w. After a year of coding on my part & not much activity on his, he announced that he is "too busy" to continue. That leaves me, a pure s/w guy with little or no h/w knowledge to continue. I need a 4x3 keypad which will work with an Atmel UC3 series 32-bit microprocessor - can you advise? Preferably something with sample code. As I have no o/s, should I go interrupt driven or polled? (told you I am not a h/w guy ;-) Thanks in advance for any help. AI: The circuit I use has the MM74C922 4x4 matrix encoder at its heart. The advantages of using it are that it provides an interrupt for keypress notification plus it handles debouncing the keys. DA connects to an interrupt pin so that the MCU can be notified when a key has been pressed. For 4x3 operation, leave Y4 disconnected (since the Yx pins are sensing). Note however that the MM74C92x is obsolete, and supplies will dry up over time. You should look for a more recent part such as the TCA8418 or MAX7360 which, although not drop-in replacements, do offer additional capabilities which may remove some of the burden from the MCU.
H: Calculating power requirements of RGB LED strips Is there any formula or rule of thumb for calculating power requirements of 'typical' RGB LED strips? Say x amps per # of lights? or are there too many other variables involved(specific make, etc). AI: There are way too many types of LED strips (e.g. individually addressable or not, I2C, SPI or PWM interface, integrated current limiting resistors, ...) A wide variety of LED chips are used in such strips (5 mA, 20 mA, 500 mA or even 1 Ampere per color, and SMD 3528 through to high-power LED per color), for any general rule of thumb to be applicable. Also, the number of LEDs in a strip is yet another variable. In short, there is no such thing as a "typical" RGB LED strip. An LED strip manufacturer will typically list rated power for the strip, that is the best recourse for determining power requirements.
H: What is the fastest logic gate? I have been told that the fastest logic gate family is ECL. My first question: Is this true? In this or another family (Depending on the answer to the above question), Is there any particular gate who's internal structure is: simpler, faster, requires less energy, creates less electrical noise e.t.c. ? AI: ECL is both the fastest logic family and has the simplest internal structure of modern logic families, but like other bipolar-only families it has a not insignificant power draw. It is also incompatible with other logic families due to its signal voltages. If you're looking for a logic family for general use, my recommendation would be the 74LVC CMOS family. It takes a supply of 1.65V to 5.5V, and uses normal CMOS signaling levels. It comes as surface mount only, but provides flexibility in that it is possible to get devices with as few as a single gate in a SOT23-5 package.
H: thin headers to replace IC with a board I have an IC (PDIP) I would like to replace with a board and some smd parts. Normal 0.1" headers are too thick to fit in the holes of the desoldered IC pins. Do you know if there exists 0.1" pitch headers with diameter of 0.6mm or less, so that they fit in the holes for the IC pins? AI: You can use the machined pin headers. They are available in both male and female versions Here is the female datasheet that shows the pins diameter, it's 0.51mm And a male header datasheet , this one shows 0.49mm
H: 200kHz Ultrasonic Piezo Transformer Can anyone recommend characteristics for a low power (< 1W) 1:10 step up transformer for driving a piezo crystal (1nF capacitance) at 200kHz? AI: I'd start with using a ferrite material like 3F3 from Ferroxcube - it'll have low losses at 200kHz: - The dotted line in the graph (largely) represents the core losses and, at 200 kHz, it is quite low compared to the normal permeability of the material. I'd probably go for an RM type pot core such as an RM8 (available with 3F3 material) and I'd gap it it to reduce efects of saturation and inductance drift with temperature. The part is available pre-gapped and has a Ferroxcube part number of RM8/I-3F3-A400 - this has an \$A_L\$ value of 400 nH/\$\sqrt{Hz}\$. If you have 5 turns on the primary its inductance will be 10 uH. The secondary would be of course 50 turns. The bobbin part number is CPV-RM8/I-1S-12PD - it should have enough room to put the windings in. You'll need two clips to hold the ferrite parts together (CLI/P-RM8/I). If you refer the transducer capacitance back to the primary you'll be seeing about 100nF because of the square of the turns ratio and this will look like a primary load of 10 uH in parallel with 100nF (plus a resistor that represents the acoustic power output from the piezo. This will tend to resonate at 159kHz so you might want to reduce the primary turns to about 4 to reduce the inductance. I'm not sure whether the piezo transducer you have is very resonant at 200kHz or not and this could make a big difference - I'm assuming that it is not naturally resonant at 200kHz but if it is you might need to experiment with primary and secondary turns. Alternatively, if you have a good model of the electrical characteristic try simulating the effects it might have - you won't need to worry about simulating the 3F3 material - just use two coupled coils at about 97% coupling and play with primary inductance values. That's how I'd do it anyway.
H: Is it safe to self-reset a flip-flop based on its output state I'd like to create a logic function that toggles with the (inverted) clock when enabled and stays low when disabled, like so: clk ena out 0 0 0 1 0 0 0 1 1 1 1 0 I could do that with simple AND/NOT gates, like in the following schematic: The output should be glitch-free though, so I thought of the following circuit instead: To avoid out glitches, ena (which changes triggered on the rising clk edge) is sampled at the falling clk edge. My question is about the DFF's reset input while ena is high: This will only be a very short pulse (almost like a glitch itself), from the time clk rises until the DFF is reset. Will this cause any problems or is it safe to use this circuit? AI: I don't exactly understand what your requirements are, but it seems to me that you simply want to create a "gated clock" and avoid creating malformed clock pulses when "ena" changes when clock is low (and the output clock pulse is generated). This problem is discussed in this article. One of the proposed circuits is shown below. Please note that all circuits discussed in the linked article have some disadvantages, so you should select the proper one based on other constraints. simulate this circuit – Schematic created using CircuitLab
H: How to float the output of an optocoupler when needed? I want to have an opto-isolated output which can be driven high, low or left floating. I thought of the following circuit but I'm quite new to electronics so I don't know whether it makes sense. Do you think something like this could work? When EN from the input side is high, IC2 is supposed to drive the output high or low. When EN is low, IC2's output should be floating. As I understand it, when the transistor in IC2 is conducting, the OUT pin goes low. When it's not conducting, it floats. So, by itself, the optocoupler can drive the output only to ground or leave it floating. I want to drive it high also, am I understanding something terribly wrong? Edit: Sorry my original question wasn't so clear about what I want to do with this circuit. I want to have multiple copies of the input/output circuit, preferably controlled with just one enable/disable circuit. Also, I'd like to use a high speed device since one of the outputs will be a serial link and I don't know how to find a fast standard-type optocoupler. AI: You could connect a buffer like SN74LVC1G240 instead of the transistor to control the output of IC2. The output of IC1 goes to the Output Enable input of the buffer. The output of IC2 goes to the A input of the buffer. When the EN is high, the output of IC1 is low, enabling the buffer output. When the EN is low, the output of IC1 is high, disabing the buffer output (floating). I think this should work, but please double-check before ordering parts ;-)
H: How can we use a usb(in a laptop) for general purpose input/output operations, such as robotics control How can we use a usb port (in a laptop) for general purpose input/output operations, such as robotics control?? I want to control an external hardware such as a robot or say simply an array of LEDs using my laptop's USB port. Is there a way to do so. If not can we use some other ports like Serial port or RS-232 cable? AI: Basically you need something that will know how to talk USB at the other end of the line. Same thing goes for any other port, but USB itself is pretty complicated, so I'll focus a bit more on it. Unlike simple serial or parallel ports, doesn't just send data over to the other side. Instead, there's a large (well compared to RS-232) amount of communication between the device and the computer and the device needs to identify itself to the computer and so on and so on. So if you aren't particularly interested in how exactly USB works and just want to use it to control something, you have two basic approaches: Get some sort of converter, such as a USB to serial port chip (FTDI makes may types of such chips and is very popular) or cable and then use USB just to send serial commands from the computer. The second approach is to get a microcontroller which can talk USB. There are many such microcontrollers today and there are libraries available that will allow you to simply program a microcontroller to work as a USB device. There are also numerous PC side examples which you could use to work with your micro. The bad side of this is that if you want to go a bit beyond what pre-made libraries offer you'll either have to go the serial to USB converter way (and it's not difficult to implement a virtual serial port inside of a microcontroller) or to learn how to work with USB, which is difficult. With traditional serial port, what you have is basically just a few wires which are toggles between various states by the computer. It's much easier to program it on both the PC side and on microcontroller side. Also, since you can directly control pin states, you don't have to use microcontrollers at all. You can simply build a circuit which will react when a certain pin state goes high or low and that's it. Do note that traditional PC serial ports use RS-232 signaling levels, so zero is positive voltage and one is negative. Also the voltages are pretty high at around 12 V. Another type of port that was extremely popular with hobbyists in the past, but is getting rare today, is the parallel port. It's main advantage is that you basically have an 8 bit bus which you can control, so you have much more pins you can directly toggle from computer. Main problem with it today is that you'd basically have to get a parallel port card for new computers since many do not have it anymore on their motherboard and the USB to parallel port converters often only work for printer use. Another problem are drivers, since in the post Windows XP era, drivers which allow you to directly experiment with the port are a bit rare.
H: Honeywell Dead Reckoning Module GPS Problems This was previously posted in the Stack Exchange forum and I was referred here. I'm currently trying to connect a Honeywell DRM4000L to a GPS module. The DRM is a dead-reckoning device which takes a GPS input and outputs the location by serial. Currently, I have a GS407 GPS module connected to the DRM. Every time I try the GPS pass-through function on the DRM, I get gibberish output. I also have an FTDI cable connected to the GPS and I'm getting the correct NMEA data. The data coming in from the GPS is all formatted correctly when connected directly to the computer. The DRM data is also coming in correctly, but it doesn't see an NMEA data stream and thus does not initialize with the GPS data. It only has track information based off of the inertial sensors (INS). The GPS is set to 9600 baud and the DRM host port is set to 9600, so the DRM should be seeing all the correct GPS data. The baud rate from the DRM to the computer is also 9600. Is anyone seeing anything that I'm not seeing? Thanks! AI: It seems the solution has pretty much been found in the comments but I'll restate it here for posterity. The issue is that one of the devices is a TTL voltage-level serial device and the other is an RS-232 voltage-level serial device. TTL voltage levels are (essentially) 0V for a '0' and 5V for a '1'. This is straightforward for most people to understand - low is low and high is high. RS-232 voltage levels are different. Where TTL has '0' and '1', RS-232 has (respectively) 'space' and 'mark'. 'Mark' is defined as a voltage between +3V and +15V and 'space' is defined as a voltage between -3V and -15V. You'll note that these are the inverse of the TTL levels - a '1' or True signal is a negative voltage and the '0' or False signal is a positive voltage. KK6FSL noted (correctly) that the serial data he was receiving seemed to be an inversion of the proper serial data. Given the discrepancy of the two voltage levels it's surprising that this would be the case - the voltage levels shouldn't be very compatible at all! Strictly-speaking this would be true, but in the real world there is a surprising amount of compatibility in the voltage levels between TTL and RS-232. For example, if a TTL-level chip is trying to read an RS-232 signal then the voltage levels work out pretty well (other than the fact that the levels are inverted from what TTL expects). Assuming that the TTL input is protected so that it can't go higher than 5V and no lower than 0V (which may not always be the case! The TTL chip may be in some danger!) a 'Mark' will be 0V and a 'Space' will be 5V. These are perfectly valid TTL levels and the chip will be able to interpret them - but it won't reproduce the original data! For the reverse case, an RS-232 receiver reading TTL-level signals, a '1' would be 5V which is above the +3V threshold for a 'Space' which would register as a logical '0'. A 0V signal shouldn't register as anything at all because it's outside of the valid RS-232 range: it's not above +3V or below -3V. It's undefined according to the standard and shouldn't be anything at all. Sadly, many RS-232 voltage-level devices are very forgiving of out-of-range voltages and will gladly assume that 0V is a valid value. I believe one past reason for this was that you can save money by directly interface a TTL serial transmit line to an RS-232 receive line without a special chip in between. A bunch of lazy cheap engineers thought it sounded like a good idea and kept it going, so now we have RS-232 'standard' interface chips that don't actually implement the standard. There's yet another wrinkle here that is confusing. In RS-232 when nothing is happening the state of the line is called Idle. RS-232 defines Idle as a 'Space' - this is a positive voltage. When a message starts, the start bit is a 'Mark' which is a negative voltage - thus, a falling transition occurs and this is used to identify when a message begins. One would assume that since the voltage levels are inverted for TTL-level serial messages, the line would Idle at 0V and the Start bit would be 5V. That would be consistent and would make sense so of course it isn't done that way. TTL-level serial also (generally) idles at 5V and the start bit is a '0' which is 0V. Thus, you have the same falling edge transition to mark the start of the message and then all the data bits are properly inverted. If Idle for TTL was simply inverted from RS-232 then the data wouldn't simply be inverted but also delayed by one bit or more (since the first falling edge transition would be some time after the Start bit). Thanks to this wrinkle, there is a simple inversion between RS-232 level and TTL-level serial that makes perfect sense at first, less sense after a bit and then you just give up and accept it. Don't assume though, that the previous paragraph is definitive. Serial protocols are like opinions - every has one and no one really agrees. There are devices out there that will have Idle at logical '0' instead of '1'. The design-related reasons for this are lost to the ages, but in the end the reason is the same: to make your job harder.
H: How can I indicate pin 1 on a SMT package footprint without silkscreen Sometimes when I order PCBs from a board house, I omit the bottom silkscreen for budgetary reasons. When I place surface-mount chips on the bottom of the board, I then end up with a footprint that doesn't indicate the chip orientation. This is annoying because it means that I need to verify the component placement and orientation during assembly, and this allows for errors when placing the parts. How can I clearly indicate pin 1 with the remaining layers in a way that will be clear but not significantly impact the PCB size or cause issues when soldering? I'm assuming that I always have access to a solder mask layer and a copper layer. AI: Have a differently shaped solder mask on pin 1. For surface mount processors, you could have the pin 1 pad be noticably longer than the others.
H: Is there any disadvantage to running an op-amp off asymmetrical voltage rails? On a PCB I'm working with, I have analog feedbacks running through op-amps into a 3.3V microcontroller. Thus, signals outside 0-3.3V are useless, and potentially dangerous to the microcontroller. The op amps have +-15V rails, because those rails were available and convenient. However, that means it's possible for my op amp to destroy my microcontroller by railing out positive. In perfect operation this should never happen, but I'm considering edge cases. To improve reliability, I'm considering connecting my op amps to +3.3V and -15V. Is there any reason I should not run an op amp off asymmetrical voltage rails? Obviously, railing out negative could also destroy the processor. I'm only considering the positive-rail case at the moment. AI: As long as the input pins or the output pin(s) of a typical rail-to-rail op amp are between the rail voltages, the "ground" reference is not actually locked to midway between the rails. (n.b. IIRC there are some op-amps which actually have a separate ground pin) To illustrate, let us consider a rail-to-rail input/output (RRIO) op-amp in a voltage follower configuration: We supply the op-amp rails with +/- 9.15 Volts, and inject an AC signal with a DC bias of 7.5 Volts and a peak-to-peak AC amplitude of 3.3 Volts. The output would traverse between +9.15 Volts and +5.85 Volts, which is within the operating range of this hypothetical op-amp. The rest of the operating range, from -9.15 Volts through to +5.85 Volts would be unused so long as the signal stayed within parameters. The mid value, 7.5 Volts, can thus be treated as the "ground" for this signal. In other words, the op-amp doesn't care about the symmetry of the rails, it doesn't know where "ground" is. For a real op-amp rather than an ideal one, there may be some minimum headroom for the output swing, from a few millivolts to a couple of Volts. So, this needs to be accounted for in the strategy laid out in the question. In addition, the MCU pins may not take kindly to a traversal below the MCU ground rail. Hence, a clipping diode to the ground rail, on the input side, would be a good idea.
H: RFID sources and battery lifetime I'm trying to do high value asset monitoring within a panel van/truck with RFID tags. So this would be a case of a 3m+ range with metal everywhere - mowers, digging equipment, jackhammers etc. A local antenna would interrogate all the tags within range and then relay the information via 3G or WiFi. Olin Lathrop answered another thread saying passive RFID is impractical for purposes like this. Active RFID requires batteries however. I feel a practical battery replacement schedule would be over 2 years. For a requirement like this - relatively low range, low scan speed (ie the equipment in the van is there for several hours at a stretch, it's not just passing by), and maximum battery life: Is there a preferred frequency (VHF vs UHF etc). Does higher frequency mean lower battery life? Is there good transmit interval time or is it the case that the longer you leave it between transmits, the longer the battery life? Is this a problem with many tags in the one location? ie: something has to sort between all the RF collisions. Would receiving as well as transmitting (so, waiting for a valid RF signature) badly affect the battery life? Wouldn't this be more secure? (Edited to ask more specific questions) AI: I once designed a small transmitter that woke up every minute or so to measure temperature and transmit the value along with an ID. These were used in a room which had a stack of freezers and if one of the received transmissions indicated the temperature was too high an alarm sounded. Collisions of data was expected but each transmission only laster 40 milli seconds every minute or so if you had 100 of these all randomly transmitting, the total transmission time of all one-hundred was less than 10% of one minute. There was also a random factor built in based on ID. Battery life was paramount on this but 1 year was got (from memory) from a PP3 style 9V battery. The engineering to get more battery life is keep the electronics powered off as long as possible, ensure the quiescent current (when off) is as small as possible and keep the transmission as short as possible. I used 433MHz off-ther-shelf transmitter modules and one off-the-shelf receiver acting as the central collection point for data. Incorporating a receiver is not a good idea i.e. transmit on request would need a receiver that takes up valuable real-estate and consumes power almost constantly.
H: Prescaled Timers Problem I'm using a attiny2313a, and I'm having a lot of trouble figuring out what's going on with the timer. It's very simple, yet it simply refuses to work. I have a 16Mhz clock. When I put in a 1024 prescaler, then the TCNT1 clock will increment at the frequency 16Mhz/1024= 0.0156MHz, This means that I get an increment every 64uS. So, for one second, I should expect 1000000/64 = 15625 This is ok, because TCNT1 is a 16-bit counter. However, when I set up a testing program, what I get is a very long beep somewhere closer to 15-16 seconds. When I set the prescaler at 64, then 15624 gives me exactly one second. In my mind, my crystal is behaving like I would expect a 1Mhz crystal to. Is my thought process wrong, or is there something else that might be wrong? Here is my testing code, the important parts: #include <avr/io.h> #include <avr/interrupt.h> #define Echo PINB0 #define Trig PINB1 #define Buzz PINB4 #define Led PIND4 int main(void) { DDRD = (1<<Led); PORTD = 1<<Led; DDRB = 1<<Trig | 1<<Buzz; DDRB &= ~(1<<Echo); TCCR1B = (1<< CS10) | (1<<CS12); // prescaler = 1024 while(1) { beep(); wait(1); } } void wait(int t){ TCNT1 = 0; while(TCNT1 <= 15624*t){ } } void beep(){ TCNT1 = 0; PORTB = 1<<Buzz; while(TCNT1 <= 15624){ } PORTB &= ~(1<<Buzz); } AI: It looks your MCU is running at 1MHz like alexan_e describes. Check your fuses - select external crystal as a clock source and unset CKDIV8 fuse. Regarding your code - you are doing it wrong. You should use interrupts to detect timer events. In this particular case - an Output Compare Match interrupt. You have to set your magic number to OCR1A and set bit OCIE1A in TIMSK register to enable the interrupt. Don't forget to provide timer1 overflow interrupt A handler in your code. This way your code will not be stuck in closed loop while timer is counting. That's the beauty of using peripherals in MCU - they are trully running in parallel - while the timer is counting, the processor can do other usefull stuff or conserve power sleeping. Please note, that you either have to reset the timer to 0 yourself in the interrupt handler or set timer to CTC mode (WGM12 bit in TCCR1B)
H: Single transistor instead of RGB screen In today's screens, each individual pixel is created by the combination of three transistor as Red Green Blue. But, colours are already just different frequency waves. Why aren't pixels made by just one single component to create different colour values? Is it cost or capability of electronic components? -- MORE EXPLANATION -- For each pixel, manufacturers are putting three different colour generating transistors/materials, and by the combination of those colours, we can have millions of different colours. My thought was that if colour is a wave as a photon, and colour of photon changes according to the frequency of it, we could use just one transistor/material for each pixel and change its frequency to have any colour we want. But as explained in comments, colours are very high frequency waves (3-digit Terahertz values), and technologically we are not able to generate those frequencies yet, which explains why it is not done in that way. AI: I'm taking a guess about what you are misunderstanding, but here goes... colours are already just different frequency waves. This is true, but the frequencies involved are very very high. \$f = \frac{c}{\lambda}\$. So for a wavelength of 640 nm (red), you're looking at a frequency of about 470 THz. That's 470 x 1012 Hz. We don't have any technology that can route signals at these frequencies over wires, or emit them using the kind of antennas used for RF. Instead we rely on the natural resonances of certain materials (the bandgaps of different compound semiconductors or transition energies of phosphors) to generate these frequencies. And different wavelengths require different materials, which is why pixels in a display require 3 separate LEDs or 3 separate phosphors, for example.
H: Correctly wire up a Switching Regulator I am looking to use a Texas Instruments MC33063 Buck/Boost regulator. I have never used a switching regulator before so this may be a conceptual issue. My input voltage will probably be anywhere from 6 to 12V and I would like to use the regulator to buck down to 5V. However, I get confused when I read through the data sheet. Here's the layout for a step down from the sheet: So the data sheet shows that if I were to input 25V, given this setup, I can get 5V. However what about 6 to 12V for a Vin? Also, the optional filter is shown that \$V_{out} = 1.25(1 + R_2/R_1)\$. Is this independent of the input voltage? If so, what is the advantages of varying input voltages or is it simply flexibility? Here's the link to the datasheet: http://www.ti.com/lit/ds/symlink/mc33063a.pdf AI: Most buck converters (including this one) have an internal voltage reference and a feedback loop, which regulates the output voltage. The output voltage is set by the resistors R1 and R2. The output voltage is independent of the input voltage fluctuations. The output voltage formula is not related the optional filter. Switch mode converters can be layout sensitive, so it's usually a good idea to follow a reference design. On the other hand, this one has a top frequency of only 250kHz, so it may be more forgiving than switchers with higher frequencies. There's more details about the principles of operation of buck converter here and here. edit: A somewhat odd thing, however, is that the resistor values in the drawing don't quite check with the output voltage \$V_{out}=1.25\left( 1 + \cfrac{R_2}{R_1} \right)=1.25\left( 1 + \cfrac{3.8}{1.2} \right) = 5.2 V\$ should be 5.0V. I wonder if there's a reason for the extra 0.2V?
H: Weird Voltage measurement problem I have a DC/DC converter outputting 5.18 VDC @ 25% load (1 Ohm resistor). If I measure the voltage at the green nodes it fails out of tolerance, if I measure the voltage at the red nodes (before the line resistance) it passes tolerance. (See Figure 1) The tolerance is 5.18 VDC +/- 0.155 VDC. There is a line resistance of 0.1 to 0.5 ohms on each output, the wiring is pretty long in this case. I understand there is a voltage drop proportional to current flowing, at this case there is about 1.75 A flowing at 25% load. 1.75A * 0.5 Ohms = 0.875 VDC Voltage drop for each output wire. I get why that is failing. However when I am measuring the voltage output at the red nodes, it is in tolerance, but the same line resistance 0.875 VDC voltage drops are still connected to the load resistor because the current is still flowing through them to get to the load (in parallel with the DMM). So why does this pass? Wouldn't the line resistance add to the load resistance in either case? AI: The voltage drop is in the wires - if you measure at the red nodes, you are measuring before the wires, so you won't see the voltage drops. At the red nodes, you are measuring the battery voltage directly - the voltage you measure there won't depend on voltage drops elsewhere in the circuit. (for the pedantic, the voltage at the red nodes may vary with load, depending on the characteristics of the DC-DC converter.) If the DC-DC converter permits remote voltage sensing, you can solve the problem by making the converter sense the voltage at the load, rather than at its output. This would require another pair of wires between the load and DC-DC converter. An easier solution may be to move the DC-DC converter close to the load.
H: Understanding crystal resonator symbols - which one is 24Mhz? So, I'm in need of a 24MHz crystal to drive an AVR microcontroller. I've got some crystals that I've desoldered off some old, useless equipment. I've found three crystals that have '24' on their packaging: HC 24.00 TXC 24.0NQ4L 24.00R4L Google search turned out nothing, so I don't know whether any of these is 24MHz, or 2.4MHz, or some other values. From what I've managed to find, 24MHz have three 0's after the dot, but I couldn't find if 2.4MHz quartz ones have only two 0's or not. I don't have a counter to measure how many ticks these can generate (too expensive :/ ) So, to expand the question a little bit, as I have more crystals in my collection: How to find out, without googling, looking only on the number on the package, how many Hz's are there? AI: The decimal point on crystal oscillators or crystal resonators is typically at the millions place or less often the thousands place, in hertz. The number of digits after the decimal point does not affect the frequency. Thus, a 24 MHz part would be labeled 24.00 or 24.000, a 2.4 MHz part would be labeled 2.400 or (not seen this yet, but it is possible) 2.40. A 32768 Hz crystal would be labeled 32.768 - those are common for RTC applications. Other than 32.768 and a few other low frequency crystals used for very specific purposes, it is almost always a megahertz number marked on the part.
H: how to, best way to use a linear actuator vs gear system? I am wondering what is the best and cheap option to use in a crane like system. a linear actuator or a gear rig system with an engine. the weight at the end could be up to 100 pounds. I was thinking about using a linear actuator, but I'm worried that the angle might not be enough to push the payload up if i wanted to in the image below the vertical part can be moved up or down AI: It's not fully obvious from your diagram how the two shown systems are intended to work, and the question is largely but not fully a mechanical one that risks being closed. However, what you are trying to achieve is clear enough and I believe that the clear answer is that a geared motor is liable to be your best choice in most cases, because ... "Linear actuator" is an inexact term and may mean a self contained unit which essentially IS a geared motor driving an extending rod, or a linear motor, or a solenoid or perhaps a pneumatic or hydraulic cylinder, or thermally expanded or phase changed material, or ...? Here are some examples of what people mean by the term "linear actuator" and here are some examples of what are described by "electric linear actuator". You'll note a very large % contain a rotary motion electric motor and some form of rotary to linear converter. ie An 'ELA' ("electric linear actuator") is most often a motor plus gearbox system that has been predesigned and packaged to meet an envisaged need or to suit a range of applications. While an ELA can be used in a wide range of "crane" type operations it is not suitable in most general cases. This is because an ELA has predefined and limited stroke and does not lend itself to ease of application of its application at some other point without use of additional parts. Generally the terms "cheap", "up to 100 pounds load" and ELA do not go together if you are using commercially manufactured equipment. By building what you want with material that is cheap or free and that overall meets your need you will be able to meet a wider range of requirements at far lower prices than could be achieved with an ELA. Effectively you are constructing an ELA from component parts, with the added benefit tjat the ELA can be "distributed" as it does not come as a packaged unit. A "crane" which eg has a motor at its base, a boom arm with a load lifting hook several pulleys and a rope or drive belt to transfer power, constitutes an ELA that extends from the motor, up the tower, along the boom and down the "rope" to the hook. You have not said how fast or how far you want the load moved. I'll use metric units here as they has a nice relationship between distance moved, force, time and power required, but you can convert to steam-driven units if required. Mass: 1 kg = 1 kilogram ~= 2.2 pounds mass. Distance: 1 m = 1 metre ~= 3.28 feet. (1 foot = 0.3048m exactly) Force: 1 Newton = 0.1 kg "close enough" (Force = g x mass. ) ( g = acceleration due to gravity - g = 9.80665 m/s/s exactly ~+ 10) Power: Watts = Force x distance = mass x g x distance SO ... Power = mass x distance/second x g Power ~= kg x metres_moved_per_second x 10 .... P = M x D x 10 Example: Say load is 50 kg =~ 110 pounds. To move 50 kg vertically at 1 ms requires Power = MxDx10 = 50 x 1 x 10 = 500 Watts. To lift 50kg at 10 m/s requires 5000 Watts. To ift 50 kg a 10mm = 1cm = 0/01m per second requires 5 Watts. The above Watts are the actual power used to move a suspecned load vertically. Inefficiencies in motors, gearboxes, pulleys, lever systems etc aqnd forces applied in other than required directions, will lead to higher power being needed. BUT the aqbove gives an idea of what is required. If you want "as cheaply as possible" then a say 10 Watt motor will "winch up" a 50 kg weight at about 10 mm per second. If you have 100 or 1000 or 10,000 Watts available you can winch the same load at 100mm/s or 1m/s or 10 m/s. More power needs more attention to cables, booms and construction in general. BUT a 50 kg load is not a trivial load and needs care with even a 10 Watt winch motor. A 50 kg load on a crane can easily kill someone. Some of the ways of making you own distributed ELA / crane system include, motor with: Gearbox - gears, worm and gear(s), pulleys, ... Rope, wire-rope, belt (flat / V / toothed,...) Levers (as per your diagram) Threaded rod with "captive nut" - turn rod and nut climbs the rod. ... Real world low cost solutions: Battery drills. I'm doing exactly this at present for a project - A cheap easy fun and effective system can be made using old electric battery-operated drills driving a rotating threaded rod with a captive nut acting as a linear drive point. A typical 12V or 18V electric drill driving a 10mm diameter, 1mm pitch threaded rod will lift about 100kg at around the 20mm/second rate. Power 100 x 0.020 x 10 = 20 Watts. Real power will be higher but at 18V load current at about 80 kg load is under 2A. 2 metres of 1mm pitch threaded 10mm dia galvanised rod can be bought here for under $10. Well used but usefully functional battery electric drills are close to free (the batteries usually die first). Depending on load and speed requirements a used car wiper motor may provide a useful solution. Car wipers cycle at about 1 to 2 cycles per second. Some mechanisms make only a to and from motion available while others have output shafts that turn at 60 to 120 RPM. Power levels are generally lower than that which can be obtained from larger battery electric drills. (Ask me how I know :-) ). Motor gearbox units made for wheelchair drives and similar are often rated in the 200W - 500 W range and are robust enough for frequent use in crane applications - but are also usually not overly low cost. Ask for additional information if desired.
H: Designing stand-alone microcontroller based components 3 Years after finishing my study of computer science (B.Sc.) my search for a new hobby lead me back to the microcontrollers. There were 2 semester microcontroller programming with embedded assembler in C on a ATMEL development board. But I really hated it. Now I want to give it a second chance. During the years I found some practical use cases and I have some ideas. But my first question, after researching for dev boards is: how do I port my application from the development board to a stand-alone unit? Do I have to buy single parts and solder them on a board? Or can I buy ready to use components for a single purpose (e.g. switching a motor time controlled). edit: there were many nice answers which helped me a lot researching about the topic. As the question got marked as "put on hold - too broad": I wanted to know if I have to solder cheap units or if there exist cheap ready-to-run components to implement a few small applications without buying a relative expensive dev board for each application. I already isolated 3 candidates to buy. Thanks you all for your answers. AI: how do I port my application from the development board to a stand-alone unit? The easiest way is to replicate the essentials on a new PCB. Some AVR chips require almost nothing in the way of support components and circuits using them are relatively easily ported from a development board / breadboard to a small purpose-made circuit (e.g. "shrinkified") Do I have to buy single parts and solder them on a board? That's probably the best, and in some ways easiest approach. For small numbers and low frequencies, you can use stripboard or tri-pad board if you don't want to get into making your own PCBs. Or can I buy ready to use components for a single purpose You can, these may be sold as daughterboards for a specific platform (e.g. "shields" for Arduino) or as breakout boards with 0.1" connector spacing. These are convenient but you pay a price for that convenience. For a circuit developed using the Arduino, you may be able to replace something like an Arduino Uno with a smaller or cheaper equivalent/compatible product. For example, "The Arduino Pro Mini is intended for semi-permanent installation in objects or exhibitions. ".
H: Return Paths of Signals on Flat Flex Cable I have a 4 layer PCB with a typical stackup (signal-gnd-vcc-signal) and on the top layer there's a CMOS sensor connected with a flat flex cable... I was wondering, since there's no reference plane underneath the cable, What would the return paths for those signals look like ? is there a chance for coupling between the signals here ? And how to minimize that loop ? if I add a reference plane just under the cable and connector on the top layer, would that help provide a low impedance return path for those signals ? Update: a photo of the cable AI: The return path for a trace in a single layer flex cable in free space is going to be the other traces. If this is a digital interconnect with high speed, you most likely have a layout like: gnd - sig - gnd - sig - ... or gnd - sig - sig - gnd - ... This is typical coplanar transmission lines and you can simulate that easily with a 2.5D simulator like Hyperlynx og SigXplorer (both expensive). I think you can get a good idea from the free TNT field solver as well. That will help you determine both what the impedance of your signal traces are and what amount of coupling you get between traces. Now if you put this (very) close to other metal like your top layer Cu this may change. If and by how much depends on the geometries. Put Cu closer than the trace-to-trace distance in the flex and it will certainly do something. Specifically it will reduce coupling (x-talk) like you mention and lower the trace impedance. It it worth doing? Good question. I would recommend you do some quick simulations to find out before you waste too much time and energy solving a problem that may not even be there to begin with :-) Let me know if you want to provide more details, so I can give a more detailed answer? Update As can be seen on the photos you added, the flex is a 2-layer and some of the traces actually do have a reference plane running on the opposite side of the cable. Provided the thing is well engineered, you should not try to change impedance by putting other metal real close to the cable. Don't however assume that it is well engineered just because some (well known) company is selling it :-)
H: What tool can make a nice 3D image of a via? I found this graphic somewhere on the web, but now I need to create a similar illustration for some training, but with a 16 layer board having traces coming in on other layers etc. What is the easiest/fastest/cheapest tool to do this? What tool was used for this graphic? AI: You can zoom into your board in the 3D view in Altium: I changed the view settings to scale up the board thickness (otherwise you can't get a good look inside) and to color the structures by layer. To remove copper from un-used layers like so: In 2D layout mode, open the via properties and select "Full-Stack" in the Diameters panel: Set the diameter to 0 for desired layer:
H: power leaking from device via USB In my car I have power converter for the cigarette lighter. This power converter has some 3 USB ports and 2 cigarette lighter ports. I have devices plugged into the cigarette lighter ports. One of which is to power my phone (is left in car overnight). If the phone has enough power it will power the other devices plugged into the power converter, when the car is turned off. Power is not coming from the car. I know this for certain as the other devices will immediately turn off when i remove the charged phone. I assume the power from the phone is leaking through the USB cable and into the other devices. This is a problem as I don't want the phone to discharge over-night. I think putting in a diode on the 5V wire for the USB cable for the phone will do the trick. What requirements do I need in a diode to ensure that I don't cause damage to my phone and allow it charge as normal as possible? AI: The main properties you want to work around are the maximum allowed reverse voltage, the forward voltage drop, the maximum forward current and the form factor. The maximum reverse voltage should be comfortably greater than the USB voltage (5V) - give it at least 6V. Practically, you'll probably find a much higher reverse voltage limit in the diode you select, so don't worry about this too much. The forward voltage drop should be very low at the current you expect to see when the phone is charging. Depending on your phone it should certainly have a charge rate of less than 2A. You'll have to examine the V-I curve for the diode to determine this. Lower is definitely better here - try for .5V or less at 1A or lower. The maximum forward current is chosen based on the charging voltage of your phone - again, 2A is generally the maximum charging current you'll see from any USB device (and it's generally pads that draw this, not phones) and you'll want a margin of error, so go 3A or above. For the form factor you'll probably want a through-hole diode for ease of install. I recommend some heat-shrink around the whole thing to give it some mechanical stability when you're done soldering.
H: Interfacing two devices using transistors I have a microcontroller and a small video/still "spy" camera (like these) that came in a case disguising it as a car remote. The microcontroller is a TI MSP430 value line model, though I could use an ATMEGA/ATTINY via arduino if the MSP430 doesn't work out. I have the two devices sharing a ground, but each is powered by separate batteries because the camera wants about 4.7v and the MSP430 runs on 3.3v. I'm trying to use a pair of transistors to act as the Power and Function buttons on the camera, in order to use it as a time lapse controlled camera. I removed the push buttons on the camera's board and wired the contacts up to the emitters and collectors of the two transistors. My basic circuit diagram looks like this: When I test it on a breadboard with LEDs hooked up to the transistors instead of the camera, my program works fine. It "presses" the power button for 2.5 seconds to turn the camera, then sends brief pulses on the Function button to tell the camera to take a picture. But when I connect the camera, the camera turns on, waits a few seconds, and turns it off. When I check the function button's transistor, it looks like it never even triggers. My question is, should I be using transistors this way? Or did I screw something up? AI: When you use transistors in this way, a series resistor must be included in the base line. 10k would be a good guess. A transistor used this way sort-of works as a switch, but only in one direction. The emitter must be negative side (connected to the ground or - lead of the batetries). Your diagram does not show if this is the case, or whether you were even aware of this issue.
H: Connect analog load cell to usb via AVR I have an analog load cell with just 4 wires sticking out of it. I want to be able to connect it to a computer via usb. For that I am going to use the AVR micro controller and LUFA usb library. My question is about connection of a load cell to a micro controller. As far as I understand one needs to amplify the signal from a load cell with some amplifier and direct it to the analog input of the AVR controller. And then direct the digitised value to the computer. But few times I saw people mentioning advanced chips that have an amplifier and analog-to-digital converter combined. Are there any benefits of using such combined chips? And if there are, how the digital output of such chips should be read with the AVR controller? AI: Are there any benefits of using such combined chips? Yes. They are simpler and allow you to get away with less engineering work. Think 'Plug and play' And if there are, how the digital output of such chips should be read with the AVR controller? It depends on the device. This will be explained in its datasheet. Most likely it will have a SPI or I2C interface.
H: Battery shorts and current I'm wondering something. Let's take a 9V dc voltage source with \$\infty\$ output current. If I short the two poles only the wire resistance will impact the current. I'll take a standard breadbord hookup wire. Based on the following table the resistance for 3 meters (10 feets) is \$0.16140\Omega\$. So... \$ I = \dfrac{9V}{0.16140\Omega} \\ \\ I = 55.762 A\$ Based on this table the maximum current is \$7A\$ for chassis transmission and \$0.92A\$ for power transmissions. So I've got two question : First what can happen to the cable as the current is 8 times bigger than the limit ? Second, let's say I replace my \$9V - \infty A \$ with a \$9V - 900mAh\$ battery. She should be discharged really quickly (in approximatively \$900mA / 56A * 60 = 0.9\$ so less than a minute), but when I've tested that, she heats up but remains charged, why ? AI: To answer your first question, the amperage ratings that you have quoted are based on many factors, not just the gauge of the copper wire. So, what can happen if the current is 8 times bigger? It depends. If there is good air circulation or the wire is very short and connected to a good heat sink then you might see nothing happen at all. The wire might get very hot and melt, or it might melt its insulation, or the insulation might smoke or catch fire. The ratings are telling you that exceeding those current ratings might be dangerous. As for the second question, you assumed an ideal 9V voltage source and then performed an experiment with a very non-ideal 9V battery. The real battery has an internal series resistance and has a limited current capability. So, connecting your wire across the battery terminals did not draw anywhere near 56A and you did not draw anything close to 900mAh from it. Therefore, the battery was not completely discharged by the experiment.
H: Answering a phone call with RN-52 and Arduino Mega 2560 I come from Stackoverflow in need of some guidance. My goal: stream tunes (completed) and answer/end calls through the RN-52 (not completed) My issue: I am getting confused on the RX/TX/CTS/RTS functions of the RN-52 (datasheet). I have tried: Connecting the RX and TX of the RN52 to the TX and RX of the Mega 2560 (pins 0 and 1) to initiate UART however when I attempt to send the command C to the module, nothing occurs (that should tell the RN52 to answer the call). Perhaps: my issue is getting the RN52 into command mode, but I have ground GPIO9 (putting low makes it command mode). Perhaps: I am not sending the command correctly? I used Serial.println("C");. I hope my question and struggle is clear. Any reading material pointing me in the right direction would be greatly appreciated. I would love to get this to work but I would love to learn how it works even more. Thanks in advance and happy New Year! Helpful link: https://learn.sparkfun.com/tutorials/rn-52-bluetooth-hookup-guide/c EDIT (diagram, additional info) Here is my code for using two push buttons to answer or decline a call. #include <SoftwareSerial.h>//not sure if this is needed...read about it during a tutorial? const int answerButton = 52; //button to answer const int endButton = 53; //button to end void setup(){ Serial.begin(9600); //start talking to RN52 pinMode(answerButton,INPUT); //set buttons to input pinMode(endButton,INPUT); } void loop(){ int answer = digitalRead(answerButton); //read the state of the buttons int endCall = digitalRead(endButton); if (answer == 1){ //if depressed, print C (command to answer the call) Serial.print("C"); delay(2000); } if (endCall == 1){ //if depressed, print E (command to end/reject call) Serial.print("E"); delay(2000); } delay(1);//for stability...although I'm not entirely sure this is needed :) } When I use this, I do see the RX LED illuminate however the call is not answered. And unfortunately I can't connect to the RN52 serial to see what is says through CoolTerm at the same time since the Arduino is using the connection (read about that in this forum). GPIO7 is NOT connected to anything (just open). The RN52 is grounded and does stream tunes properly through Bluetooth on my iPhone. HOWEVER, there is mention about grounding or sending a signal on GPIO2 in the datasheet (table 1-3) but I can't comprehend what they are saying to do...this might be part of my issue. ADDING SCHEMATIC (awesome, had no idea I could do this! Sorry, will include in all future posts!) simulate this circuit – Schematic created using CircuitLab AI: Serial.begin(9600); //start talking to RN52 I think you need to pull GPIO7 down to set speed to 9600. From datasheet GPIO7 Driving this pin low sets the UART baud rate to 9,600. By default the pin is high with a baud rate of 115,200.
H: Electromagnetic Coil I am trying to make an electromagnet, i would like to know what kind of core would work best, from what i have read a soft iron core would work best BUT i know some metals are known by number and i would like a number just to be more specific (if possible). i also need to keep the core from rusting and i was thinking of copper plating the core, would the magnet still work after doing so why or why not? (i know what wire i need to use i only need to know these last few things i asked) AI: You are talking about a DC electromagnet right? So wrought iron is the best but it is almost impossible to find this days. Maybe in a flea market selling very old door's accessories etc. But you can search for Armco iron. Bellow is the relevant magnetic behaviour Next choice is Steel 1010 with maximum permeability of 1800 and saturates at 1.6T. Don't use ferrite for this applications. Magnetic Irons is already coated in bronze-like coating (galvanised?). See a core of a loudspeaker. Painting does not degrade core characteristics, unless this coat insert a significant gap between coil and core. You can shape the tip of core to maximize the strength, like focus! And don't forget: Core cross section plays major role on electromagnet's pulling/holding strength. Finally keep in mind that core also plays a role in the electromagnet thermodynamics, so mass of core is also critical (ok...not only because of this).
H: Can anyone identify this tiny 2.4/5.8GHz antenna connector? I'm looking to add a pigtail and larger antenna to small wireless video receiver. It came with a removable antenna with a connector I don't recognize. Sorry for the blurry pictures. If they're not helpful I can try again. It's a push on, and the center of it has the white plastic bit I've seen on RP-TNC connectors. The numbers on the tape in the images are centimeters. AI: It's quite hard to tell but here is some hints on possibilities: MMCX connector: used for wifi antenna in notebooks http://en.wikipedia.org/wiki/MMCX_connector U.FL connector: also used for wifi antenna in notebooks, but more recent http://en.wikipedia.org/wiki/Hirose_U.FL MC-Card connector ( http://www.deltarf.com/pdf/DeltaMCcard.pdf ) The connector you have seems to be to long for the small U.FL, also the U.FL central pin seems to big to fit your connector. I'll said that's a MMCX connector but not sure at 100%.
H: Tech stereo damaged by dimmer switch outlet, why? A low end Tech stereo was plugged into an electronic dimmer switch outlet. The stereo was only a few years old and was functioning properly prior to plugging into a dimmer controlled outlet. I plugged the stereo into a normal outlet after the incident, however, there is no indication of life. If possible I would like to fix the stereo, but before hand I would like to better understand what component might be damaged, and why. Example, could low voltage require higher current from regulator thus burning out the regulator circuit? I have been put on hold due to asking a repair question. 15 yard penalty still 3rd down... :) JK Andre's below response however was helpful, so glad I posted above question. I researched my dimmer type "Lutron Maestro" which uses standard phase control, or leading edge. Basically power is provided at certain time points within the AC +/- voltage phases. Different start times control light luminescence by controlling power on time. A DC voltage can be supplied which does not bode well with magnetic transformers. My stereo does not have a fuse from plug to transformer therefore the copper wire blew open. I confirmed transformer input to be open with OHM meter, and I did not observe 120V AC at the input when plugged in. Thought this might be useful for others who like electronic dimmers. Bottom line do not connect a dimmer to an outlet as it can damage an electronic device that is plugged into it. Good news though, transformers are cheap, and it is an easy fix. My daughters Stereo is up and running. Go Niners!!! AI: It is not just a lower voltage what comes out of the dimmer. It was probably a phase control dimmer (as opposed to a reverse phase control dimmer) as they are cheaper and more common. This type of dimmer switches on in the middle of the AC cycle and switches off at the zero crossing and by this controls the average power that the device can take. (red is the voltage after the dimmer) The sudden rise of the voltage can be a problem for devices whose input is capacitive (behaves like a capacitor/has a capacitor parallel to its input) because a capacitor has a low resistance when it's empty and therefore takes a very large current when the dimmer suddenly switches on. It's possible that this just blew the fuse of your stereo. Complex electronic devices in general shouldn't be dimmed, however more simpler switched power supplies (for lighting etc.) can sometimes be dimmed with a reverse phase control dimmer. That is one that switches on at the zero-crossing and then suddenly off in the middle of the cycle. On the other hand these dimmers cannot be used for devices with an inductive input because inductors (coils, e.g. a transformer) produce high voltages when suddenly switched off.
H: Computer Architect Book Reccomendation Best Book For Computer Architect , As I have to build SAP this semester. Most people told me it is very difficult to make a SimpleAsPossible 8 bit Computer up and running therefore any suggestions for the best book in your view that will make my concepts for this course much strong Thanks AI: Computer Organization and Design by David A. Patterson and John L. Hennessy is one of the classic sources. If you can understand it, it will help you.
H: Connect Arduino to RS232 I have a device that is powered by the Arduino (+5V). The device (a VC0706 Powered camera), incomporates a MAX3232 to convert to RS-232. Unfortunatly, I don't have the tools or dexterity to remove the TTL/RS232 conversion manually. My question is: is it possible to establish communication between the device and the Arduino with RS232 interface? AI: I think you are confused about the voltage level used to power the camera and the voltages used to communicate with the camera. The fact that the camera is powered with +5V from the Arduino is really irrelevant in this case. If the camera has a true RS-232 interface then a logic 1 is represented by a voltage more negative than -3V and a logic 0 is represented by a voltage more positive than +3V. It sounds like the Arduino does not have a true RS-232 interface but rather uses conventional logic signals with a serial interface, and in this case a logic 1 is a voltage of about +5V and a logic 0 is represented by a voltage close to ground. An interface like this is sometimes called a "TTL serial" interface for historical reasons. Note that these two interfaces are not electrically compatible. Connecting an RS-232 interface TX line to a TTL RX line may damage the receiver. You cannot solve this problem in software. You have two options, as others have mentioned. You can remove the RS-232 voltage converter in the camera, effectively making it have a TTL serial interface, or you can add an RS-232 voltage converter to the Arduino.
H: How does a burden resistor work? So I've been getting into the world of building circuits with an Arduino controller and a breadboard. I've been working in IT for years, but I'm not super familiar with electronics at this level. While following a tutorial for building a "knock sensor" using a piezo speaker as the sensor, it connected the piezo speaker from ground to an analog input pin on the Arduino. Then, it connected a 1M ohm resister in parallel to that. All it said was that doing so protected the Arduino from the voltage spikes caused by the knock sensor. After asking around, I learned that this resistor was called a "burden resistor," but I can't seem to understand how adding a resistor in parallel to the element that generates the voltage would protect the Arduino board. Can someone explain this to a newbie like me? This is the webpage that shows the burden resistor: http://arduino.cc/en/Tutorial/Knock AI: The piezo can generate very large voltages (e.g. 90V) above the operating range (6V) of the ATmega and would blow any input. That said the power is very little and any resistance will load the spike, so that current is absorbed in the 1Mg ohm resister, rather then the hi-impedance input of the ATmega. Here is a link to Electrical Over-Stress and Electrostatic Discharge Protection of ICs by IT E2E group. It has link to a PDF presentation that does a great job explaining how the chips internals can tolerate or fail such voltages.
H: What can the dsPIC do which the humble PIC microcontroller cannot do? I have not used a DSP chip as of yet. All I know is that their architecture is such that they can carry out calculations quite fast, usually within a clock cycle, they have multiply-accumulate instructions in their instruction set and they have DMAs so the CPU does not have to waste precious time moving data around. I think there is more to it, but these are a few basic points. I can see that Microchip has dsPIC which is their DSP chip line. Can't we just use a PIC18 or PIC32 which also has built in multipliers to do DSP as well? How is the dsPIC different from the normal PIC? My main question is this, Why do we need to have something seperate and distinct called DSP chip and not integrate high precision floating point unit calculation capability on all the microcontrollers? Surely with the process technologies we have now, this should not take a lot of space. Also, how do I know that I need to use a DSP chip in my project rather than a normal microcontroller> AI: Generally "DSP..." means 'more relevant horsepower and/or more relevant hardware at the time the product was introduced.' Generalised processors tend to catch up with olde specialist devices. DSPIC is p[robably 10+ years old - Olin will know. [Items in brackets relate to some DSPIC examples - not exhaustive]. In DSP products expect some mix of: Expect things like barrel shifters, wide fast pipelines and fast single cycle execution times, wide single cycle instructions, DMA [6 or 8 channels, dual port RAM buffers] large linear memory addressing ranges [4 Mword program, 64 kB data] specialist arithmetic oriented features Maybe: specialist peripherals such as motor control, hardware for several different coms standards [CAN, IIC, UART, IIS, AC97, ...] deeper than usual coms buffers [4 bytes] faster and/or wider than usual ADCs [2 Msps, 10 or 12 bit] You'll find most of these in the DSPIC family - and increasingly so in gp processor families. In extreme cases you get user microcoding and more.
H: How to make transistor fail protection for light bulb In the circuit below I choose an optimal current for the lamp set to 4A (the lamp specs are 12V/5A). I need to make a safety circuit for the lamp in case transistor Q2 fails. I add a fuse in the circuit but I'm looking for a better solution, what is the best way to protect the lamp? This is current regulator circuit: simulate this circuit – Schematic created using CircuitLab AI: Firstly, I would consider a different approach. I would consider Pulse width modulation to the lamp similar to the function of an SCR in an AC dimmer circuit. You could also increase the 1R sense resistor such that it achieves a 4A current limit. You would need to know the hot resistance of the lamp. If however you cannot use a PWM drive circuit, then I would propose a high side FET current limiter such as this: The way it works, is that when 4A current is exceeded, the voltage across the 0R15 resistor is sufficient to turn the PNP resistor on, lifting the P-Channel Gate up to 15V. THis clamps it off to maaintain a constant current limit which is determined exclusively by the value of the 0R15 sense resistor. The 100k/10k form the bias network which keeps the P-CH fet in conduction until the PNP is enabled. THe Mosfet should be rated to handle the required power. Ordinatily, it will be saturated but at fault condition it could dissipate up to 60 Watts. I hope this helps.
H: Singular error when putting a current source in series with a capacitor (ngspice) I am getting singular errors when I simulate a current source in series with a capacitor with the following .cir file: * Spice netlister for gnetlist C1 1 0 1 I1 1 0 1 .TRAN 100u 6m (I understand a farad is huge, just to make the numbers easy. I have tried smaller capacitor values, but they have not helped.) Based on my analysis, I = C*(dV/dt) Integrating, I expect V = (I*t)/C. So I would expect increasing voltage in the mV range over time when I plot v(1), but I get the following error at the below of this message. When I change the C1 into an R1, no error is observed at all. What is going on? Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Warning: singular matrix: check nodes 1 and 1 Note: Starting dynamic gmin stepping Trying gmin = 1.0000E-03 Note: One successful gmin step Trying gmin = 1.0000E-04 Note: One successful gmin step Trying gmin = 1.0000E-05 Note: One successful gmin step Trying gmin = 1.0000E-06 Note: One successful gmin step Trying gmin = 1.0000E-07 Note: One successful gmin step Trying gmin = 1.0000E-08 Note: One successful gmin step Trying gmin = 1.0000E-09 Note: One successful gmin step Trying gmin = 1.0000E-10 Note: One successful gmin step Trying gmin = 1.0000E-11 Note: One successful gmin step Trying gmin = 1.0000E-12 Note: One successful gmin step Trying gmin = 1.0000E-12 Note: One successful gmin step Warning: singular matrix: check nodes 1 and 1 Warning: Dynamic gmin stepping failed Note: Starting source stepping Supplies reduced to 0.0000% Warning: singular matrix: check nodes 1 and 1 Trying gmin = 1.0000E-02 Note: One successful gmin step Trying gmin = 1.0000E-03 Note: One successful gmin step Trying gmin = 1.0000E-04 Note: One successful gmin step Trying gmin = 1.0000E-05 Note: One successful gmin step Trying gmin = 1.0000E-06 Note: One successful gmin step Trying gmin = 1.0000E-07 Note: One successful gmin step Trying gmin = 1.0000E-08 Note: One successful gmin step Trying gmin = 1.0000E-09 Note: One successful gmin step Trying gmin = 1.0000E-10 Note: One successful gmin step Trying gmin = 1.0000E-11 Note: One successful gmin step Trying gmin = 1.0000E-12 Note: One successful gmin step Note: One successful source step Supplies reduced to 0.1000% Warning: singular matrix: check nodes 1 and 1 Supplies reduced to 0.0000% Warning: singular matrix: check nodes 1 and 1 Warning: source stepping failed Transient solution failed - Last Node Voltages ------------------ Node Last Voltage Previous Iter ---- ------------ ------------- 1 0 0 doAnalyses: iteration limit reached run simulation(s) aborted AI: Many circuit simulators attempt to find a DC operating point prior to executing a transient analysis. Basically, they replace inductors with short circuits and capacitors with open circuits and then solve the remaining circuit. Your circuit has no stable DC point (open-circuit current source) and this process fails. Usually, there's a way to tell the simulator to skip the initialization step and specify starting conditions (e.g., Vcap = 0V) explicitly.
H: What is the purpose of inserting resistors (diodes?) directly on the path of the VCC and GND lines powering a PCB? I am trying to learn electronics by looking at simple circuits and see how engineers get the job done. Looking at a PCB featuring only one Texas Instruments ADS1115 ADC, I see that: They bridge VCC and GND with a capacitor as close as possible to the power lines arriving at the PCB. I guess it's 100µF (shown in the picture). They do the same on the VCC and GND as close as possible to the chip (not shown in the picture). They have pull-up 10K resistors on the SDA, SCL and ADDRESS lines. I guess it's because they wish those to be high when not driven (not shown in the picture). However, I do not understand why they have two parts (black 0805) inserted in the VCC and GND lines arriving on the board (shown at the top of the picture). Are these resistors ? What would their purpose be ? The board can be powered from 1.8 to 5 V. Maybe they are only diodes? In that case, the polarity should be marked. And there would be a voltage drop across. I am also puzzled, because these parts are across the VCC as well as the GND. In my mind, there is never any part splitting the GND line. AI: These are MMZ2012Y152B ferrite filters and your 3rd guess about I2C pullups is correct. The schema including components names is on the manufacturer Github.
H: STM32 custom bootloader: how to verify the firmware? Using a custom SDIO/FAT in the application bootloader for a STM32 chip, is it possible to make the jump from the bootloader to the new firmware fail-safe? I would like to verify the new firmware sanity before jumping to it and ideally do so in a sandboxed or safe environment to treat failures if need be. All examples and documentation I found verify the firmware has correctly been placed in the flash memory and then jump to it without a second thought. AI: What you're probably looking for is a checksum or a hash of the entire application image. Say you'd be using CRC32 since the chip may already have hardware support for it. After compiling the firmware, you create the checksum for it and store it in a separate file. Transfer both these files onto the filesystem. The bootloader then reads the firmware image, creating the checksum once again. If the generated and stored checksums match, then you're good to go. Sorry if I understood the question incorrectly.
H: How do I create a knob like on my amplifier On my amp, I have a big round knob, that I can turn forever in both directions, to control volume. It simply turns up whenever I turn clockwise and down when I turn counter clockwise. There is no limit as to how far I can keep turning it. How do I create this in my own project? I have an arduino where I want a knob like this, to control a value in the arduino memory. Simply, turning up, add to value, turning down, subtract from value. I assume I need some kind of potentiometer, but they do not turn forever, do they? AI: What you need in a rotary encoder, they have two outputs that generate pulses which are then decoded to read the direction of rotation. Refer to http://playground.arduino.cc/Main/RotaryEncoders To control the volume you can use Arduino to drive a volume control chip like PGA2311. There are even 4 channel versions like PGA4311 You can also control digital potentiometers like MCP41xxx/42xxx
H: Crimp connectors making process review I'm actually working on a project with several "little" modules. They are all connected to the PSU and the MCU. So I've design interface for each, so I can easily wire everything together. For that I've bought a full range of crimp connectors, male/female pins and 10wires cables. (the "biggest" interface use 9 wires + VDC/GND, but for VDC/GND I use biggest gauge and other connectors) The problem is that I'm not sure of the way I'm building these cables. Here are the steps I go through with a 1 pin connector. First I cut the cable so the insulator is near the beginning of the connector and the end of the wire touch the start of the pin : Then I apply a bit of solder on the inside of the connector and cut the two little piece of metal at the base, without that I can't put the housing (this one is a previously made one where I've removed the housing, that's why he looks really ugly) Then I place the housing and use to pliers to put it in place. (Can't put it manually) And here's the final result : What I don't like is : I need to cut a part of the base to insert the housing. I need to use pliers to insert the housing. But if I take a look at the housing there's a kind of little piece of plastic that should block the housing to move back once in place. If I force a bit I can remove the housing. So do you have any advice's ? Does it sound ok for you ? (I'm just a hobbyist, it's not for a professional purpose or anything really "serious" or consumer related) AI: Soldering will do the job but normally these are intended to be assembled using a crimping tool that fastens the wire on the pin. Here is a video tutorial
H: How to use an ADC with a non zero lower reference voltage input I need to convert, linearly, a voltage in the range of about 1v to 2v into the range 0 to 1v for input to an ADC. This is the background: I fiddle with electronics and programming as a hobby to give me interesting and challenging projects -- but on this one I am stumped. I have built a power supply to give me 0 to 1 amp, approx, and want to add an ammeter to it. I will use a Sparkfun ACS712 Low Current Sensor Breakout board which I can adjust to give a voltage output range from 1.000 to 2.024 volts over the input range of 0 - 1024 mA, so that a 10 bit ADC with these as its lower and upper reference voltages will give me a nice 1mV per mA per bit output. I will be happy with a 1% or so accuracy. I intend, if I can, to use a Microchip PIC12F675 to do this conversion, but it allows adjustment of only the upper reference value. To display the current reading I will use an I2C link to a Sparkfun 7-Segment Serial Display COM-11442. So my question is: please, how do I convert the 1.000 to 2.024 voltage range into 0.000 to 1.024 to suit the ADC? As an alternative, is there a different small PIC that I could use, which has an ADC with a variable lower Vref to a 10 bit ADC, and also an I2C serial module? I have looked on Microchip's website, but the needle, if it is there, is in a bewilderingly impenetrable haystack of data. I want to use a PIC because I can program them easily in Assembler, which is a process I view with somewhere between enjoyment and love, and I have the software and hardware to do it. This is a specific question, please don't suggest other ways I can sample the current, I can do that myself. Thank you. AI: You said you only care about 1% accuracy, which is less than 7 bits of the full range. You can therefore use the 1.000-2.024 voltage directly. Even if you have a 10 bit A/D with a 0-3.3 V full range, you still get about 320 counts, which is more than 3 times your requirement. There is no need to shift or scale anything. If you use a divider to create Vref+ instead of using the 3.3 V supply internally, then you get even more resolution. If you can bring it down to 2.1 V, for example, to leave a little margin, then you get 500 counts over your range. Thats lots more resolution than accuracy unless you use a separate precision reference. Consider that a divider made from 1% resistors will cause significantly more error than a 10 bit A/D using the reference. To get 1% accuracy, using a fixed external reference is probably the simplest way. A 2.048 V reference is almost perfect here. Some PICs do have a optional Vref- input, but tying it to anything other than ground is going to decrease accuracy. Basically you'd be tradeing off accuracy to get more resolution, which makes no sense when you already have lots of resolution and accuracy is on the edge. Your desire to get the raw A/D counts to represent some arbitrary "round" value is silly. Don't burden your measurement system with having to meet this arbitrary spec. Do the best job of taking the measurement, then the rest is simple conversion in firmware. You have a digital processor that can easily apply a scale and offset instantaneously in human time. The conversion to decimal will probably take more cycles, although that will be instantaneous in human time too. Basically, think about what you really want to get out, proritize your requirements accordingly, and don't specify implementation details (like what one A/D count should represent). Your top priority should be accuracy, given your specs, since everything else pretty much falls out with a 10 bit A/D.
H: Convert TV Remote To NMT Remote I've got a 4 year old LG TV remote control, which I recently took apart. I've also got a Popcorn Hour A-100, without the original remote. So my question is - given that I don't care about the plastic packaging - is basically how to transform the old TV remote into the NMT (Networked Media Tank) remote which I require. I'll divy it up into 3 seperate questions: Is there a way of finding out which IR signals are required to operate a specific device, namely my NMT? Is there a way of finding out which IR signals a remote puts out, with the push of every different button (or am I approaching this all wrong, and the push of a specific button does not trigger a different IR signal,but merely sends the information to the micro-processor which in it's turn tells the IR signaler what to do) ? Lastly, is there a way to re-calibrate a remote so it puts out the IR signals I require? AI: IR Remote controls are generally designed to be tight to their functional requirement in order to keep their manufacturing cost extremely low. This generally means that the chip in the remote is a dedicated chip designed to produce a certain IR protocol that is specific to the manufacturer's device family. Each key on the remote will cause a different IR modulated sequence to be sent to the target device. All of the key codes for that target device will be within the same IR protocol family. A protocol family will support a certain number of key codes within the protocol whether that be 32, 64 or 128 codes (or some other number). I mention this because some remotes can support multiple target devices for example TV, DVD etc. Each target device may be a different protocol family. There are handful of different protocol families in use and are generally lined up with major equipment manufacturers such as Sony, NEC, Philips and others. It is highly unlikely that the remote that you have in hand will be easily convertible for use with your alternate target device. You would have to first know what IR protocol family was required for your target device and what the required individual key codes are. Unless you have the actual remote in hand this information is almost impossible to reverse engineer. The best you could hope for is that the family protocol and key codes may be documented off on some web site. If you did manage to find the target device family protocol and key codes then the process of converting the existing device would only be successful if it natively supported the same IR family protocol. It is usually possible to reverse engineer the IR protocol and key codes for an in-hand IR remote control. Two general methods are used for this, both of which require the use of an oscilloscope. With one scheme you probe the signal in the remote itself that drives the transmit IR emitter LED. In the second scheme an IR receiver component can be rigged up on a proto-board and then used to receive the signal from the remote control which is then probed with the oscilloscope. The latter scheme is somewhat easier to see the IR signalling envelope because the IR receiver removes the carrier frequency from the detected IR stream. At the transmit side you would see this carrier as part of the waveform and is typically 36KHz, 38KHz or 40KHz although other carrier frequencies may be used by some IR protocol families. In the long run you would probably be best off to look into finding a replacement remote control for your target device or look at universal replacement type controls that can be programmed to emulate the IR family protocols and key code sets for several thousand different target devices. Even if the universal remote does not directly support your target device it is possible to sometimes experiment with selecting alternate similar type device selections and find one that will allow partial control of your device.
H: Resistor values for LED I'm reading this datasheet: http://www.jaycar.co.nz/products_uploaded/ZD0012%20-%20AL-50-30RGBC-C-004.pdf The Preferred Value Series Resistor on this page recommends 510/470/470 Ohms for 12VDC which to me seems too low because the maximum current is specified as 20mA per channel while Ohms law says 12V / 470 Ohms = 25.53mA Which is above the recommended 20mA. Why is this? AI: Ohm's law applies only to the resistor, so you need to use the voltage across the resistor when calculating current. That means you need to subtract the LED forward voltage from 12V before dividing by the resistance.
H: AD623 ANZ vs. BNZ? I have simulated my first circuit ever and now I wanted to order an Analog AD623 to actually build it. I gathered that I need the 8-DIP package to stick the IC on the breadboard, but there are actually two versions: http://www.digikey.ch/product-detail/en/AD623ANZ/AD623ANZ-ND/750974 $3.79 http://www.digikey.ch/product-detail/en/AD623BNZ/AD623BNZ-ND/760282 $5.25 I fail to find any differences between the ANZ and BNZ version besides the price. Can you tell me what this stuff is about? AI: The suffix ANZ or BRZ have a meaning. have a look at p.23 in the datasheet (rev.D). A or B - grade N - package Z- RoHS compliance The ICs have manufacturing variations. ICs are tested during production. Some of them are rejected. The ones that pass, are sorted into grades (or bins), depending on the variations in each individual IC. You can see the difference between the grades on pp.3-5 in the datasheet. AD623A and AD623B have separate columns. Notice that grade B has somewhat better characteristics.
H: Driving High Power LEDs with this circuit I've just completed building this circuit (thanks alexan), times 3 for each RGB channel. R1 = 4.7k R2 = 1K R3 = 10K Q1 = BD140 Q2 = BD139 This circuit is used to power 4x20mA RGB LEDs in parallel and am happy with the result. They're using 510/470/470 resistors for the RGB channels respectively. Now I'd like to do the same but power a much higher power LED but I have a few questions before I go ahead and purchase it. What's the reason for not having a common cathode, instead having +/- for each channel? Can the cathode go to a common ground in my circuit, while each of the anodes go to the emitter of each Q1? Would the schematic above be sufficient to drive these LEDs? (remember the schematic represents a single channel) How do I calculate the resistor values for each channel for a 12VDC power supply? Is the 350mA current for all 3 channels or is it per channel? If it's per channel, then each channel would need 166.67mA of current. The calculation I'm using is: Typical Forward Voltage R/G/B (datasheet) = 2.4/3.5/3.4 Red = (12V - 2.4V) / 166.67 = 57 Ohm (1.6W) Green (12V - 3.5) / 166.67 = 50 Ohm (1.4W) Blue (12V - 3.4) / 166.67 = 51 Ohm (1.4W) This doesn't seem right to me at all, because the total power comes to 4.4 Watts. So, where am I going wrong? AI: What's the reason for not having a common cathode, instead having +/- for each channel? Can the cathode go to a common ground in my circuit, while each of the anodes go to the emitter of each Q1? But the cathode is common (assuming the led resistor is connected to the anode side), all cathodes are connected to the ground so they are connected to each other too. If you have connected the resistors to the cathode side of the leds then you can't connect them together. I'm not sure why you mention the emitter, the leds are connected between the collector and ground Would the schematic above be sufficient to drive these LEDs? (remember the schematic represents a single channel) If you increase the base current to be sufficient then it can drive higher power leds too. How do I calculate the resistor values for each channel for a 12VDC power supply? Is the 350mA current for all 3 channels or is it per channel? The base current should be about 1/10 to 1/20 of the output current to saturate the transistor and have a low voltage drop across the emitter-collector. When you are using one color (the others are off), you can use 350mA for sure but I'm in doubt of the total max current when all three are on. This doesn't seem right to me at all, because the total power comes to 4.4 Watts. There is nothing wrong in the calculation. What you get is the dissipated power in each resistor for the given input voltage/output current.
H: Is a pic 16f877a reprogrammable I have just finished a basic lesson in electronics, an i have become interested in micro-controller programming. I have decided i would learn on the PIC micro-controller because it looks simple and their are many tutorials available. When researching the pic to start with the 16f877a was recommended. However when i was researching it I think i heard somewhere that it could not be reprogrammed. I was wondering weather it could be reprogrammed using a pickit programmer after having previously been programmed. AI: "F" PICs are flash-based and hence are electrically reprogrammable. "C" PICs are OTP, but there are ways of adding programming to it as long as the firmware isn't full (see the family datasheet for details).
H: Interfacing an automotive pressure sensor to microcontroller circuit This is a follow up to Measuring water pressure in a tank. I've decided to try and go a different direction so I'm asking a new question. I have an application in which I need to electronically measure the pressure inside of a pool filter. Because the sensor will be subjected to chlorinated water I can't use a simple pressure sensor such as the MPX5700 from Freescale. I've got a cheap 150 PSI Pressure Transducer from Ebay with the following technical details: Input: 0-150 psi. Output: 0.5V – 4.5V linear voltage output. 0 psi outputs 0.5V, 75 psi outputs 2.5V, 150 psi outputs 4.5V. Works for oil, fuel, water or air pressure. Can be used in oil tank, gas tank, etc. Accuracy: within 2% of reading (full scale). Thread: 1/8”-27 NPT. Wiring connector: water sealed quick disconnect. Mating connector is included. Wiring: Red for +5V. Black for ground. Blue for signal output. I tested it out on the bench using an oscilloscope and multimeter and measured the following: When no pressure is applied it is producing about 418mV. This seems correct based upon the above. When I force some air into it using my mouth the voltage goes up as expected. The resistance between 5V and GND is 42.7K ohm The resistance between 5V and signal OUTPUT is 120K ohm The resistance between GND and signal OUTPUT is 69K ohm I connected the sensor signal wire to my LPC1768 micro-controller on P17 ( analog in ), sensor Red wire to +5V and the sensor ground wire directly to ground. When I read the 12 bit AD convertor output I saw wildly varying output such as the following in the Pressure column: Cycle Level Pressure ================================ [211] W:[184] F:[2200] [212] W:[184] F:[2071] [213] W:[185] F:[1279] [214] W:[184] F:[418] [215] W:[184] F:[1514] [216] W:[184] F:[3002] [217] W:[185] F:[1499] [218] W:[185] F:[0] [219] W:[183] F:[1430] [220] W:[184] F:[2501] [221] W:[184] F:[1965] [222] W:[185] F:[1311] [223] W:[184] F:[263] [224] W:[184] F:[1509] [225] W:[183] F:[3195] [226] W:[186] F:[1518] [227] W:[184] F:[74] [228] W:[185] F:[1306] [229] W:[184] F:[2037] [230] W:[184] F:[2409] [231] W:[184] F:[1478] [232] W:[184] F:[30] [233] W:[184] F:[1503] [234] W:[185] F:[3254] [235] W:[184] F:[1549] [236] W:[184] F:[433] [237] W:[185] F:[1025] [238] W:[184] F:[1714] [239] W:[184] F:[2691] [240] W:[185] F:[1479] [241] W:[184] F:[0] I'm using the same software routine to read both the Level and Pressure column. The Level column is very stable unlike the Pressure column. My questions are as follows: If the sensor is supposed to output .5V with no pressure how is it that I'm reading 0? Why such variations between each ADC reading? Do I have to add some components to the circuit interface because of the resistance noted above in points 3,4 and 5 such as a unity gain buffer? If so, what op-amp would you recommend? Note that I'm not an electrical engineer, just a hobbyist new to op-amps. Thanks Joe Hass for the unity gain buffer idea. What about power supply filter capacitors? Should they be needed and if so have much? Should I add pull-down or pull-up resistor? Is it possible to get this to work or would I need to use a much more expensive item such a Honeywell industrial pressure sensor? Note: This is both an electronics and software question. Right now I am working on the electrical interface. Update: Things appear for the moment to have been solved. I had the sensor signal connected to the LPC1768 P18 which is shared as Analog In and Analog Out. The sensor signal is now connected to P17 ( Analog In only ). That change and adding a 0.1uF cap to filter the sensor output has made the output at 0 PSI appear correct. I just have to test it with an air compressor and certain PSI settings to ensure the ADC readings remain correct. AI: These problems are hard to diagnose. The first thing I would do is swap the level and pressure ADC inputs to make sure that there isn't some sort of software issue. Even if you've looked at the code a thousand times I would do this. The impedance of your sensor is pretty high to feed directly to the ADC input. I think you should add a unity gain, non-inverting buffer between the sensor and the ADC input. Bypass capacitors may be needed. There's not enough information to tell where they should be added or what their values should be. I would be sure to bypass the 5V supply for the sensor. You could add a small capacitor to the output of the sensor as well, assuming that the pressure is not changing rapidly. You could also try slowing the ADC clock rate to give the sample-and-hold more time to charge. Sometimes putting the processor to sleep during a conversion can reduce noise as well.
H: Send SD data connected to Arduino to a Webhost using FTP Sorry, I'm not very expert in drawing schematics, so this is the best I can do! I want to connect my arduino to GSM/GPS Shield offered by Cookinghacks.com http://www.cooking-hacks.com/3g-gprs-shield-for-arduino-3g-gps-audio-video-kit Now, the device will be kept inside the car as a data logger. I want the device to store the location of the car, and it should also take a picture while will be saved as well on the SD card. Now I want the system to be able every let's say 5 hours, to upload the picture and the text file containning the GPS location to an online host I've created using 3G. How could I upload images-text files to a webserver using FTP? AI: Have you seen http://playground.arduino.cc/Code/FTP. Note the FTP is above the socket connect layer to the Ethernet Shield's driver. So you it simply connecting the socket, just like the other client examples. Once connected then responding to the user/password prompt correctly, then issuing the FTP PUT command and finally sending or receiving the data.
H: Arduino as ISP: IC swapping I usually use my Arduino as an ISP programmer. Let's say I want to program the blink LED code to my ATmega328 with the bootloader already in it. Can I just program it in the classical way and pull out the chip from the Arduino? Is there any problem doing like this? It sounds easier and quicker. (I'm talking only about ATmega328 with the bootloader already in it, not ATtiny or other ATmega chips.) AI: Short answer: Yes you can. Longer answer, mostly stating the obvious for those who might need it: Evidently one would need an Arduino with a DIP socket and DIP ATmega microcontrollers - while the classic Uno and several other Arduino boards have this, some of the newer ones are SMD-only. This won't work with a fresh ATmega MCU, i.e. one without the bootloader - this is of course already addressed in the question The microcontroller ICs can be sensitive - both to manhandling while pulling the IC out (pins break), and possible ESD damage if the pins are not handled with care. The ATmega family is pretty hardy though, so ESD is not as big a risk If this method of programming is to be done for a bunch of MCUs, it would be better to use a breadboard or ZIF socket, rather than the socket on the Arduino
H: DC voltage for houses I'm wondering something. It's purely theoretical. Let's say I'm in home automation etc and I've got lots of little modules, for examples to control lights, access codes, doors locks, etc... All these modules uses DC voltage. But houses mostly are wired with AC circuits. Does it sound ok for you to have some tranformers in the basement, (for example 5VDC/10A, 9VDC/10A, 12VDC/10A) and then wire the house with DC circuits in addition of the classical AC circuit ? Are there some limitation ? (cable length) Or any specific care about ? AI: You can find some information on Low Voltage wiring in NEC Article 720 "Circuits and Equipment Operating at Less Than 50 Volts. Article 720 is relatively brief and basically states that conductors should not be smaller than 12 AWG. 12 AWG is some hefty wiring for the low voltage you are considering. Article 725 covers Class 1,2 and 3 "Power Limited Circuits" A Class 1 circuit is one that is under 1000 VA. The maximum VA you listed is 120 (12V * 10A). As long as you have your circuit properly fused or on a circuit breaker you can classify your circuit as a Class 1 under Article 725. 725.25 States that you can use 18 AWG and 16 AWG in an approved raceway or cable. Typical house wiring of this type is called bell wire. This cable usually has a brown outer jacket and has solid conductors (one white and one red) It is also available with more than 2 conductors and is used for wiring of doorbells and thermostats. If you anticipate regular circuit loadings of 10Amps I would consider using 16 AWG wire. Otherwise I would think 18 AWG would be fine. Edit: I see that 725.23 " Class 1 Circuit Overcurrent Protection" states that circuit amperage for 18 AWG wire shall not exceed 7A. Circuit Amperage for 16 AWG wire should not exceed 10A
H: WiFi wave cancellation Let's assume there is an emitter and a reciver. As the emitter is usually omni-directional, the reciver may get one direct wave and some reflected waves. Why does not these waves influence each other (they might even cancel themselves) and how it is solved the latency issue (a packet comes faster on direct wave than on reflected waves)? AI: Why does not these waves influence each other (they might even cancel themselves) This absolutely happens. In fact, much of the strength of 802.11N is derived from its ability to use MIMO to take advantage of the multiple paths that the environment provides. The latency issue is (partially) solved by using Automatic Gain Control (AGC).
H: Programming ATMega328 from arduino with separated power supply I actually need to update the code on a project who use an ATMega328. I'm using an arduino as a SPI programmer. So, I need TX/RX and RESET pins to program the external ATMega328. My problem is, the actual ATMega328 run on an other power supply than the programmer. Is it a problem ? Should I use optocouplers to connect the two circuit for the programming ? I can replace the power supply by the +5V/GND of the arduino, but I'm just wondering as this could be really easier for me. AI: As long as both the device and the programmer share grounds and use the same signaling levels, the device can be programmed directly. If they share grounds but do not use the same signaling levels then you will need to use a level converter. If they do not share grounds then you will need to use optocouplers.
H: What is a 3-state storage register on a shift register? The question lies almost all in the title I have bought a shift register to play with, and looked at the datasheet. I don't understand what is the 3 state storage register associated with RCLK. My understanding is that if there is a high edge on RCLK then something (the 8 bits I guess) is stored in the storage. Is it possible to retrieve this value for some late usage ? shift register 74HC595 with storage: https://www.sparkfun.com/products/733 datasheet : https://www.sparkfun.com/datasheets/IC/SN74HC595.pdf AI: 3-state simply refers to the ability to disable the outputs, in this case using the OE pin for output enable. It really has nothing to do with the registers themselves, but only the output drivers. Doing it this way allows to set up a bunch of devices on a common bus; for example, a shift register like this could receive the current state of a NES controller, and be read out at a later time. Page 3 of the datasheet shows the functional steps very clearly; there's one shifting chain, fed by SER and SRCLK (with output into QH' so you can chain it wider, as for a SNES controller), a second 8-bit register that is updated using RCLK, and buffers to read that out using OE. This setup allows one set of counting hardware to load new values without risking a partially shifted version of data on the outputs. So yes, RCLK will copy the shift register contents into the parallel output register. From there the only readout available is using OE to enable the output pins QA through QH. That makes the 74*595 a serial to parallel shift register.
H: Poor man large linear encoder I'm looking for a way to build a cheap 1m linear encoder. Precision should be around 2cm (which is not really "precision"). Any advice will be welcome. @Joe Hass : yes it is moving. Not really fast. Speed is not a concern. 1m per 10s is ok. Edit : Thanks for help, as asked I give more details. The device will pick paper in drawers arranged vertically. There's one moving paper picking device, and dozen of drawers on top of each others. I need accuracy to locate the drawers to pick from. And a good notion of speed and position for the PID system that control the picking device. I think two laser cut optical rulers will do the trick. (there's a fablab in my city). AI: I'm not sure of the mechanics of what you describe but if it slides on a specific legth bar you can use an optical sensor that reads either slots on the bar or reflective areas (like a shiny sticker every 2cm) Another idea is the use of a small wheel that has a similar optical sensor and by reading the wheel movement you can calculate the distance.
H: Using a low discharge accumulator to power a drone I'm trying to figure out if there is a way to use a Lithium accumulator to power a drone. Because of the maximum recommended continuous current of the battery, which is too low, I can't drive my motors and electronics. Is there a way to hack this into working using a supercapacitor or an alternative like hooking up many lower capacity accumulators ? I'm interested, as you have guessed, in low mass and high capacity. The details of the accumulator are : Nominal capacity : 19Ah Voltage : 3.6V Max. recommended continuous current : 230mA Max. pulse current capability : 400mA Weight : 98g Volume : 51cm3 Link to the datasheet (page 6) PS : I'm working on this. My version will incorporate a pinhole CMOS video camera and a wireless transmitter. AI: A bunch of capacitors aren't going to fix a sustained discharge rate problem. Capacitors can provide high peak currents for a short time, but they store relatively little energy compared to a battery, so anything sustained must come from the battery. The basic problem is that this battery is inappropriate for this application. Lithium polymer batteries have good energy density and can provide more maximum current for the same size or capacity. Paralleling multiple batteries does give you higher discharge rate for the combined battery. However, the real problem here is the that maximum power output per weight is too low, and using multiple batteries, regarless of how they are connected, can't change that. Put another way, this battery can only put out 830 mW. That's simply too little to lift its own weight. Batteries for copters are usually depleted in 5-20 minutes, meaning that they put out Amps 3-12 times their Amp-hour rating. It would take 80 hours to deplete your battery at maximum current. This battery is meant for long term low drain. A copter requires exactly the opposite.
H: high frequency op amp for Arduino frequency counter I'm going kind of crazy trying to solve what I thought would be a very simple problem. I'm not massively experienced but will try my best to spell out what I'm trying to do and what's happening. I'm trying to build a frequency counter using an Arduino Mega to hook in to a homebrew HF radio receiver I'm working on. The library I'm using on the Arduino (http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/) requires logic (5V) level signals to sample to calculate the frequency of the input signal. The signal I'm trying to measure comes from an LC tank attached to a SA602AN and in the current configuration runs from ~3 MHz to ~5 MHz, and on my 'scope it measures 180mV peak to peak. I taking signal via a 10pF ceramic cap to avoid effecting the tank. No problem I thought, I'll rattle a little 2N3904 common emitter amplifier, nice and simple and we've all built a few I'm sure, but I didn't seem to be able to squeeze any gain out of the circuit - output was 180mV peak to peak. Next idea, use a LM385, signal to (+) via a 100nF cap, a 25k pot between output and - to adjust gain, and a 1k resistor between - and ground, which I've seen many times online for similar applications. I had exactly the same problem - in fact wherever I set the pot, the output signal of the circuit was < the input. Now I'm perfectly happy to accept the idea that I don't know a) what I'm doing or b) what I'm talking about, since this should really be an easy problem to solve but I'm just going round and round in circles. I have other similar 358-based op-amp circuits in my radio (audio preamp and to drive an RSSI indicator LED), the main receiver circuit has 5 2N3904s slopping around (and a couple of 2N2222s) so I kind of thought I knew what I was doing, but obviously not! Would anyone be able to point me in a useful direction, toward either what I could be doing wrong or a circuit which would serve the purpose? Thanks for your time! AI: Try an op-amp in comparator configuration - nothing in the feedback loop, ground the non-inverting input (or use an offset as needed) and your signal to the inverting input. No feedback. If you use a chip designed as a comparator, like LM319, it won't have internal compensation and is much faster than an equivalent op-amp. LM319 has full scale response of 80nS (can stretch out to 180 with over-voltage input) which fits your frequency needs. Use capacitor coupled input for zero-crossing detector, or add about half your full scale input to the + pin. LM319 works with single +5 supply but so will a lot of others. Note the old standby LM311 you will see in a lot of examples is too slow.
H: Designing ammeter for an external ATX power supply adapter I'm trying to design and build an external ATX power supply adapter, much like this one. I want to use it as a benchtop power supply. I wanted my adapter to have one more feature: I wanted it to have a voltmeter and an ammeter at each positive rail (+12V and +5V). I'm planning on having an ATmega328P do the voltage readings and display them in a common 16x2 LCD. Here's where my problems begin. I'm having trouble designing the ammeters. My first attempt at it was the schematics below. The idea behind the schematics is that I'll read voltages in ports A0 and A2 to determine voltages of +12V and +5V rails, respectively, using ATmega328P ADC. There I would have my voltmeters, no problem. The voltage dividers in each circuit are there to bring voltages to the ADC's 5V limit. To determine currents for the +12V and +5V rails, I would calculate the differences A1 - A0 and A3 - A2, assuming I'll be using 0R1 (0.1 ohm) 5W shunt resistors. The shunts I'm planning to use yield 100mV/A. I plan on making readings well below 7A to respect the 5W spec on the resistors. The problem is that I'm not comfortable having to make two readings to get the currents. I would much rather have the shunt connected to ground and then make a single voltage reading at its other end using the ATmega's 1.1V internal analog reference. That would give me the accuracy I want, all the way to about 6A. But then I don't know how to design such circuit so that all current that goes to each rail gets measured. So, my question is: Is this design going to work? I'm afraid I won't have enough accuracy, especially because I'm depending on two readings to calculate current. Will the stacked up errors be too much? Another related question: is there a better way to measure the current of each rail? AI: A single-ended reading from the perspective of your micro is the way to go. Use an accurate analog circuit to compute the difference and quantize that difference with a single ADC channel to get your reading. I suggest using a smaller shunt (something that will produce 10mV at your maximum load) and a part from the INA210 family - these parts are highly accurate and work in both the high-side and low-side. If you don't end up with the exact gain you want, you can simply voltage-divide the output of the INA21x and feed that into your ADC input.
H: Best practice to keep main() in embedded systems I would like to know one thing about keeping the main() in embedded coding practice. I have a stand-alone system that have n number of states and it would be shifting to the respective states. At first I did a while(1) condition in main() and checked for any of the states to occur: main() { initialize; while(1) { check for state n. if state n found GoTo state n } } I don't know whether I made a mistake by defining the state n inside the main itself. Or should I separate the state n definition by separating it from main() and calling the state n function from main()? I want to practice the best coding standard. What is the best practised method in embedded systems to keep the main()? I would like to have inputs from your part to have the best structure for defining embedded coding methods to keep main() and corresponding source files. What will be the case when the states become elaborate and complex? How should I keep the main()? I trust coding needs to be kept tidy. I would appreciate your valuable inputs and suggestions. AI: If you're concerned that code for a simple switch() based state machine (SM) will become untidy, you can split it into smaller subroutines. void do_state_s1() { // stuff if ( /* certain contidition */ ) { g_iState = STATE_S2; // transition to another state } } void do_state_s2() { // other stuff if ( /* some other condition */ ) { g_iState = STATE_S1; } } void do_state_machine() { switch (g_iState) { case STATE_S1: do_state_s1(); break; case STATE_S2: do_state_s2(); break; }; } void main() { g_iState = STATE_S1; // initialize the SM while (1) { do_state_machine(); } }
H: How does the phone detect if 3.5 mm jack circuit is closed? I have an android phone to which i have plugged an earphones. So at the top of the phone, I get the headphone symbol which indicates that the earphone is connected (In other words, the circuit at the 3.5 mm jack is closed). Then I cut the two earphones (transducers) from it, and still the headphone symbol shows. When I later cut this cable, below where it branches out, even then it shows circuit completion. So my question is this: How does the phone detect circuit completion at the 3.5 mm jack and thus trigger all sound and music to be directed through the 3.5mm jack? AI: Headphone jacks have extra contacts inside, which act as switches. The the drawing below, pins 4 and 5 are intended for sensing that the plug was inserted. They are not intended for audio signal. When the plug is not present, the switche, which are formed by 2 & 4 and 3 & 5, are closed. When the plug is inserted, these switches are open. The plug flexes 2 and 3 slightly, and they break contact with 4 and 5. You could insert a 3.5mm plastic rod [a dummy] into the jack, which will open the contacts, and the phone might think that earphones are plugged in. Source: datasheet for a typical stereo jack.
H: What's the difference between uIP, lwIP, 6LoWPAN? I just started to work on a wireless sensor network project and encounter these three terms: uIP, lwIP, 6LoWPAN. Since I'm new to this area, could anyone please explain the differences between these three terms? Thanks! AI: uIP and lwIP are both open source TCP/IP stacks used for embedded/microcontroller systems. 6LoWPAN is a network protocol which works over the IEEE 802.15.4 wireless layer.
H: What sort of electric "motor" would I need to launch a puck? As the title suggests I am looking at making a hockey puck launcher so I can do some off ice technique training as a goal tender. I have no one to train with so I wanted to create a puck launcher similar to the tennis trainers they have that fire balls at you. My idea was to run an electric motor that was attached to two spindles (via belt or chain drive) with spinning wheels. When the puck is inserted between them it will grab and take off. My problem is I'm unsure as to how to determine what size motor I would need as I don't know much about torque / force. I want to be able to do the following: Fire a 100 gram (3.5 oz) inline puck. Speed should be able to be varied between 0 - 60 mph. Must be able to be plugged into 240v mains power (I live in Australia) via step down transformer or similar. (Note: I have qualified electricians who can do this for me). I was looking at hobby RC motors as those cars likely weigh more than 100 grams and many of those can go extremely fast, they also have variable speed control to mimic a real car. My concern is though would they have enough power to grip the puck and throw it? Is there any math I can use to determine this at all? If you need any more information or would like a design or something to help with the question to prevent it from being closed let me know. AI: You probably want a stored energy system to reduce required motor power. Mean power can be low - if you lower the firing rate the mean power drops. Easiest way to get consistent results is probably to have a rotating wheel with substantial mass that spins at the required circumferential velocity. If this is used to accelerate and "sling" the puck, and if Mwheel >> Mpuck then it will not slow much as the puck is accelerated to exit speed. Wheel is spun up by a motor of whatever power is desired. Larger motor = quicker recovery time. Note that if the wheel stores say 10 x the puck max energy you have a potentially lethal flywheel which would not be too hard to build safely, but care is required. Wheel balancing machines spin the tires & wheels up with an electric motor. Some have quite a small Wattage motor and a slow run up time. Others use larger motors and faster runup. I've seen older ones with a 24 VDC motor and maybe a few 10's of Watts max power. Spin up a wheel on such a machine to desired speed, place a sprung "floor" under the wheel, not touching but less than puck height separation, feed in a puck [from the BACK :-) ! ] and watch it vanish as it touches the tire. An old deadish wheel balancer may be available at minimal cost. Probably larger than what you had in mind :-). Energy & Power: Liberties: The following takes some liberties with power and energy profiles when accelerating a puck. If you accelerate at constant power then velocity change is not linear. If you accelerate at constant acceleration then power input is not linear. Time to accelerate depends on power input profile and is not the simplistic figure derived below. But, the following should give a good feel for power end energy levels involved. Energy / Power / Acceleration / time in 'launcher' / ... : Given puck with mass = 100g = 0.1 kg and velocity_max = 60 mph = 27 m/s -> say 30 m/s then Puck energy \$(E_K) = \frac{1}{2} \times m \times v^2 = 0.5 \times 0.1 \times 30^2 = 45 Joule = 45 Watt seconds. \$ (\$ E_K \$*=kinetic energy, m= mass of the object in kg, v= speed of object in m/s).* Linear motor: If you accelerated it at constant power over a say 1 metre linear track them Vmean = (30-0)/2 = 15 m/s so time to accelerate = 1/15s = 67 mS. As puck energy = 45 W.s and you are delivering this in 1/15s the power during acceleration is ~= 45 Ws / (1/15s) = 675 Watts. That's more Watts than you'd like to need in a linear launcher if you are driving it directly electrically. "Crossbow": Instead you can wind up a "crossbow" type mechanism where a spring or torsion bar or whatever is wound up to store the desired amount of energy and then "tripped". For a potential firing rate of 1/second you need 45 Watt of energy to storage transfer rate - say about double this to get electrical motor input or about 100W. For a 5 second repeat rate you are down to 20W and 10W for 10 second cycle time. "Putter:" A 10 Watt motor winding up a spring via a reduction box or screw thread or ...? is easy to build and play with. It would (probably) be easy to pull back a weight on a pivot (rigid shaft pendulum) and let it go so it swings and strikes the puck, golf putter style. Potential energy in a mass is mgh or about 10 x kg x height. You want 45 W.s max. 10 kg x 0.5 metre x 10 = 50 W.s Height is the vertical height above rest level. Velocities are now wrong and you are going to need to deal with impulse energy transfer, but it should be in the order of right. Rocket: A potentially workable system would be to use compressed air and a pressure reservoir. A completely DIY system could use a "water rocket" type launcher as built by amateurs world wide. Liable to be somewhat noisy [tm] on release. Treadmill motor / Direct drive rotary flinger: A potentially excellent excellent motor for a flinger is a treadmill motor. These are typically rate in the 0.5 to "several" HP range and 200 VDC permanent magnet units powered from 230 VAC rectified mains (and no doubt the 110 VAC based versions in the US) are common. Speed control by PWM or other voltage variation allowing wide range speed control. An arbitrarily large disk could be attached directly to suit the motors preferred RPM maximum. eg an 1800 RPM motor = 30 RPS will need a 1 metre circumference disk to deliver 30 m/S = a diameter of 318 mm or about 1 foot.
H: Power arduino with 7.2v rc racing battery? I just want to make sure before I destroy my arduino.. Is it okay if I power my Arduino Mega from a high current 7.2v battery pack? The battery I'm planning to use is this : http://www.ebay.com/itm/7-4-V-30C-5200mAH-2S-Lipo-Li-Po-Lipoly-Battery-for-RC-Car-Boat-/261351067166?pt=Radio_Control_Parts_Accessories&hash=item3cd9bcce1e The voltage is within the recommended 7-9V and it's a 5.2A pack, and the arduino will only draw as much current as it needs, so I don't need to worry about current, do I? Note: I will be connecting GPS/GSM module, and some other sensors. I won't use any motors for cars or boats. I need this because I want the arduino to live as long as possible! AI: It should be OK but be aware that the voltage regulator device on the arduino may not regulate when the battery voltage drops below 7V because, from memory it is a 7805 device and it, for proper operation needs a minimum of 7V to ensure the output remains regulated.
H: How to execute firmware from external flash memory interface to PIC microcontroller? I have both PIC18 and PIC24 microcontrollers with 256KiB of flash memory. My code size is 400kB and cannot be stored in the flash memory of those MCUs anymore. So I'm thinking about using external flash memory to hold the program code. Can I store my executable file in the external flash and execute it from there? How do I do that? AI: There are PIC24 & dsPIC33 models with 512KB flash. PIC18F8622 & 8722, and some other PIC18F's (87J50, 97J60, for example) have external bus interface, you can put a parallel flash (29xx-type) there, and the external bus can address up to 2MB. From the datasheet, we can see that this can be used to store program code: The External Memory Bus (EMB) allows the device to access external memory devices (such as Flash, EPROM, SRAM, etc.) as program or data memory. Using other types of interface to connect to an external flash might be problematic as you would not be able to run the code from the flash directly, instead, you'd have to copy the code into RAM before running it - but since these microcontrollers have extremely limited RAM resources, this would severely limit the usefulness of such a solution (you'd have to implement some kind of paging/overlay technique). Here's Microchip's product selection tool, allowing you to search for models with certain features: http://www.microchip.com/maps/microcontroller.aspx
H: What component to use for audio signal switching? I'm looking to build a guitar pedal switcher based on a Raspberry Pi or Arduino (have not yet decided, but I have an unused Raspberry around and I lean towards that). Anyway, digital logic. Now, I need to switch audio signal obviously and I need to do it quietly (both physical silence and electrical silence). Please note that the signal is line level throughout most of the build, except for the input which is much lower. I will probably have 2 or 3 loops before the preamp so those may not encounter line level signal. From what I read and know, so far, mechanical relays are not really an option due to the clicking noise they make. I also read something about FETs, but that's a bit out of my league and I would appreciate any info on these. PS: I will probably use different power rails for the digital and analog paths. PS2: The whole thing will be mounted in a 1U rack enclosure, so please tell me if I should take into consideration any thermal issues. AI: I'd consider using analogue switches to do this - they are used extensively on switching thermocouples in and out of circuits and thermocouples are very low level signals. For example, the DG409 is used in this type of application and is specified in the brochure for audio routing applications. They are low power devices too. They can operate with a single +5V supply or from +/-5V supplies to +/-20V. The DG409 has two 4:1 multiplexers meaning you can route your signal to one of four places or choose on of 4 signals to route to a single place. This type of analogue switch comes with different switch configurations such as changeover or normally open too.
H: TO-220 voltage regulator, heatsink and mounts I've received my heatsink and mounts for my voltage regulators. It's the first time for me. I'm not sure about the way to mount the regulator on the heatsink. Mainly a little film, not sure about the composition. Feels like plastic but it's really fragile and composed by multiple layers. after a google search I've found some posts talking about a kind of thermal paste replacement. Here's what I have : To mount it I've place the little film between the regulator and the heatsink. Does it sound ok for you ? Do you have more information about that little film ? Should I mount it on the other side of the heatsink ? AI: Here is a site that shows the uninitiated how to mount components on heat-sinks (amongst other things). Towards the end they touch-on mylar insulating washers (like the one you have). For a simple regulator you don't need this insulating plate providing you make sure the heatsink doesn't touch parts of the circuit that are not at 0v (centre pin on most regulators)
H: Differential output to headphones In my circuit, wt-32 gives 4 analog outputs(l+,l-,r+,r-). I want to connect them to a headphone jack. I thought of using 2 lm386 audio amplifiers as shown below: Will this connection work? or Am I making some mistakes. AI: The LM386 isn't quite suitable for what you need. Firstly it has a minimum gain of 20 so it's going to be pounding out loud and distorting badly. The second thing is that this type of amplifier benefits from a bypass capacitor from pin 7 to ground - it greatly enhances rejection of power supply noise - take a look at the top middle graph on page 4 to see the effects. Thirdly, and quite importantly you need an output capacitor to stop dc voltages being shorted by the low impedance of your speaker - take a look at the application diagrams on page 5 onwards to see what I mean - it's mostly shown as a 250uF capacitor for your reference. Fourthly, in most applications where the device is being used as a normal amplifier, it is operated with a single ended input - I'm not sure the data sheet adequately informs anyone that operating differentially (as you have it) is ideal. You can get this device to work as a headphone amp but you'll probably need to reduce the signals going into it.