source
stringlengths 620
29.3k
| target
stringlengths 12
1.24k
|
|---|---|
Is it safe to exceed an LED max current when ON time is less than 100%? For an LED that is rated at 20mA, is it safe to PWM it at 40mA half the time? Will that make it nearly as bright as if continuously supplied with 20mA? Addendum: Thanks Olin and tcrosley for your answers. I didn't want to distract from the question by adding the details of what I am doing, but here it is: I am working with an LED strip from http://www.environmentallights.com/LED-Strip-Light-Double-Density-4-Wire-Red-Green-Blue-by-the-5-meter-reel_P3846.aspx . They do not have a datasheet per se. I think the LEDs are connected as shown in this image http://www.ladyada.net/wiki/_media/products/ledstrip/astripsch.png . Based on what I read about LEDs in general, 20mA per color seemed safe. I tested it - using 12V, potentiometer and 3 inches long strip, that is 3 leds in series each color - for short periods, few minutes, and 20mA per color seems to have worked fine, good enough brightness and no overheating or color intensity variation. I will be working with up to 2 feet length strips, that is 160mA per color and 480mA to get White. I may have up to 10 strands to control. That will add up to about 5Amps. I will be using the Propeller microcontroller from Parallax to flash the strips in various patterns and colors. Will use mosfets to drive the LEDs. I was thinking of supplying about 200mA instead of the 160mA needed per color, but then I will PWM the leds such that only one color is on at a time; at a frequency of 1KHz. So to get white, each color will be on for one third the time, that is 0.3 msec. At any moment only one color is on, only 200mA is drawn. I imagine the leds will be less bright, hopefully not by much. So, for 10 strands, I will deal with only 2A instead of 5A. Please let me know if what I am thinking is off. Thanks. <Q> The datasheet will have this information. <S> Some LEDs that can only handle 20mA continuous are spec'd for <S> very brief pulses of a much higher current. <S> You would have to specify the PWM frequency to be able to look up the answer to this question in a datasheet. <S> For one particular product, the CREE CLV1A <S> RGB LED, you may drive red at 50 mA continuous or with a 200 mA pulse (pulse width ≤0.1 msec, duty ≤1/10), and blue and green at half that current. <S> It's all in the datasheet. <S> You can also see that there is a diminishing return as the relative luminuous intensity vs. forward <S> current is not linear at high currents. <S> I think you should not worry about the brightness loss from driving your LEDs at a 50% duty cycle at the maximum continuously rated current. <S> IIRC <S> the eye has a non-linear response to brightness and they will appear somewhat brighter than half as bright, and you won't destroy your LEDs if you screw up the PWM. <A> If you are driving the LED from a microcontroller with a PWM output, and setting the maximum current above the safe continuous operating value, you need to make sure there are no failure modes where the PWM could stop with the LED driven on. <S> I have seen this happen with a multiplexed, multi-digit seven segment display where something caused the software to fail and <S> one digit remained overly bright until it failed. <A> Your spec "rated at" is unclear. <S> Rated for continuous operation or maximum pulse <S> current? <S> What you are looking for is the maximum allowed instantaneous current. <S> This is found in the datasheet along with the maximum average current. <S> A LED rated for 20 mA average current can most likely be run at 40 mA at 50% duty cycle as long as the frequency is fast enough, probably a few 100 Hz. <S> Ordinarly T1-3/4 LEDs can generally take this. <S> Some high performance lighting LEDs are run so close to the limit that their maximum pulse current and average continuous current are fairly close. <S> As always, of course, read the datasheet . <S> Usually this is small, but again, read the datasheet . <S> High performance and high power lighting LEDs tend to have more falloff because their intended operating point is already somewhat into this region. <S> In any case, efficiency (light out per electrical power in) falls off with current because the voltage accross the LED increases with current. <S> Even if the light output is always proportional to current, the voltage will increase with current a bit and therefore the input power increases with current more than the light output. <S> For most ordinary 20 mA indicator LEDs, 40 mA half the time at a few 100 <S> Hz is for practical purposes almost the same as 20 mA continuous. <S> This is less true for higher power and higher performance LEDs. <S> Again, read the datasheet . <A> I've done that in some multiplexed arrays of high efficiency LEDs (used as a graphic display). <S> because it was the only way to get the rated light output from the leds with mux. <S> I've used 2A at 0.5% duty cycle (LEDs were rated at 20mA). <S> Displays are working almost 24/7 since 2007... <S> so, it surely is a bad practice, but leds doesn't seem to care... :-)
|
LED brightness is pretty much proportional to current except that there is often a falloff in this relationship at high currents.
|
What's so great about PPC? There's gotta be something With this question in mind (the first one that stackexchange is offering me right now among the "Questions with similar titles"), I'd like to steal the idea of the question and ask it about PPC. What's so great about it? All other chips I've seen - ARM, MIPS, SuperH, x86 - crunch numbers just fine. The background of this question - about PPC, that is - is that the PPC architecture is used in many DSP chips, in particular in the automotive industry. Of course, this could simply be a question of momentum, and allow the developers to stay with an architecture they know well, including the toolchain. And the software they've written until now, of course. But assuming I'm starting a DSP project anew, without any old baggage to lug around - is there any compelling advantage of the PPC architecture that would persuade me to prefer PPC to, say, ARM? Knowing about the power efficiency of ARM chips, let me mention that my design would run off the grid, not on batteries. <Q> "What's so great about the PowerPC?" <S> There are so many ways to answer this question. <S> It wouldn't surprise me if there is a book on the topic. <S> I will answer it in the most concise and simple way possible and leave the details for the reader... <S> For much of its life it was the fastest non-Intel CPU available (that was also commonly available). <S> Compared to todays CPU's the PowerPC is just OK <S> but at the time it was arguably the best. <S> But in the current CPU market, ARM is the dominant non-Intel based CPU and the PowerPC is fading fast. <S> Except for some very niche applications, there is no good reason to design a new product with a PowerPC CPU anymore. <S> As for DSP, there are so many other ways to get fast number crunching than to use a PowerPC. <S> Only a few high-end versions of the PowerPC ever did well with DSP, that would be those with the Altivec instructions. <S> But that is old technology and there are Intel and ARM processors that do just as good if not much better. <S> There are also dedicated DSP chips that would be a modern alternative to the PowerPC for this application. <S> If you can use off the shelf <S> PCB's then a modern Intel CPU can give you massive amounts of DSP power for relatively little cost. <S> If you can't use an off the shelf PCB, and must make your own, then consider ARM chips or dedicated DSP chips (or ARM's with dedicated DSPs in them from T.I.). <S> I say this without knowing your application, so take this advice with a huge grain of salt. <A> Once upon a time the x86 family were considered to be caught in a computing paradigm that demanded more and more megahertz and more and more transistors in order to keep up with comparitively simple RISC CPUs like PowerPC and ARM. <S> In short, the Intel CPUs at the time could be considered to be measured in CPU cycles per instruction, while the more modern architecture and RISC instruction set of the newer designs meant that they could measured in instructions per CPU cycle. <S> Enormous amounts of money and resources and exploring numerous dead-ends would eventually allow Intel and AMD to create x86 compatible chips that wrap CISC compatibility around a simplified RISC-like core to compete with the RISC designs on a level that seemed unlikely at the time. <S> Anyone creating a new computing platform at the time could see the writing on the wall, common thinking was that the x86 family were a technological dead-end, with even Intel putting their research efforts into RISC at the time with i960 then Itanium. <S> Meanwhile, in Apple's case at least, much of the early speed advantage of the more advanced PowerPC chips was squandered by users having to run most third-party software in emulation for a number of years. <S> By the time Apple had completed their 68k to PowerPC transition, Intel's revolutionary Pentium came along with similar price/performance and set the stage for PowerPC's fall from grace. <A> The simple answer for the modern advantage of PowerPC architecture is in real-time operation. <S> There is a whole market for safety critical equipment where even a small unpredictable delay is a problem. <S> Think brakes on a car, avionics controls for an aircraft, and anything to do with the space industry. <S> A delay can kill people, or destroy millions of dollars of equipment. <S> If you are not using a Real-Time Operating System (RTOS) <S> then this is probably completely irrelevant. <S> Windows, and most flavors of Linux are useless for real-time operation, and the features of the OS ruin the real-time capabilities of the processor. <S> Intel never was great at real-time systems, and their processor "performance" improvements in the last decade have completely abandoned the principle. <S> Intel performs active scheduling management in their processors, which is a problem with real-time, and have added predictive processing and other various improvements. <S> For the common-user, this speeds up performance, but it is a problem for real-time operation. <S> There are some new ARM designs that are now reaching acceptable levels of real-time operation, but those are still significantly lower performance in processing power compared to a PowerPC. <S> Basically you can look at the market like this. <S> Raw processing power, you want Intel. <S> Low power usage, you want ARM. <S> Real-time operation, you want PowerPC.
|
The PowerPC was a great processor because it was the right chip, for the right price, at the right time.
|
Why does electric arc in a switch prefer a curved path over a straight path? Recently I found this video of a 500 kilovolts line being opened under load. When the switch contacts are pulled apart an electric arc predictably starts. While the contacts are close to each other the arc runs along a straight path between the contacts. Then as contacts are pulled further apart the arc starts to bend and turn into a steep curve and its length becomes several times greater than the distance between the contacts. Then finally the arc just fades out. That doesn't make sense to me. As I see it the arc should take the least resistance path and that's clearly a straight path, not a steep curve. Even more, if the arc takes a curved path why would it fade out suddenly instead of just taking a less curved path of less resistance and continue running? Why does the arc behave this way - first prefers a curved path and then suddenly fades out? <Q> There are two combined phenomena: <S> The current chooses always the least resistive path, that is not necessarily the shortest, as can easily be proven by physical circuits; Such high voltages and currents have an ionization effect on the surrounding air (electrons are stripped off of the atoms) <S> that cause it to become more conductive in the area where this current is flowing, but at the same time also hotter; this hot air is lighter than the surrounding colder air <S> so it starts going upwards, but still leaving this "conductive" path in which the current continues to flow. <S> This process ends when the path of more conductive air becomes too resistive for enough current flowing in it, and the ionized air goes up, replaced by "normal" and less conductive air, which is not conductive enough to create the arc. <S> When the arc fades, it's also because this triggering event has ceased. <A> This was a comment but the links were too long. <S> As well as what others have said - look up " magnetic blowout " and be suitably amazed. <S> More for DC but certainly not only. <S> A magnet is used to deflect the arc so it lengthens and fails Equipped in even very small and common switching devices. <S> Many of <S> these and these Even Tesla did it :-) <S> Interest only - from here EXPERIMENTS WITH ALTERNATE CURRENTS OF HIGH POTENTIAL AND HIGH FREQUENCY. <S> BY NIKOLA TESLA. <S> A LECTURE DELIVERED BEFORE THE INSTITUTION OF ELECTRICAL ENGINEERS, LONDON. <S> With a Portrait and Biographical Sketch of the Author. <S> NEW YORK: <S> 1892 <A> The air ionises initially and an arc forms. <S> Being air, and being hot, it rises. <S> The ionised "tunnel" air rises and "breaks" at which point the arc is extinguished. <A> The arc ionizes the air. <S> The air has finite resistance, so it heats as current flows through it. <S> As it heats, it becomes more buoyant and raises. <S> Current simply follows the path of least resistance. <S> Jacob's Ladder is a visual effects device, which works on this principle. <S> Some lab scenes in Frankenstein movie feature it. <S> There are a few videos of Jacob's Ladder on YouTube <S> ( here's one ). <S> EDIT: <S> Look carefully at the beginning of the experiment in OP. <S> You'll notice that the arc starts with something burning in a straight horizontal line. <S> There was a conductor which burned apart, and that had established the initial arc (tunnel of ionized air).
|
Probably the arc was caused by an event, such an overvoltage, or simply, as in one of the videos, an object that lowered the resistance between the two contacts; OR, like the video in the example, a switch that is opening.
|
Connect a light sensor to PC I want to connect a light sensor to my PC ( serial or usb ) and read the values of that sensor. Is there a way i can do this without a microcontoller? I am looking into the cheapest method of acheiving this functionality.I must say i am a n00b in electronics so i would be grateful for any detailed explanation. Thanks. <Q> Easiest (but not cheapest!) <S> way is probably to use a webcam and integrate the pixel values. <S> I don't know how much error there is in this process, but I'm quite certain it could be made to work. <S> [edit: expanding on Oli Glaser's comment]I didn't notice before that serial was an option. <S> This will cost about $1.50 for a DE9 connector, photocell and capacitor in single quantities. <S> The catch is that unless you're doing this in DOS, you will have to write a kernel driver to do the reading. <S> Windows has enough going on that you are not going to get millisecond-level latency. <S> An alternative is to use a very high value capacitor (say around 1000uF or so). <S> My experiments with NT and XP show that 50 millisecond latency is not unreasonable. <S> By using a 1,000uF capacitor, if we assume that the average resistance of the CdS cell in the range you are reading is about 25kohms (I wrote code to do just this on an AVR a month ago <S> and I think the light in an "average" room translated to about 25k), then the time constant is 25 seconds. <S> That should give you plenty of resolution even if reading the serial port has 100 millisecond imprecision. <S> Now you've piqued my interest :-) <S> I'm going to have to try coding this up. <S> Wonder if .NET is up to it? <A> You may want to try this: <S> http://www.yoctopuce.com/EN/products/usb-sensors/yocto-light <S> It's not the cheapest, but it's one of the easiest. <S> USB,tiny, no driver required, quite a lot of OS and programming languages supported. <S> And it features a data-logger... <A> If you want to read a range of values from your light sensor (as opposed to on/off) then you will need more than just the sensor itself. <S> As Kenny says, a $1 uC can achieve this quite easily. <S> The code could be written in minutes. <S> Serial port (or USB/serial cable) would be easier than USB, though obviously not as "up to date". <S> If it's not a commercial project then this may not be an issue. <S> Even with USB there are plenty of sample projects for PICs/Atmel/etc that could be adapted quickly. <S> If you just want an on/off (i.e. light/no light) sensor, then you could probably use one of the serial control lines (DSR or CTS maybe - see 9-pin serial pinout ) to interface directly. <A> Cheap and simple is achieved with a "555" light to frequency converter. <S> Set to low frequency and drive a line on eg RS232 input or RS232 to USB converter <S> One possible 555 circuit From here . <S> TLC555 here. <S> Increase C1 to lower frequency. <S> Or use 555 and eg LDR in place of R1 or R2 here. <S> From here not much other info. <S> Legion <S> 555 / frequency / RS 232 <S> / ... <S> TSL23x series light to frequency converter ICs TSL235 datasheet here Very low frequency at very low light. <S> Cover with translucent "filter" eg paper) to reduce level to get eg 1 <S> Hz. <S> Sparkfun <S> TSL235R <S> Kevin Vermeer was here 2 years ago :-) <S> Another datasheet <S> You Tube TSL230 ... <S> TSL23x suppliers via FindChips <A> Consider also this: with a specific analog circuit, or anyway a discrete circuit, you are forced to a certain behavior, and you can customize it only to a certain point. <S> If you use a uC, there are several advantages: <S> Built-in UART (or even USB) <S> Nearly limitless configurability Relatively high time to get it working Possibility to add many features <S> And, if you use something like FTDI chips, the effort is almost none, just use one analog input (almost).
|
The dirt-cheapest way would be to use a CdS photocell and a capacitor and measure the time constant using the serial control lines. You could use one of the output control lines (RTS, DTR) to power the sensor and a transistor with resistor/LDR divider to switch the input control line.
|
Safe temperature for desoldering SMD components w/ hot-air rework gun? What is a reasonably safe temperature to use for desoldering SMD components using a hot-air rework gun? I have a new-to-me rework station from Xytronic and the documentation clearly assumes you know what you're doing… It tells you what temperature range the gun is capable of, but has nothing to say about where you should be setting it. Also, I was surprised by how little air pressure the unit generates even when the AIR setting is set to max (99). Is this normal? My one test so far was to desolder a random surface-mount IC package from a piece of electronic salvage I had lying around (kept for exactly this purpose). I tried to step up the temperature slowly, but I got all the way to 400 degrees Celsius before the chip seemed to suddenly be floating free. I never did see any visible change in the solder… (But perhaps that's just my eyesight.) I am concerned that at that temperature any component that I can get off a board might be damaged by the heat. <Q> Very good idea to practice, practice, and practice some more on salvaged boards until you get competent with new tools. <S> You didn't notice the solder had reached the molten state because there's so little of it used to solder components. <S> The reason why you need a much higher temperature is because you want to get the solder joints to the melting point as fast as possible. <S> If the hot-air gun is set to a much lower temperature, it'll take a longer time to reach the melting point. <S> The longer the time to raise the temperature of the leads/pads will increase the overall temperature of the component, possibly past the point of destruction. <S> So the technique is to heat it up fast, remove the part and hot-air gun, then put the part where it can cool off. <S> Now, if you're removing a part that's already fried due to some other reason, no worries then. <S> Just don't damage the board by overheating the pads and causing them to lift off. <S> If that happens, your headaches are just beginning on this repair. <A> I am working with SMD for a while <S> and I suggest you use leaded solder to treat the oxidized solder joints with flux before you get to the hot air stage. <S> After solder mixture process, preheat the board close to 200C and continue with hot air station. <S> I use analog hot air stations because I don't want to turn around and look at the temperature. <S> I know where I have to set the hand dial without looking <S> and I think that is between 7-8 on Hakko 852 station (around 420C). <S> Preheat the chip from distance and can feel when it is enough to start. <S> I count to 5 and viola pull the chip out without any problem. <S> The hard ones are BGA chips and need precision timing and good BGA preheater. <S> Average ICs are rated to 380C/10Sec <S> I think <S> but I am not sure. <A> If you just bought it (or replaced the element), some stations will need calibration. <S> (ALWAYS check).If your unit has potentiometers on the front use a non inductive screwdriver. <S> Otherwise look for a calibration mode. <S> Search: "rework station calibration" or "rework station calibration mode"Harbor Freight tools has a infra red temperature probe for $20.00. <S> -Should do the trick. <S> When I unboxed mine, it was 100c out.-e <A> preheat your pcb to 150c. <S> Use Chipquick alloy or Zephertronics Lo melt. <S> Apply flux, lomelt let sit for about 4 mins then lift the chip off the pcb. <S> Use flux and a swab to gather and remove the leftover lomelt <A> Pre-heating at 200 degrees Celsius for 1min, then raise temperature to 400 degrees Celsius to heat for 20sec. <S> You can use a thermal couple to monitor the temperature.
|
The typical lead-free solder has a melting point around 217 degrees C, so you'll have to get the leads and pads up to that temperature before trying to remove the component.
|
Braking with an electric motor I realize that when you short the terminals of a motor, it stops the motor faster than just turning off the voltage. I was wondering if putting a large diode across the leads so that when the motor is running current can't flow through the diode, but when the current stops, the diode would short the pins. In other words, connect the positive (anode) side of the diode to the negative pin of the motor and the negative (cathode) side of the diode to the positive side. Would this have the same effect as shorting the leads of the motor? <Q> A typical DC motor may be reasonably well modeled as an ideal motor in series with a certain amount of inductance and resistance. <S> An ideal motor will always have voltage across its leads proportional to rotational speed, and current flowing through it proportional to torque. <S> If a motor with frictionless bearings and 2.4-ohm internal resistance would have a no-load speed of 1200rpm at 12 volts, then such a motor rotated at 1200rpm would generate 12 volts. <S> If the leads are shorted, such a motor would have 5 amps flowing through it, and would generate 5 amps' worth of torque. <S> As a pretty good approximation, shorting a motor which is spinning at a certain speed will generate braking torque pretty close to what would be obtained by driving a stalled motor with the same voltage as the spinning motor would generate open-circuit. <A> This is a more popular method of braking a motor than many people seem to realize. <S> The physics behind it boil down to the fact that an electric motor is a generator (the input power is provided as mechanical power from the shaft, e.g. when braking due to inertia) as well and can 'flip' from one operation mode to the other without any further extras. <S> In practical applications this is done either by feeding back the energy stored in the motor into the supply (called regenerative braking ), if the supply allows it and the amount of energy saved that way makes it economically worthwhile (the power electronics are more complicated - and expensive - in that case) or you can simply connect a resistor (imaginatively called braking resistor ) across the motor during braking. <S> I strongly suggest using a resistor and not simply shorting the motor to avoid overheating or other unwanted side-effects from the big reverse currents that are produced. <S> Otherwise, happy braking! <S> :) <A> In some H-bridge drives you sometimes see modes where both low-side drives (with both high side drives OFF!) are turned on simultaneously to provide braking. <S> This lets current generated in the motor loop around through the lower rail node, essentially shorting the motor; the current thus generated provides braking torque in the motor, and mechanical energy absorbed by the motor turns into heat in the resistive elements along the path of that current. <S> (Of course, you could turn on both high side drives and leave the lower ones OFF, and get the same effect, with the supply rail node allowing the motor current to loop back.) <S> I believe the H-bridge has to be constructed with FETs as the active elements to accomplish this <S> , b/c during braking, one of the sides has to conduct in the opposite direction than normal. <A> I realize this is an old thread, but diodes were/are used to brake small DC motors. <S> For example, with 1/24th scale slot car racing, a now defunct company called Cidex made a controller that used a diode rectifier not only for voltage control (5 rectifiers) for the motor control but also used a 6th rectifier(KBU8B) for braking. <S> Max brakes on a slot car are always to simply short the motor. <S> Routing the electrical path through one (1) diode in that rectifier would give a little LESS braking. <S> Routing through two (2) diodes in that same rectifier would give even less braking. <S> Lastly, opening the brake circuit would simply allow no braking and allow the slot car to coast. <S> Another popular method to slow a slot car down is to use a 2-5 ohm power rated rheostat/potentiometer. <S> When set to zero ohms (shorted) it would allow max braking. <S> The more resistance input into the circuit (by turning the knob on the pot) would decrease braking. <S> Pots are popular because it allowed precise adjustment to braking... <S> Braking generates heat, the potential energy in the slot car/motor has to go somewhere... use heat sinks!
|
You must keep in mind that the energy released through braking (accumulated as kinetic energy in the motor plus the mechanical inertia of the load e.g. flywheel) will be transformed into heat and you don't really want it to be dissipated in the motor, but rather in the braking resistor. Remember that a rectifier has 4 diodes in it.
|
Selecting the right microcontrollers for this project (Arduino based) I'm thinking about buying some Arduino development kits to migrate from my actual development platform (picaxe) to Arduino. I want to buy just what I need to develop my next project, but taking in consideration that I am a total ignorant of the Arduino capabilities I have some issues trying to decide what to buy. So I decided to explain you what I want to do and what I think I need (in terms of hardware) hoping to have some feedbacks. Ok the idea is simple, over the serial cable my computer (or USBtoserial) I will send some commands to my Arduino Uno board: these commands are composed of several bits (defined in my own protocol); anyway, after my Arduino has received this commands it will take some actions, at the moment the only action that matters is to send a word to other Arduinos connected to a communication bus (need to decide if I2C, serial or TTL). This word is composed of 1000 bits, the firsts 8 bits are just the header (containing the address of the chip that will receive the data) and rest is just data (the actual length of this word is always fixed to 1000 bits). So in summary this is what I will do: For example, from the PC, I send the command over the serial cable: 11011011 1010101010011…….01101. This goes to the Arduino board who resend it to the communication bus where all the other micro controllers are always listening to the bus, they will read the first 8 bits and compares them to their own address: if it matches the micro controller address (stored in a variable), it will store the next bits on memory (if the power goes off I don’t need to save the informations, so it could be a volatile memory). After that the micro will be waiting for a future command that will eventually tell him to output the data bits over an output pin. All the micro will only save one word of 1000 minus 8 bits at the time, so the memory is fixed for just 9992 bits. I'm having problems to decide which small microcontroller to use, which communication protocol to use and some issues with the software. Taking is consideration that the distance between the first micro and the last one could be up to 7 meters I think that I2C is not the way to go, serial will be great but that means that I will need a serial to ttl converter on each micro (take in consideration that they could be up to 128 micros) so that can make the project to go out of my budget, TTL will be great but I never tried a communication via TLL over 7 meters, what do you think? I think a good cable will not drop so much voltage in 7 meters, also the speed I thinking to use is max 19200bits/s. About the micros, my biggest concern is to choose the cheapest alternative because they will only receive data in one pin (serial data) saved in a volatile memory, and then output that data at a fixed rate over an output pin (to light up and off a led for example). I saw on internet that you could program the ATtiny with the arduino board, is this chip capable of doing what I need? Do I need an external memory to store the data? Or I can save it on a variable? (what memory you suggest?) And my final question is about software, when I was using PicAxe, a very simple development kit for microcontrollers when I need to store a word over a serial input I just make this: serin serpin,N2400,(27),seraddr, b4,b5 Where serin is the command to begin the serial acquisition, serpin is the number of the input pin I want to use and b4 and b5 are four bits variables so using they two I have a 8 bits word. The PicAxe platform is fixed with 10 4 bits vars (b0,b1…….b9) so it will be imposible to store a 1000 bits word without passing the information to an external memory. With the Attiny I can store that amount of data on a program var? What is the maximum I can store? At the point do you still think the attiny is the way to go? Thanks so much for any feedback and suggestion! <Q> As you are already planning to use an Arduino, why not stick to Arduino's? <S> Or get yourself an AVR programmer and use bare ATMega328 chips. <S> As for the communication: RS485 is a very reliable bus, and the transciever chips are cheap. <S> For even lower cost you could send a TTL-level signal and regenerate it at each node . <A> Take a look at the TI MSP430 series. <S> They are really low cost (start at under $1.00) and features increase with price up to quite powerful little SoC devices. <A> Most small microcontrollers will be capable of doing what you need. <S> You could even ditch the Arduino "wrapper" and use a USB capable micro in it's place. <S> Microchip, Atmel, TI, ST, etc all have 8, 16, 32-bit uCs of varying <S> RAM/FLASH/EEPROM sizes to pick from. <S> All the modern uCs come with at least UART, SPI, I2C peripherals that can be used for your communications. <S> There is not a lot in them really, I'd just pick one and see how you like it. <S> I (currently) use ST's 32-bit ARMs and Microchip 8, 16 ,32-bit PICs. <S> I'd probably use a few PIC12F or 16Fs for the slave uCs and a PIC18F or PIC24F for the master. <S> You mention needing ~10kbits of memory (not quite clear what type or which uC needs it from your description to me though) <S> It's easy to determine what is suitable though, just check the RAM/ROM/EEPROM specs of each uC you look at. <S> For example the PIC16F1938 has: Parameter Name Value Program Memory Type <S> Flash Program Memory (KB) 28 CPU Speed (MIPS) <S> 8 RAM Bytes 1,024 Data EEPROM (bytes) 256 <S> So 28KB of program memory is more than enough to store non-volatile data if your program is small enough <S> (on the newer PICs you can also read/write to program memory at run time) <S> 10kbits will not quite fit into the RAM though, at 1024 <S> * 8 = 8192 bits. <S> The 16F1527 has 1536 bytes of RAM though, so you could use this if necessary. <S> For the master (alternatives to Arduino) there is something like the 18F25J50 or similar, which has a USB 2.0 peripheral. <S> Microchip provide a USB stack an plenty of example firmware to get you started with USB. <S> If you need something more powerful for the master, have a look at the PIC24 series with up to 256K of Flash and 96K of RAM. <S> Or even the PIC32 which is 32-bit and up to 80MIPS. <S> The PICKit3 is a low price programmer that will program all the above mentioned PICs, and MPLAB (or MPLABX) is a free IDE for firmware development. <S> Communication can be done with I2C, which deals with the master/slave configuration and addressing easily. <S> All you have to worry about is sending the data. <S> 7 meters should be no problem with a reasonably quiet environment and the right setup (low value pullups - say 2.2k, low capacitance cable) <A> Regarding your distance concerns, check out these chips: I2C bus extenders . <S> They are made by a few different manufacturers, you can find one that fits your needs and budget. <S> I think I2C is a good choice for the protocol here given that you want an addressable scheme. <S> As @Oli Glaser mentioned, using a stronger (smaller) pull-up resistor will help as well, but if that can only get you so far, definitely check out the bus extenders as I've had success with them before. <S> Regarding your size concerns, check out the specs of the microcontroller that you're looking at. <S> Specifically you want to look at how much SRAM <S> it has. <S> You mentioned that you want to buffer 1000 bits == <S> 125 Bytes. <S> SRAM spec is usually given in KB (Kilo-Bytes) so be sure to choose one that is larger than that. <S> If you are using more buffers in your code as well, or your program is somewhat complex (large and many function calls) then you will probably want at least 512 bytes - 1KB of SRAM. <S> It is hard to determine how much you need without knowing more about the application. <S> If you don't need all of the 125 bytes at once, you can stream it in and out of EEPROM as well.
|
Arduino sounds like it can do what you want (seeing as they all have UART and I2C capability), but really any microcontroller with those peripherals will do the trick.
|
Can I send data to my computer from the serial port on an Arduino/ATTiny? I am using an Arduino to program an ATTiny like in this tutorial . My question is: How can i send data to my computer on the serial port? Is it possible ? Any ideas are welcome. <Q> Neither the ATTiny45 ( parameters overview ) nor the ATTiny85 ( parameters overview ) has a UART, which makes it a bit painful to connect them directly to a computer. <S> If they had a UART <S> In your case it's not as easy as you don't have a UART. <S> They do have both SPI and I2C though so you can make them talk through the Arduino as it has both SPI/I2C and UART support. <S> Another alternative is to use an "USB to SPI/I2C" dongle, but they're not really that easy to use ( <S> and not what you're after). <S> Edit: <S> Another solution proposed by @AndrejaKo is to implement the UART in software. <S> If you're only sending this can be quite easy as you only need to get the timing right and can just bang out the bits from there. <A> The ATTiny 45/85 doesnt have a hardware UART <S> but it does have a USI (Universal Serial Interface) <S> hardware module that simplifies implementing a UART in software. <S> Atmel have an appnote explaining this .Some <S> USI example source here for a working example that doesn't use USI, have a look at this one on AVRFreaks <S> Full Duplex SW-UART with FIFO <S> - you might need to login to AVRFreaks view that page. <S> Note however that you will probably need a level converter to match rs232 voltages on the pc. <S> A simple alternative might be to bitbang low speed usb on the ATTiny85 using the V-USB library, but that will consume significant amounts of your processors program memory and clock cycles. <A> I had some success using a CP2102 based USB-UART adapter . <S> I used atmega32 which has hadware UART, but it should also work with a software UART. <S> I think that almost any USB to UART converter would be fine.
|
a common procedure would be to use a USB to serial adapter, preferably with TTL voltage levels (5V or 3.3V) and use the UART in the chip directly.
|
Are vacuums tubes suitable for switching high current (~30amps) at high frequencies (~K-Mhz)? I was looking to build a system for high currents (say ~30 amps) and a friend suggested vacuum tubes. In theory, vacuum tubes seemed more robust for high current applications, but after looking around, and I found a bunch with relatively low current ratings (~10mA.) I wanted to avoid mechanical relays if possible because they seemed a poor design for high speeds. I also preferred to use a CMOS type design--my setup is symmetric with respect to p-channel and n-channel MOSFETs (at least in my circuit simulator.) I noticed some vacuum tubes have a dual gate--which fits perfectly into my design. The question is whether they can handle these currents at high speeds. My voltage should be quite low ~50V. EDIT:I am designing an induction heater, but I am trying a different approach in which I treat the heating element and the object to be heated as a black box, and use the proper switching elements to counter whatever voltage the black box produces. That is the basic idea. There is obviously more to it (e.g. have the switch on only after a threshold voltage, and off beyond another threshold voltage that would damage the circuit.)Anyway, it was just something I wanted to try, and thus far, it seems like a relatively cheap project considering I can get a lot of parts from old stuff at yard sales, ebay, etc. <Q> A very short answer with not too much detail goes like this: <S> Tubes are good at medium to high voltage and low current. <S> Transistors (especially MOSFETs) are good at low to medium voltage and high current. <S> Exceptions exist, but for the common and most used examples of said parts, the above... ahem... <S> selection guide is a start. <S> For fast (> 10 kHz) switching applications based on tubes <S> , you may want to look into (literature for) horizontal deflection circuits in old (pre-1970) TV sets. <A> Tubes exist which can be used to switch very high currents and voltages. <S> You can do a search on hydrogen thyratron as one example. <S> Thyratrons tend to be used in laser, radar and other relatively exotic applications, but have also been (ab)used by Tesla coil fans. <S> They work more like SCRs than conventional transistors. <S> Once triggered, they remain in the 'on' state until something breaks the circuit. <A> In response to your goal of making an induction heater, wikipedia says that vacuum tubes were used in induction heaters until the early 1990s. <S> No, tubes are not great at switching 30A <S> but this is not necessary as a transformer can (and was) used to drive the output coil. <S> http://en.wikipedia.org/wiki/Induction_heater <A> That having been said, that does not mean that they are the only way to go, or that they are appropriate for your application. <S> You would need to describe in more detail what you are hoping to accomplish. <S> EDIT: <S> Based upon the additional information you added to the question. <S> You state the application relates to inductive heating. <S> Microwave ovens use vacuum tubes, specifically a cavity magnetron to heat the food. <S> Microwave ovens operate at a frequency of 2.45 GHz, which would qualify as high speed by most standards. <S> So it is safe to conclude that vaccum tubes are in widespread use for dielectric heating .
|
If you look at the RF power amplifiers used by radio and TV stations you will find tubes capable of handling kilowatts of power, so the short answer is that vacuum tubes can handle high power and high speed.
|
Why do people use AT commands in serial communication? I need to know why people in embedded systems use AT commands? When I have asked people say that it is a standard. So my question is: What does "AT" means? Why do people keep saying it's a standard? <Q> One seldom-appreciated detail about "AT" commands is that many modems would start out in "auto-baud/auto-parity" mode. <S> Initially, the modem would start out not trying to actually decode any serial data, but would simply watch for a consecutive low pulse and high pulse whose widths matched the same valid bit period (e.g. 3.333ms for 300 baud, 833us for 1200 baud, etc.). <S> Upon finding that, they would see if the next low pulse was five times that width. <S> If so, they would watch for either another high-low-high or else for at least 1.5 bit times of high. <S> Finding either of those would indicate that the modem had just seen a 0x41 or 0xC1 <S> (i.e. "A") of the identified baud rate. <S> It would further indicate either the attached computer was using either 8-N-1 or 7-E-1, or that it was using either 7-N-1 or 7-O-1. <S> In either case, it would look for the next character to be either 0x54 or 0xD4 <S> (i.e. "T"). <S> That would allow the modem to further categorize the character length and parity settings. <S> Note that everything received before the "AT" would be ignored. <S> If echo was turned on, the data would be echoed back to the attached computer simply by mirroring all line transitions without any serial decoding. <S> If a computer sent data prior to the "AT" at e.g. 247 baud, it would be echoed back at that speed. <S> Nowadays, a few devices use an initial "A" for auto-baud-rate detection, but otherwise the fact that commands start with "AT" is basically a historical curiosity. <A> It refers to the Hayes command set which has been the standard for a long time for issuing commands to modems (and other equipment) over a serial line. <S> Instead of the commands and data <S> having two separate lines, only one line is used and to switch into command mode from data a certain sequence is sent, <S> e.g. +++ <S> followed by a set length pause. <S> Then the next data is seen as a command by the receiving equipment. <S> The reason to use something like this is the fact that it avoids the need for another pair of lines, which in many cases are simply not available, especially in small embedded systems. <S> Have a look at the Wiki page and the links at the bottom - there is plenty of detail there. <S> There are all sorts of extensions to the original AT set though, so I wouldn't bank on everything that mentions AT to actually use all the original Hayes commands. <S> For example I have a bluetooth serial chip here which IIRC uses it's own AT type set. <S> I'm no expert on it though, I just remember hacking around with commands in ye olde days of dial up and BBS. <A> This was a common problem of modems, back when they were external boxes connected to computers via a serial cable. <S> Hayes was a manufacturer of such modems, and gained a lot of early popularity. <S> Their solution for the out of band problem was to send the modem mostly two letter ASCII control commands with a special sequence to put it in data pass thru mode. <S> To reduce the likelyhood of random stuff looking like commands, their command sequences all started with the AT command, which stood for "attention". <S> Hayes gained so much market share that other modem manufacturers had to implement the same command set to be compatible. <S> That way customers could use their modems without having to re-write software, which was already set up to drive a Hayes modem. <S> Nowadays, this scheme is rarely used but <S> of course something that was so pervasive sticks around in dark corners even today. <A> There is an especially good document that describes the history of the "AT" commands that can be found here: http://nemesis.lonestar.org/reference/telecom/modems/at/history.html <S> It contains many pages of good "history" on how the protocol came about. <A> why people in embedded systems use AT commands? <S> I'm not one of those "people in embedded systems" <S> but I'd say that AT commands are still in use because they come from a well-defined low-overhead standard for in-line signaling. <S> What that means is that you can use the same communication channel both for signaling (AT commands to manage the communication) and data (actual data you want to send). <S> The AT standard specifies how to differentiate between the two so you and your serial device don't get confused when talking to each other. <S> What does "AT" means? <S> AT is for ATtention <S> Why do people keep saying it's a standard? <S> Well, because it is. <S> I'd say it is actually a mix of de-facto standardization and a couple of "real" standards and some recommendations .
|
The "AT" command set was to solve a problem of needing out of band control information over the same byte-stream channel arbitrary data was sent.
|
Why do the large transistors on computer components have their middle pin cut? I have seen transistors with the middle pin cut used in computer equipment. What do they do? <Q> Because it isn't required. <S> On most of those parts the middle pin is internally connected to the heatsink tab, and that one is soldered anyway, for cooling reasons. <S> BTW, the pin isn't cut, the short tab is the way the part is supplied. <S> Note that the PCB can accommodate both parts with or without the pin. <A> They're called D2PAK or TO-263 packages (DPAK = TO-252 is similar but smaller), and they're designed that way on purpose. <S> As stevenvh states, the middle pin of the leadframe is internally connected to the heatsink tab -- it's actually one piece of metal! <S> (Sometime try dissolving away / removing the packaging compound and you'll see this.) <S> The reason the middle pin is short is to allow for increased creepage and clearance distance. <S> Why they have the middle pin stick out at all is a little strange to me <S> (it's still an unwanted voltage near the other two pins, and it would seem like if they didn't make it stick out of the package at all, there would be even better creepage/clearance distances) -- although I'll admit it seems just right, as you can hook a probe clip on it if you need to. <A> History. <S> (As in: Why, after all, is the middle pin still there, in its strange, stub-like nature?) <S> The Evolution goes like this: <S> TO-220 <S> , TO-262, TO-263 (Source: Infineon; via http://www.powerblog.de/2011/12/06/bleifreie-mosfets-in-standard-to-gehausen-fur-die-automobilindustrie/ , hopefully o.k. <S> as per fair use .) <S> TO-220 has been the classic THT power package for, like , forever. <S> TO-262 is shorter and may be handy in height-restricted mounting space. <S> The smaller tab is not a big drawback when no heat sink is required or when you use a clamp instead of a screw to mount the part onto a heat sink. <S> Clamping is a better choice for a number of reasons, anyway. <S> TO-263 could be called the surface-mount version of these THT parts. <S> The tab and the middle pin are connected, and the tab offers a path with less inductance compared to the middle pin. <S> With no solder pad for the middle pin, board space may be saved (other components may go where the pad would be), and insulation distance may be increased (good for high voltage parts). <S> Note that the plastic molding of all three cases is exactly the same. <S> Thus, much of the same machinery can be used in the packing process of the parts , it's likely just a different lead frame.
|
Some of the transistors in TO-263 packages are rated at several hundred volts, and getting the middle pin out of the way is a huge deal because the other two pins are relatively close to each other in voltage, whereas the middle pin is the drain/source pin which is often at a very different voltage.
|
How durable is a supercapacitor? Suppose I have a device that utilizes a supercapacitor. How long will it take to wear out the supercapacitor so that it needs replacement? <Q> Overview In general capacitor lifetime (including supercapacitors) is dependent on three things: Electrolyte Life Voltage Derating Temperature / Power Dissipation <S> If you want the capacitor to last a long time, limit the applied voltage, keep it cool, and limit the output current. <S> All this should be in the datasheet of your capacitor. <S> Electrolyte Life <S> If the capacitor is, say, ceramic or tantalum, the electrolyte is a solid and the cap will basically never go bad. <S> If it's an electrolytic, then it contains fluid which will evaporate and eventually cause the cap to fail. <S> In an electrolytic double-layer super-capacitor, the electrolyte is a combination of a fluid and of activated carbon, so it is mildly vulnerable to evaporation. <S> Voltage <S> Derating <S> More important, though, is the voltage derating of the capacitor. <S> If the voltage burns the cap up on the first use, you won't need to worry about evaporation. <S> A capacitor is a carefully constructed device which separates two conductive films with a thin, thin layer of insulating material over a wide area (folded or rolled into a package). <S> Decrease the separation, and you've got higher capacitance with the same area. <S> This thin separation is vulnerable to high voltages; that's why capacitors have specific voltage maximums, often printed on the case. <S> In a supercap, this barrier is often just nanometers thick, and the dielectric will not insulate high voltages across this short distance. <S> Using a cap at close to its maximum voltage will cause it to fail more quickly than using it at a lower voltage, this tradeoff is known as a derating curve. <S> It should be available from your capacitor manufacturer. <S> Temperature / Power Dissipation <S> A capacitor is negatively affected by heat. <S> It causes the electrolyte to evaporate more quickly, causes the dielectric to be weakened, and it can damage the thin conducting elements in the capacitor. <S> Both environmental heat and self-heating effects should be considered. <S> If the capacitor is discharged very rapidly, the small resistance of the foil and leads will be inconsequential compared to the square of the current. <A> Every capacitor has different characteristics. <S> You should check out the datasheet of you capacitor to figure out when it needs replacement. <S> The characteristics of your capacitor will change over time, under certain conditions. <S> Usually, (super)capacitors have a parameter called endurance / load life (in hours) or life cycles (in cycles). <S> An example of what you can find in a datasheet: <S> After 1000 hours application of 5.5V DC at +85°C, the capacitor shallmeet the following limits: Capacitance change : <S> ±30% of initial measured value Internal resistance : < 4 times of initial specified value <S> So, in the case above, you can decide if a change of ±30% of the initial capacitance is still suitable for your application. <S> If not, you should replace the capacitor after 1000 hours of operation under those conditions. <A> An extremely good reference here http://www.digikey.co.nz/Web%20Export/Supplier%20Content/CooperBussmann_283/PDF/CooperBussmann_Guidelines_using_aerogel.pdf?redirected=1 <S> Which includes the comment: <S> PowerStor supercapacitors have a longer lifetime than secondarybatteries, but their lifetime is not infinite. <S> The basic end-of-life failure mode for a supercapacitor is an increase in equivalentseries resistance (ESR) <S> and/or a decrease in capacitance. <S> Theactual end-of-life criteria are dependent on the applicationrequirements. <S> Prolonged exposure to elevated temperatures,high applied voltage and excessive current will lead to increasedESR and decreased capacitance. <S> Reducing these parameterswill lengthen the lifetime of a supercapacitor. <S> In general, cylindrical supercapacitors have a similar construction to electrolytic capacitors, having a liquid electrolyte inside an aluminum can sealed with a rubber bung. <S> Here is a diagram from the above reference which puts some figures on various effects. <S> The 'key' does not make full sense. <S> The significant effect of voltage on lifetime is worth noting. <S> This reference is about supercap aging - not immediately apparent. <S> Appears to be the middle of a wider discussion. <S> Worthwhile. <S> Some related discussion here
|
Over many years, the supercapacitor will dry out, similar to an electrolytic capacitor,causing high ESR and eventually end-of-life.
|
Why are transistors difficult to use in special cases such as >100 MHz operation? I have heard on good authority that transistors are difficult to use in certain cases, such as >100 MHz operation. Why is this? Are there alternate devices which might be preferable? <Q> You premise is flawed. <S> It is not that transistors are difficult above 100 MHz, it is that any specialized circuit will require appropriate engineering. <S> Engineering high frequency circuits using any components requires particular attention to lead lengths due to the wavelengths of the frequencies evolved. <S> Wavelength is inversely proportional to frequency. <S> In fact for radio waves in space wavelength = (speed of light)/frequency. <S> If you think about it, virtually all FM radios, TVs, cellphones and internet wireless routers use transistors (inside of integrated circuits) these days rather than the tubes (valves) that used to be used. <S> 100 MHz is in the FM radio band, and routers operate in the GHz range. <S> What does cause issues in designing high frequency circuits is that as wires between components become a significant fraction of the wavelength involved they start behaving more like transmission lines, antennas, inductors and capacitors. <S> This is not a problem with audio circuits where the wavelength is enormous. <S> Other factors to consider include crosstalk <S> (signals from one wire appearing on another where they are not wanted) and shielding. <A> Using transistor in High frequency will cause some problems , that engineer will have to work them out while designing .First <S> I will show the difference between BJT(as example, it also applies to other types ) transistor in low frequency & high frequency : <S> This is the model of BJT in low frequency with noise : <S> This the model in High frequency <S> The below figure will show you how many noise effects are added while the frequency increases All of this will make it harder to design in high frequency , As Jonny mentioned you may also face the problem of "Cross talk " : crosstalk normally refers to a signal affecting another nearby signal. <S> Usually the coupling is capacitive, and to the nearest neighbor, but other forms of coupling and effects on signal further away are sometimes important, especially in analog designs. , & the problem of parasitic capacitance . <S> High-frequency circuits require special design techniques such as careful separation of wires and components, guard rings, ground planes, power planes, shielding between input and output, termination of lines, and striplines to minimise the effects of unwanted capacitance <S> Resources for further readings :- http://www.mbeckler.org/coursework/2006-2007/ee3101lab6.pdf <S> http://iroi.seu.edu.cn/prepare/Meeting/File/SODC/data/01%20M.Berroth.pdf <S> http://bmf.ece.queensu.ca/mediawiki/index.php/High_frequency_transistor_models <A> I would also say that at high frequency, may of the assumptions that are made for low frequency are not valid anymore. <S> Take this question : also an inductor, that you would expect to behave as a inductor (guess why?), at high frequency starts to show the behavior of parasitic effects like capacitance <S> (oh my gosh <S> it's the opposite!). <S> And transistors, if you look inside, are full of parasitic capacitances, since each interface between differently doped regions basically creates a capacitance. <S> This is a big issue when designing high-performance circuits like microprocessors or RF circuits, but with discrete components the frequency at which these effects appear is much lower. <S> In general, in many cases circuit analysis <S> you make the assumption of quasi-stationary signals to mean that the speed at which things are changing is low enough to consider them static. <S> Increasing frequency, this approximation loses sense.
|
So in brief: transistor operating in High frequency will face many problemslike (cross talk , noise , parasitic capacitance , parasitic inductance .. )
|
Adding capacitor to model railway 12V motor to keep it going over a dead spot I have read that you can add a capacitor to a model loco to keep it going over a dead spot on the track - not DCC - just DC. Is this accurate? On one forum someone has been experimenting with 2000mF 12V DC polarised capacitors. However what happens if the power is reversed - I assume a short circuit - can anyone help with advice? <Q> This is easy for digitally controlled railroads, where you can connect the capacitors to the DC part of the circuit behind the rectifier. <S> I've done it for LGB garden railroads with nominal 24V (in reality up to 28V), using ten or eleven <S> 3 Farad supercaps in series, which gives about 0.3F = <S> 300mF. <S> The supercaps need to have low internal resistance. <S> With that the train can continue to run for about a meter, which IMHO is a bit much (but there are no suitable smaller capacitors, so I can't easily change it). <S> If control is lost near the end of the track this can result in a crash. <S> A more detailed description of the circuit:The circuit uses a diode and a resistor to limit current when charging, but not when discharging. <S> There is also a choke in series with the capacitor, so that the fast digital data signals are not filtered out. <S> Resistors across each capacitor even out the voltage and discharge it slowly when not in use. <A> However, there are non-polarized electrolytic capacitors. <S> if you really need to, you can make a non-polarized capacitor by taking two capacitors of equal capacity and connecting their positive leads together (while connecting the negative leads to the circuit). <S> The resulting capacity will be half of that of a single capacitor and the voltage rating will be the same as a single capacitor. <A> As @Pentium100 says - connecting two std polarised capacitors "back to back" is a reasonably good way of making a non polarised capacitor of half the value. <S> Note <S> that 1 mF = 1 milli-Farad = <S> 1000 <S> uF = <S> 1000 microFarad. <S> Was your forumite using a 2,000 uF cap or a 2,000,000 uF one ? <S> Probably the former. <S> As a guide A capacitor will droop APPROXIMATELY 1 volt in time t where t = <S> C <S> / <S> I <S> It will droop V volts in V times as long. <S> C = capacitance in FARADS <S> and I = current in amps. <S> On a 12 Volt system <S> I ~= <S> W/12 <S> where W = motor watts. <S> So a 1000 uF (not mF) cap will droop 1 V in 1 mS at 1A or in 10 mS at 100 mA or in 100 mS at 10 mA or in 1 second at 1 mA <S> In a model railway system you can probably run over a dead spot if V >= 6V (at a guess) <S> so t ~~= <S> 6C/ <S> I [s, F, A] <S> Rearranging <S> C = <S> t <S> x I /6 <S> [F, s, A] <S> If time is in mS and capacitance in uF then t (ms) ~~= <S> 6 <S> x C (uF) / (1000 <S> x I) = <S> C/(166 x I) <S> So if you want a 300 mA motor to hold up for 100 mS at 6V droop t = <S> C/166I <S> So C = <S> 166 <S> x t <S> x I = 166 <S> x 100ms <S> x 0.3A = 5000 uF
|
Connecting a regular electrolytic capacitor in reverse results in that capacitor blowing up (or just creating a short circuit if there is not enough power for it to blow up).
|
building my own lc meter - multi point gnd I'm building my own lc meter using the attached schematic. What I don't understand is why there is more than one path to gnd? Does it not eventually get connected to the same point? <Q> In addition to the answer by JonnyBoats, I think this makes the schematic more readable. <S> Imagine a huge schematic and only one GND point. <S> Now for each component (there can be really a lot) connected to GND <S> you would need to follow a thin line, just like in a maze... <S> That's why I think it is common practice to do it that way. <A> I think I understand your confusion. <S> You see lots of downward pointing triangles, like on the left of the battery (B1). <S> This is just a form of shorthand when drawing schematics. <S> Perhaps it stems from the old days of tube radios when components were mounted on a metal chassis rather than using printed circuit boards. <S> Back then one would simply attach ground lugs, perhaps one at every tube socket, to the chassis and connect the wires to those ground lugs. <S> The chassis itself served as the "wiring" to connect together the various ground points. <A> There is only one connection to GND, either on the negative side of the battery or <S> I am guessing through the power supply pins on the bottom of P2A. Electrons <S> will flow from every chip back to that one GND connection through its own unique path. <S> There is nothing explicit on the schematic about how to connect the various GND triangles (this is done in layout), but the layout will have huge implications for how well the circuit functions. <S> Since this is a mixed analog/digital board, the biggest source of noise to eliminate is the digital noise polluting the analog return path.
|
Yes, these are all connected together and are at chassis ground.
|
Is there a way that you can get a Portable/Online Arduino IDE? I am just starting out with the Arduino, and I want to develop and create sketches at my school. The only problem is that the school's computer doesn't allow any application to run if app tries to create a folder on its hard-drive. Are there any ways to make the standard IDE portable, or is there another portable option? <Q> The standard IDE is portable as it runs as a stand-alone Java application. <S> As such it requires no "installation" so to speak, and projects exist. <S> So if you have it on rewritable media (e.g. a USB flash drive) and you store your projects on that same media, you in effect have a portable IDE. <S> It will (I'm pretty sure) however, keep all <S> it's build artifacts in temporary folders under the current users HOME directory. <A> There are a couple of projects working on online IDEs for Arduino. <S> My project, called wifino, is probably the most developed at this point. <S> You can try out the beta at http://ide.wifino.com . <S> Code still needs to be moved to the Arduino using avrdude, but we're working on a deployment client for windows, mac/linux, and (drum roll) <S> iPhone using 802.11b/g networks. <A> I ran into issues with this while teaching arduino to one of my classes. <S> Without admin access, you can't install the device driver for the arduino and with Windows 7 <S> the JVM is not installed by default. <S> Should work fine until campus IT gets wise and blocks booting from CD/DVDs <A> To go portable you can use a portable Chrome Browser and install the extension to the site below. <S> --> codebender <-- <S> Once the extension is install you can connect your Arduino and start building. <A> I don't believe that @vicatcu has the complete answer to the question. <S> In reference to Processing 2.0 to 2.2, not only the sketchbook location, but also the preferences file itself, modes and other folders are placed on the hard drive. <S> But with a few quick modifications to a file that strongly urges against modification, we can achieve portable Processing. <S> As @vicatcu mentioned, the sketchbook folder location can be set in the IDE via File <S> >Preferences>Sketchbook location. <S> But I'd suggest not to do that; simply set that path with the defaults.txt file. <S> Additionally, the settings path must be set. <S> These sketchbook and settings paths can be modified in "lib/defaults.txt" by uncommenting lines #sketchbook.path= and # <S> settings.path=. You can use local paths such as "sketchbook.path=sketchbook" which will put these folders into the Processing IDE folder. <S> The folders will then be created when you start up Processing. <S> Note that when relative directories are used, the Processing folder must be user-writeable, so don't put it into "C:/Program Files". <S> Also, Processing should not be running until after you make the changes to the defaults.txt file.
|
I built live debian DVDs that have the IDE installed and just have them boot the cds to work with the arduinos.
|
Software for logical circuit generation I just need to create a logical circuit. i have input and output signals.Here is steps which i need to have done Simplify boolean expression using karnaugh map Generate logical circuit using expression from step 1 and different basis Generate time diagramm of working my circuit Is there any software which could help me? <Q> It seems to me that using software for such a task is somewhat defeating the purpose of the University assignment. <S> Doing it with software, even if it does exist, is at best going to eliminate that part of your education and at worst going to put you at a disadvantage in later classes where you need to utilize this knowledge. <S> Any time you save now will be completely lost later when you have trouble with future assignments. <S> I am assuming that using this kind of software wasn't the intent of your professor, <S> otherwise he/ <S> she would have provided the software themselves (or a link to it). <S> Software for FPGA/CPLD/ASIC design isn't going to help you much, if at all. <S> While they will do what you ask, the results are not going to be in a format that will be useful. <S> To make matters worse, that whole "show your work" part of your assignment will be missing. <A> You can use Gorgeous Karnaugh to generate and minimize K-Maps. <S> Also, it can generate logic gate diagrams. <S> CedarLogic simulator can simulate logic gate diagram and builds time diagram, but has some bugs and often crashes. <S> All tools above are very simple and not too hard to understand its, in difference from professional tools. <A> For generating Karnaugh maps, check this question . <S> When you have generated your K-map, it's just about choosing the logic to implement it (sum of products or vice versa) and draw the circuit. <S> Then, if you want, you can simulate it with Falstad , any version of Spice, like LTSpice or NI Multisim <S> (you'll have to pay for it.) <A> LogicWorks is a great piece of software to lay out and test what you create. <S> It wont automagically do everything for you, but once you make the K-maps you can use it to visually lay everything out and verify the design. <S> Does timing maps too IIRC. <A> Logism is a free, open-source, logical diagram simulator written in Java. <S> I used it for my computer hardware class and it generates boolean expressions, kmaps, and truth tables.
|
Logic Friday is a good tool for logic minimization and gate diagram generation.
|
How to measure current to a DC motor? I'm trying to measure current to a DC motor on an RC car I took apart. The car is powered by 3 AA batteries and seems to be made of three different boards. Two of the boards are for switches and LEDs, the other is the main one in this shot that I'm trying to measure so I can replace it with my Arduino. I am trying to measure the amperage to the motor, as well as that motor in the back of that shot. I have tried using my multimeter on 20mA, 200mA, and 10A with no sensible reading and it always stalls the RC car. Shouldn't I be able to get a reasonable result? Edit: All the pictures I have of it are in this page I've tried connecting on the motor directly and on the wires leading to it both before and after that capacitor. Edit: Thanks again for the help everyone. I'm going to give it another go soon and post some pictures of the configuration once I get it going <Q> An ampermeter will have very low resistance (a perfect ampermeter would have zero resistance so that it doesn't affect the measured current). <S> So by doing that you short the motor (well, actually you short the circuit that drives the motor, but it doesn't matter). <S> This of course stalls the car and btw puts extra load on the driving circuit which can damage it. <S> You have to connect the ampermeter in series with the motor - disconnect either of the wires and connect the ampermeter somehow like this: ---wire--ampermeter--motor--otherWire <A> As an alternative to what sharptooth said: If that's a resistor in series to the motor (left bottom; green device, probably blue, gray, gold rings = 6.8 Ohms; not sure; could also be just an inductor for radio interference suppression)you can measure the voltage U accros that resistor R. <S> So you don't have to open any connection. <S> The current is I = <S> U/R (Ohms law). <S> This measurement will tamper the actual current less than inserting an ampere meter, because resistance of todays voltage meters is so high (probably some 100KOhms-MOhms) that it can be neglected whereas the resistance of ampere meters (maybe 0.1-1 Ohm; depending on the range) still is not low enough when measuring "large" currents. <A> Instead of trying to measure motor current while it's in the circuit, I would measure the motor by itself. <S> That is easier to do and let's you find out what the limits are, not just what the circuit happens to drive it at. <S> Disconnect the motor and run it from a 4.5V power supply, which is about what to expect from three fresh AA batteries in series. <S> If you have a power supply that can show current, then that will be good enough. <S> If not, put your ammeter in series with the motor to measure the current. <S> Start with the 1A scale. <S> There are two measurements you should make to get a feeling for the motor. <S> The first is with the motor running with no load. <S> Let the wheels freely rotate. <S> The motor will draw the minimum current this way. <S> Then try it for a short time with the wheels held so that nothing rotates. <S> The motor will draw the maximum current this way. <S> This is also known as the "stall current", which you would see in its datasheet if you had one. <S> Let the wheels rotate just a little to get the stall current at different motor positions. <S> Brushed DC motors can have a bit different current draw over a revolution depending on what combination of coils are being activated by the brushes. <S> Once you have the min and max current, you can design your drive circuit around it. <S> Since you probably want variable drive and bi-directional, you want to drive the motor with a H bridge controlled by PWM from the micro. <S> I don't know what capabilities the arduino has, but there are real micros out there with PWM hardware specifically meant to drive such H bridges. <S> These make direction changing easy, handle break before made, etc.
|
From the photos you provide it is clear that you try to measure current without disconnecting the motor by connecting the ampermeter in parallel to the motor. I expect the current to be at least a few 100 mA, which most power supplies will show with reasonable resolution.
|
Shielding and Ground loops I have various pieces of equipment that all need to be connected to GND (Chassis GND). The issue I'm having is that I'm connecting an ADC card inside a computer through a metal box with custom electronics that connects into a cryostat (metal shield). The problem is that if I just use my standard cables then the computer GND is connected to the metal box with the electronics in which is in turn connected to the metal of the cryostat. Now the computer is connected to GND via the plug and the cryostat is connected to GND via a big metal strap to the building GND. This to me smells like a bad case of a ground loop. So I'm thinking that I need to break the shield somewhere on one of the cables. The questions is where? The electronics are amplifying a rather small signal from the cryostat so I'm guessing that I want to try and keep that shield connection continuous. I was going with breaking the shield at the box on the cable that runs to the computers ADC. Is this a good idea? Should I not worry if the Computer GND and cryostat GND are pretty much connected to the same power strip? Note that the electronics GND should be floating from the Chassis/building GND. <Q> Yes, it sounds like (a little confusing) <S> you have a ground loop problem, and yes they can matter, especially when trying to measure small analog signals. <S> If all grounds tie back to the same outlet strip via relatively short line cords, then it would probably be OK. <S> However, you say that this cryostat thing (whatever that is) is connected separately to building ground, so that is obviously not the case <S> and it's confusing therefore why you brought it up. <S> In general, it's good to convert analog signals to digital as close as possible to the source, then ship around digital signals. <S> Those are much easier to isolate, like via opto-couplers, pulse transformers, radio, etc. <S> In other words, a old fashioned A/D card in the computer is not the best overall architecture from a system level point of view. <S> However, look at the A/D card carefully. <S> Most likely it can be configured for single ended and differential operation. <S> This is a case where you want differential inputs. <S> The cryostat thingy may produce a ground referenced signal, but take its ground and output signal as being differential. <S> This will essentially subtract the ground offset from the signal before converting it. <S> This trick will only work up to some frequency, probably a few kHz or low 10s of kHz. <S> It should work pretty well in subtracting off any ground signal due to 60 Hz or 50 Hz power line return currents accross ground paths in the loop. <S> Sharp common mode spikes can still confuse the diff amp in the A/D and show up as noise in the final output. <S> It's worth a try though. <S> If it's not good enough, go back and convert to digital at the sensor, then opto-isolate the digital telemetry signal. <A> There is a tutorial on ground loops and other forms of electrical interference at the Loop Slooth web site . <S> This tutorial shows that ground loops behave differently at low and high frequencies. <S> At low frequencies what counts is the resistance of the conductors forming the ground loop, but not the physical layout whereas at high frequencies it is the other way around because at high frequencies what counts is the inductance not the resistance. <S> The cross-over frequency is given by R/L where R is the cable resistance and L is the loop inductance. <S> These issues are also discussed in a Review of Scientific Instruments <S> paper (also at a link on the website). <S> The tutorial explains how ground loops result from the distinction between Faraday's law and Kirchoff's law (electronics is based on Kirchoff's law which is valid for DC only, whereas the real world of time-dependent currents involves Faraday's law). <S> It also discusses the relation of ground loops to other forms of interference such as inductive coupling, electrostatic coupling, and radiative coupling. <A> It is often believed that the key threat of a ground loop is that there is a substantial DC difference between grounds (e.g. 0V and 0.3V). <S> It can be the case if current consumption of the devices is orders of magnitude different between them (say, a rotary engine connected to a mobile phone). <S> However, this is unlikely your case. <S> So, DC drop should not be a problem. <S> Ground loops are usually a problem because they act like a transformers converting changing magnetic field (caused by operating nearby devices like power grid wires, bulbs, switches, engines, etc.) into induced voltage. <S> In an ideal case, if there would be only one pair of wires (connected to a power source) closely located to one another everywhere, the current loops would be the same and induced EMF would be the same. <S> Thus, measuring voltage difference between the wires at any point would produce the same result whether with a magnetic field or not. <S> However, in practice this is rarely the case, wires don't go in pairs and they don't go always go close to one another. <S> This way, noise appears (EMFs induced in different loops <S> are different). <S> From practical standpoint you can do the following:a) ensure all wires go close to one another as much as possible (no big loops of isolated wires are formed).b) <S> ensure there are no time-varying magnetic field sources (noise aggressors) nearby. <S> In your case, the two devices have different connections to ground (mains gnd and building gnd), so, likely, a giant loop is formed, which isn't good. <S> The actual noise level will depend on parasitic magnetic fields surrounding your setup. <S> If there are no strong sources of time-varying magnetic field in your laboratory, the ground loop may not be a problem. <S> Breaking a shield may not be a good choice because: 1) it will change impedance of the cable which can be troublesome at high frequencies. <S> 2) <S> The receiver's gnd will float relative to the driver's gnd. <S> Any stray current appearing at the receiver gnd will affect the signal.
|
In which case connecting the two with a low resistance wire may cause high current and damage one (or both) of the devices.
|
Interpretation of input impedance graph of a filter I tried to simulate the input impudance of a multipass feedback low pass filter. I want to know if the graph I got is right, and if so, what does it show? Also, what is that dashed line about? And here is the circuit itself: <Q> Yes, you have plotted the input impedance of your circuit. <S> The solid line is the magnitude, and the dashed line is the phase (relative to the right-hand scale) of the impedance. <S> The phase might be 180 degrees off due to the definition of I(V1). <S> If I(V1) is the current going in to the positive terminal of the supply you should use -I(V1) to get the current going out into the circuit. <S> Having the magnitude on a dB scale is not especially helpful -- better to figure out how to plot it on a linear scale. <S> But this is not necessarily easy in LTSpice, it took me a while to figure out how to do it when I was doing something similar the other day, and I can't remember the correct incantations now. <A> If you look at the graph you can see that in the x-axis there are frequency values, and in the left and right y-axes, respectively, there are gain and phase values; so basically what you see is the representation in the frequency domain of the input impedance of your circuit. <S> The problem is that, plotting the ratio between a voltage and a current, in which the latter is in the sub-mA range (given the resistances), you end with a minimum gain of 60dB (=1000). <S> I'm not sure about what you expect to see, but you can see this as a transfer function that relates the input voltage to the input current. <S> If you want to see a lowpass function you would better look at the transfer function (Vout/Vin). <A> As said in the previous answers, this is the impedance indeed. <S> The impedance has a magnitude and a phase . <S> This enables one to represent impedances as complex numbers and their values are usually frequency-dependent, hence the representation in frequency domain. <S> The plots you have are so-called Bode plots . <S> These characterize the amplification (or gain) and phase shift in the response of a system. <S> So basically the magnitude plot (continuous line) is the ratio of the peak values of the output and input and the phase shift is the delay of the output compared to the input. <S> As a closing remark, Bode plots are used for studying other systems than filters, too. <S> They can be used to determine the stable operation regions of a given system. <A> Just throwing this in, because it took me sometime to figure it out. <S> If you use the above method of plotting V/I with AC analysis you get a dB and phase plot just like the image in the question. <S> If you click on the y axis, a pop up will appear and if you select linear, it will give you an impedance scale. <S> Now you have impedance vs frequency. <A> " I want to know if the graph I got is right, and if so, what does it show ? " <S> In addition to the given answers (complex input impedance of the filter circuit), perhaps you are interested to learn if it is possible to derive some characteristic filter parameters from the given response? <S> In general, it can be shown that each valid transfer function that can be defined for such a circuit will have has the same denominator . <S> This applies to all transfer functions to be defined between each grounded node (input) and each every other node within the circuit. <S> And this also applies between these (grounded) inputs and the currents within the circuit. <S> In particular, this applies, therefore, also to the input impedance of your circuit. <S> What does this mean: If the input impedance function Zin(s) and the classical voltage transfer function of the filter H(s) <S> have the same denominator D(s) , they will have the same pole frequency fp . <S> 800 <S> Hz. <S> Therefore, your active lowpass circuit will also have a pole frequency of fp=800 Hz. <S> For all second-order lowpass filters, the pole frequency has a direct relation to the well-known cut-off frequency (3 dB) <S> - depending on the particular approximation (Butterworth, Chebyshev,...). <S> For a Butterworth response, the pole frequency is identical to the 3dB-frequency. <S> Another example for equal pole frequencies: At the common node of R1, R2 and C2 you can observe a bandpass function with the same center frequency fp=800 Hz.
|
The input impedance as shown in your graph shows a typical bandpass response with a center frequency (identical to the pole frequency) at app. The Bode plot shows to what extent a filter can suppress different frequencies and whether it is going to introduce any delay.
|
What are some typical low cost microcontrollers and chips that are used in electronic toys? I'm researching microcontrollers, memory chips, and sound chips for simple electronic toys.These toys might take user input via buttons or switches, and then play back sounds stored on a memory chip and maybe play it back through some sound chip or audio amplifier. What are some typical models for these chips? I've worked with PIC chips in the past as a hobbyist.I'm looking for ones that are typically used by the toy manufacturers in their products. These are probably more cost effective than the ones I'm used to working with as a hobbyist. CLARIFICATION I'm researching this b/c I have a toy idea and want to get a sense of the costs of making it. I want to be able to mass produce this. <Q> PICs are as cheap as any in their class. <S> You can buy an entry level 10F series PIC for a bit over 30 cents in modest volume from US distributors. <S> BUT I understand thay have an arrangement in Asia where they sell the parts untested and the end user is reponsible for testing and the price would be MUCH less. <S> There are Asian manufacturers who have cloned the older style PICs and offer them at a lesser price than equivalent PICs on the open market at least. <S> I suspect that Microchip match them in volume prices privately. <S> [eg I have just received a quote for LSD NimH batteries from one of the big 3 Chinese battery makers at MOQ quantities that tend to make one's eyes water. <S> Quote includes a written request not to tell their competitors their pricing. <S> I doubt its too secret in reality <S> BUT no doubt the same thing happens in the processor area]. <S> So, make 100,000 toys or 1,000,000 and they will probably sell you basic processors for 10 to 15 cents. <S> There are Asian sourced 4 bit processors specifically aimed at the very large volume markets but <S> the instruction sets and architectures are very weird* and they need their own tool chains and community support <S> like you'd get for mainstream processors is completely lacking. <S> [For instance an olde Fairchild F8 would be at home amongst them. <S> An RCA CDP1801 woould look positively mainstream]. <S> Here is what APPEARS to be the utter bargain of the mainstream microcontroller world. <S> I have not yet found anything that tells me how many clocks per cycle - and some of the old ST processors such as the ST6 were seriesl bus based internally with maybe 10 clocks per instruction! - <S> but even if this was the case these would setill seem a bargain. <S> At first I thought they may be endline, but the ST site says they are "current" and a number of sellers have them at similar prices. <S> They are the best features per $ microcontroller that I have ever seen. <S> 5 x 10 bit ADC, 3 x capture compare plus 3 timers plus watchdog IIC , UART, SPI, <S> + ... . <S> I've yet to find the catch. <S> It may be speed. <S> TBD - but low speed would be OK in many cases at the price. <S> $US0.91/1 . <S> $US0.64/100. <S> $US0.39/1000. <S> $US0.33/10,000 STM8S003K3/F3 datasheet and pricing <A> For those simple toys, performance is absolutely not a priority <S> so, more than chips, the manufacturers use chEAps :). <S> Any 8-bit low cost, low power microcontroller can be suitable for this purpose. <S> About cost effectiveness, a very important factor is the number of chips that you buy in batch; for a hobbyst, that buys 1-10 devices every time, the unit price will be much higher (more than double, shipping excluded) compared to what a manufacturer pays for 10'000+ pieces. <A> In the case of cheap mass produced toys, more often that not you will find that manufacturers will not use commercially available chips other than for design and prototyping. <S> You will find that they use chips designed for one specific product or application. <S> This type of chip is called an ASIC and will often integrate much of the circuit into a single device. <S> These devices look like a black blob on the PCB. <S> The internals of the bare chip (i.e. its die) are attached when the board is manufactured and the blob is added afterwards to protect it. <S> EDIT: <S> Dan Neely posted a good link about COBs and it has some details on their cost effectiveness: dieproducts.org/tutorials/assembly/cob/index.php <S> In both cases the design and tooling costs associated with using these chips is very high, it will only be cheaper to use these kinds of chips when mass producing a device. <S> These are not used in hobby electronics other than for hacking and circuit bending, it would not be cost effective.
|
Another common type of device found in cheap toys is a Chip On Board or COB.
|
My Vias are getting shorted on the back of my chip I have a board design using a Atmel AT90USB1286 (VQFN64) and I placed vias on the back of the chip for routing purposes. Upon inspection, I found that the AT90USB1286 Chip has a thermal pad on the back of the chip and the vias were getting shorted to them. Is there a way to prevent the shorting of the vias and still be able to utilize the area on the back of the chip for routing? <Q> You shouldn't be putting tracks and vias under a QFN device, like that. <S> The pad should be soldered, otherwise the chip could shear off if the board is subjected to mechanical shock. <S> With many devices, it should be grounded. <S> From the data sheet: "The large center pad underneath the MLF packages is made of metal and internally connected toGND. <S> It should be soldered or glued to the board to ensure good mechanical stability. <S> If the center pad is left unconnected, the package might loosen from the board." <A> Typically thermal pads on chips need a connection to copper to dissipate the heat. <S> Normally these thermal pads have recommended shapes and can often be larger than the IC itself. <S> To salvage the prototypes, a hack would be to cover the vias before placing the IC. <S> You could fix the design by covering the vias with your solder mask. <S> Blind and buried vias could be used between internal and non SMT layers, but these are expensive. <S> In both cases moving the vias outside the underside of the IC is probably best from both thermally and electrically. <A> If your fab house can do blind vias, that is an option, but not one I recommend. <S> If it is a thermal pad as you believe, it is probably ground and should be connected to a ground plane with a few vias anyway; the data sheet should tell you that.
|
If it is not thermal and simply a conducting material, you can route beneath the chip but just without vias. The IC's footprint probably needs changing.
|
Any open tool for graph plotting for determining PID tuning parameters? I have gone through several PID implementations and its tuning tutorials, documents and all. The Best tuning tutorial was PID-without-a-PhD.pdf . But has not been of much help. I can say it works some. I am working on a Magnetic Levitation project. Please go through the link ( Barry's Maglev ) for an example. I am able to levitate the magnet keeping an aluminium plate below. Current progress: Video . I want to perform it without the aluminium plate. My question is how to start with graph plotting and all. I've seen and been attracted towards the graph only. Say take the PID-without-a-PhD.pdf file and just look at the plotted graphs. How to get that? which open tool to start with? I have tried building and working on some self made graph plotting tool. The plotting against time is not satisfying, and hence the gain determination. [If there are any self explanatory auto-tune algorithm available! : this is not my question now.] I want to restart fresh with hard systematic approach. Any help will be god like helpful. I don't want to go with trail-n-error method. As that didn't help. I am using AtMega2560, a coil, a stack of 2 neodymium magnet, a nicely working H-Bridge. ....Update1.... Also a hall sensor for feedback. ........ ....Update2.... Now I have its transfer function with me. I am studying LTI Transient-Response Analysis using Python . The issue is I have a matrix of transfer functions. I might be wrong because what is called what, I don't know exactly. Will learn it soon. ........ <Q> Generally in industry this would be done with Matlab. <S> If you're trying it on your own you have a few different options as far as numerical calculation/graph plotting software is concerned. <S> First among them is SciLab - a program very like Matlab but open source and free. <S> There are a couple of toolboxes that may or may not provide useful functions for designing and analyzing control systems: Control Design Tool <S> (very popular it seems) and ADS CoLiSyS (much less popular). <S> Otherwise you could try NumPy or SciPy which have some numerical/graphing capabilities but no control system toolboxes. <S> Edit: As for tuning a PID controller using a well-known method... you may be out of luck. <S> but since you're working with an unstable system (the ball will fall without feedback control) <S> you can't do what the method recommends (ie, 'turn off' integral and derivative gains to tune proportional alone, then assign integral and derivative gains as a multiple of proportional gain). <S> However, if you can create a controller that simply stabilizes the ball at a set point (a disturbance rejection controller - the disturbance being gravity) then you can add in your PID controller in series and tune it that way once the system is stable. <S> But it seems your overall goal is to make a controller that will simply stabilize the ball and not, for instance, make it follow a square wave or sinusoid input. <S> So that may not be a worthwhile approach. <S> Keep in mind that what you're doing is by no means basic controls and simplistic approaches don't necessarily apply. <S> Good luck. <A> Here's their site: http://www.20sim.com <A> Not open source, but CircuitLab will do the plotting in the time and frequency domain as you require. <S> You can compose the feedback loop graphically using either circuit elements or Laplace transform blocks, and then measure the response and tweak your PID parameters to make sure you get a stable result! <S> For example, see Laplace transform step response and Bode plot .
|
Have a look at 20-sim, they have a free version available, there are many toolboxes (also for controller design and LTI systems) and the latest version 4.4 has scripting with Matlab and Octave as well. You can try methods like Ziegler-Nichols
|
How can I measure small scale movement with an electronic component? I'm working on a project which involves measuring the distance between two pins which are nominally 3-5 cm apart. These pins can move up to 1cm in either direction. I need to take a measurement of the distance between the pins which is accurate to about 500 μm. Currently we take a measurement once a day using calipers and record the distance manually, but I need to automate the process. Update (2012-02-21) Okay, I figured the implementation details were unimportant, but as a lot of people are asking for more detail, here goes. We want to measure the opening and closing of a crack in a brick wall over the course of a year or more. We currently drill holes and insert two metal pins into the wall either side of the crack and take measurements between the two pins. So long as we can measure the opening and closing of the crack over time, then the implementation is unimportant. <Q> A vibrating wire transducer can automate this process. <S> http://www.slopeindicator.com/instruments/jmeter-crack.html <S> They are expensive but it may give you an idea on how to build your own. <S> The challenging part will be calibration. <A> This sounds like a job for a LVDT (linear variable differential transformer). <S> These are transducers that measure small absolute displacements from some nominal position. <S> Usually the total movement is rather small, like a mm or two, but that is apparently all you need. <S> There are also dedicated chips to drive these things and extract the position information. <S> I know Analog Devices makes some, and there are most likely others. <S> Added: <S> One reason LVDT came to mind is that they sense absolute position. <S> A strain guage system could possibly work, but those usually have significant drift. <S> Power shouldn't be a problem since it only needs to be powered up for a short time once a day. <S> "LVDT" is a standard term in the industry, so you can find lots of stuff written about these devices. <S> For example, here is one page I found by searching "LVDT position sensor". <A> Another way could be measuring the capacitive coupling between the two pins: but the feasibility depends on shape and distance of the pins, as well as if you can put signals in the pins themselves. <S> Update <S> I've read your additional informations, and I think that both strain gauges and LVDT can work (note that you have to measure differentially, this is good). <S> Since you are almost free to play with those pins, I would suggest also to create a structure (maybe with curved pins) to reduce the distance, and make the variations more significative. <A> You say you are using calipers manually. <S> Can you attach anything to the pins? <S> If so, could you use two electronic dial indicators with serial data output? <S> They will handle the resolution you need. <S> They are typically spring-loaded so the probe will move back and forth with the pin. <S> Here's an example <A> I'm not sure if this will meet your budget or long-term mechanical requirements, but try a web search on "wire draw encoder". <S> This is a wire that pulls out of a mechanism to measure a length. <S> As the wire is pulled out, the mechanism can produce an analog voltage proportional to the withdrawn length, or a digital signal. <S> The digital signal is probably better for your use. <S> This emits a pulse for each length of wire withdrawn (say each 1/10 or 1/20 mm). <S> Overall accuracy is specified as a percentage (like 0.05%) of the measured length, probably limited by thermal expansion of the wire itself. <S> In any event, the resolution is probably more important than the overall accuracy in your application, unless your wall is in a location subject to wide temperature swings.
|
If you're allowed to connect them together, something like a strain gauge could work: it's a variable resistance that increase its value if strained; however, requires a mechanical connection and gives very small signals with huge common mode; Wheatstone bridge circuits with differential amplifier (InAmp are better) are usually used. Wire draw encoders are apparently available with resolution to 50 microns at lengths of up to 5 meters.
|
Measuring voltage/current digitally on two separate power supply rails I'm designing a dual-rail DC power supply, with the two rails completely separate (except for sharing a dual-secondary transformer). The main design should work as-is, only by adding a fuse + mains switch, but I want to add a voltmeter and ammeter to each output (and preferably a voltmeter before the voltage regulators, too). The problem here is that the "meters" will be a microcontroller's ADC inputs (or external ADCs), and the microcontroller only shares ground with ONE of the two rails. I need some way to safely connect the µC to both rails, perhaps opto-isolation or somesuch, while keeping the rails separate. Don't look too closely at the exact schematic (below), though, as it isn't 100% correct: I couldn't find a dual-secondary transformer in MultiSim; the LM317 package is incorrect and the µC will be AVR-based. This is just to give the general picture. Full size image Now, the problem: I want to measure output voltage and output current for both rails, from the shared microcontroller, which is powered by one of the two rails. It would also be great to have a voltage probe just before the LM317s as well; that way, I can both monitor the input voltage, and also calculate and display the approximate LM317 heat dissipation. The voltage measurement would be easy, if it weren't for the floating rails... A voltage divider, perhaps followed by an opamp voltage follower to take care of any impedance troubles, connected to an analog input on the µC. As for current, I'm not quite sure. An opamp would surely be needed to amplify the tiny voltage across the 68 mOhm shunts (68 µV - 102 mV for 1 mA - 1.5 A), but I'm not sure how to wire it up, since neither side of the shunt is ground. There's also the issue of offset voltage, not to mention the galvanic isolation issue. Priorities are simplicity and cost, though needless to say some accuracy is also needed. It would be great to have 10 mV / 1 mA resolution, though something like 25 mV / 5 mA might be OK too. Any advice on how to solve this? I'm unsure about much of it. I've considered external ADCs (shunt -> opamp -> ADC -> optoisolator -> µC), or shunt -> opamp -> optoisolator -> µC, but that doesn't appear to be a good idea since the optoisolator might muck with the analog reading. Frankly, I don't quite know what I'm doing (though I do feel safe about my knowledge about the PSU in itself), but I'm certainly willing to read up a little to learn. EDIT: related to a previous question "Dual polarity vs dual rail power supply" <Q> The optoisolator -> \$\mu\$C is a viable path if you pick the right optoisolator. <S> The IL300 is an analog optocoupler which, thanks to a servo mechanism, achieves a 0.01% servo linearity. <A> In addition to stevenh's answer , I'd like to suggest 2 more alternatives: <S> You can have a separate ADC in each of the floating channels. <S> The ADCs would be linked to the PIC through serial bus (such as SPI). <S> The bus goes to the floating channel through digital optocouplers, which are cheaper than analog optocouplers. <S> Once you have an ADC inside the channel, you can make as many measurements as the ADC has got channels without needing additional optocouplers. <S> This approach was already mentioned in kenny's comment. <S> Each channel could have a dedicated PIC. <S> Each channel with its PIC (and its display, if there are displays) would all float together, and independently of the other channel. <S> You wouldn't need to install a an analog optocoupler for each signal you want to measure. <S> Furthermore, the PICs could talk to each-other through serial link (UART for example). <S> The serial link would go through digital optocouplers. <A> It is a little more expensive at around $6, but I think you would end up with fewer parts since you wouldn't need the extra op amps. <S> It is available in a 8-DIP package, The input and output sides are designed to be powered off of separate supplies. <S> It is designed to measure small voltages, so you would need a voltage divider for measuring the output voltage of the PSU.
|
Along the line of stevenh's answer , another choice is an isolation amplifier, like the HCPL-7840-000E .
|
Flash memory corruption due to electricals? I'm a software developer working on an in-vehicle (WinCE) device that uses an SDIO card for its storage. We are suffering from (seemingly) random corruptions of the data, seemingly from the FAT table getting corrupted. You may find inaccessible directories, files with "junk" half way through them, and so on. The card does NOT seem to suffer from physical damage (bad sectors) - a chkdsk fixes the FAT in most cases (the data of course is in trouble). This sounds like a classic case of power loss in the middle of writes, so we've implemented a fair bit to combat that scenario. We now have electronics to notify us that the master switch has been turned off, and give the application running on the device enough time to shut down cleanly. Despite all that, we still have the problem. We seem to see corruption, even in the absence of a "dirty" shutdown. Assuming for a second that the software side is all correct. Is it within the realms of possibility that momentary spikes, brown-outs,or other irregularlities in the power supply could cause what we're seeing? We have filters etc. in place to shut Is it possible the ESD/electromagnetic interference could cause any of the above? Any other thoughts from an electrical/electronics side? Much appreciated. <Q> This is probably a software bug. <S> However, you did say "vehicle", which implies unusually nasty power. <S> If this is a normal car, then the "12V" power is about as bad as such things get electrically. <S> You definitely can NOT just connect the 12V car power directly to your single board computer (or whatever your hardware is) unless it is specifically rated for "automotive power", even if it has a 12V or so power input. <S> Car power can be nearly 14V in normal operation, and can have 10s of volts of short term spikes. <S> These can confuse or destroy electronics not specifically designed with them in mind. <S> You didn't say what voltage and current your computer needs, but the easiest solution is to get a "automotive rated" power supply that makes the right DC voltages. <S> There must be such things available off the shelf somewhere. <A> Most common flash media include within the storage device a mechanism which dynamically maps logical sector numbers to physical addresses, since software expects to be able to write any particular sector an arbitrary number of times with minimal delay, whereas most flash devices have hardware pages have to be recycled in groups of 256, 1024, or more. <S> When one writes to sector 123, the hardware will identify a blank page, write page's data there along with some tags indicating that its sector 123. <S> If one rewrites sector 123, the hardware will identify an old page, write the page's data there along with some tags. <S> Additionally, the hardware will either assign the new page a sequence number of some sort that's higher than the old one, or else it will void out the tags on the old page. <S> If there the number of blank pages available gets very small, the system will try to find a block on which many of the pages have been superceded, copy all the non-superceded pages from that block to some of the few remaining blank ones, and then erase the old block. <S> Note that such an operation may involve any arbitrary collection of pages, often including pages not involved in any recent or current operation. <S> The logic to handle all of this in a flash device which has many millions of pages, but probably does not have millions of bytes of RAM, is quite complicated. <S> Arranging the logic so as to be robust if power is lost at any point would make it even more so. <S> It is possible that some companies have managed to design very robust systems for ensuring data integrity, but it's also pretty clear that not all flash media incorporate such systems (not effectively and correctly, anyway). <S> Unfortunately, there's really no nice way for the software that writes to flash media to know what is going to happen 'behind the scenes' in response to a write request. <S> Unless you require the use of media which are known to behave robustly in adverse conditions, the only way to avoid corruption in case of unexpected power loss is not to unexpectedly lose power. <A> I second the vote for software bug. <S> I recently worked through a flash corruption issue, on a WinCE system, as part of a development team. <S> We would sporadically find 2K blocks of flash that were erased. <S> (All bytes 0xFF) <S> For about 6 months we tested everything from ESD, to dirty power to EMI and RFI interference, we bought brand new devices and tracked usage to make sure we weren't exceeding the erase cycle limit and buring out blocks, we went through our (application level) software with a fine toothed comb. <S> The driver came from a 3rd party. <S> We informed them of the issue we found, but I don't know if they ever released a patch.
|
In the end it turned out to be an obscure bug in the very low level flash driver code, which only occurred under periods of heavy CPU load.
|
How do I determine the area of copper needed on a PCB to provide adequate heatsinking for a power SMD MOSFET? I am planning to use the IRFR5305PBF Power MOSFET (http://www.irf.com/product-info/datasheets/data/irfr5305pbf.pdf) to switch on a load. I have determined that I need an external heatsink with Rthsa < 29 C/W. How would I go about determining the area of copper on the PCB required to provide a thermal resistance of < 29 C/W? I have tried searching on Google and the IEEE database, but the articles do not clearly show me how to calculate this. edit: I am using a 4 layer PCB with 1 oz copper on the top and bottom, and 0.5oz copper for the inner layers. <Q> Unfortunately there's no simple answer to your question. <S> There are standard test methods, but these are hardly relevant to any real situation, mainly because they use just bare FR4 with no copper layers as the heat spreading element. <S> Various vendors have also published values for certain configurations. <S> The datasheet you linked, for example, refers to IRF's AN-994 , where they give thermal resistance values for various packages offered by that company. <S> But note that their standard test condition uses 2 oz. <S> copper on the outer layers. <S> Linear technology is another company that publishes informative thermal results. <S> If you can find one of their parts in the same package as your FET, and check the datasheet, they'll likely give a table of thermal resistance for various sized heat spreaders on the top and bottom layers. <S> For example, for their DDPAK package, which is not quite the same as the DPAK of your IRF part, they give: (From the LT1965 datasheet, see there for more detail on the test conditions) <S> At least you can see that getting to less than 29 C/W is somewhat challenging. <S> The only test conditions in the Linear results that achieved that required 4 square inches of copper on both the top and bottom layers. <S> But again, you can only count on these figures as guidelines, because factors like airflow will strongly influence the actual results in your application. <A> Suggest you look at SMT heat sinks (e.g. this one for DPAK devices from Aavid ) as they will meet your specs (with adequate airflow / convection, of course). <S> As for PCB copper area alone, you can check appnotes like this one from Fairchild , but I suspect from skimming it that the required area is fairly large (>1 square inch) which is probably not a good guarantee of heat sinking. <A> Robert Kollman provides a couple of pages to this subject in Constructing Your Power <S> Supply- <S> Layout Considerations in section V - Thermal Considerations. <S> I never did this by myself, but I remembered this paper. <S> He provides some examples, so I guess you could probably transfer this to your case. <A> Here is an interesting article that suggests using 4 layers and vias under the device: AN10874 - LFPAK MOSFET thermal design guide - Application note
|
There's too many variables in the problem for anyone to have measured or characterized every possible configuration: thickness of the FR4, number of copper plane layers, number of vias between the plane layers, the amount of air flow over the board and the inlet air temperature, the thermal contribution of other nearby parts, etc., etc.
|
Current and Voltage Ratings for Multi-Conductor Connectors I am currently looking at some multi-conductor connectors that will handle reasonably high currents (approximately 30 A at 24 v). When reading datasheets, I see that the connectors have both a maximum current and a maximum voltage. For example, Voltage Rating: 600 VAC / Current Rating: 9 Amps Max. in 2-position applications. I am having a hard time interpreting this. My understanding is that the maximum current is dictated by the resistance of the pins. My intuition is that this means that it would be safe to use the conector for any application that draws less than (9 A)(600 V) = 5.4 kW of power as long as the voltage does not exceed 600 VAC. Is this true? If so, why isn't there a single "maximum power" rating? If not, can you explain how to interpet the rating at different voltages? <Q> The voltage rating is related to the breakdown voltage of the plastic between the pins. <S> You shouldn't exceed the breakdown voltage <S> even of theres no current at all. <S> Edit: <S> As KellenJB says in another answer, it looks like the key thing you're missing is that the power consumed in the connector (and so the self-heating which could damage the connector) is not related to the voltage between the pins, but to the current through the pin. <S> This current, combined with the (very small) resistance of the pin or contact, generates a small voltage between one end of the pin and the other (or between one pin and the socket its mated to). <S> This voltage, multiplied by the current, gives the heat generated in the connector. <A> Everything The Photon has said is correct, but let me give you an actual example. <S> Power= <S> resistance*current^2 <S> So 9 amps going through the pin would result in power dissipation in the pin of P= <S> x*9 <S> ^ <S> 2. <S> As I am sure you can see by now, the voltage doesn't come into play here at all. <A> You're answering the question yourself: "as long as the voltage does not exceed 600 VAC". <S> The 5.4kW isn't the only limitation. <S> Otherwise you could connect 5.4kV @ 1A or 540A @ 10V; both are also 5.4kW. <S> The 9A limit is for the dissipation in the contacts. <S> Higher currents may melt the connector or weld the contacts. <S> The 600V limitation is about the insulation between the contacts, or between contact and connector housing if the latter is metal.
|
The current rating is, as you say, relates to the pin resistance and how much the connector will heat up. You shouldn't exceed the current rating even at very low voltages.
|
Arduino or PIC microcontroller? I was thinking of creating a surveillance mobile robot. And I am having a problem of choosing a PIC or a Arduino microcontroller. The surveillance mobile robot is controlled via wireless fidelity (Wi-Fi). If I choose PIC, is there a need for an Ethernet module? I have searched that it need it for an Arduino board to connect to the Internet. I am a bit experienced with PIC, but some say Arduino is better for beginners. Which is better: using Arduino or PIC for the project? Or it should be done with both Arduino and PIC? And also I am thinking of using an Android phone as the controller for the robot. What should I do? <Q> Really the question should be Arduino vs Launchpad (or another PIC development board) or AVR versus PIC . <S> Arduino is simply a development board that includes an Atmel AVR processor and the necessary hardware to use it. <S> There there tons of custom shields available for the Arduino, including a wifi shield . <S> Open-source wrapper libraries are already available for most of these shields, which will shield you from a lot of low-level bit twiddling. <S> On the development side, you can simply use a GCC cross-compiler ( avr-gcc ) and the related cross-toolchain. <S> This is not true for PICs, which are not supported by GCC. <S> If you don't mind the cost of an Arduino and the necessary shield(s), Arduino is likely the path of least resistance. <S> The available libraries and support far trump any technical advantages of a PIC devboard unless you already have a lot of experience with microcontrollers. <A> Though you have to know, that Arduino is not a microcontroller - it's a design. <S> It mostly comes with Atmel microcontrollers but you can also find Arduino with PIC <S> (Microchip microcontroller). <S> If you decide to go with PIC (since you said you have some experience with this architecture) you should definetly take a look at MRF24WB0Mx <S> module (MA is with internall antena, MB has U.FL connector). <S> Works <S> well, can create AdHoc network or join an existing infrastructure one and you can get free library and examples at Microchip's site. <S> However, if you choose Arduino, you should consider using a WiFi shield withgood support. <S> As for which is better (Atmel or PIC), Dave Jones has a video blog on this topic, ifyou can spare 24+ minutes. <S> :) <S> And don't expect a final answer since there is no. <S> If you only want to deal with programming - go with Arduino. <S> If you don't mind also designing a PCB - then you'd be probably best of with a PIC (PIC24FJ256GB106 or GA106 are very often used nowdays) and MRF24WB...). <A> Focus on what part of the project you are actually interested in. <S> Is it the microcontroller? <S> Is the the analog design? <S> Is it motor control? <S> Is it the autonomous algorithms? <S> Is it the embedded TCP stack? <S> Why not buy a robot kit that meets <S> the project requirements then dive into the inner workings of the parts of the kit that you want to learn about. <A> How about a combination...!As you already mentioned you have experience with PICs... <S> Why don't you use PIC for Motor Controls, Sensor interfacing etc and Arduino for Ethernet Stack... <S> Though, Microchip also has its own TCP/IP Stack <S> , its is not a good choice if you compare it with Arduino... <A> I don't know about PIC or anything, but I will definatly tell you arduino is a good choice. <S> Arduino is great for using internet with the wifi shield, and there is the android ADK for arduino that is just booming. <S> So if you are planning using android I would definatly look into arduino. <S> Plus there is a huge community out there so if you have any trouble, i will promise someone will help.
|
For a hobbyist Arduino is probably the best solution.
|
Why do people survive lightning bolts? It is believed that one lightning bolt can carry enough energy to light a 100W bulb for 3 months. Why do so many people get directly hit by lightning bolts and survive? One argument can be, the electric shock period is really small (a fraction of a second) but on the other hand, if someone is hit by lightning bolt from a high tension wire for example, he is almost instantly killed. That lightning is also for a very short period of time. <Q> Not all shocks are created equal. <S> Some "direct hits" are more direct than others. <S> I'm just guessing here, but I would bet real money that if a lightning bolt hit within 4 feet of a person then it would be called a "direct hit". <S> It is entirely possible that a lightning bolt that hits 4 feet away will cause injury, but not death. <S> It is also possible that it will be fatal, even at 4 feet. <S> A big factor is WHERE the electrical energy flows, and how much energy. <S> You could also have the energy flow through the skin of your torso but never reach your heart, and still survive. <S> But even if you have a "near miss", there is still a significant amount of energy that could pass through or on your body. <S> The bolt itself can be quite wide, and not all of it is visible. <S> Once the bolt hits the ground, it can flow along the ground for some distance. <S> And of course there are the non-electrical things like the blast of heat, light, and sound that could cause other issues. <S> So even a "near miss" can cause damage and injury. <A> The key difference as compared to being electrocuted from a high tension wire is that the "far terminal" of the discharge is very far away and that voltage is much higher. <S> This leads to a curious effect - the bolt gets <S> stranded (look at a picture of Tesla coil discharge for a better image of what I'm talking about). <S> When a discharge gets from a high-tension wire - it goes from the wire through a person and to the ground where the person stands, so all energy is passing through the person. <S> When a lightning strikes - the discharge starts somewhere far in the sky and goes to the ground and near the ground a huge volume of air gets ionized and forms conductive strands. <S> The discharge goes from somewhere in the sky to a wide area on the ground . <S> So for example if there's a tree near a house and a lighting strikes into the tree the discharge can also pass through the tree branches to a house wall and set the wall on fire. <S> So to protect a house not only lightning protection should be installed, but all nearby trees should be trimmed to avoid this effect. <S> Add to this that air can easily conduct tremendous currents when ionized enough but the human body has limited conductivity and the human body is not necessarily the least resistance path. <S> So when a lightning strikes anything that anything is usually only one of the multiple paths for the current, not the only one. <A> The theory behind lightning strikes is tremendously complex. <S> You're asking "why people survive". <S> It seems that you somehow think that lightning strike is by definition lethal. <S> However, the question "why would someone die when struck by lightning" is even more interesting. <S> In a simplified view, you can think about lightning as of huge current source, and about our body as of resistor. <S> In general, if the lightning strikes you directly and all the charge released during the discharge flows through your body, the damage will be severe. <S> However, the damage may be localized to a particular area of the body - it depends how exactly the current flows inside the body. <S> The body may be modeled as a distributed resistors network: <S> The ultimate destination of lightning's charge is the ground, therefore you can estimate (very roughly) <S> the path of current flow inside your body as a function of lightning's hit point. <S> For example: if the lightning hits your leg, the current won't flow into your head, therefore the brain damage will be reduced (it is very simplified model! <S> when someone is struck by a lightning, its whole body may become a temporary storage of the charge, in which case stochastic currents flow all over your body). <S> Until now we assumed that all the charge of the lightning flows through your body, but it is rarely the case. <S> If you're wet, the resistance of the external layers of your skin is much less than the resistance of the body itself. <S> This resistance is in parallel to body's resistance. <S> It means that the majority of the current will flow "on the body" and not "inside the body". <S> While this is still very dangerous (and may easily be lethal), the fact that the majority of the current do not penetrate into the body rises you chances to survive dramatically. <S> Any additional conducting path to the ground in man's vicinity when he is struck by the lightning also present additional parallel resistance for current flow and increases chances for survival. <S> Follow <S> this link to find additional info on lightning injuries.
|
The bolt can cause an electro-magnetic field that can induce electrical currents in things nearby (or very far away, in the case of lightning detectors). If you get struck directly in the leg (a real "direct hit") and that energy never flows through your brain or heart then you might survive.
|
Multidrop one or two lane bus I like to design a single master, several slave (up to 100) application and looking for a reliable (up to 30meter) multi drop bus. One or two lane is preferred, I will use daisy chain topology therefore USB is not suitable and also it is an overkill. My data rate is low and intermittent, once every 3-5 sec and probably <10KB. The slaves are not synchronized. I thought about using RS232 and implement an algo where slave transmits if there is no traffic. (Similar to Ethernet). I prefer something a bit more robust. Also, current thinking is to wake all slaves when master transmit where all slaves receive the message, they all parse it but the one we targeted takes action. Not very efficient but it would work. <Q> Most of the suggestions so far are based on use of RS422 differential signalling as per my original comment, used in various ways and/or protocols that build on top of it. <S> If you want to "roll your own" you'll find RS422 an excellent place to start looking. <S> Hardware is available and well priced and performance under various loadings and distances is well described in the literature. <S> RS422 - <S> [Pandoras box] <S> ( all link to web <S> pages)RS422 multidrop as above <S> QUICK REFERENCE FOR RS485, RS422, RS232 <S> AND RS423 <S> Wikipedia <S> RS422 Maxim tutorial 723 <S> Selecting and Using RS-232, RS-422, and RS-485 Serial Data Standards TI RS422 products page - very valuable - even if you don't use their ICs ultimately Cross Reference - Application Notes - Training - Tools & Software - Block DiagramsAnalog eLAB ™ <S> They say <S> Texas Instruments is the world leader in RS-422, with a selection of transceivers for any application. <S> TI provides industry-standard RS-422 solutions for industrial automation, motion control, e-meters, security electronics, building automation and hundreds of other applications where robust communication with high noise-immunity is needed over long cable lengths. <S> RS485.COM <S> - Commercial page but <S> VERY useful <S> Their FAQ <S> RS485 links <S> NatSemi RS485 application notes <S> NatSemi RS485 overview <S> Other: <S> Basic 422 intro <A> The standard serial multidrop busses are RS-422 , RS-423 , and RS-485 . <S> I'm not sure if these are what you want, but it is certainly a good place to start. <A> One popular bus in the automobile and industrial fields is CAN Bus . <S> It is also being used in the marine industry where it is implemented as part of NMEA 2000 . <S> A related standard is LIN bus , which is often used with CAN and is a slower and cheaper sub-network. <S> There is also a super version of CAN with dual backbones for redundancy being used by BMW and others (sorry, can't remember the name of that version). <S> All three of these buses inter-operate and have wide support from major semiconductor manufacturers. <S> Since this is designed for safety systems in automobiles, chips are cheap and available in extended temperature ranges. <S> Here is a TI whitepaper, Introduction to the Controller Area Network (CAN) <A> Thought I may contribute the solution I found. <S> ( may aswell document it somewhere xD ) <S> I recently had to interface to two RS232 "slaves" connected to a single RS232 "master" which always iniciates communication and slaves which are adressed respond. <S> Since RS232 is intended for point to point, I initially was going to convert to RS485 and create a bus in RS485 and then convert back to RS232 <S> but didn't have enough converters on hand <S> so came up with the following circuit. <S> After a bit of testing I found out that the Rx pin of a typical USB to RS232 seems to have a 10k "pull-up" to GND which causes a voltage drop to be seen when the master should see a negative voltage. <S> The resistances are designed to minimize the voltage drop while limiting the current to 15 mA between any two slave in worst case scenario ( <S> +25 -- <S> > -25V) <S> --> 50V/3k3 <S> ~ 15mA.I also used Diodes 1N4448 instead of 1N4148 which is in the schematic because I had them on hand <S> and they have a lower voltage drop. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> This is extensible to many more, but you will probably need to play with the resistance value depending on what the available sourceing current your slaves have.. and also depending on the master, each slave will also and onto into TXout pin some load. <S> Maybe this may help someone else in the future.
|
TI offers RS-422 with multiple drivers/receivers in a single package and multiple temperature ranges. Many microcontrollers have CAN on-board.
|
Why doesn't a high current transformer get damaged when shorted? In this video a high-current transformer secondary coil is shorted with numerous thick pieces of metal - pieces of rather thick wire and a knife blade. All those pieces either get red-hot or just melt. The video lasts about five minutes. The transformer doesn't seem to have any kind of active cooling yet it doesn't melt and even its windings insulation doesn't burn. Why doesn't the transformer get damaged when shorted? <Q> What you are observing here is the basis for resistance soldering . <S> Resistance soldering is the name applied to a technique where the heat to melt solder (or strip wire) is instantaneously generated by passing a high amerage electrical current through a resistive material. <S> There are three key components of resistance soldering: <S> The transformer and the leads coming out of it are copper which conducts very well. <S> The items being placed across the copper leads are of materials that do not conduct as well as copper. <S> That is why the various items tend to get very hot (and even melt) while the copper does not. <S> I rather suspect that if they had placed a heavy copper bar across the leads the results might have been different. <S> Here is a paper Build Your Own Resistance Solderer which uses a battery charger. <S> Finally you may have seen one of those little "cold heat" soldering tools that run on a couple of AA batteries which came out a few years ago. <S> They work on the same principle as described here . <A> Summary: <S> May be within ratings if aggressively designed transformer <S> May be lower voltage than stated so higher current <S> OK <S> May be fully fraudulent. <S> The transformer WILL be being heated. <S> As long as the currents drawn are below the design current then the transformer will not be damaged. <S> The transformer looks to be not more than say 400 VA in rating. <S> He says 12V output but the current to heat the knife blade or thicker wires looks to be more than the 40 or so amps that a 400 VA 12V transformer would provide. <S> It may be that the transformer is more like 2V output - where a 400 VA transformer would provide 200A "safely" [tm]. <S> And it MAY be that there is a 12V car battery hidden out of sight. <S> Why should or would there be? <S> I know not - BUT many people make many claims on the internet that are suspect or just plain untrue. <S> Maybe I have the Wattage wrong - if the designer pushed the iron hard and did not care about some core heating from magnetising current as the core went partially into saturation he MAY manage 1000 Watts, That's 12V at 80A+. <S> Or 2V at say 500A :-). <S> The wire appears to be the winding wire - not good for 100's of amps in normal use. <A> It depends on the ratio of resistance of the load (the thing doing the shorting) to the resistance of the secondary. <S> Since the current thru both is the same, they will each be heated proprotional to their resistance. <S> High current windings have deliberately low resistances for this reason. <S> This effect is the basis of a soldering gun. <S> Open one up and you will see the secondary is a single loop of quite a thick conductor. <S> This is why when you connect a few inches of #10 copper wire to it, the #10 wire gets a lot hotter than the pipe-looking conductor that is the secondary.
|
A specialized step-down transformer that will generate the appropriate currentA resistive material to generate the heatThe ability to complete an electrical circuit
|
When/why would you use a Zener diode as a flywheel diode (on the coil of a relay)? I have just been cogitating on the tutorial at http://www.electronics-tutorials.ws/io/io_5.html , and in the discussion of flywheel diodes it includes this sentence without further elaboration: As well as using flywheel Diodes for protection of semiconductor components, other devices used for protection include RC Snubber Networks, Metal Oxide Varistors or MOV and Zener Diodes. I can kind of see how an RC network might be needed if it is a large device and therefore the coil could be kicking back more current than you want to dissipate through a single diode. (Please correct me if that's not the reason.) I don't have a clue what an MOV is so for the moment I'll ignore that one. :-) I have read a bit about Zener diodes, but I don't understand why their lower reverse breakdown voltage might be desirable here? Edit: I'm also puzzled by the following diagram from the tutorial above: Wouldn't this take any flyback voltage and dump it into the Vcc net? Would it not be a better idea to have the relay coil be between TR1 and ground, and the diode dissipating the flyback voltage to ground? <Q> The current from the relay opening doesn't go into the Vcc rail at all. <S> It follows the path shown here: <S> The stored energy is dissipated in the diode drop and the coil resistance of the relay. <S> In the Zener diode configuration, the stored energy is dissipated in the full Zener voltage of the diode. <S> V*I is a lot higher power, so the current will fall faster and the relay might open a little faster: <S> MOVs are different than Zeners, but fulfill a similar circuit function: <S> They absorb energy when the voltage exceeds a certain level. <A> The rate at which the magnetic field will collapse in a solenoid, electromagnet, or similar device when power is removed will be proportional to the voltage which is allowed to appear across the device. <S> If one operates a 12-volt solenoid or relay with a push button and no flyback protection, releasing the button may cause hundreds or thousands of volts to appear across the coil until the field collapses; because of the large voltage on the coil, however, the field would collapse almost instantly. <S> Adding a simple catch diode will prevent any significant voltage from appearing on the solenoid or relay when it is released. <S> It will also, however, cause the coil to remain magnetized for much longer than it otherwise would. <S> If it would take 5ms for the magnetic field in a relay coil to reach full strength at 12 volts, it will take about 17 times that long, (i.e. 85ms) for it to dissipate through a catch diode. <S> In some situations, that could be a problem. <S> Adding some other circuitry to drop voltage can allow the coil to de-energize much faster. <S> BTW, if one is switching many 12V relays frequently, I would expect that one could save a fair amount of energy by having the clamp diodes charge a cap and then taking energy from that cap for some other purpose. <S> I'm not sure whether or where that's done, but in something like a pinball machine it would seem like it might be a useful concept. <A> The zener diode would normally go in series with the freewheel diode, cathode to cathode (pointing at each other). <S> This causes the voltage to collapse faster and therefore the coil field will collapse faster and therefore the relay/solenoid will open faster. <S> In switch mode power supplies (SMPS) <S> this is also known as a zener snubber. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> See also this question/answer: zener diode question <A> Some of these answers are confused about what happens with a simple diode. <S> The energy is dissipated primarily in Rcoil, not in the diode. <S> Key is that when using a diode, the dissipation is an RL exponential decay (like RC). <S> It is being exponential that makes it take so long (especially since release current might be only 20%). <S> With a zener it is a linear drop to zero. <S> This simulates a real relay from its datasheet values of R and L. simulate this circuit – <S> Schematic created using CircuitLab <S> You will notice that the ON (current rise) time is longer that the off time using a diode (L1,D1). <S> This is not correct as the inductance is greater (0.74H) when the relay armature is closed (better magnetic circuit) that when open (0.49H). <S> The real On time (with 0.49H) and the off-time with a diode are almost the same. <S> L2,L4 currents are the same, as there is the same drop in both cases (and the same Vdrain on the fet. <S> ignore this simulate this circuit <A> Here is an app note about using normal + Zener diodes to protect components and still de-energize quickly. <S> It shows decay time and voltage values for several methods.
|
They are used for overvoltage protection, not for precision things like voltage regulators.
|
Looking to create 36 channels of PWM control for LED sculpture I'm a sculptor, not an EE, but I'm trying to incorporate controllable LEDs into a piece that I'm working on, and I could use some advice figuring out a practical approach. I'd like to be able to control 12 separate channels (the piece is a dodecahedron) of RGB strips, and that means I'll need 36 PWM outs, which is more than I have access to on an Arduino. As far as I can tell I'll need a shield, something like TLC5940 Breakout - though that only gives me 16 PWMs so I'd need to daisy chain three of them, which I know can be done, but I'd like to know what issues might result. Something like Brilldea LED Painter might also be a solution, but I'm relatively pressed for time, so something pre-assembled would be a nice perk. I'm new to this, so I'm not sure of the accuracy of what I just said, but hopefully some of you can fill me in on what might be a reasonable approach. Thanks for your help. <Q> There is a fancy Arduino library for doing PWM through shift registers, called ShiftPWM . <S> It was developed more or less specifically for what you are wanting to do (control lots of RGB LEDs with an Arduino). <S> I saw this on Hack-a-Day several months ago. <S> It looks very cool and boasts the potential to control 768 LEDs (or 256 RGB LEDs) at 5-bits (i.e. 32 brightness levels) per color channel (i.e. >32000 possible colors). <S> I'm looking forward to using this library at some point myself. <S> And it's only going to take up three pins on your Arduino - for serial, clock, and latch to the initial shift register (in the chain). <S> This library is meant to drive something like the 74HC595 shift register, which is hell of a lot cheaper than the TLC5940. <A> In my opinion, your approach in using this breakout board by sparkfun sounds really good :) <S> The big advantages are that this board provides 16 PWM channels that are programmable via a daisy chainable serial interface, all led inputs are easily accessible and easy to keep track of. <S> Also - you probably know already, if you plan on using Arduino, a library that will help you manipulate the driver already exists. <S> In case you didn't, you should also check out their project home <S> Since you said that you are pressed I think this solution would allow you to work fast and easy in order to get those leds up and running the way you want them to - Good luck with your project! :) <A> You don't need PWM. <S> Any output (IO) <S> pin on a microcontroller will work. <S> A PWM lets you set a duty cycle (on/off time) then repeats this indefinitely, which results in a variable brightness. <S> IO pins can be turned on and off based on a timer to achieve the same result. <S> The PWM is technically more precise and can change faster than the IO pins, but the human eye can't see the difference. <S> The result will be exactly the same. <S> So you need a microcontroller with 36 IO pins. <A> (Apologies for advertisy post but couldn't see any way to contact user directly) <S> email me via whitewing.co.uk <A> I have no connections to this company, I have just used the product. <A> I would suggest using controlled-current shift registers and allowing the current-control wire to be CPU controlled (possibly by including one or more non-current-controlled shifters in the chain and having them control resistor dividers). <S> If you want 6-bit brightness control, and a maximum reload speed of 10 times the PWM rate (e.g. a max of one reload per millisecond to achieve a 100Hz frame rate), I would suggest that the six bits of each PWM value be divided among six shift buffers (so bit N of buffer B would be bit B of LED N's brightness). <S> Then every 10 cycles, the reload pattern would be: Cycle 0: <S> Load all shifters with buffer 5, full currentCycle 1-3: <S> Keep same data in shiftersCycle 4: <S> Load all shifters with buffer 4, full currentCycle 5: <S> Keep same data in shiftersCycle 6: <S> Load all shifters with buffer 3, full currentCycle 7: <S> Load all shifters with buffer 2, half currentCycle 8: <S> Load all shifters with buffer 1, quarter currentCycle 9: <S> Load all shifters with buffer 0, <S> 1/8 current This approach would allow the average current to be set from 1/80 of the maximum peak to 63/80 of the maximum peak, in units of 1/80, using a reload rate that's only 10x the frame rate. <S> If one wants 256 brightness levels, one could add reloads at 1/16 and 1/32 current (12 reloads per frame instead of 10). <S> That would allow the average current to be set from 1/384 to 255/384 with only a modest increase in reload rate. <A> This http://www.adafruit.com/products/306 could be an option. <S> It has 32 RGB addressable lEDS per strip <S> and you can cut the strip (yeap these a tutorial for that) <S> so you place them
|
I manufacture a 48 channel DMX dimmer designed to drive LED strips, which may give you an of-the-shelf solution. Another option you may want to consider is: http://thingm.com/products/blinkm
|
Do MOSFETs usually burn open or closed? I was wondering if a power MOSFET fails due to overheating, will it usually burn as an open-circuit or short-circuit? Also, does over-temp damage usually cause the gate oxide to blow through as a low resistance ( < 100 Ohms)? <Q> This is because excessive heat will, by diffusion, mix the dopants enough to create a good conductor instead of the p-n or n-p barriers that were there originally. <S> Often, the gate oxide will be taken into the diffusion, too, causing a short betweem all three terminals. <S> Only if the short circuit current after this first mode of failure is high enough to blow the bond wires or the entire transistor, there is an open circuit. <A> Shorted gate to drain is a very common and easily tested failure mode. <S> It'll often be a dead short or 10s of ohms. <S> Mosfets failed in this way also tend to destroy whatever IC was driving them. <S> When suspecting dead mosfets that's the first thing I look for. <A> Assuming my answer is correct, my intuition was wrong about this. <S> The short answer is I would expect a MOSFET to fail as an open circuit due to over-temperature conditions. <S> This wikipedia article suggests that: Increase in drain-to-source resistance. <S> It is observed in high-temperature devices, and is caused by metal-semiconductor interactions, gate sinking and ohmic contact degradation. <S> ... at least in monolithic microwave integrated circuits, but the terminology seems consistent with MOSFETs... <S> This other article also suggests it will fail open, but for different (fundamentally mechanical) reasons: <S> Exactly what happens depends on how excess the power is. <S> It may be a sustained cooking. <S> In this case, the MOSFET gets hot enough to literally unsolder itself. <S> Much of the MOSFET heating at high currents is in the leads - which can quite easily unsolder themselves without the MOSFET failing! <S> If the heat is generated in the chip, then it will get hot - but its maximum temperature is usually not silicon-restricted, but restricted by the fabrication. <S> The silicon chip is bonded to the substrate by soft solder and it is quite easy to melt this and have it ooze between the epoxy and the metal of the body, forming solder droplets. <S> This may well not destroy the chip!
|
Usually, a MOSFET will fail short first.
|
Laser for drilling very small holes I have seen examples of repurposing cd-r/w or dvd-r/w lasers to use for laser pointers or even 'burning' lasers. I have a project in mind, and I am hoping to make holes in a pingpong ball that range from .3 mm to 5 mm in size. Could those type of lasers do this kind of task? I reailze that there are many other problems to potentially solve (lens, distance, duration of pulse, etc.). If not, what other kinds of lasers (type, price) would be capable? <Q> I've used the laser from a DVD burner and let me say that it doesn't burn much of anything! <S> I got several lasers from a couple of DVD burners and combined them with an adjustable focus lens that was specifically made for laser diodes. <S> I then shot it at anything and everything. <S> Here's what I can tell you about what burns and what doesn't <S> : Black Electrical Tape: You can burn a hole in this. <S> It takes some time to get the laser focused right, but when it does you can burn very small holes. <S> It's hard to actually "cut" the tape with the laser. <S> It's more like making a series of very small holes than slicing a line through it. <S> White paper: <S> Forget about it. <S> The laser, even when well focused, just reflects off of this and does nothing. <S> Black paper: Will put small holes in it. <S> By small, I mean something around 0.5 mm. <S> Larger holes are difficult and needs to be made from a bunch of smaller holes. <S> Brown Paper (a.k.a. Cardboard) <S> : <S> With time and effort it can make small holes. <S> The holes only go through the first layer and not completely though the cardboard. <S> Plastic: <S> Will make very small marks in black plastic. <S> No holes. <S> Does nothing to light colored plastic. <S> Balloons: Might pop a dark colored balloon. <S> Nothing to a light colored balloon. <S> Matches: <S> It can work, but it's hard. <S> It doesn't work on white or red tipped matches. <S> Darker colors, or matches marked with a black marker, will ignite. <S> So... <S> It won't work for ping-pong balls. <S> But it's still cool and worth making one to just play with. <S> Warning: <S> You MUST use eye protection with this! <S> Seriously. <S> I speak from hard-earned experience. <S> The laser, when reflecting off of brown cardboard, has enough energy to make your eyes hurt after 30 minutes of playing around. <S> If you accidentally got hit directly in the eyes or got a reflection off of something shiny then you'd be in a world of hurt. <S> At this wavelength and optical power, a simple pair of dark sunglasses is good enough in a pinch. <S> Of course a real pair of laser goggles is preferred. <A> You should have no trouble finding regular drills down to 1.6 mm (1/16 inch) in your local hardware store. <S> And PCB manufacturers routinely drill holes down to 0.2 mm (0.008 inch) using mechanical drills, so those sizes must be available somewhere, though you might have to find a specialist supplier. <S> If you nonetheless want to use the laser you have, you will probably be able to burn a hole in a ping-pong ball with a cd-rw or dvd-rw laser. <S> It will be easier to drill smaller sizes because you need to concentrate a fixed amount of power into a small area to generate enough heat to burn the material. <S> 5 mm is probably too large a hole to burn effectively with a reasonable laser. <S> What the upper limit is, though, I couldn't say. <A> Try numbered size drill bits. <S> They come very small. <S> Available at Grainger or electronic supply stores anywhere. <S> Usually need a pin vise type chuck as they are too small for standard 1/4 and 3/8" chucks.
|
Be aware that a laser able to burn a hole in plastic is also extremely dangerous to your eyesight and would probably even be able to burn your skin.
|
Thin wires - tips for stripping and soldering? Any tips for stripping and soldering thin, tiny wires like these below, (maybe even thinner!)? Initially, I would think of using a knife for stripping because wire strippers will definitely not work. Then with soldering, too large solder flows are highly unwanted. Someone recommended to heat a small bit of solder onto the soldering iron tip and then letting it flow to the joint. Any recommendations? Thank you! <Q> I've used a high wattage soldering gun and just burned the enamel off, then clean it up. <S> Tin it when it was all clean. <S> Commercial enamel wire strippers are available . <S> Something to experiment with would be dipping the wire in acetone. <S> I would do this far away from a heat source! <S> You are correct though, using an Xacto knife or sandpaper will ruin the integrity of the wire by creating very small nicks in the copper. <A> If that is enammelled wire as it appears, then, as others have said, the best method of stripping is to heat the ends with a flame to destroy the insulation and scrape off the residue. <S> For sleeve type insulation, when can use sidecutters to strip wire with little risk of damage to the conductors once you get adequately skilled. <S> Sidecutter jaws have 2 "sides" relative to the cutting line. <S> Measuring "angle" relative to the wire being stripped, - deeper lower angle on one side and low depth higher angle. <S> The stripped end should be on the small depth side of the jaws. <S> The diagram below is completely wrong. <S> Reverse cutters 180 degrees and try again, <A> The most reliable way I know is Thermal strippers, often called Hot tweezers. <S> I have one actually sold as Hotweezers. <S> Regardless, they run about $200, http://www.all-spec.com/products/FT8002-01.html?gclid=CPSYounJ87cCFYuf4AodkFMARw <S> Very surprised no one mentioned wire wrap strippers. <S> I guess everyone (me included) assumed we were talking about enamel coated wire, but it's possible that the photo shows wire wrap wire. <S> We used to be very good at stripping these quickly to make god-awful wire wrap prototypes (great connections, but hard to work with to fix problems!!) <S> There are tools ranging from a gap in a metal plate to a complicated gap in a metal plate, as shown below. <A> You can use conductive glue instead of solder.
|
If you have a solder pot then "soldering through" enamel wire can be tinned in the solder pot with no trimming.
|
AC/DC Adapter for Camera Flash Mod I'm trying to modify a Nikon SB-26 camera flash to use AC power instead of batteries. I have a setup similar to this with two dummy batteries connected to wires that lead out of the battery housing. Instead of hooking up the wires to an external battery pack though, I've connected the dummy batteries to this variable voltage 300mA AC adapter. My results with different voltages are as follows: 1.5V: nothing 3V: the unit turns on and all of the menu options work, but the flash itself doesn't charge 4.5V: the unit does not turn on but beeps about once per second 6V: the unit beeps at about once per second and also quickly turns onand off at the same interval. I was about to call this experiment a failure when I decided to hook the flash up to some of the outputs on this Radio Shack electronics learning lab (which is powered by AA batteries.) Sure enough, when I plugged it into 4.5 volts, the flash was powered and worked normally (although the flash charged a little more slowly than normal) This leads me to believe that I'm using the wrong AC adapter. My ideal solution would be charging the flash much faster than it does with the electronics learning lab and closer to how quickly it charges normally. Does anyone have any recommendations for what adapter I should be using instead? Even if you don't have a specific answer, any information on a good troubleshooting/honing path to proceed with would be extremely helpful. <Q> The problem is that your "AC adapter" can't supply enough current. <S> It is only rated for 300mA, which way to wussy. <S> I don't know about the SB-26 stobe in particular, but other strobes I have looked at will happily draw 1 A or more after a strong flash. <S> Get a proper power supply rated for at least 1A. <S> Don't play games and experiment with the voltage if you value your strobe. <S> You can safely apply about 1.5 V times the number of AA cells the strobe is intended to take. <S> If it's two cells, <S> then 3 V. <S> If 4 cells, then don't exceed 6V. <S> 1 <S> A may not be enough for short periods right after a flash, but is probably enough to get thru the tough charging phase a little slower to where it will draw less current after a few seconds. <S> A little voltage sag is OK since the strobe has to be designed to at least not get hurt by low batteries. <S> I would probably get a 2 A 6 V power supply (assuming 4 AA batteries) to get good quick recharge time. <A> I do thinks like this all the time. <S> There are two issues: <S> You need approximately the same voltage. <S> Doubling the voltage will cause double the current and quadruple the heat. <S> Sometimes you can get away with a little less or more. <S> A volt extra is usually ok. <S> You must have ATLEAST enough current. <S> If the device draws 300mA then you need a power supply that can supply 300mA. BUT!!!! <S> Batteries can generally supply an amp or more very quickly!! <S> (depending on the type... <S> LI can do a several amps or more in some cases) <S> For you camera, chances are you are charging the flash too slow or the circuitry that charges the flash simply won't work with the voltage or current you've given it. <S> It seems that the device runs about 3V to 4.5V. <S> Maybe you need to give it 4V instead of <S> 4.5V. <S> It seems like it has overvoltage protection circuitry in it that prevents it from working if the power supply voltage is too large. <S> This is a good thing. <S> BUT at 3V it may be enough to power some of the camera but not all of it. <S> You might need 3V for the camera but 4V for the flash. <S> My suggestion is to try voltages in between 3 and 4.5V. <S> You can use a resistor to reduce the voltage a little <S> but it might be hard to make this work. <S> Another way is to use a diode in. <S> If you only have 4.5V and a diode then you can get down to about 3.8V which might be what it needs. <S> Diodes are ok to use but waste power. <S> There is always the issue of polarity <S> but I imagine it wouldn't work at all. <S> There is also the possibility that you simply need a higher current supply. <S> 300mA may mean that the flash takes too long to charge. <S> Maybe try it like you have at 3V but leave it on for a while? <S> My best guess is that you probably need around a 4V supply. <S> 3V might not be enough to activate mosfets for charging the flash if it uses them. <A> the rechargeble battery, it is having 1.2 volt and 2000 ma(MILLIE <S> AMPHERE) <S> power.in flash there use 4 batteries in aseries connection <S> so the total out put volt is 4.8 volt also with the am(MILLE AMPHERE) <S> is 2000 .so <S> you make adapter having 5 volt 2000mh power
|
Too high will cause too much current to pass through the device and something will fail... usually.
|
single cycle implementation with single memory I've read that implementing a single cycle cpu requires two memories one for data and one for instructions. Why is this? Using a single memory with two read ports (see figure below) wouldn't it be possible to fetch the instruction and read the operand specified during the same cycle? EDIT: @supercat Would something like this work ? <Q> Doing them both together breaks basic cause and effect. <S> There is was a similar question to this recently. <S> See single-cycle design using and shared memory for both data and instruction <A> It would indeed be possible to design a processor to simultaneously fetch code and data from a dual-port memory; indeed, I some Texas Instruments DSP's (and probably some from other vendors) contain some dual-ported RAM that could be used in that fashion. <S> This is not generally done, however, because dual-ported RAM costs about twice as much per byte as single-ported RAM, and it would generally be more useful to e.g. have a 16K block of memory for data and a 16K block "primarily" for code (likely with a means of reading and writing data, but not necessarily quickly) than to have a 16K block which could be freely used for both code and data with no time penalty. <A> No that won't work, because if you want to have dual access to the memory you'll have to interleave both accesses, i.e. during one cycle the first request is serviced, and next cycle the other. <S> This would violate the single-cycle requirement.
|
It's not really clear what you are asking, but you can't fetch a opcode and its operand in the same cycle regardless of memory architecture because you don't know what operand there is to fetch until after the instruction is decoded.
|
What happens after a zener diode breaks down? I've strapped a 6V zener diode across the 5V/GND rails of my circuit, and I want to know what will happen if my supply were to somehow fail pass 12V straight to the rest of my board. The zener will definitely fry, but what happens afterwards? Can I say for sure whether the result will be a short or open circuit? Is there any way to ensure I get a short (thereby protecting the other components on the board)? I've learned all about diodes, but no one mentioned what happens after you fry one. <Q> First, why will the zener fry? <S> You may have a 12V supply powering your regulator, but your supply must have a fuse or circuit breaker somewhere to be safe. <S> If the current rating is higher than the zener can tolerate, well, you've made a mistake in choosing a current limiter. <S> What is the function of the 6V zener? <S> If its function is to protect the 5V rail of your circuit, then I suggest that it's not going to do a very good job. <S> Many 5V components have a maximum input voltage of around 5.5V or 6V, so a 6.2V zener won't help much. <S> I'm not sure what your environment is like, but it's usually better to just shut everything down if your regulator fails than to try to let the zener run everything. <S> One common use of a diode for protection from error conditions is to use a reverse-biased rectifier diode across the input terminals. <S> That way, if anyone connects the source backwards, the power will be dissipated in your designated diode. <S> Make sure that this diode's forward voltage is less than the maximum reverse voltage on the protected components. <S> In this configuration, when the source is plugged in backwards, nothing will work: The supply voltage will be at -0.7V. <S> Presumably, you'd notice that the power LED was not on or that the circuit was not functioning, and correct your error. <S> Second, no, you can't say whether the result will be a short or open circuit. <S> You've operated the device outside of the specifications, so anything could happen. <A> All zener diodes have a datasheet. <S> A datasheet like a promise the manufacturer gives to you -- if you stay within certain tight limits described in the datasheet, <S> then the manufacturer guarantees that the device will work as described in the datasheet; if you stay within other somewhat looser limits described in the datasheet, then the manufacturer guarantees that no permanent damage will occur to the device, and when it returns to the tight range, the device will later work as described. <S> There are no guarantees as to what exactly the device will do outside the tight limits, and so good designers assume that the Worst Possible Thing will happen outside that range. <S> Then when customers do things to their boards far beyond what they were intended to do, the designers are pleasantly surprised that there is anything left to salvage :-). <S> If you put a power resistor between the power supply and your board,you can choose a resistor such thatit can limit the current such that even with 12 V on one end of the resistor, the zener can hold the other end of the resistor close to 6 V without exceeding the zener maximum power spec. <S> If the zener ever does exceed its maximum power spec, we should assume the Worst Possible Thing will happen -- in this case, that it fails open. <S> More sophisticated methods of protecting components from over-voltage include: various crowbar circuits ( one example ); using a similar resistor to limit power upstream before it goes into the voltage regulator; using spark gaps to limit the incoming voltage to 600 V; and various circuits that turn themselves off when the input "looks wrong" using a transistor that can easily hold off several hundred volts when turned off( How do I protect against an automotive load dump? ). <A> You may consider a thyristor crowbar circuit. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> If the voltage rises enough to cause the zener to breakdown the thyristor is triggered and shorts out the supply. <S> If the fuse doesn't blow (or doesn't exist) <S> the thyristor will remain on until the current is switched off. <S> C1 reduces susceptibility to noise. <S> The term 'crowbar' is a railway term from third-rail electrification systems. <S> In the event of an emergency the lineman could trip out the electrical supply by throwing his crowbar between the live and one of the running rails on the track. <S> This circuit is not very precise due to variability in thyristor turn on voltages. <A> In general, you cannot count on undefined behaviour of components - because it can be, you know, undefined. <S> What I'd recommend is installing a fuse (either regular wire fuse, or auto-resetable polymer-fuse), that limit the amount of current the circuit can take without blowing the Zener. <S> Alternatively, you can install a resistor in series with your circuit - if you have a very low expected power consumption, this will not affect you much, and just protect the circuit as a secondary, less efficient supply. <S> Fuses in general are a good idea to have a controlled failure, I wonder why people forget them. <A> I conducted experiment with a zener. <S> The zener normally fails SHORT circuited in reverse bias, but before it get short circuited, its terminal voltage goes up, <S> that is it behaves like open circuit for few seconds and then goes to short circuit permanently. <S> So using one zener will not protect the device always. <S> So a better plan to connect 2 or more zeners in parallel. <S> For e.g.: to protect a 5v line, connect 5.1v and 5.3v zener in parallel.
|
If this fuse or circuit breaker has a current rating which the zener can tolerate, then your PCB should be protected by the zener while the fuse shuts off, and no harm will come to the zener. See Axotron crowbar circuits for more ideas and improvements.
|
Are some soldering iron tips unsuitable for lead-free solder? I don't do much lead-free work at all, so I'm asking this question out of ignorance. I have been using leaded solder as long as I have been soldering, and I have never had an issue with a soldering iron tip. The plated part of the tip always stays shiny, I'm OCD about cleaning the iron, careful with the temperatures used, and never leave my iron on long without using it. I went to borrow an iron from a lab, and the tip was dark grey and rough. It would not accept any solder unless I tried to rub off some of this material, and even then it would only be a small spot that oxidized very quickly. I concluded that the tip was ruined, and went to get another iron with a better tip, but all the irons in that lab had the same condition, or worse. I got a brand new tip and installed it, and the tip lasted for about 15 minutes before it had a perfect coating and could not be cleaned. This whole time, I had been using the available solder: a 99.3% Tin, 0.7% Copper blend with a rosin core. To further the ancedote, I came across another lab that used the same iron, but only had lead based solder. The tips in this lab ranged from perfect to moderately abused, but all would have been able to easily melt solder. Many irons were set to 450 degrees C, and their tip looked just fine. I'm not sure how much I would trust the temperature though, the iron is just about the cheapest "temperature controlled" iron I've seen. Taking another new tip and using lead based solder, I was able to end up with a tip that I would classify "used, in good condition" after a soldering session. My conclusion is that the lead free solder is either more corrosive or less protective than normal lead solder. Which (finally) leads to my questions: Is there a lead free metallurgy that is more forgiving to soldering iron tips? Is there something inherently wrong in my handling of the soldering iron? What would I need to solder with this composition? Is there any hope for these tips that have been used with the lead free stuff? (My gut says no) The soldering iron is a Stahl Tools SSVT Variable Temperature Soldering Station. The solder is Elenco LF-99: 99.3% Sn, 0.7% Cu; Rosin core. EDIT: The other oxidized irons used were used to assemble simple kits; nothing very fancy or exotic as far as I know. They were handled by novices, which made me originally believe that the students had destroyed the tips. When I ended up with an oxidized tip that was otherwise clean, I thought it was less likely that the students had killed the iron. As I was using the lead-free solder, applying solder never seemed to clean the tip. I wasn't setting the iron to temperatures that were excessively high in my opinion (400 degrees C), but I don't know what the actual temperature of the iron was. <Q> Lead-free solder requires higher heat. <S> Lead has a lower melting point which one of the reason it was used in the first place. <S> You can find more information here: http://en.wikipedia.org/wiki/Solder <S> which discusses both lead and lead-free solder. <S> I hate lead-free solder and do not use it when I am not forced. <S> Edit: http://en.wikipedia.org/wiki/Soldering_iron#Tips <A> I have been having this problem as well. <S> At my business I have been buying lead free solder for the electronics we manufacture. <S> I use weller Soldering stations with Weller Tips. <S> I have been using them for years with no issues at work using lead free solder. <S> Once I started using the same iron at my second business we bought some lead free from radio shack <S> and i have wasted about $30 in weller tips <S> , I have tried multiple heat setting and it doesnt matter what I do it ruins tips. <S> Maybe its cheap radio shack solder, <S> but if I use their leaded solder i have no issues. <S> So you are not the only one seeing this. <A> See "solder alloys" on this Wikipedia solder page for many lead-free and lead-containing options. <S> Hours of browsing fun :-). <S> However ... <S> The iron ad says "... <S> iron-plated solid copper tip ...". <S> Everything points to something being chemically wrong with this specific mix of tips and Pb free solder. <S> The solder claims to be tin + copper which is standard enough. <S> Tip claims to be copper covered with iron which is standard enough. <S> Of the two <S> it seems most likely that the iron makers are being "creative" somehow. <S> They say spare tips are available. <S> If this was me I'd get a few more tips and try a solder that claimed to be the same to "prove" it was the tip at fault. <S> Trying solder that "fails" with a tip from another supplier should provide the final proof, if it is in fact the tip at fault. <S> Trace elements at quite a small level could cause problems. <S> And if the tip was not iron plated but nickel plated or whatever they "anything could happen". <S> The irons look very good value for money IF they work as you'd hope. <S> But ... Superb HP paper on low temperature solders <S> These are not necessarily lead free. <S> The temperature diagrams are a superb introduction to what can be achieved with various alloys. <S> An example super solder (not lead free) is 40% Sn, 40% In, 20% Pb. <S> Rather expensive alas. <S> They say: 40Sn40In20Pb. <S> The solidus temperature of this alloy is <S> 121°C and the liquidus temperature is 130°C. <S> It is soft andductile. <S> It doesn’t have the problem of embrittlement when soldering to thick gold surfaces, like PbSn, becauseof the high In content. <S> Unfortunately, the high In content drives the price of this alloy up because In is extremelyexpensive right now <A> At work (high tech electronics) we use "SAC" solder which is SnAgCu (Tin/Silver/Copper). <S> I have never used solder with only SnCu. <S> Certainly the contract assembly shops that do reflow soldering do not use SnCu solder. <S> Typical SAC solder is SAC305 (3% Silver, 0.5% Copper). <S> Our Metcal soldering iron (pick one up used on ebay for < USD$200 if you plan on soldering a lot, it's worth it!) <S> has no issue corrosion issues with it, but it is hard to keep it clean and shiny. <S> A copper brillo pad and lead-free tip cleaner will help. <S> It only dissolves small amounts but for a plating perhaps only a few atoms thick it would remove it. <S> I believe that is why the copper is added to the solder (to reduce copper loss from the PCB trace) <S> but I can't find a supporting reference at the moment.
|
It is possible that the solder you used is dissolving the finish on your iron, molten solder dissolves many metals such as gold and copper.
|
How to tell if brushless DC motor is wired delta or Y? I have a brushless DC motor I'm working with, do not have any spec. sheets for it. How can I determine if it's wired in delta or Y formation? There is nothing on the label that indicates this. Here's a picture of the label. TY,Fred <Q> I've never seen a brushless DC motor with 3 wires connected in a delta, and that makes no sense when you think about it. <S> I would assume 3 wires means Y configuration with the center not available, but of course the datasheet is the right place to get this information from. <S> With a 3-wire Y configuration, you can go thru 12 steps per phase. <S> Each wire can be forced low, forced high, or left open. <S> Walk thru the sequence <S> and you will see there are 12 steps as the field rotates thru one phase. <S> This scheme wouldn't work with a delta configuration because you wouldn't be able to achieve some of the combinations of full, partial, and no current thru each of the windings in the desired directions. <S> A nice side effect of this configuration and using 12 drive steps is that a wire is never switched directly between active high and active low. <S> In other words, proper drive automatically includes dead time between the low and high side drivers being on. <S> I recently did a project with a 3 wire brushless DC motor with the coils connected in a delta. <S> I measured the center point for each of the 12 drive steps, and they were quite evenly spaced. <S> This was a VCR tapehead motor being repurposed as a proof of concept test by the customer. <A> Most brushless DC motors used for RC hobby use are Delta wired. <S> Delta wiring provides a higher KV value and lower torque by a factor of 1.7 when compared to Wye connection. <A> Wye/star can be both 3 or 4 wires. <S> Search online wye/star and delta 3 phase configuration and directly go to images. <S> Never substitute lingoes for pictures if you can ever help it.
|
Delta configuration by its design can only be 3 wires.
|
LM317 to create constant current of 2mA? I have a circuit where I want to have a constant current of 2mA through a variable resistor. I've been told that I could probably use a LM317 as a current regulator, with one resistor on the ouput. But I've read some places that the LM317 takes minimum 5-10mA load to function correctly. How can I achieve a constant current output of 2mA when I don't know the resistance of the variable resistor? The input voltage is about 2.755V. Output voltage doesn't matter, just the current. Here's an image to my feeble attempt at a schematic: <Q> note: <S> question was originally about a current limiter <S> You don't need the LM317 to create a current limiter, a few discrete components will do: <S> For a limiting at 2mA you select a 330\$\Omega\$ resistor for \$R_{SENSE}\$. <S> If there flows 2mA through it Q2 will start to conduct and reduce the base voltage of Q1, so that its current is cut off. <S> edit <S> (re changed question) <S> Maybe you're focusing too much on the LM317. <S> If you need a constant current you could use the LM234 which is a programmable current source for up to 10mA. <S> You set the current with a resistor. <A> Minimum operating current for an LM317 depends on the difference between input and output voltages. <A> You don't necessarily need the LM317 to do this. <S> A basic way to do this is with a current mirror, which is shown below. <S> Your input is on the left (V1 at 2.755V as you have specified). <S> The reference of 2mA is set by a resistor Rref (it happens to be 1k, but it depends on your transistor and your input voltage, you can adjust it if you need more or less current). <S> The current which goes through the reference resistor is mirrored onto the (variable) resistive load (which is designated Rload). <S> My version of SPICE does not really simulate potentiometers, but I have used a macro instead to simulate the resistance from 100 Ohm to 1 KOhm in 10 steps (100, 200, 300...1000 Ohms). <S> The current through the load potentiometer is shown below. <S> Different resistances are in different colors; it is small, but the scale on the left goes from 2.095 mA at 100 Ohm to 2.060 mA at 1 KOhm: <S> Notice that there is a small variation (on the order of several percent), but the current mostly stays around 2mA - even though the resistance changes by an order of magnitude. <S> You should look up the Wikipedia article on current mirrors as well. <S> Clearly there is a limited range for which the current mirror will continue to give you 2mA; for example, if you make the load 10 KOhm, it will not work since the voltage across it will need to be 20 V alone (not counting any drop in the transistor).
|
The LM317 with the single series resistor between output and adjust input is actually a fixed current source, not a current limiter. It sounds like what you want is a constant current source, which will force the same amount of current through a variable load (up to the limitation of the input voltage).
|
Do ICs have a shelf life? I understand that many components, such as electrolytic capacitors ( Do electrolytic capacitors have a limited shelf life? ), have a limited shelf life if not used. Other components, such as carbon resistors tend to change values over time while sitting on the shelf. What I would like to know is if ICs also have a limited shelf life and if so, do some types suffer more than others? <Q> ICs as such dont have a shelf life, like milk or so. <S> They do age on the shelf, though, but generally not as fast as when in use. <S> What happens is you have a rising probability of ICs being dead when unpackaged, or dying earlier when used. <S> Oxidation, radiation (both natural and man-made), and chemical degradation of the dielectric, and probably several other aspects, degrade the ICs over time. <S> The effect of these influences largely depends on the manufacturing process and the quality of the IC. <S> A well made IC may be less prone to oxidation, for instance. <S> Older ICs (aka larger structures) have more material to be eaten away. <S> Modern ICs seem to be built with thinner, but more robust dielectrics. <S> All told, the ageing through technology means more. <S> I do have perfectly working 74ls00 that is over 30 years old in an apparatus that is mostly turned off. <S> Would I use it to build something today? <S> Probably not. <S> But then again, from a museum perspective, it is quite important to know how to preserve ICs: <S> Dry with a desiccant, in a metal container which is not radioactive seems to be the best bet. <S> See Aging of Integrated Circuits <A> ICs have a limited shelf life, but that has little to do with the die. <S> It's rather about the solderability of the pins. <S> These are coated and the coating will oxidize with time, which would result in poor soldering. <S> For production quantities your ICs may come in vacuum packaged trays with a "use before" date on them, usually a few months to a year in the future. <A> See JEDEC Standards (020C) <A> As @posipiet said, no. <S> However BGAs and some other packages do need to be kept dry. <S> That's why there is descant in the bag. <S> Once the bag is opened, if you wait too long you need to bake them first. <A> An over looked type of special chips (or chip modules) that other people haven't listed are ones that have other "things" integrated inside of them, such as: 1) battery inside some battery-backed SRAMs, 2) crystals inside real-time clocks, 3) <S> Opto-Isolators <S> (not sure if they age over time on the shelf). <S> In the case of the battery, the obvious draining of the battery over time is an issue, and the case of the crystal is the aging of the crystal may change over time thus losing precision. <A> ICs are made out of a piece of monocristalline silicon that has been doped P or N in selected adiacent areas in order to make junctions. <S> Typical dopings are of one "foreign" atom in 1000 Si atoms. <S> If you take a 1 liter of water in a jar and put two drops of color (say one red and one black) after a certain amount of time the color will diffuse all over the jar and a sort of uniform brown color will be seen. <S> That amount of time goes linearly with time and exponentially with temperature. <S> So if you keep your spare ICs in -18°C refrigerator their shelf life will be exponentially longer.
|
Some ICs have dielectrics than can be more prone to aging. It depends in the IC packaging , if the IC is MSL1 (Moisture Sensitivity Level 1) , the shelf life is unlimited.
|
What does #if 0 do Today I started to use MPLAB X to program my PICs, and found a code template, with multiple files and spots to fill in code. Before I have had a single file with my code in it. In this template, where I am supposed to put my Configuration bits, there is following text: /* TODO Fill in your config bits here. Remove #if 0 to embed config words. */#if 0/* General syntax for configuration word 1 - Check your device .h filefor an up to date listing of available macros.*/__CONFIG(FOSC_INTOSC & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & BOREN_OFF);/* If the device has multiple configuration words, the second macro definesthe second configuration word. Again check your device .h filefor an up to date listing of available macros. */__CONFIG(WRT_OFF & PLLEN_OFF & STVREN_OFF & BORV_19 & LVP_OFF);#endif I dont really understand what the "Remove #if 0 to embed config words." means... This is propably something really simple. I tried googling, and searching the compilers manual, but didnt get any good results. From what I can understand, the code in between #if 0 and #endif never gets compiled. What does this embed mean? Does it have something to do with setting the config-bits in code vs. afterwards? <Q> To expand a bit on #if 0: It's essentially a hack to allow for multi-line comments. <S> The preprocessor, which runs before the compiler does, will remove everything between #if 0 and the matching #endif. <S> One reason it's used instead of / <S> * */ style comments is that you can enable the entire block simply by changing it to "#if 1". <A> Yes. <S> What does this embed mean? <S> Does it have something to do with setting the config-bits in code vs. afterwards? <S> Config bits are a special programmed register in the PIC that determines operation of oscillator, brown-out detection, + other things. <S> From one of the reference manuals : (the __CONFIG macro in C maps to the corresponding directive in assembly) <S> MPASM’s <S> CONFIG Directive Microchip <S> ’s assembler, MPASM, has a nice feature that allows you to specify, in the source code file, the selected states of the configuration bits for this program. <S> This ensures that when pro- gramming a device for an application the required configuration is also programmed. <S> This mini- mizes the risk of programming the wrong device configuration, and wondering why it no longer works in the application. <A> Your exactly right, the code in between the #if 0/#endif is never compiled. <S> Removing the #if 0/#endif will include the __CONFIG macros which will enable those bits in the PIC's configuration bits.
|
It's another way of commenting out a block of code. From what I can understand, the code in between #if 0 and #endif never gets compiled.
|
What operating systems have been ported to Cortex-M3? I am working with an ARM Cortex M3 (specifically STM32F217IGH6). Are there any OS that have been ported to it? <Q> There are many open source options: <S> QP BeRTOS <S> ChibiOS Contiki <S> OS <S> Free RTOS <S> Micrium uC/OS-II eCos <S> NuttX <S> Most of the above listed have commercial versions as well. <S> I didn't list the strictly commercial RTOS's that are out there, as I assume you are more interested in open source offerings. <A> FreeRTOS is a popular choice. <S> http://www.freertos.org/portstm32iar.html <A> We have used Rowley's CT (started and dropped very fast) and FreeRtos (recommended) in M3s before. <S> Commercial but reasonable. <S> Also there is M3 specific OS out there called Cocox , looks neat but something bothered me and didn't give it a detailed go. <S> While I was looking at this, I guess, I felt it was too new to take the plunge, perhaps now it is a different story. <S> (14 months ago). <A> Freescale has ported MQX to its line of Kinetis microcontrollers . <S> The line includes Cortex-M4s and Cortex-M0s. <S> Freescale provides a license for MQX when used with Kinetis. <S> I am not sure it will run on a non-Kinetis Cortex out of the box. <A> In addition to providing a commercial (but very low-cost) software distribution and various Cortex-M eval boards / system-on-modules (SOM), Emcraft also distributes the full source of its U-Boot and uClinux kernel ports for Cortex-M3 and M4 at github.com./ <A> http://www.highintegritysystems.com/ <A> I know about uClinux as it's used in my university, and another one of which I don't remember the name now. <S> You can check this page for some links, but this is much more detailed about available platforms; some of them refer to specific microcontrollers, but you can find what of them are CM3: <S> TI Stellaris, ST STM32, NXP LPC1700 are some. <S> EDIT : I didn't read about the specific microcontroller; as I said, uClinux is used on STM32 microcontrollers in research projects at my university. <A> This is a pretty big RTOS list https://en.wikipedia.org/wiki/List_of_ARM_Cortex-M_development_tools#Real-time_operating_systems
|
Emcraft Systems specializes in providing a Linux (uCLinux) distribution for Cortex-M3 and Cortex-M4 MCUs: www.emcraft.com SAFERTOS and OPENRTOS have been ported to Cortex-M3 from High Integrity Systems, and you can evaluate them for free. I have been very interested in ChibiOS but haven't had a chance to try it out.
|
Is it true that a SD/MMC Card does wear levelling with its own controller? I can't find any reliable information about this. I don't have the full specification of the SD/MMC Card hardware. Is it true? My high-level application doesn't need to be concerned with wear leveling when working with these cards? EDIT Could someone confirm that wear leveling is guaranteed by the SD specification? I want to be sure, because it looks like most vendors do it, but it is not required by the specification. <Q> I work for a company that used to be a member of the SD association, we are familiar with the 2.0 (SDHC) spec. <S> That is completely dependent on the SD manufacturer to handle that if they so choose. <S> We have seen that some likely do, while others very much do not (beware the super cheap knock-off SD cards). <S> SDXC may have changed that to include wear leveling, but I am unsure of that. <S> Unfortunately the only way to really show that is to get your hands on the official spec. <S> You can find it online most likely, but the SD association really wants you to pay for it. <S> As a side note, taking a 2GB card and writing it beginning to end over and over again averages about 10TB before the card is dead and no longer is writable. <S> Also, SD cards will not let you know <S> when data is bad, i.e. wont return an I/O error like a PC harddrive will. <S> This might not be an issue for embedded designs as 10TB is a LOT of data, but it could be a factor for someone. <A> It's true! <S> MicroSD cards contain a NAND flash chip bonded to an (ARM) microcontroller encapsulated in some black plastic. <S> http://www.bunniestudios.com/blog/?p=898 explains. <S> At the end of the follow-up post http://www.bunniestudios.com/blog/?p=918 Bunnie posits integrating the controller probably costs less than testing the flash ahead of time. <S> Quoting SanDisk's SD card product manual: "1.9 Wear Leveling. <S> Wear leveling is an intrinsic part of the erase pooling functionality of the SD Card, using NAND memory. <S> " You can read the whole thing in the datasheet for a SanDisk brand card . <A> Yes, SD/MMC cards have controllers that do wear leveling. <S> If they didn't, you could destroy one in a matter of minutes with the wrong write patterns. <S> That's actually a problem for some embedded projects. <S> There's absolutely no way (apparently) to know what sectors might be wear leveled at any time, so a power cycle at the wrong time can destroy data anywhere on the card, no matter where you THINK you're writing. <S> (don't ask how I know :) ) <S> SD cards must be used with a system that guarantees a clean system shutdown (or at least that writes are allowed to complete), or data loss will (eventually) result. <S> EDIT <S> The problem is that the wear leveling process is entirely hidden. <S> ANY sector on the disk could be moved at any time (swapped with the page written), and if power was to fail in the middle of that process that random sector could get corrupted. <S> While there ARE reasonably safe ways to implement this move, it's not in any spec <S> so you can't trust that the card will do it. <S> You could test one card, have it work, then the manufacturer could change the implementation without changing the part number and you're screwed. <S> From testing, my SD cards' controller does NOT do this in a safe manner at all. <S> I may look into a "high reliability" SD card I saw advertised specifically for power failure tolerance... <S> but then you have to trust the manufacturer to do that correctly, and I don't. <S> I really want direct control over page erases. <S> I'm still trying to figure this one out. <A> Any type of SD card using any type of conventional NAND flash memory is going to have to use some type of sector virtualization, since no conventional NAND flash device can support erasure of individual 512-byte sectors, and no conventional NAND flash device of significant size would be able to yield performance that was within an order of magnitude of being even marginally acceptable if every attempt to write a sector required the device to copy all the sectors in that sector's erase block (even to RAM), then erase the block and write all the sectors back. <S> Most sector-virtualization techniques are inherently somewhat wear-leveling. <S> I would expect the biggest issue of variance between quality devices and knock-offs will be the extent to which a device actively tries to even out the leveling between blocks, versus simply using pseudo-random block allocation and hoping that will yield acceptably close-to-uniform results. <S> In practice, I would expect that even random/hope-for-the-best allocation would be adequate in most cases. <A> Sandisk have a white paper that explains the wear levelling logic in their cards, and goes on to give estimates of the card's life under a number of scenarios. <S> Executive summary: unless you are hammering the card non-stop, it will last decades. <A> Its interesting to note that despite this a lot of devices do corrupt SD and microSD cards especially high density ones if the battery is low or the phone crashes/shuts down/etc. <S> I suspect that the problem is inadequate regulation of the voltage supply as this is well known on some cards (cough Ad t /cough) to result in the phenomenon of an unreadable card on certain external readers but works fine on the micro variety supplied by some computer shops. <S> I am in the process of recovering a card at the moment with this fault, strangely enough most of the data is recoverable but some sectors are not though this changes on each attempt. <S> Could the wear leveling itself be at fault? <S> (yes tried multiple readers, same fault!) <A> Also had some success "nuking" zombie cards, ie ones which won't complete a format or are read-only. <S> Only works on a small percentage but they are much more sensitive than most "official" guidelines to the effect. <S> A test card thus treated lasted a full four months before failing again, if it hadn't been for the device it was used in supplying noisy voltage the lifetime might have been longer.
|
The SD card spec has NO entry for wear leveling.
|
Debouncing this Rotary Encoder Switch I have this rotary encoder and I am not quite sure how to debounce the internal push button switch (shown in the SW02 diagram). Any help would be appreciated, I'm a noob with this stuff. EDIT I would like to implement a hardware debounce My primary problem is that I need to have my VCC on pin 5 and my ground on pin 3 in order to have my LEDs also work. And I don't know how to make the debounce work properly with that setup. <Q> Note: You can replace the op-amp assembly with a schmitt-trigger inverter or buffer, to make your life easier. <S> Anything with some input hysteresis will work. <A> To effectively debounce an input, one must decide how the debounced logic should interpret various signals <S> (e.g. what must the input signal do to be regarded as a "high", and what must it then do to be considered a "low"). <S> In many cases, if precise timing isn't required, the simplest way to debounce a push button is to simply sample it periodically. <S> If the sampling interval exceeds the longest bounce time, but the duration of every push, minus its bounce time, exceeds the sampling interval, then every button push will register exactly once. <S> If more precise input timing is needed, another useful approach is to have an input transition trigger a timing circuit, and ignore the state of the input until the timer expires (one may if desired ignore the input for different lengths of time following a press and release). <S> This may in many cases be done fairly conveniently in software, even if the input is wired to an interrupt pin (the pin's interrupt service routine disables the pin's interrupt, but sets up a timer whose interrupt service routine will re-enable the pin's interrupt). <S> Another hardware approach if one has both normally-open and normally-closed contacts available, is shown here . <S> There are quite a few variations, based upon whether one wishes to run +5 and ground out to the switches and have one return wire, or whether one would rather run ground only and have two return wires, or use switch-mounted diodes and have two wires total. <S> These approaches can be especially advantageous when interfacing to low-power circuitry switches that may stay for a long time in each state, since current only has to flow through the switch when it changes state. <S> Further, they are essentially immune to even the most horrible switch-bounce conditions imaginable <S> (it's theoretically possible that just the 'right' pattern of switch bounce could trigger metastability, but the probability of that happening is extremely low). <S> The only disadvantage is the requirement that the switch have both normally-open and normally-closed contacts. <A> Maxim MAX6816 and Atmel U6032B, for example. <S> The image comes from application note 287 , which has more details.
|
There are also specialized switch debouncing ICs, which have a hardware counter to determine the debouncing delay.
|
Cleaning circuit boards for high impedance Colleagues, EEG signals typically have high source impedance. Amplifiers in the EEG circuits have high input impedance too. The signal is DC-coupled to the amplifier. One problem is that leakages across the surface of the board can distort the signal. Guard rings help prevent that. Contamination on the PCB increase leakages. So, I would like to clean the contamination. Could anyone recommend a procedure for that and what solvents to use? The board is FR4 with solder mask and silk screen. SMT components. Cleaning will be done in an industrial facility, which is equipped for handling and disposing solvents. We have fume hoods. UPDATE: Just added a bounty to this question. What I'd like to get is a fairly detailed procedure. Just throwing names of chemicals at this question will not count. UPDATE: Bounty period had expired. Still looking for the procedure. Didn't get answers I could award the bounty to. The tips which got posted so far might be useful for somebody in the future. More tips about board cleaning here (parallel thread on another forum) . UPDATE: Found more systematic insight into PCB cleaning ( here and here ). <Q> This may be deemed a comment more than an answer, but just as important as which solvent (if any) to use -- we wash our boards with critical circuitry in RO (reverse-osmosis) water because it is free of salts + other contaminants -- make sure the boards are dried thoroughly. <S> Surface-mount chips often have a very thin gap between the chip and the board which can act as a capillary to retain water for days. <S> So drying thoroughly is important. <S> I'm not sure what works best, but in one case we put our circuit boards in a thermal chamber at a high temperature (probably 60-80 C; I forget) and low humidity for a day to drive off the water. <A> Very clean (deionized) water is actually a pretty good solvent for the nasty ions that allow conduction. <S> However, this all misses the point. <S> Even if you clean the boards really well and get the necessary high impedance between adjacent traces, then what? <S> Without some way of making sure the board stays clean, the initial cleaning is rather pointless and actually gives a false sense of performance. <S> Then there are things you can't clean afterwards. <S> If the fiberglass isn't exactly right or isn't treated exactly right, ions can get trapped inside it that external cleaning isn't going to fix. <S> The better answer is to design the board to tolerate some amount of dirt. <S> As you said, guard traces is one way. <S> In rare cases you may need special glass standoffs and the like, but with good design you can usually mitigate the problem so that the board still works over a reasonable lifetime in the real world. <A> Might it be less expensive to just attach amplifiers with low output impedance near the biological end of the EEG <S> leads? <S> Powered by itty-bitty rechargeable batteries? <S> You would have to put the ends of the leads in a charger when they're not in use, but a least they wouldn't need cleaning or would be easier to clean. <S> Hmm... I also wonder why they couldn't just be powered by a source that took measures to filter out noise from the source in your range of interest, or filtered it's own noise (choke?) <S> out of the signal line. <S> I'm just a youngun, <S> so... <S> yeah, please correct me if I'm wrong.
|
You can get pretty good results by washing a board in a normal dish washer, then following up with a deionized water rinse.
|
Diagnosing cause of electrolytic capacitor failing I am hoping somebody could help me diagnose the cause of failing electrolytic capacitors in a circuit. The context is a charger circuit, more specifically its power supply unit: Given a diode bridge rectifier that is connected on one set of terminals to the mains via a filter circuit and on the other side to two electrolytic capacitors connected in series. Parallel to each capacitor are two discharge-resistors. (And of course the actual consumer circuit.) The problem is, one of the two capacitors in series, the one connected to the - terminal of the diode bridge, explodes. This fault occurs since the device was subjected to intermittent AC-supply: unstable frequency, probably over- and under-voltages. I am wondering where to search for the problem: diode bridge? - I played around a bit with spice and the only way I could get reversed polarity on one of the capacitors was to assume two diodes short-circuited and the other two became isolators. This does not seem a very likely failure mode... circuit fault after the power supply unit? - Any hint on what to look for? The consumer circuit is non trivial... The capacitors in question were 200Vdc, 1000uF for a device to be plugged into 230Vac. I replaced both after the first failure, plugged it in and immediately the same capacitor blew again. Unfortunately I do not have access to an oscilloscope at the moment but only a digital multimeter. Many thanks! Edit 1 I took a closer look at the PCB and got the following partial schematic. The main transformer is in the top left hand corner. The PWM IC chip etc. are connected to the hanging MOSFET the the bottom of the schematic. The TRIAC is part of a STR 81145, which automatically switches to voltage doubling mode if input is 115V. (It takes it's supply from the positive rail as well.) After removing the capacitors in question, C7 & C8, the resistance to the positive and negative rails are equal to the 50kOhm set by the voltage divider. <Q> 230V AC swings between +230V and -230V RMS, but that means it reaches +/- <S> 325 V peak-to-peak. <S> With a rectifier, that's between 0 and 325V, which split on two 200V capacitors would be just about enough -- except the capacitors have to be perfectly matched for that to be true. <S> If there are differences in manufacture, then the ESR of the capacitors will be slightly different, and one will see more voltage than the other. <S> Also, there may be a max amperage for the capacitor, and given that a capacitor is akin to a short when it's empty, you may get too much surge current (check the ripple current rating of the capacitor data sheet.) <A> In this case, if one of the capacitors gets shorted or something, the other sees the full supply voltage and goes explodes. <S> Replace both capacitors with ones that are rated for more the full power supply voltage, assuming there is enough space in the device. <A> It seems likely that the centre point of the two capacitors connects to the equipment concerned and that this centre point is connected to the positive rail by a fault - possibly due to a shorted switching transistor or a shorted diode - see below. <S> You do not say what is connected to the capacitors, but usually such an arrangement is a bridge circuit with the capacitors forming one centre tapped "leg" of the bridge and two transistors forming the other "leg" with the load connected between the two bridge legs. <S> Look for two largish transistors possibly MOSFETS, probably on a heatsink and probably the same model / part number. <S> The one which connects to positive will quite possibly be short circuit. <S> Note also the reverse diode possibility as described below. <S> The diagram below shows the general arrangement diagrammatically - here if Q1 is short-circuited it will destroy C2. <S> The diagram below is functionally the same but more complicaed and more like what you'd see in practice. <S> Again, Q1 is short-circuited <S> it will probably destroy C2 BUT the diagram is harder to follow - trace the path from +ve via Q1 then on to C2. <S> Shorting the reverse diode across Q1 will achieve the same result. <S> Both diagrams are from here
|
The two capacitors that were connected in series are probably rated for lower voltage than the one that the power supply actually produces.
|
Should NC-Pins of IC connected to ground through a resistor to prevent noise? I wonder if unused pins of an IC, lets say an NE555 f.e., should be connected to ground via a resistor to prevent noise or not. I have an AVR with analog inputs and just realized there's huge noise, if not connected. So I'm not sure if it is OK to leave unused Pins of other IC's like the 555 Timer unconnected, or better pull them to ground via 10kΩ or 100kΩ resistor? In other words: could it get trouble, if unused pins of a ne555 left open? <Q> If a pin is labelled N/C by a manufacturer then this almost always means that it should be <S> NOT CONNECTED to anything. <S> ALL standard 8 pin xx555 timer IC have NO NC pins. <S> ALL pins have an assigned role. <S> Some should be left open circuit in some designs - but that is done as part of the design, as required. <S> Finding an NE555FE datasheet proved wondrous hard. <S> This page shows NE555FE and NE555F. http://pdf1.alldatasheet.com/datasheet-pdf/view/17984/PHILIPS/NE555F.html <S> The NE555FE shown is a standard 8 pin package pinout and has NO NC pins. <S> The NE555F is an abomination which I have never seen before and which I did not know existed. <S> If you have such an IC you should drive a stake through it's heart, wrap it in garlic, bury it at the nearest cross roads and/or send it to a local technology museum. <S> I would also love a sample for my museum. <S> But, I'd advise using one of the many many many other 8 pin ones as this is an orphan. <S> In some cases, connecting such to ground or supply is 'fatal'. <S> Some modern LEDS have metallic connections on their thermal pad which MUST NOT be connected as if they were LED Cathode or Anode, as they are neither, but are not electrically isolated. <S> Doing this seems very very unwise, but it's done. <A> When deciding what to do with NC pins, it may be helpful to consult the data sheets of the chips in question and those of possible alternate parts. <S> It's possible that a pin might have no die connection on a particular part, but perform some potentially-bothersome function a similar part. <S> If the latter part becomes more common in the marketplace, it might be desirable to allow substitution; if the pin is used for routing, or is strapped in a way inconsistent with that other part's function for it, substitution could be difficult. <S> On the other hand, in other cases it may be a good idea to make provisions to pull an unused pin high or low ( <S> e.g. with an optional resistor) or, occasionally, to strap it in some other way. <S> For example, if one is using a particular size of parallel flash chip which has some NC pins, and if the corresponding pins on the next larger size are address pins, it may not be a bad idea to examine the data sheet of the larger chip and determine whether the pins could be connected in such a way as to permit the larger and smaller chips to be used interchangeably. <S> As larger chips become more common, they can sometimes become cheaper than smaller ones; even if one wouldn't have any use for the extra capacity of the larger chip, if it would be suitable in the design it may be worth allowing it to be used for at least the smaller capacity. <A> Had the same problem with the Microchip MRF24WB0MA RF transceiver, which has several NC pins, which I diligently tried not to connect. <S> Howeverm due to the difficulty in soldering this part (IMO), some of the NC pins got grounded through solder slivers, and the chip subsequently failed to initialise, sinking current heavily until it failed altogether. <S> So unfortunately, NC does not imply that the pin is not connected in the inside, simply that it should not be connected from the outside.! <S> Maybe NC pins are used in debugging / production test? <S> Otherwise why have them there? <A> If the datasheet marks the pin as N/C or "do not connect" then don't make any connection. <S> Outputs in general should be left floating. <S> For input pins you need to refer to the datasheet's recommendations. <S> If the input is a high-impedance digital input for example, then a pull-up or pull-down is usually required. <S> Of course if there is already an internal pull-down, adding an external pull-up resistor may not a good idea - hence the need to consult the datasheet. <S> Unused op-amp or other analogue inputs should normally by tied either directly or through a capacitor to the reference rail. <S> Some pins may need special attention. <S> For example the NE555's CTRL pin is at a defined dc voltage and should be bypassed to 0V with a capacitor if not used (as per the datasheet).
|
It depends on the characteristics of the pin. I have seen pins which are labelled NC on a device's datasheet but which DO have internal connections. Depending upon the chip and the system design, it may be better to strap them high or low, or it may be better to strap them to some other address bit. If you had one of these and insisted on using it then leaving the NCs disconnected would be safest.
|
Low-cost, low-current solution for dropping 1V from a battery I have a 3 x 1.5V NiMH battery pack giving a supply voltage in the range [3.0V ... 4.5V] depending on the remaining capacity. In order to prolong battery life I need to cut power from the entire PCB except for the MCU sleep module that consumes a few uA. The catch is that the sleep module is rated at [1.8V ... 3.6V] and I cannot afford an LDO for this purpose. Is there a way to achieve a voltage drop between 0.9V and 1.2V without any significant current draw? <Q> This microchip appnote suggests in section 8-3 to use some rectifier diodes in series as shown in Figure 3-1, which converts a 5V supply into an approximately 3.9V supply. <S> Each diode will give you a voltage drop, depending on the type of the diode and the current through the diode. <S> Note the inclusion of R1, which the appnote mentions is present to keep the voltage at the PIC MCUs \$V_{DD}\$ pin from exceeding the maximum \$V_{DD}\$ at minimum loads (typically when the PIC MCU is in Reset or sleeping). <S> Depending on the other circuitry connected to \$V_{DD}\$, this resistor may have its value increased or possibly even eliminated entirely. <S> Diodes D1-D3 must be selected so that at maximum load, typically when the PIC is running and is driving its outputs high, the voltage drop across D1-D3 is low enough to meet the PIC MCUs minimum \$V_{DD}\$ requirements. <S> The downside of this approach would be that you will lower the voltage even when you are below the 3.6V, so you will not have the full operating range. <S> Be extremely careful when selecting diodes; \$V_F\$ is not constant with respect to current or temperature. <S> Here's an example relationship from the Fairchild 1N414 datasheet : <S> The forward voltage is proportional to the log of the current until about 100mA, when it begins to increase more rapidly due to carrier saturation. <S> You mention that your device has a minimum current of a few μA, for which you probably paid dearly. <S> You could increase this quiescent current to a little more than 20 μA with a 220 kΩ resistor and put 2 diodes in series to get 450mV drop per diode and a safe output voltage of 3.6V when your batteries are at 4.5V. <S> Of course, when the MCU wakes up and draws more current (assuming ~10mA) <S> the voltage drop will go up to about 2⋅700mV=1.4V. Instead of operating from your batteries in their full charge range, you'd only be able to discharge your batteries to 1.8V + 1.4V <S> / 3 = 3.2V / <S> 3 = 1.06 V/cell. <S> There's some optimization to be had in increasing or decreasing the resistor value and diode count, but it's difficult to get good results as you could with an LDO. <S> Conclusion <S> : Don't use this approach unless your application is extremely cost-sensitive! <A> A common diode in series is not a good idea, <S> like PetPaulsen also showed: the voltage drop varies too much with current. <S> A voltage reference diode like the <S> LM285 <S> in series with your battery is a better choice if your current is <S> maximum 20mA. Voltage drop is pretty much a constant 1.235V from about 3\$\mu\$A to the maximum of 20mA. <A> NimH at low current will provide say 1.1 - 1.35 Volt out. <S> Voltage will drop below 1.3V/cell early in discharge range. <S> At low Iout 1.1V is close to exhausted if very good cell life wanted, but you can go substantially lower. <S> If you design 3.3-3.9V or say 3.0 - 3.9V you will recover the large majority of available energy. <S> You do not say what operating current drain is or acceptable vsupply when operating, and these will influence the acceptable design. <S> Charging voltage max per cell depends on max current charge rate. <S> At moderate charge rates Vmax_chg is typically 1.45V (3 = 4.35V) and 1.4V can be used with minimal capacity loss. <S> You can buy "zero gate voltage" FETS which used isolated charge storage to bias the gates to "just not on" at 0 volts \$V_{GS}\$ so that the source voltage then equals the applied gate voltage. <S> " <S> A bit of playing" would yield a solution similar in performance to the above IC solution <S> iQ wise but utterly inferior voltage accuracy wise. <S> The IC provides an immensely sophisticated and accurate result and is well worth considering. <A> One 1N4007 will drop about 0.85 volts in the forward direction. <S> It costs watt-hours, but not current. <S> Just because you supply 4.5V into the batteries doesn't mean you actually get 4.5V across the batteries. <S> They will keep their charge state voltage, plus some voltage across the resistance of the hook-up. <S> The rest of the voltage will be lost across the circuitry going into the batteries. <S> The lower the battery charge, the higher the current they want, and thus the more losses you will have in the circuitry around the battery. <S> Thus, the batteries won't get to 3*1.5V until they are completely full -- and you probably want to cut off before then <S> , say at 3 <S> *1.4V. <S> It's likely your regulator will buckle and provide less than 4.5V way before the batteries would start saturating and push the voltage up ( <S> but I don't recommend pushing it that hard.) <S> The only thing that may cost less watt-hours than a diode to drop the voltage is a highly efficient switching power regulator, which is going to both cost a lot of money, and take a lot of board space.
|
If a reduction of battery voltage range by a fixed amount or ratio was acceptable then an FET with exceptionally high value gate resistors could accomplish this.
|
Wrong outputs in VHDL entity I have lessons about VHDL in one of my university class and I have to write simple entity which will generate clock from 1MHz source. I'm using CoolRunner-II CPLD Starter Kit with ISE Webpack 13.1. When I run simulation of my code, I've got odd results. I have no idea, where the problem is. My VHDL entity looks like this: entity clock is Port ( clk_in : in STD_LOGIC; clk_1M : out STD_LOGIC; clk_500k : out STD_LOGIC; clk_100k : out STD_LOGIC; clk_1k : out STD_LOGIC; clk_1hz: out STD_LOGIC);end clock; Input is 1MHz signal from oscilator and I want to create 1MHz, 500kHz, 100kHz, 1kHz and 1Hz output signal. I defined several signals: signal c100k: std_logic_vector(3 downto 0) := (others => '0' );signal c1k: std_logic_vector(9 downto 0) := (others => '0' );signal c1hz: std_logic_vector(9 downto 0) := (others => '0' );--signal c500k_out: std_logic := '0';signal c100k_out: std_logic := '0';signal c1k_out: std_logic := '0';signal c1hz_out: std_logic := '0'; And finally, my code is: process (clk_in) begin if clk_in'event and clk_in = '1' then -- 500kHz c500k_out <= not c500k_out; end if;end process;process (clk_in) begin if clk_in'event and clk_in = '1' then -- 100kHz c100k <= c100k + '1'; if c100k = X"A" then c100k <= (others => '0' ); c100k_out <= '1'; else c100k_out <= '0'; end if; end if;end process;---- Code for 1kHz and 1Hz is same as 100kHz--clk_1M <= clk_in; -- Clock source 1Mhzclk_500k <= c500k_out; -- Clock source 500kHzclk_100k <= c100k_out; -- Clock source 100kHzclk_1k <= c1k_out; -- Clock source 1kHzclk_1hz <= c1hz_out; -- Clock source 1Hz When I run simulation, I got this odd results: What is wrong with my code? <Q> The first thing I see, which isn't likely causing your problem, is a lack of any kind of reset. <S> ModelSim does not automatically declare all signals to be '0', and trying to say s <= not s when s is not 1 or 0 is not going to give you what you want. <S> I see you declaring them all '0' at the top but a proper circuit would have a reset input that you briefly drive at the start of your simulation. <S> Your basic counter process looks wrong; basically when the count reaches ten you're outputting a '1' and for the other 9/10ths of the time you're outputting a '0' (for the 100k example, the 1Hz example would be a 1us pulse high and a 999us low time. <S> I think what you want is something like this: gen_clk100: process(clk, rst)begin if rising_edge(clk) <S> then if count = 10 <S> then clk100 <= <S> not clk100; count <= 0; else count <S> <= count + 1; <S> end if; <S> end if <S> ; if rst = '1' then clk100 <S> <= '0'; count <= 0; end if;end process; Note several things: <S> I'm not incrementing all the time. <S> I increment if the count is not at its max, and increment otherwise. <S> I'm toggling the output clock <S> when the maximum count is reached I've included an asynchronous reset (with synchronous clear) -- this ensures that your signals initialize correctly and have no metastability problems when reset is released. <S> You also mention that the other sections are the same. <S> I think you're having a problem with multiple drivers like Yann mentioned. <S> Check and double-check your code to make sure you are not assigning the output in two different processes, because that is exactly what the simulation is saying you're doing. <S> Better to either make a generic counter module or... <S> Why so many counters? <S> All your frequency dividers can be handled with a single count and then "peeling off" the conditions to do the divisions you're interested in. <S> You could also have a single counter and use the mod (modulus) operator to handle each divider case. <S> Finally, I'd also use real or integer types for the count instead of std_logic_vector <S> s <S> but that's just me. <A> You are assigning signals clk_1M, clk_500k, clk_100k, clk_1k and clk_1hz in different processes in the test bench. <S> At the same time you have instantiated your DUT which is (as Yann Vernier suggests) driving the same signals. <S> Uncomment the test bench processes (except for clk_in!) <S> and you will be fine. <S> Furthermore I would advice you to add an asynchronous reset signal to the clock entity to make it synthesizable. <A> You have multiple drivers. <S> They are not shown in your posted code snippets, but are obvious in the non-snippetized files . <S> Looking at the file test_clock.vhd you instantiate your unit under test. <S> In the port map you assign an output of clock() to clk_1M. <S> Later, you have this chunk of code: <S> clk_1M_process : <S> process begin <S> clk_1M <= '0'; wait for clk_1M_period/2; <S> clk_1M <= '1'; wait for clk_1M_period/2; <S> end process; <S> This code also assigns a value to clk_1M-- <S> therefore you have multiple drivers on your signals. <S> Other signals have similar issues so I won't go over them here. <A> When they agree, you get a logic level, but whenever they disagree you get X - a conflict in simulation, which is probably not synthesizable (if it were, it would mean a chip-frying short). <S> One guess is that you may have made a mistake somewhere when copying that clock divider process, and would be well served by a component you could instantiate instead.
|
I don't see it in the code snippets, but the simulation looks a whole lot like you have multiple drivers for some signals.
|
How to utilize HDMI port on FPGA (basic) Two questions. I have a Xilinx Spartan 6 FPGA which only has HDMI ins and outs. Is there some sort of guide or pre-written code that I can use to start sending images to the screen? I have no idea how to begin and I have not been able to find resources. Second, the reason I'm doing this is because I want to use and modify Atari 2600 code a guy implemented on a Spartan 3E with VGA. Is it even possible to easily adapt the video aspect of my project? Any help, resources, or advice would be greatly appreciated! <Q> The Atlys board uses TDMS inputs, so you'll need a HDMI decoder which takes those inputs and produces VSYNC, HSYNC, DE, and DATA. <S> Xilinx details the DVI encoding and decoding process in a couple of application notes. <S> These each come with example code, xilinx login required: TMDS Video Interface on Spartan 6 Source-Synchronous Serialization and Deserialization <S> The example code is in verilog, although converting the top level to VHDL if you prefer is a relatively trivial exercise. <S> Here's a figure taken from the first application note showing the basic premise of the receiver: <S> Since the Spartan 6 has got built-in SERDES hardware, these can be used as part of the deserialisation process. <S> There is a synchronisation process which recovers the clock and ensures that the channels are all in-sync. <S> Finally, 8b/10b decoding is applied to produce the RGB channel data. <S> Once the video signals have been recovered, You can then forward theses signals on to whatever processing you want to do, or on to a encoder which will send them out of the HDMI ports again. <S> If you have the TFTMOD display, then forwarding the data out to the display is as simple as connecting the DE and DATA signals to the appropriate FPGA pins. <S> The TFT board reference manual is useful for timing info about the display, although I found that the deserialiser output timing was fine. <S> You can use the UCF file from the this project , for the constraints for the HDMI, and <S> this project for the MODTFT constraints if you're using that board. <S> The only thing to note is that the Xilinx example doesn't handle EDID info. <S> If you're just using the board to forward data, then you can route the EDID lines right through and call it a day. <S> Other scenarios may require handling the EDID data on the FPGA. <S> Basically it's just I2C. <S> The opencores I2C interface <S> is pretty solid, or you can code your own. <S> As far as I know, the wikipedia table about the data format for EDID 1.3 is accurate. <A> Just to complement what a previous answer has explained: A DVI/HDMI transmitter can be a good starting point since you can get straight some video. <S> HDMI/DVI Video transmission over TMDS link is logically divided into stages as shown in the Figure 1: <S> TMDS Transmitter Design of Implementing a TMDS Video Interface in the Spartan-6 FPGA TMDS encoders: convert pixel data from a video source, HDMI Auxiliary/Audio data, and HSYNC and VSYNC into three 10-bit symbol streams <S> The serializers (10:5 Gear Box and OSERDES2 5:1 Convert) perform in two stages a 10-bit parallel-to serial conversion on all three streams and then send them out onto threechannels of differential output pairs (TMDS buffers). <S> Both stages require a clocking circuitry to generate (PLL) and distribute (BUFPLL,BUFG) <S> the clock signals (with frequencies of the pixel reference clock andits multiples) properly. <S> Of course, the core of the transmitter are the Encoders block. <S> You can start with the DVI encoder due to its simplicity compared to the HDMI one. <S> Both HDMI and DVI have many aspects in common, including the physical TMDS link, active video encoding algorithm and the control tokens definitions. <S> The application note also provides 2 designs. <S> It sends a color bar generator video across many screen modes which can be selected by the slide-switches. <S> This design is useful because we can change the color bar generator with another video source and still be able to get some video keeping the original transmitter block. <S> I hope this helps! <A> Here is the text of a reference design you can download from the board page you linked to: <S> DSD-0000326 <S> 12/13/11 <S> This zip file contains an EDK demo project that demonstrates using HDMI on the Genesys board. <S> It accepts an HDMI input, buffers the input frames into memory, and then outputs the buffer to another HDMI port. <S> This is implemented using PLB bus. <S> Download <S> http://www.em.avnet.com/en-us/design/drc/Pages/Xilinx-Spartan-6-FPGA-Industrial-Video-Processing-Kit.aspx <S> (click on the support files link, avnet login required). <S> There are probably more reference designs out there for different fpgas as well. <S> Also unless you are implementing the audio or encryption hdmi is basically the same as dvi. <A> The following tutorial, making use of a miniSpartan6, is very detailed and worth a look: http://zerocharactersleft.blogspot.com/2015/04/diy-fpga-based-hdmi-ambient-lighting.html
|
A simple but good for starting is the "SMPTE HD Color bar Generation with Programmable Video Timing". You can also look at the reference designs that come with the Xilinx spartan 6 industrial video processing kit.
|
does a serial port have enough power to drive a comparator circuit? I am trying to use serial port pins to power this circuit. Basically I want to send a voltage high to pin 8 when somebody "opens the box" that this circuit is in. Otherwise, it will send a voltage low when the box is closed. I can detect this in software just fine, my question is with hardware. Will the serial port be able to power this circuit? I looked at the LM339 datasheet and it seems like the current needed is pretty low, but i dont know the serial port's power capabilities. Any advice would be great, thanks! <Q> Your circuit as drawn won't work properly, at least not with an RS232 serial port. <S> The RTS and CTS signals are bipolar with respect to ground, and are expected to meet RS232 levels. <S> If the RTS line goes low, it will go negative with respect to ground and play tug-of-war with the LM339's ESD protection diodes. <S> You'd also need to handle the case where the RTS line stays high (positive) but the comparator needs to provide a negative voltage on CTS, and therefore there's no guaranteed source of negative voltage, meaning you need to have a positive-to-negative voltage converter. <A> If your signal destination implements RI (Ring Indicator), you can get away with it if you use DTR set to true (around -10V) for your negative rail and RI for your output. <S> You will need a pull-up resistor on the comparator output too. <S> The LM339 requires up to 2.5mA supply current at a minimum of 2V supply voltage which is within the capabilities of most RS232 drivers (10mA Isc typ). <S> I have used this technique in the past with PC serial ports which can generate an interrupt on RI change of state. <S> You will also need reverse polarity protection in case the flow control lines power-up in the wrong states as per Jason S's answer. <A> Especially those USB-Serial dongles are called serial for a reason: They don't implement RS232. <S> Where a true RS232 port may often be able to drive a little circuit, modern ports often don't. <S> Would a little device like <S> http://fabiobaltieri.com/2011/12/17/usb-sensors-avr/ <S> be an option? <S> It uses USB, which has proper power and most modern day <S> PC's / servers have a USB port.
|
Many computers today have no serial port or do not fully implement to RS232 specifications.
|
Combining Arduino and LEDs on same power channel http://www.ladyada.net/products/pixel36mm/ Adafruit has a great tutorial on some square LEDs that I would like to use for a project. I have a regulated 12V 5A power supply that I would like to use. According to the instructions, it says to wire the power to the LEDs separate from the Arduino. My question is, how can I wire these things such that I do not kill either the LEDs or Arduino using a SINGLE power supply? I don't want two plugs hanging off the thing I'm making. Thanks. <Q> It's a good idea in general to keep the power for your logic and power devices separated. <S> Motors for instance will generate a lot of noise on your power, and to some extent this may pass straight through the voltage regulator, polluting the microcontroller's \$V_{DD}\$. <S> One way to keep power supplies separated is feed them via a diode from the common power source. <S> Place a buffer capacitor after the diode, sized for the expected load. <S> If the LEDs are controlled statically this should be less of a problem than for motors. <A> The LEDs take 12v. <S> The Arduino takes 7-12v which it steps down to 5v using a voltage regulator - a 7805 <S> I think. <S> You DO NOT want to use the power outs of the arduino board since that will draw too much current and overheat the regulator. <S> You COULD tap the 12v power supply before it goes into the arduino power socket and use that to power the LEDs. <S> You need resistors on the LEDs (unless they are built in - I didn't read the spec closely) otherwise you can blow the LEDs. <A> It is called an 'open collector' or an 'open drain'. <S> http://en.wikipedia.org/wiki/Open_drain <S> Check the image at this page under Transistors: http://www.prolectron.com/elect/ <S> which says "This is an RS232 to Open-Collector circuit. <S> " <S> That is pretty much what you need for driving those LED-modules from 12V supply.
|
You cannot drive LED's attached to 12V directly from Arduino, it requires the use of a transistor or other sort of driver.
|
What electrical anomaly can cause RCBOs to trip in apartments in several buildings at the same time? Once I had a weird electrical event in an apartment building I live in. Suddenly the Residual Current Circuit Breaker with Overload protection (I'm sure it's exactly this kind of device) in the main panel serving my apartment tripped. When I opened the panel it turned out that RCBOs for all the apartments on the same floor also tripped. That looked suspicious and so the next day I inquired with the utility company and they said that dozens of people in several buildings served by the same power substation had the same issue at the same time and the company hotline had an inrush of phone calls. I don't get it. RCBO should trip when either there's an overload or if there's an imbalance between the phase and the neutral behind the RCBO (between the RCBO and the load). Clearly it's extremely unlikely that dozens of people had either of those at the same time, so I assume that was some external event. What electrical event could have caused such effect? <Q> Some RCDs open their contacts when the supplying net shuts off and do not automatically reconnect when the power returns. <S> A brief black-out (say, some 10 ms) may be enough. <S> Your substation may have experienced such a black-out. <S> To be sure, you could try to find a data sheet of your particular model or do a test if you are able to safely turn off the net supplying your RCD. <S> If refrigerators or alarm clocks are connected to such RCDs, such a behavior would be a major annoyance. <S> If machines, stoves or tools are connected, they may remain switched on while unpowered and you may even need this feature to avoid unintentional turn-on once the power to your home returns. <A> Brown-outs can cause switched mode power supplies to increase their current consumption. <S> The power supply will attempt to maintain a constant current and voltage on the output side. <S> If the input voltage drops, then the input current will raise to compensate. <S> Many power supplies are designed to run on both 110 V and 220 V supplies, so if you normally have 220 V and everything is running fine, you could have a 70 V brown out and those power supplies will continue providing the required output by drawing over three times the input current. <A> Since it happened to a lot of these breakers fed from the same substation, I expect that substation somehow experienced a glitch or short term event in one of the phases. <S> It may be that the condition didn't persist at the substation long enough to trip something there, but some of the faster-reacting local breaker caught the event. <A> Somewhere something connected neutral or hot to another source, either they shorted hot to ground or another device powered neutral line, like a lightning bolt could do this building wide, but this will be very dependent on the wiring. <A> Maybe specific equipment, e.g. light dimmers, were used in your appartment, that act funny on external events. <S> Together with above "Brown-out" idea, could be an explanation.
|
A voltage imbalance between the phases on the supply side would cause current imbalance between the phases on the demand side, which could cause the breakers to trip.
|
What does 3V3 or 1V8 mean? While reading a datasheet for an IC I came across the pin voltages being presented as 3V3 or 1V8. What does this representation stand for? <Q> I've always been told that the reason for using letters or symbols in place of the decimal point is neither for international relations or variable names in code but for clarity in print. <S> The issue being that when datasheets were typed up, or schematics drawn, and then copied/photocopied/faxed/ <S> etc the dot may get dropped. <S> This issue obviously isn't such a big deal these days but using 3V3 or 4R7 is still pretty common. <S> It's really common in older documentation here in the UK (and I'm talking back to kind of era where we really wouldn't have creating documents with legibility to Germans in mind...). <S> I'm pretty happy transposing commas for full stops in European documents, it's fairly common to find them in European publications (even when they've been translated to English). <A> That's the new politically correct way of writing numbers that would normally have decimal points. <S> Some parts of the world (Germany for example) use a comma to separate the integer and fraction digits. <S> To avoid ambiguity in international situations, some people now put the letter for the units where the decimal point should be. <S> So "3V3" really means <S> 3.3 Volts and "1V8" means 1.8 Volts. <S> If your audience is English speaking or it is obvious the document or the context is in English, then you are fine using a decimal point normally. <S> After all, using a decimal point is part of the language no less than the words used to describe other things, so this is not ambiguous. <S> In rare cases when numbers are by themselves without a language context, then it's probably best to use the "3V3" type notation. <S> Otherwise, I personally find this notation rather annoying since I have to look at it and think about it rather than the brain parsing it without much conscious thought. <S> As with most things PC, it's about choosing which group of people to piss off. <A> The period is replaced by the V. <S> So, rather that 3.3V or 1.8V you would write 3V3 and 1V8, respectively. <S> It came about for a couple of reasons: <S> In schematics which involve a device for which code has to be written (microcontroller, FPGA), many code languages use a period or comma as an operator (for example C uses periods to reference structure members). <S> If this is the case, the names of the signals in the code cannot directly follow the schematic net names to which they are connected as it will cause compilation errors. <S> So this scheme was developed to get around this and allow the exact same net to be referenced in the code as in the schematic, allowing for easier readability of the code and a more accurate reflection between the code & schematic. <S> For the reason mentioned above, many schematic editors don't accept periods or commas in the names of the nets because they generate code directly from the schematics or use code to operate directly on the schematics. <S> Both cases can be corrupted by the use of symbols (like periods or commas).
|
It's a naming convention to denote voltages.
|
What causes sub-second mains voltage outages? Many times I observed a following electrical event: mains voltage will suddenly drop and then immediately restore. This causes lights to blink and computers to restart. I can't imaging what could cause such a short event. I mean if someone wants to open a switch on a substation (or somewhere else in the grid) they do it for some service operation that takes time, so it doesn't make sense to have an outage shorter than several dozen seconds. So to me it looks like electrical company servicemen just open a switch and then close it to play an evil joke on the customers. What causes such short mains outages? <Q> If someone turns ON a large load (my table saw does this), it will cause the mains voltage to sag for a second or three and then it recovers while the load is still on. <S> There are several reasons for this. <S> Here they are, in rough order of decreasing probability: <S> Many devices consume the highest power immediately after power-on and then quickly settle down to something normal. <S> This is sometimes called "inrush current", but in a table saw this is "startup current". <S> If the power distribution wires have lots of resistance due to length or corrosion then this effect will be worse. <S> The power distribution wires also have inductance. <S> If the inductance is large and someone turns on a large load (without inrush/startup current) then you could see a similar effect where the mains voltage dips for a few moments. <S> This one is a weird one because depending on where you are relative to the power company and the load you might actually see the lights get brighter rather than dimmer! <S> There is a "disturbance" in the power company and they have to switch from one power source to another. <S> Normally this isn't a problem, but mistakes do happen. <A> The answer to this question depends upon how low your voltage goes, and how long it stays that way. <S> Previous answers have addressed the case of "voltage dips but not to 0" and "lasts for under 2 seconds". <S> However, if you are referring to situations where your voltage does drop to 0 <S> and it stays that way for somewhere between 3 and 6 seconds, you are probably looking at the operation of an automatic recloser . <S> These are essentially circuit breakers on power lines which, after they trip, wait a few seconds and try turning back on again in case the fault (for instance, a tree branch shorting out a set of power lines) has cleared. <S> The usual observed effect of automatic recloser operation is that your power goes out between one and three times, for somewhere around 3-6 seconds each time. <S> In the end, it either comes back on and stays on or, if the fault cannot be cleared, goes off and stays off until the electric utility company can come fix the problem manually. <A> There are a few reasons you might see a temporary voltage dip. <S> The first (most common) reason is the inrush/starting current of large loads, as mentioned by @David Kessner. <S> It is normal for an industrial three-phase motor to draw six times rated current for ten seconds as it starts and runs up to speed. <S> This produces a temporary voltage dip. . <S> Another (less common) reason is that there is a short-circuit "fault" somewhere on the electricity network, which will depress voltages until the faulty part of the network is isolated. <S> The isolation is automatically performed by fuses (on low-voltage distribution networks) or by protection relays and circuit breakers (on the high-voltage transmission network.) <S> A typical fault on a local 11kV transmission line, as might be found in a typical Australian suburb, might take anywhere from 200 msec to 2,000 msec to clear. <S> The exact clearing time depends on the kind of protective device in use (fuses or time-delayed relays) and the adjustable time delay settings. <S> On rural overhead lines it's also common to use auto-reclosers, which are circuit breakers that open if they detect a fault, the re-energise the line after a few seconds. <S> The principle here is that most overhead line faults are temporary (tree branch, etc.) <S> so the fault will not reoccur. <S> A typical fault on a massive 132kV transmission line typically gets cleared in less than 200 msec. <S> (Any more than this and the power stations will not be able to recover from the fault.) <S> . <S> I can't imaging what could cause such a short event. <S> I mean if someone wants to open a switch on a substation (or somewhere else in the grid) they do it for some service operation that takes time, so it doesn't make sense to have an outage shorter than several dozen seconds. <S> As far as this goes, all substations (in Australia) are designed <S> so there are at least two different switches that can be used to feed each transmission line. <S> Switching operations are nearly always done "make before break" so that service is not interrupted during routine operations or maintenance - so this isn't the source of the voltage dips you describe.
|
Someone turns on a large load and the voltage dips, the power company notices this and adjusts it's output voltage to compensate.
|
Why are LCD panels polarized at 45 degrees? I understand the principle of operation of LCD panels, but I am wondering why the specific output angle of polarization was chosen over, say, horizontal or vertical. <Q> Positioning the polarizers and alignment layer in a TN display at 45° and 135° can help improve viewing angle performance. <S> By doing this, the angles of best contrast are placed in the display's horizontal plane. <S> This has to do with the asymmetric shape the liquid crystals assume in a TN display. <S> From: 3M Optics 101 . <S> While all the videos are informative (if a bit repetitious) <S> the last one, "Optics 101 - Original Flash Animations" cuts to the chase. <S> I'd recommend watching from the beginning, but the answer being sought occurs around the 13 minute mark, "Section 15: <S> Twisted Nematic Displays: TN Orientation" <A> My guess was that it may be due to sunglasses being polarized horizontal (or vertical), and would then block the LCD light (unless polarized at a different angle). <S> I did a guick google and found this post : <S> Are all sunglasses polaized the same way? <S> Yes, unless they were manufactured incorrectly. <S> The glare they are trying to eliminate is usually reflected from horizontal surfaces (road surface or water) at a shallow angle so the reflected light is horizontally polarized. <S> Polarized sunglasses are vertically polarized to reduce the glare. <S> Which sounds reasonable enough to me. <S> Any takers? <A> When light reflects off of water it is horizontally polarized ( w ).All <S> "anti-glare" polarized sunglasses are vertically polarized to block that light.(If there were polarized at any other angleat least some of that "glare" would leak through). <S> Most LCD panels are designed so that the light exiting the panel is also vertically polarized,so they look as bright as possible even to someone wearing polarized sunglasses. <S> Alas, such displays are unusable -- they look completely black -- when rotated 90 degrees either way and then viewed through polarized sunglasses. <S> Some some LCD panels are designed so that light is polarized at 45 degrees ( a ).I <S> speculate that is <S> so the same display is usable in both "portrait" and "landscape" mode,even though it makes them half as bright. <A> Recently I've dug out my polarized sunglasses for driving and noticed a number of interesting phenomenon. <S> Based on this assumption, my digital watch must also be vertically polarized so that it is its brightest when my arm is horizontal <S> and I'm wearing sunglasses; when I rotate my arm 90 degrees so that it is vertical the watch display goes completely black, as expected. <S> However, the LCD displays in my car (Citroen C4) are polarized at 45 degrees; those in the central console (speedometer and stereo) are polarized 45 degrees clockwise from vertical and the display above the steering wheel (the rev counter) is polarized 45 degrees anti-clockwise from vertical. <S> This means the displays on the left (central console, right-hand drive car) go black when I tilt my head to the left (ie, towards the displays) and conversely the display above the steering wheel goes black when I tilt my head to the right when wearing the sunglasses. <S> Nevertheless, both displays are equally readable when my eyes/glasses are horizontal, although they are not at their brightest. <S> So why are they rotated 45 degrees? <S> I suspect it is because the displays can be read equally when wearing vertically polarized glasses whether rotated clockwise or anti-clockwise, but I do not know why they are not vertically polarized like my digital watch. <S> As suggested above by David Carey, it may be because the displays can be mounted horizontally or vertically without the risk of appearing totally black when wearing polarized sunglasses, which is vitally important when the display is the speedometer of a car! <A> Slight correction to the posts above. <S> When light encounters non-absorbing surfaces, a fraction of the incident light is transmitted through the surface and the remaining fraction is reflected. <S> The fraction that is transmitted/reflected depends on the polarisation of the incident light and properties of the surface. <S> For dielectric surfaces (water, glass etc) light that polarised in the plane of the surface (s-wave) is (generally) preferentially reflected, whereas light that polarised perpendicular to this (p-wave) is preferentially transmitted. <S> Light from the sun is mostly unpolarised containing equal amounts of s and p wave light. <S> Sunlight reflected from a surface becomes partially polarised in the plane of the reflecting surface. <S> If this surface is horizontal the light will be partially polarised horizontally. <S> The polaroid in sunglasses (should) be orientated to admit only light with a vertically polarised component - that is, the polaroid is orientated to filter out the polarised reflection from horizontal dielectric surfaces. <S> This property eliminates the glare from water, for example, so that fishermen can see the fish below, or so that a driver is not blinded by reflections from a wet road. <S> If you have some polarised sunglassed, try tilting your head while looking at a rainbow. <A> It depends on liquid crystal (LC) and operation type. <S> Usually, IPS (In Plane Switching) mode use 90-degree, TN (Twisted Nematic) modeuse 45-degree.
|
First, I assume that the sunglasses are vertically polarized because most glare experienced when driving is from horizontal objects - car roofs, wet roads, lakes, etc - making the reflected light horizontally polarized, so vertical polarization removes this glare.
|
Board components that are sensitive to soldering heat I have to test the various components of a board after manufacturing. I was told that SRAM, for example, is particularly sensitive to the soldering heat. What are other sensitive components? The board comprises of an ARM Cortex M3, with USB, Ethernet, GPS, SPI Flash, PSRAM, SIM card and SD card. <Q> There is no obvious reason for SRAM to be more susceptible to heat than similar products. <S> If there IS a reason it will be covered in the data sheet. <S> The data sheets of ALL major components that are used in a quality product will provide heat sensitivity information. <S> If this is volume production then you need to look at ALL data sheets for ALL factors that may be relevant to your testing. <A> I've seen inductors melt and go faulty. <A> its very rare that a soldering iron used properly will damage electronics. <S> I would suggest a few of the SparkFun soldering tutorials. <S> http://www.sparkfun.com/tutorials/36 heat ovens and heat guns on the other hand can definitely melt plastic housings on electronics. <S> For those I would check the datasheets.
|
Any component which isn't kept completely dry can suffer when heated.
|
Cleanest method for measuring the reported speed of multiple computer fans? This question builds upon this previous one How to interpret output of 3-pin computer fan speed sensor? which was asking about the 'sense' wire output from computer fans. I am designing a fan controller for PWM fans ( spec ) that needs to monitor the RPM of up to 5 fans concurrently. In the past I've used interrupts on a GPIO port to build a basic tachometer for a small motor, however my concern is that this approach will not scale given that: Each fan runs at a maximum of 2000rpm The linked question suggests that there will be 2 pulses per revolution If an interrupt is generated for each pulse to increment a counter then that works out at a maximum of 333 interrupts per second (2000rpm *5 fans * 2 pulses) I'd appreciate any suggestions for how to implement such a monitoring system. Incorporating additional chips, etc into the design is not an issue. I will be working with Cortex M3-class hardware, probably an LPC1768 (overkill for a fan controller, I know). Edit: Indeed, my original calculation posted here neglected to convert from interrupts/min to interrupts/sec. Sorry for the confusion. <Q> Your math is wrong, as you might have seen for yourself if you had properly carried the units thru your calculations. <S> You have 20 k interrupts per minute, which is 333 per second, which can be easily handled by even a modest microcontroller. <A> You don't want to hook any external signal up to an interrupt pin without making very sure you won't run into a situation where you end up flooding the micro with interrupts. <S> I learned that the hard way syncing to mains. <S> Line noise = lots of interrupts. :-) <S> That's bad design. <S> In your case I would use the capture and compare or timers; your fan tachometer outputs can be either event inputs or clock inputs; then you have a periodic (say 250ms?) <S> interrupt that just reads and resets the counts. <S> Just because your micro CAN handle <S> 20k interrupts/sec doesn't mean that's a sane way to design a system. <S> Not enough timer or counter inputs? <S> Depending on what the tach output looks like, you could add a resistor and capacitor to convert the signal to an analog voltage and feed those to the micro's ADC (most have 8 or more inputs). <S> That would work very well if the tach pulse is the same width regardless of the speed. <S> If the tach pulses are a fixed (or close) duty cycle, maybe a bunch of small F/V converters (there are lots, start with the LM2907 and go from there) feeding ADC inputs is a better option. <S> You could also gate the tach outputs into a single timer or counter using some discrete logic. <S> A '138 1-of-8 decoder would work very well for this if your scanning speed was slow enough to count at least a few pulses for low rotation speeds. <S> This is essentially the same idea as the ADC method above, but without the ADC. <A> An LPC1768 can take 20,000 Int/sec without a problem, as it can clock up to 100 MHz. <S> Just remember that P2.10 triggers the bootloader, and not every GPIO can trigger interrupts, only Port 0 and Port 2 GPIOs can. <A> Three GPIO pins would be used to change the channel selection on the multiplexer chip and thus determine which fan is selected. <S> This scheme would allow for up to 8 fans to be monitored and you could measure multiple TACH pulses from each FAN in turn. <S> Easily possible to detect fan problems for any given fan in a half second or less.
|
With the typical fan presenting 333 interrupts per second you could consider adding an simple 8->1 multiplexer chip that would select one of the fan TACH signals at a time and feed that into a single interrupt or timer input of the MCU.
|
Repairing broken trace on commercial board A friend has a USB flash drive on which the SMD USB connector broke off. When it broke, it pulled the pad traces off the board with the solder. We are trying to think of a way to reconnect the traces long enough to recover the data on the drive. We thought of filling the gaps in the coating where the pads were with solder, but one of them has an indentation that I am afraid would make solder flow onto a nearly adjacent component. Any ideas for making a temporary connection? <Q> Flexible wires is probably one of the safer options. <S> Conductive epoxy exists but seems overkill here. <S> Silver filled track repair compound exists - expensive, somewhat fiddly to use (doesn't conduct when wet - needs material to dry and settle for silver particles to make contact) <S> Copper tape with adhesive backing exists. <S> Used for window tapes for alarms and fake leadlighting as I recall. <S> I'd try flexible multistrand wires. <S> Fasten connector in place with adhesive of your choice and run wires from connector to suitable points. <S> You could probably have wires long enough - a few 10's of mm - to run them from a USB connector to the PCB without the two being joined. <A> Using small wires where the PCB traces used to be is probably the best option. <S> There are even professional standards about how to do this kind of rework: <S> http://www.ipc.org/4.0_Knowledge/4.1_Standards/7721-chg2.pdf <S> (The last page of the document seems very relevant to your question.) <S> Note: I still have a SONY Walkman (tm) where the battery had leaked and an entire pin of an IC got eaten away. <S> I fixed it by carefully milling away the IC's housing until I was able to solder a tiny wire onto the IC's bond wire. <S> The Walkman is still good as new. <A> Typically you just need the proper tweezers and small tip on your soldering iron to solder 30AWG wire to PCB traces.
|
I have used small 30 AWG wire in the past successfully for broken traces. Trying to reflow solder between the broken traces is very difficult and usually fails.
|
While using DC 12V power supply, if I connect only positive line to my electronic board and dont connect negative, what actually happens? While using dc 12 power supply, If i connect only positive line to my electronic board and do not connect negative ,what actually happens ? <Q> Nothing. <S> You need a closed circuit with a voltage difference for electrical current to flow. <A> Whilst I agree with the other answers, I will point-out one exception. <S> This is because current can find a path from the power supply positive to the negative terminal via the signal paths which were not intended to carry supply current. <S> EDIT <S> I will add one more note of caution. <S> When I first learned the fact that electricity required a closed path to flow, I figured that I could unwire a 240V mains plug without switching it off first. <S> I thought <S> "If I only touch one terminal no current will flow, right?" . <S> Wrong. <S> I was young and thought I was clever. <S> I can still remember my sense of disbelief as I was thrown across the room. <S> I had of course failed to understand that the human body, and the ground on which it stands will also conduct current, especially where high voltages are present. <A> "The sound of one hand clapping". <S> This is usually intended as a joke answer when given BUT <S> in this case there is some useful analogy. <S> Ask yourself: <S> If you clap your hands together but only use one hand, what actually happens? <S> ___- "Not connecting" one lead is the same as having a switch in that lead. <S> Ask yourself: <S> If you have a circuit with a switch in the circuit and you turn off the switch (create an open circuit) <S> what actually happens? <A> Charge is conserved. <S> It cannot appear or disappear, which is why there can be no current in a disconnected wire. <S> There will still be a 12 V voltage drop over the source, but since there is no current, it will not supply any power to the circuit. <S> It is equivalent to hooking up 0 V source to the circuit, obviously doing nothing, and a -12 V terminal at the other end, which is disconnected, therefore also doing nothing.
|
If your electronic board has outputs (or inputs) which are connected to another board which is connected to the negative terminal of your power supply, you might damage your electronic board.
|
Help a beginner who wants to start microcontroller coding I see lot of chip from Atmel company like AT89C2051,AT89S52,Atmega32,P89V51RD2. Suppose I write a code for Atmega32 which blink one LED after 10 milliseconds.Can I use the same code for AT89C2051, AT89S52, P89V51RD2 if I change the port? So if I buy one USB ISP programmer for Atmega32 MCU can I use it to program AT89C2051, AT89S52 also? Or does anybody compare the chip in terms of compiler, programmer, coding language, development board etc.? <Q> The Atmega Atmega32 and AT89S52 are ISP capable. <S> But they need different programmer. <S> AT89ISP (see here ) for AT89S52 and e.g. AVRISP mkII for Atmega32. <S> For a list of supported devices see the product page . <S> The AT89C2051 isn't ISP programable at all, again see product page . <S> The tooling support for the megaAVR and tinyAVR series are the same. <S> You could use AVR Studio 5 . <S> As for the other devices you have listed I can not say if you can use AVR Studio for them (because I never used those devices). <A> You need to recompile the code per controller type and clock frequency used. <A> Code Portability: @jippie answered that pretty good. <S> Development environment: <S> The free, fully integrated AVR Studio is the standard for Windows. <S> An alternative is the gcc port WinAVR. <S> Linux users use the gcc port avr-gcc, with it's own standard library, assembler, objcopy, programmer software. <S> Code is not directly compatible between the Atmel compiler and gcc and standard libraries are different. <S> Programmers <S> : Get an ISP(in-circuit programmer). <S> Design your PCB-s with ISP capability even in the release version. <S> I use an unofficial programmer , grabbed it at the local hardware store for ten bucks. <S> Unfortunately, making your own programmer requires that either you have another programmer (to program the chip), or you have serial or parallel port on your PC. <S> You could google around for the last option. <S> Also, I haven't heard of a programmer, capable of handling both 8-bit and 32-bit Atmel <S> uC. <S> But what do I know.
|
Not all controllers support the same I/O capabilities, so that needs some thought to make your code portable between controllers.
|
Thermocouple to ADC - with negative and positive voltages I am trying to interface a K type thermocouple to the ADC channel of a Microchip part. I am interested in negative (to -2mV) and Positive ( to + 4mV) voltages but don't know how to feed them into the ADC to get the full 12 bit resolution over this range of input voltage. I realise I need to amplify the output from the thermocouple and yes, I know all about cold junction compensation etc. I just need some ideas of how to interface the -2mv to +4mV signal into the ADC. Thanks in advance <Q> You'll need to amplify the signal to the range your A/D can handle - there are existing parts for just this purpose. <S> F/ex, <S> Analog Devices' AD595 thermocouple amplifier . <S> Simplecircuitboards.com sells boards based on it. <S> For a more comprehensive solution, Maxim MAX6675 is a complete thermocouple conversion device (thermocouple in, digital out). <S> It's currently in "Not Recommended for New Designs" status by the manufacturer <S> and I didn't see a recommended replacement <S> but that may not matter if you're not designing it into a new product. <S> Adafruit Industries sells the part on a breakout board ready to plug into a breadboard. <A> These have enough bits so that you can read the -2 to <S> +4 mV signal directly. <S> The input is differential, so you can read positive and negative signals by floating everything near half the supply. <S> Even at only 18 bits spread over ±3.3 V, you get 25 µV resolution. <S> Or put another way, that's about 8 bits over your temperature range. <S> These devices are available in 20 and 22 bits, so there is quite a lot of resolution available. <A> This chip provides an output signal of 5 mV per °C (i.e. about 100 mV at room temperature), which should be more appropriate for your ADC. <S> At its core, this chip is an instrumentation amplifier , which is the name for a sort of high-gain differential amplifier with high impedance inputs and high common mode rejection. <S> If you would like additional voltage gain, build a small amplifier to map the voltage range you have to the voltage range you want. <S> This can be done with a simple circuit consisting of a single op-amp and two resistors, such as this non-inverting amplifier circuit : <S> The voltage gain of this circuit is 1+R2/R1.
|
Connect your thermocouple to a dedicated thermocouple readout chip, such as the AD8495 "K-type thermocouple amplifier with cold junction compensation". Another possibility is to use a high resolution delta-sigma A/D converter directly, like the Microchip MCP3550 or various similar ones.
|
How can I learn electronics at home? Possible Duplicate: Learning about electronics I am 40. I am an architect by profession. I am very interested in learning electronics. I don't have time to go to college for an electronics degree. What should I do to learn electronics at home? Or is it possible at all? What minimum instruments do I need to buy? EDIT: This question helped me a lot. <Q> I would suggest perusing YouTube for projects that might hold your interest (this is key). <S> Once you find one you can begin researching it to determine how complex it might be, chose an initial one that might be completed in a few days. <S> For now, I would suggest staying away from items that need programming (connections to a PC or a micro controller) because debugging software is a bit of a distraction. <S> Most of the YouTube posters are quite willing to discuss their creations so you can ask them if they think their projects would be suitable for a novice. <S> For almost guaranteed success, you might want to purchase a kit that comes with all the components and instructions. <S> What could missing from these is the critical experience of blowing something up (aka letting the magic smoke out) and then figuring out what exactly happened. <S> Useful things to buy at the onset: a breadboard or two, a small power supply, solid core connecting wire, and some wire cutters. <S> I would also recommend this: http://www.amazon.com/Art-Electronics-Paul-Horowitz/dp/0521370957 <A> In my opinion, you would better start with Tony Kuphaldt's "Lessons in Electric Circuits". <S> There are six volumes that take you by hand from the very, very basic. <S> It doesn't assume you know anything about electricity and electronics. <S> Each volume talks about a topic (DC, AC, Semiconductors, etc)... <S> https://www.ibiblio.org/kuphaldt/electricCircuits/ <S> What you can do is to join a forum, or multiple fora. <S> Here are examples: http://www.electro-tech-online.com <S> Not bein able to post more than two hyperlinks <S> , two other fora are (look them up on Google): <S> -allaboutcircuits-edaboard <S> These are some of the very best you'll ever find. <S> They've been there for a long time, so your questions have probably been answered multiple times, and you can look up the archive. <S> I'll recommend a website that is simply great, it offers mainly reviews and answers to questions. <S> (Which book is better suited for beginners, why, which forum to chose, which forum is specialized in what, how can I learn.. <S> All these questions which seem daunting and you wish to have answers too.. <S> Look "wisewarthog" on Google. <S> It's the first result. <S> Take the time to navigate through it, it's deeper than it looks.. <S> You can find infos on books and they took a lot of time to write reviews. <S> It's better to start by knowing how things work first, instead of just soldering stuff together à la "cargo cult", and simply downloading a schematic/layout, etching it, drilling and then having it run work like "magic" not even knowing what each part does. <S> So documentation before projects, in my opinion. <S> Also, "The Art of Electronics" is great, although I wouldn't recommend it as a first read. <S> (But it's an absolutely great read <S> , I agree with the poster above). <S> All my best, <A> What should I do to learn electronics at home? <S> take on a electronics project, find a friend who knows more about electronics than you, start learning from online sources, What minimum instruments do I need to buy? <S> this is the bare minimum that could be useful for starting out. <S> Parts: that will depend on what project you take on, <A> If you want a book as reference, you can look here (AoE is pointed, too). <S> So the theory part should be covered. <S> If you want some general advice, try to type learning in the research bar, there are a lot of questions about general learning , or more specific topics, like Arduino or analog design . <S> Arduino (and many similar boards, since it's open source) is used a lot by artists too, because it allows to create a controller circuit with very high level programming and a basic knowledge about the analog stuff. <S> It may be too simple if you want to get your hands dirty with analog electronics, though. <S> And start with LEDs: they are the simplest way to get a feeling that your circuit is working :) <S> About instruments: depending on what you want to use, you always need a power supply, and a multimiter is always handy; the oscilloscope is a wonderful tool, but it's expensive and you can wait before buying one.
|
If you want to try some of the circuits you have seen, I would suggest Falstad 's very intuitive simulator, where you have some demo circuits to simulate, and you can create your own. An advice that I would give you, even if you don't want to spend too much time on theory, is: learn how to read datasheets , because they are the most importante source of information when designing. Tools: voltmeter, diagonal cutters, pliers and breadboard/jumper wire kit
|
Is making a D flip flop with asynchronous level triggered reset possible? I am starting to learn verilog coding in college and didn't have that much of a problem till now. I think I have the basics down perfectly. But I just hit a brick wall with this one. I was experimenting with behavioral modeling and ended up having this problem. It is easy to make a D flip flop with synchronous level triggered reset like this always @(posedge clk)begin if(clr) begin q <= 1'b0; end else begin q <= d; endend Or making a D flip flop with synchronous edge triggered reset like this always @(posedge clk or posedge clr)begin if(clr) begin q <= 1'b0; end else begin q <= d; endend But how can I make a level triggered but asynchronous reset? I cannot do always @(posedge clk or clr) because that would be oring two incompatible types, so an error will be thrown while doing the RTL synthesis. I cannot do always @(posedge clk)begin q <= d;endalways @(clr)begin q <= 1'b0;end since that would require multiple sources to drive q, again problem at RTL synthesis. So my question is, is making a D-flip flop with asynchronous level triggered reset possible or not? Both in verilog and in digital logic. <Q> Here's Xilinx's example of a "Flip-Flop with Negative Edge Clock and Asynchronous Reset": always @(negedge C or posedge CLR) <S> begin if (CLR) <S> Q <= 1’b0; else <S> Q <= <S> D; <S> end <S> (Source: Synthesis and Simulation Design Guide, UG626, Oct 19, 2011) <S> Notice that this is basically the same as your second example (except using the opposite clock edge). <S> And in fact this is a level-sensitive clear, not an edge-sensitive clear, because if clear is held high, the output will continue to be held low, even if new clock edges arrive and/or the D input changes. <A> It is possible to produce a circuit which will behave like an async-reset flip flop, provided that reset edges don't occur near clock edges. <S> Here is an example. <S> An important thing to note with this circuit, however, is that while a hardware asynchronous reset is guaranteed to clear any metastability, a circuit which simulates one offers no such guarantee. <A> Not sure of verilog but in VHDL <S> I thought it would be something like this: ARCHITECTURE behavioral OF dff_asynch <S> IS BEGIN <S> PROCESS(D, Clk, Clr, Pre) <S> BEGIN <S> IF Clr = '0' <S> THEN -- Don’t wait for clock Q <= '0'; <S> Qbar <= '1'; <S> ELSIF Pre = '0' THEN Q <= '1'; Qbar <= '0'; <S> ELSIF (Clk'event) AND (Clk='1') <S> THEN -- Positive Edge Q <S> <= D; <S> Qbar <= <S> not D; <S> END IF; END PROCES <A> 1) None-reset:always @(negedge C) <S> begin Q <= <S> D; <S> end 2) <S> Synchronous resetalways @(negedge <S> C) <S> begin <S> if (CLR) // <S> If C is not running, a change in CLR doesn't affect Q Q <= 1’b0; else <S> Q <= <S> D; end 3) <S> Asynchronous resetalways @(negedge <S> C or posedge CLR) <S> begin if (CLR) <S> Q <= 1’b0; else <S> Q <= <S> D; end
|
I'm not terribly familiar with Verilog, but by my understanding some synthesis tools will squawk at attempts to generate synthesize synchronous and asynchronous logic on hardware platforms whose primitives do not support such things.
|
What are these white connectors called? What are these white connectors called? I'm assuming they have a common name, with different numbers of pins. Update: better pictures, showing "BM Z" on the board connector. The board is identified by the vendor as a " 600TVL Sony Super CCD " camera. Update: the pins are 1.25mm center-to-center. It seems they are part of the Molex Picoblade family. Sad observation: the connectors are quite cheap (.07 USD in small quantities) but requires a crimping tool that retails for about 200 USD. <Q> You need to look for hints on its brand as the one you have there is a matched mated system. <S> An important specification to aid identification is the pitch or distance between the center-lines of two pins: usually either 0.1in (2.54mm) or 0.156 <S> in (3.96mm). <S> Try this page and check if the product photo and the 3D <S> PDF matches your connector. <S> When faced with an unknown connector, try exploring catalogs like the one from RS or TE's picture search . <A> These particular connectors look like JST connectors to me. <S> However, they also resemble some Hirose connectors as well. <S> Can you get a better image? <S> With a better image I might be able to pick out the particular connector series. <A> Should be Molex PicoBlade, serilized as 53047xx10. <S> xx stand for the # of pins. <S> As above mentioned, you could do the crimping with plier and soldering if you just work on small volume.
|
Those are "wire-to-board" connector assemblies. Although the picture is a bit unclear, I think what you have there is a TE 0.1in connector from their CST-100 system.
|
What's the need for a temperature controlled soldering iron? I have very little soldering experience - nothing harder than resoldering audio wires in headphones or replacing a mechanical switch on a computer mouse circuit board. I used a plain old unregulated 40 watt soldering iron at all times. Now turns out there're temperature controlled soldering irons - reading that answer was the first time I heard about them. Which makes me suspect that maybe my prior soldering experience might have been better should I have one of those. How do I know if I need a temperature controlled iron? What are specific scenarios in which a temperature controlled iron will be advantageous? <Q> You always need a temperature controlled soldering iron. <S> It's one of the first must-haves for the EE, together with a good DMM. <S> Uncontrolled irons heat up to high temperatures while they sit in their holder, so that your first solderings occur at way too high temperatures, which leads to poor quality soldering connections and possible damage to (smaller) components. <S> When in college we had labs where we soldered, but we were never formally taught how to do it. <S> Many inexperienced hobbyists apply the solder to the soldering iron. <S> Wrong! <S> You heat up the PCB pad/ component's pin with the iron, and apply the solder to the heated surface. <S> Only that way the flux can do its cleaning job on the surfaces. <A> (there are many different, for instance lead-based or lead-free is a common distinction), but still remaining in a safe limit for the components. <S> Especially with SMD packages, using a too high temperature or holding the iron too long in position ( <S> because of too low temperature) may damage the pads, the pins or the package itself. <S> So, while in some cases (hobbyst tinkering) you can just use your simple iron, it's better to have a temperature controlled one, to obtain a quality work. <A> Although expensive, temperature-controlled irons are recommended in two situations: when soldering fine (small area) pads when the device being soldered is sensitive to small temperature excursions (typically small devices, ICs, CMOS/MOSFETS) <S> Excessive heat could fry the delicate device being soldered or warp the PCB tracks/pads that the copper peels off from the board (fine tracks/pads are especially vulnerable). <S> Inconsistent heat can lead to early solder failure: small pockets of poorly melted solder will not bind well. <A> Temperature controlled irons are also useful when soldering components to power planes when there is inadequate thermal relief as they can dump extra power into the bit without increasing the temperature. <S> An uncontrolled iron will simply cool down. <S> You can also tin enamelled copper wire if you have manually adjustable temperature by whacking the temp up to 400°C. <S> Just remember to turn the temperature down afterwards! <S> I still have a mains powered uncontrolled iron in my too box, but it is only 15W. <S> This can be useful for light work <S> but I would not recommend anything over 25W.
|
It's a good thing to have a temperature controlled iron, because you can set it to be beyond the melting point of your specific solder
|
What is the voltage range of a standard headphone jack from a phone? I want to connect the output from the audio jack of an iPhone to an Arduino. What voltage range can I expect to see on the audio lines from the iPhone? I assume that turning the volume up on the phone will produce a large AC voltage, but how large does it go up to? I want to make sure that it wont exceed the voltage level that an Arduino can read on its input pins. Will I need to provide any circuitry between the iPhone and the Arduino? <Q> Commercial line out specification is to be able to drive 1 milliwatt to a 600 ohm load. <S> For a sine wave, this means a voltage of 0.77 volts RMS (2.2 volts peak-to-peak) and a current of 1.3 milliamperes RMS (3.6 milliamperes peak-to-peak). <A> Check out: http://en.wikipedia.org/wiki/Line_level <S> Expressed in absolute terms, a signal at −10 dBV is equivalent to a sine wave signal with a peak amplitude of approximately 0.447 volts, or any general signal at 0.316 volts <S> root mean square (VRMS). <S> ... <S> There is no absolute maximum, and it depends on the circuit design. <S> This is however for the "Line out" plug which, apparently, carries a signal at a fixed amplitude and lets the receiving end determine the volume. <S> In most cases changing the volume setting on the source equipment does not vary the strength of the line out signal. <S> For a speaker-driving headphone plug I believe things might get more complicated, since that signal is really rather a current signal (used to drive the coil of a speaker). <S> In contrast to line level, there are ... those used to drive headphones and loudspeakers. <S> I guess your best bet might be to look at the wave with an oscilloscope, which should have a high-impedance input like the Arduino's analog input (ADC). <S> (I'm no expert, take with a grain of salt and feel free to edit) <S> Edit: <S> The Wikipedia article I used as a source has been edited a lot since I originally posted this answer. <S> Among other changes, the qouted pieces above have been removed/changed. <S> Therefore I'm striking most of this answer out and recommend referring to the Wikipedia article linked at the top. <A> Unfortunately there is a lot of "audiophile" nonsense around headphone amplifiers and headphone impedance. <S> Probably the top 5 results for "headphone impedance" on Google are just wrong. <S> This site contains some useful information (though a lot of it is wrong too). <S> But anyway if you look at the graphs which I assume are correct, you can see that in the audio frequency range most headphones have a fairly small reactance compared to their resistance. <S> Audiophile headphones will require higher power. <S> Power is \$P= <S> V^2 / R\$ <S> so <S> \$V = <S> \sqrt{R*P}\$, so high impedance headphones will need a much higher output voltage because they require more power and have a higher impedance. <S> Anyway, for the Sony MDR-EX51 headphones shown on the page linked above you can see that they are fairly close to a simple 17 Ohm resistor. <S> At 5 mW that would mean a voltage of 0.3 V and a current of 16 mA . <S> An Arduino can supply this fairly easily <S> but I don't think you can just hook it up to PWM since 5V across 17 Ohms gives 300 mA which is well above Arduino's 25 mA limit. <S> A simple solution may be to insert a 4.7 V / 16 mA = 290 Ohm resistor in series with the pin. <S> I haven't tried any of this - you'll have to experiment! <A> This is in addition to PkP's answer. <S> Even if the spec is adhered to and you only get 775 mV RMS on average, the peaks can be considerably higher than 1.1 V. <S> It is generally good to accept and handle without distortion peaks up to ± 5 V at least. <A> There is no hard-and-fast rule for headphone jacks; be it a laptop, MP3 player or a regular stereo system. <S> I would say that a typical headphone output adheres to Line Level specifications, although for headphones they become more of a guideline than a stringent set of figures. <S> As you have already discovered, different devices have different output levels. <S> The power that can be provided by your PC is, for example, X milliwatts. <S> As the PC power supply can give up 12V to the soundcard, the X mW could well be generated with an emphasis on the voltage rather than the current. <S> Some top end motherboards (the latest Asus ROG boards, for example) boast a headphone-jack output of over 2V rms. <S> A portable MP3 player may only have a 3.7V lithium battery. <S> Its output power could be the same X mW as the PC, but at a lower voltage therefore higher current - without some boost convertors it would be impossible to match the voltage of the aforementioned high-end motherboard. <S> A fundamental difference between a 'headphone output' and a 'line out' is that the latter isn't designed to power a low impedance load. <S> I tend to assume that the input impedance of a generic audio device to be 50kOhms; if it's ever critical to know then it's typically stated by the device manufacturer. <S> Headphones or earphones can be as low as 32 Ohms, meaning that plugging headphones into a Line Out socket could result in both poor volume and poor quality. <S> There is not generally the same problem with connecting a line-level device to a headphone output unless you consider a dedicated headphone amplifier; an audiophile might argue that the output would become unbalanced. <S> Thus there is no correct answer. <S> Perhaps start with 1.4V RMS as a maximum and then increase or decrease as you work through your prototype. <A> The arduino would need a higher voltage. <S> Use an non inverting OP amp on the line which should bring the voltage to about 2ish Volts, something which is better for the arduino. <S> :) <S> http://www.instructables.com/id/Arduino-Audio-Input/step3/Non-Inverting-Amplifier/
|
And most headphones have an impedance around 16-32 Ohms with some crazy "audiophile" headphones having higher impedance (e.g. 300 Ohms). While "line level" audio is typically 1 mW into 600 Ω, and this comes out to 1.1 V p for a sine, audio is far from a sine. He suggests that 5 mW is sufficiently loud for portable headphones. The strength of the various signals does not necessarily correlate with the output voltage of a device; it also depends on the source's output impedance which determines the amount of current available to drive different loads. The most common nominal level for consumer audio equipment is −10 dBV, ...
|
5V to 160V DC converter I need a DC-DC convertor to bring a 5V input up to 160V DC output. Does anybody know off any of the shelf parts that would manage this? The high output needs to supply minimal current (uA) we really just need it to supply a potential. We have a part for this currently but it's going out of production. We'd need the replacememt to have a similiar foot print (60mmx30mm). I know linear tech have a good range of DC-DC controllers such as the LT3757, one of these may do the job. Has anybody used these for something similiar? Also I read an application note which which suggested it's possible to stack voltage references which may be another way of doing it as we don't need current. Has anyone tried this? I'd be grateful for any suggestions. <Q> Not really a whole off-the-shelf part, but... <S> (flyback converter without isolation). <S> Also, you could try something like figure D1 on page 93 of Linear Tech's app'note 47 (without Q1 and the three resistors and the capacitor around it, just to the point that says "avalanche bias"). <S> Adjust the divider to the FB pin for 160 V instead of 90 V. <S> This little circuit is a combination of a step-up converter and a charge pump. <A> You're in luck - There are many ways of achieving this. <S> Stacking voltage references will not work - they are a means of reducing a voltage to an well defined level. <S> If DIYing - various boost converter iCs exist. <S> Most of these do not have the voltage rating to handle 160 VDC directly, but use of a transformer will give you N:1 stepup. <S> I usually start with recommended and olde but goody smps IC MC34063. <S> There are many better but this about anything at low ICcost. <S> If you want REALLY low idle power there are better IC.s <S> As you want only uA <S> you want an IC that goes into burst mode at low load. <S> Run a long long time on batteries if needs be. <S> I just noticed that they have pin 1 connected to output collector. <S> That limits Vout to 40V. <S> Instead return pin 1 to Vin via a resistor and Vout can be "high". <S> Here is a circuit that uses a more modern IC an that achieves 150-250 VDC with essentially the same core circuit as above, but with improvements. <S> Uses Maxim MAX1771 IC. <S> Datasheet here . <S> Be wary of single source and availability - but seems to do your job exactly. <S> Their design is aimed at 12V in but the IC will do 2V+. <S> IC uses PFM to get low idle current at low load - high in your context and better can be done. <S> If necessary a system that shuts down to essentially zero drain most of the time under uA loads can be implemented. <S> From here - Nixie HV Switching PSU Note in text their comment on layout affecting efficiency. <S> Stray capacitance and other AC losses matters at this boost ratio. <S> Note eg lack of ground plane near inductor. <S> Using their supplied PCB design would be wise. <A> Use an oscillator with power transistor to drive the 6V side of an off-the-shelf 230V/6V transformer and rectify (diode) and smooth (capacitor) <S> the HV output <S> If needed use a feed-back loop to regulate the output voltage. <S> EDIT <S> I removed the example circuit because of flaws mentioned by Olin. <S> Still outline above shows an easy way to generate 130V from 5V.
|
A small step-up converter with an autotransformer sounds just right If this is a one off then buying one of the many many many products available may be easiest. MC34063 datasheet Fig 19, page 14 does what you want.
|
Is the GPIO speed involved in the baud rate of my USART? I am working with am ARM Cortex M3 where two GPIO pins are configured as Alternate Function for use as USART pins. When setting the pins as Alternate Function, I have to set the Output Speed of those pins. (I set them at 50Mhz.) Reading the reference manual (available here ) on pages 613 and following, the baud rate of the USART seems to only depend on the APB1 clock rate f_CK . Does the set GPIO speed influence the USART baud rate? <Q> Take a look at the architecture of your proccesor. <S> For this purpose I use the LPC1769, but is very similar on other proccesors. <S> On this platform the proccesor is not directly connected to peripherals. <S> The proccesor, as with DMA, Ethernet, USB, RAM and ROM run on it's own AHB matrix. <S> This matrix contains connections to several high-speed peripherals on the proccesor. <S> For example, the proccesor connects directly to the SRAM. <S> The DMA does as well, so the CPU can handle instructions and the DMA can (on the background) move or read data from/to peripherals. <S> The general purpose peripherals like SPI, UART, ADC, PWM, etc. are on a seperate peripheral bus (APB). <S> There is a bridge between the high-speed matrix and this bus. <S> This will cause delays in data-transfer (because the bus may be busy). <S> In case of the LPC1769, there are 4 High Speed GPIO pins. <S> If the state of these are changed, it wil; take immediate effect. <S> This allows, theoretically, an update speed of over the CPU clock frequency. <S> You say that the max. <S> update speed depends on the APB1 clock rate. <S> The APB1 clock rate is the clock rate of all peripherals on group 1, which may be GPIO and UART. <S> This clock is usually lower than the CPU, to save power. <S> The GPIO update speed and UART are not dependant on each other, but dependant on the clock rate of the peripherals and the AHB/APB structure. <A> From what I understand, output speed is the update rate of the output. <S> As long as it is reasonably higher than the the rate at which your output changes, it shouldn't matter too much. <A> The manufacturer typically does not specify the exact behavior of the device with different settings, but instead specifies that: At any particular setting, the output slew rate will be at least fast enough to accommodate a square wave output of a particular speed. <S> Specifying a slower speed setting will result in a slower slew rate, though the manufacturer typically won't specify exactly how much, or what the wave shape will be. <S> Specifying a faster slew rate will cause the output voltage to switch more quickly between VDD and ground. <S> This will generally increase peak loads on VDD, RF emissions, and the occurrence of ringing, overshoot, and other nasty effects on the output line being switched. <S> If it's important that a downstream device see an output switch within 10ns of when the ARM commands it, then one must specify the fastest data rate and deal with the consequences. <S> If the output is being used to control a relay that's going to switch maybe twice a second, one should use the slowest output speed, but it probably won't matter; the relay won't care about ringing, and an output that's switching a couple times per second isn't apt to cause excess RF emissions <S> no matter how quick the edges are. <S> The time slow output speeds are most useful <S> are when one is generating a signal which changes frequently, but not insanely fast (e.g. 100KHz-1MHz) or one is driving a device which will may quickly to transients in the output signal but one isn't actually sending pulses nearly as fast as the device could respond. <S> Sending a 1MHz square wave with edges fast enough to accommodate a 50MHz wave would generate a really big amount of RF at 3MHz, 5MHz, 7MHz, and other odd harmonics of 1MHz. <S> Slowing down the edges could greatly reduce the levels of RF noise generated. <S> An output transition (e.g. high-low) which is sent with very rapid edges may be received with a brief "bounce" (e.g. registering as high-low-high-low). <S> If the receiving device is fast enough to register that high-low-high-low as multiple events, that could cause trouble. <S> Slowing down the rate at which the output switches will substantially reduce the extent to which it bounces.
|
In many cases, the "output speed" setting of a pin controls the slew rate.
|
What's the difference between MOSFETs and BJTs (from a circuit analysis perspective)? When analyzing circuits with transistors in them, when does it make a difference whether they are MOSFETs or BJTs? <Q> From the design standpoint, the main and most evident difference is the base current: as Russel said, the bipolar is current-driven, which means that the current flowing into the Collector will be proportional to the current flowing in the Base (and the Emitter will output the sum for the KCL); the MOSFET instead, has a very high Gate impedance, and just putting a voltage higher than the treshold will activate it. <S> The bipolar transistor has a fairly constant current gain, \$ h_{FE} \$, which gives a linear response while the MOS has a quite complex response (quadratic with Vgs in saturation, depending on Vgs and Vds in "linear"). <S> At the other hand, its fixed gain may be insufficient to use it as a switch, where a low-power input is used to turn on a high-current load: in that case the Darlington configuration (two cascaded BJTs) can help, but MOS doesn't have this problem because its current gain is virtually infinite (no Gate current as we said). <S> Another aspect that may be relevant is that the MOS, being controlled by charge in the Gate, doesn't like it to be floating (not connected): <S> in that case, it's exposed to noise, and will result in an unpredictable behavior (possibly destructive). <S> The BJT, requiring a base current, is more robust in this sense. <S> Usually BJTs also have a lower threshold (around 0.7 V vs 1+ V for the MOS) <S> but this is very dependent on the device and does not always apply. <A> Quantitative Difference: <S> But generally speaking, a transistor (BJT or FET) is a "complex" component (by complex <S> I mean, it is not a resistor, a capacitor, an inductor nor an ideal voltage/current supply), which means from a circuit analysis point of view, that you should first pick the right model for the transistor, i.e, a circuit made of non-"complex" components that represent the behavior of the transistor (google for Hybrid-pi model), in order to analyze it. <S> Now if you look at both, BJT and MOSFET models you will be able to quantitatively compare them and understand the differences. <S> The way you pick the right model depends on different factors, namely: accuracy complexity if it is for small or large signal (just to name a few) <S> Qualitative Difference: <S> Check some of the posts about transistors here in the forum, (for instance David Kessner's) <A> In analysing circuit this will make difference because the electrical equivalent model of BJT is different than FET because as they talk before the characteristic of BJT is not like FET . <S> As tou can see from this picture <S> And this is due to the huge input resistor of FET . <S> By the way if we use a non favourable configuration <S> the input resistor my become small as what happen when we use common gate or common base.
|
It really depends on the type of circuit and voltage levels you are dealing with.
|
How can a Arduino (5v) power a device that operates on >12v? Say I buy a device that requires 25 volts to function, but I want to control it using my 5v arduino. How would I go about powering/controlling higher voltage devices? <Q> Yes it's possible, and it's usually done by step-up (boost) converters. <S> These converters are based on the principle that inductors react to sudden changes in their current with a high voltage. <S> So, an inductor is put in series with the supply and switched (here the name Switching Mode Power Supply, SMPS) between a short circuit and the load. <S> When the switch opens, the inductor has to discharge the stored energy and it does that creating an opposite voltage than the one it's charged with. <S> Another efficient way is also the charge pump , where capacitors are charged at the supply voltage (5V in this case) and then put in series with the supply rail to generate the higher voltage. <S> It's commonly used to double voltage, but different ratios are possible. <S> All these circuits create a pulsed output voltage; it can be filtered afterwards to give it a more stable shape if required. <A> An example of the answer by Petteri Hietavirta can be seen at the link. <S> Yenka Model to play with. <S> Opto-Isolator is a safe way to go to avoid frying the Arduino. <A> If you have correct voltage supply available for the device you want to control with Arduino, check optoisolators . <S> With that your Arduino should be safe from high voltage but still able to control the device. <A> I think this link will help you much. <S> And this video tells you a story of an engineer and his journey to find the best voltage boost for his needs.
|
You can also boost your voltage by external circuit designed for specific values as @clabacchio said.
|
How data is stored in memory beyond 0s and 1s? I am working as software Engineer. As far as I know the data being stored in memory (Either HARD Disk or RAM) is 0s and 1s. I am sure beyond 0s and 1s there are different ways data being stored in memory devices based on memory device types. Please share your ideas about it . or Where can I study about the how data stored in memory devices ? <Q> Digital data is generally stored as 1s and 0s at some level. <S> That is only the view of one level in a large layered hierarchy. <S> Below that you get into charges, phase change of material, mechanical dimples, voltages in active circuits, little regions of magnetic domains, and lots more ways people have come up with over the years to store bits (the 1s and 0s). <S> Above the bit layer there is a hierarchy eventually surfaced to applications as a file system by the operating system. <S> There are several layers above the bits and below the file system, but these vary depending on the exact storage device and the file system. <S> In general, large storage devices like disks, will present their memory as "sectors" or "blocks" that are the minimum amount that can be written or erased at once. <S> In flash drives there is a layer that does "wear leveling" that swaps around physical blocks to implement the logical blocks presented upwards. <S> Flash blocks have a limited write and erase lifetimes, and this layer seeks to wear them out as evenly as possible. <S> Magnetic disks don't have this issue, but do sometimes have a "bad spot" layer that avoids physically defective blocks from the logical blocks presented upwards. <S> Blocks usually contain CRC checksums implemented by the hardware. <S> The file system usually deals with the logical blocks directly. <S> It uses some as index to know what it stored in others. <S> Some file systems log operations to aid in recovery. <S> There are lots of strategies for knowing which blocks are used to store the content of which files, which blocks are empty, etc. <S> File systems often add their own checksums to logical blocks or files and other structures. <S> Eventually the file system presents a collection of "files" to the operating system. <S> The OS will usually define a few files for its own purposes, then present something a little different to applications. <S> How much different depends on the OS and whether it is intended to deal with multiple possibly hostile processes and other concerns. <S> Eventually the application sees arbitrarily sized collections of data, called files, it can read and write without having to worry about sectors, blocks, or how individual bits are physically stored. <S> Modern file systems tend to present files as named entities in a tree structure. <A> I suggest you start reading this wiki article http://en.wikipedia.org/wiki/Data_storage_device and go on from there. <A> Most devices store and process information using two-state devices because, in most cases, the amount of circuitry required for a device is proportional to something between the number of self-stabilizing states, and the square of the number of self-stabilizing states. <S> If a ternary device with three stable states took only 1.5 times the circuitry of a binary device with two stable states, then twelve ternary devices could hold slightly more information than nineteen binary devices, while using only 36/38 times as much circuitry. <S> In practice, though, the three-state devices would need a bit more than 1.5 times as much circuitry, so two-state devices end up being more efficient. <S> The only areas where binary isn't used almost exclusively are those where information is held or transmitted in devices that are not continuously self-stabilizing, and where the size and expense of the material carrying the information is large relative to the amount required to stabilize it; the two largest such areas are flash memories and communications cables. <S> It's possible to store more than two states in a flash memory cell, or send more than two voltages down a communications cable, without increasing the cost of the memory cell or the cable. <S> Using more than two states will substantially increase the cost and complexity of the interface circuitry, but if the cost of the memory cells or cables exceeds by an order of magnitude the cost of the data-retrieval circuitry, cost savings that could be achieved by cutting the number of cells or cables in half would dominate even a four-fold cost increases in the cost of interface circuitry. <A> As a side note: a research field is quantum computing, where people is trying to store information in the form of quantic particles (that can have whatever state until they are read) also called Qubit . <S> But AFAIK there still isn't any device implementing this technology.
|
Data on hard drives is stored as 1s and 0s which are physically represented by magnetized particles and non-magnetized particles.
|
What is the common pin configuration upon microcontroller reset? I have looked through two datasheets and user manuals now for two different microcontrollers (LPC2387 and STM32F4xx), and I haven't found (probably missed) anywhere where the initial state of the GPIO pins was described on powerup or after reset. My question is not specific for these MCUs, but in general, is it most common for GPIO pins to be initialized as input-floating (high-z) upon reset? Is there a standard convention, or do different MCUs do different things, and one needs to read the datasheet/manual for each MCU one works with? <Q> From the app note by ST <S> ( AN3430 ): <S> After a reset, all STM32F2 pins are configured as inputs except some JTAG pins such as PA15 JTDI with pull-up, PA14 JTCK with pull-down and PA13 JTMS with pull-up. <S> It makes sense to have high-Z state after reset because it is the safest default state. <S> In case of STM32F2 series micros, it also has the least power consumption. <A> I really don't believe that information is missing the datasheets. <S> I have never seen it <S> NOT there, although I have never used the particular microcontrollers you mention. <S> In general, at least for the micros I have used <S> , I/O lines wake up to be as benign to the external circuit as possible. <S> This means going to high impedance to the extent possible. <S> In addition, pins that can be analog inputs are usually configured that way on power up. <S> That is because digital inputs often are not intended to be held at intermediate voltages for extended time. <S> Some might consume more power in that case, or oscillate, or do other annoying and possibly out of spec things. <S> However, the definative answer is in the datasheet of whatever micro you are using. <A> For the LPC2387 the information is definitely there, and I expect that this is also true for the STM. <S> that's the LPC23xx. <S> The information you need is on page 172: all I/ <S> O registers are set to input. <S> This is common to most controllers. <S> The reason is that driving an output high or low on reset may have unwanted effects, depending on what's connected to the pins. <A> The most common behavior is for microcontrollers to set all configurable pins to some variety of high-Z float, thus allowing external circuitry which are about the state of the pins to safely use pull-ups or pull-downs without static current draw. <S> I've never used a microcontroller with a pin-keeper function (weak pull-up when a pin is high; weak pull-down when low) <S> but I wouldn't be at all surprised if micros that have such functions enable it by default. <S> It's probably important to note that many microcontrollers have some pins that can be configured as analog inputs, disabling the input buffers on them. <S> This feature can save 10uA-100uA to the current drawn by the part for each pin that is sitting at half-rail. <S> Some parts by default enable their input buffers, while other parts disable them. <S> Parts that enable the buffers by default may draw excess current until code has run enough to disable them. <S> Parts which disable them by default may cause problems with software which doesn't know that they must be enabled before use.
|
Some controllers will set some or all pins to weak pull-up; some will set them to weak pull-down. If you can't find the information in the datasheet, have a look at the series user manual ; this contains all information shared by all members of a controller family, in the case of the NXP
|
Could HDMI be potentially used as a power supply alternative for smartphones? I understand that HDMI's pin 18 carries a +5V charge. Similarly, USB carries 5 volts and this is used to charge many smartphones with a micro/usb connector. Could it possible to build a smartphone that charges with an HDMI port? Would that be completely impractical currently? <Q> The specification of the +5V charge is 50mA(according to wikipedia) <S> This is even lower as USB before enumeration(100mA) <S> Any device wouldn't be able to charge , or it will be very slow at 50mA (10x slower than normal USB port at full power, 500mA) <S> I don't think the HDMI connectors are specified for high currents in excess of 0.5A. <S> Furthermore, the +5V is probably used in the monior to power some small circuits for identification of itself to the PC/television/etc. , even if it's turned off. <A> Yes it can be. <S> But not with just the HDMI standard. <S> There is the MHL http://en.wikipedia.org/wiki/Mobile_High-Definition_Link standard, which uses HDMI connectors. <S> v1.0 has 5V/500mA, V2.0 has 5V/900mA. <S> It's designed to allow a phone or other device to charge from the main device (TV/Projector) while providing a high bandwidth video/audio link. <S> Your phone and the source device would have to support MHL to take advantage of that, as there is physical routing inside the phone that needs to be in place. <A> well, for starters +5v 55mA is required to be provided by source device and not receiver - which means your phone would have to act as receiver - for example display what comes from computer on <S> it's screen - etc. <S> No phone <S> I know of acts like that - all of them are source - which means they are ones providing 5v current ;] <A> On some laptops and tablet PCs if you accidentally short this line to Gnd it can cause strange symptoms, current limit or not and even prevent booting in severe cases. <S> PS3 and PS4 the same applies. <S> I actually found that the Pi Zero V1.1 could actually run on this, charging up an itty bitty LiPo like the ones used in 3D glasses from HDMI power and then activating when triggered from a special remote code or even using a 10F 2.5V supercapacitor.please note, use a single chip 5 pin charger IC or other limiter if you plan to try this as supercaps <S> /LiPos DO NOT LIKE excess voltage. <S> 2.4V seems to be a sensible hard limit for supercaps and 3.92V for LiPo <S> / 3.25V for LiFePO4. <S> Note: <S> a Pi Zero can be "juiced" to actually run from HDMI parasitic power if you optimize the code for low usage. <S> I found that by replacing the memory card with one hand selected for lowest power usage it will actually run fine. <S> Alas NOOBS won't work as it needs 8GB minimum but ArchOS might work or some other distro. <S> Would someone please release <S> PiDSL <S> already thanks! <S> (<256MB)52mA average would fit most smart TVs. <A> Mostly used to connect to I2C devices on the bus to read the identifier of what the host connected two while the device itself is off: <S> http://www.hdmi.org/learningcenter/kb.aspx?c=13#42 <S> If your device can charge from that low, <S> then yeah <S> it would be possible, but its not what the host would be expecting to happen. <S> Most devices need more than 55mA to power/charge a device at 5V. <S> There may be another rev of the spec in the future to allow more current since more and more devices will likely be using HDMI. <A> You will need an adapter or a connector to connect type-C USB and HDMI ports via an HDMI or adapter cable for charging the laptop. <S> You can also charge the laptop by connecting the type-C port with the type-C port of your mobile phone using your data cable.
|
Not really possible right now, HDMI spec shows 55mA on that line.
|
Can I safely reduce a stepper motor's power consumption by applying a PWM to the driver's enable input? I have a stepper motor driver breakout board based off the Allegro A4988 chip. I noticed that when the motor is static, it has much better holding torque than when moving. I have a battery operated configuration and a majority of the time the stepper motor is only used to hold a position. The limit setting potentiometer is already on the breakout board so I can't change it with my micro-controller. Would I able to apply a PWM signal to the enable pin of the motor driver to change the current going into the motor so that I can drive the motor at a higher current level when actively moving and reduce the current for holding position? I'm mostly interested on the effects a PWM signal will have on the driver circuit's life. Nowhere on the data sheet dose it say you can or can not do something like this. <Q> It's hard to tell from the internal circuitry if it would cause a problem. <S> The enable pin switches off the external fets, which might mean that the chip is unable to re-circulate current properly, causing voltage spikes. <S> However, I would expect Allegro would have dealt with that situation, since it would happen every time Enable goes high. <S> If you have a spare driver, then my advice would be to just try it. <S> The A4988 will then take care of the current reduction for you nicely. <S> This can be achieved by pulling the Vref pin a little lower with a resistor and either a transistor or a the pin of an MCU which can switch between low and high impedance. <S> An even better solution might be to make it automatic. <S> Use the step signal to rapidly charge a capacitor which pulls the Vref voltage up. <S> An absence of step signals lets the cap slowly discharge, and with it the Vref voltage and the motor current. <S> The faster the steps, the higher the Vref. <S> Here's a very rough schematic of how it might work. <S> I just guessed the resistor values, and haven't checked that they would work at all. <S> (Exercise left up to the reader). <A> I'm not sure what you mean by 'the limit setting potentiometer', but (assuming that you mean the current sense resistors \$R_{S1}\$ and \$R_{S2}\$ (which would be an interesting design, those should be matched low-impedance resistors) <S> I read on page 9, in the section Internal PWM Current Control : <S> The maximum value of current limiting is set by the selection of RSx and the voltage at the VREF pin. <S> The transconductance function is approximated by the maximum value of current limiting, \$I_{TripMAX}\$ (A), which is set by \$ I_{TripMAX} <S> = V_{REF} / ( 8 R_S) <S> \$ <S> where \$R_S\$ is the resistance of the sense resistor (Ω) and V_{REF} is the input voltage on the REF pin (V). <S> Do you have access to the REF pin (pin 17)? <S> If so, adjusting this with a DAC will produce the same effect as varying the sense resistors. <S> If not, the Enable input is probably a better choice than cutting the power or using the sleep or shut-down pins, those would incur a 1 ms delay (per the description on p. 10). <A> Sure you can use PWM, but your stepper motor may start to whistle a bit with the PWM frequency. <S> Pick a high frequency that you are unable to hear (>20kHz) or live with the whistle.
|
I can see nothing in the datasheet which states that the enable pin cannot be pulsed. Alternatively, you could reduce the Vref voltage, rather than using PWM.
|
How to drive a Peltier element? Maybe the underlying question is what the Voltage-Current curve looks like. Can I drive it from a voltage source (like you drive a heater) or from a current source (like you drive an LED)? Or even different than those two options? ADDITIONAL1: Say (hypothetically) I have two commercially available identical Peltier's, they are spec'd 6V/3A. Can I connect these in series to a 12Vdc power supply without any worries? CONCLUSION1: Current/Voltage load curve is reasonably linear, both driving from current or voltage source will do fine as long as the device is operated within its spec. (Olin Lathrop, Russell McMahon) CONCLUSION2: Don't drive a Peltier from PWM, power loss due to current increase, grows more rapidly than cooling power. (Olin Lathrop) CONCLUSION3: Beware the mechanical wear of the device with continues cycling. Eg. don't use a thermostat on/off controller. (Russell McMahon) <Q> Peltier devices are one of the few things you do not want to run with pulses, particularly in cooling applications. <S> The cooling effect is proportional to current, but the internal heating due to \$I^2R\$ losses is proportional to the square of the current. <S> Starting at 0, increasing current causes increasing cooling. <S> However, at some point the resistive heating due to more current outweighs the additional cooling power of the higher current. <S> More current beyond this actually therefore causes less overall cooling. <S> The maximum cooling current is one of the parameters that should be supplied by the manufacturer. <S> While maximum cooling occurs at some specified current, efficiency steadily decreases with increasing current. <S> Therefore you don't want to PWM a peltier cooler between 0 and the maximum cooling current. <S> Driving it at the steady current to produce the same overall cooling is more efficient. <S> Of course the microcontroller regulating the temperature will still produce PWM pulses. <S> These pulses need to be filtered so that the Peltier device sees relatively smooth current. <S> The general rule of thumb is to try to keep the ripple below 10% of nominal, but of course that is just a tradeoff someone picked. <S> Fortunately, this is usually not a difficult requirement to design to. <A> They are voltage driven devices but you could safely enough drive them from a voltage or a current source as long as you do not exceed their maximum voltage or current ratings. <S> eg <S> a 12V, 5A 60 Watt unit may be operated at any steady voltage <= <S> 12V <S> or any steady current <= <S> 5Aas <S> long as neither maximum value is exceeded in any case. <S> But - A Peltier device MUST NOT be constantly thermally cycled as part of the control scheme What you must avoid is controlling them with step changes in voltage with control signal time constants that are long compared to the device's thermal time constant. <S> That is - if a the control scheme is aimed at holding a device or a controlled space or an object at a constant temperature it should provide an essentially DC voltage and current or PWM in the 10's of Hz plus range and NOT PWM or thermostat or on off switching such that noticeable heating and cooling occurs during the on and off times of the control cycle. <S> If thermal cycling occurs as part of the control process the device will rapidly be destroyed mechanically. <S> Power supply ripple at mains frequencies is acceptable. <S> Thermal Cycling: <S> Say >= 1 kHz PWM rate needed - Nord ferrotech <S> Peltier manufacturers Note that Peltiers used fro test cycling SMD components also fail due to cycling IGBT thermal cycling testing <S> - nbo Peltiers <S> BUT seems to directly apply Peltiers specially made to allow long thermal cycling lifetimes - UWE <S> Same - Ctech <S> Same Ferrotec Discussion <A> Most of the microcontrollers I am familiar with do PWM in the hundreds of cycles per second range. <S> No thermoelectric module is going to be able to distinguish that from a steady voltage. <S> Also, (google it) there is a paper out there where they tested PWM cycling with rates of 1/10s all the way up to 1000/1s rates and the peltiers did not exhibit any decline in performance over thousands of hours. <S> The one that cycled every 10 seconds did exhibit temperature fluctuation due to the slow response time. <S> In any case, PWM is utterly safe for controlling a peltier. <S> I fear this thread has a bunch more misinformation in it, but I'm not knowledgeable enough to point it all out.
|
Peltier devices work on current, but usually have significant enough resistance so that voltage control is possible. Peltier devices have a reasonably linear load curve.
|
How can I quickly and safely discharge a charged capacitor (small and low voltage; <= 42V)? I am learning how to use capacitors (ceramic and electrolytic from 1pf - 1000uf) and am trying out various experiments using a breadboard. I am constantly adding/removing things to my layout to see what happens... but waiting for a capacitor to discharge sometimes takes a long time! The book I am currently reading (Make: Electronics) suggested to "discharge a capacitor by touching a resistor across it for a second or two". Is this safe/recommended way? Can I just hold the resistor with my fingers and touch it across both terminals? Note: I have to admit I am a bit paranoid with capacitors after seeing pictures of exploded capacitors and resulting fallout such as melted breadboards, burnt tables and even reading about people losing fingers! Edit: I am currently working with 1.5 - 12V though I also have some 24V stepper motors which I'd eventually like to get working. <Q> With small capacitors up to 1 mF, there is little to worry about. <S> I suppose it's a good idea to make sure they are discharged before plugging them in where the voltage that could be on the cap could damage something, but this is something not generally worried about until you get to some real energies or high voltages. <S> For small electrolytic caps like what you are working with, just short them against something metal, like a bare component lead, metal chassis, or handy screw driver. <S> Don't waste brain cycles thinking about this for anything small enough to be a ceramic cap you can plug into a breadboard. <S> By the time you plug it in, your fingers will have discharged it. <S> Even if not, do the math. <S> 1 µF <S> at 10 V is only 50 µJ. <S> Yes micro Joules. <S> Big deal. <A> Instead of holding the resistor with your fingers try gluing it to the end of a Popsicle stick or some other insulated material. <S> That way your fingers will be much less likely to come in contact with the capacitor. <S> If what you are dealing with is 20 volts or less this should be fine. <S> I am assuming we are talking about relatively small capacitors and voltages here. <S> If you start talking about high voltages that could be fatal <S> then what you want a professionally manufactured device and extra precautions. <S> Here is an article where someone made a nice discharge probe from a Bic pen. <S> He also goes into the math if you are curious. <S> Once again - safety first! <S> Now having said all that, I agree with Olin that this will be overkill for the small capacitors you are currently dealing with. <S> This information may prove helpful as you advance and perhaps start dealing with bigger capacitors and higher voltages. <A> The product of the resistance (in Ohms) and capacitance (in Farads) is the scale time for the discharge (to go to 1 <S> /e of the original charge): <S> t = RC. <S> With V = Q/C and I = <S> V/R = Q/t, you can also solve for the minimum resistance to keep the discharge current to a safe value. <S> (Keeping the current below 1 mA is a rough guideline: <S> https://www.asc.ohio-state.edu/physics/p616/safety/fatal_current.html <S> That's for discharge through humans, but what constitutes "safe" varies by what's connected to your discharge circuit. <S> If you're running the current through flexible copper wiring, it can probably take a few amps.) <S> Also note the energy stored in the capacitor, which will be deposited in the resistor which shorts it: U = 0.5 C V^2. <S> As long as you're dealing with the sorts of capacitors typically used with bread boards, you can probably short it with copper wire, as others have mentioned: 1 <S> uF <S> * 1mOhm = 1 ns discharge time. <S> If it only has 42V on it, these formulas say it will have a high current for a few nanoseconds, but the nanoHenry-scale parasitic inductances will limit the current and slow the discharge. <S> That 42 V at a 1uF is less than 1 mJ, which could damage sensitive electronic components - so don't short out the capacitor with that high-end CPU. <S> Anything else should be fine. <S> If you get into voltages and currents where discharge takes a second or more, or where your discharge currents will be in excess of that 1 mA for more than 1 ms, or where the energy stored exceeds a few Joules, then you should be careful <S> : Check the current and power ratings of the components in the discharge circuit, estimate the inductance, and maybe run a simple sim of the discharge process. <S> In general, discharge-before-use won't be a significant issue unless your capacitor is comparable to a full Farad or the voltages are a few kV. <A> Not sure how relevant this post is, but here is something I've been developing for a relay timer circuit. <S> Q1 is a PNP transistor that will turn off when the voltage is released, discharging the capacitor to ground.
|
If you are dealing with lethal voltages your best alternative is to use a professionally manufactured, tested and certified probe.
|
How hard is it to reverse-engineer a two-way protocol for a beginner with a logic analyzer? I recently bought a Tacx Flow trainer , which has a handlebar computer, with a 6channel RJ-11 cable between the trainer and the handlebar computer. The computer reads pedal frequency, power and speed, and is also able to adjust the trainer's brake -- thus two-way communication. I have little to no experience in electrical engineering, but I thought I would buy a logic analyzer to see what I could find. I think I managed to infer the GND and PWR (the computer gets power from this cable), and saw some patterns possibly related to speed and pedal frequency in two of the four lines (the two other lines were regular beats, and irregular, tiny signals). I could not think of a way to progress further. Is this just impossible for a beginner to do? <Q> I would start by looking at the PCB for the driver chips that are used (RS232? <S> RS485? <S> TTL? <S> analog?). <S> This gives a first clue how to look at the signals. <S> Google is (of course) your friend. <S> You could try to vary the inputs (speed, power, etc) to see what changes in the signals. <S> From a designer point of view, I would imagine how I would build such a system (or how others have done it) and check whether it's done the same way here. <S> I would probably use a dynamo-like thing in the wheel-blob and do all processing in the display unit. <S> (Which would make it very hard for you to interpret the signals). <A> The regular beats are probably clock signals. <S> Look at the irregular signals with reference to the clock. <S> Most systems will sample the data lines (the irregular signals) <S> when the clock is either changing, high or low. <S> Try and send some fixed signal (pressing a button or something repeatable) and looking for a predictable pattern. <A> Take a few snapshots with the logic analyzer and note the values the display shows when or shortly after you take them. <S> First try to find a packet structure. <S> Take a look at how serial communication works, especially asynchronous serial communication as it is the simplest possible solution. <S> Look at the packets for regularities and differences, and whether you find the values (maybe scaled by some factor).It helps if you can vary only one parameter and keep all others the same, but that may be difficult in this case. <S> There may also be a checksum/CRC that varies whenever anything in the packet changes. <S> It helps to be patient (I mostly use pen and paper to analyze the data). <S> And if at first you don't succeed try something else. <A> An old topic, but I had a go with an oscilloscope and the tacx flow, and from what I can tell you get 3.3V, GND, a 3.3V pulse length that varies with the speed of the flywheel, one pin that is 3.3V and pulled down when the cadence sensor/reed relay is triggered. <S> Then one pin with +- 16V AC with a 50hz period (I guess for calibration for the mains unit) and one which either is for powering the head unit or for communicating from the head unit to the flywheel unit. <S> I didn't really care to investigate further since my goal was to intercept any digital communication which could tell me what power level I was currently inputting.. <S> So..analog stuff <S> and if you don't want to do the processing yourself, just buy another trainer. <S> The Fortius/genius ones from tacx seems nicer.. <S> Since this is the nr1 post (out of 1 or 2) when googling Tacx flow reverse engineering, I thought I would add my conclusions. <S> Cheers. :-)
|
It won't hurt to have some idea of how an asynch serial, I2C, SPI, etc signal might look like.
|
On PIC18 series, when should I use LAT register and when PORT? I'm programming a PIC18F4680 using mikroElektronika's mikroC PRO compiler and I've set the LCD library to use following ports to communicate with LCD: // LCD module connectionssbit LCD_RS at RB4_bit;sbit LCD_EN at RB5_bit;sbit LCD_D4 at RB0_bit;sbit LCD_D5 at RB1_bit;sbit LCD_D6 at RB2_bit;sbit LCD_D7 at RB3_bit;sbit LCD_RS_Direction at TRISB4_bit;sbit LCD_EN_Direction at TRISB5_bit;sbit LCD_D4_Direction at TRISB0_bit;sbit LCD_D5_Direction at TRISB1_bit;sbit LCD_D6_Direction at TRISB2_bit;sbit LCD_D7_Direction at TRISB3_bit;// End LCD module connections and the LCD is sometimes displaying garbage. I was told to LATB instead of PORTB registers and after reading the I/O Ports section of the datasheet, it's still not clear to me when I should use PORT and when LAT registers. <Q> Use PORT to read from a pin, and LAT to write to a pin (and TRIS to change the direction). <S> (it's not a bug, it's a feature!). <S> Check my explanation in Interfacing a keypad with a microcontroller <A> LAT is used for writing an output, PORT is for reading an input. <S> TRIS is used to configure the direction; an output (=0) or an input (=1). <S> I remember the tris settings on PIC platforms easily because Output is 0 (O) <S> and Input is 1 (I). <A> The simplest rule, applicable 99% of the tine on devices which have LATx addresses, is to use LATx (or LATxn) whenever you are writing a port, or reading a value which will be used in computing a value to be written back to a port . <S> Use PORTx (or Rxn) only when you want to determine what outside circuitry is or is not doing to state of the pins. <S> As a further rule, I would suggest avoiding reading LATx outside its role in the iorwf , andwf , or xorwf <S> instructions (or the |= , &= , and ^= operators in C). <S> If, for example, you want to set the bottom four bits of an IO port match the contents of a register which is known to be blank outside those four bits, the pattern LATB &= ~0x0F; // <S> Clear bottom four bits <S> LATB <S> |= new_data; // Set appropriate bits is often safer than the pattern: LATB = (LATB & 0xF0) <S> | new_data; It will cause pins whose old and new value were both "1" to transition momentarily to "0", but it will work correctly even if an interrupt service routine would affect the contents of LATB. <S> If one needs the semantics of the latter statement and interrupts could modify LATB, one must either disable interrupts during the read-modify-write sequence or use some really nasty code to enure that the update happens correctly even if an interrupt strikes during it. <S> BTW, an alternative formulation with semantics between those of the former and the latter is: LATB |= new_data; LATB &= (0xF0 | new_data); <S> This version will turn on any "new" bits a few cycles before it turns off any bits which should no longer be high, but it is interrupt-safe <S> provided the interrupt <S> only writes to the upper four bits.
|
Some PICs do not have a LAT register, in those case you are forced to use the PORT register to write to a pin, which exposes you to the dreaded Read-Modify-Write
|
What do I need to drive a servo motor? I'm using an Avr microcontroller and I've been wanting to build a simple robot, for some time now, from scratch. In every robotics project I have seen, seem to have a separate board driving the servos and I want to know what that board doEd different and how could I make one from scratch. I think it might be called a motor driver (I'm a novice); so why can't I just run the servo from the microcontroller - I assume it's something to do with power. Ask any questions if anything is too ambiguous. EDIT:Every reference to servo is to a servo motor. <Q> “I assume it [inability to run servo directly from mocrocontroller] has something to do with power.” <S> You’ve probably answered your own question. <S> Most motors useful for robotics consume more current than a microcontroller pin <S> can source or sink. <S> (Unless, you’re building a micro-miniature robot.) <S> As a result, the motor requires a power driver, such as H-bridge made with power transistors. <S> For an example of an integrated H-bridge driver, see L298 (dual H-bridge) <S> and A3966 ( application note ). <A> It would simply be a matter of hooking up the 3 pins (power, ground, pulse). <S> For small servos this would be enough, for instance the Arduino operates on 5 volts, but a normal servo can operate on 4-6 Volts. <S> Nick is right however, you would want to use am h-bridge if you are going for multiple motor control. <S> Again, this might depend on the application of the servo, if you're going for simple pan and tilt then you should have no problems. <S> TLDR: You totally can use the microcontroller for servo control. <A> Just a small addition <S> (I don't have the reputation to post this as a comment): read this . <S> As for power: typically an avr can source/sink 20mA@5V = <S> 0.1W per pin. <S> This is just to clarify what a "small" servo means in this context.
|
It is quite possible for you to run the servo from the microcontroller.
|
Consume less energy by slowing down a 1 HP 220v pool pump motor I would like to know if and how I could have my pool pump motor consume less energy. It is a 1 HP motor that works on 220v. It is my assumption that if the motor runs slower, then it will consume less energy, such as a fan with different settings for the fan speed. Does anyone know how to easily do this? The volume of water that the pool really needs is a lot less than what is coming out and less gallons per minute through the pool pump that feeds the pool would not effect the final outcome which is to recirculate the water. <Q> Speed control of single phase induction motors can be achieved by driving them at different frequencies - more complex and expensive than is usually appropriate, or by changing drive to the main winding or start winding. <S> Many examples and discussions are available on web. <S> Driving whole motor: Microcontroller driving while motor with TRIACs. <S> Freescale An3471 - Ceiling Fan Speed Control - Single-Phase Motor Speed Control Using MC9RS08KA Relatively simple. <S> I'm somewhat surprised that they say you can achieve good results this simply. <S> Freescale SHOULD know what they are doing. <S> Need not use a microcontroller. <S> Here U1 is an optical controlled TRIAC which is used to trigger the larger TRIAC Q1. <S> Shaded pole motor control with PIC <S> - You tube <S> Separate out windings: <S> New method for speed control of single phase induction motor with improved motor performance Abstract only but very useful. <S> Diagram thumbnails small but useful. <S> Abstract <S> In this paper, a new method of speed control for the single phase induction motor is introduced to overcome the disadvantages of the conventional methods. <S> In this method, the magnitude of the main winding current and its angle are controlled to control the motor speed, as well as to increase the starting torque at all speed settings. <S> In the meanwhile, the voltage applied to the auxiliary winding is kept constant at the rated value. <S> The performance of a 1 hp capacitor run single phase induction motor is experimentally and theoretically investigated, using this method of speed control. <S> The experimental rig is built in the laboratory and a complete set of test results is obtained. <S> On the other hand, a mathematical model for the motor is developed and the motor performance is calculated. <S> Good agreement between the experimental and theoretical results is obtained. <S> These results show that the new method of speed control gives much higher starting torque. <S> This enables the motor to start at low speed settings. <S> Also, a great improvement in motor efficiency and power factor at all speeds is achieved. <S> 3 methods - diagrams dead Some value Variable frequency: [Microchip AN984 - An introduction to AC Induction Motor Control using the dsPIC30F MCU] <S> Student project Appears competent. <A> Russell has already given you a direct answer to your question, but here is another possibility. <S> The point is to save overall electricity since you don't need the flow rate of the pump at full speed. <S> There will be a current surge and therefore some inefficiency each time the pump is turned on, so you don't want to do this every few seconds. <S> This also allows you get down to average flow rates that would be impractical by reducing the pump speed. <S> The pool is a large reservoir relative to even the full flow rate of your pump, so will naturally average out pulses of full flow. <S> Try running it for 2 minutes every 5 minutes and see how that works. <S> That can be accomplished very simply by a microcontroller driving a relay thru a transistor. <S> This will allow you to tune the average on percentage by adjusting the off period. <S> Due to the startup effeciency, I'd probably stick to 2 minute on times and adjust the off times. <S> For example, if you can get away with 2 minutes on every 10 minutes the electric consumption will be close to 20% of the steady on case. <A> the pump has a job to do so the size of it is important and the amount of time it is run and the motor must have good bearings,clean filter. <S> I find most pumps are way too big for the job but can be re-sized easily .. <S> ask your local pool pump motor <S> whats the cheapest way to run your pump and how best to take care of it.. <S> I hear all the time "why doesn't anybody tell me that, thanks man" want cheap ? ? <S> I built a solar pump that I got 42 gallons a minute. <S> thats free <A> Answer: <S> For given voltage the motor consumes less power when rotates faster <S> The non-electrical solution can be modifying the loaded part of the pump. <S> Say chop off few leafs off the fan. <S> It will reduce the torque, increase the velocity, increase the counter-EMF and reduce the consumed current. <S> Ideally zero torque can be achieved when motor rotates with maximum speed consuming zero power. <A> Since a centrifugal pump motor is least loaded at shut-off simply closing the outlet valve reduces the load and the power consumed. <S> Do not fully close the valve as this will overheat the pump due to recirculation within it.
|
Another way to achieve this is to turn the pump on and off periodically.
|
What is the formal definition of Quiescent Point? What is Quiescent Point? Is it necessary for it to be related with any V vs I , I vs I , or any such characteristic curves intersection point? <Q> The quiescent point is by definition a state of a circuit in which all the inputs (meaning voltage and current levels, but also component values and environmental conditions) are fixed. <S> It's generally used in circuit analysis to find the operating region of active components, such as transistor and Op-Amps, and then perform a time-based analysis using the small-signal linear approximation of the component models. <S> Take this circuit : Its behavior is dynamic, as it will depend on the value of the two input voltages, but if these values are fixed, it's possible to determine the status of all the nodes and then eventually perform an analysis for small perturbations of this quiescent state. <S> The curves you are talking about, are the representation of many quiescent points given by the variation of a parameter, which may be the value of a component, of a signal, or even an environmental parameter, such as the temperature. <S> It will tell what to expect from the component under a specified biasing condition, and are often (if not always) found in datasheets. <A> The quiescent point is related directly to biasing. <S> The Quiescent Point is also known as the operating point. <S> Typically the Q-point is chosen by the designer for a specific application. <S> The point basically represents the allowed devices voltages and currents. <S> Check out this PDF . <S> It's where most of this info came from! <S> Very helpful. <A> Q point determines the region of operation. <S> It can be used as a controlling parameter to keep the transistor in required region.
|
Graphically the Q-Point is where the load line and current curve intersect (depending on the type of device) .
|
Opamp driving a capacitive filter load I know that opamps can be unstable when driving capacitive loads. The input to the opamp is more complicated than the schematic shows, but an unfiltered full wave bridge rectifier is the proper waveform. The waveform varies between 0Vpp to 15Vpp. Other circuits need the rectifier waveform. My Voltage to Current chip needs a smoother signal, so the current is more consistent. The opamp is an LM358 built as a buffer so the rectifier waveform doesn't get filtered. The LM358 is powered by 24Vdc. The issue I am having is the rectified waveform increases its voltage linearly at its own slope. while the smoothed opamp output increases its voltage linearly on another slope. The two slopes intersect at some value determined by the resister and capacitor. How can I get the slopes to be parallel or the same slope? Is there another circuit that will smooth out a rectified waveform into a DC voltage? schematic <Q> It's a bit unclear, but you want a signal <S> that is the rectified voltage into the IC, you're not trying to power the IC from the opamp, right? <S> If the latter, there are much better ways to do that, like with a voltage regulator chip. <S> Instead of putting the filter after the opamp, put it before the opamp. <S> At least put most of it there. <S> You can put a little filtering after the opmap if you're worried about slight noise introduced by the voltage follower opamp. <S> Of course "filtering" is with respect to some other signal, usually ground. <S> You don't show what you consider ground, and what the ground or reference voltage for the IC is. <S> Unless the IC is running from 15 V or can specifically handle the large input voltage, you can't just feed that directly into it. <S> Mostly likely you have to attenuate the signal into the voltage range of the IC power. <A> You've got an low-pass RC-filter with cutoff frequency \$ <S> f_C = <S> \dfrac{1}{2 \pi \cdot R \cdot C} = <S> \dfrac{1}{2 <S> \pi \cdot <S> 100\Omega \cdot 220\mu F} <S> = 7.23 <S> Hz\$. <S> Note that you can achieve the same value by increasing \$R\$ and decreasing \$C\$. <S> For instance <S> \$R\$ = 10k\$\Omega\$ and <S> \$C\$ = <S> 2.2\$\mu\$F. <S> The opamp wouldn't mind this kind of load. <S> Like Olin says it's better to place the voltage follower after the filter. <S> This will make the filter characteristic independent of the load. <A> I would like to answer my own question. <S> What about using a peak detector that bleeds. <S> The bleeding alows the detector to lock on to a lower voltage after some discharge time. <S> circuit below. <S> I captured the image of an overshoot condition, where the scope on the left is the rectified signal, and the right is the output. <S> the rectified signal operates at 350 hertz between 0 and 10 volts. <S> Everthing is powered by +24vdc. <S> Opamp would be LM358 . <S> Main issue is that there is no overshoot. <S> z2012
|
You may also have to attenuate the rectified signal.
|
What is the most cost effective way to produce a custom circuit board? UPDATE June 21, 2012: I purchased a Ferric Chloride, Positive Developer, and positive PCB boards from MG Chemicals and used the photo-etching process. The results were OUTSTANDING! You don't need their sparge tank or exposure kit. I simply exposed my pcb underneath a 20W compact florescent bulb for 10 minutes, developed the pcb in a tupperware dish according to the instructions, and then etched in the same (rinsed out) tupperware dish for 15 minutes while agitating occaisionally with a foam brush. Also, I used an inkjet printer. The instructions say only to use a laser printer, but I found that if I set my printer to print the transparency using very dark, rich dpi settings that I had sufficient contrast. The results were great--super fine and detailed thin traces!! Background I recently purchased some Syma brand indoor RC helicopters for my nephews. Well, I had so much fun enjoying these with the boys that I have since started a small collection of my own. Although loads of fun and durable, these toys use cheap electronics: An infrared transmitter/receiver that seems to lose signal quality in a brightly lit room Single channel so that you and someone else can't fly at the same time without interfering with one another. About me: Not an electronic engineer, though I am technically minded. I am very much a novice with soldering and wouldn't be capable of soldering the tiny board inside these little birds. What I would like to do: In an ideal world, I would like to have a custom circuit board made for these little birds that Accepts a non-infrared signal (2.4 GHz? Bluetooth? Wi-Fi? --Remember these are "living room" flyers). Allows for you to choose between 2-3 channels on both the transmitter and receiver so that 2-3 people can fly concurrently. I realize that this might already be available for bigger outdoor birds, but I need the circuit board to be small. Is there a cost-effective way of prototyping this? Is there perhaps a place where I can send them the specifications and they would "print" up the circuit? Software that a semi-layman like myself could use to design it? I realize that the first run would be expensive, but I can see this being an after-market item that those of us bitten by the indoor heli-bug would buy enough of to bring the cost down. <Q> For cost effective, full feature software, nothing beats open source software. <S> I use the gEDA suite of tools for my electronics designs (schematics and PCB layout) but there is also the KiCad suite which might be a bit easier to use. <S> There are several others as well. <S> Try playing with them and doing some layout tutorials to get to know the software. <S> For PCBs, you could try places like Fusion PCB or DorkbotPDX . <S> I have also heard the previously mentioned Batch PCB is good too. <S> For wireless, you could use something like this bluetooth to serial converter from DealExtreme. <S> With bluetooth, you can pair devices and then it doesn't really matter how many birds you have flying around. <S> You could also develop a smartphone app to control your helecopters. <A> So from your post you need complete design services for a small run of custom electronics involving radio communications to a mobile platform. <S> Since you're not an EE <S> this is not something that you can do yourself . <S> You can't piece together something from multiple sources that will work without in-depth technical knowledge - you need someone to design this for you. <S> Electronics are not Legos - they're not designed to work together seamlessly. <S> That means you need to pay someone or get them to do it for free. <S> The level of effort (billable hours) on this is probably something on the order of: 4 hours to sit down with you and hash out all of the requirements 8 hours to do parts selection 40 hours to do any coding (if necessary) 40 hours of schematic capture and layout for the board 16 hours to test 40 hours for rework and the next revision (if necessary) Much much more effort for any certifications necessary to make it into a real product <S> Real engineers are paid on a contract basis generally $100/hour or more. <S> If you want this to be a real product you need someone who has been through that process before - more expensive. <S> This is quite an effort to contract out. <S> If you do find someone they will handle the board manufacture <S> but you'll have to pay for parts and boards. <S> Boards also take up to weeks to get <S> and you'll be looking at one or two revisions. <S> This will take months and it will be expensive. <S> As for where to find someone to fit these criteria... dunno. <S> DOes <S> anyone know of a website where people can post small contracts like this? <S> I think it would be a good resource. <A> PCBs are first designed with a schematic. <S> You can find a large amount of options for schematic editors for the question Good tools for drawing schematics . <S> Once you get the schematic drawn you will need to "transfer" the schematic to a layout program. <S> This is really only ever done with in a single program. <S> For example, eagle is a pretty commonly used program. <S> You create a schematic, and then within eagle you transfer it to a pcb. <S> From this point you will need to place all of the parts in your layout. <S> Once the layout is complete, you can export the layout. <S> A typical format for this is gerber files. <S> You then send those files off to a PCB house who will then fab the board for you. <S> There aren't many cheap options for soldering boards for you in small quantities just because of the large amount of setup time required. <S> One option though is batchpcb.com <S> With all of that said, I think you are taking on a project that might be a little much for you right now. <S> Brainstorming questions are best for the chat room, so I wont go into much detail here. <S> Here are my concerns for you... <S> It is an art to get PCBs very small and you will need pretty small pcbs in order to get them to fit on those small helicopters. <S> Also, people tend to like to make their first PCB in every project a little bigger so that you have room to change things or adding prototyping pins, etc. <S> You would probably be best to buy yourself a development board of some sort, possibly an Arduino with some RF shields. <S> This will allow you to do some prototyping in an environment that is very easy to do things in. <S> This will help to get you up to speed with what all is needed to make something like this. <S> You could then take the step of turning it into a PCB that can fit on to the helicopter. <S> Also, you shouldn't be scared of soldering. <S> In small quantities, you will be able to save money by buying yourself some soldering equipment instead of paying someone else to do it for you. <A> However, you will be waiting a while (for me it was about a month from upload to delivery.) <A> Unless you're really set on doing this yourself, you'd be a lot better off taking a look at radio control from companies that specialize in it: <S> Futaba Airtronic Hitec <S> JR <S> You can get those (and probably at least a few others) from dealers like Tower Hobbies , RC Planet , Hobby People , etc. <S> Even using a pre-built transmitter and receiver, you'll get an opportunity to do a bit of engineering, getting the receiver to talk to the existing servos (or replacing them with those supplied with the radio) along with (usually) some mechanical engineering getting things like the throw on the servos correct.
|
Last I checked, the most cost-effective place to get small-run PCBS is http://batchpcb.com/ by the people behind SparkFun.
|
Calculate how much current is a microcontroller's pin drawing I am reading up on microcontrollers and I want to know the current that RA0 is drawing when the switch is open but I think I'am getting it wrong. Also my electronics knowledge is elementary at best. I=V/RI=5V/4700OhmI=1.06mA (rounded off) I expected to get something close to 50mA or something because of the table below I need some help. <Q> You calculation is based on the assumption, that the RA0 pin will sink the current. <S> But this is only true, when the pin is configured as an output and driven low. <S> Since pin RA0 apparently is sensing, whether the button is pushed, the pin is likely to be configured as an input. <S> In this case almost no current (only some leakage current) will flow when the button is open. <S> The table you are reffering to shows the absolute maximum ratings. <S> Your pins should never sink/source more than the current given there. <A> If you configured your pin, RA0 , as an input <S> it means that your pin is in Hi-Impedence mode <S> and it will draw an insignificant amount of current, called Input Leakage Current . <S> You'll find the value of the Input Leakage Current in the PIC16F84 datasheet , page 55: <S> So RA0 will only draw 1uA. <S> Then the pin will sink 1.06mA. <A> When it's opened, some current flows through RA0, provided it's configured as input. <S> The logic level in RA0 will be logic 1. <S> Voltage level will be near 5V. Current will be near zero. <S> The exact value doesn't appear in the tables you've provided, but it should be uA or nA. <S> Consider it initially as 1uA, as our colleague informed. <S> But you could also measure that current: measure the resistance of the 4K7 resistor use a precision (the best you've at hand, anyway) <S> voltmeter, to measure the voltage drop V across R when the switch is opened calculate <S> I= <S> V/R, as you know Xezi
|
Your calculation would be correct if you would configure the pin as an output and set it to 0/low. The current you've calculated is correct and passes through 4K7 when the switch is closed .
|
Is it possible to make a USB device that would alter mouse data on the fly? I have a friend who is struggling to find mouse drivers/manufacturers that support various options for dyslexia. Inverting the X and Y axes are a simple feature that most programs and drivers are ignorant of. The thought occurred to me that it might be possible to construct a small USB device (similar to a thumb drive or PS/2 adapter) that a user could plug a USB mouse into and, using a couple of DIP switches, invert one or both axes. I have a basic familiarity with programming (C#/C+) and electronics, but am not sure if there is a standard protocol for USB mice. I'd prefer to avoid using a serial converter (though I know it has a more or less standard protocol). Has anyone used USB mice with a custom electronics project, or can explain whether constructing a USB-to-USB adapter to invert movement is possible? <Q> What about a software solution? <S> On Windows, you can intercept the mouse actions with an application, which can be as simple as this <S> AutoHotKey script: <S> #NoEnvSetBatchLines -1Process Priority,,RBlockInput <S> Mouse ; user mouse input is ignored during MouseMoveCoordMode Mouse, Screen ; absolute coordinatesSysGet m, Monitor ; get the screen edgesmLeft += 1, mRight -= 2, mTop + <S> = 1, mBottom -= <S> 2SetMouseDelay -1 <S> ; fastest actionMouseGetPos x0, y0 ; get initial mouse pointer <S> locationSetTimer <S> WatchMouse, 1 ; run the subroutine fast (10 <S> ..16ms)ReturnWatchMouse: <S> MouseGetPos <S> x, y ; get current mouse position x0 += 2*(x0-x), x0 := <S> x0 < mLeft ? <S> mLeft : <S> (x0 > mRight ? <S> mRight : x0) <S> y0 += <S> 2*(y0-y), y0 := <S> y0 < mTop ? <S> mTop : <S> (y0 > mBottom ? <S> mBottom : y0) <S> MouseMove x0, y0, 0 ; set new position as old, for the next timerReturn!z::ExitApp ; stop the madness; make the script persistent <S> The same logic can be used to solve the problem in any application programming environment (C++, C#, etc.) <S> which can access the Windows cursor functions . <S> On Linux, it's as simple as modifying a property for your mouse with xinput , as ben wrote: xinput set-int-prop "USB Optical Mouse" "Evdev Axis Inversion" <S> 8 0 1 <S> You'll need to substitute your device name ( xinput -list | grep -i 'mouse' ) for "USB Optical Mouse". <S> Further questions on this software should be directed to Stack Overflow , our site for programming. <A> This would be a fairly difficult thing to achieve. <S> Your device would have to behave as both a USB host and a USB peripheral. <S> There may be microcontrollers out there which can do that, but you might end up having to use two, one to be the host, and one the slave. <S> If you are suggesting something like using a serial mouse, then your job would be much easier to achieve. <S> You'd just need a microcontroller with 2 serial ports, plus two serial interface chips (Like MAX202, or whichever is the newer version). <S> An even easier option might be to try to write a windows program which would do the inversion. <A> While this is probably far from the cheapest or most elegant solution, it is one that will give you great flexibility. <S> It is not limited to mice however; keyboards and other devices are HID as well. <S> You could hook a serial mouse directly to the Arduino's serial port or if you prefer to use a USB mouse you could connect it to the Arduino via a USB host shield . <S> Since you can program the Arduino in C you can translate any sorts of inputs from the mouse into any commands you like going to the PC. <S> You could for example translate a triple click of the right mouse button into a keyboard input command, the sky is the limit. <A> Adafruit carries an open source dev board that is compatible with the LUFA stack. <S> To use a USB mouse with your custom board would be tricky. <S> Using a PS/2 mouse should be much easier though. <S> The protocol is simpler and you can probably find a library out there somewhere. <S> Here is an Arduino library that can read from a PS/2 mouse which might be of some use. <S> For the PS/2 connector, SparkFun carries a breakout board and port that should work. <S> Odds are you could also change some software on the computer to do this, which would be cheapest, but less portable. <S> A quick google search shows that this is basically one command for a Linux computer. <A> OK, here's a possible solution: As ben said, this would be much easier if you were using a PS/2 mouse, because that's basically simple serial data. <S> However, if you really need this to be a USB device, then maybe maybe you an use a USB-PS/2 converter, and a PS/2-USB converter, and place <S> your device inbetween them. <S> I had a look around and couldn't immediately find a chipset which will do the job, although they must exist. <S> But you could just buy the units : <A> Yet another solution would be to install MAF-Soft mouse <S> axis inverter driver for windows.
|
You can use the open source LUFA stack to do native USB HID (human interface device) projects. An Arduino single board computer can look to a Windows host computer like a Human Interface Device (HID), in other words a mouse.
|
Powering a breadboard with USB I've recently become quite interested in building small breadboard computers. I've been reading a site that seems to be aimed for beginners, that builds a simple breadboard computer using the 6502 and some other chips. When reading the above site I feel like I understand most of what's said, but I have problems with figuring out how to power my breadboard. It seems to be that I need to power the breadboard computer with a +5V DC power supply. I've seen some single-board computers use USB as a power supply. As I understand it, USB outputs +5V. So I figured: I could probably try and mount an USB socket to my breadboard and use it as my power supply. I don't have a background in electronical engineering (I'm in my final year on my CS degree, and I've only taken one very basic EE course), so I don't have any idea if doing what I suggest is a recipe for disaster, or a adequate solution. So, is it possible to use a USB socket to power my breadboard? If so, how would I go about to connect it (schematics would be appreciated). Thank you! <Q> USB has the concept of a unit load , which seems to be the cause of some confusion. <S> In USB 2.0 a unit load is 100mA, but a device may draw up to 5 unit loads from a port. <S> In USB 3.0 a unit load is 150mA and you can draw up to 6 unit loads, or 900mA. <S> So I don't agree with sybreon when he says that a USB powered device isn't capable of doing much. <S> He mentions LEDs as drawing much current, leaving little for the rest of the circuit. <S> Even if your circuit has ten 20mA LEDs your power budget still leaves 300mA for the rest. <A> As Steven said, a normal USB 2.0 bus can provide up to 500 mA at 5 V. <S> However, a device is only guaranteed 100 mA until it negotiates with the host to draw more. <S> Depending on how much power the host has available, it will either grant the device the ability to draw 500 mA or shut it off. <S> In practise, most desktop motherboards just connect the USB 5 V line to their internal 5 V power supply in series with a polyfuse. <S> Desktops have plenty of power, so it's not worth the expense to put the extra power detection and switching into the hardware. <S> Laptops however have limited power and they often do have the additional hardware. <S> From a laptop you are more likely to only get the guaranteed 100 mA without active communication. <S> If you are using a desktop to supply the USB power and you can grab 500 mA without talking on the USB, then you get up to 2.5 Watts. <S> Actually you get a little less because the minimum guaranteed USB voltage at full current with the maximum length and thinnest allowed cable is something like 4.3(?) <S> Volts. <S> In practise with a desktop and a short cable, you will get pretty close to 5 V even at 500 mA. <S> So what you ask it doable, but in the end I'd just get a off the shelf 5 Volt power supply. <S> Nowadays wall-wart style switching power supplies are cheap and available. <S> The minimum you can find will probably supply at least 1 A. <S> That will be more tightly regulated than what you get from USB. <A> While it can output +5V, it has current limitations . <S> If you wish to power your board with it, things can start to go wrong if you need more than say, 100mA for your project. <S> To put things in perspective, an LED can typically take <S> about 25mA. So, a USB powered project may not be capable of doing very much. <A> Legally a USB conection is not required to provide more than IIRC 100 mA, but I have yet to see a desktop that imposes this limit <S> (laptops might be different). <S> I have seen desktops that crash when you short the USB power, so using it directly in an experimental setting might not be the best idea. <S> A simple solution: put a powered hub in between. <S> Other solutions: use an unregulated 12V wall-wart + an 7805 linear regulator,or use a regulated 5V wall-wart. <S> Side notes: if your aim is to program a CPU from the ground up there are numerous easier solutions, google for PIC, AVR, LPCexpresso, etc. <S> If you want a 'real' microprocessor an 6802 (+ eeprom + 6821) provides a smaller solution because it has 128b RAM in the CPU. <A> Because the family has so many tablets \ cell phones we tend to have charging 'stations' as shown in the diagram: the 5V charger that comes with the cell phone <S> \ tablet are repurposed for breadboard projects. <S> Why risk damaging your computer when 5V supplies are inexpensive and plentiful? <S> Caution should be exercised: calculating the required current to operate your circuit and ensuring that this does not exceed the rating of your power supply / wiring is key to protecting your circuit and avoiding fire risk. <S> USB Micro-B Breakout Board (Adafruit \ Amazon): Power supply example:
|
You can also (with permission) find assorted DC power supplies from discarded electronics (BestBuy).
|
Unstable readings in photoresistor matrix with Arduino, OK with Ohmmeter - what's wrong? I'm working on a photoresistor array with my arduino, and I'm having a little trouble getting stable readings. I'm driving 7 rows one at a time with Arduino's digitalWrite(pin,HIGH) command and floating the other outputs with pinMode(pin,INPUT); Problem is, I got NO READING from my analogRead() voltage dividers unless the column is hooked up to my ohmmeter. Whats up with that? Only the column connected to my ohmmeter outputs anything at all, all the other columns read zero. Whats in my ohmmeter that suddenly makes that sensor work? So if I connect my Ohm-meter to the positive rail of P1 and to MEGA Analog 0 (A0) connection, suddenly the whole column gets readings! Otherwise, zeros everywhere. void readArray() { for(int i=0; i < ROWS; i++) { for(int k=0; k<ROWS; k++) { pinMode(rowPins[k], INPUT); } pinMode(rowPins[i],OUTPUT); digitalWrite(rowPins[i],HIGH); delay(250); for(int j=0; j < COLS; j++) { holdVals[i][j] = analogRead(j); Serial.println(holdVals[i][j]); } digitalWrite(rowPins[i],LOW); } } <Q> The answer JustJeff gave you is probably correct for why you only get something when the ohmmeter is connected. <S> I'd like to address a different issue. <S> That issue is that your photoresistor array isn't going to work. <S> The problem is that you cannot "turn on" a single row at a time. <S> For example, lets say that you turn on the middle row. <S> The top and bottom row lines are tri-stated from the uC. Current will go from the middle row line, through P5 to the left most column, through P1 to the top row line, through p2 to the next column line, and mess up your measurements for that column. <S> Now imagine lots of "false paths" and you can probably work out that everything will get hopelessly messed up. <S> One solution to this is to put a schottky diode in series with every photoresistor (with the diode "pointed" to the column lines). <S> You read a row just like you do now, although you might try driving the "unused rows" with a low signal instead of tri-stating them. <S> I'm not sure if you'll have some wacky leakage current issues if you don't. <S> Even without the diodes, however, I would have expected you to read at least some voltage. <S> Do like JustJeff said and measure the voltage on a column line. <S> If it's close to zero then you have a hardware problem. <S> If it's not close to zero <S> then you have a software problem. <S> P.S., I didn't look at your C code, since I'm not familiar with programming on the Arduino. <A> When set to measure ohms, your meter actually applies a little voltage to the item under test. <S> Ordinarily this results in a current that the meter can then use to infer the resistance being measured. <S> It just so happens that it's also providing a voltage drop that your ADC input can observe as well. <S> What you should do is set the meter for voltage readings, and see if your digitalWrite() is having the intended effect. <S> Sure seems like it isn't. <S> Maybe not. <A> A couple of things: You are not supposed to measure resistance using an ohm-meter with power applied to your circuit as a general rule. <S> On the software side of things, pinMode set to INPUT can be a little bit misleading. <S> AVR pins can actually have three modes: output, high impedance input, and internally weakly pulled up input. <S> When you specify pinMode <S> INPUT <S> you are in one of the latter two cases, because all it does is affect the DDRx register. <S> To ensure it is in fact <S> a high impedance input, you should also digitalWrite LOW the same pin, which affects the PORTx register. <S> In effect what is happening is when you set your outputs HIGH for the first time, the next time you turn them to inputs, the internal passive pullups are enabled. <S> So, in summary, instead of pinMode(rowPins[k], INPUT); use two statements: pinMode(rowPins[k], INPUT);digitalWrite(rowPins[k], LOW); <A> Lots of good suggestions <S> but I would suggest a few low-hanging fruit: 1) bad connections / loose wires <S> so the rows aren't energized; 2) <S> wrong pins connected vs. the code; I would try to rule them out before digging deeper. <S> decoding the resistor values based on adc readings can be a challenge, given how the matrix is wired.
|
I forget (off the top of my head), but you may have to actually configure the pin for output in order for digitalWrite() to work. Your low-side resistors (R in your schematics) might be too low of a value.
|
Solar cell efficiency on self tabbed cells I am tabbing solar cells myself and of course it is not done perfectly on all tabbing wires. My question is, does solar cell efficiency drop if tabbing wire is not fully tabbed on all places, or do electrons flow to the closest soldered part if there are empty spaces? <Q> Supplying a photo of your cells and your soldering would be a very good idea To be certain that what you are describing is properly understood, but ... <S> The following is based on my experience in this area: A partial attachment of the tabbing wire to the solar cell should work properly. <S> You can test this by soldering tabs to some cells with as much contact area as possible, and soldering some other tabs with very little contact area. <S> Expose all cells to sunlight and measure & record current flow when the cell is short-circuited with an ammeter. <S> There will be some variation between cells, but if the soldering is OK you will not be able to tell which way the cells are soldered by looking at the short circuit currents. <A> The current would flow with even a small connection, but there are chances of the soldering not been strong enough (as it is not in contact with the entire surface of the cell) and the tabs might peel off causing the bus-bars to get damaged. <S> As the cells are connected in series even if one of the cell gets disconnected the entire connection fails. <S> So as a practice it is better to have proper soldering techniques As far as the industry is concerned the cells are laminated with Ethyl Vinyl Acetate (EVA) sheet. <S> If the solder is not proper there are chances of air to penetrate will laminating and will reduce the life of the panel. <S> (They have to survive for 25 long years). <A> By my experience with using salvage cells is even a hair line crack can effect the output. <S> It may read ok on the multimeter but handling and heat can cause it to shift out put goes to shots to crap. <S> Flex each one just a little an make sure its not cracked at all or weak then test it.
|
If you make as good a solder joint as you can, and have a good joint along say at least 10% of the connection area, then the majority of resistance to current flow will occur within the cell.
|
Efficient way to regulate voltage What is the most energy efficient way to lower voltage? I want to lower 9V to 5V. But if I use resistance doesn't it consume energy? <Q> Yes, a resistor will consume energy, but that's not the main reason not to use one. <S> The voltage drop across the resistor will vary with the current, so if your load isn't constant (it never is) <S> the voltage will vary. <S> That's not what you want from a regulator. <S> Never use a series resistor as a voltage regulator! <S> There are two big categories of voltage regulator: linear and switcher. <S> A linear regulator usually comes as a three-legger: an input pin, ground and an output pin. <S> Typical example: LM7805 . <S> They have good regulation and are easy to use. <S> Main drawback: they're not efficient. <S> The load current passes through the regulator, and causes a voltage drop there, like the series resistor would. <S> If your 5V circuit draws 1A you'll draw that 1A from the 9V, so the load's 5W will require 9W from your power supply, that's an efficiency of 55%. <S> This becomes even worse if your input voltage is higher, like 24V. With an input voltage <S> this high the regulator needs considerable cooling. <S> You don't want a linear regulator for this kind of application. <S> A switcher (or SMPS, for Switched-Mode Power Supply) is the solution. <S> This uses a coil to build up a magnetic field, which in turn is converted back into the output voltage. <S> Switchers are a bit more complicated in operation than linear regulators, but they're much more efficient; efficiencies of 95% are often possible. <S> Since they work at higher frequencies (100s of kHz to several MHz) board layout is premium to reduce radiation. <S> Proper component selection and careful PCB layout are also important to get high efficiency. <S> The good news is that switchers are very common nowadays, and designs are much simpler than 20 years ago; many switchers only need four external components. <S> TI has a Simple Switcher series (née National Semiconductor) with online design tools . <S> AndrejaKo made an interesting remark. <S> There are switcher modules which can be used as drop-in replacement for a TO-220 linear regulator: Like he says these aren't cheap but may be the right solution if you need an efficient regulator but don't have the experience to design a switcher yourself. <A> Depending on what you need, there are several ways; basically, you have a tradeoff between linearity and power efficiency. <S> So you have DC-DC converters, which do exactly what you need (convert a voltage into another one) and have different characteristics in precision, noise and efficiency. <S> The most efficient solution is the S-class (switching) buck converter, which uses a clock and MOS switches to create a lower voltage, which will be noisy and will need to be filtered. <A> On top of the previous answers, you can also use a zener diode . <S> Like normal diodes, they resist a reverse voltage up to a certain point. <S> However, unlike most diodes, this voltage threshold is the key to their use - they are designed to breakdown at a certain threshold voltage (known as the zener voltage). <S> If you put the zener in parallel with the load, voltage across the load will be capped very closely to the voltage across the zener as long as the input voltage exceeds the threshold. <S> To increase efficiency (since the zener is used to shunt the voltage away), a low-value resistor (in series with the load) should be used to limit current. <A> Why not use a 4v Zener diode in series with the 9v? <S> The voltage drop off will leave you with 5v. <S> and a 9v is regulated as it is. <S> The practical use of a Zener diode in the shorted out configuration would be AC regulation where power is abundant. <S> Also with the Zener in series with no resistor you get higher available impulse currents with less down time leakage currents.
|
While the voltage divider with resistors is the most (in principle) linear solution, it's not good for a power supply: first because the current output unbalances the divider, and second because it's not power efficient.
|
Importance of dielectric in a capacitor We all know that if we put a dielectric inside, the voltage lowers and capacitance increases. Yet, it lowers the energy density. If capacitance increases, then more charge is stored and so its like havin more energy stored. But experiment shows that energy density and potential electric energy decreases. Why is that? <Q> The capacitance for a parallel plate capacitor is given by: $$C= [k] \epsilon _{0} \frac {A}{d}$$where \$A\$ is area and \$d\$ is distance; <S> \$ \epsilon _{0} \$ is vacuum permittivity, and k is the relative dielectric constant of the dielectric material (if any). <S> So you want C big, and a small package; so you have to reduce d - but this means higher E-field because $$V= \int_{d <S> } {E \mathrm{\ <S> ds}}$$ <S> so you can't push it too much, because it becomes easier to break. <S> So you can either try to increase A (but then the package becomes bigger) or k, which is done with dielectrics. <S> About the energy, this is given by <S> $$E = \frac {1}{2} CV^{2}\\Q= CV\\E = \frac {1}{2} Q^{2} \frac{1}{C}$$ which means that if you can increase the capacity, you can store the same charge with less voltage, so the overall energy is decreased; <S> but this is more an advantage than a disadvantage, because as pointed before, the limit for a given distance between the plates is the E-field, so with the dielectric you can store more charge with the same energy. <S> Note that in modern MOS technology, to reduce the thicknes of the Gate insulation layer it's common the use of high-k dielectrics , which allow a bigger gate capacitance with reduced leakage. <A> If you take two capacitors of identical dimensions, and in one use air or vacuum for a dielectric, and in the other, put some solid material, and apply the same voltage to each, you should find that the one with the solid material actually has higher energy density, not lower as you say. <S> If you then put equal amounts of energy into both capacitors, you will find that the one with the solid dielectric does have a lower voltage, due to the properties of the dielectric, but this is not the same as having lower energy density. <S> This is because higher energy density means more joules in the capacitor per volt on it, so it takes less voltage to store the same energy. <A> If I have understood you correctly, your confusion comes from the equation :- \$Q = <S> CV\$ <S> which implies that if the capacitance increases, the charge increases proportionately. <S> Rearranging this equation gives :- \$V=\dfrac{Q}{C}\$ ... <S> which implies that increasing the capacitance decreases the voltage. <S> But in the first case it is assumed that the voltage remains constant and in the second case that the charge remains constant. <S> Look at the top circuit below and imagine varying the capacitor's capacitance. <S> The voltage remains constant but a current will flow causing the charge to vary as in the first equation. <S> In the second circuit, the voltage source is removed. <S> If we vary the capacitance now, the charge remains constant since there is nowhere for it to go, so the voltage varies as in the second equation.
|
The purpose of the dielectric is to be able to store as much charge as possible in the capacitor, with the smallest size possible.
|
Handling of UART Errors I am not concentrating on a Specific MCU as UART of most controllers has similar architecture. They have FIFOs for Both Tx and Rx. Most common errors generated by UART are:-1. Framing Error2. Parity Error3. Over-run Error (Overflow of Tx/Rx FIFOs)4. Receive Break Error (Some Error with Stop Bits) How one should handle these Error Conditions to maintain communication properly? I do understand it's a vague question but most of the time people get confused about what one should do when such errors occur and end up in just clearing the error bits. <Q> These errors can't be fixed, so retransmission is required. <S> This needs some protocol at a higher level than the UART; you'll typically want to acknowledge the correct reception of a packet of data. <S> This packet may be 1 byte, but also longer packets can be used if the communication has little errors. <S> In the latter case discard the packet and wait for retransmission. <S> If you use packet transfers you may want to consider CRC error checking instead of parity, which isn't very efficient (adds 1 bit per byte) and only catches single bit errors. <A> To actually answer your question, I usually discard anything received with error. <S> That may include re-initializing the UART hardware, depending on what error it is and the details of the UART hardware. <S> The only exception is if you want to deliberately receive breaks. <S> Those show up as framing errors. <S> In that case you pass framing errors up to the higher levels as special conditions. <S> However, that requires out of band information to be passed to the higher levels and therefore the UART receiver interface can't be seen as something quite as simple as getting a stream of bytes. <S> I think I've done this exactly once in many microcontroller projects because it had to be compatible with a old system where breaks were used deliberately. <S> Steven has given you some good ideas what to do about this at the higher level. <S> When you think there is a real chance of errors and data integrity is important, then you usually encapsulate chunks of data into packets with checksums. <S> The receiver sends a ACK for every correctly received checksum. <S> The kind of errors the UART hardware can catch are usually due to operator stupidity, not line noise. <S> Most like noise will cause bad data, which the UART won't detect. <S> So the low level UART driver throws out anything immediately associated with a UART error, but otherwise continues to pass the stream of received bytes up to the next level. <S> In fact it does this even if you are using packets and checksums since that is done at a higher level than where individual bytes are received. <A> When there is a framing error in received UART data, odds are good that all succeeding bytes are going to be garbage until, <S> depending upon the UART, there are either ten or more bit times between consecutive falling edges on the data wire, nineteen bit times of consecutive spacing, or nine bits times of consecutive marking (the last of those will work on all UARTs). <S> If one receives a correctly-framed byte with value 0x00 or 0x80 (0x100 in 9-bit mode) and either the transmitter does not send long breaks or the receiver will stop trying to parse bytes out of any long break the transmitter sends, one can be assured that it is correct and succeeding bytes will be correct as well. <S> If one receives a value in which there are 0-6 consecutive "zeroes" in the lower bits, and the remaining bits are all set, that byte value may or may not be correct but succeeding bytes will be (one could e.g. receive a value of 0xC0 when the transmitter was trying to send 01). <S> S=START P=prev byte data <S> s=stop D= <S> current byte - = <S> idle0111111101000000011111 -- <S> Signal on linePs------SDDDDDDDDs--- <S> : As intended by transmitter (0x02)SPPPPPPPPsSDDDDDDDDs- : As received (0xC0) If each packet starts with 0x00 and is followed by 0xFF, a framing error on one packet will not affect the next. <S> When the receiver notices the framing error, it can start discarding data until it sees a properly-framed 0x00, whereupon it will know that it has a legitimate start of packet.
|
Acknowledge each packet by sending an ACK to the transmitter, a NACK if an error has occurred. However, the vast majority of the time UART errors are so unlikely and not absolutely critical that you can just ignore them at the high level.
|
Processing NTSC video feed for SPI display I have recently started a project where I want to use this small camera and and have it relay the live video to a very small color LCD, like this one through an Arduino. Unfortunately the camera has a NTSC output and the LCD has a SPI input, is there any way I can get the footage from the camera to display on the LCD or will I have to use a different screen? <Q> Well you would need to digitize the video, extract luminance, chrominance & sync information, downscale from 525 lines to 128 lines and output the data over SPI in real time. <S> This sounds like a non-starter to me. <A> EDIT: <S> I was wrong about the video through the TTL interface: you can take snapshot and send them through the UART, but for the video the only way is the analog output. <S> So for it you will need a fast ADC and digital manipulation, and it won't be so easy. <S> Though, you can use it to send pictures with a low framerate, like "real-time" weather monitoring webcams. <S> What you need to define is the encoding of the image from the webcam (bit depth and framerate) and eventually write the code to convert it in a format compatible with the display (it has different options, read the datasheet). <S> It may be possible also to forward directly the image from the TTL input to the SPI input without processing, but you still have to handle the communication and it will be easier if your uC has both the UART and SPI interfaces. <S> So it's not impossible, but requires some work. <A> Capturing a black and white NTSC video signal isn't overly difficult, especially if you're not too worried about resolution or frame rate. <S> There was a video capture gizmo that plugged into the printer port of an Amiga 1000, for example. <S> No fancy zillion-megahertz microcontrollers back then--just some discrete logic, a sample-and-hold, and a not-terribly-fast ADC which IIRC captured 5-bit data at 15KHz (about 5-seconds per frame, black and white). <S> I would expect that you would want to, and could, capture monochrome data faster than that with a decent microcontroller. <S> If you want to capture a crude 128x100 image at 30fps, you'd probably need to capture about 0.8 megapixels/second (capture 1/4 of the pixels horizontally on each scan line, on two fields). <S> Capturing color from a "general" NTSC video source is much harder, since there's no fixed relationship between chroma phase and horizontal position. <S> Many video sources, however, including cameras, computers, and DVD players do have a fixed relationship between chroma and horizontal position (there is a standard for what the relationship should be for "perfect" video, but not all devices comply; most devices other than VCRs will have a consistent relationship, but they may or may not match the standard). <S> If you can design around a particular known input source, and can accurately measure timings with regard to horizontal sync (timing precision will be much more important than with monochrome video) <S> color sampling may be practical. <S> Without knowing what you're wanting to do, I can't say what the best approach would be. <S> You might be best off using an LCD display with a composite video input and overlaying video on that. <S> Color overlay is generally a pain, though if you want a horizontal "split screen" it might be possible to cheat (sets with analog color circuitry would not work well if one part of the screen used different color phase from another part, but LCD screens with a digital front end might not mind; if you generated your own chroma on lines where you wanted to display your own color, and let the camera chroma through on others, I'm not sure what would happen).
|
It would be easier to use the JPEG digital output from the camera and decompress this, since the resolution is compatible with the screen (160 X 120 vs. 160 X 128) although you still wouldn't get real-time video.
|
How to enable serial emulation through USB in a STM32F4 Discovery board? I've been searching for this and still haven't found anything about it. This board connects directly to the host PC with a USB bus. Is it possible to emulate a serial port in this case? <Q> There are two USB connections on the board - the micro USB connector at the top and then the micro A/B connector for the USB On-The-Go support. <S> The first connector is the programming interface - <S> this connects only to the programmer chip and not to the actual target microcontroller. <S> There's no way to use this connection as an emulated serial port. <S> As for the USB OTG connection I'm less familiar with it but <S> judging by the Wikipedia page on the subject it seems that it's not really meant for that either - USB OTG is focused on acting as a semi-host for peripherals such as thumb drives or bluetooth adapters or something. <S> However, it is perhaps possible that you could configure the OTG device to act as a regular USB device and then code a serial port emulator to reside on the board, but that's a whole development effort on its own. <S> You're best off attaching a cable like <S> this <S> to the UART pins on the board and interfacing through the UART on the microcontroller that way. <A> You might want to check out my question (and answer): <S> ST-LINK is serial communication possible? <S> I managed to run serial communication over SWD. <A> This project implements CDC USB serial on the STM32F4 Discovery. <S> https://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB <A> If there is a way to send serial data from the STM32F4 to the PC thought the programming USB connection, I have not seen how to do it. <S> I managed to get ( text type ) <S> GPS data to the PC as follows: <S> (1) Adapt the USART software example for the STM32F4 at "Elia's" website(2) Connect the STM32F4 TX and RX and GND pins to a USB-serial device such as I use for serial communication between the Arduino and PC or the GPS device and PC.(3) <S> Use PuTTY to display the serial data being received at the PC. <S> This seems to work <S> but it rather annoying. <S> I also cannot make it work in both directions, which I could do with the Arduino and other devices.
|
Just doing a quick Google search yields no serial port emulators and from my assessment of how OTG works my initial reaction is that it won't work.
|
How do I detect revision of a particular PIC microcontroller? I have a PIC18F4680. After reading the datasheet, it's still no clear to me how can I determine which revision the chip is. So how do I determine the revision of the microcontroller other than asking the supplier to provide that information to me? Answers relevant to other PIC series are welcome too. <Q> There are two Device ID bytes DEVID which you should be able to read along with the config bits in MPLAB. <S> The device ID bits include a 5-bit revision code. <S> The errata sheets for the different revisions give a revision code, so you can match this bit string with the right revision code. <S> e.g. the rev A3 code is 0 0100, whereas the rev B1 code is 0 0111. <S> If all else fails, or if you have a bunch of ICs in a tube + can't easily hook them up to a programmer, the IC should have a date code that's the last two digits of the year followed by the week number. <S> (e.g. 1214 for 2012, April 1 <S> which is week 14) <S> You should be able to call up your Microchip rep <S> and if you ask nicely they should be able to tell you what silicon revision that is. <S> (I can't remember if they put the silicon rev # on the packaging. <S> TI C2800 DSPs do.) <A> Not sure about MPLABX, but in earlier versions, the programmers (certainly for ICD2,3 and PICkit3) display the rev in the output window when they connect. <A> It seems I managed to find the answer to my question. <S> In the PICkit 2 installation directory, there should be file named PICkit2.ini . <S> This line: REVS: needs to be added to it in order to display the revision of the connected chip. <S> The revision will appear to the right of the checksum value. <S> This feature needs software version 2.10 or later. <S> Source
|
If you look in the Flash Programming Specification for your device (document DS39622L in your case) you'll see this table which includes the device ID bits:
|
Sensors to detect high speed object crossing plane I'm looking to detect a somewhat small (5-20mm) high speed (600m/s) object crossing a stationary 0.5m x 0.5m plane. When the object crosses the plane, I want to know the X, Y. I apologize for the very broad nature, but I'm just trying to figure out what kind of sensors could be used to construct such a device. I plan on using the arduino for processing, but am clueless wrt sensors. (I'm really a software guy - dont kill me!) Thanks,Chris <Q> Do the math. <S> 600 meters per second is 1342 miles/hour. <S> Mach 2.0 is 680 m/sec. <S> We're talking "bullet" here. <S> Assuming 5 mm for the projectile length, it will cross the plane in 8.33 microseconds. <S> A 20mm projectile will take all of 33.3 microseconds. <S> The traditional way to measure the accuracy and precision of a bullet trajectory is to shoot it at a piece of paper, and see where the hole shows up. <S> An Arduino is going to be kind of wimpy for image processing, though. <A> The way a bullet chronograph works is it measures the momentary change in light intensity through an aperture with a diffuse bright background (either the sky, or a white plastic diffuser), by means of an infrared or visible-light photodetector such as a phototransistor or photodiode. <S> If you don't need a super accurate XY coordinate on the plane, you could potentially use the same method with an array of photodetectors along each axis, and some optics or shields to restrict which parts of the plane each photodetector can "see". <S> You would then calculate the position of the projectile as it passes across the plane by looking at which photodetectors triggered (changed intensity) at the same time. <S> Alternatively, a very high speed CCD (or two) could work. <S> You could calibrate the system using a reference plane printed on a panel, to know which pixel corresponds to which coordinate on the plane. <S> I doubt the Arduino has enough processing power for running computer vision algorithms, so this may not be plausible in your application. <A> How much development do you want to do? <S> There might be several ways to do tomography within a 500mm2 window. <S> At 600m/s, the projectile will move 15mm in one cycle of a 40kHz ultrasonic acoustic signal. <S> If you had several transmitters and receivers around the edge of the detection window, you might get enough signal at the receivers to reconstruct where the extra echo was coming from. <S> Compared to light, it is of course to all intents and purposes, stationary. <S> Being small, it will not be a good reflector of radio signals until its size approaches a wavelength. <S> Perhaps you could jig some 6GHz doppler door openers (cheaply available) around the periphery and do the same reconstruction on the echoes trick. <A> You can use the timing of the sonic disturbance from several microphones placed around the periphery of the target. <S> 3 would be the absolute minimum required but I would recommend 5 to 10. <S> The pulses will need to be timestamped with a fast enough master clock to get the resolution you desire. <S> This becomes a relatively simple statistical analysis when the aparatus is operation correctly. <S> The projectile willjust need to be traveling <S> > M=1.0 when it crosses the threshold of the mics.
|
You COULD use something like black construction paper, lit from behind (light OFF AXIS!) and use a TV camera to detect the sudden appearance of a bright spot where there wasn't one, where the newly-punched bullet hole is now letting light through.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.