text
stringlengths
83
79.5k
H: How much current is used with a μC GPIO input and pullup resistor? I'm trying to understand power budgets a bit better and I have a question regarding pullups. I have a input to a microcontroller that needs to be logic high at all times. The micro goes to sleep now and again, so the internal pullup isn't an option. Looks like so (wow that's big). simulate this circuit – Schematic created using CircuitLab I'm dealing with a low power, battery-operated system here (2 AA batteries), so every bit of power savings counts. My question is how to figure out how much current this draws. If I just look at V = IR, we're talking 30μA, which is actually a lot for this application. What I don't really understand is how to factor in the microcontroller. I'm assuming there's something I need to factor in from the datasheet, but I don't know which elements are relevant. The 100k resistor is from a reference design, but is there anything stopping me from putting a much bigger resistor to cut down on current draw? These are probably basic questions, but I'm a software guy out of his element here, so bear with me. Leakage Based on some comments, it looks like leakage current is the microcontroller spec I should be interested in. Below is what I found in the datasheet. Is 3 nA the magic number? AI: You need the input leakage current. This question has a good discussion of what's actually happening. Basically, the input transistors present an effective resistance of megaohms to gigaohms and the current flowing will be extremely small. That discussion also says you can usually increase it to 1Mohm.
H: gold finger plating needed on prototype board edge connector? I am making a PCIe card and will be ordering prototypes. I know that in my production cards I should order hard gold plating on the edge connector. Can I skip this plating on my prototype cards to save expense and production time? I understand that the default plating (tin?) may be damaged by repeated insertions, but will a few insertions be an issue? Helping the situation is that my card will be attached to a PCIe flexible riser cable, and could theoretically stay attached to that riser cable most of the time during testing, so most of the insertion cycles would wear on the riser cable and not my card. AI: Yes, for prototyping over short periods of time with few insertions you should be fine. Multiple insertions will damage the coating (and worse, may eventually rub off some of the tin, leaving shavings inside the connector!), and over time vibration will reduce the contact's effectiveness. So it's not good for long term use, but it shouldn't be a problem for prototyping, particularly if you can use a removable riser card that can be replaced in the case of damage.
H: 2n2222a as a Switch I just connected a very basic transistor as a switch circuit, and was trying to control it with a function generator with a schematic shown below. simulate this circuit – Schematic created using CircuitLab I set the function generator output to 1HZ , 5V peak(0-5v) PWM with 50% Duty cycle. However the circuit showed a weird behavior. When the voltage supply was at 5V, I got an expected output across the Resistor with peak of 5V. However the behavior started changing when I went above 5V. At 5.9V, the output was something like: The amplitude of that ringing increases with input voltage. Any ideas on why this might be happening? My Guess is that, it might be since the upper end of resistor becomes floating when transistor is OFF. If so, why does it show a clean output till 5V. AI: The output high voltage from the emitter of Q1 will never exceed Vb-Vbe. If the maximum base drive voltage is 5V, then the emitter will never be able to rise above approximately 4.3 volts when Q1 is saturated. If the power supply increases to 5.9 Volts, then the transistor is operating in a linear region and the difference of 5.9-4.3 is dissipated across the CE junction. As soon as the emitter tries to rise up, it clamps off the base and shuts down a little until it reaches equilibrium. If the trace you show is of the actual circuit and not of a simulation, then the ringing is most likely cause by some noise source in the circuit as 1Hz is to slow for it to be a transient response. The upper end of R1 never floats. It is bound by the Vbe junction of Q1. If you wish to use a high side driver, then perhaps consider a PNP device. If you want a low side driver, then use an NPN device. this will free R1 from Vbe.
H: Extremely noisy signal after voltage follower/buffer I am trying to create a voltage follower for my CCD linear array. When I measure the signal with oscilloscope directly from the CCD outptut - the signal is reasonably clean. However, when I measure if after the voltage follower, the signal is extremely noisy. Distorted? The analog output from the CCD fluctuates between 5V and 8V. The readout rate is around 1MHz. Therefore, I am using AD8004 OpAmp 250MHz bandwidth, 3000V/us. I power it with -Vs=0V and +Vs=12V. Putting a 10uF cap on the power line next to the IC does not help. Please, help to find the reason of such noisy output. AI: Looking at the datasheet, the AD8004 does not seem to be a great choice for a voltage follower, and some special consideration might be needed if you are going to use it that way. Nowhere in the datasheet is it claimed that the amplifier is gain-of-1 stable. However some specs are given for gain-of-+1 configurations, so it's not entirely impossible to use it this way. Where gain-of-+1 specs are given, a feedback resistance (Rf) of 700 - 1100 ohms is specified. There are no specs for how the part will operate in the usual voltage-follower configuration with a short circuit (Rf = 0 ohms) connection from output to inverting input. The frequency response in the G=+1 configuration shows substantial peaking. My conclusion from this is that the amplifier is "just barely" stable in unity-gain configurations. Very possibly your amplifier is oscillating if you have hooked up the standard "voltage follower" configuration. If you do want to use AD8004 as a follower, you should definitely include a resistor in the feedback path (806 or 1.21k ohms are recommended in table I of the data sheet). As a comment suggested, you also must be sure to connect the pins of any unused amps in the package in such a way that they will maintain a steady voltage. If you leave them open, the unused outputs are likely to fluctuate randomly. And this fluctuation is likely to couple (for example, through the power supply) to the used amplifier and exacerbate any problem you have with stability. But even safer, especially given you have only a 1 MHz input signal, would be to find a more appropriate op-amp for this application.
H: how must I connect a USB micro b connector to reach 5v? I'm designing a circuit and want to power it through a USB Micro B connector. I have already installed the connector on my board, but after connecting the USB female connector of the wire to my computer, I don´t get any voltage on the Micro USB B connector. How must I connect it? I used to use a USB B connector on my through hole prototype and it worked very good but it had only 4 pins. Can anyone help me? AI: USB cables have 4 wires inside, normally black is GND and red is +5V and are at opposite sides of the connection e.g. 5V|D+|D-|GND probe with your multimeter to check which is which.
H: How the time is converted into distance by multiplying it with 17,000 The general formula for Distance to Time conversion or vice versa is, Velocity = Distance / Time I have been implementing HCSR04 Distance Sensor, Datasheet: https://docs.google.com/document/d/1Y-yZnNhMYy7rwhAgyL_pfa39RsB-x2qR4vP8saG73rE/edit and according to Datashheet, To start measurement, Trig of SR04 must receive a pulse of high (5V) for at least 10us, this will initiate the sensor will transmit out 8 cycle of ultrasonic burst at 40kHz and wait for the reflected ultrasonic burst. When the sensor detected ultrasonic from receiver, it will set the Echo pin to high (5V) and delay for a period (width) which proportion to distance. To obtain the distance, measure the width (Ton) of Echo pin. This is how i am calculating the Distance right now, Distance = Velocity of Sound * Time But according to datasheet, Time = Width of Echo pulse, in uS (micro second), Distance in centimeters = Time / 58 Distance in inches = Time / 148 Or you can utilize the speed of sound, which is 340m/s How come Time divided by either 58 or 148 gives Distance ? Also, Some code on the internet (http://www.bytecreation.com/blog/2013/10/13/raspberry-pi-ultrasonic-sensor-hc-sr04) suggests that, Distance = time * 17000 (in cm), Here is what this page says. # work out the difference in the two recorded times above to # calculate the distance of an object in front of the sensor timepassed = signalon - signaloff # we now have our distance but it's not in a useful unit of # measurement. So now we convert this distance into centimetres distance = timepassed * 17000 How come multiplying time with 17000 gives the distance. AI: If you take 340 m/sec (approximate speed of sound through air) and convert to cm/sec you get 34000 cm/sec. For pulse-echo, the sound travels twice the measured distance so you need to divide the conversion factor by 2 so you get 17000 cm/sec. When you multiply by the measured time, you get distance from the transducer to the object in cm. The other two conversions are converting from time measured in microseconds at the same time so the formua for Distance in centimeters is the same as: Distance (cm) = Time (seconds) * 1000000 (microseconds per second) / 58 which comes out to (approximately) Distance (cm) = Time (seconds) * 17241 which is nearly the same as the formula in your question. As Andy said, the speeds of sound used in the formulas are approximations. The actual speed of sound through air varies with temperature and (to a lesser extent) with humidity (and a little due to other factors).
H: What is a SRF? (This is used in AC power distribution system with isolation transformer) Following image shows a block diagram of a AC power system. What is that SRF equipment comes with the isolation transformer? What SRF means and what it does? AI: SRF = Self Resonant Frequency (as Dan D may or may not have suggested :-) ). SRF is NOT a component or physical item, even though it appears to be one from your diagram. The SRF is the frequency where the capacitive and inductive elements in the system are of equal magnitude and opposite sign. This leads either to very low or very high impedances depending on configuration and point of measurement. The effect is that the system does not work as intended. Keeping SRF well away from the operating frequency is a key design requirement. SRF is probably shown on the diagram as a reminder of its importance in the context being discussed. From here - Transformer testing - page 14 Practical inductive components are not perfect inductors; they have stray resistances and capacitances associated with them. For certain components, especially those with a low inductance value, the impedance of the stray capacitance can become significant when compared to that of the inductance. XL = 2πfL XC = ½ πfC The frequency at which the inductive impedance equals the capacitive impedance (XL = XC) is known as the self-resonant frequency (SRF) of the component. At this point, the phase angle of the impedance (which can be measured using the ANGL test) is zero. At test conditions where the frequency is low enough for problems with capacitive impedance to be negligible, the phase angle will be positive and close to 90 degrees. Brief but useful comment - end of 1st page here Several useful transformer related formulae - several references to SRF This is a page on the Tesla Coil Information Archive site and is relevant but biased towards Tesla coil related applications.
H: Running current into a guitar pickup When a guitar string oscillates over a magnetic-coil guitar pickup, the pickup produces an alternating current. Would it be possible to do the reverse of this, and feed an alternating current into a pickup to manually oscillate the string? If so, would the signal type being fed into the pickup, have to be the same as the signal typically output by the pickup? (except higher amplitude) My intentions were to create a sort of "e-bow" style pickup fitted into the guitar, that's only purpose was to excite the strings, with a frequency that I could control with a micro controller (e-bow demonstration) AI: Would it be possible to do the reverse of this, and feed an alternating current into a pickup to manually oscillate the string? Yes. If we were to think of guitar pickups in this way normally, we'd call them electromagnets. To the extent that you run a current through the pickup, it will attract the string magnetically. excite the strings, with a frequency that I could control with a micro controller That might not work as you expect. To get a tone out of the strings, you need the strings to resonate with the frequency you are using to excite them. The string's resonant frequency is determined by its mass and length. Without your fingers to change the length of the string, you are limited to the pitch of open strings. If you try to excite the strings at other frequencies, you might get a sound, but it probably won't sound like a natural guitar. Whatever sound you do get will be colored by the resonances of the strings. You might get some interesting effects at harmonic frequencies. At other frequencies it may just sound very dull and quiet, or not be audible at all.
H: Calculating current required for powering multiple robots in parallel I'm looking to power multiple robots off a single 230V mains supply in parallel. I'm using the Micro Magician V2. I can't find out how many amps it draws anywhere but I know the motors I'm using have a stall current of 760mA so I'd guess around 1A per robot? I will be using 4 robots with this setup The Micro Magician states it has a: Built in LDO +5V, 1A regulator (input voltage must be at least 5.5V) to power external 5V devices Built in LDO +3.3V, 500mA regulator Does this mean I can have a power supply grid with any amount of amps and the micro controller will protect the board by limiting the amps? The voltage will be around 6V in this grid once I choose an appropriate transformer. Once I know what amps the power supply grid will need to produce to handle powering the 4 robots I can then choose a transformer? Let me know if any of the above statements are wrong, I'm quite new to this. Thank you! Edit: if anyone is confused about the "power grid" part, I have prototyped this circuit and it works well: Help with a full bridge three phase rectifier powered floor AI: From the textual description, this seems to be the configuration planned: simulate this circuit – Schematic created using CircuitLab The Magician controller documentation states: Built in dual FET "H" bridge with current limiting ... ... each output has been internally limited to 910mA to prevent damage from accidental short circuits. So the motor driving FETs provide the required current limiting and short-circuit protection on the motor side, nothing additional needs to be done. Current Calculation: The above tells us that no matter which DC motors are used, the maximum current in worst-case conditions would be of the order of 2 Amperes per robot with 2 motors, both stalled. In order to provide for 3 robots, the floor grid must thus be able to supply up to 6 Amperes. Add a bit for headroom, say 8 Amperes total. Voltage calculation: The Magician boards suggest that supply voltage should be greater than 5.5 Volts, and not more than 9 Volts. The bridge rectifier output will need to be smoothed by capacitors, to achieve the desired 6 to 9 Volt DC. A mains-to-6 Volt transformer will provide a peak DC voltage of 6 * 1.4142 = ~8.5 Volts minus 2x diode drop, so say around 7.5 Volts. (Transformers are rated at their RMS voltage. Peak voltage is obtained by multiplying by sqrt(2)) This is comfortably within the desired operating range, so you're all set, other than increasing the reservoir capacitor C1 until the system works reliably, and then adding a few thousand microfarads on top. The 4700 uF indicated in the diagram will possibly be too low at full motor load, leading to unacceptable ripple on the supply line - start with 4700, keep increasing this if the controller resets on acceleration or stall.
H: Making a bigger transfomer core by stacking multiple smaller cores Does using a number of stacked EI or EE cores in the place of a bigger one (respecting the know magnetic characteristics) would pose any substantial difference?1 There's even manufactures that sell glued cores, but I think 4 stacked cores is the maximum I have seen (ferrite cores not laminated ones). UPDATE: The idea is not to "miniaturize" the core, in fact they may be heavier and bigger than a single core, but to have access to high power cores if your local market is not selling larger cores. In fact, the above manufacturer shows that even it sells some bigger cores as glued/united small cores and the specified magnetic characteristics from then Single core: Same core stacked: Both images from Thornton products catalog. AI: Stacking multiple cores as you describe would effectively increase the cross-sectional area of the core. The question is then, what difference does increasing the cross-sectional area have? Firstly, a larger core can dissipate heat without damage. This is because it has more surface area. If a smaller core would overheat (due to eddy currents, hysteresis losses, etc), then a sufficiently bigger core would not. A fatter core also increases the inductance compared to a coil with the same magnetic path length and same number of turns, but on a thinner core. Why? Recall the definition of inductance: it is the ratio of magnetic flux to current: $$ L = \frac{\phi}{i} $$ One ampere through a turn of any wire of any size produces a MMF of one ampere. As the area of the turn increases, this MMF is applied over a larger space, and thus, there is more flux, and thus more inductance. That is, we get more flux \$\phi\$ per current \$i\$ as we make the turn bigger. However, this larger flux is spread over a proportionately larger area, so the flux density remains the same. Given that the flux density remains the same, the saturation current of a fatter core is the same as that of a thinner core. However, the fatter core has a higher inductance. We could then reduce the number of turns on the fatter core such that it has the same inductance as the thinner core. Being there now fewer turns, the flux density decreases, so saturation current increases if inductance is held constant. Thus, advantages of a fatter core: increased heat dissipation increased inductance (or) increased saturation current
H: Simple calculator problem So I am trying to create a calculator program in arduino using this codes. void loop() { char keypressed = myKeypad.getKey(); if (keypressed != NO_KEY) { //Serial.print(keypressed - 48); Serial.print(keypressed); if(keypressed > 47 && keypressed < 58) { if(!mySwitch) { num1 = (num1*10) + (keypressed - 48); }else{ num2 = (num2*10) + (keypressed - 48); } } if(keypressed == 61) { answer = num1 + num2; Serial.println(answer); num1 = 0; num2 = 0; mySwitch = false; }else if (keypressed == 43) { mySwitch = true; } } } This code is for adding the numbers. I do a nested loop if(keypressed == 61) { if(keypressed == 43){ answer = num1 + num2; Serial.println(answer); num1 = 0; num2 = 0; mySwitch = false; }else if (keypressed == 43){ mySwitch = true; } if(keypressed == 45){ answer = num1 - num2; Serial.println(answer); num1 = 0; num2 = 0; mySwitch = false; }else if (keypressed == 45){ mySwitch = true; } } it will only accepts the value and not compute it after pressing the "="sign btw "61", "43", "45" is the ASCII value of "=", "+", "-" AI: Assuming I understood what you are trying to do (subtraction when '-' is pressed and addition when '+' is pressed), use the following: #include <Keypad.h> const byte numRows = 4; //number of rows on the keypad const byte numCols = 4; //number of columns on the keypad //keymap defines the key pressed according to the row and columns just as appears on the keypad char keymap[numRows][numCols] = { {'1', '2', '3', '+'}, {'4', '5', '6', '-'}, {'7', '8', '9', 'C'}, {' ', '0', '=', 'D'} }; //Code that shows the the keypad connections to the arduino terminals byte rowPins[numRows] = {11, 10, 9, 8}; //Rows 0 to 3 byte colPins[numCols] = {7, 6, 5, 4}; //Columns 0 to 3 //initializes an instance of the Keypad class Keypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); long num1, num2, answer; boolean mySwitch = false; boolean do_subtraction_flag = false; // when true we will apply subtraction void setup() { Serial.begin(9600); num1 = 0; num2 = 0; } //If key is pressed, this key is stored in 'keypressed' variable //If key is not equal to 'NO_KEY', then this key is printed out //if count=17, then count is reset back to 0 (this means no key is pressed during the whole keypad scan process void loop() { char keypressed = myKeypad.getKey(); if(keypressed != NO_KEY) { //Serial.print(keypressed - 48); Serial.print(keypressed); if(keypressed > 47 && keypressed < 58) // is between '0' and '9' { if(!mySwitch) { num1 = (num1 * 10) + (keypressed - 48); } else { num2 = (num2 * 10) + (keypressed - 48); } } if(keypressed == '=') { if(do_subtraction_flag) // we want to subtract the numbers { answer = num1 - num2; } else // we want to add the numbers { answer = num1 + num2; } Serial.println(answer); num1 = 0; num2 = 0; mySwitch = false; do_subtraction_flag = false; } else if(keypressed == '+') { mySwitch = true; } else if(keypressed == '-') { mySwitch = true; do_subtraction_flag = true; } } } I have added a flag Boolean variable named do_subtraction_flag The flag is set depending on the button used, false for addition and true for subtraction. Its value is used when '=' is pressed to conditionally execute the code that either subtracts num2 from num1 or adds them. Note that I have replaced keypressed == 61 with keypressed == '=' and keypressed == 43 with keypressed == '+' It is much easier to read the code this way.
H: Function setting on SPLC780D LCD I'm drawing a bit of a blank with this. I have a 1602A-1 16x2 LCD screen hooked up to an i2c port expander chip. I'm using the screen in 4 bit mode so I have DB4-7 hooked up to GPIO 0-3 respectively. I have also hooked up RS, R/W and E to other GPIO pins. I can see the function set binary string is 001010xx to set 4 bit mode with 2 display lines and 5x8 dots display mode. I am thus setting the GPIO 0-3 pins to 0010 and then setting the enable pin high. I set the enable pin back to low and set the GPIO 0-3 pins to 1000. Again, I pulse the enable pin. All the time, the RS and R/W pins are low to signify Instruction Input & Write, respectively. I've tested the pins output with a multimeter so I'm confident that they are high and low when they should be... however it's just not working. The screen does not change to 2 lines nor can I send 4 bit commands in a similar way, following this. Anyone have any insights? AI: Do you have the bottom 4 bits of the data tied to ground? You should first reset the LCD by sending the 0x30 command three times. Although the LCD will still be in 8-bit mode the bottom four bits are hardwired to 0 so you don't need to send the separate nibbles. Now send the 0x20 command, again in 8 bit mode. When this command finishes the LCD will be in 4 bit mode. To enable 2 rows, send command 0x28. Now you are in 4 bit mode so you need to send two nibbles. Writing to the LCD through a port expander will require up to eight writes to the port expander for each byte written to the LCD. This is necessary because of the timing sequence required for the various control signals. The sequence I use is: Set the appropriate value on RS for data or command Set EN high Put bottom nibble of data/command on D[7:4] Bring EN low Bring EN high Put top nibble on D[7:4] Bring EN low Bring RS low (optional) Remember that it takes a long time for the LCD to process a command and you must wait for it to finish before starting another command or sending another data byte. The LCD I am using needs many microseconds for some commands so I am using a system tick of 1ms and writing a byte at every tick interrupt. If you don't want to wait you need to observe the BUSY status on D7 instead.
H: SPI Slave Flash programming with two masters question I'm looking to make a system that can be upgraded by a customer in the field and I need to know some conceptual thing before I try implementing my current strategy. Say I have a USB to SPI bridge, some FTDI chip, and I want to be able to program an SPI flash using that. Cool no problem BUT my controller has to boot from the same SPI flash using SPI lines. So would I be able to just connect everything together? Here is a picture since I'm not good at explaining these things. There is a typo on the picture. The controller isn't being programmed, the SPI flash is. The controller will boot from the spi flash AI: It should be possible to connect two masters to the same SPI bus provided that Neither device tries to drive SCK, MOSI, or SS when the other device wants to use it (though SS should be weakly pulled up when idle, and other pins weakly pulled to some defined level). The devices have some means of staying out of each other's way. I don't know whether the FTDI bridge expects to be a master or slave; if it expects to be a master but floats its wires except when told by the PC to feed data, and if it has some means of holding the main processor in reset, a direct connection should work out very nicely. If it expects to be an SPI slave, then the microcontroller firmware will have to talk to the bridge, read data from it, and feed that data to the flash itself.
H: Logical to physical implementation of voltage regualtor decoupling capacitors For this typical LM7805 application : simulate this circuit – Schematic created using CircuitLab Due to bad planing when placing my components on the PCB (perfboard) I ended in the following phisical implementation : So basically, on the rail of the 7805 input I've got in the order : VCC+, 7805-IN, Capacitor. Will this have any impact ? (I think not, but would like to be sure) EDIT : My question wasn't very clear and the schematic was more confusing than hepling. What can be the impact of having VCC+,7805-IN,Capacitor+ instead of having VCC+, Capacitor+, 7805-IN With Red as VCC, Green as 7805-In, Orange as C1. The top strip is what I'm asking. The bottom strip is the "ideal one". AI: Well, you are missing C2. Without this, the regulator's transient response will be diminished. It may also be unstable. Check the datasheet. Otherwise, it doesn't matter if you put C1 on the left or the right. It's just important that it's close to the IN and GND pins. From your picture, it looks like it is. For many circuits you can assume that any changes in voltage or current happen everywhere instantly, because the rate at which the changes propagate as waves is so fast relative to the length of the things in which they are propagating. This is called the lumped element model. This is why it doesn't matter on which side of the regulator C1 is placed: even though when the input voltage changes, this propagates as a wave at the speed of light which really will "see" the regulator first, some extremely small time later that wave will see the capacitor, and send another wave back at the regulator, and very quickly an equilibrium will be reached. See also How does the current know how much to flow, before having seen the resistor?
H: How can a circuit be unexpectedly affected by change in light levels? I have (or rather, had) a completely functioning circuit the monitored input from a button to toggle an integrated LED on and off. Much to my surprise, the circuit has very suddenly become finicky with light levels. I have a lamp where I work and, when I block the light shining down on the button and its connections, the button's LED goes on the fritz. Why could this be happening? I have double-checked to make sure that I don't have any short circuits. Is there anything physical that could be causing this, or is this purely a software issue? simulate this circuit – Schematic created using CircuitLab AI: From a comment I see that your problem was fixed by enabling a pullup resistor in the microcontroller. That means your original circuit was not "completely functional". It apparently happened to work in the particular case you tested it at that temperature, at that humidity, with those specific parts, at exactly that supply voltage, and apparently that specific light level. This is what happens when you violate specs. In this case you ignored the minimum high and maximum low logic level specs for the input pin. These are clearly spelled out in the datasheet, along with the maximum pin leakage current in input mode. Putting all this together, it means the logic state of a floating input is not guaranteed, in addition of course to the usual it being a bad idea for other reasons. The switch will pull the line solidly one way (apparently low in your case) when closed. The problem is what happens when the switch is open. Without something making sure that the pin voltage is above its minimum guaranteed logic high threshold, anything can happen. This is what the pullup resistor fixed. It sources more current onto the pin at the minimum logic high level than the pin can leak out, thereby guaranteeing it will be seen as a logic high when nothing else is connected. The reason light mattered is because various substances can change conductivity slightly depending on light level. Semiconductor junctions are even more susceptible to light, which is in fact the basis of how photocells work. Since you were operating the device outside of specs, there was no guarantee of anything, and you got what you got, which in this case happened to be light sensitivity. The same problem could have occurred at different temperatures, different humidities, and different parts, even from the same batch. READ THE DATASHEET next time.
H: Looking for replacement LED I'm looking for someone who can tell me what kind of LED this is (The barcode is: 5541475) It's the blue LED from this projector: Acer K135 I'm trying to modify the beamer and replace the LED with a white one. Therefor I need a replacement which has the same structural shape. Would be awesome if anyone has an answer or hint. AI: Closest I could find is this one: http://www.digikey.com/product-detail/en/PT-39-B-C21-EPD/1214-1000-ND/3431253 no doubt if that is in a product, there may be a new revision of that board since so many answers may cite very similar but not exact boards.
H: How to make AC signal's level proper for MCU input? I'm working on a frequency counter coursework, where I use MSP430 MCU. I have to measure signals with specifications: frequency from 0.1 Hz to 1 MHz and signal's amplitude from 0.1V to 10V. The problem is with signal’s amplitude, I understand that the voltage of 10V is too high and 0.1V is too low for MCU input. Do you have any ideas how to reduce 10V signal's amplitude to 2.7V-3.6V level and how to amplify 0.1V signal to 2.7V-3.6V level? I tried to find information on the internet, but I found just voltage divider, which one isn’t suitable for me. Maybe, are there any chips which one can do this function? AI: I agree with Andy about using a comparator, but disagree about attenuating the input signal to fit into the comparator range. I would rather clip it than attenuate it. Another possibility is to power the comparator from a wide supply range, and use the type that has a open collector output. 1 MHz isn't really all that high, and it's no problem to use a low enough pullup so that the rise time is still small compared to the 1 µs period. Since you're measuring (or possibly counting) periods, a little assymmetry in the digital signal doesn't matter. You just have to make sure that you still get solid edges with a 1 MHz 100 mV sine wave in. I would also be very careful with hysteresis in this case. It can help to not get a bunch of fast edges with a slow input, but it must still be a small compared to the 100 mV minimum input signal. Perhaps AC couping 10 mV or so back to the positive input would be reasonable. I'd probably try it first without any hystersis.
H: Use CT current sensor to measure AC current of a single device So I recently bought 3 current transformers with the goal to measure the current of 3 washing machines. All I want to measure is if the machines are running or not so accuracy isn't really a concern. Now I ordered them a bit hasty and didn't think of the actual working logic of these guys. From what I read, I thought I can just clamp them around a power cable and read the current. Which apparently is not the case because I can only measure one phase with a CT as far as I understand. I live in a country with a 3 phase system and I don't understand that much about alternating current. I tried to read into this 3 phase system but its quite a bit over my head. Now from what I think I understand, this means if I clamp this around a standard power plug I wont get any output voltage because the phases cancel each other out and I don't get any magnetic field that the ct could sense, is that correct? Question: Would it be possible to remove the outer isolation of a power cable and clamp the CT to just one of the three cables/phases? Or would they be too close and interfere and still cancel each other out? Or is it a stupid idea all together because I totally didn't get how this 3 phase alternating current system works? This is the CT sensor I'm using: http://www.seeedstudio.com/depot/noninvasive-ac-current-sensor-30a-max-p-519.html Datasheet: http://garden.seeedstudio.com/images/b/bc/SCT013-030V.pdf AI: Now from what I think I understand, this means if I clamp this around a standard power plug I wont get any output voltage because the phases cancel each other out and I don't get any magnetic field that the ct could sense, is that correct? Absolutely! Would it be possible to remove the outer isolation of a power cable and clamp the CT to just one of the three cables/phases? Or would they be too close and interfere and still cancel each other out? It would work, as the CT "measures" only current flowing in wires passing through the aperture, and is not influenced by anything else happening outside. However, there are a few questions: You have 3 machines, each having a single-phase feed? If yes, then you can go on, and attach one CT to the Live wire of each machine. If you have three-phase feeds for each of the machines, then you can measure a single phase, or you'll need more than a single CT per machine. Measuring a single phase could work if the machines load the phases symmetrically - a three-phase motor does, but the controlling electronics may not. In the latter case (and assuming you're not satisfied with recognizing only when the motor runs), you might still succeed if you can figure out which phase to use for the CT (the one which feeds the controlling electronics). What else do you have to do to keep the installation safe (and fully in accordance with the local electrical code)? To answer this, you'll need someone with knowledge about the local electrical code. Generally, stripping the outer insulation layer from a cable would decrease its safety level, so some measures will have to be made to keep the system safe.
H: How do I smooth current dips on a USB charger? I've got a USB charger that I want to use to charge a phone. For about 35 seconds it outputs enough current for the phone to detect it and start charging, then for an instant (no equipment to read the length of time, let's call it a quarter second) the current drops to 0, then picks right back up. This is verified via a small USB flashlight that exhibits the same behavior. This is a problem because the phone detects it as the plug being removed and reinserted which jolts the screen back on, resulting in a loss of charge. Is there a relative simple and small footprint way to smooth this out so that I get steady current? My fuzzy memory of hanging out with EE people in college makes me think the answer is capacitors, but I have no idea how to do this or how large of a capacitor I need. AI: The issue appears to be the USB master going into thermal reset due to sustained high current draw. It could as well be resetting due to overcurrent protection, but that generally wouldn't kick in after 35 seconds but much sooner. Caveat Emptor: If the USB port simply cannot supply as much current as the device requires over a sustained period, neither of the two solutions below will do you the least bit of good. The resets will continue, at best with a longer cycle than 35 seconds, and at worst even faster because the capacitor charging trips overcurrent protection. Simple solution: Hefty capacitor between +5V and GND lines. Start with a 4700 uF 12 Volt electrolytic (just because those are common enough, and inexpensive). If that doesn't work well enough, keep adding more. More complex solution: An inductor-capacitor combination: Two hefty inductors, say 100 uH 1 Ampere each (just because those are common enough, and inexpensive), on the +5V and the GND lines, followed by a capacitor between them. simulate this circuit – Schematic created using CircuitLab The inductors will slow down the inrush current spike when the capacitor is charging up at power on. This prevents the USB port from going into overcurrent protection / reset.
H: Why are vacuum tube filaments internal So, I'm a little fuzzy on vacuum tube designs, but I am under the impression that some use the filament directly as the cathode, while some use the filament to heat a plate which is the cathode. Since the filament is what burns out on a vacuum tube (I am aware of sputtering, but that failure takes longer to happen), why aren't tubes built with an external, replaceable filament? Furthermore, why do filaments actually burn out as often as they do? Toasters, for example, seem to have a very long lifetime, and their filaments are in air. AI: Some tubes use directly heated cathodes. The filament is called the 'heater' in tube land and the part that the electrons are emitted from is the cathode. (The term 'plate' is reserved for the anode where the electrons are collected). Most use indirectly heated cathodes, which allows heating with AC. I have seen a lot of heaters made with very fine filaments with an oxide coating, usually barium oxide. The oxide is fragile and it evaporates over time and leads to the burnouts or shorts. In some heaters the filaments are packed into a small space and go back and forth and heat a cylinder of thin metal with the oxide coating on the outside. Why the oxide? Tungsten has a work function of about 4.5 eV or electron volts. The electrons must have this much energy to escape the metal. To give them the energy, the heater is run very hot, like 2700C like a light bulb. With the oxide coatings the work function is about 1.1eV. The energy of the electrons in the heater goes up with temperature exponentially. So, getting really hot makes a big difference. But so does reducing the work function and running at lower temperature which uses less power and extends the life. At 1.1eV the heater can be a dull red heat instead of light bulb white. Heaters are not replaceable because the glass tube is sealed at both ends (or a sealed metal can for some devices) and maintains a hard vacuum. In fact, after as much air is removed with a vacuum pump, the tube is sealed and a "barium getter" is heated electrically to react with any remaining gasses. The result in a very good vacuum. A side-effect makes the mirror-like spot on the side of the tube. A toaster needs to produce heat, like 1500 Watts, so a large wire is used and a lot of current. The tube needs to have a hot cathode which can be very low mass and is in a high vacuum. A fine tungsten wire will get hot with less current and consume less power. But it will also be easier to damage with heat and vibration. Direct heated tungsten was used until about 1930. Tungsten with a little thorium in it was found to have a lower work function and was used until the barium oxide effect was discovered.
H: Breadboarding a Raspberry Pi Ok, long time reader first time asker on this parcticulair stack-exchange. I am rather new to electronics, I've done some simple projects like Blinking Lights, alarms that go on when its dark and a Joystick Gamepad (with Arduino). However, I am experianced in system programming, I've written a bootloader (x86) for fun, read assembler language for a living and have hacked some code for kernel modules. For my most recent projects I got rid of the arduino and used a breadboard to build the entire board (same setup as the arduino though). I've created a project, got the breadboard prototype to work and now I am ordering a number of PCBs (seeedstudio) to get the real prototype going. While I am waiting for these boards and the components to arrive I've started a project with the RaspberryPI, created a embedded linux for it and I've been playing with the GPIO. Now I wonder, how hard is it (and what is required) to breadboard a raspberrypi so I can eventually also get my own boards created for beefier projects. TL;DR) What should I learn about before I can assemble a RaspberryPi on my Breadboard? As I can't imagine it is as easy as breading the Arduino Note: I've read, http://arduino.cc/en/Main/Standalone AI: I've been dabbling in electronics since the 1970s and had products used in nationwide broadcasting chains, reviewed (sometimes favourably!) in hi-fi magazines and (possibly soon) headed into orbit, and I would still consider breadboarding a Raspberry Pi a major project. Find a middle ground : take a look at an ARM CORTEX CPU running at 50 or 100 MHz and learn to use that. Then when that is second nature, consider taking another look at the Raspberry Pi (or whatever has replaced it in the meantime). A good starting point is the TI Launchpads (Stellaris, now Tiva) or Hercules for 100 MHz and high-reliability hardware. Or similar processor devkits from ST Micro or NXP. When you grow beyond the Launchpad board itself you will have experience with a more advanced CPU system than the traditional Arduinos, and it's in a package which is much easier to breadboard than the Raspberry Pi. (And at this level, "breadboard" really means layout your own PCB). You won't even get a datasheet for the R-Pi's processor without serious negotiations (probably involving six digit numbers) with Broadcomm. Alternatively, use the R-Pi as a component - a complete subsystem in your design that removes the need to repeat a LOT of engineering and lets you concentrate on your specific application; focus on what makes your hardware + software app unique.
H: Active high and active low in IC I am using an alu SN74ls181 . I am unable to figure out how active high and active low are decided . Is it during the manufacturing or some circuit parameters decide if the circuit is active high or low. AI: The chip does not care, it reacts to voltage levels, not to logic signals. This chip has two tables that describe the logic function it implements. The first one shows the functions when YOU define low = 1, high = 0: The second table describes the same logical circuits, but now using the (common) convention high = 1, low = 0: To illustrate the point, look at the last-but-one row, second column. In the first table (active low logic) it states F = AB, which is the math notation for the AND function. In the second table the same entry states F = A + B, which is the logical (inclusive) OR function. This all makes perfect sense: the common OR port IS AN AND PORT FOR 0's.
H: What might cause audible noise in an inductive charging system? I have a pair of Qi-compatible wireless charging pads, and I've noticed that when a device is charging, the pad will emit a quiet but noticeable squeal in a relatively high frequency range. Perhaps it's because the pads sit on my desk near my bed, that I notice, but I'm curious what might be causing the squeal and if there's anything I can try to mitigate it. AI: Wireless charging pads work by inductive coupling. In the pad is a coil, and in the device being charged is another coil. When these coils are close together, they have a high mutual inductance, and we can use this mutual inductance to transfer energy between them, as in a transformer. simulate this circuit – Schematic created using CircuitLab The trouble is this: an inductor is also an electromagnet. As the current oscillates in the coil, the magnetic forces also oscillate. These magnetic forces act on the individual turns of the coil itself and ferromagnetic materials nearby, causing audible vibration. Magnetostriction can also play a role. Besides the charging coils themselves, there are probably more inductors in the circuitry that converts the 60 or 50 Hz mains AC to the higher frequency shown here. I don't know that there's much you can do to mitigate this noise, other than remanufacturing the device. You might try setting the charger on a neoprene or rubber pad, which might at least prevent some of the vibration from coupling into your table. The better solution is usually to move the oscillation frequency above 20 kHz where it can't be heard by humans, or to more solidly support the coils so they can move less.
H: How to do a DIY LCD output from a busted android tablet? I have a cheap android tablet with a busted screen. Replacement screens cost more than a new tablet and I hate to waste it since it's only a few weeks old. I took it apart and it runs on a Allwinner A13 ARM chip. The LCD section of the data sheet doesn't seem all that helpful. Is there any way to get a VGA output from the chip? I see the chip has LCD pins for vsync and hsync but I'm lost after that. Is this a reasonable project to take up or should I just throw it out? AI: To make my comment an answer: I would advise you to throw it out. A $100 phone might have been worth the replacement parts and repair effort, but not a $35 phone.
H: noise caused by square wave signal I am using electronic switches to create non-TTL square wave clocking. The oscilloscope graph demonstrates two measurements: Yellow signal: 0-8V Blue signal: 0-5V As you can see, yellow signal is contaminated with small voltage jerks every time the blue signal goes high or low. I use microcontroller to drive DG642 switches, which in turn output high/low voltage; the schematic below represents the connections. The power of +5V and +8V comes from independent power supplies. Connecting 10uF bypass caps to pin(1) of each switch does not help. Why does such signal contamination happen and how to fight it? AI: Crosstalk such as this can be caused by many things. Among them: noise on the power rails mutual capacitance mutual inductance Moreover, your scope probe is susceptible to these things also. Depending on exactly how you attach the probe, what kind of probe, what kind of scope, where the cable is lying, etc, you change the circuit, and thus its behavior. In particular, when the scope's ground connection is far away from the tip, this adds a lot of inductance to the probe. Here's a very common solution: What is the name of this springy type oscilloscope probe accessory? The solution to this sort of problem (if there is indeed a problem, and not a flaw in your measurement technique) is a combination of careful layout to reduce unintended capacitive and inductive coupling and provide clean power rails, and making components tolerant of the noise that remains.
H: "two bypass/decoupling capacitors" rule? I found many discussions on bypass capacitors and their purpose. Usually, they come as a pair of 0.1uF and 10uF. Why does it have to be a pair? Does anyone have a good reference to a paper or an article, or could provide a good explanation? I wish to get a little theory on why TWO and the purpose of EACH. AI: http://www.ti.com/lit/an/scba007a/scba007a.pdf You'll see the big capacitor referred to a "bank" or "bulk" capacitors. The smaller ones are of course also "bypass" capacitors. The basic idea is that, in the real world, the parasitics of a capacitor aren't ideal. Your "bank" capacitor will help for transient power draw (changes in real current change) but, due to real world issues, if RF noise (EMI) gets on the line, the smaller bypass capacitor will let that noise short to ground before it gets to your IC. Additionally, both of these capacitors will be helping to suppress switching transients as well as improving intercircuit isolation. Even though the physics is the same, the terminology is altered to their function. The "bank" capacitors "provide" a little extra charge (like a charge bank). The "bypass" ones allow the noise to bypass your IC without harming the signal. "Smoothing" capacitors reduce power supply ripple. "Decoupling" capacitors isolate two parts of a circuit. So, in practice, you put a bank cap next to a bypass cap and there's your 10uF and 0.1uF. But two is just arbitrary. You have some RF on your board? Might need a 1nF cap, too. A simple example of realworld impedance can be seen in this picture. An ideal cap would just be a large downward slope forever. However, smaller caps are better at higher frequencies in the real world. So, you stack TWO (or THREE, or HOWEVER MANY) next to each other to get the lowest total impedance. I have, however, read dissenting opinions on this, saying that the self resonance between the two actually creates a HIGH impedance at certain frequencies and should be avoided, but that's for another question.
H: What is the schematic capture/PCB layout design cycle? Is there somewhere a description or flow-chart of the process of designing a circuit: Requirements analysis, schematic capture, simulation, PCB layout, etc. as well as various checks? Something especially for PCB design, and not so much about IC layout please. AI: Agree on functional operation and performance specifications Start designing the hard bits first and use a simulator Make sure parts are available Go back to (1) if the task is impossible and redo the spec Start integrating the simulations to ensure different sub-systems of the circuit work together Go back to (1) if the task is impossible and redo the spec Start developing the schematic that is your definitive circuit Choose the rest of the parts and make sure the footprints you have are double-checked or have been successfully used before on previous PCBs Start designing the PCB and if can't be done in the space available go back to a relevant earlier stage such as (1) or (2) Complete layout and if you have the tools, and is deemed necessary simulate the effects that might make the circuit layout problematic such as when designing RF stuff. If PCB has to meet safety creepage and clearance requirements then get it double-checked Order PCB, order parts, get prototype built Test it to spec agreed in (1) - this could involve many many tests and there are probably reams of information that could be said here but space and time limits me! Go back to relevant earlier stage if specifications are not met. This is usually called Design verification Create/modify the production documents including a production test spec For first run of production, ensure Design is validated (extra special care to make sure results are exactly as verification results and if not go back to an earlier stage) Hopefully, by the time you get to this point you'll have a pretty good design. Your PCB is fundamental to the schematic despite it never appearing on it (well maybe fixing holes etc). The PCB touches every single electronic component in your design - very important to do the job to what was agreed on day 1 (or amended via the process). I'll also add that this is just off the top of my head and, there are plenty of variations on this such as when designing specifically for an end user - obtaining customer approval at several points along the way is a necessary part of the process and this should be agreed up-front. Also, some products require 3rd party independent testing to "prove" they comply with regulations such as EMC, safety etc.. Between #5 and #6 it is worth mentioning that bread-boarding certain parts of the design may be done where it is felt that the simulation may not give the full picture. This is definitely not uncommon and, designing a PCB just to rigorously test certain parts of a design, is a valid step along the way even though the bread-board/PCB may never get used on the "real" job. Before #15 you should also start to consider (when production run quantities are not trivial) placing orders for production parts taking into account lead times. You should also be starting to think about any special test fixtures that need to be introduced and doing this in enough time so that the first proper production run is not delayed.
H: Minimum voltage for DC amplifier Based on Detecting a low pulse from an electromagnet induction, I was planning to amplify a DC sine/sqaure wave, however the peak is less than 50mV. What is the smallest voltage peak that can be amplified using a DC amplifier? AI: There is no real limit to amplifying even a sub pico-volt signal. Whether you can extract that signal from noise is a different matter entirely. The noise can be already present on your signal or, it can be added by the amplifier. For op-amps there are a couple of numbers in the data sheet that describes how much the amplifier adds noise. Voltage noise density describes the effective power per hertz of bandwidth. A reasonable op-amp will have a figure like 10 nV per \$\sqrt{Hz}\$. This may seem confusing but if you square the voltage noise density and reference it to 1 ohm it becomes power per hertz. If you have a signal that can occupy a bandwidth of 20 kHz (i.e. audio) you take the square root of 20,000 (equals 141) and multiply that by the 10nV (=1.41\$\mu\$ volts). This is the equivalent RMS voltage at the input to your amplifier. If the amp has a gain of 1000, then the output noise is 1.41 milli volts RMS. To get a reasonable feel for this as a peak-to-peak signal, multiply it by 6.6. Why 6.6? It's all about the density of noise being gaussian in nature and multiplying by 6.6 means you have applied 6.6 standard deviations to a random signal in order to predict what the extremes are (within a confidence level of 99.9%): - Another pointer to noise in the op-amp is low frequency peak-to-peak noise. It is specified differently to voltage noise density (above) because it is a different noise source. Normally this covers the frequency range 0.1Hz to 10Hz and is specified in \$\mu\$ volts p-p. If your frequency band of interest covers this area it has to be taken into account. Current noise density is like voltage noise density except it defines what the bias current noises are from the input transistors. To convert to an equivalent voltage it is multiplied by the (external) source resistances in and around your input circuits. And finally (probably), there is the noise of the resistors themselves. This is nothing to do with your amplifier. The voltage noise of a resistor is: - \$\sqrt{4\cdot k_B\cdot T\cdot R\cdot \Delta F}\$ Where \$k_B\$ is Boltzmanns's constant T is absolute temperature in kelvins R is resistance in ohms \$\Delta F\$ is the frequency range you are interested in. For a 1k ohm resistor at normal ambient temperature (300K) it will produce a voltage noise density of about 4nV per \$\sqrt{Hz}\$. And after you've calculated the three noise densities (voltage noise, current noise and resistor noise) you can add them all together by using \$\sqrt{A^2 + B^2 + C^2}\$ to get an equivalent input noise. I always treat the 0.1Hz to 10Hz noise as a separate entity and don't mix it in with the three noise densities just mentioned.
H: Making passive speakers louder Just bought some passive waterproof speakers to be ceiling mounted in the bathroom. They're 80 watt, 8ohm, pretty bog standard. The problem is this - when we have e.g. an iPod plugged into a cheap Bluetooth speaker via a 3.5mm audio cable, it produces an acceptable volume. However, when we connect the wires for the bathroom speakers into a headphone jack and plug this into the iPod, it is considerably quieter, not really loud enough at all. The speakers certainly have enough power, so is there something else causing the issue here? Could e.g. the Bluetooth speaker have an inbuilt amp, hence why that is loud enough? The speakers were only cheap, so we don't want to go spending loads on an amp - plus there's the issue that if we needed an active amp, that would mean messing about with batteries/power cables in the attic, which is a lot of hassle. Are we just best to return them or is there a simple solution here? We'd want to be able to play the speakers from a 3.5mm jack so that we could connect it to phones/iPods etc. Any help/advice much appreciated, thanks. AI: Headphones jacks aren't intended to drive speakers directly. Headphones differ from loudspeakers significantly in two ways: headphones typically have substantially higher impedance, some hundreds of ohms, compared to the typical 8 ohms of a loudspeaker. headphones, being right next to your ears, need substantially less power to achieve a suitable volume. To solve this, you need an amplifier somewhere, one intended to drive loudspeakers. No way around it. An iPod (and likely any other device with only a headphone jack) can simply not output enough power to drive loudspeakers without help from an amplifier designed for that purpose.
H: How to gauge resistance on parallel circuit with step down buck regulator I'm trying to create a circuit with two loads in parallel ( essentially piggy backing one circuit on the power supply of the other ). Circuit 1, the main circuit requires ~900ma at 12v. Circuit 2, requires ~70ma at 5v. To step down I'm using a buck regulator that provides 300mA at 5v. The main supply is 12v DC rated for 900mA, but in reality is providing more like 1.3A. If I connect the circuits in parallel without balancing with resistors, all the current flows through circuit 1 ( its load will consume all available current ). Now, correct me of I'm wrong, but I think I should add a resistor to each of the two circuits to manage current. So circuit 1 should get 12v / 0.9a = ~13 ohm. For circuit 2 though, I'm umsure how a buck regulator functions in this context. Should I add a 70 ohm ( 5v / 0.07a ) resistor after the buck regulator, or a 170 ohm ( 12v / 0.07a ) before the regulator. Or would both have the same effect? Or perhaps I have it all wrong, so any advice appreciated. Pseudo circuit attached: ======= UPDATE 1 ======= Circuit 1 is a terminal for a scale unit. So logic board, power to a high capacity battery and a display, and excitation for the load cell itself. All encapsulated. Circuit 2 is a rs232 converter and bluetooth chip. I took the 1.3A reading across Vin and Gnd with just the terminal and buck converter in parallel. I'm not sure how to resolve this difference, essentially the DC transformer supplied with the terminal is rated at 12V 900mA so that was my assumption on the load of the terminal. I thought 70mA was probably not going to go missing. ======= UPDATE 2 ======= Based on Peter and Photons advice, and the discovery that I had misused my multimeter and blown the circuit by connecting the two probes in parallel (across the circuit) and not in series, I have now managed to connect everything up correctly and it works fine (as per the diagram with no additional resistors). I'm not sure what the actual load from Circuit 1 is until I replace the multimeter's fuse, but it is less than the 900mA the supply is rated for, so the addition of ~70mA on Circuit 2 is not a problem and works fine. AI: You said you measured the 1.3 Amps across Vin and GND. This is NOT the way to measure the current capability of a power supply - it does give you the short circuit current, but that is usually not a useful value. If the existing power supply claims to be 12 volt and 900 mA, you should believe that current rating, and not attempt to draw more currrent. To measure current, you must connect your meter in series with the circuit - you break the circuit to do this. You should measure the actual current drawn by the 12 volt load. If it is less than 900 mA, then the difference is the current you have available to power your step-down converter. As others have said, the 300 mA rating of the stepdown converter is the maximum it can supply, not what it will actually draw. Since the stepdown ratio of the converter is 5/12, we can expect the current drawn from the 12 volt supply to be a bit more than 5/12 of the load current - perhaps 35 mA. (As a rough approximation, we can assume that the power into the converter equals the power out, plus some losses in the converter.) The total current drawn from the 12 volt supply will then be whatever you measure for the scale, plus the 35 mA or so for the step-down converter and 5 volt load.
H: Is there a difference between TI brand of the 74HC595 and the NXP brand? I have been trying to figure out the functional differences between TI's version of 74HC595 and NXP's version. I've been looking at the function tables in the datasheet for TI and the datasheet for NXP but am having a hard time determining if the function tables are equivalent. They have the exact same number of states and seem to be very similar. The confusion is arising from the fact that some values that are L or H in one table are X in the other table and that TI's version is missing the output columns. If someone is able to figure out if these two chips are functionally equivalent, i.e., they do the same thing given the same input signals, I would appreciate some help. Thanks. AI: When it comes to these sorts of logic ICs, if you match the part number you'll match functionality. So, a 74HC595 from NXP should 'work' the same way as a 74HC595 from TI. The pins are given different nomenclature by the manufacturers, but they do map 1:1 between the ICs. If there were a functionality difference, then there would be a corresponding change to the part number: Consider the difference between a 74HC595 and a 74F595 - both do the same logic function, but the underlying technology of the IC is difference (HC is high-speed CMOS, F usually refers to Fast which generally implies Schottky construction). There can be differences in timing and logic voltage levels as you change technology. Consider the difference between a 74HC595 and a 74HC596: the 595 is what you're using (8-bit shift register with output latches, three-state parallel outputs) whereas a 596 is slightly different (8-bit shift register with output latches, open-collector parallel outputs). Of course, even with the same number, there likely is very minor variations between them. The fundamental functionality and speed will be compatible and unless you're really pushing the limits of the IC, you should be able to substitute with confidence. (That being said, always test!) The timing diagrams should clear things up:
H: Is there a standard reference designator to use for labelling indicator lamps in schematics? In a schematic, LEDs typically are labelled using the letter 'D' since they are diodes. From what I can tell, it seems that there is no standard for labelling indicator lamps (e.g. small incandescent bulbs) in a schematic. My question is: is there a letter that is typically used for labelling indicator lamps in schematics? Or is there any published standard which defines the "proper" labels to use in schematics for indicator lamps? AI: In fact there is a standard: IEEE Std315-1975 Graphic Symbols for Electrical and Electronics Diagrams (Including Reference Designation Letters) The standard specifies a reference designator of "DS" for a "general light source", "lamp", and "signal light". It has the same reference designation for "light-emitting solid-state device", by the way.
H: What do peak-to-valley and mm/µV mean? I was reading a document where it says Adjust the signal generator to apply a 1mV peak-to-valley input 6Hz triangular signal at a gain of 0.001mm/µV. What does peak-to-valley mean hear? Is it same as peak to peak? And, what does mm/µV mean? AI: Peak to valley means the highest point of the signal to the lowest point. It's a little like peak-peak except that it implies a DC bias so that the "negative peaks" don't cross 0V, so valley is a better name for them. mm/µv means millimetres per microvolt, or metres per millivolt. What THAT means depends on context you haven't given us, but for example, mm may refer to the signal amplitude on the display of a REALLY SENSITIVE oscilloscope (or an oscilloscope driven from an amplifier).
H: Auto-ranging voltmeter circuit with PIC uC ADC I want to design an autoranging voltmeter with a PIC microcontroller and its ADC. Requirements: Measure voltages from +0.2v to +50v Protect against reverse inputs or slightly higher voltages Input impedance can be quite low, drawing up to a few mA. Accuracy of around 1% or better (although not necessary for smaller voltages) Sample time of around 0.5ms or better I have a circuit in mind, and would appreciate feedback. Perhaps there are simpler circuits I could use. The PIC will be on a 5v supply. I would probably use a basic, cheap op-amp running from 0v and a +12v rail. The tristate uC outputs would either set the input voltage dividers or alter the gain of the op-amp circuit to higher than unity. simulate this circuit – Schematic created using CircuitLab Does this look reasonable? AI: I'm not 100% on this but I think most PIC ADCs are 10 bit (1 in 1024 resolution) but can have up to 10x LSBs inaccuracy - this means you're just about at the 1% accuracy stage without considering resistor accuracies. Using PIC outputs as pull downs isn't a good idea either because there will be leakage currents from the pins that will add/subtract a voltage from the signal via the resistors. Also, you appear to be relying on PIC outputs going exactly to ground but neither is this the case and your accuracy on the lowest range will be dented. Also, I think the zener won't be needed because R1 will limit current into the op-amp and it will self protect - 50V across 50k gives 1mA and most op-amps are capable of dealing with this sort of current using their internal diodes. I'd run the op-amp from 5V too - this means there's no chance it can stuff a killer voltage (6V or above) into the PIC ADC pin. Use something like an AD8605 - it is rail to rail but, because you can't exactly achieve 5V, scale things down by 10% and restore in the CPU with a frig-factor. Having an op-amp that is self-protecting (due to the 50k) means negative voltages are also protected against but read the data sheets on the op-amp to be absolutely sure. If you still think you need the zener, consider that a zener will be starting to draw current at voltages significantly below 5V - it isn't an on-off thing as soon as you hit 4.99 volts.
H: GPS USB device with external coax antenna? I've been looking around for a bit searching for a USB connected GPS reciever which i can hook up to my laptop. However, the building i'm sitting at is not ideal for recieving GPS signals but i do however have a antenna tower ontop of the building which i could mount a GPS antenna to, but that would require a long coax connector since the USB cable is not suited for ~300m of wiring through a building. Anyone know of a good USB-GPS-reciever that has external antenna support? I simply can not find any (pref if it's supported by gpsd in Linux). This is what i've found so far: http://www.usglobalsat.com/p-688-bu-353-s4.aspx Thank you in advance. AI: You're right 300m of USB cable is not suitable, and neither is coax from a practical point of view because even something like LMR-1700 will give you about 17dB of loss over that length. That grade of coax is normally over $10 a meter so you'd have to drop thousands on suitable cable. You'd be better to place the receiver, antenna and a power source close to outside and transmit the data back in a digital form. RS-485 would be one robust choice for a point-to-point connection but considering how large the building is maybe you already have network infrastructure in place? In that case maybe consider a small Linux SBC that transmits data back over the existing network.
H: Which electronic parts/systems are responsible when installing an OS to an empty PC? I´m wondering there must be some already commands inside a computer to be able to install OS such as Windows. Somewhere there must be a programmed chip or something. Is that DOS? Any introduction link about this appreciated. AI: This is not a electronics question, so I'll be brief since it will likely be closed. What you are really asking is how a computer boots up. For a typical PC, this is done by a small stripped down OS called the "bios" stored in non-volatile memory. Go look it up.
H: Identify which face of a cube is up I have a device whose shape is a cube and I need to identify in real time which face is up. My current solution is (not yet implemented) is to use a gyro to get angular variation, but I can see 2 problems: Which face is up when the cube is "powered up"? We can't assume that every 90° variation will change the face standing up. If is a variation in the "world" Z axis, the face remains the same. But the "world" Z axis is not equals to the gypo Z axis. There is any way to accomplish this? AI: A gyro won't tell you anything useful, at least not the kind of electronic gyro you can afford. It sounds like what you want is an accelerometer. One for each axis lets you find the complete acceleration vector, which will be just gravity when the cube is still. There are units with three accelerometers, each orthogonal, integrated into one device. Search for "3-axis accelerometer". If the cube is being jostled about, the acceleration vector won't point exactly up, but mostly it will. Unless someone is deliberately whacking this thing or tossing it around, the acceleration vector will point upwards well enough. You can even detect the in-flight case, since the acceleration vector will be zero then.
H: How do I size fuses to handle sudden changes in AC line voltage into a capacitive load? Suppose I have a rectifier on the AC line, followed by some caps and a load. simulate this circuit – Schematic created using CircuitLab If the AC line is suddenly increased, there's a current surge into the capacitor. This can happen when power is applied, during a line surge, or when recovering from a line dip. A precharge circuit can help with power application, but it's less helpful after a dip. The only things limiting this current surge are the impedance of the circuit components and lanes, ESR of the cap, and inductance of the AC line. The line inductance looks like it should dominate. So there's an LDC circuit between the line inductance and the cap. It's like a tank circuit, except it looks like you'll only get one pulse out of it instead of a decaying ring wave. But there, I'm stuck. How do I compute the peak and width of the current pulse into the caps, so as to size my fuses appropriately? AI: The first approximation for the fuse size is to make sure the steady-state current draw is not greater than the maximum no-blow current for the fuse. The next step is to ensure that it is sized to protect against fire / explosion if there's a hard abnormal in the circuit. For example, a safety test for your product would be to short out the capacitor after the bridge and apply the maximum specified AC input. The fuse should blow without the diodes burning / rupturing / emitting smoke or debris. Once your fuse is appropriate from these perspectives, you can do your line drop tests and see how well the fuse performs. If you find nuisance blows, bear in mind that if you increase the rating or decrease the response time (go from fast to slow-blow, for instance) you'll need to repeat your safety test to make sure it's still appropriate from a safety perspective, and may need to beef up other components in the circuit to make sure the fuse blows first.
H: What is the difference between a transformer and a coupled inductor? Transformers and coupled inductors seem very similar. Is there a difference in construction? Or only in use? This question asks something similar, but the answers don't address my question: Coupled inductor vs an actual transformer? AI: The two are basically the same class of device, although each will have parameters optimized differently. The two names are to explain the different intended usage, which also gives you a quick guess of how some of the parameters may differ. Of course only the datasheets would tell you what the parameters are for sure. A transformer is specifically intended for transferring power from one winding to another. You want the coupling between windings to be as good as possible, the leakage inductance zero, and the absolute inductance of each winding with the other open is often not a large concern. With coupled inductors, each winding is still used for its inductance alone, although of course some coupling is being utilized else there would be two separate inductors. Generally leakage inductance is less of a issue. In fact, it can be useful to have some minimum guaranteed individual (non-coupled, or leakage) inductance for each winding. The absolute inductance of each winding with the other open is also a important parameter that will be well specified.
H: Powering high power LED modules/plates (series parallel internally)? I am trying to build a high power RGB LED light. I am looking for 50W-100W range for the LED (all colors combined). 100W RGB LED desn't seem to exist so I am left with 50W, 60W, or 90W options. I would prefer higher wattage single LED module as it's cheaper than multiple lower wattage modules. There is a suitable 90W LED module. There is no datasheet only this spec: Voltage: R: 20~22V; G: 32~34V; B: 32~34V; Current: R: 900mA; G: 900mA; B: 900mA; Product size: 45mm x 51mm; Power: 90W; Wavelength: R: 620~625nm; G: 520~525nm; B: 460~465nm; 10 series and 9 in parallel; I heard that for LEDs in series/parallel you need some additional components for current sharing etc... Do these LEDs have the required circuitry built-in making them essentially the same as a single LED in respect to powering them? Or do I need a special LED driver to power this module? Reason I am asking is because most LED drivers don't mention any specifics about series/parallel LED but I did recently see an LED driver with PWM control that specifically mentioned it's application was for LED module 1 x 50W multichip(10 Series x 5 Parallel). Does this driver have special circuitry or is it just a suggestion for what it can be used? What do I need to look for in an LED driver in general other than constant current, min/max voltage range and power rating to be equal or lower to that of the LED. (For the 90" RGB LED, each color would use it's own 30W driver). AI: If a module has only two terminals, but has some parallel LEDs internally, you can probably assume there's something inside the module to balance the current between each parallel circuit. This is made somewhat easier when all the LEDs are in one module because they can share a heatsink, and thus the temperature of each is likely close, and temperature variations are a big factor in why parallel LEDs will not share current equally. Each LED was also likely manufactured at the same time, so have very similar characteristics, which you can't guarantee when taking discrete LEDs out of a jar. The module may also include some small resistance in each parallel circuit to help balance. Point being: assume the manufacturer has taken care of this, and all you need to worry about is supplying the correct current to the two terminals provided by the module. Your particular module is really like three modules, one for each color. It looks like there is one common terminal on the bottom, and three separate terminals on the top, one for each color. I can't find a datasheet that specifies if the cathodes or the anodes are common, so you may have to figure it out for yourself. It looks like maybe you can cut the common terminal apart if you want, but again, I see no datasheet, so you might have to experiment for yourself. There is no special kind of LED driver that can drive parallel LED circuits. If an LED driver's job is to pump electrons, there's no way for it to tell some electrons to go down one circuit while telling others to go another way. The electrons decide which way to go by going whichever way minimizes their potential. So, what you want to do with this module is power each of the R, G, and B sub-modules with a suitable driver (or if you can find it, one box that actually has three drivers in it). What you don't want to do is try to put the R, G, and B sub-modules in parallel and drive them all together. Since each color has a different forward voltage, this won't even remotely work: the color with the lowest forward voltage (red) will take very nearly all the current and all the power, and possibly be destroyed. At best you just won't get the other colors to light.
H: What is the percent impedance of a typical residential power line transformer? Power transformers are rated by percent impedance. A 5% transformer, when loaded to full spec secondary current, will show a ~5% deviation from nominal output voltage. What is the percent impedance of a typical residential power transformer, and why is that the typical value? Or is there a typical answer? AI: I can't speak to American/ANSI standards, but in Australia we use AS/NZS standard 60076.5-2012 Power Transformers - Ability to withstand short-circuit as a guideline for the absolute minimum impedance of power transformers. Note AS/NZS 60076.5 is equivalent to IEC 60076.5. Table 1 of that standard gives absolute minimum percent impedances for various transformer sizes. I cannot reproduce the entire table, but the relevant part for you is: Table 1 - Recognised minimum values of short circuit impedance for transformers with two separate windings Short circuit impedance at rated current Rated Power (kVA) | Minimum short circuit impedance (%) ------------------+------------------------------------ 25 - 630 | 4 % 631 - 1,250 | 5 % 1,251 - 2,500 | 6 % ... | ... Noting that most residential transformers will be in the 200kVA - 2,500 kVA range. (Pole top transformers can be as large as 500 kVA; past that, up to 2,500 kVA, they tend to be pad-mount on the ground.) Why are these the typical values? The reason this information is found in the standard about "ability to withstand short circuit", which is an odd place to find it, is because the transformer impedance is important in limiting the current through the transformer under fault conditions. A minimum impedance limit implies a upper limit on the through-fault current, hence a limit on the maximum energy dissipation and dynamic force under fault conditions. The maximum energy dissipation and dynamic forces directly influence the design of the transformer. For instance, AS60076.5 mandates that the transformer must be able to withstand two seconds at maximum through-fault current without sustaining damage from heating, so the conductor thicknesses and so forth must be chosen to accomplish this. At a guess, the exact values found in Table 1 were chosen because it was found (experimentally) that these were the lowest impedances it was possible to specify, while still having a sufficiently reliable and robust transformer. Can transformers be ordered with "non standard" impedances? Transformers can be ordered with a different impedance than the minimum set forth in AS 60076.5, which is only a suggestion. It is common to order transformers with a higher impedance, so the fault levels on the LV system are reduced. I have seen 2,500 kVA transformers ordered with impedance of 12%, which is double the minimum standard impedance, for fault limiting purposes. It is not common to ask for a transformer with less than the standard impedance, as such a transformer will have a very high LV fault level, which is bad for equipment and personnel safety. Additionally, the high fault level will tend to make the transformer self-destruct under fault. As such, transformers with less than minimum impedance would only be ordered if you really knew what you were doing, and you were willing to waive some of the fault-withstand requirements set forth in AS60076.5.
H: MOSFET specification help I am designing a system that uses a large amount of power. The MOSFET will be to turn off the batteries when mains is in use. The FET will therefore be on or off. No pulsing. The voltage will be between 34.5V and 20V with about 30A max of current draw. Can someone please explain what I need to look at when choosing the correct FET or if there is a better solution. The driver IC I am planning to use is the LTC4414. Any help or recommendations are more than welcome. I know that I need a P-channel MOSFET But I am unsure of what specs I need to actually choose one. simulate this circuit – Schematic created using CircuitLab AI: Three important requirements come to mind. MOSFETs can withstand only so much drain-source voltage without breaking down. You need this to be at least your supply voltage, plus a healthy margin for robustness. This will be specified in the absolute maximums section of the datasheet, usually as \$V_{DS(max)}\$ Each MOSFET has a different gate voltage at which it is designed to operate. If the gate voltage is too low, the MOSFET isn't fully on, and it doesn't conduct well as you want it to. If it's too high, you break the gate insulation and the smoke gets out. You will need to pick a MOSFET with a gate voltage compatible with the driver you are using. From a brief reading of the LTC4414 datasheet, it looks like this is -8V to -9V. Lastly, no MOSFET is a perfect conductor when on. The conducting channel has some resistance, and current through this resistance makes heat according to Joule's law: \$P=I^2 R\$. You need a MOSFET with a low enough resistance that the heat is manageable at the maximum current that will be drawn from your batteries. The MOSFET datasheet will usually specify a maximum current, but this usually assumes an unlimited heatsink. It's better to look at the resistance (\$R_{DS(on)}\$), calculate the losses, and perform an appropriate thermal design, given your room for a heatsink and allowable losses (which reduce battery time). Tangentially relevant fact: electrons have higher mobility than holes, so an N-channel MOSFET will have a lower \$R_{DS(on)}\$ than a P-channel MOSFET of similar die size and cost. Depending on your cost and performance requirements, you might want to investigate drivers that can drive a high-side N-channel MOSFET, or re-arrange your circuit to disconnect the battery on the ground side, where you can use an N-channel MOSFET, if that's acceptable for your application.
H: PCB - single battery design I've designed an analogue front end for EMG signals that I want to turn into a PCB. However currently it runs off of two 9V batteries which makes the end product quite large and heavy. I was wondering how I would go about changing my design (or components) to a single battery supply? Thanks! Here's a picture of the the design(I apologise about splitting the circuit picture it's too big to display as one!) I use TL072's for op amps and an ina129 for the instrumentation amp: AI: Do you actually need 18V differential between positive and negative rail? If the capacity of a 9V battery is sufficient, and you need 18V, then you could use a boost converter to generate 18V relative to battery negative, and then use the battery + terminal as "ground" and the - terminal as "-9V" and the boost output as "+9V." If you can get away with a smaller voltage differential, then you can use one positive and one negative voltage regulator to generate positive and negative output voltages from a single-ended voltage. You can also use a negative boost converter to get +9V and 0V from battery, and -9V from the negative DC DC converter. If your system is very low-current/low-power, then finding the right components and possibly designing the right switching converters, with low quiescent current, will likely require some hard work (but is totally possible.)
H: What is more accurate definition of Ohm's law? What is more accurate definition of Ohm's law and resistance? is it $$R=\frac {V}{I}$$ or $$R=\frac{dV}{dI}$$ This is doubt that developed in my mind during a class where professor derived power equation where he used second one for resistance in the derivation. I checked Wikipedia. They showed the first relation as accurate. Of course if the first relation is correct and resistance \$R\$ is constant, then we can use second relation. But what if resistance is not constant? For a practical problem, suppose my voltage source is current dependent and is given by $$V=I^2+2I$$ Then how will you find resistance of given circuit at a given value of current \$I\$? AI: This answer is probably inherently displeasing to the feeling of natural order for some :-) : A law of nature is simply a statement of observed results under defined conditions. Ohms law is essentially a statement that the ratio of the two two variables V & I is typically observed to remain approximately constant as the variables vary. It is arguably saying the opposite of what it may seem - ie not so much "R is the ratio between ..." but it is more "if the ratio between V & I is constant then we call this constant resistance" and "this approximates typical behaviour of a significant proportion of real world products". At any given moment R IS the ratio between V and I. If this ratio has changed then R has changed. So V/I never changes for specific values of V & I with all other conditions held constant, whereas dV/dI typically does change in the real world. So R = V/I is an accurate statement R = dV/dI is usually an approximation and where it all falls apart it just means that the observation does not apply under thos e conditions. That's woolier than I'd like but seems to convey what I'm trying to say. I hope :-).
H: Multiplexing and electric capacitance I'm working on a project, it's basically a hand-drawn paper keyboard based on capacitance. I was thinking I can multiplex the different lines with shift register (74HC595) and switch (4066), and as I've got a lot of these here I gave them a try. But apparently not... So I'm looking for a solution. I've already found that : Multiplexer for Capacitive Sensors (MUXC01) Can you confirm that this component could work or do you have any better idea about how to multiplex these keys ? AI: I get the problem. It's not related to the 4066 or anything. It's that good ol breadboard. I'm working with little capacitance difference and the breadboard itself have a capacitance. One or two connection, well that's ok, But I was having a long bus with at least 30 wires (so times 2 for pins connection) in series to connect the input of the AtMega328 with the 1M\$\Omega\$ to all the output of the 4066. The result was a big disturbance in the force ;) I've done a test on a board with the chip soldered, barely not problems. Will just have to split in two groups, but not a big deal as I've got plenty of inputs remaining.
H: What are the construction differences between a 1% transformer and a 5% transformer? I'm told that a 1% transformer costs more than a 5% transformer of the same power rating. I understand that the 5% transformer has higher output impedance, which seems to imply more windings and thinner wire. Is this the only construction difference between a 1% and 5% transformer of the same power rating? Or are there more considerations? AI: From ABB's Transformer Handbook, 3e: 3.9 Short Circuit Impedance Users have sometimes particular requirements regarding the short-circuit impedance. Such requirements may be determined by: parallel operation with existing units limitation of voltage drop limitation of short circuit currents The transformer designer can meet the requirements in different ways: The size of the core cross-section. A large cross-section gives a low impedance, and vice versa. A tall transformer gives low impedance and vice versa. For each transformer there is, however, a smaller range which gives the optimum transformer from an economic point of view, that is the lowest sum of the manufacturing costs and the capital value of the losses. The 'short circuit impedance' mentioned above is the transformer's percent impedance. The above quote says that the transformer's impedance can be varied by changing the construction of the core. Note that a transformers' impedance is mostly inductive "leakage reactance", i.e. magnetic impedance. Therefore, the difference between a 1% transformer and a 5% transformer is mostly to do with the design of the transformer's magnetic core. The 1% transformer would require much more iron core than the 5% transformer, and would be physically larger to match, which explains the higher cost. From J&P Transformer Book, 12e: In Chapter 1 it was explained that the leakage reactance of a transformer arises from the fact that all the flux produced by one winding does not link the other winding. As would be expected, then, the magnitude of this leakage flux is a function of the geometry and construction of the transformer.... Since reactance is a result of leakage flux, low reactance must be obtained by minimising leakage flux and doing this requires as large a core as possible. Conversely, if high reactance can be tolerated, a smaller core can be provided. The conductor resistance (i.e. copper winding resistance) is typically small, 1/10th of the total impedance or less. The guideline given in AS3851 is that power transformers of less than 10 MVA may be considered to have X/R = 10.
H: Apparent power in exponential form On page 2 of this PDF, a voltage source \$V= |V| e^{0}\$ is connected to a load \$Z = |Z| e^{j\psi}\$. Then, the apparent power is described as $$ P + jQ = \frac{ |V|^2 }{2|Z|} e^{j\psi} $$ However, I think the power should be $$ P + jQ = \frac{|V|^2}{|Z|} e^{-j\psi} $$ Where did the extra factor of \$2\$ and the positive \$j\psi\$ come from? Is this is a mistake in the PDF, or am I missing something? AI: The complex power \$S\$ is defined as $$S = P + jQ = \frac{1}{2}\vec V \vec I^* = \tilde{V} \tilde{I^*}$$ where \$\vec V\$ is a peak phasor voltage and \$\tilde{V}\$ denotes a rms phasor voltage; the relationship between rms phasors and peak phasors being $$\tilde{V} = \frac{\vec V}{\sqrt{2}} $$ Carefully note that the complex power is (proportional to) the product of the voltage phasor and the conjugate current phasor. Now, Ohm's Law for phasors is $$\vec V = \vec IZ$$ Thus, for a circuit element with impedance \$Z\$, the associated complex power is $$S = P + jQ = \frac{1}{2}\vec V \vec I^* = \frac{1}{2}\vec V \frac{\vec V^*}{Z^*} = \frac{|\vec V|^2}{2Z^*}$$ For \$\vec V = |V|e^0\$ and \$Z = |Z|e^{j\psi} \$, the complex power is $$S = P + jQ = \frac{|\vec V|^2}{2Z^*} = \frac{|V|^2}{2|Z|e^{-j\psi}} = \frac{|V|^2}{2|Z|}e^{j\psi}$$ See that, when we conjugate the impedance, the sign of the phase changes from plus to minus. Then, since the (conjugate) impedance is in the denominator, we factor out the phase by bringing to the numerator with yet another sign change from minus to plus.
H: Why does the voltage of a zener diode match the voltage at Vout? In this circuit, if: Vin = 9V Vz = 5V I understand that Vout will be 5V. Does that have to do with Kirchhoff's Voltage Law? How does the zener diode, if it drops 5V to ground, cause Vout to also be 5V? AI: Zener diode passes a lot of current (has low resistance) if the voltage is above Vz. So, connected in a circuit like in the question: If the voltage at the output was lower than Vz, the diode would not conduct and (if there was o other load, the voltage would rise. If the voltage at the output was higher than Vz, the diode would have low resistance and short out the output, which means that the voltage would drop (because of the resistor in series). So, the circuit reaches an equilibrium of Vout=Vz. If the voltage tries to go lower (a load is connected), the diode conducts less and the voltage rises back up to Vz. If the voltage tries to go higher (aload was disconnected) then the diode would conduct more and drop the voltage down to Vz.
H: Why don't hall effect current sensors exist for low currents? There do not seem to be hall effect current senors available for small currents, say on the order of 500mA. I'm guessing this is due to some technical or physical limitation. What is it? AI: Hall effect current sensors measure the magnetic flux generated around a conductor carrying current. As such, the sensitivity is limited by the noise floor due to extraneous magnetic "noise" in the vicinity of the conductor. This can be overcome to varying degrees by concentrating the magnetic flux due to the current carrying conductor, by a fairly simple means: Pass the current to be measured through a coil surrounding the hall effect sensor. For example, section 12.1 of the Melexis MLX91206 linear hall effect current sensor datasheet illustrates the use of a coil for measuring small currents: Low currents can be measured with the MLX91206 by increasing the magnetic field via a coil around the sensor. The sensitivity (output voltage vs. current in coil) of the measurement will depend on the size of coil and number of turns. Additional sensitivity and increased immunity to external fields can be gained by adding a shield around the coil. The bobbin provides very high dielectric isolation making this a suitable solution for high voltage power supplies with relative low currents. The output should be scaled to obtain the maximum voltage for the highest current to be measured in order to obtain the best accuracy and resolution. In practice, so long as the design can tolerate an inductance in the current path, the MLX91206 works well enough down to 100 mA current for full-scale output. When measuring supply rail current, this can actually be leveraged to added advantage by using the inductance for ripple suppression, "for free". Conjecture: It might be worth exploring whether a non-rectangular (toroidal) coil provides better extraneous magnetic noise attenuation than the rectangular form - perhaps even lower currents can then be measured.
H: adafruit rf m4 as a ground switcher I have a store-bought battery powered LED light assembly that is controlled by a microswitch. The light is installed in a hard to reach place so I wanted to hook it up to a cheap ASK wireless receiver with a remote. I bought the RF M4 (http://www.adafruit.com/products/1096) from adafruit. It's built around a PT2272. I didn't do enough checking on the light's circuit ahead of time and it turns out the microswitch in my light assembly is on the ground side. What is the cheapest way to make the RF M4 switch the ground for me? I was planning on powering the receiver circuit with a standard 9V battery which is within the specs for the chip. I was thinking a transistor circuit, but I'm not great at designing those. Just as a quick overview, the M4 receiver here puts out Vcc on the D2 pin when it receives the signal from the transmitter. I couldn't tell from the PT2272 data sheet (http://www.adafruit.com/datasheets/PT2272.pdf) if there was a way to get D2 to go to ground instead. Also, in my light assembly the only current going through the switch is the pulse for the switching circuit to turn the lights on. The LED current does not appear to go through the switch since the light stays on after releasing the momentary switch. I'm still a beginner so I really just don't know which way to go from here. AI: From the description of the microswitch function as provided, it seems the "microswitch" is a momentary pushbutton (as opposed to a toggle / DIP switch) connected between a pull-up resistor and the lighting controller's ground. If so, the solution for replacing the push-button functionality using the remote is simple. From the AdaFruit product description: The M4 momentary type acts like a push button - when the A button is held down, the matching pin goes high. When the A button is released, the matching pin goes low. The pins only go high when a button is pressed In order to use this momentary positive pulse to achieve the equivalent of the pushbutton momentarily shorting a pulled-up line to ground, a N-channel MOSFET can be used, thus: simulate this circuit – Schematic created using CircuitLab Explanation: When D2 goes high due to a button push on the remote, this causes the gate of the MOSFET to be driven high. The MOSFET thus conducts, acting as nearly a short circuit (a fraction of an ohm), similar to what the "microswitch" push-button does. When the button on the remote is released, D2 goes low, and the MOSFET stops conducting This schematic will allow either the pushbutton or the remote to switch the lights, as they are hooked up in parallel.
H: synchronous buck ls-FET switching losses and dead time minimization I'm designing a Synchronous buck converter. I'm having doubts regarding the following: In the rectifying period of the converter, using a Schottky diode in parallel with the low side MOSFET will prevent the body diode from conducting, and so it should render the switching losses in this FET equal to zero. However I would expect that while the LS-MOSFET is switching it would be conducting at least a bit and therefore some losses would occur. Can you explain this to me, everyone just assumes there are no switching losses and that's that... And plus, are there any problems if a Schottky diode isn't used? Minimizing the losses in the diode conduction period equals to minimize the dead time between the signals that control both MOSFETs. While testing for a small dead time, I took it too far and had both FETs short circuited (even though I calculated the switching times according to the gate driving current). Is there a procedure to find a small yet safe dead time for the complementary PWMs? AI: using a Schottky diode in parallel with the low side MOSFET will prevent the body diode from conducting Will it really? I see this a lot, and a naïve analysis would suggest so. After all, the forward voltage of a Schottky is less than that of the silicon PN junction of the body diode, so how could the body diode ever become forward-biased if the Schottky is forward-biased first? But this neglects that real circuits have inductance. Really what you have is this: simulate this circuit – Schematic created using CircuitLab (CircuitLab doesn't seem to have the appropriate Schottky symbol) Now say we set \$V_{GS} = 0V\$. The current \$I_{DS}\$ that was flowing in the channel now must find another path. It can go through the body diode, D1, or through the Schottky, D2. The path through D1 has a very small inductance, because the current path need move some microscopic distance. However, D2 is maybe some millimeters away, which has, even with the smallest SMT parts, many orders of magnitude more inductance. Thus, at least for some brief period after the MOSFET channel closes, current will go through the body diode. The additional inductance (L2) puts a limit on how fast current through D2 can rise, and since the voltage across L2 is clamped to the forward voltage of D1, less the forward voltage of D2, current can't rise all that fast. Sure, L2 isn't all that big, and you don't have to wait that long. But the whole point of this synchronous rectification is to avoid conducting through either of these diodes at all, so naturally you are going to make this time as short as you possibly can. In light of this, does adding D2 really do anything? Is there a procedure to find a small yet safe dead time for the complementary PWMs? I don't think there's any magic method. Measure accurately with a scope, and read datasheets carefully. Depending on what sort of gate driver you are using, maybe there are things you can do to make the gate switching delay smaller and more predictable. For example, if there are common-emitter BJTs in your gate driver, then you can use a Baker clamp. It's also common to design gate drivers to sink more current than they can source, so that turn-off is faster than turn-on. Or, you can measure the storage delay accurately, and compensate in software. You can also do things to limit the shoot-through current, including a resistance or small inductance in the path, for example. However, this works only to a point, since by introducing such a thing you are also introducing an additional loss.
H: Shift register m74hc165 connection I am following the following tutorial (http://www.arduino.cc/en/Tutorial/ShiftIn) to connect a shift-in register to my Arduino. In the tutorial they use a CD4021 'CD4021' shift register and I got a 'm74hc165'. After looking at the datasheet (http://www.datasheetlib.com/datasheet/735260/m74hc165b1_sgs-thomson-microelectronics.html#datasheet) I cannot figure out how to connect the following wires: Q8 (pin 3) to Ardunio DigitalPin 9 (blue wire) CLOCK (pin 10) to to Ardunio DigitalPin 7 (yellow wire) P/S C (pin 9) to Ardunio DigitalPin 8 (green wire) Mentioned in the tutorial in section 2. Can somebody help me with how to connect these three wires to the shift-register? AI: Comparing the two devices the basic difference is that the PL input (parallel load) is active high for CD4021 and active low for 74HC165 so you need to invert the digital state of the pin that drives it accordingly. The connection doesn't change from the one shown in the link, only the pin numbers. Also note that Q8 (pin 3) to Ardunio DigitalPin 9 (blue wire) is a mistype, it should say Q7 (pin 3) to Ardunio DigitalPin 9 (blue wire) Your connection for 74HC165 should be Q7 (pin 9) to Ardunio DigitalPin 9 (blue wire) CLOCK (pin 2) to Ardunio DigitalPin 7 (yellow wire) P/S C (pin 1) to Ardunio DigitalPin 8 (green wire)
H: How can a capacitor store charge whilst also passing current? It's frequently said that capacitors store charge. Just reading through Wikipedia, I find: Daniel Gralath was the first to combine several jars in parallel into a "battery" to increase the charge storage capacity. Benjamin Franklin investigated the Leyden jar and came to the conclusion that the charge was stored on the glass, not in the water as others had assumed. Because the conductors (or plates) are close together, the opposite charges on the conductors attract one another due to their electric fields, allowing the capacitor to store more charge for a given voltage than if the conductors were separated, giving the capacitor a large capacitance. Here Q is the charge stored in the capacitor Charge is measured in coulombs, and I know from the definition of capacitance that if a 1F capacitor has a voltage of 1V, then 1C of charge is stored in it. If a coulomb is 6.241×1018 electrons, then there should be 6.241×1018 electrons in this capacitor somewhere. But now consider this. If I use a capacitor as a load to some AC voltage source, some current will flow (the precise amount depending on the voltage, frequency, and capacitance): simulate this circuit – Schematic created using CircuitLab I know that current is flowing all the way around this circuit, because if I put a lightbulb on either side of the capacitor, it will light. But if the current is flowing around this circuit, how does the capacitor "store charge"? In other words, how can I ever put electrons into the capacitor if the current is flowing around the circuit, which means for all the electrons I put in the capacitor, the same number come out the other side? If I can't put electrons in without taking some out, then how can the capacitor be storing them? AI: It's easy. A capacitor doesn't store charge, it stores energy. The net charge in a complete capacitor (rather than considering a single plate or the insulator) never changes. An increase of negative charge on one plate is exactly balanced by a decrease in negative charge on the other plate. Therefore, as current enters one terminal an equal current must leave the other terminal.
H: How to program Arduino Nano / Pro-Mini / Pro-Micro clone that has no usb port? I was looking for a cheapest possible option to get arduino and wireless comms for a dimmable light and come across this ebay item when searching for Arduino Nano clone. It has no usb port so how can it be programmed? Edit: I have discovered that there is a new device called "Arduino Pro Micro" which is similar to Pro Mini and Nano but have usb port in-built. The best thing is you can buy Pro Micro for under 4 euros! Excellent for a dimmable LED light... AI: It's similar to an arduino but with the USB to UART converter chip removed to be cheaper. In order to program it you have to use an external converter and connect it to the Rx/Tx pins. Please note that these boards don't use a crystal as a clock source but a 16MHz resonator which has higher tolerance (0.5%) You'll need to get an external USB to serial board (or cable), like Note that there are two "versions" of USB to serial boards. One version outputs Tx pin to Tx header and Rx pin to Rx header and the other version outputs Tx pin to Rx header and Rx pin to Tx header. If your board outputs Tx pin to Rx header and Rx pin to Tx header (the signals are already crossed) then you should connect Rx of the USB board to Rx of Arduino, and Tx of the USB board to Tx of Arduino (like shown below) If your board outputs Tx pin to Tx header and Rx pin to Rx header then you should connect Rx of the USB board to Tx of Arduino, and Tx of the USB board to Tx of Arduino (cross connect like shown below)
H: AVR ISP - SCK pin shared with LED I made a board with an AVR Attiny MCU and an ISP connection. I missed that I made the SCK pin an output for an LED. Luckily, this arrangement seems to work; I can program the chip just fine. But, during programming the SCK signal from the programmer is driving the LED on. Is this ok in principle or did I just get lucky that it works? Please see the attached schematic which shows basically how my board is connected during programming. Assuming the following- the SCK pin (PB2) must be used as the LED output pin, the value of R1 cannot be increased, and the programmer will never be connected while the SCK pin is driving the LED- what could I have done to the circuit to improve the situation? AI: what could I have done to the circuit to improve the situation? Most Arduinos have a LED on Arduino header pin 13 - the SCK pin. Some random ideas in no particular order: have a jumper or even a switch that isolates the LED. use an ultrabright LED with a higher valued resistor? provide a socket for the ATtiny and do programming off-board. use a FET to buffer the LED (high impedance input).
H: Any tricks to attaching a wire or pin to a testpoint? More and more often, I find myself needing to tear apart a device to seek out and connect to serial pads. These pads typically give me access to the underlying operating system for research or tinkering, of which I'm perfectly comfortable with. What I'm not comfortable with, though, is making the necessary hardware connections. That is, while I own soldering tools, I'm deathly afraid of using them. As a software guy, I really just want to get in, look at some bits, and get out, without any lasting damage. Are there some tricks of the trade to attaching pins/wires to a testpoint or non-throughole pad without solder for short-term use? Perhaps a wire with a flat conductive circular tip that would yield nicely to, say, tape or hot glue? Example pad site: AI: The best trick is not a trick at all. It's using a thin solder and flux. Once you've identified the pins you need to use, that is. If heat is a concern, use a low wattage soldering iron. After all, these are fairly small (area wise) isolated pins. These things are made to be soldered. Surface mounted parts go through 270°C degree solder profiles! Aside from that, Pogo pins are a good choice, but there are some more creative options. Since there is no scale to the picture to say how big the pins are, it's hard to suggest a size of wire to use. Let's use 24awg. Since one point (TP12) is tied to ground, you can grab that anywhere on the board. The other (TP11) looks to be a Vcc type, so you can grab that from anywhere that voltage is at, or don't use it if not needed. So the two important ones are TP9 and TP10. In either case, you strip the wire a few MMs, then you hammer the ends flat, to give them a bigger surface area. Since they are near the edge, a nice flat clamp will hold them in place. (or plastic covered paperclip, or a clothspin, depending on how much space you have to work with) You want the pressure to be on the wire, not the coating, other wise the wire will lift up and you will not have solid contact. Imagine this but with wires: Another option is blu tack, fun tack (A reusable gum... putty thing. Just check the stationary aisle or an office store, there is different colors and names but it all works the same). Again, flatten the wire points, then use a big thing of blutack to hold them in place. I suggest taping the wire down an inch away just to take some pressure off though. Non-conductive (I can't say that all kinds are) and doesn't really burn. It's great to hold things in place for soldering too.
H: How do i get a transistor to work efficiently? I'm trying to improve my noobie SMPS design (230v AC -> 60v DC) and i have a major issue with the efficiency. Currently the sim says it outputs 425W while eating 2.2kW, and most of the difference is lost in the main power mosfet. I think the problem is that the mosfet is always in a half way state but i want it to fully open and close. The mofet(thats supposed to let the ~300V flow through) is being driven by an opamp that gives out 15v but that isnt anywhere near enough to fully open the mosfet for a short burst but rather the current just drips through.. it works but it sucks. What can i do here? edit: here is the circuit (was an epic mess while i first posted and still kinda is but should be readable) At the top there is the source, rectifier and a cap to make it look more like dc. Then there are 2 transformers, one is 1:5 for ~60v, other is 1:20 for ~15v then there is the opamp(LT1352CN8) and some 46v zeners, one leads to the main collector cap and the other to the reference voltage from the 60v transformer, the 15v transformer is used for powering the opamp. Then there is C1 and R2 that are supposed to act as a timer.. When the reference voltage goes above C3 voltage, the opamp is supposed to turn on and load up C1 a little bit, C1 in turn would power the mosfet to let voltage through and charge up C3. I just noticed Q1 is currently getting its source from the 60v transformer, that is wrong, it should be the main ~300v line but i think i was testing something there. As you probably guessed the problem lies within powering Q1, i've tried a bunch of mosfets and/or configurations of mosfets but all of them either drop the voltage coming from C1 even lower or just leak like crazy. AI: If, as you say, you are using an op-amp to drive a SMPS MOSFET, that is likely a major problem. You need to drive the gate smartly (hard) in order to have the transistor switch quickly. If it does not switch quickly, it will spend too much time switching, and the power dissipation can be enormous (switching losses are proportional to the switching time, making some assumptions). A large MOSFET will also have a lot of gate charge that needs to be stuffed in or sucked out of the gate, so the current required is large. A good MOSFET gate driver might have a current capability in the amperes vs. only tens of mA for a typical op-amp. An op-amp will also slew too slowly in general, even without the gate load. Here is a datasheet for a random gate driver (This one is from Microchip). The output current capability is 9 amperes, and it will switch in 135ns with a 47nF load. A cheaper driver can be made by complementary emitter-follower BJTs as shown below. It may or may not be adequate, depending on your switching frequency. simulate this circuit – Schematic created using CircuitLab Suggest you look at the gate voltage waveforms in your simulation or prototype and improve the driver until you see MOSFET switching losses that are at least in the same range as the theoretical conduction losses: \${I_{RMS}}^2 \times R_{ds(on)}\$, or \${I_{on}}^2 \times R_{ds(on)} \times \dfrac{t_{on}}{t_{off} + t_{on}}\$ if the on current \$I_{on}\$ is fairly constant. Note that building an actual circuit in this power range or higher is non-trivial, and good layout practices have to be followed. International Rectifier has some excellent application notes. P.S. Here is an excellent application note that goes into the gory details of MOSFET gate charge.
H: The cheapest and smallest way of converting 3 V to 3.3 V My microcontroller operates at 3.3 V, but all the CR2032 bateries are rated at 3 V. Is it safe to drive my microcontroller using this 3 V? Will it operate correctly? I don't have to draw too much current, so the current is not an issue. If not, do I have to use something like NCP1450 to actually step up the voltage? Given that I have to reduce size, what is the cheapest way to achieve this? AI: While the question does not specify the microcontroller under consideration, the popular 3.3V rated microcontrollers from Atmel, Texas Instruments and Microchip all tolerate supply rails down to 3 Volts, 2.7 Volts or in some cases even lower. Note also that a CR2032, or for that matter pretty much any battery, will drop in voltage as it depletes. Thus the constraint to be considered is not the nominal voltage of the battery, but the lowest voltage the battery can drop to and still be considered operational. The microcontroller datasheet will mention what the absolute lower limit is. The datasheet will also reveal whether some parameters of the microcontroller will behave differently under lower voltage. Many microcontroller families specify lower clock speed limits for lower supply voltages: Thus a microcontroller which is rated to operate on a 20 MHz clock at, say, 5 Volts, would be limited to no higher than perhaps 12 MHz at 3.3 Volts, and 10 MHz at 3 Volts. Another potential point of difference would be any analog reference voltage output available from the microcontroller: Some microcontrollers offer a reference pin with output valid only as long as the supply rail voltage is sufficiently higher than the reference voltage. In order to be able to operate a microcontroller even as the battery depletes, a simple 3-terminal boost regulator, such as the Holtek HT7733, is an option to consider: This particular boost works down to 0.7 Volt battery voltage, and is very inexpensive (20 cents each in my part of the world). The circuit is simple enough to add to an existing design. It also does not require an external MOSFET, an advantage over the NCP1450.
H: SDRAM initialization I've been trying to study how the ARM bootloader works, but initialization of SDRAM is still somewhat a mystery to me. For example AT91 Bootstrap uses following function for initialization. I think I understand most of the steps, but why step #7 (8 auto-refresh cycles) is needed? int sdramc_initialize(struct sdramc_register *sdramc_config, unsigned int sdram_address) { unsigned int i; /* Step#1 SDRAM feature must be in the configuration register */ sdramc_writel(SDRAMC_CR, sdramc_config->cr); /* Step#2 For mobile SDRAM, temperature-compensated self refresh(TCSR),... */ /* Step#3 The SDRAM memory type must be set in the Memory Device Register */ sdramc_writel(SDRAMC_MDR, sdramc_config->mdr); /* Step#4 The minimum pause of 200 us is provided to precede any single toggle */ for (i = 0; i < 1000; i++) ; /* Step#5 A NOP command is issued to the SDRAM devices */ sdramc_writel(SDRAMC_MR, AT91C_SDRAMC_MODE_NOP); writel(0x00000000, sdram_address); /* Step#6 An All Banks Precharge command is issued to the SDRAM devices */ sdramc_writel(SDRAMC_MR, AT91C_SDRAMC_MODE_PRECHARGE); writel(0x00000000, sdram_address); for (i = 0; i < 10000; i++) ; /* Step#7 Eight auto-refresh cycles are provided */ for (i = 0; i < 8; i++) { sdramc_writel(SDRAMC_MR, AT91C_SDRAMC_MODE_AUTO_REFRESH); writel(0x00000001 + i, sdram_address + 4 + 4 * i); } /* Step#8 A Mode Register set (MRS) cyscle is issued to program the SDRAM parameters(TCSR, PASR, DS) */ sdramc_writel(SDRAMC_MR, AT91C_SDRAMC_MODE_LOAD_MODE); writel(0xcafedede, sdram_address + 0x24); /* Step#9 For mobile SDRAM initialization, an Extended Mode Register set cycle is issued to ... */ /* Step#10 The application must go into Normal Mode, setting Mode to 0 in the Mode Register and perform a write access at any location in the SDRAM. */ sdramc_writel(SDRAMC_MR, AT91C_SDRAMC_MODE_NORMAL); // Set Normal mode writel(0x00000000, sdram_address); // Perform Normal mode /* Step#11 Write the refresh rate into the count field in the SDRAMC Refresh Timer Rgister. */ sdramc_writel(SDRAMC_TR, sdramc_config->tr); return 0; } AI: This is mostly dependant on the SDRAM you are using. For example, take a look at the Application Note TN-46-08: Initialization Sequence for DDR SDRAM. Also, I have found that the initialization sequence is not so strict. Usually you will stick with whatever is provided already and modify it according to your specific needs. If it doesn't work already, you might want to go into details and check with your SDRAM manufacturer's datasheet ARM gives an example initialization sequence as well for various architectures, but considers them a "starting point".
H: position locator using zigbee I am working on a project to count the number of cars in a specified region. I would like to use a Zibee/Xbee module. As far as I've learned, Xbee modules are used as stationary nodes and Zigbee modules are arranged in the car. There is a gateway node that receives the data in terms of RSSI values of the signal received through the stationary node. 1)How to use that data to find the position of the car? 2)A Xbee unit can take how many readings at same time? 3)What is the range of this position locator For the first question I studied a lot on the web and there is no certain information about how to do it. All I know is a mobile node requires three stationary nodes to locate it and it is measured through RSSI value of signal received. If I am wrong somewhere please correct me. AI: Triangulate. you have 3 known points, 1 unknown but with 3 RSSI readings. Assuming all parameters are the same, RSSI is proportional to the distance via Friis transmission equation. Caution though: things rarely stay the same outside the simulation. What readings? what unit of time? That depends on your link budget and local conditions.
H: Can you use arduino for other avr chips? Example: Arduino leonardo uses Atmega32U4. What if one wants to program/develop for the plain ATmega32. AI: You can use the Arduino IDE with any MCU you can find compatibility files for. You may need to use a ISP programmer though, unless you can also find an appropriate bootloader (which you'll need a ISP programmer to upload regardless).
H: How to edit dimensions for PCB layout in proteus I need a relay like this in proteus http://www.sanyourelay.ca/public/products/pdf/DI1U-K.pdf the DI1U-P type. unfortunately all the relay i found are not of the same size. please help me on how to change measurements in the package. AI: This can probably be explained better in a in a video but I'll try with images Open ARES and place a similar footprint on the design (a relay that matches the number of pins is fine) what you get is right click on the footprint and select decompose tagged objects If the dimension of your footprint are in mm then pres the m button for metric or leave it as is for mils use the 2D graphics mode to make the outline of the component (or resize the existing one) to match the one you are trying to create change the snap size if needed, then use the dimension mode and create lines or use the grid or numeric coordinates to help you place the pads (move the existing ones from the decomposed footprint) to the appropriate distances as per the device datasheet. when you are done select the created footprint (pads & outer line) plus the text from the decomposed component (this helps avoid entering everything from scratch), right click and select make package in the next screen use a new name and change any other info you may want (not required) and store the new footprint in a user library like USERPKG In order to use the footprint in your actual PCB that is connected to a schematic you can double click the relay component and change the footprint name to match the new one you have designed, so this is changed to Another option is to change the linked package to the ISIS schematic editor. Place a component that has the same number of pins (and names, or you have to do additional steps), right click and select packaging tool press the add button to add a new package select the package you have created Set the footprint to schematic pin names association if necessary (not needed if names match) , set it as default (assuming you don't want to set it every time) and click assign package then save it in a new library like USERDVC. Note that after that you'll have two relays with the same name with one of them belonging to the USERDVC package, that is the one you should use If you need a video tutorial then there are a few in youture, like https://www.youtube.com/watch?v=CHowCns-8IU
H: Problem with Atmega 168 USART receive interrupt ,while communicating with Xbee Before decreasing my reputation please let me know what I have done wrong. Bear with me as I am a newbie. I have written a program so that a receiver radio module sends 1 when it receives an 1 from a broadcaster module.I am using XCTU with a Xbee as the broadcaster.Here is the code. #include<avr/io.h> #include<avr/interrupt.h> #include<util/delay.h> unsigned char data; //to store received data from UDR0 //Function To Initialize UART0 // desired baud rate:9600 // actual baud rate: // char size: 8 bit // parity: Disabled void uart0_init(void) { UCSR0B = 0x00; //disable while setting baud rate UCSR0A = 0x00; UCSR0C = 0x06; UBRR0L = 0x06; //set baud rate lo UBRR0H = 0x00; //set baud rate hi UCSR0B = 0x98; } SIGNAL(SIG_USART0_RECV) // ISR for receive complete interrupt { data = UDR0; //making copy of data from UDR0 in 'data' variable if(data == 0x31) UDR0 = data; //echo data back to PC } //Function To Initialize all The Devices void init_devices() { cli(); //Clears the global interrupts uart0_init(); //Initailize UART1 for serial communiaction sei(); //Enables the global interrupts } //Main Function int main(void) { init_devices(); while(1); } Now the problem is that when I send an 1 we do not get any response from the receiver. We tried the same thing with an Atmega 2560 based devboard as the receiver and the program worked like charm. But when we try it with Atmega 168 nothing happens. Well with Atmega 168 we use internal crystal of 8MHz with 8 prescaler ie 1MHz system clock so I have used UBRR0L = 0x06; //set baud rate lo Used for dev-board UBRR0L = 0x5F; //set baud rate lo to get 9600 baud. But no matter what I do the interrupt just isn't working. We tried running a toggling cycle in the main program to see it that is working or not and that worked too. But when ever I transmit a signal via XCTU (terminal software) the receiver does not go to ISR like it is supposed to. Please help. Ask me back if anything I need to clarify. AI: You are using the old format for interrupts, I wonder if this is the cause of the problem. Please refer to avr/interrupt.h The interrupt handler should be like ISR(USART0_RX_vect) { }
H: Reducing system voltage whilst getting the same output from a PCB antenna I have built a small prototype transmitter, based on a schematic available online. It transmits on a 5Mhz carrier and uses BPSK modulation. It works well enough for my purposes. The schematic for the TX output section looks like the below: My question is: if I reduce Vcc from 5v to 3.3v and also reduce R4/R5 to get the same current, will I get the same output from the TX antenna? Further details I would like to replace the current 9v battery & LDO with a single AA cell and boost converter. I have other existing circuits with a single AA cell but the IC I am using only goes to 3.3v from a single cell. MOD1 and MOD2 in the schematic are the same for "quiet time" (when not transmitting) and always inverse when transmitting. When they change a carrier inversion happens. The PCB trace inductor loops around the outside of the board, it can just about be seen in the image below. There are 10 turns on the top and bottom layers, winding in the same direction. I measured this to be ~25uH using a Peak LCR meter (I am aware that the test frequency is not the same as my carrier, therefore this is not perfect). When doing some research I found a schematic in an FCC filing for a product similar to what I'm prototyping. Whilst the modulation is different the antenna and capacitors are quite similar. This suggests that the schematic I found online is at least mostly sensible. This design is fed from one end (the other is GND) and only has a 22R resistor. I happily admit that I do not have much idea of how the antenna works, R4 and R5 in my design are there to ensure the 74AC86 current limits are not exceeded. Looking at it whilst writing this question I suspect R5 could be completely removed. An answer that explains how this works (in simple terms for a non-EE) would allow me to understand my own question and perhaps refine the design further. AI: First of all, it isn't the resistors that are limiting the current out of the gates — the AC impedance of the capacitors at 5 MHz is more than enough for that. A more important function of the resistors is to isolate the resonant tank circuit from the low output impedance of the gates, allowing the Q of the circuit to be higher than it would be without them. If anything, I would be tempted to raise the values of the resistors, to maybe 150Ω or 220Ω, to provide a better match to the antenna. Otherwise, if you want to redesign the antenna to work at a lower voltage and higher current, you're going to have to reduce the inductance and raise the capacitances by the same ratio in order to keep the same resonant frequency. This type of antenna only interacts directly with the magnetic field of an EM wave, so its "power" is directly related to the magnetic field it can produce, which is a function of the current through the inductor and the number of turns in it (Ampere-turns). Since inductance is proportional to N2, halving the number of turns allows roughly 4× the current to flow for a given voltage, which gives a net 2× improvement in the overall Ampere-turns value. This is an extreme example that shows the principle — in practice, you'll probably want to make a smaller adjustment to your present design, and you do still need to pay attention to the amount of current the gates can supply.
H: PIC XC8 compiler array of structs? I'm having trouble assigning variables to structs, particularly making an array of structs, with the XC8 compiler. Example code below: typedef struct p{ int id; dateStamp start; dateStamp stop; int parent_id; } period; period p1 = {1, {0, 0, 0, 1, 1, 14}, {20, 0, 0, 1, 1, 14}, 1}; period p2 = {1, {21, 0, 0, 1, 1, 14}, {50, 0, 0, 1, 1, 14}, 1}; period p3 = {1, {51, 0, 0, 1, 1, 14}, {59, 0, 0, 1, 1, 14}, 1}; period periods[3] = {p1, p2, p3}; And this is the compiler error log: main.c:233: error: (188) constant expression required main.c:233: error: (207) simple type required for "@" main.c:233: error: (182) illegal conversion between types struct p -> int main.c:233: error: (181) non-scalar types can't be converted to other types main.c:233: error: (188) constant expression required main.c:233: error: (207) simple type required for "@" main.c:233: error: (182) illegal conversion between types struct p -> int main.c:233: error: (181) non-scalar types can't be converted to other types main.c:233: error: (188) constant expression required main.c:233: error: (207) simple type required for "@" main.c:233: error: (182) illegal conversion between types struct p -> int main.c:233: error: (181) non-scalar types can't be converted to other types main.c:256: warning: (345) unreachable code (908) exit status = 1 make[2]: *** [build/default/production/main.p1] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 Suggestions would be welcome.... AI: This is a C problem. period periods[3] = {p1, p2, p3}; is invalid in C, as p1, p2 & p3 are struct variables, and not constants known at compile-time, therefore you cannot use them as initializers. You may use macros to substitute the same constant values into p1, p2, p3 and periods[3] so that you don't have to duplicate the values: #define P1 {1, {0, 0, 0, 1, 1, 14}, {20, 0, 0, 1, 1, 14}, 1} #define P2 {1, {21, 0, 0, 1, 1, 14}, {50, 0, 0, 1, 1, 14}, 1} #define P3 {1, {51, 0, 0, 1, 1, 14}, {59, 0, 0, 1, 1, 14}, 1} period p1 = P1; period p2 = P2; period p3 = P3; period periods[3] = { P1, P2, P3 }; Or you may simply avoid initializers altogether, and use explicit statements at the beginning of your program to initialize these arrays.
H: DC Motor Control - h-bridge pulsing strategy? Question is with regards to a DC motor controller built around an Allegro A4940 and four discrete FETs. There are at least four possible strategies for driving the FETs, and I'm struggling to understand if any one of them is the accepted "right" way or if the best choice depends on circumstances. The options I can see are: Turn on the low-side FET to select direction, and PWM the corresponding high-side FET to set speed. Opposite pair are off. Similar to #1, but PWMing both, instead of the low-side just being held on. Similar to #2, but with the low-side and high-side FETs taking turns switching off, instead of both doing so (so, PWM out of phase). PWM back and forth between opposite pairs, varying the ratio depending on the commanded speed (so, like a class-D amplifier). Option #1 seems like the simplest. Are there efficiency or heat dissipation reasons to go with #2 or #3. Option #4 seems wasteful and unnecessary if you don't need the precise control for audio. Thoughts, or pointers to resources on this? AI: I did some more reading. It looks like the optimal is #1, but with a complementary PWM output used to switch on the high side's low FET during the OFF time. This is synchronous rectification, and it is more efficient because the windings are connected to a lower resistance during the off period. Details can be found in the user manual for TI's Black Jaguar motor controller.
H: A program to add 6 bytes of data and store sum and carry in 8085 instruction set I have a question on 8085 instruction set. A program to add 6 bytes of data stored in memory starting from 4500h. must use b register to save any carries and finally store the sum and carry at two consecutive memory locations 3000h and 3001h. I wrote the following for it. ACI 4500h ACI 4501h ACI 4502h ACI 4503h ACI 4504h ACI 4505h STA 3000h HLT So, is this right and even if it is can you make some suggestions to make it better like make a loop instead of repeating ACI six times and so on. Suggest any think that you think would help me learn more about this program. Thanks in advance. AI: Ah, more computer archaeology! I'm just going to give you a solution here, since it would take too long to address the misconceptions in your code. Study it and make sure you know exactly what each instruction is doing and why. ;; HL points to array of bytes to be added ;; DE contains 16-bit sum ;; C is loop counter lxi h, 4500h ; point to first byte mov e, m ; fetch first byte mvi d, 0 ; clear high byte of sum mvi c, 5 ; add 5 more bytes loop: inx h ; point to next byte mov a, m ; fetch next byte add e ; add to sum mov e, a jnc skip ; if carry ... inr d ; increment high byte of sum skip: dcr c ; decrement loop counter jnz loop ; repeat if not done ;; Store the result xchg ; move sum to HL shld 3000h hlt
H: ATX Computer PSU: OK to connect loads between positive rails, e.g. +12v to +5v I have looked, but haven't find an answer. Are ATX computer PSUs capable of having a load connected between their positive rails, so that for example, current would flow from a 12v rail to a 5v rail? Specifically, I need to know: Does the specification of the standard say anything about this? If not, what is the likelihood that it would be OK? What's the worst that could happen? Thanks Addition: Same question, but between the -12v and any of the positive rails (paricularly +12v and +5v). Similar question here says -12v to +12v would be OK. AI: The answer, as to many engineering questions, is "it depends". The most cautious advice is that you can allow current to flow from any rail to any other rail provided that the specified minimum output load current (which may be zero) is drawn from any rail. What is the minimum load, you ask? It's specified in the ATX specification. In no case should you allow a rail that normally sinks current to source current or vice versa. That's what "0" means. Should you break that rule, the voltages present at the rails may go outside of tolerance and (worst case) damage the supply or something attached to the rail (one exception to the minimum load rule is that if you open all the outputs, damage should not occur to the supply, but the supply is not guaranteed to operate). For example, the 5V rail could rise to 8V, exceeding the rating most 5V chips as well as the output filter capacitors. High quality supplies may have OVP (overvoltage protection) which will likely prevent damage to the supply or attached load. On the other hand, there are ATX power supply designs that stack a 7V rail on top of the 5V rail to give +12V, such as this one. You can draw current from the +12V rail to the 5V rail on this one (but not the 3.3V rail). There's no guarantee that you'll get a supply made this, so it's best to stay within the specifications that all ATX supplies must meet. There are multiple revisions of the specifications.
H: Solve this Linear Circuit Consider these relations about that circuit bellow: $$i_2 = i_L\\ V_2 = V_L\\ Z_2 = Z_L$$ As reference the circuits below on pictures I and II, is correct to affirm that the value of Voltage $V_x$ can be calculated by this equation: $$\frac{V_x-V_0}{R_0} - I_0 + \frac{V_x}{R_1} = 0$$ Answer: Correct. PS.: I try every relations with nodes Law, KCL and KVL but there are too many equation but not visualize that especific equation. AI: The question is basically saying that in Figure 2, Vx and Rx are the Thevenin equivalent of everything in Figure 1 except the load ZL. To work out the Thevenin equivalent of a source network, you need to know the open circuit voltage and the short circuit current. In fact, since the question only asks about Vx, in this case you really only to need to work out the open circuit voltage. To do that, just imagine in Figure 1, that ZL is removed and replaced with an open circuit, and work out the voltage VL. Since you have two independent sources, you'll use the superposition principle to do that.
H: What can I do to decrease the latency from these serial ports which are attached to a PC via a Serial to USB adapter? I think I have accidentally discovered a need in my life for embedded systems. Which is great! And kind of scary. And I need help. Background: I got hired to build a GUI application which takes scans from two SICK LMS-291s and integrates them with a sub-inch accuracy GPS, so you know where each scan occurred. As the naive web programmer I am, I understood that timing would be important, but didn't realize it would also be hard! If you don't know when each GPS point and each scan occurred, you can't figure out where the scans occur. Oops. They had specified windows 7 as the platform, as well as bought a SeaLevel RS422 to USB box to hook up the sensors and GPS to, and in short order I discovered my folly. Somewhere between the sensors and my computer program, something was keeping the scans from arriving in a timely manner. The LMS spits out 75 scans per second, or at 13.32 ms/scan. My program doesn't get them in a timely manner. It gets them every 100 or so milliseconds, in groups of 7 or 8 or 10 or something. Also sometimes not enough scans show up, or they're mangled. Either this SeaPort adapter is only sending ten times a second (is that possible? I don't know how USB works) or Windows isn't checking the buffer (there must be a buffer somewhere, right?) nearly often enough. Present Day: This leads to some inaccuracies that the client is basically okay with. I'm not, though, and since I've got a chance to do similar work for the client (integrating more sensors inputs!), I'd like to figure out how to do it right, e.g. given the accuracy of the GPS, be able to give guarantees about the precision and accuracy of the scan locations. What does that look like? I need a UI, and to be able to check input from these three devices every 13.32 milliseconds. If I used FreeRTOS with, say, Nano-X for the GUI, run on a laptop they provide, would that sound like a sane solution? Is it possible that the RS-422 to USB adapter is causing these delays, and using Windows is actually just fine for this purpose? AI: The problem is almost certainly in the USB buffering related to the USB-RS422 converter. USB has variable and fairly high latency. The easiest solution would just be a better RS422 interface, ideally something PCI/PCI-e based. That would solve the latency issues. You may also be able to modify the USB polling rate, though this is fairly dependent on the host OS (what platform are you on?). For what it's worth, I looked about on sealevel system's website, and it is MASSIVELY infected with marketing bullshit. They literally spend like 10 pages and multiple white-papers on saying "we use a USB hub internally, rather then doing MCU multiplexing". Hey SeaLevel! That's what the cheap-ass $50 4-port USB-serial interface I bought on e-bay from china does too! You're not special, even if you write half a dozen vapid whitepapers trying to make it sound like you are! Have you tried to force those things to use FTDI drivers? I'd put money on it they're just using bog-standard FTDI FT232 or similar. Can you pop the box on one of them open, and take pictures? If you really want to spin your own hardware, for fun or educational opportunities, I'd strongly suggest you not try to do everything in the hardware. Since you need to simply time-correlate all three signals, all you really need is something that can listen on three serial lines (two RS422, one RS232 (the GPS)), time-stamps the data, and forwards it to the main computer. Once the data is time-stamped, you're free to have all the buffer-latency you want, since you can always just look at the time-stamps. Realistically, if you have no base in hardware, designing something with enough crunch to draw a nice GUI is quite the undertaking. Personally, I'd probably throw a fairly chunky ARM MCU at the buffering issue, and be done with it. Despite the fact that it's an Arduino, the Arduino Due has plenty of SRAM, and is more then fast enough for what you need (and there is lots of support, which is always nice). Alternatively, the STM32 series has similar performance, and is more intended for "advanced" users (read, there are fewer, or no examples to reference). ST makes lots of quite nice, extremely inexpensive eval boards as well. With the Due, you do get a native USB port, for which you could roll your own CDC driver if you wanted. Some of the STM32 boards have native USB as well.
H: What does ".1M/250" mean as a capacitor rating? I'm not very familiar with capacitor markings, and I'm trying to understand what exactly this one means. I'm guessing .1M indicates 0.1 microfarads with 20% tolerance, but I have no idea what the /250 means. I don't have any documentation for it since I just pulled it out of a dimmer switch. This is what it looks like: AI: That's a 0.1uF +/-20% mylar film capacitor rated for 250VDC. That is a typical capacitance, type of capacitor, and voltage rating for the capacitor used in a dimmer. The voltage rating is a DC rating. The capacitor actually only sees the diac breakdown voltage (typically 30-40 volts) plus a volt or two for the triac gate. The "M" does not stand for microfarads- rather it is a tolerance code. J = +/-5% K = +/-10% M = +/-20% In light dimmers, sometimes the diac is integrated into the triac as one unit.
H: How would I make an Arduino Due recieve RS-232/422 signals? Background on this question is here: What can I do to decrease the latency from these serial ports which are attached to a PC via a Serial to USB adapter? I'm looking at purchasing an Arduino Due to take in 3 (well, ultimately 5, but currently 3) serial signals, one rs-232 and two rs-422. The point would be to get accurate time stamps before sending them on to a real computer for processing. The due has a USB port, but I'd presumably have to put something together that could let the microcontroller access the serial signals. I happen to know bupkis about hardware, though. This isn't a plea for someone to draw me up wiring diagrams (I don't actually know if wiring diagrams are relevant to this problem, and I couldn't read them [yet] if you did). I just don't have the language to research this. I would presumably have to solder things together? A serial port (x5) to a circuit board of some sort? Would the Due let me do three serial inputs? Could it support five? More importantly, how can you tell? (I'm kind of guessing that since the Due has 54 pins, and a serial port has 9 each, and 5 * 9 = 45, that the Due could support all five devices. Am I on the right track?) AI: The Due, which is really a Atmel AT91SAM3X8E, only has 4 full hardware serial interfaces (though there is an additional UART which may work). The first thing I'd strongly reccomend is to stop thinking of the board as an "Arduino". The Arduino tools just paper over the actual device. It's a AT91SAM3X8E dev board. That said, the first place to start is to read the product page and datasheet(pdf). Functionally, RS-422 looks like a differential asynchronous serial bus. Depending on the implementation, it can be half-duplex (e.g. data can only go one way at a time), or full-duplex (e.g. data can go both directions at the same time). This mode is determined by the hardware, as full-duplex takes more physical wires. Half duplex is one differential pair (and ground), full duplex requires two diff-pairs (and one ground). For full-duplex on a non-bus topology (e.g. only two devices), the hardware required to interface the bus can be as simple as just sticking a differential line driver/receiver in between your MCU's USART and the other device. For bus-topologies or half-duplex connexions, it gets more complex, as you need to be able to turn off the line-driver to allow the other device(s) to talk over the shared connections. Also, one note is you'll see lots of "RS-422/RS-485" line drivers, etc... This is because the physical layer specifications for the two are the same, so a driver that works for RS-422 will generally work for RS-485, and vice versa. In fact, there are often devices that support both protocols. Fortunately, RS-422 looks exactly like RS-232, simply with different physical signaling levels (and one is differential). As such converting RS232 to RS422 is as simple as just sticking in a converter. (RS485 is more involved). This means you can probably use the 5th UART in the AT91SAM3X8E for your 5th channel without issue (or you could just use it for the RS232 connection anyways). With regard to how to actually make your device talk RS-422, you will need a RS422 driver IC. Fortunately, there are lots of options. There are even options available in DIP for easy prototyping. Breakout boards are harder to come by, as RS-422 is pretty unusual in anything hobbyist grade. I found one, but it looks pretty poorly designed (no ground terminal!). It would probably work fine for experimentation, though.
H: Battery Elimination Circuit Powering Flight Controller I am putting together a quadcopter, and one of the things I've stumbled across that I don't quite understand is Battery Elimination Circuits (BECs). The Flight Controller on my quadcopter is a modded Arduino board with some motor pins and other sensors integrated into it. The Flight Controller is capable of being fed anything from 12V to 5V. I have been feeding it 12V straight out of my LiPo battery, which it regulates down to 5V and continues merrily on its way. Now, the Electronic Speed Controllers (ESCs) that drive the motors each contain an integrated BEC. From a post on this site under the "Discussions" tab, one guy claims that the most common thing to do is use the BEC to power the Flight Controller. So it seems to me like the BEC is kicking 5V back to the flight controller. Is that good enough? Do I need to worry about low current or low voltage conditions? It's pretty important the Flight Controller say running. I have read a few links about BEC's: From this link, I think I understand that the voltage regulators in BEC's are generally linear, which is going to use more power than a switching power supply, but then in the comments, the guy who asked the question said "thanks... I'll go with a BEC." I'm not sure what I'm missing there. So I currently have four ESCs, each with three pins (Signal, V, GND) connecting to my Flight Controller. I also have 12V straight from the battery connecting to my Flight Controller board, which is regulated down to 5V. Is this wasteful? Wise? Should I remove the (V, GND) pins to the ESCs and only keep the signal pins? I'm spinning my wheels here because I'm obviously missing something. What is best power and weight-wise? Any advice is appreciated. I didn't know BECs existed in the not-too-distant past. AI: If your flight controller already have its own DC/DC converter you should go for it, because it is probably designed for this particular use. Most speed controllers with BEC are based on linear regulators. Basically these regulators turn excess voltage into heat, the more current you will draw the hotter they will be. If, for some reason, they become too hot they will go into protection mode, and stop to work. To disable a speed controller BEC just disconnect the red wire from the from servo plug, unless your flight controller board already have a system allowing to choose the power source.
H: Op amp non-inverting circuit mystery I'm working on a project with lots of op amps and so far had no problem but this one is driving me nuts. I need a 1:2 non-inverting amplifier which I built on breadboard but doesn't work as expected. The circuit is trivial, I tried different op amps (LM741,TL072,LM358), use a rail-splitter or just a voltage divider for the bias DC, with our without the DC decoupling caps and yet it doesn't work. It seems that negative half of the signal is gone (yellow being the output signal while the incoming signal is from a signal generator). Thank you for your help in advance! AI: You have nothing setting the operating point of your positive input to the op-amp. As such the input bias current of the op-amp is causing C1 to charge up to one of the rails, and it's therefore cutting off part of your signal. This issue will likely be exaggerated in simulations as well, since few simulations properly account for the input bias currents and input networks of their virtual op-amps. If you are using a simulation, try measuring the voltage on the + input of the op-amp. I suspect you'll find it exceeds the supply rails when the output does so as well. You need a large-value resistor from the + input of the op-amp to the virtual ground. That resistor will set the operating point for the + input pin, and fix the issue. Issue as described Fixed
H: DMA completion interrupt not working for slave STM32 SPI I am using stm32f103 to transmit some data over SPI while stm32 acts as slave. I need to use DMA for sending data to the SPI but the corresponding interrupt handler is never called. The initialization code comes in the following: DMA_InitTypeDef DMA_InitStructure; /* DMA configuration */ DMA_DeInit(SPI_SLAVE_DMA); DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t) SPI_SLAVE_DR_Adress; DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t) SPI_Buffer; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST; DMA_InitStructure.DMA_BufferSize = SPI_BufferSize; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(SPI_SLAVE_DMA, &DMA_InitStructure); /* Enable DMA Transfer Complete interrupt */ DMA_ITConfig(SPI_SLAVE_DMA, DMA_IT_TC, ENABLE); /* Enable DMA */ DMA_Cmd(SPI_SLAVE_DMA, ENABLE); /* SPI_SLAVE configuration */ SPI_InitTypeDef SPI_InitStructure; SPI_InitStructure.SPI_Direction = SPI_Direction_1Line_Tx; SPI_InitStructure.SPI_Mode = SPI_Mode_Slave; SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Hard; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(SPI_SLAVE, &SPI_InitStructure); /* Enable SPI_SLAVE Tx request */ SPI_I2S_DMACmd(SPI_SLAVE, SPI_I2S_DMAReq_Tx, ENABLE); /* Enable SPI_SLAVE */ SPI_Cmd(SPI_SLAVE, ENABLE); When I use SPI interrupt handler, my system works. But using the code written above, interrupt handler of SPI_SLAVE_DMA channel is never called. AI: I found the solution. In reference manual of STM32f103xx there is a table (No. 78) clarifying that which DMA channel can be used for which peripheral. According to that table, I had to use DMA1 channel3, while I was using channel6 instead.
H: How to find a problem on a Non working Yamaha SPX90 (Pro audio) effects unit I have an electronic processor unit namely an SPX90 (a 19" pro audio effects unit made circa 1987). I'm a home studio producer and have owned it from new from 1987, but it died a few years ago. Now thanks to this SE, I'd like to find out how I might be able to fix it myself with your advice! I have a multi-meter (M/M), but although I'm a pretty dab hand with home recording studio & home DIY. Using my multi-meter, I'd like to try to find out what has failed on the unit (obviously without the mains connected!). The Yamaha SPX90 was renowned for the internal power supply failing and I have an in-clinging it is this as the frontpanel power switch became very temperamental when last used (about 5 years ago) but it is a great classic unit and I really don't want it to go the tip as I could get another 10 years out of it, even though I have many other pro effects that superceed it. I'm not sure where to start, could anyone give me some advice on what I need to do and what I'm looking for with the M/M, I'm really keen for this to be my first electronics project (-: AI: You should search the web and find circuits or service manuals for it. At the very minimum, you might be able to ascertain that there are dc voltages coming from the power supplies but, it requires a certain level of technical knowledge to understand the components you are seeing on the circuit boards or you may probe your multimeter in the wrong places and make invalid conclusions. Make sure you are using DC voltage measurements and your probe wires are NOT connected to the amp measurement sockets. Try and determine if there is an obvious ground/0V point and measure relative to that. For an absolute guess I'd be expecting to see +12 volts and -12 volts on certain points but, this could easily be +/-5V or +/-15V. Look for voltage regulator chips like ones marked with 7805, 7905, 7812, 7912, 7815, 7915 - these are linear voltage regulators that may have suffered - also inspect the big tubular things we call capacitors - quite often these components can fail and they sometimes show signs of deterioration by bulging or leaking goo from the internals. Also look at the copper on the circuit board to see if there are any scorched areas. Look for scorched components too - quite often resistors will age and eventually fail if they are subjected to continuous moderate-to-high powers.
H: How to wire/interface a 4x3 membrane keypad I followed this example to wire my keypad to my STM32F4 Discovery board. However any way I read data on the pins I keep getting same data which leads me to believe I wired something wrong. Here is the image how I had it wired: I the red line (+) on the breadboard is wired to a +5V pin on my STM32F4 and the blue one (-) is wired to GND on my STM32F4 board. The first 4 wires are for rows they are wired directly yo + line and right after them there are wired wired to pins from 4-7 like the image bellow shows: I also tried it by now wiring the keypad to +5. Anyhow I keep getting the following output from my pins: 1 1 0 1 1 1 1 Meaning all but Pin 3 are returning 1 (High). As far as code goes I initialize all pins for INPUT so I'm reading the value from the PINs. I have Pull UP/DOWN resistor set to NOPULL. However it's always this output. What is the proper way to wire/interface these keyboards ? Expanded question: I wired all 7 pins to my GPIO pins. - I set all 4 rows to HIGH 1 - I set all 3 columns to LOW + PULL DOWN + Input Now when I read state of all pins I get: 1111 for the output pins and for the input pins I get 000 and when I press a button on the keypad the corresponding column make one of the 000 to 1. The problem is this only tells me which column is selected how to I find out which row is selected if they are all set to 1. My code: void start_clocks(); void init_outputs(); void init_inputs(); volatile int a, b, c; volatile int e, f, g, h; void main(void) { // Start clocks start_clocks(); // Configure outputs init_outputs(); // Configure inputs init_inputs(); // Configure abc a = -1; b = -1; c = -1; e = -1; f = -1; g = -1; h = -1; while(1) { a = GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_11); b = GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_9); c = GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_7); e = GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13); f = GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_11); g = GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_15); h = GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_13); } } void init_inputs() { GPIO_InitTypeDef Keypad; Keypad.GPIO_Pin = GPIO_Pin_11|GPIO_Pin_9|GPIO_Pin_7; Keypad.GPIO_Mode = GPIO_Mode_IN; Keypad.GPIO_OType = GPIO_OType_PP; Keypad.GPIO_PuPd = GPIO_PuPd_DOWN; Keypad.GPIO_Speed = GPIO_Speed_100MHz; GPIO_Init(GPIOE, &Keypad); } void init_outputs() { GPIO_InitTypeDef Keypad; Keypad.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_11; Keypad.GPIO_Mode = GPIO_Mode_OUT; Keypad.GPIO_OType = GPIO_OType_PP; Keypad.GPIO_PuPd = GPIO_PuPd_UP; Keypad.GPIO_Speed = GPIO_Speed_100MHz; GPIO_Init(GPIOB, &Keypad); Keypad.GPIO_Pin = GPIO_Pin_15|GPIO_Pin_13; GPIO_Init(GPIOE, &Keypad); GPIO_SetBits(GPIOB, GPIO_Pin_13); GPIO_SetBits(GPIOB, GPIO_Pin_11); GPIO_SetBits(GPIOE, GPIO_Pin_15); GPIO_SetBits(GPIOE, GPIO_Pin_13); } void start_clocks() { // Start clocks for GPIO B and GPIO E RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOB, ENABLE); } AI: You have to poll the rows one at a time. Set the voltage high on only one row at a time. After trying each row, you'll have seen a high on only one column. The combination of active row and responding column tells you which button is pressed.
H: Can I run this motor off of this solar panel? I am trying to build a solar powered boat, and I have decided upon this 5V, 500mA panel. I can buy 3 or 4 of them to get up to the necessary voltage and amperage. The problem I have is that I can't find any good 5V motors; the closest are 6V, however as far as I know you have to match the same voltage exactly. I'm looking for the highest possible RPM and I want to spend less than $10. Can I power a 6V motor like this one off of a 5V panel? What if I linked four panels to get 10V, 1A and used this motor, which supports 9V at 1.1A under load? AI: A 6 Volt DC motor will function very well with a 5 Volt supply. A 9 Volt motor on the other hand will operate at around half the rated RPM at 5 Volts, and even slower with any appreciable load on the shaft. Therefore a 6 Volt motor is preferable. Regarding solar panels, one would need to use multiple of the 5 Volt 500 mA panels in parallel, to preferably exceed the maximum stall current rating of the motor to be used. Stall current is typically much higher than the operating current. Thus, for a 6 Volt motor rated at say 1.1 Amperes maximum stall current, a minimum of 3 solar panels in parallel would be recommended, more if they are to be used in overcast conditions. The question does not specify how much torque is expected from the motor, which is an important consideration for motor selection - speed ratings are typically at zero load or at some nominal load torque if this is explicitly stated. Some examples of DC motors from eBay that will work on 5 Volts, and at prices well within the budget: 1, 2, 3. For use with a propeller, a geared motor with lower RPM but higher torque would work better, for instance this one will deliver around 700 RPM with high torque, with a 5 Volt supply. Similar motors can be found on many other sites - Radio Shack seems to be rather poorly stocked on such motors, so it would help to look further afield. Edit to address updated question: The 6 Volt motor does not seem to have current requirement specifications, but as stated above, it should work well enough with 2 of the 5 Volt panels in parallel. To successfully supply the 9 Volt motor identified in the question, a series-parallel arrangement of 4 panels (2 x 2) will work - The panels will not be able to supply the full required current under load so the motor will slow down, but neither the panels nor the motor will suffer any harm.
H: Logic gates q's on unconnected and mid-range inputs and gate output Why do TTL integrated circuits assume unconnected inputs to be at logic 1? What is fan-in and why is it important in the operation of a logic gate? What happens to the gate output of NOT logic gate when its input voltage level reaches from 0.4 V to 2.4 V? Is it possible for a gate output to receive current from other sources? If so, what amount of current can it receive? EDIT: Here are my final answers. TTL integrated circuits assume unconnected inputs to be at logic 1 because the main requirement for driving a TTL input is to pull-down the level to near 0 V which takes about 1 mA per input. Fan-in is the number of physical inputs on a gate. For example, if you need a 2-input AND gate and you have only one input, you need to add logic. [Thanks for the example, @SpehroPefhany. I need to use AND since we haven't discussed NAND yet.] There would be no certain response because it is within the noise margin. No logic gate manufacturer would guarantee how their gate circuit would interpret such signal. Yes, it could come from the voltage source and the ground. If the output terminal is connected to the form,er it is called sourcing current; to the latter, switching current. AI: I've reworded some of your questions so they make more sense to me. Why does an unconnected input to a TTL circuit appear "high"? Look at the input circuit diagram for a typical TTL gate (SN7400) with parts values shown. Can you see that at least one input must be pulled low with about 1mA of current flowing out of the input (logic "0") for the output to go high? Incidentally, it's bad practice to leave TTL inputs floating, you should tie them to \$V_{CC}\$ through a pullup resistor. What is the importance of fan-in? Fan-in is the number of physical inputs on a gate. If you need a 6-input NAND gate and you have only a 4-input, you'll need additional logic. If you have an 8-input NAND (such as an 74HC30 as shown below you need only tie the unused inputs to a logic "1". Literally midpoint between 0 and 5.0V is 2.5V, which is a valid TTL logic level "1", so the output of an inverter will be low (less than 0.4V with rated load). If you want to know what happens between 0.8 (\$V_{IL}\$) and 2.0V (\$V_{IH}\$), you can analyze, simulate or measure it from a typical schematic such as this one for the section of an SN7404 inverter. This question is quite vague. I imagine your instructor wants you to consider current supplied by inputs (fan-in). There are also other places current can go- into stray capacitance when the output switches, various leakage currents, into an oscilloscope probe or multimeter probe, into an LED-resistor indicator circuit, and so on.
H: how to draw a timing diagram for a logic circuit Hello does anybody have a guide to drawing timelines for logic circuits? For flip flops like this Basically I want to draw corresponding timeline for any circuit like this: AI: Generally, you want to show the external inputs at the top (like your diagram does), and outputs along the bottom, and then show how a change in one of the inputs affects the system. However (IMO) the timing diagram shown in your example is missing some important information: which input signals directly affect the outputs of various gates. I have added the additional information here in red: so now it is clear that when ¬S goes low, this forces Q to go high after a propagation delay tp2. Q high along with ¬R high makes ¬Q go low after propagation delay tp1. This is now a steady state and no further changes take place as a result of ¬S going low. You can get a little more elaborate, such as showing on the diagram that both ¬R high and Q high ANDed together cause ¬Q to go low. This makes it more clear that just one signal ¬S low causes Q to go high, but two signals ANDed together (¬R high and Q high) to make ¬Q low. To draw diagrams like this, you just change an input, and then follow it through all circuit to see how it changes the state of various elements. In your example. assuming the D flip-flops are positive-edge triggered (like the 74HC74), and all of the flip-flops are initially reset (Q low, ¬Q high) then a rising edge clock pulse on vstup will set the first flip-flop high. A second clock pulse on vstup will set the first flip-flop low and the second one high etc.
H: Why is the voltage output from an arduino positive? If I connect the common ground (COM) probe of my voltmeter to the positive side of a 9V battery and connect the voltage probe to the negative side, I read -9V (or thereabouts). This lines up well with my mental model of non-conventional current flow and how it's the negatively charged electron that's flowing from the negative terminal of the battery to the positive. So why is it when I connect the COM probe to the GND pin on my Arduino and the voltage pin to the 5V pin, I get a +5V reading? How does that work? Do I need to wire all of my circuits backwards when powered by an Arduino? AI: "Ground", in most electronics, is simply the place in the ciruit that we choose to call "zero volts", and use as a reference when measuring voltage elsewhere in the circuit. It is where we put the black (common) lead of our meter. In most cases these days, "Ground" is the most negative terminal of the power supply, so all voltages elsewhere will be positive. However, we do sometimes call the positive terminal of the power supply "Ground", then voltages elsewhere will be negative. It is common in analog circuits to call the midpoint of the power supply "Ground", then we will have both positive and negative voltages. When you put the common lead of your meter on the positive terminal of the 9 volt battery, you effectively declared the positive terminal as "Ground", so the meter says the negative terminal is -9 volts. If you had instead put the black (common) meter lead on the negative terminal, you would have declared the negative terminal as ground, so the poistiver terminal would be +9 volts.
H: Increase Amperage With Capacitors without any change in voltage I want to know how to increase the current/amperage without changing the amount of voltage. I found this formula: I (t) = Vs/R * e^-t/RC from this website:http://www.ehow.com/how_8780713_increase-amperage-capacitors-diodes.html but i don't unserstand how t is found, because it set to: t = 3 microseconds how did they calculate that t is 3 microseconds? can anyone give me sample and how (e^-2) = 0.8, becouse i'm getting it to be: 0.13533528323 AI: Unfortunately, a lot of information on eHow is of very low quality. The eHow article defines "t is the elapsed time since the power supply was turned on" If you connect a source of electricity with a fixed voltage (constant voltage supply) to a capacitor through a resistor, the capacitor will charge, the current that flows will be initially large but will decrease over time. The formula describes that. simulate this circuit – Schematic created using CircuitLab $$I = \frac{V}{R}e^{-t/RC} $$ Note that the exponent of \$e\$ is \$\frac{-t}{RC}\$ See http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capchg.html I want to know how to increase the current/amperage without changing the amount of voltage. A capacitor can act as a short-term store of energy that can be released in a short burst over a small amount of time if your load occasionally requires more power than your power supply can deliver. A capacitor cannot make a 12V DC 1A power supply into a 12V DC 2A power supply. Amperage in the most basic sense, is what controls the amount of work that can be done from a constant voltage. The circuit that would need to be added to the capacitor would be a resistor with ohm value of 2000 connected to a Darlington pair of transistors. Amperage can also be increased through the usage of magnets. (Wink)
H: Simulation of inverting summing amplifier not working and finding it's parameters I have a project to create circuit of inverting summing amplifier with 3 inputs and a simulation on it. I am using capture (OrCAD Pspice) and so far I got to the circuit you see below, at the end of this wall of text. The circuit is supposed to have the following parameters: Av1 = 1 Av2 = 2 Av3 = 3 f max = 20kHz And that's it. Since I do not have the value of any resistors I should use in my circuit I have picked a random number - in my case: Rf = -6k Ohm Ri1 = 6k Ohm Ri2 = 3k Ohm Ri3 = 2k Ohm Please note that I am not even sure that Rf can have negative value, but if it doesn't I am not really sure how I can make the voltage gain positive as the equation is: Av1 = -(Rf/Ri1) The second problem is that I can not get the simulation to work. I am not sure which one should I use (probably the AC sweep?), but I have tried using Time Domain, DC Sweep, AC sweep, Bias points. Not even one of them worked. I tried changing the sources between AC and DC, but I keep getting flat only lines. The only thing that works in my simulation is that with increasing the voltage through resistors their current increases. I am pretty sure the simulation I get should look something like the one shown here - I tried to make my circuit diagram pretty much the same to the one in that post, but it still doesn't work. Here is the diagram itself: AI: Here's the pin-out of a 741: - Please note the following: - Positive supply is to pin 7 not pin 5 Negative supply is to pin 4 not pin 1 Negative feedback is from output to the inverting input NOT the non-inverting input The gain is inverting i.e. the minus sign is associated with the gain being inverted as in +1v becomes -1v therefore Rf is a positive value.
H: Calculating Impedance for capacitor in AC circuit with some undefined waveform I need to set up equations for some simple AC circuit. The problem is that I dont know the formula, definition for the resistance. I know for the 1/2*PI()*f*C, but I think this is only valid for the sin, cos, waveforms. My question: is the formel 1/2*PI*f*C valid for other waveforms, and if not, what is the most basic formel. Thank you AI: You could try THE most basic formula for a capacitor namely Q = CV which leads to: - \$\dfrac{dQ}{dt} = C \dfrac{dV}{dt}\$ and this leads to: - \$ I = C \dfrac{dV}{dt}\$ In other words if you know the formula for the applied voltage, V, you can differentiate it and derive an expression for current AND, V divided by current could be described as the dynamic impedance for the capacitor. It's a bit unusual to state it this way but it may help.
H: What are the consequences of oversizing resistors? When building a circuit to power an LED, we use Ohms law to calculate the required resistance, then to calculate the required wattage of the resistor. Suppose this formula dictates a 1/8 W resistor, and I instead use a 1W or a 100W resistor of the correct resistance. What will happen? AI: In your example, you've paid too much money and the part is huge (especially the 100W part). If the LED current is an AC signal (PWM or whatever) the 100W resistor may have a lot of inductance, which will change the way the circuit behaves. On the other hand, the ratings of resistors are conditional on a bunch of things, such as mounting, surrounding PCB patterns (especially SMT resistors) and, of course, ambient temperature. The number in the part description is just sort of a rough guide, you really have to drill down using datasheets and part series manuals and other manufacturer's data to get the details. You should also consider odd conditions such as extremes of input voltage, what happens if an LED shorts out, and so on. It is also not a good idea to get too close to the maximum ratings if you want long life. Using a 1/4W part for 1/8W actual dissipation is not a bad idea. Using a 1W part might make sense if it's a high-reliability design or you have a bunch of them on hand. Using a 100W part is silly.
H: Step up DC-DC converter for powering Raspberry Pi from batteries I will power a Raspberry PI with 4 NIMH batteries, but they quickly lose charge, and end up at 3V instead of the 5V needed. I was wondering about a DC-DC step up converter. I want a converter that will have a fixed output and will not be affected by the input voltage. E.g. This may transform 3V to 5V, but when the batteries are fully charged at 5V, I want the converter to output 5V too rather than 7V for example which will damage the PI. I was thinking of using this converter, would this work? XL6009 DC-DC Step Up Boost Voltage Converter Power AI: seems like you answered your own question... a buck-boost would be optimal, but a boost would also do the trick. Here is a simple boost circuit you can build yourself:
H: Are some implementations of SPICE more accurate than others? Just like the title says. Is there one single SPICE back-end that's the same for different versions of SPICE, or are the different versions performing different simulations? AI: The general approach to SPICE simulation is more or less the same for different SPICE simulators...the fundamental laws of circuit analysis haven't changed. What will vary from simulator to simulator and across versions of the same simulator are the techniques used to do numerical integration, achieve convergence, and avoid round-off errors. For elements like transistors there are a variety of models (sets of equations) that can be used, and you may find a variety of model parameters (the coefficients for the equations) for a given part number. I'm not sure that either of the choices you offer in your question are quite right. It's not clear what you mean by "back-end", "the same", or "different simulations".
H: Changing iron's pilot lamp connection, will it still work? I have restored a Rowenta E5291 heavy clothing iron, a remake of a vintage model, and I changed the pilot lamp's connection. I made this change because this iron can never be turned off unless you unplug it so I modified the bimetal switch to allow it to be turned off when turning the button to the lowest setting. Everything worked good but it was still heating because the lamp was still directing the power to the heater so I have changed it in the following way: Diagram of the wiring before and after the modification But I am worried that it might blow up the lamp or trigger the breaker box. Since I strongly doubt I can find a replacement for the lamp, in case it gets busted, I would like to hear from anyone if this will work as I expect or if it will cause any problem. Mind you that I am very amateur but I did check for continuity with a multimeter and everything looked good (Unplugged from the wall). AI: The modification will work but the sense of the indication changes entirely: In original schematic, the lamp would turn on when the switch was off (open), and would turn off when the switch was on (closed). In the modified version, the lamp will turn on when the switch is on, and off when the switch is off. The voltage across the lamp when it is lit would be the same in either case, so the lamp should last as long as in the earlier mode.
H: AC solenoid valve with DC I have a 24VAC/60Hz solenoid. I used 12VDC just to try, and it worked good (well needless to say it worked as expected with 24VAC/60Hz). What are the effects of a solenoid that's designed for AC running with DC? Applied force does not seem to be a problem in this case, so I think the main issue would be heat, as it is not running on the power source it was designed/optimized for. Technically speaking, what types of losses should be expected? AI: It's ampere-turns that produce the magnetic field to attract the moving part of a solenoid and operating at AC means the inductance of the coil comes into play and there is a limiting impedance restricting current. At DC the solenoid dc resistance may be very low and to get it to work correctly might mean operating it at quite low dc voltages compared to the ac operating voltage. If you try running it at 24V dc it could easily burn-out so be careful. The dc voltage should be chosen so that the current is approximately the same as the RMS ac current at 24V AC.
H: PIC18 microseconds counter I want to count microseconds between timer's ON/OFF. My FOSC is 48 MHz. I figured out timer1 would need to be initialized like (I'm programming in mplab): // Freq = 1000000.00 Hz - Period = 0.000001 seconds T1CONbits.T1CKPS1 = 0; // Prescaler rate T1CONbits.T1CKPS0 = 0; // 1:1 T1CONbits.T1OSCEN = 1; // Oscillator enable control bit 1 = on T1CONbits.T1SYNC = 1; // External Clock Input Synchronization Control bit...1 = Do not synchronize T1CONbits.TMR1CS = 0; // Timer1 Clock Source Select bit...0 = Internal clock (FOSC/4) T1CONbits.TMR1ON = 0; // disable timer TMR1H = 255; // preset for MSB register TMR1L = 253; // preset for LSB register And later timing: T1CONbits.TMR1ON = 1; ... some work ... T1CONbits.TMR1ON = 0; us = (TMR1H<<8) + (TMR1L); It's not working correctly. Probably because of timer's overflow. How do i deal with this correctly? AI: Some things don't make sense. Timer 1 has no period register, only a prescaler that can do powers of 2 from 1 to 8. You can't therefore time µs directly. The oscillator of 48 MHz means a 12 MHz instruction clock, so you would have to divide by 12 to get µs. However, you gave no justification for why you need to measure µs exactly, so we can assume you can use something else roughly in that range and scale later if it really matters. Since you seem to be trying to measure code cycles, I'd set up the prescaler for 8, which is the largest you can do anyway. That will increment the timer at 12 MHz / 8 = 1.5 MHz rate, which is every 667 ns. The maximum interval you can time is 65535 counts, which is 43.7 ms. If you try to time something longer than that, information will be lost due to timer wrap-around. You have no comments in your code indicating what you think each setting does. Shame on you! I'm not going to spend a lot of time diagnosing irresponsibly written code. However, I happened to notice you have the timer 1 oscillator enabled. Without comments we can't tell what you think the purpose of that is, or whether you really intended that or not.
H: Should I define default register values in start up code? It has come to my attention that some ARM programmers set some CPU registers with values that are the same default values of the register on microcontroller reset. For example: the default value of IOCON_PIO2_9, parameter MODE on LCP1114 is 0x02 (pull-up resistor enabled). In Olimex's example code this value is set to 0x02 in software initialization but this is already the default value. This behavior occurs with many other registers. Why would someone do that? In my opinion, this extra code just pollutes everything and make code readability worse. Is this a good programming practice? AI: To make code modular. If your A/D routine, for example, always sets up the A/D completely for whatever mode it uses it in, then that routine can be called at any time whether immediately after powerup or after the A/D was used in some other way. Code may jump back to the startup location to do a software reset. In that case, the settings may not be at the powerup default values. The powerup defaults may be different on different processors, so setting them in code makes the code more portable. It documents what the settings are. If these registers are explicitly set on startup, then someone looking at the code doesn't have to go digging in the datasheet to see what they are set to. It documents that you care. Let the hardware default the settings you aren't using, but explicitly set the ones you rely on. This may alert some future maintainer to the importance of these particular settings.
H: What is "transformer connected" vs. "direct connected" for a electricity meter? I am looking at sub electricity meters. Right now I am reading about the ABB product line EQ. In the documentation (link to PDF, "Electricity Meters - For modular enclosures and DIN rail"), they split the products into two categories, the ones that are "transformer connected" and the ones that are "direct connected". If I read the documentation correctly, they also call the "transformer connected" by the acronym "CTVT". I've tried to look this up, also without luck. What does that mean? I only know a bit more than highschool physics, so please try to give an answer that a non-engineer can understand. If that is possible :) AI: In order to measure power (and sum that up to get the energy flow), the instrument needs to measure both the voltage and the current. When voltages and currents are relatively low, it makes sense to run wires directly to the instrument, hence "direct connected". If the currents are relatively large, the wires become thick and expensive, and the control panel might be a bit remote. Also, the connections on a typical instrument won't handle very high currents. Such high currents can also be quite dangerous because fault currents could be high enough to cause arc flash injuries. So, a Current Transformer (CT) is installed on the high current line (typically a toroid or square donut shape and the high current wire simply passes through, forming a one-turn primary). The secondary current is much less, often 5 Amperes at full scale (which might be 100A or more on the main conductor). The same thing is true of voltages- a 240V input is no problem with reasonable clearances, but a 1kV wire would cause headaches- thick insulation and danger. To solve this problem a potential transformer (also called a voltage transformer (VT) can be used to step the voltage down to something more compatible with instrumentation. These items are classed as "Instrument Transformers". The operating principles are generally the same as any other transformer, but they are optimized for the intended application. One interesting quirk is that a CT is typically operated with the output almost shorted so the input current determines the output current, and not the load. If the output load is removed from a current transformer (because the wire breaks, for example), there is quite a bit of transformer core in there (to get good accuracy under normal conditions), so the output voltage can rise enough to be a hazard to someone poking around. For residential smart meters, every penny is important because of the high volumes, and some use high-current shunts (direct connect) but CTs are not unknown. In the below photo of a North American residential smart meter you can see the two "hot" lines pass through the CT in opposite directions. Since they're 180° out of phase, they add. Since the two hot lines are assumed to be balanced (in voltage), there's no need to measure the neutral current.
H: Are there rules for selecting wire gauge for single-pulse applications? I'm trying to size wire for UL 508a panels. I have UL's wire gauge requirements, but those requirements are for continuous use. The device I'm designing will only run for two seconds, with minutes or hours between runs. Since currents of interest are 25, 50, 100, and 200 amps, there's a lot to be saved by not using wire rated for continuous use! Is there a proper way to size wire for pulse applications like this? If the continuous ampacity of (for example) 75C copper stranded 4 AWG is 85 amps, how much can I run for two seconds? Is there some rule of thumb? Some equation? A table? Appropriate application of calculus? AI: If this question were in a physics exam, I would answer it as follows; whether this is a sensible idea in practice is entirely another matter. One would have to be pretty certain that no fault state could leave current flowing for more than two seconds. We know from the specification of the wire the resistance per metre R and mass of copper per metre M. Given the current, I, we know that the power dissipated in the wire is I^2 R per metre. The total heat energy dissipated per metre of wire is therefore E=I^2 R t, where t=2 seconds is the time that the current is active for. We (conservatively) estimate that negligible heat leaves the copper wire during this 2 seconds, and therefore the rise in temperature T is given by T=E/(MC) = I^2 R t / (MC) where C is the specific heat capacity of copper. A wire needs to be chosen with R and M such that this temperature rise T is acceptable.
H: Inverting OpAmp with reference voltage Can anyone please explain how to calculate Vout for both cases below? 1 case, simulation shows Vout is -1V 2 case, simulation shows Vout is +2V! I understand how things work when there is a virtual ground, but when there is a reference voltage applied and resistor on the feedback, I can not get the logic where -1V and +2V came from. AI: In the negative feedback configuration, the op amp will drive its output such that the voltage between its positive and negative inputs is (ideally) zero. In the first example, the positive input is at 3V. Therefore the op amp will drive the negative input to 3V. So R1 will have 2V across it, and therefore 2mA through it; this 2mA all flows through R2 (no current flows into input because an ideal op amp has infinite input impedance), so there is 4V drop across R2. Therefore the output is 3V - 4V = -1V. Apply the same reasoning in the second example. You can solve for the output voltage symbolically by summing the currents at the negative input: $$ \frac{V_3-V_4}{R_1} + \frac{V_{out}-V_4}{R_2} = 0 $$
H: What is the maximum output current of an OP27? How much current can an OP27 supply (happily) ? The closest thing I can find on the datasheet is the short-circuit current (~30mA). AI: I think this is as close as you can get to an answer It basically shows you the max current vs output load, all it takes is a division between the voltage and resistance. As you can see it's about 40mA for 4v at 100 Ohm or 10v at 250 Ohm but as the load resistance increases the max current drops
H: Capacitor with op-amp if we connect a capacitor with charge = 5 volts , with buffer (op-amp) , will the capacitor will discharge it's voltage ? or because of high impedance will keep it's charge ? simulate this circuit – Schematic created using CircuitLab AI: In the ideal sense, that capacitor will hold its charge for a very long time because of the high input impedance of the FET input opamp, and slowly leak to ground. In reality, the circuit probably isn't very useful, as the bias current from the positive input of the amplfier has nowhere to go but that capacitor, so your amplifier output will probably eventually saturate at the positive or negative rail, depending on the direction of the bias current.
H: op-amp and capacitor 2 if i have the following circuit , what the expected behaviour of the following caps ? , it will be charge and discharge very quickly since we have a low inpedance form op-amp? simulate this circuit – Schematic created using CircuitLab AI: I expect this will oscillate or otherwise not behave as you intend. The TL081 is supposedly unity gain stable, but it is unlikely stable at unity gain and with such a large capacitive load. Even if the opamp were ideal, your circuit doesn't make sense. A perfect ideal opamp would drive its output to whatever it takes. The cap would just cause lots of current whenever it changes its output voltage. If your intent is to low pass filter the output, put a resistor in series with the opamp output before the cap. A better answer for a low pass filter using these components is to put the resistor followed by cap to groun on the input of the opamp.
H: When do we use all pins in RS-232 cable? I think the minimum for simplex communication are TX so we can transmit and the power supply pins +Vcc and GND. That is all we need. When do we need to use all 9 pins of RS-232? I think that the reciever can decipher when data has started coming in and if it knows the baud rate already, it also knows when the latch the incoming bits. Therefore, I don't see the purpose of all the remaining pins on the RS-232 cable besides TX, RX, +Vcc and GND. Do we still need them? The problem is that I wish to connect a PC to a waveform generator through RS-232 cable. I have the software for this installed on the PC but no RS-232 cable. If I do make my own using RS-232 connectors (which is what I intend) with my own wires soldered to it, how do I know if I just need TX, RX, +Vcc and GND or if I need all the other pins as well? Soldering all the pins is not such a hard thing to do anyway, but I am just curious. AI: The RS-232 standard was originally specified to support connections between Data Terminal Equipment (DTE) such as computers, teletypes and video display terminals and Data Communications Equipment (DCE) such as modems and Automatic Calling Units (ACUs). At the time, DCE did not have any internal intelligence, so dedicated signals were designed into the RS-232 specification to manage specific features that were common to such equipment, such as flow control, on-hook/off-hook status and call progress. Nowadays, modems have their own microprocessors, so it's actually easier (and cheaper) to ignore the dedicated signals in the RS-232 connector and do everything over the serial data lines, using the ubiquitous "AT" protocol.
H: Low cost high precision linear position sensor I am trying to find a low cost high accuracy linear position sensor that can be used in a hobby 3D printer. Almost all current 3D printer designs rely on stepper motors to provide positioning but I want something that works on positioning info rather than assuming the motor will do what it's told. After a few hours of searching I have found lots of technologies that provide high accuracy sensing but they are all sold by companies who tailor make a whole system for application and require that you request a quote. I am assuming that things are probably insanely expensive and not something for a hobbyist. I am obviously not a professional and would just like to find out if any of you know of a technology I can use that should not really be more expensive than stepper motors? PS. The type of accuracy I am looking for is about 0,01mm. AI: You can use the optical part of a very sensitive laser mouse for a PC. I have seen that type of optical system provide extremely good resolution - and cost is down where you want it. This one appears to have around 0.02mm resolution: http://www.parallax.com/sites/default/files/downloads/28560-MouseSensor-MCS-12086-Datasheet.pdf I am sure you can get something better. Be prepared to work a lot with the algorithms to get reliable absolute position. Good thing is you know the approximate speed and position already plus you can have a consistent good surface to track on. Let me know how it goes?
H: GPIO/PCIe programing I want to connect a PCIe 16x 3.0 GPU card to a Raspberry pi. I don't mind lo loose bandwidth, i just want to use the core GPU capabilities. So, the only idea that came out to my mind is to use the 26 GPIO RPi pins. I am concern about the GPIO/PCIe programing, do not have any idea neither an approach. Is this a crazy a idea ? can somebody help me to get a big picture of what i must to do ? AI: Your best bet would probably be to check whether a PLX PCIe bridge would be usable for this purpose. It's highly likely that abandoning this idea of using a Raspberry Pi and instead using something that has a PCIe port built in instead will be vastly easier and cheaper.