text
stringlengths
83
79.5k
H: Pulldown resistor on output pin, how does output still work? On a part I'm working with, it says that you can configure the part to operate in a particular mode by "strapping" a particular pin to ground. That is, it wants you to use a pulldown resistor to pull it to ground. From what I understand, when this part starts up, the pins are inputs, so the pin gets pulled down, which tells the part to be in X mode. I believe microcontrollers are like this as well, where all pins are inputs when it starts up or after it resets. What confuses me is that after the part starts up, this is an output. It's basically connected to ground through this resistor. How could there still be an output if it's basically tied to ground? Let's say it's supposed to output a signal to, I dunno, a microcontroller. Whenever it outputs, wouldn't that current all go to ground and not end up at the microcontroller? Thanks for the help! AI: You have two modes. Input The input is high-impedance, so there won't flow any current, apart from a small leakage current, which we'll ignore for the moment. Let's say you have a 10 kΩ pull-down resistor. Since there doesn't flow any current into or out of the input there won't be any current through the resistor, and then, due to Ohm's Law there won't be any voltage across it either. So if the low end is 0 V, so will be the input. The controller sees it as a low level. Output Whether the output is high or low, it's low impedance, like for instance 10 Ω. Low won't be a problem: the pull-down already made the level low, and the low impedance of the output only enforces this. If the output is high, the internal 10 Ω resistor and the 10 kΩ pull-down form a resistor divider. The output voltage will then be \$ V_{out} = \dfrac{10 k\Omega}{10 k\Omega + 10\Omega} 5 V = 4.995 V \$ So the pull-down resistor changes the output voltage only very slightly, thanks to the big difference in resistance.
H: Ideas to measure 2D position of an object constrained to X-Y plane I am working on a project, and an aspect has come up where I would like to measure (track continuously) the X and Y position of an object across a 2D plane. The object is moved by a person, with the object's movement constrained to the 2D plane (so no Z-axis displacement). Constraints: I would like measured position resolution of 1 mm, ideally 0.5 mm or better. The space over which the object moves is 30 cm X 30 cm. Whatever method of measurement I use shouldn't significantly constrict the movement of the object. Also, please just assume that the plane on which the object moves is air, and NOT an actual solid surface (for project-specific reasons that are hard to verbalize). The good news is: The object is completely OK to be modified as necessary (LED on top, or string attachments, or anything else). What might be a method to get that kind of resolution? I am considering various approaches, but I don't know if any of them will fulfill the resolution requirement. Since there aren't many constraints on my existing system, I am OK with even a complex / bulky implementation, just as long as it's precise enough. Here are a couple of my ideas so far: (1) Infrared-based range sensors (only need two actually) (2) Two long calipers/micrometers connected from the object to the sides (3) Two strings, each connected from the object to a freely bending strain gage leaf on the side AI: Idea 4: This will give you the best accuracy. You will need the following: 2x Precision linear slides. 2x Precision linear encoders. 2x Metal linkages. Attach a linear encoder to each linear slide. Arrange the two slides 90º apart, and attach the object to the sliders using the linkages. Linear encoders like this are used for precision measurement applications. Using this method you could easily achieve 0.01mm resolution, and 0.1mm accuracy, and will probably do much better than that.
H: Reference source for copper conductivity vs. temperature I am looking for a curve for copper conductivity vs. temperature over the -55°C to +180°C range (covers std. ranges of semiconductors plus NEMA class H insulation in the case of magnetics / motors) but cannot seem to find anything searching on the internet. I have heard that it depends on the particular copper alloy as well, I'm just looking for "normal" copper found in electrical wire. Does anyone have a reference that would include this information? I'm not looking for a linear approximation (the Wikipedia page on conductivity lists copper conductivity and its temperature coefficient at 20°C) but rather a curve. AI: Data from NIST (table 2) At low temperatures the resistivity of copper approaches a "residual" resistivity. However, this isn't really a concern until below ~100K. At higher temperatures the resistivity is best approximated with a linear increase vs. temperature (as you've already found). I plotted the resitivity vs. temperature, and I wouldn't be too worried about non-linearity too much until ~800K.
H: Optoisolate 2MHz SPI communication I need to isolate the SPI communication between two chips. The bottleneck of the communication is on the slave, which apparently can handle up to 2MHz SPI clock frequency. My idea is to do this isolation using optocouplers. On this first attempt, I used the 4n35. It was just not working, so I looked on the datasheet and I saw the chip takes 10 us to rise and 10 us to lower the signal (on the worst case). This makes its use pointless. Can someone suggest me an optocoupler that can: be fast enought for this purpose (2MHz, but 1MHz is also acceptable) be easy to buy and not expensive I searched over the internet for an optocoupler that met those requirements, but I couldn't find one that was most recommendable. I'm open to suggestions on how to isolate the communication in a different way, if it's practical. AI: Borges, there are isolated devices made specifically for digital isolation and even for SPI busses. Texas Instruments and Analog Devices both make these. It's capacitive or magnetic isolation instead of optical isolation. Here is a link to popular device: ISO7241C @ TI.com It's also available on digikey: ISO7241CDW @ Digikey
H: Know any manufacturer of beeswax capacitors? Other than Jupiter. I need to replace a vintage beewax capacitor. I don't want other types of waxes. AI: To answer your question, Aerovox makes beeswax capacitors. You may also google bumblebee capacitors. FYI, you catch more flys with honey (or in this case you catch more bee capacitors,) so you may want to at least be helpfull with people who are trying to help you in your search!
H: Methods to accurately move an object across a 2-D plane This is the opposite/complement of my previous question, which concerned measuring the precise position of an object as it is moved/drawn by someone over a short duration. Assuming I use one of @Rocketmagnet's suggested approaches (probably using linear encoders), next: Suppose I have tracked/recorded the X-Y position data as an object is moved arbitrarily through some pattern across a 2-D plane by someone: Goal: Now I would like the object to replicate that same recorded movement pattern, i.e., I would like the object to move through those same X-Y positions -- but automated this time. In other words, I would like the system to carry/displace the object from the recorded (X1, Y1) to (X2, Y2) to (X3, Y3) and so on. Again, completely constrained to a 2D plane/surface, like so: Constraints: I would like fairly controlled/accurate movement of the object, with no greater than 0.5mm error. The domain of points for the object to move will extends across a 30cm X 30cm square. Exact duration/path between points is NOT critical -- since I will have a fairly well-populated point set (so it will already be pretty close to continuous movement). The one potential solution I have considered for this (and I think one that is easy to implement) is to use motors placed on the edges but somehow connected to the object. But I am not sure how to connect them in a way that allows 2 degrees of freedom simultaneously, and moreover, I'm not sure how/if it's possible to attain the desired movement accuracy using motors. So my question is: What are potential methods I can try for this kind of accurately controlled 2-dimensional movement? There are very few physical limitations on my setup as it currently stands, so I am open to toying with (reasonable) implementations of any level of complexity! One piece of good news is: Since I will have a precise measurement/tracking system (from the previous question), it would be possible to integrate feedback / calibrate during the movement, which I suppose will be essential if I want to assure the 0.5 mm maximum error. EDIT: In case the exact application is of interest: The system is my attempt at a simplified electronics-art demo of action-replication, i.e., a person's action is recorded and it is then duplicated either after a period, or on a duplicate system nearby. I initially tried working with shape memory alloys (nitinol specifically), but recording a 3-D movement of a multi-point shape was not easy (FAR from it!), hence my simplification to a "single-point" object across a 2-D plane. AI: You might as well combine the measurement and replication into one system. Let me start with my previous answer to your question: Idea 4 You already have linear bearings and encoders set up to measure the motion of the object. Now all you need to do is to actuate those bearings. Normally, if you were building something like a CNC milling machine, and you wanted to actuate linear motions, you'd use a ballscrew and a stepper motor. The problem with these is that they are not back-drivable, and therefore you won't be able to move the object yourself. Two options: Add force sensors (using strain gauges). Now the system can detect you pushing on the object, and it will drive the motor to create the illusion that there's no motor there at all. This can work extremely well if you do it carefully, and if the motor is fast enough. This is known as active compliance. Use linear motors. These are completely back-drivable when unpowered. The good news is that, if you can afford it, you can buy complete linear motor motion systems from companies like Aerotech or Baldor Motion. Alternatively, you can ask a small robotic engineering company to build you the whole system. Again, these systems are very accurate. They're used where 0.01mm accuracy is a common requirement, and even 0.001mm accuracy (but then you really need a temperature controlled environment).
H: electrical switch controlled remotely via mobile bluetooth arduino Without arduino what other ways? If I use arduino should I use ardunioBT and write a mobile software for communicating with arduinoBT. Or using Amarino with a arduino board is better (as amarino has a software portion already). Also there are many arduino board version, which one is good to start with. Thanks for your help AI: Are you simply asking if it is possible to switch an electrical circuit using Bluetooth? Or do you specifically have to use an Arduino for some reason? If so the answer is yes. I'm not sure from your question if you must use an Arduino or you're asking how to do it without one. Without the Arduino, you can use an RN-41 from Roving Networks. The RN41 has some general purpose I/O pins. After the RN41 is paired with the host Bluetooth controller, you can send commands to it to control outputs. One of these outputs can drive a relay. The question of how to control a relay from a logic level output has been answered here many times, so you can search for that solution. There are other Bluetooth devices that have built in I/O, but that one is easily available and cheap. With the Arduino, you have more flexibility, since any pair of Bluetooth devices supporting SPP (Serial Port Protocol) will allow you to set up a wireless serial connection between devices. Now you can send control messages wirelessly from your PC, etc to the Arduino which is then responsible for controlling the relay.
H: Ultrasonic rangefinder (for beginner) I'm quite beginner in electronics. So, to begin with, I wanted to make a simple (?) ultrasonic rangefinder, based on microcontroller. So I had a few questions for experienced in electronics: What would be the best environment for development - breadboard, or something else ? What would be best to use: sender and receiver as one unit (example: BPU-1640TOAH12) or a separate units for sending and receiving: Velleman MA40A5S (send) and MA40A5R (receive). If it matters, I would like to measure a distance up to 5 meters. What is a typical power supply source for such a circuitry ? At least in development. Batteries ? Or something else ? What parameter (voltage, current) would affect the output signal strength ? Do I need to have some advanced op-amp chains (or some other amplification elements) ? What microcontroller should I be using ? Should be very cheap and simple(= without extra unutilized features). What would you recommend ? What about using "Proteus" ? Should I trust this program ? Is it any good ? P.S I'm NOT interested in Arduino. AI: 1 . Breadboard or Stripboard will be fine for prototyping/learning purposes. FOr the latter you need to have basic skills with a soldering iron. Either should be fine for basic distance sensing. You have more control with separate units , for instance if you want the receiver and transmitter to have different polar patterns (sensitivity angle - you could put one in a tube to make it more directional for example) or slightly different angles (for whatever reason) Can be powered by any reasonably clean ~5-12VDC >250mA supply (probably get away with less but 250mA is easy and makes sure you have plenty for additional stuff like LEDs, LCD, etc) This could be a DC wall brick, batteries, etc. You will need a regulator (e.g. 3.3V LDO) for your micro but the transducers can be powered directly (up to 20V rms according to Velleman page) You will need a couple of general purpose transistors (NPN or N-ch MOSFET - BC337-40 is a good choice) to switch the transmitter with, as you will want to use the higher voltage input rail (rather than the regulated micro rail) for extra range. Any small 8-bit micro with a couple of timers, a PWM peripheral (a comparator/ADC would be nice) will do for simple sensing and display on e.g. LCD. This could be a PIC16F, PIC18F, AVR of some sort, MSP430, etc. You can get simple dev boards or "starter packs" for all these micros that will get you up and running quickly. For example with a PIC16F you can use MPLAB/MPLABX to write your code on, and use a PICkit3 to program the chip with. Here is an 18F pack that includes dev board and PICkit3. Lots more boards here. I assume you mean using Proteus for development (I have only seen it's PCB design part) This is okay if you want to go that way, Proteus has a pretty good rep from what I have heard. Personally though, I would stick with the tools provided by the people who make the chips (unless they don't provide anything) I have used MPLAB for all my PIC development and it's a very solid platform. MPLABX is the next generation IDE, based on Netbeans.
H: male-male VGA cable wiring I need to build a VGA cable (assemble connectors to wire). I need a male-male cable. Is its wiring straight or cross? (should i connect 1-1,2-2,... or something else) Thanks AI: Yes, all VGA cables are wired 1-to-1, whether they are regular male-male cables or the relatively rarer male-female extension cables. The equipment at either end always has a female connector, and they're all wired the same way.
H: How is etalon important to tunable lasers? Tunable lasers utilize some kind of feedback in order to maintain the same optical intensity. I've read that there is some kind of etalon trans-impedance amplifier that works in order to generate the output necessary for this feedback. I'd like to know how the reflecting surfaces of the etalon generate the analog signal that is necessary for feedback. AI: Tunable lasers utilize some kind of feedback in order to maintain the same optical intensity. This is not correct. In fact, lasers do involve feedback, but it is a positive feedback mechanism, not negative feedback. That means that the feedback is not what maintains the optical intensity. Lasers are essentially optical oscillators. There is a positive feedback mechanism and a gain mechanism that work together to sustain an oscillation. The feedback mechanism tends to cause the output power to increase exponentially without limit. However the gain mechanism is only able to support as much power output from the laser as is put into it in the pumping process. So it is the gain mechanism (or gain medium) that maintains or limits the laser's output intensity, not the feedback. I've read that there is some kind of etalon trans-impedance amplifier that works in order to generate the output necessary for this feedback. Again this is incorrect. An etalon (as the term is usually used) is simply two flat reflecting surfaces parallel to each other. Light reflecting back and forth between the two surfaces of an etalon is one possible way to set up the feedback mechanism to produce a laser. However, practical lasers more often use either curved mirrors or more complex optical arrangements (waveguides in the most common types of semiconductor laser) to minimize diffractive losses and increase the laser efficiency. Also, an etalon is not an amplifier. The amplifier in the laser is usually some other material placed in the cavity. For example, it could be a piece of semiconductor, or certain other types of crystal (ruby, for example), or a stream of dye-bearing liquid. Also, the amplifier used in a laser is not a transimpedance amplifier. A transimpedance amplifier is an electrical amplifier, but a laser requires an optical amplifier. I'd like to know how the reflecting surfaces of the etalon generate the analog signal that is necessary for feedback. Now, how can you set up a laser to produce a well-controlled output power? We could simply limit the input pump power to the laser. But then, if the laser's efficiency drifted (which it will do, due to temperature shifts, etc), the laser output power would change. What we can do is pick off a small portion of the laser beam, either from inside the laser cavity or from the laser output, and direct that to a photodiode. Then the photodiode output can be used to control the pump power in such a way to maintain the laser output power. The etalon (if the laser has one) is not particularly involved in this control circuit. In this case, the control circuit would normally be a negative feedback circuit. And almost universally, a transimpedance amplifier would be used to convert the photodiode signal into a voltage that can be amplified in the rest of the control circuit. But the details of the control circuit are entirely under the control of the designer. There's no fixed designs that are used, or that are applicable to all kinds of lasers. The control circuit would be designed to account for the dynamics of the laser action, the kind of control signal needed to control the pump mechanism, the required stability of the output intensity, etc. Tunable lasers So far I haven't even talked about tunable lasers. Everything above applies more or less to any kind of laser, tunable or otherwise. But tunable lasers get even more complicated, because you want to control not just the output intensity but also the wavelength. In this case, if the laser cavity is formed by an etalon, shifting the spacing between the etalon surfaces can be a means of controlling the wavelength. In this case the etalon is an actuator that sets the wavelength, it is not a sensor that tests the wavelength, and it is not an amplifier. It would also be possible to use a (second) etalon outside the laser, in a second pick-off beam, to test the wavelength and use that to drive a feedback mechanism to tune the laser. Here, the etalon would be used essentially as a narrow-band band-pass filter to detect whether the laser output wavelength matches the desired wavelength or not. A photodiode after the etalon and additional amplifier components would be used to convert the etalon output into a signal that could be used to adjust the laser tuning mechanism. In either case, the tuning range of an etalon is quite small, and their use as either tuning mechanism or in the sensing path would be limited to cases where only very fine adjustments to the laser wavelength are required.
H: Powering RGB LED's and using a PWM chip; series or parallel? I'm working on a hobby project where I will be using an Arduino board and a TLC 5940 to control 5 different groups of RGB LED's. The number of LED's in any particular group will not necessarily match the number in another group i.e. there may be 20 in one group but 24 in another. I'm trying to figure out the best way to wire up these LED's. I'm probably going to have on the neighborhood of 50+ LED's total so using one TLC pin for each pin on the LED's is completely out of the question. If I can do it I would like to only use one TLC chip though that is not a requirement; I will start to run into space issues if I need to use more than 2 or 3 though. Ideally with 5 groups of LED's and 3 pins per group I could do it with only one TLC chip since they have 16 channels. I'm pretty new to electronics so I'm trying to figure out the best way to wire this up. They are all going to be powered from a hobby RC battery pack, probably from an RC helicopter or something. My LED's want 30mA, 3.2v, and the TLC is a constant current driver so if it was just one LED I'd rig up the correct resistor to make it 30mA and go. But since I need to run a bunch of LED off of one pin I have a couple choices. If I have a 20 LED group and run them parallel then I would need to set the TLC for 600mA correct? And if I run them all series I would need a 64 volt power source; is that correct? So do I want to do those or some combination of series-parallel. Current RC battery backs like the ones I'm considering seem to be 7v or 11v. As I said this is a hobby project so absolute stability is not an overwhelming concern. That in mind is the TLC enough of a current limiter for the application or will I want to be adding additional ones inside whatever circuit I work out? Like these LM317 chips: http://users.telenet.be/davshomepage/current-source.htm Also am I correct in assuming that if one of my groups has 24 LED's and another has 20 I can have the second group mimic the first by adding in 4 resistors that drop 3.2v each? That way I could have both groups run off the same TLC chip since they would need the same current limit. My guess is that I'll be best off running them all parallel and once I know exactly how many LED I will have I'll need to do the heat dissipation math for the TLC to figure out how many chips I need to spread it across. Is there a better way? As I said I'm still new to electronics. Your patience and support is appreciated. If I'm missing any obvious considerations or am completely off in my understanding of how this works please let me know. AI: What you have guessed is correct -- if you want to run the LEDs in parallel, then you need to be able to source 600mA. If you run in series, then your power supply needs to supply at least 64V. I don't know the specifics for selecting the ideal power rail, but I would certainly shoot for >64V and put in the current limiting resistor. A resistor on its own doesn't "drop 3.2V each" -- the voltage drop across a resistor is IxR, so the actual drop depends upon the current going through the circuit. You can calculator or measure the current going through your other group(s) of LEDs, and then pick the appropriate resistor for the mismatched group so that the current is the same.
H: LiPo vs. NiMH for kid's toy I've been researching here and on google regarding potential battery technologies for a toy that I want to make for my kids. I was hoping to get others' perspectives on this, keeping in mind that this is for a child. I'm trying to look at this from all angles, but safety is the most important. Here are the things I have come up with: volatility: can the cell explode if mistreated, i.e. charged too long, toy thrown around, etc. lifespan: does my son have to keep an eye on the toy to make sure it's always charged? size: can I even fit the cell in the toy? cost: cheaper is obviously better Have I missed anything obvious? As far as those four points go, here is what I have found from my research so far: volatility: LiPo sure sounds like you have to be more careful. There are battery packs that have overvoltage and undervoltage protection circuitry built-in, but I would like to see if I can find an off-board circuit that can be built for less money since that's NRE and cells might need to be changed. Battery management ICs like the MCP73831 should help, as well as a fuel gauge like the MAX17043. Not sure if there's anything else I can do. NiMH has similar ICs available, like the DS2715 for charging and the BQ2014NS-D120 fuel gauge. Either technology would probably benefit from a temperature sensor / cutoff of some kind. LiPo looks like it does not like shock, so having the toy thrown onto the pavement might not be a good thing. lifespan: LiPo shouldn't be allowed to discharge below a threshold voltage. Neither should NiMH. Need to check if fuel gauge can cut off toy's circuit if below threshold. size: LiPo has the huge advantage here. At 3.7V per cell, I only need a 1S LiPo, and they come in all kinds of (small) sizes. NiMH will likely require 3 1/3-AAA cells, which I should still be able to fit. cost: LiPo batteries without protection circuitry are super cheap, like $2 in single quantities. The ones I have found with protection circuitry are larger and 4x the price. The NiMH 1/3-AAA cells I found were about the same price. No mention of protection circuitry so I don't know if that's important if I have the battery management IC (same goes for LiPo) I'd love to hear what others have to say about these points. Did I miss anything really critical, and just as importantly, did I post any bad information about these two battery types? EDIT -- I have added LiFePO4 as suggested by Russell and AndreKr. I don't necessarily trust myself to design a proper circuit that is bulletproof, so I am looking at the MCP73123 since its current limitations are within the range of the single cell that I want to charge. I saw the Tenergy cells previously, but wasn't sure about them and ended up ordering a few of these from a shop in the US: http://www.batteryspace.com/LiFePO4-Rechargeable-14430-Cell-3.2V-400-mAh-0.4A-Rate-1.28Wh.aspx. I really like how they can be ordered with tabs attached, which is what I did. So right now I have a LiPo protected cell and MCP73831-based charger coming from Sparkfun so I can play with it, as well as the Powerizer LiFePO4 cell and a sample of the MCP73123 which I'll somehow try to breadboard to test its charging capability. I'm going to look around, but if anyone knows of good app notes to make a PIC-based LiFePO4 charger that explains constant-current source circuits, I'm all ears! Thank you for your input. AI: LiPo is MUCH easier to manage well than NimH. Energy densities for top capacity NimH are about the same as LiPo nowadays. (That was written in 2012. In 2021 LiPo energy densities are now typically somewhat higher). NimH is a relatively hard battery chemistry to manage well. Charging at low rates is not usually advised and negative voltage deflection under charge or temperature rise are the usual end-of-charge detection methods. In contrast, LiPo is charged at constant-current until a set voltage is reached and then at constant-voltage until current falls to a preset level. LiPo will accept any lower-than-maximum rate of charge if desired, and can be recharged from any state-of-charge with no special conditions. (Handling very low voltage cells is slightly more complex, but all sensible charger ICs handle this - and very low voltage should never be allowed to happen.) The ONLY reason I would think of using NimH in your context is safety - and if it was my son, I'd consider that I could make LiPo safe enough for him to use. LiPo can "melt down" very enthusiastically with flame, BUT it is extremely rare in practice and taking quite usual precautions should allow a safe result. I would have no personal concerns over LiPo safety in a competently engineered system. HOWEVER, NEVER use unprotected LiPo cells if you care about safety. The in-battery protection IC DOES NOT serve the same roles as the charger ICs do. The in-battery ones are just to stop people from doing stupidly dangerous things to the battery. That said, IF your charger is properly implemented, and if there is no chance of short or fire potential then most of the protection circuitry is not needed. I say "most" because, if there is e.g. a catastrophic equipment failure and e.g. a short circuit occurs, the in-cell circuitry will usually open-circuit the cell and prevent a fire. Using the proper charger ICs should allow a very safe and reliable charger to be implemented. You do not need gas gauging per se - just low voltage cut-out. If you can stop operation at say 3V / cell, that should be enough. Protected cells should not cost vastly more. If they do, it MAY indicate that the cheap ones are bad ones. You can get utter junk LiIon batteries (and you'd hope to get a price advantage when buying junk :-) - if you were silly enough to buy them. There are enough reputable brand cells around that buying them probably does not cost vastly more. Ensuring that the cells are genuine is another matter. As a working position I suggest you start by assuming that anything bought from a low cost Chinese supplier is fake or out of spec and THEN try and prove otherwise. (NB: Racism? - definitely not!. It's based on experience - many visits to China and time in factories, etc. China is very, very large and has a vast range of sellers in a very competitive market place. In a casual sale, expect a certain portion of the sellers to be 'dodgy' at best.) Added: I was going to come back and mention LiFePO4 - AndreKr beat me to it. Compared to LiPo, LiFePO4 (Lithium Ferro Phosphate) are safer, longer life and have lower energy density. You can buy RCR123A LiFePO4 batteries with 450 mAh x 3.2V capacity. (Some claim up to about 700 mAh but are suspect.) Tenergy LiFePO4 RC123A are widely advertised on ebay and should be good. Tenergy are AFAIK a "rebadger" BUT seem to sell good product. LiFePO4 MUST be charged properly, but are as easy as LiPo to manage. A very simple charger can be built using a constant-current regulator followed by a 3.6V constant-voltage regulator. This setup charges at constant current until Vlimit is reached, and then at constant V. Setting to 3.5V is better. Here is a randomly found seller of Tenergy LiFePO4 RCR123A batteries. They also sell chargers. NOTE: Do NOT use Lithium Ion RC123 (3.6V nominal). Do not use 3.0V Lithium Primary RC123. The terms RC123, RC123A, RCR123, RCR123A etc are used somewhat interchangeably by sellers. Just be sure of what you are getting.
H: How can I find temperature of microcontroller? In some boards which environment temperature goes up could cause high temperature in micro controller. This will effect on micro and bad situation maybe occurs. For example I have designed a device which used in a box. This box was near a motor and after some load to motor I encountered a high temperature near micro. So, anyone could help me if there is any solution for finding temperature of micro? This micro could be AVR or PIC. If micro could find it's temperature, it could terminate working before any bad damage. AI: At least some (I don't know about all of them) AVRs have a temperature sensor on-chip, which is connected to the ADC. The temperature measurement is based on an on-chip temperature sensor that is coupled to a single ended ADC channel. The sensor is a diode that produces a temperature dependent voltage. This voltage is measured with the ADC. The voltage has a linear relationship to temperature and the result has approximately a 1 LSB/°C correlation to temperature. (from this application note) A number of PIC devices also have an internal temperature indicator, like the PIC16F15xx and 16F18xx. This family of devices is equipped with a temperature circuit designed to measure the operating temperature of the silicon die. The circuit’s range of operating temperature falls between -40°C and +85°C. The output is a voltage that is proportional to the device temperature. The output of the temperature indicator is internally connected to the device ADC. The circuit may be used as a temperature threshold detector or a more accurate temperature indicator, depending on the level of calibration performed. A one-point calibration allows the circuit to indicate a temperature closely surrounding that point. A two-point calibration allows the circuit to sense the entire range of temperature more accurately. (from this datasheet) Further reading AVR122: Calibration of the AVR's internal temperature reference, Atmel application note, Using the AVR internal temperature sensor, PIC16F15xx datasheet, p.133 AN1333: Use and Calibration of the Internal Temperature Indicator, Microchip application note,
H: Bluetooth SPP (Serial Port Protocol) and Cobra Tag I have been trying to build something similar to the Cobra Tag (Check out the video). I have written a prototype android app which uses SPP to connect to a bluetooth module and exchange commands, which is working great. But, i have a few queries From what appears, does Cobra Tag also use SPP or any proprietary custom profile ? I am able to connect to a single device over SPP and do the data exchange, how do i go about connecting to multiple devices simultaneously. Does Bluetooth/SPP support that ? Should i be using any other bluetooth profile/protocol which would be more efficient for this purpose ? AI: Check the Cobra Tags FAQ Answer to first and second question. Can I use a Cobra or other manufacturer’s Bluetooth headset for handsfree talking while using this product? Yes you can. The Cobra Tag uses a different Bluetooth communication link than the headsets (called serial port profile) so they can both work together. How many Cobra Tags can be connected to one mobile phone? The maximum number with some phones is 7. The maximum number that can be paired with iOS devices is 1. This is based on a technology limitation. It seems that some phones can’t simultaneously handle 7 Tags and are better off with 1-5 maximum. Answer to Third question. SPP emulates a serial cable to provide a simple substitute for existing RS-232. Architecture of cobra tag shows it doesn't need complex data manipulation and just requires a few set of commands for its operation. I'll suggest sticking to this profile only.
H: How do I calculate necessary mosfet turn on/turn off time? I'm trying to measure capacitance of C1 using this design: Everything works from 3.3V. The mosfets is my addition to it - i want to discharge the capacitor after each half-cycle. Everything works OK in low frequencies, but i want to run it on 8Mhz and then it seems, mosfets do not turn on in time. Even more - performance depends on R3 - i had to lower it from 12K to 1K for this to work at 1Mhz. If i want to discharge C1 in 62.5ns, how do I go about designing this - what mosfet parameters do I look up and what calculations do I make? How gate resistance influences turn on speed? From what i see 2N7002 has 6ns turn on delay time 4ns rise time 20ns turn off delay time 5ns fall time if I add it up - it's far less than 62ns. Datasheet of 2N7002 Edit Made an inverter as adviced by @rawbrawb AI: Your second mosfet is beng turned on through R3. F3db = 1/(2*pi*30 pf* 1KOhm) = 5.3 MHz - full settling occurs at 6 time constants => ~ 884 Khz. gate cap = 30 pF from datasheet Replace R3 with PMOS transistor to form an inverter.
H: Diode between VCC and GND I was having a look at some guitar effect circuits and came across with a company that offers PCBs for some well known circuits. I have noticed that most of ther circuits have a 1N4001 (D1) placed between VCC and GND, without any kind of resistor in series. This one, for example: At first I thought it was meant to avoid reverse biasing the transistors, but risking the power supply by placing it in parallel doesn't make much sense to me. I think it would be better to place it in series to the source or, if needing to keep that parallel setup, at least put a resistor in series to the diode to avoid a direct short circuit. I just would like to know if the circuit is wrong or I am missing something. Thank you very much. AI: I nearly always put such a 'fools diode' in my circuit, even when I am breadboarding. Reverse power will kill most of the chips I use. Over-current protection is a function for the power supply, not for the powered circuit. This makes more sense: most power supplies are current limited in the first place, think of basic batteries, and 7805-like regulated power supplies (but NOT NiMh accu packs!) Having the protection in the attached circuit will not protect against an error in the circuit, or the wring to the circuit, so it must still be complement by a protection in the supply I build much more powered circuits than I build power supplies, so it makes more economic sense to put the current limiting in the supply. When I use a battery (NiMh etc) that does not inherently limit its current I add a fuse, polyfuse or the like (often the battery supplier has already done this). A series resistor is often not practical because it makes the voltage the circuit sees dependent on the current it consumes. You circuit is fed by 9V, most likely it is intended to be fed by a 9V battery, which is current limited by itself (unless maybe when it is an NiMh 9V pack? or are those protected in any way?) If you are really worried I suggest you either put a fuse or polyfuse between the battery and this circuit, or as your circuit probably draws very little current and probably can live with a small voltage drop, put an schottky diode in series (an 1N5819 will drop ~ 0.4V at 100mA). This circuit was probably designed long before schottky diodes became common place.
H: Can Grid Dip Oscillator (GDO) detect WiFi, Bluetooth and NFC? Can I use GDO to detect those waves? Can I buy one somewhere or I need to build one? I would to have digital one, that will just show the frequency of the waves. AI: No, a grid-dip oscillator is fundamentally a signal generator, not a signal detector. It is used to measure the characteristics of passive circuits such as RF tanks and and antennas, by measuring how they absorb energy at various frequencies. What you're looking for would be a frequency counter that has an antenna connected to its input. The display will show the frequency of the strongest signal that the antenna is picking up.
H: Inductor ground, where to put it So I'm building a tachometer for my car. It's pretty simple, basically I have a wire wrapped around the spark plug wire about 10 times, and the 30-50k volts travelling through the spark plug wire should be sufficient to induce a small current through the wire wrapped around it. I'm detecting the voltage in an arduino and then doing a simple calculation to figure out the RPM. So, I set this all up, and I have no idea where to put the ground. Now, if I just have one end of the inductor wire going to the arduino, through a diode and then voltage divider, the whole thing works, which doesn't make any sense to me, the other end of the inductor wire is just floating in the air, not connected to anything. Here's what it looks like Thanks for any ideas. Like I said, this works, and it's giving moderately stable results, but I can't figure out why it works or how. AI: Actually, you can't detect current in a wire by wrapping another wire around it. The magnetic field of the first wire doesn't couple to the second wire. If you think about it a bit, you'll realize that they're essentially at right angles to each other. Wires need to be parallel in order to couple inductively. If you want to pick up the spark pulse inductively, as many timing lights, etc. do, you'll need to put a ferrite toroid around the ignition wire, and then wrap your sense wire around the ferrite (by passing it multiple times through the hole), too.
H: Antenna that can be used for large range of frequences? Is there an antenna or device that can be used for WiFi, NFC, bluetooth, GSM for use with a frequency counter to measure the frequency of the waves? AI: For laboratory use, it is common to use a Log-periodic antenna, which is well-behaved over a large frequency range. Anyway, it will be quite tricky to try to feed the antenna directly to a frequency counter and get a result for the signals you want. You will need a spectrum analyzer, and even then some will be quite tricky to identify (most notably the spread spectrum signals).
H: RF Antenna Frequency I'm curious as to the ability of an antenna designed for a specific wavelength, to work on another wavelength. For example, I have a half wave antenna that is 1.5m long, which would be ideal for a 100MHz signal. Now would that same 1.5m antenna work well on a 150MHz signal, or an even higher frequency? At what point would it no longer work? Are there any quantities that are minimized? AI: An antenna that resonates at one frequency (e.g., 100 MHz) will also resonate at odd multiples of that frequency (e.g., 300, 500, MHz, etc.). However, the radiation pattern will be different on each of those frequencies. At the lowest frequency, the maximum sensitivity will be broadside to the wire. At higher frequencies, it will shift toward the ends of the wire.
H: Connect two Ac to Dc adaptors in series I have a modem with a rating of 10 VDC and 1A but I dont have a adaptor for it. Instead I have two 5VDC and 1A adaptors. Just wanted to know if I connect these adaptors in series would It work ? AI: This will probably work OK provided that the outputs are both isolated. ie if both outputs have one side, say -ve, connected to input ground, then they cannot be combined in series. This would be unusual. In most cases the outputs will be fully floating for DC relative to the inputs. Some supplies will have a capacitor between output (usually negative) and input ground. Usually in the 0.01 - 0.1 uF range. This MAY produce some interesting noise results for circuits that cared but should cause no problem when used as you propose. Connection is A-ve to B+ve A+ve = 10 VDC +ve out. B-ve = 10V DC-ve out In very rare cases it is conceivable that two switching regulators might go into some form of interactive oscillatory mode, but this would be extremely rare if it happened at all.
H: Is it possible to connect a reed switch to two separate arduino boards? I'd like to add a bit of redundancy to a security system. I use reed switches for doors. How can i safely connect the same reed switch to two separate arduino boards? (the boards are not connected between them in any way, they use separate adapters). AI: ... How can i safely connect the same reed switch to two separate Arduino boards? (the boards are not connected between them in any way, they use separate adapters). If they are not electrically connected and if you wish to maintain the isolation you could use an optoisolator or similar. The reed switch could provide current via the LED in the opto isolator or voltage switched by the reed switch could apply voltage to a resistor connected to the LED. A reed could drive 2 x LEDs in two optoisolators this way this way if it had its own power supply or using the power supply from one Arduino. Placing the LED from an optoisolator in series with the reed switch adds a reliability hazrad - if the LED fails then the input fails on both Arduinos. Placing a few diodes or a zener across the LED such that Vdiode_string is slightly higher than V_LED_on will protect against LED failure as long as there is enough drive voltage. There are other isolating means available but an opt-oisolator is about as easy and cheap as any. If you do not wish to maintain isolation then by connecting the two systems' grounds together you could share a sensor. But, isolated systems seem with having in the context. One mode of attacking a security system is to use a TASER or electric cattle prod or similar. This tends to be poorly tolerated [tm] in most cases. If you wish half your system to live long enough to report the other half's death when under TASER attack you will need to rate the cross coupling isolators accordingly. One method I've heard of is to use a dummy video camera which is presented as first line target. It's health is monitored by the system proper. It's role is to act as a honey-pot TASER-attack sensor. [I won't tell you what country I heard about this from :-) ].
H: Log Periodic antenna Design What are the specific formulas for designing a LP antenna? Values like boom length, spacing, number of segments needed, and segment width? desired range is 500 to 5000MHz. Thanks! AI: You are liable to find much information on this from eg amateur radio sites such as ARRL or RSGB, but also from many other websites. Stack Exchange does not permit me to tell you what tool may be suitable for finding this information by yourself. Yee Ha !!! - Log Periodeic design program Looks superb. Seems to be formula based version of above page Links to 20 LP design articles Some excellent links wil; be available from here - hover over to get brief summaries You tube video - some value only but not really "design" video
H: How to find a DIP component implementing this simple logic? I need to implement this logic in a very simple circuit. It will be perfect if I can use a single component in a DIP package, implementing the logic. How can I find one? AI: That's a 1-to-2 demultiplexer, where the lower input is the select line. You can use a 74HC237 3-to-8 demultiplexer for this. (They don't make the smaller versions like 1-to-2 in DIL package). Use A0 and A1 for inputs, and Y1 and Y3 for outputs. Make LE, E1 and A2 low, E2 high. Then you have the following truth table: A1 A0 Y1 Y3 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 So A0 is your data input, A1 is the output selector: low selects Y1, high selects Y3. You can use other input-output combinations for the same IC to achieve this, or for instance use Y0 and Y2 instead of Y1 and Y3 to get inverted outputs when selected. This is the full truth table from the datasheet:
H: Algorithm for value range mapping My question perhaps belongs to general ability test or something like that. It is not directly related to Embedded devices. I have been given a variable resister which can rotate infinitely and is of 10kΩ. ADC is set for value range 0 to 1023 sampling. By which I've to control light luminosity/intensity. The ADC value range is divided into 32 steps for 1024/32 levels of brightness. The issue is the pot has to be rotated 16 times to get to extremities. Which is very harassing. Now its time when I can't change the pot hardware but the firmware. I thought of doing as follows, please help me from here: I'll choose a range window within the [0 1023], say of 32 steps. Lets ignore the ADC noise for now. Then we have 32 steps in that 32 step windows. If I start from 0, the intensity will be increasing till 32. The 32 is max intensity possible. Then if I rotate more, the intensity should remain maximum at 32 all the way till 1023. And as soon as it is started to decrease from 1023, I will have decrease in intensity till ( 1023-32 ) and will remain at 0 intensity all the way till 0. if I rotate back from any place it should follow the above explained moving window rule. How to start with it? I did as follows: void processADC_data() { ushort adc0 = (ushort)ADC_DATA; adc0_Avg = adc0; // If Noise /* ushort adc0_L = (ushort)(adc0 - 40); ushort adc0_H = (ushort)(adc0 + 40); adc0 = (ushort)read_ADC( adc0_L,adc0_H ); adc0_Avg = adc0 * 20 + adc0_Avg * 80; adc0_Avg /= 100; */ IsInceasing = (adc0_last - adc0_Avg) < 0 ; adc0_last = adc0_Avg; if (IsInceasing) { // Extrimity has to be handled if (!HasPerformedIncreased) { adc0_center = (ushort)(adc0_Avg - window); HasPerformedIncreased = true; HasPerformedDecrease = false; } else if (HasPerformedIncreased) { IsCrossingLimit = ( (adc0_Avg - adc0_center) > window ); if(IsCrossingLimit) { adc0_Avg = LIGHT_SENS_MAX; IsCrossingLimit = false; } else { adc0_Avg = (ushort)(adc0_Avg / LIGHT_SENS_MAX); } } //judge_brightness(adc0_Avg); } else { // Extrimity has to be handled if (!HasPerformedDecrease) { adc0_center = (ushort)(adc0_Avg + window); HasPerformedDecrease = true; HasPerformedIncreased = false; } else if (HasPerformedDecrease) { IsCrossingLimit = ( (adc0_center - adc0_Avg) > window ); if(IsCrossingLimit) { adc0_Avg = LIGHT_SENS_MIN; IsCrossingLimit = false; } else { adc0_Avg = (ushort)(adc0_Avg / LIGHT_SENS_MAX); } } } brightness(adc0_Avg); } Thanks AI: in pseudocode // initialization previous = ADC() brightness = 0 process ADC: new = ADC() // must use towards-0 division! // divide-by-2 because each 1024/16 turn must give 32 steps delta = ( new - previous ) / 2 if( delta > 0 ): brightness = min( brightness + delta, maximum ) previous = new if( delta < 0 ): brightness = max( brightness - delta, minimum ) previous = new
H: Ideas to stack multiple PCBs on top of each other? My design has a number of boards stacked on top of each other. I would like to connect signals across the boards. The boards all need the same 10 signals running through them (all boards from top to bottom), so that simplifies it a bit. What could be a possible solution (or type of part) that is simple but also inexpensive for this type of design? I am OK with any type of connector (vertical, parallel, right-angle, press-to-fit, contact-based, etc.) or architecture really, because if it would allow this type of multi-board passage of the signals, it would bring significant convenience to my design. Relevant points: MOST important: I would like the spacing between the boards less than 5 mm. Otherwise, it would make my overall design prohibitively tall. My standard go-to for just two boards would have been a male-female header-socket combo. But, in the multiple-board case, if I were to have female sockets/receptacles on the top of each board and male header pins on the bottom of each board, then overlap creates an issue with the soldering/placement. I also considered female sockets/receptacles which have lengthy/extended male ends (so that the same socket could be used as female and male), but these are rather expensive. The stacked-board count varies for each of several slight variations of my basic design, so I would ideally like a method that works for a variable number of stacked boards. The number of layers is currently 2 (two) but if necessary, I am open to making the board 4-layer or greater. AI: Board to board connectors are what you're looking for. SMT of course
H: Measure weights with arduino I want to measure weights with arduino. After the measurements, i want to analyze the weight data of the measured objects.Precision is not very important, but it should be work in the range of 10 to 100 kilograms. Is there a force-sensing socket, weight-sensor or something similar for Arduino that i can use? AI: PIEZO speakers can be used as a sensor to force. I guess they could be placed on a point to become a scale. Very DIY.
H: TLC 5940 PWM driver blank input and pull-up resistor I've read some of the data sheet for the TLC 5940 and it states the following about the BLANK input: Blank all outputs. When BLANK = H, all OUTn outputs are forced OFF. GS counter is also reset. When BLANK = L, OUTn are controlled by grayscale PWM control. Looking at this image: ... from the Arduino playground about using the TLC chip with Arduino it shows a 10k pull-up resistor to reset the chips when the device is turned on. I read about pull-up resistors so I get that when power is supplied the resistor allows BLANK to read a high input. What I don't get though is how the chip works after that. I don't see anything that sets BLANK to low. How is the BLANK input getting set to LOW so the device can operate normally? AI: The BLANK pin(s) on the TLC5940(s), in addition to being pulled high by the 10k resistor, are also tied to pin 10 of the Arduino (labeled "BLANK", the blue wire). This allows the Arduino firmware to drive the pin low when needed.
H: Kinect data to a microcontroller Before I begin, I understand this is a very broad and open ended question, please be patient with me. I am a complete newbie to this. After looking around I found various ways of interacting withe the Kinect sensor. ROS, OpenCV, Processing,Matlab.... But they all seem to need a PC in between. Is there a way to transfer data to a microcontroller like Arduino directly and processing the data ( say depth image like a matrix) without a PC? I would assume there are some C frameworks that would be available for this. AI: Even if you could get the data into an 8-bit microcontroller like an Arduino, it would be completely inadequate to process it. According to Wikipedia, the depth information streaming out of the Kinect is 640x480, 11-bits of resolution. That's about 600 kB of raw data for each frame, and the frame rate is 30 Hz. So, we need to crank through about 18 MB of data each second. This isn't too big of a challenge for a PC, but it's of the league of something like an Arduino. Instead, you may have better luck using something like a Raspberry Pi. It has a 32-bit ARM microprocessor running at 700 MHz, 256 MB of RAM, and a GPU. It's basically a PC from 8 years ago on a single board.
H: controlling canon camera i have a canon EOS 550D and i want to control it from computer. i had good result with taking photos with an ir led, arduino, and multi camera ir control library but i want to control also focus, and, if it is possible, the exposition (f number and time). i've tried to have a look but i don't understand if it is possible to control via ir led, or i have to build a remote jack simulation, or even is it is possible only with official sdk. i even can take into account a gear system like this: http://www.instructables.com/id/Arduino-Lens-Controller-Synchronized-ZoomFocus-/ AI: The official way is to use the Canon developer SDK: http://www.usa.canon.com/cusa/consumer/standard_display/sdk_homepage You have to sign up for it but surprisingly it wasn't really a pain to do. I was working on a small photobooth project and I explained that to them and they let us in and gave us the code (no charge or verification, think I had to sign an NDA). This was a little while ago but I used it in C and then later a C# program to do remote capture, setup camera settings, do auto focus etc. It's actually pretty easy to use, and the documentation is great. There's also an open source program called gphoto that might help you too, depending on how down and dirty you want to get. It lists your camera as supported: http://www.gphoto.org/doc/remote/ Good Luck!
H: VHDL - How to reduce signal's dependencies and optimize speed? I'm wondering how to optimize comparison a wide counter value with few defined values. Maybe it will be easier if I show it on example - let say there is a receiver that gets data in well defined format - 1004, 8-bit symbols are grouped in one frame. In every CLK cycle one 8-bit symbol appears on receiver input. The last four symbols in frame are sequence number, that helps the receiver to find boundaries of frames. So, useful data that should be forwarded to next module are 1000 symbols. But, these symbols are also grouped in 4 smaller subframes, 250 symbols each one. Subframes are aligned to bigger frame's boundary - 1st symbol of bigger frame is also first symbol of 1st subframe. I would like to filter out sequence symbols in big frame, forward encapsulated data to next module and set additional output signal that shows subframes' beginnings. My fist idea was to build state machine that looks where are big frames boundaries. If it catches sync sequence few times, it goes to sync state. Then use 10-bit counter that counts every symbols. On counter values 0, 250, 500, 750 would be subframes' 1st symbols (that I can signalise to next module by additional output signal - call it StartOut), and on counter values 1000-1003 the next module should be disabled, to skip sync sequence. Unfortunately this solution is not so good - output signals Enable and StartOut are functions of 10 bits. There are some logic (including 10-bit comparators) that slows down output signals' maximum speed. It becomes more limited if big frame size increases, and 16-bit counter is needed. Searching StackExchange I found this question: vhdl synthesis optimization: counters in statemachines. There is shown an idea how to reduce output signal dependency, and make it a function of only one 1-bit signal. But it works rather with counting to one value. Here is a problem of one counter and few values that should be compared with it. Do you have any idea how to improve speed in comparison counter with few constant values? AI: In general, the usual answer to this sort of problem is to pipeline. You might consider adding pipeline registers immediately after the 10-bit comparators, before the logic that combines them into the enable signal for the next stage. To keep the resulting enable signal aligned with the correct data in the data path, you'll probably also need a pipeline register for the data, too. But yes, you can also use the technique described in the other question. For your specific 10-bit counter example, instead of counting from 0 to 1003 and using a comparator to identify state 999 to turn off the enable signal, you could make it an 11-bit counter that counts from -1000 to 3. The MSB of this counter is your enable signal, and when the count gets to 3[1], you reload the counter with -1000 ... and also load an auxiliary 9-bit count-down counter with the value 249. Each time this auxiliary counter reaches -1 (MSB set) is the start of another subframe (in addition to the one that starts at the beginning of the main frame). [1]Note that detecting "3" is a function of just 3 bits — the MSB and the two LSBs — not a function of 11 bits.
H: Altium Error? What is this reddish box? I've been to a couple introductory Altium trainings and everything goes fine and dandy. This is the actual first board I am working on by myself. I've been learning so much just by doing stuff myself but there is something that I can't seem to quite understand. Whenever I transfer my schematic to the PCB is is placed inside this reddish box, I believe it is a Room. All the examples I saw during training didn't do this. And if I move the components outside the box they turn green (DRC error maybe?) Does anyone know what this means? AI: That is indeed called a "Room". Rooms are relevant if you're doing multi-channel design, as they let you copy the layout between channels. It's also completely normal. If you want to disable it, it's very easy to do: Click the room -> PCB Inspector panel -> uncheck "Rule Enabled" checkbox. "Design" menu -> "Rules" menu item -> In the tree: "Design Rules" -> "Placement" -> "Room Definition" -> uncheck all the "Enabled" checkboxes. Alternatively, you can just delete the room, but it will come back next time you synchronize the schematic to the PCB.
H: Interface a 5v pressure sensor with a 3.3v ADC I'm trying to interface a pressure sensor (MPXV6115vc6u) with a 3.3v ADC. My board is providing a 3.3v (it's a XBee power regulated board, via a Li-Po battery). To wire the MPX sensor, I need to: Step-up the 3.3v to 5v to power up the sensor Convert the 0-5v analog signal to a 0-3.3v to read the pressure value. What's the best approach, considering that pressure sensor are noise-sensitive and that my board is low-power? For 1, I can probably use a circuit like this. For 2, what should I do to keep the full range? What's the best way to minimize the number of components (~combine 1 and 2). Thanks! AI: Since your pressure sensor only uses about 6mA according to the datasheet you might be better off with a switched capacitor step up supply like this one: http://www.ti.com/lit/ds/symlink/lm2750.pdf To get your analog signal down to levels you can read you could just do a simple voltage divider. Or you could use an opamp this paper probably gives you more information than you'd care to know but there's a good circuit at the bottom of it: http://www.ti.com/lit/an/slyt173/slyt173.pdf Hope that helps.
H: LM3915 to drive more LEDs / basic questions about PNP transistors in saturation As a few others here, I'm trying to drive a few (10) LEDs from each output of a LM3915 vu-meter chip. I've read different posts, and it seems the universal recommendation is this great answer. I have, however a few difficulties understanding it in details to adapt it to my configuration (V+ = 9v, 5 rows of 2 leds). How are there R1 and R2 resistors choosen ? I see you want to reach 2mA, but I'm not sure about how to translate this to the resistor values. I also guess the LM3915 is a specific beast here, as its output current can be configured (to drive LEDs directly without resistors for example). So in my naive mind, are these two resistors necessary at all, if the output current of the chip is configured properly ? Also, is R1 only there to ensure that the transistor based is positive (instead of floating) when nothing is happening ? In that case, shouldn't its value be larger thaOr has it an additional purpose ? I think I also have to ensure that (base current * minimal Hfe) > needed output current, or is this not applicable when the transistor is used in saturation ? AI: R1 is there to make sure T1 won't conduct if the 3915's output is off. When off there may still be a small leakage current. This won't do any harm if the output drives LEDs directly, but if you drive an external transistor with it the leakage current will be amplified, and the LEDs may light up very slightly, though maybe only visible in the dark. In any case, it's easy to prevent that. Imagine the 3915 slowly increasing its current. At for instance 10 µA that current will go through R1, not T1's base. Why? 10 µA through 1 kΩ is 10 mV, and that's far below the 0.7 V T1 needs to begin conducting. So even 100 µA will only drop 100 mV, and still no base current. It's only when the current exceeds 700 µA that T1 begins to conduct. Because the emitter-base voltage will be 0.7 V the current through R1 will be limited to that 700 µA, what the 3915 will draw more comes from T1's base. In hindsight R1 may well be increased to 10 kΩ, then T1 will begin to conduct at 70 µA, which will well be above the 3915's leakage current. Since the 3915's outputs are current sinks R2 is not really necessary to limit the current. But without R2 almost the full power supply voltage (minus 0.7 V) will be across the output, and then the device's dissipation may become too high. Hence R2, to take some of that voltage, and the power which goes with it. You'll have to dimension R2 such that \$I_B \times h_{FE}\$ > required \$I_C\$, like you say. Note that for a transistor in saturation \$h_{FE}\$ is much lower than the value specified in the datasheet, so a base current of a couple tens of mA is no luxe. Check the transistor's datasheet for the maximum allowed base current.
H: Attaching a LED to PIC's Rx pin I need some way to know whether the microcontroller (PIC) is receiving (or transmitting) any data. So I thought of keeping a separate LED so that it'll blink when any data transfer occur. But I need to know how to attach this LED. Is it OK to directly attach an LED to PICs Tx (and Rx) pins? I mean will it affect the transferring data in some way (like by dropping out the voltage etc...). AI: (At least some) PICs can't drive much current(*), but also for the RxD pin you better use a transistor to drive the LED, since you'll avoid loading the transmitter at the other end (probably a MAX3232 or similar?). Connect the input "Q" to the TxD/RxD line. A typical general purpose transistor will have a gain of about 100, then 1 mA base current is enough to get 20 mA collector current. For a 5 V bus and power supply: choose \$R_B\$ = 3.9 kΩ, then the base current will be (5 V - 0.7 V)/ 3.9 kΩ = 1.1 mA. To limit the collector current to 20 mA (typical indicator LED) \$R\$ should be (5 V - 2 V)/ 20 mA = 150 Ω. For a 3.3 V bus and power supply, use the same equations, replacing 5 V by 3.3 V, then your resistor values will be 2.2 kΩ and 47 Ω resp. A MOSFET like AndrejaKo suggests is a good alternative, but make sure you have a logic level gate type, with a maximum gate threshold voltage somewhat below the bus voltage. (There are logic level gate FETs where that can be as high as 4 V and then you won't get enough drain current with a 3.3 V bus voltage.) The real advantage of the FET is that it needs hardly any drive current, but since we only need a mA for the BJT we won't have any problems with that either. (*) This random PIC controller specifies a 700 mV drop at only 3 mA output current, that's a 230 Ω output resistance. A 2 V LED directly driven from a 3.3 V output will drop the output by 1 V at only 4 mA. Most indicator LEDs are specified for 20 mA.
H: Arduino Uno, weird characters sent to COM (SoftwareSerial) I'm trying to send ASCII characters from Arduino UNO to a computer serial port. I'm using a cable with a male COM connector, attached to the computer's serial port, and three wires (TX, RX and Ground) on the Arduino side. I used pins 12, 13 and Gnd as shown in the picture: And I am running this piece of code to send a string every second on the serial port: #include <SoftwareSerial.h> SoftwareSerial mySerial(13, 12); // RX, TX void setup() { mySerial.begin(9600); } void loop() { mySerial.println("Hello world"); delay(1000); } But, when I read that port (at the right 9600 speed), instead of "Hello world" I get strange characters instead: I thought I had set the pin erroneusly, so I swapped RX with TX, but I get a different but still wrong output: What am I doing wrong? AI: The Arduino UART produces TTL level signals, that is 5V for high and 0V for low. A PC's RS232 port expects full RS232 voltages which can be -9V to +9V and are inverted. Either use a TTL level serial adapter (such as those from FTDI) to interface to the PC. Or use a level converter like the MAX232.
H: CAD Schematic pin arrangement approach I was looking for related questions here, and the closest one I could find was this one: Industry Practices for Schematic Design? However, it does not address my specific question, so here goes: I am not an EE and am just trying to learn Eagle so I can break my reliance on ExpressPCB, which I have found to be okay for simple projects, but being stuck with their proprietary format, tool, and fab no longer appeals to me. In my past, limited experience with making schematics, I lay out the pins in numerical order, which is typically pin 1 to (N/2) from top to bottom on the left, then pin (N/2+1) to N from bottom to top on the right. While that's fine and all, I'm now laying out a board for the MCP73123 to test a LiFePO4 charger (because of my other post here) and noticed that in Microchip's datasheet, they lay out their schematic like this: Personally, I would think this is the way to do it, since CAD/CAE tools know what the correct pin assignments are anyway, and this looks a heck of a lot cleaner in the schematic since related pins are within close proximity of each other. So my question is simply, do you experienced PCB designers typically do this, or do you go with the numerical-order approach? What do you consider to be the pros / cons of each approach. Also, is there another methodology? AI: This is a no-brainer, use the functional layout approach. There are a lot of bad schematics out there, including professional ones, so you will see pin order schematic layout sometimes. However, it is a bad idea. Pin-order symbols is mostly laziness on the part of someone defining the part in the CAD system. Slapping everything down in the pin order is easier than digging out the full names and functions of each pin. Of course this isn't usually the stated reason. The most common excuse is that it aids in debugging. However, a little thought reveals that is not so. When you are debugging a new board, you have both the board and schematic in front of you. Think about the usual work flow. Which is more common: "I want to look at the clock line, which pin is that?", or "I want to look at pin 5, which function is that?"?. Clearly the answer is the former, by a lot. Yes, occasionally early in the debugging process you may want to go around a IC and look at the signal on every pin, but that is usually once, if at all. There are cases where pin-order helps, like for some repair work, but for every one of those there are multiple cases when function order is better. Functional pin depiction is actually better for debugging than pin-order depiction. Don't get taken in by the excuses for not spending time on the symbol definition once. Then there is the other considerable issue of schematic clarity. Here there is no contest at all. Pin order obfuscates the circuit and either forces a lot of air wires or forces other blocks to be put in inconvenient places. For more on good schematic practises, see my more lengthy writeup on the subject.
H: Why does it hase a power supply for the rs232 to rs422? We have a anemometer with RS422/485 communication, and we would like to connect to the PC, but we have only RS232 so I would like to purchase a converter, but some converter has an external power supply, some not. The maximum distance will be less than 100m. I which case do I need an RS422/485-RS232 converter with external power supply? AI: It really depends on which end of the run the converter is on. If you place it near the PC, so that the 100m run is RS-422, then a converter powered by the PC's serial port (no external supply) will probably work fine. If you want to place the converter near the sensor, so that the 100m run is RS-232, then it would probably be wise to use one that has an external supply.
H: LED and motor connected in parallel i built a vibrobot pictured above. i now want to connect a led to the working system. sadly when i connect the led in parallel, it will not work. power source is a CR2032 3V coin cell. motor is small pager dc motor. im trying to keep number of components at a minimum AI: You shouldn't be driving a red LED from a 3V coin cell. Red LED voltage drop is typically on the order of 1.8V. You're overloading the LED by doing it this way, and it is likely sinking the current that should be going to your motor. Minimally, you need a resistor in series with the LED to limit its current.
H: Covering PCB Pads I have a PCB that was poorly designed and there is a ground pad that is too close to a signal pad. As a result, the signal pad on the surface mount component will short to ground. I was looking to use some ink or other material to cover the ground pad. The pads are too small to fit Kapton tape. Are there any standard materials used to cover PCB SMT pads? Solution: I ended up cutting the pad out of the board using a very small razor blade. Picture from under a microscope of the end product: AI: Is it possible to cut the pad with a razor just to make some space? Are you getting bridging during the reflow process? If you post a picture of the offending area I think we could comment more on a suitable repair solution.
H: FCC and CE Testing / Failure Resolution I'm seriously thinking about (practically committed to) taking one of my products through FCC and EC testing and it's my first time doing so. It's Arduino based electronics running off a 16MHz crystal with an Ethernet Controller running off a 25MHz crystal and an RFM12B 433 MHz radio module. The Radio Module, as far as I can tell, doesn't have an FCC ID, but they have published data on their website that suggest compliance to FCC part 15 requirements. Everything is pretty low power here, and I'll be using an US/EU approved wall-wart power supply to provide power to the board. So what I'm worried about is what happens if my boards fail the tests? Best case is it passes and we move on, which would be great. But I'm really honestly terrified of what happens if it fails and I'm not sure how to fix it from an engineering standpoint? I've tested the boards various functionalities and it works great, I would really hate to have to go back to the drawing board especially given that I won't really know what changes might be made to fix it. I don't have a specialized staff; it's basically just me. I'm producing open source hardware and software. Most people take the really conservative and pessimistic approach when answering questions like this are not really encouraging or supportive. Can anyone give me some insight into what to expect from this process, and constructive experience on how to get through this process and resolve the types of issues that might come up? The whole thing just seems really unfriendly and forbidding to me. I know I'm not the only one out there who feels this way. I hope there are some community members who can shed light on it besides the usual gloom and doom perspective. Basically I want to be prepared for reality, but I want to know there is a light at the end of the tunnel too. AI: To Start You're going to want some things if you can get them. First would be a spectrum analyzer with quazi-peak averaging, if you can't beg borrow or steal one of those, the test lab will have one. I suppose you could try to use your scope and FFT mode but that's nowhere near as good. Then if you can buy your self a EMI sniffer probe set, mine is the 100C from Behive Eelctronics I think it cost me $300. If you don't want to buy that then you can make a poor mans probe by taking three or four loops of wire in a coil and soldering each end to a single BNC cable. But you really should have something for a probe, because even if you can't get your own analyzer I've been in labs where they let me sit with my probe and their old outdated spectrum analyzer and try to debug my problem without charging me. Oh and get yourself some copper tape it's your friend :) Keep in mind you can rent them by the month too if you can't buy one. Here's the probes: http://beehive-electronics.com/probes.html Here's a page on making your own http://www.millertechinc.com/pdf_files/MTI%20TN101%20Simplest%20EMC%20Magnetic%20Field%20Probe.htm More on making your own http://www.interferencetechnology.com/the-hf-current-probe-theory-and-application/ Here's a good analyzer I used to have, but no more http://www.tek.com/spectrum-analyzer/rsa6000 Also a quick look on ebay shows you can get under 1Ghz analyzers for around $1000 Prepping: Ok I'm guessing you didn't design your board with EMI in mind. It would be really nice if you had a nice 4 layer board, well decoupled, with power and gnd in the middle, no traces passing over split planes etc. If you don't then you should seriously weigh the cost of test chamber time VS respinning your board. Maybe your design can support a spread spectrum clock? If so great use it! I'm just trying to point out that any upfront things you do can save you a lot of money when it comes time for certification. Know your spec: To clear FCC you're going to need to pass 433Mhz intentional radiator testing, and Class B unintentional radiator Basically they're going to scan all the frequencies your board puts out and then show you if you're over the allowed levels. It will help if you know the rules going in so here are some links to what you'll need. 433Mhz intentional Radiator requirements: http://tinyurl.com/8dvjjn4 General FCC Class B Requirements http://tinyurl.com/9cqb6sp Wiki page about Class B (Title 47 CFR Part 15 is the actual title of the federal law) http://en.wikipedia.org/wiki/Title_47_CFR_Part_15 Review: One of the nice things about most certification labs is they have experts there who can review your design and your layout to point out possible problem areas, but don't expect to be able to rely on them to solve your problems for you. I would just advise you to go in with the attitude that you really don't know what you're doing in terms of compliance. Ask for help and listen as much as you can. I don't know where you plan on going but here are some places I've used: NTS http://www.nts.com/ TUV http://www.tuv.com/global/en/index.html MET labs http://www.metlabs.com/ UL http://www.ul.com/ I've also used small independent places. They can all help you but I like to pick someplace close by so I can sneak in when I need to, no one wants a two hour trip every day while working on an emissions problem. Plus sometimes other people finish early and you can get in for half a day at half price, nice when you're on a budget. Your first day radiated emmissions: Ok it's your first day you're going to do a pre-scan because you have no idea if you'll pass or not. Of course you've brought your product to the lab, and if you need any cables you've brought "really really long" versions of them. If you need a USB cable to debug you'd better have a long one cause it's going under the floor and some long distance to a room outside the chamber. They're going to put your product in the chamber on a rotating table, you're going to get it up and running and then close the door. Now this part takes a little bit, they're going to rotate your card around while moving their receiving antenna up and down. What you'll get in the end is a set of plots from different positions showing the amplitude/frequency that your card radiated. There's also going to be a line, you cross the line you fail, you don't you pass. Chances are good that on your first attempt you are going to fail, don't worry it happens all the time. AHHHH I Failed now what?: Ok you failed, but you got this cool map that basically shows you where you're failing. Maybe it's something obvious like the exact frequency your micro is running at. Or less obvious like why am I failing at 1.34Mhz??? Now this becomes a debugging process like anything else. Keep in mind in it's most simplistic form radiation is caused by current flowing in a loop. That creates EM fields, those fields radiate out from your board and the FCC gets angry. Your job is to track down these sources of noise and crush them. That's why I had you make or get a probe, now you can go back into that chamber with the probe and the analyzer and slowing move the probe around your card until you find that damned 1.34Mhz. Divide and concur is the name of the game. On more complex boards you may have the luxury of turning off parts or ripping things out and testing again. Let's say you find that an opamp seems to be the source of your noise. Well unsolder it and scan again at least that will tell you the source. Things like clocks, busses, and especially external cables all make great sources of radiation (as do hastily designed boards). Basically wash and repeat till you get an idea of where your emissions are coming from. Fixing it: I'll go back to prepping again, because anything you could have done is going to be less money and less painful than what you'll try now. There are so many possible causes and fixes, and it would be impossible to list them all. Some things you may try are using your copper tape to cover a component (or your board) and grounding it. Then scanning again, this is like having a shield on your board already. You could try lowering the edge rates of clocks or serial lines if it seems to be coming from that. Maybe cutting and re-routing a signal will help. External cables are always a struggle. You may want to try clip on ferrite beads, or other solutions there. Your lab should have a bunch of toys to play with as well as a variety of caps, resistors, and other strange things to try. My advice would be go for a day get the scan and try to isolate things. Then ask for help at the lab, and come back here and ask for more help. After each change scan it with your sniffer probe, this is also something you can do back at your office / home if you have the equipment. You can work on lowering that emmission level all day and when you think you have it go back to the chamber again. Keeps the boss off your back about costs, or keeps your stress level down if you're the boss. Don't be afraid: The first time is always scary, I've had Jr. Engineers get stuck in testing for days trying to figure things out. That can be a nightmare scenario when that $1200 a day is coming out of your pocket. If you just take your time and divide and conquer you should be able to get it. Don't be afraid to ask for more advice again and again. If I could get half the things through that we've gotten through, then you can get your board through. On spread spectrum: If your board can handle it consider using a spread spectrum clock source instead of what you use today. A SS clock bascially wobbles the main clock frequency back and forth a little bit. This helps becasue the FCC measures not your peak amplitude but your quasi peak which is a way of averaging. So by wobbilng around you lower the average amplitude of your emmissions. Most of my consumer designs use this since we were always in plastic cases. Metal Cases / Sheilding: You can always sheild your product in one way or another. Most cheap consumer goods are in plastic boxes, and most little dev boards are open air. However many products either come in some kind of metal box or enclosure or they have individual parts on the board that are sheilded. If you've ever torn apart some electronics, then no doubt you've seen parts or sections of a circuit with a little metal box with holes in it surrounding it. You can play around with some copper tape or aluminum foil when debugging to see if that helps. Just make sure you GND it, and don't short anything! I usually put down Kapton or some other tape and then put my copper tape over that. Going back to prepping one more time, it's often a good idea if you can to leave room and GND connections around parts or circuit sections so you can easily add a cage later if you have to. That way if you get stuck at the last minute at least you won't have to respin. A lot of times things that can be solved with a cage could be solved with a careful redesign, but not always. Intentional Radiator: If you have to go through this it is more expense and more of a pain in the... :) My advice for your first time since you're using a module anyway is if the module plus the antenna you're using is not pre-certified, then pick another one. Why spend your money debugging their board? To me that's the whole point of buying a module otherwise I'd just make it myself. If you decide not to, then this test is going to be similar to the one above but now they'll be looking at how your product radiates, is it within the allowed power, not interfering with adjacent bands, etc. I'm sure someone on here can explain this process better than me. I've only done it once with help. Conducted Emissions: I'll assume you're using a wall wart style power supply and not connecting to mains directly. If so that should make it a lot easier for you to pass conducted emissions test. Most manufactures provide plugs that at least pass the conducted portion of the emissions test, and if yours doesn't try another plug :) (thanks to @dext0rb for pointing that out) I'm sure I've missed some things, so if you have questions let me know. I'll be happy to try to help you through your first time. I'm sure other guys will chime in as well. It's a complex area but nothing to be afraid of.
H: What is it that strips vocals from audio when a 1/8" audio jack is partially unplugged? Every once in a while, my eighth-inch audio jack will slip loose and I'll seemingly lose only the voice part of a track -- leaving somewhat of a "karaoke" version. What I would guess about how audio plugs work suggests that I'd be making this up; however, I've asked and others tell me they've experienced this as well. What causes this stripped vocals from audio when a 1/8" audio jack is partially unplugged? AI: When the plug starts to slip out of the jack, very often it's the ground contact (sleeve) that breaks its connection first, leaving the two "hot" leads (left and right, tip and ring) still connected. With the ground open like this, both earpieces still get a signal, but now it's the "difference" signal between the left and right channels; any signal that is in-phase in both channels cancels out. Recording engineers tend to place the lead vocal signal right in the middle of the stereo image, so that's just one example of an in-phase signal that disappears when you're listening to the difference signal.
H: Is there a C671x DSP development kit with more than 16M Flash? TI's standard kit C6713DSK has only 256K bytes of Flash, which is too small for my application. Is there a third-party DSP kit that has a larger Flash like 16M bytes? AI: The Daughter Card interface of the DSK6713 is memory mapped though the same interface the on-board Flash and SDRAM is: You could buy a prototyping daughter card from Link Research and add however much memory you need for storage through that interface.
H: c18 assembly inside function problem. unidentified label (bit names) Here is the data_write function I'm looking at. I've been told that this method (from the textbook) is not good and I should be using the C method (that is currently commented out). When the Cbits method is used, any arguments after the _asm/_endasm the compiler doesn't recognize the bit names (they don't turn green). If I use only the assembly method, I get a string of errors [1111] about the undefined label (WR, GIE, EECON1, etc.) inside this function. Do I have to somehow re-define the ADC.h inside the function? Basically, all of the register names (EECON1, etc) and bit names (WR, WREN, etc.) are not recognized inside the function "data_write" if they are inside the assembly tags (_asm/_endasm). If I use the Cbits.BIT method, I get a generic syntax error and the bits following _endasm are not identified (turn green). #include <stdio.h> #include <stdlib.h> #include <p18f452.h> #include <delays.h> #include <adc.h> int result; // used in ADC result handling int write_point=0x64; // used in data_write function. initial=d100 void data_write (int write_point, int result); // declare prototype void main(void) // <==should this be 'int main (void)' b/c i'm passing result to another function ? { while (1) { // sensor 1 configured to port AN0 OpenADC(ADC_FOSC_8 & ADC_RIGHT_JUST & ADC_5ANA_0REF, ADC_CH0 & ADC_INT_OFF); //configures ADC for port AN0 = sensor 1 input ConvertADC(); // initiate conversion of sensor1 @ AN0 while(BusyADC()); // waiting to complete conversion result=ReadADC(); // read the result of sensor1 @ AN0 data_write(result, write_point); CloseADC(); } } void data_write (int write_point, int result) { /* EECON1bits.EEPGD = 0 // points to data memory EECON1bits.CFGS = 0 // access data eeprom EECON1bits.WREN = 1 // enable write to data eeprom INTCONbits.GIE=0 // disable interrupt ** if I substitute this method of bit control, this 2nd portion belongs after * the asm arguments, but the bits (WR, GIE, WREN) will not be identified * either an I get a syntax error. (of course commenting out the bcf/bsf statements) EECON1bits.WR = 1 // enable bit to start the write operation INTCONbits.GIE = 1 // re-enable interrupt EECON1bits.WREN = 0 // restores the write command to =disabled */ _asm movlw write_point // starting data memory address = data_adr movwf EEADR,A movlw result // gets data stored in "result" variable movwf EEDATA,A // places data into data memory holder bcf EECON1,EEPGD,A // points to data memory bcf EECON1,CFGS,A // access data eeprom bsf EECON1,WREN,A // enable write to data EEPROM bcf INTCON,GIE,A // disable interrupt movlw 0x55 // start flash erase sequence movwf EECON2,A movlw 0xAA movwf EECON2,A // end flash erase sequence bsf EECONN1,WR,A // enable bit to start the write operation bsf INTCON,GIE,A // re-enable interrupt bcf EECON1,WREN // restores the write command to =disabled _endasm write_point = write_point+2; // increment address by 2 if (write_point >= 0xC6) // if address >= d'198 write_point = 0x64; // resets starting point to d'100 } AI: For the commented out C part, you don't appear to have have any ending semicolons (e.g. first line should be EECON1bits.EEPGD = 0;) , so the compiler certainly won't like that. For the inline assembly, IIRC the register names hould b e usable, but I think you have to specify operands fully (e.g. instead of movwf EECON2,A you do movwf EECON2,0) It's possible the bit names must be specified by number instead of name too, for example instead of bcf EECON1,EEPGD,A you do bcf EECON1, 7, 0 (EEPGD is bit 7 of EECON1) The A at the end is not right anyway, this should be 1 or 0 (or W or F in MPASM) It's been a while since I used the inline assembly for anything like this so memory is fuzzy, but try it and let us know how it goes.
H: How can I activate a circuit with a remote control I want to make an system which can be activated by a remote control, or even by a switch. The goal is to turn on something wirelessly, something simple such as an LED. I have known that I could use a relay in order to do such thing, but I am not quite sure if it is true. What do I need in order to do it, what knowledge is required? AI: If it's line of sight, then a simple way would be to use an IR transmitter and IR detector. The transmitter can be an IR LED pulsed at the receivers frequency (use a microcontroller, 555 timer, PWM IC, etc for this) this will create a logic high at the receiver output which can be used to trigger your circuit. The transmitting driver can be something like below, using an NPN transistor driven from your PWM source (note that this example shows 36kHz, the receiver below uses 38kHz - the principle is exactly the same): At the receiver you can see how it turns into a logic high (the bottom waveform): Here is an example of a 950nm IR LED, and a 38kHz IR receiver. TO produce a logic high at the receiver, you send a stream of pulses at 38kHz with ~50% duty cycle. Related circuits: Here is a PIC based IR remote project. Simple but reasonable CD4017 based circuit. Not a great circuit, but very simple. May be informative to play around with. You may want consider buying a module like this one that can be used to control quite a hefty load (up to 12VDC/10A or 240VAC/5A) Some more reading: Remote Basics (images above from here) Adafruit on IR sensors RF solution: You say you have some walls in between the sender/receiver, so an RF solution is they way to go in this case. Since it's just an on/off signal that needs to be transmitted, we can use very simple OOK/ASK Rx/Tx modules like this one: The above is just an example, it basically just outputs at the Tx what goes in to the data pin on the Rx. There are many more on eBay if you search for "RF module", of varying types. Also places like Farnell, Mouser, Digikey sell various modules (purchasing from one of these is preferable for more complex modules as they are of a certain quality and come with a datasheet)
H: Garage Power is low...any way to boost? First of all, I'm an active StackOverflow user. This is my first time on Electrical engineering, and I HOPE this is the right place to ask this. I just moved into a new apartment. The breakerbox is no where to be seen sadly. My wife to be has told me that the garage is mine to do with as I please. So far I have placed a 46inch tv (sony bravia, older LCD, not LED), ps3, several other game systems, high powered computer, low powered HTPC, a small soundbar with sub and a couple of lamps in there. Everything is hooked up to the one outlet that is available to my setup. My AVR/batterybackup displays that it is receiving 121-122V. I have no way to convert to 220 so far as I can tell, and even if I did, I doubt my apartment management would like that very much. My AVR/Battery backup Problem: I currently have the tv, high powered computer (core-i5 oced to 3.8ghz, gefore 560ti448, 750W power supply, and 1 lamp on. The AVR is reading that it is at 70% capacity. With the ps3 on, playing a netflix video, and When I start a benchmark on the PC, it jumps to 101-105% of its capacity, and in 5 seconds, shuts itself off. The breaker has not blown, Im sure because the AVR is absorbing the overflow and not tripping it. Question: Is there anyway that I could increase the ability to power my garage without major modifications? For instance, dropping an extension cord down from the upstairs that is on another circuit is doable (fire and electrical codes not withstanding); but adding a sub-box to my breaker box is not. Im hoping there is a better way, for instance, would piggy backing a couple of higher powered AVR/battery backup units do the trick? Current Load information: Computer (basic browsing)and monitor+1 lamp: 33% - 0.173kW Same as above with TV: 64% - 0.336kW Same as above with PS3 - 85% 0.430kW Computer (running benchmark)and monitor+1 lamp: 65% - 0.362kW Thank you all for any advice/knowledge you can impart. And again, if this is not the correct subsite for this question, please let me know, or feel free to move it (if you are a mod) AI: The outlet in your garage will either be 15A or 20A, depending on the upstream breaker (hint: it's worth your trouble to find the breaker box given what you're trying to do). This equates to up to 1800VA or 2400VA for a resistive load (less for the loads you're running). If all of your man cave gear is plugged into the 875VA UPS that you linked, that is the limiting factor, not your house wiring. Get a larger UPS, run two in parallel and have them run different loads, or just use a surge suppressor and skip the battery backup for your less critical loads. From there, you could also determine if you have multiple circuits supplying power to your garage, but you're a long ways off of having to do that.
H: Mains Power indicator maximum current draw I am building a circuit like this: From here. This got me wondering how much current can I draw from a circuit like this? The question would seem to be what is the wattage of an capacitor? Edit: What I am trying to ask is can I draw 100mA or 1A? And how would that affect the components? AI: I'll assume the frequency is 50Hz,as the link says. You have: \$ (2 \cdot 120 \Omega)+(470k \Omega || 470nF)+(2 \cdot V_{FWD})+(5 \cdot LED) \$. Let's say the LEDs have \$ V_{FWD}=2V \$ \$ X_C=\frac{1}{2 \pi f C} = \frac{1Meg}{2 \cdot \pi \cdot 50 \cdot 0.47} = 6.77k \Omega \$ \$ Z_{eq} = 470k \Omega || 6.77k \Omega = 6.67 k \Omega \$ The total (RMS) current will be: \$ I_{total} = \frac{ V_{in} - 2 V_{diode} - 5 V_{LED} }{2 \cdot 120 \Omega + Z_{eq}} = \frac{230-1.4-10}{240+6670} = 31.63 mA \$ Still, due to the large capacitor's reactance compared to the total resistance, you will have a large displacement factor, plus islanding due to the forward drop voltage. The displacement will be (approximately, it doesn't include diode's/LED's resistance): \$ Z_{tot} = 2 \cdot 120 \Omega + 6.67 k \Omega = 6.91 k \Omega \$ The two 120\$ \Omega \$ are too small so we can leave them aside, therefore leaving us with: \$ \phi = arctan \frac{R}{X_C} = arctan \frac{470 k\Omega}{6.91 k\Omega} \approx 89^{\circ} \$ Which is almost pure reactive, therefore the power factor will be (considering the simplifications we made) \$ \approx \$ 1.5%. A quick simulation with the following schematic: with the following results: Which are quite close to the calculations, save the power factor who counts the distortions and harmonics, as well.
H: Tunable Lowpass Filter I would like to design and build a tunable lowpass filter. I would like to adjust the cutoff frequency from 1 MHz to 500 MHz. Requirement on the resolution would be something like 10-50 MHz, obviously, it's not that critical. I am going to send a programmable clock signal through this filter and want to reduce the high frequency harmonics. I am only using the clock signal as a simple way to get a programmable sinusoidal signal, hence the need for the filter. I was considering using the ADF4110, ADF4350, or one of the Silicon Labs Si570/571 as the programmable clock. I was told that a tunable lowpass filter over this range may be tricky, so I thought it best to consult the StackExchange. I am open to any suggestions. Ultimately, what I'm trying to accomplish is get a sinusoidal signal that will sweep from 1-500 MHz. AI: Tunable filters over this sort of range are really, really difficult to do. For reals. In high end network analysers you will find a special type of filter called a YIG filter (low end ones often don't use them because of their price) or a sweep oscillator based on a YIG VCO. Your best bet would be to just make 10 lowpass filters and switch them in with relays (or use relays to change the capacitance). You'll note that older signal generators do a lot of clicking when you crank the frequency up. If all of the HP RF boffins couldn't work out a good way of making tunable filters then I think you may struggle. But to be honest, I am not sure why you are doing this to generate a sine wave. Just go DDS! Any modern signal and/or function gen will use DDS for this frequency range. You can buy off the shelf chips that go way above what you need; the AD9914 does <0Hz to 1.4GHz sine waves.
H: 1-10V fluorescent lighting digital control I have a number of fluorescent lights installed that use 1-10V dimming. Note that this is not the same as 0-10V dimming as used in older theatre equipment. The control gear for the lights outputs 10V on the two control wires. When open circuit, the light is at 100%. When shorted, the light is at ~10% (minimum level). Dimmer controls for this kind of lighting are passive devices, only connecting to the two connections from the fixture. I want to be able to control this lighting digitally. I'm not too fussed with the protocol, as I can always program a µC to do protocol conversion. I have found commercially available devices such as this DMX 1-10V Converter, which will convert DMX/DALI etc to 1-10V, but they are rather expensive, and building my own would be much more fun. Has anyone any experience with this control protocol? Or can you offer any pointers to where to get started? AI: Basically what you are asking for is called a digital to analog converter, or D/A or DAC for short. In this case you want the full range to be 0-10 volts. From your description, it appears the receiving end passively pulls up the line, and is expecting the dimmer to put a variable resistance between it and ground. You want to outright control the voltage, but you only need a low side active pulldown to do it. Here is a circuit that will probably work: The input to this analog circuit is a 0 to 3.3 volt digital PWM signal from a microcontroller. R5, C4, R2, and C2 form a two-pole low pass filter that makes the average value of the PWM signal. Since your frequency requirements are so low, you can easily create such a PWM signal in a microcontroller with plenty of resolution. For example, a 1 kHz PWM signal will have its PWM frequency reduced by nearly 4000 (over 70 dB) by this filter. Even slow micros can give you 8 bits or more resolution at 1 kHz PWM frequency. The micro would adjust its PWM duty cycle in response to commands received via a UART or some other digital interface. The opamp is used in the classic positive gain configuration, except that since the transistor inverts the signal the opamp inputs are flipped in response. R1 and R4 form the feedback divider, which in this case causes the circuit to have a gain a little over 3. Ideally you want a gain of 3.03, but the values shown give you a little bit at the top of the range where you know the output will go to maximum. The opamp drives the base current of Q1 to whatever it takes to make the desired dimmer line output voltage. R3 is there so that there will be some voltage change in the opamp output with output change. Otherwise, the opamp output would always be at the B-E junction drop above ground, which could lead to instability. You didn't say what the maximum current is that a dimmer has to sink. This circuit can handle well over 100 mA, which is probably high. If so, you can make R3 higher, but the 1 kΩ shown should work anyway. C3 is there only for stability. You don't need much bandwidth, so there is no harm in overdamping the opamp. Some capacitance here will be needed since even with R3 there, there will actually be a voltage gain less than 1 from the input to the opamp output. Edit: The previous circuit accidentally had the opamp inputs flipped. The transistor inverts the voltage, so the opamp inputs have to be opposite from the usual positive gain configuration. The circuit above is now the fixed version. I have also updated the circuit for the processor running at 3.3 V instead of 5 V and now show the PWM signal from the micro directly.
H: Impedance Matching for Short-Low Frequency Traces Is it necessary to have impedance matching for short PCB traces if the frequency is lower than say 100MHz ? I've read somewhere that for a trace to be considered a transmission line it should have a length greater than 1/8 of the wavelength of the frequency, and somewhere else greater than the wavelength, not sure which one is more accurate ? Anyway, assuming that it's 1/8 of the wavelength, at 100MHz the wavelength is 3000mm so it's not necessary to match the impedance for traces shorter than 375mm (3000/8), am I correct here ? AI: Forget about clock or signal frequency. Think about edge rise time instead. A perfect square wave of, say, 320 Hz actually contains much higher frequency components: You can see frequency components going right up to 2000 Hz (and they go beyond too). But if you slow the rise time of the square wave, then you actually remove these high frequency components. As we add higher and higher frequency components, we can see the rise time of the wave getting shorter and shorter. To decide what frequencies your signal contains, look at the rise time on an oscilloscope. The rise time of a signal is usually considered to be the time taken to go from 10% to 90% of the amplitude. Once you have taken this measurement, the maximum frequency you should worry about is about: freq = 0.5 / rise time A 100MHz clock will be a big problem if the rise time is 10ps!
H: Best practice design ground and shielding Case: I design a pcb with a microprocessor and a adc (I'll leave out the details). Is this correct: The digital ground and the analog ground should be connected, but by a small passage. Next question: If the pcb have hole's for mounting to a metal chassis, should the skrew's then be grounded to the pcb analog/digital ground and to the chassis? Wouldn't that be a better protection? Or should the analog and digital ground not be connected to the chassis. Instead I should design a "chassis ground" surrounding the digital/analog ground. Or should the analog/digital just be on the pcb and not connected to the chassis nor should the be any chassis ground either. Kind Regards AI: The digital ground and the analog ground should be connected, but by a small passage. Yes this is correct. All you need between the two is a single point of reference. Best practice in most applications is a star ground, i.e. connect the digital ground plane to the power source's ground connection and the analog ground plane to the same physical point. The small passage should be capable of handling any current that could potentially flow through it. If the pcb have hole's for mounting to a metal chassis, should the skrew's then be grounded to the pcb analog/digital ground and to the chassis? Wouldn't that be a better protection? This depends on the application. In some applications, such as underwater, the chassis should be electrically isolated from any charge storage element to reduce oxydization. If you want to electrically connect the chassis connect it to earth ground if the application allows.
H: Arduino UNO Timer issue i seem to be facing a weird issue here. First time working with AVR timers. Basically what I am trying to achieve is to set timer2 (with prescaler val @ 1024) and use CTC mode (with val 78) to get 5ms timer ticks. Every 5ms i just display the current framebuffer on a row of LEDs and every 1sec (using a counter to keep track of 200 timer ticks) update the frame buffer. my code is void setup() { pinMode(dataPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(latchPin, OUTPUT); pinMode(row1, OUTPUT); pinMode(row2, OUTPUT); pinMode(row3, OUTPUT); pinMode(row4, OUTPUT); pinMode(row5, OUTPUT); digitalWrite(row1,LOW); digitalWrite(row2,LOW); digitalWrite(row3,LOW); digitalWrite(row4,LOW); digitalWrite(row5,LOW); digitalWrite(latchPin,HIGH); digitalWrite(clockPin,LOW); Serial.begin(9600); Serial.println("Program initialized ..."); //create string map + display the initial frame buffer //create_string_map("hello!"); //generate the first frame_buffer Serial.println("1"); //create_frame_buffer(0); Serial.println("2"); //update_frame_buffer(); Serial.println("3"); //disable global interrupts cli(); //init timer2 TCCR2A = 0; TCCR2B = 0; //set ctc mode TCCR2B |= (1 << WGM12); //set CTC value OCR2A = 78; //set prescaler @ 1024 TCCR2B |= (1<<CS10); TCCR2B |= (1<<CS12); //enable timer TIMSK2 |= (1<<TOIE2); sei(); } //install the ISR ISR(TIMER2_OVF_vect) { timer_counter++; //disable timer TIMSK2 |= (0<<TOIE2); if(timer_counter==200) //200 = 1 sec { //reset timer_counter timer_counter=0; //update frame /*Serial.println("Frame update event ..."); string_map_col_counter++; if(string_map_col_counter>=30){string_map_col_counter=0;} create_frame_buffer(string_map_col_counter); update_frame_buffer(); display_and_hold_frame();*/ Serial.println("1 second tick"); } else { //display_and_hold_frame(); Serial.println("timer tick"); } //enable timer TIMSK2 |= (1<<TOIE2); } as you see i have commented most of the stuff out because i am trying to debug the issue. when i open the serial port the only output i get is "prog" and just stops there. the only thing i can think of that might be going wrong is that the timer is cont configured with ticks too fast so the serial.println never gets the time to finish. but as you can see i start the timer AFTER all these serial print statements. also when i press the reset button on the board does it clear all the timer configs on board or does it remember them b/w resets ? any ideas what might be causing this. AI: At 9600 bps, it takes over 1 ms to transmit one character, so getting just "Prog" in 5 ms sounds about right. Try increasing the serial port speed and/or sending shorter messages (e.g., just one character per timer tick). I don't know much about how the Arduino Serial module works internally, but my guess would be that you're simply overloading its transmit buffer with all the stuff you're printing, and it's just "giving up".
H: Are 32-bit ALUs really just 32 1-bit ALUs in parallell? I'm reading the high esteemed text Computer Organization where this picture is found that is supposed to represent a 32-bit ALU: Is this technology really how it's done, just a lot of 1-bit ALUs, so a 64 bit ALu would just be 64 1-bit ALUs in parallell? Some how I have doubt that this is how a CPU is built in practice, can you confirm or tell me more? AI: That's essentially it. The technique is called bit-slicing: Bit slicing is a technique for constructing a processor from modules of smaller bit width. Each of these components processes one bit field or "slice" of an operand. The grouped processing components would then have the capability to process the chosen full word-length of a particular software design. Bit slice processors usually consist of an arithmetic logic unit (ALU) of 1, 2, 4 or 8 bits and control lines (including carry or overflow signals that are internal to the processor in non-bitsliced designs). For example, two 4-bit ALUs could be arranged side by side, with control lines between them, to form an 8-bit CPU, with four slices a 16-bit CPU can be built, and it takes 8 four bit slices for a 32-bit word CPU (so the designer can add as many slices as required to manipulate increasingly longer word lengths). In this paper they use three TI SN74S181 4-bit ALU blocks to create an 8-bit ALU: The 8-bit ALU was formed by combining three 4-bit ALU’s with 5 multiplexers as shown in Figure 2. The design of the 8-bit ALU is based on the use of a carry select line. The four lowest bits of the input are fed into one of the 4 bit ALU’s. The carry out line from this ALU is used to select the outputs from one of the two remaining ALUs. If carry out is asserted then the ALU with carry in tied true is selected. If carry out is not asserted then the ALU with carry in tied false is selected. The outputs of the selectable ALUs are multiplexed together forming the upper and lower 4 bits, and carry out for the 8 Bit ALU. In most cases though, this takes the form of combining 4-bit ALU blocks and look ahead carry generators such as the SN74S182. From the Wikipedia page on the 74181: The 74181 performs these operations on two four-bit operands generating a four-bit result with carry in 22 nanoseconds. The 74S181 performs the same operations in 11 nanoseconds, while the 74F181 performs the operations in 7 nanoseconds (typical). Multiple 'slices' can be combined for arbitrarily large word sizes. For example, sixteen 74S181s and five 74S182 look ahead carry generators can be combined to perform the same operations on 64-bit operands in 28 nanoseconds. The reason for the addition of the look ahead generators is to negate the time delay caused by ripple carry introduced using the architecture shown in your diagram. This paper on The Design of Computers Using Bit-Slice Technology goes through the design of a computer using the AMD AM2902 ALU (which AMD calls a "Microprocessor Slice") and the AMD AM2902 carry look ahead generator. In Section 5.6 it does a pretty good job of explaining the effects of ripple carry and how to negate them. However, its a protected PDF and the spelling and grammar is less than ideal so I'll paraphrase: One of the problems with cascading ALU devices is that the output of the system depends on the total operation of all the devices. The reason is that during arithmetic operations the output of each bit depends not only on the inputs (the operands) but also on the results of the operations on all of the less significant bits. Imagine a 32 bit adder formed by cascading eight ALUs. In order to get the result we need to wait for the least significant device to produce its results. The carry of this device is applied to the operation of the next most significant bit. Then we wait for this device to produce its output and so on in this fashion until all the devices have produced valid output. This is called ripple carry because the carry ripples through all of the devices until it get to the most significant one. Only then the result is valid. If we consider that the delay from memory address to carry output is 59 ns and that from carry input to carry output is 20 ns, the whole operation takes 59 + 7 * 20 = 199 ns. When using large words, the time it takes to perform arithmetic operations with ripple carry is too long. However, the solution to this problem is simple enough. The idea is to use the procedure of carry look ahead. It is possible to compute what the carry of a four bit operation is going to be without waiting for the end of the operation. In a larger word, we divide the word into nibbles and compute the P (carry propagate bit) and the G (carry generate bit) and, by combining them, we can generate the final carry and all the intermediate ones with very low delay while the other devices are computing the sum or difference. But if you look at the datasheet for the SN74S181, you'll see that it is just cascaded one-bit ALUs. So while there is some additional circuitry to speed up calculation when operating on larger words, it really comes down to a lot of single bit operations. For fun, if you don't have access to simulation software, you can always create and cascade ALUs in Minecraft:
H: What characteristics of magentic coil is the most important for VLF sensitivity I try to sense a VLF magnetic field (1-100Hz) by using a coil. The field is very weak and in most of reading there is too much noise. Is there the most important characteristic of the coil, should I look at first if I want to improve my readings? AI: Generally speaking, the "loop area" (the area inside the coils of wire) is the primary factor that determines the sensitivity of a loop antenna. If the noise is also magnetic in nature, there isn't much you can do other than try different orientations of the coil to maximize the signal-to-noise ratio. Increasing the loop area in this case will only increase the noise, too. However, a large coil can also couple noise from electric fields to the circuitry it's driving, and it may therefore be helpful to wrap your coil in a grounded electrostatic shield. I've seen loop antennas created by pushing multiconductor cable into a piece of copper tubing, bending the tubing into a circle, and then connecting all of the conductors in series to create a coil. But be careful to leave a gap in any such shield; otherwise, it will create a "shorted turn" and eliminate any possibility of detecting magnetic fields.
H: What is the equivalent thevenin resistance of a digital output port on an Arduino Uno R3 How would I determine the thevenin equivalent resistance? AI: You can't directly, at least assuming there is nothing between the arduino output and the microcontroller output. Microcontroller manufacturers don't spec output resistance usually, but they do specify the worst case voltage drop under some load. For example, for a micro running at 5 V they spec might say the minimum guaranteed logic high output is 4.0 V at 20 mA sourced (I'm making up these numbers as examples only, you need to check the datasheet). Assuming the output when driving high is a saturated FET that can be modeled well enough as a resistor, then this says it drops 1 V at 20 mA. 1V / 20mA = 50 Ω. That's the worst case, so is the highest resistance. The actual resistance can be anywhere from 0 to that value. However, modeling a digital output as a Thevenin source is only roughly right. You can get some first order useful information from it, but you certainly don't want to use that for any kind of detail. If you find yourself wanting that, then it's a good clue you need to step back and think about the design differently. It would help if you explained why you want to know the output resistance of the micro.
H: How to read high voltages on microcontroller? I want to read high voltages, like ~50V, using a microcontroller. I plan to put this as an input into the microcontroller's A/D line. But of course, you shouldn't have voltage that high on the input of a microcontroller or it'll fry. How might I read high voltages? The main thing is that I need to step down the voltage before reading it. What do I need to consider when stepping down this voltage? Thanks in advance! Edit: I noticed in the PIC18 datasheet that it says "The maximum recommended impedance for analog sources is 2.5 kOhms." How does this affect how I step down the voltage, be it with resistive dividers, etc.? AI: A simple resistive voltage divider will achieve what you want. The formula to calculate the output voltage is: So if we assume your input voltage ranges from 0-50V, we need to divide it by 10 to achieve 0-5V. If we also assume we want to load the input voltage with 100kΩ, then the calculations would something like: Vout / Vin = R2 / 100kΩ 0.1 = R2 / 100kΩ -> R2 = 10kΩ R1 = 100kΩ - R2 = 90kΩ So R1 = 90kΩ and R2 = 10kΩ For an ADC requiring a maximum source impedance, you must make sure the voltage divider impedance is below this level. The impedance at the divider can be calculated as R1||R2. For <2.5kΩ, the above won't meet this requirement as 10kΩ||90kΩ = 9kΩ If we use 9kΩ and 1kΩ though, we get 1 / (1/1000 + 1/9000) = 900Ω Bear in mind the lower the resistance the higher the wattage rating resistors you need. 50V / 1k = 50mA -> 50mA * 45V = 2.25W across the top resistor (0.25W across the bottom) In these cases it's best to use an opamp buffer in between a high resistance divider and the ADC. Or use a 2kΩ and 18kΩ divider, which is not quite as power hungry as the 1k/9k version.
H: MAX232 circuit, what is the purpose of the capacitors? Possible Duplicate: Can I use 10\$\mu\$F caps in a MAX232? What is a decoupling capacitor and how do I know if I need one? Kindly refer to the following typical MAX232 circuit: I am still not quite sure I understand capacitors correctly, and while building this circuit, I realized that I wasn't understanding what the purposes of the capacitors I was sticking onto the breadboard were. My guess is that they are all used for power conditioning, or decoupling. I am not sure how I would be able to tell which one though. I am especially confused about the 10 uF capacitor, as it seems like it's just shorting out the GND and VCC pins from my microcontroller. AI: The 10uF capacitor shorts only AC voltages developing between VCC and GND: noise on the power supply. To DC, a capacitor is an open component! When you power this MAX232 with single-voltage 5V supply, its V+ and V- pins are able to generate a dual supply: a positive voltage greater than 5V and a more or less equal but opposite negative voltage. How that kind of thing works is that an oscillator drives a network of diodes and capacitors: look up the term charge pump. The capacitors needed to make this charge pump work are connected to pins 1 and 3, and pins 4 and 5. The 1uF capacitors on 2 and 6 (the V+ and V-) outputs, are just additional "rail caps" on this dual supply that is generated by the chip. They probably just do some further removal of ripple and noise from this generated supply. (To filter ripple, these capacitors don't have to be large. Why? Because the internal oscillator for the charge pump probably works at a substantially higher frequency than 60 Hz.) The use of the capacitor on pin 2 shows a slight deviation from the "Typical Operating Circuit" given in the Texas Instruments datasheet (Figure 4). In the datasheet, the pin is capacitively coupled to ground through a 1uF capacitor. Here you have it coupled to VCC. That does not matter much, because both VCC and GND are AC ground. However, this configuration is not a mistake. It appears in the original Maxim datasheets for this device! One important clue in the TI datasheet is a note that this device is compatible with another company's existing product (and so is not a TI house design). It behooves us to look at the Maxim data sheet in addition to the TI one. That datasheet contains a lot more discussion and numerous additional diagrams.
H: Arduino SPI Clock Speed Configuration I am trying to communicate with a Nokia 1202 LCD with my Arduino using SPI. The LCD using the STE2007 Controller. As per the datasheet here @ page 12, you find that the min time for SCLK is 250ns => 4MHz and no maximum value listed. So what i understand is that this driver can communicate using SPI with SCLK being max. of 4MHz. Since my arduino board is running at 16MHz, and I will be using the 'spi' library this is what I think i should do: set bits SPR0 and SPR1 in the SPCR register to set the spi clock speed @ 4MHz do spi.begin() execute spi commands as normal Is this correct ? Something like ... void setup() { pinMode(SPI_SS, OUTPUT); pinMode(SPI_DC_SEL, OUTPUT); SPI.begin(); SPI.setBitOrder(MSBFIRST); //set spi register to set SCLK @ 4Mhz //SPI2X = SPR1 = SPR0 = 0 SPCR &= ~(1<<SPR1); SPCR &= ~(1<<SPR0); SPSR &= ~(1<<SPIX2); } AI: You can set the SPI speed (and many other things!) using the Arduino SPI library without specifying any register values. You already did it with MSBFIRST. Like so: SPI.setDataMode(SPI_MODE3); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV4); // 16/4 MHz SPI.begin(); Also, SPI.begin sets all the pin modes for you, so no need to do that.
H: What is the advantages/disadvantages of the SMB connector against SMA? I would like to connect an external UMTS antenna to the module, because of this I need a 15m long cable. The antenna has N-connector and I have to decide which connector should I put in the other side of the cable. I found only SMB connectors(Bulgin) which rating is IP67. The rating is important because the antenna is connected to an outdoor measurement system. Does it has any disadvantage of this connector in the 1800-2200Mhz frequency range? I have the following concept: N(antenna)--------------SMB(IP67, connection to the box)------SMA(Module) AI: The principal difference is the major one: SMB connectors are Snap-In. You push them together to mate, and pull them apart to unmate. SMA connectors are threaded. You have to screw them together, and unscrew them to disconnect. SMB connectors are also slightly smaller. SMA connectors are also far more common. Personally, I would be much more inclined to go with SMA connectors, just because they're so much more easily available. However, since this is going outside, I would more strongly recommend SMA, as it is much more mechanically reliable. However, it's crucial to note that the Bulgin connector you link isn't really SMB. It's a SMB-style connector with a bunch more stuff on it. It's also exclusively available from Bulgin. However, realistically, any high-frequency IP67 connector is going to be non-standard (well, aside from N connectors), as there aren't really any standards for sealed high-frequency connectors, so the fact that it's Bulgin-Exclusive isn't really a big deal, as anything else will be similarly single-sourced. On the whole, If you really need IP67, I can highly recommend the Bulgin Buccaneer connectors. I use several varieties of them in a device I designed, and they are very nicely made. Just be aware that you will need to make your own cables (which involves crimping/terminating coax), if the few varieties Bulgin offers do not suffice (and the longest cable they do make is 5M). Is there any reason you can't use a N connector on your equipment? The only real downside to N connectors is they're large.
H: Is there any restriction in the choice of Ethernet PHY, depending on the TCP/IP stack? I am new on the forum and am currently working on a project to design an ethernet electronic board. I will have a microcontroller 32-bit with an external PHY. I wanted to know : depending on the TCP/IP stack I will choose, will there be any restriction on the external ethernet PHY or all the PHY are usable? The thing is I need to choose the Ethernet PHY before the microcontroller and then I don't know if I will use uIP or Contiki or microchip stack or any other. AI: Basically there should be no difference what PHY You'll use, since the low level driver is written separately from all the TCP/IP stack itself. At least I am sure this is done in LwIP, since I use this stack with Micrel PHY - had to write my own initialization setup stuff.
H: Fastest moving averaging techniques with minimum footprint I have tried few running averaging techs for smoothing the change in ADC data in AtMega48 for controlling lights(PWM) when rotating a pot(ADC). The filters (pseudo codes): Moving average: adc_avg += new adc_raw; adc_avg >>= 1; 8-point Moving Average Filter: fill adc_raw_array[i] = adc_raw; adc_raw_array[8] <-- delete left most, move left, push adc_raw. adc_avg = sum(adc_raw_array); adc_avg >>=3 ; // divide by 8 I observed that the filters are very nice. But slow in response which is expected. I am looking for a techniques like Exponential moving average. Said to be more responsive. Is there another like this one? As it says: adc_Eavg = α * adc_raw + ( 1 - α ) * adc_Eavg ; where α is between 0 and 1. How to code and optimize those; code wise (without using floats) ? Or How would I convert the floats to corresponding integers for making code small, fast and responsive one. I tried as adc_Eavg += α * ( adc_raw - adc_Eavg ); and I kept α = 1; Other then that it wont work as expected. Because I'd've to change all the variables to float. Please do not concentrate on following statement for the time being but note. Keeping floats in my code base is filling the program memory from 45% to 137%, in case of adc_avg = adc_avg * 0.8f + adc_raw * 0.2f; AI: Your moving average filter is rather inefficient; there's no need to shift the data, nor to calculate the total each time again. Instead of a FIFO implement it as a round robin: *i points to the oldest sample in the list* total -= samples[i] total += new_sample samples[i] = new_sample i = (i+1) mod 8 average = total >> 3 So you replace the oldest sample by the new one in the list, after subtracting the oldest from the total and adding the new one. Then let the index point to the next position, which now is the oldest, to be replaced by the next sample. FIR vs IIR The moving average filter is a FIR (Finite Impulse Response) filter with all coefficients equal. A FIR filter is inherently stable, and its main disadvantage is that it needs more storage than the typical IIR filter. In the case of the moving average it's only the samples array, but for a generic FIR filter you need a second array with the coefficients. Your other solution is an IIR (Infinite Impulse Response) filter; it uses a combination of the previous output and the new input to create the new output value. It's not necessarily stable (though yours is), but often needs less storage: yours only needs the previous out value. A bi-quad filter only needs a 4 sample storage (Direct Form 1, shown below) or just 2 samples in Direct Form 2.
H: Amplifying Signal From Electret Microphone My project requires me to use an electret microphone and I am having a lot of trouble getting any decent-sized signal out of it. I currently have it configured with a 100Kohm pullup resistor and a 47uF capacitor. The signal is so weak that even if I put it through an amp with 200V/V gain, I only get an output whenever I tap the microphone or blare music straight into it with my earphones. Is there a trick to using the microphone right or do I just have a crappy one? I don't know the model because my professor didn't provide it, but 54LO is printed on the top. AI: 2 wires or 3? Polarity known to be correct? What DC feed voltage? 100k sounds high. Try 10k Sensitivity ratings are usually wrt 1V/Pascal = 1 V/ 94 dB Sound Pressure Level. 1V/Pascal = 94 dB SPL = "loud and close" Real world sensitivities may be 40 - 70 dB below that (!). -60 dB ~= 1 mV/Pascal. -40 Db ~= 10 mV/Pascal. This may not be far off what you are seeing depending on the mic you have and what signal level you require. So with a 200V/V amplifier and a loud signal you'd expect about 200 mV from a -60 dB sensitivity microphone with a rather loud signal. And 2V with a -40 dB mic. Microphone output and gain calculator here Nicely done amplifer article here - note input DC bias resistor needed for electret. Many potential circuits here BUT you need to have some idea of basic specs and correct connection. Example Hosiden mic spec sheet - all at -45 dB sensitivity. 2 transistor electret mic preamp useful. Another similar useful
H: What is the usage of Zero Ohm & MiliOhm Resistor? I am new to PCB design and I noticed that some schematics use 0Ω or 100mΩ resistors. What is their purpose and why do we need to use them in our PCB design? Normally if we wish to probe how much current the load is taking, we put a jumper pin across the PCB trace (then measure current across the pin using a multimeter). Adding resistors for this purpose seems like it would waste a lot of PCB real-estate. Is this the sole reason why 100mΩ resistors are being placed (since I = V/0.1Ω) instead of a jumper pin? If so, is there any consideration we should take when placing such a mΩ resistor on board so it doesn't affect the signal or behaviour of the circuit? AI: Zero Ohm "resistors" are frequently used as links on single side boards because they can be placed by component insertion machines that can insert resistors. High volume single sided board manufacturers often use a separate link inserting machine - whose frighteningly fast speeds need to be seen to be believed. A 1 Ohm resistor is "just another component". It may be used as a current sense resistor or for some other circuit function. If using resistors for current sensing for measurement purposes. Worst case voltage drop across them should be small compared to total circuit voltage so that they do not affect operation. eg if a circuit draws 1 amp and has a 5V supply then a 1ohm resistor would drop 1 Volt. This is 20% of total circuit voltage and would be excessive in essentially all real world cases. A 0.1 Ohm resistor would drop 0.1 V at 1A = 2% of supply and MAY be acceptable depending on circuit. A 0.01 Ohm resistor will drop 0.01V at 1A = 0.2% and would almost always be acceptable. The 0.1 Ohm resistor will drop 100 mV per Amp so 1 mA will produce 100 uV. Many low cost DMMs have a 200 mV range with a resolution (but not accuracy) of 0.1 mV = 100 uV, so they can read current in a 0.1 Ohm resistor to 1 mA resolution. Similarly they can read current in a 0.01 Ohm resistor to 10 mA resolution. Placing the sense resistors with one side grounded allows ground referenced measurement which may be convenient. The Voltage drop must not affect circuit operation. Sometimes bypassing the sense resistor with a capacitor - maybe 10 uF or 100 uF depending on circuit, will further reduce impact on the circuit. Where high frequency noise is present use of a DMM or other meter to measure voltage so as to calculate current will give bad results die to noise entering the meter. In such a case use an eg 0.1 Ohm sense resistor, feed the voltage via a series 1k resistor to the meter and add a say 10 uF across the meter terminals. ____________________________________ Here is a Panasonic "universal axial inserter" at work. I set the start to 35 seconds as the prior part is less consistent. My recollection is that the wire-link-specific inserter was faster again. It fed wire from a reel, shaped, cut, inserted, cinched and cut it. ... Here we go - wow agh wow - faaaaaast wire link former inserter @Marcelm said: "... whose frighteningly fast speeds need to be seen to be believed."_ - You're not kidding! (the video is of resistor insertion rather than links but ehh)
H: wiring LED's in parallel - need series resistor? I would like to confirm something I have inferred through my looking into LED wiring and also have a couple questions answered. For the sake of the examples below assume the source voltage is 5v; my LED's drop 3.2v and want 20mA. I am going to be wiring some LED's in parallel to a pin on a TLC5940. The TLC is a constant current driver. If each LED wants 20mA and I'm going to wire 6 LED then I would set the TLC to have a constant current of 120mA. I suspect that I also need to wire a resistor in series with each LED because LED's "effectively have no resistance" so to make sure the current balances evenly I need to throw a resistor in each parallel string. Is that correct? A couple other questions; I'm still new to electronics so I think I still don't fully understand a couple basic concepts. If I throw a resistor in series with each LED do I need to make the TLC draw more current to balance out the resistors; or do I just make sure that the resistor is smaller than 90ohms i.e. (5v - 3.2v) / .02A? I set up a test where I had an Arduino board controlling the TLC chip and only one LED to a pin with the chip set to 20mA. The Arduino 5v pin was powering bot the TLC chip and the LED. The thing is my LED only wants 3.2v so there were 1.8v left over. So was my LED being over-driven with voltage, does that not matter so long as the current is correct, or does the TLC chip automatically sink any excess voltage while it does it's current limiting? AI: You don't need the series resistors to control the current; the TLC5940 is a current source, and doesn't give a damn about the resistance. If you program it to source 120 mA it will source 120 mA, whether the series resistor is 0 Ω or 15 Ω (15 Ω is the equivalent of six 90 Ω resistors in parallel). Your calculation of the 90 Ω is correct: 3.2 V for the LED plus 20 mA \$\times\$ 90 Ω = 5 V, so a larger resistor would need a higher voltage to keep 20 mA flowing. If the 5 V is all you have increasing the resistance will decrease the current. A 100 Ω resistor for instance will allow \$ \dfrac{5 V - 3.2 V}{100 \Omega} = 18 mA \$ Further increasing the resistance will also further decrease the current. There are two reasons why you should use series resistors: balance the currents between the LEDs. Small differences in LED voltage will be compensated by the voltage drop across the resistors. Since the resistors will all see the same voltage from the TLC5940 a 90 mV higher voltage for LED 1 will cause 90 mV less for its series resistor, and hence a 90 mV / 90 Ω = 1 mA less current, which won't be noticeable but more importantly, they reduce the power dissipation in the TLC5940. If it supplies 120 mA per output, and you wouldn't have series resistors, then it would dissipate (5 V - 3.2 V) \$\times\$ 120 mA = 220 mW. Not too much it seems, but the TLC5940 has 16 outputs, then that 220 mW may become 3.5 W!! That's too much for the poor device (see power rating on page 3 of the datasheet, at 70 °C, not at 25 °C). So the resistors literally take some of that power out of the device. At 90 Ω there would not be any dissipation in the IC at all, but the current source wouldn't have any headroom either. So it's better to choose the resistance a bit lower: 68 Ω will leave 5 V - (3.2 V + 20 mA \$\times\$ 68 Ω) = 440 mV for the IC. 16 outputs driving 120 mA each will then cause an acceptable 850 mW dissipation.
H: RS-232 and RS-485 software configurability? I would like to connect a anemometer(RS-485, DB9) to the PC. The PC has a serial port with DB9 connector. I couldn't find the specification of the serial port. Is that RS-232 standard or RS-485? Most commonly used the RS-232, so I assume that is RS-232. Is there a possibility to configure the serial port from RS-232 to RS-485, or I just need a RS-232/RS-485 converter? AI: An EIA-485 ("RS" refers to "Recommended Standard", and is an obsolete name) interface is rare on a PC, you'll need a separate interface board for that. The reason is that EIA-232 and EIA-485 are not hardware compatible, despite using the same connector type: EIA-232 uses single-ended signals, meaning that RxD and TxD are referenced to ground. EIA-485 uses balanced signals, meaning that both sent and received data have a positive and negative signal which are each other's negative.
H: Wrong voltage sent to output Using miniLab1008, I am trying to send 10V to my D/A OUT0 but it sends only 5V and when I send 5V, I get 2.5V. I am using the universal library example VOut01.c Is this a board problem? However using the software that came with the board everything seems normal. AI: The user manual says on page 28: Maximum output range: 0-5 volts It's USB powered, and simply doesn't have 10 V available. So the reference voltage is 5 V, for a digital value of 1023. A 512 value will give you 2.5 V. \$ V_{out} = \dfrac{data}{1024} \cdot 5 V \$ The inputs can process 10 V input voltage, though.
H: Orientaion Flat on Semiconductor Wafer On semiconductor wafers there is a straight line, which is called Orientation Flat. What exactly are these and how they are formed? AI: As stevenh says one of the purposes is to ensure correct orientation during handling. The other reason is to indicate the crystal orientation of the lattice and the wafer doping. From BYU's cleanroom website: Wafer Flats Purpose and Function Orientation for automatic equipment Indicate type and orientation of crystal. Primary flat – The flat of longest length located in the circumference of the wafer. The primary flat has a specific crystal orientation relative to the wafer surface; major flat. Secondary flat – Indicates the crystal orientation and doping of the wafer. The location of this flat varies. For large crystals no flats are ground. Instead a notch is machined for positioning and orientation purposes. The crystal lattice is defined by how the wafer grew from the initial seeding. It is important to cut the wafers along the crystal lattice if you want a clean break.
H: What is this resistor strip on my helicopter circuit? RM: Smaller photo substituted - larger slower loading one here if desired: https://i.stack.imgur.com/RPM8l.jpg I am building a helicopter and would like to use a linear servo like the one on the right in this picture. The exact same servo has been removed from the left side, revealing two strips, one bare copper and the other one black with variable resistive properties. The black one is connected to positive voltage on top, ground on the bottom. The back side of the slider on the servo is touching these two strips, causing a variable voltage input on the microcontroller on board. I need to get me one of those black strips, and having searched for membrane resistor/potentiometer, I can not find anything that will suit my circuit. It is supposed to be about 20mm long, and the only thing I can find that actually looks like something I need is this one from SparkFun but that is obviosly to large. All help on the mather is greately appreciated AI: That will be a linear resistive track for servo feedback. Measure track resistance end to end. Then ... You may be able to drive a standard linear mechanical pot instead using the mechanism. Looks doable. Gear on end of existing linear resistor needs to be fitted to multiturn end of a linear pot. You can get linear posts with screw thread drive. Or you could add a simple thread and nut drive to something like this linear pot from Mouser
H: How to convert digital IO driving strength to dBm? Feeding an LVCMOS digital output into a spectrum analyzer I have a spectrum analyzer that's primarily supposed to be used for RF measurements. It lists an input limit of +30dBm max, and 0V DC, and has a 50Ohm impedance. My RF signal generator speaks the same language: you specify the output amplitude in dBm, and whatever number I select on the generator matches what the analyzer sees. The analyzer has a frequency limit of 100Hz at the low end. I want to use it to measure the spectrum of signals that come out of an FPGA that are in a range of 0 to 10MHz. The FPGA IO is configured to be a 3v3 LVCMOS output. What do I need to do to make sure I don't destroy the spectrum analyzer input circuit? It's clear that I need to insert a series capacitor to remove the DC component, either by putting a cap on my board or by inserting an SMA DC blocker on the measurement cable. I know the +30dBm corresponds to 1W, which is much higher than the power that can come out of an FPGA digital output. But I'd like to get the mathematics and basic understanding right: how do I convert from an FPGA IO drive strength to dBm? As an example, let's take a MAX10 FPGA IO configured as 3v3 LVMOS output with a 2mA driving strength. What's the corresponding dBm? Is it just 3.3 * 0.002 = 6.6mW, which converts to 8.2dBm? Or is there more to it, e.g. because there's also a 50 Ohm impedance to take into account somewhere? AI: If your '2 mA driving strength' really means that your FPGA output behaves like a +/- 2 mA current source (which I doubt, in detail at least), then it could be connected directly to the spec ana input with a series DC blocking capacitor. The calculation would go thus. Power into the 50Ω input of the analyser is \$I^2R\$ is 0.002 x 0.002 x 50 = 0.2 mW = -7dBm. That's the total power of the square wave. Most of this would end up in the fundamental, the rest of the power would go into the other odd harmonics. You might have some even harmonics visible, due to asymmetries in the squarewave. I would be more inclined to program the output to maximum drive strength, so it behaves more like a voltage output, then use a series resistor and capacitor. You could use a 50Ω resistor, or one that's bigger. If you used a 50Ω series resistor, then the FPGA output would be driving a total of 100Ω, and the +/- 1.65 V coming from it would drive +/- 16.5 mA into the spec ana, if it had sufficient drive strength. A bigger resistor would reduce the current. The \$I^2R\$ calculation is just the same, to give 13 mW or +11.3 dBm with 16.5 mA. Of course this sum assumes zero output impedance from the FPGA, which is not going to be true. Working back from a measurement of power on your spec ana might in theory allow you to estimate the extra output impedance of the FPGA, but the poor basic accuracy of the spec ana would make that very inaccurate. A trick that mainly RF engineers use to probe circuits (also useful for high speed logic) is to use a series resistor in the 470Ω to 1kΩ ballpark, in series with a DC blocking capacitor, connected directly to a 50Ω coax cable going to a spec ana. This value of resistance is usually high enough to not trouble a logic or 50Ω impedance RF circuit too much, yet still give a reasonable amount of signal into the spec ana. Although the coax is not being driven from its characteristic impedance, the resulting probe is flat and well behaved because the coax is terminated by the spec ana input. The resistor end of the coax must be grounded very close to the point being probed.
H: Calculate capacitance from cascade low pass filters The task is to make a 2:degree filter with a slope of 40 dB/decade. I have this circuit. R1=R2=10kΩ, f=1kHz I also have this formula What I think (probably wrong). Is that that because 40 dB/decade, then I'm not quite sure that I have gotten the decibel conversion (to H) right. But if that is right, how do I calculate the value of C when there is that imaginary j in the expression? The magnitude of H is: AI: Your equation is the transfer function correctly of two cascaded RC low pass filters with a buffer in between them so there is very little loading effect on the first filter by the second filter. You need to find the magnitude of the transfer function so, first get it in the form a+jb, then find the magnitude from sqrt(a^2 + b^2). Equate the expression for the magnitude of the transfer function to 0.707 which is the magnitude at the -3dB frequency then transpose to make C the subject of the equation.
H: What is the physical meaning to the condition maximum efficiency in transformer? Mathematically I can see that When Iron Loss = Copper loss there is maximum efficiency, But why is this true? As far as I know Iron losses are completely independent quantities, So I can't understand this condition intuitively. Please help. AI: The purpose of a transformer is power throughput. Power = volts x amps. You can get the same power with 100 V and 1 A, as with 10 V and 10 Amps, and 1 V and 100 A. In a transformer, in a sense, the copper area is responsible for the current carrying. The iron area is responsible for the voltage handling. You can build a transformer with a huge area iron core, which would therefore have a very large volts per turn, meaning that you needed little copper to achieve your power throughput. The resulting large volume iron core would lose a lot of power in hysteresis losses, assuming magnetisation to its maximum permitted flux. With few copper turns, there would be little copper loss. Alternatively you could build a transformer with a small core, which would then need many turns of thin copper wire. At the same magnetisation flux, iron losses would be low, and copper losses high. As the total loss is the sum of the two losses, but the power throughput is the product of their capabilities, either design could be improved by reducing the amount of high loss material, with a small increase in the amount of low loss material. If this isn't self evident, then I'll dig out a graph of a hyperbola. Whether you get the best efficiency when both are exactly equal is another matter. There is certainly little point in reducing one loss a little at the cost of having the other loss increase by a lot. The optimum will tend to be around the equal contributions state. 'Efficient' is one of those words that means different things to different people. Many mean the ratio of power out to power in. However, manufacturers may well optimise their transformer for materials cost, rather than power cost. They may well use more (cheaper) iron for the core to save on (expensive) copper, with a resultant unbalancing of the losses. There are two typical regimes for transformers; ones that operate at full power all the time, and ones that operate over a wide range of loads and may spend a lot of time at no load. These two regimes will use different optimisations for materials, as the full iron loss is present whenever voltage is applied, but copper loss only occurs when the transformer is on load. Transformers will therefore have equal losses only at some specific load.
H: What is k variable on antenna theory I make my text on bold so it distinguishes from the print-screens I post. I am reading Antenna theory Analysis and Design, Balanis (Wiley 2016). At page 17, (subsection 1.4 CURRENT DISTRIBUTION ON A THIN WIRE ANTENNA), I see \$sin(kl/2)\$, where \$k\$ is not explained. Is it a positive integer? aka \$k=0,1,2,...\$, or a specific variable for antennas? I tried to ctrl+f the pdf, and the \$k\$ does not seem to be explained later on. The next time it appears on the book is page 38, subsection 2.4 RADIATION INTENSITY, where it talks about far-zone electric-field intensity of the antenna. But is it the same \$k\$ as before? It does not explain this one either. Also at section 6.2 and below I observe the usage of multiplying it with d: \$kd\$. Where k is again, not explained. is it the same variable? AI: That's the wavenumber \$k\$; should be introduced pretty early in a chapter about wave theory / how the existence of propagating waves arises from Maxwell! It's really just what you highlight in the first line of (6-3): the factor in the complex part of the exponent of your E-field exp. That's actually its significance!
H: LHM6642 - Open Loop I want to use LHM6642 as a comparator and I was wondering if it would work. The schematic that I have in mind is this one: simulate this circuit – Schematic created using CircuitLab In the input I will inject a PWM signal (2V High, 0V Low). Using the a resistor voltage divider, I biased the inverting input of the OAmp to 1.2 V Aprox. The idea with this setup is to get the same square wave in the output but with the following voltage levels (12V High, 0V Low). It seems to me this should work in theory. I have checked the datasheet of the Oamp but I haven't seen any information regarding if this Oamp can work in an open loop configuration. AI: It will work, however the op-amp will be saturated, so you'll have the overload recovery time to deal with. Also there will be some loading of the input signal due to the -1.2V differential input voltage being in the range of two diode drops, especially at elevated temperature (Fig 54 in the datasheet): In general it's usually better not to use op-amps as comparators.
H: How to regulate voltage from marine battery? I have a telescope with a number of components that run on 12vdc. I want to create some sort of power regulator to supply power to my components without frying anything. Is there some kind of voltage regulator i can put between the marine battery and my components to make sure nothing happens to them? I could put a power inverter in to the battery and then have 12vdc plugs plugged into that, but that seems like a wasted effort. I just need to create some kind of block that will do the typical 9v/12v barrel connectors to a reliable power source. AI: When an appliance rating simply says 12V with no tolerance mentioned, it usually expects the range of a lead-acid battery in a car. This is at least 10.8V .. 14.8V and usually wider. From what I know about the telescopes, their internal components (cpus, servos, screens, etc) internally run on 5V or even lower (modern digital electronics is generally 3.3V or less), so it has its internal convertors that take care to stabilize whatever the other components need. Using DC-DC convertors to stabilize the voltage will not necessarily bring you a better experience: How much exact your 12V needs to be? It is already within 10% (without a charger connected) or within 20% (with a charger in parallel). How much do you lose in the cables? Quite a few 12V-labeled car-powered things actually run better at 13.5 or 14.0V (the voltage of a car battery with the engine running). E.g. phone/tablet/laptop chargers. The convertor will have its loses. Your battery will deplete faster. Depending on the load profile, it may be as fast as twice faster, even with a high-quality convertor. The electrical noise. A lead-acid battery is quite silent. A dc-dc convertor will bring a great variety of frequencies leaking to the load. E.g. camera powered off the same convertor may get dust-like noise or moires in the pictures. In short, don't dive into complex electronics. Use appropriate connectors. Twisted wires are for the brave. Use fuses (this is important, lead-acid batteries are impressively powerful when unintentionally shorted). Take care about the polarity. Think about the voltage stabilization if and only if something works unacceptably AND you know it is not because of an over-depleted battery.
H: What is meant by "monotonic reset"? Can someone tell me what does it mean by Monotonic Reset? I read this below paragraph from this document and got this doubt. A reset generator / voltage monitor is one option to provide a proper reset. Better yet, for increased design flexibility, a controllable reset (GPIO, dedicated reset output) should be considered. In this case, SMSC recommends a push-pull type output (not an open-drain type) for the monotonic reset to ensure a sharp rise time transition from low-to-high" AI: Monotonic means the same as in mathematics. Basically the derivative of a signal must not change sign, and as an extreme case a signal can still be considered monotonic even if derivative goes to zero. When the signal is changing to some direction, like reset pin voltage having a rising edge where the voltage is going from low to high, the signal voltage is only allowed to increase (or stay same which means it stopped increasing), but the voltage is not allowed to decrease at all even momentarily during the rising edge.
H: Wireless charging IC I am building this wireless IC circuit and I don't understand the term HOST, TRI-STATE an BI-STATE. What do they mean? AI: BI-State is simply a digital logic output with two states high and low. Tri-State is a digital logic output with three states high, low and high-Z. High-Z is a passive output with high internal resistance. Several Tri-State outputs may be connect together if only one of them is in the state high or low and all other outputs is in the state high-Z. HOST is a controlling microprocessor with two outputs connected to the charging IC. Of course you should read the complete technical documentation on the web page: https://www.ti.com/product/BQ51050B#tech-docs the technical articles, the application notes, the user guide and more literature
H: Media Independent Interface I'm reading about the PHY, MAC and the MII interface. I understand that the MDI interface from the RJ-45 to PHY will be 10Mbps, 100Mbps or even higher to 1Gbps. But when this data signals move to the MAC, the MII clock speeds are 25MHz, RMII - 50MHz, GMII - 125MHz, RGMII - 125MHz and SGMII is 625MHz. I just want to understand what would be the speed of the data transfer from PHY to MAC using this MII/RMII/xMII interface as the clock speed is 25MHz, 50MHz and so on. Like, how to understand this: The speed between the RJ-45 and PHY is 100Mbps or higher, but what is the speed between PHY to MAC and how does the speed increase from PHY to MAC? AI: The speed between PHY and MAC also will be the same as between PHY and RJ45. In MII, clock speed is 25MHz, but 4 parallel data signals are used between PHY and MAC. So the speed meets 100Mbps(25x4- 4bit data is transmitted or received on each clock cycle). In RMII, the clock speed is doubled to 50MHz and parallel data lines are reduced to 2. so in each clock cycle 2bit data transmitted or received. So the effective speed is 100Mbps (50x2). In GMII, the clock speed is increased to 125MHz and data line increased to 8bits. So 8bits are transmitted or received on each clock cycle. The speed reaches to 1000Mbps(125x8). In RGMII, the data lines are reduced to 4bits and clock speed remains same. But data is sampled on both rising and falling edge of the clock. meaning in each clock cycle 2 bits are transmitted or received on one data line, so with 4 data lines 8 bits are transmitted or received on each clock cycle and meets 1000Mbps speed (125x2x4) In SGMII, the clock speed is increased to 625Hz and number of dat line is reduced to one. Data is sampled on both rising and falling edge of the clock. So the speed on the link reaches 1250Mbps. But the SGMII uses 8b/10b encoding (encodes 8 bit data to 10bit symbols). So the actual throughput will be 1000Mbps (625x2x8/10).
H: Characteristic impedance when routing differential Can the characteristic impedance value of a single-ended transmissions line be omitted when the two transmissions lines of a differential pair are routed differentially (not two isolated lines)? I ask this because up to now when dealing with a diff pair, I've always first calculated the required width of the two traces from their Z0 value, to then use that width to calculate the required gap from the Zdiff value. After recently watching some videos on the topic, I'm second guessing myself as the Z0 value is never used when calculating for diff pairs that are routed close together. AI: No, it can't be ignored. The following discussion assumes traces on a PCB. The situation is different for interfaces like twisted pairs. For edge coupled (that is co-planar) traces, the differential impedance is mostly determined by the singled ended impedance of each individual trace. An isolated trace has a ZO that depends primarily on it's width and distance from any ground or power planes (they're usually treated the same from a ZO standpoint). When you use two widely separated traces to route a differential signal, the differential impedance will be 2*ZO. When you bring those two traces close together their (in isolation) ZO is reduced because one trace starts to couple to the other by a small amount, assuming they are edge coupled. So each trace's impedance is reduced by some small amount, epsilon (ε), and so the differential impedance becomes 2*(ZO-ε). Note, there have been a number of Q&A's about this topic just in the past 2 years or so that I've been here.
H: Design using 5x1 Mux, would this have any complications? I am building a stopwatch with 5 counters. All are BCD counters with the exception of 1 modulo-6 counter (10ths, 1s, 10s, 1mins, 10mis.) I intend to pass these to the 7 segment displays on my board. To do this I plan to serialize the 7 segment display's since I know that all of the displays share a common cathode. To do this I wired the count values to a 5x1 bus mux with 3 select lines which are sourced from the state value of a FSM (S0,S1,S2,S3,S4) or (000,001,010,011,100.) The state values are then placed through a 3-5 decoder to activate the enable of 5 displays. I did the 5x1 to be more concise in my code, when I do begin coding. I know a 5x1 mux is not as common compared to a 8x1 mux, but I just want to know if this might potentially cause some errors in functionality. Should I just tie the other 3 values of an 8x1 mux to 0000, and should I make the FSM have a total of 8 states? Am I going on the correct path as it is? AI: The 3 'illegal' states should not happen, but perhaps because of a bad reset or other glitch may occur. You should take care that the FSM exits these states in a useful way. Since this would only affect the display temporarily, It is probably sufficient to ensure that any of these states exits to one of the 'good' states. One way would be {S5,S6,S7,S0} -> S1 -> S2 -> S3 -> S4 -> S5 -> S0. Depending on how you want to handle the display during an error, you could just blank it (no segments) if S5,S6,S7 is detected, or you could display an error (e.g. '-' symbol ?).
H: Altium route to plane in the past I always used internal Signal layers, on which I created huge GND polygon planes as a ground plane. However, there are actual solid planes definable in Altiums Layer Stackup Manager, which can be assigned a dedicated net. So I assume, the proper way to define a ground plane is to define a plane in the Layer Stack Manager and assign the GND net. Lets take the following exemplary scenario: Top Layer has some components You define microvias from top layer to inner layer 1 Inner layer one is defined in Layer Stack Manager as a solid plane Afterwards assign GND net to inner layer 1 You now choose a GND pad of some component on the top layer and try to route it to inner layer 1 using a microvia. Step 5 cant be performed. Please let me know, why this is not possible. What am I missing? When should you use planes and when should you use signal layers in Altiums Layer Stackup Manager in order to define your planes? All the best, AI: I think planes are only usefull if you want to use impedance calculations and/or automatically impedance controlled traces. Altium can only do that when you route the traces over a plane. In all other cases I think planes are inferiour to the flexibility of simple polygons on a signal layer. I for my part basically always use signal layers.
H: Simplification down to a single resistor How would you go about simplifying this circuit down to a single resistor? It’s Learning assesment E2.23 in "Basic engineering circuit analysis (Ed. 10 & 11)" I have found out, that the current dosent just go down the path without the resistor, since it splits. But I don’t have an idea for how to simplify it, due to way the resistors are placed. I guess the 10k and 4k resistors arent in series? Attempted solution (current source removed): V_0 using previously attempted solution: I get a voltage of 58.87V and it should be 60V Edit: So this is my attempt at a redraw and I think I have gotten all the nodes right, im a little unsure about node "D", since R3 isnt connected in the same manner as the original circuit EDIT: For the sake of completion, here is my complete simplification, with huge help from @Niel_UK From @Niel_UK AI: At the moment, you have a network of devices, with a random node drawn at the top, and another random node drawn at the bottom, with the current source hanging across the middle. It's drawn to confuse. Letter all the nodes, so you don't drop any in the redrawing. First put in your current source, and draw a bus line across the top, and the bottom, like this. I've started by putting in the 6k resistor. simulate this circuit – Schematic created using CircuitLab Now draw in all the remaining components. You should find it pretty much solves itself, just for being redrawn. Often a circuit that looks complicated is much tidier from a different view. The whole point of a schematic is that it tells a story. The shape of the story that engineers like to see is positive at the top, negative at the bottom, current flowing down the page. Edit following the OP's good attempt I apologise for not having mentioned reference designators at the outset of my answer, especially as two of the resistors have the same value. Fortunately the OP was smart enough to put them in to his schematics. Redrawing the OP's redrawing. C and D are the same node, so we need to move the D line up to C, and flip R1 and R5 round. Now it's clearly obvious which resistors are to be grouped and how they should be grouped. simulate this circuit The benefit of 'positive at the top, negative at the bottom' is most shown when we make the natural extension to 'decreasing voltage down the page', and 'equipotientals across the page'. It naturally places resistors that should be paralleled in parallel, and similarly for series. On reflection, there is a more systematic way to do this redrawing. Starting with the original drawing, identify the nodes by colouring them in, like this. Remember a node is not just a dot, it's also a line or wire between dots. All of the node is at the same voltage. If you're going into a paper-based exam, I would strongly recommend taking in some old technology like coloured pencils. It's apparent now that there are only three nodes, and two of them belong to the current source, leaving just one additional node at an intermediate potential. It's also very easy to compare the original and redrawn circuits for equivalence. C and D are red, A is blue, B is yellow.
H: NPN BJT emitter current only from base I'm working with a BC637 transistor. I want to deliver a 48 V, 2.5 mA signal to my load (diagram below.) I have the load connected through the emitter pin (19.2k Ω resistor.) I was under the impression the collector-emitter current was supposed to be controlled by the equation ß×Ib (base current.) While I was testing the circuit, I assumed ß would be about 100, and so I would get ~4.3 V / 200kΩ = ~ 2.15 mA. However, both in testing and simulating the circuit, I'm getting about 215 µA instead. I even took out the 200kΩ resistor and the current remained basically the same (230 µA.) Since the base resistor had minimal effect on the output current, out of curiosity I calculated what the output current would be if I had just connected a 5V source to the 19.2k resistor. After accounting for the ~0.55V drop from the diode, the math roughly checks out: 4.447/19.2k = ~231 µA. I can't figure out why this would be happening though. I'm a first year EE student with minimal previous electronics experience so I'm guessing there's something fundamental I've overlooked here. Any insight would be greatly appreciated. AI: I was under the impression the collector-emitter current was supposed to be controlled by the equation \$\beta\ I_b\$ (base current.) That is correct, but your problem is in thinking "controlled by" rather than "the relationship holds". In this case, the emitter voltage is controlled by the base voltage -- it's one diode drop* below the base voltage. If you went and measured your base current in this circuit, you should find that it's very roughly 100 times lower than the emitter current ("very roughly" meaning somewhere between 50 and 250 -- read your data sheet for details, but in general transistor \$\beta\$ varies a lot over part variation, emitter current, collector voltage, temperature, etc., etc.) * Usually taken as 0.6V, but it varies depending on all sorts of things.
H: Is it okay to charge a deeply discharged Li ion cell below 1V? I accidentally discharge my lithium cell to 0.45V. Is is okay if I try to revive it by charging with 10mA of current till it reaches 2.5V? cell capacity is 4000mAh. AI: Throw it away. It's a huge safety risk. Deep discharges that bring LiIon cells under about 2.5V cause irreparable damages to its internal structure. See this document: https://www.analog.com/media/en/technical-documentation/lt-journal-article/LTMag_V18N3_Sep08.pdf. At page 9 you find this excerpt (emphasis mine): Avoid very deep discharges below 2V or 2.5V, as this quickly and permanently damages a Li-ion battery. Internal metal plating can occur causing a short circuit making the battery unusable and unsafe. Most Li-ion batteries have electronic circuitry within the battery pack that opens the battery connection if the battery voltage is less than 2.5V, exceeds 4.3V or if the battery current when charging or discharging exceeds a predeined threshold Another interesting reference on the subject is this: https://www.nature.com/articles/srep30248.pdf
H: Why would this PCB design cause a short? Yesterday, I designed my first ever PCB. It's meant to take data from several sensors and pass the data to a Raspberry Pi, which will in turn actuate pumps to control nutrient concentrations in a hydroponic system. When I took this PCB to my professor, he said it would cause a short because of the way the MCP3008 was connected using two layers. He gave me an explanation that I didn't really understand. Can someone clear this up for me? Link to the Fritzing fzz file. AI: As already noted in other comments, some of the traces are fairly close to other IC pads. The better practice for connecting traces to IC pads is to allow for the best clearance when it is practical. For example on the MCP3008 chip, the trace connected to pin 3 initially comes horizontally straight away from the pad before the diagonal turn, this gives a good maximum clearance. Now looking at the connection of pin 1 which hits the pad at center directly from the diagonal trace, the trace to pad clearance is much less (to pin 2). If there are slight variations in PCB alignment there is a higher chance of that trace and the nearby pad shorting together. Also if solder mask is not ideal (or is offset a slight amount, or not included at all) there is a chance that during the soldering operation a short could develop. You have a few other pad connections with this potential issue.
H: What is the reason to connect 4 resistors of the same value as 2s2p? (image) There are 2 parallel branches, each has 2x 10R resistor. It seems to me that the resulting value will be 10R, but I can't wrap my head around why would someone do this if it is not meant to dissipate power (it's meant to be a filter I believe). Context: It is at the power input to a PCB. The source is a 6S Li-Po battery. AI: Dissipation (4x) or pulse power capability (4x) since cost can go up much faster than those capabilities— or redundancy (no single failure will cause a short or open). The latter strategy is used in certain high-reliability and safety-critical applications from domestic gas heating controllers to space gear. But I more suspect pulse handling in this case.
H: Power supply names I'm studying and trying to understand Google developer board schematics, but there are a lot of redundant power supplies. This board is a carrier board when SOM is mounted. For example this: This is a dual DC-DC converter with 3.3V and 1.8V outputs, but in the design there are 1.8V and 3.3V that they are connected with power supplies from SOM: This SOM datasheet shows this: Connectors between SOM and board (outputs): VDD_3V3 is not used. What is the function of this? Does it supply more current? AI: Those are power rails but not coming from separate power supplies. There's only one power supply which generates two separate voltages: BB_3V3 and BB_1V8. And all other 1V8 and 3V3 voltage rails are just copies (direct or filtered) of these rails. The intention is to make the schematic more readable generally: If someone else is to look at the schematic, he/she can understand easily where a voltage is used at. In your case, V3V3 and V1V8 are used everywhere in the circuit. But BB_xxx voltages belong to only baseboard. So the designers might not have wanted to use BB_xx rail names everywhere in the circuit. Look at VDDA_1V8, for example. This is not coming from a separate power supply. It's clear that this voltage is for ADC and probably copied (directly or filtered) from BB_1V8 line. Sometimes we do the same thing for easier readability: simulate this circuit – Schematic created using CircuitLab EDIT One thing the OP missed is that 1V8 and 3V3 outputs of the SOM are labelled as VDD_3V3 and VDDA_1V8, respectively (not V3V3 and V1V8), and VDD_3V3 and V3V3/BB_3V3 do not join together, likewise VDDA_1V8 and BB_1V8/V1V8 do not join either. There's only a single location where the OP may have confused: the supply line of RTL... IC. It looks like VDD_3V3 and V3V3 join but there's a 0R/DNP supply selector.
H: Non volatile memory on simple hardware board I'm designing a low frequency board with some analog signals inputs and a few discrete logic gates which drive warning LEDs. I want to save the status of the LED even if the board is powered off. No microcontroller on the board is allowed. The most common option to save the LED's status when cycling power is to use a backup battery. Is there any other solution? The best choice would be a sort of 1 bit EEPROM flip-flop, but I haven't found anything on the market. Using a parallel EEPROM and driving it through a discrete gate only network could be an option, but this would result in a quite complex hardware. AI: You can use a non-volatile voltage reference in a way similar to this circuit. https://www.maximintegrated.com/en/design/technical-documents/app-notes/4/4624.html It uses the DS4305 which is a voltage refence that stores and outputs the measured value on Vin at the toggle of a pin. It can do 50,000 write cycles. For an analog warning system that might just be the thing you're looking for. Of course you can also do this with an micro and some eeprom or fram, depending on number of write cycles you require.
H: Powering a device from an unknown circuit - voltage drops from 3.3 to 3.2. Is it overloaded? I want to power an ESP8266 (wemos D1 Mini) directly off of a 3.3v power source provided by my garage door opener. This was never intended by the manufacturer, but it would be very convenient. I observe that when I connect the ESP to the door opener, the voltage drops from 3.28v to 3.20v. Is this voltage drop an indication that the ESP8266 is overloading the voltage regulator? AI: It is not necessarily an indication of overloading, but it most certainly should not be taken as a sign that it is "okay". The ESP draws current in relatively large spikes so measurement with a multimeter may not give a true indication of what is happening (you'd need an oscilloscope) and there may also be thermal factors (there could be a regulator overheated and close to failure or thermal limiting when the air temperature rises in summer, for example).
H: Is it ok for the one output of a dual-channel op-amp into an input of the other channel on the same IC? So I have an LM358 op-amp with 2 (as far as I'm aware) separate channels. I need to increase gain but also need to have enough current to activate a diode. The problem is that the device (sensor) whose voltage I will be amplifying cannot source enough current to activate the diode. So I would use another op-amp with a gain of 1 just as a current buffer. Luckily (or perhaps not), the op-amp I'm using has another channel sitting right there unused. Can I save board space by having the output of channel 1 go (not directly) to one of the inputs of channel 2? Or will this type of feedback mess up the operation of the device? Note that their inputs will not be connected, nor will their outputs, only the output of one to the input of the other. AI: There is minimal interaction between the channels on an LM358. Easily detectable, but microvolts. For most ordinary purposes you can treat them as two separate op-amps with common power pins and common thermal considerations.
H: How to convert hydraulic pressure gauge into analog output? Below is the pressure gauge of the heavy equipment. The pressure gauge needle is moved by a hydraulic pressure line. We are looking to capture the hydraulic pressure into an IoT device that takes an analog voltage as input. How do I convert the hydraulic pressure into a corresponding analog voltage which can be given as input to the IoT device? Front side Back-side AI: You use a pressure transducer which gives some sort of electrical output. On the hydraulic side, common interface is national pipe thread (NPT). You need to tap in to the hydraulic line either at the distribution manifold or inserting a 'T' connection. There are many companies that offer pressure transducers. Keller and Omega are two such companies. Omega has good user information on use of pressure transducers. Common output formats are: Analog current output, specifically 4 to 20 mA current. 4-20 mA current loop output is often used in industrial environments since it only requires two wires and accuracy isn't affected by cable length. You need additional circuitry to convert 4-20 mA to the desired voltage range for your analog to digital (A/D) converter input on the microprocessor. There are solutions you can buy off the shelf for interfacing to 4-20 mA current loop. Not knowing your installation, this is a good solution since it is robust. Analog voltage output. You can feed this directly to an A/D converter with some protection circuitry. I would steer clear of this solution due to voltage drop on the ground line that can affect the accuracy of the measurement unless you know what you're doing. Digital output, specifically I2C, which is a standard communications scheme for microcontrollers. This is fine for shorter runs in a nice environment, but probably not suitable for industrial environments where you need long cable runs. This is the easiest interface for a microcontroller that has an I2C interface. [edit] As mentioned by @Kartman, pressure transducers are also offered with CAN bus. Pressure transducers can be damaged by spikes in pressure. Protect the pressure transducer with a snubber designed for hydraulic useage.
H: IGBT operation failure at high current I tried to use IGBT (skm400ga-12t4) to do fast current switching of circuits with an inductor. The gate driver used adum4121-ARIZ and gate driving was performed by making a same circuit to the example in the data sheet. Currently, one of the four IGBTs I have had was fine with gate driving even if 150A current was applied to the coil, but the other three had problem. Symptoms of three problematic IGBTs are as follows. Gate driving works well up to 30A, so I think the gate driver needs protection or I use it more than specifications of parts (IGBT or gate driver), but I don't know where the problem is. The current flowing through the coil (inductor) did not have a problem up to 30A, but adum-4121 shows problem around 50A, and Vout only came out at 3V. Even if I changed the gate driver, it broke down again. I checked that gate driver worked well at first and the ampere was output properly when I applied 50A or higher. However, gate driving did not work properly when the second test was conducted, and the reason was that Vout is only 3V. Maybe the gate driver will have a problem when the current decreases. Gate driving works well up to 30A, so I think the gate driver needs protection or I use it more than specifications of parts (IGBT or gate driver), but I don't know where the problem is. Of course other possibilities may be the 3 IGBTs problem. But it's so strange that 3 out of 4 have functional defects. Could you help me find out what the problem is? AI: You are driving the gate to emitter with 5 volts. Examine the data sheet and you will find that the gate emitter requires more than 11 volts to turn on fully. Typically the IGBT will use 15 volts for proper operation. Your schematic also shows no connection for the emitter ground to your driver. But I suspect you do have the connection. You can also use an oscilloscope to observe the Vce at turn off, to reassure yourself that you are not exceeding the maximum collector emitter voltage.
H: Temperature measurement in strong AC magnetic field I have a coil that is continously driven with a maximum of 100A RMS of current at a frequency of 20kHz. The coil is water-cooled and I would like to directly monitor its temperature. The temperature sensor will be placed on the coil and will need to relay the signal to a microcontroller over 1.5m of wire that will be running in close proximity to the wires powering the coil. The sensor will therefore need to be resistant to being induction-heated by the coil, and the circuit reading out the temperature needs to be immune to the noise picked up by the long wires. My question is: what type of temperature sensor and corresponding circuit would be suitable for this situation? AI: Like jonk said, fiber optics are a great solution for your problem, but what you get will depend on your budget. Older infrared monitors are decently cheap, though, but might require some work to interface with newer equipment. Here's a set I found on e-bay for US$35.00 Some newer equipment can be a lot more expensive, however...
H: Feasibility of 30MW DC transmission over 400m? We have an electric motor final load of 10-30MW, in an isolated industrial location. The power source could be (Li-ion) battery packs, where each pack outputs 1500VDC, ~500A. Having 10-30 of these packs we get 10-30MW DC. Can we efficiently transmit this over 200m-400m (yes! meters!) with standard cables? Hitting <5% losses would be great. Do we need a step-up converter? We want to stick to commodity equipment and voltages. AI: First, 10-30 packs won't get you 10-30 MW if each pack is 750 kW. You would need 40 of them to get 30 MW. Also, you haven't said what you mean by 'standard cables', that could mean zip cord for all we know. In parallel you would have 1500 V @ 20,000 A In series you would have 60,000 V @ 500 A You would need some seriously large cable to handle 20,000 A. With 1 in. thick cable you're talking several hundred volts per leg voltage drop. At 60,000 V the losses would be a lot less, but you'd have some serious safety issues to deal with (not that 1500 V isn't dangerous as well). You could do something in the middle with a series/parallel arrangement. With parallel you're also going to have to think about how to combine them, it's less trouble putting batteries in series than in parallel. And of course you're going to have to figure out how to charge them. Honestly, I would recommend that you pay some engineers to do this for you rather than asking on the internet.
H: How do shift registers work on the gate level? I am trying to understand how a serial to parallel shift register works on the gate level. Where I want to shift/load a bit each clock cycle. I found this schematic for a positive edge triggered D flip flop which works great. Trying to hook them up in series though, they all load the value on the data D line as they share the same clock. How then do these work such that they can load/shift a bit on the data input for each clock cycle? Thanks AI: The trick with flip-flops is that they have a non-zero clock to output delay. This means that when you cascade them, the next flop down the line can grab the current flop’s state before it changes. So the 'next' flop is one cycle behind its upstream neighbor. This clock-to-output delay amounts to a ‘grace period’ for that next flop to grab that state and clock it out. As long as there is enough clock-to-output delay, this works fine: the shift register you show is a series of 1-cycle delays (I added a sim below.) If however there is some extra inserted clock delay on the next flop relative to the current flop (that is, there is clock skew), the next flop could catch the state while the current flop is still in the middle of changing its state, and thus have an unpredictable post-clock value. This situation is called a hold time violation, and is one key design parameter for clocked systems. The other key clocked-system parameter is setup time, that is, how long does the data need to be stable ('set up') before the rising edge of the clock. If the next flop input data changes before it has settled on it, its output state after clock rise can again be unpredictable. This becomes more of an issue as the cycle time gets smaller. In the bigger picture, every flip flop has a sampling window relative to the clock where the input data must be stable. This is the time interval between minimum input setup and minimum input hold. I call this the validity window, and it must be met for the system to be reliable. To ensure your system will work sometimes you need to understand your flip flop output delay and setup / hold characteristics, taking into account your system clock skews and your desired clock rate. In other words: hold time requirement: (output delay min - clock skew) > input hold min setup time requirement: (cycle time - output delay max - clock skew) > input setup min Most of the time this isn't so hard. Flip-flops in small-scale logic like TTL or CMOS are generally designed to require zero hold time (internally, they insert delay on the input relative to the clock.) This makes system design somewhat simpler. BONUS: A Falstad Sim (simulate it here):
H: How to add harmonic distortions to guitar amp? I was reading about the carver challenge,(https://www.stereophile.com/content/carver-challenge) and read that he had added a series of potentiometers to one of his amps that had allowed him to independently control each harmonic. I was wondering if this is possible to add to a simple amp design such as this one here AI: I'm not sure how the article on the Carver Challenge relates to your question. I searched the page and the word "harmonic" does not occur in it. If you would like to have knobs to adjust individual harmonics, you should first read up on the Chebyshev polynomials which can have the effect of multiplying frequency (i.e. generating a harmonic). To strictly implement the Chebyshev polynomials as transfer functions of a distortion unit in a guitar amplifier, you're better off in the digital domain. There are even plug-ins for popular digital audio workstations that do just that. However, if you look at the plots of these functions you may get an idea of their "shape" and how it might be accomplished (not strictly, but maybe efficiently and musically) as a circuit, e.g.: T2(x) looks a bit like rectification, and in fact rectification is part of the popular "octave fuzz" effect that adds lots of second harmonic.
H: How to build boolean expression from these logic gates I have these xor logic gates and I want to create a truth table from it. However I am having issue reading it from logic gate. Could anyone show me a minimal example how to convert this to a boolean expression? AI: You provided a solution of your second example and it appears you've now gathered things up. So here's things done explicitly. Hopefully, it helps a little to deepen it. If you insert some columns for the results of combining A and B and for combining C and D, then you get an expanded table which looks like this: $$ \begin{array}{rl} \overset{\text{2nd Example Solution}}{ \begin{smallmatrix} \begin{array}{|cc|c|c|cc|c|c} \hline A&B&A\oplus B&&C&D&C\oplus D&&F\\ \hline 0&0 &0 && 0&0 &0 && 0\\ 0&0 &0 && 0&1 &1 && 1\\ 0&0 &0 && 1&0 &1 && 1\\ 0&0 &0 && 1&1 &0 && 0\\ 0&1 &1 && 0&0 &0 && 1\\ 0&1 &1 && 0&1 &1 && 0\\ 0&1 &1 && 1&0 &1 && 0\\ 0&1 &1 && 1&1 &0 && 1\\ 1&0 &1 && 0&0 &0 && 1\\ 1&0 &1 && 0&1 &1 && 0\\ 1&0 &1 && 1&0 &1 && 0\\ 1&0 &1 && 1&1 &0 && 1\\ 1&1 &0 && 0&0 &0 && 0\\ 1&1 &0 && 0&1 &1 && 1\\ 1&1 &0 && 1&0 &1 && 1\\ 1&1 &0 && 1&1 &0 && 0 \end{array} \end{smallmatrix}} \end{array} $$ Note that F is the result of performing an XOR on the two newly inserted columns. That's one way to approach it. The second logic, though, also just generates the parity where '1' occurs when an odd number of inputs are '1' and where '0' occurs when an even number of inputs are '1'. So that would be another way of producing the right output. But you'd need to have been familiar enough with the logic to realize this. The first logic does the same thing, just differently. So I think you are being asked to discover this symmetry under XOR on your own. Once you get used to it, you will also see this 4-bit k-map as a familiar pattern: $$\begin{array}{rl} \begin{smallmatrix}\begin{array}{r|cccc} A\oplus B\oplus C\oplus D&\overline{B}\:\overline{A}&\overline{B}\: A&B \:A&B \:\overline{A}\\ \hline \overline{D}\:\overline{C}&0&1&0&1\\ \overline{D}\: C&1&0&1&0\\ \vphantom{D\:\overline{C}}D\: C&0&1&0&1\\ D\:\overline{C}&1&0&1&0 \end{array}\end{smallmatrix} \end{array}$$
H: Analog ground and pgnd in proteus I am doing a project on proteus,I cannot find the ground terminal, where can I find AGND(Analog ground) and PGND in proteus? AI: In the left hand menu of Proteus, go to the "Terminals" tab and you'll find the symbols for power, ground, input, output and others. connect this to your circuit and simply re-name the net to PGND or AGND
H: Why TRIAC is not triggering? I'm trying to trigger a TRIAC BTA16-800 using an MCO3021 optocoupler. I have a two-channel power supply, in one of them I'm pulsing the optocoupler at 120 Hz and the other channel is configured as a sinusoidal source of 24V amplitude and 60 Hz for power on the other side of the optocoupler and the TRIAC. But apparently the TRIAC is not triggering as it should. When I measure the output of the optocoupler I get the following waveform (yellow is the 24V source and blue is the optocoupler output). If I vary the phase of the pulse that I am applying to the optocoupler, the output is also varied, as expected. Connecting the circuit as follows, applying a pulse to the input of the optocoupler and a sinusoidal voltage of 24V amplitude to the output of the optocoupler and the TRIAC, I cannot get any voltage across the load. Is there something wrong with the circuit design? Or am I forgetting something? Measuring it wrong? Thanks in advance, I've been trying to get the TRIAC to work with the optocoupler for some time now and I still haven't gotten any results. AI: In your circuit, the gate will not get voltage, as you the coupler is connected between the gate and A1. Swap A1 and A2 triac conections, that is, connect coupler resistor to the other 12 Vac supply point and check.
H: Layout for MOSFETs (copper area for source vs drain) I have a schematic. Here is a section of it: The FETS are being driven by the chip to behave as ideal diodes. Plus two FETs in series to block current path when chip is in shut down stage. I've seen most chips have the drain connected to the thermal pad and generally recommended to maximize the drain copper plane to reduce thermal impedance of the FET. Why the drain and not the source for removing heat? Also in regards to layout would it make sense to bring the source of the 4 FETs very close together and then connect with a small plane and use the remaining space on the board to maximize the area for drain? Or do I need to increase the plane size for the source too? AI: I've seen most chips have the drain connected to the thermal pad and generally recommended to maximise the drain copper plane to reduce thermal impedance of the FET. Why the drain and not the source for removing heat? The answer is simplicity itself; the drain region of a power MOSFET is by far the largest area/volume on/in the silicon die and therefore, allows the highest removal of heat: - Image source. would it make sense to bring the source of the 4 FETs very close together and then connect with a small plane and use the remaining space on the board to maximise the area for drain? Yes, I'd do it that way.
H: Larger phase margin means less overshoot? Why is it that the larger phase margin means the system has less overshoot? I have heard that the larger phase margin means greater damping, but I don't how they are connected to each other. Could someone give a physical example that would show their relationship, like the low pass filter I mentioned above( if my example is right )? And in many system, they require that the phase margin must be higher than 45°. How do they know the number 45° can get their requirement? AI: Let me start by saying that the step response of a system is determined only by the position of the poles and zeroes of the transfer function describing the system. The terms: bandwidth, phase margin, crossover frequency, etc. are things we can determine when looking at the open loop Bode Plot of a system (closed loop for bandwidth). An important thing to remember is that a Bode Plot is only a tool we can use to predict the response of the system but in the end, the system response is determined by the pole/zero placements. Wikipedia derives a connection between bandwidth and rise-time of a system \$t_r=\frac{0.34}{BW} \$ and a connection between overshoot and damping ratio here \$PO = 100e^{\frac{-\zeta\pi}{\sqrt{1-\zeta^2}}} \$. Example Let's take a simple second order transfer function \$G_{plant} = \frac{100}{s^2+2s+8} \$. Let's check the phase margin and the step response of the closed loop systems \$G_{cl} = \frac{G_{plant}}{1+G_{plant}}\$ and \$G_{cl2} =\frac{G_{plant} \cdot 0.1}{1+G_{plant} \cdot 0.1} \$. The transfer function of the closed loop system is also shown: - Clearly, we see a faster rise time for the system with the high bandwidth (the left one). However, we also see many oscillations and large overshoot. For the system with high phase margin, we see less oscillations and smaller overshoot. But we also see a slower response, due to the lower bandwidth. Looking at the transfer functions $$G_{cl} = \frac{100}{s^2+2s+108} \: \: \: \text{and} \: \: \: G_{cl2} = \frac{10}{s^2+2s+18} $$ it's clear that the damping ratio is largest for the slower system. The poles for these systems are: - Observations When we lower the bandwidth the response of the system becomes slower, because the system poles move closer to the origin. When we increase the phase margin the damping ratio becomes larger, because the poles move closer to the real axis in the complex plane.