source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Connecting more than one serial device to PIC16f877a In my project i need to interface a gps receiver and a gsm modem to pic16f877a, But there is only one set of UART lines in this Microcontroller. Is it possible to multiplex these two devices using software without the use of additional hardware? <Q> You're approaching the problem in the wrong way. <S> Luckily, such things are available, for example among the PIC24's there are chips that have two UART ports and two I2C ports. <S> These are still PIC, so you can apply your PIC16 skills. <S> Match the microcontroller to the application! <S> Do not have a "pet" microcontroller that you use for everything, no matter what. <S> There isn't much reason to use a PIC16 today in a new design. <S> It's great that Microchip stands behind them and still makes them. <S> But the primary value of this is that you can replace a nonworking one in an old device. <A> As was stated in the other answers consider switching to a more advanced PIC with 2 UART modules. <S> The PIC18 series of microcontroller is still 8-bit, but offers more peripherals than the PIC16's. <S> Switching to a PIC18 would also allow you to take advantage of the Microchip C18 compiler which makes writing the programs easier (can be written in C instead of Assembly) and the compiler comes with a set of software libraries, for example a software implementation of a UART peripheral. <A> If you have an I2C or SPI interface available on your micro, you could hang a UART (e. g. XR20V2170IL40-F) off that.
You have two devices that put out serial data, so you need a microcontroller with two UARTS.
What kind of oscillator should I use for a binary clock? I've seen that a lot of clocks use a 32.768KHz crystal. I'm curious why that is exactly. I am working on a binary clock project with some 4520 ICs. I have some 555 timers too, but I want to use a crystal if I can. I just don't know what would be the most accurate. I also don't know anything about the configuration. For instance, does the 32.768KHz need to be used with resistors or capacitors to operate? <Q> a lot of clocks use a 32.768KHz crystal. <S> I'm curious why that is exactly. <S> This particular crystal is optimized for use in clocks. <S> The low frequency operation consumes less power than oscillators that run in the Megahertz. <S> The small size, unusual for a low-frequency crystal, allows it to be used in watches. <S> And the chosen frequency can be repeatedly divided by 2 until an exact 1-second time period is obtained. <S> The extra load capacitance isn't required to make it oscillate. <S> It's required to bring the crystal exactly on frequency. <A> When divided by 2^15 it gives 1s. <S> Most 32.768 kHz oscillators on MCUs have built-in capacitors. <S> You just have to select a crystal with the correct load capacitor value, which will be in the MCU data sheet, to ensure accurate timekeeping. <S> The smallest PIC with a suitable timer for a 32.768 kHz oscillator appears to be the 8 pin 12F675. <A> $$32768=2^{15}$$ <S> Some PICs of the PIC16 series have an 8-bit timer which gives an interrupt on an overflow. <S> The minimum prescale value is 1:128 and \$128=2 <S> ^ <S> 7\$. <S> So with a 1:128 prescaler, you'll get an interrupt in every \$128\cdot2 <S> ^ <S> 8=2 <S> ^ <S> 7\cdot2^8=2^{15}=32768\$ pulses. <S> At 32.768kHz, that's exactly once per second. <S> I suspect other chips work with similar values. <S> You absolutely should use a crystal when designing a clock. <S> A 555 isn't stable at all . <S> Little temperature variations will cause huge timing variations. <S> Most PICs will want you to connect it directly to the OSC pins, with small capacitors to ground. <S> In case you just want an oscillating signal, use a crystal oscillator like here .
It depends on the chip you're using how you should implement the crystal.
Why aren't 1Hz crystals used to measure seconds? According to Wikipedia: Many clocks use a 32.768KHz crystal. Is this because the crystal is smaller than a 1Hz crystal? If 1.0 Hz == 1.0 second. Then, why the need for the division? <Q> The main reason is that a 1 Hz crystal would have to be physically very big. <S> A crystal is a piece of quartz that mechanically vibrates at the specific frequency. <S> Since quarts exhibits a fairly strong piezo-electric effect, those vibrations also cause electrical signals and vice versa. <S> Getting a physically small crystal down to 33 kHz resonant frequency was quite a breakthru not that long ago. <S> The trick is to shape the quartz like a tuning fork. <S> That allows for much slower oscillations than a solid block of quartz of the same size. <S> However, extending that another 3½ orders of magnitude is going to make the crystal a lot bigger. <S> It's hard to imagine what use a 1 Hz crystal would be, considering how cheap and easy it is to start with a faster frequency and then divide down with a counter. <S> 33 kHz is already so slow that you won't get any significant power savings by running the logic any slower. <S> In fact, filtering the harmonics from a 1 Hz square wave and still providing the drive for the size crystal that it would take to make that frequency would take significantly more power. <S> It just doesn't make sense. <S> Put another way, a 33 kHz crystal with its drive circuit and a digital counter is smaller, cheaper, and takes less power than a 1 Hz crystal with the drive circuitry it would require. <A> If you have a 1Hz crystal to generate 1 second ticks, every bit of that jitter manifests as error in your clock. <S> If you start with a higher frequency and divide down, that error gets minimized. <S> For example, a 1Hz crystal with 1% jitter would give you 1 sec +/- <S> 1% ticks. <S> A 1kHz clock with 1% jitter going through three divide by 10 chips will give you 1 sec + <S> /- 0.001 % ticks. <S> EDIT: <S> http://www.silabs.com/Support%20Documents/TechnicalDocs/Clock-Division-WP.pdf shows a great discussion on this. <S> Look particularly at the phase noise reduction as division increases in figure 6, and the following table, which shows the jitter expressed in time as staying constant. <A> Most of life's "physicality" isn't going to affect a 32k xtal. <S> We live physically in the low tens of Hz maximum (except hearing) and a 1Hz xtal is gonna come in for a few resonant bumps. <S> Given also that it's nearly a qtr of a mile long (according to Brian Drummond) settles the argument for me. <S> OK maybe bats can disturb a 32k xtal? <A> From wiki: A crystal's frequency characteristic depends on the shape or 'cut' of the crystal. <S> A tuning fork crystal is usually cut such that its frequency over temperature is a parabolic curve centered around 25 °C. <S> This means that a tuning fork crystal oscillator will resonate close to its target frequency at room temperature, but will slow down when the temperature either increases or decreases from room temperature. <S> A common parabolic coefficient for a 32 kHz tuning fork crystal is −0.04 ppm/°C². <S> In a real application, this means that a clock built using a regular 32 kHz tuning fork crystal will keep good time at room temperature, lose 2 minutes per year at 10 degrees Celsius above (or below) room temperature and lose 8 minutes per year at 20 degrees Celsius above (or below) room temperature due to the quartz crystal. <S> In practical terms, a 1Hz crystal will mean that the slightest change in temperature, will cause the clock to be fast or slow by minutes per day, instead of nanoseconds. <S> Over a year, that would make it one of the most inaccurate clocks ever, without daily adjustment. <S> And that is just temperature. <S> Pressure (And Altitude), Humidity, and vibration also come into play. <S> So unless the crystal is in a a completely controlled environment, it is simply impractical for common everyday time keeping use.
Aside from the practical aspects of making a 1 Hz crystal, every crystal is going to have some degree of jitter. There is also the problem with drift, due to environmental issues.
Do I really need to solder headers to a shield? Or can I just plug it into my Arduino? I recently purchased an MP3 Player Shield for my Arduino. I bought a couple of headers to run through the shield's holes down to my arduino. Is this TRULY necessary (for testing purposes)? Or could I just plug it in and down to the Arduino. By "plug it in and down to the Arduino," I mean running the stack headers through the shield's pinholes and down into the female pins of the arduino" without any soldering. <Q> Now that you have explained that the alternative to adding headers to your daughter board was just letting the pins stick thru the holes where the header would be soldered, this question can be easily answered. <S> NO, that is a really bad idea . <S> If the holes are plated thru, which they probably are, the pins will make contact most of the time. <S> That's the worst case scenario for a bug. <S> However, the metal of each pin won't be solidly held against the ring of metal that is the plating inside the hole. <S> That ring is a bit bigger than the pin, so the pin will make contact intermittently if there is any vibration. <S> Overall, your system will be flaky. <S> This is what sockets with their spring-loaded mechanisms are for. <S> If it was so simple that you could just stick the pins thru the holes, whoever designed the board wouldn't have added the extra trouble and expense to specify a socket. <A> This way the connection is reliable and secure instead of intermittent. <S> This is true for your final projects and for testing purposes. <S> Hope it helps someone in the future! <S> P.S. <S> If you have trouble figuring out where to solder, here's an awesome quick start guide for the MP3 Shield (Pretty sure it's similar to other shields, in terms of soldering stack headers). <A> I assume the alternative you were thinking of was to put the shield on top of the Arduino and use a row of unsoldered male headers to connect the two. <S> It’s a seductive idea, but as I learned myself this week, it tends to be way unreliable.
For anyone who may later stumble into a similar dilemma, it turns out that you should solder the headers to the shield.
How do arcs generate radio-frequency When I have an electric arc, and put an AM radio nearby, I hear a crackle and the station that I previously heard goes away. I am wondering what is going on with the electricity through the air to generate the noise that I heard through the radio. <Q> It's a spark-gap transmitter - here are some words from the internet <S> "Spark gap transmitters are the oldest type of radio transmitter made by man. <S> They were first used around 1888 and remained legal until the 1920s when their use became greatly restricted. <S> World War II delayed their complete ban outside of emergency communications for a few years. <S> Now the only way to use them legally is inside a faraday cage. <S> They operate as jammers for the same reason they were banned, they take up a lot of the radio spectrum. <S> A spark gap transmitter is fairly simple. <S> Send a high voltage current through an air gap, when the resistance of the air breaks down a spark will cross the gap. <S> When this happens electromagnetic radiation is emitted." <S> The difference between your welding apparatus and most spar-gap transmitters is that they had tuning coils and capacitors so that the spark energy could be constrained in the electromagnetic spectrum. <S> Having said that they weren't particularly good at that hence they were banned. <A> Such pulses are essentially square waves which generate wide-band RF. <S> Something similar happens with a lightning strike, or a nuclear explosion. <S> The latter produces an intense electro-magnetic pulse (EMP) which generates colossal E and H fields. <A> The reason is that a spark is a wide band frequency generator. <S> It broadcasts noise over a wide range of frequencies. <S> Some of those frequencies are the same as your radio is tuned to. <S> The way AM modulation works, the radio can't distinguish the what was produced by the radio station and what was produced by the spark over the narrow band it is tuned to. <A> A circuit with an electric arc in it is actually (well, usually) a 'relaxation oscilator'. <S> There is a small capacitance between the electrodes of the arc, and both resistance and inductance in series with it. <S> The voltage rises across the spark gap until it is high enough to form an arc. <S> The arc itself has what is called 'dynamic negative resistance', which means (over a certain current range) <S> the voltage across the arc goes down when the current in the arc increases. <S> Weird, eh? <S> So, to continue: the voltage across the gap rises until it arcs. <S> The arc discharges the capacitance until it is below a sustaining voltage and the arc goes out. <S> Now the capacitance charges up again until it arcs, and the cycle repeats. <S> Each discharge in the cycle is very rapid, making broadband RF pulses, as stated in other answers. <S> When I saw your question, I thought perhaps the negative resistance of the arc is what makes the RF, so I searched on 'negative resistance arc oscillator' and found this link: <S> PoulsonArcOscillator . Turns out negative resistance isn't mostly where the RF comes from, it is the relaxation oscillator, as I described.
The arc results from the air being ionised by a high voltage resulting in a high amplitude pulse, or series of pulses.
Current produced by thermocouples I can't seem to find an answer to this on Google. Take a K-type thermocouple for example. The voltage produced is around 41uV/K. I'm wondering how this changes when a load is put across it. What equation determines the current? Can I assume that the thermocouple is equivalent to voltage source and internal resistance? What current would typically be produced when short-circuited? Thanks <Q> My understanding is that the thermocouple voltage is strictly a function of the temperature. <S> Apparently this is called the Seebeck Voltage . <S> The short-circuit current will be determined by that internal resistance by the usual Ohm's Law calculation I_ss = <S> V(temperature) <S> / R_internal. <A> Thermocouples can and do provide useful power. <S> Long distant satellite probes are powered by RTGs: http://fas.org/nuke/space/gphs.pdf <S> This document describes how the thermo-electric effect is used to power these spacecraft, with, typically 572 junctions, generating 294W <S> ( 28V @ 10.5A) <S> at the beginning of a mission, reducing over time as the radioactive source decays. <S> http://www.osti.gov/scitech/servlets/purl/4716190/ describes in detail, exhaustive research into materials that could be used in these generators. <S> Silicon-Germanium junctions produce >300 microvolts per degree K, which is high compared to a typical 'measurement' grade thermocouple junction. <S> If you want to use a thermocouple to measure something, then you need to cause as little current to flow as possible. <S> If you want a junction to provide current, then you take as much as you can whilst allowing for the voltage drop across the junction. <S> A very similar issue with PV panels on the roofs of houses, where the PV inverter reduces the current drawn, to maintain the voltage, to give the maximum power extracted. <A> I landed on this posting after searching google to see how much current I could pull from a thermocouple without materially affecting the measurement. <S> I didn't find that exact answer here (and also didn't quite believe that a thermocouple is truly an ideal voltage source) <S> so I made a measurement. <S> The resistance of this thermocouple is ~4.5ohms (measured by applying 100mA and measuring the voltage) and from the plot we can see that sure enough it acts like a voltage source with a ~4.5ohm series resistance. <S> I tried a few other thermocouples that I had and got very different values of short-circuit current (one large one gave >20mA @150C!) <S> but all tracked more or less the loop-resistance model. <S> I have to say that I was surprised by the magnitude of the current produced. <S> The one I measured output 10uA per degree, meaning that I could pull 1uA from the device and still have 0.1 degree accuracy. <A> The thermocouple wiring into an instrument wants to connect to circuitry that approaches an ideal volt meter. <S> That is a circuit that does not load the thermocouple at all. <S> As a matter of fact a thermocouple in a stabilized situation will not have any current flowing in it at all. <S> The thermocouple voltage is not produced in the junction but rather over the full length of the wires between the junction end and the cold junction end at the instrument. <S> In other words thermocouples are measuring a thermal gradient along the wires. <S> I see no useful value to consider putting a "load" across the thermocouple wires at the instrument. <S> Instead you want to be thinking about how high of impedance instrumentation amplifier you can obtain to monitor the differential voltage between the two wires.
Like any voltage source there is an internal resistance associated with it due to "real world" effects.
Can an Arduino use a 12 V relay? So I wanted to play around with relays and clearly got it wrong even before I got started. I wanted to control a 12 Volt fan - thinking that it would have a capacity of 12 V to control.. But now I know that it takes 12 V input and can control upto 250VAC... I have ordered some new 5 Volt relays, but want to know how I can use the 12V relay with an arduino _____________? (bear in mind that I'm a newbie) This is the relay module I bought : UPDATE Thank you all so much for finding your time to help me out, I really appreciate it!First now I found the time to try out your suggestion. @jippie comment: ..(or Vin on Arduino if you are feeding it from a 12V supply) got me think about what I really wanted. I wanted to use the 12V power supply to also feed the arduino (hehe..)- but posting the question I needed to know the anwser to whether an "under"-powered arduino could control a 12V relay. But first validate that the relay is actually working! So found a 12 V adapter and connected it to a breadboard. Then connected it to the relay by NC and COM Compiled the Blink code example and hooked it up using Vin, GND and D13 I then hooked my Arduino to a 9V battery and tried the 5V output Unfortunately this did not work.. @Madmanguruman and @Kurt thank you both for your answers - I'm just too newbie to figure out all the things you were talking about. UPDATE 2 Forgot one more possible combination This kinda brings me down to these options with my relay: Control something that requires more than 12 Volts, but power the arduino with 12 Volts Use it to control DC gear motors without using and H-bridge and diode (kinda expensive) Use the NC (Normally Closed) and NO (Normally Open) logic to do something neat All this got me thinking.. If I need to power my Arduino with 12 Volts to control a 12 Volts device - why don't I just connect my device directly to my Arduino ____? As mentioned many times: I'm a newbie and just want to learn electronics mostly by Learning-by-doing - but without putting myself at risk and breaking things (like my Arduino) But why would this not work: simulate this circuit – Schematic created using CircuitLab EDIT : Controlling 12v DC motorfan with arduino Firstly, even if a motor or pump or fan (anything with coils inside) is 3V or 5V, do NOT power it directly from the Arduino pins as the Arduino pins can only supply a maximum of 40mA. As per my previous article on Arduino pins, they are not designed to drive a DC motor or coils. UPDATE 3 Using 9V and Vin also worked :) So guess the answer is: Yes, but I have to use >= 9V (perhaps lower, but not 5V) and the Vin. <Q> This board is designed to work with 5V logic level control, according to the link you provided. <S> I couldn't find a spec sheet so the following is speculative: you supply +12V and ground to the VCC and GND pins, and use a logic level signal on the IN pin to switch the relay on and off via Q1 and the optoisolator. <S> So, if the logic level signal can control Q1, your relay may actually work as-is. <S> Changing the relay itself may not help if Q1 can't deal with 3.3V gate drive. <S> (Q1 is marked 'J3Y', so it may be an NPN transistor known as 'S8050'. <S> A logic-level MOSFET like a 2N7002 may work better in this application. <S> Again, pure speculation without a spec sheet.) <S> Overkill, sure, but it will do the job just fine and will scale up to allow you to play with bigger stuff as your confidence grows. <A> I'll leave the long talks to the other answerers. <S> If the exact module you bought is the one on the picture then: Connect: GND to <S> GND on Arduino <S> Vcc <S> to 12V (or Vin on Arduino if you are feeding it from a 12V supply) <S> At this moment I would verify the voltage on pin IN <S> , this should be near 0V with respect to GND, if it is higher than 5V stop here. <S> If it is near 0V, the last step is to connect: IN to the digital output pin you conotrol on Arduino. <S> So my answer is: If memory serves me right, my answer is: yes you can drive this type of module from Arduino. <A> First off, a common automotive relay would work plenty fine, unless you are trying to switch power for a high voltage device or you really wanted that opto-coupler in there. <S> In any case, take a look at this simple circuit: Because a logic Level MOSFET is used, the transistor only needs a small voltage at the gate to fully turn it ON. <S> When the signal from the microcontroller is HI, it will turn the FET ON, connecting the relay to ground and powering the fan or other devices. <S> When the MCU pin is a LO signal, Q1 will turn off. <S> If the MCU is disconnected or the pin is in some unknown state (hi-Z, for example) <S> the resistor R1 will pull the gate LO to turn the transistor off. <S> either way, when Q1 turns off, the relay will also disconnect the power to the fan. <S> This circuit could be similarly made with BJT transistors; I just prefer FETs. <S> The only thing to consider here is that the transistor must be able to sink at least as much current as the relay coil uses when the relay is switched on. <A> You tried powering the relay from a 12v power supply and it worked, but when you tried a 5v supply, it did not. <S> Try connecting the Relay's VCC to the Arduino's VIN, which would be the 9v. <S> The relay requires 75% of the nominal voltage to "Pickup". <S> 12v * 0.75 = 9v. <S> That's the bare minimum that is needed for the relay to activate. <S> So your 9v battery might not be enough, but a fresh one should. <S> Once it's activated, the relay will consume about 25~30mA, and should, according to the datasheet, stay on until the VCC goes down to about 10% of the nominal, which is 1.2V. <S> AND you could simply power the arduino from the 12V power supply in the first place, instead of the low capacity 9v battery. <A> This is because even I had the same problem. <S> Now connect the vcc of relay to 12v adapter. <S> Now connect the one end of the transister (refer to data sheet) to 12 adapter connect the middle pin of transistor to one of the pwm pin of arduino . <S> Program the arduino to be high on the pwm. <S> Connects <S> the last end of the transistor to the relay 12 v signal pin <S> and you are good to goWhen <S> the pwm pin is high the 12v flows through from the transistor to the last pin and here is how you control 12v relay with 5v pwm arduino <S> ThanksSwaton
There's nothing inherently wrong with your relay as far as controlling a fan goes. So all u need is a high voltage (12v) transistor and the other parts : arduino, 12v adapter and relay.
How can an SR Flip Flop be made using a D Flip Flop and other Gates? An SR flip flop is a flip flop that has set and reset inputs like a gated SR latch. How can an SR Flip Flop be made from using a D Flip Flop and other logic gates? I've done several searches online and nothing really explains this. I believe a latch can determine values based on inputs and/or the clock? And flip flops are dependent on the inputs? I've sketched several circuits and the SR FF always seems more basic than the D FF.. So I'm confused as to how this can be shown. My book is terrible at explaining things and the questions are basically irrelevant to the explanations in the chapters. <Q> A D flip flop simply latches the value of a wire on it's D pin at the rising edge of a clock. <S> Using three inputs ( S , R , and Q (output of the DFF)), you need to create a small combinational circuit which mimics an SR flop: <S> If S is set, the value of D should be 1 <S> If R is set, the value of D should be 0 <S> If neither is set, the value of D should be Q <S> With these three statements it's simple to create a small truth table and from that to create the combinational circuit which should drive your D pin. <A> You are quite correct that the SR FF is more basic then the D FF. <S> In fact, I expect you would find one or more SR flip-flops inside a D FF. <S> For this reason, I assume doing what you request would only serve as an academic exercise. <S> Since the main difference here is that the D FF has an added clock, what needs to be done is to generate a clock signal when either button is pressed. <S> (Assuming the inputs are push buttons...the exact implementation will depend on this detail). <S> So, gather together some logic gates to generate the following conditions: A logic term, that will be low when the R button is pressed, and high when the S button is pressed. <S> A clock term, that is normally low, but goes high when either button is pressed. <S> For completeness, there probably needs to be some delay in the clock term, so that it doesn't change until after the logic term has changed. <S> This can be done by a pair of inverters that don't change the signal, but do delay it. <S> Of course, if your particular D FF has "preset" and "clear" pins, you may not need to build anything! <A> First of all, I think that you need to understand a bunch of concepts in order to answer your question:All digital designers use the name flip-flop for a sequential device that normally samples its inputs and changes its,outputs only at times determined by a clocking signal. <S> On the other hand, most digital designers use the name latch for a sequential device that watches all of its inputs continuously and changes its outputs at any time, independent of a clocking signal. <S> However, 'some textbooks and digital designers may (incorrectly) use the name "flip-flop" for a device that we call a 'latch." <S> In any case, because the functional behaviors of latches and flip-flops are quite different, it is important for the logic designer to know which type is being used in a design, either from the device's part number (e.g., 74x374 vs. 74x373) or from other contextual information. <S> Regarding to what you have asked, S-R latches are useful in ''control" applications, where we may have independent conditions for setting and resetting a control bit. <S> If the control bit is supposed to be changed only at certain times with respect to a clock signal, then we need an S-R flip-flop that, like a D flip-flop, changes its outputs only on a certain edge of the clock signal. <S> You can get a master/slave S-R flip flop by using two S-R latches. <S> Fig: The logic symbol for the master slave S-R <S> flip- flop does not use a dynamic-input indicator, because the flip-flop is not truly edge triggered. <S> It is more like a latch that follows its input during the entire interval that C is 1 but changes its output to reflect the final latched value only when C goes to 0. <S> In the symbol, a postponed-output indicator indicates that the postponed-output signal does not change until enable input C is negated. <S> Flip-flops with this indicator kind of behavior are sometimes called pulse-triggered flip-flops. <A> An example chip would be a 74HC74 dual D flip-flop.
An S-R latch can be made from a D flip-flop that has "Set" and "Reset" pins by grounding the clock and data pins.
Serial and parallel circuits and power If I have 12V of power, and wanted to power LEDs with a forward voltage of 2V, could I only power 6 of them? Would I connect the cathode of one to the anode of the next, creating a kind of serial connection? Or is there a way to have each LED be it's own loop? Thank you. <Q> You can do it either way. <S> Each LED can be its own loop, or you can do it in <S> In series-parallel, you have multiple current loops. <S> Each loop can carry as many LEDs as you can power from your supply voltage. <S> For example, if you had LEDs with a nominal 1.7Vf, then you would have 5 LEDs for a total of 8.5V. With a power supply voltage of 12V, a reasonable resistor choice for each branch would be (12 - 8.5)/.02 = 190. <S> Closest standard 5% resistor value I can think of is 220 ohms which would give you 16mA per branch. <S> Should be plenty bright enough. <A> There are some basic rules regarding voltage and current: <S> The current in a series circuit is everywhere the same <S> The total current drawn by a parallel circuit equals the sum of the different parallel connected circuits <S> You can use 5 LEDs in series with a current limiting resistor (see the comments). <S> Schematic created using CircuitLab <S> You can also give every LED its own "loop". <S> That is, you make sure no LEDs are connected in series with each other. <S> That could be useful when you want to switch them on and off separately. <S> Normally, an LED uses like 20mA on 2V <S> (I'd say 2.5V, but well). <S> You might want to check the datasheet on this to be sure. <S> Given that the LED takes 2V <S> , that's 10V left to dissipate 1 . <S> You'll use a series resistor for this. <S> It has to take 10V at 20mA <S> (the current in the series is the same everywhere), so you can calculate the resistance with \$R=\frac{V}{I}=\frac{10}{0.02}=2\text{k}\Omega\$. <S> So the circuit would be like this: simulate this circuit 1: <S> dissipate, yes, in heat. <S> This is not energy-efficient! <A> Choose a current per LED (e.g. 10mA) and choose one resistor in series with the LEDs to get the desired current. <S> The formula for the resistor is:$$R = \frac{12V - 2V}{N\cdot10mA}$$ where \$N\$ is the number of LEDs. <S> If you choose a different current, just replace the 10mA in the above formula by the new current.
You can also use multiple series of 5, in parallel, like this: simulate this circuit – You should probably connect the LEDs in parallel.
Energized circuit in a 3M Static Shielding Bag (silver color) I'm wondering if it's safe to put an energized circuit in a static shielding bag...as part of a high altitude balloon project. I'm not too sure how these work, so I tried seeing if either the outside or inside of the bag was conductive on a regular multimeter, which I found that it was not. <Q> I wouldn't put a high voltage spark generator in it but most other stuff will be <S> OK - circuits won't break or burn-out because the resistance of the static bag is higher than a regular multimeter would read. <S> Having said that some may be lower than a couple of Mohm. <S> This link might prove to be insiteful: - <S> Do antistatic bags have conductive interior, exterior or both? <A> Yes they do have conductive interiors and exteriors. <S> However the surface of the bag has may mega-ohms of resistance per inch. <S> If you would like a comparason, an antistatic bag is very similar to an anti-static mat. <S> If you have high voltage or extremely sensitive components/analog circuitry you may run into problems. <S> Another problem that the normal user shouldn't have, but could be an issue, is if you are working on a board that has traces extremely close together. <S> One other note, is that if you seal the bag, it can act like a faraday cage, and prevent/inhibit radio signals from entering or exiting the bag. <S> Alternatively instead of putting the circuit inside of an antistatic bag, a better way may be to create a large ground plane on the circuit, and then use some TVS diodes like these to protect any important components. <A> While they might by slightly conductive, all you need to do is insulate your circuit, from the bag. <S> Don't let any metal/conductive part touch the bag and you would be fine, for normal, non-high voltage circuits. <A> Also, keep in mind there are 2 types of static shielding bags and one might be more suited for your purpose: <S> Metal In Static Shielding Bags Metal- <S> In static shielding bags offer superior durability at a low cost. <S> Enhanced durability is obtained with the metallized layer buried between the polyester and the polyethylene layers of the metal-in shielding. <S> The metal-in layer prevents the penetration of damaging electrostatic fields. <S> Tribocharging is minimized by specially processed, non-static-generating polyethylene. <S> This type of bag is recommended when packaging static sensitive components. <S> Metal Out <S> Static <S> Shielding Bags <S> Metal-Out static shielding bags are designed to protect against static-induced damage. <S> The Metal-Out layer is close to the surface for low surface resistivity readings. <S> The Metal-Out static shielding bags will dissipate a 5,000-volt static charge to zero in less than 100 microseconds.
In working with folks in the military packaging industry, yes, static shielding bags do have conductive interiors and exteriors.
Can supplying DC power into an AC device break the device? I have an AC device that takes 12 volts 47-63Hz AC. It is a water softner that is essentially an electromagnet. I lost the original plug and supplied it with 11.2V DC, it came on for a few minutes and no longer turns on. Did the DC current break my AC device or is the DC power source broken? <Q> It could be broken. <S> Supplying ac to an electromagnet can produce an ac current of maybe a few hundred milli-amps. <S> Supplying the same coil with DC could cause the coil to take a high current of several amps. <S> This could easily burn-out the coil after a few minutes. <S> If you don't have one then you need to find someone who can do this for you. <S> Once you have a voltmeter, check to see if it can measure resistance and connect it to the AC device to see if you can measure resistance between the two terminals. <S> If it measures a few ohms then the ac device is probably ok - <S> this should be confirmed byt the output of dc power source being open circuit or low voltage. <A> From first impressions, the device appears to be an inductor coil electromagnet. <S> If this is so, the device would provide a given reactance to AC power, and as with any inductor, a lower reactance / resistance to DC. <S> In effect, the coil would act like a short circuit (or at least a near-short) to DC power. <S> The possibilities are: Due to insufficient reactance, too much current flowed through the device, and damaged it. <S> Due to insufficient reactance, the DC supply was forced to supply more current than designed for, and either blew a fuse or got otherwise damaged. <S> To arrive at a more definitive answer, a multimeter could be used to test the power supply output, at the least. <S> Further, one wouldn't supply DC to the system and expect it to operate, in the past or going forward. <A> In general, It completely depends on the device you are using. <S> It may be that the device has an AC adapter, because the AC adaptor was cheaper to source, and it has a bridge rectifier to turn the AC into DC inside. <S> Or it may be that the device actually uses or needs AC power on the inside. <S> For your specific device, it seems it needed the AC current. <S> Without checking your power supply, or the device for blown parts, or getting the correct adaptor to test with, there is no way to tell if your device has been permanently broken.
But, it could be the DC power source that broke - you need to test it with a voltmeter. You won't know unless you have detailed information about the device, such as a schematic or opening it up to take a look.
Performance analysis of embedded firmware I'm working on a project where I want to make the software the most power efficient it can be on the system. What ways can I do performance analysis of my system? I'd like to run the system off AAA batteries but would like to estimate how long between the batteries needing to be changed. My system mainly consists of a MSP430G2553 with a nordic nRF24L01+. Are there any commercially available devices that I can hook up that'll monitor the power performance so then I can relate this to the firmware and work out how to redevelop the software to become more power efficient? <Q> Yes, it's called an ammeter . <S> It measures current. <S> For the test, run the unit from a fixed voltage supply and put the ammeter in series. <S> Since voltage is fixed, current is proportional to power. <S> You can then experiment with different software options to see what draws what current. <S> However, while I've worked on a number of power-sensitive microcontroller designs, I don't recall measuring current during the design phase. <S> At most this was done as part of verification to make sure the current was within the range that I already knew it would be. <S> Actually measuring current only tells you what that unit at that temperature with that voltage is doing right now. <S> It doesn't tell you what the worst case could be, which is usually what you need to design for. <S> Designing a system for low power shouldn't be a trial and error procedure. <S> You look at the datasheets carefully to see what draws what power under what conditions, then sit down and actually design the system deliberately to exploit those characteristics to minimize power. <S> Measurements should only be to verify that you didn't screw up or that something unexpected isn't happening. <S> When designing for low power, make sure to consider the whole system, not just the load. <S> Minimizing power usage of the load is important, but how the power supply delivers that power can also be important. <A> This answer might come a bit late, but iSYSTEM makes an I/ <S> O add-on for their MSP430-friendly IC5000 "BlueBox" debugger that allows current measurements as part of (and correlated with) the debugging process. <S> Note that if this is a personal project, the startup costs for the system are prohibitive. <S> If it's a commercial project, the expense of the system may be justified by its versatility. <S> Here's the link to the I/O module documentation: http://isystem.com/files/docs/IO_Module_V12.02.pdf <A> There's a tool for this for ARM and renesas, but i don't know something for TI MSP. <S> [1] http://www.iar.com/en/Products/IAR-Embedded-Workbench/Power-debugging/Power-Debugging-in-IAR-Embedded-Workbench/
Any common "multimeter" will have ammeter capability.
Will a short circuit in analog A/V cables cause electrical damage to connected equipment? Most people don't take especially good care of analog A/V cables, and they are often subjected to getting stepped on repeatedly, chewed by pets, etc. If an analog A/V cable (component, composite, etc.) is damaged and the center conductor shorts with the outer shield, would this result in any electrical damage to the connected devices? <Q> Some devices may output power through a cable along with an audio or video signal, however, and a short between the power wire and a signal wire could cause damage. <A> While it varies, for standard audio and video cables, a short shouldn't cause too much issue if any. <S> Line Level audio has very little current, and goes through dc blocking capacitors and series resistors, into amplifiers, in most equipment. <S> Yet you can still use a Mono 3.5mm cable on a Stereo Jack. <S> The Right channel, normally on the middle Ring, would be shorted out to Ground, and has no affect on most devices. <S> Same goes for 4 conductor TRRS jacks and 3 Conductor TRS cables. <S> Shorting a line level output to it's own ground isn't a problem. <S> Same for composite video. <S> I do not know if the same can be said for component or rgb connections. <S> It's when either ground or the a/v signal is shorted to a power source that the issue occurs. <A> Suppose you have a small-signal audio output implemented as an op-amp stage. <S> If the op-amp has no short-circuit or thermal protection, and you ask it to drive a short circuit, it will probably be permanently damaged. <S> This is true even if the output is AC coupled via a capacitor because the capacitor is transparent to the AC signal, which could have a large signal swing, resulting in a large AC current. <S> An AC short is just as bad as a DC short. <S> Analog inputs can usually be shorted. <S> This is because they frequently are. <S> Output circuits usually have a low impedance, often very low: close to zero. <S> Furthermore, outputs sometimes go to 0V, like when there is no signal. <S> A low impedance at 0V is a virtual ground: the input is basically grounded when driven at 0V by a low-impedance output. <S> It's even a good idea for unused inputs to be grounded, to reduce opportunities for noise to enter into the device. <S> Sometimes switched input jacks are used to automatically ground inputs when the plug is removed.
The amounts of power that need to be conveyed through analog A/V cables other than speaker wires is generally pretty small, and most devices which output analog audio or video are incapable of outputting so much power as to damage themselves in the event of an output short circuit.
4 or 5 Time Constants to reach practical potential? While I'm aware that a component can never "fully" charge or discharge to 100%, one textbook I'm using (Practical Electronics - 6th Edition, Sinclair, Dunton) says that we can assume a component has reached roughly its full practical potential after 4 time constants. Another source (allaboutcircuits.com) says that it takes 5 time constants for a component to reach its potential. I understand that 4 time constants equal roughly 98% of capacity and 5 time constants equal roughly 99% due to 63% of value being added every time constant, but one is telling me to assume component has completed charge after 4, another tells me 5. This makes it confusing when calculating time for component to reach its capacity (difference of 25%). Which is right? <Q> The correct answer to this question would have to be: <S> Neither , the set point is insufficiently specified . <S> To elaborate: Let us say the component in question is a capacitor, to be charged / discharged. <S> As this charging / discharging process approaches limit asymptotically, clearly there is no finite time to completion, as the question rightly notes. <S> Thus, to specify sufficient condition for "reaching practical potential", an acceptable variance from the asymptotic value must be specified. <S> This may typically be specified as a percentage, say "within 1% of supply voltage" <S> Depending on the percentage specified, the number of time constants to fulfillment would be calculated, as the question already mentions. <S> Thus, both textbooks are correct, with the caveat that neither mentions acceptable percentage (or <S> the question has not reported this). <A> Like many "rules of thumb" in engineering, it's just a rough guideline, and the correct answer depends ultimately on you and your specifications. <S> For example, if we have a simple event triggered at 50% charge, or a relaxation oscillator that swings between 1/3 and 2/3 of the applied voltage (such as the 555 timer IC), then 1 or 2 time constants may be fine for our purposes. <S> For a high precision ADC sample and hold circuit, we may want to wait much longer, say > 8 time constants. <S> So how long depends entirely upon the application. <S> For most purposes, above 99% (or ~5 time constants) will do, but remember it's always your call with this type of thing, not the books. <A> It entirely depends on the application, and whether you consider a 2% error or a 1% error "negligible" in that application. <A> If you were creating a circuit in which a delay is based on an RC time, you would not choose the "on" voltage to be the maximum voltage, but something less. <S> If a capacitor C is charging to 5V through some resistor R then it theoretically never quite reaches 5V. <S> However, it reaches, say, 4.4V in a finite time that can be calculated exactly (within the tolerances of all the parts, like R and C, the voltage regulation, and so on). <S> The closer you choose the high threshold to 5V, the flatter the charging curve gets at that threshold, and <S> the harder it is to establish the time accurately. <A> Imagine you worked on a machine in a factory making 2 inch nails to sell in hardware stores. <S> If you took every nail you made for one day and measured how long each one was you'd find that most (probably more than 95%) were between 1.9 inches and 2.1 inches and the rest were out of specification and got recycled. <S> The decision to recycle 5% is based on quality control but that decision could easily have been at the 2 inch +/- <S> 0.05 inches limit where only 90% of nails produced in a day could be shipped. <S> It's all about quality and <S> what is good enough for your requirements.
We know that in theory the voltage will never reach the full potential, so how many time constants we deem suitable depends on the circuit.
Recommendation of a USB-to-RS-232 chip for an industrial environment I have bought a device which has an ATmega microcontroller and an FTDI chip which connects to a computer through USB. The FTDI is used only as an RS-232-to-USB adapter. My problem is that this device hangs up the PC when some of the machines are running. I changed the cables to thick, heavy-shielded ones. Also the cable is in a steel conduit. And the device itself is inside a 2 mm stainless steel casing. The case connected is to ground. Amazingly, the problem is not present when working with this device, but with a plain RS-232 version. (The RS-232 version works even with el-cheapo cable. no problems.) My questions are: Is the problem related to a poor design of the device or is the FTDI chip fault? I am now confident that it was due to a bad design of the converter. What would be the best pick for a chip to convert RS-232 to USB in an industrial environment? How much work is it to use a microcontroller with a built-in USB port, for example an Atmel microcontroller? Will it be cheaper and faster? The only requirement is that there must be drivers both for Windows and Linux for the converter. <Q> One possible cause for the problem report described, is a level mismatch between ground at the PC and at the industrial equipment side. <S> This comes from similar personal experiences designing for industrial applications. <S> Either that, or some significant transients traversing <S> the connections - RS232 is more forgiving than USB in some ways. <S> One thing to check is whether the two grounds are connected, and even if they are, whether there is significant enough potential difference for measurable sustained current, DC or transient, to be passing along the ground to ground connection / cable shield. <S> A resolution would be a galvanically or optically isolated implementation: <S> The industrial sensors / actuator control lines to be isolated from the PC side through (a) transformer coupling, or (b) optocouplers, depending on the specific design requirements. <S> The microcontroller device could be placed on either side of the isolation barrier. <S> Another such device is the USB Port Guardian , quite a bit better packaged, but essentially similar in functionality. <S> Neither of these devices seem to survive well in extremely harsh environments though - we have faced some device failures in deployed set-ups, but your environment may not be as challenging. <S> At a design level, Analog Devices offers single-package USB isolation parts in their iCoupler line . <S> Incorporating such a part into the design is not very complicated, and the Analog Devices design support team is very proactive if you need help. <S> Specific to the 3 points in the question: <S> The problem is most likely to be design-specific as noted above, rather than an issue with the FTDI part. <S> This would require specifying the actual industrial envornment factors, i.e. temperature et cetera . <S> Maxim and other manufacturers have parts specified for industrial temperature ranges, but if your PC is in there, and presumably its operators, the environment is probably not that harsh. <S> The jury is out on this one: There are proponents of both the FTDI and the integrated USB MCU schools of thought. <S> The actual cost advantage, including design cost, would vary situationally. <A> Anindo's answer is bang on - I strongly suspect you have <S> too much grounding and the PC USB ground is being dragged around by the machinery. <S> so I'd be very reluctant to blame them as the cause of failure. <S> USB's data lines may be differential <S> but it is not isolated and the power & GND lines could go anywhere in the target device - not good if the target device has ground connections which are not common with the PC. <S> Many USB controller chips in PC's will shut down if they detect over-current conditions etc. <S> so it's entirely possible <S> the machinery is dragging the power/ground lines around and giving the PC a heart attack. <S> There are FTDI USB/232/485 boards on eBay for $10, we use a lot of them. <A> At my last company we found that USB-to-RS-232 converters can have a problem when they expect an almost instant responce from the RS-232 device. <S> I was advised by the design engineer for our equipment that USB uses data packets. <S> So when using USB, unless the software/drivers force a USB packet of data to be sent, the USB driver can hang around for more than a second (5000 ms) waiting for the packet to be filled before sending the incomplete data packet. <S> This meant that a lot of older DOS/Windows programs where they monitored RS-232 status lines would time out. <S> The older programs often used timing loops based on looping a certain number of times... <S> So as the PCs got faster, the polling got faster. <S> As the length of time the polling continued to effectivly get shorter, USB came along. <S> The polling effectively became a memory location... <S> (The drivers are usually optimised for maximum data packet throughput and didn't pass the status information on, because it was waiting to fill a packet). <S> The drivers can sometimes be adjusted to help with this. <S> FTDI drivers can adjust a lot of values in their configuration file. <S> (Great for non-standard data rates.) <S> This meant we often had to run programs on desktops with RS-232 ports or drag the laptop base station out to the equipment to get it to work. <S> Additional information <S> See page 6 of the application note <S> Advanced Driver Options for USB time out adjustments... <S> And for odd baud rates <S> up to 3 Mbit/s, see Configuring FT232R, FT2232 and FT232B Baud Rates . <A> I am not sure this is you problem, but on my previous PC the use of an usb-serial converter in combination with certain other applications (especially audio and video) could cause my PC to hang and often reboot. <S> This did not happen when I used the same gadget and application with the real (hardware) serial port. <S> I never found out what the cause was, I just learned to avoid watching video during intensive USB serial port use. <S> AFAIR this happended with both FTDI and prolific converters. <S> With my new PC (different windows version) I have never encountered this problem. <S> (Which is all the better since it does not have a hardware serial port.)
It could have been a SW problem (windows version, USB stack) or maybe hardware (flaky motherboard). In practical terms, the easiest way to implement this, once the need for isolation is established, is to use a standalone USB isolation device such as this one from Olimex, on the PC to board USB connection: . I would look at running the 232 to the PC and then having the converter at the PC end, or even converting to RS485/422 (plenty of Maxim chips to do this) and back at the PC end. In our experience, FTDI chips are about the best
Protecting Microcontroller Input Pins from Soft Power Switch I'm working on a soft power switch for a microcontroller where a momentary switch can turn the circuit on (including microcontroller), and then when the switch is pushed a second time, the microcontroller can shut itself off after performing some clean up. I have the above circuit so far, but I'm not sure if it'll be reliable. I'm using a lithium-ion battery (3.7-4.2V) and the TC1015 regulator (3.0V output). The idea is that when the switch is pressed, the regulator turns on, then the microcontroller sets uC Power high, keeping itself on. When the switch is pressed a second time, an interrupt on uC Switch will allow the microcontroller to set uC Power low, turning itself off. What I'm not sure about, is if I need to protect the microcontroller from battery voltage. The microcontroller I'm using has an absolute maximum voltage on the I/O pins of Vdd+0.4V, so I'm not sure how to handle that best. Second, will this circuit actually keep the regulator from turning on when it's in the "off" state? I had thought about using a pulldown resistor on the enable line, but am worried about the current draw while the chip is powered on. Edit: The microcontroller is the primary load that will be switched, so putting it into a low power mode unfortunately won't work here. Edit #2 (After answers were posted): I ended up using the circuit below: The previously posted circuit didn't work very well, and had issues with a floating enable line when the microcontroller wasn't powering it. The new circuit uses a flip flop, with the data line normally pulled low. Pressing the switch hits the clock, turning the system on. Subsequent presses of the switch drive the CLOCK line high (allowing the microcontroller to sense the press), but don't affect the output of the regulator. Once the microcontroller is ready to power off, it sets the DATA line high and then sets the CLOCK line high, which will cause the regulator to shut down. One of the really nice things about this setup, is that the first button press turns the regulator on, and keeps it on until the microcontroller is ready to shut down. Bounce isn't an issue, because no matter how many times the clock line goes high, the data line is still held low by the pull down. In addition, the current draw should be very minimal (just the flip flop and the TC1015 while off), and there is minimal current draw through resistors while on. The microcontroller does need to be protected from the battery voltage on the clock line, but as @Andy aka suggested, that can be done with a resistor on CLOCK . <Q> R1 and R2 will limit the current into pins on your uC <S> and this is usually sufficient to protect your device - you just need to check in the spec what that "limit" current is and choose a resistor value that is appropriate given that the uC supply may be at 0V (un powered). <S> The zeners can be left out on this basis. <S> Reliability is another issue. <S> Switch bounce may cause your uC to switch on then switch off a few times so write your code to be aware of this. <S> I think it may be advisable to have a resistor on enable but probably in the region of +10K and maybe this could be higher possibly 100k. <S> The voltage on the shutdown pin has to be at least 45% of Vin <S> so this shouldn't be an issue. <A> This seems like a self latching system, which in theory should work, like a self latching relay circuit would (A button is used to turn on the relay, and then because the load pin and the coil pin are tied together, the relay stays on as long as power goes to the load pins). <S> To test it, without risking a microcontoller, you can do this. <S> Add a dummy load to keep the regulator happy (a few leds, also so you can see that it is working), and then tie the output to the point where it is marked uC Power . <S> After you press the switch, the regulator should start, turning on the leds and the uC Power, which in turn should keep the Enable pin at logic high (Shutdown Logic High is minimum 45% of VIN, so 1.89V at 4.2V <S> In.). <S> So if you press the button and the leds stay on after you release it, it works. <S> If it doesn't, it won't work as is. <S> Warning: <S> I say that, not being sure how the Zener diodes will cause the circuit to react though. <A> The circuit linking the battery, microcontroller signals and the SHDN* input of the regulator (renamed EN) seems dodgy. <S> Then the output of this latch can be OR'ed with a signal signal from the MCU to drive the SHDN* pin of the regulator (renamed to EN in the schematic). <S> Upon booting, the MCU should drive its enable line first, then clear the latch, thereby ensuring that EN stays asserted. <S> The subsequent button action can be monitored through the latch: if the switch is pressed again, the latch goes high again. <S> The MCU notices this and clears both the latch and its enable signal, triggering shutdown. <S> Since the switch is latched, the MCU can monitor this very conveniently by simply polling it at a leisurely frequency. <S> One more optional refinement would be a circuit to ensure that when the battery itself comes online, the system powers up without the use of the button. <S> This could be some kind of pulse which sets the latch. <A> Pull EN low with a suitable resistor and tie it to an io pin on the mcu. <S> The switch goes on an input pin of the mcu. <S> Pushing the button triggers an interrupt on the mcu input pin which toggles the output pin controlling the EN pin of your LDO. <S> Putting the mcu into deep sleep will allow the pin to be pulled low and disable the LDO. <S> Triggering an interrupt with the switch will wake it up, pulling the pin high again and turning on the enabling the LDO again.
How about using a latch (running on battery power) to capture the closure of the key.
What is the Need for modulation What is the need for any kind of modulation in order to transmit signals? <Q> Modulation is, generically, a means of shifting information from one frequency domain into (typically) a higher frequency domain. <S> This provides a number of benefits; among them: Two or more input signals with matching or overlapping frequency domains may have their information shifted into disjoint frequency domains; if such signals travel together through a medium, having their frequency domains be disjoint will allow them to be separated. <S> In many cases it's easier to uniformly handle signals where the minimum frequency is a substantial fraction of the maximum, than signals where the maximum is many times the minimum. <S> An audio signal whose frequency content is 20-20,000Hz has a 1,000:1 spread between the minimum and maximum frequencies. <S> If such a signal were amplitude-modulated at 1MHz, the spread would be about 4% [from 980,000Hz to 1,020,000Hz]. <S> Even if there were no other radio communications anywhere in the world, trying to design an antenna which could work well with a 1,000:1 frequency spread (from 20Hz to 20KHz) would be very difficult. <S> Designing an antenna to deal with a 4% spread would be much easier. <S> Some use cases for modulation exploit both benefits; others only rely upon one or the other. <A> Modulation is the means to transmit information using a radio signal. <S> The carrier frequency of a commercial radio station is used to place the signal within the allotted spectrum of a particular radio service. <S> For example, AM radio covers the frequency band from 540 to 1640 kilohertz. <S> Let's say that one station has been assigned the carrier frequency of 1010 kilohertz. <S> If it just transmitted that carrier, no information would be available to the listener. <S> If the amplitude modulation is made to be in step with a song, for example, than a listener can tune his radio to the carrier frequency and the demodulator in the radio will reproduce the song. <S> Since modulation creates sidebands around the carrier frequency, the modulation frequency is limited (to about 5 kilohertz for regular AM radio) so that many stations can be accommodated in the 540 to 1640 kHz band. <S> For amplitude modulation, the bandwidth transmitted by the radio station is twice the audio bandwith of the modulating signal. <S> Thus each AM station occupies 10 kHz of the available spectrum. <S> With 1100 kHz available, many stations can be transmitting at the same time. <A> Have you got a radio? <S> Have you noticed that you can tune through several stations across any band on your radio? <S> When you tune to one station, have you noticed that you don't pick-up any (or <S> maybe slight sometimes if AM) signals from other stations? <S> If "yes" to the above then perhaps you'll realize that there has to be a way to differentiate one station from another. <S> If there wasn't a way of doing this, your radio speaker would be just producing an unintelligible mess of a sound. <S> The way we can do this is by modulation. <S> Every transmitting station produces an audio signal that it "mixes" with the allotted frequency in the radio spectrum the government has allocated to it. <S> OK sometimes governments don't allocate frequencies but a lot of the time they do. <S> EDIT - The "mixing" is better defined by the word "modulation" and this process allows us the means to tune our radios to whichever channel we want in the radio band in question. <A> If you are referring to communications. <S> The answer can be broken down into two main answers: Matching the transmission characteristics of the medium, andconsiderations of power and antenna size, which impact portability. <S> The second is the desire to multiplex, or share, a communication medium among many concurrently active users. <S> Below: an example of modulation ...
By modulating that carrier (in this case amplitude modulation) information can be transmitted.
What is the easiest way to connect a breadboard to a multimeter? The test leads on my multimeter are too large to fit in the holes in my breadboard. How can I easily connect my multimeter to test voltage on my breadboard? <Q> Use alligator clips for your DMM test leads and pin it on the leads of your breadboard wires ( terminals) where you want to test. <S> Please see the below picture to understand what I am trying to say. <S> Please for heaven's sake don't try forcing those test lead pins into the breadboard holes, they damage the copper strip inside (personal experience.) <A> You could either make some leads up, with banana jack on one end (available from any decent electronics vendor) and header pin, crocodile clip, or similar on the other. <S> Or do what I have done many times and just grab a bit of solid core wire (of a size suitable from breadboard), strip at both ends, wrap one end a few times around the test probe with needle nose pliers and stick the other end in the breadboard. <A> Of course, a short bit of bare wire twisted round <S> the probe is a lot lot cheaper :-) <A> If you are not planning on doing any high voltage measurements then I would suggest cutting off the standard tips and soldering some male crimp pins. <S> You can insulate them with heat shrink to enhance their longevity. <S> It's been working great for me. <S> Here is a picture of my setup and some crimp pins: <S> If you find it hard to buy male crimp pins then you can emulate this with a jumper cable or a pin from a breakaway header soldered permanently into a BLS housing. <A> Neither cheap nor simple, but I like the micro clips from the Hirschmann PMS 0,64 set best (clipped to a wire): <S> (source: sks-kontakt.de ) <S> You can also plug the leads directly on header pins. <A> Lacking any alligator clips in my collection (I need to rectify that oversight) <S> I managed to use elastic bands to connect two pieces of metal together. <S> Where one piece of metal was a wire attatched to my breadboard and the other was the DMM pin: <S> It actually worked really well. <S> A knot like you see here: <S> (source: themathlab.com ) <A> If you find a spare set of banana plug wires, solder a square header pin and you now have incredibly easy probes. <S> Twist the wires for better measurement noise immunity. <A> Why not push the test lead against one of the component's pins that you want to measure? <S> Of course you have to hold the test leads in your hand, you can't push them in all the way. <A> This post provides an interesting solution user paper clips: <S> Then you can solder it: and use pliers to improve the contact.
You can also buy accessories that plug onto the end of your test lead probes which provide a little grabber for attaching to small component leads and jumper wires etc. If you push it down to the surface of the breadboard where the plastic has a little dent, your test lead will stick in that dent, just enough not to slip away. The trick is to tie the rubber band in a slip knot so that you can pull it as tight as you want.
Can I use a 220v engine to build up a RC car? sorry for the noob question, but I'd like to build myself a small RC car. I've found this motor in a blender, which runs at 220v. Can I power it with a lower voltage? What should I use? Thanks a lot, I'd appreciate some good help :) <Q> The motor you have found is probably AC and runs at a high voltage (although there is no harm in trying it out with a low DC voltage as mentioned in case <S> it is not 220VAC driven). <S> Whilst in theory it is possible to use any motor if you drive it correctly, this is not the right type for an application such as this. <S> The high voltage makes it needlessly dangerous, and would need to be created from a lower voltage DC source (i.e. a battery) So rather than convert a low voltage DC source, you are better off using a low voltage DC motor. <S> Here is one such motor from Hobby King which runs from 7.4V to 11.1V DC: <A> Small kitchen appliances are often "universal" motors rather than induction motors, and will run on AC or DC. <S> If you can see two carbon "brushes" running on a segmented copper ring (the commutator) <S> then you have a universal motor. <S> The picture below shows a small domestic (but not kitchen!) <S> appliance motor. <S> It may not run at any significant speed on 12V DC however, or it may run but with too little torque to be useful. <S> It would be theoretically feasible to rewind it for lower voltages (fewer turns of thicker wire) but that is not an easy operation! <A> I am not a power or analog guy. <S> I've seen step-up power sources. <S> It is from National Instruments to power up their industrial computers. <S> I think it has a lead-acid battery and can be stepped up to 220V. <S> You might take a look at some switching regulators which might do the job. <S> But you will be better off to buy a motor that runs on a battery directly. <S> Power regulation is not 100% efficient. <A> Odds are real good that a 220V motor from a blender is going to be an induction motor, that only runs on AC. <S> There are OODLES of small DC motors available that are specifically designed for RC car applications. <S> Start with Tower Hobbies : they're reputable.
If you check on any RC hobby store site, you should see many suitable options, and the batteries to power them (plus servos, and other things you need for an RC car)
LM317 construct 3volt output and 2amp output I am doing a project using 6 stepper motors. These motors have different operating voltage and current. For example, one requires 3.6V and 2A, another one requires 2.4V and 1.2A. The 6 stepper motors operating in different voltages and current, so I purchased a 12 Volt 2 Amp transformer, (6 numbers) and a LM317. I also purchased a stepper motor L298 H bridge driver. Now my doubt is how to reduce the voltage from 12V to 3V using the LM317? I don't need to reduce the current. I need 2A 3V output from my transformers. Please help me. <Q> The answers are focusing on your questiong about configuring the LM317 correctly. <S> However, I'd rather go for your intent. <S> Just because the stepper motor nameplate says it runs at "2.4V @ 2A <S> " does not mean that is exactly required. <S> It really means that at a supply voltage of 2.4V, it will draw 2A. <S> You can run the motor at a higher voltage <S> (IME it's rare to run at nameplate voltage) and this will provide better high speed performance, however you must limit the current to avoid motor overheating. <S> So if you run your "2.4V" motor at 12 volts, either a power resistor must be used inline with the motor coil, or a current limit driver must be used instead of your L293. <S> Let's say we wanted to keep your motor running on 4.8 watts (2.4 * 2) from a 12V power supply. <S> We'd want to reduce the current to 0.4A. <S> That would mean a 48 ohm resistor (50ohm is close standard value) with a 2W rating. <S> Motor will likely run much smoother. <S> It is worth investigating more modern drive <S> IC's than the L293 that incorporate a current-limiting chopper drive. <S> But as a start, the L/R method is fine. <A> You don't need to directly regulate the 12 V down to 3.6 V or 2.4 V that the stepper motors are intended to run at. <S> Drive the stepper motor coils with PWM with a duty cycle so that the average is still within the motor's rating. <S> The coils will be driven with lots of 12 V pulses in rapid succession, but if this is done fast enough they will only "see" the average. <S> A few 100 Hz should be enough for the motor to react only to the average, but you probably want more than that so that the coils themselves, which look like inductors to the driving electronics, average the current thru them nicely. <S> Usually this is done a bit above the audible frequency range. <S> For example, let's say you are using pulses at 25 kHz. <S> That's 40 µs per pulse. <S> If each pulse is on for 10 µs and off for 30 µs, then the coil will be effectively driven with the average of 3 V. <S> Another very nice feature of this scheme is that the losses will be low. <S> By pulsing the coils, you are much closer to power in <S> is power out (minus a little loss). <S> Put another way, you are making a switching power supply for each coil, just that the coil itself is a integral part of the switching power supply. <A> Linear regulators reduce voltage by acting like a resistor. <S> Reworking Kaz's solution a bit: even if the application were correct (which there are doubts), the LM317 is not going to work, since at 9V differential (12V-3V) and 25°C, assuming TO-220 and derating \$T_{J(max)}\$ by 20 degrees for reliability reasons: \$ P_{max} = <S> \dfrac{T_{J(MAX)} <S> - T_A}{\theta_{JA}} \$ <S> \$ P_{max} = <S> \dfrac{130°C - 25 <S> °C}{\frac{19°C}{W}} <S> \$ <S> \$ P_{max} = <S> 5.5W \$ <S> \$ I_{max} <S> = \dfrac{5.5W}{9V} = 611mA \$ 611mA isn't going to work where 2A is needed. <S> The device will thermally shut down. <A> 2A is a bit high for most LM317's. <S> Look at datasheet for your model. <S> LM350 is high current big brother. <S> 12V is FAR TOO HIGH a voltage if you want 3.6, 2.4, 3V etc. <S> Vdc loaded needs to be about Vout+2.5V <S> so <S> eg 3.6V+2.5 <S> = <S> 6.1V = 6V for the 3V6 output. <S> A 5VAC transformer is closer to what you want. <S> Vdc loaded ~~~~ 1.4 x VAC. <S> Here 5V x 1.4V = <S> 7V so allowing for some droop and wiring loss and ripple <S> then 5VAC is about right. <S> Dissipation in regulator is (Vin - Vout) <S> x Iload. <S> So at 2A if you have 3.6V out and 12VDC in at 2A dissipation = <S> (Vin-Vo) <S> x Iload = (12-3.6) <S> x 2A = 16.8 Watts. <S> A good heatsink is needed. <S> Using 5VAC to make Vin is better. <A> 2A of current deliver is close to the limit for the 317, and you have a large drop from 12V to 3V. <S> This asks the 317 to dissipate a lot: \$2A\times 9V = 18W\$! <S> This is not going to happen with any heat sink, and so the 317 will just shut down the current and lose regulation. <S> The TI datasheet says (P. 2 footnotes) that \$P_D = <S> (T_J(max) <S> – T_A)/\theta_{JA}\$. <S> \$\theta_{JA}\$ is given for the TO-220 package as 19° <S> C/W. \$T_J(max)\$ (the absolute one, not the recommended one) is 150°C. <S> So we can take \$P_D\$ to be 18W and solve for \$T_A\$: <S> ambient temperature: $$T_A = T_J(max) - P_D\theta_{JA}$$ $$T_A = 150 - 18W \times 19°C/W$$ $$T_A = 150 - 342$$ $$T_A = -187 <S> °C$$ <S> So if we achieve a cryogenic ambient temperature \$T_A\$, or an equivalent heat sink, we can have 18W of dissipation.
Using a resistor is often called the "L/R" method. With a linear regulator like the LM317, current in is current out, which will be horribly inefficient with 12 V in and 3 V out.
How to build simple 12v .5a regulator I'm building a solar powered light. The idea of this light is that its output is proportional to the brightness of the sun. At night, no light. During daylight, full light. So it's basically as simple as attaching my 12v 0.5A LED setup to a 12v 6w solar panel. But not so fast. The 12V 6w panel won't produce enough voltage at lower sunlight levels - I want the LEDs to be brighter in the AM than a 6w panel will drive them. So I want to use a 12V 10W panel. In full sunlight, however, I fear it'll overdrive the LEDs. So I need to cap the output at 12V 0.5A. Below that, the output should just follow the output of the panel. I assume I'll need a zener diode circuit, but am not sure how to make the circuit. Please help me design one with the correct values for my system. EDIT: I'm hacking an existing LED strip that runs off of a 12V .5A wall wart to operate from a hobbyist-type panel. This isn't a pre-existing system. EDIT: like this http://www.amazon.com/Solaro-Energy-SD1000-Daylight-Simulator/dp/B0053AL5LA only not $600 EDIT: so-called "12V" panels are actually >12V because the typical use is to charge a 12V battery. Both models available (the 5W and 10W) actually have nominal voltage of ~18V in full sun and OCV of ~21V in full sun. I can limit the amount of sun to prevent the voltage from peaking so high, but that kinda defeats the purpose of having an efficient system that will drive the LEDs fairly brightly at lower sunlight levels. <Q> LEDs are current driven devices , not voltage driven. <S> In other words, it is not the voltage provided to the LED that matters (except peripherally), as the current allowed through it. <S> Intensity of an LED is controlled by regulating the current, or by using Pulse Width Modulation of variable duty cycle (on-off time ratio of pulses) with a predefined, fixed on-state current. <S> The question does not specify which specific 12v .5A <S> LED setup is to be used, so it is conceivable that the set-up may already have dimming circuitry built in - LEDs by default are not 12 Volt devices, so there must be some additional electronics in the setup. <S> If the LED setup does provide a dimming interface, then that should be used to alter the intensity. <S> Some LED units contain inbuilt constant-current regulators and favor PWM for control <S> Others have their own remote control protocol (and control device) - less common <S> Yet others are essentially just LED + resistor in series, so voltage, current or PWM based intensity control will work <S> If the LED has integrated current regulation and a PWM interface, a microcontroller circuit would be recommended, to modify PWM duty cycle as per requirement. <S> The additional stated requirement is that the LEDs must be driven brighter than default when the ambient light gets low. <S> For this, you may need to put together a boost regulator, to raise available voltage to a higher value, and vary LED intensity through a microcontroller program as per some set table, in relation to the solar panel's power output (i.e. the ambient light). <S> Without additional information about the solar panels and associated circuitry, it is not feasible to speculate further. <S> Regarding input voltage from the solar panel exceeding the rated 12 Volts of the LED strip: LED strips with integrated resistors are quite resilient to a small overvoltage, but you'll only know through destructive testing. <S> Yes, as the question rightly mentions, a 12 Volt Zener diode connected in reverse bias as a shunt at input would be one way of limiting supply voltage to the LEDs. <A> Assuming it's a simple led strip, in a 3 leds + resistors per segment setup, then no, you have nothing to worry about, by using a bigger solar panel. <S> A 12V 6W solar panel should allow 0.5A of current at full unobstructed sunlight. <S> A 12V 10W would allow 0.83A of current. <S> But current is pulled, not pushed. <S> The led strip like below, are set up for 12V, at a fixed current (educated guess, 20mA per segment). <S> The resistor on each segment, will take the Input Voltage - the Led Forward voltage (x3 because there are 3 leds in series, and leds in series share the same current), and limit the current. <S> Assuming 3.3v <S> Forward Voltage <S> , that's 12V - <S> (3.3V * 3) / 20mA or 2.1V / 20mA <S> = 105 ohm resistor or close to it. <S> And since that's just 20mA per Segment, and that's 3 leds per segment, you just multiply <S> 20mA by the number of segments your strip has, to find out how much it draws. <S> What does this mean for you? <S> Basically, the led strips are fixed to 20mA per led, at 12V. Using a bigger Solar Panel <S> increases it's potential current source, but the led strip will not pull more than it needs and can be sourced. <S> At lower light levels, a bigger (or more efficient) panel will probably increase the current capacity. <S> At high light levels, nothing will change. <S> And that's only if the current panel cannot drive your light strip at the moment. <S> How many segments do you have? <S> As for the Solar Panel Voltage output, it's a curve, and depends on the panel/cell, but in general: As the voltage increases past the nominal design point, in this case 12v, the current capacity starts to sharply decline. <S> And the leds will not be able to pull more current than exists, even when the voltage is higher. <A> A Zener would work in this situation, where the maximum excess power supplied by the panel isn't very high. <S> 1N5349BG <S> (12V, 5W) seems suitable. <S> You should make sure it has adequate heatsinking; perhaps firmly screwing the ground lead to metal casework would be sufficient.
For the type of LED setup with just current limiting resistors in there, both voltage and current regulation are options, voltage regulation perhaps being more effective.
What elements of a capacitor make it higher voltage and higher capacitance I know capacitors have 2 plates, and an insulator in between the plates. I am wondering what elements inside of a capacitor make the capacitance larger, and what makes the maximum voltage higher? <Q> \$ <S> C = \epsilon_0 \epsilon_r <S> \dfrac{A}{d}\$ <S> Where: \$C\$ is the capacity in Farad [F]; \$\epsilon_0=8.854×10^{−12} \text{F/m}\$; \$\epsilon_r\$ is 'relative permittivity', its value is specific for the material used as insulator. <S> See also @rawbrawb's comment; \$A\$ is the area of the plates that overlaps in square meters; <S> \$d\$ is the distance between the plates in meters. <S> So: if the plate overlapping area increases, the capacity increases and if the distance between the plates increases, the capacity decreases. <S> The insulator that fills the space between both plates (A×d) has a limited strength when it comes to voltage between the plates. <S> The insulator will breakdown at a certain maximum voltage, at that point it is no longer a capacitor, but probably a short. <A> http://en.wikipedia.org/wiki/Capacitance especially "Capacitance of simple systems": larger plate area and smaller separation will give greater capacitance. <S> The maximum voltage depends on the breakdown voltage of the dielectric (material between plates); the point at which it stops being an insulator. <A> If you want to have voltage higher, you need to have larger space among plates. <S> But this is opposite to another request to have higher capacitance. <S> So what you can do is to separate plates more to have higher voltage standing and to increase area of the plates in order to increase capacitance as well.
For any given dielectric, the breakdown voltage is proportional to its thickness (i.e., the plate separation).
Can I electronically trigger a PIR motion sensor? I would like to trigger a PIR sensor using an infrared LED. Is that possible? My goal is to simulate motion in front of the PIR, when there otherwise is none. I tried using a handheld remote control, but that didn't seem to work. <Q> People often use imprecise terms to describe InfraRed and it is further complicated in that with respect to Infrared "that word infrared ... <S> I don't think it means what you think it means" in a lot of cases. <S> PIR - AKA Passive infrared sensors are pryoelectric devices that are optimized to detect Mammalian body temperatures (around 300 K), these warm bodies emit light at around the 10µm to 14µm wavelength range. <S> Some people call this the "mid Infrared" but the trend is towards using the term "Thermal InfraRed" or TIR. <S> The IR LED you are using emits probably around 900 nm -> <S> 750 <S> nm - so close to 1µm in wavelength. <S> Some people call this "Near IR" but those people also tend to call 2 - 4 um wavelngth range the "Mid Infrared also". <S> Confusing? <S> yep. <S> It comes from a different historical use. <S> One from the military one from chemistry/astronomy. <S> So you are at least a factor of 10X away in wavelength terms. <S> And a LED emits light in a very, very narrow band of energies (it is an electronic effect after all) <S> Also PIR's are "designed" to detect rather largish bodies, which means a fair amount of energy or photon flux. <S> A black body emitter will increase energy in all wavelengths with increasing temperature. <S> So an emitter at 27 C (300 K) will emit less light at 10µm than a emitter that is at 100 C (373 K) in the same band of energies. <S> So if you want to have an emitter that will trigger the PIR, make a temperature controlled emitter, run it at 100 C to be safe, and it will emit a lot more light in the 10 - 14µm band than a body temperature device. <S> On second thought make it 70 C just to be safe. <S> 100 C is a little too hot. <S> Read up about blackbody emitters for fun. <A> You may be able to cause it to trigger if you place two filament bulbs operated under-voltage at a dim glow in front of it, you may have to tune the positioning a bit to get it right. <S> Then switch them on alternately hoping that they will illuminate the alternate parts of the sensor. <S> The spacing of the bulbs should be related to the detection 'beam' angle which can be different in different directions and zones and obviously will vary by model and manufacturer as well. <S> The alternating frequency will need to be made to match the expected signal it would get if a person was crossing the detection 'beams' and getting it to match walking speed. <S> EDIT: <S> A domestic PIR sensor is designed to detect moving IR sources. <S> They generally have a two active area detectors that have to have the areas alternately illuminated to create an alternating differential (pyroelectrically generated voltage) <S> so they can detect a warm body moving but not a stationary heater. <S> The alternating signal is normally achieved with the multi-zone Fresnel lens (or reflector) found on this type of sensor. <S> To spoof it you need to place two sources that illuminate the two zones unevenly and then alternate their signal to mimic the flickering pattern that a moving person would create. <S> A single source may not cause the proper alternating signal to be generated and be filtered out as spurious environmental changes. <A> Alternatively a few drops of cold water from a fridge or well will trigger on a warm day. <S> Alternatively a well trained cat can help.
A small quantity of warm but not boiling water will often trigger a PIR (safety in mind) or on a cold day just tap water - just throw it into the air near the sensor.
Identifying piece of circuitry on a PCB I haven't done electronics for a long time but am doing some for a hobby project this weekend. I'm looking for some help breaking down/analyzing a circuit board I want to modify/hack: It's for 3 lights (designated by R, Y and G on the board). At the moment it lights each in turn and I'd like to be able to light one at a time by ignoring/circuventing whatever timer/control mechanism is being used right now. The black wire in R goes to each light's -ve terminal The black wire on the left and the brown wire on the left are -ve and +ve respectively I've identified the resistors, but would be curious to know why they're all different, when do you need to use different resistances and why is each blue one different when they each go to an identical light. I also identified the transistors - TO-92/S8550/D331 apparently? I'm pretty sure these are for controlling whether or not the light should be on? Ceramic Capacitors (p104) , not sure why we need these? Tiny thing between the ceramic capacitors - not resistor. What this is? The upright board which takes +ve and -ve voltage, has a connection to each transistor as well as to C4, then the two rightmost connections seem to join together via resistor RC. **What is going on here?** I'm sure this is all really basic stuff so hopefully an electronics aficionado can fill me in :) Thanks in advance! **Update** Wow - Thanks for all the input so far. The transistors have S8550 D331 on them and a small circular indent on the curved side? My plan was to follow all the circuit paths and create a schematic anyway and it seems that would help so I will go ahead and do that. Not sure how to model the IC chip though? Also, I've added a shot of the underside of the board below (flipped so it mathches the same orientation/perspective) - seems pretty crappy, with solder even in places without components so I tried to colour them out to avoid confusion. If you open the image in a new tab/dowload both this and the previous one are high res by the way, might be easier to see! If anyone beats me to a schematic (I imagine if you try you'll be much quicker) do share as I'd love to compare my attempt when I've had a go! <Q> I've identified the resistors, but would be curious to know why they're all different, <S> If the lights are LEDs, different coloured LEDs can have different voltage drops so need different resistors to provide similar currents (and/or similar brightness) <S> I also identified the transistors TO-92 <S> is just the case style. <S> The devices will have an identifying number printed on the flat face. <S> The photo lacks enough detail to see. <S> I'd guess they provide current to the lights, perhaps the controlling IC (on the riser) can't provide sufficient current by itself. <S> So yes, they're being used as switches. <S> Ceramic Capacitors <S> Because of their position, they may be part of the power supply? <S> The ZD marking suggests a Zener Diode used for voltage regulation. <S> The upright board Looks like a chip-on-board. <S> There's a tiny silicon IC under the blob. <S> If you posted a photo of the tracks on the underside of the main board, it might help show how the devices are interconnected. <A> I won't repeat much of the info already posted. <S> But here's some more experience-based analysis: R5/6/7 <S> , are said to control the LED brightness (by limiting the current). <S> This is supported by two more observations. <S> One is that they are in series with each lead that goes to its LED. <S> The other is their low values. <S> R5=51 ohms, R6=22 ohms, and R7=27 ohms. <S> Assuming they stuck to the convention of NPN transistors and a common-emitter setup, these resistors will lead you right to the collectors of the transistors. <S> Next, we look at R2/3/4. <S> They are all 1K. <S> This is a common <S> "can't really lose" value for connecting a drive signal to the base of a transistor. <S> So the next thing we get is that following the right side of each resistor will identify the base of each transistor. <S> More on this, in a moment. <S> Finally, there are outlines for more parts that are not installed. <S> DB107 would have been a rectifier bridge, and C1 and C3, filter caps for that supply. <S> Then the board would have run from an AC input. <S> The Zener diode suggests the AC voltage only had to be in some range (like 6 to 9 volts). <S> You can find out what the circuit runs from by powering it up and measuring the voltage at the Zener. <S> Identifying ground is left as an exercise to the student. <S> Lastly, if you power up the board and watch the voltage at the left side of R2/3/4, you will then know how that IC controls the lights. <S> Next, unsolder those same ends, and you now have a place to put your PIC/Arduino/555/IBM370 or whatever you're planning to control the lights from. <A> The Chip on Blob board, From left to right, on the top: Ground, unconnected V+ Green Led (Off when Logic High) (1kΩ resistor to PNP Base) <S> Yellow Led ( <S> Off when Logic High)(1kΩ resistor to PNP Base) <S> Red Led (Off when Logic High) (1kΩ resistor to PNP Base) <S> Regulated Ground <S> Unknown, Connected to Pin 8 with a resistor, probably a mode select or delay based on the resistance. <S> See 7. <S> The capacitors are bypass 0.1uf capacitors, simply to filter out some noise on the power supply, standard value on nearly everything. <S> The Transistors are PNP transistors. <S> Collector to the LED/Resistor/Ground, Emitter to V+. <S> They are on when the base is logic low (ground), and off when the base is logic high (v+). <S> To use it with an arduino, you would simply remove the CoB board, connect a digital/pwm pin to 3, 4 and 5, as well as connecting the ground of the board and the arduino together. <S> Since you would have it in output only, there isn't any issue with the V+ voltage level. <A> The circuit is built round the IC on the vertical board, under the black blob. <S> It has weak drive outputs, so the transistors are used to drive the lights. <S> The different resistors are probably to tune the apparent intensity of the different colours. <S> ZD between the capacitors is a zener diode acting as a voltage regulator. <S> The capacitors are decoupling capacitors, required for digital logic. <S> There is spaceon the board for a diode bridge rectifier, which would allow ot to operate from AC. <S> RC is presumably a configuration or a time constant. <A> However, I will take a shot: If the R,Y and G refers to different colored LEDs, then the resistors are probably different because each LED requires a different current to operate properly. <S> TO-92 is the package type of the transistors and does not identify the transistor itself. <S> What markings are on the transistors? <S> The transistor type for this kind of application is not critical but they must at least be established as being NPN or PNP. <S> The ceramic capacitors are for timing and/or bypassing. <S> If the board lights each lamp in turn, than that implies some kind of timing circuit. <S> Capacitors are usually used as one component, usually along with a resistor, to set a time constant to control timing. <S> The thing between the capacitors is a zener diode (denoted by ZD on the board). <S> Without a schematic it is difficult to determine how the board operates but the transistors may be connected as a multivibrator, with the RC's controlling the timing, so as to light the lamps in sequence. <S> You should attempt to create a schematic by following the board traces. <S> Then we can see how to achieve what you want. <A> The blinking behavior of the LEDs is most likely controlled by that little integrated circuit based daughter board. <S> The transistors, and passive components just provide the current sourcing interface between that IC and the LEDs. <S> If you want a different behavior, desolder that IC and provide your own circuit to drive the lines. <S> Figure out which inputs on that connector <S> drive what transistors, which ones provide power and ground to the chip and off you go.
Without a schematic of the board, not all of your questions can be answered. Tiny thing between the ceramic capacitors A diode.
Multiple buck converters on the same PCB, should switching frequency be the same? I have a question regarding dc-dc buck converters. I need to supply multiple different voltages on my board and I am very limitted with power this is why I need to use high efficiency converters. If they are to be placed near to each other should their switching frequency be the same? As far as I know this would be better due to the EMI and SI issues, it's easier to get rid off one frequency than multiple of them and their harmonics, products etc. On the other hand if it's not essential, than increasing the switching frequency will decrease the size of the inductors. Any help would be appreciated <Q> As far as I know this would be better due to the EMI and SI issues, it's easier to get rid off one frequency than multiple of them and their harmonics, <S> products etc. <S> This is a false premise. <S> EMI regulations limit the emissions on a frequency-by-frequency basis. <S> If you have two sources in your system at the same frequency, their outputs can add, giving higher emissions at that frequency. <S> It's a general rule in EMI design that the best solution is to reduce your sources of emissions, rather than generate signals and then try to block them. <S> So I'd say for EMI purposes, you're better off using different frequencies for your different switching regulators. <A> If you use multiple converters with different switching frequencies it will be really hard to predict the input voltage ripple and thus it will be hard to design the input filter. <S> There will be some moments when switching occurs simultaneously and some moment when switching events will be spread out in time. <S> In your case, I think, the best design would be to use the same switching frequency for all converters and interleave them. <S> This way the input filter for all buck will be much smaller than the sum of individual filters (if they would not be interleaved). <A> Using independent frequencies probably has no massive negative aspect. <S> Identical frequencies, if they really are identical, may lead to switching transients from one converter getting into another at a critical part in the switching cycle and affecting when and how it switches. <S> At the likely levels involved in cross feeding I would expect this usually not to be a fatal problem - just MAY degrade accuracy of output if switching point is slightly affected by other signals. <S> Such spurious input would usually have effect only where they affected the switching decision voltage when it was very near to the switching threshold as at other points in the cycle the voltages will be large enough that noise will not affect them. <S> eg if switching point occurs when divided down output is fed to Vref pin and = <S> Vref = say 0.8V, then if Vin is 0.799 V, noise on the sense line that is coupled onto Vsense and that results in a + 0.001V change may make it switch early. <S> But if Vsense is at 0.700 Volts you'd need +0.1V noise to trigger switching Higher frequency Noise on Vout has a fairly free ride on to Vsense as there is usually a cap across the reference divider from Vsense to Vout. <S> This vastly improves response time to transients and removal can lead to a converter which is fatally trying to chase its own tail. <S> Ask me how I know :-). <S> If N converters are asynchronous wrt frequency etc then glitches will occur pseudo randomly throughout the cycle and hopefully have little overall effect. <A> If you run your bucks at different frequencies, you need to be careful of beat frequencies <S> - beating shows up as harmonic content on the input DC, and if unfiltered, the buck loop compensation may not handle it and allow it to pass to the output without attenuation. <S> Good input filtering is important (properly located high frequency ceramic and/or film capacitors near the input of each converter) as well as good layout practices (keeping the switching nodes as tight as possible, keeping physical separation between the bucks and not mixing the power/control routes between them, etc). <A> My experience: A particular job that had two switchers locked to the same frequency and then, on a 2nd iteration PCB mistakingly leaving a component out that "locked" them made no difference to the baseband noise whatsoever; neither did it affect power efficiency. <S> The job was quite analoggy with several strain gauge amplifiers etc.. <S> As far as EMC goes, like @The Photon says, use two frequencies because emissions are likely to be less, and this is supported by the manufacturers of several SMPSU chips who modulate their switching frequency to avoid this.
If they're at different frequencies, they are effectively independent for purposes of emissions.
LM386 audio amplifier not amplifying This is my first attempt at making a really simple audio amplifier. The schematics are below:- First I tried connecting the circuit to a 9V battery. (Multimeter reads around 8.3 Volts, which is in the operating voltage range of the LM386 as per datasheet) The result I have is lots of noise, sometimes cracks and pops and a barely audible sound of the audio input (it feels like highly attenuated form of input which is very bad). It doesn't even sound at least equal to the input! I want the gain to be around 200, so I do have a 10\$\mu\$F capacitor across pins 1 and 8 of the LM386. I've also tried connecting to a 9.6V - 250mA rated unregulated DC adapter. The results are almost the same... (though I seem to get a higher voltage here..) Initially I simply used a in-ear earphone to pick up the mono output. I also tried connecting a small speaker (pictured). It's apparently a 0.2W 8\$\Omega\$ speaker. The output is low, but the end result is similar to the earphone output.. Here's a snap of the breadboard.. Sorry for the bad quality pic. This config used the DC adapter and a 0.2W 40\$\Omega\$ speaker. I even checked all parts for continuity using a multimeter. I'm also open to tips on troubleshooting this, since I'm new. Top bus is the V s and the bottom bus is the common ground. Input audio is connected to the left end of the 'green' 1k resistor. Its a very thin wire since its from a small 3.5mm TRS cable. I don't want anything super loud, just audible maybe like 2x of the input signal. If so, what kinds of speakers would this amp be capable of driving? What would I need to make it sound acceptable? Basically, what's wrong with this circuit? UPDATE: I followed all of your suggestions and my setup now consists of an additional 100\$\mu F\$ capacitor in parallel to the power, a 100nF capacitor in series to the input audio signal and a 10\$\mu F\$ capacitor connected to the bypass pin.There was a problem though, the 9.6V unregulated adapter I use seems to show 22 Volts on the power rails (under load).. this seemed to make the LM386 run really loud. I seem to hear the amplified audio at times when I nudge some parts here, but anyhow after sometime, the IC got too hot and so did the 100\$\mu F\$ capacitor at the power supply. I can't really tell if it's all because of a bad quality adapter or the IC or breadboard or capacitors.. The capacitors were salvaged from an old PCB board of another circuit.Also since I think the last LM386 got fried, I desoldered another LM386 from another board and I'm keeping it in stock. This is the last 386 I have in hand now and I don't wanna screw this up. Now for safe testing, I drew power from laptop USB (5V regulated).. the volt at pin 6 of the new 386 shows a solid 5V. Speakers were really quiet so I hooked this up to an AUX cable and listened to it.. The output is weird and not satisfactory.. The sound seemed to be amplified when I nudge the power cable at pin 6 (ie, peaks of loud sound happens only at the beginning and then it fades to a point; see attached image/sound of the Line in recording) (Using no cap at pin 1 and 8) Sound Clip UPDATE-2: I seriously doubt the volume level output of this amp.. through the speakers, I don't think it plays it loud enough.. the signal sounds sort of 'amplified', but the speaker doesn't seem to output it loud. Btw, I tried 9V batteries, 9V battery with 5V DC, 7.8V DC, 5V DC all sound the same. Is it because of my speakers?Also thanks to everyone who suggested adding extra caps to the power rails.. that part really helped in filtering a lot of noise. I used a 10\$\mu\$F cap there along with the 100nF cap. Or does adding more caps cause power loss or something? <Q> The LM386 amplifier's inputs are an internally biased differential pair, with common mode input range extending to the indicated ground, V ee , or actually 0.4 Volts below ground. <S> In order to not disturb this internal biasing, the input signal must be capacitively coupled (or perfectly ground-referenced) - a capacitor in series on the input line is needed. <S> Next, for a voltage gain of 200, the input signal peak to peak needs to be under 1/200 of the output voltage range of the amp. <S> While I could not find this specified in a quick scan of the datasheet, if we assume 7 volts output voltage range with a 9 Volt supply, the input signal needs to be under 35 mV peak to peak , to avoid clipping the signal. <S> Clipping would result in mild to severe distortion of the output - though this does not explain the complete lack of signal you find on output. <S> If the incoming signal is higher than this 35 mV P-P, a potentiometer as an attenuator on the input is suggested. <S> Once these fixes are done, please revert with results, so the answer can be added to if needed. <A> A LM386 amplifier may behave quite erratically on a breadboard. <S> Here are some ideas that may help you: Start out with 20x amplification, i.e. without the capacitor between pin 1 and pin 8. <S> Add a 10uF capacitor between pin 7 ("Bypass") and ground. <S> The capacitor's negative lead is towards ground. " <S> A small electrolytic or tantalum cap of a few uF from pin 7 to ground will isolate the high gain input stage of the LM386 from power supply noise, hum, transients, etc." <S> ( source ) <A> Try removing the capacitor between pins 1 and 8, you say that you want x2 output and you are using x200. <S> Remove it <S> so you have x20, next connect an audio device and set it to it's LOWEST volume and increase it slowly. <S> You may also try to add a trimmer between pin 3 and ground and connect the center pin to audio device to attenuate input signal, but do not remove the input capactor. <A> Try the following: 9 volts through on/off switch to pin 6, 16 or 25 volt 10uF electrolytic capacitor between pin 1 & 8 (positive to 1, negative to 8), a 0.01uF ceramic capacitor from pin 7 to ground, and a 16 to 25 volt 220uF electrolytic capacitor from pin 5 to an 8 ohm speaker (positive of cap to 5, negative to speaker positive). <S> Pins 2 & 4 to ground, and all other ground terminals (jack input, power, speaker, volume potentiometer, etc).I have made many LM386 amplifiers for guitars, and the sound is great. <S> The max output is 325mA... <S> nearly 3/8 watt. <S> The battery can be a standard 9 volt, or for longer lasting power, use a harness that holds 6 AA 1.5 volt batteries. <S> An LED power-on indicator light can be added too. <A> The first diagram you posted had no 10 uF cap from pin 7 to ground. <S> This is a must. <S> The Zobel network R2 and C4 must also be installed if you are using the LM386 as an amplifier. <S> If you are using it as a part of an oscillator circuit then those two components are unnecessary. <S> There are a number of versions of the LM386 IC and lot of suppliers only offer the N1 version. <S> This version has a reputation for being noisy and unstable, whereas the N4 version has a much better reputation in terms of low noise and stability. <S> Hope this helps. <A> I had the same problem, you need to increase the output capacitor for the speaker, 220 uF is way too small <S> , I am currently running 2200 uF, there is a lot more noise, but the output is a lot louder, two 470 uF capacitors is probably best.
Some extra filtering never hurts Keep all components as close to the LM386 chip as possible Keep the input path as short as possible, to avoid external interferences Add a 100uF capacitor across the power supply rails, in addition to the 100nF capacitor you have. Once you get proper sound at the output, you can always pump up the gain
Different ASCII Characters in RS 232 I'm working on the UART communication of PIC18F4520. I have tried simulating the code on ISIS proteus and then also checked the real time result. One thing I am quite confused about is that the characters I get from the two i.e. simulation and the experiment are not the same. I have no confirmation of this but still wondering if it is possible that for every other machine, ASCII characters are interpreted differently. Is this possible..? void main(void){ unsigned char r; TRISB=0; // configure USART OpenUSART( USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 5 ); r='y'; while(1) { putcUSART(r); while (BusyUSART()); r=ReadUSART(); PORTB=r; } CloseUSART();} The output has been shown in this snapshot: <Q> No, since it's an encoding standard, if set to ASCII the hex values should mostly be interpreted the same on any machine. <S> The printable A-Z, a-z and numeric characters should be reliable, but as Chris notes in the comments there can be differences with other codes and the extended set. <S> Check your baud rates, stop/parity bits, handshaking, and also that the terminal program is actually set to ASCII (i.e. not displaying in hex/octal/binary) <S> For reference here is an ASCII table . <S> EDIT - now you have added the code, I see another issue. <S> You set the variable r = 'y' , but then read the UART and store the result in this variable, overwriting it. <S> This means the code will only send a y on the first loop. <S> Use a separate variable to read into if yu don't want this to happen (or reset to <S> y <S> within the loop each time) <S> Something like this: <S> void main(void){ unsigned char r; unsigned char t; TRISB=0; // <S> configure USART <S> OpenUSART <S> ( USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & <S> USART_CONT_RX & USART_BRGH_HIGH, 5 ); t='y'; while(1) { putcUSART(t); <S> // Changed variable to t to avoid overwriting on read while ( <S> BusyUSART()); r=ReadUSART(); // Read into r <S> PORTB=r; } <S> CloseUSART <S> ();} <A> First off, that code looks to me like it puts out 1 'y', and then it reads, getting I-don't-know-what and outputting what it reads. <S> Does ReadUSART block waiting for a character? <S> Second, are you certain of your baud rate calculations? <S> I don't know the platform, so I can't check you, but if your serial terminal is set wrong in the real world, that could easily cause this kind of behavior. <A> The strange character is Ç . <S> It is code C7 (11000111) in ISO 8851-1. <S> The code for y is 79 (01111001). <S> If we add start and stop bits we get 0110001111 and 0011110011. <S> And of course the idle level in RS232 corresponds to 1. <S> You can see there are similarities at the binary level, so that if somehow the reception of start and stop bits is unreliable or whatever, it could explain how y turns to Ç . <S> A correct bistream of back to back <S> yyyy looks like: 0011110011001111001100111100110011110011... <S> Now you have to understand that in RS-232 there can be a synchronization problem! <S> The only framing information is the 0 start bit and the 1 stop bit. <S> If the start bit is not received correctly, and there is back-to-back continuous transmission, <S> the only way that the receiver can detect that it is in error is if it receives a 0 at a point where the stop bit is expected! <S> If a variety of characters are transmitted, hopefully it will lock in on the correct framing eventually. <S> If there is a pause in the transmission, of course, that helps too. <S> In repeating sequence of 10 bits, any 0 which is preceded by a 1 could be the start bit. <S> So in a repeating sequence of y , assuming 8 bits, no parity and 1 stop bit, there are two possible frame starts: 0011110011001111001100111100110011110011... <S> ^--------^ 'g' ^--------^ 's' So assuming a correct receiver and a reliable link (except for missing the start bit), a stream of y could be misinterpreted as a stream of g . <S> You don't need bad hardware to get this screwup. <S> Now g has code 67, which isn't C7, but some other problem can perhaps explain that one, and also the fact that you were consistently getting the C7 character. <A> I have got my problem solved i guess. <S> There was a problem with the development board and as i changed the board, i got the data without any glitches. <S> Thank you everyone.
If you are getting different results between simulation and real life, then it's likely you have set things up incorrectly.
Best way to go about biasing a Class B audio amplifier? I am trying to bias the class be audio amplifier in the provided pdf. None of the resistor values are correct so the bjts are unbiased. What is the best way to go about starting to bias this? Circuit: simulate this circuit – Schematic created using CircuitLab <Q> Your schematic is squished too small so that part values and designators can't be read, so I'll only answer in broad terms. <S> For starters, the input section is missing a deliberate DC bias. <S> You have <S> AC coupled the input, which makes sense for a audio circuit, but added no deliberate DC bias of its own. <S> Only the middle stage has a deliberate DC bias, but this is AC coupled to the output stage so that bias does not follow to the output. <S> This circuit also can't seem to make up its mind whether it is meant to be single supply or not. <S> The three stages seem to be running from a single supply, but then the output is shown DC coupled to a load to ground, which makes no sense relative to the other parts. <S> To fix this mess, I'd start by adding some DC bias right after the input capacitor. <S> That should float the first stage at some reasonably predictable operating point. <S> This feedback would be filtered to only effect the DC operating point. <S> The AC feedback would still go back to the first stage as it does now. <S> Beware of instability though. <S> This kind of output stage will have a little crossover distortion. <S> You didn't give enough specs to determine whether that matters in this case. <S> If this is meant for high quality "hi-fi" operation, then you need to deal with it. <S> If it is meant for something less demanding, like a public address amplifier for example, then the overall feedback may deal with the crossover distortion well enough. <S> It won't be large, and for many basic applications that will be good enough, which allows keeping things considerably simpler. <S> In any case, you need to add small resistors in series with the emitter of each output transistor, else you can get large currents thru both and thermal runaway. <A> None of the resistor values are correct so the bjts are unbiased <S> That's not correct. <S> The two diodes are already attempting to bias the two output transistors. <S> It's not a good technique though. <S> You need to investigate a thing called a 'bias spreader transistor', associated with a trimpot. <S> The resistor values are certainly all wrong as well, but that can't affect the output stage bias, as the output stage is AC coupled. <S> They do affect bias of the second stage, but that's not class B <S> so I assume that's not what you're talking about. <S> I would expect to see 0R1 to 0R33 at the emitter of each output transistor. <A> Here's the more up to date (and squished) circuit the OP refers to in his comments <S> and I've marked up in red the problems, and there are many of them: - Biasing problem - bias needs to be centred on mid-rail except you have one of the supply rails upside down <S> so there isn't a mid-rail. <S> All the current generators are ridiculously high in value. <S> Emitter resistor at <S> zero ohms - this can't be or a Q point near centre of the rails is never going to be achieved. <S> 1N4148s are only rated at 200mA (which is fine if a sensible bias current for them were chosen). <S> Top o/p transistor is a 600mA max device whereas PNP is a 15A device. <S> I'm not going to even try designing any decent values until the OP is interested in putting the circuit into some sort of order and starts listening to folk and answering questions like "have you built it/simulated it?"
Perhaps you can DC-couple the second and third stages, then use the DC of the output to bias the second stage.
Convert 9v of battery into 5v at 3.5watt I want to run Raspberry Pi using a general non-rechargeable 9v battery.Raspberry Pi needs 3.5W and 5V input.Questions: Which LDO should i use ? For what amount of time general 9V battery is able to supply 3.5watt power ? EDIT1:Battery is Duracell 9V rectangular battery. <Q> The data sheet available on this page <S> won't tell you outright <S> but it'll hint at very bad news. <S> It shows that at a power draw of 0.25W the service life would be 14 hours. <S> However at 0.5W the life falls to - not 7 hours, but 3.5 hours. <S> This shows that pushing the battery beyond its limits results in useful life much shorter than a simple amp-hour calculation would suggest. <S> Double the power 3 more times <S> and if the same pattern applies, the projected life would be more like 4 minutes than the 36 minutes that Samuel suggested. <S> Find a battery with your current requirements at least on its design spec. <S> Even four AA cells would a closer match for your needs. <S> Alternative approach <S> : ditch the R-Pi and use a lower power target processor. <S> This depends on your computational needs, but there are low cost ARM processors like the TI Stellaris and others, with maybe 10% of the processor speed but capable of running at a few ma and sleeping at a few microamps for maybe a year on that battery. <A> This isn't a good idea. <S> Do realize you're trying to run a computer off of a standard battery. <S> An LDO will just dissipate any excess power needed to supply the 700mA to the system. <S> Effectively you can just assume your 9V battery will be supplying 700mA and you'll be splitting that power between the LDO and the Raspberry Pi. <S> You'll need to select a 5V LDO that can dissipate at least (9V-5V)*(700mA) = <S> 2.8W. <S> It's difficult to say how long you're expecting this setup to last, but it will be on the order of half an hour. <S> A typical 9V battery is rated at around 600mAh, to calculate duration you just divide by the current, (600mAh/700mA) <S> = <S> 0.6h <S> = 36 minutes. <S> It could be more, it could be less, the Raspberry Pi will not likely be consuming 700mA at all times and it may even peak beyond that. <S> You need to determine a power profile for your use case. <A> Here is the datasheet for the Duracell 9V battery . <S> What you will find is that the battery just isn't up to the task. <S> None of the charts and graphs show operation at the power levels that you require for the Ras-PI. <S> If I were to extrapolate from the graphs that are there... <S> In the most optimistic case you could power the board for about 3 hours. <S> All of this assumes a switching DC/DC converter with 100% efficiency (which doesn't exist). <S> A practical switching converter is going to give you an average of about 75% efficiency for this project due to the large input voltage range, so reduce those estimates by about 25%. <S> In short, unless you have a specific need for a battery that will only last about an hour I wouldn't do this. <S> You certainly do NOT want to use an LDO regulator. <S> That type of regulator is inefficient in this task and might reduce your battery life to well under 30 minutes.
In the most pessimistic case, you might get about an hour. To get a longer life time you should use a switching regulator, use more batteries in parallel, use high capacity batteries, or work out a way to plug the computer into a wall outlet.
Smaller alternative to RJ45 Ethernet connector I am trying to minimize space usage for an enclosure that holds 48 boards with a RJ45 connector for Ethernet communication on each board. The boards work well with 10BASE-T (2 pairs) connection to a 48 port 10/100 Ethernet switch, faster is not really needed. I am thinking of replacing the RJ45 with a much smaller connector, or with simple gold fingers and have an edge connector going on top - in best case even a backplane that connects to multiple boards at the same time (other end would still be 48 port Ethernet switch though for the time being). Would this work or do you have other recommendations? (objective is shaving off the height of the stacked boards, keep noise at minimum, and avoid connecting one by one if possible) <Q> In theory, you could get a custom cable to go from RJ45 to anything you want. <S> Samtec has some great connectors. <S> The only thing that (supposedly) matters is the pairs being twisted to prevent crosstalk between the pairs. <S> However, if your cabling is very short, it might not matter as much, especially for 10BaseT. You can probably use an old-school 0.1 pitch connector for that. <A> If the deployment is in a controlled environment ( no random people plugging random cables into connectors ), you could consider what is probably one of the most ubiquitous low-profile connector around today, the micro-B USB 2.0 connector . <S> The advantages are price, size and a likelihood of sustained availability: Those connectors, and cables to connect to them, are very common with cellphones, so standardization is high, as is volume-driven price reduction over time. <S> Those connectors are available in both flat and vertical configurations, so a backplane option becomes viable, or better yet a riser board or several of them. <S> For a very short cable run to the actual RJ45 ports as specified in the question, cable impedance and twists-per-inch may not be deal-breakers - OP will have to check the actual deployment constraints to determine this. <A> Make 2 variants of the board - let's call them Master and Slave. <S> Master has 2 (or 3) <S> RJ45s, Slave has board-board connections to the extra sockets on Master. <S> Master can accommodate a Slave on either side of it if you need to triple the density. <S> However as Nick says, you will have to pay close attention to cooling and airflow. <S> And it implies removing a set of boards - Master + slave(s) rather than individual boards for maintenance. <A>
The big disadvantage is that someone could conceivably plug a cellphone charger into one of the ports. Another option is four conductor TRRS jacks and plugs, with standard ethernet cabling.
Are high power ceramic resistors waterproof? I need to put some resistors on my jeep. I picked up 2x 22ohm, 10watt resistors at a local electronic store. They do the job well, but are they waterproof? Can they hold up to the elements? I put the resistors under the hood, so they should not get wet under normal usage - and I covered them in heat shrink. On the off chance that they get wet, will it chance their resistance? I'm not talking about the striped cylindrical resistors, but the white rectangular ones. <Q> On the off chance that they get wet, will it chance their resistance? <S> Yes. <S> Unless they are sealed, yes. <S> How much it changes depends on a few factors (impregnation depth, chemistry of the solution, volume, mass, and temperature). <S> They are made from a porous ceramic powder material so they will absorb moisture from the air and liquid in surface contact. <S> The bigger problem is the impurities left behind by the liquid. <S> Seal them. <S> What are you using them for exactly? <S> (just curious) <A> No they are not water proof. <S> Three things you could do. <S> You could seal them, but since the good Dr. Fried Parts says the power ratings should be halved, you might need to double up on each resistor. <S> Or you can mount them in a automotive rated case, like under the hood car fuse boxes are. <S> They are encased in aluminum, to provide resistance against weather conditions without affecting thermal conductivity. <S> You could also just deal with them as is. <S> Unless you are off roading in river, or driving through flood prone areas, cars normally do not get much if any water under the hood, especially at headlight level. <S> If they did, alternators, batteries, lightbulbs, fuses would all have serious risk of damage with the current state car design. <S> How about an alternative solution(s) <S> ? <S> 1 <S> , Get a second set of led turn signal bulbs, hook them up in parallel. <S> You instantly get twice the load on the line. <S> 2, disable or trick the current sense circuit on the line. <S> If people can trick emissions systems to remove o2 sensors that way, I'm sure a simple light bulb burnout sensor or circuit/system can as well. <S> You might need a factory wiring manual for that. <A> Note also that the leads of this type of resistor are almost universally tinned copper wire, which is a combination that is not at all resistant to corrosion. <S> They need to be kept clean and dry. <S> You also need to pay attention to how you connect wires (or whatever) to the resistor leads. <S> A crimp connection will be more reliable than a soldered connection. <S> But again, it needs to be kept clean and dry.
For reliability, seal them with an automative-grade silicon sealant and derate their power rating by 2. However, if you run enough power through them, they will get hot and "bake" the moisture out. Or you could get Load Resistors designed for automotive use.
What does a PLC read if I have an unconnected input? What does a PLC read if I have an unconnected input? I know that I can test it, but I want to know whether there is any default ? <Q> For digital inputs it will read zero. <S> For analog inputs it depends - for example in 4.. <S> 20mA signals you know <S> when you have a wire break, but in 0..20mA <S> you don't. <A> I'd be surprised if a PLC input couldn't handle a simple on/off switch in the field because that's how most of them are used. <S> "Off" is electrically no different from "unconnected" except for some induced noise on a long cable run. <S> (because of redundancy, actual fault detection, outsmarting ignorant operators, etc.) <S> The way they do this is with a pull-down resistor that requires significant current (compared to noise) to raise the voltage above the threshold. <S> Some inputs, especially those that take 120VAC or so, use opto-isolators instead, which is one or two LED's that shine on a light-sensitive transistor, all sealed in a plastic case that looks like an IC chip. <S> Either way, it requires current to operate the input, which the induced noise can't provide enough of. <S> More like x-20mA except with a digital threshold in there somewhere and no regard for the actual value. <A> The default logic level is probably undefined or at best written in the datasheet of the device. <S> You don't want to rely on a default like this unless explicitly defined there as the reading may be influenced due to noise. <S> PLCs are commonly used in very noisy environmnents.
Therefore, unconnected digital inputs to a PLC can generally be relied on to read "0" except for safety applications.
Why not reflow a PCB before placing parts? A standard reflow method for low-volume assembly is: Method A Apply solder paste (using stencil or syringe) Hand-place parts (using vacuum pickup pen or tweezers) Oven reflow - But what happens if one does the following instead? Are there any potential disadvantages?: Method B Apply solder paste Oven reflow first time Hand-place parts Oven reflow second time - I see no disadvantage to Method B, and one rather convenient advantage: The solder paste will have already solidified during the first reflow, so after that, part placement cannot disturb/smear the solder paste any more; so, it's easier to get a high-quality finished board (fewer solder bridges or missed solder joints). In contrast, Method A demands greater hand precision, especially for fine-pitch ICs, and really gives you only one shot at the part placement. <Q> Because the method you describe, and it's advantage, is really a disadvantage. <S> Not only is it harder to place smd parts on unevenly tinned pads, it prevents the main advantages of solder paste. <S> It is a paste of tiny solder beads and flux. <S> The smd parts are suspended in place. <S> The second being surface tension. <S> When freshly reflowed, free of oxidation and contaminants, there is high surface tension. <S> The parts are not likely to move without external force. <S> And the last advantage is capillary action. <S> Between the flux, the surface to surface contact of the pad and the pin, capillary action pulls the pin to the center of the liquid solder. <S> Multiple pins doing this, makes a smd part self center. <S> And as long as you have solder mask between the pins, this is even more effective, of course, only if there is not excessive paste on the pads. <S> And most importantly, industry leaders have probably tried your method, and having not adopted it, it probably didn't sit well with them. <S> Probably. <A> Have you ever done any hand-pick-n-place work? <S> You push the component into the solder paste, and it is this paste that holds the components in place when you sneeze over it or otherwise are handling the populated (but as yet not reflowed) <S> PCB. <S> With the solder already melted you don't only miss the 'gluing'. <S> The flowed solder will have made small 'hills' on all the pads, so now you are into the task of balancing your components on top of two or more hills (small though they might seem for you). <A> Reflow for many packages just works better when the IC's can sit flatter on the board, and in paste. <S> Try teetering a 100 pin package on the nicely rounded-over edges of hard solder, and see what happens. <S> Your parts will just skid right off the pads before the solder melts. <S> Less precision than you think is required for positioning IC's, as the surface tension wants to pull the chips into place -- so long as the leads start off somewhere on the pads, which they might not using method B <S> Lastly, your IC leads will get none of the benefit of the flux in the solder paste, which is activated at a temperature lower than melting (that's why the heating standard is a series of ramp-soaks). <A> To add to the other good answers, the PCB materials have a limited number of reflows to give before they break down from the heat and begin to cause failures. <S> Your proposal consumes one reflow cycle that could otherwise be used as a repair cycle later. <S> Some materials only provide a couple opportunities to repair something before the heat begins to break things, and those cycles can be very desirable opportunities to have before putting an expensive board in the trash. <A> If one was to use method B, you could just manually apply solder. <S> Did you ever try that? <S> I can't even nicely solder a SOIC-8 with solder still left on the pads. <S> Paste keeps parts in place with its stickiness. <S> Flux cleans oxidized metal and helps the soldering process. <S> Surface tension self-aligns parts to a certain margin. <S> Reflowed solder causes 'bubbles'. <S> In my experience, parts don't want to stay on top of these and glide off. <S> More heat cycles on the PCB. <S> What are reflow profiles all about...? <S> If you end up with solder bridges, maybe the paste is wrong/old or you applied too much. <S> Manually reworking it will solve that, although that can be pain on large series or small packages. <S> If a part ends up misaligned, remove the part with hot air, clean the board carefully and replace it manually. <S> This can happen all the time, for example tombstones on small passives or a QFP/SSOP package that drifts off <S> it's pads <S> (probably not aligned well enough during manually placing parts).
The first is that solder paste holds a piece in place, ever so slightly, before being reflowed. Second and third reflows result in lower surface tensions, as well as cold joints.
Can electronics be damaged by undervolting it? I was wondering if there are some particularly important mechanism by which one can break electronics, when undervolting it. Its pretty obvious that lots of electronics will not work properly if undervolted, but what about permanent damage? The question was motivated by repair work. I was wondering about what sorts of secondary effects one should look for when a damaged power supply was involved. I imagine motors could be damaged if they stalled due to undervolting. So what are specific mechanisms for permemenant damage due to undervolting (or better put undersupplying)? Are there even any? To add to the question, what are components or simple circuits that fail when undersupplied? <Q> Damage by undervoltage is not as common as by overvoltage, but it is not unheard of. <S> An example: a simple circuit that has a power mosfet driving a motor. <S> The intention is that the mosfet is either completely on or completely off. <S> In both cases the power dissipated by the mosfet is very low: when it is on the power is low because the o-fully-on resistance of the mosfet is very low, hence the voltage across it is also very low, so the power (V*I) is low. <S> when it is off the full voltage of the power is across the mosfet, but the current is almost zero, hence the power is almost zero too. <S> A mosfet needs a certain voltage at its gate to turn fully on. <S> 8V is a typical value. <S> A simple driver circuit could get this voltage directly from the power that also feeds the motor. <S> When this voltage is too low to turn the mosfet fully on a dangerous situation (from the point of view of the moseft) can arise: when it is half-on, both the current through it and the voltage across it can be substantial, resulting in a dissipation that can kill it. <S> Death by undervoltage. <S> Note that I started by assuming a simple circuit. <S> In practice a serious circuit like this would have an undervoltage protection. <A> Wouter has some good information, but there are more scenarios where not providing a high enough voltage can damage a device. <S> Some higher end display screens require multiple voltage sources, and failing to power one source to a high enough level, or fast enough, before a second source, can cause damage to the screen or controller. <S> Some devices with internal mosfet can be damaged by underpowering the source. <S> As was explained by a TI employee about a current controlled led driver, if the VLed source is too low to provide the selected current through a channel, the logic in that channel will try to drive the channel's mosfet harder to try to sink more current. <S> Eventually, the mosfet will burn out, if not other parts of the chip. <S> I wish I could find that discussion and link it. <S> While not directly causing damage to the device being underpowered, failing to provide the right voltage to a heating element could cause what is being heated to not heat up correctly/fast enough. <S> Winter Water Pipe heaters, electric stoves, microwaves (for a loose meaning of "heater"), certain car parts. <S> Worse, medical devices or heating in artic environments. <S> Same for cooling solutions, like fans or ACs or pelters. <S> A underperforming fan due to voltage issues can cause it's target to overheat. <S> Water pumps as well. <S> And all three can be damaged by the side effects of it. <S> Water pumps normally use the moving water to cool themselves. <S> A lower voltage will cause it to move water, but might not be fast enough to cool itself down. <S> Underperforming fans might be cooked by the device it could not cool down. <S> Heaters themselves might freeze if they cannot get hot enough. <S> And last I can think of, battery chargers. <S> A battery could feed back into the circuit when it shouldn't. <A> It depends on your load. <S> If it's a resistive load, lowering voltage means it will conduct less current and dissipate less heat. <S> Nothing wrong here. <S> If you drop the voltage on the gate/base of a transistor and it may not fully saturate and have a larger voltage drop. <S> As power dissipation is P=U*I; the voltage drop on the transistor could double (from 0.5V to 1V) while the current may stay more or less the same (for e.g. 1000mA to 800mA). <S> You effectively doubled the power dissipation and that could lead to damage! <S> If the device uses a linear regulator, the regulator will have to regulate less voltage. <S> This will lead to lower power dissipation. <S> Of course there is a limit at which the regulator cannot maintain regulation anymore and the output voltage will drop too. <S> This output may shutdown or stop working at a certain point. <S> Switch mode power supplies are a constant power load. <S> If you assume the output to draw a constant power ; for example 3.3V 1A. <S> This equals to 3.3W which means whatever the input voltage is <S> , it will always draw 3.3W. <S> In practice you have efficiency (which can vary) and limits to the voltage region, but it will try to draw 3.3W. <S> If the input voltage drops the input current increases. <S> If parts like inductors, diodes or MOSFETs cannot handle the higher current (heat dissipation or exceeding saturation/peak currents) it can cause damage. <S> However, in that case you're probably exceeding a certain operation window. <S> For example, a product may have a input voltage requirement of 9-15V. <S> Although the switching regulator would work fine on (for example) 7V, it may exceed the current on some part and become unreliable. <S> Sometimes you see "Undervoltage lock-out" on these devices. <S> This is a voltage at which the switch mode supply will shutdown because it cannot guarantee reliable operation. <A> One example of a specific failure mode of certain electronic systems is Latch-Up. <S> https://en.wikipedia.org/wiki/Latch-up Quote from the above link... <S> This frequently happens in circuits which use multiple supply voltages that do not come up in the required sequence on power-up, leading to voltages on data lines exceeding the input rating of parts that have not yet reached a nominal supply voltage. <S> Often this can be resolved by simply power-cycling the system, but if that system is controlling some other mechanism it can cause further failure or even physical damage as an indirect side-effect.
A malfunctioning charger, or simply badly designed one, as part of a larger circuit, could cause a lower voltage in a charging state.
Can electronics be damaged by under-currenting it? Someone just asked Can electronics be damaged by undervolting it? , so now I am going to ask under-current. Let's say something requires 10A, 12V, if I limit the current to 5A, could anything go wrong? <Q> Conceivably yes. <S> Limiting the current means that the circuit will attempt to draw the current but the supply limiter will reduce its output voltage in order to balance the higher demand of current. <S> We are back to a lower voltage or under-voltage scenario <S> and I can envisage a situation where a weakly designed circuit will potentially be damaged. <S> A buck convertor may be specified to run from (say) 20V. <S> It's <S> output may be 5V to a load that might be 1A (5 watts to the load). <S> Ignoring losses, it will take 0.25V from the 20V supply in order to do so and it may be fused for say 0.5A. <S> An associated part of the whole circuit may nominally require 2A and if you current limited the supply to 1.5A and <S> the voltage dropped to (say) 6V the buck convertor could be taking 0.833A. <S> It's a tortuous example <S> but it could happen and the fuse blows. <S> Maybe there wasn't a fuse - <S> the buck convertor transistor will get too hot and if it is a BJT type it will destroy itself. <A> Flawed premise... <S> Fundamentally, it is not possible to "under-current" a device^ while simultaneously providing the nominal voltage (e.g. not under or over "volting" it). <S> ^ device <S> = complete network, sans power source ... <S> due to the relationship Since voltage and current have a relationship... <S> Ohm's law v1 = <S> c i1 in the simple case of a linear element (c = constant) <S> v1 = <S> F(i1) <S> , let's say, in the generic case <S> It is is not possible to independently and simultaneously describe v1 AND i1 without modifying or violating F(..) <S> In the two port case... Confusing to students is the representation of this model using two ports (typically an input and output port). <S> In this situation, you no longer have the complete system enclosed in the boundary of the "black box" (blue in this case ;-) ). <S> Therefore, there are more degrees of freedom. <S> That is not the case of the question. <S> You'll notice that each of the other answers that attempts to answer the question directly, makes assertions/assumptions about the output side of the circuit (two-port model) or concludes that "under-power" (output) or "lower voltage" (input) will be required. <A> Transistors not in saturation could have heat buildup and dissipation issues. <S> Some devices with internal mosfet can be damaged by underpowering the source. <S> As was explained by a TI employee about a current controlled led driver, if the VLed source is too low to provide the selected current through a channel, the logic in that channel will try to drive the channel's mosfet harder to try to sink more current. <S> Eventually, the mosfet will burn out, if not other parts of the chip. <S> I wish I could find that discussion and link it. <S> Or if a series resistor is added that shouldn't be there, limiting current, could also trigger the logic to drive the mosfet too hard. <S> Indirectly to both the device <S> and it's target, Heating Elements, Cooling Solutions, Water Pumps. <S> Motors as well. <S> Indirectly, underpowered lights can stop illuminating, causing accidents, which could eventually cause the light to be damaged. <A> The most common situation in which supplying a lack of current to a device would cause damage would be those in which a device has two supplies and one of them receives insufficient current. <S> This may cause damage either to the supply, or to equipment powered thereby.
Otherwise, while supplying too little power to a device is not especially likely to damage it, it's common for some types of power supplies to have a minimum current draw specification, and for their output voltage to exceed design limits if the amount of current drawn is below that.
Connectors for horizontal and vertical mount Alright, I will try to formulate this as a non-shopping question... let's hope I can make it so. I do have a board (which I can still change) which basically has 1 hole in each corner. This board, features some (user-accessible) connectors on one side (USB, ...) and now I'm looking for a way to fix this board to some mainboard. I would like to be able to fix the board either horizontally or vertically, the required pin count is around 150 (including power and ground). What I am looking for is a way to mount the board either way with as few additional components as possible. I also have the option to mount it to the casing in either direction but I'd rather have a version where the board is really tied to the mainboard (and to the casing). The main question is now: Do you have another idea than using a 90° 1.27mm (0.05'') pin header? <Q> If the requirement is "as few additional components as possible", then the answer is probably some kind of edgecard connector . <S> This requires only one additional component, probably a connector mounted on the main card. <S> Connection to the daughter card is made through a pattern etched in copper on the daughter card. <S> It should be possible to find a family of connectors that allows either a horizontal or vertical connection. <A> Then the mechanical connection could be made via any other method, including standoffs or spacers or some other structure. <A> Two sections of 80 conductor ribbon cable. <S> That way you could even use standard dual row headers. <S> Or you would need to use high conductor count FPC. <S> Backplane connectors would be another option. <S> Mainboard will plug into backplane, daughterboard plugs into a second one for horizontal, or a third for vertical. <A> If cost and ease of availability are factors, then: <S> Use two Ultra-DMA IDE (80-connector) ribbon cables, each with Insulation-Displacement Connectors. <S> Use the corresponding 40x2 fine-pitch IDC receptacles which are available in both vertical and horizontal configurations, 2 on each board (mainboard and accessory board) <S> If you have the option, put the receptacles well-separated along the "joining edge", such that an accidental wrench does not pull off the cables. <S> Of the 160 conductors available between the boards, use 150 for the currently assigned lines, and the remaining 10 distributed 5 each for power and for ground. <S> Now mount the two boards mechanically using L-brackets, such as used in some PC cabinets.
You might use a short ribbon cable for the electronic connection, allowing the board to rotate 90 degrees while staying connected.
Why do LEDs not obey Ohm's law? In a previous question, it was brought to me that LEDs do not obey the Ohm's law .(See Calculate expected voltage around a resistor ) Simply put: how is that? What makes them behave so differently? How should we treat them in a circuit and calculations? Are there other components with similar behavior? <Q> They do - they just do not have a "fixed" resistance. <S> If you look at it from a standpoint of having a fixed forward voltage drop (which they sort of do - depending on operating region) - look at them more as having a fixed voltage across them. <S> Therefore, as different currents go through them, their voltage will stay (relatively) constant, but <S> the resistance will change. <S> This is a simplistic answer - <S> but I think you're talking at this level. <A> Ohm's law applies to resistance. <S> All resistive aspects of a device will behave according to OHm's law. <S> If you invert your question you see that every thing that behaves according to Ohm's law must be a resistor. <S> There is only so much that one can do with pure resistance. <S> So logically the anything that doesn't behave according to ohms law isn't a resistor. <S> Or any thing that isn't a resistor won't behave according to ohms law. <S> I believe that is called a Tautology. <S> In circuit design we have many different devices all having unique properties to be able to implement different things/functions. <A> Simply put, because the're not resistors but p-n junctions, and because of that their V-I ratio is exponential. <S> It doesn't mean that you can't calculate their current, just that it's not as simple as for resistors. <S> For instance, you can treat them with a threshold model, with a fixed voltage drop. <S> Then the current will be set by external resistors or active components. <S> The LEDs are diodes, so that's the obvious similarity. <S> Also the base-emitter junction of a bipolar transistor is a diode, and behaves similarly. <A> A lightbulb, on first examination may not appear to obey ohms law. <S> Measure its resistance with a multimeter and it might be 5 ohms. <S> Connect it to a power supply capable of illuminating it and measure current and voltage and its resistance will have considerably risen (maybe 20 or 30 ohms). <S> Its still a resistor but <S> its resistance changes with power delivered to it. <S> A light dependent resistor is another example - its resistance changes with incident light - it's still a resistor and obeys ohms law - but it takes a little bit more than a linear volt-current graph to figure things out.
The only difference with diodes is that their threshold voltage is higher due to the different materials and doping.
Any good way to automatically enable an RS-485 transmitter in hardware? Does anyone know of a good circuit that would automatically enable the transmit on an RS-485 driver when characters are transmitted? In our designs we currently use RTS to drive the driver transmit pin, but then the RTS signalling has to be done in software. Note the solution would have to be quite cheap as this will be a volume product (kind of excludes using a separate microcontroller to do the job). Also keeping the transmit enabled for any longer than necessary would be a problem, as the serial line may have to handle a lot of traffic. <Q> If you're using an ordinary asynchronous (UART) protocol, with a start bit at the beginning of every byte, one simple method is to use a monostable multivibrator (even the dreaded 555) set to the duration of a byte plus the start bit and about half the stop bit, and use that to enable the transmit driver. <S> If the multivibrator is retriggerable, you need to allow up to one full byte time from the end of a transmission before anyone else can transmit, because the multivibrator may have been retriggered by the last data bit if it was a zero. <S> If not, then it should shut off in the middle of each stop bit, and then trigger again on the next start bit. <A> Well "good" is a vague term, but you did say "cheap"... <S> The simplest solution to this I've seen and tested myself is to use a PNP transistor and RC network. <S> The following example is intended for 9600 baud, so a 22k resistor and 1n5 capacitor are used. <S> These values would be modified for different baud rates. <S> This is by no means an elegant solution, but it's simple and can be build from the parts bin. <S> Here's the schematic: <S> simulate this circuit – <S> Schematic created using CircuitLab <A> You should probably have an edge-triggered interrupt on the "data in" pin that asserts your "data out" signal even before a byte has been fully received, so that as soon as the complete byte is received you can start transmitting it <S> (it's normally a good idea to assert transmit enable a little while before transmission actually begins). <S> After a certain amount of time elapses without either a falling edge or a completely-received character, turn off the transmit enable pin. <S> The above approach would introduce a delay of a full character time between when the processor receives data and when it goes out the wire. <S> In some cases, it may be desirable to reduce that time. <S> Doing so would require using a software bit-bang UART instead of a hardware UART. <S> Getting the timing correct at higher bit rates would be difficult, but one could have much finer control over the timing of the incoming and outgoing data. <A> I saw a circuit that probably solved this issue. <S> The CPU was a slave on the RS485 and therefore normally was in receive mode waiting for the correct ID message whereupon it would transmit its reply. <S> The RS485 chip was transmit-enabled by the leading edge of the 1st bit in the data reply coming from the CPU when responding. <S> A diode, a capacitor and a resistor contrived to quickly enable the chip into transmit mode, and successive data transitions kept it in transmit mode. <S> When the transmission ended the cap would discharge through the resistor and after a few tens of milli seconds the chip would revert to receive mode. <S> There are two issues with this - the first bit transmitted <S> was slightly short by about 10% and this may cause you problems. <S> I'm sure a better circuit could be developed <S> but there will always be a shortening of the 1st bit due to this being used to "detect" a transmit signal and enable the RS485 to transmit. <S> The 2nd issue is that the transmit enable circuit kept active for some tens of milli secs after transmission from the slave had ceased and this of course prevents the master from polling another slave during that period in time. <S> If these "issues" are OK then no problem, it will work <A> I've been looking for a similar solution but I needed very accurate timing as the bus is running at 90% capacity. <S> I couldn't afford to have more than half a bit length of overrun. <S> I need to reliably disable the Tx within 2uS of the end of the stop bit. <S> My solution was use use a S/R D type flip flop to latch the start bit then drive that into an LTC timing chip (LTC6994), these provide 3% accuracy at the baud rate I needed of 230kbps. <S> The output of the timing chip drives the reset on the D type.
Your best bet would probably be to use a small microcontroller (probably with a UART, though software bit-banging might suffice) which takes a "data in" signal and generates both "data out" and "transmit enable".
Circuit works on breadboard but not PCB I have a fairly simple circuit that works perfectly on the breadboard, but I am having a lot of trouble transferring it to a PCB. I am seeing very strange behavior which lies outside of my current experience, so I hope to get some advice. The circuit implements a wifi motion sensor, although the problem I am having happens waaay before I get to the RF part, or even the uC part of the diagram: I have circled the part that is having trouble. R3 is a pull-down resistor, which is required b/c AMN42121 drives the output HIGH when motion is detected, but leaves it hanging for no motion, so pull-down is needed. I used C1 to smooth out the transition between motion and no motion. C1 makes the output level go to LOW slowly and smoothly, so "no motion" state is achieved after a few seconds of no motion. Inverter is there b/c attiny's external interrupts are triggered by LOW level, so I need to invert the logic. It is unfortunate that I had to use such a large DIP package for one inverter, but I couldn't find anything else. I have made a double-sided PCB for this circuit, which looks like this: Again, I have only assembled the circled area so far. After soldering S1, R3 and C1, I get the following signal from sensor output: This is exactly what I want to see, so everything is fine up until this point. Next I soldered in a socket for IC2 and plugged in the inverter. This is where mysteries begin. At first everything was fine, but after a while of messing with the board the circuit suddenly stopped working. When I place a probe on the sensor output, instead of the nice signal we saw above, I see variations on the following two examples: Example 1: Example 2: Note that unlike the first example, the signal in the second example is not generated by motion - that saw tooth shape just emerges on it's own w/o any action from me. After a lot of testing, I was able to establish the following: Unplugging the inverter from the socket makes the sensor work properly again. Cutting power to the inverter while leaving it plugged in makes the sensor work. Using a different inverter has no effect. Dousing the board with flux remover or acetone and scrubbing with a brush sometimes makes the sensor work again, but very briefly. At one point I was able to make the signal look like this by aggressively scrubbing with a toothbrush: Note that even in this last picture the signal is not returning to LOW level all the way. The effect went away almost as soon as I stopped brushing. So far this points to some soldering defect, except that I really can't see the problem. I have gone over the board carefully with powerful magnification and tested all spots I could think of for continuity - everything checks out. Here is a closeup of the solder job on the IC socket and the sensor: I am now out of ideas, so any advice would be greatly appreciated. Thank you. EDIT: I have just discovered something interesting. A closer examination of example #2 (the saw-tooth shape signal) reveals that the downward slope is a segment of the expected C1 discharge curve. When voltage level gets close to the threshold of the inverter and spends too much time there, the inverter seems to be getting confused! It's generating that little burst of noise and then does something to kick the input back to HIGH, or simply hangs out in that "indeterminate" noisy state indefinitely until sensor output goes HIGH again b/c of motion (Example #1). To test this theory I replaced C1 with a cap that is 10 times smaller, thus making the discharge curve much steeper and "voila!" - the inverter is no longer getting confused and the circuit works! Of course, this defeats the purpose of C1, since it is now not providing as much delay as I want. I am not sure why I did not have this problem with the inverter on the breadboard, but it does suggest that there could be a very easy fix that can address this problem. I read that breadboards have a large "stray" capacitance, so perhaps I just need to strategically add some more capacitors somewhere? Any ideas? EDIT 2: Providing a top view since some commenters asked for it: <Q> Solder one across the power pins of each chip. <S> Also, your 'scrubbing makes it work' <S> comment suggests you have a dry joint or intermittent connection somewhere. <S> Inspect all your soldering carefully. <S> Regarding a DIL chip being overkill, you could have just used a transistor, and put the time delay stuff in software. <A> EDIT - because of my misinterpretation of the circuit I'm editing the answer to focus on the output of the sensor - are you using the analogue output to feed into the inverter - <S> if you are maybe you should try a Schmitt trigger like a 74HC14 <A> Your main concern seems to be reducing power consumption. <S> The AMN42121 consumes about 50uA continuously. <S> The 74HC04 consumes about 20uA continuously. <S> The ATTINY85 consumes about 300uA intermittently, i.e.when woken up. <S> The radio will use milliamps when it transmits. <S> How often will the sensor be triggered ?. <S> Have you done any power calculations to estimate battery life ?. <S> I suggest you discard the invertor and 'slowing down' capacitor, wire the sensor direct to the MCU with a 10K pulldown as per the sensor datasheet, and write the time delay logic in the MCU. <S> [EDIT] <S> Although you have got things a bit wrong, I am glad to see that you are testing your circuit a stage at a time. <S> It's so much easier than trying to faultfind a completed project.
Without studying your circuit in great detail, the obvious thing is you have no decoupling capacitors.
Why does an XLR connector use 3 pins instead of two Why does XLR connectors use 3 pins instead of just 2. The wiring is Pin Function--------------------------------1 Chassis ground(cable shield)2 hot3 cold ( http://en.wikipedia.org/wiki/XLR_connector#Three_pin_-_audio ) Why do they use an extra pin instead of the connector shell to connect the cable shield? <Q> The cable connector body must contact the chassis connector body, which is generally metal, conductive, and bolted to a conductive metal case. <S> Therefore the only choice for the connector body is a connection to the equipment case. <S> This (the equipment case) is obviously grounded - to safety earth. <S> There is no choice about this. <S> However it is common for safety earth connections to form ground loops or be connected to a noisy earth point shared with, e.g. multi-kilowatt triac dimmed lighting systems (i.e. spiky 50Hz waveforms.) <S> So audio equipment design must separate the two functions of an earth connection: safety, and noise reduction. <S> Connect external metalwork to a safety ground, without worrying about the noise on it. <S> Connect signal ground to a separate low noise ground, without worrying about whether it is fault-current rated. <S> And this dictates the need for a separate pin for signal ground connections. <S> When I worked in broadcast audio, "pin 1 is ground" was one of those rules we didn't even have to think about. <S> Consider many pieces of equipment connected to an audio mixer by XLR cable : there may be many signal ground connections - yet we must eliminate ground loops. <S> There are options on some of these boxes to "float" the signal ground - isolate it from safety ground - using the signal cable to provide a signal ground reference from the mixer. <A> Wiki article you linked has an explanation: <S> AES standard [AES14-1992] recommend that shells of cable-mounted connectors should never be connected to pin 1 or the shield, because inadvertent contact of the shell with another grounded surface while in use can create unwanted current paths for fault current, potentially causing hum and other noise. <S> Since the shell should not be used as ground, because touching it will cause ground issues, and added noise, which is unwanted in audio setups. <S> Since AES and EIA standards are behind pay walls, it's hard to provide better justification for it. <S> A better reason is that not all XLR connectors have metal casings in the first place. <S> Plastic cases are just as common. <A> You mean, why aren't XLR female plugs designed more like DC barrel plugs, with a metallic casing that forms one of the contacts, and then just two holes? <S> Electrically, this would work just as well. <S> There is no "deep, electronic" reason. <S> However, note that such a plug still had better be asymmetric, otherwise it could easily be inserted backwards, resulting in a phase reversal. <S> The advantage of a two-conductor plug to use a round casing for one of the contacts is that it can be inserted at any rotation whatsoever. <S> You never have to fidget with an AC adapter's barrel plug's alignment with the jack! <S> Nor with a tip-ring or tip-ring-sleeve connector. <S> As soon as you have two pins that have to line up with holes, this advantage goes away. <S> The plug has to be at a prescribed angle in order to go in. <S> If the plug were surrounded by a metal casing, this would be a waste of metal because only specific spot on that metal casing would touch the mating contact point in the jack. <S> Of course, the plug could use a casing with multiple sections, like tip-ring-sleeve plugs. <S> And, guess what? <S> TRS plugs <S> /jacks are sometimes used for balanced audio! <A> The XLR 3-pin connector is used for balanced audio connections <S> therefore it needs two signal pins and one ground pin. <S> The ground pin <S> I refer to is signal ground and not the metal outer shell of the connector. <S> The metal outer shell will (or can inevitably) be connected to power grounds in the system and these are not recommended for small-signal audio grounds such as from microphones. <A> <A> Very good question. <S> These is no such thing as 'signal ground' in a balanced audio connection, which is what XLR connectors are used for, so it isn't that, and to be effective the shield ground should contact the chassis at the earliest possible opportunity at both ends of the cable. <S> There is a very good discussion in the latest Linear Audio (5) in which it is argued that it is a design mistake. <A> Many XLRs do provide a terminal for termination to the shell as well, which can be used to maintain an additional ground connection, usually 'chassis ground' which is often connected to the mains 'earth' (for non-double insulated devices). <S> More recently the termination is used to maintain the EMC performance of the cable over the last few mm in electrically noisy environments (e.g. see the Neutrik EMC series connectors ). <S> In practice, equipment is most likely to work with no connection to the connector chassis, even though it may be technically superior in some situations to use the connection.
The shells of many connectors are not intended to provide a reliable electrical connection so using a connector pin for ground is required to ensure that the ground connection is carried through the cable. A large quantity of XLR connections are used in situations requiring regular reconfiguration (e.g. live music and other audio applications), so the 'most likely to work' option is also the most popular!
3.7V Lithium ion battery supply and Arduino Uno So many people have asked questions related to mine already, but mine is not quite out there. So my question is I have a 3.7V Lithium Ion battery and I need to power Arduino Uno, which requires a minimum of 7V. I found some voltage doubling circuits, either they are using an external component(like mosfets, etc) or the circuit is for AC. Is there any simple voltage doubling or any another easier way using resistors and capacitors? <Q> As noted by others, there is no simple way to boost a DC voltage, without an IC. <S> First, a short note on how the Arduino works. <S> The Uno can use a Vin barrel jack that goes to a NCP1117 5v regulator, that needs at least 7v <S> In for proper regulation. <S> It can also use the VIN header pin for the same regulator. <S> Or it can be powered via <S> it's USB connector, where the USB 5V is almost directly connected, through a fuse and a switch (so that you don't break your arduino or computer, if usb and the Vin jack is used at the same time). <S> That said, you can simply use a Regulated 5v through the USB jack, instead of needing 7V, which would waste 2V <S> * Current in wasted heat. <S> So you have a 3.7v Lipo battery. <S> You will need a Boost Regulator to bring that up to a regulated 5V. You can get individual ICs, and the passive parts they need (caps, inductor, etc), or you can get ready made parts. <S> You can even get Arduino LIPO shields, or Lipo Charging and regulating boards. <S> These can charge your Lipo from a usb port (and/or solar panels). <S> And frankly, at about 10 dollars, is probably easier than designing and getting pcbs made. <S> Boost regulator modules are cheaper, 4~6 bucks, and since you already have a lipo charger, it might be a better fit. <A> There is something called a charge pump that can boost a voltage, but at 150 mA out that is not applicable here. <S> The capacitors required would need to be quite large and would need to tolerate significant ripple current. <S> While that is all theoretically possible, it is not a practical solution. <S> What you want is called a bosst converter . <S> That is a switching power supply that uses a inductor to make a higher output voltage than the input voltage. <A> "Simple voltage doubling or any another easier way using resistors and capacitors" = <S> NO Resistors take energy and convert it to heat and capacitors on there own (or in conjunction with resistors) cannot convert 3.7V to anything significantly higher. <A> As pointed out by Chris, you just can't use resistors and capacitors. <S> You can use LM2663M configured as a voltage doubler. <S> As you may know, a single fully charged Lithium Ion battery cell will put out 4.2V. <S> If you are going to need a charging circuit, LTC1734 works great.
5V boost Regulators for batteries, with USB out, lockout protection (to prevent the LIPO from being drained so much it dies), and constant regulation are common to find.
How to electronically generate exponential and logarithmic functions i mean, it is possible to generate with Op amps, or diodes, etc, to generate complex exponential and logarithmic functions, like one can create sinusoidal signals using a Wien bridge oscillator. Thank you very much, if it does what devices can help me on that? <Q> The current thru a diode is close to a exponential function of the applied voltage, at least for a part of the operating range. <S> Therefore the reverse is also true, which is that voltage is a logarithmic function of the current thru a diode. <S> Making a rough analog log function therefore is mostly putting a controlled current thru a diode and returning the voltage accross it. <S> Often the log function is used in a feedback loop instead, which has the effect of inverting it. <S> In days long past there were analog multipliers built on this principle. <S> Take the log of the two input signals, add them, then unlog by doing a exponential. <S> With a lot of careful tweaking and calibration and temperature control (or compensation), you can get meaningful results like this. <S> Nowadays the first reaction should be to convert the input signals to digital values as soon as possible, then do all the fancy mathematical manipulations digitally. <A> Well I have seen this circuit for Exponential output and this one for Log output <S> but I have never used it or build it. <S> So I do not know if they actually work. <A> The standard approach for this kind of thing uses precision-matched transistor pairs. <S> National Semiconductor has AN-30 <S> "Log Amps" , a classic app note on log amps. <S> Texas Instruments has a couple of very good app notes on it. <S> I have them, but they're on the work machine <S> and I'm at home right now.
You could use a diode directly to make a exponential by driving it with voltage and measuring the current, but little errors can cause problems that way.
Is it always safe / reasonable to replace a power supply brick with one rated for more amps? I am specifically looking to replace a 12V 3A power supply that seems to have disappeared from a backup HDD. I found a 12V 5A power supply with the right connector on Amazon, and ordered it without hesitation as I've always "understood" that as long as the power supply was rated for at least the peak current the device might draw, it was fine. But now that I've had time to consider it a bit, I'm less sure… Having tinkered a bit with TI's designer tool it seems there is considerable room for optimizing the supply circuitry with the expectation of a particular range of loads. Will a "typical" off-the-shelf, switching power supply brick rated for 5A deal gracefully with all loads from 0-5A ? A little knowledge is a dangerous thing, as they say… Is my "understanding" that the higher-rated supply is safe / reasonable actually correct? <Q> Is it always safe? <S> No. <S> It is usually safe? <S> Yes. <S> There are some characteristics of a power supply that will effect how you use it. <S> Minimum Load: <S> A regulator, even a linear regulator, will have a minimum load. <S> Below this load the power supply will not regulate the output as well. <S> Sometimes the output will be +/-10% instead of <S> +/-2%. <S> Other times the output will be way out of whack. <S> Generally speaking (but there are always exceptions), a power supply rated for a higher max output will also have a higher minimum load. <S> Quiescent Power: <S> This is the power that just the supply is consuming, separate from the load and separate from the supply efficiency. <S> Bigger supplies generally have higher quiescent power, and that means that the supply will generate slightly more heat. <S> Efficiency: <S> Switching supplies generally have the highest efficiency at about 80-90% of the rated max current. <S> If you get a bigger supply and now you are somewhere near 50-60% of the max current <S> then you are likely running at a lower overall efficiency-- which means more heat. <S> If you are putting this supply into a chassis that is designed for less heat, you could have problems. <S> Usually, these issues are not major and you will be safe using a larger supply. <S> But, you must consider these other issues, just in case. <A> It is okay to replace a power supply with one that is rated at higher amperage. <S> However, you do need to consider few things. <S> The connector may look the same, but the polarity could be reversed, do check for that. <S> Also, some power supplies are regulated and they will put out the voltage very close to what is stamped on them; some power supplies are not regulated, they may put out voltage that is much larger than what is stamped on them and may have large noise ripples as well. <S> If you measure the voltage under no load and it is much higher than the stamped value, that indicates the power supply is not regulated. <A> However, there are two things to consider in this particular situation: 1) <S> Hard drives vary in load, as pointed out by @DavidKessner. <S> 2) <S> The guys who did the work on that backup HDD almost surely did NOT design that 3 amp supply. <S> Almost no one designs and manufactures their own wall-wart power supplies. <S> Half or more of the point of using a wall-wart is that you can buy the supply on the open market as a pre-made part that already has all the relevant safety agency ratings, test certificates, etc, etc. <S> It saves the design an enormous amount of time going through various approval processes that have very little to do with the actual thing they are trying to make money on. <S> Given that information, we can then guess that yes, any decent supply with the appropriate connector, the same voltage and a bit higher amps rating should work fine. <S> Be sure to check the polarity before plugging in, but otherwise, you should be good to go.
You might get into trouble if the new supply has a higher minimum load than the old supply. It is correct that you can design a supply to it's intended load.
Switching / dimming a high power mains heater I need to make an adjustable power controller for a 3kW heater that will run off single-phase 240V AC power. How should it be done? Maybe a triac circuit similar to that used for dimming lights. Could this work? (Household heaters don't seem to ever be 'dimmable', is this just a cost saver, or is there another reason?) An alternative idea was switch the heater on and off with a minimum interval of once per second in a PWM fashion, using a zero-cross solid state relay. But I don't think the neighbours would be happy with their lights flickering at 2Hz. Any thoughts or other ideas would be appreciated <Q> It will introduce interference and the thermal capacity of the heater will be so large that you can easily switch on and off for full mains cycles and even every so many seconds (if your neighbors don't mind). <A> Two thoughts: <S> The traditional way is to use a solid-state relay. <S> It won't be particularly cheap, but it will be properly heatsinked and will have a zero-crossing circuit built in. <S> In either case, you will get the same effect as if you were turning it off and on with a switch. <S> There are also some newer devices that can be used to PWM AC at a higher rate. <A> Some calculations of its thermal inertia are worthwhile : start with its mass and heat capacity, and see how long it would take 3kw to heat it by one degree. <S> You might find that PWM at a frequency of 1 cycle per minute or per 10 minutes is appropriate. <S> If it's a tank of water, you may need to override the controller when drawing off hot water. <S> Crude way : If a flow switch runs for a minute, run at full power for 3 minutes or something. <S> Better way : read up about PID controllers) <S> Switching devices? <S> I cannot add anything to the excellent suggestions to avoid phase angle modulation at these power levels, and use zero crossing SSRs.
Once you get that, you can easily do PWM on it. No need for phase angle modulation like on a dimmer for lighting, no need for PWM nor for switching on/off every second. Switching at zero crossings is good practice, and a Solid State Relay can help you with that and is safe when properly connected. Suitable switching rate depends on what you are heating.
Calculate wattage of incandescent bulb I'm trying to find out the wattage of some bulbs supplied to a company I'm working for. The product is a set of garden lights (Cheap Chinese) which is 10x small bulbs in parallel, powered by a 12Vac 5A 60VA transformer. The issue is we seem to be receiving a lot of burned out transformers back, and looking at the bulbs, i think they are more than the rated 5w. I can remember back to my electronics days with V=IR etc, but all i am able to measure is the un-loaded voltage of the transformer (12.6Vac) and the voltage measured across the bulb is 10.1v.I cant measure the AC current, or the ON resistance of the bulb. Is it at all possible to calculate the bulb wattage? <Q> To determine the power you need to measure both the current and voltage. <S> You have already measured the voltage, so what is left is the current. <S> What you need is a ammeter , but you don't necessarily need to specficially get a ammeter. <S> Ammeter capability within the range you need is included in most off the shelf multi-meters. <S> These are cheap and available. <S> Break the circuit somewhere, like right at the secondary of the transformer, and put the ammeter in line. <S> This will tell you how many Amps are flowing. <S> That times the voltage measured accross the secondary of the transformer at the same time (can be measured with a second multi-meter, for example), will tell you the power. <S> Technically, RMS voltage times RMS current only gives you the VA rating, not actual power. <S> However, VA is probably more relevant to determine stress on the transformer. <S> And, the load is mostly resistive, so VA and W should be close to the same anyway. <S> It seems the transformer is dropping significant voltage when the bulbs are on. <S> You say the open circuit (unloaded) transformer output is 12.6 V, and that it is 10.1 V at the bulbs when they are on. <S> What is it at the tranformer when the bulbs are on? <S> That will tell you if you are dropping significant voltage in the wires between the transformer and the lights. <S> Or, you could forget all that and put a 5 A fuse in series with the transformer secondary. <S> Of course if the bulbs draw more current then they are supposed to, then the fuse will pop often, but then you have a problem anyway. <A> What Olin suggested is probably the best way for determining the true load on the transformer. <S> However, doing a quick calculation: Let's assume the bulbs do output <S> P=5W <S> at steady state on. <S> That means: Ion = 10 <S> * 5W / <S> 10.1V = <S> 4.95A <S> This is rather close to the current rating of the transformer to begin with, and keep in mind that incandescent bulbs increase their resistance as they warm up. <S> That means it's possible that peak start-up current could easily exceed the 5A rating, or <S> any slight tolerance variations in the bulbs would exceed the rating (say, bulbs with actual 5.06W output). <S> Additionally, the transformer's actual current rating may not be exactly 5A or better, it could be slightly less than 5A resulting in failure (especially over prolonged use). <A> A less exciting solution is to buy a Kill-A-Watt for $18 :
Yes, you can measure the current.
Ethernet connector and transformers I'm working on an Ethernet connection for a PIC18F4620 with the ENC28J60 . I found a useful article here , with a schematic: I see I need transformers between the RJ45 connector and the Ethernet chip. I've heard people talking about connectors where the transformer already is included. I'm thinking of disassembling the connector from this board: My questions: Would this connector have built-in transformers? Or how can I check this? If the connector does not have built-in transformers, can I use the chip next to it for that? The numbers on it are "bel 0120S1B S558-5999-46" and a search for "S558-5999-46" returns this . Would this "transformer module" be compatible with the ENC28J60? <Q> No, that jack is not a Magjack . <S> It is a bare connector. <S> I say that because the chip next to it is the Bel S558-5999-46. <S> It's specific datasheet is here . <S> It is an Ethernet 10/100Base-T Lan Magnetic Single Port Transformer. <S> You could use that. <S> Or both the chip and the jack. <S> It should be compatible with the ENC28J60, most common 10/100 magnetic transformer would. <S> The S558-5999-46 is a 1:1 Ratio transformer. <S> See the schematic below for tappings and pinout. <A> The isolator component in that case is that thing next to the connector with the bel logo. <S> You will not be able to generally use "any old connector" and magnetic components for you Ethernet connection. <S> There are multiple parameters to consider when selecting the magnetic for your application. <S> (And when you do that selection I would highly recommend that you use a magjack type component). <S> The factors at play here are: 1) Coupling ratio across the magnetic coils between the PHY connections and the CAT5/6 cable. <S> 2) <S> Common mode magnetics for noise filtering. <S> 3) <S> Overall number of coils in the magjack. <S> 4) <S> PHY side common pin biasing - to a voltage rail or to GND. <S> 5) Termination resistor placement and values on the PHY side of the magnetics. <S> 6) Filter capacitor placement and values used on the PHY side. <S> 7) Ethernet connection type / speed. <S> 8) Number of wire pairs used in the RJ45 used to make the actual type of Ethernet connection you are trying to build. <S> Note that it is fairly common that manufacturers of magjacks will provide information on which components in their line will be recommended for various PHYs and popular Ethernet controllers that have the PHY built on board the chip. <A> I followed the link to the BEL part, but that just went to some Mouser page, no datasheet. <S> Most likely, the BEL part is the transformer. <S> I usually use a Pulse H2019. <S> That also includes common mode chokes on the network side, which can be useful in reducing emissions on the ethernet cable. <S> By the way, I don't use the ENC28J60 much anymore, especially if it's going to be driven from a PIC 18. <S> In that case, use the PIC 18F67J60 instead, which essentially has the ENC28J60 built in. <S> All you need is the PIC, the transformer, a few passive parts, and the RJ-45 jack.
The pictured RJ45 is not a magjack. The ENC28J60 requires 1:1 transformers with at least one of the windings center tapped on its side.
What can go wrong when producing an ASIC from an FPGA-verified verilog design? Given a Verilog design fully validated on an FPGA prototyping system, and someone who has never done an ASIC before, what are the chances that a service like CMP will ship fully usable chips on the first try? As far as I can tell, they provide the cell library and the tools, and do a DRC, so in theory it seems like just taking the RTL and compiling the design with their cell libraries should result in a usable chip. What kind of things can go wrong when moving an FPGA-validated design onto a basic process like CMP's 0.35μm CMOS process? If the design works on FPGA but not on the chip, is it debuggable without very specialized services like decapsulation and microprobing? <Q> Lots ... <S> A FPGA verification is just a functional verification or something that you can use to emulate the final chip in system before you get the final Silicon. <S> There are companies that provide FPGA to Si conversions and they do it via different methods. <S> Either they have a structure that maps 1:1 to the FPGA structure (really just a metal and routing change) <S> Or they know how to get timing closure with std cells. <S> The linked to website is for Std cells, so unless you know what you're doing be prepared to get it wrong. <S> The timing closure, the regressions and constraints used in FPGA synthesis is a subset of what you need to get a Std cell out the door. <S> So you may have RTL, which certainly will change. <S> The P&R will be driven by very different constraints than what a FPGA uses. <S> You'll have to be more explicit and detailed in critical paths than you would in a FPGA. <S> The debuggablility is a factor of whether you have scan insertion, JTAG interfaces and built in debug support. <S> If you think you can rely on a probe-station and advanced tools to probe inside the chip you've already lost the game. <S> MOST signals are not available or are only available once the chip is greatly disabled. <S> And some signals aren't even probable as the capacitance of the probe is too large. <S> Full stop. <S> So the RTL now is no longer the same RTL you started out with. <A> It looks like CMP takes GDSII files, so it seems that the entire backend flow of RTL production is up to you to do. <S> To get a functioning chip, you would need to do (this is not a complete list, just off top of my head): <S> If the design works on FPGA but not on the chip, is it debuggable without very specialized services like decapsulation and microprobing? <S> It's debuggable if you design your chip to be debug friendly. <S> If your chip has one input and one output and the output fails, then you will have a very hard time. <S> Typically professional designs would include things like test modes and scan chains (where you can serialize and scan out every register in your design through a jtag interface, as well as input a serial stream to initialize the registers in your design to a specific state). <S> A lot of time investment is required to properly code a chip for good debug though, so you can decide if the time investment is worthwhile to you based on your chip's complexity. <A> See How is ASIC design different from FPGA HDL synthesis? <S> The layout and instantiation process is very different between the two; are you using one of the ASIC "hard copy" services, or resynthesising all of the logic? <S> You will have to do all the timing closure and layout yourself, and resimulate the final gate-level netlist. <S> Assuming that works, you will also need to check your power consumption, including inrush current; you may get something that works but burns out the single bond wire you used for your power pin, or otherwise overheats and fails. <S> If you have any analog parts on your chip (regulators, clock PLLs) you will need to re-validate their use. <S> As the other answer says, you will want some sort of DFT arrangement; at the bare minimum you need enough scan to identify manufacturing defects. <S> Edit: it is very much worth hiring a "backend" firm to do this for you. <S> It will cost you £10-£50k but save you at least that much in failed IC production.
Correctly performing the timing analysis of your circuit looking for setup and hold issues Doing some gate level verification on your design (poor RTL coding style can lead to issues where the simulation diverges from actual gate level operation, need to check for things like x-propagation) You must design in test from the get go.
How do I attach a bridge rectifier to a PCB or breadboard? Newbie question here...I need to know the proper terminology so I know what I'm looking for. I have a bridge rectifier that has four flat blades on the bottom. I want to throw it on a breadboard to test my circuit, and will eventally want to get it onto a pcb. Right now, I've got it connected to jumpers on my breadboard via four alligator clip cables, but there's GOT to be a better way. Searching for "bridge rectifier socket" led me to some proprietary socket datasheets for a very specific rectifier that didn't fit. But not even a Mouser or DigiKey page in the top 50 or so results. What am I looking for so I can get better search results? <Q> That is a fairly high-power device, and is intended to be bolted to a chassis or heatsink for heat dissipation. <S> It is not intended to be mounted on a PC boards. <S> Connections would normally be made using Faston(tm) connectors or by soldering wires directly to the terminals. <S> A rectifier connected to female spade connectors (also called "female spade terminals", also called " Faston connectors ") looks like: (via http://www.autotoys.com/x/home.php?cat=641 :) <S> (via http://www.tinboats.net/forum/viewtopic.php?f=4&t=19243 :) <S> Underneath all the insulation, a female spade connector looks like: (via http://www.frozencpu.com/products/13613/ele-882/FrozenCPU_Quick_Disconnect_Female_Spade_Connector_-_28mm.html :) <A> This bridge has large blades for a reason: there will be a lot current through the part. <S> It therefore should be strongly discouraged to use this part on a breadboard. <S> There is a way though: you can use header pins. <S> Search for things like "male header" and you should find something like this: <S> Cut or break it into four pieces and solder each pin on each blade of the bridge <S> and you can use it on your breadboard. <A> The type of rectifier shown in your picture is intended for bolting directly to a heat sink via the hole in the center. <S> It is for large currents. <S> Or else you can use four diodes like 1N4001's. <S> Bridge rectifiers are not usually socketed, so that may be why "bridge rectifier socket" doesn't turn up much. <S> Including yours. <S> The rectifier you have has connector terminals exactly for the reason that it ends up being bolted to a chassis, away from both the transformer and the circuit board that it supplies. <S> In these situations it has to be disconnected so the circuit board can be removed without removing the rectifier from the case. <A> For breadboard you might want a small (1 or 2A) bridge. <S> types like W08, for example. <S> Like others have said, this large on is for chassis mounting and point-to-point wiring (either solder to blades, or 0.25" quick connects).
For smaller currents, there are bridge rectifiers that have lead terminals for through-hole soldering.
How can I spin an old HDD motor? I've stripped out an old IDE (40 Pin) HDD from 1998 for use in a POV display project (Gr. 12 Computer Engineering), and I've been trying to spin it up. The problem is that the HDD motor is brushless DC, so it requires more than just a ground and source connection. Our electronics has a max output current of about 200mA (555, transistors, other ICs), so I can't work with those. Connecting the HDD with the PCB to the PSU will only turn the motor on for about 15s before it shuts off. The HDD is completely stripped with only the motor and the PCB screwed into the base. The motor has 4 pins. From the time I spent playing with it, there's 1 pin for ground, and 3 other pins that I think is for the 3 pairs of coils. HDD information: Fujitsu MPB3043AT 12V DC 0.32A 5V DC 0.5A Materials: Arduino Uno Old HDD PSU Breadboard 9V battery 1.5V batteries 74HC164 8 bit sihft registers 555 Timer IC 3904/3906 Transistors Capacitors, resistors, potentiometers What options do I have to get the motor to spin (Preferably without the PSU, but I'm open to options with the PSU)? Is there a pin on the IDE that will allow me to turn it on/off? UPDATE 1: I fiddled around with the IDE cable. When I connect pin 27 (IO Ready) to pin 2 (Ground), the motor started spinning as if I just plugged it into the PSU, but only for about 10s. And I had to wait a few minutes before I can get it to spin again using this method UPDATE 2: Turns out the motor is only 5V and not 12V, that should ease things up a bit <Q> I am not sure if I got your question correctly but I am assuming you are asking how to make the HDD motor spin continuously (also assuming you don't have a circuit in place to spin the motor yet). <S> AFAIK HDD motors are stepper motors with 3 coils to supply input source at different phases of rotation of the motor. <S> You will need to provide it with a 3 phase supply voltage to work optimally. <S> I found a helpful schematic on the internet here . <A> Most of the HDD motors are BLDC (brushless) motors. <S> They can be driven by brushless ESC. <S> Something like this would be fine. <S> (turnigy plush 25A). <S> 25A means that it can be used to run motors up to that current without damaging ESC. <S> You could find lower current ESC as well (but this one is cheap enough). <S> ESC consist of three wires <S> , there are no 4 wires ESC. <S> You need to measure resistance between pairs of wires and connect only wires with higher resistance. <S> One with lower resistance leave unconnected. <A> Hope that I am not too late. <S> I wrote an article here . <S> Basically I was using Arduino to send discrete signals to all 3 phases, but those three phases combine to give a continuous attractive force and make the rotor rotates. <S> These signals allow the Darlington Transistors to pass a larger current to drive the motor. <A> I simply used a $3 freq generator (aliexpress.com) and a N-FET, connected one phase to 12V, the other to drain, and source to ground. <S> Very simple. <S> There is two issues, no self starting (I set to 60Hz and give it a light spin), and there is a acceleration limit, you cant go to quick or it loses sync. <S> Quick testing showed 1000Hz freq was no problem (about 6W input at 12V). <S> UPDATE: <S> I got the hard disk drive motor to spin 25,000 rpm using this simple fet and freq generator. <S> https://www.youtube.com/watch?v=SRk651ThM0k
Cheapest would be to buy hobby RC ESC and drive it by PWM. You could make your own driver circuit based off the schematics shown there.
What do you mean by a Wattage of an incandescent bulb? How do I interpret the wattage of a bulb. For example when it is said that the bulb is rated for 60 W , what does that mean? <Q> Watt (\$W\$) is the unit of Power (\$P\$). <S> There is an equation that says: $$E = <S> P <S> \cdot <S> t$$ <S> You can see that Energy (\$E\$) equals Power (\$P\$) <S> times time (\$t\$). <S> There is a linear relationship between Energy and Power, so the higher the Power (wattage) of a device, the more energy it consumes. <S> The same formula, in a different form: $$E= <S> P <S> \cdot <S> t \rightarrow P=\frac{E}{t} <S> \rightarrow <S> W=\frac{J}{s}$$ <S> One Watt means one Joule (\$J\$) per second (\$s\$) is being consumed. <A> Typical bulbs specify a wattage and a voltage. <S> The figures together mean that when the indicated voltage is applied in free air in a room-temperature environment, the bulb's temperature and resistance will find an equilibrium state where the bulb consumes the indicated amount of electrical power (giving it off as some combination of conducted heat and radiated energy). <S> If a different voltage is applied to a bulb, the filament will reach a different equilibrium temperature and may, as a consequence, have a different resistance. <S> If the resistance were constant, power would be proportional to the square of voltage, so a 10% reduction in voltage would represent about a 19% reduction in power. <S> In practice, reducing voltage by 10% will reduce power by significantly less than 19%, but the reduction in visible light will be significantly greater than 19%. <S> Although operating a bulb at at a lower voltage will greatly reduce efficiency, it will greatly improve longevity. <S> There's a light bulb in San Francisco which doesn't burn very bright, but has been going almost continuously for over 100 years. <A> if you have 60W bulb, and your mains supply 220V <S> then that means the bulb is drawing 60/220 = 0.273A of current. <S> So there must also be a voltage rating along with the wattage to be meaning full. <S> Also, more is the wattage, more energy it consumes. <A> power is the rate at which energy is being used, the unit for energy is joules, as we use the term megabyte/second to denote the transfer rate at which data is being sent or received, similarly power=amount of energy used/second, in a similar way by 1W <S> we mean in each single second, 1 joules of energy is being used (transformed into another energy or transferring whatever). <S> now a bulb of power rating <S> 60W, 220v means that when the bulb is connected to a 220V mains, it will consume 60 joules of energy in each second, some of this 60 joule is converted into light and some of the 60 joules of energy is converted into heat. <S> however, if you want to put it in another way, for an electronic/electrical equipment, WATTS=VOLTS x AMPERES. <A> If the power rating of bulb is given 60WNd we know household electricity is at 220VMeans <S> this bulb is having resistance R = <S> 220 <S> ^ <S> 2/60 = <S> 806.667 <S> ohmNd <S> it's drawing a current of I = <S> 60/220 <S> = <S> 0.2727 <S> A
60W means 60J/s is being consumed by the bulb.
How input current affects circuit? Is it ignored? All the examples I have seen so far, take the input voltage as-is and start calculating circuit current depending on on-board resistors using ohm's law etc. Can you just ignore the original current rate? If it is doubled (say by using less resistant wiring) then it is double the electrons moving, it must have some effect, right? Am i missing something? Edit (1): I am learning the basics, and everyone just seem to ignore the input current rating. <Q> There are voltage and current sources. <S> In the case of an ideal voltage source, the source maintains a constant voltage, and the load draws whatever current it needs. <S> \$I=\dfrac{V}{R}\$ <S> In the case of an ideal current source, the source maintains a constant current, and the load voltage is induced by that current. <S> \$V <S> = <S> IR\$ <S> Your example falls in the voltage source category. <S> They solve for it because it is determined by the load. <A> The voltage source, which you drew, is an ideal voltage source . <S> It's a mathematical abstraction <S> **. <S> You can imagine a caricaturesque character with a scroll and a trumpet proclaiming "The King said ten volts!" <S> Ideal voltage source will provide as much or as little current as necessary to maintain the voltage. <S> In the circuit in the O.P. (10V, 100Ω), the current will be I= <S> V <S> / <S> R=0.1A. <S> ** <S> Especially if we take into account that the O.P. says that he's working through abstract examples. <S> The conductors, which you drew, are ideal conductors . <S> They have no resistance. <S> They can be 10mm long or 10km long. <S> It doesn't matter, because they are ideal. <S> If you want to see what conductor resistance will do to your circuit, replace the conductors with resistors, which have some value. <S> These are the things (abstractions), which the O.P. seems to be missing. <S> update: <S> @elec_newbie <S> Well, it seems that you want current rating and can't do without it. <S> Here's a modified example for you. <S> Assume the original circuit (10V, 100Ω). <S> Assume also that the resistor is rated for 0.25W. <S> What should the input current rating be? <A> All those examples you're talking about takes an input voltage and don't show input current for the sake of simplicity, but of course, input current is as important as voltage can be. <S> Ohm's law speaks by itself. <S> I cannot imagine a simpler answer to give you:) <A> The examples you're looking at are assuming that the input is an ideal voltage source, which has zero internal impedance. <S> Real world voltage sources have internal impedance (made of some combination of RLC) elements. <S> The current that flows between a source and load depends on the source and load impedance and the nature of the signal (DC? <S> AC? <S> What frequency?) <S> Ideal voltage sources are a useful tool because they let you think about the inherent response of a circuit in the absence of extraneous elements. <S> An ideal source acting on a circuit is similar to a force acting on a body in a free body diagram in physics. <S> In the new diagram which was added to the question, there is a 10V voltage source, and a 100 ohm resistor. <S> These two numbers determine how much current flows through the circuit: <S> 10V / 100 \$\Omega\$ = 0.1A. <S> Each node (junction point) in the circuit has 0.1A flowing in, and 0.1A flowing out. <S> There is no such thing as a voltage source which has prescribed current also. <S> Ideal voltage sources can supply unlimited quantities of current into any nonzero load while maintaining their voltage. <S> Real-world voltage supplies cannot deliver unlimited current without either frying themselves, or losing their voltage regulation (allowing the voltage to drop). <S> So real-world voltage supplies are accompanied by a current value which states their maximum limit.
No one is ignoring the input current.
Odd number of bits in ADC Why is it that most ADC have even number of bit resolution like 8, 10, 12, 14 bits etc. Odd numbers are not available. <Q> Well, actually, odd numbers ARE available. <S> You just have to look ;) <S> Here's an example: <S> ADC1112D125 : http://www.nxp.com/documents/data_sheet/ADC1112D125.pdf <A> In radio astronomy, the signals from pairs of antennas are multiplied then put through a very fast low-res ADC. <S> These are rarely as much as 8 bits. <S> Some are 3-bit, some are 2-bit, and, amazing but true, real science can be done with 1-bit ADCs. <S> Of course, a 1-bit ADC is really no more than a simple threshold detector. <S> Have a look at https://science.nrao.edu/facilities/vla/docs/manuals/oss2013a/performance/samplers or https://science.nrao.edu/facilities/vla/docs/manuals/oss2013b/performance/correlator/referencemanual-all-pages <A> Of the 5,161 ADC's that are currently in stock at Digi-Key, 64 (about 1%) have an odd number of bits of resolution: 9, 11, 13, 15, 19 and 31 bits. <S> So they are a rare breed. <S> How that relates to them having a odd number of bits of resolution <S> I don't know.
What sets the odd-numbered ADC's apart from the others is that all 64 appear to have differential inputs.
Can I simulate the temperature response of one thermistor by a different thermistor This sounds like an automotive question, but its really not. I have a engine temperature sensor (presumably a thermistor, as it reduces resistance with increasing temperature). I need to mate this to a temperature gauge, but the gauge is calibrated for a different sensor with a different temp. response curve. temp/ohm curves are known for both sensors (see graph) For various reasons I can't replace the engine sensor. Also the gauge is a sealed unit, so lets assume I can't modify the gauge internals. Is there anyway I can insert a circuit between the sensor and gauge, so the gauge 'thinks' its connected to the 'correct' sensor? Preferably a circuit of passive components as I don't have too much electronics experience. Initially I assumed I might be able to do this by putting a suitable resistor in parallel with the sensor, but any resistor like that will only 'flatten' the response curve and as you see, response curve needs to be 'stretched'. A couple of other factors to consider. I don't need super accuracy; +/- 3 deg C is fine I only this to work well in the range 85-105 deg C Is this possible in principle and what is the general approach? EDIT: More info The red curve is given by: resistance(ohms)=114+6014*e^(T*-0.0396), where T=temp in deg C Measured resistances from the existing engine sensor (blue line) is below. I would hope there is enough data there to predict the remaining values up to 105degC(do themistors follow a standard curve?) <Q> Use a microcontroller to measure the thermistor, then program a lookup table and make it control an electronic potmeter. <S> Intermediate values can be calculated by interpolation. <A> If the existing engine sensor were the red graph then I'd say this can't be done with a few simple components. <S> But because it's the other way round and you only want accuracy in a portion of the temperature range then this is achievable. <S> BUT, NO it's impossible to do this accurately with the data you have provided. <S> A more in-depth look at the resistances of both sensors from 75ºC to 120ºC is required. <S> Can you provide this information? <S> EDIT - AdditionYou now have data for the engine sensor albeit a little limited. <S> You obviously have spreadsheet capabilites and this means you are nearly there. <S> Given the resistance formula you have for the red-curve try creating another table of numbers that puts this resistance in parallel with another fixed value resistance, Rf. <S> You do this by Rf. <S> Rt/ <S> (Rf + Rt) where Rf is the fixed value and Rt is the thermistor value. <S> See what experimenting with different values for Rf does to the new numbers - how far off the engine values do you get? <A> If i understand your question correctly you want to go from a lower resistanse to a higher resistance. <S> That may be doable wth a series + parallel resistor. <S> I bet your thermistor follows an exponential curve (try plotting the log and see if you get a straight line). <S> That shouuld make it easy to extrapolate the missing values. <S> I didn't solve the problem for you, as you sound like you want to conquer this using your own skills <S> -rigth? <A> First your formula for the red curve makes no sense. <S> However,using the curves it appears that you could get a good approximation of the red curve by using four of the thermistors corresponding to the blue curve in series. <S> Using four multiplies the slope of the blue curve by four and makes it closer to the red curve. <A> You can use” ( rVal <S> >Val).rVal would be the input (potVal) <S> > <S> Value you want to attain. <S> One example would be an analog read of resistance say 1000 ohms , so you would read whatever value you are getting from your component and stating that if you read over the given value say 1000 ohms then send an output to a device.
Use an Arduino, you can program it to read a resistance and output a signal to a device of your choosing. However, your graphs do not give enough technical detail about the resistance of either gauges in the 85ºC to 105ºC range to calculate a circuit so to answer your question, YES there is a way to do what you want
Install DC power cable connector on vacuum feedthrough rod I would like to know how to install an electrical plug or connector on an electrical vacuum feedthrough. An image of the feedthrough can be seen here: https://us.trinos.com/vacuum_s/trinos-electrical-feedthrough-weld-adapter-from-ht.html You can click on the small image to see are larger picture of the feedthrough. I know how to make electrical connections on the vacuum side, I just need to connect a DC power cable on the atmospheric side. I would be grateful for any advice on the subject. <Q> Depending on the model, the conductor rod thickness corresponds to common thread diameters (e.g. 1/4, 3/8, 3/4). <S> They also can be easily had from an industrial supplier like Grainger, MSC or McMaster Carr. <S> If you thread the rod, a simple set screw lug can be bought from a hardware store which is used for connecting thick electric wires to terminals. <S> Just use two nuts, washers and a lock washer to secure it to the threaded rod. <S> For the smaller diameter conductor rods, solder a lead and put a plug on the end. <S> Don't solder the thicker rods. <A> Wire and the copper rod go into the hole, the screw clamps them together. <S> Such terminal doesn't require heating. <S> It can be taken apart. <S> Soldering wire to the copper rod should work too. <S> You know how to connect to the feedthrough on the vacuum side. <S> How are you going to connect on the vaccum side? <S> What prevents you from using the same method on the atmospheric side? <A> If you want an easily-removable connection, you could use female contacts from some handy connector family, if you can find some the right size. <S> Add some heat-shrink tubing to insulate the connection. <A> See page 14 in this catalog , which covers just about every possible connection method.
I would make a screw clamp consisting of a small block with a hole, which can accommodate the copper rod and a wire, and a screw, which is radial to the hole. You could thread the ends with a die which can be bought at an autoparts store or hardware store. I don't see what would rule out soldering.
Why should any unit be used instead of the watt (W) as a power unit? I am taking a course on AC circuits and so far I have seen that for the different types of power (read real, reactive and complex) different units are used. For the real power, which is power in fact dissipated by the system, the SI compliant watt is used. I am very much in agreement with this. However, for reactive and complex power the equivalent SI derived unit volt-ampere is used. In the special case of reactive power, a lowercase "r" is appended. Now, I wonder: why should any other unit be used instead of watt, if the purpose of the unit is to specify the type of magnitude of a value? Moreover, why should a symbol be appended to the unit when its use is simply that of a reminder? Also, is there a reason why using watts for reactive power would be considered wrong? <Q> Simply because a watt is a measure of work done. <S> The real part of V*A is watts. <S> There are exact equivalents in mechanical systems. <S> \$W=\dfrac{J}{s}=\dfrac{N*m}{s}\$ <S> so \${N*m}\$ here is Force that does work through a distance <S> but it can also be a measure of Torque over a distance and <S> that is static(non moving). <S> One is the potential to do work, one is the work itself. <S> Using VAr - r for reactive is just short hand for the purely imaginary part, instead of using i or j (for you physicists out there). <A> These are three different powers therefore they have different units: <S> P [W] - real power Q [var] - reactive power S <S> [VA] - complex power <S> Complex power S is a sum of real and reactive powers: $$S = P + jQ$$ where j is a an imaginary unit. <S> This can be shown on a complex plane like this: <A> A power transformer is rated in VA. <S> It is not rated in watts because that would be wrong. <S> The transformer can supply a certain rated voltage at a certain rated current and if the load on the transformer is purely reactive then no-watts (net) are transferred <S> BUT the transformer is at its limit. <S> To say a 50VA transformer is rated at 50W is nonsence - the load may not "lose", "transfer" or "dissipate" any watts <S> but it sure will be pushing the 50VA transformer to its maximum ratings. <A> Here's an example: I have a device that apparent power of 10 VA with \$cos \phi=0.7\$. <S> It uses \$P <S> = <S> S*cos \phi=0.7 <S> *10 \mbox <S> { } W=7 \mbox <S> { }W\$. <S> On the other hand it also uses \$Q= <S> S*sin \phi=0.714*10=7.14 <S> \mbox <S> { }W\$. <S> We could then add those two together since hey, <S> it's both consuming 7 W and 7.14 W at the same time and get 14.14 W, which is obviously incorrect, since device will never use more than 10 W, even if its power factor somehow got corrected back to 1. <S> Basically var is used to signify that the reactive power is not in phase with active power and that you can't add them together. <S> On paper, power is power but by using var (sometimes incorrectly referred to as VAr, so r isn't just appended <S> , it's part of a different unit whose name is often misspelled), volt-ampere and watt, we (at least hope to) clearly signify the context in which such unit is used. <S> So var not only signifies magnitude, it signifies phase as well. <S> This is actually nothing new and is common in other fields as well. <S> For example we have radian and steradian as measurement units for angles which are actually 1. <S> Same thing goes for bit as well. <S> So while we could technically say that speed of a communication link is 1 MHz, it implies different context than 1 Mb/s. <A> If a wall transformer is driving a reactive load, then during part of each AC cycle it will be transferring energy from the mains to the load, but during another part of each AC cycle it will be transferring energy from the load back to the mains . <S> If during each 1/60sec cycle a load takes one joule and returns 0.25 joules, then the power taken by that load will be 60 watts and the power returned will be 15 watts, so the total power consumed will be 45 watts--the 60 to the load <S> minus <S> the 60 to the mains. <S> On the other hand, the total power conveyed by the transformer would be 75VA--60 watts to the load plus the 15 watts to the mains. <A> It is just a convention. <S> It explicitly differentiates the different types of power when speaking or writing (which have different meanings mathematically, even though they have the same fundamental units). <S> If the different types of power are given "different-looking/sounding" units (even though VA = W), than it is very clear to a person familiar with the field what you are talking about, even if you don't tell them.
Using watts for reactive power would be wrong because reactive power is stored power and not capable of doing work.
USB Fuse to protect USB ports? I shorted by accident a circuit creating large voltage to my computer, luckily MBA has some sort of shorting protections -- yet this kind of thing should not happen. I would like to have a fuse between my microprocessor and my computer. What are this kind of protection mechanisms called? USB fuse did not return anything in eBay so I am thinking I am trying to find things with wrong word. <Q> Note: this answer concerns marginal but far from comprehensively effective half-measures for protecting devices . <S> It does not address PERSONAL SAFETY in the slightest, because such was not part of the question at the time this was posted . <S> But that is only one type of electrical risk <S> - it does nothing to protected the data lines for example. <S> I believe there are full USB "isolators" (likely with optical coupling inside) <S> but these are expensive for everyday use, so likely to be found only in industrial or test setups (for example, a programming pod used while developing motor controls). <S> Using a cheap sacrificial USB hub outboard of the computer may provide some degree of protection, though far from absolute as there is an electrical connection through the circuitry of the hub. <A> You're looking for a resettable fuse, PTC, or thermistor. <S> They're basically a resistor with low resistance in normal conditions, but as they heat up, the resistance goes up significantly. <S> This causes a massive voltage drop, stopping the short circuit (until it cools down again). <S> Since it has some resistance, some electricity is burned off, heating the PTC a little bit. <S> As you increase the current, it will heat up more until it trips. <A> Newer USB ports have a protection system most of the time. <S> I once burnt down a processor after shorting a USB port, but that was a very old computer. <S> However, it is a good idea to be sure you don't draw too much current. <S> An extensive article has been written on this. <S> It addresses a lot considerations when it comes to protecting the USB port. <S> You can always buy a special chip for this, like the LM3525 , which is a power switch and over-current protection in one. <S> They also have the LM3526 , which is a dual-LM3525.
USB ports often (but not always) have thermally activated self-resetting fuses to protect against excessive current draw.
Why do 0.02A fuses not protect a person? Why no protection from shocks? I understand the user here so that fuses do not protect people from shocks. I am planning to put put fuses such as fast-blown fuses and PPTC fuses around all kind of positions such as computerUSB-microprocessor-link and wet-electrode-circuit link. I feel it is far better to blow up fuses than to blow up computer or get shocks. Now the user does not recommend any substitute to protect from shocks so how to protect from shocks? Not with fuses? What then? I operate with EM the level of coming from MBA. Further reading EOS versus ESD -thread by TI <Q> You question is really asking about a bunch of different failure scenarios and without more detail (really, more specification) <S> it is difficult to answer in any detail: Too much voltage (temporarily) <S> You need a "transient voltage suppressor". <S> They come in many forms and scales from large consumer products to build-your-own with two diodes. <S> Too much voltage (constantly) <S> You need to reduce the voltage. <S> There are basically two categories of solutions "regulation" and "drop/unregulated". <S> Regulators are available in everything from commercial switch-mode power supplies to individual IC's. <S> Unregulated voltage drop can be achieved with just a properly biased diode, a resistor, a step-down transformer, and many other approaches Too much current (temporarily) <S> Current is a bit trickier since it is controlled by the load (and anything shorting it). <S> Fuses and other energy threshold based devices will be too slow to react in the general case. <S> You will probably need to "slow" the current transient down (reduce edge-rate), by applying inductance in series, to buy time for whatever protective devices you employ to activate. <S> Current transience is best handled by active devices (sense-and-respond) -- just my opinion -- since you usually have a rather complex set of criteria to distinguish between the "good" and "bad" cases. <S> Too much current (constantly) HELLO FUSES!!! <S> =) <A> Hospital gear in the US is often tested to the NFPA 99 standard for health care facilities . <S> This standard involves certain no-brainers like is the device double insulated, is the power cord good, etc., but it also tests devices under a variety of failure modes, often by pulling the ground pin, and looking at a variety of leakage currents. <S> As the level of exposure goes up, the amount of leakage current with a ground pin goes down. <S> For example, in ICU's where a patient my have a variety of catheters filled with conductive solutions going right into the heart, the limit for leakage current for devices with patient leads is tens of MICROamps! <S> Many situations are forced to test to different standards. <S> IEC standards are fairly common. <S> See IEC 60335 and some of the others on http://en.wikipedia.org/wiki/List_of_IEC_standards . <S> If your plan allow your device to test to such standards, you're good to go. <S> Unfortunately, getting many of these standards is a fairly expensive proposition, and often one standard points to many more, so the expense can snowball without a subscription service. <A> Overheating a component sufficiently to start a fire requires that either a moderate amount of excess power be delivered it for a comparatively long time (multiple seconds), a really huge amount of power be delivered (in which case the time may be shortened by a factor of a thousand). <S> If someone were to touch a circuit guarded by a 10mA fuse in such fashion as to allow 100mA to flow across the chest, the time required for that current to disrupt heart function might be less than the time required to blow the fuse. <S> A common arrangement is what's called (in the US, anyway) a Ground Fault Circuit Interrupter. <S> I think some other countries use the term Residual Current Detector. <S> Such a device measures the difference between the rate at which electrons flow to a piece of equipment via the supply wire and the rate at which they flow back via the return wire. <S> A sufficient mismatch will cause current to be disconnected immediately. <S> Unlike a fuse, which will only blow immediately under a severe fault condition (blowing slowly under lesser conditions), a GFCI will trip immediately under just about any fault condition which will cause it to trip at all. <A> Not really a "complete answer" but helpful: <S> Two important terms to look up: galvanic isolation - which is preventing current to flow by eliminating metal paths between places. <S> optical isolation <S> - Using an *optoisolator *which is using essentially an LED and a light detector, separated from each other. <S> Both of these things/methods make it so voltage/current transients - even from things such as arcs, short-circuits or even lightning strikes cannot cross a given point. <S> Such things/techniques are used to isolate both circuits from teach other - or people from circuits which could hurt them should something go wrong.
Avoidance of electrical shock requires that there isn't any path by which any significant current could be pushed through a person, outside of fault conditions, and that any fault condition--even a minor one--must cause power to be disconnected quickly. Fuses are generally intended to protect against fires, and so they will blow quickly when current massively exceeds specifications (e.g. by a factor of fifty), but will blow slowly when the excess is smaller (e.g. a factor of only two).
Identifying pin numbers from PCB I have a PCB with documentation. In the documentation, there is referred to specific pins of several jumpers and connectors. On the PCB however, there isn't a label or so for which pin has what number. I need to figure out which pin has which number, so that I know the function of each physical pin. I noticed all connectors have all pins with a rounded tin pad, whilst one pin (either the first or the last when counting from right to left) has a square tin pad: Is it some kind of convention which number this pin has? After that, how to count the other pins? <Q> Normally the square pad is pin 1. <S> The left picture looks like a DE9 connector - on that connector family, the pins are numbered along the row from pin 1, then the second row is numbered in the same direction, like: 5 <S> 4 <S> 3 <S> 2 <S> 1 <S> 9 <S> 8 <S> 7 <S> 6 <S> For the rectangular array in your second picture, pins may be numbered either row by row, or column by column, depending on the designer's whim. <S> You may find pin numbers on the connector itself, or on the mating connector. <A> <A> Generally, the 'different' pin is pin 1. <S> On the first picture, that would be the square pad, top right, second pic square pad top left. <S> I would think it then numbers across the top, and then loops down to the row below it. <S> On the first pad it would be right to left, second left to right, assuming the pictures are oriented correctly. <S> The first picture looks very similar to a serial DB9 connecter, and this supports my theory on numbering. <S> Look at it as if you were plugging in the male connecter to the board, and the numbers match.. <S> The second picture I have nothing to base my assumption off of but experience. <S> Attack it with your multimeter and see where you have continuity before soldering anything.... <S> I would have expected a diagram that came with the board. <S> From there I would try to contact for the company that provided you the board. <A> From my experience as layout designer, pad with different shape is pin 1. <S> You have to read datasheet or refer to standards. <S> In general take attention in cable tipology. <S> For example, in ribbon flat cable connectors, as micromatch, mic, DB, because the numbering does not occur in ascending order along the line, but according to an order staggered row / column. <S> In fact, assuming an increasing numbering of the ribbon cable, the wires on the connector are arranged in a staggered manner on terminals. <A> From my experience (although limited), the square pad is pin 1. <S> It will then proceed sequentially on the same line. <S> The black pcb, it looks like the numbers increase down, and then goes to the next column. <A> I've always seen pin 1 being the square pin and this applies to several jobs I've been in. <S> I'm not saying it isn't a rule that is universally adopted <S> but I'd be a little surprised if it isn't pin 1. <S> I think pin 2 will be on the row below this square pin - this is based on the type of connector that I believe it to be. <S> Odd numbers on this occasion, will be on the top row methinks. <S> The black PCB connector may be columned into A, B and C <S> but I've seen triple row connectors with the top three being numbered 1, 2 and 3 left to right
Generally, pin 1 is given a unique shape (often square). Beyond that, numbering tends to be non-standard - you'll need to check the manufacturer's datasheet for the specific connector in question.
If-else decision structure using op amps or any other non-programmable electronic device The title is pretty clear, I would like to know if there is any circuit or an IC capable of dealing with signals to perform algorithmic sort of decisions, I mean, as you can solve differential equations using op-amps, I can design a circuit which output is the GCD of two input signals, finding them with Euclid's algorithm. <Q> Analog computers <S> Analog computers can do much of what you want to do. <S> Essentially, they consist of analog block functions that you can assemble as needed like building blocks, and twiddle knobs to tweak parameters. <S> Some had comparators, which you would use to drive yes/no decisions based on the resulting analog signals. <S> I've seen these beasts, which are things of the past, used to estimate parameters in differential equations. <S> Some had essentially swappable breadboards, which let you change simulations easily. <S> I don't believe you can still buy analog computers, but if you know what your morphology will be, you can certainly build the equivalent with op-amps and passives. <S> This may be within your reach if your equations are simple enough (though I don't know the algorithm you would use to take on the problem you describe). <S> http://www.analogmuseum.org/english/impressions/eai_tr48.jpg <S> Neuromorphic circuits/Neural Networks <S> Another strategy is to use MANY stereotypical nonlinear analog building blocks, connect them in strange ways, and let complicated algorithms tweak the weights of connections between the hundreds to thousands of elements. <S> This is called neural computing. <S> The theories are analog, but most are digitally implemented. <S> Just last week, I saw video of a neuromorphic CCD that was exquisite at sensing image motion. <S> There are academic journals, like Neural Computation, dedicated to these pursuits. <S> This approach is likely beyond what you want to implement. <S> http://lowercolumbia.edu/facultyResource-crhode/NNimages/NasaNeuralNetwork.jpg <A> What you want is clear enough in general terms BUT not specific enough to give you a useful answer. <S> ie the answer is "Yes." <S> If you gave a specific real world case of what you wanted to do (as opposed to focusing on how) it would probably help. <S> (How is also good BUT knowing more about 'what' first is best). <S> What you describe MAY be quite easy <S> but it's not 100% certain from your description. <S> If you can use as many as ICs as needed you can build what you want from standard parts. <S> If you want a single IC it gets harder. <S> You can get 'PSOC' system on a chip (the SOC in the name) ICs that incorporate a microcontroller plus analog circuitry that allows hybrid systems. <S> They would probably do what you want in one IC. <S> Digikey offerings here and here <S> For $2.19 in 1's you get this Cypress CY8C22113 and CY8C22213 Containing (as well as much else) <S> 3 <S> Rail-to-Rail Analog PSoC Blocks Provide: - <S> Up to 14-Bit ADCs - Up to 9-Bit DACs - Programmable Gain Amplifiers - Programmable Filters and Comparators 4 Digital PSoC Blocks Provide: - <S> 8- to 32-Bit Timers, Counters, and PWMs - CRC and PRS Modules - Full-Duplex UART - SPI Masters or Slaves - Connectable to all GPIO <S> Pins <A> If only discrete values of the input signals are allowed, as you mention in comments, then you are talking about a digital circuit. <S> There are zillions of digital ICs available that you could use to build essentially any digital circuit you like. <S> Just look in the "logic" section of the websites of TI, NXP, On Semi, or Fairchild (and probably a couple of others I've forgotten). <S> AND, OR, NAND, NOR and NOT gates are all available as individual chips, and with these you can in principle construct any digital circuit you wish. <S> At a higher level of abstraction, flip-flops, latches, memories, shift registers, counters, and other combinations of the basic gates are also available as chips. <S> Op-amps aren't really appropriate for doing calculations on discrete-leveled inputs (although you could probably figure out a way to do it if you were stuck on a desert island with only a bag of 741's and some resistors). <S> Op-amps are frequently used, in a comparator configuration, to produce a discrete-valued output based on the level of a continuously-variable input.
There are some custom made integrated circuits (some used to be commercially available, some may still be) that actually do analog implementations.
Creating a Sequenced Array of 3 Mosfets with Adjustable Timings I am comfortable with rudimentary 555 circuits and other basics, but I have something a little bit beyond me now. I need to have three separate mosfets A, B, and C all turn on and off in sequence. I want to be able to control the timing of on state separately if possible, but it's not absolutely necessary. I would be fine with all of them having the same ON time so long as I can control the period of the entire cycle so that I can speed up or slow down the frequency. I'd like to be able to do this in the 10Khz to 1Mhz range. I've been told there are basic integrated chips that will let me do exactly this sort of thing, but I haven't the foggiest what part number or catalog page to look up. <Q> As Anindo says, a small microcontroller (such as a PIC10F, 12F, 16F) is the perfect solution for this kind of task, so if you are up to trying this examples can be given. <S> If you want to progress with modern electronics microcontrollers are pretty much a necessity. <S> To do it without one, there are a few ways you could approach this - for example you could set up a logic gate based circuit with a clock/counters/comparators, or you could use a 555/556 based approach. <S> If you know 555s, then you could set up 3 555s in one-shot mode, then use NAND gates to trigger each one in turn. <S> I think this should work okay. <S> For example, when B and C are low, A is triggered, when C and A are low, B is triggered, and when A and B are low, C is triggered. <S> To adjust timing on each, use a potentiometer for the R part of the RC timing components on each 555. <S> If you need a diagram, let me know <S> and I'll try and throw one together. <A> Another non-microcontroller option is a 4017 decade counter. <S> This chip has 10 output pins. <S> Each pin goes high, in turn, as you pulse the clock. <S> In order to make it only pulse 3 outputs, just connect the 4th output pin to the Reset pin. <S> As soon as 4 goes high, the counter will reset back to 1. <S> An astable 555 is a nice adjustable clock source for lower frequencies. <S> I'm not sure how well they work up in the MHz <S> range you mention. <A> There are quite a lot of hobbyist circuits to do this without microcontrollers, if you don't want to use one; the search term you need is "traffic light circuit". <S> http://www.555-timer-circuits.com/traffic-lights.html <S> (Some of them generalise easily to more than 3 lights, some of them don't)
If you don't mind the timing being equal for each FET then a 3-bit ring counter could also be used - the timing for all could be adjusted still by changing the clock speed.
How can I make LED's light up equally? I have built a Binary to Unary (kind of) circuit on my breadboard.It looks like this: simulate this circuit – Schematic created using CircuitLab There are three switches that represent "binary number", and according to that switches' combination, number of lit LEDs change to represent that binary number. So for example: A B C LEDs0 1 0 _____OO0 1 1 ____OOO1 0 0 ___OOOOetc.. But with different ABC combination my LED's are lit with different luminous intensity... I am wondering how do provide equal current and voltage for LEDs and make them light up with equal luminous intensity independent of switches' combination.Probably I'm not understanding some major law in electronics. <Q> There are several things you need to do to have the LEDs be equal brightness. <S> The best way to make the LEDs look the same is to drive them with a constant current. <S> This is easier than it sounds, because many companies make chips specifically for driving lots of LEDs with constant current. <S> Here is one from TI. <S> Of course, this is a little more difficult because you have chosen to use discrete transistors instead of gates/cplds/mcu's-- <S> but those are the breaks. <S> The second, and hardest, is to get LEDs that are matched. <S> I say this is hardest because when you buy in hobby volumes, you are often at the mercy of the people you buy it from. <S> Getting things from DigiKey might be easier, but you have to research the different LEDs and see which ones do better color and intensity matching. <S> However, for most uses this step is not required as LED that have the same manufacturer part number are usually "good enough". <A> At the very simplest you will need a constant-current power supply for each LED, with their outputs (manually) tuned to provide matching brightness. <A> What intensities are you seeing? <S> And are you powering off a nine volt battery, or a power supply? <S> First, you have most of your common NPN Transistors with the loads after the emitter. <S> While I can see why for some spots, where you don't want to invert a signal, at the least the leds and current regulating resistors should go before the last transistors. <S> Second, the base resistor for the last transistor is 100kΩ! <S> Given 9v - 2x 0.7v <S> C-E Transistor Drops <S> , you are only placing ((9v - 1.4) / 100000) <S> 0.0076 mA or less of current at the base. <A> I honestly don't think this has anything to do with not using a constant current driver. <S> I only use a constant current driver when I am working with high power LEDs. <S> Common LEDs are very predictable using nothing more than a current limiting series resistor, and realistically, this is a primitive type of constant current driver anyway. <S> I believe the difference in light output is based on the tiny current being fed into the transistor bases. <S> That is why it was worse at a lower source voltage: even less base current. <S> The BJTs are not acting as switches, but as amplifiers. <S> Trying using smaller resistors at the transistor bases to fully saturate them.
As long as the LEDs are from the same source (made at the same time by the same manufacturer) and equal series resistors are used, the brightness should be near enough not to notice.
Simple RC circuit with diode question I was trying to understand this circuit under DC conditions, but can someone explain to me why the voltage across the capacitor is 8.1 V? I can't seem to understand. This voltage however does go down to 4.2 V if I increase the simulation speed and wait for couple of seconds but how can it start of it at 8.1 V. Am I missing something? Here is the circuit I drawn using falstad simulator. <Q> Basically it's your simulator - it can't ever be higher than the 5V supply and 4.2 <S> is pretty normal. <S> Check that your initial conditions don't include some form of charge on the capacitor. <S> Simulators can throw curved-balls sometimes and you did the right thing by asking. <S> By the way I think @pjc50 may have misread your voltage as being 9V not 5V - or maybe it's me - the picture isn't all that clear. <A> That is the standard 0.7V forward diode voltage drop. <S> Part of the functioning of a diode is that the voltage across it has to be more than a particular value for current to flow in the forward direction. <S> As the voltage increases, the effective resistance of the silicon junction decreases. <S> The value of this voltage threshold is about 0.7V for silicon P-N diodes and about 0.3V for Schottky and germanium diodes. <A> It's the simulator's way of calculating, and we call this the transient effect. <S> Remember, the simulator is based on linear approximations. <S> If you can actually look at the source code of the simulator, its probably dividing some value by a very small number (i.e. \$\frac{1}{0.5}\$). <S> Think about your capacitor equation (\$\frac{1}{jwC}\$ and \$C\frac{dV}{dt}\$ ) and try to think what calculations the simulator is doing initially (just as if you were to do a circuit analysis the capacitor is initially considered a short then as time progresses its an open circuit. <S> Right?). <S> I hope this helps you understand why we can't always trust a simulator. <S> It just provides more data to verify our calculations.
There will always be that much voltage drop through a diode of that particular construction.
Switching from PIC to AVR I have worked with PIC16 and PIC18s for over three years now and would like to get to know AVR as well. I have no specific project in mind, but would like to try around with the different architectures. I'd like to get a compatibility report on PIC and AVR. uC's software I am familiar with Assembly and C for PIC16 and PIC18. How do the Assembly and C variants for AVR microcontrollers vary from the PIC variants? Are there a lot differences? PC's software What software would I need to compile and assemble my programs for AVR chips? Is it free and where can I download it? Programming hardware I've used VOTI's Wisp648 to program PICs, but that board can't program AVRs. Do I have to buy a programmer or are there any circuits available on the web that I can build myself? uC's hardware For PICs, I have used the PIC18F4620 a lot. I'm looking for an AVR with similar features. The features I like are: Internal Oscillator Timers 5V and 3.3V version ADC MSSP with I2C and SPI support (E)USART PWM Much I/O pins >= 32kB program memory, >= 2kB RAM DIP package What AVR chip would have the same features? The package is a deal breaker, I really want DIP, PDIP or SPDIP. What would an AVR with comparable features be? SPI and I2C variants I was told that Microchip has its own variants on the SPI and I2C protocol. I often use SPI and I2C slave devices from microchip in combination with a PIC. Would I be able to use these chips (23K256, RTC, ENC28J60, ...), in combination with an AVR? In addition to that, would it be possible to link an AVR and a PIC chip using I2C or SPI? <Q> I work equally well on PIC and AVR (and others, too). <S> I like AVRs largely because of AVR-libc . <S> It's a decent embedded library that is open source and <S> reasonably well documented ( UNLIKE Microchip's plib, but plib does have full source, which I genuinely appreciate). <S> AVRs use regular old gcc and gdb which means no idiotic IDEs getting in my way. <S> The same tools work on Windows, OSX and Linux, and I don't need a 600MB+ IDE with Java and Netbeans or Eclipse to trip over or pollute my source tree with their own garbage. <S> Programming AVRs is usually done via ISP or JTAG (there was a recent question about that), and from a programming standpoint, it's really not much different from any other micro. <S> From a personal perspective, I've grown to very much dislike Microchip's datasheets and part numbering. <S> I cut my teeth on embedded design with Microchip and I loved them for a long, long time, but when I look for a micro these days I tend to start with Atmel, although they're not without their flaws too. <S> (SAM-BA is garbage for their SAM parts, and I've had some trouble with their factory support too.) <S> As far as which to use... try both, it's like the difference between Coke and Pepsi. <S> They are very, very similar and the choice usually comes down to price and the tools you prefer to use. <A> C will be the same with some small compiler differences. <S> Assembly will be quite different since it's a different architecture. <S> I advise going with C, and maybe pick up enough assembly to be able to inline some important routines. <S> For the IDE and programmer, Atmel have similar offerings to Microchip, just have a look at their website, download the free IDE and pick a programmer. <S> A similar chip to an 18F might be something like the ATMega328 <S> (the one used in Arduinos) <S> I believe they have DIP package versions. <S> Yes, I2C and SPI should work just the same. <S> Linking an AVR and PIC should be no problem. <S> Disclaimer - I have not used an AVR for a long long time. <S> I mainly use PICs and ARMs nowadays, but I have never had an issue connecting anything with SPI/I2C in the past, having frequently used SPI to connect between e.g. PIC/Atmel EEPROM/Cortex-M3/FPGA. <S> SPI is a very basic protocol which pretty much any modern micro should be capable of in hardware. <S> I2C is a little more complex. <S> I can't remember the story of the licensing/naming (e.g. 2-wire, I2C, SMBus) off the top of my head, but most peripherals are compatible at the basic level as far as I am aware. <S> Have a read of the Wiki pages for more detail. <A> uC's software The PIC and AVR instruction sets are similar, but I would not start out programming an AVR in assembly. <S> Program in C, with Atmel Studio. <S> It comes packaged with the AVR version of gcc, and has a really good disassembler that shows you the line of C you wrote, and under it, the resulting assembly instructions, very handy. <S> I would also download WinAVR . <S> PC's software Use Atmel Studio . <S> Don't bother with Eclipse, Programmer's Notepad, or whatever other random IDEs people use. <S> Atmel Studio is based on Visual Studio, has all kinds of plug ins available from Atmel, and has a good simulator built in. <S> Programming hardware <S> There are lots of cheap AVR programmers, such as the Bus Pirate, but get an Atmel ICSP . <S> It is entirely worth the extra expense if you intend to do more than one AVR project. <S> It uses USB, and is controllable from inside Atmel Studio. <S> uC's hardware <S> There is a selector tool , but in general, low end AtMega typical hardware is: Internal Oscillator (8 MHz)3 Timers2.7-5.5V Supply range8-channel multiplexed ADCI2C and SPI supportUSART2 PWMs that work in conjunction with the 8 bit timers Going to higher performing chips will buy you more timers and PWMs. <S> How much flash memory and SRAM you have available depends on the particular chip. <S> Most of the AtMega parts parts are available in PDIP, with the really high pin count stuff being QFP. <S> SPI and I2C variants <S> You really need to read the AVR datasheet's SPI and TWI sections carefully, do not skip a line. <S> There are multiple control registers for data order, clock polarity, etc for each interface. <S> It's all laid out in the datasheets, and is very readable. <S> It would not be hard to link an AVR and PIC. <S> You would just need to play with the SPI or TWI modes until you established communication.
It is possible to use MCP I2C (TWI for AVR) and SPI devices with AVR uCs.
How do I calculate the input voltage based on an ADC reading? +UB is a 12V power supply. I have to find the voltage on U_KL30. I take this U_KL30 as an input at PortA<1> of my MC9S08DZ60 and use an ADC to get a digital value. Now I need an equation to reverse engineer the digital value received from the ADC to the actual voltage on U_KL30. What equation can I use? <Q> There are two possibilities here: <S> That the uC has a fully calibrated ADC with precision circuits and temperature correction. <S> In which case you just need to read through the 418 page *.pdf and find the relationship or .. <S> It is uncalibrated and you can only get an approximation. <S> SO that means that you have to calibrate the input vs. <S> binary # ahead of time and hope it does not change with temperature too much. <S> Simply sweep the voltage on the pin, read it with a DMM and compare that to the ADC value. <S> Since this is a high volume product with tight profit margins I suspect #2 is what you'll have to do. <S> Keep in mind that you also will have tolerances on the R18 and R19 <S> it's looking more and more <S> like you'll just have to calibrate it. <S> Of course this all depends upon precision needed. <S> You could possibly get away with just reading two values and fitting a straight line to those. <S> If \$D_1\$ is digital reading #1 corresponding to \$V_1\$ with the measured pair \$D_1\$, \$V_1\$ <S> you simply: <S> \$V_x = <S> \frac{V_2-V_1}{B_2-B_1}B_x+\frac{(V_1B_2-V_2B_1)}{B_2-B_1}\$ <S> where \$B_x\$ is the new sample value. <S> Using your samples:"V1= 10V, V2= 12V <S> ; B1= 2023, B2= 2428, Bx= 2432" <S> We get V = \$ = \frac{2}{405}B_x <S> + 0.0098 = <S> 0.004938 B_x + 0.0098\$ <S> \$V_X = <S> 12.02 \$ <A> Assuming the number is read directly as a N-bit integer that's justified to the LSB (i.e., the most significant bits beyond ADC resolution are zero), $$V_{in}= V_{ref <S> }* \frac {ADC \ Reading}{(2^N-1)}$$ <S> Sure, there are nonlinearites and noise considerations, but this should be a pretty good first pass <A> I'm not quite sure exactly what you are trying to do here, but: If the input at +UB is +12VDC, then you can ignore the capacitor and just calculate the divider voltage: \$ 12V <S> \cdot \dfrac{R19}{R18+R19} = 12V <S> \cdot \dfrac{3.3k}{13.3k} = <S> 2.98V \$ <S> The diodes will limit the voltage range from just over 5V to just under 0V. For the digital representation, it depends on the ADC resolution and reference voltage. <S> For example, if you have a 10-bit ADC with a reference voltage of 5V, then the 2.98V would be: \$ \dfrac{2.98V}{5V} <S> \cdot <S> 2^{10} = <S> 610 = 1001100010 \$
It depends on how your ADC is configured, and what the reference voltage is.
Dots in a transformer symbol I came across this schematic : What do the dots in the transformer indicate? <Q> Those are phase dots. <S> They refer to the 'start' of the winding based on a predetermined winding direction (CW or CCW). <S> This allows you to tell at a glance <S> what 'polarity' the windings have <S> so you can figure out how the current will flow. <A> Without them, you don't know the polarity of the voltage coming out of the secondary with respsect to the primary. <S> In many transformer applications that doesn't matter, but when it does the dots need to be shown on the schematic. <S> The way to read the dots is to imagine current going into the primary at the dot. <S> That causes current to go out of the secondary at its dot. <S> If the transformer has a 1:1 ratio, then you can imagine that for differential mode signals there is no transformer, just a connection between the two dot ends accross primary to secondary, and the two not-dot ends. <S> Of course this doesn't hold true for the common mode part of the signal since that is isolated, but it might help visualize how to interpret the dots. <A> If the dots were on the same side, your circuit schematic would have be drawn with crossing wires, like this: simulate this circuit – <S> Schematic created using CircuitLab By adding the dots to the coils, we clarify that the orientation of the coils is important. <S> And by allowing ourselves to put the dots on either end, we gain a the freedom to rearrange the diagram to suit our convenience, such as not to have crossing wires. <S> So, it's not a different kind of transformer; only a notation. <S> So why do we sometimes not see dots in transformer schematics? <S> That just means the orientation is not specified, which means that it either it doesn't matter in the application, or the schematic has an error: the polarity actually does matter, but the dots were mistakenly omitted. <S> A common example where it doesn't matter is a power transformer which steps down AC and feeds a bridge rectifier. <S> The transformer will work properly whether it inverts or preserves phase. <S> By contrast, your Joule Thief circuit will not work properly if the transformer is wired incorrectly.
The dots tell you the relative orientation of the windings.
process timing on FPGA I'm new to fpgas, and there are some timing subtleties that I'm not sure I understand: if all my synchronous processes are triggered on the same edge, then that means my inputs are 'captured' on one rising edge, and my outputs change on.. the same edge? the next rising edge? if I have two modules, where the output of one flows into the inputs of the next, there could arise the situation where the inputs to my module (the outputs of a previous module) are changing at the same time as they are captured. The marker at 205ns shows what I'm talking about, op and data_write being my inputs. Everything seems to "just work" in this test case, but in the simulation it's not clear exactly what is being captured when. Is the data_write="0001..." being captured at 205ns or (205ns + 1 clock cycle)? Is there a way to get more detailed waveforms in ISim that show setup and hold times? Thanks. <Q> There's always some propagation delay through the flip-flop. <S> It's often called "clock-to-Q" delay. <S> That means your inputs are captured on the edge, and you outputs change on the same edge, but just a few nanoseconds later. <S> This few nanoseconds delay is enough (if your flip-flops are designed with "zero hold time" as they are in most FPGAs) that the changes don't affect any downstream flip-flops until the next clock edge. <S> In functional or RTL simulation (which is probably what you're doing to generate your result) <S> the delay won't be simulated as lasting nanoseconds. <S> In VHDL, it will be a single delta cycle of the simulator clock, which is technically no time at all. <S> This makes it impossible to see the delay in the simulator output. <S> Nonetheless for the simulated-as-ideal flip-flops, it is enough that the output changes don't affect downstream flip-flops. <S> If you do post-place-and-route simulation, it should be able to include appropriate delays <S> so you see these effects clearly, at the cost of increased simulation effort. <A> At the desired clock edge (rising or falling) the input at D appears at output Q. <S> This takes a finite amount of time (Clock to Q delay) and assuming there are no timing violations, D will only pass through one FF at a time (i.e <S> if there is another FFs input connected to Q, the second FF will pass the FF1 Q value before it changes. <S> To include timings in your simulation, you need to synthesize and place and route your design, then run a post place and route simulation. <S> This will have all the combinational, clock to Q delays, etc included. <S> The HDL simulation does not have any of these timings, so it's only useful for testing basic operation, not timing limits. <S> You will also get a timing report, which will tell you the speed limits of a particular clock domain, let you know if there are any timing violations, and show you the timing slack for various paths. <S> You can use this info to figure out where chnages may need to be made, or rules added to tell the software the violation is not a problem (e.g. for things like multi-cycle paths or cross clock paths) <A> This is meant as an addition to the previous answers, from whcih <S> I believe you get the idea. <S> These matters can indeed be a bit tricky in the beginning when simulation RTL designs since one can find it difficult to see what is the cause <S> and what is the effect in ideal/functional/RTL simulations (=no propagation delays). <S> With the right simulator, the delta delays <S> can actually be visualised. <S> ISim doesn't it do it, but in e.i. ModelSim, you can enable delta expansion around the clock edges. <S> Below is an example screenshot from a buggy 3rd-party IP that I trouble-shooted. <S> c is the clock signal, and the +1 etc. <S> are the delta cycles, visualized as time. <S> In your example, therefore, at 205 ns, data_write = 0000... <S> is what is being captured. <S> Some other logic in the first unit is changing the signal data_write to 0001... on the same flank, and that signal appears on data_write slightly after the clock flank. <S> This "slightly after" would be one or several simulation deltas in an ideal simulation (your example) (not visible in ISim, but in e.g. ModelSim with delta expansion), or some ps/ns later in the real world. <S> On a side note: One important thing with RTL design is to make sure that inputs are always sampled on the clock flank - even one delta cycle later is too late. <S> The input might not be valid one delta later. <S> Or in other words: "don't mess with the clock path".
If a design is simulated where both the simulation and the design is truly ideal and synchronous , with no delays simulated, you can, in principle, view all signal changes on a specific clock flank as happening slightly after that clock flank.
What is my microcontroller power duty cycle? Say I have a uC active for 1s every 100s, sleep otherwise. This will lead to 1% duty cycle. But what if it is active ones every ten seconds, and once every 100 seconds, and then once every week? Over what period of time do I calculate the duty cycle? <Q> If I read your question correctly then you have a wakeup at three different intervals simultaneously: <S> Once every ten seconds and <S> Once every 100 seconds and <S> Once every week In this case you have to calculate the duty cycle over the longest interval, in this case one week. <S> Then calculate all the smaller intervals in terms of the larger one. <S> A week is 7 days, each day is 24 hours, each hour has 3600 seconds, so your week is 7*24 <S> *3600 = 604800 seconds. <S> During this interval you will wake up: <S> 60480 times (for the once / 10 sec interval), plus 6048 times (for the once / 100 sec interval), plus 1 time (for the once / week interval) <S> In other words, in 604800 seconds you will wake up 60480+6048+1 = 66529 times. <S> Calculate the wake time for each wakeup <S> (in seconds, even if it is fractional), multiply it by 66529 and divide 604800, then multiply by 100%: this is your duty cycle. <S> Duty cycle = <S> \$\dfrac{66529 <S> * seconds_{awake}}{604800}*100\%\$ <A> The duty cycle indicates how long your uC is on, relatively to the period (\$T\$) of the signal. <S> Typically, it is \$\frac{t_{on}}{T}\cdot100\%\$. <S> You have to calculate the duty cycle over one (or more) full periods. <S> That is, you can only calculate the duty cycle of a periodic signal. <S> Let's do an example: <S> In indicated the active time with \$a\$ and the inactive time with \$i\$. You can see this signal repeats after \$t_a+t_i\$, so one period, <S> \$T=t_a+t_i\$. You calculate the duty cycle over one period, so it is: $$\frac{t_a}{T}\cdot100\%=\frac{t_a}{t_a+t_i}\cdot100\%$$ <S> Now for a more advanced signal: It isn't a very good photo, but I gave the first on-time \$a_1\$, the first off-time \$i_1\$, the second on-time \$a_2\$ and the second off-time \$i_2\$. <S> Again, you have to take the full period of the signal. <S> You see the signal repeats itself after \$T=t_{a_1}+t_{i_1}+t_{a_2}+t_{i_2}\$. You can now calculate the duty cycle with: $$\frac{t_{a_1}+t_{a_2}}{T}\cdot100\% = <S> \frac{t_{a_1}+t_{a_2}}{t_{a_1}+t_{i_1}+t_{a_2}+t_{i_2}}\cdot100\%$$ <S> This means you can only calculate the duty cycle of a periodic signal. <S> If your uC wakes up due to, for example, an external signal, it doesn't make sense to calculate the duty cycle. <S> You can of course estimate how long it will be on and how long it will be off, to see how much energy it will consume. <A> The duty cycle for a microcontroller is just a figure that helps calculating the average power consumption. <S> If the duty cycle is not fixed, like for example when it's woken up by an asynchronous signal, it doesn't make sense to express it in terms of duty cycle. <S> You could have an estimate if you could have the average period at which the event happens.
So, to answer your question: calculate the duty cycle over one full period.
Working and simple applications of PLL Recently I am studying about Phase Locked Loop. My professor said that it is an amazing device with a variety of application. I understood the basic working of a PLL. But I couldn't appreciate his statement. Can anybody make me understand it's operation by giving a practical example..? <Q> Perhaps one of the most useful applications for a PLL is a frequency multiplier. <S> A PLL is a feedback loop. <S> Feedback loops try to attain a steady state in which the input is equal to the output. <S> By modifying the feedback mechanism, you can do a lot of interesting stuff... <S> Consider the following: <S> Let's say a frequency of 1MHz goes into the Pre Divider set to divide by 1. <S> This 1MHz enters one of the Phase Detector inputs. <S> Now suppose the Feedback Divider is set to, say, <S> M = <S> 8.This <S> 1/8th of MHz enters the second Phase Detector input. <S> Because the loop is trying to reach a state in which the two inputs are equal, the VCO frequency will eventually have to rise to 8MHz. <S> You just turned 1MHz into 8MHz using a couple of dividers and a VCO. <S> You'll find a PLL multiplier in every ARM microcontroller. <S> Using a set of various dividers for N and M you can generate many different frequencies from a single clock source. <A> This is very much an idealistic description followed by a couple of practical examples. <S> The oscillator output is usually a single frequency squarewave. <S> The phase detector receives 2 inputs and produces an output level that is nominally centre-rail when the phase of the two inputs are exactly at 90 degrees to each other. <S> If the frequencies are different you get a complex signal whose average level will be higher or lower than centre rail. <S> This allows you to compare two frequencies and get a measure of which input frequency is the highest. <S> If you feed the output from the oscillator (that is controlled by the phase detector) into one of the phase detector inputs AND you apply an unknown signal into the other input, the PLL will try to adjust its own oscillator so that it matches the input signal frequency but 90º phase shifted. <S> So what? <S> Not a big deal in doing that you might say <S> BUT, if the unknown input frequency was quite "dirty" with noise and distortion, what you get is a cleaned-up version from the PLL's oscillator. <S> That can be useful. <S> Because you can choose to filter the output of the Phase comparator to remove high frequencies, if the "unknown input" were frequency modulated, the output of the oscillator would be restricted from following the modulations but, would be representative of the unmodulated carrier frequency of the "unknown input". <S> Useful in radio receivers. <S> On the other hand if you allowed the PLL to "track" the frequency modulations of the input, the output of the phase comparator (not the oscillator) would look like the signal that originally modulated the input. <S> The PLL is now a frequency demodulator. <S> The descriptions above are fairly simple and I haven't made any attempt to describe the details that must be covered to succesfully design a PLL. <A> It's convenient to have only one actual timing crystal in the design, then generate others at higher frequencies from that.
A PLL in it's common form is a phase detector that controls the frequency of an oscillator. They're used a lot in integrated circuits to generate clocks at various speeds from a single master clock.
Why is the circuit board abreviation for transistor "Q"? On circuit boards, I see that transistors are "Q", but why Q? Shouldn't "TR" be transformer, so transistor can be "T" because transistors seem to be more common then transformers. <Q> There are claims that, after initial chaos, eventually the letter Q was chosen because of the popular TO18/TO39 case styles. <S> Just look at it from the bottom: <S> And of course, 'T' had been used for transformers since decades earlier. <S> Now, finding trustworthy sources available on the web... well, it hasn't been a lucky few minutes for me, but <S> I know I read this somewhere in print years ago. <A> Here's the rumor I have read somewhere: When transistors were new, they were that strange part no one was really using yet. <S> I have stopped worrying about how to call parts. <S> The letters are not used consistently in different parts of the world - "Q" for transistors, for instance, is an American tradition; Europeans often call transistors "T". <S> Except for Germany, where discrete semiconductors (diodes, transistors) tend to be called "V" in some companies even though the standard DIN EN 60617 suggesting the letter "V" is not even valid any more, iirc. <S> The current standard, DIN EN 61346, suggests the letter "K" for transistors, but I've met no one who is really hardcore enough to actually use it. <S> Oh, and I've just found out that DIN EN 61346 has been withdrawn and replaced by IEC 81346 . <S> The German wikipedia article has a complete list about all the suggested reference designators, and you can clearly see how the goal of finding one big classification, valid for everything and anything from board level design to industrial automation in large installations, has led to a big table that has FUBARed everything. <S> Search for the term "transistor" in the wikipedia article, and you'll find that you're supposed to use "KF"! <A> TL;DR <S> The short answer is "because [someone] said so!" <S> (Shockley? <S> Moore?) <S> and then it was codified <S> Might refer to the Q-point ("quiescent" point) as load-line analysis (Q-point analysis, or bias analysis) came of age around the same time as the advent of the transistor FYI: "T" is transformer according to ANSI/IEEE <S> (My) Summary of the Codification History: 1950's Military defines standards for drafting to facilitate what we now call <S> "lifecycle management" 1970's IEEE/ANSI tries to get in on the action and set a wide reaching commercial standard 1990's IEEE tries to update it, but realizes its pointless (e.g. good enough) From Wikipedia (emphasis mine): IEEE 200 -1975 "Standard Reference Designations for Electrical and Electronics Parts and Equipments" is a standard that was used to define referencing naming systems for collections of electronic equipment. <S> IEEE 200 was ratified in 1975. <S> The IEEE renewed the standard in the 1990s, but withdrew it from active support shortly thereafter. <S> This document also has an ANSI document number, ANSI Y32 .16-1975. <S> This standard codified information from, among other sources, a United States military standard MIL-STD-16 <S> which dates back to at least the 1950s in American industry.
"T" was already taken (transformer), and the not-so-often used letter "Q" was (i) not used for anything else and (ii) seemed appropriate for a not-so-often used type of component.
7805 5v Regulator outputting 5.8v? TTL chip not functioning correctly? LED + TTL chips? I've read a number of other similar questions to mine, but none of the answers have helped me so far. I also don't have any electrical schematic software, so I'm afraid I'll have to explain in words and picture the situation. What I am trying to create is a basic 5v regulator that will be used to power TTL chips and LED's. In front of the 7805 is a 220uF capacitor, and another one after it. The load at the output is a 330ohm 1/2 watt resistor with an led. The middle pin is correcting connecting to the - lead. I'm trying to create: The brown wires are connecting to my multimeter leads. Without load, when a 9v battery is used, the regulator's output is correct at 5.00 on the dot. When I use a 7.5v 250mA DC adapter, the output is 5.8. Why is this? I've read on one forum that greater than 9 volts should be used, but another forum said that ~7v and above is fine for a 7805. I have tested another 7805 chip, with the same results. My second question is about TTL chips. Earlier, I was using the 9v battery to power a 7400 quad 2-input NAND chip, and I noticed that it was functioning inconsistently. From what I read, when there are no inputs, the TTL chips will "float" and assume that all the inputs are 1. If that is the case, why are my all of my gate outputs 1 as well? If the input 1/2 are assumed to be 1, and the chip contains 4 NAND gates, shouldn't all 4 outputs be 0? The chip is functioning how I would expect an AND gate to. Accepting the behavior of my NAND gates, I still have another confusing issue. When I do add power to one of the input pins, the output of the NAND gate will correctly become 0. However, when I remove that added power to the input pin, the output doesn't turn back back to 1! I have to the input pin with my multimeter to get it back on. Why is this? I've tested another 7400 chip, same problem. If TTL chips need a consistent supply of ~5v, does that mean I cannot use LEDs at all? When I add a standard T-1 3/4 led to my load, the voltage drops to ~2.3, which is inadequate for my TTL chips. But a number of guides I've read online suggest experimenting with the output of TTL chips with LEDs, so I am wondering if there is a problem with my setup. The voltage drop of ~2.7 should be expected when using an LED, right? <Q> Do you know that the horizontal strips of a breadboard are all connected together (except sometimes in the middle)? <S> To me this looks like you have shorted the input to the output of the 7805. <S> (Or maybe the output to te ground, my view is blocked by the capacitor.) <S> ==================================== <S> OK, next step. <S> You are using a plain old 7400, no LS or HC or any other letters between the 74 and 00? <S> That old chip requires 5V. <S> If you used it at 9V you can't assume it is still working correct. <S> It might, but don't count on it. <S> ==================================== <S> I can't make sense of your LED question. <S> You don't mention a series resistor, did you use one?A LED nearly always requires a series resistor. <S> For starters, take 1k. <A> You really want >8V or so so that the 7805 isn't dropping out, especially if there is a lot of ripple on the input <S> (drop out is relative to the lowest part of the input). <S> Try it with 9-12V DC, load the output (resistor and LED is fine), and measure again. <S> 7400 <S> / <S> 74LS/S/L/F/ALS etc (the true TTL models) are 5V only. <S> 9V need not apply. <S> CMOS based 74x is usually 2-6V supply. <S> None are safe at 9V, AFAIK. <S> TTL inputs tend to float up, but it's not always a sure thing. <S> tie them the way you want them to be certain. <S> Have LED's on the output through a resistor, so as to not excessively load the output, and so the LED doesn't clamp the output to Vf. <S> Or are you talking about LED across the supply? <S> have it in series with a resistor. <S> Get rid of your in line protection resistors <S> (330ohm? <S> I didn't quite understand, but it looks like that's what you are doing in the LED picture? <S> they are in series with the 7805 in and out? <S> That won't work very well if you pull any current at all...) <A> The large electrolytics you have provided do part of the job - smoothing lower frequency variations - but they cannot respond quickly enough to counter high frequency issues. <S> Many regulators will output the wrong voltage without these capacitors. <S> Also, digital multimeters may respond erroneously to signals with high frequency noise present.
Whatever other problems you may have, you need some smaller capacitors with drastically lower series resistance across the regulator output (and preferably input as well) to stabilize it.
NiMh or LiPo batteries for unattended charging/usage I'm in the planning stage of a summer project: A WiFi controlled robot for remotely monitoring a shore home. The robot will consist of a 4-wheel platform (4 motors, 1 A stall current each, 7 V), Raspberry Pi Model A + WiFi dongle, and Raspberry Pi camera module. Since this robot will be operated while I'm not at the house, I need to be able to remotely recharge it. The plan is to implement something similar to the Roomba's drive-on charging base: My issue is that I'm unsure which battery chemistry to choose. LiPo has the benefit of being lighter, but since their nominal voltage is 3.7 V, I'd have to put two or three packs in series to be able to run my motors (which need 7 V, as I mentioned). But, I know this not recommended because then charging the batteries in series is complicated/unsafe. NiMh seems attractive: wide range of voltage/current ratings, not as prone to fireballs, albeit heavier. My thinking is I could build a simple charging base that trickle charges the robot's NiMh battery. No fast charging is needed (the robot will spend most of its time on the charging base, when not in use anyway). Summary of requirements: rechargeable battery for unattended charging/usage, somewhere in range of 8-12 V, several amp-hours capacity (4-6 Ah, maybe). Is my evaluation of this correct - that NiMh seems the way to go? Or should I consider LiPo? <Q> For a hobbyist project, I'd go with a NiMH option. <S> They are significantly easier to charge <S> (you can charge them with a commodity linear regulator (LM317) and a few passive components), and safer. <S> The weight difference will likely not matter much- <S> your robot doesn't seem to need to change directions very quickly, and it's not something like a quadcopter where every ounce counts. <A> Charging the battery safely is a primary concern. <S> So to give you some ideas, this is a "smart" charger you can set for various current and voltage settings (up to 9.6 volts); it will also turn off automatically. <S> It will also charge NiMH. <S> Here is a link from one of my favorite websites: <S> http://www.servocity.com/html/super_brain_charger.html <S> Also, the user's manual for the charger: MCR Super Brain Charger Manual <S> http://www.servocity.com/html/9_6v_batteries.html <S> Also, may I suggest a method to implement the charging station? <S> After I built my Reginald project, I saw what this gentleman did to elegantly recharge his battery remotely: <S> Basically it's a positive and negative spring post that makes contact with some metal tabs. <S> EDIT: Link to Reginald: http://www.instructables.com/id/Reginald-a-UDP-surveillance-bot-control-via-the-/ <A> I've built several products around different chemistries. <S> I have found LiPo the easiest to use since there are already specialised charger <S> IC's that do all the work however, like you said, having them in series is not that straight forward. <S> I believe the NiMH is a better solution if you don't have a lot of experience with chargers or if you don't find a good solution for charging LiPo in series. <S> Just one note <S> , do not trickle charge NiMH indefinitely, use a timer at least to avoid overcharging the battery too much(even <S> when you trickle them, they overcharge). <S> You could also use, like Pwocky suggested, an LM317 to charge at a constant current and monitor the change in temperature in the battery pack, once the delta T becomes big enough (the temperature changes more rapidly) the battery is charged. <S> You could also mix this method with delta V and a safety charge timer. <S> This is what I do and it works perfectly. <S> I charge my batteries fast and never overcharge them. <S> There is a lot of info online with graphs showing how the temperature changes when charging a NiMH battery.
For your battery, I suggest getting one of these NiMH: I typically like to DIY; however when safety is a factor, it would probably be better to buy a product from a quality company.
How to discover memory overflow errors in the Arduino C code? Several times I had some suspicious outputs on the Serial Monitor after uploading code to the Arduino: like eternal output of whitespaces or suddenly cut of strings or scrambled strings. Because there was no compile error or warning in the Arduino IDE I thought the Arduino was broken but after some tests I found out that not all kinds of errors are caught by the Arduino IDE compiler - especially when assigning variables in a loop for array structures. This seems to crash the Arduino in a short amount of time. How can I discover errors not displayed by the Arduino IDE? <Q> The MemoryFree library can help you find risks with memory usage. <S> Example: <S> #include <MemoryFree.h>// On Arduino Duemilanove with ATmega328://// <S> Reported free memory with str commented <S> out:// 1824 <S> bytes//// Reported free memory with str and Serial.println(str) <S> uncommented:// 1810//// <S> Difference: 14 bytes (13 ascii chars + null terminator)// 14-bytes string//char str[] = <S> "Hello, world!";void setup() { Serial.begin(115200);}void loop() { //Serial.println(str); Serial.print("freeMemory()="); Serial.println(freeMemory()); delay(1000);} I'm unsure if MemoryFree accounts for the stack pointer. <S> If your stack pointer collides with your heap pointer you can experience segmentation faults. <A> The most common cause for RAM exhaustion is using the String object or using lots of constant-character arrays (c-style string). <S> Forutantly IDE 1.0.4 includes a fix to malloc which has plagued the String-object for a very long time. <S> To reduce the RAM wasted by constant-character strings like: Serial.print("Hello World"); // <S> This consumes RAM! <S> You can use the F() macro. <S> This macro will force the character array to stay in PROGMEM. <S> When the array is used, only one byte of memory is consumed. <S> Serial.print(F("Hello World")); // <S> Keeps the character-array in PROGMEM <S> Keep in mind that strings stored in PROGMEM cannot be altered during runtime. <A> Looks like you're talking about runtime errors(of the memory leak/segfault type) here. <S> There isn't any way to discover such errors (unless you comb very carefully through the code) in code that's already written. <S> However, it is quite easy to prevent these from happening while writing the code. <S> Just be very careful <S> when writing loops or recursive calls; ask yourself "could this get out of hand?". <S> If it looks like these is scope for it to "get out of hand", then write code to protect against that. <S> About segfaults -- just check the boundary values of array indices and you ought to be OK. <S> If you're using pointers, then please be careful with pointer arithmetic.
As far as discovery goes, without a debugger or memory controller, you have to use old-fashioned detective techniques to find where the problems occurring.
Is there any way to simulate a program run before burning it onto the board? Programs may, at times, have runtime errors. These are sometimes hard to find and can easily be missed. Is there any way to test the program before actually burning it onto the board ? <Q> There are a few Arduino Simulator projects out there. <S> Perhaps one of the more mature ones is the Virtronics Simulator for Arduino , YouTube video here . <S> The Virtronics page linked above also lists a few other Arduino simulators, both free and paid. <S> Given the interest the Arduino evokes, there are likely to be many more such simulators out there, so no point trying to list them all in an answer here. <S> What is worth noting is that there is also an Arduino Simulator iPhone app : This is not a recommendation, not having seen it in operation yet. <S> On a side note: The Arduino is in itself a prototyping / experimentation board. <S> It is ideal for programming experimental code, debugging it, modifying and then re-flashing fresh code, pretty much as many times as one likes . <S> If the code hangs, reset and reflash with any changes. <S> Therefore, the merit of using a simulator, which can never perfectly emulate the various real-world timing or other issues an application might face, is questionable. <S> If the cost of the Arduino is the concern, there are a couple of options open: <S> Inexpensive Arduino Nano clones off eBay <S> - I have several Meduino Nano Enhancement boards, they work excellently, and are priced at under $10 including world-wide shipping: Make your own Arduino - The Arduino site walks you through making one on a breadboard , which does not even need you to solder anything! <A> This is available in <S> Visual Micro although it requires Visual Studio. <S> You can set breakpoints, evaluate variables, and change variable values. <S> You can also get visualization of of memory over time: <A> One way to do this would be to create a wrapper program for the actual code which simulates all the inputs and accepts outputs (thereby creating a feedback loop) as per the real environment. <S> This would take variable amount of effort depending on the type of program, degree of testing and number of inputs. <S> Keep in mind that while writing the wrapper program, you should follow a black-box approach. <S> Otherwise, your outer code may not test the program as well as possible as keeping in mind the actual code while creating the test code <S> may bias you to ignore boundary cases or problem areas <S> (This has been observed to happen while doing White-Box Testing which is the alternative).
You can find runtime errors if you can manually step through your program with the Arduino connected and debug ( after downloading code to the Arduino).
Is there any way that the Arduino board can get damaged by using a buzzer without a resistor? I want to use a standard piezo buzzer on one of the Arduino Uno's analog pins without the use of a resistor. Will connecting this be a problem for the Arduino board? Why? <Q> Given this common buzzer , it has a coil resistance of about 42 ohms running at 5V, it would try to draw 119mA if connected directly, far more than the 40mA (per pin) <S> the Arduino can supply. <S> Drawing this current could damage the Arduino. <S> Adding an inline 100ohm resistor could drop the current draw to about 35ohms, within safe limits. <S> Also, as a magnetic component, you should place a diode across it to prevent back EMF from damaging the Arduino. <S> Sound vibrations can cause the buzzer to generate a voltage and the diode can prevent that from damaging the Arduino. <A> Specific to a piezoelectric buzzer : <S> This capability is frequently used in knock sensors, and piezo pick-ups for percussion musical instruments. <S> The voltages involved can be as high as several tens of volts , for instance if the buzzer falls onto a hard surface. <S> Without some form of protection, such as at the least a resistor in series, such voltages can overcome the ESD protection within the Arduino's microcontroller, and damage the device. <S> Therefore using a resistor is strongly recommended . <S> The reverse voltage is more of a concern than drive current, since unlike the magnetic (coil) buzzers some answers refer to, a piezoelectric buzzer consumes very little current for normal operation. <S> Refer to the datasheet for your specific buzzer: operating currents from 5 to 30 mA <S> are common, and won't be a risk to the Arduino. <A> The I/ <S> O pins can provide up to 40mA of current before damage occurs. <S> (Although many recommend keeping that in the 20-30mA to be safe.) <S> If the buzzer does not draw more than that, you are fine. <S> If you don't know the buzzer's current draw, a small resistor can help to limit the current. <A> The Arduino pins can take up to 40 mA of current. <S> Measure how much current the buzzer takes when it is given 3-5V. <S> If it is below 40 mA, you're fine. <S> It really depends on the buzzer. <S> Piezo buzzers usually are fine, you have to be careful with normal buzzers. <S> Generally, adding a 200-300 ohm resistor protects the pins from almost all damage. <S> I'd suggest using one anyway, especially if the buzzer is drawing current in the 30-40mA range.
Apart from the current limiting concerns as already expressed in other answers, there is an additional risk to a direct connection: A piezoelectric element or piezo bender (the thin flat circular portion that vibrates to generate sound) can generate large voltages when knocked or tapped:
Is there anything I should watch out for with cheap "Arduino" copies? There's a plethora of cheap Arduino copies on eBay and similar sites, usually originating from the far east, that can be had for a significant chunk less than the official boards, especially if you're buying more than one. Aside from the moral reasons of supporting the Arduino guys (not that I'm ignoring that, just not considering it for the purposes of this question) is there any technical difference between them, or are they pretty much the same (Arduino are open source hardware after all) will they be, as far as functionally, pretty identical? <Q> You should rather make make a cheap Arduino by yourself. <S> By doing this, you can have it customized and use high quality parts. <S> You can (and should) buy the original Atmega chip so you will have 100% compatibility with the software. <S> You will maybe [accidentally] burn the first chip to ashes (like me), but you'll get a lot of experience doing this. <S> Most cheap electronics have failed me. <S> So would cheap Arduino clone, I believe. <S> Electronic components are kind of delicate things, capacitors and transistors especially. <S> I know my answer is not real answer to the question, but you know, cheap hardware is random thing <S> : you'll get a guys, that had luck (over 50% much likely) and those who didn't. <S> My friend is of the second group and I'm pretty sure, he would sign under my answer. <S> Here, you can see a cheap way to make your own Arduino (cheaper than a pizza with Coca-Cola :) <S> ): http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3 <A> You could be buying counterfeit products, with counterfeit chips or components. <S> It sounds unbelievable, but check out Sparkfun's research on counterfeit ATMega328 (the same chip in many Arduino boards, clones, and variants!) <S> This article starts here (why aren't these ATmegas acting correctly?): <S> https://www.sparkfun.com/news/350 Second page: <S> (they're not ATmegas at all ): <S> https://www.sparkfun.com/news/395 <S> There are so <S> many known good variants out there. <S> Pick one that people have actually heard of instead of something sketchy. <S> EMSL's Diavolino http://shop.evilmadscientist.com/productsmenu/tinykitlist/180-diavolino Modern Device <S> http://shop.moderndevice.com/collections/arduino-freeduino/ <S> Digispark <S> http://digistump.com/category/1 <A> Even though I prefer that you make your Arduino rather buying it, if you're interested in buying cheap copies it's not an issue. <S> I bought a Mega for as low as 16$ and a Nano for like 10$ since I started with electronics, they are working completely fine and a good acceptable quality. <S> Just beware of 1 thing, some of them come with Prolific drivers for USB to serial, you'll have problem finding working drivers for your OS. <S> Make sure it is FTDI and not Prolific, the drivers will be included with the Arduino IDE. <A> You can't generalize the entire buying experience from sources like eBay as good or bad. <S> There are a couple of sellers on eBay selling clone boards that are of good build quality. <S> Many of them are not. <S> As with any electronic components from eBay, it is going to be very hit or miss in terms of quality. <S> Regarding your "technical differences" question, there will be small differences. <S> The Arduino team does not use the published reference designs as their final board files that go to production. <S> In fact, some of the reference designs have mistakes in them, which haven shown up in the clones. <S> In some cases, the maker doesn't even bother to program the chips. <A> It's open source hardware so everyone has the same plans to start out with, but some components are switched out which can make Clones either perform better or worse. <S> First, beware of counterfeit arduinos that claim to be genuine. <S> Never buy what you think may be a genuine arduino from ebay. <S> Just not worth it. <S> Some of the super cheap ones use components that will break quickly if you have an accidental wiring mishap. <S> Many cheaper arduinos won't include a component that ensures the 5Volts is constant <S> but you rarely need that. <S> Another way that money is saved is that they don't include the cable. <S> Decent, cheap ones can be found for $5 plus from China. <S> Probably the best ways to ensure you'll get something that works will be to look at reviews and to use money back guarantees.
Some other cheap ones will use cheaper components that will require you to take an extra step of installing a very specific driver and it won't work with the arduino software out the box. Also, you have a wildcard as to what bootloader is programmed on the main chip and what code is used on the usb-to-serial chip (if its a microcontroller instead of dedicated function.)
What are the implications of using PROGMEM? With large amounts of text variables, I've found it necessary to store them in the Flash memory using PROGMEM . What are the positive and negative consequences of storing large variables in Flash (using PROGMEM) vs SRAM vs EEPROM on the Arduino? <Q> Here is a quick comparison of FLASH, EEPROM and SRAM on the AtMega328, the microcontroller in many of the current Arduino boards (excluding Due, Leonardo, older Arduinos and some other compatible boards). <S> FLASH: 10,000 write/erase cycles. <S> Access is fast, but slower than SRAM. <S> Code accesses via PROGMEM . <S> EEPROM: 100,000 write/erase cycles. <S> Access is slooooooow, in milliseconds. <S> Relatively complex access procedure. <S> SRAM: <S> Unlimited write/erase cycles. <S> Access is very fast, 2 clock cycles. <S> Direct access by code. <S> So, the key hypothetical negative consequence of using PROGMEM is the 10,000 write cycle limit. <S> The key negative consequence of using EEPROM is the complexity of code to read/write/copy data. <S> SRAM, it's just very limited in capacity . <A> You'll also take a (very small) performance hit as the string needs to be copied 1 byte at a time. <S> Wear-out of the FLASH isn't a (primary) concern since in order to make changes to your program you'd have to re-program the FLASH anyway. <S> With the IDE 1.x introduction <S> the F() macro was included. <S> This makes it easier to keep strings in PROGMEM. <S> For example instead of using:Serial.print("Hello World!"); You can now use: Serial.print(F("Hello World!"); <S> Note, that F() isn't a function <S> , it is just a macro <S> so its use is somewhat limited. <A> PROGMEM is best used for immutable data. <S> If you're going to keep rapidly changing variables, I would just store it in the SRAM. <S> On the other hand, if you want to have some immutable text variables (eg stuff to be displayed) that won't be fetched too often, PROGMEM is a great idea. <S> Regarding EEPROM -- try to save this for persistent stuff. <S> IIRC <S> it is slower to fetch data from EEPROM over SRAM/PROGMEM. <S> Usually I (and others) copy data from EEPROM over to SRAM (Even the official example does this) before using it.
The primary implication is that you can not modify the information stored in PROGMEM.
How to water-protect my Arduino? I am building a watering system with an Arduino. Basically it runs on a track with a hose that drips water down on plants a couple of times every day. Its outside, and water might sometimes get from the leaves of the plants down to the Arduino controller. What is the best way to protect my Arduino against weather and water from the watering system? <Q> In a nutshell, you want to treat the Arduino and all other electronic components as you would treat a line voltage electrical system. <S> The easiest way to protect it from the actual watering system is simply to have the electronics at a higher elevation than the water source, while observing all the previous precautions I mentioned. <A> Firstly, there are commercially available products like this one . <S> The easiest thing to do is to get one of those airtight boxes for food storage and place the Arduino in there. <S> If you want any wires to come out, cut a hole and use hot glue 1 or some waterproofing substance (like plumber's epoxy). <S> Silicone waterproof nuts work as well. <S> 1. <S> While this will work for the device you have in mind, note that hot glue seals may not work well when completely submerged. <A> I used to install equipment onto Communications Towers that would have to be exposed 24/7 to all the elements (including getting covered in ICE). <S> I typically would use NEMA rated enclosure boxes for this, because the thick hard plastic is almost indestructable. <S> but you can drill into it for Cable Glands or mounting easily enough.(make sure to seal anything you drill) <S> I use Cable Glands to seal cable entries, and depending on the direction, drip loops should be used. <S> you could also opt for something with Ingress Protection ratings, (something like IP67-IP69+), check out http://www.enclosurecompany.com/ip-ratings-explained.php for more information on enclosure IP ratings.
You want to have a weather-resistant case for the Arduino with as few access ports as possible, and you may want to go so far as to plug those access ports with silicone once you have the required wires in place.
Can I output a HDMI signal with an Arduino? There's various articles online detailing how to use an Arduino to output a VGA signal, but can I use it to output a HDMI signal or is it simply not fast enough? It would only be used to display some basic text, nothing in the way of fancy graphics. <Q> No, not directly. <S> Arduinos just don't have the horsepower to do such a task. <S> For this project, I would recommend using a Raspberry Pi. <S> Take a look at this awesome blog post by Joonas Pihlajamaa on using a Raspberry Pi as a Arduino HDMI shield . <A> Please see Chrontel's products at <S> www.chrontel.com : <S> CH7035 - TTL to HDMI output. <S> CH7026 - TTL to CVBS. <S> CH7033 - TTL to VGA and HDMI. <S> CH7034 - TTL to VGA. <S> CH7322 - HDMI CEC. <S> Their TTL input supports RGB 8-8-8. <S> 5-6-5, <S> YCrCb 4:2:2, ITU656, etc. <S> I think the Arduino can use their MCU interface to write graphics data to their frame buffer directly. <S> On-chip scaler can scale frame buffer content to all HDMI output resolutions like 1080P. <A> For low resolution displays, it's possible to directly generate HDMI signals using low-end FPGAs. <S> In order to generate an HDMI signal, you need to be able to toggle 3 GPIO pins at a rate of 250MHz, which is within the capabilities of, say, the Spartan 6 or Cyclone IV range of FPGAs. <S> This would be enough to display a 640x480 image with 24-bit colour depth. <S> Your Arduino could then interface with the FPGA to provide instructions on what to display, and the FPGA could update its display as required. <S> See this project for the basics of how this would work. <A> Here's an Arduino Shield for HDMI from TechToys.com by John Leung. <S> It uses a TFT controller RA8876 to generate RGB video in 8:8:8 format. <S> Arduino HDMI Sheild <S> Arduino Source Code <S> It's kind of pricey at $69. <S> It's on backorder as of 5/2019. <A> The graphics part is playing nicely. <S> There remains the audio part.
The hardware combination Arduino + RA8876 + CH7033B has proven to be able to output a 1920x1080 progressive scan @ 60Hz to a TV, 1080p monitor, and even a 1080p mini projector.
Can I use the analog pins on the Arduino for my project as digital? I am new to using Arduino, and I have an Arduino Uno. For the projects I've done, I've only used the digital pins. I am building a small vehicle that uses stepper motors. I have run out of pins to control the motors for this vehicle. What are the analog pins for? Is it possible for me to use analog pins to control the rest of the step motors which I connect to the Arduino, or do I have to buy a bigger Arduino than Arduino Uno to control this contraption? <Q> You can always use the analog pins for digital writing. <S> digitalRead <S> () works on all pins. <S> It will just round the analog value received and present it to you. <S> If analogRead(A0) is greater than or equal to 512, digitalRead(A0) will be 1, else 0. <S> digitalWrite <S> () works on all pins, with allowed parameter 0 or 1. <S> digitalWrite(A0,0) <S> is the same as analogWrite(A0,0) , and digitalWrite(A0,1) <S> is the same as analogWrite(A0,255) <S> analogRead <S> () works only on analog pins. <S> It can take any value between 0 and 1023. <S> analogWrite() works on all analog pins and all digital PWM pins. <S> You can supply it any value between 0 and 255. <S> The analog pins let you read/write analog values - basically, instead of giving out a voltage of 0 or 5 (as with digital), they can give a range of voltages between 0 and 5 (both as input and output). <S> Note that the voltage during analog output is only the observed voltage with a multimeter. <S> In reality, the analog pins send pulses of 0V and 5V signals to get an output that "looks" analog (this is PWM). <S> Regarding the number of pins: keep in mind that the PWM pins can be used for analog output. <S> If you run out of pins, you can use multiplexing to make more. <A> This is documented in the Arduino input pins documentation , in the Pin Mapping section: <S> Pin mapping <S> The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. <S> For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH: <S> pinMode(A0, OUTPUT); digitalWrite(A0, HIGH); <A> The analog pins on the Arduino can be used as digital pins, as pointed out by Anindo Ghosh. <S> However, even if you run out of pins to control your stepper motors, you dont really need to buy another board. <S> You can simply use an intermediate component such as a register or a multiplexer to control the appropriate stepper motor. <A> If you can afford it, and you really want to make working with a stepper super easy check out Easy Stepper . <S> I was very pleased. <S> From the example code page <S> http://www.sc-fa.com/blog/wp-content/uploads/2013/04/20130414-080645.jpg <S> Example 1: <S> Basic Arduino <S> setupThis is the most basic example you can have with an Arduino, an Easy Driver, and a stepper motor. <S> Connect the motor's four wires to the Easy Driver (note the proper coil connections), connect a power supply of 12V is to the Power In pins, and connect the Arduino's GND, pin 8 and pin 9 to the Easy Driver. <S> Then load this sketch and run it on your Arduino or chipKIT: <S> void setup() { pinMode(8, OUTPUT); pinMode(9, OUTPUT); digitalWrite(8, LOW); digitalWrite(9, LOW);}void loop() { digitalWrite(9, HIGH); delay(1); digitalWrite(9, LOW); delay(1); } Also from the same page, here's some example code to run two motors with two easystepper boards, with acceleration/deceleration: <S> http://www.sc-fa.com/blog/wp-content/uploads/2013/04/20130414-081018.jpg #include <AccelStepper.h>// <S> Define two steppers and the pins they will useAccelStepper <S> stepper1(1, 9, 8);AccelStepper stepper2(1, 7, 6);int <S> pos1 = <S> 3600;int pos2 = 5678;void setup(){ stepper1.setMaxSpeed(3000); stepper1.setAcceleration(1000); stepper2.setMaxSpeed(2000); stepper2.setAcceleration(800);}void loop(){ if (stepper1.distanceToGo() == 0) { delay(500); <S> pos1 = <S> -pos1; <S> stepper1.moveTo(pos1) <S> ; } if (stepper2.distanceToGo() == 0) { delay(500); <S> pos2 = -pos2 <S> ; stepper2.moveTo(pos2); } stepper1.run(); stepper2.run();} <A> Adding as answer, because can't comment. <S> To answer briefly, yes you can. <S> Please refer to Anindo Ghosh's Answer on how to do so. <S> Please Note however <S> that for the Arduino Nano , pins A6 and A7 are analog only and cannot be used in the digital mode.
Yes, the analog pins on the Arduino can be used as digital outputs. It is not necessary to get another Arduino.
How can I safely connect both Arduino and a 120V 10A circuit? I'm building a thermostat, and the idea is to have it fire one of two 120V 10A circuits (one to heat, one to cool). I have two of these modules for the relay and I understand how to connect both of them. Here is a picture directly from the site I purchased it from : However, I still have a couple of questions: Is it safe to connect from an Arduino pin directly to the signal pin on this block or is there some way I should be 'protecting' the Arduino? I eventually want to put this whole project in a single box and hopefully only have one power cord going to it. What's the safest way to power both the Arduino and the 120V 10A circuits (note that only one of the 120V 10A circuits would ever be on at a given time;never simultaneously)? <Q> As Kevin commented, you can connect them to an Arduino directly providing they're using the same logic voltage. <S> There's no harm in connecting the Arduino directly to the relay control, as the control will be isolated from the rest of the relay. <S> Theoretically, you could pass a high enough current to cause the gas inside the relay to ionise and cause electrical arcs, but at that point I'd be worried for your safety, not the Arduino's. <S> EDIT: <S> In response to question 2, I doubt you could use just one power cord - you would need one connected to a 120V, 5A (600W) source, and one to a low current one. <S> The exception to this would be if you used a modified ATX Power Supply - this would supply 600W <S> (and so could be transformed to the correct voltage), and also has 5V logic lines which could power an Arduino - this has been done successfully in the RepRap 3D Printer . <A> An approach I have used with such situations is thus: Bring the power line (220 Volts AC in this case) connection into my device enclosure, typically via a power connector like the ones at the back of a desktop PC power supply: The type that the power cord connects to: <S> Power the Arduino with a USB cable from the charger Wire <S> the mains power to the relay and then out to a regular shaped 3-pin wall socket also fitted on the enclosure Plug the mains powered device I need to control, into this 3-pin socket. <S> By using two different types of sockets on the enclosure, it is ensured that the power cords aren't plugged into the wrong ports. <S> The things to check before selecting the USB charger to use: <S> The actual voltage output by the charger. <S> Good brands deliver a nice stable 5 Volts DC, +/- <S> 0.1 <S> Volts or so. <S> Some OEM chargers and "fake" clone chargers deliver far higher, or very unstable voltage even though their output connector is USB. <S> This can damage the Arduino <S> Whether the charger is isolated or not: Again, the big brand genuine chargers all are, unbranded ones might not be. <A> Is it safe to connect from an Arduino pin directly to the signal pin on this block or is there some way I should be 'protecting' the Arduino? <S> It's a relay, and the signal circuit is physically separate from the switching: <S> The coil is connected to the signal, and the magnetic switch terminals (A,B,C) are connected to the 12V system. <S> While the parts may be close, there is a very little chance of these two systems coming in contact through the relay. <S> However, be very careful about placing the relay board on any conducting surface <S> (For that matter, don't do that with the Arduino either, you can easily burn it out) <S> I eventually want to put this whole project in a single box and hopefully only have one power cord going to it. <S> What's the safest way to power both the Arduino and the 120V 10A circuits (note that only one of the 120V 10A circuits would ever be on at a given time;never simultaneously)? <S> Nothing wrong with keeping high-voltage circuits in the same box, just be careful about the insulation. <S> Also, 120V 10A is a bit much, you may want to use thick wires.
Basically, as long as you're careful when dealing with high currents, then you and your Arduino will be fine. Put one of the really tiny mobile phone USB wall chargers inside the enclosure, plugged into a 2-pin socket inside: I had several spare HTC chargers, which work great.
Would Arduino be an appropriate platform to teach high school students? To teach students about electrical engineering, would the Arduino be a good fit? Or would it be more appropriate to teach them the theory with simulators, or something else completely? <Q> Given the relative inexpensive cost of the arduino and all of its available variants, I think it's a perfect platform. <S> What we're finding is that when learners are engaging more of their senses during the act of learning, they're more likely to integrate the concepts. <S> Since the arduino really connects the physical world to the digital world, it's awesome for cementing the abstract skills of programming an LED to turn on with code, and actually seeing it happen in real life. <S> Please do. <S> You can get them at Radio Shack now, and they're well within reach cost-wise. <S> Also: open source and cross-platform. <S> The Arduino is a winner all the way around for beginners. <A> Yes, it's a good platform. <S> The only better newbie platform I can think of is NXT -- but that is expensive and is an intro to robotics , not electronics . <S> Arduinos are insanely easy to use if you understand a bit of programming <S> (the amount of programming required to code Arduinos at a basic level can be taught in an hour or less. <S> Compare this to just letting them make simple circuits (boring), or having them work with a bare microcontroller (scary). <S> Simulators work as well. <S> But simulators are even more abstract, and a student will find it hard to relate with one. <S> On the other hand, arm the student with an Arduino and a multimeter, and they'll be able to relate to the system much better. <S> While this seems like a hollow point, "being able to relate to the system" for topics like programming/math/EE is quite important. <S> Students new to the topic just see the system as something abstract, and can't relate to it. <S> Till they are able to relate to it, they'll always have trouble understanding it. <S> Again, Arduino is really, really easy to catch on to. <S> I've seen a batch of ~600 students learn basic Arduino (enough to make a radio-controlled bot) just from a couple of sessions. <S> There's an abundance of online materials, and it's quite easy to catch on to. <S> Go for it! <A> Personally, I think Arduinos are an excellent platform for teaching Electrical Engineering. <S> The 6th form electronics at my school makes good use of Arduinos, as you can use them both for the micro-controller side of things, and for the discrete components attached. <A> Simulators simply can't do justice to learning electronics. <S> For example, you have to understand how to properly setup the simulation and then how to interpret the results. <S> Tools like the java-based Falstad circuit simulator is a bit easier to use ( http://www.falstad.com/circuit/ ), however, I would imagine high school students would rather see a LED flash. <S> If you use a simulator to simulate the firmware of a microcontroller, you might as well just teach programming on a PC. <S> One option is to use the Ruggeduino: http://ruggedcircuits.com/html/ruggeduino.html . <S> The designer made it with education in mind. <A> I started using Arduino's during my first year of college <S> and I enjoyed using it. <S> Using it as a tool to teach high school students would be great. <S> It would be a much better alternative than using a simulator. <S> Arduino is relatively inexpensive platform and is easy to use. <S> Many students will be able to grasp concepts and use it effectively. <S> There seem to be some examples of teachers using Arduino boards in high school. <S> Also, there is a Introduction to Arduino comic under development which will help with the teaching process. <S> Demonstrations and small projects will be the best way to go about engaging the students and who knows, you might inspire some of them to create something awesome!
A student can be taught a lot of electronics using an Arduino, and have fun in the process as well. Tools that simulate circuits tend to be very limiting to someone who doesn't have a full understanding of electrical engineering.
What are the most common ways to fry an arduino? I've fried two Arduinos before: one was an Uno, which I killed with too high of an input voltage, and the other was the ADK version of the Mega, which I never was able to conclusively determine what went wrong. This got me thinking: what are some things (perhaps not immediately obvious) that will damage Arduinos? <Q> Some I can think of that people have done... Connecting more than 6 volts to the 5V pin. <S> (The two ATmega chips used on most Arduino boards have an absolute max of 6V .) <S> Connecting more than <S> VCC (typically 5 volts) <S> to any of the I/O pins. <S> Not current limiting the I <S> /O pins to less than 40mA . <S> (E.g. driving a motor directly or not using a current limiting resistor with a LED) <S> Vin and Barrel jack do have a protection diode, but it isn't always enough. <S> Connecting a 5 volt supply to the 5V pin while connected to USB. <S> Changing connections while powered -- never do this! <S> Not using flyback diodes with inductive components like motors, relays, and solenoids. <S> On the Uno and Mega2560 boards, which use an ATmega8u2 or 16u2 for the USB to Serial converter, it seems like whenever someone accidentally connects <S> 12V <S> to an I/ <S> O pin it gets blown. <S> I don't fully understand why, but it seems like a trend. <A> Here's a list that I referred to in my previous answer . <S> There's some information on pin current limits here , as well as a specific current-related problem here . <S> Connecting more than 6V to <S> any of the pins. <S> If you want to use more power, use an H-bridge type chip like the L293D. <S> The RESET pin can take up till 13V, though. <S> "The <S> Perry Bad Journalism S" <S> Shorting two GPIO OUTPUT pins when one is HIGH and one is LOW Using +5V to power the Arduino instead of Vin/USB. <S> This is actually OK, but only as long as you do not: Put any load on Vin <S> Do this with the jumper set on USB <S> The 5V pin is not as protected as the Vin pin, and can end up destroying things. <S> Shorting anything but 0V to GND. <S> Connecting more than Vcc to any GPIO pin (generally this is sort of safe till you go above Vcc+0.5V). <S> Changing connections while the Arduino is on: It's very easy to accidentally short something. <S> Switch polarities of Vcc and GND (This happens quite often when the power jack is soldered backwards.) <S> (This pin is for output , not input) <S> Finally, make sure you don't keep your Arduino on a metal surface, and try to keep it free from dust and moisture. <S> Make sure there's nothing lying around in the same compartment as the Arduino which can end up shorting something. <S> While making a robot, it's quite common for metal shavings to get into the board. <S> Be sure to leave it well-covered when cutting things in situ. <A> According to Ruggedunino , here are the top ten most common ways to destroy your Arduino: <S> Shorting I/O Pins to Ground <S> Shorting I/O Pins to Each Other <S> Apply Overvoltage to I/ <S> O Pins <S> Apply External Vin Power <S> Backwards Apply <S> >5V to the 5V Connector <S> Pin Apply >3.3V to the 3.3V Connector Pin Short Vin to GND <S> Apply 5V External Power with Vin Load <S> Apply >13V to the Reset Pin Exceed Total Microcontroller Current <S> You can find the list and the fixes here . <S> Also, if you are very concerned, they came out with an Arduino Uno clone that protects against these things, but it is $40 plus shipping. <S> Some [non-common but funny] ways to destroy your Arduino <S> (Do not attempt at home): <S> Attach it to a model rocket or fireworks <S> Put it in a pool <S> Hit it with a sledgehammer <S> Throw it off a cliff <S> Light it on fire <S> (assuming you douse it in gasoline first) Hook it up to AC mains <S> (Well you get the point.) <S> Conclusion: <S> If you double check your connections and don't do anything stupid like don't use a resistor when you should, then you should be fine. <S> Plus, if you don't know if it will damage your board, you can pick up a cheap Arduino clone on eBay to test it out and then transfer (if you want to use the official board because... <S> well you want to support the foundation <S> and/or you like the name brand boards.) <S> Good luck not damaging your board! <A> One common way to mysteriously kill electronic devices is static electricity. <S> Modern devices have some built-in protection against ESD, but if you get shocked every time you leave your chair, then sitting in that chair while tinkering with Arduino is not the smartest idea. <S> Another (equally mysterious) danger comes from using badly insulated solder irons. <S> If you solder while the iron is plugged into the mains, it could leak small current into any circuit you touch it with. <S> Usually, we're talking about micro-amperes here, so you may never notice it, but it might be enough to damage delicate CMOS transistors. <S> The solution is to disconnect any expansion boards (shields?) <S> before you solder on them.
Expanding on it: Overloading a pin: If you try to power a device with a high power rating via the Arduino GPIO pins or the Vcc/GND pins, you are in danger of burning out the pin or the entire board. Connecting less than 5 volts to GND and GND to Vin or 5V (reversed power). Shorting a GPIO pin set on OUTPUT, HIGH to GND, or one set on OUTPUT,LOW to Vcc Apply something other than 3.3V to the 3.3V pin. Put it out in the rain with a huge metal pole that will attract lightning and get it wet
Which board is the best fit for my project? I am designing a device that will have an accelerometer and temperature sensors. This device is intended to record patterns in activity of individuals throughout the day. The device will need to operate throughout the day, and should be able to withstand a lot of movement, possibly small weights and generally rough usage. It also needs to be small enough to be carried on a person, possibly latch onto backpacks and fit into pockets or latch onto the belt loops (not sure of the term?). Which device would best suit my requirements ? Looking around a bit, it seems the Lilypad is the only Arduino that is small enough. Are there other choices ? <Q> For size and very low thermal profile, look at the FemtoDuino : <S> The new design has on-board USB. <S> Also, the board is so small that pressure / rough use stresses are not a big concern. <S> However, the headers are not the standard 0.1 inch type (obviously), in order to fit everything into that tiny form factor. <S> This isn't an issue for a custom project, I suggest. <S> It is, however, insufficiently specified for the sensors the question mentions - not enough pins exposed. <A> Another alternative is the RFduino , currently (10-Apr-2013) in pre-order after a successful Kickstarter funding campaign. <S> It looks like it has the size you need, and it has Bluetooth integrated, which many people expect their fitness devices to have for syncing (see: Fitbit). <A> Looking at the modest input requirements, the Digispark (~$9) might be a suitable fit. <S> It uses standard size headers, plugs directly into the USB port, and is based on the ATtiny <S> so it has 6 I/ <S> O pins available. <S> Although they produced laser cut acrylic cases as part of their Kickstarter , I can't find them for sale now. <S> They also produce proto shields for it <S> (~$3) <S> : On the other hand, the TinyDuino is a full ATmega328 <S> (Arduino Uno chip), with a coin cell clip built in for power and mounting holes . <S> The drawback to this option is that it is ~$20 and you also need a programmer module for ~$17. <S> The protoboards are about $4 each, and 3 options provide different pin spacing on each board. <A> If you are going to do any heavy lifting in the CPU, the Teensyduino 3.0 is an ARM based, 32 bit, Arduino API compatible board that is quite small and less than $20. <S> Has a number of breakout boards, including an SD card interface which might prove useful if you are logging a ton of data. <S> http://www.pjrc.com/store/teensy3.html
There is also the LilyTiny , quite small, and specifically designed as a wearable Arduino like the LilyPad, but with limited functionality compared to the FemtoDuino.
How should I light up all the LEDs? I am working on a 4x4x4 LED cube. I have connected all the negative terminals of LEDs in a horizontal layer to each other, and am using one Arduino pin per layer. I have connected all the LED positive terminals of a vertical column together and am controlling each column via a pin. So, 16 pins used for columns and 4 pins used for horizontal layers. The pins are directly powering and sinking the LEDs. From my calculations, I can turn on atmost 16 LEDs at one time before reaching current limits. So, if I want to light up all the layers simultaneously, without burning the board, how should I go about it ? <Q> Best way to do so is multiplexing . <S> That's the way your Monitors / Displays (cellphone, laptop and so on) work. <S> I would also recommend shift-registers (as I wrote in this topic ) <S> Hope that helps! <A> Generally speaking these led cubes use persistence of vision and multiplexing to minimise the number of wires and digital IO pins for a given size of cube, but in your case you can also use it to reduce the overall current drawn by the cube. <S> Instead of just turning a LED on or off, you would flash the led many times per second to provide an apparently continuous brightness but at a much lower current draw. <S> For instance, if you can continuously power 16 LEDs but need to power 64 LEDs then you can do so if you have a duty cycle of 25%. <S> Each LED will be powered on for a quarter of the time and powered off for three quarters of the time, so it will be 1/4 of the brightness of the continuously powered LED but also consume only 1/4 of the power. <S> At 2ms (125Hz) few people would notice the flickering, even out of the corner of their eye. <S> For more information, take a look at the wikipedia page on Flicker fusion threshold . <A> The Texas Instruments <S> TLC5940 <S> is another way to easily drive LEDs from the arduino. <S> You can apparently daisy chain up to 40 of them together. <S> There's so much good information on the arduino playground page. <S> Please go check it out. <S> Here's one example from an arduino forum user named saeveritt <S> that illustrates an idea of how the wiring diagram would look. <S> Do follow the links to learn about how to power this many LEDs using this technique. <A> I would think that with an appropriate number of transistors you could switch things without having to sink all the LED current through an Arduino pin. <S> You don't indicate your power source, but I would do it powering the LEDs direct (not through the Arduino) and using the Arduio to flip transistor switches.
If you can cycle between the 4 planes every every 5ms (50Hz) then depending on how bright the cube LEDs are people looking directly at the cube probably won't notice the flickering, but anyone looking elsewhere will probably notice the flickering out of the corner of their eye.
How can I control more than 64 LEDs using a Uno? I finished working on my 4x4x4 LED cube. I want to make a larger 6x6x6 cube. Is this possible ? Which components should I use to control the LEDs ? <Q> Try out shift registers. <S> These should give you the ability to address some more LEDs. <S> There are several videos on Youtube describing the functionality of shift registers <S> Note <S> : On Arduino there are already functions to "shift out", etc. <A> An alternative to shift registers or LED drivers is Charliplexing . <S> Charliplexing allows you to control n^2-n LEDs using only 'n' pins. <S> For a 6x6x6 cube, you need 216 LEDs. <S> Using 15 pins gives you 210 LEDs (15^2 = 225; 225 - 15 = 210), just short of what you need. <S> You'll have to go with 16 pins which is not a problem on the Arduino (there are 18 IO pins available). <S> This would allow you more LEDs than you need (240 vs. 216) <S> but you can simply not populate the extra positions. <S> Charliplexing requires less hardware <S> but it is certainly more complex. <S> Also, you have to rely on POV (persistence of vision) if you want to light multiple LEDs simultaneously. <S> Therefor, it might not make sense for your particular project depending on your desired usage of the cube. <S> This article from Uzimonkey's blog talks about Charliplexing on an Arduino. <S> He includes a good discussion on calculating resistor values at the end of the article. <A> That goes slightly beyond the 216 LEDs in the 6 x 6 x 6 cube, but the small overflow can be easily handled the conventional Arduino way, through shift registers or LED drivers attached to the RainbowDuino. <S> RainbowDuino sample sketches show how each individual LED can be written to. <S> If you need to access individual LEDs and not connect them as described above, a separate Extension Board is available which has break-outs for all 192 individual channels. <S> The entire LED cube would thus be updated by relying on persistence of vision (PoV) , i.e. with their refresh rates being faster than around 25 times per second, just like cinema or television work. <S> Using current-regulated, latching LED outputs such as offered by the RainbowDuino allows the PoV refresh code timing to be far less challenging than if shift registers or Charlieplexing code were to be used within your Arduino sketch. <A> The Texas Instruments <S> TLC5940 <S> is another way to easily drive LEDs from the arduino. <S> You can apparently daisy chain up to 40 of them together. <S> (40*16 LEDs) <S> There's so much good information on the arduino playground page. <S> Please go check it out. <S> Here's one example from an arduino forum user named saeveritt <S> that illustrates an idea of how the wiring diagram would look. <S> Do follow the links to learn about how to power this many LEDs using this technique.
An Arduino clone that incorporates multiplexed Common Anode LED drivers ( MY9221 ) to drive 192 LEDs or LED strings. The RainbowDuino is an option: You would need to connect the anodes of the LEDs to the positive voltage rail, which in effect makes them a Common Anode matrix addressed via the cathode pins.
Maximum Current Draw on Vin Pin I don't want to damage the pins on my Arduino Uno, and I'm especially cautious of drawing too much current. I'm experimenting with a small servo motor (similar to this one ), and have connected the power line to the Vin pin on my Arduino. (I'm powering the Arduino via a 9v battery connected to the DC jack). I know the current limits for the digital ports (which are covered in this question ), but I haven't been able to find any current draw limit for the Vin pin. Is there a limit determined by the Arduino hardware? <Q> You can look at the schematic for the Uno to see for yourself. <S> Looking at that, you can identify the power pins (top right) and see that the Vin pin comes straight from Vin, without going through the MCU or any other chip. <S> Then, if you look towards the top you can see that the only thing separating Vin from the power supply is a single diode. <S> In short, there is nothing on the Uno that would limit the current draw of Vin. <S> This could cause the Arduino to reset (which is probably undesirable). <S> So just limit your current to what your power supply can handle. <S> Edit: As stated in comments, the diode and trace width are other limiting factors. <S> The diode is rated at 1 amp and the board traces can't handle much above 2 amp. <A> The Vin pin's maximum current is generally limited by the reverse protection diode, which is rated for 1A. While you didn't ask this question, you should keep in mind that those small rectangular 9V batteries are very lousy when it comes to current capacity. <S> They are only designed to provide small amounts of current, <30mA. <S> The Arduino board itself draws almost 50mA. <A> Well... learned this the hard way. <S> Max 1A
The only consideration is that you don't draw so much current that the voltage drops.
How to avoid SD Card and W1500 SPI mixup on the Ethernet Shield? In an answer Kevin Mark points to a solution/reason for the usage of the Ethernet shield together with the SD Card. The documentation says that SD Card and the Ethernet chip both share the SPI bus and that I have to set different pins on HIGH to tell the Ethernet shield to use the Ethernet OR the SD Card. How would such a solution look like? pinMode(4, OUTPUT);digitalWrite(4, HIGH);// Now I can use the SD Card?pinMode(10, OUTPUT);digitalWrite(10, HIGH);// Now I can use the Ethernet (W5100)?// Do I have to (re)set 4 to LOW?// Any possibility to use both at the same time?// Can I use the Ethernet/SD Card without the setting of pin 4 or 10?// Why is this missing on the official code examples? Is it really necessary? <Q> In SPI, the following connections are used: MISO <S> (Master In Slave Out) - a data line for sending data from the slave to the master MOSI <S> (Master Out <S> Slave In) - a data line for sending data from the master to the slave <S> SCK <S> (Serial Clock) - a clock generated by the master for clocking the bits on MISO and MOSI <S> SS <S> (Slave Select) - a data line from the master to a particular slave. <S> There is one SS for every slave device. <S> MISO , MOSI , and SCK are shared between all the devices on the bus. <S> In your case, pin 4 is SS for the SD card interface while pin 10 is SS for the ethernet controller. <S> Your code should look something like this (untested code): #define SS_SD_CARD <S> 4#define SS_ETHERNET 10void setup() { // ... <S> pinMode(SS_SD_CARD, OUTPUT); pinMode(SS_ETHERNET, OUTPUT); digitalWrite(SS_SD_CARD, HIGH); // <S> SD Card not active digitalWrite(SS_ETHERNET, HIGH); // <S> Ethernet not active // ...}void <S> scCardCode() { // ... digitalWrite(SS_SD_CARD, LOW); // <S> SD Card ACTIVE // code that sends to the sd card slave device over SPI // <S> using SPI.transfer() etc. <S> digitalWrite(SS_SD_CARD, HIGH); // <S> SD Card not active // <S> ...}void ethernetCode <S> () { // ... digitalWrite(SS_ETHERNET, LOW); // <S> Ethernet ACTIVE <S> // <S> code that sends to the ethernet slave device over SPI <S> // <S> using SPI.transfer() etc. <S> digitalWrite(SS_ETHERNET, HIGH); // <S> Ethernet not active // ...} <S> You should make sure that 4 and 10 are not low at the same time because that would cause the same data to be sent to both slaves--BAD. <S> Your library probably handles setting 4 & 10 low and high at the appropriate times. <S> However, there may be methods that leave one of them low until another method sets it high. <S> During that period, you should not use a method for the other device. <S> It's possible for the library to handle cases like this, but since your bug seems to be known, it obviously does not do it well, if at all. <A> This adafruit wiki page seems to have a decent example. <S> The only reference I see to the pin 4 and 10 stuff in the code is setting pin 10 to HIGH once on init. <S> pinMode(10, OUTPUT); <S> // set the SS pin as an output (necessary!)digitalWrite(10, HIGH); // <S> but turn off the W5100 chip! <S> I assume the Ethernet and SD card libraries handle it from there. <S> Be sure to check out that entire page. <A> If you are using both peripherals in your program, this should be taken care of by the corresponding libraries. <S> If you're not using one of the peripherals in your program, however, you'll need to explicitly deselect it. <S> To do this with the SD card, set pin 4 as an output and write a high to it. <S> For the W5100, set digital pin 10 as a high output. <S> The above answer solves the problem but there are no examples on the standard libraries how to use both functions in order to use Ethernet and SD for Datalogging as an example.
There is a hint on http://arduino.cc/en/Main/ArduinoEthernetShield Note that because the W5100 and SD card share the SPI bus, only one can be active at a time.
Oscilloscope noise reduction when measuring IC voltage I am trying to monitor the voltage of an IC. The supply voltage of the IC is 3.3V and clock frequency is 24MHz. Here are some parameters for the channel used for measuring voltage: vertical scale to 50 mV/div, the offset to 150 mV, and enable 20MHz BWL,Sampling rate is 2Gs/S 200ms. I get some samples. The shape looks like what I expect when observing by eye. However, when I use my computer to process the data (extract certain property from the waveform), I did not get what I expect. I doubt if there are too much noise in my set up. I mean the waveform looks right by eye, but have some problem when I do the accurate processing from the computer. How do I determine how much noise I have? What are the ways I can try to reduce the noise in this experiment? This is the oscilloscope waveform This is the captured waveform plotted from my computer. <Q> Here are some parameters for the channel used for measuring voltage: vertical scale to 50 mV/div, the offset to 150 mV, and enable 20MHz BWL , Sampling rate is 2Gs/S 200ms. <S> Don't enable 20MHz <S> BWL - this may be telling lies about what you are seeing on the scope - the captured data may be unfiltered. <A> By "process the data" I'm assuming you mean dumping the data points collected by the oscilloscope to a CSV or other text format and then analyzing them on a computer. <S> To figure out how much noise you have, you would calculate the Signal to Noise Ratio (SNR) : $$SNR = \dfrac{\mu}{\sigma} = \dfrac{mean}{std. <S> dev.}$$ <S> If you're processing your data on a computer, programs like Excel or GNUPlot can easily calculate the mean and standard deviation for you. <S> From the Wikipedia article (specific to image processing but generally applicable): <S> The Rose criterion (named after Albert Rose) states that an SNR of at least 5 is needed to be able to distinguish image features at 100% certainty. <S> An SNR less than 5 means less than 100% certainty in identifying image details. <S> This is probably what you're oscilloscope is doing before presenting you with the data on the screen. <S> On something like the Tektronics DSO/MSO series, there are various functions to change the amount of post-processing it does before showing the data on the screen. <S> Alternatively (or in addition to) you can try to shorten up the ground on your oscilloscope probe. <S> See the following Q&A for a good discussion with lots of picture on what you need and what the results are: What is the name of this springy type oscilloscope probe accessory? <A> In order to determine how much noise you have on Vcc, do a popper measurement and read of the Vpp. <S> Sounds simple, right? <S> And maybe you already did that. <S> The best paper I know of that describes how to do this measurement <S> is this one: http://www.electrical-integrity.com/Quietpower_files/Quietpower-21.pdf <S> In short: Use a coax cable soldered directly to your board. <S> Run the 50R coax into your oscilloscope set to 50R input impedance. <S> Select AC-coupling. <S> A bandwidth that is adequate (minimum 500 MHz). <S> And infinite persistence. <S> If you made your measurement using a high impedance probe with a long "pig-tail" for ground - you may have extra noise not related to your Vcc noise picked up. <S> When in doubt, always do the null-experiement: touch the probe tip to the ground point, so both tip and ground of the probe touches the same point on the board. <S> If you don't get a flat line, something is being picked up by inductive coupling into the loop formed by probe and ground lead. <S> Provided your measurement is done reasonably well <S> , your noise is about 200mVpp (read from the oscilloscope, why your computer plot shows about 100-something <S> you have to read about in the manual of your equipment). <S> How to reduce noise? <S> Well if you are talking about reducing error in the measurement, you should follow the above ideas. <S> If you are talking about reducing the noise on the Vcc itself there are a number of techniques. <S> Search PDN design to learn a lot more about power planes and bypass capacitors. <S> Your next question may be: Is 200mVpp too much? <S> Well since I don't know what parts you are using, let me go by example. <S> Suppose the datasheet of this device calls for 3.3V +/-5% for the Vcc supply. <S> You have +/-165mV as the limit. <S> Let's assume you have a 2% accuracy of your DC regulator. <S> And let's assume you have a 0-1% distribution drop in the connections between the regulator and the device (cables, connectors, traces, filters etc.). <S> That leaves 2% to the AC-noise/ripple or +/-66mV <S> (132mVpp). <S> In this example you have too much noise - if your measurements are done right. <S> Did I answer your questions?
In order to reduce the noise, you can do some post-processing on the data such as averaging or filtering.
Difference between reading PORT and PIN What is the difference between reading PORTA and PINA?What is the relation between a port and its pins?I'm really confused!!!sample of reading PORT:(reading pin is not useful here) Assemblyf=1MHZATmega8I need to complement PORTB every 1ms.(Dutycycle=50%) LDI R16,$FF OUT DDRB,R16 MAIN: LDI R16,00 DELAY:CPI R16,200 BREQ LOOP INC R16 RJMP DELAY loop:IN R17,PORTB COM R17 OUT PORTB,R17 OUT R17,PORTB RJMP MAIN <Q> PORT is the OUTPUT buffer, PIN is the INPUT buffer. <S> When you want to set the pin to a "high" or "low" voltage, write to the PORT register. <S> The bits of these registers represent the corresponding pins of the general-purpose input/output port. <S> Here is a simplified schematic of the electronics inside the AVR connected to a single pin <S> (go here for complete datasheets). <S> This circuit block is repeated for each pin. <S> Eight of these form a port (port A, for example). <S> Starting at the left-most square (which represents the physical connection to the outside world), you can see three paths: <S> The upper-most path is the software selectable pull-up resistor <S> The middle path is used when the pin is configured as an output <S> The lowest path is used when the pin is configured as an input <S> It should be noted that some or all of this circuitry can be bypassed when the pin is shared with an internal peripheral. <S> For example, the Analog-to-Digital Converter (ADC). <A> I agree with DrFriedParts answer completely, however, I do want to add that, you can indeed read PORT to find out whether the port/pin is configured as OUTPUT high or low (when DDR = 1 , port/pin configured as output) or whether the internal pullup resistor is activated (when DDR = 0 , port/pin configured as input). <S> In this way a port port can be used (in a rather silly way) as general storage or to pass information about the state of the output/input pullups, as in the following scenario Perhaps one part of your program writes something to ports or activates/deactivates pullups, and the other part of the program reads PORT to find out how it is configured. <S> Reading PORT immediately after writing PORT does not make sense: having written to PORT , you know what the value of PORT is. <A> For your purposes, reading from PORT actually makes sense: The pins in question are output pins, and you simply want to read the last value you wrote, toggle it, and write it back. <S> So you’re using the port register as a byte of externally observable RAM. <S> On the other hand, for this particular app, you could simply just keep the value in a register and wouldn’t even have to read back the PORT register.
When you want to know what voltage is currently presented to a pin, read the PIN register.
How does a computer (or USB device) detect that there is a new/lost connection? I have two computers, a USB keyboard and a USB mouse. I want to build something that lets me switch the USB devices between the two computers. My approach would be to buy a new powered USB hub and plug the keyboard and the mouse into it. Then, I would use a microcontroller to control transistors for the DATA- and DATA+ lines to the two PCs (so four transistors total). I would just short all the GND wires (from the powered hub and the PCs) – that shouldn't do any harm, right? – and leave the +5V wires from the PCs unconnected. As far as I can see, that should work fine for switching. However, how would the PCs (or the powered hub?) know when to do a new handshake and so on? Is it sufficient to have the +5V wire to the USB hub high by default and pull it to GND while switching? Would the USB hub initiate a handshake or something when its USB +5V wire goes up? Also, how would the other PC find out that it has just lost the connection? By checking whether there's a voltage between Data+ and Data-? <Q> What you're looking for is called a "KVM switch" (keyboard, video and mouse), you just don't need the video part. <S> These are commonly available and easy to find once you know the correct term. <S> But to your specific question about USB enumeration: Every USB device has a pullup resistor on one of the Data lines (one for low-speed devices, the other for all others). <S> A USB host or hub recognizes the presence of this resistor and initiates enumeration when it appears. <A> USB uses polling to enumerate, and detect when a device is lost. <S> If the usb slave device does not respond in a certain time frame, the usb connection is lost, even if the device is not unplugged. <S> See usbtiny and v-usb for software usb implementations for the amtel brand microcontrollers. <A> It has 2 <S> x SPST switches to switch the data lines between two ports. <A> As you most certainly know, USB uses two data lines, D+ and D–, in differential mode (that is, they switch opposite to each other). <S> The USB host controller has 15kΩ pull-down resistors on both these data lines, pulling them low when nothing is connected. <S> When you connect a device, you are supposed to pull [i]one[/i] of those data lines up with a 1.5kΩ resistor, which overpowers the 15kΩ one and pulls that particular data line up, and the host controller uses this to notice that the device has been connected. <S> This also tells the controller whether it is the low-speed device (if the D– data line is pulled up) or the full-speed device (if the D+ data line is pulled up). <S> Or in short: the "plus" one is faster, the "minus" one is slower ;) <S> (USB 2.0 uses some more complicated "chirping" signal to indicate that it is a high-speed device.) <S> Bringing both data lines down usually means end of transmission, or "over and out". <S> The host controller is the bus master here, so it initiates all data transfers and polls the devices. <S> Devices are not allowed to speak unless the host asks them with a request. <S> (There are a few exceptions, e.g. waking up from power saving mode etc.) <S> So the host controller is constantly communicating with devices, sending them request every 1 millisecond (or faster for high-speed devices), so called "frames". <S> If a device does not respond to any requests for a while, and its data lines are both low, it is considered to be disconnected.
You can use a FSUSB30MUX.
transformer for power supply i bought this transformer to use in a power supply http://www.dhwelectronics.com/Safety_Isolating_019000600020/P028_1A_Secondary_30VA_Transformer_With_15015_Vac_Ouputs/ i want to have two outputs but as there is only three wires was wondering do i have to cut into the transformer to add a fourth wire or can i solder that wire onto the strip board and then branch a wire off from there ? <Q> The transformer is wired as follows: <S> simulate this circuit – <S> Schematic created using CircuitLab Notice that the two 15V wires are 180° out of phase, resulting in a 30V(AC) between the outer two windings and 15V relative to the middle wire. <S> You mustn't cut the transformer's insulation as that is a safety hazard. <S> The two 15V wires share a common ground (0V) wire, you cannot change that. <S> You do have several choices how to use them, but to answer that you have to elaborate in your question on what your goal is. <A> The transformer has one secondary which is center tapped. <S> That is why there are only 3 wires. <S> The voltage across the entire secondary is <S> 30 VAC and the voltage from the center tap to each of the other wires is 15 VAC. <A> This is what the OP wants to do: simulate this circuit – <S> Schematic created using CircuitLab <S> So, yes, you add another wire to the center tap, to be used on both supplies. <S> You must realize that the two supplies share a common connection. <S> Whether that will be a problem depends on what you do with it. <S> If you treat each of the common wires as a "ground", you will be OK.
You can get two 15 VAC outputs but they will have a common connection, the center tap wire.
MOSFET as a switch? In the picture shown, can "Output" be controlled to be 0V or 12V based on "Control"? Will be Drain and Source the way it is connected be a problem? <Q> The transistor shown is a P-channel MOSFET acting as a "high-side switch". <S> More commonly, an N-channel MOSFET low-side switch is used, but what you have will work as long once you add something to the drain such as in this image of P-Channel MOSFET <S> switch from <S> http://www.electronics-tutorials.ws/transistor/tran_7.html : <S> When the control goes "HI" the MOSFET switch is "OFF. <S> " When the control goes "LO" the MOSFET acts as a switch, essentially shorting the drain and source. <S> While this is not entirely true, it is a close approximation as long as the transistor is fully saturated. <S> So the schematic you have shown can be used to switch 12V to something, but it will not connect the output to 0V unless a pull down resistor is used as shown in the above image. <S> The opposite control scenario works for an N-channel MOSFET: <S> LO control turns the switch off, HI control turns the switch ON. <S> However, an N-channel is more suited to be a "LO-side switch" connecting the output to ground instead of VDD as in this image of an N-Channel MOSFET switch: <S> IMPORTANT NOTE: <S> The red line from input to ground is simply a depiction of the input being shorted to ground to give a 0V input. <S> This would not be included in any physical circuit construction because it would short the input signal to ground, which is a bad idea. <S> The actual voltage level that determines if the FET is on or off is known as the gate threshold voltage. <S> So called "logic level gates" work at lower voltages common in digital circuits such as 1.8V, 3.3V, or 5V. <S> Although, crossing this threshold does not entirely turn the switch on or off, it merely allows the FET to start or stop conducting. <S> I should also add that it is pretty common practice to include a pull up resistor (10k or so) at the gate of the P-Channel MOSFET to keep it OFF in unknown states. <S> Similarily, a pull down resistor is used at the gate of the N-Channel MOSFET to keep it OFF in unknown states. <A> You are using a P-channel MOSFET as a high side switch. <S> That's fine. <S> The direction you have it wired in is fine. <S> As long as "Control" is 12V or higher, the switch will be "off. <S> " If it drops below 10V or so, the MOSFET will start conducting (exactly how much it needs to drop depends on the Vgs-threshold of the device.) <S> Typically, to use a logic-level control (0-5V or 0-3.3V) <S> you will use a pull-up resistor from gate to source (say, 1 kOhm or so) and a small-signal N-channel MOSFET between the gate and ground. <S> When the signal goes into the gate of the smaller N-channel MOSFET, it will open, and pull the gate of the P-channel to ground, and thus the P-channel will start conducting in the blocked direction. <S> (It always conducts the other direction, so don't switch the terminals!) <S> Once the gate of the small-signal N-channel goes to ground again, it will stop conducting; input voltage will pull the gate of the P-channel MOSFET up, and the P-channel will stop conducting. <S> Somebody asked for a schematic for the circuit for controlling this P-channel MOSFET with logic-level inputs, so I edited to add this: simulate this circuit – <S> Schematic created using CircuitLab <S> I couldn't figure out how to change the names of the components -- you typically want a signal transistor like a BS170 for the bottom N-channel switcher. <S> You can also tune the resistors for your preferred trade-off of current consumption vs fast switching (the current values are fairly aggressive for fast switching; 10 kOhm will often work fine)The ability of the output to be driven to 0V depends on the load. <S> If the load is purely capacitive, then you will need a pull-down resistor between output and ground, like Kurt shows. <S> An N-channel MOSFET, as Kurt suggests, only works if it's either on the low end, or if you use a bootstrap/charge-pump circuit to boost the voltage into the gate above the 12V source voltage. <S> N-channel as "high side switch" is only used if you make lots of your circuit (so the cost of P-channel matters) or the circuit is very sensitive to losses (so the lower Rdson of N-channels matters.) <A> In the picture shown, can "Output" be controlled to be 0V or 12V based on "Control"? <S> Yes, this will produce 12V when the control line is "low" and if you had a resistor to 0V from the drain, the output would be 0V when the control line is high (12V). <S> The control line needs to have, as a minimum 12V to turn the FET off (thus letting the resistor to ground pull the output to 0V), and somewhere between 11V and 6V (typical values and dependent on the FET) to turn the FET on. <S> Will be Drain and Source the way it is connected <S> be a problem? <S> No this won't be a problem
If the load will by itself pull the output down to 0V, then yes, this will be able to switch the output between 0V and 12V. The FET should be full saturated with the values noted in the datasheet to full turn ON or OFF.
Microphones disturbed by capacitance I've used several KE 4-211-2 Sennheiser microphones to assemble a device for acoustic signal analysis. They are connected to a National Instruments data acquisition device with ~1 m long cable and sampling rate is set to 50kHz. I've added a resistor and a capacitor as described here (2nd page). However after a start of data collection instead of clear acoustic signal I get strong disturbance looking like a step function in low pass filter. It obviously distorts my frequency spectrum. After investigation I found out that when NI device is not collecting data, capacitors charge slowly and start of collection probably results in dramatic drop of impedance on inputs. What might be a reason for this behavior and what should I do to make it work properly? I think there is everything on this picture <Q> I've used multi-channel NI analogue acquisition cards and they have a single ADC which can be programmed to connect to one of the mulitple-inputs by a multiplexer chip. <S> Channels not un-connected to the ADC will float high and, when that channel "connects" it will glitch. <S> You need a pull-down resistor on the inputs so that if there is leakage current from the mulitplexer, it has a path to ground. <S> Probably something in the order of 3k3. <S> It's easy to try and hopefully this advise works. <A> Data acquisition boards often do not have high input impedances when they are powered down. <S> Your board needs to be powered up. <S> A preamp between the mic and tha A/D might help, depending on the preamp. <A> simulate this circuit – <S> Schematic created using CircuitLab <S> One side or the other has the responsibility of implementing the DC return. <S> Without this, the current flowing from the input (which is arbitrarily represented here as an op-amp's + input), no matter how small (could be nanoamperes) will gradually charge the capacitor until the DC level at the + input is out of range. <S> Another way to look at it is that the input naturally has some arbitrary voltage bias, and by connecting a capacitor, the circuit will eventually reach that bias point, which is not in range. <S> The added resistor conveys the 0V voltage ground reference to the input, forcing it to be biased at 0. <S> Because the impedance of the input is high, that resistor can also be high, so as not to degrade the input impedance to an unacceptable level, yet it appears "stiff" enough to the input that it conveys the 0V impedance without an offset. <S> If a microampere of bias current flows through 100K, it's not a big voltage, in other words. <S> In your circuit, since you already have a 5K2 impedance and this is your wiring outside of the microphone, what you can do is double the resistor value and put two of them in parallel, but one on the other side of the capacitor. <S> simulate this circuit <S> 11K is a resistor value available in the E24 series .
Perhaps your circuit does not have a DC return path for the bias current that needs to into/out of the data collector's input:
What material should I use to insulate my MOSFET from a heatsink? I have a heat-sink and I want to put two FET's on it. I know I have to insulate it so the metal showing on it doesn't connect and create a path. Is there any good everyday material that would work? (ex. plastic bag) My packaging is TO-247 (irfp250/450) and I found 1 insulator laying around, but not 2 for both of them. So do I need to put the insulator on both MOSFETs or is one good enough? <Q> A common through-hole package for MOSFETs is the TO-220, where the metal tab looks like this from the back: <S> (source: Wikipedia ) <S> Edit: <S> OP clarifies that their MOSFETs are TO-247 packages, for which the TO-220 insulators can be used - or TO-247 ones possibly, though those don't seem to be sold as a distinct product much. <S> For these, mica insulator kits are available at extremely low prices, containing the washer itself, a nut, bolt, spring washer, and an insulating sleeve to isolate the bolt from the metal tab: ( source ) <S> Insulation is preferably done for each of the MOSFETs <S> you are attaching to a heat-sink, to avoid undesired short circuits. <S> You should also use a bit of heat-sink compound between the mica and the metal tab, as well as between the mica and the heat sink itself. <A> The modern alternative to mica and grease is the Sil-Pad products from Bergquist and others. <S> These are not very expensive and they're a lot more convenient to work with. <A> For very good thermal performance and isolation, go with Bergquist Hi-Flow . <S> It's phase change material that goes liquid-ish above 55C, filling whatever voids are necessary, plus it has a Kapton insulator in the middle to give you good dielectric strength. <S> It works best with clip-type connectors that hold constant pressure, otherwise you need to pre-bake the heatsink and torque down screws a second time once the material flows. <A> One more alternative to put out there: They are rare but at least one supplier makes MOSFETs with electrically isolated tabs. <S> IXYS sells these under the marketing name "ISOPLUS" but you can find more by googling "MOSFET ELECTRICALLY ISOLATED TAB". <S> These could bolt directly to the heat sink and, for anything being manufactured, could save a lot of time.
Depending on the MOSFET package, mica washers are an option.
Concurrent processes in MCUs Is it possible to achieve FPGA-like concurrent functionality on, for example, ARM Cortex-4? If I have a process which does time-sensitive calculations and at the same time I would like to listen for a button press. Even if I use interrupts for buttons, it will pause time-sensitive calculations for a bit to execute onPress function. I believe what I am asking is - how to simulate threads on hardware? <Q> FPGAs have concurrent execution not by threads, but by real parallel execution paths. <S> There may be some gates on one part of the die performing an addition while other gates on another part of the die are performing another addition. <S> Threads are one of many programming abstractions that make it seem as if a CPU can execute multiple tasks when really it can't ( multitasking ). <S> Regardless of what you do, be it cooperative multitasking, preemptive multitasking, interrupt (event) <S> driven processing, you will have to handle the reality that each CPU can do only one thing. <S> If you need to do something else, the thing you were doing must necessarily be interrupted or it must yield control. <S> If you truly need to do more than one thing, you need more than one CPU, or a CPU with multiple cores. <S> The problem then becomes balancing the need to do things now with the need to also do other things. <S> Real-time operating systems have been developed to address this problem. <S> Depending on the complexity of your problem and your needs, a RTOS may be overly complex, and you will just have to do what you can to minimize the impact of multitasking and interrupts on your program. <S> Usually this means setting appropriate interrupt priorities if the platform supports it, and keeping interrupt handlers quick to minimize interrupt latency . <A> On the Cortex you will have a single core / execution path so what you're asking isn't possible. <S> A seperate thread or or interrupt of any kind will delay execution of other tasks to some degree. <S> You may be able to optimize that to reduce the delay but it will always be present to some degree. <S> One option to consider is a seperate slave processor such as a cheap microcontroller that can handle button presses and similar time-critical tasks and then be polled from the main processor. <S> That could implement a simple serial protocol for example to retrieve events that have occurred since last time it was checked. <A> While PeterJ 's answer is almost entirely correct, there are a number of limited cases that fall outside of that generalization: in some very limited ways, your MCU does have ways of doing more than one thing at a time, but only if one of the things you need to do is built into the MCU's hardware: <S> The simplest example of this is PWM: most MCUs can produce square wave with certain characteristics while executing your code Similarly, if your MCU has hardware-support for SPI protocol, it can be sending a character while executing your code (for example preparing the next character so send) <S> Same thing applies to USART usage and other serial transmission or reception <S> The examples in datasheets usually do not take advantage of this fact. <S> For instance, for AVR, SPI examples look like this (pseudocode) <S> Loop: <S> Prepare byte of data <S> Write data to register Wait for send to finish <S> Go to loop <S> You can take advantage of the weak multiprocessing abilities by rewriting the code as follows: <S> Loop: <S> Prepare byte of data <S> Wait for send to finish <S> Write data to register <S> Go to loop <S> This way the data is prepared while it is being sent: almost like doing two things at once. <S> The same thing can be accomplished by using interrupts, however these generally have a large overhead, and as a result do not provide an advantage over polling code for relatively frequent events, at least on the AVR platform. <A> In addition to various other answers: You can disable interrupts during the time critical calculations, then the (button press) interrupt will be serviced once you enable them again. <S> Button presses aren't too time sensitive. <A> Check out the Parallax Propeller (www.parallax.com) <S> it has 8 independent processors each with a 2kB program space. <S> Any processor can access any of the 32 digital I/ <S> O pins and the 32kB of shared Hub memory. <S> Each prodessor (COG in Propeller speak) is capsble of interacting with the other COGs through the shared memory space. <S> It is programmable in it's native languages, Spin or PASM or C or BASIC or Forth. <A> To the above answers, I would add that the reason microcontrollers are so can do so much with comparatively small amount of circuitry is that in most designs there are relatively few things that truly need to be done "simultaneously". <S> If two tasks need to be performed simultaneously, then separate circuitry will be required for the two tasks. <S> The reason that even a simple processor can perform so many complicated functions is that circuitry only needs to be dedicated to a task while it is actually being performed. <S> The rest of the time, the circuitry may be used for other purposes. <A> Check XMOS and <S> their xCORE since they claim that " xCORE multicore microcontroller is able to run multiple real-time tasks simultaneously"
If, however, the tasks can be performed at discrete times, then it may be possible to have a single set of circuitry perform one task and then later perform the other. You wouldn't simulate threads on a Cortex -- you would just implement them, or more likely by selecting an operating system or library that has already implemented the functionality for you.
Why does the nichrome heat up? If I have a copper wire and a nichrome wire of the same gauge (e.g. 30 awg) with the same current passing through them. why does the nichrome heat up significantly. Also, the length of the wires are the same (e.g. 1 foot), the voltage is the same (e.g. 12 volts). The current is being varied by PWM. Question: What is it about nichrome that causes it to heat up so much? <Q> Nichrome wire has far, far higher resistance per unit length at a given cross section. <S> It's an alloy chosen for that property. <S> The power dissipated in a resistor is the product of the resistance and current, so a larger resistance at the same current means more power dissipated as heat. <A> <A> Nichrome is an resistive alloy. <S> It has very useful properties as heating wire: <S> high melting point <S> high resistance chemical inertness <S> non-magnetic good mechanical properties <S> The reason why it heats up more is high resistance. <S> In comparison to good conductors like copper - it is possible to transform more electrical energy into heat by using wire with same gauge and length at same current or voltage.
Nicrome wire has a high resistance, it has a high melting point and it can remain red hot for a long time without getting oxidized or 'burning out'
Is there a simpler solution for highside current sensing here? I have an existing automotive circuit simplified in the image. The loads (2 or more solenoids in parallel) share a 12V supply and are individually switched to ground through the car's ECU. I need to detect when any one of the circuits close (only one closes at any one time), using a single PIC digital in (or comparator if I must), and with the minimum of wiring (the car's wiring is buried and a pain to get to although the common 12V rail is easy to get to). I can't disturb the ground plane(s) and can't add much load. I have looked at highside current sense ICs but can't find them in DIP and don't want to use SOT if I can help it as I will be hand-soldering to stripboard. Anyway, I don't need to know how much current is flowing, just whether it is or not. There must be a simpler solution that I'm missing? <Q> D1 and D2 perform a OR function so that the bottom end of R3 goes low <S> when either or both switches are closed. <S> I would put D1, D2, and R3 close to where these switches are, then R4 by the PIC. <S> You have to assume the long line will pick up noise and transients, so R4 provides some impedance for D3 to work against to clamp the signal at the PIC to safe levels. <S> Added: <S> There is confusion as to whether or not you can get at the low sides of the loads. <S> My first reaction was that this would be the easy way to connect because you only have to monitor the voltage. <S> However, if it is really better to break into the high side power connection to the loads for some reason, then here is a simple way: <S> Again, R1, R2, SW1, and SW2 are the switches and loads that you presumably can't get into. <S> R3 is a current sense resistor sized to produce enough of a voltage drop to turn on Q1 when either of the loads is on. <S> R4 is just to limit current thru the base of Q1 to safe levels. <S> The long wire to the PIC board is intended to be between the collector of Q1 and the top of R5. <S> With the R5, R6, and Q2 receiving circuit, a lot of noise and nasty spikes can be tolerated on that line. <S> When Q1 is on, Q2 will be driven on, which will drive OUT low. <S> Th collector of Q2 goes directly to a PIC pin with a internal pullup. <S> Noise shouldn't be much of a issue here since R5, R6, and Q2 are intended to be on the same board close to the PIC. <A> If you can access the 12V side and, all you care about is any one-contact (or more) closing then possibly an opto coupler may work (although it will "lose" something like 3V including current limiting and diodes across the LED to protect the opto-diode from being over-stressed when more contacts close). <A> You can use the Analog Devices AD626 single supply Differential Amplifier available in a DIP-8 package ( $8.62 in single units at Digikey ) for high side current sensing. <S> The AD626 can handle 24 Volts common mode input if powered by 5 Volts, or 6 x (Vcc -1) per the supply voltage. <S> In case your device uses a 3.3 Volt supply rail, the CMR is +13.8 Volts, which may be somewhat borderline with a 12 Volt automobile circuit. <S> If expected current is significantly higher, then either a lower shunt resistance (thus lower heating issues) or reducing the gain to 10x would be preferable. <S> The linked datasheet provides a current sense schematic for the application: <S> Notes: <S> For sensing the two paths individually, two of these diff-amps would be needed, and these are not inexpensive parts. <S> Allowing for significant headroom in the output signal is suggested: As the purpose is solely to detect current flow, not to measure it, a small designed voltage level for the output would allow this headroom. <S> As other answers have pointed out, in an automotive environment, overvoltage clamping, fast flyback diodes and other precautions are a necessity. <A> simulate this circuit – <S> Schematic created using CircuitLab <S> This will produce 2.8V at the MCU input (e.g. designed for a 3V logic) when the switch is open and 0.0V when the switch is closed. <S> Please Note: <S> It will add about 1uA each (2uA total) continuous leakage to the system. <S> That should stay below the 10uA guideline I see typically used in automotive applications. <S> You should add a clamping diode if the load is inductive (relay, solenoid) <S> You should add a series resistor to the MCU input path to protect against the general automotive environment (voltage spikes) Hopefully, adding four passives <S> isn't too bad... <A> If you have physical access to the solenoids, you could mount a hall effect sensor to detect the magnetic field generated when the solenoid is energized. <S> This would require 1 sensor per solenoid, but it would be completely non-invasive, from the standpoint of splicing into existing wiring.
The Voltage Divider If you are looking for a simple solution above all else, you could just add two resistors, but they'll have to be very large: Overall, when a load is turned on, the PIC input will go low. The opto-coupler output will be a transistor that, with the appropriate pull-up resistor on the collector, will provide an input to your monitoring device. It therefore doesn't require breaking any connections, just tapping off existing connection points. As the part has a maximum gain of 100, a very small value shunt resistor would suffice to sense presence / absence of current: If expected maximum current is in the 0.5 Ampere range, then a 0.1 Ohm shunt resistor would provide a full-scale (5 Volts) output. Here is a simple solution: R1, R2, SW1, and SW2 represent the circuit in the car that you can't modify. This requires breaking the power connection to the loads and inserting R3, R4, and Q1.
Design a FPGA based Oscilloscope I want to design a little oscilloscope that is able to analyze signals up to 1 MHz using a Xilinx FPGA. I want use the VGA interface in order to display the signals. Is it possible obtain a good result using only FPGA and an external RAM for signal elaboration? Or is it necessary to use an external microprocessor? With the Xilinx ISE Webpack license I can't use the MicroBlaze softcore processor, but only the PicoBlaze. What is the better way to obtain a good result with a simple and cheap design? <Q> 1 MHz is slow enough that this should be doable without a FPGA. <S> Perhaps you may want to use a external A/D or sample memory, but orchestrating all that should be possible with just a decently fast microcontroller. <S> Some of the dsPIC 33F have built-in A/Ds that can sample at 1 MHz, if I remember right. <S> You don't typically need lots of bits for a oscilloscope, since the user will adjust the gain and offset to zoom in on what they want to see. <S> Entry level scopes don't have more than 256 pixels vertically anyway, so <S> obviously aren't showing more than 8 bit of information per sample. <S> The 10 bits <S> the internal A/D of a dsPIC <S> can do should be sufficient. <A> I think this is quite doable. <S> I'll assume you've selected a part with a built in ADC per channel that you want. <S> The architecture depends on whether you want to have a framebuffer or not; it will consume RAM but make it easier to debug. <S> Non-framebuffer designs would probably have a character generator ROM approach instead for numbers in the UI. <S> Either way, the key to getting it working nicely is not to involve the microprocessor in putting the trace on screen. <S> Each ADC should be connected to a ring buffer of the N most recent samples, where N is the number of samples across the width of the screen. <S> On the VGA vertical blanking interval, capture this to another buffer which will represent the set of samples to display. <S> You can then either translate them into pixels in the framebuffer; or generate a one-line framebuffer for each line of the display by scanning the sample buffer for any situation where there is a sample below the scanline next to one above the scanline. <S> (This might involve two different RAMs, one being written to by the ADCs and one being the display one, swapping roles every frame). <A> An oscilloscope is comprised of many parts, but what truly defines an oscilloscope's performance and utility is it's trigger circuits. <S> Being able to define when to start a sample, the conditions that are needed to capture an event beyond just sampling and displaying <S> really define/extend the usefulness of the instrument. <S> With line buffers and decision logic you can implement some non-causal filters and signal processing that can isolate out those certain events that truly help you debug. <S> It is after all those intermittent (perhaps even singular) events that make debugging very difficult. <S> While a sound card like (Sample and then display) system is where you should start at that should not be the end goal.
I would argue that if you truly wanted to build something special and useful that you really only have the choice of implementing an 'Scope of that sort of bandwidth in a FPGA.
How a Delta-Sigma Modulator Works Can someone explain in simple terms how a delta-sigma modulator works specifically for ADC applications? I've googled around and have been piecing it together but am still unclear on a few things. Most descriptions note an accumulator with a certain DC offset that affects ADCs oscillation but I don't understand what is being accumulated/what is oscillating/ what threshold these are referring to. <Q> I think the easiest way to start thinking about this question is to imagine a "perfect-in-all-other-ways" parallel 8-bit ADC; it produces an 8-bit number every time it converts. <S> It's an 8-bit device so it only approximates to the real analogue input fed to it. <S> Let's say it's input span is 0 to 2.55V - each lowest bit change is worth 10mV and 10mV is its resolution and accuracy (remember it's perfect in all other ways). <S> If you inputted 1.015V, it would produce a digital output the equivalent of 1.01V <S> i.e. there is an error of <S> 5mV. Now consider this situation: the ADC output is converted back to analogue by an 8-bit DAC and subtracted from the input voltage to produce an "error" voltage. <S> Consider also that the error voltage is integrated and now feeds into the ADC's input instead of the original input. <S> What now happens is the the output of the ADC will hunt above and below the precise value of the real input voltage. <S> Several consecutive ADC outputs can now be averaged (in the digital domain) to get a progressively more accurate picture of the real analogue signal. <S> Why not use a 4-bit ADC? <S> If 4-Bits is used, to achieve the same accuracy as the 8-bit ADC, more consecutive results need to be averaged to accomodate the chunkiness of 4-bits compared to 8-bits. <S> Take this to extremes - imagine a one-bit ADC - <S> basically it's a comparator - plenty of results need to be taken and averaged to reach the equivalent of an 8-bit ADC <S> but if the speed is high and the processing power is good then no problem. <S> The difficulty explaining this type of ADC is that if you "use" the the normal Delta-Sigma single-bit architecture, the digital numbers produced can befuddle the mind. <S> Anyway that's my take on things! <A> The key concept of a delta-sigma modulator — the heart of both A-D and D-A converters — is to produce a stream of digital words whose average value matches an input value. <S> In the most extreme — and most common — case, the digital words are single bits at high speed (128 or more times the bandwidth of the input signal). <S> In an ADC, the stream of bits is then digitally filtered to produce a slower stream of wider words, and in a DAC, the stream of bits is filtered in the analog domain to create an analog output signal. <S> The basic mechanism is a feedback loop, in which the average value of the past values of the output stream is compared to the current input value, and the result of this comparison is used to create the next output value. <S> Creating the average is basically a form of low-pass filter, and the nuances with regard to the design of delta-sigma converters relate primarily to the design of this filter. <S> This filter has the effect of keeping the noise introduced by the comparator (quantizer) separated from the desired signal in the frequnecy domain, a process referred to as "noise shaping". <S> This allows the output filter to remove the noise and keep the original signal intact. <A> The blocks should generally be designed so that if fed some sequence of inputs followed by a "1", they will output a higher value than if it were fed that same sequence followed by a "0". <S> In typical usage, the signal to be converted will be compared with the output the first delta-sigma blocks. <S> The output of that comparison will be fed into both blocks; the output of the second block will be filtered and then sent as the output of the converter. <S> In a delta-sigma ADC, the first delta-sigma block will operate on analog signals while the second will operate on multi-bit digital quantities. <S> In a delta-sigma DAC, the first block will operate on digital quantities while the second will act on analog signals. <S> Some analog isolation amplifiers use two analog delta-sigma blocks, designed so that the analog output of the second block will attempt to mirror the signal with which the first block is being compared. <S> Two major factors determine how well the output of the second block matches the reference input; the first factor is the accuracy of matching the two delta-sigma blocks. <S> The second factor is the degree to which the delta-sigma converters are able to conform to the input signal given that they only make a finite number of comparisons. <S> There are a variety of means via which manufacturers can attempt to tweak the delta-sigma blocks to yield optimal performance with various kinds of inputs; the essential thing to note is that the intermediate stream of data coming from the comparator doesn't represent the input value directly, but will cause a delta-sigma block receiving it to output something reasonably close to the input.
The heart of a typical delta-sigma converter is a pair of matched delta-sigma blocks will take one-bit input values and, for each value input, produce a continuous-scale output which is based upon that value and the previous values it has received.
How to learn dsPIC UART program based on PIC USART experience? I've learned USART of PIC16F883, and I want to learn UART of dsPIC33FJ64MC802.(Actually I need to learn dsPIC, but I learned PIC16F883 first since I thought it's easier to learn.) Here's my circuit diagram of PIC16F883 in Proteus simulator(I can send messages to virtual COM port): And here's the code: void main() { char ch; UART1_Init(19200); Delay_ms(100); while(1) { if(UART1_Tx_Idle()) UART1_Write_Text("OK2\r\n"); Delay_ms(500); }} I have found some resources teaching dsPIC UART, but I can hardly read the sample code. And I don't know how to what's the circuit of the sample code and how to learn. Can anyone provide some help? How can I learn dsPIC UART based on the what I've learned from PIC? 1. UART Example for DSPIC33 (DSPIC33FJ128GP802) 2. Setting up RS232 transmission on a dsPIC 3. dsPIC33F UART transmission problem 4. Thread: [dspic33] UART - Transmits ok, but receives garbage EDIT: An easy way to run dsPIC UART is using mikroC for dsPIC, it's very user friendly. It provides sample code and the code is easy to understand. <Q> You have unfortunately not learned much from your previous UART experience if that is all the code you have. <S> Here it seems like you have used a couple of libraries (i.e header files) which has implemented all the "tricky" stuff for you. <S> I would suggest that you take a look in your code and open up the UART1_Init() <S> function. <S> This is most likely included as uart.c and uart.h , where the .c-file is the actual implementation. <S> Here you will find how UART actually works, and when you have learned this you can move on to other controllers. <S> As a matter of fact, look in to all of your uart-functions and study them, finding out what every line means. <S> This is the most common way to learn code: To study code, understanding it and write your own. <A> This has lots of UART examples and explains how to use the XC16 library functions to control the UART. <S> I also suggest Microchip's Embedded Code Source site, as there are lots of samples available there. <A> If you really want to learn the UART, take a look at my canned UART code for PIC and dsPIC. <S> This should be included in the PIC Development Tools release at http://www.embedinc.com/pic/dload.htm . <S> Look for files with "uart" in their names in the SOURCE > PIC and SOURCE > <S> DSPIC directories within the software installation directory. <S> For example, source/pic/uart.ins.aspic implements a highly configurable low level interface to most 8 bit PIC UARTs. <S> You can specify whether it uses interrupts or polling, input and output FIFOs, etc. <S> The dsPIC counterpart will be source/dspic/uart.ins.aspic. <S> One nice thing about the dsPIC architecture is that each interrupt is individually vectored, so it is possible write a self-contained UART module that handles interrupts and all in the same file.
I suggest looking at the Microchip XC16 documentation that comes in the \docs folder of the installation, specifically 16-Bit_Language_Tools_Libraries_51456.pdf (for XC16 version 1.11).